@aws-sdk/client-lambda 3.185.0 → 3.188.0

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/Lambda.js +254 -261
  3. package/dist-es/LambdaClient.js +22 -28
  4. package/dist-es/commands/AddLayerVersionPermissionCommand.js +21 -28
  5. package/dist-es/commands/AddPermissionCommand.js +21 -28
  6. package/dist-es/commands/CreateAliasCommand.js +21 -28
  7. package/dist-es/commands/CreateCodeSigningConfigCommand.js +21 -28
  8. package/dist-es/commands/CreateEventSourceMappingCommand.js +21 -28
  9. package/dist-es/commands/CreateFunctionCommand.js +21 -28
  10. package/dist-es/commands/CreateFunctionUrlConfigCommand.js +21 -28
  11. package/dist-es/commands/DeleteAliasCommand.js +22 -29
  12. package/dist-es/commands/DeleteCodeSigningConfigCommand.js +21 -28
  13. package/dist-es/commands/DeleteEventSourceMappingCommand.js +21 -28
  14. package/dist-es/commands/DeleteFunctionCodeSigningConfigCommand.js +22 -29
  15. package/dist-es/commands/DeleteFunctionCommand.js +22 -29
  16. package/dist-es/commands/DeleteFunctionConcurrencyCommand.js +22 -29
  17. package/dist-es/commands/DeleteFunctionEventInvokeConfigCommand.js +22 -29
  18. package/dist-es/commands/DeleteFunctionUrlConfigCommand.js +22 -29
  19. package/dist-es/commands/DeleteLayerVersionCommand.js +22 -29
  20. package/dist-es/commands/DeleteProvisionedConcurrencyConfigCommand.js +22 -29
  21. package/dist-es/commands/GetAccountSettingsCommand.js +21 -28
  22. package/dist-es/commands/GetAliasCommand.js +21 -28
  23. package/dist-es/commands/GetCodeSigningConfigCommand.js +21 -28
  24. package/dist-es/commands/GetEventSourceMappingCommand.js +21 -28
  25. package/dist-es/commands/GetFunctionCodeSigningConfigCommand.js +21 -28
  26. package/dist-es/commands/GetFunctionCommand.js +21 -28
  27. package/dist-es/commands/GetFunctionConcurrencyCommand.js +21 -28
  28. package/dist-es/commands/GetFunctionConfigurationCommand.js +21 -28
  29. package/dist-es/commands/GetFunctionEventInvokeConfigCommand.js +21 -28
  30. package/dist-es/commands/GetFunctionUrlConfigCommand.js +21 -28
  31. package/dist-es/commands/GetLayerVersionByArnCommand.js +21 -28
  32. package/dist-es/commands/GetLayerVersionCommand.js +21 -28
  33. package/dist-es/commands/GetLayerVersionPolicyCommand.js +21 -28
  34. package/dist-es/commands/GetPolicyCommand.js +21 -28
  35. package/dist-es/commands/GetProvisionedConcurrencyConfigCommand.js +21 -28
  36. package/dist-es/commands/InvokeAsyncCommand.js +21 -28
  37. package/dist-es/commands/InvokeCommand.js +21 -28
  38. package/dist-es/commands/ListAliasesCommand.js +21 -28
  39. package/dist-es/commands/ListCodeSigningConfigsCommand.js +21 -28
  40. package/dist-es/commands/ListEventSourceMappingsCommand.js +21 -28
  41. package/dist-es/commands/ListFunctionEventInvokeConfigsCommand.js +21 -28
  42. package/dist-es/commands/ListFunctionUrlConfigsCommand.js +21 -28
  43. package/dist-es/commands/ListFunctionsByCodeSigningConfigCommand.js +21 -28
  44. package/dist-es/commands/ListFunctionsCommand.js +21 -28
  45. package/dist-es/commands/ListLayerVersionsCommand.js +21 -28
  46. package/dist-es/commands/ListLayersCommand.js +21 -28
  47. package/dist-es/commands/ListProvisionedConcurrencyConfigsCommand.js +21 -28
  48. package/dist-es/commands/ListTagsCommand.js +21 -28
  49. package/dist-es/commands/ListVersionsByFunctionCommand.js +21 -28
  50. package/dist-es/commands/PublishLayerVersionCommand.js +21 -28
  51. package/dist-es/commands/PublishVersionCommand.js +21 -28
  52. package/dist-es/commands/PutFunctionCodeSigningConfigCommand.js +21 -28
  53. package/dist-es/commands/PutFunctionConcurrencyCommand.js +21 -28
  54. package/dist-es/commands/PutFunctionEventInvokeConfigCommand.js +21 -28
  55. package/dist-es/commands/PutProvisionedConcurrencyConfigCommand.js +21 -28
  56. package/dist-es/commands/RemoveLayerVersionPermissionCommand.js +22 -29
  57. package/dist-es/commands/RemovePermissionCommand.js +22 -29
  58. package/dist-es/commands/TagResourceCommand.js +22 -29
  59. package/dist-es/commands/UntagResourceCommand.js +22 -29
  60. package/dist-es/commands/UpdateAliasCommand.js +21 -28
  61. package/dist-es/commands/UpdateCodeSigningConfigCommand.js +21 -28
  62. package/dist-es/commands/UpdateEventSourceMappingCommand.js +21 -28
  63. package/dist-es/commands/UpdateFunctionCodeCommand.js +21 -28
  64. package/dist-es/commands/UpdateFunctionConfigurationCommand.js +21 -28
  65. package/dist-es/commands/UpdateFunctionEventInvokeConfigCommand.js +21 -28
  66. package/dist-es/commands/UpdateFunctionUrlConfigCommand.js +21 -28
  67. package/dist-es/endpoints.js +8 -8
  68. package/dist-es/models/LambdaServiceException.js +5 -10
  69. package/dist-es/models/models_0.js +910 -611
  70. package/dist-es/pagination/ListAliasesPaginator.js +25 -68
  71. package/dist-es/pagination/ListCodeSigningConfigsPaginator.js +25 -68
  72. package/dist-es/pagination/ListEventSourceMappingsPaginator.js +25 -68
  73. package/dist-es/pagination/ListFunctionEventInvokeConfigsPaginator.js +25 -68
  74. package/dist-es/pagination/ListFunctionUrlConfigsPaginator.js +25 -68
  75. package/dist-es/pagination/ListFunctionsByCodeSigningConfigPaginator.js +25 -68
  76. package/dist-es/pagination/ListFunctionsPaginator.js +25 -68
  77. package/dist-es/pagination/ListLayerVersionsPaginator.js +25 -68
  78. package/dist-es/pagination/ListLayersPaginator.js +25 -68
  79. package/dist-es/pagination/ListProvisionedConcurrencyConfigsPaginator.js +25 -68
  80. package/dist-es/pagination/ListVersionsByFunctionPaginator.js +25 -68
  81. package/dist-es/protocols/Aws_restJson1.js +6122 -7968
  82. package/dist-es/runtimeConfig.browser.js +26 -12
  83. package/dist-es/runtimeConfig.js +30 -12
  84. package/dist-es/runtimeConfig.native.js +8 -5
  85. package/dist-es/runtimeConfig.shared.js +8 -11
  86. package/dist-es/waiters/waitForFunctionActive.js +45 -65
  87. package/dist-es/waiters/waitForFunctionActiveV2.js +45 -65
  88. package/dist-es/waiters/waitForFunctionExists.js +23 -42
  89. package/dist-es/waiters/waitForFunctionUpdated.js +45 -65
  90. package/dist-es/waiters/waitForFunctionUpdatedV2.js +45 -65
  91. package/package.json +34 -34
