@aws-sdk/client-signer 3.490.0 → 3.496.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist-cjs/Signer.js +1 -49
  2. package/dist-cjs/SignerClient.js +1 -43
  3. package/dist-cjs/commands/AddProfilePermissionCommand.js +1 -28
  4. package/dist-cjs/commands/CancelSigningProfileCommand.js +1 -28
  5. package/dist-cjs/commands/DescribeSigningJobCommand.js +1 -28
  6. package/dist-cjs/commands/GetRevocationStatusCommand.js +1 -28
  7. package/dist-cjs/commands/GetSigningPlatformCommand.js +1 -28
  8. package/dist-cjs/commands/GetSigningProfileCommand.js +1 -28
  9. package/dist-cjs/commands/ListProfilePermissionsCommand.js +1 -28
  10. package/dist-cjs/commands/ListSigningJobsCommand.js +1 -28
  11. package/dist-cjs/commands/ListSigningPlatformsCommand.js +1 -28
  12. package/dist-cjs/commands/ListSigningProfilesCommand.js +1 -28
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  14. package/dist-cjs/commands/PutSigningProfileCommand.js +1 -28
  15. package/dist-cjs/commands/RemoveProfilePermissionCommand.js +1 -28
  16. package/dist-cjs/commands/RevokeSignatureCommand.js +1 -28
  17. package/dist-cjs/commands/RevokeSigningProfileCommand.js +1 -28
  18. package/dist-cjs/commands/SignPayloadCommand.js +1 -28
  19. package/dist-cjs/commands/StartSigningJobCommand.js +1 -28
  20. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  21. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  22. package/dist-cjs/commands/index.js +1 -22
  23. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  24. package/dist-cjs/extensionConfiguration.js +1 -2
  25. package/dist-cjs/index.js +2263 -12
  26. package/dist-cjs/models/SignerServiceException.js +1 -12
  27. package/dist-cjs/models/index.js +1 -4
  28. package/dist-cjs/models/models_0.js +1 -175
  29. package/dist-cjs/pagination/Interfaces.js +1 -2
  30. package/dist-cjs/pagination/ListSigningJobsPaginator.js +1 -7
  31. package/dist-cjs/pagination/ListSigningPlatformsPaginator.js +1 -7
  32. package/dist-cjs/pagination/ListSigningProfilesPaginator.js +1 -7
  33. package/dist-cjs/pagination/index.js +1 -7
  34. package/dist-cjs/protocols/Aws_restJson1.js +1 -1450
  35. package/dist-cjs/runtimeExtensions.js +1 -22
  36. package/dist-cjs/waiters/index.js +1 -4
  37. package/dist-cjs/waiters/waitForSuccessfulSigningJob.js +1 -48
  38. package/package.json +41 -41
