@jjrawlins/cdk-iam-policy-builder-helper 0.0.52 → 0.0.54
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/.jsii +3 -3
- package/cdk-iam-policy-builder-helper/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -1
- package/node_modules/@aws-sdk/client-iam/dist-cjs/index.js +13439 -13574
- package/node_modules/@aws-sdk/client-iam/package.json +6 -6
- package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +478 -596
- package/node_modules/@aws-sdk/client-sso/package.json +5 -5
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +1969 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +35 -74
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1581 -1863
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +38 -73
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +194 -259
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +72 -132
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +71 -107
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +176 -249
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +16 -25
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +170 -203
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +583 -858
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +795 -928
- package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +147 -222
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/README.md +22 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +57 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +39 -8
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/createUserAgentStringParsingProvider.js +20 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js +37 -6
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/createUserAgentStringParsingProvider.d.ts +14 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts +14 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts +4 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/createUserAgentStringParsingProvider.d.ts +9 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts +5 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +1 -1
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +50 -94
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/crt-availability.d.ts +1 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/defaultUserAgent.d.ts +10 -5
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +5 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +32 -30
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +133 -202
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +126 -34
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +19 -17
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
- package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +82 -176
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +4 -26
- package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-base64/dist-cjs/constants.browser.js +9 -32
- package/node_modules/@smithy/util-base64/dist-es/constants.browser.js +9 -28
- package/node_modules/@smithy/util-base64/dist-types/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/dist-types/ts3.4/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +8 -6
- package/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js +8 -6
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +11 -9
- package/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js +11 -8
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -3
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +3 -5
- package/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js +3 -5
- package/node_modules/@smithy/util-stream/dist-types/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/package.json +3 -3
- package/package.json +3 -3
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
export { createUserAgentStringParsingProvider } from "./createUserAgentStringParsingProvider";
|
|
2
2
|
export const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => async (config) => {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const navigator = typeof window !== "undefined" ? window.navigator : undefined;
|
|
4
|
+
const uaString = navigator?.userAgent ?? "";
|
|
5
|
+
const osName = navigator?.userAgentData?.platform ?? fallback.os(uaString) ?? "other";
|
|
6
|
+
const osVersion = undefined;
|
|
7
|
+
const brands = navigator?.userAgentData?.brands ?? [];
|
|
8
|
+
const brand = brands[brands.length - 1];
|
|
9
|
+
const browserName = brand?.brand ?? fallback.browser(uaString) ?? "unknown";
|
|
10
|
+
const browserVersion = brand?.version ?? "unknown";
|
|
6
11
|
const sections = [
|
|
7
12
|
["aws-sdk-js", clientVersion],
|
|
8
13
|
["ua", "2.1"],
|
|
9
|
-
[`os/${
|
|
14
|
+
[`os/${osName}`, osVersion],
|
|
10
15
|
["lang/js"],
|
|
11
|
-
["md/browser", `${
|
|
16
|
+
["md/browser", `${browserName}_${browserVersion}`],
|
|
12
17
|
];
|
|
13
18
|
if (serviceId) {
|
|
14
19
|
sections.push([`api/${serviceId}`, clientVersion]);
|
|
@@ -19,4 +24,30 @@ export const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) =>
|
|
|
19
24
|
}
|
|
20
25
|
return sections;
|
|
21
26
|
};
|
|
27
|
+
export const fallback = {
|
|
28
|
+
os(ua) {
|
|
29
|
+
if (/iPhone|iPad|iPod/.test(ua))
|
|
30
|
+
return "iOS";
|
|
31
|
+
if (/Macintosh|Mac OS X/.test(ua))
|
|
32
|
+
return "macOS";
|
|
33
|
+
if (/Windows NT/.test(ua))
|
|
34
|
+
return "Windows";
|
|
35
|
+
if (/Android/.test(ua))
|
|
36
|
+
return "Android";
|
|
37
|
+
if (/Linux/.test(ua))
|
|
38
|
+
return "Linux";
|
|
39
|
+
return undefined;
|
|
40
|
+
},
|
|
41
|
+
browser(ua) {
|
|
42
|
+
if (/EdgiOS|EdgA|Edg\//.test(ua))
|
|
43
|
+
return "Microsoft Edge";
|
|
44
|
+
if (/Firefox\//.test(ua))
|
|
45
|
+
return "Firefox";
|
|
46
|
+
if (/Chrome\//.test(ua))
|
|
47
|
+
return "Chrome";
|
|
48
|
+
if (/Safari\//.test(ua))
|
|
49
|
+
return "Safari";
|
|
50
|
+
return undefined;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
22
53
|
export const defaultUserAgent = createDefaultUserAgentProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UserAgent } from "@smithy/types";
|
|
2
|
+
import type { DefaultUserAgentOptions } from "./configurations";
|
|
3
|
+
import type { PreviouslyResolved } from "./index";
|
|
4
|
+
/**
|
|
5
|
+
* This is an alternative to the default user agent provider that uses the bowser
|
|
6
|
+
* library to parse the user agent string.
|
|
7
|
+
*
|
|
8
|
+
* Use this with your client's `defaultUserAgentProvider` constructor object field
|
|
9
|
+
* to use the legacy behavior.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated use the default provider unless you need the older UA-parsing functionality.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare const createUserAgentStringParsingProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { Provider, UserAgent } from "@smithy/types";
|
|
2
|
-
import { DefaultUserAgentOptions } from "./configurations";
|
|
2
|
+
import type { DefaultUserAgentOptions } from "./configurations";
|
|
3
|
+
export { createUserAgentStringParsingProvider } from "./createUserAgentStringParsingProvider";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
3
7
|
export interface PreviouslyResolved {
|
|
4
8
|
userAgentAppId: Provider<string | undefined>;
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
11
|
+
* Default provider of the AWS SDK user agent string in react-native.
|
|
7
12
|
* @internal
|
|
8
|
-
*
|
|
9
|
-
* Default provider to the user agent in browsers. It's a best effort to infer
|
|
10
|
-
* the device information. It uses bowser library to detect the browser and version
|
|
11
13
|
*/
|
|
12
14
|
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
|
|
15
|
+
/**
|
|
16
|
+
* Rudimentary UA string parsing as a fallback.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const fallback: {
|
|
20
|
+
os(ua: string): string | undefined;
|
|
21
|
+
browser(ua: string): string | undefined;
|
|
22
|
+
};
|
|
13
23
|
/**
|
|
14
24
|
* @internal
|
|
15
25
|
* @deprecated use createDefaultUserAgentProvider
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Provider, UserAgent } from "@smithy/types";
|
|
2
2
|
import { DefaultUserAgentOptions } from "./configurations";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface PreviouslyResolved {
|
|
4
7
|
userAgentAppId: Provider<string | undefined>;
|
|
5
8
|
}
|
|
6
9
|
/**
|
|
10
|
+
* Default provider to the user agent in ReactNative.
|
|
7
11
|
* @internal
|
|
8
|
-
*
|
|
9
|
-
* Default provider to the user agent in ReactNative. It's a best effort to infer
|
|
10
|
-
* the device information. It uses bowser library to detect the browser and virsion
|
|
11
12
|
*/
|
|
12
13
|
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
|
|
13
14
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UserAgent } from "@smithy/types";
|
|
2
|
+
import { DefaultUserAgentOptions } from "./configurations";
|
|
3
|
+
import { PreviouslyResolved } from "./index";
|
|
4
|
+
export declare const createUserAgentStringParsingProvider: ({
|
|
5
|
+
serviceId,
|
|
6
|
+
clientVersion,
|
|
7
|
+
}: DefaultUserAgentOptions) => (
|
|
8
|
+
config?: PreviouslyResolved
|
|
9
|
+
) => Promise<UserAgent>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Provider, UserAgent } from "@smithy/types";
|
|
2
2
|
import { DefaultUserAgentOptions } from "./configurations";
|
|
3
|
+
export { createUserAgentStringParsingProvider } from "./createUserAgentStringParsingProvider";
|
|
3
4
|
export interface PreviouslyResolved {
|
|
4
5
|
userAgentAppId: Provider<string | undefined>;
|
|
5
6
|
}
|
|
@@ -9,6 +10,10 @@ export declare const createDefaultUserAgentProvider: ({
|
|
|
9
10
|
}: DefaultUserAgentOptions) => (
|
|
10
11
|
config?: PreviouslyResolved
|
|
11
12
|
) => Promise<UserAgent>;
|
|
13
|
+
export declare const fallback: {
|
|
14
|
+
os(ua: string): string | undefined;
|
|
15
|
+
browser(ua: string): string | undefined;
|
|
16
|
+
};
|
|
12
17
|
export declare const defaultUserAgent: ({
|
|
13
18
|
serviceId,
|
|
14
19
|
clientVersion,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-user-agent-browser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.907.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline util-user-agent-browser",
|
|
@@ -1,102 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
NODE_APP_ID_CONFIG_OPTIONS: () => NODE_APP_ID_CONFIG_OPTIONS,
|
|
25
|
-
UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
|
|
26
|
-
UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
|
|
27
|
-
createDefaultUserAgentProvider: () => createDefaultUserAgentProvider,
|
|
28
|
-
crtAvailability: () => crtAvailability,
|
|
29
|
-
defaultUserAgent: () => defaultUserAgent
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(index_exports);
|
|
1
|
+
'use strict';
|
|
32
2
|
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
var
|
|
3
|
+
var os = require('os');
|
|
4
|
+
var process = require('process');
|
|
5
|
+
var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
|
|
36
6
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
isCrtAvailable: false
|
|
7
|
+
const crtAvailability = {
|
|
8
|
+
isCrtAvailable: false,
|
|
40
9
|
};
|
|
41
10
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return ["md/crt-avail"];
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
}, "isCrtAvailable");
|
|
49
|
-
|
|
50
|
-
// src/defaultUserAgent.ts
|
|
51
|
-
var createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
|
|
52
|
-
return async (config) => {
|
|
53
|
-
const sections = [
|
|
54
|
-
// sdk-metadata
|
|
55
|
-
["aws-sdk-js", clientVersion],
|
|
56
|
-
// ua-metadata
|
|
57
|
-
["ua", "2.1"],
|
|
58
|
-
// os-metadata
|
|
59
|
-
[`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
|
|
60
|
-
// language-metadata
|
|
61
|
-
// ECMAScript edition doesn't matter in JS, so no version needed.
|
|
62
|
-
["lang/js"],
|
|
63
|
-
["md/nodejs", `${import_process.versions.node}`]
|
|
64
|
-
];
|
|
65
|
-
const crtAvailable = isCrtAvailable();
|
|
66
|
-
if (crtAvailable) {
|
|
67
|
-
sections.push(crtAvailable);
|
|
68
|
-
}
|
|
69
|
-
if (serviceId) {
|
|
70
|
-
sections.push([`api/${serviceId}`, clientVersion]);
|
|
11
|
+
const isCrtAvailable = () => {
|
|
12
|
+
if (crtAvailability.isCrtAvailable) {
|
|
13
|
+
return ["md/crt-avail"];
|
|
71
14
|
}
|
|
72
|
-
|
|
73
|
-
sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
|
|
74
|
-
}
|
|
75
|
-
const appId = await config?.userAgentAppId?.();
|
|
76
|
-
const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
|
|
77
|
-
return resolvedUserAgent;
|
|
78
|
-
};
|
|
79
|
-
}, "createDefaultUserAgentProvider");
|
|
80
|
-
var defaultUserAgent = createDefaultUserAgentProvider;
|
|
81
|
-
|
|
82
|
-
// src/nodeAppIdConfigOptions.ts
|
|
83
|
-
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
|
84
|
-
var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
|
|
85
|
-
var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
|
|
86
|
-
var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
|
|
87
|
-
var NODE_APP_ID_CONFIG_OPTIONS = {
|
|
88
|
-
environmentVariableSelector: /* @__PURE__ */ __name((env2) => env2[UA_APP_ID_ENV_NAME], "environmentVariableSelector"),
|
|
89
|
-
configFileSelector: /* @__PURE__ */ __name((profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], "configFileSelector"),
|
|
90
|
-
default: import_middleware_user_agent.DEFAULT_UA_APP_ID
|
|
15
|
+
return null;
|
|
91
16
|
};
|
|
92
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
93
17
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
18
|
+
const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
|
|
19
|
+
return async (config) => {
|
|
20
|
+
const sections = [
|
|
21
|
+
["aws-sdk-js", clientVersion],
|
|
22
|
+
["ua", "2.1"],
|
|
23
|
+
[`os/${os.platform()}`, os.release()],
|
|
24
|
+
["lang/js"],
|
|
25
|
+
["md/nodejs", `${process.versions.node}`],
|
|
26
|
+
];
|
|
27
|
+
const crtAvailable = isCrtAvailable();
|
|
28
|
+
if (crtAvailable) {
|
|
29
|
+
sections.push(crtAvailable);
|
|
30
|
+
}
|
|
31
|
+
if (serviceId) {
|
|
32
|
+
sections.push([`api/${serviceId}`, clientVersion]);
|
|
33
|
+
}
|
|
34
|
+
if (process.env.AWS_EXECUTION_ENV) {
|
|
35
|
+
sections.push([`exec-env/${process.env.AWS_EXECUTION_ENV}`]);
|
|
36
|
+
}
|
|
37
|
+
const appId = await config?.userAgentAppId?.();
|
|
38
|
+
const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
|
|
39
|
+
return resolvedUserAgent;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const defaultUserAgent = createDefaultUserAgentProvider;
|
|
43
|
+
|
|
44
|
+
const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
|
|
45
|
+
const UA_APP_ID_INI_NAME = "sdk_ua_app_id";
|
|
46
|
+
const UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
|
|
47
|
+
const NODE_APP_ID_CONFIG_OPTIONS = {
|
|
48
|
+
environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME],
|
|
49
|
+
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],
|
|
50
|
+
default: middlewareUserAgent.DEFAULT_UA_APP_ID,
|
|
51
|
+
};
|
|
102
52
|
|
|
53
|
+
exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS;
|
|
54
|
+
exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME;
|
|
55
|
+
exports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME;
|
|
56
|
+
exports.createDefaultUserAgentProvider = createDefaultUserAgentProvider;
|
|
57
|
+
exports.crtAvailability = crtAvailability;
|
|
58
|
+
exports.defaultUserAgent = defaultUserAgent;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { Provider, UserAgent } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
2
5
|
export { crtAvailability } from "./crt-availability";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
3
9
|
export interface DefaultUserAgentOptions {
|
|
4
10
|
serviceId?: string;
|
|
5
11
|
clientVersion: string;
|
|
6
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
7
16
|
export interface PreviouslyResolved {
|
|
8
17
|
userAgentAppId: Provider<string | undefined>;
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*
|
|
13
20
|
* Collect metrics from runtime to put into user agent.
|
|
21
|
+
* @internal
|
|
14
22
|
*/
|
|
15
23
|
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
|
|
16
24
|
/**
|
|
17
|
-
*
|
|
18
25
|
* @internal
|
|
19
|
-
*
|
|
20
26
|
* @deprecated use createDefaultUserAgentProvider
|
|
21
|
-
*
|
|
22
27
|
*/
|
|
23
28
|
export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-user-agent-node",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.907.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline util-user-agent-node",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
25
|
+
"@aws-sdk/middleware-user-agent": "3.907.0",
|
|
26
26
|
"@aws-sdk/types": "3.901.0",
|
|
27
27
|
"@smithy/node-config-provider": "^4.3.0",
|
|
28
28
|
"@smithy/types": "^4.6.0",
|
|
@@ -887,7 +887,7 @@ class CborShapeDeserializer {
|
|
|
887
887
|
readValue(_schema, value) {
|
|
888
888
|
const ns = schema.NormalizedSchema.of(_schema);
|
|
889
889
|
if (ns.isTimestampSchema() && typeof value === "number") {
|
|
890
|
-
return serde.
|
|
890
|
+
return serde._parseEpochTimestamp(value);
|
|
891
891
|
}
|
|
892
892
|
if (ns.isBlobSchema()) {
|
|
893
893
|
if (typeof value === "string") {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var schema = require('@smithy/core/schema');
|
|
4
3
|
var utilUtf8 = require('@smithy/util-utf8');
|
|
5
4
|
|
|
6
5
|
class EventStreamSerde {
|
|
@@ -131,12 +130,15 @@ class EventStreamSerde {
|
|
|
131
130
|
let eventType = unionMember;
|
|
132
131
|
let explicitPayloadMember = null;
|
|
133
132
|
let explicitPayloadContentType;
|
|
134
|
-
const isKnownSchema =
|
|
133
|
+
const isKnownSchema = (() => {
|
|
134
|
+
const struct = unionSchema.getSchema();
|
|
135
|
+
return struct.memberNames.includes(unionMember);
|
|
136
|
+
})();
|
|
135
137
|
const additionalHeaders = {};
|
|
136
138
|
if (!isKnownSchema) {
|
|
137
139
|
const [type, value] = event[unionMember];
|
|
138
140
|
eventType = type;
|
|
139
|
-
serializer.write(
|
|
141
|
+
serializer.write(15, value);
|
|
140
142
|
}
|
|
141
143
|
else {
|
|
142
144
|
const eventSchema = unionSchema.getMemberSchema(unionMember);
|
|
@@ -53,10 +53,10 @@ class HttpProtocol {
|
|
|
53
53
|
request.fragment = endpoint.url.hash || void 0;
|
|
54
54
|
request.username = endpoint.url.username || void 0;
|
|
55
55
|
request.password = endpoint.url.password || void 0;
|
|
56
|
+
if (!request.query) {
|
|
57
|
+
request.query = {};
|
|
58
|
+
}
|
|
56
59
|
for (const [k, v] of endpoint.url.searchParams.entries()) {
|
|
57
|
-
if (!request.query) {
|
|
58
|
-
request.query = {};
|
|
59
|
-
}
|
|
60
60
|
request.query[k] = v;
|
|
61
61
|
}
|
|
62
62
|
return request;
|
|
@@ -165,7 +165,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
165
165
|
if (endpoint) {
|
|
166
166
|
this.updateServiceEndpoint(request, endpoint);
|
|
167
167
|
this.setHostPrefix(request, operationSchema, input);
|
|
168
|
-
const opTraits = schema.
|
|
168
|
+
const opTraits = schema.translateTraits(operationSchema.traits);
|
|
169
169
|
if (opTraits.http) {
|
|
170
170
|
request.method = opTraits.http[0];
|
|
171
171
|
const [path, search] = opTraits.http[1].split("?");
|
|
@@ -289,7 +289,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
289
289
|
if (response.statusCode >= 300) {
|
|
290
290
|
const bytes = await collectBody(response.body, context);
|
|
291
291
|
if (bytes.byteLength > 0) {
|
|
292
|
-
Object.assign(dataObject, await deserializer.read(
|
|
292
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
293
293
|
}
|
|
294
294
|
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
295
295
|
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
@@ -355,7 +355,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
355
355
|
headerListValueSchema.getMergedTraits().httpHeader = key;
|
|
356
356
|
let sections;
|
|
357
357
|
if (headerListValueSchema.isTimestampSchema() &&
|
|
358
|
-
headerListValueSchema.getSchema() ===
|
|
358
|
+
headerListValueSchema.getSchema() === 4) {
|
|
359
359
|
sections = serde.splitEvery(value, ",", 2);
|
|
360
360
|
}
|
|
361
361
|
else {
|
|
@@ -455,7 +455,7 @@ class RpcProtocol extends HttpProtocol {
|
|
|
455
455
|
if (response.statusCode >= 300) {
|
|
456
456
|
const bytes = await collectBody(response.body, context);
|
|
457
457
|
if (bytes.byteLength > 0) {
|
|
458
|
-
Object.assign(dataObject, await deserializer.read(
|
|
458
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
459
459
|
}
|
|
460
460
|
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
461
461
|
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
|
@@ -574,18 +574,18 @@ class RequestBuilder {
|
|
|
574
574
|
function determineTimestampFormat(ns, settings) {
|
|
575
575
|
if (settings.timestampFormat.useTrait) {
|
|
576
576
|
if (ns.isTimestampSchema() &&
|
|
577
|
-
(ns.getSchema() ===
|
|
578
|
-
ns.getSchema() ===
|
|
579
|
-
ns.getSchema() ===
|
|
577
|
+
(ns.getSchema() === 5 ||
|
|
578
|
+
ns.getSchema() === 6 ||
|
|
579
|
+
ns.getSchema() === 7)) {
|
|
580
580
|
return ns.getSchema();
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
|
|
584
584
|
const bindingFormat = settings.httpBindings
|
|
585
585
|
? typeof httpPrefixHeaders === "string" || Boolean(httpHeader)
|
|
586
|
-
?
|
|
586
|
+
? 6
|
|
587
587
|
: Boolean(httpQuery) || Boolean(httpLabel)
|
|
588
|
-
?
|
|
588
|
+
? 5
|
|
589
589
|
: undefined
|
|
590
590
|
: undefined;
|
|
591
591
|
return bindingFormat ?? settings.timestampFormat.default;
|
|
@@ -611,12 +611,12 @@ class FromStringShapeDeserializer {
|
|
|
611
611
|
if (ns.isTimestampSchema()) {
|
|
612
612
|
const format = determineTimestampFormat(ns, this.settings);
|
|
613
613
|
switch (format) {
|
|
614
|
-
case
|
|
615
|
-
return serde.
|
|
616
|
-
case
|
|
617
|
-
return serde.
|
|
618
|
-
case
|
|
619
|
-
return serde.
|
|
614
|
+
case 5:
|
|
615
|
+
return serde._parseRfc3339DateTimeWithOffset(data);
|
|
616
|
+
case 6:
|
|
617
|
+
return serde._parseRfc7231DateTime(data);
|
|
618
|
+
case 7:
|
|
619
|
+
return serde._parseEpochTimestamp(data);
|
|
620
620
|
default:
|
|
621
621
|
console.warn("Missing timestamp format, parsing value with Date constructor:", data);
|
|
622
622
|
return new Date(data);
|
|
@@ -636,15 +636,17 @@ class FromStringShapeDeserializer {
|
|
|
636
636
|
return intermediateValue;
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
639
|
+
if (ns.isNumericSchema()) {
|
|
640
|
+
return Number(data);
|
|
641
|
+
}
|
|
642
|
+
if (ns.isBigIntegerSchema()) {
|
|
643
|
+
return BigInt(data);
|
|
644
|
+
}
|
|
645
|
+
if (ns.isBigDecimalSchema()) {
|
|
646
|
+
return new serde.NumericValue(data, "bigDecimal");
|
|
647
|
+
}
|
|
648
|
+
if (ns.isBooleanSchema()) {
|
|
649
|
+
return String(data).toLowerCase() === "true";
|
|
648
650
|
}
|
|
649
651
|
return data;
|
|
650
652
|
}
|
|
@@ -716,13 +718,13 @@ class ToStringShapeSerializer {
|
|
|
716
718
|
}
|
|
717
719
|
const format = determineTimestampFormat(ns, this.settings);
|
|
718
720
|
switch (format) {
|
|
719
|
-
case
|
|
721
|
+
case 5:
|
|
720
722
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
721
723
|
break;
|
|
722
|
-
case
|
|
724
|
+
case 6:
|
|
723
725
|
this.stringBuffer = serde.dateToUtcString(value);
|
|
724
726
|
break;
|
|
725
|
-
case
|
|
727
|
+
case 7:
|
|
726
728
|
this.stringBuffer = String(value.getTime() / 1000);
|
|
727
729
|
break;
|
|
728
730
|
default:
|