@@ -1,4 +1,3 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import packageInfo from "../package.json";
3
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
4
3
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
@@ -12,15 +11,30 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
12
11
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
12
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
14
13
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
15
- export var getRuntimeConfig = function (config) {
16
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
17
- var defaultsMode = resolveDefaultsModeConfig(config);
18
- var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
19
- var clientSharedValues = getSharedRuntimeConfig(config);
20
- return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4, defaultConfigProvider()];
23
- case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
24
- }
25
- }); }); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
14
+ export const getRuntimeConfig = (config) => {
15
+ const defaultsMode = resolveDefaultsModeConfig(config);
16
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
17
+ const clientSharedValues = getSharedRuntimeConfig(config);
18
+ return {
19
+ ...clientSharedValues,
20
+ ...config,
21
+ runtime: "browser",
22
+ defaultsMode,
23
+ base64Decoder: config?.base64Decoder ?? fromBase64,
24
+ base64Encoder: config?.base64Encoder ?? toBase64,
25
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
26
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
27
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
28
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
29
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
30
+ region: config?.region ?? invalidProvider("Region is missing"),
31
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
32
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
33
+ sha256: config?.sha256 ?? Sha256,
34
+ streamCollector: config?.streamCollector ?? streamCollector,
35
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
36
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
37
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
38
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
39
+ };
26
40
  };
