@aws-sdk/client-s3outposts 3.35.0 → 3.38.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/CHANGELOG.md +47 -0
- package/dist-cjs/S3Outposts.js +0 -4
- package/dist-cjs/S3OutpostsClient.js +0 -9
- package/dist-cjs/commands/CreateEndpointCommand.js +0 -46
- package/dist-cjs/commands/DeleteEndpointCommand.js +0 -46
- package/dist-cjs/commands/ListEndpointsCommand.js +0 -44
- package/dist-cjs/commands/index.js +6 -0
- package/dist-cjs/endpoints.js +1 -2
- package/dist-cjs/index.js +4 -8
- package/dist-cjs/models/index.js +0 -1
- package/dist-cjs/models/models_0.js +0 -37
- package/dist-cjs/pagination/Interfaces.js +0 -1
- package/dist-cjs/pagination/ListEndpointsPaginator.js +0 -11
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_restJson1.js +0 -6
- package/dist-cjs/runtimeConfig.browser.js +1 -6
- package/dist-cjs/runtimeConfig.js +2 -7
- package/dist-cjs/runtimeConfig.native.js +0 -4
- package/dist-cjs/runtimeConfig.shared.js +0 -4
- package/dist-es/S3Outposts.js +0 -1
- package/dist-es/S3OutpostsClient.js +0 -1
- package/dist-es/commands/CreateEndpointCommand.js +0 -1
- package/dist-es/commands/DeleteEndpointCommand.js +0 -1
- package/dist-es/commands/ListEndpointsCommand.js +0 -1
- package/dist-es/commands/index.js +3 -0
- package/dist-es/endpoints.js +1 -2
- package/dist-es/index.js +4 -8
- package/dist-es/models/index.js +0 -1
- package/dist-es/models/models_0.js +0 -1
- package/dist-es/pagination/Interfaces.js +0 -1
- package/dist-es/pagination/ListEndpointsPaginator.js +0 -1
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +0 -1
- package/dist-es/runtimeConfig.browser.js +1 -2
- package/dist-es/runtimeConfig.js +2 -3
- package/dist-es/runtimeConfig.native.js +0 -1
- package/dist-es/runtimeConfig.shared.js +0 -1
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/index.d.ts +4 -7
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/S3Outposts.d.ts +4 -73
- package/dist-types/ts3.4/S3OutpostsClient.d.ts +24 -89
- package/dist-types/ts3.4/commands/CreateEndpointCommand.d.ts +2 -41
- package/dist-types/ts3.4/commands/DeleteEndpointCommand.d.ts +2 -41
- package/dist-types/ts3.4/commands/ListEndpointsCommand.d.ts +2 -39
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/index.d.ts +4 -7
- package/dist-types/ts3.4/models/models_0.d.ts +43 -136
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +33 -30
- package/dist-cjs/S3Outposts.js.map +0 -1
- package/dist-cjs/S3OutpostsClient.js.map +0 -1
- package/dist-cjs/commands/CreateEndpointCommand.js.map +0 -1
- package/dist-cjs/commands/DeleteEndpointCommand.js.map +0 -1
- package/dist-cjs/commands/ListEndpointsCommand.js.map +0 -1
- package/dist-cjs/endpoints.js.map +0 -1
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/models/index.js.map +0 -1
- package/dist-cjs/models/models_0.js.map +0 -1
- package/dist-cjs/pagination/Interfaces.js.map +0 -1
- package/dist-cjs/pagination/ListEndpointsPaginator.js.map +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist-cjs/runtimeConfig.browser.js.map +0 -1
- package/dist-cjs/runtimeConfig.js.map +0 -1
- package/dist-cjs/runtimeConfig.native.js.map +0 -1
- package/dist-cjs/runtimeConfig.shared.js.map +0 -1
- package/dist-es/S3Outposts.js.map +0 -1
- package/dist-es/S3OutpostsClient.js.map +0 -1
- package/dist-es/commands/CreateEndpointCommand.js.map +0 -1
- package/dist-es/commands/DeleteEndpointCommand.js.map +0 -1
- package/dist-es/commands/ListEndpointsCommand.js.map +0 -1
- package/dist-es/endpoints.js.map +0 -1
- package/dist-es/index.js.map +0 -1
- package/dist-es/models/index.js.map +0 -1
- package/dist-es/models/models_0.js.map +0 -1
- package/dist-es/pagination/Interfaces.js.map +0 -1
- package/dist-es/pagination/ListEndpointsPaginator.js.map +0 -1
- package/dist-es/protocols/Aws_restJson1.js.map +0 -1
- package/dist-es/runtimeConfig.browser.js.map +0 -1
- package/dist-es/runtimeConfig.js.map +0 -1
- package/dist-es/runtimeConfig.native.js.map +0 -1
- package/dist-es/runtimeConfig.shared.js.map +0 -1
- package/jest.config.js +0 -4
- package/src/S3Outposts.ts +0 -180
- package/src/S3OutpostsClient.ts +0 -239
- package/src/commands/CreateEndpointCommand.ts +0 -116
- package/src/commands/DeleteEndpointCommand.ts +0 -116
- package/src/commands/ListEndpointsCommand.ts +0 -114
- package/src/endpoints.ts +0 -57
- package/src/index.ts +0 -8
- package/src/models/index.ts +0 -1
- package/src/models/models_0.ts +0 -312
- package/src/pagination/Interfaces.ts +0 -8
- package/src/pagination/ListEndpointsPaginator.ts +0 -59
- package/src/protocols/Aws_restJson1.ts +0 -557
- package/src/runtimeConfig.browser.ts +0 -41
- package/src/runtimeConfig.native.ts +0 -17
- package/src/runtimeConfig.shared.ts +0 -17
- package/src/runtimeConfig.ts +0 -46
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -33
- package/tsconfig.types.json +0 -9
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
2
|
-
import {
|
|
3
|
-
expectNonNull as __expectNonNull,
|
|
4
|
-
expectNumber as __expectNumber,
|
|
5
|
-
expectObject as __expectObject,
|
|
6
|
-
expectString as __expectString,
|
|
7
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
8
|
-
parseEpochTimestamp as __parseEpochTimestamp,
|
|
9
|
-
} from "@aws-sdk/smithy-client";
|
|
10
|
-
import {
|
|
11
|
-
Endpoint as __Endpoint,
|
|
12
|
-
MetadataBearer as __MetadataBearer,
|
|
13
|
-
ResponseMetadata as __ResponseMetadata,
|
|
14
|
-
SerdeContext as __SerdeContext,
|
|
15
|
-
SmithyException as __SmithyException,
|
|
16
|
-
} from "@aws-sdk/types";
|
|
17
|
-
|
|
18
|
-
import { CreateEndpointCommandInput, CreateEndpointCommandOutput } from "../commands/CreateEndpointCommand";
|
|
19
|
-
import { DeleteEndpointCommandInput, DeleteEndpointCommandOutput } from "../commands/DeleteEndpointCommand";
|
|
20
|
-
import { ListEndpointsCommandInput, ListEndpointsCommandOutput } from "../commands/ListEndpointsCommand";
|
|
21
|
-
import {
|
|
22
|
-
AccessDeniedException,
|
|
23
|
-
ConflictException,
|
|
24
|
-
Endpoint,
|
|
25
|
-
InternalServerException,
|
|
26
|
-
NetworkInterface,
|
|
27
|
-
ResourceNotFoundException,
|
|
28
|
-
ValidationException,
|
|
29
|
-
} from "../models/models_0";
|
|
30
|
-
|
|
31
|
-
export const serializeAws_restJson1CreateEndpointCommand = async (
|
|
32
|
-
input: CreateEndpointCommandInput,
|
|
33
|
-
context: __SerdeContext
|
|
34
|
-
): Promise<__HttpRequest> => {
|
|
35
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
36
|
-
const headers: any = {
|
|
37
|
-
"content-type": "application/json",
|
|
38
|
-
};
|
|
39
|
-
const resolvedPath =
|
|
40
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/CreateEndpoint";
|
|
41
|
-
let body: any;
|
|
42
|
-
body = JSON.stringify({
|
|
43
|
-
...(input.AccessType !== undefined && input.AccessType !== null && { AccessType: input.AccessType }),
|
|
44
|
-
...(input.CustomerOwnedIpv4Pool !== undefined &&
|
|
45
|
-
input.CustomerOwnedIpv4Pool !== null && { CustomerOwnedIpv4Pool: input.CustomerOwnedIpv4Pool }),
|
|
46
|
-
...(input.OutpostId !== undefined && input.OutpostId !== null && { OutpostId: input.OutpostId }),
|
|
47
|
-
...(input.SecurityGroupId !== undefined &&
|
|
48
|
-
input.SecurityGroupId !== null && { SecurityGroupId: input.SecurityGroupId }),
|
|
49
|
-
...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
|
|
50
|
-
});
|
|
51
|
-
return new __HttpRequest({
|
|
52
|
-
protocol,
|
|
53
|
-
hostname,
|
|
54
|
-
port,
|
|
55
|
-
method: "POST",
|
|
56
|
-
headers,
|
|
57
|
-
path: resolvedPath,
|
|
58
|
-
body,
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const serializeAws_restJson1DeleteEndpointCommand = async (
|
|
63
|
-
input: DeleteEndpointCommandInput,
|
|
64
|
-
context: __SerdeContext
|
|
65
|
-
): Promise<__HttpRequest> => {
|
|
66
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
67
|
-
const headers: any = {};
|
|
68
|
-
const resolvedPath =
|
|
69
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/DeleteEndpoint";
|
|
70
|
-
const query: any = {
|
|
71
|
-
...(input.EndpointId !== undefined && { endpointId: input.EndpointId }),
|
|
72
|
-
...(input.OutpostId !== undefined && { outpostId: input.OutpostId }),
|
|
73
|
-
};
|
|
74
|
-
let body: any;
|
|
75
|
-
return new __HttpRequest({
|
|
76
|
-
protocol,
|
|
77
|
-
hostname,
|
|
78
|
-
port,
|
|
79
|
-
method: "DELETE",
|
|
80
|
-
headers,
|
|
81
|
-
path: resolvedPath,
|
|
82
|
-
query,
|
|
83
|
-
body,
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const serializeAws_restJson1ListEndpointsCommand = async (
|
|
88
|
-
input: ListEndpointsCommandInput,
|
|
89
|
-
context: __SerdeContext
|
|
90
|
-
): Promise<__HttpRequest> => {
|
|
91
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
92
|
-
const headers: any = {};
|
|
93
|
-
const resolvedPath =
|
|
94
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListEndpoints";
|
|
95
|
-
const query: any = {
|
|
96
|
-
...(input.NextToken !== undefined && { nextToken: input.NextToken }),
|
|
97
|
-
...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
|
|
98
|
-
};
|
|
99
|
-
let body: any;
|
|
100
|
-
return new __HttpRequest({
|
|
101
|
-
protocol,
|
|
102
|
-
hostname,
|
|
103
|
-
port,
|
|
104
|
-
method: "GET",
|
|
105
|
-
headers,
|
|
106
|
-
path: resolvedPath,
|
|
107
|
-
query,
|
|
108
|
-
body,
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const deserializeAws_restJson1CreateEndpointCommand = async (
|
|
113
|
-
output: __HttpResponse,
|
|
114
|
-
context: __SerdeContext
|
|
115
|
-
): Promise<CreateEndpointCommandOutput> => {
|
|
116
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
117
|
-
return deserializeAws_restJson1CreateEndpointCommandError(output, context);
|
|
118
|
-
}
|
|
119
|
-
const contents: CreateEndpointCommandOutput = {
|
|
120
|
-
$metadata: deserializeMetadata(output),
|
|
121
|
-
EndpointArn: undefined,
|
|
122
|
-
};
|
|
123
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
124
|
-
if (data.EndpointArn !== undefined && data.EndpointArn !== null) {
|
|
125
|
-
contents.EndpointArn = __expectString(data.EndpointArn);
|
|
126
|
-
}
|
|
127
|
-
return Promise.resolve(contents);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const deserializeAws_restJson1CreateEndpointCommandError = async (
|
|
131
|
-
output: __HttpResponse,
|
|
132
|
-
context: __SerdeContext
|
|
133
|
-
): Promise<CreateEndpointCommandOutput> => {
|
|
134
|
-
const parsedOutput: any = {
|
|
135
|
-
...output,
|
|
136
|
-
body: await parseBody(output.body, context),
|
|
137
|
-
};
|
|
138
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
139
|
-
let errorCode = "UnknownError";
|
|
140
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
141
|
-
switch (errorCode) {
|
|
142
|
-
case "AccessDeniedException":
|
|
143
|
-
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
144
|
-
response = {
|
|
145
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
146
|
-
name: errorCode,
|
|
147
|
-
$metadata: deserializeMetadata(output),
|
|
148
|
-
};
|
|
149
|
-
break;
|
|
150
|
-
case "ConflictException":
|
|
151
|
-
case "com.amazonaws.s3outposts#ConflictException":
|
|
152
|
-
response = {
|
|
153
|
-
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
154
|
-
name: errorCode,
|
|
155
|
-
$metadata: deserializeMetadata(output),
|
|
156
|
-
};
|
|
157
|
-
break;
|
|
158
|
-
case "InternalServerException":
|
|
159
|
-
case "com.amazonaws.s3outposts#InternalServerException":
|
|
160
|
-
response = {
|
|
161
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
162
|
-
name: errorCode,
|
|
163
|
-
$metadata: deserializeMetadata(output),
|
|
164
|
-
};
|
|
165
|
-
break;
|
|
166
|
-
case "ResourceNotFoundException":
|
|
167
|
-
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
168
|
-
response = {
|
|
169
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
170
|
-
name: errorCode,
|
|
171
|
-
$metadata: deserializeMetadata(output),
|
|
172
|
-
};
|
|
173
|
-
break;
|
|
174
|
-
case "ValidationException":
|
|
175
|
-
case "com.amazonaws.s3outposts#ValidationException":
|
|
176
|
-
response = {
|
|
177
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
178
|
-
name: errorCode,
|
|
179
|
-
$metadata: deserializeMetadata(output),
|
|
180
|
-
};
|
|
181
|
-
break;
|
|
182
|
-
default:
|
|
183
|
-
const parsedBody = parsedOutput.body;
|
|
184
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
185
|
-
response = {
|
|
186
|
-
...parsedBody,
|
|
187
|
-
name: `${errorCode}`,
|
|
188
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
189
|
-
$fault: "client",
|
|
190
|
-
$metadata: deserializeMetadata(output),
|
|
191
|
-
} as any;
|
|
192
|
-
}
|
|
193
|
-
const message = response.message || response.Message || errorCode;
|
|
194
|
-
response.message = message;
|
|
195
|
-
delete response.Message;
|
|
196
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export const deserializeAws_restJson1DeleteEndpointCommand = async (
|
|
200
|
-
output: __HttpResponse,
|
|
201
|
-
context: __SerdeContext
|
|
202
|
-
): Promise<DeleteEndpointCommandOutput> => {
|
|
203
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
204
|
-
return deserializeAws_restJson1DeleteEndpointCommandError(output, context);
|
|
205
|
-
}
|
|
206
|
-
const contents: DeleteEndpointCommandOutput = {
|
|
207
|
-
$metadata: deserializeMetadata(output),
|
|
208
|
-
};
|
|
209
|
-
await collectBody(output.body, context);
|
|
210
|
-
return Promise.resolve(contents);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const deserializeAws_restJson1DeleteEndpointCommandError = async (
|
|
214
|
-
output: __HttpResponse,
|
|
215
|
-
context: __SerdeContext
|
|
216
|
-
): Promise<DeleteEndpointCommandOutput> => {
|
|
217
|
-
const parsedOutput: any = {
|
|
218
|
-
...output,
|
|
219
|
-
body: await parseBody(output.body, context),
|
|
220
|
-
};
|
|
221
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
222
|
-
let errorCode = "UnknownError";
|
|
223
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
224
|
-
switch (errorCode) {
|
|
225
|
-
case "AccessDeniedException":
|
|
226
|
-
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
227
|
-
response = {
|
|
228
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
229
|
-
name: errorCode,
|
|
230
|
-
$metadata: deserializeMetadata(output),
|
|
231
|
-
};
|
|
232
|
-
break;
|
|
233
|
-
case "InternalServerException":
|
|
234
|
-
case "com.amazonaws.s3outposts#InternalServerException":
|
|
235
|
-
response = {
|
|
236
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
237
|
-
name: errorCode,
|
|
238
|
-
$metadata: deserializeMetadata(output),
|
|
239
|
-
};
|
|
240
|
-
break;
|
|
241
|
-
case "ResourceNotFoundException":
|
|
242
|
-
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
243
|
-
response = {
|
|
244
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
245
|
-
name: errorCode,
|
|
246
|
-
$metadata: deserializeMetadata(output),
|
|
247
|
-
};
|
|
248
|
-
break;
|
|
249
|
-
case "ValidationException":
|
|
250
|
-
case "com.amazonaws.s3outposts#ValidationException":
|
|
251
|
-
response = {
|
|
252
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
253
|
-
name: errorCode,
|
|
254
|
-
$metadata: deserializeMetadata(output),
|
|
255
|
-
};
|
|
256
|
-
break;
|
|
257
|
-
default:
|
|
258
|
-
const parsedBody = parsedOutput.body;
|
|
259
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
260
|
-
response = {
|
|
261
|
-
...parsedBody,
|
|
262
|
-
name: `${errorCode}`,
|
|
263
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
264
|
-
$fault: "client",
|
|
265
|
-
$metadata: deserializeMetadata(output),
|
|
266
|
-
} as any;
|
|
267
|
-
}
|
|
268
|
-
const message = response.message || response.Message || errorCode;
|
|
269
|
-
response.message = message;
|
|
270
|
-
delete response.Message;
|
|
271
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
export const deserializeAws_restJson1ListEndpointsCommand = async (
|
|
275
|
-
output: __HttpResponse,
|
|
276
|
-
context: __SerdeContext
|
|
277
|
-
): Promise<ListEndpointsCommandOutput> => {
|
|
278
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
279
|
-
return deserializeAws_restJson1ListEndpointsCommandError(output, context);
|
|
280
|
-
}
|
|
281
|
-
const contents: ListEndpointsCommandOutput = {
|
|
282
|
-
$metadata: deserializeMetadata(output),
|
|
283
|
-
Endpoints: undefined,
|
|
284
|
-
NextToken: undefined,
|
|
285
|
-
};
|
|
286
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
287
|
-
if (data.Endpoints !== undefined && data.Endpoints !== null) {
|
|
288
|
-
contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
|
|
289
|
-
}
|
|
290
|
-
if (data.NextToken !== undefined && data.NextToken !== null) {
|
|
291
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
292
|
-
}
|
|
293
|
-
return Promise.resolve(contents);
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const deserializeAws_restJson1ListEndpointsCommandError = async (
|
|
297
|
-
output: __HttpResponse,
|
|
298
|
-
context: __SerdeContext
|
|
299
|
-
): Promise<ListEndpointsCommandOutput> => {
|
|
300
|
-
const parsedOutput: any = {
|
|
301
|
-
...output,
|
|
302
|
-
body: await parseBody(output.body, context),
|
|
303
|
-
};
|
|
304
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
305
|
-
let errorCode = "UnknownError";
|
|
306
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
307
|
-
switch (errorCode) {
|
|
308
|
-
case "AccessDeniedException":
|
|
309
|
-
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
310
|
-
response = {
|
|
311
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
312
|
-
name: errorCode,
|
|
313
|
-
$metadata: deserializeMetadata(output),
|
|
314
|
-
};
|
|
315
|
-
break;
|
|
316
|
-
case "InternalServerException":
|
|
317
|
-
case "com.amazonaws.s3outposts#InternalServerException":
|
|
318
|
-
response = {
|
|
319
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
320
|
-
name: errorCode,
|
|
321
|
-
$metadata: deserializeMetadata(output),
|
|
322
|
-
};
|
|
323
|
-
break;
|
|
324
|
-
case "ResourceNotFoundException":
|
|
325
|
-
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
326
|
-
response = {
|
|
327
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
328
|
-
name: errorCode,
|
|
329
|
-
$metadata: deserializeMetadata(output),
|
|
330
|
-
};
|
|
331
|
-
break;
|
|
332
|
-
case "ValidationException":
|
|
333
|
-
case "com.amazonaws.s3outposts#ValidationException":
|
|
334
|
-
response = {
|
|
335
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
336
|
-
name: errorCode,
|
|
337
|
-
$metadata: deserializeMetadata(output),
|
|
338
|
-
};
|
|
339
|
-
break;
|
|
340
|
-
default:
|
|
341
|
-
const parsedBody = parsedOutput.body;
|
|
342
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
343
|
-
response = {
|
|
344
|
-
...parsedBody,
|
|
345
|
-
name: `${errorCode}`,
|
|
346
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
347
|
-
$fault: "client",
|
|
348
|
-
$metadata: deserializeMetadata(output),
|
|
349
|
-
} as any;
|
|
350
|
-
}
|
|
351
|
-
const message = response.message || response.Message || errorCode;
|
|
352
|
-
response.message = message;
|
|
353
|
-
delete response.Message;
|
|
354
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
|
|
358
|
-
parsedOutput: any,
|
|
359
|
-
context: __SerdeContext
|
|
360
|
-
): Promise<AccessDeniedException> => {
|
|
361
|
-
const contents: AccessDeniedException = {
|
|
362
|
-
name: "AccessDeniedException",
|
|
363
|
-
$fault: "client",
|
|
364
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
365
|
-
Message: undefined,
|
|
366
|
-
};
|
|
367
|
-
const data: any = parsedOutput.body;
|
|
368
|
-
if (data.Message !== undefined && data.Message !== null) {
|
|
369
|
-
contents.Message = __expectString(data.Message);
|
|
370
|
-
}
|
|
371
|
-
return contents;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
const deserializeAws_restJson1ConflictExceptionResponse = async (
|
|
375
|
-
parsedOutput: any,
|
|
376
|
-
context: __SerdeContext
|
|
377
|
-
): Promise<ConflictException> => {
|
|
378
|
-
const contents: ConflictException = {
|
|
379
|
-
name: "ConflictException",
|
|
380
|
-
$fault: "client",
|
|
381
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
382
|
-
Message: undefined,
|
|
383
|
-
};
|
|
384
|
-
const data: any = parsedOutput.body;
|
|
385
|
-
if (data.Message !== undefined && data.Message !== null) {
|
|
386
|
-
contents.Message = __expectString(data.Message);
|
|
387
|
-
}
|
|
388
|
-
return contents;
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
const deserializeAws_restJson1InternalServerExceptionResponse = async (
|
|
392
|
-
parsedOutput: any,
|
|
393
|
-
context: __SerdeContext
|
|
394
|
-
): Promise<InternalServerException> => {
|
|
395
|
-
const contents: InternalServerException = {
|
|
396
|
-
name: "InternalServerException",
|
|
397
|
-
$fault: "server",
|
|
398
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
399
|
-
Message: undefined,
|
|
400
|
-
};
|
|
401
|
-
const data: any = parsedOutput.body;
|
|
402
|
-
if (data.Message !== undefined && data.Message !== null) {
|
|
403
|
-
contents.Message = __expectString(data.Message);
|
|
404
|
-
}
|
|
405
|
-
return contents;
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
409
|
-
parsedOutput: any,
|
|
410
|
-
context: __SerdeContext
|
|
411
|
-
): Promise<ResourceNotFoundException> => {
|
|
412
|
-
const contents: ResourceNotFoundException = {
|
|
413
|
-
name: "ResourceNotFoundException",
|
|
414
|
-
$fault: "client",
|
|
415
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
416
|
-
Message: undefined,
|
|
417
|
-
};
|
|
418
|
-
const data: any = parsedOutput.body;
|
|
419
|
-
if (data.Message !== undefined && data.Message !== null) {
|
|
420
|
-
contents.Message = __expectString(data.Message);
|
|
421
|
-
}
|
|
422
|
-
return contents;
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
const deserializeAws_restJson1ValidationExceptionResponse = async (
|
|
426
|
-
parsedOutput: any,
|
|
427
|
-
context: __SerdeContext
|
|
428
|
-
): Promise<ValidationException> => {
|
|
429
|
-
const contents: ValidationException = {
|
|
430
|
-
name: "ValidationException",
|
|
431
|
-
$fault: "client",
|
|
432
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
433
|
-
Message: undefined,
|
|
434
|
-
};
|
|
435
|
-
const data: any = parsedOutput.body;
|
|
436
|
-
if (data.Message !== undefined && data.Message !== null) {
|
|
437
|
-
contents.Message = __expectString(data.Message);
|
|
438
|
-
}
|
|
439
|
-
return contents;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext): Endpoint => {
|
|
443
|
-
return {
|
|
444
|
-
AccessType: __expectString(output.AccessType),
|
|
445
|
-
CidrBlock: __expectString(output.CidrBlock),
|
|
446
|
-
CreationTime:
|
|
447
|
-
output.CreationTime !== undefined && output.CreationTime !== null
|
|
448
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
|
|
449
|
-
: undefined,
|
|
450
|
-
CustomerOwnedIpv4Pool: __expectString(output.CustomerOwnedIpv4Pool),
|
|
451
|
-
EndpointArn: __expectString(output.EndpointArn),
|
|
452
|
-
NetworkInterfaces:
|
|
453
|
-
output.NetworkInterfaces !== undefined && output.NetworkInterfaces !== null
|
|
454
|
-
? deserializeAws_restJson1NetworkInterfaces(output.NetworkInterfaces, context)
|
|
455
|
-
: undefined,
|
|
456
|
-
OutpostsId: __expectString(output.OutpostsId),
|
|
457
|
-
SecurityGroupId: __expectString(output.SecurityGroupId),
|
|
458
|
-
Status: __expectString(output.Status),
|
|
459
|
-
SubnetId: __expectString(output.SubnetId),
|
|
460
|
-
VpcId: __expectString(output.VpcId),
|
|
461
|
-
} as any;
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext): Endpoint[] => {
|
|
465
|
-
return (output || [])
|
|
466
|
-
.filter((e: any) => e != null)
|
|
467
|
-
.map((entry: any) => {
|
|
468
|
-
if (entry === null) {
|
|
469
|
-
return null as any;
|
|
470
|
-
}
|
|
471
|
-
return deserializeAws_restJson1Endpoint(entry, context);
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => {
|
|
476
|
-
return {
|
|
477
|
-
NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
|
|
478
|
-
} as any;
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
const deserializeAws_restJson1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => {
|
|
482
|
-
return (output || [])
|
|
483
|
-
.filter((e: any) => e != null)
|
|
484
|
-
.map((entry: any) => {
|
|
485
|
-
if (entry === null) {
|
|
486
|
-
return null as any;
|
|
487
|
-
}
|
|
488
|
-
return deserializeAws_restJson1NetworkInterface(entry, context);
|
|
489
|
-
});
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
493
|
-
httpStatusCode: output.statusCode,
|
|
494
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
495
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
496
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
// Collect low-level response body stream to Uint8Array.
|
|
500
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
501
|
-
if (streamBody instanceof Uint8Array) {
|
|
502
|
-
return Promise.resolve(streamBody);
|
|
503
|
-
}
|
|
504
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
// Encode Uint8Array data into string with utf-8.
|
|
508
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
509
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
510
|
-
|
|
511
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
512
|
-
value !== undefined &&
|
|
513
|
-
value !== null &&
|
|
514
|
-
value !== "" &&
|
|
515
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
516
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
517
|
-
|
|
518
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
519
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
520
|
-
if (encoded.length) {
|
|
521
|
-
return JSON.parse(encoded);
|
|
522
|
-
}
|
|
523
|
-
return {};
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
528
|
-
*/
|
|
529
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
530
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
531
|
-
|
|
532
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
533
|
-
let cleanValue = rawValue;
|
|
534
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
535
|
-
cleanValue = cleanValue.split(":")[0];
|
|
536
|
-
}
|
|
537
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
538
|
-
cleanValue = cleanValue.split("#")[1];
|
|
539
|
-
}
|
|
540
|
-
return cleanValue;
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
544
|
-
if (headerKey !== undefined) {
|
|
545
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
if (data.code !== undefined) {
|
|
549
|
-
return sanitizeErrorCode(data.code);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
if (data["__type"] !== undefined) {
|
|
553
|
-
return sanitizeErrorCode(data["__type"]);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
return "";
|
|
557
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
2
|
-
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
3
|
-
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
4
|
-
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
|
|
5
|
-
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
|
|
6
|
-
import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
|
|
7
|
-
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
8
|
-
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
9
|
-
|
|
10
|
-
// @ts-ignore: package.json will be imported from dist folders
|
|
11
|
-
import packageInfo from "../package.json";
|
|
12
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
-
import { S3OutpostsClientConfig } from "./S3OutpostsClient";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
|
|
19
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
|
-
return {
|
|
21
|
-
...clientSharedValues,
|
|
22
|
-
...config,
|
|
23
|
-
runtime: "browser",
|
|
24
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
25
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
26
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
27
|
-
credentialDefaultProvider:
|
|
28
|
-
config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
|
|
29
|
-
defaultUserAgentProvider:
|
|
30
|
-
config?.defaultUserAgentProvider ??
|
|
31
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
33
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
34
|
-
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
|
|
35
|
-
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
|
|
36
|
-
sha256: config?.sha256 ?? Sha256,
|
|
37
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
38
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
39
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
-
|
|
3
|
-
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
4
|
-
import { S3OutpostsClientConfig } from "./S3OutpostsClient";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
|
|
10
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
11
|
-
return {
|
|
12
|
-
...browserDefaults,
|
|
13
|
-
...config,
|
|
14
|
-
runtime: "react-native",
|
|
15
|
-
sha256: config?.sha256 ?? Sha256,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Logger as __Logger } from "@aws-sdk/types";
|
|
2
|
-
import { parseUrl } from "@aws-sdk/url-parser";
|
|
3
|
-
|
|
4
|
-
import { defaultRegionInfoProvider } from "./endpoints";
|
|
5
|
-
import { S3OutpostsClientConfig } from "./S3OutpostsClient";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export const getRuntimeConfig = (config: S3OutpostsClientConfig) => ({
|
|
11
|
-
apiVersion: "2017-07-25",
|
|
12
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
13
|
-
logger: config?.logger ?? ({} as __Logger),
|
|
14
|
-
regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
|
|
15
|
-
serviceId: config?.serviceId ?? "S3Outposts",
|
|
16
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
17
|
-
});
|
package/src/runtimeConfig.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
2
|
-
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
|
|
3
|
-
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
-
import { Hash } from "@aws-sdk/hash-node";
|
|
5
|
-
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
|
|
6
|
-
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
|
|
7
|
-
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
|
|
8
|
-
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
9
|
-
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
|
|
10
|
-
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
|
|
11
|
-
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
12
|
-
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
|
|
13
|
-
|
|
14
|
-
// @ts-ignore: package.json will be imported from dist folders
|
|
15
|
-
import packageInfo from "../package.json";
|
|
16
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
17
|
-
import { S3OutpostsClientConfig } from "./S3OutpostsClient";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
|
|
23
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
24
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
25
|
-
return {
|
|
26
|
-
...clientSharedValues,
|
|
27
|
-
...config,
|
|
28
|
-
runtime: "node",
|
|
29
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
30
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
31
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
32
|
-
credentialDefaultProvider:
|
|
33
|
-
config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
34
|
-
defaultUserAgentProvider:
|
|
35
|
-
config?.defaultUserAgentProvider ??
|
|
36
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
37
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
38
|
-
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
39
|
-
requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
|
|
40
|
-
retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
|
|
41
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
42
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
43
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
44
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
45
|
-
};
|
|
46
|
-
};
|
package/tsconfig.es.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"],
|
|
8
|
-
"outDir": "dist-es"
|
|
9
|
-
}
|
|
10
|
-
}
|