@aws-sdk/client-supplychain 3.491.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.
- package/LICENSE +201 -0
- package/README.md +227 -0
- package/dist-cjs/SupplyChain.js +15 -0
- package/dist-cjs/SupplyChainClient.js +43 -0
- package/dist-cjs/commands/CreateBillOfMaterialsImportJobCommand.js +28 -0
- package/dist-cjs/commands/GetBillOfMaterialsImportJobCommand.js +28 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/endpoint/EndpointParameters.js +18 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/SupplyChainServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +106 -0
- package/dist-cjs/protocols/Aws_restJson1.js +283 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +24 -0
- package/dist-cjs/runtimeExtensions.js +22 -0
- package/dist-es/SupplyChain.js +11 -0
- package/dist-es/SupplyChainClient.js +39 -0
- package/dist-es/commands/CreateBillOfMaterialsImportJobCommand.js +24 -0
- package/dist-es/commands/GetBillOfMaterialsImportJobCommand.js +24 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoint/EndpointParameters.js +14 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/SupplyChainServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +96 -0
- package/dist-es/protocols/Aws_restJson1.js +276 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +20 -0
- package/dist-es/runtimeExtensions.js +18 -0
- package/dist-types/SupplyChain.d.ts +30 -0
- package/dist-types/SupplyChainClient.d.ts +177 -0
- package/dist-types/commands/CreateBillOfMaterialsImportJobCommand.d.ts +82 -0
- package/dist-types/commands/GetBillOfMaterialsImportJobCommand.d.ts +86 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +20 -0
- package/dist-types/models/SupplyChainServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +195 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +20 -0
- package/dist-types/runtimeConfig.browser.d.ts +49 -0
- package/dist-types/runtimeConfig.d.ts +46 -0
- package/dist-types/runtimeConfig.native.d.ts +45 -0
- package/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/SupplyChain.d.ts +41 -0
- package/dist-types/ts3.4/SupplyChainClient.d.ts +130 -0
- package/dist-types/ts3.4/commands/CreateBillOfMaterialsImportJobCommand.d.ts +30 -0
- package/dist-types/ts3.4/commands/GetBillOfMaterialsImportJobCommand.d.ts +30 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/SupplyChainServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +84 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +29 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +103 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveEndpoint } from "@smithy/util-endpoints";
|
|
2
|
+
import { ruleSet } from "./ruleset";
|
|
3
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
4
|
+
return resolveEndpoint(ruleSet, {
|
|
5
|
+
endpointParams: endpointParams,
|
|
6
|
+
logger: context.logger,
|
|
7
|
+
});
|
|
8
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const s = "required", t = "fn", u = "argv", v = "ref";
|
|
2
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = { [s]: false, "type": "String" }, i = { [s]: true, "default": false, "type": "Boolean" }, j = { [v]: "Endpoint" }, k = { [t]: c, [u]: [{ [v]: "UseFIPS" }, true] }, l = { [t]: c, [u]: [{ [v]: "UseDualStack" }, true] }, m = {}, n = { [t]: "getAttr", [u]: [{ [v]: g }, "supportsFIPS"] }, o = { [t]: c, [u]: [true, { [t]: "getAttr", [u]: [{ [v]: g }, "supportsDualStack"] }] }, p = [k], q = [l], r = [{ [v]: "Region" }];
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ rules: [{ endpoint: { url: "https://scn-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ rules: [{ endpoint: { url: "https://scn-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ rules: [{ endpoint: { url: "https://scn.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { rules: [{ endpoint: { url: "https://scn.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] };
|
|
4
|
+
export const ruleSet = _data;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class SupplyChainServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, SupplyChainServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models_0";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { SupplyChainServiceException as __BaseException } from "./SupplyChainServiceException";
|
|
2
|
+
export class AccessDeniedException extends __BaseException {
|
|
3
|
+
constructor(opts) {
|
|
4
|
+
super({
|
|
5
|
+
name: "AccessDeniedException",
|
|
6
|
+
$fault: "client",
|
|
7
|
+
...opts,
|
|
8
|
+
});
|
|
9
|
+
this.name = "AccessDeniedException";
|
|
10
|
+
this.$fault = "client";
|
|
11
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const ConfigurationJobStatus = {
|
|
15
|
+
FAILED: "FAILED",
|
|
16
|
+
IN_PROGRESS: "IN_PROGRESS",
|
|
17
|
+
NEW: "NEW",
|
|
18
|
+
QUEUED: "QUEUED",
|
|
19
|
+
SUCCESS: "SUCCESS",
|
|
20
|
+
};
|
|
21
|
+
export class ConflictException extends __BaseException {
|
|
22
|
+
constructor(opts) {
|
|
23
|
+
super({
|
|
24
|
+
name: "ConflictException",
|
|
25
|
+
$fault: "client",
|
|
26
|
+
...opts,
|
|
27
|
+
});
|
|
28
|
+
this.name = "ConflictException";
|
|
29
|
+
this.$fault = "client";
|
|
30
|
+
Object.setPrototypeOf(this, ConflictException.prototype);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export class InternalServerException extends __BaseException {
|
|
34
|
+
constructor(opts) {
|
|
35
|
+
super({
|
|
36
|
+
name: "InternalServerException",
|
|
37
|
+
$fault: "server",
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
this.name = "InternalServerException";
|
|
41
|
+
this.$fault = "server";
|
|
42
|
+
this.$retryable = {};
|
|
43
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class ResourceNotFoundException extends __BaseException {
|
|
47
|
+
constructor(opts) {
|
|
48
|
+
super({
|
|
49
|
+
name: "ResourceNotFoundException",
|
|
50
|
+
$fault: "client",
|
|
51
|
+
...opts,
|
|
52
|
+
});
|
|
53
|
+
this.name = "ResourceNotFoundException";
|
|
54
|
+
this.$fault = "client";
|
|
55
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export class ServiceQuotaExceededException extends __BaseException {
|
|
59
|
+
constructor(opts) {
|
|
60
|
+
super({
|
|
61
|
+
name: "ServiceQuotaExceededException",
|
|
62
|
+
$fault: "client",
|
|
63
|
+
...opts,
|
|
64
|
+
});
|
|
65
|
+
this.name = "ServiceQuotaExceededException";
|
|
66
|
+
this.$fault = "client";
|
|
67
|
+
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class ThrottlingException extends __BaseException {
|
|
71
|
+
constructor(opts) {
|
|
72
|
+
super({
|
|
73
|
+
name: "ThrottlingException",
|
|
74
|
+
$fault: "client",
|
|
75
|
+
...opts,
|
|
76
|
+
});
|
|
77
|
+
this.name = "ThrottlingException";
|
|
78
|
+
this.$fault = "client";
|
|
79
|
+
this.$retryable = {
|
|
80
|
+
throttling: true,
|
|
81
|
+
};
|
|
82
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export class ValidationException extends __BaseException {
|
|
86
|
+
constructor(opts) {
|
|
87
|
+
super({
|
|
88
|
+
name: "ValidationException",
|
|
89
|
+
$fault: "client",
|
|
90
|
+
...opts,
|
|
91
|
+
});
|
|
92
|
+
this.name = "ValidationException";
|
|
93
|
+
this.$fault = "client";
|
|
94
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
2
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
|
+
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
5
|
+
import { SupplyChainServiceException as __BaseException } from "../models/SupplyChainServiceException";
|
|
6
|
+
export const se_CreateBillOfMaterialsImportJobCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
b.bp("/api/configuration/instances/{instanceId}/bill-of-materials-import-jobs");
|
|
12
|
+
b.p("instanceId", () => input.instanceId, "{instanceId}", false);
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify(take(input, {
|
|
15
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
16
|
+
s3uri: [],
|
|
17
|
+
}));
|
|
18
|
+
b.m("POST").h(headers).b(body);
|
|
19
|
+
return b.build();
|
|
20
|
+
};
|
|
21
|
+
export const se_GetBillOfMaterialsImportJobCommand = async (input, context) => {
|
|
22
|
+
const b = rb(input, context);
|
|
23
|
+
const headers = {};
|
|
24
|
+
b.bp("/api/configuration/instances/{instanceId}/bill-of-materials-import-jobs/{jobId}");
|
|
25
|
+
b.p("instanceId", () => input.instanceId, "{instanceId}", false);
|
|
26
|
+
b.p("jobId", () => input.jobId, "{jobId}", false);
|
|
27
|
+
let body;
|
|
28
|
+
b.m("GET").h(headers).b(body);
|
|
29
|
+
return b.build();
|
|
30
|
+
};
|
|
31
|
+
export const de_CreateBillOfMaterialsImportJobCommand = async (output, context) => {
|
|
32
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
33
|
+
return de_CreateBillOfMaterialsImportJobCommandError(output, context);
|
|
34
|
+
}
|
|
35
|
+
const contents = map({
|
|
36
|
+
$metadata: deserializeMetadata(output),
|
|
37
|
+
});
|
|
38
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
39
|
+
const doc = take(data, {
|
|
40
|
+
jobId: __expectString,
|
|
41
|
+
});
|
|
42
|
+
Object.assign(contents, doc);
|
|
43
|
+
return contents;
|
|
44
|
+
};
|
|
45
|
+
const de_CreateBillOfMaterialsImportJobCommandError = async (output, context) => {
|
|
46
|
+
const parsedOutput = {
|
|
47
|
+
...output,
|
|
48
|
+
body: await parseErrorBody(output.body, context),
|
|
49
|
+
};
|
|
50
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
51
|
+
switch (errorCode) {
|
|
52
|
+
case "AccessDeniedException":
|
|
53
|
+
case "com.amazonaws.supplychain#AccessDeniedException":
|
|
54
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
55
|
+
case "ConflictException":
|
|
56
|
+
case "com.amazonaws.supplychain#ConflictException":
|
|
57
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
58
|
+
case "InternalServerException":
|
|
59
|
+
case "com.amazonaws.supplychain#InternalServerException":
|
|
60
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
61
|
+
case "ResourceNotFoundException":
|
|
62
|
+
case "com.amazonaws.supplychain#ResourceNotFoundException":
|
|
63
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
64
|
+
case "ServiceQuotaExceededException":
|
|
65
|
+
case "com.amazonaws.supplychain#ServiceQuotaExceededException":
|
|
66
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
67
|
+
case "ThrottlingException":
|
|
68
|
+
case "com.amazonaws.supplychain#ThrottlingException":
|
|
69
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
70
|
+
case "ValidationException":
|
|
71
|
+
case "com.amazonaws.supplychain#ValidationException":
|
|
72
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
73
|
+
default:
|
|
74
|
+
const parsedBody = parsedOutput.body;
|
|
75
|
+
return throwDefaultError({
|
|
76
|
+
output,
|
|
77
|
+
parsedBody,
|
|
78
|
+
errorCode,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export const de_GetBillOfMaterialsImportJobCommand = async (output, context) => {
|
|
83
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
84
|
+
return de_GetBillOfMaterialsImportJobCommandError(output, context);
|
|
85
|
+
}
|
|
86
|
+
const contents = map({
|
|
87
|
+
$metadata: deserializeMetadata(output),
|
|
88
|
+
});
|
|
89
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
90
|
+
const doc = take(data, {
|
|
91
|
+
job: _json,
|
|
92
|
+
});
|
|
93
|
+
Object.assign(contents, doc);
|
|
94
|
+
return contents;
|
|
95
|
+
};
|
|
96
|
+
const de_GetBillOfMaterialsImportJobCommandError = async (output, context) => {
|
|
97
|
+
const parsedOutput = {
|
|
98
|
+
...output,
|
|
99
|
+
body: await parseErrorBody(output.body, context),
|
|
100
|
+
};
|
|
101
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
102
|
+
switch (errorCode) {
|
|
103
|
+
case "AccessDeniedException":
|
|
104
|
+
case "com.amazonaws.supplychain#AccessDeniedException":
|
|
105
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
106
|
+
case "ConflictException":
|
|
107
|
+
case "com.amazonaws.supplychain#ConflictException":
|
|
108
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
109
|
+
case "InternalServerException":
|
|
110
|
+
case "com.amazonaws.supplychain#InternalServerException":
|
|
111
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
112
|
+
case "ResourceNotFoundException":
|
|
113
|
+
case "com.amazonaws.supplychain#ResourceNotFoundException":
|
|
114
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
115
|
+
case "ServiceQuotaExceededException":
|
|
116
|
+
case "com.amazonaws.supplychain#ServiceQuotaExceededException":
|
|
117
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
118
|
+
case "ThrottlingException":
|
|
119
|
+
case "com.amazonaws.supplychain#ThrottlingException":
|
|
120
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
121
|
+
case "ValidationException":
|
|
122
|
+
case "com.amazonaws.supplychain#ValidationException":
|
|
123
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
124
|
+
default:
|
|
125
|
+
const parsedBody = parsedOutput.body;
|
|
126
|
+
return throwDefaultError({
|
|
127
|
+
output,
|
|
128
|
+
parsedBody,
|
|
129
|
+
errorCode,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
134
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
135
|
+
const contents = map({});
|
|
136
|
+
const data = parsedOutput.body;
|
|
137
|
+
const doc = take(data, {
|
|
138
|
+
message: __expectString,
|
|
139
|
+
});
|
|
140
|
+
Object.assign(contents, doc);
|
|
141
|
+
const exception = new AccessDeniedException({
|
|
142
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
143
|
+
...contents,
|
|
144
|
+
});
|
|
145
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
146
|
+
};
|
|
147
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
148
|
+
const contents = map({});
|
|
149
|
+
const data = parsedOutput.body;
|
|
150
|
+
const doc = take(data, {
|
|
151
|
+
message: __expectString,
|
|
152
|
+
});
|
|
153
|
+
Object.assign(contents, doc);
|
|
154
|
+
const exception = new ConflictException({
|
|
155
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
156
|
+
...contents,
|
|
157
|
+
});
|
|
158
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
159
|
+
};
|
|
160
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
161
|
+
const contents = map({});
|
|
162
|
+
const data = parsedOutput.body;
|
|
163
|
+
const doc = take(data, {
|
|
164
|
+
message: __expectString,
|
|
165
|
+
});
|
|
166
|
+
Object.assign(contents, doc);
|
|
167
|
+
const exception = new InternalServerException({
|
|
168
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
169
|
+
...contents,
|
|
170
|
+
});
|
|
171
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
172
|
+
};
|
|
173
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
174
|
+
const contents = map({});
|
|
175
|
+
const data = parsedOutput.body;
|
|
176
|
+
const doc = take(data, {
|
|
177
|
+
message: __expectString,
|
|
178
|
+
});
|
|
179
|
+
Object.assign(contents, doc);
|
|
180
|
+
const exception = new ResourceNotFoundException({
|
|
181
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
182
|
+
...contents,
|
|
183
|
+
});
|
|
184
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
185
|
+
};
|
|
186
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
187
|
+
const contents = map({});
|
|
188
|
+
const data = parsedOutput.body;
|
|
189
|
+
const doc = take(data, {
|
|
190
|
+
message: __expectString,
|
|
191
|
+
});
|
|
192
|
+
Object.assign(contents, doc);
|
|
193
|
+
const exception = new ServiceQuotaExceededException({
|
|
194
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
195
|
+
...contents,
|
|
196
|
+
});
|
|
197
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
198
|
+
};
|
|
199
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
200
|
+
const contents = map({});
|
|
201
|
+
const data = parsedOutput.body;
|
|
202
|
+
const doc = take(data, {
|
|
203
|
+
message: __expectString,
|
|
204
|
+
});
|
|
205
|
+
Object.assign(contents, doc);
|
|
206
|
+
const exception = new ThrottlingException({
|
|
207
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
208
|
+
...contents,
|
|
209
|
+
});
|
|
210
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
211
|
+
};
|
|
212
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
213
|
+
const contents = map({});
|
|
214
|
+
const data = parsedOutput.body;
|
|
215
|
+
const doc = take(data, {
|
|
216
|
+
message: __expectString,
|
|
217
|
+
});
|
|
218
|
+
Object.assign(contents, doc);
|
|
219
|
+
const exception = new ValidationException({
|
|
220
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
221
|
+
...contents,
|
|
222
|
+
});
|
|
223
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
224
|
+
};
|
|
225
|
+
const deserializeMetadata = (output) => ({
|
|
226
|
+
httpStatusCode: output.statusCode,
|
|
227
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
228
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
229
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
230
|
+
});
|
|
231
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
232
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
233
|
+
value !== null &&
|
|
234
|
+
value !== "" &&
|
|
235
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
236
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
237
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
238
|
+
if (encoded.length) {
|
|
239
|
+
return JSON.parse(encoded);
|
|
240
|
+
}
|
|
241
|
+
return {};
|
|
242
|
+
});
|
|
243
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
244
|
+
const value = await parseBody(errorBody, context);
|
|
245
|
+
value.message = value.message ?? value.Message;
|
|
246
|
+
return value;
|
|
247
|
+
};
|
|
248
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
249
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
250
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
251
|
+
let cleanValue = rawValue;
|
|
252
|
+
if (typeof cleanValue === "number") {
|
|
253
|
+
cleanValue = cleanValue.toString();
|
|
254
|
+
}
|
|
255
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
256
|
+
cleanValue = cleanValue.split(",")[0];
|
|
257
|
+
}
|
|
258
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
259
|
+
cleanValue = cleanValue.split(":")[0];
|
|
260
|
+
}
|
|
261
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
262
|
+
cleanValue = cleanValue.split("#")[1];
|
|
263
|
+
}
|
|
264
|
+
return cleanValue;
|
|
265
|
+
};
|
|
266
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
267
|
+
if (headerKey !== undefined) {
|
|
268
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
269
|
+
}
|
|
270
|
+
if (data.code !== undefined) {
|
|
271
|
+
return sanitizeErrorCode(data.code);
|
|
272
|
+
}
|
|
273
|
+
if (data["__type"] !== undefined) {
|
|
274
|
+
return sanitizeErrorCode(data["__type"]);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
3
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
4
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
5
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
6
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
7
|
+
import { Hash } from "@smithy/hash-node";
|
|
8
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
9
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
10
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
11
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
12
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
13
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
14
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
15
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
16
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
17
|
+
export const getRuntimeConfig = (config) => {
|
|
18
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
19
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
22
|
+
awsCheckVersion(process.version);
|
|
23
|
+
return {
|
|
24
|
+
...clientSharedValues,
|
|
25
|
+
...config,
|
|
26
|
+
runtime: "node",
|
|
27
|
+
defaultsMode,
|
|
28
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
30
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
31
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
33
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
34
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
35
|
+
retryMode: config?.retryMode ??
|
|
36
|
+
loadNodeConfig({
|
|
37
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
38
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
39
|
+
}),
|
|
40
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
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
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
2
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
3
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
5
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
6
|
+
export const getRuntimeConfig = (config) => {
|
|
7
|
+
return {
|
|
8
|
+
apiVersion: "2024-01-01",
|
|
9
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
10
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
11
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
13
|
+
extensions: config?.extensions ?? [],
|
|
14
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
15
|
+
serviceId: config?.serviceId ?? "SupplyChain",
|
|
16
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
const asPartial = (t) => t;
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = {
|
|
7
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
};
|
|
11
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
|
+
return {
|
|
13
|
+
...runtimeConfig,
|
|
14
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { CreateBillOfMaterialsImportJobCommandInput, CreateBillOfMaterialsImportJobCommandOutput } from "./commands/CreateBillOfMaterialsImportJobCommand";
|
|
3
|
+
import { GetBillOfMaterialsImportJobCommandInput, GetBillOfMaterialsImportJobCommandOutput } from "./commands/GetBillOfMaterialsImportJobCommand";
|
|
4
|
+
import { SupplyChainClient } from "./SupplyChainClient";
|
|
5
|
+
export interface SupplyChain {
|
|
6
|
+
/**
|
|
7
|
+
* @see {@link CreateBillOfMaterialsImportJobCommand}
|
|
8
|
+
*/
|
|
9
|
+
createBillOfMaterialsImportJob(args: CreateBillOfMaterialsImportJobCommandInput, options?: __HttpHandlerOptions): Promise<CreateBillOfMaterialsImportJobCommandOutput>;
|
|
10
|
+
createBillOfMaterialsImportJob(args: CreateBillOfMaterialsImportJobCommandInput, cb: (err: any, data?: CreateBillOfMaterialsImportJobCommandOutput) => void): void;
|
|
11
|
+
createBillOfMaterialsImportJob(args: CreateBillOfMaterialsImportJobCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateBillOfMaterialsImportJobCommandOutput) => void): void;
|
|
12
|
+
/**
|
|
13
|
+
* @see {@link GetBillOfMaterialsImportJobCommand}
|
|
14
|
+
*/
|
|
15
|
+
getBillOfMaterialsImportJob(args: GetBillOfMaterialsImportJobCommandInput, options?: __HttpHandlerOptions): Promise<GetBillOfMaterialsImportJobCommandOutput>;
|
|
16
|
+
getBillOfMaterialsImportJob(args: GetBillOfMaterialsImportJobCommandInput, cb: (err: any, data?: GetBillOfMaterialsImportJobCommandOutput) => void): void;
|
|
17
|
+
getBillOfMaterialsImportJob(args: GetBillOfMaterialsImportJobCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetBillOfMaterialsImportJobCommandOutput) => void): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
* <p>
|
|
22
|
+
* AWS Supply Chain is a cloud-based application that works with your enterprise resource planning (ERP) and supply chain management systems. Using AWS Supply Chain, you can connect and extract your inventory, supply, and demand related data from existing ERP or supply chain systems into a single data model.
|
|
23
|
+
* </p>
|
|
24
|
+
* <p>The AWS Supply Chain API supports configuration data import for Supply Planning.</p>
|
|
25
|
+
* <p>
|
|
26
|
+
* All AWS Supply chain API operations are Amazon-authenticated and certificate-signed. They not only require the use of the AWS SDK, but also allow for the exclusive use of AWS Identity and Access Management users and roles to help facilitate access, trust, and permission policies.
|
|
27
|
+
* </p>
|
|
28
|
+
*/
|
|
29
|
+
export declare class SupplyChain extends SupplyChainClient implements SupplyChain {
|
|
30
|
+
}
|