@@ -1,4 +1,3 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import packageInfo from "../package.json";
3
2
  import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
4
3
  import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver";
@@ -15,16 +14,35 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar
15
14
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
16
15
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
17
16
  import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
18
- export var getRuntimeConfig = function (config) {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
17
+ export const getRuntimeConfig = (config) => {
20
18
  emitWarningIfUnsupportedVersion(process.version);
21
- var defaultsMode = resolveDefaultsModeConfig(config);
22
- var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
23
- var clientSharedValues = getSharedRuntimeConfig(config);
24
- return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
25
- switch (_a.label) {
26
- case 0: return [4, defaultConfigProvider()];
27
- case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
28
- }
29
- }); }); } })), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "sha256"), streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
19
+ const defaultsMode = resolveDefaultsModeConfig(config);
20
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
21
+ const clientSharedValues = getSharedRuntimeConfig(config);
22
+ return {
23
+ ...clientSharedValues,
24
+ ...config,
25
+ runtime: "node",
26
+ defaultsMode,
27
+ base64Decoder: config?.base64Decoder ?? fromBase64,
28
+ base64Encoder: config?.base64Encoder ?? toBase64,
29
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
30
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
31
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
32
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
33
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
34
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
35
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
36
+ retryMode: config?.retryMode ??
37
+ loadNodeConfig({
38
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
39
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
40
+ }),
41
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
42
+ streamCollector: config?.streamCollector ?? streamCollector,
43
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
44
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
45
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
46
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
47
+ };
30
48
  };
@@ -1,8 +1,11 @@
1
- import { __assign } from "tslib";
2
1
  import { Sha256 } from "@aws-crypto/sha256-js";
3
2
  import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
