@fern-api/venus-api-sdk 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +23 -0
- package/Client.js +28 -0
- package/api/index.js +17 -0
- package/api/resources/commons/index.js +17 -0
- package/api/resources/commons/types/OrganizationId.js +10 -0
- package/api/resources/commons/types/UserId.js +10 -0
- package/api/resources/commons/types/index.js +18 -0
- package/api/resources/index.js +40 -0
- package/{types/api → api}/resources/organization/client/Client.d.ts +4 -4
- package/api/resources/organization/client/Client.js +214 -0
- package/api/resources/organization/client/addUser.js +44 -0
- package/api/resources/organization/client/create.js +44 -0
- package/api/resources/organization/client/get.js +34 -0
- package/api/resources/organization/client/getMyOrganizationFromScopedToken.js +34 -0
- package/api/resources/organization/client/index.js +36 -0
- package/api/resources/organization/client/isMember.js +24 -0
- package/api/resources/organization/client/requests/AddUserToOrgRequest.js +5 -0
- package/api/resources/organization/client/requests/CreateOrganizationRequest.js +5 -0
- package/api/resources/organization/client/requests/UpdateOrganizationRequest.js +5 -0
- package/api/resources/organization/client/requests/index.js +2 -0
- package/api/resources/organization/client/update.js +34 -0
- package/api/resources/organization/index.js +18 -0
- package/api/resources/organization/types/LightweightUser.d.ts +8 -0
- package/api/resources/organization/types/LightweightUser.js +5 -0
- package/{types/api → api}/resources/organization/types/Organization.d.ts +2 -0
- package/api/resources/organization/types/Organization.js +5 -0
- package/api/resources/organization/types/index.d.ts +2 -0
- package/api/resources/organization/types/index.js +18 -0
- package/{types/api → api}/resources/registry/client/Client.d.ts +4 -4
- package/api/resources/registry/client/Client.js +135 -0
- package/api/resources/registry/client/generateRegistryTokens.js +44 -0
- package/api/resources/registry/client/hasRegistryPermission.js +44 -0
- package/api/resources/registry/client/index.js +33 -0
- package/api/resources/registry/client/requests/CheckRegistryPermissionRequest.js +5 -0
- package/api/resources/registry/client/requests/GenerateRegistryTokensRequest.js +5 -0
- package/api/resources/registry/client/requests/RevokeTokenRequest.js +5 -0
- package/api/resources/registry/client/requests/index.js +2 -0
- package/api/resources/registry/client/revokeToken.js +44 -0
- package/api/resources/registry/index.js +18 -0
- package/api/resources/registry/types/MavenRegistryToken.js +5 -0
- package/api/resources/registry/types/NpmRegistryToken.js +5 -0
- package/api/resources/registry/types/RegistryToken.js +45 -0
- package/api/resources/registry/types/RegistryTokens.js +5 -0
- package/api/resources/registry/types/index.js +20 -0
- package/{types/api → api}/resources/user/client/Client.d.ts +4 -4
- package/api/resources/user/client/Client.js +87 -0
- package/api/resources/user/client/getMyOrganizations.js +24 -0
- package/api/resources/user/client/getMyself.js +24 -0
- package/api/resources/user/client/index.js +32 -0
- package/api/resources/user/client/requests/GetUserOrganizationsRequest.js +5 -0
- package/api/resources/user/client/requests/index.js +2 -0
- package/api/resources/user/index.js +18 -0
- package/api/resources/user/types/OrganizationsPage.js +5 -0
- package/api/resources/user/types/User.js +5 -0
- package/api/resources/user/types/index.js +18 -0
- package/core/auth/BasicAuth.js +26 -0
- package/core/auth/BearerToken.js +15 -0
- package/core/auth/index.js +7 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/{types/core → core}/fetcher/Fetcher.d.ts +0 -3
- package/core/fetcher/Fetcher.js +85 -0
- package/core/fetcher/Supplier.js +13 -0
- package/core/fetcher/index.js +7 -0
- package/core/index.js +32 -0
- package/core/schemas/Schema.js +19 -0
- package/core/schemas/builders/date/date.js +55 -0
- package/core/schemas/builders/date/index.js +5 -0
- package/core/schemas/builders/enum/enum.js +29 -0
- package/core/schemas/builders/enum/index.js +5 -0
- package/core/schemas/builders/index.js +28 -0
- package/core/schemas/builders/lazy/index.js +7 -0
- package/core/schemas/builders/lazy/lazy.js +28 -0
- package/core/schemas/builders/lazy/lazyObject.js +21 -0
- package/core/schemas/builders/list/index.js +5 -0
- package/core/schemas/builders/list/list.js +53 -0
- package/core/schemas/builders/literals/index.js +5 -0
- package/core/schemas/builders/literals/stringLiteral.js +28 -0
- package/core/schemas/builders/object/index.js +9 -0
- package/core/schemas/builders/object/object.js +231 -0
- package/core/schemas/builders/object/property.js +16 -0
- package/core/schemas/builders/object/types.js +2 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +62 -0
- package/core/schemas/builders/object-like/index.js +6 -0
- package/core/schemas/builders/object-like/types.js +2 -0
- package/core/schemas/builders/primitives/any.js +6 -0
- package/core/schemas/builders/primitives/boolean.js +24 -0
- package/core/schemas/builders/primitives/index.js +13 -0
- package/core/schemas/builders/primitives/number.js +24 -0
- package/core/schemas/builders/primitives/string.js +24 -0
- package/core/schemas/builders/primitives/unknown.js +6 -0
- package/core/schemas/builders/record/index.js +5 -0
- package/core/schemas/builders/record/record.js +91 -0
- package/core/schemas/builders/record/types.js +2 -0
- package/core/schemas/builders/schema-utils/JsonError.js +13 -0
- package/core/schemas/builders/schema-utils/ParseError.js +13 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
- package/core/schemas/builders/schema-utils/index.js +11 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
- package/core/schemas/builders/set/index.js +5 -0
- package/core/schemas/builders/set/set.js +44 -0
- package/core/schemas/builders/union/discriminant.js +10 -0
- package/core/schemas/builders/union/index.js +7 -0
- package/core/schemas/builders/union/types.js +2 -0
- package/core/schemas/builders/union/union.js +100 -0
- package/core/schemas/index.js +17 -0
- package/core/schemas/utils/MaybePromise.js +2 -0
- package/core/schemas/utils/OptionalRecord.js +2 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.js +18 -0
- package/core/schemas/utils/entries.js +7 -0
- package/core/schemas/utils/filterObject.js +14 -0
- package/core/schemas/utils/isPlainObject.js +19 -0
- package/core/schemas/utils/keys.js +7 -0
- package/core/schemas/utils/partition.js +16 -0
- package/index.js +29 -0
- package/package.json +19 -43
- package/serialization/index.js +17 -0
- package/serialization/resources/commons/index.js +17 -0
- package/serialization/resources/commons/types/OrganizationId.js +35 -0
- package/serialization/resources/commons/types/UserId.js +37 -0
- package/serialization/resources/commons/types/index.js +18 -0
- package/serialization/resources/index.js +39 -0
- package/serialization/resources/organization/client/addUser.js +47 -0
- package/serialization/resources/organization/client/create.js +47 -0
- package/serialization/resources/organization/client/get.js +44 -0
- package/serialization/resources/organization/client/getMyOrganizationFromScopedToken.js +44 -0
- package/serialization/resources/organization/client/index.js +36 -0
- package/serialization/resources/organization/client/isMember.js +31 -0
- package/serialization/resources/organization/client/requests/AddUserToOrgRequest.js +34 -0
- package/serialization/resources/organization/client/requests/CreateOrganizationRequest.js +34 -0
- package/serialization/resources/organization/client/requests/UpdateOrganizationRequest.js +33 -0
- package/serialization/resources/organization/client/requests/index.js +9 -0
- package/serialization/resources/organization/client/update.js +44 -0
- package/serialization/resources/organization/index.js +18 -0
- package/serialization/resources/organization/types/LightweightUser.d.ts +14 -0
- package/serialization/resources/organization/types/LightweightUser.js +35 -0
- package/{types/serialization → serialization}/resources/organization/types/Organization.d.ts +2 -0
- package/serialization/resources/organization/types/Organization.js +36 -0
- package/serialization/resources/organization/types/index.d.ts +2 -0
- package/serialization/resources/organization/types/index.js +18 -0
- package/serialization/resources/registry/client/generateRegistryTokens.js +47 -0
- package/serialization/resources/registry/client/hasRegistryPermission.js +48 -0
- package/serialization/resources/registry/client/index.js +33 -0
- package/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.js +34 -0
- package/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.js +33 -0
- package/serialization/resources/registry/client/requests/RevokeTokenRequest.js +34 -0
- package/serialization/resources/registry/client/requests/index.js +9 -0
- package/serialization/resources/registry/client/revokeToken.js +47 -0
- package/serialization/resources/registry/index.js +18 -0
- package/serialization/resources/registry/types/MavenRegistryToken.js +34 -0
- package/serialization/resources/registry/types/NpmRegistryToken.js +33 -0
- package/serialization/resources/registry/types/RegistryToken.js +49 -0
- package/serialization/resources/registry/types/RegistryTokens.js +34 -0
- package/serialization/resources/registry/types/index.js +20 -0
- package/serialization/resources/user/index.js +17 -0
- package/serialization/resources/user/types/OrganizationsPage.js +34 -0
- package/serialization/resources/user/types/User.js +36 -0
- package/serialization/resources/user/types/index.js +18 -0
- package/core.d.ts +0 -4
- package/dist/browser/cjs/core.js +0 -4821
- package/dist/browser/cjs/index.js +0 -6937
- package/dist/browser/cjs/serialization.js +0 -6453
- package/dist/browser/esm/core.js +0 -4815
- package/dist/browser/esm/index.js +0 -6933
- package/dist/browser/esm/serialization.js +0 -6471
- package/dist/node/core.js +0 -13178
- package/dist/node/index.js +0 -15320
- package/dist/node/serialization.js +0 -15332
- package/serialization.d.ts +0 -4
- package/types/Client.d.ts +0 -21
- package/types/api/resources/organization/types/index.d.ts +0 -1
- package/types/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +0 -9
- package/types/serialization/resources/organization/types/index.d.ts +0 -1
- /package/{types/api → api}/index.d.ts +0 -0
- /package/{types/api → api}/resources/commons/index.d.ts +0 -0
- /package/{types/api → api}/resources/commons/types/OrganizationId.d.ts +0 -0
- /package/{types/api → api}/resources/commons/types/UserId.d.ts +0 -0
- /package/{types/api → api}/resources/commons/types/index.d.ts +0 -0
- /package/{types/api → api}/resources/index.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/addUser.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/create.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/get.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/index.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/isMember.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/requests/AddUserToOrgRequest.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/requests/CreateOrganizationRequest.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/requests/index.d.ts +0 -0
- /package/{types/api → api}/resources/organization/client/update.d.ts +0 -0
- /package/{types/api → api}/resources/organization/index.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/generateRegistryTokens.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/hasRegistryPermission.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/index.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/requests/RevokeTokenRequest.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/requests/index.d.ts +0 -0
- /package/{types/api → api}/resources/registry/client/revokeToken.d.ts +0 -0
- /package/{types/api → api}/resources/registry/index.d.ts +0 -0
- /package/{types/api → api}/resources/registry/types/MavenRegistryToken.d.ts +0 -0
- /package/{types/api → api}/resources/registry/types/NpmRegistryToken.d.ts +0 -0
- /package/{types/api → api}/resources/registry/types/RegistryToken.d.ts +0 -0
- /package/{types/api → api}/resources/registry/types/RegistryTokens.d.ts +0 -0
- /package/{types/api → api}/resources/registry/types/index.d.ts +0 -0
- /package/{types/api → api}/resources/user/client/getMyOrganizations.d.ts +0 -0
- /package/{types/api → api}/resources/user/client/getMyself.d.ts +0 -0
- /package/{types/api → api}/resources/user/client/index.d.ts +0 -0
- /package/{types/api → api}/resources/user/client/requests/GetUserOrganizationsRequest.d.ts +0 -0
- /package/{types/api → api}/resources/user/client/requests/index.d.ts +0 -0
- /package/{types/api → api}/resources/user/index.d.ts +0 -0
- /package/{types/api → api}/resources/user/types/OrganizationsPage.d.ts +0 -0
- /package/{types/api → api}/resources/user/types/User.d.ts +0 -0
- /package/{types/api → api}/resources/user/types/index.d.ts +0 -0
- /package/{types/core → core}/auth/BasicAuth.d.ts +0 -0
- /package/{types/core → core}/auth/BearerToken.d.ts +0 -0
- /package/{types/core → core}/auth/index.d.ts +0 -0
- /package/{types/core → core}/fetcher/APIResponse.d.ts +0 -0
- /package/{types/core → core}/fetcher/Supplier.d.ts +0 -0
- /package/{types/core → core}/fetcher/index.d.ts +0 -0
- /package/{types/core → core}/index.d.ts +0 -0
- /package/{types/core → core}/schemas/Schema.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/date/date.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/date/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/enum/enum.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/enum/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/lazy/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/lazy/lazy.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/lazy/lazyObject.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/list/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/list/list.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/literals/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/literals/stringLiteral.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object/object.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object/property.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object/types.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object-like/getObjectLikeUtils.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object-like/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/object-like/types.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/any.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/boolean.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/number.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/string.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/primitives/unknown.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/record/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/record/record.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/record/types.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/schema-utils/JsonError.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/schema-utils/ParseError.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/schema-utils/getSchemaUtils.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/schema-utils/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/set/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/set/set.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/union/discriminant.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/union/index.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/union/types.d.ts +0 -0
- /package/{types/core → core}/schemas/builders/union/union.d.ts +0 -0
- /package/{types/core → core}/schemas/index.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/MaybePromise.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/OptionalRecord.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/createIdentitySchemaCreator.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/entries.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/filterObject.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/isPlainObject.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/keys.d.ts +0 -0
- /package/{types/core → core}/schemas/utils/partition.d.ts +0 -0
- /package/{types/index.d.ts → index.d.ts} +0 -0
- /package/{types/serialization → serialization}/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/commons/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/commons/types/OrganizationId.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/commons/types/UserId.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/commons/types/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/addUser.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/create.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/get.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/isMember.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/requests/AddUserToOrgRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/requests/CreateOrganizationRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/requests/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/client/update.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/organization/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/generateRegistryTokens.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/hasRegistryPermission.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/requests/RevokeTokenRequest.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/requests/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/client/revokeToken.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/types/MavenRegistryToken.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/types/NpmRegistryToken.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/types/RegistryToken.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/types/RegistryTokens.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/registry/types/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/user/index.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/user/types/OrganizationsPage.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/user/types/User.d.ts +0 -0
- /package/{types/serialization → serialization}/resources/user/types/index.d.ts +0 -0
package/dist/browser/cjs/core.js
DELETED
|
@@ -1,4821 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
-
|
|
33
|
-
// .yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/index.js
|
|
34
|
-
var require_base64_js = __commonJS({
|
|
35
|
-
".yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/index.js"(exports) {
|
|
36
|
-
"use strict";
|
|
37
|
-
exports.byteLength = byteLength;
|
|
38
|
-
exports.toByteArray = toByteArray;
|
|
39
|
-
exports.fromByteArray = fromByteArray;
|
|
40
|
-
var lookup = [];
|
|
41
|
-
var revLookup = [];
|
|
42
|
-
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
43
|
-
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
44
|
-
for (i = 0, len = code.length; i < len; ++i) {
|
|
45
|
-
lookup[i] = code[i];
|
|
46
|
-
revLookup[code.charCodeAt(i)] = i;
|
|
47
|
-
}
|
|
48
|
-
var i;
|
|
49
|
-
var len;
|
|
50
|
-
revLookup["-".charCodeAt(0)] = 62;
|
|
51
|
-
revLookup["_".charCodeAt(0)] = 63;
|
|
52
|
-
function getLens(b64) {
|
|
53
|
-
var len2 = b64.length;
|
|
54
|
-
if (len2 % 4 > 0) {
|
|
55
|
-
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
56
|
-
}
|
|
57
|
-
var validLen = b64.indexOf("=");
|
|
58
|
-
if (validLen === -1)
|
|
59
|
-
validLen = len2;
|
|
60
|
-
var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
|
|
61
|
-
return [validLen, placeHoldersLen];
|
|
62
|
-
}
|
|
63
|
-
function byteLength(b64) {
|
|
64
|
-
var lens = getLens(b64);
|
|
65
|
-
var validLen = lens[0];
|
|
66
|
-
var placeHoldersLen = lens[1];
|
|
67
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
68
|
-
}
|
|
69
|
-
function _byteLength(b64, validLen, placeHoldersLen) {
|
|
70
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
71
|
-
}
|
|
72
|
-
function toByteArray(b64) {
|
|
73
|
-
var tmp;
|
|
74
|
-
var lens = getLens(b64);
|
|
75
|
-
var validLen = lens[0];
|
|
76
|
-
var placeHoldersLen = lens[1];
|
|
77
|
-
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
78
|
-
var curByte = 0;
|
|
79
|
-
var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
80
|
-
var i2;
|
|
81
|
-
for (i2 = 0; i2 < len2; i2 += 4) {
|
|
82
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
|
|
83
|
-
arr[curByte++] = tmp >> 16 & 255;
|
|
84
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
85
|
-
arr[curByte++] = tmp & 255;
|
|
86
|
-
}
|
|
87
|
-
if (placeHoldersLen === 2) {
|
|
88
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
|
|
89
|
-
arr[curByte++] = tmp & 255;
|
|
90
|
-
}
|
|
91
|
-
if (placeHoldersLen === 1) {
|
|
92
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
|
|
93
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
94
|
-
arr[curByte++] = tmp & 255;
|
|
95
|
-
}
|
|
96
|
-
return arr;
|
|
97
|
-
}
|
|
98
|
-
function tripletToBase64(num) {
|
|
99
|
-
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
100
|
-
}
|
|
101
|
-
function encodeChunk(uint8, start, end) {
|
|
102
|
-
var tmp;
|
|
103
|
-
var output = [];
|
|
104
|
-
for (var i2 = start; i2 < end; i2 += 3) {
|
|
105
|
-
tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
|
|
106
|
-
output.push(tripletToBase64(tmp));
|
|
107
|
-
}
|
|
108
|
-
return output.join("");
|
|
109
|
-
}
|
|
110
|
-
function fromByteArray(uint8) {
|
|
111
|
-
var tmp;
|
|
112
|
-
var len2 = uint8.length;
|
|
113
|
-
var extraBytes = len2 % 3;
|
|
114
|
-
var parts = [];
|
|
115
|
-
var maxChunkLength = 16383;
|
|
116
|
-
for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
|
|
117
|
-
parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
|
|
118
|
-
}
|
|
119
|
-
if (extraBytes === 1) {
|
|
120
|
-
tmp = uint8[len2 - 1];
|
|
121
|
-
parts.push(
|
|
122
|
-
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
123
|
-
);
|
|
124
|
-
} else if (extraBytes === 2) {
|
|
125
|
-
tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
|
|
126
|
-
parts.push(
|
|
127
|
-
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
return parts.join("");
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// .yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip/node_modules/ieee754/index.js
|
|
136
|
-
var require_ieee754 = __commonJS({
|
|
137
|
-
".yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip/node_modules/ieee754/index.js"(exports) {
|
|
138
|
-
exports.read = function(buffer, offset, isLE, mLen, nBytes) {
|
|
139
|
-
var e, m;
|
|
140
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
141
|
-
var eMax = (1 << eLen) - 1;
|
|
142
|
-
var eBias = eMax >> 1;
|
|
143
|
-
var nBits = -7;
|
|
144
|
-
var i = isLE ? nBytes - 1 : 0;
|
|
145
|
-
var d = isLE ? -1 : 1;
|
|
146
|
-
var s = buffer[offset + i];
|
|
147
|
-
i += d;
|
|
148
|
-
e = s & (1 << -nBits) - 1;
|
|
149
|
-
s >>= -nBits;
|
|
150
|
-
nBits += eLen;
|
|
151
|
-
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {
|
|
152
|
-
}
|
|
153
|
-
m = e & (1 << -nBits) - 1;
|
|
154
|
-
e >>= -nBits;
|
|
155
|
-
nBits += mLen;
|
|
156
|
-
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {
|
|
157
|
-
}
|
|
158
|
-
if (e === 0) {
|
|
159
|
-
e = 1 - eBias;
|
|
160
|
-
} else if (e === eMax) {
|
|
161
|
-
return m ? NaN : (s ? -1 : 1) * Infinity;
|
|
162
|
-
} else {
|
|
163
|
-
m = m + Math.pow(2, mLen);
|
|
164
|
-
e = e - eBias;
|
|
165
|
-
}
|
|
166
|
-
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
|
167
|
-
};
|
|
168
|
-
exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
|
|
169
|
-
var e, m, c;
|
|
170
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
171
|
-
var eMax = (1 << eLen) - 1;
|
|
172
|
-
var eBias = eMax >> 1;
|
|
173
|
-
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
|
174
|
-
var i = isLE ? 0 : nBytes - 1;
|
|
175
|
-
var d = isLE ? 1 : -1;
|
|
176
|
-
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
177
|
-
value = Math.abs(value);
|
|
178
|
-
if (isNaN(value) || value === Infinity) {
|
|
179
|
-
m = isNaN(value) ? 1 : 0;
|
|
180
|
-
e = eMax;
|
|
181
|
-
} else {
|
|
182
|
-
e = Math.floor(Math.log(value) / Math.LN2);
|
|
183
|
-
if (value * (c = Math.pow(2, -e)) < 1) {
|
|
184
|
-
e--;
|
|
185
|
-
c *= 2;
|
|
186
|
-
}
|
|
187
|
-
if (e + eBias >= 1) {
|
|
188
|
-
value += rt / c;
|
|
189
|
-
} else {
|
|
190
|
-
value += rt * Math.pow(2, 1 - eBias);
|
|
191
|
-
}
|
|
192
|
-
if (value * c >= 2) {
|
|
193
|
-
e++;
|
|
194
|
-
c /= 2;
|
|
195
|
-
}
|
|
196
|
-
if (e + eBias >= eMax) {
|
|
197
|
-
m = 0;
|
|
198
|
-
e = eMax;
|
|
199
|
-
} else if (e + eBias >= 1) {
|
|
200
|
-
m = (value * c - 1) * Math.pow(2, mLen);
|
|
201
|
-
e = e + eBias;
|
|
202
|
-
} else {
|
|
203
|
-
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
|
204
|
-
e = 0;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
|
|
208
|
-
}
|
|
209
|
-
e = e << mLen | m;
|
|
210
|
-
eLen += mLen;
|
|
211
|
-
for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
|
|
212
|
-
}
|
|
213
|
-
buffer[offset + i - d] |= s * 128;
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
// .yarn/cache/buffer-npm-6.0.3-cd90dfedfe-5ad23293d9.zip/node_modules/buffer/index.js
|
|
219
|
-
var require_buffer = __commonJS({
|
|
220
|
-
".yarn/cache/buffer-npm-6.0.3-cd90dfedfe-5ad23293d9.zip/node_modules/buffer/index.js"(exports) {
|
|
221
|
-
"use strict";
|
|
222
|
-
var base64 = require_base64_js();
|
|
223
|
-
var ieee754 = require_ieee754();
|
|
224
|
-
var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
225
|
-
exports.Buffer = Buffer2;
|
|
226
|
-
exports.SlowBuffer = SlowBuffer;
|
|
227
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
228
|
-
var K_MAX_LENGTH = 2147483647;
|
|
229
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
230
|
-
Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
|
|
231
|
-
if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
|
|
232
|
-
console.error(
|
|
233
|
-
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
function typedArraySupport() {
|
|
237
|
-
try {
|
|
238
|
-
const arr = new Uint8Array(1);
|
|
239
|
-
const proto = { foo: function() {
|
|
240
|
-
return 42;
|
|
241
|
-
} };
|
|
242
|
-
Object.setPrototypeOf(proto, Uint8Array.prototype);
|
|
243
|
-
Object.setPrototypeOf(arr, proto);
|
|
244
|
-
return arr.foo() === 42;
|
|
245
|
-
} catch (e) {
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
Object.defineProperty(Buffer2.prototype, "parent", {
|
|
250
|
-
enumerable: true,
|
|
251
|
-
get: function() {
|
|
252
|
-
if (!Buffer2.isBuffer(this))
|
|
253
|
-
return void 0;
|
|
254
|
-
return this.buffer;
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
Object.defineProperty(Buffer2.prototype, "offset", {
|
|
258
|
-
enumerable: true,
|
|
259
|
-
get: function() {
|
|
260
|
-
if (!Buffer2.isBuffer(this))
|
|
261
|
-
return void 0;
|
|
262
|
-
return this.byteOffset;
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
function createBuffer(length) {
|
|
266
|
-
if (length > K_MAX_LENGTH) {
|
|
267
|
-
throw new RangeError('The value "' + length + '" is invalid for option "size"');
|
|
268
|
-
}
|
|
269
|
-
const buf = new Uint8Array(length);
|
|
270
|
-
Object.setPrototypeOf(buf, Buffer2.prototype);
|
|
271
|
-
return buf;
|
|
272
|
-
}
|
|
273
|
-
function Buffer2(arg, encodingOrOffset, length) {
|
|
274
|
-
if (typeof arg === "number") {
|
|
275
|
-
if (typeof encodingOrOffset === "string") {
|
|
276
|
-
throw new TypeError(
|
|
277
|
-
'The "string" argument must be of type string. Received type number'
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
return allocUnsafe(arg);
|
|
281
|
-
}
|
|
282
|
-
return from(arg, encodingOrOffset, length);
|
|
283
|
-
}
|
|
284
|
-
Buffer2.poolSize = 8192;
|
|
285
|
-
function from(value, encodingOrOffset, length) {
|
|
286
|
-
if (typeof value === "string") {
|
|
287
|
-
return fromString(value, encodingOrOffset);
|
|
288
|
-
}
|
|
289
|
-
if (ArrayBuffer.isView(value)) {
|
|
290
|
-
return fromArrayView(value);
|
|
291
|
-
}
|
|
292
|
-
if (value == null) {
|
|
293
|
-
throw new TypeError(
|
|
294
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
|
|
298
|
-
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
299
|
-
}
|
|
300
|
-
if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {
|
|
301
|
-
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
302
|
-
}
|
|
303
|
-
if (typeof value === "number") {
|
|
304
|
-
throw new TypeError(
|
|
305
|
-
'The "value" argument must not be of type number. Received type number'
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
const valueOf = value.valueOf && value.valueOf();
|
|
309
|
-
if (valueOf != null && valueOf !== value) {
|
|
310
|
-
return Buffer2.from(valueOf, encodingOrOffset, length);
|
|
311
|
-
}
|
|
312
|
-
const b = fromObject(value);
|
|
313
|
-
if (b)
|
|
314
|
-
return b;
|
|
315
|
-
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
|
|
316
|
-
return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
|
|
317
|
-
}
|
|
318
|
-
throw new TypeError(
|
|
319
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
Buffer2.from = function(value, encodingOrOffset, length) {
|
|
323
|
-
return from(value, encodingOrOffset, length);
|
|
324
|
-
};
|
|
325
|
-
Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype);
|
|
326
|
-
Object.setPrototypeOf(Buffer2, Uint8Array);
|
|
327
|
-
function assertSize(size) {
|
|
328
|
-
if (typeof size !== "number") {
|
|
329
|
-
throw new TypeError('"size" argument must be of type number');
|
|
330
|
-
} else if (size < 0) {
|
|
331
|
-
throw new RangeError('The value "' + size + '" is invalid for option "size"');
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
function alloc(size, fill, encoding) {
|
|
335
|
-
assertSize(size);
|
|
336
|
-
if (size <= 0) {
|
|
337
|
-
return createBuffer(size);
|
|
338
|
-
}
|
|
339
|
-
if (fill !== void 0) {
|
|
340
|
-
return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
|
|
341
|
-
}
|
|
342
|
-
return createBuffer(size);
|
|
343
|
-
}
|
|
344
|
-
Buffer2.alloc = function(size, fill, encoding) {
|
|
345
|
-
return alloc(size, fill, encoding);
|
|
346
|
-
};
|
|
347
|
-
function allocUnsafe(size) {
|
|
348
|
-
assertSize(size);
|
|
349
|
-
return createBuffer(size < 0 ? 0 : checked(size) | 0);
|
|
350
|
-
}
|
|
351
|
-
Buffer2.allocUnsafe = function(size) {
|
|
352
|
-
return allocUnsafe(size);
|
|
353
|
-
};
|
|
354
|
-
Buffer2.allocUnsafeSlow = function(size) {
|
|
355
|
-
return allocUnsafe(size);
|
|
356
|
-
};
|
|
357
|
-
function fromString(string2, encoding) {
|
|
358
|
-
if (typeof encoding !== "string" || encoding === "") {
|
|
359
|
-
encoding = "utf8";
|
|
360
|
-
}
|
|
361
|
-
if (!Buffer2.isEncoding(encoding)) {
|
|
362
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
363
|
-
}
|
|
364
|
-
const length = byteLength(string2, encoding) | 0;
|
|
365
|
-
let buf = createBuffer(length);
|
|
366
|
-
const actual = buf.write(string2, encoding);
|
|
367
|
-
if (actual !== length) {
|
|
368
|
-
buf = buf.slice(0, actual);
|
|
369
|
-
}
|
|
370
|
-
return buf;
|
|
371
|
-
}
|
|
372
|
-
function fromArrayLike(array) {
|
|
373
|
-
const length = array.length < 0 ? 0 : checked(array.length) | 0;
|
|
374
|
-
const buf = createBuffer(length);
|
|
375
|
-
for (let i = 0; i < length; i += 1) {
|
|
376
|
-
buf[i] = array[i] & 255;
|
|
377
|
-
}
|
|
378
|
-
return buf;
|
|
379
|
-
}
|
|
380
|
-
function fromArrayView(arrayView) {
|
|
381
|
-
if (isInstance(arrayView, Uint8Array)) {
|
|
382
|
-
const copy = new Uint8Array(arrayView);
|
|
383
|
-
return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
|
|
384
|
-
}
|
|
385
|
-
return fromArrayLike(arrayView);
|
|
386
|
-
}
|
|
387
|
-
function fromArrayBuffer(array, byteOffset, length) {
|
|
388
|
-
if (byteOffset < 0 || array.byteLength < byteOffset) {
|
|
389
|
-
throw new RangeError('"offset" is outside of buffer bounds');
|
|
390
|
-
}
|
|
391
|
-
if (array.byteLength < byteOffset + (length || 0)) {
|
|
392
|
-
throw new RangeError('"length" is outside of buffer bounds');
|
|
393
|
-
}
|
|
394
|
-
let buf;
|
|
395
|
-
if (byteOffset === void 0 && length === void 0) {
|
|
396
|
-
buf = new Uint8Array(array);
|
|
397
|
-
} else if (length === void 0) {
|
|
398
|
-
buf = new Uint8Array(array, byteOffset);
|
|
399
|
-
} else {
|
|
400
|
-
buf = new Uint8Array(array, byteOffset, length);
|
|
401
|
-
}
|
|
402
|
-
Object.setPrototypeOf(buf, Buffer2.prototype);
|
|
403
|
-
return buf;
|
|
404
|
-
}
|
|
405
|
-
function fromObject(obj) {
|
|
406
|
-
if (Buffer2.isBuffer(obj)) {
|
|
407
|
-
const len = checked(obj.length) | 0;
|
|
408
|
-
const buf = createBuffer(len);
|
|
409
|
-
if (buf.length === 0) {
|
|
410
|
-
return buf;
|
|
411
|
-
}
|
|
412
|
-
obj.copy(buf, 0, 0, len);
|
|
413
|
-
return buf;
|
|
414
|
-
}
|
|
415
|
-
if (obj.length !== void 0) {
|
|
416
|
-
if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
|
|
417
|
-
return createBuffer(0);
|
|
418
|
-
}
|
|
419
|
-
return fromArrayLike(obj);
|
|
420
|
-
}
|
|
421
|
-
if (obj.type === "Buffer" && Array.isArray(obj.data)) {
|
|
422
|
-
return fromArrayLike(obj.data);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
function checked(length) {
|
|
426
|
-
if (length >= K_MAX_LENGTH) {
|
|
427
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
|
|
428
|
-
}
|
|
429
|
-
return length | 0;
|
|
430
|
-
}
|
|
431
|
-
function SlowBuffer(length) {
|
|
432
|
-
if (+length != length) {
|
|
433
|
-
length = 0;
|
|
434
|
-
}
|
|
435
|
-
return Buffer2.alloc(+length);
|
|
436
|
-
}
|
|
437
|
-
Buffer2.isBuffer = function isBuffer(b) {
|
|
438
|
-
return b != null && b._isBuffer === true && b !== Buffer2.prototype;
|
|
439
|
-
};
|
|
440
|
-
Buffer2.compare = function compare(a, b) {
|
|
441
|
-
if (isInstance(a, Uint8Array))
|
|
442
|
-
a = Buffer2.from(a, a.offset, a.byteLength);
|
|
443
|
-
if (isInstance(b, Uint8Array))
|
|
444
|
-
b = Buffer2.from(b, b.offset, b.byteLength);
|
|
445
|
-
if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
|
|
446
|
-
throw new TypeError(
|
|
447
|
-
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
if (a === b)
|
|
451
|
-
return 0;
|
|
452
|
-
let x = a.length;
|
|
453
|
-
let y = b.length;
|
|
454
|
-
for (let i = 0, len = Math.min(x, y); i < len; ++i) {
|
|
455
|
-
if (a[i] !== b[i]) {
|
|
456
|
-
x = a[i];
|
|
457
|
-
y = b[i];
|
|
458
|
-
break;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (x < y)
|
|
462
|
-
return -1;
|
|
463
|
-
if (y < x)
|
|
464
|
-
return 1;
|
|
465
|
-
return 0;
|
|
466
|
-
};
|
|
467
|
-
Buffer2.isEncoding = function isEncoding(encoding) {
|
|
468
|
-
switch (String(encoding).toLowerCase()) {
|
|
469
|
-
case "hex":
|
|
470
|
-
case "utf8":
|
|
471
|
-
case "utf-8":
|
|
472
|
-
case "ascii":
|
|
473
|
-
case "latin1":
|
|
474
|
-
case "binary":
|
|
475
|
-
case "base64":
|
|
476
|
-
case "ucs2":
|
|
477
|
-
case "ucs-2":
|
|
478
|
-
case "utf16le":
|
|
479
|
-
case "utf-16le":
|
|
480
|
-
return true;
|
|
481
|
-
default:
|
|
482
|
-
return false;
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
Buffer2.concat = function concat(list2, length) {
|
|
486
|
-
if (!Array.isArray(list2)) {
|
|
487
|
-
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
488
|
-
}
|
|
489
|
-
if (list2.length === 0) {
|
|
490
|
-
return Buffer2.alloc(0);
|
|
491
|
-
}
|
|
492
|
-
let i;
|
|
493
|
-
if (length === void 0) {
|
|
494
|
-
length = 0;
|
|
495
|
-
for (i = 0; i < list2.length; ++i) {
|
|
496
|
-
length += list2[i].length;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
const buffer = Buffer2.allocUnsafe(length);
|
|
500
|
-
let pos = 0;
|
|
501
|
-
for (i = 0; i < list2.length; ++i) {
|
|
502
|
-
let buf = list2[i];
|
|
503
|
-
if (isInstance(buf, Uint8Array)) {
|
|
504
|
-
if (pos + buf.length > buffer.length) {
|
|
505
|
-
if (!Buffer2.isBuffer(buf))
|
|
506
|
-
buf = Buffer2.from(buf);
|
|
507
|
-
buf.copy(buffer, pos);
|
|
508
|
-
} else {
|
|
509
|
-
Uint8Array.prototype.set.call(
|
|
510
|
-
buffer,
|
|
511
|
-
buf,
|
|
512
|
-
pos
|
|
513
|
-
);
|
|
514
|
-
}
|
|
515
|
-
} else if (!Buffer2.isBuffer(buf)) {
|
|
516
|
-
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
517
|
-
} else {
|
|
518
|
-
buf.copy(buffer, pos);
|
|
519
|
-
}
|
|
520
|
-
pos += buf.length;
|
|
521
|
-
}
|
|
522
|
-
return buffer;
|
|
523
|
-
};
|
|
524
|
-
function byteLength(string2, encoding) {
|
|
525
|
-
if (Buffer2.isBuffer(string2)) {
|
|
526
|
-
return string2.length;
|
|
527
|
-
}
|
|
528
|
-
if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) {
|
|
529
|
-
return string2.byteLength;
|
|
530
|
-
}
|
|
531
|
-
if (typeof string2 !== "string") {
|
|
532
|
-
throw new TypeError(
|
|
533
|
-
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
const len = string2.length;
|
|
537
|
-
const mustMatch = arguments.length > 2 && arguments[2] === true;
|
|
538
|
-
if (!mustMatch && len === 0)
|
|
539
|
-
return 0;
|
|
540
|
-
let loweredCase = false;
|
|
541
|
-
for (; ; ) {
|
|
542
|
-
switch (encoding) {
|
|
543
|
-
case "ascii":
|
|
544
|
-
case "latin1":
|
|
545
|
-
case "binary":
|
|
546
|
-
return len;
|
|
547
|
-
case "utf8":
|
|
548
|
-
case "utf-8":
|
|
549
|
-
return utf8ToBytes(string2).length;
|
|
550
|
-
case "ucs2":
|
|
551
|
-
case "ucs-2":
|
|
552
|
-
case "utf16le":
|
|
553
|
-
case "utf-16le":
|
|
554
|
-
return len * 2;
|
|
555
|
-
case "hex":
|
|
556
|
-
return len >>> 1;
|
|
557
|
-
case "base64":
|
|
558
|
-
return base64ToBytes(string2).length;
|
|
559
|
-
default:
|
|
560
|
-
if (loweredCase) {
|
|
561
|
-
return mustMatch ? -1 : utf8ToBytes(string2).length;
|
|
562
|
-
}
|
|
563
|
-
encoding = ("" + encoding).toLowerCase();
|
|
564
|
-
loweredCase = true;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
Buffer2.byteLength = byteLength;
|
|
569
|
-
function slowToString(encoding, start, end) {
|
|
570
|
-
let loweredCase = false;
|
|
571
|
-
if (start === void 0 || start < 0) {
|
|
572
|
-
start = 0;
|
|
573
|
-
}
|
|
574
|
-
if (start > this.length) {
|
|
575
|
-
return "";
|
|
576
|
-
}
|
|
577
|
-
if (end === void 0 || end > this.length) {
|
|
578
|
-
end = this.length;
|
|
579
|
-
}
|
|
580
|
-
if (end <= 0) {
|
|
581
|
-
return "";
|
|
582
|
-
}
|
|
583
|
-
end >>>= 0;
|
|
584
|
-
start >>>= 0;
|
|
585
|
-
if (end <= start) {
|
|
586
|
-
return "";
|
|
587
|
-
}
|
|
588
|
-
if (!encoding)
|
|
589
|
-
encoding = "utf8";
|
|
590
|
-
while (true) {
|
|
591
|
-
switch (encoding) {
|
|
592
|
-
case "hex":
|
|
593
|
-
return hexSlice(this, start, end);
|
|
594
|
-
case "utf8":
|
|
595
|
-
case "utf-8":
|
|
596
|
-
return utf8Slice(this, start, end);
|
|
597
|
-
case "ascii":
|
|
598
|
-
return asciiSlice(this, start, end);
|
|
599
|
-
case "latin1":
|
|
600
|
-
case "binary":
|
|
601
|
-
return latin1Slice(this, start, end);
|
|
602
|
-
case "base64":
|
|
603
|
-
return base64Slice(this, start, end);
|
|
604
|
-
case "ucs2":
|
|
605
|
-
case "ucs-2":
|
|
606
|
-
case "utf16le":
|
|
607
|
-
case "utf-16le":
|
|
608
|
-
return utf16leSlice(this, start, end);
|
|
609
|
-
default:
|
|
610
|
-
if (loweredCase)
|
|
611
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
612
|
-
encoding = (encoding + "").toLowerCase();
|
|
613
|
-
loweredCase = true;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
Buffer2.prototype._isBuffer = true;
|
|
618
|
-
function swap(b, n, m) {
|
|
619
|
-
const i = b[n];
|
|
620
|
-
b[n] = b[m];
|
|
621
|
-
b[m] = i;
|
|
622
|
-
}
|
|
623
|
-
Buffer2.prototype.swap16 = function swap16() {
|
|
624
|
-
const len = this.length;
|
|
625
|
-
if (len % 2 !== 0) {
|
|
626
|
-
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
627
|
-
}
|
|
628
|
-
for (let i = 0; i < len; i += 2) {
|
|
629
|
-
swap(this, i, i + 1);
|
|
630
|
-
}
|
|
631
|
-
return this;
|
|
632
|
-
};
|
|
633
|
-
Buffer2.prototype.swap32 = function swap32() {
|
|
634
|
-
const len = this.length;
|
|
635
|
-
if (len % 4 !== 0) {
|
|
636
|
-
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
637
|
-
}
|
|
638
|
-
for (let i = 0; i < len; i += 4) {
|
|
639
|
-
swap(this, i, i + 3);
|
|
640
|
-
swap(this, i + 1, i + 2);
|
|
641
|
-
}
|
|
642
|
-
return this;
|
|
643
|
-
};
|
|
644
|
-
Buffer2.prototype.swap64 = function swap64() {
|
|
645
|
-
const len = this.length;
|
|
646
|
-
if (len % 8 !== 0) {
|
|
647
|
-
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
648
|
-
}
|
|
649
|
-
for (let i = 0; i < len; i += 8) {
|
|
650
|
-
swap(this, i, i + 7);
|
|
651
|
-
swap(this, i + 1, i + 6);
|
|
652
|
-
swap(this, i + 2, i + 5);
|
|
653
|
-
swap(this, i + 3, i + 4);
|
|
654
|
-
}
|
|
655
|
-
return this;
|
|
656
|
-
};
|
|
657
|
-
Buffer2.prototype.toString = function toString() {
|
|
658
|
-
const length = this.length;
|
|
659
|
-
if (length === 0)
|
|
660
|
-
return "";
|
|
661
|
-
if (arguments.length === 0)
|
|
662
|
-
return utf8Slice(this, 0, length);
|
|
663
|
-
return slowToString.apply(this, arguments);
|
|
664
|
-
};
|
|
665
|
-
Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
|
|
666
|
-
Buffer2.prototype.equals = function equals(b) {
|
|
667
|
-
if (!Buffer2.isBuffer(b))
|
|
668
|
-
throw new TypeError("Argument must be a Buffer");
|
|
669
|
-
if (this === b)
|
|
670
|
-
return true;
|
|
671
|
-
return Buffer2.compare(this, b) === 0;
|
|
672
|
-
};
|
|
673
|
-
Buffer2.prototype.inspect = function inspect() {
|
|
674
|
-
let str = "";
|
|
675
|
-
const max = exports.INSPECT_MAX_BYTES;
|
|
676
|
-
str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
|
|
677
|
-
if (this.length > max)
|
|
678
|
-
str += " ... ";
|
|
679
|
-
return "<Buffer " + str + ">";
|
|
680
|
-
};
|
|
681
|
-
if (customInspectSymbol) {
|
|
682
|
-
Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
|
|
683
|
-
}
|
|
684
|
-
Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
|
|
685
|
-
if (isInstance(target, Uint8Array)) {
|
|
686
|
-
target = Buffer2.from(target, target.offset, target.byteLength);
|
|
687
|
-
}
|
|
688
|
-
if (!Buffer2.isBuffer(target)) {
|
|
689
|
-
throw new TypeError(
|
|
690
|
-
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target
|
|
691
|
-
);
|
|
692
|
-
}
|
|
693
|
-
if (start === void 0) {
|
|
694
|
-
start = 0;
|
|
695
|
-
}
|
|
696
|
-
if (end === void 0) {
|
|
697
|
-
end = target ? target.length : 0;
|
|
698
|
-
}
|
|
699
|
-
if (thisStart === void 0) {
|
|
700
|
-
thisStart = 0;
|
|
701
|
-
}
|
|
702
|
-
if (thisEnd === void 0) {
|
|
703
|
-
thisEnd = this.length;
|
|
704
|
-
}
|
|
705
|
-
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
|
|
706
|
-
throw new RangeError("out of range index");
|
|
707
|
-
}
|
|
708
|
-
if (thisStart >= thisEnd && start >= end) {
|
|
709
|
-
return 0;
|
|
710
|
-
}
|
|
711
|
-
if (thisStart >= thisEnd) {
|
|
712
|
-
return -1;
|
|
713
|
-
}
|
|
714
|
-
if (start >= end) {
|
|
715
|
-
return 1;
|
|
716
|
-
}
|
|
717
|
-
start >>>= 0;
|
|
718
|
-
end >>>= 0;
|
|
719
|
-
thisStart >>>= 0;
|
|
720
|
-
thisEnd >>>= 0;
|
|
721
|
-
if (this === target)
|
|
722
|
-
return 0;
|
|
723
|
-
let x = thisEnd - thisStart;
|
|
724
|
-
let y = end - start;
|
|
725
|
-
const len = Math.min(x, y);
|
|
726
|
-
const thisCopy = this.slice(thisStart, thisEnd);
|
|
727
|
-
const targetCopy = target.slice(start, end);
|
|
728
|
-
for (let i = 0; i < len; ++i) {
|
|
729
|
-
if (thisCopy[i] !== targetCopy[i]) {
|
|
730
|
-
x = thisCopy[i];
|
|
731
|
-
y = targetCopy[i];
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
if (x < y)
|
|
736
|
-
return -1;
|
|
737
|
-
if (y < x)
|
|
738
|
-
return 1;
|
|
739
|
-
return 0;
|
|
740
|
-
};
|
|
741
|
-
function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
|
|
742
|
-
if (buffer.length === 0)
|
|
743
|
-
return -1;
|
|
744
|
-
if (typeof byteOffset === "string") {
|
|
745
|
-
encoding = byteOffset;
|
|
746
|
-
byteOffset = 0;
|
|
747
|
-
} else if (byteOffset > 2147483647) {
|
|
748
|
-
byteOffset = 2147483647;
|
|
749
|
-
} else if (byteOffset < -2147483648) {
|
|
750
|
-
byteOffset = -2147483648;
|
|
751
|
-
}
|
|
752
|
-
byteOffset = +byteOffset;
|
|
753
|
-
if (numberIsNaN(byteOffset)) {
|
|
754
|
-
byteOffset = dir ? 0 : buffer.length - 1;
|
|
755
|
-
}
|
|
756
|
-
if (byteOffset < 0)
|
|
757
|
-
byteOffset = buffer.length + byteOffset;
|
|
758
|
-
if (byteOffset >= buffer.length) {
|
|
759
|
-
if (dir)
|
|
760
|
-
return -1;
|
|
761
|
-
else
|
|
762
|
-
byteOffset = buffer.length - 1;
|
|
763
|
-
} else if (byteOffset < 0) {
|
|
764
|
-
if (dir)
|
|
765
|
-
byteOffset = 0;
|
|
766
|
-
else
|
|
767
|
-
return -1;
|
|
768
|
-
}
|
|
769
|
-
if (typeof val === "string") {
|
|
770
|
-
val = Buffer2.from(val, encoding);
|
|
771
|
-
}
|
|
772
|
-
if (Buffer2.isBuffer(val)) {
|
|
773
|
-
if (val.length === 0) {
|
|
774
|
-
return -1;
|
|
775
|
-
}
|
|
776
|
-
return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
|
|
777
|
-
} else if (typeof val === "number") {
|
|
778
|
-
val = val & 255;
|
|
779
|
-
if (typeof Uint8Array.prototype.indexOf === "function") {
|
|
780
|
-
if (dir) {
|
|
781
|
-
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
|
|
782
|
-
} else {
|
|
783
|
-
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
|
|
787
|
-
}
|
|
788
|
-
throw new TypeError("val must be string, number or Buffer");
|
|
789
|
-
}
|
|
790
|
-
function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
|
|
791
|
-
let indexSize = 1;
|
|
792
|
-
let arrLength = arr.length;
|
|
793
|
-
let valLength = val.length;
|
|
794
|
-
if (encoding !== void 0) {
|
|
795
|
-
encoding = String(encoding).toLowerCase();
|
|
796
|
-
if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
|
|
797
|
-
if (arr.length < 2 || val.length < 2) {
|
|
798
|
-
return -1;
|
|
799
|
-
}
|
|
800
|
-
indexSize = 2;
|
|
801
|
-
arrLength /= 2;
|
|
802
|
-
valLength /= 2;
|
|
803
|
-
byteOffset /= 2;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
function read(buf, i2) {
|
|
807
|
-
if (indexSize === 1) {
|
|
808
|
-
return buf[i2];
|
|
809
|
-
} else {
|
|
810
|
-
return buf.readUInt16BE(i2 * indexSize);
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
let i;
|
|
814
|
-
if (dir) {
|
|
815
|
-
let foundIndex = -1;
|
|
816
|
-
for (i = byteOffset; i < arrLength; i++) {
|
|
817
|
-
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
|
818
|
-
if (foundIndex === -1)
|
|
819
|
-
foundIndex = i;
|
|
820
|
-
if (i - foundIndex + 1 === valLength)
|
|
821
|
-
return foundIndex * indexSize;
|
|
822
|
-
} else {
|
|
823
|
-
if (foundIndex !== -1)
|
|
824
|
-
i -= i - foundIndex;
|
|
825
|
-
foundIndex = -1;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
} else {
|
|
829
|
-
if (byteOffset + valLength > arrLength)
|
|
830
|
-
byteOffset = arrLength - valLength;
|
|
831
|
-
for (i = byteOffset; i >= 0; i--) {
|
|
832
|
-
let found = true;
|
|
833
|
-
for (let j = 0; j < valLength; j++) {
|
|
834
|
-
if (read(arr, i + j) !== read(val, j)) {
|
|
835
|
-
found = false;
|
|
836
|
-
break;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
if (found)
|
|
840
|
-
return i;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
return -1;
|
|
844
|
-
}
|
|
845
|
-
Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
|
|
846
|
-
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
847
|
-
};
|
|
848
|
-
Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
|
|
849
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
|
|
850
|
-
};
|
|
851
|
-
Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
852
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
853
|
-
};
|
|
854
|
-
function hexWrite(buf, string2, offset, length) {
|
|
855
|
-
offset = Number(offset) || 0;
|
|
856
|
-
const remaining = buf.length - offset;
|
|
857
|
-
if (!length) {
|
|
858
|
-
length = remaining;
|
|
859
|
-
} else {
|
|
860
|
-
length = Number(length);
|
|
861
|
-
if (length > remaining) {
|
|
862
|
-
length = remaining;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
const strLen = string2.length;
|
|
866
|
-
if (length > strLen / 2) {
|
|
867
|
-
length = strLen / 2;
|
|
868
|
-
}
|
|
869
|
-
let i;
|
|
870
|
-
for (i = 0; i < length; ++i) {
|
|
871
|
-
const parsed = parseInt(string2.substr(i * 2, 2), 16);
|
|
872
|
-
if (numberIsNaN(parsed))
|
|
873
|
-
return i;
|
|
874
|
-
buf[offset + i] = parsed;
|
|
875
|
-
}
|
|
876
|
-
return i;
|
|
877
|
-
}
|
|
878
|
-
function utf8Write(buf, string2, offset, length) {
|
|
879
|
-
return blitBuffer(utf8ToBytes(string2, buf.length - offset), buf, offset, length);
|
|
880
|
-
}
|
|
881
|
-
function asciiWrite(buf, string2, offset, length) {
|
|
882
|
-
return blitBuffer(asciiToBytes(string2), buf, offset, length);
|
|
883
|
-
}
|
|
884
|
-
function base64Write(buf, string2, offset, length) {
|
|
885
|
-
return blitBuffer(base64ToBytes(string2), buf, offset, length);
|
|
886
|
-
}
|
|
887
|
-
function ucs2Write(buf, string2, offset, length) {
|
|
888
|
-
return blitBuffer(utf16leToBytes(string2, buf.length - offset), buf, offset, length);
|
|
889
|
-
}
|
|
890
|
-
Buffer2.prototype.write = function write(string2, offset, length, encoding) {
|
|
891
|
-
if (offset === void 0) {
|
|
892
|
-
encoding = "utf8";
|
|
893
|
-
length = this.length;
|
|
894
|
-
offset = 0;
|
|
895
|
-
} else if (length === void 0 && typeof offset === "string") {
|
|
896
|
-
encoding = offset;
|
|
897
|
-
length = this.length;
|
|
898
|
-
offset = 0;
|
|
899
|
-
} else if (isFinite(offset)) {
|
|
900
|
-
offset = offset >>> 0;
|
|
901
|
-
if (isFinite(length)) {
|
|
902
|
-
length = length >>> 0;
|
|
903
|
-
if (encoding === void 0)
|
|
904
|
-
encoding = "utf8";
|
|
905
|
-
} else {
|
|
906
|
-
encoding = length;
|
|
907
|
-
length = void 0;
|
|
908
|
-
}
|
|
909
|
-
} else {
|
|
910
|
-
throw new Error(
|
|
911
|
-
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
912
|
-
);
|
|
913
|
-
}
|
|
914
|
-
const remaining = this.length - offset;
|
|
915
|
-
if (length === void 0 || length > remaining)
|
|
916
|
-
length = remaining;
|
|
917
|
-
if (string2.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
|
|
918
|
-
throw new RangeError("Attempt to write outside buffer bounds");
|
|
919
|
-
}
|
|
920
|
-
if (!encoding)
|
|
921
|
-
encoding = "utf8";
|
|
922
|
-
let loweredCase = false;
|
|
923
|
-
for (; ; ) {
|
|
924
|
-
switch (encoding) {
|
|
925
|
-
case "hex":
|
|
926
|
-
return hexWrite(this, string2, offset, length);
|
|
927
|
-
case "utf8":
|
|
928
|
-
case "utf-8":
|
|
929
|
-
return utf8Write(this, string2, offset, length);
|
|
930
|
-
case "ascii":
|
|
931
|
-
case "latin1":
|
|
932
|
-
case "binary":
|
|
933
|
-
return asciiWrite(this, string2, offset, length);
|
|
934
|
-
case "base64":
|
|
935
|
-
return base64Write(this, string2, offset, length);
|
|
936
|
-
case "ucs2":
|
|
937
|
-
case "ucs-2":
|
|
938
|
-
case "utf16le":
|
|
939
|
-
case "utf-16le":
|
|
940
|
-
return ucs2Write(this, string2, offset, length);
|
|
941
|
-
default:
|
|
942
|
-
if (loweredCase)
|
|
943
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
944
|
-
encoding = ("" + encoding).toLowerCase();
|
|
945
|
-
loweredCase = true;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
Buffer2.prototype.toJSON = function toJSON() {
|
|
950
|
-
return {
|
|
951
|
-
type: "Buffer",
|
|
952
|
-
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
953
|
-
};
|
|
954
|
-
};
|
|
955
|
-
function base64Slice(buf, start, end) {
|
|
956
|
-
if (start === 0 && end === buf.length) {
|
|
957
|
-
return base64.fromByteArray(buf);
|
|
958
|
-
} else {
|
|
959
|
-
return base64.fromByteArray(buf.slice(start, end));
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
function utf8Slice(buf, start, end) {
|
|
963
|
-
end = Math.min(buf.length, end);
|
|
964
|
-
const res = [];
|
|
965
|
-
let i = start;
|
|
966
|
-
while (i < end) {
|
|
967
|
-
const firstByte = buf[i];
|
|
968
|
-
let codePoint = null;
|
|
969
|
-
let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
|
|
970
|
-
if (i + bytesPerSequence <= end) {
|
|
971
|
-
let secondByte, thirdByte, fourthByte, tempCodePoint;
|
|
972
|
-
switch (bytesPerSequence) {
|
|
973
|
-
case 1:
|
|
974
|
-
if (firstByte < 128) {
|
|
975
|
-
codePoint = firstByte;
|
|
976
|
-
}
|
|
977
|
-
break;
|
|
978
|
-
case 2:
|
|
979
|
-
secondByte = buf[i + 1];
|
|
980
|
-
if ((secondByte & 192) === 128) {
|
|
981
|
-
tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
|
|
982
|
-
if (tempCodePoint > 127) {
|
|
983
|
-
codePoint = tempCodePoint;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
break;
|
|
987
|
-
case 3:
|
|
988
|
-
secondByte = buf[i + 1];
|
|
989
|
-
thirdByte = buf[i + 2];
|
|
990
|
-
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
|
|
991
|
-
tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
|
|
992
|
-
if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
|
|
993
|
-
codePoint = tempCodePoint;
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
break;
|
|
997
|
-
case 4:
|
|
998
|
-
secondByte = buf[i + 1];
|
|
999
|
-
thirdByte = buf[i + 2];
|
|
1000
|
-
fourthByte = buf[i + 3];
|
|
1001
|
-
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
|
|
1002
|
-
tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
|
|
1003
|
-
if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
|
|
1004
|
-
codePoint = tempCodePoint;
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
if (codePoint === null) {
|
|
1010
|
-
codePoint = 65533;
|
|
1011
|
-
bytesPerSequence = 1;
|
|
1012
|
-
} else if (codePoint > 65535) {
|
|
1013
|
-
codePoint -= 65536;
|
|
1014
|
-
res.push(codePoint >>> 10 & 1023 | 55296);
|
|
1015
|
-
codePoint = 56320 | codePoint & 1023;
|
|
1016
|
-
}
|
|
1017
|
-
res.push(codePoint);
|
|
1018
|
-
i += bytesPerSequence;
|
|
1019
|
-
}
|
|
1020
|
-
return decodeCodePointsArray(res);
|
|
1021
|
-
}
|
|
1022
|
-
var MAX_ARGUMENTS_LENGTH = 4096;
|
|
1023
|
-
function decodeCodePointsArray(codePoints) {
|
|
1024
|
-
const len = codePoints.length;
|
|
1025
|
-
if (len <= MAX_ARGUMENTS_LENGTH) {
|
|
1026
|
-
return String.fromCharCode.apply(String, codePoints);
|
|
1027
|
-
}
|
|
1028
|
-
let res = "";
|
|
1029
|
-
let i = 0;
|
|
1030
|
-
while (i < len) {
|
|
1031
|
-
res += String.fromCharCode.apply(
|
|
1032
|
-
String,
|
|
1033
|
-
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
|
|
1034
|
-
);
|
|
1035
|
-
}
|
|
1036
|
-
return res;
|
|
1037
|
-
}
|
|
1038
|
-
function asciiSlice(buf, start, end) {
|
|
1039
|
-
let ret = "";
|
|
1040
|
-
end = Math.min(buf.length, end);
|
|
1041
|
-
for (let i = start; i < end; ++i) {
|
|
1042
|
-
ret += String.fromCharCode(buf[i] & 127);
|
|
1043
|
-
}
|
|
1044
|
-
return ret;
|
|
1045
|
-
}
|
|
1046
|
-
function latin1Slice(buf, start, end) {
|
|
1047
|
-
let ret = "";
|
|
1048
|
-
end = Math.min(buf.length, end);
|
|
1049
|
-
for (let i = start; i < end; ++i) {
|
|
1050
|
-
ret += String.fromCharCode(buf[i]);
|
|
1051
|
-
}
|
|
1052
|
-
return ret;
|
|
1053
|
-
}
|
|
1054
|
-
function hexSlice(buf, start, end) {
|
|
1055
|
-
const len = buf.length;
|
|
1056
|
-
if (!start || start < 0)
|
|
1057
|
-
start = 0;
|
|
1058
|
-
if (!end || end < 0 || end > len)
|
|
1059
|
-
end = len;
|
|
1060
|
-
let out = "";
|
|
1061
|
-
for (let i = start; i < end; ++i) {
|
|
1062
|
-
out += hexSliceLookupTable[buf[i]];
|
|
1063
|
-
}
|
|
1064
|
-
return out;
|
|
1065
|
-
}
|
|
1066
|
-
function utf16leSlice(buf, start, end) {
|
|
1067
|
-
const bytes = buf.slice(start, end);
|
|
1068
|
-
let res = "";
|
|
1069
|
-
for (let i = 0; i < bytes.length - 1; i += 2) {
|
|
1070
|
-
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
|
|
1071
|
-
}
|
|
1072
|
-
return res;
|
|
1073
|
-
}
|
|
1074
|
-
Buffer2.prototype.slice = function slice(start, end) {
|
|
1075
|
-
const len = this.length;
|
|
1076
|
-
start = ~~start;
|
|
1077
|
-
end = end === void 0 ? len : ~~end;
|
|
1078
|
-
if (start < 0) {
|
|
1079
|
-
start += len;
|
|
1080
|
-
if (start < 0)
|
|
1081
|
-
start = 0;
|
|
1082
|
-
} else if (start > len) {
|
|
1083
|
-
start = len;
|
|
1084
|
-
}
|
|
1085
|
-
if (end < 0) {
|
|
1086
|
-
end += len;
|
|
1087
|
-
if (end < 0)
|
|
1088
|
-
end = 0;
|
|
1089
|
-
} else if (end > len) {
|
|
1090
|
-
end = len;
|
|
1091
|
-
}
|
|
1092
|
-
if (end < start)
|
|
1093
|
-
end = start;
|
|
1094
|
-
const newBuf = this.subarray(start, end);
|
|
1095
|
-
Object.setPrototypeOf(newBuf, Buffer2.prototype);
|
|
1096
|
-
return newBuf;
|
|
1097
|
-
};
|
|
1098
|
-
function checkOffset(offset, ext, length) {
|
|
1099
|
-
if (offset % 1 !== 0 || offset < 0)
|
|
1100
|
-
throw new RangeError("offset is not uint");
|
|
1101
|
-
if (offset + ext > length)
|
|
1102
|
-
throw new RangeError("Trying to access beyond buffer length");
|
|
1103
|
-
}
|
|
1104
|
-
Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
|
|
1105
|
-
offset = offset >>> 0;
|
|
1106
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1107
|
-
if (!noAssert)
|
|
1108
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1109
|
-
let val = this[offset];
|
|
1110
|
-
let mul = 1;
|
|
1111
|
-
let i = 0;
|
|
1112
|
-
while (++i < byteLength2 && (mul *= 256)) {
|
|
1113
|
-
val += this[offset + i] * mul;
|
|
1114
|
-
}
|
|
1115
|
-
return val;
|
|
1116
|
-
};
|
|
1117
|
-
Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
|
|
1118
|
-
offset = offset >>> 0;
|
|
1119
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1120
|
-
if (!noAssert) {
|
|
1121
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1122
|
-
}
|
|
1123
|
-
let val = this[offset + --byteLength2];
|
|
1124
|
-
let mul = 1;
|
|
1125
|
-
while (byteLength2 > 0 && (mul *= 256)) {
|
|
1126
|
-
val += this[offset + --byteLength2] * mul;
|
|
1127
|
-
}
|
|
1128
|
-
return val;
|
|
1129
|
-
};
|
|
1130
|
-
Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
1131
|
-
offset = offset >>> 0;
|
|
1132
|
-
if (!noAssert)
|
|
1133
|
-
checkOffset(offset, 1, this.length);
|
|
1134
|
-
return this[offset];
|
|
1135
|
-
};
|
|
1136
|
-
Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
1137
|
-
offset = offset >>> 0;
|
|
1138
|
-
if (!noAssert)
|
|
1139
|
-
checkOffset(offset, 2, this.length);
|
|
1140
|
-
return this[offset] | this[offset + 1] << 8;
|
|
1141
|
-
};
|
|
1142
|
-
Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
1143
|
-
offset = offset >>> 0;
|
|
1144
|
-
if (!noAssert)
|
|
1145
|
-
checkOffset(offset, 2, this.length);
|
|
1146
|
-
return this[offset] << 8 | this[offset + 1];
|
|
1147
|
-
};
|
|
1148
|
-
Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
1149
|
-
offset = offset >>> 0;
|
|
1150
|
-
if (!noAssert)
|
|
1151
|
-
checkOffset(offset, 4, this.length);
|
|
1152
|
-
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
1153
|
-
};
|
|
1154
|
-
Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
1155
|
-
offset = offset >>> 0;
|
|
1156
|
-
if (!noAssert)
|
|
1157
|
-
checkOffset(offset, 4, this.length);
|
|
1158
|
-
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
1159
|
-
};
|
|
1160
|
-
Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
|
|
1161
|
-
offset = offset >>> 0;
|
|
1162
|
-
validateNumber(offset, "offset");
|
|
1163
|
-
const first = this[offset];
|
|
1164
|
-
const last = this[offset + 7];
|
|
1165
|
-
if (first === void 0 || last === void 0) {
|
|
1166
|
-
boundsError(offset, this.length - 8);
|
|
1167
|
-
}
|
|
1168
|
-
const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
|
|
1169
|
-
const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
|
|
1170
|
-
return BigInt(lo) + (BigInt(hi) << BigInt(32));
|
|
1171
|
-
});
|
|
1172
|
-
Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
|
|
1173
|
-
offset = offset >>> 0;
|
|
1174
|
-
validateNumber(offset, "offset");
|
|
1175
|
-
const first = this[offset];
|
|
1176
|
-
const last = this[offset + 7];
|
|
1177
|
-
if (first === void 0 || last === void 0) {
|
|
1178
|
-
boundsError(offset, this.length - 8);
|
|
1179
|
-
}
|
|
1180
|
-
const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
|
|
1181
|
-
const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
|
|
1182
|
-
return (BigInt(hi) << BigInt(32)) + BigInt(lo);
|
|
1183
|
-
});
|
|
1184
|
-
Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
|
|
1185
|
-
offset = offset >>> 0;
|
|
1186
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1187
|
-
if (!noAssert)
|
|
1188
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1189
|
-
let val = this[offset];
|
|
1190
|
-
let mul = 1;
|
|
1191
|
-
let i = 0;
|
|
1192
|
-
while (++i < byteLength2 && (mul *= 256)) {
|
|
1193
|
-
val += this[offset + i] * mul;
|
|
1194
|
-
}
|
|
1195
|
-
mul *= 128;
|
|
1196
|
-
if (val >= mul)
|
|
1197
|
-
val -= Math.pow(2, 8 * byteLength2);
|
|
1198
|
-
return val;
|
|
1199
|
-
};
|
|
1200
|
-
Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
|
|
1201
|
-
offset = offset >>> 0;
|
|
1202
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1203
|
-
if (!noAssert)
|
|
1204
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1205
|
-
let i = byteLength2;
|
|
1206
|
-
let mul = 1;
|
|
1207
|
-
let val = this[offset + --i];
|
|
1208
|
-
while (i > 0 && (mul *= 256)) {
|
|
1209
|
-
val += this[offset + --i] * mul;
|
|
1210
|
-
}
|
|
1211
|
-
mul *= 128;
|
|
1212
|
-
if (val >= mul)
|
|
1213
|
-
val -= Math.pow(2, 8 * byteLength2);
|
|
1214
|
-
return val;
|
|
1215
|
-
};
|
|
1216
|
-
Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
1217
|
-
offset = offset >>> 0;
|
|
1218
|
-
if (!noAssert)
|
|
1219
|
-
checkOffset(offset, 1, this.length);
|
|
1220
|
-
if (!(this[offset] & 128))
|
|
1221
|
-
return this[offset];
|
|
1222
|
-
return (255 - this[offset] + 1) * -1;
|
|
1223
|
-
};
|
|
1224
|
-
Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
1225
|
-
offset = offset >>> 0;
|
|
1226
|
-
if (!noAssert)
|
|
1227
|
-
checkOffset(offset, 2, this.length);
|
|
1228
|
-
const val = this[offset] | this[offset + 1] << 8;
|
|
1229
|
-
return val & 32768 ? val | 4294901760 : val;
|
|
1230
|
-
};
|
|
1231
|
-
Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
1232
|
-
offset = offset >>> 0;
|
|
1233
|
-
if (!noAssert)
|
|
1234
|
-
checkOffset(offset, 2, this.length);
|
|
1235
|
-
const val = this[offset + 1] | this[offset] << 8;
|
|
1236
|
-
return val & 32768 ? val | 4294901760 : val;
|
|
1237
|
-
};
|
|
1238
|
-
Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
1239
|
-
offset = offset >>> 0;
|
|
1240
|
-
if (!noAssert)
|
|
1241
|
-
checkOffset(offset, 4, this.length);
|
|
1242
|
-
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
1243
|
-
};
|
|
1244
|
-
Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
1245
|
-
offset = offset >>> 0;
|
|
1246
|
-
if (!noAssert)
|
|
1247
|
-
checkOffset(offset, 4, this.length);
|
|
1248
|
-
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
1249
|
-
};
|
|
1250
|
-
Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
|
|
1251
|
-
offset = offset >>> 0;
|
|
1252
|
-
validateNumber(offset, "offset");
|
|
1253
|
-
const first = this[offset];
|
|
1254
|
-
const last = this[offset + 7];
|
|
1255
|
-
if (first === void 0 || last === void 0) {
|
|
1256
|
-
boundsError(offset, this.length - 8);
|
|
1257
|
-
}
|
|
1258
|
-
const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
|
|
1259
|
-
return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
|
|
1260
|
-
});
|
|
1261
|
-
Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
|
|
1262
|
-
offset = offset >>> 0;
|
|
1263
|
-
validateNumber(offset, "offset");
|
|
1264
|
-
const first = this[offset];
|
|
1265
|
-
const last = this[offset + 7];
|
|
1266
|
-
if (first === void 0 || last === void 0) {
|
|
1267
|
-
boundsError(offset, this.length - 8);
|
|
1268
|
-
}
|
|
1269
|
-
const val = (first << 24) + // Overflow
|
|
1270
|
-
this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
|
|
1271
|
-
return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
|
|
1272
|
-
});
|
|
1273
|
-
Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
1274
|
-
offset = offset >>> 0;
|
|
1275
|
-
if (!noAssert)
|
|
1276
|
-
checkOffset(offset, 4, this.length);
|
|
1277
|
-
return ieee754.read(this, offset, true, 23, 4);
|
|
1278
|
-
};
|
|
1279
|
-
Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
1280
|
-
offset = offset >>> 0;
|
|
1281
|
-
if (!noAssert)
|
|
1282
|
-
checkOffset(offset, 4, this.length);
|
|
1283
|
-
return ieee754.read(this, offset, false, 23, 4);
|
|
1284
|
-
};
|
|
1285
|
-
Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
1286
|
-
offset = offset >>> 0;
|
|
1287
|
-
if (!noAssert)
|
|
1288
|
-
checkOffset(offset, 8, this.length);
|
|
1289
|
-
return ieee754.read(this, offset, true, 52, 8);
|
|
1290
|
-
};
|
|
1291
|
-
Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
1292
|
-
offset = offset >>> 0;
|
|
1293
|
-
if (!noAssert)
|
|
1294
|
-
checkOffset(offset, 8, this.length);
|
|
1295
|
-
return ieee754.read(this, offset, false, 52, 8);
|
|
1296
|
-
};
|
|
1297
|
-
function checkInt(buf, value, offset, ext, max, min) {
|
|
1298
|
-
if (!Buffer2.isBuffer(buf))
|
|
1299
|
-
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1300
|
-
if (value > max || value < min)
|
|
1301
|
-
throw new RangeError('"value" argument is out of bounds');
|
|
1302
|
-
if (offset + ext > buf.length)
|
|
1303
|
-
throw new RangeError("Index out of range");
|
|
1304
|
-
}
|
|
1305
|
-
Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
|
|
1306
|
-
value = +value;
|
|
1307
|
-
offset = offset >>> 0;
|
|
1308
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1309
|
-
if (!noAssert) {
|
|
1310
|
-
const maxBytes = Math.pow(2, 8 * byteLength2) - 1;
|
|
1311
|
-
checkInt(this, value, offset, byteLength2, maxBytes, 0);
|
|
1312
|
-
}
|
|
1313
|
-
let mul = 1;
|
|
1314
|
-
let i = 0;
|
|
1315
|
-
this[offset] = value & 255;
|
|
1316
|
-
while (++i < byteLength2 && (mul *= 256)) {
|
|
1317
|
-
this[offset + i] = value / mul & 255;
|
|
1318
|
-
}
|
|
1319
|
-
return offset + byteLength2;
|
|
1320
|
-
};
|
|
1321
|
-
Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
|
|
1322
|
-
value = +value;
|
|
1323
|
-
offset = offset >>> 0;
|
|
1324
|
-
byteLength2 = byteLength2 >>> 0;
|
|
1325
|
-
if (!noAssert) {
|
|
1326
|
-
const maxBytes = Math.pow(2, 8 * byteLength2) - 1;
|
|
1327
|
-
checkInt(this, value, offset, byteLength2, maxBytes, 0);
|
|
1328
|
-
}
|
|
1329
|
-
let i = byteLength2 - 1;
|
|
1330
|
-
let mul = 1;
|
|
1331
|
-
this[offset + i] = value & 255;
|
|
1332
|
-
while (--i >= 0 && (mul *= 256)) {
|
|
1333
|
-
this[offset + i] = value / mul & 255;
|
|
1334
|
-
}
|
|
1335
|
-
return offset + byteLength2;
|
|
1336
|
-
};
|
|
1337
|
-
Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
1338
|
-
value = +value;
|
|
1339
|
-
offset = offset >>> 0;
|
|
1340
|
-
if (!noAssert)
|
|
1341
|
-
checkInt(this, value, offset, 1, 255, 0);
|
|
1342
|
-
this[offset] = value & 255;
|
|
1343
|
-
return offset + 1;
|
|
1344
|
-
};
|
|
1345
|
-
Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
1346
|
-
value = +value;
|
|
1347
|
-
offset = offset >>> 0;
|
|
1348
|
-
if (!noAssert)
|
|
1349
|
-
checkInt(this, value, offset, 2, 65535, 0);
|
|
1350
|
-
this[offset] = value & 255;
|
|
1351
|
-
this[offset + 1] = value >>> 8;
|
|
1352
|
-
return offset + 2;
|
|
1353
|
-
};
|
|
1354
|
-
Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
1355
|
-
value = +value;
|
|
1356
|
-
offset = offset >>> 0;
|
|
1357
|
-
if (!noAssert)
|
|
1358
|
-
checkInt(this, value, offset, 2, 65535, 0);
|
|
1359
|
-
this[offset] = value >>> 8;
|
|
1360
|
-
this[offset + 1] = value & 255;
|
|
1361
|
-
return offset + 2;
|
|
1362
|
-
};
|
|
1363
|
-
Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
1364
|
-
value = +value;
|
|
1365
|
-
offset = offset >>> 0;
|
|
1366
|
-
if (!noAssert)
|
|
1367
|
-
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1368
|
-
this[offset + 3] = value >>> 24;
|
|
1369
|
-
this[offset + 2] = value >>> 16;
|
|
1370
|
-
this[offset + 1] = value >>> 8;
|
|
1371
|
-
this[offset] = value & 255;
|
|
1372
|
-
return offset + 4;
|
|
1373
|
-
};
|
|
1374
|
-
Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
1375
|
-
value = +value;
|
|
1376
|
-
offset = offset >>> 0;
|
|
1377
|
-
if (!noAssert)
|
|
1378
|
-
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1379
|
-
this[offset] = value >>> 24;
|
|
1380
|
-
this[offset + 1] = value >>> 16;
|
|
1381
|
-
this[offset + 2] = value >>> 8;
|
|
1382
|
-
this[offset + 3] = value & 255;
|
|
1383
|
-
return offset + 4;
|
|
1384
|
-
};
|
|
1385
|
-
function wrtBigUInt64LE(buf, value, offset, min, max) {
|
|
1386
|
-
checkIntBI(value, min, max, buf, offset, 7);
|
|
1387
|
-
let lo = Number(value & BigInt(4294967295));
|
|
1388
|
-
buf[offset++] = lo;
|
|
1389
|
-
lo = lo >> 8;
|
|
1390
|
-
buf[offset++] = lo;
|
|
1391
|
-
lo = lo >> 8;
|
|
1392
|
-
buf[offset++] = lo;
|
|
1393
|
-
lo = lo >> 8;
|
|
1394
|
-
buf[offset++] = lo;
|
|
1395
|
-
let hi = Number(value >> BigInt(32) & BigInt(4294967295));
|
|
1396
|
-
buf[offset++] = hi;
|
|
1397
|
-
hi = hi >> 8;
|
|
1398
|
-
buf[offset++] = hi;
|
|
1399
|
-
hi = hi >> 8;
|
|
1400
|
-
buf[offset++] = hi;
|
|
1401
|
-
hi = hi >> 8;
|
|
1402
|
-
buf[offset++] = hi;
|
|
1403
|
-
return offset;
|
|
1404
|
-
}
|
|
1405
|
-
function wrtBigUInt64BE(buf, value, offset, min, max) {
|
|
1406
|
-
checkIntBI(value, min, max, buf, offset, 7);
|
|
1407
|
-
let lo = Number(value & BigInt(4294967295));
|
|
1408
|
-
buf[offset + 7] = lo;
|
|
1409
|
-
lo = lo >> 8;
|
|
1410
|
-
buf[offset + 6] = lo;
|
|
1411
|
-
lo = lo >> 8;
|
|
1412
|
-
buf[offset + 5] = lo;
|
|
1413
|
-
lo = lo >> 8;
|
|
1414
|
-
buf[offset + 4] = lo;
|
|
1415
|
-
let hi = Number(value >> BigInt(32) & BigInt(4294967295));
|
|
1416
|
-
buf[offset + 3] = hi;
|
|
1417
|
-
hi = hi >> 8;
|
|
1418
|
-
buf[offset + 2] = hi;
|
|
1419
|
-
hi = hi >> 8;
|
|
1420
|
-
buf[offset + 1] = hi;
|
|
1421
|
-
hi = hi >> 8;
|
|
1422
|
-
buf[offset] = hi;
|
|
1423
|
-
return offset + 8;
|
|
1424
|
-
}
|
|
1425
|
-
Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {
|
|
1426
|
-
return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1427
|
-
});
|
|
1428
|
-
Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {
|
|
1429
|
-
return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1430
|
-
});
|
|
1431
|
-
Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
|
|
1432
|
-
value = +value;
|
|
1433
|
-
offset = offset >>> 0;
|
|
1434
|
-
if (!noAssert) {
|
|
1435
|
-
const limit = Math.pow(2, 8 * byteLength2 - 1);
|
|
1436
|
-
checkInt(this, value, offset, byteLength2, limit - 1, -limit);
|
|
1437
|
-
}
|
|
1438
|
-
let i = 0;
|
|
1439
|
-
let mul = 1;
|
|
1440
|
-
let sub = 0;
|
|
1441
|
-
this[offset] = value & 255;
|
|
1442
|
-
while (++i < byteLength2 && (mul *= 256)) {
|
|
1443
|
-
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
|
|
1444
|
-
sub = 1;
|
|
1445
|
-
}
|
|
1446
|
-
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1447
|
-
}
|
|
1448
|
-
return offset + byteLength2;
|
|
1449
|
-
};
|
|
1450
|
-
Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
|
|
1451
|
-
value = +value;
|
|
1452
|
-
offset = offset >>> 0;
|
|
1453
|
-
if (!noAssert) {
|
|
1454
|
-
const limit = Math.pow(2, 8 * byteLength2 - 1);
|
|
1455
|
-
checkInt(this, value, offset, byteLength2, limit - 1, -limit);
|
|
1456
|
-
}
|
|
1457
|
-
let i = byteLength2 - 1;
|
|
1458
|
-
let mul = 1;
|
|
1459
|
-
let sub = 0;
|
|
1460
|
-
this[offset + i] = value & 255;
|
|
1461
|
-
while (--i >= 0 && (mul *= 256)) {
|
|
1462
|
-
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
|
|
1463
|
-
sub = 1;
|
|
1464
|
-
}
|
|
1465
|
-
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1466
|
-
}
|
|
1467
|
-
return offset + byteLength2;
|
|
1468
|
-
};
|
|
1469
|
-
Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
1470
|
-
value = +value;
|
|
1471
|
-
offset = offset >>> 0;
|
|
1472
|
-
if (!noAssert)
|
|
1473
|
-
checkInt(this, value, offset, 1, 127, -128);
|
|
1474
|
-
if (value < 0)
|
|
1475
|
-
value = 255 + value + 1;
|
|
1476
|
-
this[offset] = value & 255;
|
|
1477
|
-
return offset + 1;
|
|
1478
|
-
};
|
|
1479
|
-
Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
1480
|
-
value = +value;
|
|
1481
|
-
offset = offset >>> 0;
|
|
1482
|
-
if (!noAssert)
|
|
1483
|
-
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1484
|
-
this[offset] = value & 255;
|
|
1485
|
-
this[offset + 1] = value >>> 8;
|
|
1486
|
-
return offset + 2;
|
|
1487
|
-
};
|
|
1488
|
-
Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
1489
|
-
value = +value;
|
|
1490
|
-
offset = offset >>> 0;
|
|
1491
|
-
if (!noAssert)
|
|
1492
|
-
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1493
|
-
this[offset] = value >>> 8;
|
|
1494
|
-
this[offset + 1] = value & 255;
|
|
1495
|
-
return offset + 2;
|
|
1496
|
-
};
|
|
1497
|
-
Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
1498
|
-
value = +value;
|
|
1499
|
-
offset = offset >>> 0;
|
|
1500
|
-
if (!noAssert)
|
|
1501
|
-
checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1502
|
-
this[offset] = value & 255;
|
|
1503
|
-
this[offset + 1] = value >>> 8;
|
|
1504
|
-
this[offset + 2] = value >>> 16;
|
|
1505
|
-
this[offset + 3] = value >>> 24;
|
|
1506
|
-
return offset + 4;
|
|
1507
|
-
};
|
|
1508
|
-
Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
1509
|
-
value = +value;
|
|
1510
|
-
offset = offset >>> 0;
|
|
1511
|
-
if (!noAssert)
|
|
1512
|
-
checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1513
|
-
if (value < 0)
|
|
1514
|
-
value = 4294967295 + value + 1;
|
|
1515
|
-
this[offset] = value >>> 24;
|
|
1516
|
-
this[offset + 1] = value >>> 16;
|
|
1517
|
-
this[offset + 2] = value >>> 8;
|
|
1518
|
-
this[offset + 3] = value & 255;
|
|
1519
|
-
return offset + 4;
|
|
1520
|
-
};
|
|
1521
|
-
Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {
|
|
1522
|
-
return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1523
|
-
});
|
|
1524
|
-
Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {
|
|
1525
|
-
return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1526
|
-
});
|
|
1527
|
-
function checkIEEE754(buf, value, offset, ext, max, min) {
|
|
1528
|
-
if (offset + ext > buf.length)
|
|
1529
|
-
throw new RangeError("Index out of range");
|
|
1530
|
-
if (offset < 0)
|
|
1531
|
-
throw new RangeError("Index out of range");
|
|
1532
|
-
}
|
|
1533
|
-
function writeFloat(buf, value, offset, littleEndian, noAssert) {
|
|
1534
|
-
value = +value;
|
|
1535
|
-
offset = offset >>> 0;
|
|
1536
|
-
if (!noAssert) {
|
|
1537
|
-
checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);
|
|
1538
|
-
}
|
|
1539
|
-
ieee754.write(buf, value, offset, littleEndian, 23, 4);
|
|
1540
|
-
return offset + 4;
|
|
1541
|
-
}
|
|
1542
|
-
Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
|
|
1543
|
-
return writeFloat(this, value, offset, true, noAssert);
|
|
1544
|
-
};
|
|
1545
|
-
Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
|
|
1546
|
-
return writeFloat(this, value, offset, false, noAssert);
|
|
1547
|
-
};
|
|
1548
|
-
function writeDouble(buf, value, offset, littleEndian, noAssert) {
|
|
1549
|
-
value = +value;
|
|
1550
|
-
offset = offset >>> 0;
|
|
1551
|
-
if (!noAssert) {
|
|
1552
|
-
checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);
|
|
1553
|
-
}
|
|
1554
|
-
ieee754.write(buf, value, offset, littleEndian, 52, 8);
|
|
1555
|
-
return offset + 8;
|
|
1556
|
-
}
|
|
1557
|
-
Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
|
|
1558
|
-
return writeDouble(this, value, offset, true, noAssert);
|
|
1559
|
-
};
|
|
1560
|
-
Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
|
|
1561
|
-
return writeDouble(this, value, offset, false, noAssert);
|
|
1562
|
-
};
|
|
1563
|
-
Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
|
|
1564
|
-
if (!Buffer2.isBuffer(target))
|
|
1565
|
-
throw new TypeError("argument should be a Buffer");
|
|
1566
|
-
if (!start)
|
|
1567
|
-
start = 0;
|
|
1568
|
-
if (!end && end !== 0)
|
|
1569
|
-
end = this.length;
|
|
1570
|
-
if (targetStart >= target.length)
|
|
1571
|
-
targetStart = target.length;
|
|
1572
|
-
if (!targetStart)
|
|
1573
|
-
targetStart = 0;
|
|
1574
|
-
if (end > 0 && end < start)
|
|
1575
|
-
end = start;
|
|
1576
|
-
if (end === start)
|
|
1577
|
-
return 0;
|
|
1578
|
-
if (target.length === 0 || this.length === 0)
|
|
1579
|
-
return 0;
|
|
1580
|
-
if (targetStart < 0) {
|
|
1581
|
-
throw new RangeError("targetStart out of bounds");
|
|
1582
|
-
}
|
|
1583
|
-
if (start < 0 || start >= this.length)
|
|
1584
|
-
throw new RangeError("Index out of range");
|
|
1585
|
-
if (end < 0)
|
|
1586
|
-
throw new RangeError("sourceEnd out of bounds");
|
|
1587
|
-
if (end > this.length)
|
|
1588
|
-
end = this.length;
|
|
1589
|
-
if (target.length - targetStart < end - start) {
|
|
1590
|
-
end = target.length - targetStart + start;
|
|
1591
|
-
}
|
|
1592
|
-
const len = end - start;
|
|
1593
|
-
if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {
|
|
1594
|
-
this.copyWithin(targetStart, start, end);
|
|
1595
|
-
} else {
|
|
1596
|
-
Uint8Array.prototype.set.call(
|
|
1597
|
-
target,
|
|
1598
|
-
this.subarray(start, end),
|
|
1599
|
-
targetStart
|
|
1600
|
-
);
|
|
1601
|
-
}
|
|
1602
|
-
return len;
|
|
1603
|
-
};
|
|
1604
|
-
Buffer2.prototype.fill = function fill(val, start, end, encoding) {
|
|
1605
|
-
if (typeof val === "string") {
|
|
1606
|
-
if (typeof start === "string") {
|
|
1607
|
-
encoding = start;
|
|
1608
|
-
start = 0;
|
|
1609
|
-
end = this.length;
|
|
1610
|
-
} else if (typeof end === "string") {
|
|
1611
|
-
encoding = end;
|
|
1612
|
-
end = this.length;
|
|
1613
|
-
}
|
|
1614
|
-
if (encoding !== void 0 && typeof encoding !== "string") {
|
|
1615
|
-
throw new TypeError("encoding must be a string");
|
|
1616
|
-
}
|
|
1617
|
-
if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
|
|
1618
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
1619
|
-
}
|
|
1620
|
-
if (val.length === 1) {
|
|
1621
|
-
const code = val.charCodeAt(0);
|
|
1622
|
-
if (encoding === "utf8" && code < 128 || encoding === "latin1") {
|
|
1623
|
-
val = code;
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
} else if (typeof val === "number") {
|
|
1627
|
-
val = val & 255;
|
|
1628
|
-
} else if (typeof val === "boolean") {
|
|
1629
|
-
val = Number(val);
|
|
1630
|
-
}
|
|
1631
|
-
if (start < 0 || this.length < start || this.length < end) {
|
|
1632
|
-
throw new RangeError("Out of range index");
|
|
1633
|
-
}
|
|
1634
|
-
if (end <= start) {
|
|
1635
|
-
return this;
|
|
1636
|
-
}
|
|
1637
|
-
start = start >>> 0;
|
|
1638
|
-
end = end === void 0 ? this.length : end >>> 0;
|
|
1639
|
-
if (!val)
|
|
1640
|
-
val = 0;
|
|
1641
|
-
let i;
|
|
1642
|
-
if (typeof val === "number") {
|
|
1643
|
-
for (i = start; i < end; ++i) {
|
|
1644
|
-
this[i] = val;
|
|
1645
|
-
}
|
|
1646
|
-
} else {
|
|
1647
|
-
const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding);
|
|
1648
|
-
const len = bytes.length;
|
|
1649
|
-
if (len === 0) {
|
|
1650
|
-
throw new TypeError('The value "' + val + '" is invalid for argument "value"');
|
|
1651
|
-
}
|
|
1652
|
-
for (i = 0; i < end - start; ++i) {
|
|
1653
|
-
this[i + start] = bytes[i % len];
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
return this;
|
|
1657
|
-
};
|
|
1658
|
-
var errors = {};
|
|
1659
|
-
function E(sym, getMessage, Base) {
|
|
1660
|
-
errors[sym] = class NodeError extends Base {
|
|
1661
|
-
constructor() {
|
|
1662
|
-
super();
|
|
1663
|
-
Object.defineProperty(this, "message", {
|
|
1664
|
-
value: getMessage.apply(this, arguments),
|
|
1665
|
-
writable: true,
|
|
1666
|
-
configurable: true
|
|
1667
|
-
});
|
|
1668
|
-
this.name = `${this.name} [${sym}]`;
|
|
1669
|
-
this.stack;
|
|
1670
|
-
delete this.name;
|
|
1671
|
-
}
|
|
1672
|
-
get code() {
|
|
1673
|
-
return sym;
|
|
1674
|
-
}
|
|
1675
|
-
set code(value) {
|
|
1676
|
-
Object.defineProperty(this, "code", {
|
|
1677
|
-
configurable: true,
|
|
1678
|
-
enumerable: true,
|
|
1679
|
-
value,
|
|
1680
|
-
writable: true
|
|
1681
|
-
});
|
|
1682
|
-
}
|
|
1683
|
-
toString() {
|
|
1684
|
-
return `${this.name} [${sym}]: ${this.message}`;
|
|
1685
|
-
}
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
|
-
E(
|
|
1689
|
-
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1690
|
-
function(name) {
|
|
1691
|
-
if (name) {
|
|
1692
|
-
return `${name} is outside of buffer bounds`;
|
|
1693
|
-
}
|
|
1694
|
-
return "Attempt to access memory outside buffer bounds";
|
|
1695
|
-
},
|
|
1696
|
-
RangeError
|
|
1697
|
-
);
|
|
1698
|
-
E(
|
|
1699
|
-
"ERR_INVALID_ARG_TYPE",
|
|
1700
|
-
function(name, actual) {
|
|
1701
|
-
return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
|
|
1702
|
-
},
|
|
1703
|
-
TypeError
|
|
1704
|
-
);
|
|
1705
|
-
E(
|
|
1706
|
-
"ERR_OUT_OF_RANGE",
|
|
1707
|
-
function(str, range, input) {
|
|
1708
|
-
let msg = `The value of "${str}" is out of range.`;
|
|
1709
|
-
let received = input;
|
|
1710
|
-
if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
|
|
1711
|
-
received = addNumericalSeparator(String(input));
|
|
1712
|
-
} else if (typeof input === "bigint") {
|
|
1713
|
-
received = String(input);
|
|
1714
|
-
if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
|
|
1715
|
-
received = addNumericalSeparator(received);
|
|
1716
|
-
}
|
|
1717
|
-
received += "n";
|
|
1718
|
-
}
|
|
1719
|
-
msg += ` It must be ${range}. Received ${received}`;
|
|
1720
|
-
return msg;
|
|
1721
|
-
},
|
|
1722
|
-
RangeError
|
|
1723
|
-
);
|
|
1724
|
-
function addNumericalSeparator(val) {
|
|
1725
|
-
let res = "";
|
|
1726
|
-
let i = val.length;
|
|
1727
|
-
const start = val[0] === "-" ? 1 : 0;
|
|
1728
|
-
for (; i >= start + 4; i -= 3) {
|
|
1729
|
-
res = `_${val.slice(i - 3, i)}${res}`;
|
|
1730
|
-
}
|
|
1731
|
-
return `${val.slice(0, i)}${res}`;
|
|
1732
|
-
}
|
|
1733
|
-
function checkBounds(buf, offset, byteLength2) {
|
|
1734
|
-
validateNumber(offset, "offset");
|
|
1735
|
-
if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) {
|
|
1736
|
-
boundsError(offset, buf.length - (byteLength2 + 1));
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
function checkIntBI(value, min, max, buf, offset, byteLength2) {
|
|
1740
|
-
if (value > max || value < min) {
|
|
1741
|
-
const n = typeof min === "bigint" ? "n" : "";
|
|
1742
|
-
let range;
|
|
1743
|
-
if (byteLength2 > 3) {
|
|
1744
|
-
if (min === 0 || min === BigInt(0)) {
|
|
1745
|
-
range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`;
|
|
1746
|
-
} else {
|
|
1747
|
-
range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`;
|
|
1748
|
-
}
|
|
1749
|
-
} else {
|
|
1750
|
-
range = `>= ${min}${n} and <= ${max}${n}`;
|
|
1751
|
-
}
|
|
1752
|
-
throw new errors.ERR_OUT_OF_RANGE("value", range, value);
|
|
1753
|
-
}
|
|
1754
|
-
checkBounds(buf, offset, byteLength2);
|
|
1755
|
-
}
|
|
1756
|
-
function validateNumber(value, name) {
|
|
1757
|
-
if (typeof value !== "number") {
|
|
1758
|
-
throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
function boundsError(value, length, type) {
|
|
1762
|
-
if (Math.floor(value) !== value) {
|
|
1763
|
-
validateNumber(value, type);
|
|
1764
|
-
throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);
|
|
1765
|
-
}
|
|
1766
|
-
if (length < 0) {
|
|
1767
|
-
throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
|
|
1768
|
-
}
|
|
1769
|
-
throw new errors.ERR_OUT_OF_RANGE(
|
|
1770
|
-
type || "offset",
|
|
1771
|
-
`>= ${type ? 1 : 0} and <= ${length}`,
|
|
1772
|
-
value
|
|
1773
|
-
);
|
|
1774
|
-
}
|
|
1775
|
-
var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
|
|
1776
|
-
function base64clean(str) {
|
|
1777
|
-
str = str.split("=")[0];
|
|
1778
|
-
str = str.trim().replace(INVALID_BASE64_RE, "");
|
|
1779
|
-
if (str.length < 2)
|
|
1780
|
-
return "";
|
|
1781
|
-
while (str.length % 4 !== 0) {
|
|
1782
|
-
str = str + "=";
|
|
1783
|
-
}
|
|
1784
|
-
return str;
|
|
1785
|
-
}
|
|
1786
|
-
function utf8ToBytes(string2, units) {
|
|
1787
|
-
units = units || Infinity;
|
|
1788
|
-
let codePoint;
|
|
1789
|
-
const length = string2.length;
|
|
1790
|
-
let leadSurrogate = null;
|
|
1791
|
-
const bytes = [];
|
|
1792
|
-
for (let i = 0; i < length; ++i) {
|
|
1793
|
-
codePoint = string2.charCodeAt(i);
|
|
1794
|
-
if (codePoint > 55295 && codePoint < 57344) {
|
|
1795
|
-
if (!leadSurrogate) {
|
|
1796
|
-
if (codePoint > 56319) {
|
|
1797
|
-
if ((units -= 3) > -1)
|
|
1798
|
-
bytes.push(239, 191, 189);
|
|
1799
|
-
continue;
|
|
1800
|
-
} else if (i + 1 === length) {
|
|
1801
|
-
if ((units -= 3) > -1)
|
|
1802
|
-
bytes.push(239, 191, 189);
|
|
1803
|
-
continue;
|
|
1804
|
-
}
|
|
1805
|
-
leadSurrogate = codePoint;
|
|
1806
|
-
continue;
|
|
1807
|
-
}
|
|
1808
|
-
if (codePoint < 56320) {
|
|
1809
|
-
if ((units -= 3) > -1)
|
|
1810
|
-
bytes.push(239, 191, 189);
|
|
1811
|
-
leadSurrogate = codePoint;
|
|
1812
|
-
continue;
|
|
1813
|
-
}
|
|
1814
|
-
codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
|
|
1815
|
-
} else if (leadSurrogate) {
|
|
1816
|
-
if ((units -= 3) > -1)
|
|
1817
|
-
bytes.push(239, 191, 189);
|
|
1818
|
-
}
|
|
1819
|
-
leadSurrogate = null;
|
|
1820
|
-
if (codePoint < 128) {
|
|
1821
|
-
if ((units -= 1) < 0)
|
|
1822
|
-
break;
|
|
1823
|
-
bytes.push(codePoint);
|
|
1824
|
-
} else if (codePoint < 2048) {
|
|
1825
|
-
if ((units -= 2) < 0)
|
|
1826
|
-
break;
|
|
1827
|
-
bytes.push(
|
|
1828
|
-
codePoint >> 6 | 192,
|
|
1829
|
-
codePoint & 63 | 128
|
|
1830
|
-
);
|
|
1831
|
-
} else if (codePoint < 65536) {
|
|
1832
|
-
if ((units -= 3) < 0)
|
|
1833
|
-
break;
|
|
1834
|
-
bytes.push(
|
|
1835
|
-
codePoint >> 12 | 224,
|
|
1836
|
-
codePoint >> 6 & 63 | 128,
|
|
1837
|
-
codePoint & 63 | 128
|
|
1838
|
-
);
|
|
1839
|
-
} else if (codePoint < 1114112) {
|
|
1840
|
-
if ((units -= 4) < 0)
|
|
1841
|
-
break;
|
|
1842
|
-
bytes.push(
|
|
1843
|
-
codePoint >> 18 | 240,
|
|
1844
|
-
codePoint >> 12 & 63 | 128,
|
|
1845
|
-
codePoint >> 6 & 63 | 128,
|
|
1846
|
-
codePoint & 63 | 128
|
|
1847
|
-
);
|
|
1848
|
-
} else {
|
|
1849
|
-
throw new Error("Invalid code point");
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
return bytes;
|
|
1853
|
-
}
|
|
1854
|
-
function asciiToBytes(str) {
|
|
1855
|
-
const byteArray = [];
|
|
1856
|
-
for (let i = 0; i < str.length; ++i) {
|
|
1857
|
-
byteArray.push(str.charCodeAt(i) & 255);
|
|
1858
|
-
}
|
|
1859
|
-
return byteArray;
|
|
1860
|
-
}
|
|
1861
|
-
function utf16leToBytes(str, units) {
|
|
1862
|
-
let c, hi, lo;
|
|
1863
|
-
const byteArray = [];
|
|
1864
|
-
for (let i = 0; i < str.length; ++i) {
|
|
1865
|
-
if ((units -= 2) < 0)
|
|
1866
|
-
break;
|
|
1867
|
-
c = str.charCodeAt(i);
|
|
1868
|
-
hi = c >> 8;
|
|
1869
|
-
lo = c % 256;
|
|
1870
|
-
byteArray.push(lo);
|
|
1871
|
-
byteArray.push(hi);
|
|
1872
|
-
}
|
|
1873
|
-
return byteArray;
|
|
1874
|
-
}
|
|
1875
|
-
function base64ToBytes(str) {
|
|
1876
|
-
return base64.toByteArray(base64clean(str));
|
|
1877
|
-
}
|
|
1878
|
-
function blitBuffer(src, dst, offset, length) {
|
|
1879
|
-
let i;
|
|
1880
|
-
for (i = 0; i < length; ++i) {
|
|
1881
|
-
if (i + offset >= dst.length || i >= src.length)
|
|
1882
|
-
break;
|
|
1883
|
-
dst[i + offset] = src[i];
|
|
1884
|
-
}
|
|
1885
|
-
return i;
|
|
1886
|
-
}
|
|
1887
|
-
function isInstance(obj, type) {
|
|
1888
|
-
return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
|
|
1889
|
-
}
|
|
1890
|
-
function numberIsNaN(obj) {
|
|
1891
|
-
return obj !== obj;
|
|
1892
|
-
}
|
|
1893
|
-
var hexSliceLookupTable = function() {
|
|
1894
|
-
const alphabet = "0123456789abcdef";
|
|
1895
|
-
const table = new Array(256);
|
|
1896
|
-
for (let i = 0; i < 16; ++i) {
|
|
1897
|
-
const i16 = i * 16;
|
|
1898
|
-
for (let j = 0; j < 16; ++j) {
|
|
1899
|
-
table[i16 + j] = alphabet[i] + alphabet[j];
|
|
1900
|
-
}
|
|
1901
|
-
}
|
|
1902
|
-
return table;
|
|
1903
|
-
}();
|
|
1904
|
-
function defineBigIntMethod(fn) {
|
|
1905
|
-
return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
|
|
1906
|
-
}
|
|
1907
|
-
function BufferBigIntNotDefined() {
|
|
1908
|
-
throw new Error("BigInt not supported");
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
});
|
|
1912
|
-
|
|
1913
|
-
// .yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-f2f1f7943c.zip/node_modules/safe-buffer/index.js
|
|
1914
|
-
var require_safe_buffer = __commonJS({
|
|
1915
|
-
".yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-f2f1f7943c.zip/node_modules/safe-buffer/index.js"(exports, module2) {
|
|
1916
|
-
var buffer = require_buffer();
|
|
1917
|
-
var Buffer2 = buffer.Buffer;
|
|
1918
|
-
function copyProps(src, dst) {
|
|
1919
|
-
for (var key in src) {
|
|
1920
|
-
dst[key] = src[key];
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
1924
|
-
module2.exports = buffer;
|
|
1925
|
-
} else {
|
|
1926
|
-
copyProps(buffer, exports);
|
|
1927
|
-
exports.Buffer = SafeBuffer;
|
|
1928
|
-
}
|
|
1929
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
1930
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
1931
|
-
}
|
|
1932
|
-
copyProps(Buffer2, SafeBuffer);
|
|
1933
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
1934
|
-
if (typeof arg === "number") {
|
|
1935
|
-
throw new TypeError("Argument must not be a number");
|
|
1936
|
-
}
|
|
1937
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
1938
|
-
};
|
|
1939
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
1940
|
-
if (typeof size !== "number") {
|
|
1941
|
-
throw new TypeError("Argument must be a number");
|
|
1942
|
-
}
|
|
1943
|
-
var buf = Buffer2(size);
|
|
1944
|
-
if (fill !== void 0) {
|
|
1945
|
-
if (typeof encoding === "string") {
|
|
1946
|
-
buf.fill(fill, encoding);
|
|
1947
|
-
} else {
|
|
1948
|
-
buf.fill(fill);
|
|
1949
|
-
}
|
|
1950
|
-
} else {
|
|
1951
|
-
buf.fill(0);
|
|
1952
|
-
}
|
|
1953
|
-
return buf;
|
|
1954
|
-
};
|
|
1955
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
1956
|
-
if (typeof size !== "number") {
|
|
1957
|
-
throw new TypeError("Argument must be a number");
|
|
1958
|
-
}
|
|
1959
|
-
return Buffer2(size);
|
|
1960
|
-
};
|
|
1961
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
1962
|
-
if (typeof size !== "number") {
|
|
1963
|
-
throw new TypeError("Argument must be a number");
|
|
1964
|
-
}
|
|
1965
|
-
return buffer.SlowBuffer(size);
|
|
1966
|
-
};
|
|
1967
|
-
}
|
|
1968
|
-
});
|
|
1969
|
-
|
|
1970
|
-
// .yarn/cache/basic-auth-npm-2.0.1-f1627ef330-3419b805d5.zip/node_modules/basic-auth/index.js
|
|
1971
|
-
var require_basic_auth = __commonJS({
|
|
1972
|
-
".yarn/cache/basic-auth-npm-2.0.1-f1627ef330-3419b805d5.zip/node_modules/basic-auth/index.js"(exports, module2) {
|
|
1973
|
-
"use strict";
|
|
1974
|
-
var Buffer2 = require_safe_buffer().Buffer;
|
|
1975
|
-
module2.exports = auth;
|
|
1976
|
-
module2.exports.parse = parse2;
|
|
1977
|
-
var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/;
|
|
1978
|
-
var USER_PASS_REGEXP = /^([^:]*):(.*)$/;
|
|
1979
|
-
function auth(req) {
|
|
1980
|
-
if (!req) {
|
|
1981
|
-
throw new TypeError("argument req is required");
|
|
1982
|
-
}
|
|
1983
|
-
if (typeof req !== "object") {
|
|
1984
|
-
throw new TypeError("argument req is required to be an object");
|
|
1985
|
-
}
|
|
1986
|
-
var header = getAuthorization(req);
|
|
1987
|
-
return parse2(header);
|
|
1988
|
-
}
|
|
1989
|
-
function decodeBase64(str) {
|
|
1990
|
-
return Buffer2.from(str, "base64").toString();
|
|
1991
|
-
}
|
|
1992
|
-
function getAuthorization(req) {
|
|
1993
|
-
if (!req.headers || typeof req.headers !== "object") {
|
|
1994
|
-
throw new TypeError("argument req is required to have headers property");
|
|
1995
|
-
}
|
|
1996
|
-
return req.headers.authorization;
|
|
1997
|
-
}
|
|
1998
|
-
function parse2(string2) {
|
|
1999
|
-
if (typeof string2 !== "string") {
|
|
2000
|
-
return void 0;
|
|
2001
|
-
}
|
|
2002
|
-
var match = CREDENTIALS_REGEXP.exec(string2);
|
|
2003
|
-
if (!match) {
|
|
2004
|
-
return void 0;
|
|
2005
|
-
}
|
|
2006
|
-
var userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1]));
|
|
2007
|
-
if (!userPass) {
|
|
2008
|
-
return void 0;
|
|
2009
|
-
}
|
|
2010
|
-
return new Credentials(userPass[1], userPass[2]);
|
|
2011
|
-
}
|
|
2012
|
-
function Credentials(name, pass) {
|
|
2013
|
-
this.name = name;
|
|
2014
|
-
this.pass = pass;
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2018
|
-
|
|
2019
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/bind.js
|
|
2020
|
-
var require_bind = __commonJS({
|
|
2021
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/bind.js"(exports, module2) {
|
|
2022
|
-
"use strict";
|
|
2023
|
-
module2.exports = function bind(fn, thisArg) {
|
|
2024
|
-
return function wrap() {
|
|
2025
|
-
var args = new Array(arguments.length);
|
|
2026
|
-
for (var i = 0; i < args.length; i++) {
|
|
2027
|
-
args[i] = arguments[i];
|
|
2028
|
-
}
|
|
2029
|
-
return fn.apply(thisArg, args);
|
|
2030
|
-
};
|
|
2031
|
-
};
|
|
2032
|
-
}
|
|
2033
|
-
});
|
|
2034
|
-
|
|
2035
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/utils.js
|
|
2036
|
-
var require_utils = __commonJS({
|
|
2037
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/utils.js"(exports, module2) {
|
|
2038
|
-
"use strict";
|
|
2039
|
-
var bind = require_bind();
|
|
2040
|
-
var toString = Object.prototype.toString;
|
|
2041
|
-
var kindOf = function(cache) {
|
|
2042
|
-
return function(thing) {
|
|
2043
|
-
var str = toString.call(thing);
|
|
2044
|
-
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
2045
|
-
};
|
|
2046
|
-
}(/* @__PURE__ */ Object.create(null));
|
|
2047
|
-
function kindOfTest(type) {
|
|
2048
|
-
type = type.toLowerCase();
|
|
2049
|
-
return function isKindOf(thing) {
|
|
2050
|
-
return kindOf(thing) === type;
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
function isArray(val) {
|
|
2054
|
-
return Array.isArray(val);
|
|
2055
|
-
}
|
|
2056
|
-
function isUndefined(val) {
|
|
2057
|
-
return typeof val === "undefined";
|
|
2058
|
-
}
|
|
2059
|
-
function isBuffer(val) {
|
|
2060
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
2061
|
-
}
|
|
2062
|
-
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
2063
|
-
function isArrayBufferView(val) {
|
|
2064
|
-
var result;
|
|
2065
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
2066
|
-
result = ArrayBuffer.isView(val);
|
|
2067
|
-
} else {
|
|
2068
|
-
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
2069
|
-
}
|
|
2070
|
-
return result;
|
|
2071
|
-
}
|
|
2072
|
-
function isString(val) {
|
|
2073
|
-
return typeof val === "string";
|
|
2074
|
-
}
|
|
2075
|
-
function isNumber(val) {
|
|
2076
|
-
return typeof val === "number";
|
|
2077
|
-
}
|
|
2078
|
-
function isObject(val) {
|
|
2079
|
-
return val !== null && typeof val === "object";
|
|
2080
|
-
}
|
|
2081
|
-
function isPlainObject2(val) {
|
|
2082
|
-
if (kindOf(val) !== "object") {
|
|
2083
|
-
return false;
|
|
2084
|
-
}
|
|
2085
|
-
var prototype = Object.getPrototypeOf(val);
|
|
2086
|
-
return prototype === null || prototype === Object.prototype;
|
|
2087
|
-
}
|
|
2088
|
-
var isDate = kindOfTest("Date");
|
|
2089
|
-
var isFile = kindOfTest("File");
|
|
2090
|
-
var isBlob = kindOfTest("Blob");
|
|
2091
|
-
var isFileList = kindOfTest("FileList");
|
|
2092
|
-
function isFunction(val) {
|
|
2093
|
-
return toString.call(val) === "[object Function]";
|
|
2094
|
-
}
|
|
2095
|
-
function isStream(val) {
|
|
2096
|
-
return isObject(val) && isFunction(val.pipe);
|
|
2097
|
-
}
|
|
2098
|
-
function isFormData(thing) {
|
|
2099
|
-
var pattern = "[object FormData]";
|
|
2100
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
|
|
2101
|
-
}
|
|
2102
|
-
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
2103
|
-
function trim(str) {
|
|
2104
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
2105
|
-
}
|
|
2106
|
-
function isStandardBrowserEnv() {
|
|
2107
|
-
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
2108
|
-
return false;
|
|
2109
|
-
}
|
|
2110
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
2111
|
-
}
|
|
2112
|
-
function forEach(obj, fn) {
|
|
2113
|
-
if (obj === null || typeof obj === "undefined") {
|
|
2114
|
-
return;
|
|
2115
|
-
}
|
|
2116
|
-
if (typeof obj !== "object") {
|
|
2117
|
-
obj = [obj];
|
|
2118
|
-
}
|
|
2119
|
-
if (isArray(obj)) {
|
|
2120
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
2121
|
-
fn.call(null, obj[i], i, obj);
|
|
2122
|
-
}
|
|
2123
|
-
} else {
|
|
2124
|
-
for (var key in obj) {
|
|
2125
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2126
|
-
fn.call(null, obj[key], key, obj);
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
function merge() {
|
|
2132
|
-
var result = {};
|
|
2133
|
-
function assignValue(val, key) {
|
|
2134
|
-
if (isPlainObject2(result[key]) && isPlainObject2(val)) {
|
|
2135
|
-
result[key] = merge(result[key], val);
|
|
2136
|
-
} else if (isPlainObject2(val)) {
|
|
2137
|
-
result[key] = merge({}, val);
|
|
2138
|
-
} else if (isArray(val)) {
|
|
2139
|
-
result[key] = val.slice();
|
|
2140
|
-
} else {
|
|
2141
|
-
result[key] = val;
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
2145
|
-
forEach(arguments[i], assignValue);
|
|
2146
|
-
}
|
|
2147
|
-
return result;
|
|
2148
|
-
}
|
|
2149
|
-
function extend(a, b, thisArg) {
|
|
2150
|
-
forEach(b, function assignValue(val, key) {
|
|
2151
|
-
if (thisArg && typeof val === "function") {
|
|
2152
|
-
a[key] = bind(val, thisArg);
|
|
2153
|
-
} else {
|
|
2154
|
-
a[key] = val;
|
|
2155
|
-
}
|
|
2156
|
-
});
|
|
2157
|
-
return a;
|
|
2158
|
-
}
|
|
2159
|
-
function stripBOM(content) {
|
|
2160
|
-
if (content.charCodeAt(0) === 65279) {
|
|
2161
|
-
content = content.slice(1);
|
|
2162
|
-
}
|
|
2163
|
-
return content;
|
|
2164
|
-
}
|
|
2165
|
-
function inherits(constructor, superConstructor, props, descriptors) {
|
|
2166
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
2167
|
-
constructor.prototype.constructor = constructor;
|
|
2168
|
-
props && Object.assign(constructor.prototype, props);
|
|
2169
|
-
}
|
|
2170
|
-
function toFlatObject(sourceObj, destObj, filter) {
|
|
2171
|
-
var props;
|
|
2172
|
-
var i;
|
|
2173
|
-
var prop;
|
|
2174
|
-
var merged = {};
|
|
2175
|
-
destObj = destObj || {};
|
|
2176
|
-
do {
|
|
2177
|
-
props = Object.getOwnPropertyNames(sourceObj);
|
|
2178
|
-
i = props.length;
|
|
2179
|
-
while (i-- > 0) {
|
|
2180
|
-
prop = props[i];
|
|
2181
|
-
if (!merged[prop]) {
|
|
2182
|
-
destObj[prop] = sourceObj[prop];
|
|
2183
|
-
merged[prop] = true;
|
|
2184
|
-
}
|
|
2185
|
-
}
|
|
2186
|
-
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
2187
|
-
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
2188
|
-
return destObj;
|
|
2189
|
-
}
|
|
2190
|
-
function endsWith(str, searchString, position) {
|
|
2191
|
-
str = String(str);
|
|
2192
|
-
if (position === void 0 || position > str.length) {
|
|
2193
|
-
position = str.length;
|
|
2194
|
-
}
|
|
2195
|
-
position -= searchString.length;
|
|
2196
|
-
var lastIndex = str.indexOf(searchString, position);
|
|
2197
|
-
return lastIndex !== -1 && lastIndex === position;
|
|
2198
|
-
}
|
|
2199
|
-
function toArray(thing) {
|
|
2200
|
-
if (!thing)
|
|
2201
|
-
return null;
|
|
2202
|
-
var i = thing.length;
|
|
2203
|
-
if (isUndefined(i))
|
|
2204
|
-
return null;
|
|
2205
|
-
var arr = new Array(i);
|
|
2206
|
-
while (i-- > 0) {
|
|
2207
|
-
arr[i] = thing[i];
|
|
2208
|
-
}
|
|
2209
|
-
return arr;
|
|
2210
|
-
}
|
|
2211
|
-
var isTypedArray = function(TypedArray) {
|
|
2212
|
-
return function(thing) {
|
|
2213
|
-
return TypedArray && thing instanceof TypedArray;
|
|
2214
|
-
};
|
|
2215
|
-
}(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
|
|
2216
|
-
module2.exports = {
|
|
2217
|
-
isArray,
|
|
2218
|
-
isArrayBuffer,
|
|
2219
|
-
isBuffer,
|
|
2220
|
-
isFormData,
|
|
2221
|
-
isArrayBufferView,
|
|
2222
|
-
isString,
|
|
2223
|
-
isNumber,
|
|
2224
|
-
isObject,
|
|
2225
|
-
isPlainObject: isPlainObject2,
|
|
2226
|
-
isUndefined,
|
|
2227
|
-
isDate,
|
|
2228
|
-
isFile,
|
|
2229
|
-
isBlob,
|
|
2230
|
-
isFunction,
|
|
2231
|
-
isStream,
|
|
2232
|
-
isURLSearchParams,
|
|
2233
|
-
isStandardBrowserEnv,
|
|
2234
|
-
forEach,
|
|
2235
|
-
merge,
|
|
2236
|
-
extend,
|
|
2237
|
-
trim,
|
|
2238
|
-
stripBOM,
|
|
2239
|
-
inherits,
|
|
2240
|
-
toFlatObject,
|
|
2241
|
-
kindOf,
|
|
2242
|
-
kindOfTest,
|
|
2243
|
-
endsWith,
|
|
2244
|
-
toArray,
|
|
2245
|
-
isTypedArray,
|
|
2246
|
-
isFileList
|
|
2247
|
-
};
|
|
2248
|
-
}
|
|
2249
|
-
});
|
|
2250
|
-
|
|
2251
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/buildURL.js
|
|
2252
|
-
var require_buildURL = __commonJS({
|
|
2253
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/buildURL.js"(exports, module2) {
|
|
2254
|
-
"use strict";
|
|
2255
|
-
var utils = require_utils();
|
|
2256
|
-
function encode2(val) {
|
|
2257
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2258
|
-
}
|
|
2259
|
-
module2.exports = function buildURL(url, params, paramsSerializer) {
|
|
2260
|
-
if (!params) {
|
|
2261
|
-
return url;
|
|
2262
|
-
}
|
|
2263
|
-
var serializedParams;
|
|
2264
|
-
if (paramsSerializer) {
|
|
2265
|
-
serializedParams = paramsSerializer(params);
|
|
2266
|
-
} else if (utils.isURLSearchParams(params)) {
|
|
2267
|
-
serializedParams = params.toString();
|
|
2268
|
-
} else {
|
|
2269
|
-
var parts = [];
|
|
2270
|
-
utils.forEach(params, function serialize(val, key) {
|
|
2271
|
-
if (val === null || typeof val === "undefined") {
|
|
2272
|
-
return;
|
|
2273
|
-
}
|
|
2274
|
-
if (utils.isArray(val)) {
|
|
2275
|
-
key = key + "[]";
|
|
2276
|
-
} else {
|
|
2277
|
-
val = [val];
|
|
2278
|
-
}
|
|
2279
|
-
utils.forEach(val, function parseValue(v) {
|
|
2280
|
-
if (utils.isDate(v)) {
|
|
2281
|
-
v = v.toISOString();
|
|
2282
|
-
} else if (utils.isObject(v)) {
|
|
2283
|
-
v = JSON.stringify(v);
|
|
2284
|
-
}
|
|
2285
|
-
parts.push(encode2(key) + "=" + encode2(v));
|
|
2286
|
-
});
|
|
2287
|
-
});
|
|
2288
|
-
serializedParams = parts.join("&");
|
|
2289
|
-
}
|
|
2290
|
-
if (serializedParams) {
|
|
2291
|
-
var hashmarkIndex = url.indexOf("#");
|
|
2292
|
-
if (hashmarkIndex !== -1) {
|
|
2293
|
-
url = url.slice(0, hashmarkIndex);
|
|
2294
|
-
}
|
|
2295
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2296
|
-
}
|
|
2297
|
-
return url;
|
|
2298
|
-
};
|
|
2299
|
-
}
|
|
2300
|
-
});
|
|
2301
|
-
|
|
2302
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/InterceptorManager.js
|
|
2303
|
-
var require_InterceptorManager = __commonJS({
|
|
2304
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/InterceptorManager.js"(exports, module2) {
|
|
2305
|
-
"use strict";
|
|
2306
|
-
var utils = require_utils();
|
|
2307
|
-
function InterceptorManager() {
|
|
2308
|
-
this.handlers = [];
|
|
2309
|
-
}
|
|
2310
|
-
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
2311
|
-
this.handlers.push({
|
|
2312
|
-
fulfilled,
|
|
2313
|
-
rejected,
|
|
2314
|
-
synchronous: options ? options.synchronous : false,
|
|
2315
|
-
runWhen: options ? options.runWhen : null
|
|
2316
|
-
});
|
|
2317
|
-
return this.handlers.length - 1;
|
|
2318
|
-
};
|
|
2319
|
-
InterceptorManager.prototype.eject = function eject(id) {
|
|
2320
|
-
if (this.handlers[id]) {
|
|
2321
|
-
this.handlers[id] = null;
|
|
2322
|
-
}
|
|
2323
|
-
};
|
|
2324
|
-
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
2325
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
2326
|
-
if (h !== null) {
|
|
2327
|
-
fn(h);
|
|
2328
|
-
}
|
|
2329
|
-
});
|
|
2330
|
-
};
|
|
2331
|
-
module2.exports = InterceptorManager;
|
|
2332
|
-
}
|
|
2333
|
-
});
|
|
2334
|
-
|
|
2335
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/normalizeHeaderName.js
|
|
2336
|
-
var require_normalizeHeaderName = __commonJS({
|
|
2337
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module2) {
|
|
2338
|
-
"use strict";
|
|
2339
|
-
var utils = require_utils();
|
|
2340
|
-
module2.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
2341
|
-
utils.forEach(headers, function processHeader(value, name) {
|
|
2342
|
-
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
2343
|
-
headers[normalizedName] = value;
|
|
2344
|
-
delete headers[name];
|
|
2345
|
-
}
|
|
2346
|
-
});
|
|
2347
|
-
};
|
|
2348
|
-
}
|
|
2349
|
-
});
|
|
2350
|
-
|
|
2351
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/AxiosError.js
|
|
2352
|
-
var require_AxiosError = __commonJS({
|
|
2353
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/AxiosError.js"(exports, module2) {
|
|
2354
|
-
"use strict";
|
|
2355
|
-
var utils = require_utils();
|
|
2356
|
-
function AxiosError2(message, code, config, request, response) {
|
|
2357
|
-
Error.call(this);
|
|
2358
|
-
this.message = message;
|
|
2359
|
-
this.name = "AxiosError";
|
|
2360
|
-
code && (this.code = code);
|
|
2361
|
-
config && (this.config = config);
|
|
2362
|
-
request && (this.request = request);
|
|
2363
|
-
response && (this.response = response);
|
|
2364
|
-
}
|
|
2365
|
-
utils.inherits(AxiosError2, Error, {
|
|
2366
|
-
toJSON: function toJSON() {
|
|
2367
|
-
return {
|
|
2368
|
-
// Standard
|
|
2369
|
-
message: this.message,
|
|
2370
|
-
name: this.name,
|
|
2371
|
-
// Microsoft
|
|
2372
|
-
description: this.description,
|
|
2373
|
-
number: this.number,
|
|
2374
|
-
// Mozilla
|
|
2375
|
-
fileName: this.fileName,
|
|
2376
|
-
lineNumber: this.lineNumber,
|
|
2377
|
-
columnNumber: this.columnNumber,
|
|
2378
|
-
stack: this.stack,
|
|
2379
|
-
// Axios
|
|
2380
|
-
config: this.config,
|
|
2381
|
-
code: this.code,
|
|
2382
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
2383
|
-
};
|
|
2384
|
-
}
|
|
2385
|
-
});
|
|
2386
|
-
var prototype = AxiosError2.prototype;
|
|
2387
|
-
var descriptors = {};
|
|
2388
|
-
[
|
|
2389
|
-
"ERR_BAD_OPTION_VALUE",
|
|
2390
|
-
"ERR_BAD_OPTION",
|
|
2391
|
-
"ECONNABORTED",
|
|
2392
|
-
"ETIMEDOUT",
|
|
2393
|
-
"ERR_NETWORK",
|
|
2394
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
2395
|
-
"ERR_DEPRECATED",
|
|
2396
|
-
"ERR_BAD_RESPONSE",
|
|
2397
|
-
"ERR_BAD_REQUEST",
|
|
2398
|
-
"ERR_CANCELED"
|
|
2399
|
-
// eslint-disable-next-line func-names
|
|
2400
|
-
].forEach(function(code) {
|
|
2401
|
-
descriptors[code] = { value: code };
|
|
2402
|
-
});
|
|
2403
|
-
Object.defineProperties(AxiosError2, descriptors);
|
|
2404
|
-
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
2405
|
-
AxiosError2.from = function(error, code, config, request, response, customProps) {
|
|
2406
|
-
var axiosError = Object.create(prototype);
|
|
2407
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
2408
|
-
return obj !== Error.prototype;
|
|
2409
|
-
});
|
|
2410
|
-
AxiosError2.call(axiosError, error.message, code, config, request, response);
|
|
2411
|
-
axiosError.name = error.name;
|
|
2412
|
-
customProps && Object.assign(axiosError, customProps);
|
|
2413
|
-
return axiosError;
|
|
2414
|
-
};
|
|
2415
|
-
module2.exports = AxiosError2;
|
|
2416
|
-
}
|
|
2417
|
-
});
|
|
2418
|
-
|
|
2419
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/defaults/transitional.js
|
|
2420
|
-
var require_transitional = __commonJS({
|
|
2421
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/defaults/transitional.js"(exports, module2) {
|
|
2422
|
-
"use strict";
|
|
2423
|
-
module2.exports = {
|
|
2424
|
-
silentJSONParsing: true,
|
|
2425
|
-
forcedJSONParsing: true,
|
|
2426
|
-
clarifyTimeoutError: false
|
|
2427
|
-
};
|
|
2428
|
-
}
|
|
2429
|
-
});
|
|
2430
|
-
|
|
2431
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/toFormData.js
|
|
2432
|
-
var require_toFormData = __commonJS({
|
|
2433
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/toFormData.js"(exports, module2) {
|
|
2434
|
-
"use strict";
|
|
2435
|
-
var utils = require_utils();
|
|
2436
|
-
function toFormData(obj, formData) {
|
|
2437
|
-
formData = formData || new FormData();
|
|
2438
|
-
var stack = [];
|
|
2439
|
-
function convertValue(value) {
|
|
2440
|
-
if (value === null)
|
|
2441
|
-
return "";
|
|
2442
|
-
if (utils.isDate(value)) {
|
|
2443
|
-
return value.toISOString();
|
|
2444
|
-
}
|
|
2445
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
2446
|
-
return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
2447
|
-
}
|
|
2448
|
-
return value;
|
|
2449
|
-
}
|
|
2450
|
-
function build(data, parentKey) {
|
|
2451
|
-
if (utils.isPlainObject(data) || utils.isArray(data)) {
|
|
2452
|
-
if (stack.indexOf(data) !== -1) {
|
|
2453
|
-
throw Error("Circular reference detected in " + parentKey);
|
|
2454
|
-
}
|
|
2455
|
-
stack.push(data);
|
|
2456
|
-
utils.forEach(data, function each(value, key) {
|
|
2457
|
-
if (utils.isUndefined(value))
|
|
2458
|
-
return;
|
|
2459
|
-
var fullKey = parentKey ? parentKey + "." + key : key;
|
|
2460
|
-
var arr;
|
|
2461
|
-
if (value && !parentKey && typeof value === "object") {
|
|
2462
|
-
if (utils.endsWith(key, "{}")) {
|
|
2463
|
-
value = JSON.stringify(value);
|
|
2464
|
-
} else if (utils.endsWith(key, "[]") && (arr = utils.toArray(value))) {
|
|
2465
|
-
arr.forEach(function(el) {
|
|
2466
|
-
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
2467
|
-
});
|
|
2468
|
-
return;
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
build(value, fullKey);
|
|
2472
|
-
});
|
|
2473
|
-
stack.pop();
|
|
2474
|
-
} else {
|
|
2475
|
-
formData.append(parentKey, convertValue(data));
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
build(obj);
|
|
2479
|
-
return formData;
|
|
2480
|
-
}
|
|
2481
|
-
module2.exports = toFormData;
|
|
2482
|
-
}
|
|
2483
|
-
});
|
|
2484
|
-
|
|
2485
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/settle.js
|
|
2486
|
-
var require_settle = __commonJS({
|
|
2487
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/settle.js"(exports, module2) {
|
|
2488
|
-
"use strict";
|
|
2489
|
-
var AxiosError2 = require_AxiosError();
|
|
2490
|
-
module2.exports = function settle(resolve, reject, response) {
|
|
2491
|
-
var validateStatus = response.config.validateStatus;
|
|
2492
|
-
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
2493
|
-
resolve(response);
|
|
2494
|
-
} else {
|
|
2495
|
-
reject(new AxiosError2(
|
|
2496
|
-
"Request failed with status code " + response.status,
|
|
2497
|
-
[AxiosError2.ERR_BAD_REQUEST, AxiosError2.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
2498
|
-
response.config,
|
|
2499
|
-
response.request,
|
|
2500
|
-
response
|
|
2501
|
-
));
|
|
2502
|
-
}
|
|
2503
|
-
};
|
|
2504
|
-
}
|
|
2505
|
-
});
|
|
2506
|
-
|
|
2507
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/cookies.js
|
|
2508
|
-
var require_cookies = __commonJS({
|
|
2509
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/cookies.js"(exports, module2) {
|
|
2510
|
-
"use strict";
|
|
2511
|
-
var utils = require_utils();
|
|
2512
|
-
module2.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
2513
|
-
return {
|
|
2514
|
-
write: function write(name, value, expires, path, domain, secure) {
|
|
2515
|
-
var cookie = [];
|
|
2516
|
-
cookie.push(name + "=" + encodeURIComponent(value));
|
|
2517
|
-
if (utils.isNumber(expires)) {
|
|
2518
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
2519
|
-
}
|
|
2520
|
-
if (utils.isString(path)) {
|
|
2521
|
-
cookie.push("path=" + path);
|
|
2522
|
-
}
|
|
2523
|
-
if (utils.isString(domain)) {
|
|
2524
|
-
cookie.push("domain=" + domain);
|
|
2525
|
-
}
|
|
2526
|
-
if (secure === true) {
|
|
2527
|
-
cookie.push("secure");
|
|
2528
|
-
}
|
|
2529
|
-
document.cookie = cookie.join("; ");
|
|
2530
|
-
},
|
|
2531
|
-
read: function read(name) {
|
|
2532
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
2533
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
2534
|
-
},
|
|
2535
|
-
remove: function remove(name) {
|
|
2536
|
-
this.write(name, "", Date.now() - 864e5);
|
|
2537
|
-
}
|
|
2538
|
-
};
|
|
2539
|
-
}() : function nonStandardBrowserEnv() {
|
|
2540
|
-
return {
|
|
2541
|
-
write: function write() {
|
|
2542
|
-
},
|
|
2543
|
-
read: function read() {
|
|
2544
|
-
return null;
|
|
2545
|
-
},
|
|
2546
|
-
remove: function remove() {
|
|
2547
|
-
}
|
|
2548
|
-
};
|
|
2549
|
-
}();
|
|
2550
|
-
}
|
|
2551
|
-
});
|
|
2552
|
-
|
|
2553
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2554
|
-
var require_isAbsoluteURL = __commonJS({
|
|
2555
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module2) {
|
|
2556
|
-
"use strict";
|
|
2557
|
-
module2.exports = function isAbsoluteURL(url) {
|
|
2558
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2559
|
-
};
|
|
2560
|
-
}
|
|
2561
|
-
});
|
|
2562
|
-
|
|
2563
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/combineURLs.js
|
|
2564
|
-
var require_combineURLs = __commonJS({
|
|
2565
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/combineURLs.js"(exports, module2) {
|
|
2566
|
-
"use strict";
|
|
2567
|
-
module2.exports = function combineURLs(baseURL, relativeURL) {
|
|
2568
|
-
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2569
|
-
};
|
|
2570
|
-
}
|
|
2571
|
-
});
|
|
2572
|
-
|
|
2573
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/buildFullPath.js
|
|
2574
|
-
var require_buildFullPath = __commonJS({
|
|
2575
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/buildFullPath.js"(exports, module2) {
|
|
2576
|
-
"use strict";
|
|
2577
|
-
var isAbsoluteURL = require_isAbsoluteURL();
|
|
2578
|
-
var combineURLs = require_combineURLs();
|
|
2579
|
-
module2.exports = function buildFullPath(baseURL, requestedURL) {
|
|
2580
|
-
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
2581
|
-
return combineURLs(baseURL, requestedURL);
|
|
2582
|
-
}
|
|
2583
|
-
return requestedURL;
|
|
2584
|
-
};
|
|
2585
|
-
}
|
|
2586
|
-
});
|
|
2587
|
-
|
|
2588
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/parseHeaders.js
|
|
2589
|
-
var require_parseHeaders = __commonJS({
|
|
2590
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/parseHeaders.js"(exports, module2) {
|
|
2591
|
-
"use strict";
|
|
2592
|
-
var utils = require_utils();
|
|
2593
|
-
var ignoreDuplicateOf = [
|
|
2594
|
-
"age",
|
|
2595
|
-
"authorization",
|
|
2596
|
-
"content-length",
|
|
2597
|
-
"content-type",
|
|
2598
|
-
"etag",
|
|
2599
|
-
"expires",
|
|
2600
|
-
"from",
|
|
2601
|
-
"host",
|
|
2602
|
-
"if-modified-since",
|
|
2603
|
-
"if-unmodified-since",
|
|
2604
|
-
"last-modified",
|
|
2605
|
-
"location",
|
|
2606
|
-
"max-forwards",
|
|
2607
|
-
"proxy-authorization",
|
|
2608
|
-
"referer",
|
|
2609
|
-
"retry-after",
|
|
2610
|
-
"user-agent"
|
|
2611
|
-
];
|
|
2612
|
-
module2.exports = function parseHeaders(headers) {
|
|
2613
|
-
var parsed = {};
|
|
2614
|
-
var key;
|
|
2615
|
-
var val;
|
|
2616
|
-
var i;
|
|
2617
|
-
if (!headers) {
|
|
2618
|
-
return parsed;
|
|
2619
|
-
}
|
|
2620
|
-
utils.forEach(headers.split("\n"), function parser(line) {
|
|
2621
|
-
i = line.indexOf(":");
|
|
2622
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
2623
|
-
val = utils.trim(line.substr(i + 1));
|
|
2624
|
-
if (key) {
|
|
2625
|
-
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
2626
|
-
return;
|
|
2627
|
-
}
|
|
2628
|
-
if (key === "set-cookie") {
|
|
2629
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
2630
|
-
} else {
|
|
2631
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
});
|
|
2635
|
-
return parsed;
|
|
2636
|
-
};
|
|
2637
|
-
}
|
|
2638
|
-
});
|
|
2639
|
-
|
|
2640
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
2641
|
-
var require_isURLSameOrigin = __commonJS({
|
|
2642
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module2) {
|
|
2643
|
-
"use strict";
|
|
2644
|
-
var utils = require_utils();
|
|
2645
|
-
module2.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
2646
|
-
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
2647
|
-
var urlParsingNode = document.createElement("a");
|
|
2648
|
-
var originURL;
|
|
2649
|
-
function resolveURL(url) {
|
|
2650
|
-
var href = url;
|
|
2651
|
-
if (msie) {
|
|
2652
|
-
urlParsingNode.setAttribute("href", href);
|
|
2653
|
-
href = urlParsingNode.href;
|
|
2654
|
-
}
|
|
2655
|
-
urlParsingNode.setAttribute("href", href);
|
|
2656
|
-
return {
|
|
2657
|
-
href: urlParsingNode.href,
|
|
2658
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
2659
|
-
host: urlParsingNode.host,
|
|
2660
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
2661
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
2662
|
-
hostname: urlParsingNode.hostname,
|
|
2663
|
-
port: urlParsingNode.port,
|
|
2664
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
2665
|
-
};
|
|
2666
|
-
}
|
|
2667
|
-
originURL = resolveURL(window.location.href);
|
|
2668
|
-
return function isURLSameOrigin(requestURL) {
|
|
2669
|
-
var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
2670
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
2671
|
-
};
|
|
2672
|
-
}() : function nonStandardBrowserEnv() {
|
|
2673
|
-
return function isURLSameOrigin() {
|
|
2674
|
-
return true;
|
|
2675
|
-
};
|
|
2676
|
-
}();
|
|
2677
|
-
}
|
|
2678
|
-
});
|
|
2679
|
-
|
|
2680
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/CanceledError.js
|
|
2681
|
-
var require_CanceledError = __commonJS({
|
|
2682
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/CanceledError.js"(exports, module2) {
|
|
2683
|
-
"use strict";
|
|
2684
|
-
var AxiosError2 = require_AxiosError();
|
|
2685
|
-
var utils = require_utils();
|
|
2686
|
-
function CanceledError(message) {
|
|
2687
|
-
AxiosError2.call(this, message == null ? "canceled" : message, AxiosError2.ERR_CANCELED);
|
|
2688
|
-
this.name = "CanceledError";
|
|
2689
|
-
}
|
|
2690
|
-
utils.inherits(CanceledError, AxiosError2, {
|
|
2691
|
-
__CANCEL__: true
|
|
2692
|
-
});
|
|
2693
|
-
module2.exports = CanceledError;
|
|
2694
|
-
}
|
|
2695
|
-
});
|
|
2696
|
-
|
|
2697
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/parseProtocol.js
|
|
2698
|
-
var require_parseProtocol = __commonJS({
|
|
2699
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/parseProtocol.js"(exports, module2) {
|
|
2700
|
-
"use strict";
|
|
2701
|
-
module2.exports = function parseProtocol(url) {
|
|
2702
|
-
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
2703
|
-
return match && match[1] || "";
|
|
2704
|
-
};
|
|
2705
|
-
}
|
|
2706
|
-
});
|
|
2707
|
-
|
|
2708
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/adapters/xhr.js
|
|
2709
|
-
var require_xhr = __commonJS({
|
|
2710
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/adapters/xhr.js"(exports, module2) {
|
|
2711
|
-
"use strict";
|
|
2712
|
-
var utils = require_utils();
|
|
2713
|
-
var settle = require_settle();
|
|
2714
|
-
var cookies = require_cookies();
|
|
2715
|
-
var buildURL = require_buildURL();
|
|
2716
|
-
var buildFullPath = require_buildFullPath();
|
|
2717
|
-
var parseHeaders = require_parseHeaders();
|
|
2718
|
-
var isURLSameOrigin = require_isURLSameOrigin();
|
|
2719
|
-
var transitionalDefaults = require_transitional();
|
|
2720
|
-
var AxiosError2 = require_AxiosError();
|
|
2721
|
-
var CanceledError = require_CanceledError();
|
|
2722
|
-
var parseProtocol = require_parseProtocol();
|
|
2723
|
-
module2.exports = function xhrAdapter(config) {
|
|
2724
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2725
|
-
var requestData = config.data;
|
|
2726
|
-
var requestHeaders = config.headers;
|
|
2727
|
-
var responseType = config.responseType;
|
|
2728
|
-
var onCanceled;
|
|
2729
|
-
function done() {
|
|
2730
|
-
if (config.cancelToken) {
|
|
2731
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
2732
|
-
}
|
|
2733
|
-
if (config.signal) {
|
|
2734
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
|
|
2738
|
-
delete requestHeaders["Content-Type"];
|
|
2739
|
-
}
|
|
2740
|
-
var request = new XMLHttpRequest();
|
|
2741
|
-
if (config.auth) {
|
|
2742
|
-
var username = config.auth.username || "";
|
|
2743
|
-
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
2744
|
-
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
2745
|
-
}
|
|
2746
|
-
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
2747
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
2748
|
-
request.timeout = config.timeout;
|
|
2749
|
-
function onloadend() {
|
|
2750
|
-
if (!request) {
|
|
2751
|
-
return;
|
|
2752
|
-
}
|
|
2753
|
-
var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
2754
|
-
var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
2755
|
-
var response = {
|
|
2756
|
-
data: responseData,
|
|
2757
|
-
status: request.status,
|
|
2758
|
-
statusText: request.statusText,
|
|
2759
|
-
headers: responseHeaders,
|
|
2760
|
-
config,
|
|
2761
|
-
request
|
|
2762
|
-
};
|
|
2763
|
-
settle(function _resolve(value) {
|
|
2764
|
-
resolve(value);
|
|
2765
|
-
done();
|
|
2766
|
-
}, function _reject(err) {
|
|
2767
|
-
reject(err);
|
|
2768
|
-
done();
|
|
2769
|
-
}, response);
|
|
2770
|
-
request = null;
|
|
2771
|
-
}
|
|
2772
|
-
if ("onloadend" in request) {
|
|
2773
|
-
request.onloadend = onloadend;
|
|
2774
|
-
} else {
|
|
2775
|
-
request.onreadystatechange = function handleLoad() {
|
|
2776
|
-
if (!request || request.readyState !== 4) {
|
|
2777
|
-
return;
|
|
2778
|
-
}
|
|
2779
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
2780
|
-
return;
|
|
2781
|
-
}
|
|
2782
|
-
setTimeout(onloadend);
|
|
2783
|
-
};
|
|
2784
|
-
}
|
|
2785
|
-
request.onabort = function handleAbort() {
|
|
2786
|
-
if (!request) {
|
|
2787
|
-
return;
|
|
2788
|
-
}
|
|
2789
|
-
reject(new AxiosError2("Request aborted", AxiosError2.ECONNABORTED, config, request));
|
|
2790
|
-
request = null;
|
|
2791
|
-
};
|
|
2792
|
-
request.onerror = function handleError() {
|
|
2793
|
-
reject(new AxiosError2("Network Error", AxiosError2.ERR_NETWORK, config, request, request));
|
|
2794
|
-
request = null;
|
|
2795
|
-
};
|
|
2796
|
-
request.ontimeout = function handleTimeout() {
|
|
2797
|
-
var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
2798
|
-
var transitional = config.transitional || transitionalDefaults;
|
|
2799
|
-
if (config.timeoutErrorMessage) {
|
|
2800
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
2801
|
-
}
|
|
2802
|
-
reject(new AxiosError2(
|
|
2803
|
-
timeoutErrorMessage,
|
|
2804
|
-
transitional.clarifyTimeoutError ? AxiosError2.ETIMEDOUT : AxiosError2.ECONNABORTED,
|
|
2805
|
-
config,
|
|
2806
|
-
request
|
|
2807
|
-
));
|
|
2808
|
-
request = null;
|
|
2809
|
-
};
|
|
2810
|
-
if (utils.isStandardBrowserEnv()) {
|
|
2811
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
2812
|
-
if (xsrfValue) {
|
|
2813
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
if ("setRequestHeader" in request) {
|
|
2817
|
-
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
2818
|
-
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
2819
|
-
delete requestHeaders[key];
|
|
2820
|
-
} else {
|
|
2821
|
-
request.setRequestHeader(key, val);
|
|
2822
|
-
}
|
|
2823
|
-
});
|
|
2824
|
-
}
|
|
2825
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
|
2826
|
-
request.withCredentials = !!config.withCredentials;
|
|
2827
|
-
}
|
|
2828
|
-
if (responseType && responseType !== "json") {
|
|
2829
|
-
request.responseType = config.responseType;
|
|
2830
|
-
}
|
|
2831
|
-
if (typeof config.onDownloadProgress === "function") {
|
|
2832
|
-
request.addEventListener("progress", config.onDownloadProgress);
|
|
2833
|
-
}
|
|
2834
|
-
if (typeof config.onUploadProgress === "function" && request.upload) {
|
|
2835
|
-
request.upload.addEventListener("progress", config.onUploadProgress);
|
|
2836
|
-
}
|
|
2837
|
-
if (config.cancelToken || config.signal) {
|
|
2838
|
-
onCanceled = function(cancel) {
|
|
2839
|
-
if (!request) {
|
|
2840
|
-
return;
|
|
2841
|
-
}
|
|
2842
|
-
reject(!cancel || cancel && cancel.type ? new CanceledError() : cancel);
|
|
2843
|
-
request.abort();
|
|
2844
|
-
request = null;
|
|
2845
|
-
};
|
|
2846
|
-
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
2847
|
-
if (config.signal) {
|
|
2848
|
-
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
if (!requestData) {
|
|
2852
|
-
requestData = null;
|
|
2853
|
-
}
|
|
2854
|
-
var protocol = parseProtocol(fullPath);
|
|
2855
|
-
if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
|
|
2856
|
-
reject(new AxiosError2("Unsupported protocol " + protocol + ":", AxiosError2.ERR_BAD_REQUEST, config));
|
|
2857
|
-
return;
|
|
2858
|
-
}
|
|
2859
|
-
request.send(requestData);
|
|
2860
|
-
});
|
|
2861
|
-
};
|
|
2862
|
-
}
|
|
2863
|
-
});
|
|
2864
|
-
|
|
2865
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/null.js
|
|
2866
|
-
var require_null = __commonJS({
|
|
2867
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/null.js"(exports, module2) {
|
|
2868
|
-
module2.exports = null;
|
|
2869
|
-
}
|
|
2870
|
-
});
|
|
2871
|
-
|
|
2872
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/defaults/index.js
|
|
2873
|
-
var require_defaults = __commonJS({
|
|
2874
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/defaults/index.js"(exports, module2) {
|
|
2875
|
-
"use strict";
|
|
2876
|
-
var utils = require_utils();
|
|
2877
|
-
var normalizeHeaderName = require_normalizeHeaderName();
|
|
2878
|
-
var AxiosError2 = require_AxiosError();
|
|
2879
|
-
var transitionalDefaults = require_transitional();
|
|
2880
|
-
var toFormData = require_toFormData();
|
|
2881
|
-
var DEFAULT_CONTENT_TYPE = {
|
|
2882
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
2883
|
-
};
|
|
2884
|
-
function setContentTypeIfUnset(headers, value) {
|
|
2885
|
-
if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) {
|
|
2886
|
-
headers["Content-Type"] = value;
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
function getDefaultAdapter() {
|
|
2890
|
-
var adapter;
|
|
2891
|
-
if (typeof XMLHttpRequest !== "undefined") {
|
|
2892
|
-
adapter = require_xhr();
|
|
2893
|
-
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
2894
|
-
adapter = require_xhr();
|
|
2895
|
-
}
|
|
2896
|
-
return adapter;
|
|
2897
|
-
}
|
|
2898
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
2899
|
-
if (utils.isString(rawValue)) {
|
|
2900
|
-
try {
|
|
2901
|
-
(parser || JSON.parse)(rawValue);
|
|
2902
|
-
return utils.trim(rawValue);
|
|
2903
|
-
} catch (e) {
|
|
2904
|
-
if (e.name !== "SyntaxError") {
|
|
2905
|
-
throw e;
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
2910
|
-
}
|
|
2911
|
-
var defaults = {
|
|
2912
|
-
transitional: transitionalDefaults,
|
|
2913
|
-
adapter: getDefaultAdapter(),
|
|
2914
|
-
transformRequest: [function transformRequest(data, headers) {
|
|
2915
|
-
normalizeHeaderName(headers, "Accept");
|
|
2916
|
-
normalizeHeaderName(headers, "Content-Type");
|
|
2917
|
-
if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
|
|
2918
|
-
return data;
|
|
2919
|
-
}
|
|
2920
|
-
if (utils.isArrayBufferView(data)) {
|
|
2921
|
-
return data.buffer;
|
|
2922
|
-
}
|
|
2923
|
-
if (utils.isURLSearchParams(data)) {
|
|
2924
|
-
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
2925
|
-
return data.toString();
|
|
2926
|
-
}
|
|
2927
|
-
var isObjectPayload = utils.isObject(data);
|
|
2928
|
-
var contentType = headers && headers["Content-Type"];
|
|
2929
|
-
var isFileList;
|
|
2930
|
-
if ((isFileList = utils.isFileList(data)) || isObjectPayload && contentType === "multipart/form-data") {
|
|
2931
|
-
var _FormData = this.env && this.env.FormData;
|
|
2932
|
-
return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData());
|
|
2933
|
-
} else if (isObjectPayload || contentType === "application/json") {
|
|
2934
|
-
setContentTypeIfUnset(headers, "application/json");
|
|
2935
|
-
return stringifySafely(data);
|
|
2936
|
-
}
|
|
2937
|
-
return data;
|
|
2938
|
-
}],
|
|
2939
|
-
transformResponse: [function transformResponse(data) {
|
|
2940
|
-
var transitional = this.transitional || defaults.transitional;
|
|
2941
|
-
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
2942
|
-
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
2943
|
-
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
2944
|
-
if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) {
|
|
2945
|
-
try {
|
|
2946
|
-
return JSON.parse(data);
|
|
2947
|
-
} catch (e) {
|
|
2948
|
-
if (strictJSONParsing) {
|
|
2949
|
-
if (e.name === "SyntaxError") {
|
|
2950
|
-
throw AxiosError2.from(e, AxiosError2.ERR_BAD_RESPONSE, this, null, this.response);
|
|
2951
|
-
}
|
|
2952
|
-
throw e;
|
|
2953
|
-
}
|
|
2954
|
-
}
|
|
2955
|
-
}
|
|
2956
|
-
return data;
|
|
2957
|
-
}],
|
|
2958
|
-
/**
|
|
2959
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2960
|
-
* timeout is not created.
|
|
2961
|
-
*/
|
|
2962
|
-
timeout: 0,
|
|
2963
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
2964
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2965
|
-
maxContentLength: -1,
|
|
2966
|
-
maxBodyLength: -1,
|
|
2967
|
-
env: {
|
|
2968
|
-
FormData: require_null()
|
|
2969
|
-
},
|
|
2970
|
-
validateStatus: function validateStatus(status) {
|
|
2971
|
-
return status >= 200 && status < 300;
|
|
2972
|
-
},
|
|
2973
|
-
headers: {
|
|
2974
|
-
common: {
|
|
2975
|
-
"Accept": "application/json, text/plain, */*"
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
};
|
|
2979
|
-
utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
2980
|
-
defaults.headers[method] = {};
|
|
2981
|
-
});
|
|
2982
|
-
utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2983
|
-
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
2984
|
-
});
|
|
2985
|
-
module2.exports = defaults;
|
|
2986
|
-
}
|
|
2987
|
-
});
|
|
2988
|
-
|
|
2989
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/transformData.js
|
|
2990
|
-
var require_transformData = __commonJS({
|
|
2991
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/transformData.js"(exports, module2) {
|
|
2992
|
-
"use strict";
|
|
2993
|
-
var utils = require_utils();
|
|
2994
|
-
var defaults = require_defaults();
|
|
2995
|
-
module2.exports = function transformData(data, headers, fns) {
|
|
2996
|
-
var context = this || defaults;
|
|
2997
|
-
utils.forEach(fns, function transform2(fn) {
|
|
2998
|
-
data = fn.call(context, data, headers);
|
|
2999
|
-
});
|
|
3000
|
-
return data;
|
|
3001
|
-
};
|
|
3002
|
-
}
|
|
3003
|
-
});
|
|
3004
|
-
|
|
3005
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/isCancel.js
|
|
3006
|
-
var require_isCancel = __commonJS({
|
|
3007
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/isCancel.js"(exports, module2) {
|
|
3008
|
-
"use strict";
|
|
3009
|
-
module2.exports = function isCancel(value) {
|
|
3010
|
-
return !!(value && value.__CANCEL__);
|
|
3011
|
-
};
|
|
3012
|
-
}
|
|
3013
|
-
});
|
|
3014
|
-
|
|
3015
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/dispatchRequest.js
|
|
3016
|
-
var require_dispatchRequest = __commonJS({
|
|
3017
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/dispatchRequest.js"(exports, module2) {
|
|
3018
|
-
"use strict";
|
|
3019
|
-
var utils = require_utils();
|
|
3020
|
-
var transformData = require_transformData();
|
|
3021
|
-
var isCancel = require_isCancel();
|
|
3022
|
-
var defaults = require_defaults();
|
|
3023
|
-
var CanceledError = require_CanceledError();
|
|
3024
|
-
function throwIfCancellationRequested(config) {
|
|
3025
|
-
if (config.cancelToken) {
|
|
3026
|
-
config.cancelToken.throwIfRequested();
|
|
3027
|
-
}
|
|
3028
|
-
if (config.signal && config.signal.aborted) {
|
|
3029
|
-
throw new CanceledError();
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
module2.exports = function dispatchRequest(config) {
|
|
3033
|
-
throwIfCancellationRequested(config);
|
|
3034
|
-
config.headers = config.headers || {};
|
|
3035
|
-
config.data = transformData.call(
|
|
3036
|
-
config,
|
|
3037
|
-
config.data,
|
|
3038
|
-
config.headers,
|
|
3039
|
-
config.transformRequest
|
|
3040
|
-
);
|
|
3041
|
-
config.headers = utils.merge(
|
|
3042
|
-
config.headers.common || {},
|
|
3043
|
-
config.headers[config.method] || {},
|
|
3044
|
-
config.headers
|
|
3045
|
-
);
|
|
3046
|
-
utils.forEach(
|
|
3047
|
-
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
3048
|
-
function cleanHeaderConfig(method) {
|
|
3049
|
-
delete config.headers[method];
|
|
3050
|
-
}
|
|
3051
|
-
);
|
|
3052
|
-
var adapter = config.adapter || defaults.adapter;
|
|
3053
|
-
return adapter(config).then(function onAdapterResolution(response) {
|
|
3054
|
-
throwIfCancellationRequested(config);
|
|
3055
|
-
response.data = transformData.call(
|
|
3056
|
-
config,
|
|
3057
|
-
response.data,
|
|
3058
|
-
response.headers,
|
|
3059
|
-
config.transformResponse
|
|
3060
|
-
);
|
|
3061
|
-
return response;
|
|
3062
|
-
}, function onAdapterRejection(reason) {
|
|
3063
|
-
if (!isCancel(reason)) {
|
|
3064
|
-
throwIfCancellationRequested(config);
|
|
3065
|
-
if (reason && reason.response) {
|
|
3066
|
-
reason.response.data = transformData.call(
|
|
3067
|
-
config,
|
|
3068
|
-
reason.response.data,
|
|
3069
|
-
reason.response.headers,
|
|
3070
|
-
config.transformResponse
|
|
3071
|
-
);
|
|
3072
|
-
}
|
|
3073
|
-
}
|
|
3074
|
-
return Promise.reject(reason);
|
|
3075
|
-
});
|
|
3076
|
-
};
|
|
3077
|
-
}
|
|
3078
|
-
});
|
|
3079
|
-
|
|
3080
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/mergeConfig.js
|
|
3081
|
-
var require_mergeConfig = __commonJS({
|
|
3082
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/mergeConfig.js"(exports, module2) {
|
|
3083
|
-
"use strict";
|
|
3084
|
-
var utils = require_utils();
|
|
3085
|
-
module2.exports = function mergeConfig(config1, config2) {
|
|
3086
|
-
config2 = config2 || {};
|
|
3087
|
-
var config = {};
|
|
3088
|
-
function getMergedValue(target, source) {
|
|
3089
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
3090
|
-
return utils.merge(target, source);
|
|
3091
|
-
} else if (utils.isPlainObject(source)) {
|
|
3092
|
-
return utils.merge({}, source);
|
|
3093
|
-
} else if (utils.isArray(source)) {
|
|
3094
|
-
return source.slice();
|
|
3095
|
-
}
|
|
3096
|
-
return source;
|
|
3097
|
-
}
|
|
3098
|
-
function mergeDeepProperties(prop) {
|
|
3099
|
-
if (!utils.isUndefined(config2[prop])) {
|
|
3100
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
3101
|
-
} else if (!utils.isUndefined(config1[prop])) {
|
|
3102
|
-
return getMergedValue(void 0, config1[prop]);
|
|
3103
|
-
}
|
|
3104
|
-
}
|
|
3105
|
-
function valueFromConfig2(prop) {
|
|
3106
|
-
if (!utils.isUndefined(config2[prop])) {
|
|
3107
|
-
return getMergedValue(void 0, config2[prop]);
|
|
3108
|
-
}
|
|
3109
|
-
}
|
|
3110
|
-
function defaultToConfig2(prop) {
|
|
3111
|
-
if (!utils.isUndefined(config2[prop])) {
|
|
3112
|
-
return getMergedValue(void 0, config2[prop]);
|
|
3113
|
-
} else if (!utils.isUndefined(config1[prop])) {
|
|
3114
|
-
return getMergedValue(void 0, config1[prop]);
|
|
3115
|
-
}
|
|
3116
|
-
}
|
|
3117
|
-
function mergeDirectKeys(prop) {
|
|
3118
|
-
if (prop in config2) {
|
|
3119
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
3120
|
-
} else if (prop in config1) {
|
|
3121
|
-
return getMergedValue(void 0, config1[prop]);
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3124
|
-
var mergeMap = {
|
|
3125
|
-
"url": valueFromConfig2,
|
|
3126
|
-
"method": valueFromConfig2,
|
|
3127
|
-
"data": valueFromConfig2,
|
|
3128
|
-
"baseURL": defaultToConfig2,
|
|
3129
|
-
"transformRequest": defaultToConfig2,
|
|
3130
|
-
"transformResponse": defaultToConfig2,
|
|
3131
|
-
"paramsSerializer": defaultToConfig2,
|
|
3132
|
-
"timeout": defaultToConfig2,
|
|
3133
|
-
"timeoutMessage": defaultToConfig2,
|
|
3134
|
-
"withCredentials": defaultToConfig2,
|
|
3135
|
-
"adapter": defaultToConfig2,
|
|
3136
|
-
"responseType": defaultToConfig2,
|
|
3137
|
-
"xsrfCookieName": defaultToConfig2,
|
|
3138
|
-
"xsrfHeaderName": defaultToConfig2,
|
|
3139
|
-
"onUploadProgress": defaultToConfig2,
|
|
3140
|
-
"onDownloadProgress": defaultToConfig2,
|
|
3141
|
-
"decompress": defaultToConfig2,
|
|
3142
|
-
"maxContentLength": defaultToConfig2,
|
|
3143
|
-
"maxBodyLength": defaultToConfig2,
|
|
3144
|
-
"beforeRedirect": defaultToConfig2,
|
|
3145
|
-
"transport": defaultToConfig2,
|
|
3146
|
-
"httpAgent": defaultToConfig2,
|
|
3147
|
-
"httpsAgent": defaultToConfig2,
|
|
3148
|
-
"cancelToken": defaultToConfig2,
|
|
3149
|
-
"socketPath": defaultToConfig2,
|
|
3150
|
-
"responseEncoding": defaultToConfig2,
|
|
3151
|
-
"validateStatus": mergeDirectKeys
|
|
3152
|
-
};
|
|
3153
|
-
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
3154
|
-
var merge = mergeMap[prop] || mergeDeepProperties;
|
|
3155
|
-
var configValue = merge(prop);
|
|
3156
|
-
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
|
3157
|
-
});
|
|
3158
|
-
return config;
|
|
3159
|
-
};
|
|
3160
|
-
}
|
|
3161
|
-
});
|
|
3162
|
-
|
|
3163
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/env/data.js
|
|
3164
|
-
var require_data = __commonJS({
|
|
3165
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/env/data.js"(exports, module2) {
|
|
3166
|
-
module2.exports = {
|
|
3167
|
-
"version": "0.27.2"
|
|
3168
|
-
};
|
|
3169
|
-
}
|
|
3170
|
-
});
|
|
3171
|
-
|
|
3172
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/validator.js
|
|
3173
|
-
var require_validator = __commonJS({
|
|
3174
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/validator.js"(exports, module2) {
|
|
3175
|
-
"use strict";
|
|
3176
|
-
var VERSION2 = require_data().version;
|
|
3177
|
-
var AxiosError2 = require_AxiosError();
|
|
3178
|
-
var validators = {};
|
|
3179
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
3180
|
-
validators[type] = function validator(thing) {
|
|
3181
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
3182
|
-
};
|
|
3183
|
-
});
|
|
3184
|
-
var deprecatedWarnings = {};
|
|
3185
|
-
validators.transitional = function transitional(validator, version2, message) {
|
|
3186
|
-
function formatMessage(opt, desc) {
|
|
3187
|
-
return "[Axios v" + VERSION2 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
3188
|
-
}
|
|
3189
|
-
return function(value, opt, opts) {
|
|
3190
|
-
if (validator === false) {
|
|
3191
|
-
throw new AxiosError2(
|
|
3192
|
-
formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
|
|
3193
|
-
AxiosError2.ERR_DEPRECATED
|
|
3194
|
-
);
|
|
3195
|
-
}
|
|
3196
|
-
if (version2 && !deprecatedWarnings[opt]) {
|
|
3197
|
-
deprecatedWarnings[opt] = true;
|
|
3198
|
-
console.warn(
|
|
3199
|
-
formatMessage(
|
|
3200
|
-
opt,
|
|
3201
|
-
" has been deprecated since v" + version2 + " and will be removed in the near future"
|
|
3202
|
-
)
|
|
3203
|
-
);
|
|
3204
|
-
}
|
|
3205
|
-
return validator ? validator(value, opt, opts) : true;
|
|
3206
|
-
};
|
|
3207
|
-
};
|
|
3208
|
-
function assertOptions(options, schema, allowUnknown) {
|
|
3209
|
-
if (typeof options !== "object") {
|
|
3210
|
-
throw new AxiosError2("options must be an object", AxiosError2.ERR_BAD_OPTION_VALUE);
|
|
3211
|
-
}
|
|
3212
|
-
var keys2 = Object.keys(options);
|
|
3213
|
-
var i = keys2.length;
|
|
3214
|
-
while (i-- > 0) {
|
|
3215
|
-
var opt = keys2[i];
|
|
3216
|
-
var validator = schema[opt];
|
|
3217
|
-
if (validator) {
|
|
3218
|
-
var value = options[opt];
|
|
3219
|
-
var result = value === void 0 || validator(value, opt, options);
|
|
3220
|
-
if (result !== true) {
|
|
3221
|
-
throw new AxiosError2("option " + opt + " must be " + result, AxiosError2.ERR_BAD_OPTION_VALUE);
|
|
3222
|
-
}
|
|
3223
|
-
continue;
|
|
3224
|
-
}
|
|
3225
|
-
if (allowUnknown !== true) {
|
|
3226
|
-
throw new AxiosError2("Unknown option " + opt, AxiosError2.ERR_BAD_OPTION);
|
|
3227
|
-
}
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
module2.exports = {
|
|
3231
|
-
assertOptions,
|
|
3232
|
-
validators
|
|
3233
|
-
};
|
|
3234
|
-
}
|
|
3235
|
-
});
|
|
3236
|
-
|
|
3237
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/Axios.js
|
|
3238
|
-
var require_Axios = __commonJS({
|
|
3239
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/core/Axios.js"(exports, module2) {
|
|
3240
|
-
"use strict";
|
|
3241
|
-
var utils = require_utils();
|
|
3242
|
-
var buildURL = require_buildURL();
|
|
3243
|
-
var InterceptorManager = require_InterceptorManager();
|
|
3244
|
-
var dispatchRequest = require_dispatchRequest();
|
|
3245
|
-
var mergeConfig = require_mergeConfig();
|
|
3246
|
-
var buildFullPath = require_buildFullPath();
|
|
3247
|
-
var validator = require_validator();
|
|
3248
|
-
var validators = validator.validators;
|
|
3249
|
-
function Axios(instanceConfig) {
|
|
3250
|
-
this.defaults = instanceConfig;
|
|
3251
|
-
this.interceptors = {
|
|
3252
|
-
request: new InterceptorManager(),
|
|
3253
|
-
response: new InterceptorManager()
|
|
3254
|
-
};
|
|
3255
|
-
}
|
|
3256
|
-
Axios.prototype.request = function request(configOrUrl, config) {
|
|
3257
|
-
if (typeof configOrUrl === "string") {
|
|
3258
|
-
config = config || {};
|
|
3259
|
-
config.url = configOrUrl;
|
|
3260
|
-
} else {
|
|
3261
|
-
config = configOrUrl || {};
|
|
3262
|
-
}
|
|
3263
|
-
config = mergeConfig(this.defaults, config);
|
|
3264
|
-
if (config.method) {
|
|
3265
|
-
config.method = config.method.toLowerCase();
|
|
3266
|
-
} else if (this.defaults.method) {
|
|
3267
|
-
config.method = this.defaults.method.toLowerCase();
|
|
3268
|
-
} else {
|
|
3269
|
-
config.method = "get";
|
|
3270
|
-
}
|
|
3271
|
-
var transitional = config.transitional;
|
|
3272
|
-
if (transitional !== void 0) {
|
|
3273
|
-
validator.assertOptions(transitional, {
|
|
3274
|
-
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3275
|
-
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3276
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
3277
|
-
}, false);
|
|
3278
|
-
}
|
|
3279
|
-
var requestInterceptorChain = [];
|
|
3280
|
-
var synchronousRequestInterceptors = true;
|
|
3281
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
3282
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
3283
|
-
return;
|
|
3284
|
-
}
|
|
3285
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3286
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3287
|
-
});
|
|
3288
|
-
var responseInterceptorChain = [];
|
|
3289
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
3290
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3291
|
-
});
|
|
3292
|
-
var promise;
|
|
3293
|
-
if (!synchronousRequestInterceptors) {
|
|
3294
|
-
var chain = [dispatchRequest, void 0];
|
|
3295
|
-
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
3296
|
-
chain = chain.concat(responseInterceptorChain);
|
|
3297
|
-
promise = Promise.resolve(config);
|
|
3298
|
-
while (chain.length) {
|
|
3299
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
3300
|
-
}
|
|
3301
|
-
return promise;
|
|
3302
|
-
}
|
|
3303
|
-
var newConfig = config;
|
|
3304
|
-
while (requestInterceptorChain.length) {
|
|
3305
|
-
var onFulfilled = requestInterceptorChain.shift();
|
|
3306
|
-
var onRejected = requestInterceptorChain.shift();
|
|
3307
|
-
try {
|
|
3308
|
-
newConfig = onFulfilled(newConfig);
|
|
3309
|
-
} catch (error) {
|
|
3310
|
-
onRejected(error);
|
|
3311
|
-
break;
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
try {
|
|
3315
|
-
promise = dispatchRequest(newConfig);
|
|
3316
|
-
} catch (error) {
|
|
3317
|
-
return Promise.reject(error);
|
|
3318
|
-
}
|
|
3319
|
-
while (responseInterceptorChain.length) {
|
|
3320
|
-
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
3321
|
-
}
|
|
3322
|
-
return promise;
|
|
3323
|
-
};
|
|
3324
|
-
Axios.prototype.getUri = function getUri(config) {
|
|
3325
|
-
config = mergeConfig(this.defaults, config);
|
|
3326
|
-
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
3327
|
-
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3328
|
-
};
|
|
3329
|
-
utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
3330
|
-
Axios.prototype[method] = function(url, config) {
|
|
3331
|
-
return this.request(mergeConfig(config || {}, {
|
|
3332
|
-
method,
|
|
3333
|
-
url,
|
|
3334
|
-
data: (config || {}).data
|
|
3335
|
-
}));
|
|
3336
|
-
};
|
|
3337
|
-
});
|
|
3338
|
-
utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
3339
|
-
function generateHTTPMethod(isForm) {
|
|
3340
|
-
return function httpMethod(url, data, config) {
|
|
3341
|
-
return this.request(mergeConfig(config || {}, {
|
|
3342
|
-
method,
|
|
3343
|
-
headers: isForm ? {
|
|
3344
|
-
"Content-Type": "multipart/form-data"
|
|
3345
|
-
} : {},
|
|
3346
|
-
url,
|
|
3347
|
-
data
|
|
3348
|
-
}));
|
|
3349
|
-
};
|
|
3350
|
-
}
|
|
3351
|
-
Axios.prototype[method] = generateHTTPMethod();
|
|
3352
|
-
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
3353
|
-
});
|
|
3354
|
-
module2.exports = Axios;
|
|
3355
|
-
}
|
|
3356
|
-
});
|
|
3357
|
-
|
|
3358
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/CancelToken.js
|
|
3359
|
-
var require_CancelToken = __commonJS({
|
|
3360
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/cancel/CancelToken.js"(exports, module2) {
|
|
3361
|
-
"use strict";
|
|
3362
|
-
var CanceledError = require_CanceledError();
|
|
3363
|
-
function CancelToken(executor) {
|
|
3364
|
-
if (typeof executor !== "function") {
|
|
3365
|
-
throw new TypeError("executor must be a function.");
|
|
3366
|
-
}
|
|
3367
|
-
var resolvePromise;
|
|
3368
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
3369
|
-
resolvePromise = resolve;
|
|
3370
|
-
});
|
|
3371
|
-
var token = this;
|
|
3372
|
-
this.promise.then(function(cancel) {
|
|
3373
|
-
if (!token._listeners)
|
|
3374
|
-
return;
|
|
3375
|
-
var i;
|
|
3376
|
-
var l = token._listeners.length;
|
|
3377
|
-
for (i = 0; i < l; i++) {
|
|
3378
|
-
token._listeners[i](cancel);
|
|
3379
|
-
}
|
|
3380
|
-
token._listeners = null;
|
|
3381
|
-
});
|
|
3382
|
-
this.promise.then = function(onfulfilled) {
|
|
3383
|
-
var _resolve;
|
|
3384
|
-
var promise = new Promise(function(resolve) {
|
|
3385
|
-
token.subscribe(resolve);
|
|
3386
|
-
_resolve = resolve;
|
|
3387
|
-
}).then(onfulfilled);
|
|
3388
|
-
promise.cancel = function reject() {
|
|
3389
|
-
token.unsubscribe(_resolve);
|
|
3390
|
-
};
|
|
3391
|
-
return promise;
|
|
3392
|
-
};
|
|
3393
|
-
executor(function cancel(message) {
|
|
3394
|
-
if (token.reason) {
|
|
3395
|
-
return;
|
|
3396
|
-
}
|
|
3397
|
-
token.reason = new CanceledError(message);
|
|
3398
|
-
resolvePromise(token.reason);
|
|
3399
|
-
});
|
|
3400
|
-
}
|
|
3401
|
-
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
3402
|
-
if (this.reason) {
|
|
3403
|
-
throw this.reason;
|
|
3404
|
-
}
|
|
3405
|
-
};
|
|
3406
|
-
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
3407
|
-
if (this.reason) {
|
|
3408
|
-
listener(this.reason);
|
|
3409
|
-
return;
|
|
3410
|
-
}
|
|
3411
|
-
if (this._listeners) {
|
|
3412
|
-
this._listeners.push(listener);
|
|
3413
|
-
} else {
|
|
3414
|
-
this._listeners = [listener];
|
|
3415
|
-
}
|
|
3416
|
-
};
|
|
3417
|
-
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
3418
|
-
if (!this._listeners) {
|
|
3419
|
-
return;
|
|
3420
|
-
}
|
|
3421
|
-
var index = this._listeners.indexOf(listener);
|
|
3422
|
-
if (index !== -1) {
|
|
3423
|
-
this._listeners.splice(index, 1);
|
|
3424
|
-
}
|
|
3425
|
-
};
|
|
3426
|
-
CancelToken.source = function source() {
|
|
3427
|
-
var cancel;
|
|
3428
|
-
var token = new CancelToken(function executor(c) {
|
|
3429
|
-
cancel = c;
|
|
3430
|
-
});
|
|
3431
|
-
return {
|
|
3432
|
-
token,
|
|
3433
|
-
cancel
|
|
3434
|
-
};
|
|
3435
|
-
};
|
|
3436
|
-
module2.exports = CancelToken;
|
|
3437
|
-
}
|
|
3438
|
-
});
|
|
3439
|
-
|
|
3440
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/spread.js
|
|
3441
|
-
var require_spread = __commonJS({
|
|
3442
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/spread.js"(exports, module2) {
|
|
3443
|
-
"use strict";
|
|
3444
|
-
module2.exports = function spread(callback) {
|
|
3445
|
-
return function wrap(arr) {
|
|
3446
|
-
return callback.apply(null, arr);
|
|
3447
|
-
};
|
|
3448
|
-
};
|
|
3449
|
-
}
|
|
3450
|
-
});
|
|
3451
|
-
|
|
3452
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isAxiosError.js
|
|
3453
|
-
var require_isAxiosError = __commonJS({
|
|
3454
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/helpers/isAxiosError.js"(exports, module2) {
|
|
3455
|
-
"use strict";
|
|
3456
|
-
var utils = require_utils();
|
|
3457
|
-
module2.exports = function isAxiosError(payload) {
|
|
3458
|
-
return utils.isObject(payload) && payload.isAxiosError === true;
|
|
3459
|
-
};
|
|
3460
|
-
}
|
|
3461
|
-
});
|
|
3462
|
-
|
|
3463
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/axios.js
|
|
3464
|
-
var require_axios = __commonJS({
|
|
3465
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/lib/axios.js"(exports, module2) {
|
|
3466
|
-
"use strict";
|
|
3467
|
-
var utils = require_utils();
|
|
3468
|
-
var bind = require_bind();
|
|
3469
|
-
var Axios = require_Axios();
|
|
3470
|
-
var mergeConfig = require_mergeConfig();
|
|
3471
|
-
var defaults = require_defaults();
|
|
3472
|
-
function createInstance(defaultConfig) {
|
|
3473
|
-
var context = new Axios(defaultConfig);
|
|
3474
|
-
var instance = bind(Axios.prototype.request, context);
|
|
3475
|
-
utils.extend(instance, Axios.prototype, context);
|
|
3476
|
-
utils.extend(instance, context);
|
|
3477
|
-
instance.create = function create(instanceConfig) {
|
|
3478
|
-
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
3479
|
-
};
|
|
3480
|
-
return instance;
|
|
3481
|
-
}
|
|
3482
|
-
var axios2 = createInstance(defaults);
|
|
3483
|
-
axios2.Axios = Axios;
|
|
3484
|
-
axios2.CanceledError = require_CanceledError();
|
|
3485
|
-
axios2.CancelToken = require_CancelToken();
|
|
3486
|
-
axios2.isCancel = require_isCancel();
|
|
3487
|
-
axios2.VERSION = require_data().version;
|
|
3488
|
-
axios2.toFormData = require_toFormData();
|
|
3489
|
-
axios2.AxiosError = require_AxiosError();
|
|
3490
|
-
axios2.Cancel = axios2.CanceledError;
|
|
3491
|
-
axios2.all = function all(promises) {
|
|
3492
|
-
return Promise.all(promises);
|
|
3493
|
-
};
|
|
3494
|
-
axios2.spread = require_spread();
|
|
3495
|
-
axios2.isAxiosError = require_isAxiosError();
|
|
3496
|
-
module2.exports = axios2;
|
|
3497
|
-
module2.exports.default = axios2;
|
|
3498
|
-
}
|
|
3499
|
-
});
|
|
3500
|
-
|
|
3501
|
-
// .yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/index.js
|
|
3502
|
-
var require_axios2 = __commonJS({
|
|
3503
|
-
".yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/index.js"(exports, module2) {
|
|
3504
|
-
module2.exports = require_axios();
|
|
3505
|
-
}
|
|
3506
|
-
});
|
|
3507
|
-
|
|
3508
|
-
// src/core/index.ts
|
|
3509
|
-
var core_exports = {};
|
|
3510
|
-
__export(core_exports, {
|
|
3511
|
-
BasicAuth: () => BasicAuth,
|
|
3512
|
-
BearerToken: () => BearerToken,
|
|
3513
|
-
Supplier: () => Supplier,
|
|
3514
|
-
fetcher: () => fetcher,
|
|
3515
|
-
serialization: () => schemas_exports
|
|
3516
|
-
});
|
|
3517
|
-
module.exports = __toCommonJS(core_exports);
|
|
3518
|
-
|
|
3519
|
-
// src/core/schemas/index.ts
|
|
3520
|
-
var schemas_exports = {};
|
|
3521
|
-
__export(schemas_exports, {
|
|
3522
|
-
JsonError: () => JsonError,
|
|
3523
|
-
ParseError: () => ParseError,
|
|
3524
|
-
any: () => any,
|
|
3525
|
-
boolean: () => boolean,
|
|
3526
|
-
date: () => date,
|
|
3527
|
-
discriminant: () => discriminant,
|
|
3528
|
-
enum_: () => enum_,
|
|
3529
|
-
getObjectLikeUtils: () => getObjectLikeUtils,
|
|
3530
|
-
getObjectUtils: () => getObjectUtils,
|
|
3531
|
-
getSchemaUtils: () => getSchemaUtils,
|
|
3532
|
-
isProperty: () => isProperty,
|
|
3533
|
-
lazy: () => lazy,
|
|
3534
|
-
lazyObject: () => lazyObject,
|
|
3535
|
-
list: () => list,
|
|
3536
|
-
number: () => number,
|
|
3537
|
-
object: () => object,
|
|
3538
|
-
optional: () => optional,
|
|
3539
|
-
property: () => property,
|
|
3540
|
-
record: () => record,
|
|
3541
|
-
set: () => set,
|
|
3542
|
-
string: () => string,
|
|
3543
|
-
stringLiteral: () => stringLiteral,
|
|
3544
|
-
transform: () => transform,
|
|
3545
|
-
union: () => union,
|
|
3546
|
-
unknown: () => unknown,
|
|
3547
|
-
withParsedProperties: () => withParsedProperties
|
|
3548
|
-
});
|
|
3549
|
-
|
|
3550
|
-
// src/core/schemas/Schema.ts
|
|
3551
|
-
var SchemaType = {
|
|
3552
|
-
DATE: "date",
|
|
3553
|
-
ENUM: "enum",
|
|
3554
|
-
LIST: "list",
|
|
3555
|
-
STRING_LITERAL: "stringLiteral",
|
|
3556
|
-
OBJECT: "object",
|
|
3557
|
-
ANY: "any",
|
|
3558
|
-
BOOLEAN: "boolean",
|
|
3559
|
-
NUMBER: "number",
|
|
3560
|
-
STRING: "string",
|
|
3561
|
-
UNKNOWN: "unknown",
|
|
3562
|
-
RECORD: "record",
|
|
3563
|
-
SET: "set",
|
|
3564
|
-
UNION: "union",
|
|
3565
|
-
OPTIONAL: "optional"
|
|
3566
|
-
};
|
|
3567
|
-
|
|
3568
|
-
// src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts
|
|
3569
|
-
function stringifyValidationError(error) {
|
|
3570
|
-
if (error.path.length === 0) {
|
|
3571
|
-
return error.message;
|
|
3572
|
-
}
|
|
3573
|
-
return `${error.path.join(" -> ")}: ${error.message}`;
|
|
3574
|
-
}
|
|
3575
|
-
|
|
3576
|
-
// src/core/schemas/builders/schema-utils/JsonError.ts
|
|
3577
|
-
var JsonError = class extends Error {
|
|
3578
|
-
constructor(errors) {
|
|
3579
|
-
super(errors.map(stringifyValidationError).join("; "));
|
|
3580
|
-
this.errors = errors;
|
|
3581
|
-
Object.setPrototypeOf(this, JsonError.prototype);
|
|
3582
|
-
}
|
|
3583
|
-
};
|
|
3584
|
-
|
|
3585
|
-
// src/core/schemas/builders/schema-utils/ParseError.ts
|
|
3586
|
-
var ParseError = class extends Error {
|
|
3587
|
-
constructor(errors) {
|
|
3588
|
-
super(errors.map(stringifyValidationError).join("; "));
|
|
3589
|
-
this.errors = errors;
|
|
3590
|
-
Object.setPrototypeOf(this, ParseError.prototype);
|
|
3591
|
-
}
|
|
3592
|
-
};
|
|
3593
|
-
|
|
3594
|
-
// src/core/schemas/builders/schema-utils/getSchemaUtils.ts
|
|
3595
|
-
function getSchemaUtils(schema) {
|
|
3596
|
-
return {
|
|
3597
|
-
optional: () => optional(schema),
|
|
3598
|
-
transform: (transformer) => transform(schema, transformer),
|
|
3599
|
-
parseOrThrow: async (raw, opts) => {
|
|
3600
|
-
const parsed = await schema.parse(raw, opts);
|
|
3601
|
-
if (parsed.ok) {
|
|
3602
|
-
return parsed.value;
|
|
3603
|
-
}
|
|
3604
|
-
throw new ParseError(parsed.errors);
|
|
3605
|
-
},
|
|
3606
|
-
jsonOrThrow: async (parsed, opts) => {
|
|
3607
|
-
const raw = await schema.json(parsed, opts);
|
|
3608
|
-
if (raw.ok) {
|
|
3609
|
-
return raw.value;
|
|
3610
|
-
}
|
|
3611
|
-
throw new JsonError(raw.errors);
|
|
3612
|
-
}
|
|
3613
|
-
};
|
|
3614
|
-
}
|
|
3615
|
-
function optional(schema) {
|
|
3616
|
-
const baseSchema = {
|
|
3617
|
-
parse: (raw, opts) => {
|
|
3618
|
-
if (raw == null) {
|
|
3619
|
-
return {
|
|
3620
|
-
ok: true,
|
|
3621
|
-
value: void 0
|
|
3622
|
-
};
|
|
3623
|
-
}
|
|
3624
|
-
return schema.parse(raw, opts);
|
|
3625
|
-
},
|
|
3626
|
-
json: (parsed, opts) => {
|
|
3627
|
-
if (parsed == null) {
|
|
3628
|
-
return {
|
|
3629
|
-
ok: true,
|
|
3630
|
-
value: null
|
|
3631
|
-
};
|
|
3632
|
-
}
|
|
3633
|
-
return schema.json(parsed, opts);
|
|
3634
|
-
},
|
|
3635
|
-
getType: () => SchemaType.OPTIONAL
|
|
3636
|
-
};
|
|
3637
|
-
return {
|
|
3638
|
-
...baseSchema,
|
|
3639
|
-
...getSchemaUtils(baseSchema)
|
|
3640
|
-
};
|
|
3641
|
-
}
|
|
3642
|
-
function transform(schema, transformer) {
|
|
3643
|
-
const baseSchema = {
|
|
3644
|
-
parse: async (raw, opts) => {
|
|
3645
|
-
const parsed = await schema.parse(raw, opts);
|
|
3646
|
-
if (!parsed.ok) {
|
|
3647
|
-
return parsed;
|
|
3648
|
-
}
|
|
3649
|
-
return {
|
|
3650
|
-
ok: true,
|
|
3651
|
-
value: transformer.transform(parsed.value)
|
|
3652
|
-
};
|
|
3653
|
-
},
|
|
3654
|
-
json: async (transformed, opts) => {
|
|
3655
|
-
const parsed = await transformer.untransform(transformed);
|
|
3656
|
-
return schema.json(parsed, opts);
|
|
3657
|
-
},
|
|
3658
|
-
getType: () => schema.getType()
|
|
3659
|
-
};
|
|
3660
|
-
return {
|
|
3661
|
-
...baseSchema,
|
|
3662
|
-
...getSchemaUtils(baseSchema)
|
|
3663
|
-
};
|
|
3664
|
-
}
|
|
3665
|
-
|
|
3666
|
-
// src/core/schemas/builders/date/date.ts
|
|
3667
|
-
var ISO_8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
|
3668
|
-
function date() {
|
|
3669
|
-
const baseSchema = {
|
|
3670
|
-
parse: (raw) => {
|
|
3671
|
-
if (typeof raw === "string" && ISO_8601_REGEX.test(raw)) {
|
|
3672
|
-
return {
|
|
3673
|
-
ok: true,
|
|
3674
|
-
value: new Date(raw)
|
|
3675
|
-
};
|
|
3676
|
-
} else {
|
|
3677
|
-
return {
|
|
3678
|
-
ok: false,
|
|
3679
|
-
errors: [
|
|
3680
|
-
{
|
|
3681
|
-
path: [],
|
|
3682
|
-
message: "Not an ISO 8601 date string"
|
|
3683
|
-
}
|
|
3684
|
-
]
|
|
3685
|
-
};
|
|
3686
|
-
}
|
|
3687
|
-
},
|
|
3688
|
-
json: (date2) => {
|
|
3689
|
-
if (date2 instanceof Date) {
|
|
3690
|
-
return {
|
|
3691
|
-
ok: true,
|
|
3692
|
-
value: date2.toISOString()
|
|
3693
|
-
};
|
|
3694
|
-
} else {
|
|
3695
|
-
return {
|
|
3696
|
-
ok: false,
|
|
3697
|
-
errors: [
|
|
3698
|
-
{
|
|
3699
|
-
path: [],
|
|
3700
|
-
message: "Not a Date object"
|
|
3701
|
-
}
|
|
3702
|
-
]
|
|
3703
|
-
};
|
|
3704
|
-
}
|
|
3705
|
-
},
|
|
3706
|
-
getType: () => SchemaType.DATE
|
|
3707
|
-
};
|
|
3708
|
-
return {
|
|
3709
|
-
...baseSchema,
|
|
3710
|
-
...getSchemaUtils(baseSchema)
|
|
3711
|
-
};
|
|
3712
|
-
}
|
|
3713
|
-
|
|
3714
|
-
// src/core/schemas/utils/createIdentitySchemaCreator.ts
|
|
3715
|
-
function createIdentitySchemaCreator(schemaType, validate) {
|
|
3716
|
-
return () => {
|
|
3717
|
-
const baseSchema = {
|
|
3718
|
-
parse: validate,
|
|
3719
|
-
json: validate,
|
|
3720
|
-
getType: () => schemaType
|
|
3721
|
-
};
|
|
3722
|
-
return {
|
|
3723
|
-
...baseSchema,
|
|
3724
|
-
...getSchemaUtils(baseSchema)
|
|
3725
|
-
};
|
|
3726
|
-
};
|
|
3727
|
-
}
|
|
3728
|
-
|
|
3729
|
-
// src/core/schemas/builders/enum/enum.ts
|
|
3730
|
-
function enum_(values) {
|
|
3731
|
-
const validValues = new Set(values);
|
|
3732
|
-
const schemaCreator = createIdentitySchemaCreator(SchemaType.ENUM, (value, { allowUnknownKeys = false } = {}) => {
|
|
3733
|
-
if (typeof value === "string" && (validValues.has(value) || allowUnknownKeys)) {
|
|
3734
|
-
return {
|
|
3735
|
-
ok: true,
|
|
3736
|
-
value
|
|
3737
|
-
};
|
|
3738
|
-
} else {
|
|
3739
|
-
return {
|
|
3740
|
-
ok: false,
|
|
3741
|
-
errors: [
|
|
3742
|
-
{
|
|
3743
|
-
path: [],
|
|
3744
|
-
message: "Not one of the allowed values"
|
|
3745
|
-
}
|
|
3746
|
-
]
|
|
3747
|
-
};
|
|
3748
|
-
}
|
|
3749
|
-
});
|
|
3750
|
-
return schemaCreator();
|
|
3751
|
-
}
|
|
3752
|
-
|
|
3753
|
-
// src/core/schemas/builders/lazy/lazy.ts
|
|
3754
|
-
function lazy(getter) {
|
|
3755
|
-
const baseSchema = constructLazyBaseSchema(getter);
|
|
3756
|
-
return {
|
|
3757
|
-
...baseSchema,
|
|
3758
|
-
...getSchemaUtils(baseSchema)
|
|
3759
|
-
};
|
|
3760
|
-
}
|
|
3761
|
-
function constructLazyBaseSchema(getter) {
|
|
3762
|
-
return {
|
|
3763
|
-
parse: async (raw, opts) => (await getMemoizedSchema(getter)).parse(raw, opts),
|
|
3764
|
-
json: async (parsed, opts) => (await getMemoizedSchema(getter)).json(parsed, opts),
|
|
3765
|
-
getType: async () => (await getMemoizedSchema(getter)).getType()
|
|
3766
|
-
};
|
|
3767
|
-
}
|
|
3768
|
-
async function getMemoizedSchema(getter) {
|
|
3769
|
-
const castedGetter = getter;
|
|
3770
|
-
if (castedGetter.__zurg_memoized == null) {
|
|
3771
|
-
castedGetter.__zurg_memoized = await getter();
|
|
3772
|
-
}
|
|
3773
|
-
return castedGetter.__zurg_memoized;
|
|
3774
|
-
}
|
|
3775
|
-
|
|
3776
|
-
// src/core/schemas/utils/entries.ts
|
|
3777
|
-
function entries(object2) {
|
|
3778
|
-
return Object.entries(object2);
|
|
3779
|
-
}
|
|
3780
|
-
|
|
3781
|
-
// src/core/schemas/utils/filterObject.ts
|
|
3782
|
-
function filterObject(obj, keysToInclude) {
|
|
3783
|
-
const keysToIncludeSet = new Set(keysToInclude);
|
|
3784
|
-
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
3785
|
-
if (keysToIncludeSet.has(key)) {
|
|
3786
|
-
acc[key] = value;
|
|
3787
|
-
}
|
|
3788
|
-
return acc;
|
|
3789
|
-
}, {});
|
|
3790
|
-
}
|
|
3791
|
-
|
|
3792
|
-
// src/core/schemas/utils/isPlainObject.ts
|
|
3793
|
-
var NOT_AN_OBJECT_ERROR_MESSAGE = "Not an object";
|
|
3794
|
-
function isPlainObject(value) {
|
|
3795
|
-
if (typeof value !== "object" || value === null) {
|
|
3796
|
-
return false;
|
|
3797
|
-
}
|
|
3798
|
-
if (Object.getPrototypeOf(value) === null) {
|
|
3799
|
-
return true;
|
|
3800
|
-
}
|
|
3801
|
-
let proto = value;
|
|
3802
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
3803
|
-
proto = Object.getPrototypeOf(proto);
|
|
3804
|
-
}
|
|
3805
|
-
return Object.getPrototypeOf(value) === proto;
|
|
3806
|
-
}
|
|
3807
|
-
|
|
3808
|
-
// src/core/schemas/utils/keys.ts
|
|
3809
|
-
function keys(object2) {
|
|
3810
|
-
return Object.keys(object2);
|
|
3811
|
-
}
|
|
3812
|
-
|
|
3813
|
-
// src/core/schemas/utils/partition.ts
|
|
3814
|
-
function partition(items, predicate) {
|
|
3815
|
-
const trueItems = [], falseItems = [];
|
|
3816
|
-
for (const item of items) {
|
|
3817
|
-
if (predicate(item)) {
|
|
3818
|
-
trueItems.push(item);
|
|
3819
|
-
} else {
|
|
3820
|
-
falseItems.push(item);
|
|
3821
|
-
}
|
|
3822
|
-
}
|
|
3823
|
-
return [trueItems, falseItems];
|
|
3824
|
-
}
|
|
3825
|
-
|
|
3826
|
-
// src/core/schemas/builders/object-like/getObjectLikeUtils.ts
|
|
3827
|
-
function getObjectLikeUtils(schema) {
|
|
3828
|
-
return {
|
|
3829
|
-
withParsedProperties: (properties) => withParsedProperties(schema, properties)
|
|
3830
|
-
};
|
|
3831
|
-
}
|
|
3832
|
-
function withParsedProperties(objectLike, properties) {
|
|
3833
|
-
const objectSchema = {
|
|
3834
|
-
parse: async (raw, opts) => {
|
|
3835
|
-
const parsedObject = await objectLike.parse(raw, opts);
|
|
3836
|
-
if (!parsedObject.ok) {
|
|
3837
|
-
return parsedObject;
|
|
3838
|
-
}
|
|
3839
|
-
const additionalProperties = Object.entries(properties).reduce(
|
|
3840
|
-
(processed, [key, value]) => {
|
|
3841
|
-
return {
|
|
3842
|
-
...processed,
|
|
3843
|
-
[key]: typeof value === "function" ? value(parsedObject.value) : value
|
|
3844
|
-
};
|
|
3845
|
-
},
|
|
3846
|
-
{}
|
|
3847
|
-
);
|
|
3848
|
-
return {
|
|
3849
|
-
ok: true,
|
|
3850
|
-
value: {
|
|
3851
|
-
...parsedObject.value,
|
|
3852
|
-
...additionalProperties
|
|
3853
|
-
}
|
|
3854
|
-
};
|
|
3855
|
-
},
|
|
3856
|
-
json: (parsed, opts) => {
|
|
3857
|
-
if (!isPlainObject(parsed)) {
|
|
3858
|
-
return {
|
|
3859
|
-
ok: false,
|
|
3860
|
-
errors: [
|
|
3861
|
-
{
|
|
3862
|
-
path: [],
|
|
3863
|
-
message: NOT_AN_OBJECT_ERROR_MESSAGE
|
|
3864
|
-
}
|
|
3865
|
-
]
|
|
3866
|
-
};
|
|
3867
|
-
}
|
|
3868
|
-
const addedPropertyKeys = new Set(Object.keys(properties));
|
|
3869
|
-
const parsedWithoutAddedProperties = filterObject(
|
|
3870
|
-
parsed,
|
|
3871
|
-
Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key))
|
|
3872
|
-
);
|
|
3873
|
-
return objectLike.json(parsedWithoutAddedProperties, opts);
|
|
3874
|
-
},
|
|
3875
|
-
getType: () => objectLike.getType()
|
|
3876
|
-
};
|
|
3877
|
-
return {
|
|
3878
|
-
...objectSchema,
|
|
3879
|
-
...getSchemaUtils(objectSchema),
|
|
3880
|
-
...getObjectLikeUtils(objectSchema)
|
|
3881
|
-
};
|
|
3882
|
-
}
|
|
3883
|
-
|
|
3884
|
-
// src/core/schemas/builders/object/property.ts
|
|
3885
|
-
function property(rawKey, valueSchema) {
|
|
3886
|
-
return {
|
|
3887
|
-
rawKey,
|
|
3888
|
-
valueSchema,
|
|
3889
|
-
isProperty: true
|
|
3890
|
-
};
|
|
3891
|
-
}
|
|
3892
|
-
function isProperty(maybeProperty) {
|
|
3893
|
-
return maybeProperty.isProperty;
|
|
3894
|
-
}
|
|
3895
|
-
|
|
3896
|
-
// src/core/schemas/builders/object/object.ts
|
|
3897
|
-
function object(schemas) {
|
|
3898
|
-
const baseSchema = {
|
|
3899
|
-
_getRawProperties: () => Promise.resolve(
|
|
3900
|
-
Object.entries(schemas).map(
|
|
3901
|
-
([parsedKey, propertySchema]) => isProperty(propertySchema) ? propertySchema.rawKey : parsedKey
|
|
3902
|
-
)
|
|
3903
|
-
),
|
|
3904
|
-
_getParsedProperties: () => Promise.resolve(keys(schemas)),
|
|
3905
|
-
parse: async (raw, opts) => {
|
|
3906
|
-
const rawKeyToProperty = {};
|
|
3907
|
-
const requiredKeys = [];
|
|
3908
|
-
for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
|
|
3909
|
-
const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey;
|
|
3910
|
-
const valueSchema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty;
|
|
3911
|
-
const property2 = {
|
|
3912
|
-
rawKey,
|
|
3913
|
-
parsedKey,
|
|
3914
|
-
valueSchema
|
|
3915
|
-
};
|
|
3916
|
-
rawKeyToProperty[rawKey] = property2;
|
|
3917
|
-
if (await valueSchema.getType() !== "optional") {
|
|
3918
|
-
requiredKeys.push(rawKey);
|
|
3919
|
-
}
|
|
3920
|
-
}
|
|
3921
|
-
return validateAndTransformObject({
|
|
3922
|
-
value: raw,
|
|
3923
|
-
requiredKeys,
|
|
3924
|
-
getProperty: (rawKey) => {
|
|
3925
|
-
const property2 = rawKeyToProperty[rawKey];
|
|
3926
|
-
if (property2 == null) {
|
|
3927
|
-
return void 0;
|
|
3928
|
-
}
|
|
3929
|
-
return {
|
|
3930
|
-
transformedKey: property2.parsedKey,
|
|
3931
|
-
transform: (propertyValue) => property2.valueSchema.parse(propertyValue, opts)
|
|
3932
|
-
};
|
|
3933
|
-
},
|
|
3934
|
-
allowUnknownKeys: opts?.allowUnknownKeys ?? false
|
|
3935
|
-
});
|
|
3936
|
-
},
|
|
3937
|
-
json: async (parsed, opts) => {
|
|
3938
|
-
const requiredKeys = [];
|
|
3939
|
-
for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
|
|
3940
|
-
const valueSchema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty;
|
|
3941
|
-
if (await valueSchema.getType() !== "optional") {
|
|
3942
|
-
requiredKeys.push(parsedKey);
|
|
3943
|
-
}
|
|
3944
|
-
}
|
|
3945
|
-
return validateAndTransformObject({
|
|
3946
|
-
value: parsed,
|
|
3947
|
-
requiredKeys,
|
|
3948
|
-
getProperty: (parsedKey) => {
|
|
3949
|
-
const property2 = schemas[parsedKey];
|
|
3950
|
-
if (property2 == null) {
|
|
3951
|
-
return void 0;
|
|
3952
|
-
}
|
|
3953
|
-
if (isProperty(property2)) {
|
|
3954
|
-
return {
|
|
3955
|
-
transformedKey: property2.rawKey,
|
|
3956
|
-
transform: (propertyValue) => property2.valueSchema.json(propertyValue, opts)
|
|
3957
|
-
};
|
|
3958
|
-
} else {
|
|
3959
|
-
return {
|
|
3960
|
-
transformedKey: parsedKey,
|
|
3961
|
-
transform: (propertyValue) => property2.json(propertyValue, opts)
|
|
3962
|
-
};
|
|
3963
|
-
}
|
|
3964
|
-
},
|
|
3965
|
-
allowUnknownKeys: opts?.allowUnknownKeys ?? false
|
|
3966
|
-
});
|
|
3967
|
-
},
|
|
3968
|
-
getType: () => SchemaType.OBJECT
|
|
3969
|
-
};
|
|
3970
|
-
return {
|
|
3971
|
-
...baseSchema,
|
|
3972
|
-
...getSchemaUtils(baseSchema),
|
|
3973
|
-
...getObjectLikeUtils(baseSchema),
|
|
3974
|
-
...getObjectUtils(baseSchema)
|
|
3975
|
-
};
|
|
3976
|
-
}
|
|
3977
|
-
async function validateAndTransformObject({
|
|
3978
|
-
value,
|
|
3979
|
-
requiredKeys,
|
|
3980
|
-
getProperty,
|
|
3981
|
-
allowUnknownKeys
|
|
3982
|
-
}) {
|
|
3983
|
-
if (!isPlainObject(value)) {
|
|
3984
|
-
return {
|
|
3985
|
-
ok: false,
|
|
3986
|
-
errors: [
|
|
3987
|
-
{
|
|
3988
|
-
path: [],
|
|
3989
|
-
message: NOT_AN_OBJECT_ERROR_MESSAGE
|
|
3990
|
-
}
|
|
3991
|
-
]
|
|
3992
|
-
};
|
|
3993
|
-
}
|
|
3994
|
-
const missingRequiredKeys = new Set(requiredKeys);
|
|
3995
|
-
const errors = [];
|
|
3996
|
-
const transformed = {};
|
|
3997
|
-
for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) {
|
|
3998
|
-
const property2 = getProperty(preTransformedKey);
|
|
3999
|
-
if (property2 != null) {
|
|
4000
|
-
missingRequiredKeys.delete(preTransformedKey);
|
|
4001
|
-
const value2 = await property2.transform(preTransformedItemValue);
|
|
4002
|
-
if (value2.ok) {
|
|
4003
|
-
transformed[property2.transformedKey] = value2.value;
|
|
4004
|
-
} else {
|
|
4005
|
-
errors.push(
|
|
4006
|
-
...value2.errors.map((error) => ({
|
|
4007
|
-
path: [preTransformedKey, ...error.path],
|
|
4008
|
-
message: error.message
|
|
4009
|
-
}))
|
|
4010
|
-
);
|
|
4011
|
-
}
|
|
4012
|
-
} else if (allowUnknownKeys) {
|
|
4013
|
-
transformed[preTransformedKey] = preTransformedItemValue;
|
|
4014
|
-
} else {
|
|
4015
|
-
errors.push({
|
|
4016
|
-
path: [preTransformedKey],
|
|
4017
|
-
message: `Unrecognized key "${preTransformedKey}"`
|
|
4018
|
-
});
|
|
4019
|
-
}
|
|
4020
|
-
}
|
|
4021
|
-
errors.push(
|
|
4022
|
-
...requiredKeys.filter((key) => missingRequiredKeys.has(key)).map((key) => ({
|
|
4023
|
-
path: [],
|
|
4024
|
-
message: `Missing required key "${key}"`
|
|
4025
|
-
}))
|
|
4026
|
-
);
|
|
4027
|
-
if (errors.length === 0) {
|
|
4028
|
-
return {
|
|
4029
|
-
ok: true,
|
|
4030
|
-
value: transformed
|
|
4031
|
-
};
|
|
4032
|
-
} else {
|
|
4033
|
-
return {
|
|
4034
|
-
ok: false,
|
|
4035
|
-
errors
|
|
4036
|
-
};
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4039
|
-
function getObjectUtils(schema) {
|
|
4040
|
-
return {
|
|
4041
|
-
extend: (extension) => {
|
|
4042
|
-
const baseSchema = {
|
|
4043
|
-
_getParsedProperties: async () => [
|
|
4044
|
-
...await schema._getParsedProperties(),
|
|
4045
|
-
...await extension._getParsedProperties()
|
|
4046
|
-
],
|
|
4047
|
-
_getRawProperties: async () => [
|
|
4048
|
-
...await schema._getRawProperties(),
|
|
4049
|
-
...await extension._getRawProperties()
|
|
4050
|
-
],
|
|
4051
|
-
parse: async (raw, opts) => {
|
|
4052
|
-
return validateAndTransformExtendedObject({
|
|
4053
|
-
extensionKeys: await extension._getRawProperties(),
|
|
4054
|
-
value: raw,
|
|
4055
|
-
transformBase: (rawBase) => schema.parse(rawBase, opts),
|
|
4056
|
-
transformExtension: (rawExtension) => extension.parse(rawExtension, opts)
|
|
4057
|
-
});
|
|
4058
|
-
},
|
|
4059
|
-
json: async (parsed, opts) => {
|
|
4060
|
-
return validateAndTransformExtendedObject({
|
|
4061
|
-
extensionKeys: await extension._getParsedProperties(),
|
|
4062
|
-
value: parsed,
|
|
4063
|
-
transformBase: (parsedBase) => schema.json(parsedBase, opts),
|
|
4064
|
-
transformExtension: (parsedExtension) => extension.json(parsedExtension, opts)
|
|
4065
|
-
});
|
|
4066
|
-
},
|
|
4067
|
-
getType: () => SchemaType.OBJECT
|
|
4068
|
-
};
|
|
4069
|
-
return {
|
|
4070
|
-
...baseSchema,
|
|
4071
|
-
...getSchemaUtils(baseSchema),
|
|
4072
|
-
...getObjectLikeUtils(baseSchema),
|
|
4073
|
-
...getObjectUtils(baseSchema)
|
|
4074
|
-
};
|
|
4075
|
-
}
|
|
4076
|
-
};
|
|
4077
|
-
}
|
|
4078
|
-
async function validateAndTransformExtendedObject({
|
|
4079
|
-
extensionKeys,
|
|
4080
|
-
value,
|
|
4081
|
-
transformBase,
|
|
4082
|
-
transformExtension
|
|
4083
|
-
}) {
|
|
4084
|
-
const extensionPropertiesSet = new Set(extensionKeys);
|
|
4085
|
-
const [extensionProperties, baseProperties] = partition(
|
|
4086
|
-
keys(value),
|
|
4087
|
-
(key) => extensionPropertiesSet.has(key)
|
|
4088
|
-
);
|
|
4089
|
-
const transformedBase = await transformBase(filterObject(value, baseProperties));
|
|
4090
|
-
const transformedExtension = await transformExtension(filterObject(value, extensionProperties));
|
|
4091
|
-
if (transformedBase.ok && transformedExtension.ok) {
|
|
4092
|
-
return {
|
|
4093
|
-
ok: true,
|
|
4094
|
-
value: {
|
|
4095
|
-
...transformedBase.value,
|
|
4096
|
-
...transformedExtension.value
|
|
4097
|
-
}
|
|
4098
|
-
};
|
|
4099
|
-
} else {
|
|
4100
|
-
return {
|
|
4101
|
-
ok: false,
|
|
4102
|
-
errors: [
|
|
4103
|
-
...transformedBase.ok ? [] : transformedBase.errors,
|
|
4104
|
-
...transformedExtension.ok ? [] : transformedExtension.errors
|
|
4105
|
-
]
|
|
4106
|
-
};
|
|
4107
|
-
}
|
|
4108
|
-
}
|
|
4109
|
-
|
|
4110
|
-
// src/core/schemas/builders/lazy/lazyObject.ts
|
|
4111
|
-
function lazyObject(getter) {
|
|
4112
|
-
const baseSchema = {
|
|
4113
|
-
...constructLazyBaseSchema(getter),
|
|
4114
|
-
_getRawProperties: async () => (await getMemoizedSchema(getter))._getRawProperties(),
|
|
4115
|
-
_getParsedProperties: async () => (await getMemoizedSchema(getter))._getParsedProperties()
|
|
4116
|
-
};
|
|
4117
|
-
return {
|
|
4118
|
-
...baseSchema,
|
|
4119
|
-
...getSchemaUtils(baseSchema),
|
|
4120
|
-
...getObjectLikeUtils(baseSchema),
|
|
4121
|
-
...getObjectUtils(baseSchema)
|
|
4122
|
-
};
|
|
4123
|
-
}
|
|
4124
|
-
|
|
4125
|
-
// src/core/schemas/builders/list/list.ts
|
|
4126
|
-
function list(schema) {
|
|
4127
|
-
const baseSchema = {
|
|
4128
|
-
parse: async (raw, opts) => validateAndTransformArray(raw, (item) => schema.parse(item, opts)),
|
|
4129
|
-
json: (parsed, opts) => validateAndTransformArray(parsed, (item) => schema.json(item, opts)),
|
|
4130
|
-
getType: () => SchemaType.LIST
|
|
4131
|
-
};
|
|
4132
|
-
return {
|
|
4133
|
-
...baseSchema,
|
|
4134
|
-
...getSchemaUtils(baseSchema)
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
async function validateAndTransformArray(value, transformItem) {
|
|
4138
|
-
if (!Array.isArray(value)) {
|
|
4139
|
-
return {
|
|
4140
|
-
ok: false,
|
|
4141
|
-
errors: [
|
|
4142
|
-
{
|
|
4143
|
-
message: "Not a list",
|
|
4144
|
-
path: []
|
|
4145
|
-
}
|
|
4146
|
-
]
|
|
4147
|
-
};
|
|
4148
|
-
}
|
|
4149
|
-
const maybeValidItems = await Promise.all(value.map((item) => transformItem(item)));
|
|
4150
|
-
return maybeValidItems.reduce(
|
|
4151
|
-
(acc, item, index) => {
|
|
4152
|
-
if (acc.ok && item.ok) {
|
|
4153
|
-
return {
|
|
4154
|
-
ok: true,
|
|
4155
|
-
value: [...acc.value, item.value]
|
|
4156
|
-
};
|
|
4157
|
-
}
|
|
4158
|
-
const errors = [];
|
|
4159
|
-
if (!acc.ok) {
|
|
4160
|
-
errors.push(...acc.errors);
|
|
4161
|
-
}
|
|
4162
|
-
if (!item.ok) {
|
|
4163
|
-
errors.push(
|
|
4164
|
-
...item.errors.map((error) => ({
|
|
4165
|
-
path: [`[${index}]`, ...error.path],
|
|
4166
|
-
message: error.message
|
|
4167
|
-
}))
|
|
4168
|
-
);
|
|
4169
|
-
}
|
|
4170
|
-
return {
|
|
4171
|
-
ok: false,
|
|
4172
|
-
errors
|
|
4173
|
-
};
|
|
4174
|
-
},
|
|
4175
|
-
{ ok: true, value: [] }
|
|
4176
|
-
);
|
|
4177
|
-
}
|
|
4178
|
-
|
|
4179
|
-
// src/core/schemas/builders/literals/stringLiteral.ts
|
|
4180
|
-
function stringLiteral(literal) {
|
|
4181
|
-
const schemaCreator = createIdentitySchemaCreator(SchemaType.STRING_LITERAL, (value) => {
|
|
4182
|
-
if (value === literal) {
|
|
4183
|
-
return {
|
|
4184
|
-
ok: true,
|
|
4185
|
-
value: literal
|
|
4186
|
-
};
|
|
4187
|
-
} else {
|
|
4188
|
-
return {
|
|
4189
|
-
ok: false,
|
|
4190
|
-
errors: [
|
|
4191
|
-
{
|
|
4192
|
-
path: [],
|
|
4193
|
-
message: `Not equal to "${literal}"`
|
|
4194
|
-
}
|
|
4195
|
-
]
|
|
4196
|
-
};
|
|
4197
|
-
}
|
|
4198
|
-
});
|
|
4199
|
-
return schemaCreator();
|
|
4200
|
-
}
|
|
4201
|
-
|
|
4202
|
-
// src/core/schemas/builders/primitives/any.ts
|
|
4203
|
-
var any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value }));
|
|
4204
|
-
|
|
4205
|
-
// src/core/schemas/builders/primitives/boolean.ts
|
|
4206
|
-
var boolean = createIdentitySchemaCreator(SchemaType.BOOLEAN, (value) => {
|
|
4207
|
-
if (typeof value === "boolean") {
|
|
4208
|
-
return {
|
|
4209
|
-
ok: true,
|
|
4210
|
-
value
|
|
4211
|
-
};
|
|
4212
|
-
} else {
|
|
4213
|
-
return {
|
|
4214
|
-
ok: false,
|
|
4215
|
-
errors: [
|
|
4216
|
-
{
|
|
4217
|
-
path: [],
|
|
4218
|
-
message: "Not a boolean"
|
|
4219
|
-
}
|
|
4220
|
-
]
|
|
4221
|
-
};
|
|
4222
|
-
}
|
|
4223
|
-
});
|
|
4224
|
-
|
|
4225
|
-
// src/core/schemas/builders/primitives/number.ts
|
|
4226
|
-
var number = createIdentitySchemaCreator(SchemaType.NUMBER, (value) => {
|
|
4227
|
-
if (typeof value === "number") {
|
|
4228
|
-
return {
|
|
4229
|
-
ok: true,
|
|
4230
|
-
value
|
|
4231
|
-
};
|
|
4232
|
-
} else {
|
|
4233
|
-
return {
|
|
4234
|
-
ok: false,
|
|
4235
|
-
errors: [
|
|
4236
|
-
{
|
|
4237
|
-
path: [],
|
|
4238
|
-
message: "Not a number"
|
|
4239
|
-
}
|
|
4240
|
-
]
|
|
4241
|
-
};
|
|
4242
|
-
}
|
|
4243
|
-
});
|
|
4244
|
-
|
|
4245
|
-
// src/core/schemas/builders/primitives/string.ts
|
|
4246
|
-
var string = createIdentitySchemaCreator(SchemaType.STRING, (value) => {
|
|
4247
|
-
if (typeof value === "string") {
|
|
4248
|
-
return {
|
|
4249
|
-
ok: true,
|
|
4250
|
-
value
|
|
4251
|
-
};
|
|
4252
|
-
} else {
|
|
4253
|
-
return {
|
|
4254
|
-
ok: false,
|
|
4255
|
-
errors: [
|
|
4256
|
-
{
|
|
4257
|
-
path: [],
|
|
4258
|
-
message: "Not a string"
|
|
4259
|
-
}
|
|
4260
|
-
]
|
|
4261
|
-
};
|
|
4262
|
-
}
|
|
4263
|
-
});
|
|
4264
|
-
|
|
4265
|
-
// src/core/schemas/builders/primitives/unknown.ts
|
|
4266
|
-
var unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value }));
|
|
4267
|
-
|
|
4268
|
-
// src/core/schemas/builders/record/record.ts
|
|
4269
|
-
function record(keySchema, valueSchema) {
|
|
4270
|
-
const baseSchema = {
|
|
4271
|
-
parse: async (raw, opts) => {
|
|
4272
|
-
return validateAndTransformRecord({
|
|
4273
|
-
value: raw,
|
|
4274
|
-
isKeyNumeric: await keySchema.getType() === SchemaType.NUMBER,
|
|
4275
|
-
transformKey: (key) => keySchema.parse(key, opts),
|
|
4276
|
-
transformValue: (value) => valueSchema.parse(value, opts)
|
|
4277
|
-
});
|
|
4278
|
-
},
|
|
4279
|
-
json: async (parsed, opts) => {
|
|
4280
|
-
return validateAndTransformRecord({
|
|
4281
|
-
value: parsed,
|
|
4282
|
-
isKeyNumeric: await keySchema.getType() === SchemaType.NUMBER,
|
|
4283
|
-
transformKey: (key) => keySchema.json(key, opts),
|
|
4284
|
-
transformValue: (value) => valueSchema.json(value, opts)
|
|
4285
|
-
});
|
|
4286
|
-
},
|
|
4287
|
-
getType: () => SchemaType.RECORD
|
|
4288
|
-
};
|
|
4289
|
-
return {
|
|
4290
|
-
...baseSchema,
|
|
4291
|
-
...getSchemaUtils(baseSchema)
|
|
4292
|
-
};
|
|
4293
|
-
}
|
|
4294
|
-
async function validateAndTransformRecord({
|
|
4295
|
-
value,
|
|
4296
|
-
isKeyNumeric,
|
|
4297
|
-
transformKey,
|
|
4298
|
-
transformValue
|
|
4299
|
-
}) {
|
|
4300
|
-
if (!isPlainObject(value)) {
|
|
4301
|
-
return {
|
|
4302
|
-
ok: false,
|
|
4303
|
-
errors: [
|
|
4304
|
-
{
|
|
4305
|
-
path: [],
|
|
4306
|
-
message: NOT_AN_OBJECT_ERROR_MESSAGE
|
|
4307
|
-
}
|
|
4308
|
-
]
|
|
4309
|
-
};
|
|
4310
|
-
}
|
|
4311
|
-
return entries(value).reduce(
|
|
4312
|
-
async (accPromise, [stringKey, value2]) => {
|
|
4313
|
-
if (value2 == null) {
|
|
4314
|
-
return accPromise;
|
|
4315
|
-
}
|
|
4316
|
-
const acc = await accPromise;
|
|
4317
|
-
let key = stringKey;
|
|
4318
|
-
if (isKeyNumeric) {
|
|
4319
|
-
const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
|
|
4320
|
-
if (!isNaN(numberKey)) {
|
|
4321
|
-
key = numberKey;
|
|
4322
|
-
}
|
|
4323
|
-
}
|
|
4324
|
-
const transformedKey = await transformKey(key);
|
|
4325
|
-
const transformedValue = await transformValue(value2);
|
|
4326
|
-
if (acc.ok && transformedKey.ok && transformedValue.ok) {
|
|
4327
|
-
return {
|
|
4328
|
-
ok: true,
|
|
4329
|
-
value: {
|
|
4330
|
-
...acc.value,
|
|
4331
|
-
[transformedKey.value]: transformedValue.value
|
|
4332
|
-
}
|
|
4333
|
-
};
|
|
4334
|
-
}
|
|
4335
|
-
const errors = [];
|
|
4336
|
-
if (!acc.ok) {
|
|
4337
|
-
errors.push(...acc.errors);
|
|
4338
|
-
}
|
|
4339
|
-
if (!transformedKey.ok) {
|
|
4340
|
-
errors.push(
|
|
4341
|
-
...transformedKey.errors.map((error) => ({
|
|
4342
|
-
path: [`${key} (key)`, ...error.path],
|
|
4343
|
-
message: error.message
|
|
4344
|
-
}))
|
|
4345
|
-
);
|
|
4346
|
-
}
|
|
4347
|
-
if (!transformedValue.ok) {
|
|
4348
|
-
errors.push(
|
|
4349
|
-
...transformedValue.errors.map((error) => ({
|
|
4350
|
-
path: [stringKey, ...error.path],
|
|
4351
|
-
message: error.message
|
|
4352
|
-
}))
|
|
4353
|
-
);
|
|
4354
|
-
}
|
|
4355
|
-
return {
|
|
4356
|
-
ok: false,
|
|
4357
|
-
errors
|
|
4358
|
-
};
|
|
4359
|
-
},
|
|
4360
|
-
Promise.resolve({ ok: true, value: {} })
|
|
4361
|
-
);
|
|
4362
|
-
}
|
|
4363
|
-
|
|
4364
|
-
// src/core/schemas/builders/set/set.ts
|
|
4365
|
-
function set(schema) {
|
|
4366
|
-
const listSchema = list(schema);
|
|
4367
|
-
const baseSchema = {
|
|
4368
|
-
parse: async (raw, opts) => {
|
|
4369
|
-
const parsedList = await listSchema.parse(raw, opts);
|
|
4370
|
-
if (parsedList.ok) {
|
|
4371
|
-
return {
|
|
4372
|
-
ok: true,
|
|
4373
|
-
value: new Set(parsedList.value)
|
|
4374
|
-
};
|
|
4375
|
-
} else {
|
|
4376
|
-
return parsedList;
|
|
4377
|
-
}
|
|
4378
|
-
},
|
|
4379
|
-
json: async (parsed, opts) => {
|
|
4380
|
-
if (!(parsed instanceof Set)) {
|
|
4381
|
-
return {
|
|
4382
|
-
ok: false,
|
|
4383
|
-
errors: [
|
|
4384
|
-
{
|
|
4385
|
-
path: [],
|
|
4386
|
-
message: "Not a Set"
|
|
4387
|
-
}
|
|
4388
|
-
]
|
|
4389
|
-
};
|
|
4390
|
-
}
|
|
4391
|
-
const jsonList = await listSchema.json([...parsed], opts);
|
|
4392
|
-
return jsonList;
|
|
4393
|
-
},
|
|
4394
|
-
getType: () => SchemaType.SET
|
|
4395
|
-
};
|
|
4396
|
-
return {
|
|
4397
|
-
...baseSchema,
|
|
4398
|
-
...getSchemaUtils(baseSchema)
|
|
4399
|
-
};
|
|
4400
|
-
}
|
|
4401
|
-
|
|
4402
|
-
// src/core/schemas/builders/union/discriminant.ts
|
|
4403
|
-
function discriminant(parsedDiscriminant, rawDiscriminant) {
|
|
4404
|
-
return {
|
|
4405
|
-
parsedDiscriminant,
|
|
4406
|
-
rawDiscriminant
|
|
4407
|
-
};
|
|
4408
|
-
}
|
|
4409
|
-
|
|
4410
|
-
// src/core/schemas/builders/union/union.ts
|
|
4411
|
-
function union(discriminant2, union2) {
|
|
4412
|
-
const rawDiscriminant = typeof discriminant2 === "string" ? discriminant2 : discriminant2.rawDiscriminant;
|
|
4413
|
-
const parsedDiscriminant = typeof discriminant2 === "string" ? discriminant2 : discriminant2.parsedDiscriminant;
|
|
4414
|
-
const discriminantValueSchema = enum_(keys(union2));
|
|
4415
|
-
const baseSchema = {
|
|
4416
|
-
parse: async (raw, opts) => {
|
|
4417
|
-
return transformAndValidateUnion(
|
|
4418
|
-
raw,
|
|
4419
|
-
rawDiscriminant,
|
|
4420
|
-
parsedDiscriminant,
|
|
4421
|
-
(discriminantValue) => discriminantValueSchema.parse(discriminantValue, opts),
|
|
4422
|
-
(discriminantValue) => union2[discriminantValue],
|
|
4423
|
-
opts?.allowUnknownKeys ?? false,
|
|
4424
|
-
(additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts)
|
|
4425
|
-
);
|
|
4426
|
-
},
|
|
4427
|
-
json: async (parsed, opts) => {
|
|
4428
|
-
return transformAndValidateUnion(
|
|
4429
|
-
parsed,
|
|
4430
|
-
parsedDiscriminant,
|
|
4431
|
-
rawDiscriminant,
|
|
4432
|
-
(discriminantValue) => discriminantValueSchema.json(discriminantValue, opts),
|
|
4433
|
-
(discriminantValue) => union2[discriminantValue],
|
|
4434
|
-
opts?.allowUnknownKeys ?? false,
|
|
4435
|
-
(additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts)
|
|
4436
|
-
);
|
|
4437
|
-
},
|
|
4438
|
-
getType: () => SchemaType.UNION
|
|
4439
|
-
};
|
|
4440
|
-
return {
|
|
4441
|
-
...baseSchema,
|
|
4442
|
-
...getSchemaUtils(baseSchema),
|
|
4443
|
-
...getObjectLikeUtils(baseSchema)
|
|
4444
|
-
};
|
|
4445
|
-
}
|
|
4446
|
-
async function transformAndValidateUnion(value, discriminant2, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnknownKeys, transformAdditionalProperties) {
|
|
4447
|
-
if (!isPlainObject(value)) {
|
|
4448
|
-
return {
|
|
4449
|
-
ok: false,
|
|
4450
|
-
errors: [
|
|
4451
|
-
{
|
|
4452
|
-
path: [],
|
|
4453
|
-
message: NOT_AN_OBJECT_ERROR_MESSAGE
|
|
4454
|
-
}
|
|
4455
|
-
]
|
|
4456
|
-
};
|
|
4457
|
-
}
|
|
4458
|
-
const { [discriminant2]: discriminantValue, ...additionalProperties } = value;
|
|
4459
|
-
if (discriminantValue == null) {
|
|
4460
|
-
return {
|
|
4461
|
-
ok: false,
|
|
4462
|
-
errors: [
|
|
4463
|
-
{
|
|
4464
|
-
path: [],
|
|
4465
|
-
message: `Missing discriminant ("${discriminant2}")`
|
|
4466
|
-
}
|
|
4467
|
-
]
|
|
4468
|
-
};
|
|
4469
|
-
}
|
|
4470
|
-
const transformedDiscriminantValue = await transformDiscriminantValue(discriminantValue);
|
|
4471
|
-
if (!transformedDiscriminantValue.ok) {
|
|
4472
|
-
return {
|
|
4473
|
-
ok: false,
|
|
4474
|
-
errors: transformedDiscriminantValue.errors.map((error) => ({
|
|
4475
|
-
path: [discriminant2, ...error.path],
|
|
4476
|
-
message: error.message
|
|
4477
|
-
}))
|
|
4478
|
-
};
|
|
4479
|
-
}
|
|
4480
|
-
const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
|
|
4481
|
-
if (additionalPropertiesSchema == null) {
|
|
4482
|
-
if (allowUnknownKeys) {
|
|
4483
|
-
return {
|
|
4484
|
-
ok: true,
|
|
4485
|
-
value: {
|
|
4486
|
-
[transformedDiscriminant]: transformedDiscriminantValue.value,
|
|
4487
|
-
...additionalProperties
|
|
4488
|
-
}
|
|
4489
|
-
};
|
|
4490
|
-
} else {
|
|
4491
|
-
return {
|
|
4492
|
-
ok: false,
|
|
4493
|
-
errors: [
|
|
4494
|
-
{
|
|
4495
|
-
path: [discriminant2],
|
|
4496
|
-
message: "Unrecognized discriminant value"
|
|
4497
|
-
}
|
|
4498
|
-
]
|
|
4499
|
-
};
|
|
4500
|
-
}
|
|
4501
|
-
}
|
|
4502
|
-
const transformedAdditionalProperties = await transformAdditionalProperties(
|
|
4503
|
-
additionalProperties,
|
|
4504
|
-
additionalPropertiesSchema
|
|
4505
|
-
);
|
|
4506
|
-
if (!transformedAdditionalProperties.ok) {
|
|
4507
|
-
return transformedAdditionalProperties;
|
|
4508
|
-
}
|
|
4509
|
-
return {
|
|
4510
|
-
ok: true,
|
|
4511
|
-
value: {
|
|
4512
|
-
[transformedDiscriminant]: discriminantValue,
|
|
4513
|
-
...transformedAdditionalProperties.value
|
|
4514
|
-
}
|
|
4515
|
-
};
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
|
-
// src/core/auth/BasicAuth.ts
|
|
4519
|
-
var import_basic_auth = __toESM(require_basic_auth());
|
|
4520
|
-
|
|
4521
|
-
// .yarn/cache/js-base64-npm-3.7.5-81a9ad2ffd-67a78c8b1c.zip/node_modules/js-base64/base64.mjs
|
|
4522
|
-
var version = "3.7.5";
|
|
4523
|
-
var VERSION = version;
|
|
4524
|
-
var _hasatob = typeof atob === "function";
|
|
4525
|
-
var _hasbtoa = typeof btoa === "function";
|
|
4526
|
-
var _hasBuffer = typeof Buffer === "function";
|
|
4527
|
-
var _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
|
|
4528
|
-
var _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
|
|
4529
|
-
var b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
4530
|
-
var b64chs = Array.prototype.slice.call(b64ch);
|
|
4531
|
-
var b64tab = ((a) => {
|
|
4532
|
-
let tab = {};
|
|
4533
|
-
a.forEach((c, i) => tab[c] = i);
|
|
4534
|
-
return tab;
|
|
4535
|
-
})(b64chs);
|
|
4536
|
-
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
4537
|
-
var _fromCC = String.fromCharCode.bind(String);
|
|
4538
|
-
var _U8Afrom = typeof Uint8Array.from === "function" ? Uint8Array.from.bind(Uint8Array) : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
|
|
4539
|
-
var _mkUriSafe = (src) => src.replace(/=/g, "").replace(/[+\/]/g, (m0) => m0 == "+" ? "-" : "_");
|
|
4540
|
-
var _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, "");
|
|
4541
|
-
var btoaPolyfill = (bin) => {
|
|
4542
|
-
let u32, c0, c1, c2, asc = "";
|
|
4543
|
-
const pad = bin.length % 3;
|
|
4544
|
-
for (let i = 0; i < bin.length; ) {
|
|
4545
|
-
if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255)
|
|
4546
|
-
throw new TypeError("invalid character found");
|
|
4547
|
-
u32 = c0 << 16 | c1 << 8 | c2;
|
|
4548
|
-
asc += b64chs[u32 >> 18 & 63] + b64chs[u32 >> 12 & 63] + b64chs[u32 >> 6 & 63] + b64chs[u32 & 63];
|
|
4549
|
-
}
|
|
4550
|
-
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
4551
|
-
};
|
|
4552
|
-
var _btoa = _hasbtoa ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
|
|
4553
|
-
var _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
|
|
4554
|
-
const maxargs = 4096;
|
|
4555
|
-
let strs = [];
|
|
4556
|
-
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
4557
|
-
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
4558
|
-
}
|
|
4559
|
-
return _btoa(strs.join(""));
|
|
4560
|
-
};
|
|
4561
|
-
var fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
4562
|
-
var cb_utob = (c) => {
|
|
4563
|
-
if (c.length < 2) {
|
|
4564
|
-
var cc = c.charCodeAt(0);
|
|
4565
|
-
return cc < 128 ? c : cc < 2048 ? _fromCC(192 | cc >>> 6) + _fromCC(128 | cc & 63) : _fromCC(224 | cc >>> 12 & 15) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
|
|
4566
|
-
} else {
|
|
4567
|
-
var cc = 65536 + (c.charCodeAt(0) - 55296) * 1024 + (c.charCodeAt(1) - 56320);
|
|
4568
|
-
return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
|
|
4569
|
-
}
|
|
4570
|
-
};
|
|
4571
|
-
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
4572
|
-
var utob = (u) => u.replace(re_utob, cb_utob);
|
|
4573
|
-
var _encode = _hasBuffer ? (s) => Buffer.from(s, "utf8").toString("base64") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
|
|
4574
|
-
var encode = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);
|
|
4575
|
-
var encodeURI = (src) => encode(src, true);
|
|
4576
|
-
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
4577
|
-
var cb_btou = (cccc) => {
|
|
4578
|
-
switch (cccc.length) {
|
|
4579
|
-
case 4:
|
|
4580
|
-
var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;
|
|
4581
|
-
return _fromCC((offset >>> 10) + 55296) + _fromCC((offset & 1023) + 56320);
|
|
4582
|
-
case 3:
|
|
4583
|
-
return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));
|
|
4584
|
-
default:
|
|
4585
|
-
return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1));
|
|
4586
|
-
}
|
|
4587
|
-
};
|
|
4588
|
-
var btou = (b) => b.replace(re_btou, cb_btou);
|
|
4589
|
-
var atobPolyfill = (asc) => {
|
|
4590
|
-
asc = asc.replace(/\s+/g, "");
|
|
4591
|
-
if (!b64re.test(asc))
|
|
4592
|
-
throw new TypeError("malformed base64.");
|
|
4593
|
-
asc += "==".slice(2 - (asc.length & 3));
|
|
4594
|
-
let u24, bin = "", r1, r2;
|
|
4595
|
-
for (let i = 0; i < asc.length; ) {
|
|
4596
|
-
u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);
|
|
4597
|
-
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
|
|
4598
|
-
}
|
|
4599
|
-
return bin;
|
|
4600
|
-
};
|
|
4601
|
-
var _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
|
|
4602
|
-
var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
|
|
4603
|
-
var toUint8Array = (a) => _toUint8Array(_unURI(a));
|
|
4604
|
-
var _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
|
|
4605
|
-
var _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == "-" ? "+" : "/"));
|
|
4606
|
-
var decode = (src) => _decode(_unURI(src));
|
|
4607
|
-
var isValid = (src) => {
|
|
4608
|
-
if (typeof src !== "string")
|
|
4609
|
-
return false;
|
|
4610
|
-
const s = src.replace(/\s+/g, "").replace(/={0,2}$/, "");
|
|
4611
|
-
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
4612
|
-
};
|
|
4613
|
-
var _noEnum = (v) => {
|
|
4614
|
-
return {
|
|
4615
|
-
value: v,
|
|
4616
|
-
enumerable: false,
|
|
4617
|
-
writable: true,
|
|
4618
|
-
configurable: true
|
|
4619
|
-
};
|
|
4620
|
-
};
|
|
4621
|
-
var extendString = function() {
|
|
4622
|
-
const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
|
|
4623
|
-
_add("fromBase64", function() {
|
|
4624
|
-
return decode(this);
|
|
4625
|
-
});
|
|
4626
|
-
_add("toBase64", function(urlsafe) {
|
|
4627
|
-
return encode(this, urlsafe);
|
|
4628
|
-
});
|
|
4629
|
-
_add("toBase64URI", function() {
|
|
4630
|
-
return encode(this, true);
|
|
4631
|
-
});
|
|
4632
|
-
_add("toBase64URL", function() {
|
|
4633
|
-
return encode(this, true);
|
|
4634
|
-
});
|
|
4635
|
-
_add("toUint8Array", function() {
|
|
4636
|
-
return toUint8Array(this);
|
|
4637
|
-
});
|
|
4638
|
-
};
|
|
4639
|
-
var extendUint8Array = function() {
|
|
4640
|
-
const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
|
|
4641
|
-
_add("toBase64", function(urlsafe) {
|
|
4642
|
-
return fromUint8Array(this, urlsafe);
|
|
4643
|
-
});
|
|
4644
|
-
_add("toBase64URI", function() {
|
|
4645
|
-
return fromUint8Array(this, true);
|
|
4646
|
-
});
|
|
4647
|
-
_add("toBase64URL", function() {
|
|
4648
|
-
return fromUint8Array(this, true);
|
|
4649
|
-
});
|
|
4650
|
-
};
|
|
4651
|
-
var extendBuiltins = () => {
|
|
4652
|
-
extendString();
|
|
4653
|
-
extendUint8Array();
|
|
4654
|
-
};
|
|
4655
|
-
var gBase64 = {
|
|
4656
|
-
version,
|
|
4657
|
-
VERSION,
|
|
4658
|
-
atob: _atob,
|
|
4659
|
-
atobPolyfill,
|
|
4660
|
-
btoa: _btoa,
|
|
4661
|
-
btoaPolyfill,
|
|
4662
|
-
fromBase64: decode,
|
|
4663
|
-
toBase64: encode,
|
|
4664
|
-
encode,
|
|
4665
|
-
encodeURI,
|
|
4666
|
-
encodeURL: encodeURI,
|
|
4667
|
-
utob,
|
|
4668
|
-
btou,
|
|
4669
|
-
decode,
|
|
4670
|
-
isValid,
|
|
4671
|
-
fromUint8Array,
|
|
4672
|
-
toUint8Array,
|
|
4673
|
-
extendString,
|
|
4674
|
-
extendUint8Array,
|
|
4675
|
-
extendBuiltins
|
|
4676
|
-
};
|
|
4677
|
-
|
|
4678
|
-
// src/core/auth/BasicAuth.ts
|
|
4679
|
-
var BasicAuth = {
|
|
4680
|
-
toAuthorizationHeader: (basicAuth) => {
|
|
4681
|
-
if (basicAuth == null) {
|
|
4682
|
-
return void 0;
|
|
4683
|
-
}
|
|
4684
|
-
const token = gBase64.encode(`${basicAuth.username}:${basicAuth.password}`);
|
|
4685
|
-
return `Basic ${token}`;
|
|
4686
|
-
},
|
|
4687
|
-
fromAuthorizationHeader: (header) => {
|
|
4688
|
-
const parsed = (0, import_basic_auth.parse)(header);
|
|
4689
|
-
if (parsed == null) {
|
|
4690
|
-
throw new Error("Invalid basic auth");
|
|
4691
|
-
}
|
|
4692
|
-
return {
|
|
4693
|
-
username: parsed.name,
|
|
4694
|
-
password: parsed.pass
|
|
4695
|
-
};
|
|
4696
|
-
}
|
|
4697
|
-
};
|
|
4698
|
-
|
|
4699
|
-
// src/core/auth/BearerToken.ts
|
|
4700
|
-
var BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
|
|
4701
|
-
var BearerToken = {
|
|
4702
|
-
toAuthorizationHeader: (token) => {
|
|
4703
|
-
if (token == null) {
|
|
4704
|
-
return void 0;
|
|
4705
|
-
}
|
|
4706
|
-
return `Bearer ${token}`;
|
|
4707
|
-
},
|
|
4708
|
-
fromAuthorizationHeader: (header) => {
|
|
4709
|
-
return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
|
|
4710
|
-
}
|
|
4711
|
-
};
|
|
4712
|
-
|
|
4713
|
-
// src/core/fetcher/Fetcher.ts
|
|
4714
|
-
var import_axios = __toESM(require_axios2());
|
|
4715
|
-
var fetcher = async (args) => {
|
|
4716
|
-
const headers = {
|
|
4717
|
-
"Content-Type": "application/json"
|
|
4718
|
-
};
|
|
4719
|
-
if (args.headers != null) {
|
|
4720
|
-
for (const [key, value] of Object.entries(args.headers)) {
|
|
4721
|
-
if (value != null) {
|
|
4722
|
-
headers[key] = value;
|
|
4723
|
-
}
|
|
4724
|
-
}
|
|
4725
|
-
}
|
|
4726
|
-
try {
|
|
4727
|
-
const response = await (0, import_axios.default)({
|
|
4728
|
-
url: args.url,
|
|
4729
|
-
params: args.queryParameters,
|
|
4730
|
-
method: args.method,
|
|
4731
|
-
headers,
|
|
4732
|
-
data: args.body,
|
|
4733
|
-
validateStatus: () => true,
|
|
4734
|
-
transformResponse: (response2) => response2,
|
|
4735
|
-
timeout: args.timeoutMs ?? 6e4,
|
|
4736
|
-
transitional: {
|
|
4737
|
-
clarifyTimeoutError: true
|
|
4738
|
-
},
|
|
4739
|
-
withCredentials: args.withCredentials
|
|
4740
|
-
});
|
|
4741
|
-
let body;
|
|
4742
|
-
if (response.data != null && response.data.length > 0) {
|
|
4743
|
-
try {
|
|
4744
|
-
body = JSON.parse(response.data) ?? void 0;
|
|
4745
|
-
} catch {
|
|
4746
|
-
return {
|
|
4747
|
-
ok: false,
|
|
4748
|
-
error: {
|
|
4749
|
-
reason: "non-json",
|
|
4750
|
-
statusCode: response.status,
|
|
4751
|
-
rawBody: response.data
|
|
4752
|
-
}
|
|
4753
|
-
};
|
|
4754
|
-
}
|
|
4755
|
-
}
|
|
4756
|
-
if (response.status >= 200 && response.status < 300) {
|
|
4757
|
-
return {
|
|
4758
|
-
ok: true,
|
|
4759
|
-
body
|
|
4760
|
-
};
|
|
4761
|
-
} else {
|
|
4762
|
-
return {
|
|
4763
|
-
ok: false,
|
|
4764
|
-
error: {
|
|
4765
|
-
reason: "status-code",
|
|
4766
|
-
statusCode: response.status,
|
|
4767
|
-
body
|
|
4768
|
-
}
|
|
4769
|
-
};
|
|
4770
|
-
}
|
|
4771
|
-
} catch (error) {
|
|
4772
|
-
if (error.code === "ETIMEDOUT") {
|
|
4773
|
-
return {
|
|
4774
|
-
ok: false,
|
|
4775
|
-
error: {
|
|
4776
|
-
reason: "timeout"
|
|
4777
|
-
}
|
|
4778
|
-
};
|
|
4779
|
-
}
|
|
4780
|
-
return {
|
|
4781
|
-
ok: false,
|
|
4782
|
-
error: {
|
|
4783
|
-
reason: "unknown",
|
|
4784
|
-
errorMessage: error.message
|
|
4785
|
-
}
|
|
4786
|
-
};
|
|
4787
|
-
}
|
|
4788
|
-
};
|
|
4789
|
-
|
|
4790
|
-
// src/core/fetcher/Supplier.ts
|
|
4791
|
-
var Supplier = {
|
|
4792
|
-
get: async (supplier) => {
|
|
4793
|
-
if (typeof supplier === "function") {
|
|
4794
|
-
return supplier();
|
|
4795
|
-
} else {
|
|
4796
|
-
return supplier;
|
|
4797
|
-
}
|
|
4798
|
-
}
|
|
4799
|
-
};
|
|
4800
|
-
/*! Bundled license information:
|
|
4801
|
-
|
|
4802
|
-
ieee754/index.js:
|
|
4803
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
4804
|
-
|
|
4805
|
-
buffer/index.js:
|
|
4806
|
-
(*!
|
|
4807
|
-
* The buffer module from node.js, for the browser.
|
|
4808
|
-
*
|
|
4809
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
4810
|
-
* @license MIT
|
|
4811
|
-
*)
|
|
4812
|
-
|
|
4813
|
-
basic-auth/index.js:
|
|
4814
|
-
(*!
|
|
4815
|
-
* basic-auth
|
|
4816
|
-
* Copyright(c) 2013 TJ Holowaychuk
|
|
4817
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
4818
|
-
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
4819
|
-
* MIT Licensed
|
|
4820
|
-
*)
|
|
4821
|
-
*/
|