@esri/arcgis-rest-request
Advanced tools
Comparing version 3.4.3 to 4.0.0-beta.2
@@ -1,22 +0,41 @@ | ||
export * from "./request"; | ||
export * from "./utils/append-custom-params"; | ||
export * from "./utils/ArcGISRequestError"; | ||
export * from "./utils/clean-url"; | ||
export * from "./utils/encode-form-data"; | ||
export * from "./utils/encode-query-string"; | ||
export * from "./utils/decode-query-string"; | ||
export * from "./utils/ErrorTypes"; | ||
export * from "./utils/GrantTypes"; | ||
export * from "./utils/HTTPMethods"; | ||
export * from "./utils/IAuthenticationManager"; | ||
export * from "./utils/IFetchTokenParams"; | ||
export * from "./utils/IGenerateTokenParams"; | ||
export * from "./utils/IParams"; | ||
export * from "./utils/IParamBuilder"; | ||
export * from "./utils/IParamsBuilder"; | ||
export * from "./utils/IRequestOptions"; | ||
export * from "./utils/ITokenRequestOptions"; | ||
export * from "./utils/process-params"; | ||
export * from "./utils/ResponseFormats"; | ||
export * from "./utils/retryAuthError"; | ||
export * from "./utils/warn"; | ||
export * from "./request.js"; | ||
export * from "./utils/append-custom-params.js"; | ||
export * from "./utils/ArcGISRequestError.js"; | ||
export * from "./utils/ArcGISAccessDeniedError.js"; | ||
export * from "./utils/clean-url.js"; | ||
export * from "./utils/encode-form-data.js"; | ||
export * from "./utils/encode-query-string.js"; | ||
export * from "./utils/decode-query-string.js"; | ||
export * from "./utils/ErrorTypes.js"; | ||
export * from "./utils/GrantTypes.js"; | ||
export * from "./utils/HTTPMethods.js"; | ||
export * from "./utils/IAuthenticationManager.js"; | ||
export * from "./utils/IFetchTokenParams.js"; | ||
export * from "./utils/IGenerateTokenParams.js"; | ||
export * from "./utils/IParams.js"; | ||
export * from "./utils/IParamBuilder.js"; | ||
export * from "./utils/IParamsBuilder.js"; | ||
export * from "./utils/IRequestOptions.js"; | ||
export * from "./utils/ITokenRequestOptions.js"; | ||
export * from "./utils/process-params.js"; | ||
export * from "./utils/ResponseFormats.js"; | ||
export * from "./utils/retryAuthError.js"; | ||
export * from "./utils/warn.js"; | ||
export * from "./ApplicationCredentialsManager.js"; | ||
export * from "./ApiKeyManager.js"; | ||
export * from "./ArcGISIdentityManager.js"; | ||
export * from "./fetch-token.js"; | ||
export * from "./generate-token.js"; | ||
export * from "./authenticated-request-options.js"; | ||
export * from "./app-tokens.js"; | ||
export * from "./validate-app-access.js"; | ||
export * from "./federation-utils.js"; | ||
export * from "./revoke-token.js"; | ||
export * from "./types/feature.js"; | ||
export * from "./types/geometry.js"; | ||
export * from "./types/symbol.js"; | ||
export * from "./types/service.js"; | ||
export * from "./types/group.js"; | ||
export * from "./types/user.js"; | ||
export * from "@esri/arcgis-rest-fetch"; | ||
export * from "@esri/arcgis-rest-form-data"; |
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
export * from "./request"; | ||
export * from "./utils/append-custom-params"; | ||
export * from "./utils/ArcGISRequestError"; | ||
export * from "./utils/clean-url"; | ||
export * from "./utils/encode-form-data"; | ||
export * from "./utils/encode-query-string"; | ||
export * from "./utils/decode-query-string"; | ||
export * from "./utils/ErrorTypes"; | ||
export * from "./utils/GrantTypes"; | ||
export * from "./utils/HTTPMethods"; | ||
export * from "./utils/IAuthenticationManager"; | ||
export * from "./utils/IFetchTokenParams"; | ||
export * from "./utils/IGenerateTokenParams"; | ||
export * from "./utils/IParams"; | ||
export * from "./utils/IParamBuilder"; | ||
export * from "./utils/IParamsBuilder"; | ||
export * from "./utils/IRequestOptions"; | ||
export * from "./utils/ITokenRequestOptions"; | ||
export * from "./utils/process-params"; | ||
export * from "./utils/ResponseFormats"; | ||
export * from "./utils/retryAuthError"; | ||
export * from "./utils/warn"; | ||
export * from "./request.js"; | ||
export * from "./utils/append-custom-params.js"; | ||
export * from "./utils/ArcGISRequestError.js"; | ||
export * from "./utils/ArcGISAccessDeniedError.js"; | ||
export * from "./utils/clean-url.js"; | ||
export * from "./utils/encode-form-data.js"; | ||
export * from "./utils/encode-query-string.js"; | ||
export * from "./utils/decode-query-string.js"; | ||
export * from "./utils/ErrorTypes.js"; | ||
export * from "./utils/GrantTypes.js"; | ||
export * from "./utils/HTTPMethods.js"; | ||
export * from "./utils/IAuthenticationManager.js"; | ||
export * from "./utils/IFetchTokenParams.js"; | ||
export * from "./utils/IGenerateTokenParams.js"; | ||
export * from "./utils/IParams.js"; | ||
export * from "./utils/IParamBuilder.js"; | ||
export * from "./utils/IParamsBuilder.js"; | ||
export * from "./utils/IRequestOptions.js"; | ||
export * from "./utils/ITokenRequestOptions.js"; | ||
export * from "./utils/process-params.js"; | ||
export * from "./utils/ResponseFormats.js"; | ||
export * from "./utils/retryAuthError.js"; | ||
export * from "./utils/warn.js"; | ||
export * from "./ApplicationCredentialsManager.js"; | ||
export * from "./ApiKeyManager.js"; | ||
export * from "./ArcGISIdentityManager.js"; | ||
export * from "./fetch-token.js"; | ||
export * from "./generate-token.js"; | ||
export * from "./authenticated-request-options.js"; | ||
export * from "./app-tokens.js"; | ||
export * from "./validate-app-access.js"; | ||
export * from "./federation-utils.js"; | ||
export * from "./revoke-token.js"; | ||
export * from "./types/feature.js"; | ||
export * from "./types/geometry.js"; | ||
export * from "./types/symbol.js"; | ||
export * from "./types/service.js"; | ||
export * from "./types/group.js"; | ||
export * from "./types/user.js"; | ||
export * from "@esri/arcgis-rest-fetch"; | ||
export * from "@esri/arcgis-rest-form-data"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,7 +0,6 @@ | ||
import { ArcGISRequestError } from "./utils/ArcGISRequestError"; | ||
import { IRequestOptions } from "./utils/IRequestOptions"; | ||
import { IParams } from "./utils/IParams"; | ||
import { IRetryAuthError } from "./utils/retryAuthError"; | ||
import { ArcGISRequestError } from "./utils/ArcGISRequestError.js"; | ||
import { IRequestOptions } from "./utils/IRequestOptions.js"; | ||
import { IParams } from "./utils/IParams.js"; | ||
import { IRetryAuthError } from "./utils/retryAuthError.js"; | ||
export declare const NODEJS_DEFAULT_REFERER_HEADER = "@esri/arcgis-rest-js"; | ||
declare let DEFAULT_ARCGIS_REQUEST_OPTIONS: IRequestOptions; | ||
/** | ||
@@ -14,3 +13,3 @@ * Sets the default options that will be passed in **all requests across all `@esri/arcgis-rest-js` modules**. | ||
* setDefaultRequestOptions({ | ||
* authentication: userSession // all requests will use this session by default | ||
* authentication: ArcGISIdentityManager // all requests will use this session by default | ||
* }) | ||
@@ -23,3 +22,4 @@ * ``` | ||
*/ | ||
export declare function setDefaultRequestOptions(options: typeof DEFAULT_ARCGIS_REQUEST_OPTIONS, hideWarnings?: boolean): void; | ||
export declare function setDefaultRequestOptions(options: IRequestOptions, hideWarnings?: boolean): void; | ||
export declare function getDefaultRequestOptions(): any; | ||
export declare class ArcGISAuthError extends ArcGISRequestError { | ||
@@ -71,2 +71,1 @@ /** | ||
export declare function request(url: string, requestOptions?: IRequestOptions): Promise<any>; | ||
export {}; |
/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
import { __assign, __extends } from "tslib"; | ||
import { encodeFormData } from "./utils/encode-form-data"; | ||
import { encodeQueryString } from "./utils/encode-query-string"; | ||
import { requiresFormData } from "./utils/process-params"; | ||
import { ArcGISRequestError } from "./utils/ArcGISRequestError"; | ||
import { warn } from "./utils/warn"; | ||
export var NODEJS_DEFAULT_REFERER_HEADER = "@esri/arcgis-rest-js"; | ||
var DEFAULT_ARCGIS_REQUEST_OPTIONS = { | ||
httpMethod: "POST", | ||
params: { | ||
f: "json", | ||
}, | ||
}; | ||
import { encodeFormData } from "./utils/encode-form-data.js"; | ||
import { encodeQueryString } from "./utils/encode-query-string.js"; | ||
import { requiresFormData } from "./utils/process-params.js"; | ||
import { ArcGISRequestError } from "./utils/ArcGISRequestError.js"; | ||
import { warn } from "./utils/warn.js"; | ||
import { getFetch } from "@esri/arcgis-rest-fetch"; | ||
export const NODEJS_DEFAULT_REFERER_HEADER = `@esri/arcgis-rest-js`; | ||
/** | ||
@@ -23,3 +17,3 @@ * Sets the default options that will be passed in **all requests across all `@esri/arcgis-rest-js` modules**. | ||
* setDefaultRequestOptions({ | ||
* authentication: userSession // all requests will use this session by default | ||
* authentication: ArcGISIdentityManager // all requests will use this session by default | ||
* }) | ||
@@ -36,6 +30,13 @@ * ``` | ||
} | ||
DEFAULT_ARCGIS_REQUEST_OPTIONS = options; | ||
globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS = options; | ||
} | ||
var ArcGISAuthError = /** @class */ (function (_super) { | ||
__extends(ArcGISAuthError, _super); | ||
export function getDefaultRequestOptions() { | ||
return (globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS || { | ||
httpMethod: "POST", | ||
params: { | ||
f: "json" | ||
} | ||
}); | ||
} | ||
export class ArcGISAuthError extends ArcGISRequestError { | ||
/** | ||
@@ -50,26 +51,21 @@ * Create a new `ArcGISAuthError` object. | ||
*/ | ||
function ArcGISAuthError(message, code, response, url, options) { | ||
if (message === void 0) { message = "AUTHENTICATION_ERROR"; } | ||
if (code === void 0) { code = "AUTHENTICATION_ERROR_CODE"; } | ||
var _this = _super.call(this, message, code, response, url, options) || this; | ||
_this.name = "ArcGISAuthError"; | ||
_this.message = | ||
code === "AUTHENTICATION_ERROR_CODE" ? message : code + ": " + message; | ||
return _this; | ||
constructor(message = "AUTHENTICATION_ERROR", code = "AUTHENTICATION_ERROR_CODE", response, url, options) { | ||
super(message, code, response, url, options); | ||
this.name = "ArcGISAuthError"; | ||
this.message = | ||
code === "AUTHENTICATION_ERROR_CODE" ? message : `${code}: ${message}`; | ||
} | ||
ArcGISAuthError.prototype.retry = function (getSession, retryLimit) { | ||
var _this = this; | ||
if (retryLimit === void 0) { retryLimit = 3; } | ||
var tries = 0; | ||
var retryRequest = function (resolve, reject) { | ||
getSession(_this.url, _this.options) | ||
.then(function (session) { | ||
var newOptions = __assign(__assign({}, _this.options), { authentication: session }); | ||
retry(getSession, retryLimit = 3) { | ||
let tries = 0; | ||
const retryRequest = (resolve, reject) => { | ||
getSession(this.url, this.options) | ||
.then((session) => { | ||
const newOptions = Object.assign(Object.assign({}, this.options), { authentication: session }); | ||
tries = tries + 1; | ||
return request(_this.url, newOptions); | ||
return request(this.url, newOptions); | ||
}) | ||
.then(function (response) { | ||
.then((response) => { | ||
resolve(response); | ||
}) | ||
.catch(function (e) { | ||
.catch((e) => { | ||
if (e.name === "ArcGISAuthError" && tries < retryLimit) { | ||
@@ -79,3 +75,3 @@ retryRequest(resolve, reject); | ||
else if (e.name === "ArcGISAuthError" && tries >= retryLimit) { | ||
reject(_this); | ||
reject(this); | ||
} | ||
@@ -87,9 +83,7 @@ else { | ||
}; | ||
return new Promise(function (resolve, reject) { | ||
return new Promise((resolve, reject) => { | ||
retryRequest(resolve, reject); | ||
}); | ||
}; | ||
return ArcGISAuthError; | ||
}(ArcGISRequestError)); | ||
export { ArcGISAuthError }; | ||
} | ||
} | ||
/** | ||
@@ -107,3 +101,3 @@ * Checks for errors in a JSON response from the ArcGIS REST API. If there are no errors, it will return the `data` passed in. If there is an error, it will throw an `ArcGISRequestError` or `ArcGISAuthError`. | ||
if (response.code >= 400) { | ||
var message = response.message, code = response.code; | ||
const { message, code } = response; | ||
throw new ArcGISRequestError(message, code, response, url, options); | ||
@@ -113,4 +107,4 @@ } | ||
if (response.error) { | ||
var _a = response.error, message = _a.message, code = _a.code, messageCode = _a.messageCode; | ||
var errorCode = messageCode || code || "UNKNOWN_ERROR_CODE"; | ||
const { message, code, messageCode } = response.error; | ||
const errorCode = messageCode || code || "UNKNOWN_ERROR_CODE"; | ||
if (code === 498 || | ||
@@ -131,4 +125,4 @@ code === 499 || | ||
if (response.status === "failed" || response.status === "failure") { | ||
var message = void 0; | ||
var code = "UNKNOWN_ERROR_CODE"; | ||
let message; | ||
let code = "UNKNOWN_ERROR_CODE"; | ||
try { | ||
@@ -167,39 +161,16 @@ message = JSON.parse(response.statusMessage).message; | ||
*/ | ||
export function request(url, requestOptions) { | ||
if (requestOptions === void 0) { requestOptions = { params: { f: "json" } }; } | ||
var options = __assign(__assign(__assign({ httpMethod: "POST" }, DEFAULT_ARCGIS_REQUEST_OPTIONS), requestOptions), { | ||
params: __assign(__assign({}, DEFAULT_ARCGIS_REQUEST_OPTIONS.params), requestOptions.params), | ||
headers: __assign(__assign({}, DEFAULT_ARCGIS_REQUEST_OPTIONS.headers), requestOptions.headers), | ||
export function request(url, requestOptions = { params: { f: "json" } }) { | ||
const defaults = getDefaultRequestOptions(); | ||
const options = Object.assign(Object.assign(Object.assign({ httpMethod: "POST" }, defaults), requestOptions), { | ||
params: Object.assign(Object.assign({}, defaults.params), requestOptions.params), | ||
headers: Object.assign(Object.assign({}, defaults.headers), requestOptions.headers) | ||
}); | ||
var missingGlobals = []; | ||
var recommendedPackages = []; | ||
// don't check for a global fetch if a custom implementation was passed through | ||
if (!options.fetch && typeof fetch !== "undefined") { | ||
options.fetch = fetch.bind(Function("return this")()); | ||
} | ||
else { | ||
missingGlobals.push("`fetch`"); | ||
recommendedPackages.push("`node-fetch`"); | ||
} | ||
if (typeof Promise === "undefined") { | ||
missingGlobals.push("`Promise`"); | ||
recommendedPackages.push("`es6-promise`"); | ||
} | ||
if (typeof FormData === "undefined") { | ||
missingGlobals.push("`FormData`"); | ||
recommendedPackages.push("`isomorphic-form-data`"); | ||
} | ||
if (!options.fetch || | ||
typeof Promise === "undefined" || | ||
typeof FormData === "undefined") { | ||
throw new Error("`arcgis-rest-request` requires a `fetch` implementation and global variables for `Promise` and `FormData` to be present in the global scope. You are missing " + missingGlobals.join(", ") + ". We recommend installing the " + recommendedPackages.join(", ") + " modules at the root of your application to add these to the global scope. See https://bit.ly/2KNwWaJ for more info."); | ||
} | ||
var httpMethod = options.httpMethod, authentication = options.authentication, rawResponse = options.rawResponse; | ||
var params = __assign({ f: "json" }, options.params); | ||
var originalAuthError = null; | ||
var fetchOptions = { | ||
const { httpMethod, rawResponse } = options; | ||
const params = Object.assign({ f: "json" }, options.params); | ||
let originalAuthError = null; | ||
const fetchOptions = { | ||
method: httpMethod, | ||
/* ensures behavior mimics XMLHttpRequest. | ||
needed to support sending IWA cookies */ | ||
credentials: options.credentials || "same-origin", | ||
credentials: options.credentials || "same-origin" | ||
}; | ||
@@ -214,4 +185,27 @@ // the /oauth2/platformSelf route will add X-Esri-Auth-Client-Id header | ||
} | ||
let authentication; | ||
// Check to see if this is a raw token as a string and create a IAuthenticationManager like object for it. | ||
// Otherwise this just assumes that options.authentication is an IAuthenticationManager. | ||
if (typeof options.authentication === "string") { | ||
const rawToken = options.authentication; | ||
authentication = { | ||
portal: "https://www.arcgis.com/sharing/rest", | ||
getToken: () => { | ||
return Promise.resolve(rawToken); | ||
} | ||
}; | ||
/* istanbul ignore else - we don't need to test NOT warning people */ | ||
if (!options.authentication.startsWith("AAPK") && // doesn't look like an API Key | ||
!options.suppressWarnings && // user doesn't want to suppress warnings for this request | ||
!globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING // we havn't shown the user this warning yet | ||
) { | ||
warn(`Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information.`); | ||
globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING = true; | ||
} | ||
} | ||
else { | ||
authentication = options.authentication; | ||
} | ||
return (authentication | ||
? authentication.getToken(url, { fetch: options.fetch }).catch(function (err) { | ||
? authentication.getToken(url).catch((err) => { | ||
/** | ||
@@ -233,3 +227,3 @@ * append original request url and requestOptions | ||
: Promise.resolve("")) | ||
.then(function (token) { | ||
.then((token) => { | ||
if (token.length) { | ||
@@ -242,3 +236,3 @@ params.token = token; | ||
// Custom headers to add to request. IRequestOptions.headers with merge over requestHeaders. | ||
var requestHeaders = {}; | ||
const requestHeaders = {}; | ||
if (fetchOptions.method === "GET") { | ||
@@ -251,9 +245,9 @@ // Prevents token from being passed in query params when hideToken option is used. | ||
typeof window === "undefined") { | ||
requestHeaders["X-Esri-Authorization"] = "Bearer " + params.token; | ||
requestHeaders["X-Esri-Authorization"] = `Bearer ${params.token}`; | ||
delete params.token; | ||
} | ||
// encode the parameters into the query string | ||
var queryParams = encodeQueryString(params); | ||
const queryParams = encodeQueryString(params); | ||
// dont append a '?' unless parameters are actually present | ||
var urlWithQueryString = queryParams === "" ? url : url + "?" + encodeQueryString(params); | ||
const urlWithQueryString = queryParams === "" ? url : url + "?" + encodeQueryString(params); | ||
if ( | ||
@@ -283,3 +277,3 @@ // This would exceed the maximum length for URLs specified by the consumer and requires POST | ||
see https://github.com/Esri/arcgis-rest-js/pull/500 for more info. */ | ||
var forceFormData = new RegExp("/items/.+/updateResources").test(url); | ||
const forceFormData = new RegExp("/items/.+/updateResources").test(url); | ||
if (fetchOptions.method === "POST") { | ||
@@ -289,3 +283,3 @@ fetchOptions.body = encodeFormData(params, forceFormData); | ||
// Mixin headers from request options | ||
fetchOptions.headers = __assign(__assign({}, requestHeaders), options.headers); | ||
fetchOptions.headers = Object.assign(Object.assign({}, requestHeaders), options.headers); | ||
/* istanbul ignore next - karma reports coverage on browser tests only */ | ||
@@ -300,9 +294,18 @@ if (typeof window === "undefined" && !fetchOptions.headers.referer) { | ||
} | ||
return options.fetch(url, fetchOptions); | ||
/** | ||
* Check for a global fetch first and use it if available. This allows us to use the default | ||
* configuration of fetch-mock in tests. | ||
*/ | ||
/* istanbul ignore next coverage is based on browser code and we don't test for the absence of global fetch so we can skip the else here. */ | ||
return globalThis.fetch | ||
? globalThis.fetch(url, fetchOptions) | ||
: getFetch().then(({ fetch }) => { | ||
return fetch(url, fetchOptions); | ||
}); | ||
}) | ||
.then(function (response) { | ||
.then((response) => { | ||
if (!response.ok) { | ||
// server responded w/ an actual error (404, 500, etc) | ||
var status_1 = response.status, statusText = response.statusText; | ||
throw new ArcGISRequestError(statusText, "HTTP " + status_1, response, url, options); | ||
const { status, statusText } = response; | ||
throw new ArcGISRequestError(statusText, `HTTP ${status}`, response, url, options); | ||
} | ||
@@ -326,5 +329,5 @@ if (rawResponse) { | ||
}) | ||
.then(function (data) { | ||
.then((data) => { | ||
if ((params.f === "json" || params.f === "geojson") && !rawResponse) { | ||
var response = checkForErrors(data, url, params, options, originalAuthError); | ||
const response = checkForErrors(data, url, params, options, originalAuthError); | ||
if (originalAuthError) { | ||
@@ -335,3 +338,3 @@ /* If the request was made to an unfederated service that | ||
in the event of a repeat request */ | ||
var truncatedUrl = url | ||
const truncatedUrl = url | ||
.toLowerCase() | ||
@@ -342,3 +345,3 @@ .split(/\/rest(\/admin)?\/services\//)[0]; | ||
// default to 24 hours | ||
expires: new Date(Date.now() + 86400 * 1000), | ||
expires: new Date(Date.now() + 86400 * 1000) | ||
}; | ||
@@ -345,0 +348,0 @@ originalAuthError = null; |
@@ -1,2 +0,2 @@ | ||
import { IRequestOptions } from "./IRequestOptions"; | ||
import { IRequestOptions } from "./IRequestOptions.js"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Helper for methods with lots of first order request options to pass through as request parameters. |
/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
import { __assign } from "tslib"; | ||
/** | ||
@@ -8,3 +7,3 @@ * Helper for methods with lots of first order request options to pass through as request parameters. | ||
export function appendCustomParams(customOptions, keys, baseOptions) { | ||
var requestOptionsKeys = [ | ||
const requestOptionsKeys = [ | ||
"params", | ||
@@ -17,7 +16,7 @@ "httpMethod", | ||
"maxUrlLength", | ||
"headers" | ||
"headers", | ||
]; | ||
var options = __assign(__assign({ params: {} }, baseOptions), customOptions); | ||
const options = Object.assign(Object.assign({ params: {} }, baseOptions), customOptions); | ||
// merge all keys in customOptions into options.params | ||
options.params = keys.reduce(function (value, key) { | ||
options.params = keys.reduce((value, key) => { | ||
if (customOptions[key] || typeof customOptions[key] === "boolean") { | ||
@@ -29,3 +28,3 @@ value[key] = customOptions[key]; | ||
// now remove all properties in options that don't exist in IRequestOptions | ||
return requestOptionsKeys.reduce(function (value, key) { | ||
return requestOptionsKeys.reduce((value, key) => { | ||
if (options[key]) { | ||
@@ -32,0 +31,0 @@ value[key] = options[key]; |
@@ -1,3 +0,3 @@ | ||
import { IRequestOptions } from "./IRequestOptions"; | ||
export declare class ArcGISRequestError { | ||
import { IRequestOptions } from "./IRequestOptions.js"; | ||
export declare class ArcGISRequestError extends Error { | ||
/** | ||
@@ -4,0 +4,0 @@ * The name of this error. Will always be `"ArcGISRequestError"` to conform with the [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) class. |
@@ -7,3 +7,3 @@ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
// This code is from MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types. | ||
var ArcGISRequestError = /** @class */ (function () { | ||
export class ArcGISRequestError extends Error { | ||
/** | ||
@@ -18,3 +18,9 @@ * Create a new `ArcGISRequestError` object. | ||
*/ | ||
function ArcGISRequestError(message, code, response, url, options) { | ||
constructor(message, code, response, url, options) { | ||
// 'Error' breaks prototype chain here | ||
super(message); | ||
// restore prototype chain, see https://stackoverflow.com/questions/41102060/typescript-extending-error-class | ||
// we don't need to check for Object.setPrototypeOf as in the answers becasue we are ES2017 now | ||
const actualProto = new.target.prototype; | ||
Object.setPrototypeOf(this, actualProto); | ||
message = message || "UNKNOWN_ERROR"; | ||
@@ -24,3 +30,3 @@ code = code || "UNKNOWN_ERROR_CODE"; | ||
this.message = | ||
code === "UNKNOWN_ERROR_CODE" ? message : code + ": " + message; | ||
code === "UNKNOWN_ERROR_CODE" ? message : `${code}: ${message}`; | ||
this.originalMessage = message; | ||
@@ -32,7 +38,3 @@ this.code = code; | ||
} | ||
return ArcGISRequestError; | ||
}()); | ||
export { ArcGISRequestError }; | ||
ArcGISRequestError.prototype = Object.create(Error.prototype); | ||
ArcGISRequestError.prototype.constructor = ArcGISRequestError; | ||
} | ||
//# sourceMappingURL=ArcGISRequestError.js.map |
@@ -11,4 +11,4 @@ export declare function decodeParam(param: string): { | ||
*/ | ||
export declare function decodeQueryString(query: string): { | ||
export declare function decodeQueryString(query?: string): { | ||
[key: string]: string; | ||
}; |
/* Copyright (c) 2017-2020 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
export function decodeParam(param) { | ||
var _a = param.split("="), key = _a[0], value = _a[1]; | ||
const [key, value] = param.split("="); | ||
return { key: decodeURIComponent(key), value: decodeURIComponent(value) }; | ||
@@ -14,7 +14,11 @@ } | ||
export function decodeQueryString(query) { | ||
if (!query || query.length <= 0) { | ||
return {}; | ||
} | ||
return query | ||
.replace(/^#/, "") | ||
.replace(/^\?/, "") | ||
.split("&") | ||
.reduce(function (acc, entry) { | ||
var _a = decodeParam(entry), key = _a.key, value = _a.value; | ||
.reduce((acc, entry) => { | ||
const { key, value } = decodeParam(entry); | ||
acc[key] = value; | ||
@@ -21,0 +25,0 @@ return acc; |
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
import { processParams, requiresFormData } from "./process-params"; | ||
import { encodeQueryString } from "./encode-query-string"; | ||
import { processParams, requiresFormData } from "./process-params.js"; | ||
import { encodeQueryString } from "./encode-query-string.js"; | ||
import { FormData } from "@esri/arcgis-rest-form-data"; | ||
/** | ||
@@ -13,7 +14,7 @@ * Encodes parameters in a [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) object in browsers or in a [FormData](https://github.com/form-data/form-data) in Node.js | ||
// see https://github.com/Esri/arcgis-rest-js/issues/499 for more info. | ||
var useFormData = requiresFormData(params) || forceFormData; | ||
var newParams = processParams(params); | ||
const useFormData = requiresFormData(params) || forceFormData; | ||
const newParams = processParams(params); | ||
if (useFormData) { | ||
var formData_1 = new FormData(); | ||
Object.keys(newParams).forEach(function (key) { | ||
const formData = new FormData(); | ||
Object.keys(newParams).forEach((key) => { | ||
if (typeof Blob !== "undefined" && newParams[key] instanceof Blob) { | ||
@@ -25,10 +26,10 @@ /* To name the Blob: | ||
*/ | ||
var filename = newParams["fileName"] || newParams[key].name || key; | ||
formData_1.append(key, newParams[key], filename); | ||
const filename = newParams["fileName"] || newParams[key].name || key; | ||
formData.append(key, newParams[key], filename); | ||
} | ||
else { | ||
formData_1.append(key, newParams[key]); | ||
formData.append(key, newParams[key]); | ||
} | ||
}); | ||
return formData_1; | ||
return formData; | ||
} | ||
@@ -35,0 +36,0 @@ else { |
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
import { processParams } from "./process-params"; | ||
import { processParams } from "./process-params.js"; | ||
/** | ||
@@ -14,3 +14,5 @@ * Encodes keys and parameters for use in a URL's query string. | ||
if (Array.isArray(value) && value[0] && Array.isArray(value[0])) { | ||
return value.map(function (arrayElem) { return encodeParam(key, arrayElem); }).join("&"); | ||
return value | ||
.map((arrayElem) => encodeParam(key, arrayElem)) | ||
.join("&"); | ||
} | ||
@@ -26,5 +28,5 @@ return encodeURIComponent(key) + "=" + encodeURIComponent(value); | ||
export function encodeQueryString(params) { | ||
var newParams = processParams(params); | ||
const newParams = processParams(params); | ||
return Object.keys(newParams) | ||
.map(function (key) { | ||
.map((key) => { | ||
return encodeParam(key, newParams[key]); | ||
@@ -31,0 +33,0 @@ }) |
@@ -17,2 +17,6 @@ /** | ||
* | ||
* case ErrorType.ArcGISAccessDeniedError: | ||
* // handle a user denying an authorization request in an oAuth workflow | ||
* break; | ||
* | ||
* default: | ||
@@ -26,3 +30,4 @@ * // handle some other error (usually a network error) | ||
ArcGISRequestError = "ArcGISRequestError", | ||
ArcGISAuthError = "ArcGISAuthError" | ||
ArcGISAuthError = "ArcGISAuthError", | ||
ArcGISAccessDeniedError = "ArcGISAccessDeniedError" | ||
} |
@@ -19,2 +19,6 @@ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
* | ||
* case ErrorType.ArcGISAccessDeniedError: | ||
* // handle a user denying an authorization request in an oAuth workflow | ||
* break; | ||
* | ||
* default: | ||
@@ -30,3 +34,4 @@ * // handle some other error (usually a network error) | ||
ErrorTypes["ArcGISAuthError"] = "ArcGISAuthError"; | ||
ErrorTypes["ArcGISAccessDeniedError"] = "ArcGISAccessDeniedError"; | ||
})(ErrorTypes || (ErrorTypes = {})); | ||
//# sourceMappingURL=ErrorTypes.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=GrantTypes.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=HTTPMethods.js.map |
@@ -1,6 +0,6 @@ | ||
import { ITokenRequestOptions } from "./ITokenRequestOptions"; | ||
import { ITokenRequestOptions } from "./ITokenRequestOptions.js"; | ||
/** | ||
* Authentication can be supplied to `request` via [`UserSession`](../../auth/UserSession/) or [`ApplicationSession`](../../auth/ApplicationSession/). Both classes extend `IAuthenticationManager`. | ||
* Authentication can be supplied to `request` via [`ArcGISIdentityManager`](../../auth/ArcGISIdentityManager/) or [`ApplicationSession`](../../auth/ApplicationSession/). Both classes extend `IAuthenticationManager`. | ||
* ```js | ||
* const session = new UserSession({ | ||
* const session = new ArcGISIdentityManager({ | ||
* username: "jsmith", | ||
@@ -7,0 +7,0 @@ * password: "123456", |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IAuthenticationManager.js.map |
@@ -1,3 +0,3 @@ | ||
import { GrantTypes } from "./GrantTypes"; | ||
import { IParams } from "./IParams"; | ||
import { GrantTypes } from "./GrantTypes.js"; | ||
import { IParams } from "./IParams.js"; | ||
export interface IFetchTokenParams extends IParams { | ||
@@ -10,2 +10,3 @@ client_id: string; | ||
code?: string; | ||
code_verifier?: string; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IFetchTokenParams.js.map |
@@ -1,2 +0,2 @@ | ||
import { IParams } from "./IParams"; | ||
import { IParams } from "./IParams.js"; | ||
export interface IGenerateTokenParams extends IParams { | ||
@@ -3,0 +3,0 @@ username?: string; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IGenerateTokenParams.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IParamBuilder.js.map |
@@ -1,2 +0,2 @@ | ||
import { ResponseFormats } from "./ResponseFormats"; | ||
import { ResponseFormats } from "./ResponseFormats.js"; | ||
export interface IParams { | ||
@@ -3,0 +3,0 @@ f?: ResponseFormats; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IParams.js.map |
@@ -1,4 +0,4 @@ | ||
import { IParams } from "./IParams"; | ||
import { IParams } from "./IParams.js"; | ||
export interface IParamsBuilder { | ||
toParams(additionalParams?: IParams): IParams; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IParamsBuilder.js.map |
@@ -1,4 +0,4 @@ | ||
import { HTTPMethods } from "./HTTPMethods"; | ||
import { IParams } from "./IParams"; | ||
import { IAuthenticationManager } from "./IAuthenticationManager"; | ||
import { HTTPMethods } from "./HTTPMethods.js"; | ||
import { IParams } from "./IParams.js"; | ||
import { IAuthenticationManager } from "./IAuthenticationManager.js"; | ||
/** | ||
@@ -21,5 +21,5 @@ * Options for the `request()` method. | ||
/** | ||
* The instance of `IAuthenticationManager` to use to authenticate this request. | ||
* The instance of {@linkcode ApiKey}, {@linkcode ArcGISIdentityManager} or {@linkcode ApplicationSession} to use to authenticate this request. A token may also be passed directly as a string however using the built in authentication managers is encouraged. | ||
*/ | ||
authentication?: IAuthenticationManager; | ||
authentication?: IAuthenticationManager | string; | ||
/** | ||
@@ -39,3 +39,2 @@ * Prevents the token from being passed in a URL Query param that is saved in browser history. | ||
*/ | ||
fetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
/** | ||
@@ -55,2 +54,6 @@ * A string indicating whether credentials (cookies) will be sent with the request. Used internally for authentication workflows. | ||
}; | ||
/** | ||
* Suppress any ArcGIS REST JS related warnings for this request. | ||
*/ | ||
suppressWarnings?: boolean; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=IRequestOptions.js.map |
@@ -1,4 +0,4 @@ | ||
import { HTTPMethods } from "./HTTPMethods"; | ||
import { IGenerateTokenParams } from "./IGenerateTokenParams"; | ||
import { IFetchTokenParams } from "./IFetchTokenParams"; | ||
import { HTTPMethods } from "./HTTPMethods.js"; | ||
import { IGenerateTokenParams } from "./IGenerateTokenParams.js"; | ||
import { IFetchTokenParams } from "./IFetchTokenParams.js"; | ||
export interface ITokenRequestOptions { | ||
@@ -5,0 +5,0 @@ params?: IGenerateTokenParams | IFetchTokenParams; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=ITokenRequestOptions.js.map |
@@ -9,4 +9,4 @@ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
export function requiresFormData(params) { | ||
return Object.keys(params).some(function (key) { | ||
var value = params[key]; | ||
return Object.keys(params).some(key => { | ||
let value = params[key]; | ||
if (!value) { | ||
@@ -18,3 +18,3 @@ return false; | ||
} | ||
var type = value.constructor.name; | ||
const type = value.constructor.name; | ||
switch (type) { | ||
@@ -46,6 +46,6 @@ case "Array": | ||
export function processParams(params) { | ||
var newParams = {}; | ||
Object.keys(params).forEach(function (key) { | ||
const newParams = {}; | ||
Object.keys(params).forEach(key => { | ||
var _a, _b; | ||
var param = params[key]; | ||
let param = params[key]; | ||
if (param && param.toParam) { | ||
@@ -60,4 +60,4 @@ param = param.toParam(); | ||
} | ||
var type = param.constructor.name; | ||
var value; | ||
const type = param.constructor.name; | ||
let value; | ||
// properly encodes objects, arrays and dates for arcgis.com and other services. | ||
@@ -72,3 +72,3 @@ // ported from https://github.com/Esri/esri-leaflet/blob/master/src/Request.js#L22-L30 | ||
// eslint-disable-next-line no-case-declarations | ||
var firstElementType = (_b = (_a = param[0]) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name; | ||
const firstElementType = (_b = (_a = param[0]) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name; | ||
value = | ||
@@ -75,0 +75,0 @@ firstElementType === "Array" ? param : // pass thru array of arrays |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=ResponseFormats.js.map |
@@ -1,3 +0,3 @@ | ||
import { IRequestOptions } from "./IRequestOptions"; | ||
import { IAuthenticationManager } from "./IAuthenticationManager"; | ||
import { IRequestOptions } from "./IRequestOptions.js"; | ||
import { IAuthenticationManager } from "./IAuthenticationManager.js"; | ||
export declare type IRetryAuthError = (url: string, options: IRequestOptions) => Promise<IAuthenticationManager>; |
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
export {}; | ||
//# sourceMappingURL=retryAuthError.js.map |
@@ -1,2 +0,2 @@ | ||
import { IRequestOptions } from "../utils/IRequestOptions"; | ||
import { IRequestOptions } from "../utils/IRequestOptions.js"; | ||
/** | ||
@@ -7,3 +7,3 @@ * Allows you to wrap individual methods with a default set of request options. This is useful to avoid setting the same option more then once and allows for interacting and setting defaults in a functional manner. | ||
* import { withOptions } from "@esri/arcgis-rest-request"; | ||
* import { queryFeatures } from '@esri/arcgis-rest-feature-layer'; | ||
* import { queryFeatures } from '@esri/arcgis-rest-feature-service'; | ||
* | ||
@@ -18,3 +18,3 @@ * const queryTrails = withOptions({ | ||
* const queryTrailsAsUser = withOptions({ | ||
* authentication: userSession | ||
* authentication: ArcGISIdentityManager | ||
* }, queryTrails); | ||
@@ -21,0 +21,0 @@ * |
@@ -1,2 +0,1 @@ | ||
import { __assign, __spreadArrays } from "tslib"; | ||
/** | ||
@@ -7,3 +6,3 @@ * Allows you to wrap individual methods with a default set of request options. This is useful to avoid setting the same option more then once and allows for interacting and setting defaults in a functional manner. | ||
* import { withOptions } from "@esri/arcgis-rest-request"; | ||
* import { queryFeatures } from '@esri/arcgis-rest-feature-layer'; | ||
* import { queryFeatures } from '@esri/arcgis-rest-feature-service'; | ||
* | ||
@@ -18,3 +17,3 @@ * const queryTrails = withOptions({ | ||
* const queryTrailsAsUser = withOptions({ | ||
* authentication: userSession | ||
* authentication: ArcGISIdentityManager | ||
* }, queryTrails); | ||
@@ -32,12 +31,8 @@ * | ||
export function withOptions(defaultOptions, func) { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var options = typeof args[args.length - 1] === "object" | ||
? __assign(__assign({}, defaultOptions), args.pop()) : defaultOptions; | ||
return func.apply(void 0, __spreadArrays(args, [options])); | ||
return (...args) => { | ||
const options = typeof args[args.length - 1] === "object" | ||
? Object.assign(Object.assign({}, defaultOptions), args.pop()) : defaultOptions; | ||
return func(...[...args, options]); | ||
}; | ||
} | ||
//# sourceMappingURL=with-options.js.map |
{ | ||
"name": "@esri/arcgis-rest-request", | ||
"version": "3.4.3", | ||
"version": "4.0.0-beta.2", | ||
"description": "Common methods and utilities for @esri/arcgis-rest-js packages.", | ||
"main": "dist/node/index.js", | ||
"unpkg": "dist/umd/request.umd.js", | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
"ES6", | ||
"arcgis", | ||
"esri", | ||
"fetch", | ||
"promise", | ||
"typescript" | ||
], | ||
"type": "module", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"js:next": "dist/esm/index.js", | ||
"unpkg": "dist/bundled/request.umd.min.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"types": "dist/esm/index.d.ts", | ||
"sideEffects": false, | ||
"types": "dist/esm/index.d.ts", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"tslib": "^1.10.0" | ||
}, | ||
"files": [ | ||
@@ -19,14 +31,24 @@ "dist/**" | ||
"scripts": { | ||
"prepare": "npm run build", | ||
"build": "npm run build:node && npm run build:umd && npm run build:esm", | ||
"build:esm": "tsc --module es2015 --outDir ./dist/esm --declaration", | ||
"build:umd": "rollup -c ../../umd-base-profile.js && rollup -c ../../umd-production-profile.js", | ||
"build:node": "tsc --module commonjs --outDir ./dist/node", | ||
"dev:esm": "tsc -w --module es2015 --outDir ./dist/esm --declaration", | ||
"dev:umd": "rollup -w -c ../../umd-base-profile.js", | ||
"dev:node": "tsc -w --module commonjs --outDir ./dist/node" | ||
"build": "npm-run-all --parallel build:*", | ||
"postbuild": "node ../../scripts/create-dist-package-jsons.js", | ||
"build:bundled": "rollup -c ../../rollup.js", | ||
"build:cjs": "tsc --outDir ./dist/cjs -m commonjs", | ||
"build:esm": "tsc --outDir ./dist/esm --declaration", | ||
"dev": "npm-run-all --parallel dev:*", | ||
"dev:bundled": "rollup -w -c ../../rollup.js", | ||
"dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs", | ||
"dev:esm": "tsc -w --outDir ./dist/esm --declaration" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
"engines": { | ||
"node": ">=12.20.0" | ||
}, | ||
"dependencies": { | ||
"@esri/arcgis-rest-fetch": "4.0.0-beta.1", | ||
"@esri/arcgis-rest-form-data": "4.0.0-beta.1", | ||
"tslib": "^2.3.1" | ||
}, | ||
"contributors": [ | ||
"Patrick Arlt <parlt@esri.com> (http://patrickarlt.com/)" | ||
], | ||
"homepage": "https://github.com/Esri/arcgis-rest-js#readme", | ||
"repository": { | ||
@@ -37,21 +59,8 @@ "type": "git", | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Patrick Arlt", | ||
"email": "parlt@esri.com", | ||
"url": "http://patrickarlt.com/" | ||
} | ||
], | ||
"bugs": { | ||
"url": "https://github.com/Esri/arcgis-rest-js/issues" | ||
}, | ||
"homepage": "https://github.com/Esri/arcgis-rest-js#readme", | ||
"keywords": [ | ||
"typescript", | ||
"promise", | ||
"fetch", | ||
"arcgis", | ||
"esri", | ||
"ES6" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"esri": { | ||
@@ -58,0 +67,0 @@ "keyExports": [ |
@@ -11,3 +11,3 @@ [![npm version][npm-img]][npm-url] | ||
[travis-url]: https://travis-ci.org/Esri/arcgis-rest-js | ||
[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/arcgis-rest-request/dist/umd/request.umd.min.js?compression=gzip | ||
[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/arcgis-rest-request/dist/bundled/request.umd.min.js?compression=gzip | ||
[coverage-img]: https://codecov.io/gh/Esri/arcgis-rest-js/branch/master/graph/badge.svg | ||
@@ -27,10 +27,10 @@ [coverage-url]: https://codecov.io/gh/Esri/arcgis-rest-js | ||
```js | ||
import { request } from '@esri/arcgis-rest-request'; | ||
import { request } from "@esri/arcgis-rest-request"; | ||
const url = "https://www.arcgis.com/sharing/rest/content/items/6e03e8c26aad4b9c92a87c1063ddb0e3/data"; | ||
const url = | ||
"https://www.arcgis.com/sharing/rest/content/items/6e03e8c26aad4b9c92a87c1063ddb0e3/data"; | ||
request(url) | ||
.then(response => { | ||
console.log(response) // WebMap JSON | ||
}); | ||
request(url).then((response) => { | ||
console.log(response); // WebMap JSON | ||
}); | ||
``` | ||
@@ -42,3 +42,3 @@ | ||
If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [**love**](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you. | ||
If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [**love**](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you. | ||
@@ -75,2 +75,2 @@ If you're looking for help you can also post issues on [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-oss). | ||
A copy of the license is available in the repository's [LICENSE](../../LICENSE) file. | ||
A copy of the license is available in the repository's [LICENSE](../../LICENSE) file. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
1449195
230
10773
73
5
Yes
3
1
+ Added@esri/arcgis-rest-fetch@4.0.0-beta.1(transitive)
+ Added@esri/arcgis-rest-form-data@4.0.0-beta.1(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-node@4.4.1(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedweb-streams-polyfill@3.3.34.0.0-beta.3(transitive)
- Removedtslib@1.14.1(transitive)
Updatedtslib@^2.3.1