- export var getRuntimeConfig = function (config) {
5
- var _a;
6
- var browserDefaults = getBrowserRuntimeConfig(config);
7
- return __assign(__assign(__assign({}, browserDefaults), config), { runtime: "react-native", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Sha256 });
3
+ export const getRuntimeConfig = (config) => {
4
+ const browserDefaults = getBrowserRuntimeConfig(config);
5
+ return {
6
+ ...browserDefaults,
7
+ ...config,
8
+ runtime: "react-native",
9
+ sha256: config?.sha256 ?? Sha256,
10
+ };
8
11
  };
@@ -1,13 +1,10 @@
1
1
  import { parseUrl } from "@aws-sdk/url-parser";
2
2
  import { defaultRegionInfoProvider } from "./endpoints";
3
- export var getRuntimeConfig = function (config) {
4
- var _a, _b, _c, _d, _e;
5
- return ({
6
- apiVersion: "2015-03-31",
7
- disableHostPrefix: (_a = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _a !== void 0 ? _a : false,
8
- logger: (_b = config === null || config === void 0 ? void 0 : config.logger) !== null && _b !== void 0 ? _b : {},
9
- regionInfoProvider: (_c = config === null || config === void 0 ? void 0 : config.regionInfoProvider) !== null && _c !== void 0 ? _c : defaultRegionInfoProvider,
10
- serviceId: (_d = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _d !== void 0 ? _d : "Lambda",
11
- urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : parseUrl,
12
- });
13
- };
3
+ export const getRuntimeConfig = (config) => ({
4
+ apiVersion: "2015-03-31",
5
+ disableHostPrefix: config?.disableHostPrefix ?? false,
6
+ logger: config?.logger ?? {},
7
+ regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
8
+ serviceId: config?.serviceId ?? "Lambda",
9
+ urlParser: config?.urlParser ?? parseUrl,
10
+ });
@@ -1,69 +1,49 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
3
2
  import { GetFunctionConfigurationCommand, } from "../commands/GetFunctionConfigurationCommand";
4
- var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
5
- var reason, result_1, returnComparator, returnComparator, returnComparator, exception_1;
6
- return __generator(this, function (_a) {
7
- switch (_a.label) {
8
- case 0:
9
- _a.trys.push([0, 2, , 3]);
10
- return [4, client.send(new GetFunctionConfigurationCommand(input))];
11
- case 1:
12
- result_1 = _a.sent();
13
- reason = result_1;
14
- try {
15
- returnComparator = function () {
16
- return result_1.State;
17
- };
18
- if (returnComparator() === "Active") {
19
- return [2, { state: WaiterState.SUCCESS, reason: reason }];
20
- }
21
- }
22
- catch (e) { }
23
- try {
24
- returnComparator = function () {
25
- return result_1.State;
26
- };
27
- if (returnComparator() === "Failed") {
28
- return [2, { state: WaiterState.FAILURE, reason: reason }];
29
- }
30
- }
31
- catch (e) { }
32
- try {
33
- returnComparator = function () {
34
- return result_1.State;
35
- };
36
- if (returnComparator() === "Pending") {
37
- return [2, { state: WaiterState.RETRY, reason: reason }];
38
- }
39
- }
40
- catch (e) { }
41
- return [3, 3];
42
- case 2:
43
- exception_1 = _a.sent();
44
- reason = exception_1;
45
- return [3, 3];
46
- case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new GetFunctionConfigurationCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.State;
11
+ };
12
+ if (returnComparator() === "Active") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
47
15
  }
48
- });
49
- }); };
50
- export var waitForFunctionActive = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
51
- var serviceDefaults;
52
- return __generator(this, function (_a) {
53
- serviceDefaults = { minDelay: 5, maxDelay: 120 };
54
- return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
55
- });
56
- }); };
57
- export var waitUntilFunctionActive = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
58
- var serviceDefaults, result;
59
- return __generator(this, function (_a) {
60
- switch (_a.label) {
61
- case 0:
62
- serviceDefaults = { minDelay: 5, maxDelay: 120 };
63
- return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
64
- case 1:
65
- result = _a.sent();
66
- return [2, checkExceptions(result)];
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.State;
20
+ };
21
+ if (returnComparator() === "Failed") {
22
+ return { state: WaiterState.FAILURE, reason };
23
+ }
67
24
  }
68
- });
69
- }); };
25
+ catch (e) { }
26
+ try {
27
+ const returnComparator = () => {
28
+ return result.State;
29
+ };
30
+ if (returnComparator() === "Pending") {
31
+ return { state: WaiterState.RETRY, reason };
32
+ }
33
+ }
34
+ catch (e) { }
35
+ }
36
+ catch (exception) {
37
+ reason = exception;
38
+ }
39
+ return { state: WaiterState.RETRY, reason };
40
+ };
41
+ export const waitForFunctionActive = async (params, input) => {
42
+ const serviceDefaults = { minDelay: 5, maxDelay: 120 };
43
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
44
+ };
45
+ export const waitUntilFunctionActive = async (params, input) => {
46
+ const serviceDefaults = { minDelay: 5, maxDelay: 120 };
47
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
48
+ return checkExceptions(result);
49
+ };
@@ -1,69 +1,49 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
3
2
  import { GetFunctionCommand } from "../commands/GetFunctionCommand";
