@aws-sdk/client-finspace-data 3.34.0 → 3.37.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 → dist-cjs}/FinspaceData.js +1 -5
- package/{dist/cjs → dist-cjs}/FinspaceDataClient.js +8 -17
- package/{dist/cjs → dist-cjs}/commands/CreateChangesetCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/GetProgrammaticAccessCredentialsCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/GetWorkingLocationCommand.js +2 -28
- package/{dist/cjs → dist-cjs}/endpoints.js +1 -2
- package/{dist/cjs → dist-cjs}/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/models_0.js +0 -43
- package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +2 -8
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
- package/{dist/es → dist-es}/FinspaceData.js +1 -2
- package/{dist/es → dist-es}/FinspaceDataClient.js +1 -2
- package/{dist/es → dist-es}/commands/CreateChangesetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/GetProgrammaticAccessCredentialsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/GetWorkingLocationCommand.js +2 -3
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/{dist/es → dist-es}/models/models_0.js +0 -1
- package/{dist/es → dist-es}/protocols/Aws_restJson1.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -2
- package/{dist/types → dist-types}/FinspaceData.d.ts +2 -2
- package/{dist/types → dist-types}/FinspaceDataClient.d.ts +4 -4
- package/{dist/types → dist-types}/commands/CreateChangesetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetProgrammaticAccessCredentialsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetWorkingLocationCommand.d.ts +2 -2
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/{index.ts → dist-types/index.d.ts} +0 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/FinspaceData.d.ts +6 -15
- package/{dist/types → dist-types}/ts3.4/FinspaceDataClient.d.ts +28 -93
- package/dist-types/ts3.4/commands/CreateChangesetCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/commands/GetProgrammaticAccessCredentialsCommand.d.ts +4 -22
- package/dist-types/ts3.4/commands/GetWorkingLocationCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/dist-types/ts3.4/models/models_0.d.ts +224 -0
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +45 -42
- package/FinspaceData.ts +0 -119
- package/FinspaceDataClient.ts +0 -247
- package/commands/CreateChangesetCommand.ts +0 -94
- package/commands/GetProgrammaticAccessCredentialsCommand.ts +0 -102
- package/commands/GetWorkingLocationCommand.ts +0 -95
- package/dist/cjs/FinspaceData.js.map +0 -1
- package/dist/cjs/FinspaceDataClient.js.map +0 -1
- package/dist/cjs/commands/CreateChangesetCommand.js.map +0 -1
- package/dist/cjs/commands/GetProgrammaticAccessCredentialsCommand.js.map +0 -1
- package/dist/cjs/commands/GetWorkingLocationCommand.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/package.json +0 -91
- 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/FinspaceData.js.map +0 -1
- package/dist/es/FinspaceDataClient.js.map +0 -1
- package/dist/es/commands/CreateChangesetCommand.js.map +0 -1
- package/dist/es/commands/GetProgrammaticAccessCredentialsCommand.js.map +0 -1
- package/dist/es/commands/GetWorkingLocationCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -7
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -91
- 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/dist/types/ts3.4/commands/CreateChangesetCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/GetWorkingLocationCommand.d.ts +0 -36
- package/dist/types/ts3.4/models/models_0.d.ts +0 -429
- package/endpoints.ts +0 -57
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -505
- package/protocols/Aws_restJson1.ts +0 -594
- package/runtimeConfig.browser.ts +0 -40
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -45
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -31
- package/tsconfig.types.json +0 -8
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
import { CreateChangesetCommandInput, CreateChangesetCommandOutput } from "../commands/CreateChangesetCommand";
|
|
2
|
-
import {
|
|
3
|
-
GetProgrammaticAccessCredentialsCommandInput,
|
|
4
|
-
GetProgrammaticAccessCredentialsCommandOutput,
|
|
5
|
-
} from "../commands/GetProgrammaticAccessCredentialsCommand";
|
|
6
|
-
import { GetWorkingLocationCommandInput, GetWorkingLocationCommandOutput } from "../commands/GetWorkingLocationCommand";
|
|
7
|
-
import {
|
|
8
|
-
AccessDeniedException,
|
|
9
|
-
ChangesetInfo,
|
|
10
|
-
Credentials,
|
|
11
|
-
ErrorInfo,
|
|
12
|
-
InternalServerException,
|
|
13
|
-
ResourceNotFoundException,
|
|
14
|
-
ThrottlingException,
|
|
15
|
-
ValidationException,
|
|
16
|
-
} from "../models/models_0";
|
|
17
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
18
|
-
import {
|
|
19
|
-
expectLong as __expectLong,
|
|
20
|
-
expectNonNull as __expectNonNull,
|
|
21
|
-
expectNumber as __expectNumber,
|
|
22
|
-
expectObject as __expectObject,
|
|
23
|
-
expectString as __expectString,
|
|
24
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
25
|
-
parseEpochTimestamp as __parseEpochTimestamp,
|
|
26
|
-
} from "@aws-sdk/smithy-client";
|
|
27
|
-
import {
|
|
28
|
-
Endpoint as __Endpoint,
|
|
29
|
-
MetadataBearer as __MetadataBearer,
|
|
30
|
-
ResponseMetadata as __ResponseMetadata,
|
|
31
|
-
SerdeContext as __SerdeContext,
|
|
32
|
-
SmithyException as __SmithyException,
|
|
33
|
-
} from "@aws-sdk/types";
|
|
34
|
-
|
|
35
|
-
export const serializeAws_restJson1CreateChangesetCommand = async (
|
|
36
|
-
input: CreateChangesetCommandInput,
|
|
37
|
-
context: __SerdeContext
|
|
38
|
-
): Promise<__HttpRequest> => {
|
|
39
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
40
|
-
const headers: any = {
|
|
41
|
-
"content-type": "application/json",
|
|
42
|
-
};
|
|
43
|
-
let resolvedPath =
|
|
44
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{datasetId}/changesets";
|
|
45
|
-
if (input.datasetId !== undefined) {
|
|
46
|
-
const labelValue: string = input.datasetId;
|
|
47
|
-
if (labelValue.length <= 0) {
|
|
48
|
-
throw new Error("Empty value provided for input HTTP label: datasetId.");
|
|
49
|
-
}
|
|
50
|
-
resolvedPath = resolvedPath.replace("{datasetId}", __extendedEncodeURIComponent(labelValue));
|
|
51
|
-
} else {
|
|
52
|
-
throw new Error("No value provided for input HTTP label: datasetId.");
|
|
53
|
-
}
|
|
54
|
-
let body: any;
|
|
55
|
-
body = JSON.stringify({
|
|
56
|
-
...(input.changeType !== undefined && input.changeType !== null && { changeType: input.changeType }),
|
|
57
|
-
...(input.formatParams !== undefined &&
|
|
58
|
-
input.formatParams !== null && { formatParams: serializeAws_restJson1stringMap(input.formatParams, context) }),
|
|
59
|
-
...(input.formatType !== undefined && input.formatType !== null && { formatType: input.formatType }),
|
|
60
|
-
...(input.sourceParams !== undefined &&
|
|
61
|
-
input.sourceParams !== null && { sourceParams: serializeAws_restJson1stringMap(input.sourceParams, context) }),
|
|
62
|
-
...(input.sourceType !== undefined && input.sourceType !== null && { sourceType: input.sourceType }),
|
|
63
|
-
...(input.tags !== undefined &&
|
|
64
|
-
input.tags !== null && { tags: serializeAws_restJson1stringMap(input.tags, context) }),
|
|
65
|
-
});
|
|
66
|
-
return new __HttpRequest({
|
|
67
|
-
protocol,
|
|
68
|
-
hostname,
|
|
69
|
-
port,
|
|
70
|
-
method: "POST",
|
|
71
|
-
headers,
|
|
72
|
-
path: resolvedPath,
|
|
73
|
-
body,
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (
|
|
78
|
-
input: GetProgrammaticAccessCredentialsCommandInput,
|
|
79
|
-
context: __SerdeContext
|
|
80
|
-
): Promise<__HttpRequest> => {
|
|
81
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
82
|
-
const headers: any = {};
|
|
83
|
-
let resolvedPath =
|
|
84
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/credentials/programmatic";
|
|
85
|
-
const query: any = {
|
|
86
|
-
...(input.durationInMinutes !== undefined && { durationInMinutes: input.durationInMinutes.toString() }),
|
|
87
|
-
...(input.environmentId !== undefined && { environmentId: input.environmentId }),
|
|
88
|
-
};
|
|
89
|
-
let body: any;
|
|
90
|
-
return new __HttpRequest({
|
|
91
|
-
protocol,
|
|
92
|
-
hostname,
|
|
93
|
-
port,
|
|
94
|
-
method: "GET",
|
|
95
|
-
headers,
|
|
96
|
-
path: resolvedPath,
|
|
97
|
-
query,
|
|
98
|
-
body,
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const serializeAws_restJson1GetWorkingLocationCommand = async (
|
|
103
|
-
input: GetWorkingLocationCommandInput,
|
|
104
|
-
context: __SerdeContext
|
|
105
|
-
): Promise<__HttpRequest> => {
|
|
106
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
107
|
-
const headers: any = {
|
|
108
|
-
"content-type": "application/json",
|
|
109
|
-
};
|
|
110
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workingLocationV1";
|
|
111
|
-
let body: any;
|
|
112
|
-
body = JSON.stringify({
|
|
113
|
-
...(input.locationType !== undefined && input.locationType !== null && { locationType: input.locationType }),
|
|
114
|
-
});
|
|
115
|
-
return new __HttpRequest({
|
|
116
|
-
protocol,
|
|
117
|
-
hostname,
|
|
118
|
-
port,
|
|
119
|
-
method: "POST",
|
|
120
|
-
headers,
|
|
121
|
-
path: resolvedPath,
|
|
122
|
-
body,
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const deserializeAws_restJson1CreateChangesetCommand = async (
|
|
127
|
-
output: __HttpResponse,
|
|
128
|
-
context: __SerdeContext
|
|
129
|
-
): Promise<CreateChangesetCommandOutput> => {
|
|
130
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
131
|
-
return deserializeAws_restJson1CreateChangesetCommandError(output, context);
|
|
132
|
-
}
|
|
133
|
-
const contents: CreateChangesetCommandOutput = {
|
|
134
|
-
$metadata: deserializeMetadata(output),
|
|
135
|
-
changeset: undefined,
|
|
136
|
-
};
|
|
137
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
138
|
-
if (data.changeset !== undefined && data.changeset !== null) {
|
|
139
|
-
contents.changeset = deserializeAws_restJson1ChangesetInfo(data.changeset, context);
|
|
140
|
-
}
|
|
141
|
-
return Promise.resolve(contents);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const deserializeAws_restJson1CreateChangesetCommandError = async (
|
|
145
|
-
output: __HttpResponse,
|
|
146
|
-
context: __SerdeContext
|
|
147
|
-
): Promise<CreateChangesetCommandOutput> => {
|
|
148
|
-
const parsedOutput: any = {
|
|
149
|
-
...output,
|
|
150
|
-
body: await parseBody(output.body, context),
|
|
151
|
-
};
|
|
152
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
153
|
-
let errorCode: string = "UnknownError";
|
|
154
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
155
|
-
switch (errorCode) {
|
|
156
|
-
case "AccessDeniedException":
|
|
157
|
-
case "com.amazonaws.finspacedata#AccessDeniedException":
|
|
158
|
-
response = {
|
|
159
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
160
|
-
name: errorCode,
|
|
161
|
-
$metadata: deserializeMetadata(output),
|
|
162
|
-
};
|
|
163
|
-
break;
|
|
164
|
-
case "InternalServerException":
|
|
165
|
-
case "com.amazonaws.finspacedata#InternalServerException":
|
|
166
|
-
response = {
|
|
167
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
168
|
-
name: errorCode,
|
|
169
|
-
$metadata: deserializeMetadata(output),
|
|
170
|
-
};
|
|
171
|
-
break;
|
|
172
|
-
case "ResourceNotFoundException":
|
|
173
|
-
case "com.amazonaws.finspacedata#ResourceNotFoundException":
|
|
174
|
-
response = {
|
|
175
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
176
|
-
name: errorCode,
|
|
177
|
-
$metadata: deserializeMetadata(output),
|
|
178
|
-
};
|
|
179
|
-
break;
|
|
180
|
-
case "ThrottlingException":
|
|
181
|
-
case "com.amazonaws.finspacedata#ThrottlingException":
|
|
182
|
-
response = {
|
|
183
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
184
|
-
name: errorCode,
|
|
185
|
-
$metadata: deserializeMetadata(output),
|
|
186
|
-
};
|
|
187
|
-
break;
|
|
188
|
-
case "ValidationException":
|
|
189
|
-
case "com.amazonaws.finspacedata#ValidationException":
|
|
190
|
-
response = {
|
|
191
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
192
|
-
name: errorCode,
|
|
193
|
-
$metadata: deserializeMetadata(output),
|
|
194
|
-
};
|
|
195
|
-
break;
|
|
196
|
-
default:
|
|
197
|
-
const parsedBody = parsedOutput.body;
|
|
198
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
199
|
-
response = {
|
|
200
|
-
...parsedBody,
|
|
201
|
-
name: `${errorCode}`,
|
|
202
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
203
|
-
$fault: "client",
|
|
204
|
-
$metadata: deserializeMetadata(output),
|
|
205
|
-
} as any;
|
|
206
|
-
}
|
|
207
|
-
const message = response.message || response.Message || errorCode;
|
|
208
|
-
response.message = message;
|
|
209
|
-
delete response.Message;
|
|
210
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
export const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (
|
|
214
|
-
output: __HttpResponse,
|
|
215
|
-
context: __SerdeContext
|
|
216
|
-
): Promise<GetProgrammaticAccessCredentialsCommandOutput> => {
|
|
217
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
218
|
-
return deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError(output, context);
|
|
219
|
-
}
|
|
220
|
-
const contents: GetProgrammaticAccessCredentialsCommandOutput = {
|
|
221
|
-
$metadata: deserializeMetadata(output),
|
|
222
|
-
credentials: undefined,
|
|
223
|
-
durationInMinutes: undefined,
|
|
224
|
-
};
|
|
225
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
226
|
-
if (data.credentials !== undefined && data.credentials !== null) {
|
|
227
|
-
contents.credentials = deserializeAws_restJson1Credentials(data.credentials, context);
|
|
228
|
-
}
|
|
229
|
-
if (data.durationInMinutes !== undefined && data.durationInMinutes !== null) {
|
|
230
|
-
contents.durationInMinutes = __expectLong(data.durationInMinutes);
|
|
231
|
-
}
|
|
232
|
-
return Promise.resolve(contents);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = async (
|
|
236
|
-
output: __HttpResponse,
|
|
237
|
-
context: __SerdeContext
|
|
238
|
-
): Promise<GetProgrammaticAccessCredentialsCommandOutput> => {
|
|
239
|
-
const parsedOutput: any = {
|
|
240
|
-
...output,
|
|
241
|
-
body: await parseBody(output.body, context),
|
|
242
|
-
};
|
|
243
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
244
|
-
let errorCode: string = "UnknownError";
|
|
245
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
246
|
-
switch (errorCode) {
|
|
247
|
-
case "AccessDeniedException":
|
|
248
|
-
case "com.amazonaws.finspacedata#AccessDeniedException":
|
|
249
|
-
response = {
|
|
250
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
251
|
-
name: errorCode,
|
|
252
|
-
$metadata: deserializeMetadata(output),
|
|
253
|
-
};
|
|
254
|
-
break;
|
|
255
|
-
case "InternalServerException":
|
|
256
|
-
case "com.amazonaws.finspacedata#InternalServerException":
|
|
257
|
-
response = {
|
|
258
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
259
|
-
name: errorCode,
|
|
260
|
-
$metadata: deserializeMetadata(output),
|
|
261
|
-
};
|
|
262
|
-
break;
|
|
263
|
-
case "ThrottlingException":
|
|
264
|
-
case "com.amazonaws.finspacedata#ThrottlingException":
|
|
265
|
-
response = {
|
|
266
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
267
|
-
name: errorCode,
|
|
268
|
-
$metadata: deserializeMetadata(output),
|
|
269
|
-
};
|
|
270
|
-
break;
|
|
271
|
-
default:
|
|
272
|
-
const parsedBody = parsedOutput.body;
|
|
273
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
274
|
-
response = {
|
|
275
|
-
...parsedBody,
|
|
276
|
-
name: `${errorCode}`,
|
|
277
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
278
|
-
$fault: "client",
|
|
279
|
-
$metadata: deserializeMetadata(output),
|
|
280
|
-
} as any;
|
|
281
|
-
}
|
|
282
|
-
const message = response.message || response.Message || errorCode;
|
|
283
|
-
response.message = message;
|
|
284
|
-
delete response.Message;
|
|
285
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
export const deserializeAws_restJson1GetWorkingLocationCommand = async (
|
|
289
|
-
output: __HttpResponse,
|
|
290
|
-
context: __SerdeContext
|
|
291
|
-
): Promise<GetWorkingLocationCommandOutput> => {
|
|
292
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
293
|
-
return deserializeAws_restJson1GetWorkingLocationCommandError(output, context);
|
|
294
|
-
}
|
|
295
|
-
const contents: GetWorkingLocationCommandOutput = {
|
|
296
|
-
$metadata: deserializeMetadata(output),
|
|
297
|
-
s3Bucket: undefined,
|
|
298
|
-
s3Path: undefined,
|
|
299
|
-
s3Uri: undefined,
|
|
300
|
-
};
|
|
301
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
302
|
-
if (data.s3Bucket !== undefined && data.s3Bucket !== null) {
|
|
303
|
-
contents.s3Bucket = __expectString(data.s3Bucket);
|
|
304
|
-
}
|
|
305
|
-
if (data.s3Path !== undefined && data.s3Path !== null) {
|
|
306
|
-
contents.s3Path = __expectString(data.s3Path);
|
|
307
|
-
}
|
|
308
|
-
if (data.s3Uri !== undefined && data.s3Uri !== null) {
|
|
309
|
-
contents.s3Uri = __expectString(data.s3Uri);
|
|
310
|
-
}
|
|
311
|
-
return Promise.resolve(contents);
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
const deserializeAws_restJson1GetWorkingLocationCommandError = async (
|
|
315
|
-
output: __HttpResponse,
|
|
316
|
-
context: __SerdeContext
|
|
317
|
-
): Promise<GetWorkingLocationCommandOutput> => {
|
|
318
|
-
const parsedOutput: any = {
|
|
319
|
-
...output,
|
|
320
|
-
body: await parseBody(output.body, context),
|
|
321
|
-
};
|
|
322
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
323
|
-
let errorCode: string = "UnknownError";
|
|
324
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
325
|
-
switch (errorCode) {
|
|
326
|
-
case "AccessDeniedException":
|
|
327
|
-
case "com.amazonaws.finspacedata#AccessDeniedException":
|
|
328
|
-
response = {
|
|
329
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
330
|
-
name: errorCode,
|
|
331
|
-
$metadata: deserializeMetadata(output),
|
|
332
|
-
};
|
|
333
|
-
break;
|
|
334
|
-
case "InternalServerException":
|
|
335
|
-
case "com.amazonaws.finspacedata#InternalServerException":
|
|
336
|
-
response = {
|
|
337
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
338
|
-
name: errorCode,
|
|
339
|
-
$metadata: deserializeMetadata(output),
|
|
340
|
-
};
|
|
341
|
-
break;
|
|
342
|
-
case "ThrottlingException":
|
|
343
|
-
case "com.amazonaws.finspacedata#ThrottlingException":
|
|
344
|
-
response = {
|
|
345
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
346
|
-
name: errorCode,
|
|
347
|
-
$metadata: deserializeMetadata(output),
|
|
348
|
-
};
|
|
349
|
-
break;
|
|
350
|
-
case "ValidationException":
|
|
351
|
-
case "com.amazonaws.finspacedata#ValidationException":
|
|
352
|
-
response = {
|
|
353
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
354
|
-
name: errorCode,
|
|
355
|
-
$metadata: deserializeMetadata(output),
|
|
356
|
-
};
|
|
357
|
-
break;
|
|
358
|
-
default:
|
|
359
|
-
const parsedBody = parsedOutput.body;
|
|
360
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
361
|
-
response = {
|
|
362
|
-
...parsedBody,
|
|
363
|
-
name: `${errorCode}`,
|
|
364
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
365
|
-
$fault: "client",
|
|
366
|
-
$metadata: deserializeMetadata(output),
|
|
367
|
-
} as any;
|
|
368
|
-
}
|
|
369
|
-
const message = response.message || response.Message || errorCode;
|
|
370
|
-
response.message = message;
|
|
371
|
-
delete response.Message;
|
|
372
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
|
|
376
|
-
parsedOutput: any,
|
|
377
|
-
context: __SerdeContext
|
|
378
|
-
): Promise<AccessDeniedException> => {
|
|
379
|
-
const contents: AccessDeniedException = {
|
|
380
|
-
name: "AccessDeniedException",
|
|
381
|
-
$fault: "client",
|
|
382
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
383
|
-
message: undefined,
|
|
384
|
-
};
|
|
385
|
-
const data: any = parsedOutput.body;
|
|
386
|
-
if (data.message !== undefined && data.message !== null) {
|
|
387
|
-
contents.message = __expectString(data.message);
|
|
388
|
-
}
|
|
389
|
-
return contents;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
const deserializeAws_restJson1InternalServerExceptionResponse = async (
|
|
393
|
-
parsedOutput: any,
|
|
394
|
-
context: __SerdeContext
|
|
395
|
-
): Promise<InternalServerException> => {
|
|
396
|
-
const contents: InternalServerException = {
|
|
397
|
-
name: "InternalServerException",
|
|
398
|
-
$fault: "server",
|
|
399
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
400
|
-
message: undefined,
|
|
401
|
-
};
|
|
402
|
-
const data: any = parsedOutput.body;
|
|
403
|
-
if (data.message !== undefined && data.message !== null) {
|
|
404
|
-
contents.message = __expectString(data.message);
|
|
405
|
-
}
|
|
406
|
-
return contents;
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
410
|
-
parsedOutput: any,
|
|
411
|
-
context: __SerdeContext
|
|
412
|
-
): Promise<ResourceNotFoundException> => {
|
|
413
|
-
const contents: ResourceNotFoundException = {
|
|
414
|
-
name: "ResourceNotFoundException",
|
|
415
|
-
$fault: "client",
|
|
416
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
417
|
-
message: undefined,
|
|
418
|
-
};
|
|
419
|
-
const data: any = parsedOutput.body;
|
|
420
|
-
if (data.message !== undefined && data.message !== null) {
|
|
421
|
-
contents.message = __expectString(data.message);
|
|
422
|
-
}
|
|
423
|
-
return contents;
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
const deserializeAws_restJson1ThrottlingExceptionResponse = async (
|
|
427
|
-
parsedOutput: any,
|
|
428
|
-
context: __SerdeContext
|
|
429
|
-
): Promise<ThrottlingException> => {
|
|
430
|
-
const contents: ThrottlingException = {
|
|
431
|
-
name: "ThrottlingException",
|
|
432
|
-
$fault: "client",
|
|
433
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
434
|
-
};
|
|
435
|
-
const data: any = parsedOutput.body;
|
|
436
|
-
return contents;
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
const deserializeAws_restJson1ValidationExceptionResponse = async (
|
|
440
|
-
parsedOutput: any,
|
|
441
|
-
context: __SerdeContext
|
|
442
|
-
): Promise<ValidationException> => {
|
|
443
|
-
const contents: ValidationException = {
|
|
444
|
-
name: "ValidationException",
|
|
445
|
-
$fault: "client",
|
|
446
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
447
|
-
message: undefined,
|
|
448
|
-
};
|
|
449
|
-
const data: any = parsedOutput.body;
|
|
450
|
-
if (data.message !== undefined && data.message !== null) {
|
|
451
|
-
contents.message = __expectString(data.message);
|
|
452
|
-
}
|
|
453
|
-
return contents;
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
const serializeAws_restJson1stringMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
|
|
457
|
-
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
|
|
458
|
-
if (value === null) {
|
|
459
|
-
return acc;
|
|
460
|
-
}
|
|
461
|
-
return {
|
|
462
|
-
...acc,
|
|
463
|
-
[key]: value,
|
|
464
|
-
};
|
|
465
|
-
}, {});
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
const deserializeAws_restJson1ChangesetInfo = (output: any, context: __SerdeContext): ChangesetInfo => {
|
|
469
|
-
return {
|
|
470
|
-
changeType: __expectString(output.changeType),
|
|
471
|
-
changesetArn: __expectString(output.changesetArn),
|
|
472
|
-
changesetLabels:
|
|
473
|
-
output.changesetLabels !== undefined && output.changesetLabels !== null
|
|
474
|
-
? deserializeAws_restJson1stringMap(output.changesetLabels, context)
|
|
475
|
-
: undefined,
|
|
476
|
-
createTimestamp:
|
|
477
|
-
output.createTimestamp !== undefined && output.createTimestamp !== null
|
|
478
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createTimestamp)))
|
|
479
|
-
: undefined,
|
|
480
|
-
datasetId: __expectString(output.datasetId),
|
|
481
|
-
errorInfo:
|
|
482
|
-
output.errorInfo !== undefined && output.errorInfo !== null
|
|
483
|
-
? deserializeAws_restJson1ErrorInfo(output.errorInfo, context)
|
|
484
|
-
: undefined,
|
|
485
|
-
formatParams:
|
|
486
|
-
output.formatParams !== undefined && output.formatParams !== null
|
|
487
|
-
? deserializeAws_restJson1stringMap(output.formatParams, context)
|
|
488
|
-
: undefined,
|
|
489
|
-
formatType: __expectString(output.formatType),
|
|
490
|
-
id: __expectString(output.id),
|
|
491
|
-
sourceParams:
|
|
492
|
-
output.sourceParams !== undefined && output.sourceParams !== null
|
|
493
|
-
? deserializeAws_restJson1stringMap(output.sourceParams, context)
|
|
494
|
-
: undefined,
|
|
495
|
-
sourceType: __expectString(output.sourceType),
|
|
496
|
-
status: __expectString(output.status),
|
|
497
|
-
updatedByChangesetId: __expectString(output.updatedByChangesetId),
|
|
498
|
-
updatesChangesetId: __expectString(output.updatesChangesetId),
|
|
499
|
-
} as any;
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
const deserializeAws_restJson1Credentials = (output: any, context: __SerdeContext): Credentials => {
|
|
503
|
-
return {
|
|
504
|
-
accessKeyId: __expectString(output.accessKeyId),
|
|
505
|
-
secretAccessKey: __expectString(output.secretAccessKey),
|
|
506
|
-
sessionToken: __expectString(output.sessionToken),
|
|
507
|
-
} as any;
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
const deserializeAws_restJson1ErrorInfo = (output: any, context: __SerdeContext): ErrorInfo => {
|
|
511
|
-
return {
|
|
512
|
-
errorCategory: __expectString(output.errorCategory),
|
|
513
|
-
errorMessage: __expectString(output.errorMessage),
|
|
514
|
-
} as any;
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
const deserializeAws_restJson1stringMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
|
|
518
|
-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
519
|
-
if (value === null) {
|
|
520
|
-
return acc;
|
|
521
|
-
}
|
|
522
|
-
return {
|
|
523
|
-
...acc,
|
|
524
|
-
[key]: __expectString(value) as any,
|
|
525
|
-
};
|
|
526
|
-
}, {});
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
530
|
-
httpStatusCode: output.statusCode,
|
|
531
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
532
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
533
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
// Collect low-level response body stream to Uint8Array.
|
|
537
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
538
|
-
if (streamBody instanceof Uint8Array) {
|
|
539
|
-
return Promise.resolve(streamBody);
|
|
540
|
-
}
|
|
541
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
542
|
-
};
|
|
543
|
-
|
|
544
|
-
// Encode Uint8Array data into string with utf-8.
|
|
545
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
546
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
547
|
-
|
|
548
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
549
|
-
value !== undefined &&
|
|
550
|
-
value !== null &&
|
|
551
|
-
value !== "" &&
|
|
552
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
553
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
554
|
-
|
|
555
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
556
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
557
|
-
if (encoded.length) {
|
|
558
|
-
return JSON.parse(encoded);
|
|
559
|
-
}
|
|
560
|
-
return {};
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
565
|
-
*/
|
|
566
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
567
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
568
|
-
|
|
569
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
570
|
-
let cleanValue = rawValue;
|
|
571
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
572
|
-
cleanValue = cleanValue.split(":")[0];
|
|
573
|
-
}
|
|
574
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
575
|
-
cleanValue = cleanValue.split("#")[1];
|
|
576
|
-
}
|
|
577
|
-
return cleanValue;
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
581
|
-
if (headerKey !== undefined) {
|
|
582
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
if (data.code !== undefined) {
|
|
586
|
-
return sanitizeErrorCode(data.code);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
if (data["__type"] !== undefined) {
|
|
590
|
-
return sanitizeErrorCode(data["__type"]);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
return "";
|
|
594
|
-
};
|
package/runtimeConfig.browser.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import packageInfo from "./package.json";
|
|
2
|
-
|
|
3
|
-
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
|
-
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
5
|
-
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
6
|
-
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
|
|
7
|
-
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
|
|
8
|
-
import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
|
|
9
|
-
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
10
|
-
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
11
|
-
import { FinspaceDataClientConfig } from "./FinspaceDataClient";
|
|
12
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export const getRuntimeConfig = (config: FinspaceDataClientConfig) => {
|
|
18
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
19
|
-
return {
|
|
20
|
-
...clientSharedValues,
|
|
21
|
-
...config,
|
|
22
|
-
runtime: "browser",
|
|
23
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
24
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
25
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
26
|
-
credentialDefaultProvider:
|
|
27
|
-
config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
|
|
28
|
-
defaultUserAgentProvider:
|
|
29
|
-
config?.defaultUserAgentProvider ??
|
|
30
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
32
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
33
|
-
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
|
|
34
|
-
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
|
|
35
|
-
sha256: config?.sha256 ?? Sha256,
|
|
36
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
37
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
38
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
39
|
-
};
|
|
40
|
-
};
|
package/runtimeConfig.native.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
-
import { FinspaceDataClientConfig } from "./FinspaceDataClient";
|
|
3
|
-
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export const getRuntimeConfig = (config: FinspaceDataClientConfig) => {
|
|
9
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
10
|
-
return {
|
|
11
|
-
...browserDefaults,
|
|
12
|
-
...config,
|
|
13
|
-
runtime: "react-native",
|
|
14
|
-
sha256: config?.sha256 ?? Sha256,
|
|
15
|
-
};
|
|
16
|
-
};
|
package/runtimeConfig.shared.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defaultRegionInfoProvider } from "./endpoints";
|
|
2
|
-
import { Logger as __Logger } from "@aws-sdk/types";
|
|
3
|
-
import { parseUrl } from "@aws-sdk/url-parser";
|
|
4
|
-
import { FinspaceDataClientConfig } from "./FinspaceDataClient";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const getRuntimeConfig = (config: FinspaceDataClientConfig) => ({
|
|
10
|
-
apiVersion: "2020-07-13",
|
|
11
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
-
logger: config?.logger ?? ({} as __Logger),
|
|
13
|
-
regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
|
|
14
|
-
serviceId: config?.serviceId ?? "finspace data",
|
|
15
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
16
|
-
});
|