-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(:black_circle:): remove circular dependency in request
AFFECTS PACKAGES: @esri/arcgis-rest-request
- Loading branch information
Showing
8 changed files
with
186 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 0 additions & 65 deletions
65
packages/arcgis-rest-request/src/utils/check-for-errors.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
|
||
/** | ||
* HTTP methods used by the ArcGIS REST API. | ||
*/ | ||
export type HTTPMethods = "GET" | "POST"; | ||
|
||
/** | ||
* Valid response formats for the `f` parameter. | ||
*/ | ||
export type ResponseFormats = | ||
| "json" | ||
| "geojson" | ||
| "text" | ||
| "html" | ||
| "image" | ||
| "zip"; | ||
|
||
export type GrantTypes = | ||
| "authorization_code" | ||
| "refresh_token" | ||
| "client_credentials" | ||
| "exchange_refresh_token"; | ||
|
||
export interface IParams { | ||
f?: ResponseFormats; | ||
[key: string]: any; | ||
} | ||
|
||
export interface IGenerateTokenParams extends IParams { | ||
username?: string; | ||
password?: string; | ||
expiration?: number; | ||
token?: string; | ||
serverUrl?: string; | ||
} | ||
|
||
export interface IFetchTokenParams extends IParams { | ||
client_id: string; | ||
client_secret?: string; | ||
grant_type: GrantTypes; | ||
redirect_uri?: string; | ||
refresh_token?: string; | ||
code?: string; | ||
} | ||
|
||
export interface ITokenRequestOptions { | ||
params?: IGenerateTokenParams | IFetchTokenParams; | ||
httpMethod?: HTTPMethods; | ||
fetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
} |
Oops, something went wrong.