4
- var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
5
- var reason, result_1, returnComparator, returnComparator, returnComparator, exception_1;
6
- return __generator(this, function (_a) {
7
- switch (_a.label) {
8
- case 0:
9
- _a.trys.push([0, 2, , 3]);
10
- return [4, client.send(new GetFunctionCommand(input))];
11
- case 1:
12
- result_1 = _a.sent();
13
- reason = result_1;
14
- try {
15
- returnComparator = function () {
16
- return result_1.Configuration.State;
17
- };
18
- if (returnComparator() === "Active") {
19
- return [2, { state: WaiterState.SUCCESS, reason: reason }];
20
- }
21
- }
22
- catch (e) { }
23
- try {
24
- returnComparator = function () {
25
- return result_1.Configuration.State;
26
- };
27
- if (returnComparator() === "Failed") {
28
- return [2, { state: WaiterState.FAILURE, reason: reason }];
29
- }
30
- }
31
- catch (e) { }
32
- try {
33
- returnComparator = function () {
34
- return result_1.Configuration.State;
35
- };
36
- if (returnComparator() === "Pending") {
37
- return [2, { state: WaiterState.RETRY, reason: reason }];
38
- }
39
- }
40
- catch (e) { }
41
- return [3, 3];
42
- case 2:
43
- exception_1 = _a.sent();
44
- reason = exception_1;
45
- return [3, 3];
46
- case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new GetFunctionCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.Configuration.State;
11
+ };
12
+ if (returnComparator() === "Active") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
47
15
  }
48
- });
49
- }); };
50
- export var waitForFunctionActiveV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
51
- var serviceDefaults;
52
- return __generator(this, function (_a) {
53
- serviceDefaults = { minDelay: 1, maxDelay: 120 };
54
- return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
55
- });
56
- }); };
57
- export var waitUntilFunctionActiveV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
58
- var serviceDefaults, result;
59
- return __generator(this, function (_a) {
60
- switch (_a.label) {
61
- case 0:
62
- serviceDefaults = { minDelay: 1, maxDelay: 120 };
63
- return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
64
- case 1:
65
- result = _a.sent();
66
- return [2, checkExceptions(result)];
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.Configuration.State;
20
+ };
21
+ if (returnComparator() === "Failed") {
22
+ return { state: WaiterState.FAILURE, reason };
23
+ }
67
24
  }
68
- });
69
- }); };
25
+ catch (e) { }
26
+ try {
27
+ const returnComparator = () => {
28
+ return result.Configuration.State;
29
+ };
30
+ if (returnComparator() === "Pending") {
31
+ return { state: WaiterState.RETRY, reason };
32
+ }
33
+ }
34
+ catch (e) { }
35
+ }
36
+ catch (exception) {
37
+ reason = exception;
38
+ }
39
+ return { state: WaiterState.RETRY, reason };
40
+ };
41
+ export const waitForFunctionActiveV2 = async (params, input) => {
42
+ const serviceDefaults = { minDelay: 1, maxDelay: 120 };
43
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
44
+ };
45
+ export const waitUntilFunctionActiveV2 = async (params, input) => {
46
+ const serviceDefaults = { minDelay: 1, maxDelay: 120 };
47
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
48
+ return checkExceptions(result);
49
+ };
@@ -1,45 +1,26 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
3
2
  import { GetFunctionCommand } from "../commands/GetFunctionCommand";
4
- var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
5
- var reason, result, exception_1;
6
- return __generator(this, function (_a) {
7
- switch (_a.label) {
8
- case 0:
9
- _a.trys.push([0, 2, , 3]);
10
- return [4, client.send(new GetFunctionCommand(input))];
11
- case 1:
12
- result = _a.sent();
13
- reason = result;
14
- return [2, { state: WaiterState.SUCCESS, reason: reason }];
15
- case 2:
16
- exception_1 = _a.sent();
17
- reason = exception_1;
18
- if (exception_1.name && exception_1.name == "ResourceNotFoundException") {
19
- return [2, { state: WaiterState.RETRY, reason: reason }];
20
- }
21
- return [3, 3];
22
- case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new GetFunctionCommand(input));
7
+ reason = result;
8
+ return { state: WaiterState.SUCCESS, reason };
9
+ }
10
+ catch (exception) {
11
+ reason = exception;
12
+ if (exception.name && exception.name == "ResourceNotFoundException") {
13
+ return { state: WaiterState.RETRY, reason };
23
14
  }
24
- });
25
- }); };
26
- export var waitForFunctionExists = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
27
- var serviceDefaults;
28
- return __generator(this, function (_a) {
29
- serviceDefaults = { minDelay: 1, maxDelay: 120 };
30
- return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
31
- });
32
- }); };
33
- export var waitUntilFunctionExists = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
34
- var serviceDefaults, result;
35
- return __generator(this, function (_a) {
36
- switch (_a.label) {
37
- case 0:
38
- serviceDefaults = { minDelay: 1, maxDelay: 120 };
39
- return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
40
- case 1:
41
- result = _a.sent();
42
- return [2, checkExceptions(result)];
43
- }
44
- });
45
- }); };
15
+ }
16
+ return { state: WaiterState.RETRY, reason };
17
+ };
18
+ export const waitForFunctionExists = async (params, input) => {
19
+ const serviceDefaults = { minDelay: 1, maxDelay: 120 };
20
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
21
+ };
22
+ export const waitUntilFunctionExists = async (params, input) => {
23
+ const serviceDefaults = { minDelay: 1, maxDelay: 120 };
24
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
25
+ return checkExceptions(result);
26
+ };
@@ -1,69 +1,49 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
3
2
  import { GetFunctionConfigurationCommand, } from "../commands/GetFunctionConfigurationCommand";