@@ -1,1450 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartSigningJobCommand = exports.de_SignPayloadCommand = exports.de_RevokeSigningProfileCommand = exports.de_RevokeSignatureCommand = exports.de_RemoveProfilePermissionCommand = exports.de_PutSigningProfileCommand = exports.de_ListTagsForResourceCommand = exports.de_ListSigningProfilesCommand = exports.de_ListSigningPlatformsCommand = exports.de_ListSigningJobsCommand = exports.de_ListProfilePermissionsCommand = exports.de_GetSigningProfileCommand = exports.de_GetSigningPlatformCommand = exports.de_GetRevocationStatusCommand = exports.de_DescribeSigningJobCommand = exports.de_CancelSigningProfileCommand = exports.de_AddProfilePermissionCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartSigningJobCommand = exports.se_SignPayloadCommand = exports.se_RevokeSigningProfileCommand = exports.se_RevokeSignatureCommand = exports.se_RemoveProfilePermissionCommand = exports.se_PutSigningProfileCommand = exports.se_ListTagsForResourceCommand = exports.se_ListSigningProfilesCommand = exports.se_ListSigningPlatformsCommand = exports.se_ListSigningJobsCommand = exports.se_ListProfilePermissionsCommand = exports.se_GetSigningProfileCommand = exports.se_GetSigningPlatformCommand = exports.se_GetRevocationStatusCommand = exports.se_DescribeSigningJobCommand = exports.se_CancelSigningProfileCommand = exports.se_AddProfilePermissionCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const uuid_1 = require("uuid");
8
- const models_0_1 = require("../models/models_0");
9
- const SignerServiceException_1 = require("../models/SignerServiceException");
10
- const se_AddProfilePermissionCommand = async (input, context) => {
11
- const b = (0, core_1.requestBuilder)(input, context);
12
- const headers = {
13
- "content-type": "application/json",
14
- };
15
- b.bp("/signing-profiles/{profileName}/permissions");
16
- b.p("profileName", () => input.profileName, "{profileName}", false);
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1.take)(input, {
19
- action: [],
20
- principal: [],
21
- profileVersion: [],
22
- revisionId: [],
23
- statementId: [],
24
- }));
25
- b.m("POST").h(headers).b(body);
26
- return b.build();
27
- };
28
- exports.se_AddProfilePermissionCommand = se_AddProfilePermissionCommand;
29
- const se_CancelSigningProfileCommand = async (input, context) => {
30
- const b = (0, core_1.requestBuilder)(input, context);
31
- const headers = {};
32
- b.bp("/signing-profiles/{profileName}");
33
- b.p("profileName", () => input.profileName, "{profileName}", false);
34
- let body;
35
- b.m("DELETE").h(headers).b(body);
36
- return b.build();
37
- };
38
- exports.se_CancelSigningProfileCommand = se_CancelSigningProfileCommand;
39
- const se_DescribeSigningJobCommand = async (input, context) => {
40
- const b = (0, core_1.requestBuilder)(input, context);
41
- const headers = {};
42
- b.bp("/signing-jobs/{jobId}");
43
- b.p("jobId", () => input.jobId, "{jobId}", false);
44
- let body;
45
- b.m("GET").h(headers).b(body);
46
- return b.build();
47
- };
48
- exports.se_DescribeSigningJobCommand = se_DescribeSigningJobCommand;
49
- const se_GetRevocationStatusCommand = async (input, context) => {
50
- const b = (0, core_1.requestBuilder)(input, context);
51
- const headers = {};
52
- b.bp("/revocations");
53
- const query = (0, smithy_client_1.map)({
54
- [_sT]: [
55
- (0, smithy_client_1.expectNonNull)(input.signatureTimestamp, `signatureTimestamp`) != null,
56
- () => (input[_sT].toISOString().split(".")[0] + "Z").toString(),
57
- ],
58
- [_pI]: [, (0, smithy_client_1.expectNonNull)(input[_pI], `platformId`)],
59
- [_pVA]: [, (0, smithy_client_1.expectNonNull)(input[_pVA], `profileVersionArn`)],
60
- [_jA]: [, (0, smithy_client_1.expectNonNull)(input[_jA], `jobArn`)],
61
- [_cH]: [
62
- (0, smithy_client_1.expectNonNull)(input.certificateHashes, `certificateHashes`) != null,
63
- () => (input[_cH] || []).map((_entry) => _entry),
64
- ],
65
- });
66
- let body;
67
- let { hostname: resolvedHostname } = await context.endpoint();
68
- if (context.disableHostPrefix !== true) {
69
- resolvedHostname = "verification." + resolvedHostname;
70
- if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
71
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
72
- }
73
- }
74
- b.hn(resolvedHostname);
75
- b.m("GET").h(headers).q(query).b(body);
76
- return b.build();
77
- };
78
- exports.se_GetRevocationStatusCommand = se_GetRevocationStatusCommand;
79
- const se_GetSigningPlatformCommand = async (input, context) => {
80
- const b = (0, core_1.requestBuilder)(input, context);
81
- const headers = {};
82
- b.bp("/signing-platforms/{platformId}");
83
- b.p("platformId", () => input.platformId, "{platformId}", false);
84
- let body;
85
- b.m("GET").h(headers).b(body);
86
- return b.build();
87
- };
88
- exports.se_GetSigningPlatformCommand = se_GetSigningPlatformCommand;
89
- const se_GetSigningProfileCommand = async (input, context) => {
90
- const b = (0, core_1.requestBuilder)(input, context);
91
- const headers = {};
92
- b.bp("/signing-profiles/{profileName}");
93
- b.p("profileName", () => input.profileName, "{profileName}", false);
94
- const query = (0, smithy_client_1.map)({
95
- [_pO]: [, input[_pO]],
96
- });
97
- let body;
98
- b.m("GET").h(headers).q(query).b(body);
99
- return b.build();
100
- };
101
- exports.se_GetSigningProfileCommand = se_GetSigningProfileCommand;
102
- const se_ListProfilePermissionsCommand = async (input, context) => {
103
- const b = (0, core_1.requestBuilder)(input, context);
104
- const headers = {};
105
- b.bp("/signing-profiles/{profileName}/permissions");
106
- b.p("profileName", () => input.profileName, "{profileName}", false);
107
- const query = (0, smithy_client_1.map)({
108
- [_nT]: [, input[_nT]],
109
- });
110
- let body;
111
- b.m("GET").h(headers).q(query).b(body);
112
- return b.build();
113
- };
114
- exports.se_ListProfilePermissionsCommand = se_ListProfilePermissionsCommand;
115
- const se_ListSigningJobsCommand = async (input, context) => {
116
- const b = (0, core_1.requestBuilder)(input, context);
117
- const headers = {};
118
- b.bp("/signing-jobs");
119
- const query = (0, smithy_client_1.map)({
120
- [_s]: [, input[_s]],
121
- [_pI]: [, input[_pI]],
122
- [_rB]: [, input[_rB]],
123
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
124
- [_nT]: [, input[_nT]],
125
- [_iR]: [() => input.isRevoked !== void 0, () => input[_iR].toString()],
126
- [_sEB]: [
127
- () => input.signatureExpiresBefore !== void 0,
128
- () => (input[_sEB].toISOString().split(".")[0] + "Z").toString(),
129
- ],
130
- [_sEA]: [
131
- () => input.signatureExpiresAfter !== void 0,
132
- () => (input[_sEA].toISOString().split(".")[0] + "Z").toString(),
133
- ],
134
- [_jI]: [, input[_jI]],
135
- });
136
- let body;
137
- b.m("GET").h(headers).q(query).b(body);
138
- return b.build();
139
- };
140
- exports.se_ListSigningJobsCommand = se_ListSigningJobsCommand;
141
- const se_ListSigningPlatformsCommand = async (input, context) => {
142
- const b = (0, core_1.requestBuilder)(input, context);
143
- const headers = {};
144
- b.bp("/signing-platforms");
145
- const query = (0, smithy_client_1.map)({
146
- [_c]: [, input[_c]],
147
- [_p]: [, input[_p]],
148
- [_t]: [, input[_t]],
149
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
150
- [_nT]: [, input[_nT]],
151
- });
152
- let body;
153
- b.m("GET").h(headers).q(query).b(body);
154
- return b.build();
155
- };
156
- exports.se_ListSigningPlatformsCommand = se_ListSigningPlatformsCommand;
157
- const se_ListSigningProfilesCommand = async (input, context) => {
158
- const b = (0, core_1.requestBuilder)(input, context);
159
- const headers = {};
160
- b.bp("/signing-profiles");
161
- const query = (0, smithy_client_1.map)({
162
- [_iC]: [() => input.includeCanceled !== void 0, () => input[_iC].toString()],
163
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
164
- [_nT]: [, input[_nT]],
165
- [_pI]: [, input[_pI]],
166
- [_st]: [() => input.statuses !== void 0, () => (input[_st] || []).map((_entry) => _entry)],
167
- });
168
- let body;
169
- b.m("GET").h(headers).q(query).b(body);
170
- return b.build();
171
- };
172
- exports.se_ListSigningProfilesCommand = se_ListSigningProfilesCommand;
173
- const se_ListTagsForResourceCommand = async (input, context) => {
174
- const b = (0, core_1.requestBuilder)(input, context);
175
- const headers = {};
176
- b.bp("/tags/{resourceArn}");
177
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
178
- let body;
179
- b.m("GET").h(headers).b(body);
180
- return b.build();
181
- };
182
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
183
- const se_PutSigningProfileCommand = async (input, context) => {
184
- const b = (0, core_1.requestBuilder)(input, context);
185
- const headers = {
186
- "content-type": "application/json",
187
- };
188
- b.bp("/signing-profiles/{profileName}");
189
- b.p("profileName", () => input.profileName, "{profileName}", false);
190
- let body;
191
- body = JSON.stringify((0, smithy_client_1.take)(input, {
192
- overrides: (_) => (0, smithy_client_1._json)(_),
193
- platformId: [],
194
- signatureValidityPeriod: (_) => (0, smithy_client_1._json)(_),
195
- signingMaterial: (_) => (0, smithy_client_1._json)(_),
196
- signingParameters: (_) => (0, smithy_client_1._json)(_),
197
- tags: (_) => (0, smithy_client_1._json)(_),
198
- }));
199
- b.m("PUT").h(headers).b(body);
200
- return b.build();
201
- };
202
- exports.se_PutSigningProfileCommand = se_PutSigningProfileCommand;
203
- const se_RemoveProfilePermissionCommand = async (input, context) => {
204
- const b = (0, core_1.requestBuilder)(input, context);
205
- const headers = {};
206
- b.bp("/signing-profiles/{profileName}/permissions/{statementId}");
207
- b.p("profileName", () => input.profileName, "{profileName}", false);
208
- b.p("statementId", () => input.statementId, "{statementId}", false);
209
- const query = (0, smithy_client_1.map)({
210
- [_rI]: [, (0, smithy_client_1.expectNonNull)(input[_rI], `revisionId`)],
211
- });
212
- let body;
213
- b.m("DELETE").h(headers).q(query).b(body);
214
- return b.build();
215
- };
216
- exports.se_RemoveProfilePermissionCommand = se_RemoveProfilePermissionCommand;
217
- const se_RevokeSignatureCommand = async (input, context) => {
218
- const b = (0, core_1.requestBuilder)(input, context);
219
- const headers = {
220
- "content-type": "application/json",
221
- };
222
- b.bp("/signing-jobs/{jobId}/revoke");
223
- b.p("jobId", () => input.jobId, "{jobId}", false);
224
- let body;
225
- body = JSON.stringify((0, smithy_client_1.take)(input, {
226
- jobOwner: [],
227
- reason: [],
228
- }));
229
- b.m("PUT").h(headers).b(body);
230
- return b.build();
231
- };
232
- exports.se_RevokeSignatureCommand = se_RevokeSignatureCommand;
233
- const se_RevokeSigningProfileCommand = async (input, context) => {
234
- const b = (0, core_1.requestBuilder)(input, context);
235
- const headers = {
236
- "content-type": "application/json",
237
- };
238
- b.bp("/signing-profiles/{profileName}/revoke");
239
- b.p("profileName", () => input.profileName, "{profileName}", false);
240
- let body;
241
- body = JSON.stringify((0, smithy_client_1.take)(input, {
242
- effectiveTime: (_) => Math.round(_.getTime() / 1000),
243
- profileVersion: [],
244
- reason: [],
245
- }));
246
- b.m("PUT").h(headers).b(body);
247
- return b.build();
248
- };
249
- exports.se_RevokeSigningProfileCommand = se_RevokeSigningProfileCommand;
250
- const se_SignPayloadCommand = async (input, context) => {
251
- const b = (0, core_1.requestBuilder)(input, context);
252
- const headers = {
253
- "content-type": "application/json",
254
- };
255
- b.bp("/signing-jobs/with-payload");
256
- let body;
257
- body = JSON.stringify((0, smithy_client_1.take)(input, {
258
- payload: (_) => context.base64Encoder(_),
259
- payloadFormat: [],
260
- profileName: [],
261
- profileOwner: [],
262
- }));
263
- b.m("POST").h(headers).b(body);
264
- return b.build();
265
- };
266
- exports.se_SignPayloadCommand = se_SignPayloadCommand;
267
- const se_StartSigningJobCommand = async (input, context) => {
268
- const b = (0, core_1.requestBuilder)(input, context);
269
- const headers = {
270
- "content-type": "application/json",
271
- };
272
- b.bp("/signing-jobs");
273
- let body;
274
- body = JSON.stringify((0, smithy_client_1.take)(input, {
275
- clientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
276
- destination: (_) => (0, smithy_client_1._json)(_),
277
- profileName: [],
278
- profileOwner: [],
279
- source: (_) => (0, smithy_client_1._json)(_),
280
- }));
281
- b.m("POST").h(headers).b(body);
282
- return b.build();
283
- };
284
- exports.se_StartSigningJobCommand = se_StartSigningJobCommand;
285
- const se_TagResourceCommand = async (input, context) => {
286
- const b = (0, core_1.requestBuilder)(input, context);
287
- const headers = {
288
- "content-type": "application/json",
289
- };
290
- b.bp("/tags/{resourceArn}");
291
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
292
- let body;
293
- body = JSON.stringify((0, smithy_client_1.take)(input, {
294
- tags: (_) => (0, smithy_client_1._json)(_),
295
- }));
296
- b.m("POST").h(headers).b(body);
297
- return b.build();
298
- };
299
- exports.se_TagResourceCommand = se_TagResourceCommand;
300
- const se_UntagResourceCommand = async (input, context) => {
301
- const b = (0, core_1.requestBuilder)(input, context);
302
- const headers = {};
303
- b.bp("/tags/{resourceArn}");
304
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
305
- const query = (0, smithy_client_1.map)({
306
- [_tK]: [
307
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
308
- () => (input[_tK] || []).map((_entry) => _entry),
309
- ],
310
- });
311
- let body;
312
- b.m("DELETE").h(headers).q(query).b(body);
313
- return b.build();
314
- };
315
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
316
- const de_AddProfilePermissionCommand = async (output, context) => {
317
- if (output.statusCode !== 200 && output.statusCode >= 300) {
318
- return de_AddProfilePermissionCommandError(output, context);
319
- }
320
- const contents = (0, smithy_client_1.map)({
321
- $metadata: deserializeMetadata(output),
322
- });
323
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
324
- const doc = (0, smithy_client_1.take)(data, {
325
- revisionId: smithy_client_1.expectString,
326
- });
327
- Object.assign(contents, doc);
328
- return contents;
329
- };
330
- exports.de_AddProfilePermissionCommand = de_AddProfilePermissionCommand;
331
- const de_AddProfilePermissionCommandError = async (output, context) => {
332
- const parsedOutput = {
333
- ...output,
334
- body: await parseErrorBody(output.body, context),
335
- };
336
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
337
- switch (errorCode) {
338
- case "AccessDeniedException":
339
- case "com.amazonaws.signer#AccessDeniedException":
340
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
341
- case "ConflictException":
342
- case "com.amazonaws.signer#ConflictException":
343
- throw await de_ConflictExceptionRes(parsedOutput, context);
344
- case "InternalServiceErrorException":
345
- case "com.amazonaws.signer#InternalServiceErrorException":
346
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
347
- case "ResourceNotFoundException":
348
- case "com.amazonaws.signer#ResourceNotFoundException":
349
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
350
- case "ServiceLimitExceededException":
351
- case "com.amazonaws.signer#ServiceLimitExceededException":
352
- throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context);
353
- case "TooManyRequestsException":
354
- case "com.amazonaws.signer#TooManyRequestsException":
355
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
356
- case "ValidationException":
357
- case "com.amazonaws.signer#ValidationException":
358
- throw await de_ValidationExceptionRes(parsedOutput, context);
359
- default:
360
- const parsedBody = parsedOutput.body;
361
- return throwDefaultError({
362
- output,
363
- parsedBody,
364
- errorCode,
365
- });
366
- }
367
- };
368
- const de_CancelSigningProfileCommand = async (output, context) => {
369
- if (output.statusCode !== 200 && output.statusCode >= 300) {
370
- return de_CancelSigningProfileCommandError(output, context);
371
- }
372
- const contents = (0, smithy_client_1.map)({
373
- $metadata: deserializeMetadata(output),
374
- });
375
- await (0, smithy_client_1.collectBody)(output.body, context);
376
- return contents;
377
- };
378
- exports.de_CancelSigningProfileCommand = de_CancelSigningProfileCommand;
379
- const de_CancelSigningProfileCommandError = async (output, context) => {
380
- const parsedOutput = {
381
- ...output,
382
- body: await parseErrorBody(output.body, context),
383
- };
384
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
385
- switch (errorCode) {
386
- case "AccessDeniedException":
387
- case "com.amazonaws.signer#AccessDeniedException":
388
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
389
- case "InternalServiceErrorException":
390
- case "com.amazonaws.signer#InternalServiceErrorException":
391
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
392
- case "ResourceNotFoundException":
393
- case "com.amazonaws.signer#ResourceNotFoundException":
394
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
395
- case "TooManyRequestsException":
396
- case "com.amazonaws.signer#TooManyRequestsException":
397
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
398
- default:
399
- const parsedBody = parsedOutput.body;
400
- return throwDefaultError({
401
- output,
402
- parsedBody,
403
- errorCode,
404
- });
405
- }
406
- };
407
- const de_DescribeSigningJobCommand = async (output, context) => {
408
- if (output.statusCode !== 200 && output.statusCode >= 300) {
409
- return de_DescribeSigningJobCommandError(output, context);
410
- }
411
- const contents = (0, smithy_client_1.map)({
412
- $metadata: deserializeMetadata(output),
413
- });
414
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
415
- const doc = (0, smithy_client_1.take)(data, {
416
- completedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
417
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
418
- jobId: smithy_client_1.expectString,
419
- jobInvoker: smithy_client_1.expectString,
420
- jobOwner: smithy_client_1.expectString,
421
- overrides: smithy_client_1._json,
422
- platformDisplayName: smithy_client_1.expectString,
423
- platformId: smithy_client_1.expectString,
424
- profileName: smithy_client_1.expectString,
425
- profileVersion: smithy_client_1.expectString,
426
- requestedBy: smithy_client_1.expectString,
427
- revocationRecord: (_) => de_SigningJobRevocationRecord(_, context),
428
- signatureExpiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
429
- signedObject: smithy_client_1._json,
430
- signingMaterial: smithy_client_1._json,
431
- signingParameters: smithy_client_1._json,
432
- source: smithy_client_1._json,
433
- status: smithy_client_1.expectString,
434
- statusReason: smithy_client_1.expectString,
435
- });
436
- Object.assign(contents, doc);
437
- return contents;
438
- };
439
- exports.de_DescribeSigningJobCommand = de_DescribeSigningJobCommand;
440
- const de_DescribeSigningJobCommandError = async (output, context) => {
441
- const parsedOutput = {
442
- ...output,
443
- body: await parseErrorBody(output.body, context),
444
- };
445
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
446
- switch (errorCode) {
447
- case "AccessDeniedException":
448
- case "com.amazonaws.signer#AccessDeniedException":
449
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
450
- case "InternalServiceErrorException":
451
- case "com.amazonaws.signer#InternalServiceErrorException":
452
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
453
- case "ResourceNotFoundException":
454
- case "com.amazonaws.signer#ResourceNotFoundException":
455
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
456
- case "TooManyRequestsException":
457
- case "com.amazonaws.signer#TooManyRequestsException":
458
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
459
- default:
460
- const parsedBody = parsedOutput.body;
461
- return throwDefaultError({
462
- output,
463
- parsedBody,
464
- errorCode,
465
- });
466
- }
467
- };
468
- const de_GetRevocationStatusCommand = async (output, context) => {
469
- if (output.statusCode !== 200 && output.statusCode >= 300) {
470
- return de_GetRevocationStatusCommandError(output, context);
471
- }
472
- const contents = (0, smithy_client_1.map)({
473
- $metadata: deserializeMetadata(output),
474
- });
475
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
476
- const doc = (0, smithy_client_1.take)(data, {
477
- revokedEntities: smithy_client_1._json,
478
- });
479
- Object.assign(contents, doc);
480
- return contents;
481
- };
482
- exports.de_GetRevocationStatusCommand = de_GetRevocationStatusCommand;
483
- const de_GetRevocationStatusCommandError = async (output, context) => {
484
- const parsedOutput = {
485
- ...output,
486
- body: await parseErrorBody(output.body, context),
487
- };
488
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
489
- switch (errorCode) {
490
- case "AccessDeniedException":
491
- case "com.amazonaws.signer#AccessDeniedException":
492
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
493
- case "InternalServiceErrorException":
494
- case "com.amazonaws.signer#InternalServiceErrorException":
495
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
496
- case "TooManyRequestsException":
497
- case "com.amazonaws.signer#TooManyRequestsException":
498
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
499
- case "ValidationException":
500
- case "com.amazonaws.signer#ValidationException":
501
- throw await de_ValidationExceptionRes(parsedOutput, context);
502
- default:
503
- const parsedBody = parsedOutput.body;
504
- return throwDefaultError({
505
- output,
506
- parsedBody,
507
- errorCode,
508
- });
509
- }
510
- };
511
- const de_GetSigningPlatformCommand = async (output, context) => {
512
- if (output.statusCode !== 200 && output.statusCode >= 300) {
513
- return de_GetSigningPlatformCommandError(output, context);
514
- }
515
- const contents = (0, smithy_client_1.map)({
516
- $metadata: deserializeMetadata(output),
517
- });
518
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
519
- const doc = (0, smithy_client_1.take)(data, {
520
- category: smithy_client_1.expectString,
521
- displayName: smithy_client_1.expectString,
522
- maxSizeInMB: smithy_client_1.expectInt32,
523
- partner: smithy_client_1.expectString,
524
- platformId: smithy_client_1.expectString,
525
- revocationSupported: smithy_client_1.expectBoolean,
526
- signingConfiguration: smithy_client_1._json,
527
- signingImageFormat: smithy_client_1._json,
528
- target: smithy_client_1.expectString,
529
- });
530
- Object.assign(contents, doc);
531
- return contents;
532
- };
533
- exports.de_GetSigningPlatformCommand = de_GetSigningPlatformCommand;
534
- const de_GetSigningPlatformCommandError = async (output, context) => {
535
- const parsedOutput = {
536
- ...output,
537
- body: await parseErrorBody(output.body, context),
538
- };
539
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
540
- switch (errorCode) {
541
- case "AccessDeniedException":
542
- case "com.amazonaws.signer#AccessDeniedException":
543
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
544
- case "InternalServiceErrorException":
545
- case "com.amazonaws.signer#InternalServiceErrorException":
546
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
547
- case "ResourceNotFoundException":
548
- case "com.amazonaws.signer#ResourceNotFoundException":
549
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
550
- case "TooManyRequestsException":
551
- case "com.amazonaws.signer#TooManyRequestsException":
552
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
553
- default:
554
- const parsedBody = parsedOutput.body;
555
- return throwDefaultError({
556
- output,
557
- parsedBody,
558
- errorCode,
559
- });
560
- }
561
- };
562
- const de_GetSigningProfileCommand = async (output, context) => {
563
- if (output.statusCode !== 200 && output.statusCode >= 300) {
564
- return de_GetSigningProfileCommandError(output, context);
565
- }
566
- const contents = (0, smithy_client_1.map)({
567
- $metadata: deserializeMetadata(output),
568
- });
569
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
570
- const doc = (0, smithy_client_1.take)(data, {
571
- arn: smithy_client_1.expectString,
572
- overrides: smithy_client_1._json,
573
- platformDisplayName: smithy_client_1.expectString,
574
- platformId: smithy_client_1.expectString,
575
- profileName: smithy_client_1.expectString,
576
- profileVersion: smithy_client_1.expectString,
577
- profileVersionArn: smithy_client_1.expectString,
578
- revocationRecord: (_) => de_SigningProfileRevocationRecord(_, context),
579
- signatureValidityPeriod: smithy_client_1._json,
580
- signingMaterial: smithy_client_1._json,
581
- signingParameters: smithy_client_1._json,
582
- status: smithy_client_1.expectString,
583
- statusReason: smithy_client_1.expectString,
584
- tags: smithy_client_1._json,
585
- });
586
- Object.assign(contents, doc);
587
- return contents;
588
- };
589
- exports.de_GetSigningProfileCommand = de_GetSigningProfileCommand;
590
- const de_GetSigningProfileCommandError = async (output, context) => {
591
- const parsedOutput = {
592
- ...output,
593
- body: await parseErrorBody(output.body, context),
594
- };
595
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
596
- switch (errorCode) {
597
- case "AccessDeniedException":
598
- case "com.amazonaws.signer#AccessDeniedException":
599
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
600
- case "InternalServiceErrorException":
601
- case "com.amazonaws.signer#InternalServiceErrorException":
602
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
603
- case "ResourceNotFoundException":
604
- case "com.amazonaws.signer#ResourceNotFoundException":
605
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
606
- case "TooManyRequestsException":
607
- case "com.amazonaws.signer#TooManyRequestsException":
608
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
609
- default:
610
- const parsedBody = parsedOutput.body;
611
- return throwDefaultError({
612
- output,
613
- parsedBody,
614
- errorCode,
615
- });
616
- }
617
- };
618
- const de_ListProfilePermissionsCommand = async (output, context) => {
619
- if (output.statusCode !== 200 && output.statusCode >= 300) {
620
- return de_ListProfilePermissionsCommandError(output, context);
621
- }
622
- const contents = (0, smithy_client_1.map)({
623
- $metadata: deserializeMetadata(output),
624
- });
625
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
626
- const doc = (0, smithy_client_1.take)(data, {
627
- nextToken: smithy_client_1.expectString,
628
- permissions: smithy_client_1._json,
629
- policySizeBytes: smithy_client_1.expectInt32,
630
- revisionId: smithy_client_1.expectString,
631
- });
632
- Object.assign(contents, doc);
633
- return contents;
634
- };
635
- exports.de_ListProfilePermissionsCommand = de_ListProfilePermissionsCommand;
636
- const de_ListProfilePermissionsCommandError = async (output, context) => {
637
- const parsedOutput = {
638
- ...output,
639
- body: await parseErrorBody(output.body, context),
640
- };
641
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
642
- switch (errorCode) {
643
- case "AccessDeniedException":
644
- case "com.amazonaws.signer#AccessDeniedException":
645
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
646
- case "InternalServiceErrorException":
647
- case "com.amazonaws.signer#InternalServiceErrorException":
648
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
649
- case "ResourceNotFoundException":
650
- case "com.amazonaws.signer#ResourceNotFoundException":
651
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
652
- case "TooManyRequestsException":
653
- case "com.amazonaws.signer#TooManyRequestsException":
654
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
655
- case "ValidationException":
656
- case "com.amazonaws.signer#ValidationException":
657
- throw await de_ValidationExceptionRes(parsedOutput, context);
658
- default:
659
- const parsedBody = parsedOutput.body;
660
- return throwDefaultError({
661
- output,
662
- parsedBody,
663
- errorCode,
664
- });
665
- }
666
- };
667
- const de_ListSigningJobsCommand = async (output, context) => {
668
- if (output.statusCode !== 200 && output.statusCode >= 300) {
669
- return de_ListSigningJobsCommandError(output, context);
670
- }
671
- const contents = (0, smithy_client_1.map)({
672
- $metadata: deserializeMetadata(output),
673
- });
674
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
675
- const doc = (0, smithy_client_1.take)(data, {
676
- jobs: (_) => de_SigningJobs(_, context),
677
- nextToken: smithy_client_1.expectString,
678
- });
679
- Object.assign(contents, doc);
680
- return contents;
681
- };
682
- exports.de_ListSigningJobsCommand = de_ListSigningJobsCommand;
683
- const de_ListSigningJobsCommandError = async (output, context) => {
684
- const parsedOutput = {
685
- ...output,
686
- body: await parseErrorBody(output.body, context),
687
- };
688
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
689
- switch (errorCode) {
690
- case "AccessDeniedException":
691
- case "com.amazonaws.signer#AccessDeniedException":
692
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
693
- case "InternalServiceErrorException":
694
- case "com.amazonaws.signer#InternalServiceErrorException":
695
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
696
- case "TooManyRequestsException":
697
- case "com.amazonaws.signer#TooManyRequestsException":
698
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
699
- case "ValidationException":
700
- case "com.amazonaws.signer#ValidationException":
701
- throw await de_ValidationExceptionRes(parsedOutput, context);
702
- default:
703
- const parsedBody = parsedOutput.body;
704
- return throwDefaultError({
705
- output,
706
- parsedBody,
707
- errorCode,
708
- });
709
- }
710
- };
711
- const de_ListSigningPlatformsCommand = async (output, context) => {
712
- if (output.statusCode !== 200 && output.statusCode >= 300) {
713
- return de_ListSigningPlatformsCommandError(output, context);
714
- }
715
- const contents = (0, smithy_client_1.map)({
716
- $metadata: deserializeMetadata(output),
717
- });
718
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
719
- const doc = (0, smithy_client_1.take)(data, {
720
- nextToken: smithy_client_1.expectString,
721
- platforms: smithy_client_1._json,
722
- });
723
- Object.assign(contents, doc);
724
- return contents;
725
- };
726
- exports.de_ListSigningPlatformsCommand = de_ListSigningPlatformsCommand;
727
- const de_ListSigningPlatformsCommandError = async (output, context) => {
728
- const parsedOutput = {
729
- ...output,
730
- body: await parseErrorBody(output.body, context),
731
- };
732
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
733
- switch (errorCode) {
734
- case "AccessDeniedException":
735
- case "com.amazonaws.signer#AccessDeniedException":
736
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
737
- case "InternalServiceErrorException":
738
- case "com.amazonaws.signer#InternalServiceErrorException":
739
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
740
- case "TooManyRequestsException":
741
- case "com.amazonaws.signer#TooManyRequestsException":
742
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
743
- case "ValidationException":
744
- case "com.amazonaws.signer#ValidationException":
745
- throw await de_ValidationExceptionRes(parsedOutput, context);
746
- default:
747
- const parsedBody = parsedOutput.body;
748
- return throwDefaultError({
749
- output,
750
- parsedBody,
751
- errorCode,
752
- });
753
- }
754
- };
755
- const de_ListSigningProfilesCommand = async (output, context) => {
756
- if (output.statusCode !== 200 && output.statusCode >= 300) {
757
- return de_ListSigningProfilesCommandError(output, context);
758
- }
759
- const contents = (0, smithy_client_1.map)({
760
- $metadata: deserializeMetadata(output),
761
- });
762
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
763
- const doc = (0, smithy_client_1.take)(data, {
764
- nextToken: smithy_client_1.expectString,
765
- profiles: smithy_client_1._json,
766
- });
767
- Object.assign(contents, doc);
768
- return contents;
769
- };
770
- exports.de_ListSigningProfilesCommand = de_ListSigningProfilesCommand;
771
- const de_ListSigningProfilesCommandError = async (output, context) => {
772
- const parsedOutput = {
773
- ...output,
774
- body: await parseErrorBody(output.body, context),
775
- };
776
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
777
- switch (errorCode) {
778
- case "AccessDeniedException":
779
- case "com.amazonaws.signer#AccessDeniedException":
780
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
781
- case "InternalServiceErrorException":
782
- case "com.amazonaws.signer#InternalServiceErrorException":
783
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
784
- case "TooManyRequestsException":
785
- case "com.amazonaws.signer#TooManyRequestsException":
786
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
787
- default:
788
- const parsedBody = parsedOutput.body;
789
- return throwDefaultError({
790
- output,
791
- parsedBody,
792
- errorCode,
793
- });
794
- }
795
- };
796
- const de_ListTagsForResourceCommand = async (output, context) => {
797
- if (output.statusCode !== 200 && output.statusCode >= 300) {
798
- return de_ListTagsForResourceCommandError(output, context);
799
- }
800
- const contents = (0, smithy_client_1.map)({
801
- $metadata: deserializeMetadata(output),
802
- });
803
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
804
- const doc = (0, smithy_client_1.take)(data, {
805
- tags: smithy_client_1._json,
806
- });
807
- Object.assign(contents, doc);
808
- return contents;
809
- };
810
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
811
- const de_ListTagsForResourceCommandError = async (output, context) => {
812
- const parsedOutput = {
813
- ...output,
814
- body: await parseErrorBody(output.body, context),
815
- };
816
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
817
- switch (errorCode) {
818
- case "BadRequestException":
819
- case "com.amazonaws.signer#BadRequestException":
820
- throw await de_BadRequestExceptionRes(parsedOutput, context);
821
- case "InternalServiceErrorException":
822
- case "com.amazonaws.signer#InternalServiceErrorException":
823
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
824
- case "NotFoundException":
825
- case "com.amazonaws.signer#NotFoundException":
826
- throw await de_NotFoundExceptionRes(parsedOutput, context);
827
- case "TooManyRequestsException":
828
- case "com.amazonaws.signer#TooManyRequestsException":
829
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
830
- default:
831
- const parsedBody = parsedOutput.body;
832
- return throwDefaultError({
833
- output,
834
- parsedBody,
835
- errorCode,
836
- });
837
- }
838
- };
839
- const de_PutSigningProfileCommand = async (output, context) => {
840
- if (output.statusCode !== 200 && output.statusCode >= 300) {
841
- return de_PutSigningProfileCommandError(output, context);
842
- }
843
- const contents = (0, smithy_client_1.map)({
844
- $metadata: deserializeMetadata(output),
845
- });
846
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
847
- const doc = (0, smithy_client_1.take)(data, {
848
- arn: smithy_client_1.expectString,
849
- profileVersion: smithy_client_1.expectString,
850
- profileVersionArn: smithy_client_1.expectString,
851
- });
852
- Object.assign(contents, doc);
853
- return contents;
854
- };
855
- exports.de_PutSigningProfileCommand = de_PutSigningProfileCommand;
856
- const de_PutSigningProfileCommandError = async (output, context) => {
857
- const parsedOutput = {
858
- ...output,
859
- body: await parseErrorBody(output.body, context),
860
- };
861
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
862
- switch (errorCode) {
863
- case "AccessDeniedException":
864
- case "com.amazonaws.signer#AccessDeniedException":
865
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
866
- case "InternalServiceErrorException":
867
- case "com.amazonaws.signer#InternalServiceErrorException":
868
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
869
- case "ResourceNotFoundException":
870
- case "com.amazonaws.signer#ResourceNotFoundException":
871
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
872
- case "TooManyRequestsException":
873
- case "com.amazonaws.signer#TooManyRequestsException":
874
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
875
- case "ValidationException":
876
- case "com.amazonaws.signer#ValidationException":
877
- throw await de_ValidationExceptionRes(parsedOutput, context);
878
- default:
879
- const parsedBody = parsedOutput.body;
880
- return throwDefaultError({
881
- output,
882
- parsedBody,
883
- errorCode,
884
- });
885
- }
886
- };
887
- const de_RemoveProfilePermissionCommand = async (output, context) => {
888
- if (output.statusCode !== 200 && output.statusCode >= 300) {
889
- return de_RemoveProfilePermissionCommandError(output, context);
890
- }
891
- const contents = (0, smithy_client_1.map)({
892
- $metadata: deserializeMetadata(output),
893
- });
894
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
895
- const doc = (0, smithy_client_1.take)(data, {
896
- revisionId: smithy_client_1.expectString,
897
- });
898
- Object.assign(contents, doc);
899
- return contents;
900
- };
901
- exports.de_RemoveProfilePermissionCommand = de_RemoveProfilePermissionCommand;
902
- const de_RemoveProfilePermissionCommandError = async (output, context) => {
903
- const parsedOutput = {
904
- ...output,
905
- body: await parseErrorBody(output.body, context),
906
- };
907
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
908
- switch (errorCode) {
909
- case "AccessDeniedException":
910
- case "com.amazonaws.signer#AccessDeniedException":
911
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
912
- case "ConflictException":
913
- case "com.amazonaws.signer#ConflictException":
914
- throw await de_ConflictExceptionRes(parsedOutput, context);
915
- case "InternalServiceErrorException":
916
- case "com.amazonaws.signer#InternalServiceErrorException":
917
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
918
- case "ResourceNotFoundException":
919
- case "com.amazonaws.signer#ResourceNotFoundException":
920
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
921
- case "TooManyRequestsException":
922
- case "com.amazonaws.signer#TooManyRequestsException":
923
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
924
- case "ValidationException":
925
- case "com.amazonaws.signer#ValidationException":
926
- throw await de_ValidationExceptionRes(parsedOutput, context);
927
- default:
928
- const parsedBody = parsedOutput.body;
929
- return throwDefaultError({
930
- output,
931
- parsedBody,
932
- errorCode,
933
- });
934
- }
935
- };
936
- const de_RevokeSignatureCommand = async (output, context) => {
937
- if (output.statusCode !== 200 && output.statusCode >= 300) {
938
- return de_RevokeSignatureCommandError(output, context);
939
- }
940
- const contents = (0, smithy_client_1.map)({
941
- $metadata: deserializeMetadata(output),
942
- });
943
- await (0, smithy_client_1.collectBody)(output.body, context);
944
- return contents;
945
- };
946
- exports.de_RevokeSignatureCommand = de_RevokeSignatureCommand;
947
- const de_RevokeSignatureCommandError = async (output, context) => {
948
- const parsedOutput = {
949
- ...output,
950
- body: await parseErrorBody(output.body, context),
951
- };
952
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
953
- switch (errorCode) {
954
- case "AccessDeniedException":
955
- case "com.amazonaws.signer#AccessDeniedException":
956
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
957
- case "InternalServiceErrorException":
958
- case "com.amazonaws.signer#InternalServiceErrorException":
959
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
960
- case "ResourceNotFoundException":
961
- case "com.amazonaws.signer#ResourceNotFoundException":
962
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
963
- case "TooManyRequestsException":
964
- case "com.amazonaws.signer#TooManyRequestsException":
965
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
966
- case "ValidationException":
967
- case "com.amazonaws.signer#ValidationException":
968
- throw await de_ValidationExceptionRes(parsedOutput, context);
969
- default:
970
- const parsedBody = parsedOutput.body;
971
- return throwDefaultError({
972
- output,
973
- parsedBody,
974
- errorCode,
975
- });
976
- }
977
- };
978
- const de_RevokeSigningProfileCommand = async (output, context) => {
979
- if (output.statusCode !== 200 && output.statusCode >= 300) {
980
- return de_RevokeSigningProfileCommandError(output, context);
981
- }
982
- const contents = (0, smithy_client_1.map)({
983
- $metadata: deserializeMetadata(output),
984
- });
985
- await (0, smithy_client_1.collectBody)(output.body, context);
986
- return contents;
987
- };
988
- exports.de_RevokeSigningProfileCommand = de_RevokeSigningProfileCommand;
989
- const de_RevokeSigningProfileCommandError = async (output, context) => {
990
- const parsedOutput = {
991
- ...output,
992
- body: await parseErrorBody(output.body, context),
993
- };
994
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
995
- switch (errorCode) {
996
- case "AccessDeniedException":
997
- case "com.amazonaws.signer#AccessDeniedException":
998
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
999
- case "InternalServiceErrorException":
1000
- case "com.amazonaws.signer#InternalServiceErrorException":
1001
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
1002
- case "ResourceNotFoundException":
1003
- case "com.amazonaws.signer#ResourceNotFoundException":
1004
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1005
- case "TooManyRequestsException":
1006
- case "com.amazonaws.signer#TooManyRequestsException":
1007
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1008
- case "ValidationException":
1009
- case "com.amazonaws.signer#ValidationException":
1010
- throw await de_ValidationExceptionRes(parsedOutput, context);
1011
- default:
1012
- const parsedBody = parsedOutput.body;
1013
- return throwDefaultError({
1014
- output,
1015
- parsedBody,
1016
- errorCode,
1017
- });
1018
- }
1019
- };
1020
- const de_SignPayloadCommand = async (output, context) => {
1021
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1022
- return de_SignPayloadCommandError(output, context);
1023
- }
1024
- const contents = (0, smithy_client_1.map)({
1025
- $metadata: deserializeMetadata(output),
1026
- });
1027
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1028
- const doc = (0, smithy_client_1.take)(data, {
1029
- jobId: smithy_client_1.expectString,
1030
- jobOwner: smithy_client_1.expectString,
1031
- metadata: smithy_client_1._json,
1032
- signature: context.base64Decoder,
1033
- });
1034
- Object.assign(contents, doc);
1035
- return contents;
1036
- };
1037
- exports.de_SignPayloadCommand = de_SignPayloadCommand;
1038
- const de_SignPayloadCommandError = async (output, context) => {
1039
- const parsedOutput = {
1040
- ...output,
1041
- body: await parseErrorBody(output.body, context),
1042
- };
1043
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1044
- switch (errorCode) {
1045
- case "AccessDeniedException":
1046
- case "com.amazonaws.signer#AccessDeniedException":
1047
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1048
- case "InternalServiceErrorException":
1049
- case "com.amazonaws.signer#InternalServiceErrorException":
1050
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
1051
- case "ResourceNotFoundException":
1052
- case "com.amazonaws.signer#ResourceNotFoundException":
1053
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1054
- case "TooManyRequestsException":
1055
- case "com.amazonaws.signer#TooManyRequestsException":
1056
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1057
- case "ValidationException":
1058
- case "com.amazonaws.signer#ValidationException":
1059
- throw await de_ValidationExceptionRes(parsedOutput, context);
1060
- default:
1061
- const parsedBody = parsedOutput.body;
1062
- return throwDefaultError({
1063
- output,
1064
- parsedBody,
1065
- errorCode,
1066
- });
1067
- }
1068
- };
1069
- const de_StartSigningJobCommand = async (output, context) => {
1070
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1071
- return de_StartSigningJobCommandError(output, context);
1072
- }
1073
- const contents = (0, smithy_client_1.map)({
1074
- $metadata: deserializeMetadata(output),
1075
- });
1076
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1077
- const doc = (0, smithy_client_1.take)(data, {
1078
- jobId: smithy_client_1.expectString,
1079
- jobOwner: smithy_client_1.expectString,
1080
- });
1081
- Object.assign(contents, doc);
1082
- return contents;
1083
- };
1084
- exports.de_StartSigningJobCommand = de_StartSigningJobCommand;
1085
- const de_StartSigningJobCommandError = async (output, context) => {
1086
- const parsedOutput = {
1087
- ...output,
1088
- body: await parseErrorBody(output.body, context),
1089
- };
1090
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1091
- switch (errorCode) {
1092
- case "AccessDeniedException":
1093
- case "com.amazonaws.signer#AccessDeniedException":
1094
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1095
- case "InternalServiceErrorException":
1096
- case "com.amazonaws.signer#InternalServiceErrorException":
1097
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
1098
- case "ResourceNotFoundException":
1099
- case "com.amazonaws.signer#ResourceNotFoundException":
1100
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1101
- case "ThrottlingException":
1102
- case "com.amazonaws.signer#ThrottlingException":
1103
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1104
- case "TooManyRequestsException":
1105
- case "com.amazonaws.signer#TooManyRequestsException":
1106
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1107
- case "ValidationException":
1108
- case "com.amazonaws.signer#ValidationException":
1109
- throw await de_ValidationExceptionRes(parsedOutput, context);
1110
- default:
1111
- const parsedBody = parsedOutput.body;
1112
- return throwDefaultError({
1113
- output,
1114
- parsedBody,
1115
- errorCode,
1116
- });
1117
- }
1118
- };
1119
- const de_TagResourceCommand = async (output, context) => {
1120
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1121
- return de_TagResourceCommandError(output, context);
1122
- }
1123
- const contents = (0, smithy_client_1.map)({
1124
- $metadata: deserializeMetadata(output),
1125
- });
1126
- await (0, smithy_client_1.collectBody)(output.body, context);
1127
- return contents;
1128
- };
1129
- exports.de_TagResourceCommand = de_TagResourceCommand;
1130
- const de_TagResourceCommandError = async (output, context) => {
1131
- const parsedOutput = {
1132
- ...output,
1133
- body: await parseErrorBody(output.body, context),
1134
- };
1135
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1136
- switch (errorCode) {
1137
- case "BadRequestException":
1138
- case "com.amazonaws.signer#BadRequestException":
1139
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1140
- case "InternalServiceErrorException":
1141
- case "com.amazonaws.signer#InternalServiceErrorException":
1142
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
1143
- case "NotFoundException":
1144
- case "com.amazonaws.signer#NotFoundException":
1145
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1146
- case "TooManyRequestsException":
1147
- case "com.amazonaws.signer#TooManyRequestsException":
1148
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1149
- default:
1150
- const parsedBody = parsedOutput.body;
1151
- return throwDefaultError({
1152
- output,
1153
- parsedBody,
1154
- errorCode,
1155
- });
1156
- }
1157
- };
1158
- const de_UntagResourceCommand = async (output, context) => {
1159
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1160
- return de_UntagResourceCommandError(output, context);
1161
- }
1162
- const contents = (0, smithy_client_1.map)({
1163
- $metadata: deserializeMetadata(output),
1164
- });
1165
- await (0, smithy_client_1.collectBody)(output.body, context);
1166
- return contents;
1167
- };
1168
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1169
- const de_UntagResourceCommandError = async (output, context) => {
1170
- const parsedOutput = {
1171
- ...output,
1172
- body: await parseErrorBody(output.body, context),
1173
- };
1174
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1175
- switch (errorCode) {
1176
- case "BadRequestException":
1177
- case "com.amazonaws.signer#BadRequestException":
1178
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1179
- case "InternalServiceErrorException":
1180
- case "com.amazonaws.signer#InternalServiceErrorException":
1181
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
1182
- case "NotFoundException":
1183
- case "com.amazonaws.signer#NotFoundException":
1184
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1185
- case "TooManyRequestsException":
1186
- case "com.amazonaws.signer#TooManyRequestsException":
1187
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1188
- default:
1189
- const parsedBody = parsedOutput.body;
1190
- return throwDefaultError({
1191
- output,
1192
- parsedBody,
1193
- errorCode,
1194
- });
1195
- }
1196
- };
1197
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SignerServiceException_1.SignerServiceException);
1198
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1199
- const contents = (0, smithy_client_1.map)({});
1200
- const data = parsedOutput.body;
1201
- const doc = (0, smithy_client_1.take)(data, {
1202
- code: smithy_client_1.expectString,
1203
- message: smithy_client_1.expectString,
1204
- });
1205
- Object.assign(contents, doc);
1206
- const exception = new models_0_1.AccessDeniedException({
1207
- $metadata: deserializeMetadata(parsedOutput),
1208
- ...contents,
1209
- });
1210
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1211
- };
1212
- const de_BadRequestExceptionRes = async (parsedOutput, context) => {
1213
- const contents = (0, smithy_client_1.map)({});
1214
- const data = parsedOutput.body;
1215
- const doc = (0, smithy_client_1.take)(data, {
1216
- code: smithy_client_1.expectString,
1217
- message: smithy_client_1.expectString,
1218
- });
1219
- Object.assign(contents, doc);
1220
- const exception = new models_0_1.BadRequestException({
1221
- $metadata: deserializeMetadata(parsedOutput),
1222
- ...contents,
1223
- });
1224
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1225
- };
1226
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1227
- const contents = (0, smithy_client_1.map)({});
1228
- const data = parsedOutput.body;
1229
- const doc = (0, smithy_client_1.take)(data, {
1230
- code: smithy_client_1.expectString,
1231
- message: smithy_client_1.expectString,
1232
- });
1233
- Object.assign(contents, doc);
1234
- const exception = new models_0_1.ConflictException({
1235
- $metadata: deserializeMetadata(parsedOutput),
1236
- ...contents,
1237
- });
1238
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1239
- };
1240
- const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
1241
- const contents = (0, smithy_client_1.map)({});
1242
- const data = parsedOutput.body;
1243
- const doc = (0, smithy_client_1.take)(data, {
1244
- code: smithy_client_1.expectString,
1245
- message: smithy_client_1.expectString,
1246
- });
1247
- Object.assign(contents, doc);
1248
- const exception = new models_0_1.InternalServiceErrorException({
1249
- $metadata: deserializeMetadata(parsedOutput),
1250
- ...contents,
1251
- });
1252
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1253
- };
1254
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
1255
- const contents = (0, smithy_client_1.map)({});
1256
- const data = parsedOutput.body;
1257
- const doc = (0, smithy_client_1.take)(data, {
1258
- code: smithy_client_1.expectString,
1259
- message: smithy_client_1.expectString,
1260
- });
1261
- Object.assign(contents, doc);
1262
- const exception = new models_0_1.NotFoundException({
1263
- $metadata: deserializeMetadata(parsedOutput),
1264
- ...contents,
1265
- });
1266
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1267
- };
1268
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1269
- const contents = (0, smithy_client_1.map)({});
1270
- const data = parsedOutput.body;
1271
- const doc = (0, smithy_client_1.take)(data, {
1272
- code: smithy_client_1.expectString,
1273
- message: smithy_client_1.expectString,
1274
- });
1275
- Object.assign(contents, doc);
1276
- const exception = new models_0_1.ResourceNotFoundException({
1277
- $metadata: deserializeMetadata(parsedOutput),
1278
- ...contents,
1279
- });
1280
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1281
- };
1282
- const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
1283
- const contents = (0, smithy_client_1.map)({});
1284
- const data = parsedOutput.body;
1285
- const doc = (0, smithy_client_1.take)(data, {
1286
- code: smithy_client_1.expectString,
1287
- message: smithy_client_1.expectString,
1288
- });
1289
- Object.assign(contents, doc);
1290
- const exception = new models_0_1.ServiceLimitExceededException({
1291
- $metadata: deserializeMetadata(parsedOutput),
1292
- ...contents,
1293
- });
1294
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1295
- };
1296
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1297
- const contents = (0, smithy_client_1.map)({});
1298
- const data = parsedOutput.body;
1299
- const doc = (0, smithy_client_1.take)(data, {
1300
- code: smithy_client_1.expectString,
1301
- message: smithy_client_1.expectString,
1302
- });
1303
- Object.assign(contents, doc);
1304
- const exception = new models_0_1.ThrottlingException({
1305
- $metadata: deserializeMetadata(parsedOutput),
1306
- ...contents,
1307
- });
1308
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1309
- };
1310
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1311
- const contents = (0, smithy_client_1.map)({});
1312
- const data = parsedOutput.body;
1313
- const doc = (0, smithy_client_1.take)(data, {
1314
- code: smithy_client_1.expectString,
1315
- message: smithy_client_1.expectString,
1316
- });
1317
- Object.assign(contents, doc);
1318
- const exception = new models_0_1.TooManyRequestsException({
1319
- $metadata: deserializeMetadata(parsedOutput),
1320
- ...contents,
1321
- });
1322
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1323
- };
1324
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1325
- const contents = (0, smithy_client_1.map)({});
1326
- const data = parsedOutput.body;
1327
- const doc = (0, smithy_client_1.take)(data, {
1328
- code: smithy_client_1.expectString,
1329
- message: smithy_client_1.expectString,
1330
- });
1331
- Object.assign(contents, doc);
1332
- const exception = new models_0_1.ValidationException({
1333
- $metadata: deserializeMetadata(parsedOutput),
1334
- ...contents,
1335
- });
1336
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1337
- };
1338
- const de_SigningJob = (output, context) => {
1339
- return (0, smithy_client_1.take)(output, {
1340
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1341
- isRevoked: smithy_client_1.expectBoolean,
1342
- jobId: smithy_client_1.expectString,
1343
- jobInvoker: smithy_client_1.expectString,
1344
- jobOwner: smithy_client_1.expectString,
1345
- platformDisplayName: smithy_client_1.expectString,
1346
- platformId: smithy_client_1.expectString,
1347
- profileName: smithy_client_1.expectString,
1348
- profileVersion: smithy_client_1.expectString,
1349
- signatureExpiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1350
- signedObject: smithy_client_1._json,
1351
- signingMaterial: smithy_client_1._json,
1352
- source: smithy_client_1._json,
1353
- status: smithy_client_1.expectString,
1354
- });
1355
- };
1356
- const de_SigningJobRevocationRecord = (output, context) => {
1357
- return (0, smithy_client_1.take)(output, {
1358
- reason: smithy_client_1.expectString,
1359
- revokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1360
- revokedBy: smithy_client_1.expectString,
1361
- });
1362
- };
1363
- const de_SigningJobs = (output, context) => {
1364
- const retVal = (output || [])
1365
- .filter((e) => e != null)
1366
- .map((entry) => {
1367
- return de_SigningJob(entry, context);
1368
- });
1369
- return retVal;
1370
- };
1371
- const de_SigningProfileRevocationRecord = (output, context) => {
1372
- return (0, smithy_client_1.take)(output, {
1373
- revocationEffectiveFrom: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1374
- revokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1375
- revokedBy: smithy_client_1.expectString,
1376
- });
1377
- };
1378
- const deserializeMetadata = (output) => ({
1379
- httpStatusCode: output.statusCode,
1380
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1381
- extendedRequestId: output.headers["x-amz-id-2"],
1382
- cfId: output.headers["x-amz-cf-id"],
1383
- });
1384
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1385
- const isSerializableHeaderValue = (value) => value !== undefined &&
1386
- value !== null &&
1387
- value !== "" &&
1388
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1389
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1390
- const _c = "category";
1391
- const _cH = "certificateHashes";
1392
- const _iC = "includeCanceled";
1393
- const _iR = "isRevoked";
1394
- const _jA = "jobArn";
1395
- const _jI = "jobInvoker";
1396
- const _mR = "maxResults";
1397
- const _nT = "nextToken";
1398
- const _p = "partner";
1399
- const _pI = "platformId";
1400
- const _pO = "profileOwner";
1401
- const _pVA = "profileVersionArn";
1402
- const _rB = "requestedBy";
1403
- const _rI = "revisionId";
1404
- const _s = "status";
1405
- const _sEA = "signatureExpiresAfter";
1406
- const _sEB = "signatureExpiresBefore";
1407
- const _sT = "signatureTimestamp";
1408
- const _st = "statuses";
1409
- const _t = "target";
1410
- const _tK = "tagKeys";
1411
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1412
- if (encoded.length) {
1413
- return JSON.parse(encoded);
1414
- }
1415
- return {};
1416
- });
1417
- const parseErrorBody = async (errorBody, context) => {
1418
- const value = await parseBody(errorBody, context);
1419
- value.message = value.message ?? value.Message;
1420
- return value;
1421
- };
1422
- const loadRestJsonErrorCode = (output, data) => {
1423
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1424
- const sanitizeErrorCode = (rawValue) => {
1425
- let cleanValue = rawValue;
1426
- if (typeof cleanValue === "number") {
1427
- cleanValue = cleanValue.toString();
1428
- }
1429
- if (cleanValue.indexOf(",") >= 0) {
1430
- cleanValue = cleanValue.split(",")[0];
1431
- }
1432
- if (cleanValue.indexOf(":") >= 0) {
1433
- cleanValue = cleanValue.split(":")[0];
1434
- }
1435
- if (cleanValue.indexOf("#") >= 0) {
1436
- cleanValue = cleanValue.split("#")[1];
1437
- }
1438
- return cleanValue;
1439
- };
1440
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1441
- if (headerKey !== undefined) {
1442
- return sanitizeErrorCode(output.headers[headerKey]);
1443
- }
1444
- if (data.code !== undefined) {
1445
- return sanitizeErrorCode(data.code);
1446
- }
1447
- if (data["__type"] !== undefined) {
1448
- return sanitizeErrorCode(data["__type"]);
1449
- }
1450
- };
1
+ module.exports = require("../index.js");