@aws-sdk/client-taxsettings 3.590.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 +272 -0
- package/dist-cjs/TaxSettings.js +25 -0
- package/dist-cjs/TaxSettingsClient.js +56 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/BatchDeleteTaxRegistrationCommand.js +29 -0
- package/dist-cjs/commands/BatchPutTaxRegistrationCommand.js +29 -0
- package/dist-cjs/commands/DeleteTaxRegistrationCommand.js +28 -0
- package/dist-cjs/commands/GetTaxRegistrationCommand.js +29 -0
- package/dist-cjs/commands/GetTaxRegistrationDocumentCommand.js +28 -0
- package/dist-cjs/commands/ListTaxRegistrationsCommand.js +29 -0
- package/dist-cjs/commands/PutTaxRegistrationCommand.js +29 -0
- package/dist-cjs/commands/index.js +10 -0
- package/dist-cjs/endpoint/EndpointParameters.js +18 -0
- package/dist-cjs/endpoint/endpointResolver.js +14 -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/TaxSettingsServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +198 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListTaxRegistrationsPaginator.js +7 -0
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_restJson1.js +311 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +49 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +25 -0
- package/dist-es/TaxSettings.js +21 -0
- package/dist-es/TaxSettingsClient.js +52 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/BatchDeleteTaxRegistrationCommand.js +25 -0
- package/dist-es/commands/BatchPutTaxRegistrationCommand.js +25 -0
- package/dist-es/commands/DeleteTaxRegistrationCommand.js +24 -0
- package/dist-es/commands/GetTaxRegistrationCommand.js +25 -0
- package/dist-es/commands/GetTaxRegistrationDocumentCommand.js +24 -0
- package/dist-es/commands/ListTaxRegistrationsCommand.js +25 -0
- package/dist-es/commands/PutTaxRegistrationCommand.js +25 -0
- package/dist-es/commands/index.js +7 -0
- package/dist-es/endpoint/EndpointParameters.js +14 -0
- package/dist-es/endpoint/endpointResolver.js +10 -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/TaxSettingsServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +178 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListTaxRegistrationsPaginator.js +4 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +294 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +44 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +21 -0
- package/dist-types/TaxSettings.d.ts +73 -0
- package/dist-types/TaxSettingsClient.d.ts +189 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/commands/BatchDeleteTaxRegistrationCommand.d.ts +81 -0
- package/dist-types/commands/BatchPutTaxRegistrationCommand.d.ts +346 -0
- package/dist-types/commands/DeleteTaxRegistrationCommand.d.ts +73 -0
- package/dist-types/commands/GetTaxRegistrationCommand.d.ts +158 -0
- package/dist-types/commands/GetTaxRegistrationDocumentCommand.d.ts +74 -0
- package/dist-types/commands/ListTaxRegistrationsCommand.d.ts +186 -0
- package/dist-types/commands/PutTaxRegistrationCommand.d.ts +336 -0
- package/dist-types/commands/index.d.ts +7 -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 +9 -0
- package/dist-types/index.d.ts +25 -0
- package/dist-types/models/TaxSettingsServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1476 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListTaxRegistrationsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +65 -0
- package/dist-types/runtimeConfig.browser.d.ts +45 -0
- package/dist-types/runtimeConfig.d.ts +45 -0
- package/dist-types/runtimeConfig.native.d.ts +44 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/TaxSettings.d.ts +129 -0
- package/dist-types/ts3.4/TaxSettingsClient.d.ts +162 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/commands/BatchDeleteTaxRegistrationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/BatchPutTaxRegistrationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/DeleteTaxRegistrationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetTaxRegistrationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetTaxRegistrationDocumentCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListTaxRegistrationsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/PutTaxRegistrationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/index.d.ts +7 -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 +9 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/TaxSettingsServiceException.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 +408 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListTaxRegistrationsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +89 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +85 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +89 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +79 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +101 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
|
|
5
|
+
import { TaxSettingsServiceException as __BaseException } from "../models/TaxSettingsServiceException";
|
|
6
|
+
export const se_BatchDeleteTaxRegistrationCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
b.bp("/BatchDeleteTaxRegistration");
|
|
12
|
+
let body;
|
|
13
|
+
body = JSON.stringify(take(input, {
|
|
14
|
+
accountIds: (_) => _json(_),
|
|
15
|
+
}));
|
|
16
|
+
b.m("POST").h(headers).b(body);
|
|
17
|
+
return b.build();
|
|
18
|
+
};
|
|
19
|
+
export const se_BatchPutTaxRegistrationCommand = async (input, context) => {
|
|
20
|
+
const b = rb(input, context);
|
|
21
|
+
const headers = {
|
|
22
|
+
"content-type": "application/json",
|
|
23
|
+
};
|
|
24
|
+
b.bp("/BatchPutTaxRegistration");
|
|
25
|
+
let body;
|
|
26
|
+
body = JSON.stringify(take(input, {
|
|
27
|
+
accountIds: (_) => _json(_),
|
|
28
|
+
taxRegistrationEntry: (_) => _json(_),
|
|
29
|
+
}));
|
|
30
|
+
b.m("POST").h(headers).b(body);
|
|
31
|
+
return b.build();
|
|
32
|
+
};
|
|
33
|
+
export const se_DeleteTaxRegistrationCommand = async (input, context) => {
|
|
34
|
+
const b = rb(input, context);
|
|
35
|
+
const headers = {
|
|
36
|
+
"content-type": "application/json",
|
|
37
|
+
};
|
|
38
|
+
b.bp("/DeleteTaxRegistration");
|
|
39
|
+
let body;
|
|
40
|
+
body = JSON.stringify(take(input, {
|
|
41
|
+
accountId: [],
|
|
42
|
+
}));
|
|
43
|
+
b.m("POST").h(headers).b(body);
|
|
44
|
+
return b.build();
|
|
45
|
+
};
|
|
46
|
+
export const se_GetTaxRegistrationCommand = async (input, context) => {
|
|
47
|
+
const b = rb(input, context);
|
|
48
|
+
const headers = {
|
|
49
|
+
"content-type": "application/json",
|
|
50
|
+
};
|
|
51
|
+
b.bp("/GetTaxRegistration");
|
|
52
|
+
let body;
|
|
53
|
+
body = JSON.stringify(take(input, {
|
|
54
|
+
accountId: [],
|
|
55
|
+
}));
|
|
56
|
+
b.m("POST").h(headers).b(body);
|
|
57
|
+
return b.build();
|
|
58
|
+
};
|
|
59
|
+
export const se_GetTaxRegistrationDocumentCommand = async (input, context) => {
|
|
60
|
+
const b = rb(input, context);
|
|
61
|
+
const headers = {
|
|
62
|
+
"content-type": "application/json",
|
|
63
|
+
};
|
|
64
|
+
b.bp("/GetTaxRegistrationDocument");
|
|
65
|
+
let body;
|
|
66
|
+
body = JSON.stringify(take(input, {
|
|
67
|
+
destinationS3Location: (_) => _json(_),
|
|
68
|
+
taxDocumentMetadata: (_) => _json(_),
|
|
69
|
+
}));
|
|
70
|
+
b.m("POST").h(headers).b(body);
|
|
71
|
+
return b.build();
|
|
72
|
+
};
|
|
73
|
+
export const se_ListTaxRegistrationsCommand = async (input, context) => {
|
|
74
|
+
const b = rb(input, context);
|
|
75
|
+
const headers = {
|
|
76
|
+
"content-type": "application/json",
|
|
77
|
+
};
|
|
78
|
+
b.bp("/ListTaxRegistrations");
|
|
79
|
+
let body;
|
|
80
|
+
body = JSON.stringify(take(input, {
|
|
81
|
+
maxResults: [],
|
|
82
|
+
nextToken: [],
|
|
83
|
+
}));
|
|
84
|
+
b.m("POST").h(headers).b(body);
|
|
85
|
+
return b.build();
|
|
86
|
+
};
|
|
87
|
+
export const se_PutTaxRegistrationCommand = async (input, context) => {
|
|
88
|
+
const b = rb(input, context);
|
|
89
|
+
const headers = {
|
|
90
|
+
"content-type": "application/json",
|
|
91
|
+
};
|
|
92
|
+
b.bp("/PutTaxRegistration");
|
|
93
|
+
let body;
|
|
94
|
+
body = JSON.stringify(take(input, {
|
|
95
|
+
accountId: [],
|
|
96
|
+
taxRegistrationEntry: (_) => _json(_),
|
|
97
|
+
}));
|
|
98
|
+
b.m("POST").h(headers).b(body);
|
|
99
|
+
return b.build();
|
|
100
|
+
};
|
|
101
|
+
export const de_BatchDeleteTaxRegistrationCommand = async (output, context) => {
|
|
102
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
103
|
+
return de_CommandError(output, context);
|
|
104
|
+
}
|
|
105
|
+
const contents = map({
|
|
106
|
+
$metadata: deserializeMetadata(output),
|
|
107
|
+
});
|
|
108
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
109
|
+
const doc = take(data, {
|
|
110
|
+
errors: _json,
|
|
111
|
+
});
|
|
112
|
+
Object.assign(contents, doc);
|
|
113
|
+
return contents;
|
|
114
|
+
};
|
|
115
|
+
export const de_BatchPutTaxRegistrationCommand = async (output, context) => {
|
|
116
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
117
|
+
return de_CommandError(output, context);
|
|
118
|
+
}
|
|
119
|
+
const contents = map({
|
|
120
|
+
$metadata: deserializeMetadata(output),
|
|
121
|
+
});
|
|
122
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
123
|
+
const doc = take(data, {
|
|
124
|
+
errors: _json,
|
|
125
|
+
status: __expectString,
|
|
126
|
+
});
|
|
127
|
+
Object.assign(contents, doc);
|
|
128
|
+
return contents;
|
|
129
|
+
};
|
|
130
|
+
export const de_DeleteTaxRegistrationCommand = async (output, context) => {
|
|
131
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
132
|
+
return de_CommandError(output, context);
|
|
133
|
+
}
|
|
134
|
+
const contents = map({
|
|
135
|
+
$metadata: deserializeMetadata(output),
|
|
136
|
+
});
|
|
137
|
+
await collectBody(output.body, context);
|
|
138
|
+
return contents;
|
|
139
|
+
};
|
|
140
|
+
export const de_GetTaxRegistrationCommand = async (output, context) => {
|
|
141
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
142
|
+
return de_CommandError(output, context);
|
|
143
|
+
}
|
|
144
|
+
const contents = map({
|
|
145
|
+
$metadata: deserializeMetadata(output),
|
|
146
|
+
});
|
|
147
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
148
|
+
const doc = take(data, {
|
|
149
|
+
taxRegistration: _json,
|
|
150
|
+
});
|
|
151
|
+
Object.assign(contents, doc);
|
|
152
|
+
return contents;
|
|
153
|
+
};
|
|
154
|
+
export const de_GetTaxRegistrationDocumentCommand = async (output, context) => {
|
|
155
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
156
|
+
return de_CommandError(output, context);
|
|
157
|
+
}
|
|
158
|
+
const contents = map({
|
|
159
|
+
$metadata: deserializeMetadata(output),
|
|
160
|
+
});
|
|
161
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
162
|
+
const doc = take(data, {
|
|
163
|
+
destinationFilePath: __expectString,
|
|
164
|
+
});
|
|
165
|
+
Object.assign(contents, doc);
|
|
166
|
+
return contents;
|
|
167
|
+
};
|
|
168
|
+
export const de_ListTaxRegistrationsCommand = async (output, context) => {
|
|
169
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
170
|
+
return de_CommandError(output, context);
|
|
171
|
+
}
|
|
172
|
+
const contents = map({
|
|
173
|
+
$metadata: deserializeMetadata(output),
|
|
174
|
+
});
|
|
175
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
176
|
+
const doc = take(data, {
|
|
177
|
+
accountDetails: _json,
|
|
178
|
+
nextToken: __expectString,
|
|
179
|
+
});
|
|
180
|
+
Object.assign(contents, doc);
|
|
181
|
+
return contents;
|
|
182
|
+
};
|
|
183
|
+
export const de_PutTaxRegistrationCommand = async (output, context) => {
|
|
184
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
185
|
+
return de_CommandError(output, context);
|
|
186
|
+
}
|
|
187
|
+
const contents = map({
|
|
188
|
+
$metadata: deserializeMetadata(output),
|
|
189
|
+
});
|
|
190
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
191
|
+
const doc = take(data, {
|
|
192
|
+
status: __expectString,
|
|
193
|
+
});
|
|
194
|
+
Object.assign(contents, doc);
|
|
195
|
+
return contents;
|
|
196
|
+
};
|
|
197
|
+
const de_CommandError = async (output, context) => {
|
|
198
|
+
const parsedOutput = {
|
|
199
|
+
...output,
|
|
200
|
+
body: await parseErrorBody(output.body, context),
|
|
201
|
+
};
|
|
202
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
203
|
+
switch (errorCode) {
|
|
204
|
+
case "ConflictException":
|
|
205
|
+
case "com.amazonaws.taxsettings#ConflictException":
|
|
206
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
207
|
+
case "InternalServerException":
|
|
208
|
+
case "com.amazonaws.taxsettings#InternalServerException":
|
|
209
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
210
|
+
case "ValidationException":
|
|
211
|
+
case "com.amazonaws.taxsettings#ValidationException":
|
|
212
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
213
|
+
case "ResourceNotFoundException":
|
|
214
|
+
case "com.amazonaws.taxsettings#ResourceNotFoundException":
|
|
215
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
216
|
+
default:
|
|
217
|
+
const parsedBody = parsedOutput.body;
|
|
218
|
+
return throwDefaultError({
|
|
219
|
+
output,
|
|
220
|
+
parsedBody,
|
|
221
|
+
errorCode,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
226
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
227
|
+
const contents = map({});
|
|
228
|
+
const data = parsedOutput.body;
|
|
229
|
+
const doc = take(data, {
|
|
230
|
+
errorCode: __expectString,
|
|
231
|
+
message: __expectString,
|
|
232
|
+
});
|
|
233
|
+
Object.assign(contents, doc);
|
|
234
|
+
const exception = new ConflictException({
|
|
235
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
236
|
+
...contents,
|
|
237
|
+
});
|
|
238
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
239
|
+
};
|
|
240
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
241
|
+
const contents = map({});
|
|
242
|
+
const data = parsedOutput.body;
|
|
243
|
+
const doc = take(data, {
|
|
244
|
+
errorCode: __expectString,
|
|
245
|
+
message: __expectString,
|
|
246
|
+
});
|
|
247
|
+
Object.assign(contents, doc);
|
|
248
|
+
const exception = new InternalServerException({
|
|
249
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
250
|
+
...contents,
|
|
251
|
+
});
|
|
252
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
253
|
+
};
|
|
254
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
255
|
+
const contents = map({});
|
|
256
|
+
const data = parsedOutput.body;
|
|
257
|
+
const doc = take(data, {
|
|
258
|
+
errorCode: __expectString,
|
|
259
|
+
message: __expectString,
|
|
260
|
+
});
|
|
261
|
+
Object.assign(contents, doc);
|
|
262
|
+
const exception = new ResourceNotFoundException({
|
|
263
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
264
|
+
...contents,
|
|
265
|
+
});
|
|
266
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
267
|
+
};
|
|
268
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
269
|
+
const contents = map({});
|
|
270
|
+
const data = parsedOutput.body;
|
|
271
|
+
const doc = take(data, {
|
|
272
|
+
errorCode: __expectString,
|
|
273
|
+
fieldList: _json,
|
|
274
|
+
message: __expectString,
|
|
275
|
+
});
|
|
276
|
+
Object.assign(contents, doc);
|
|
277
|
+
const exception = new ValidationException({
|
|
278
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
279
|
+
...contents,
|
|
280
|
+
});
|
|
281
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
282
|
+
};
|
|
283
|
+
const deserializeMetadata = (output) => ({
|
|
284
|
+
httpStatusCode: output.statusCode,
|
|
285
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
286
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
287
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
288
|
+
});
|
|
289
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
290
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
291
|
+
value !== null &&
|
|
292
|
+
value !== "" &&
|
|
293
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
294
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
@@ -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: RequestHandler.create(config?.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,44 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
5
|
+
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";
|
|
6
|
+
import { Hash } from "@smithy/hash-node";
|
|
7
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
8
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
11
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
12
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
15
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
16
|
+
export const getRuntimeConfig = (config) => {
|
|
17
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
18
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
19
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
20
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
21
|
+
awsCheckVersion(process.version);
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
28
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
29
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
30
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
32
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
33
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
34
|
+
retryMode: config?.retryMode ??
|
|
35
|
+
loadNodeConfig({
|
|
36
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
37
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
38
|
+
}),
|
|
39
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
40
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
41
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
42
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -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,30 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
4
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
6
|
+
import { defaultTaxSettingsHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
7
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
8
|
+
export const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "2018-05-10",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
15
|
+
extensions: config?.extensions ?? [],
|
|
16
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultTaxSettingsHttpAuthSchemeProvider,
|
|
17
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
18
|
+
{
|
|
19
|
+
schemeId: "aws.auth#sigv4",
|
|
20
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
21
|
+
signer: new AwsSdkSigV4Signer(),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
25
|
+
serviceId: config?.serviceId ?? "TaxSettings",
|
|
26
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
27
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
28
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
const asPartial = (t) => t;
|
|
6
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
7
|
+
const extensionConfiguration = {
|
|
8
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
12
|
+
};
|
|
13
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
14
|
+
return {
|
|
15
|
+
...runtimeConfig,
|
|
16
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
17
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
18
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { BatchDeleteTaxRegistrationCommandInput, BatchDeleteTaxRegistrationCommandOutput } from "./commands/BatchDeleteTaxRegistrationCommand";
|
|
3
|
+
import { BatchPutTaxRegistrationCommandInput, BatchPutTaxRegistrationCommandOutput } from "./commands/BatchPutTaxRegistrationCommand";
|
|
4
|
+
import { DeleteTaxRegistrationCommandInput, DeleteTaxRegistrationCommandOutput } from "./commands/DeleteTaxRegistrationCommand";
|
|
5
|
+
import { GetTaxRegistrationCommandInput, GetTaxRegistrationCommandOutput } from "./commands/GetTaxRegistrationCommand";
|
|
6
|
+
import { GetTaxRegistrationDocumentCommandInput, GetTaxRegistrationDocumentCommandOutput } from "./commands/GetTaxRegistrationDocumentCommand";
|
|
7
|
+
import { ListTaxRegistrationsCommandInput, ListTaxRegistrationsCommandOutput } from "./commands/ListTaxRegistrationsCommand";
|
|
8
|
+
import { PutTaxRegistrationCommandInput, PutTaxRegistrationCommandOutput } from "./commands/PutTaxRegistrationCommand";
|
|
9
|
+
import { TaxSettingsClient } from "./TaxSettingsClient";
|
|
10
|
+
export interface TaxSettings {
|
|
11
|
+
/**
|
|
12
|
+
* @see {@link BatchDeleteTaxRegistrationCommand}
|
|
13
|
+
*/
|
|
14
|
+
batchDeleteTaxRegistration(args: BatchDeleteTaxRegistrationCommandInput, options?: __HttpHandlerOptions): Promise<BatchDeleteTaxRegistrationCommandOutput>;
|
|
15
|
+
batchDeleteTaxRegistration(args: BatchDeleteTaxRegistrationCommandInput, cb: (err: any, data?: BatchDeleteTaxRegistrationCommandOutput) => void): void;
|
|
16
|
+
batchDeleteTaxRegistration(args: BatchDeleteTaxRegistrationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: BatchDeleteTaxRegistrationCommandOutput) => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* @see {@link BatchPutTaxRegistrationCommand}
|
|
19
|
+
*/
|
|
20
|
+
batchPutTaxRegistration(args: BatchPutTaxRegistrationCommandInput, options?: __HttpHandlerOptions): Promise<BatchPutTaxRegistrationCommandOutput>;
|
|
21
|
+
batchPutTaxRegistration(args: BatchPutTaxRegistrationCommandInput, cb: (err: any, data?: BatchPutTaxRegistrationCommandOutput) => void): void;
|
|
22
|
+
batchPutTaxRegistration(args: BatchPutTaxRegistrationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: BatchPutTaxRegistrationCommandOutput) => void): void;
|
|
23
|
+
/**
|
|
24
|
+
* @see {@link DeleteTaxRegistrationCommand}
|
|
25
|
+
*/
|
|
26
|
+
deleteTaxRegistration(): Promise<DeleteTaxRegistrationCommandOutput>;
|
|
27
|
+
deleteTaxRegistration(args: DeleteTaxRegistrationCommandInput, options?: __HttpHandlerOptions): Promise<DeleteTaxRegistrationCommandOutput>;
|
|
28
|
+
deleteTaxRegistration(args: DeleteTaxRegistrationCommandInput, cb: (err: any, data?: DeleteTaxRegistrationCommandOutput) => void): void;
|
|
29
|
+
deleteTaxRegistration(args: DeleteTaxRegistrationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteTaxRegistrationCommandOutput) => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* @see {@link GetTaxRegistrationCommand}
|
|
32
|
+
*/
|
|
33
|
+
getTaxRegistration(): Promise<GetTaxRegistrationCommandOutput>;
|
|
34
|
+
getTaxRegistration(args: GetTaxRegistrationCommandInput, options?: __HttpHandlerOptions): Promise<GetTaxRegistrationCommandOutput>;
|
|
35
|
+
getTaxRegistration(args: GetTaxRegistrationCommandInput, cb: (err: any, data?: GetTaxRegistrationCommandOutput) => void): void;
|
|
36
|
+
getTaxRegistration(args: GetTaxRegistrationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetTaxRegistrationCommandOutput) => void): void;
|
|
37
|
+
/**
|
|
38
|
+
* @see {@link GetTaxRegistrationDocumentCommand}
|
|
39
|
+
*/
|
|
40
|
+
getTaxRegistrationDocument(args: GetTaxRegistrationDocumentCommandInput, options?: __HttpHandlerOptions): Promise<GetTaxRegistrationDocumentCommandOutput>;
|
|
41
|
+
getTaxRegistrationDocument(args: GetTaxRegistrationDocumentCommandInput, cb: (err: any, data?: GetTaxRegistrationDocumentCommandOutput) => void): void;
|
|
42
|
+
getTaxRegistrationDocument(args: GetTaxRegistrationDocumentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetTaxRegistrationDocumentCommandOutput) => void): void;
|
|
43
|
+
/**
|
|
44
|
+
* @see {@link ListTaxRegistrationsCommand}
|
|
45
|
+
*/
|
|
46
|
+
listTaxRegistrations(): Promise<ListTaxRegistrationsCommandOutput>;
|
|
47
|
+
listTaxRegistrations(args: ListTaxRegistrationsCommandInput, options?: __HttpHandlerOptions): Promise<ListTaxRegistrationsCommandOutput>;
|
|
48
|
+
listTaxRegistrations(args: ListTaxRegistrationsCommandInput, cb: (err: any, data?: ListTaxRegistrationsCommandOutput) => void): void;
|
|
49
|
+
listTaxRegistrations(args: ListTaxRegistrationsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListTaxRegistrationsCommandOutput) => void): void;
|
|
50
|
+
/**
|
|
51
|
+
* @see {@link PutTaxRegistrationCommand}
|
|
52
|
+
*/
|
|
53
|
+
putTaxRegistration(args: PutTaxRegistrationCommandInput, options?: __HttpHandlerOptions): Promise<PutTaxRegistrationCommandOutput>;
|
|
54
|
+
putTaxRegistration(args: PutTaxRegistrationCommandInput, cb: (err: any, data?: PutTaxRegistrationCommandOutput) => void): void;
|
|
55
|
+
putTaxRegistration(args: PutTaxRegistrationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutTaxRegistrationCommandOutput) => void): void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* <p>You can use the tax setting API to programmatically set, modify, and delete the tax
|
|
59
|
+
* registration number (TRN), associated business legal name, and address (Collectively referred
|
|
60
|
+
* to as "TRN information"). You can also programmatically view TRN information and tax addresses
|
|
61
|
+
* ("Tax profiles"). </p>
|
|
62
|
+
* <p>You can use this API to automate your TRN information settings instead of manually using
|
|
63
|
+
* the console.</p>
|
|
64
|
+
* <p>Service Endpoint</p>
|
|
65
|
+
* <ul>
|
|
66
|
+
* <li>
|
|
67
|
+
* <p>https://tax.us-east-1.amazonaws.com</p>
|
|
68
|
+
* </li>
|
|
69
|
+
* </ul>
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
export declare class TaxSettings extends TaxSettingsClient implements TaxSettings {
|
|
73
|
+
}
|