4
- var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
5
- var reason, result_1, returnComparator, returnComparator, returnComparator, exception_1;
6
- return __generator(this, function (_a) {
7
- switch (_a.label) {
8
- case 0:
9
- _a.trys.push([0, 2, , 3]);
10
- return [4, client.send(new GetFunctionConfigurationCommand(input))];
11
- case 1:
12
- result_1 = _a.sent();
13
- reason = result_1;
14
- try {
15
- returnComparator = function () {
16
- return result_1.LastUpdateStatus;
17
- };
18
- if (returnComparator() === "Successful") {
19
- return [2, { state: WaiterState.SUCCESS, reason: reason }];
20
- }
21
- }
22
- catch (e) { }
23
- try {
24
- returnComparator = function () {
25
- return result_1.LastUpdateStatus;
26
- };
27
- if (returnComparator() === "Failed") {
28
- return [2, { state: WaiterState.FAILURE, reason: reason }];
29
- }
30
- }
31
- catch (e) { }
32
- try {
33
- returnComparator = function () {
34
- return result_1.LastUpdateStatus;
35
- };
36
- if (returnComparator() === "InProgress") {
37
- return [2, { state: WaiterState.RETRY, reason: reason }];
38
- }
39
- }
40
- catch (e) { }
41
- return [3, 3];
42
- case 2:
43
- exception_1 = _a.sent();
44
- reason = exception_1;
45
- return [3, 3];
46
- case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new GetFunctionConfigurationCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.LastUpdateStatus;
11
+ };
12
+ if (returnComparator() === "Successful") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
47
15
  }
48
- });
49
- }); };
50
- export var waitForFunctionUpdated = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
51
- var serviceDefaults;
52
- return __generator(this, function (_a) {
53
- serviceDefaults = { minDelay: 5, maxDelay: 120 };
54
- return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
55
- });
56
- }); };
57
- export var waitUntilFunctionUpdated = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
58
- var serviceDefaults, result;
59
- return __generator(this, function (_a) {
60
- switch (_a.label) {
61
- case 0:
62
- serviceDefaults = { minDelay: 5, maxDelay: 120 };
63
- return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
64
- case 1:
65
- result = _a.sent();
66
- return [2, checkExceptions(result)];
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.LastUpdateStatus;
20
+ };
21
+ if (returnComparator() === "Failed") {
22
+ return { state: WaiterState.FAILURE, reason };
23
+ }
67
24
  }
68
- });
69
- }); };
25
+ catch (e) { }
26
+ try {
27
+ const returnComparator = () => {
28
+ return result.LastUpdateStatus;
29
+ };
30
+ if (returnComparator() === "InProgress") {
31
+ return { state: WaiterState.RETRY, reason };
32
+ }
33
+ }
34
+ catch (e) { }
35
+ }
36
+ catch (exception) {
37
+ reason = exception;
38
+ }
39
+ return { state: WaiterState.RETRY, reason };
40
+ };
41
+ export const waitForFunctionUpdated = async (params, input) => {
42
+ const serviceDefaults = { minDelay: 5, maxDelay: 120 };
43
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
44
+ };
45
+ export const waitUntilFunctionUpdated = async (params, input) => {
46
+ const serviceDefaults = { minDelay: 5, maxDelay: 120 };
47
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
48
+ return checkExceptions(result);
49
+ };