@aws-sdk/client-artifact 3.515.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 (115) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +253 -0
  3. package/dist-cjs/Artifact.js +23 -0
  4. package/dist-cjs/ArtifactClient.js +56 -0
  5. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  6. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  7. package/dist-cjs/commands/GetAccountSettingsCommand.js +28 -0
  8. package/dist-cjs/commands/GetReportCommand.js +28 -0
  9. package/dist-cjs/commands/GetReportMetadataCommand.js +28 -0
  10. package/dist-cjs/commands/GetTermForReportCommand.js +28 -0
  11. package/dist-cjs/commands/ListReportsCommand.js +28 -0
  12. package/dist-cjs/commands/PutAccountSettingsCommand.js +28 -0
  13. package/dist-cjs/commands/index.js +9 -0
  14. package/dist-cjs/endpoint/EndpointParameters.js +18 -0
  15. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  16. package/dist-cjs/endpoint/ruleset.js +7 -0
  17. package/dist-cjs/extensionConfiguration.js +2 -0
  18. package/dist-cjs/index.js +12 -0
  19. package/dist-cjs/models/ArtifactServiceException.js +12 -0
  20. package/dist-cjs/models/index.js +4 -0
  21. package/dist-cjs/models/models_0.js +138 -0
  22. package/dist-cjs/pagination/Interfaces.js +2 -0
  23. package/dist-cjs/pagination/ListReportsPaginator.js +7 -0
  24. package/dist-cjs/pagination/index.js +5 -0
  25. package/dist-cjs/protocols/Aws_restJson1.js +432 -0
  26. package/dist-cjs/runtimeConfig.browser.js +39 -0
  27. package/dist-cjs/runtimeConfig.js +49 -0
  28. package/dist-cjs/runtimeConfig.native.js +15 -0
  29. package/dist-cjs/runtimeConfig.shared.js +34 -0
  30. package/dist-cjs/runtimeExtensions.js +25 -0
  31. package/dist-es/Artifact.js +19 -0
  32. package/dist-es/ArtifactClient.js +52 -0
  33. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  34. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  35. package/dist-es/commands/GetAccountSettingsCommand.js +24 -0
  36. package/dist-es/commands/GetReportCommand.js +24 -0
  37. package/dist-es/commands/GetReportMetadataCommand.js +24 -0
  38. package/dist-es/commands/GetTermForReportCommand.js +24 -0
  39. package/dist-es/commands/ListReportsCommand.js +24 -0
  40. package/dist-es/commands/PutAccountSettingsCommand.js +24 -0
  41. package/dist-es/commands/index.js +6 -0
  42. package/dist-es/endpoint/EndpointParameters.js +14 -0
  43. package/dist-es/endpoint/endpointResolver.js +8 -0
  44. package/dist-es/endpoint/ruleset.js +4 -0
  45. package/dist-es/extensionConfiguration.js +1 -0
  46. package/dist-es/index.js +7 -0
  47. package/dist-es/models/ArtifactServiceException.js +8 -0
  48. package/dist-es/models/index.js +1 -0
  49. package/dist-es/models/models_0.js +128 -0
  50. package/dist-es/pagination/Interfaces.js +1 -0
  51. package/dist-es/pagination/ListReportsPaginator.js +4 -0
  52. package/dist-es/pagination/index.js +2 -0
  53. package/dist-es/protocols/Aws_restJson1.js +417 -0
  54. package/dist-es/runtimeConfig.browser.js +34 -0
  55. package/dist-es/runtimeConfig.js +44 -0
  56. package/dist-es/runtimeConfig.native.js +11 -0
  57. package/dist-es/runtimeConfig.shared.js +30 -0
  58. package/dist-es/runtimeExtensions.js +21 -0
  59. package/dist-types/Artifact.d.ts +52 -0
  60. package/dist-types/ArtifactClient.d.ts +177 -0
  61. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  62. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  63. package/dist-types/commands/GetAccountSettingsCommand.d.ts +79 -0
  64. package/dist-types/commands/GetReportCommand.d.ts +81 -0
  65. package/dist-types/commands/GetReportMetadataCommand.d.ts +98 -0
  66. package/dist-types/commands/GetTermForReportCommand.d.ts +81 -0
  67. package/dist-types/commands/ListReportsCommand.d.ts +95 -0
  68. package/dist-types/commands/PutAccountSettingsCommand.d.ts +81 -0
  69. package/dist-types/commands/index.d.ts +6 -0
  70. package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
  71. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  72. package/dist-types/endpoint/ruleset.d.ts +2 -0
  73. package/dist-types/extensionConfiguration.d.ts +9 -0
  74. package/dist-types/index.d.ts +15 -0
  75. package/dist-types/models/ArtifactServiceException.d.ts +13 -0
  76. package/dist-types/models/index.d.ts +1 -0
  77. package/dist-types/models/models_0.d.ts +605 -0
  78. package/dist-types/pagination/Interfaces.d.ts +8 -0
  79. package/dist-types/pagination/ListReportsPaginator.d.ts +7 -0
  80. package/dist-types/pagination/index.d.ts +2 -0
  81. package/dist-types/protocols/Aws_restJson1.d.ts +56 -0
  82. package/dist-types/runtimeConfig.browser.d.ts +48 -0
  83. package/dist-types/runtimeConfig.d.ts +48 -0
  84. package/dist-types/runtimeConfig.native.d.ts +47 -0
  85. package/dist-types/runtimeConfig.shared.d.ts +21 -0
  86. package/dist-types/runtimeExtensions.d.ts +17 -0
  87. package/dist-types/ts3.4/Artifact.d.ts +107 -0
  88. package/dist-types/ts3.4/ArtifactClient.d.ts +156 -0
  89. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  90. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  91. package/dist-types/ts3.4/commands/GetAccountSettingsCommand.d.ts +30 -0
  92. package/dist-types/ts3.4/commands/GetReportCommand.d.ts +26 -0
  93. package/dist-types/ts3.4/commands/GetReportMetadataCommand.d.ts +30 -0
  94. package/dist-types/ts3.4/commands/GetTermForReportCommand.d.ts +29 -0
  95. package/dist-types/ts3.4/commands/ListReportsCommand.d.ts +26 -0
  96. package/dist-types/ts3.4/commands/PutAccountSettingsCommand.d.ts +30 -0
  97. package/dist-types/ts3.4/commands/index.d.ts +6 -0
  98. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  99. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  100. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  101. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  102. package/dist-types/ts3.4/index.d.ts +10 -0
  103. package/dist-types/ts3.4/models/ArtifactServiceException.d.ts +8 -0
  104. package/dist-types/ts3.4/models/index.d.ts +1 -0
  105. package/dist-types/ts3.4/models/models_0.d.ts +187 -0
  106. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  107. package/dist-types/ts3.4/pagination/ListReportsPaginator.d.ts +11 -0
  108. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  109. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +77 -0
  110. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  111. package/dist-types/ts3.4/runtimeConfig.d.ts +101 -0
  112. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  113. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
  114. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  115. package/package.json +101 -0
@@ -0,0 +1,432 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_PutAccountSettingsCommand = exports.de_ListReportsCommand = exports.de_GetTermForReportCommand = exports.de_GetReportMetadataCommand = exports.de_GetReportCommand = exports.de_GetAccountSettingsCommand = exports.se_PutAccountSettingsCommand = exports.se_ListReportsCommand = exports.se_GetTermForReportCommand = exports.se_GetReportMetadataCommand = exports.se_GetReportCommand = exports.se_GetAccountSettingsCommand = void 0;
4
+ const core_1 = require("@smithy/core");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const ArtifactServiceException_1 = require("../models/ArtifactServiceException");
7
+ const models_0_1 = require("../models/models_0");
8
+ const se_GetAccountSettingsCommand = async (input, context) => {
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ b.bp("/v1/account-settings/get");
14
+ let body;
15
+ body = "";
16
+ b.m("GET").h(headers).b(body);
17
+ return b.build();
18
+ };
19
+ exports.se_GetAccountSettingsCommand = se_GetAccountSettingsCommand;
20
+ const se_GetReportCommand = async (input, context) => {
21
+ const b = (0, core_1.requestBuilder)(input, context);
22
+ const headers = {};
23
+ b.bp("/v1/report/get");
24
+ const query = (0, smithy_client_1.map)({
25
+ [_rI]: [, (0, smithy_client_1.expectNonNull)(input[_rI], `reportId`)],
26
+ [_rV]: [() => input.reportVersion !== void 0, () => input[_rV].toString()],
27
+ [_tT]: [, (0, smithy_client_1.expectNonNull)(input[_tT], `termToken`)],
28
+ });
29
+ let body;
30
+ b.m("GET").h(headers).q(query).b(body);
31
+ return b.build();
32
+ };
33
+ exports.se_GetReportCommand = se_GetReportCommand;
34
+ const se_GetReportMetadataCommand = async (input, context) => {
35
+ const b = (0, core_1.requestBuilder)(input, context);
36
+ const headers = {};
37
+ b.bp("/v1/report/getMetadata");
38
+ const query = (0, smithy_client_1.map)({
39
+ [_rI]: [, (0, smithy_client_1.expectNonNull)(input[_rI], `reportId`)],
40
+ [_rV]: [() => input.reportVersion !== void 0, () => input[_rV].toString()],
41
+ });
42
+ let body;
43
+ b.m("GET").h(headers).q(query).b(body);
44
+ return b.build();
45
+ };
46
+ exports.se_GetReportMetadataCommand = se_GetReportMetadataCommand;
47
+ const se_GetTermForReportCommand = async (input, context) => {
48
+ const b = (0, core_1.requestBuilder)(input, context);
49
+ const headers = {};
50
+ b.bp("/v1/report/getTermForReport");
51
+ const query = (0, smithy_client_1.map)({
52
+ [_rI]: [, (0, smithy_client_1.expectNonNull)(input[_rI], `reportId`)],
53
+ [_rV]: [() => input.reportVersion !== void 0, () => input[_rV].toString()],
54
+ });
55
+ let body;
56
+ b.m("GET").h(headers).q(query).b(body);
57
+ return b.build();
58
+ };
59
+ exports.se_GetTermForReportCommand = se_GetTermForReportCommand;
60
+ const se_ListReportsCommand = async (input, context) => {
61
+ const b = (0, core_1.requestBuilder)(input, context);
62
+ const headers = {};
63
+ b.bp("/v1/report/list");
64
+ const query = (0, smithy_client_1.map)({
65
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
66
+ [_nT]: [, input[_nT]],
67
+ });
68
+ let body;
69
+ b.m("GET").h(headers).q(query).b(body);
70
+ return b.build();
71
+ };
72
+ exports.se_ListReportsCommand = se_ListReportsCommand;
73
+ const se_PutAccountSettingsCommand = async (input, context) => {
74
+ const b = (0, core_1.requestBuilder)(input, context);
75
+ const headers = {
76
+ "content-type": "application/json",
77
+ };
78
+ b.bp("/v1/account-settings/put");
79
+ let body;
80
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
81
+ notificationSubscriptionStatus: [],
82
+ }));
83
+ b.m("PUT").h(headers).b(body);
84
+ return b.build();
85
+ };
86
+ exports.se_PutAccountSettingsCommand = se_PutAccountSettingsCommand;
87
+ const de_GetAccountSettingsCommand = async (output, context) => {
88
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
89
+ return de_CommandError(output, context);
90
+ }
91
+ const contents = (0, smithy_client_1.map)({
92
+ $metadata: deserializeMetadata(output),
93
+ });
94
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
95
+ const doc = (0, smithy_client_1.take)(data, {
96
+ accountSettings: smithy_client_1._json,
97
+ });
98
+ Object.assign(contents, doc);
99
+ return contents;
100
+ };
101
+ exports.de_GetAccountSettingsCommand = de_GetAccountSettingsCommand;
102
+ const de_GetReportCommand = async (output, context) => {
103
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
104
+ return de_CommandError(output, context);
105
+ }
106
+ const contents = (0, smithy_client_1.map)({
107
+ $metadata: deserializeMetadata(output),
108
+ });
109
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
110
+ const doc = (0, smithy_client_1.take)(data, {
111
+ documentPresignedUrl: smithy_client_1.expectString,
112
+ });
113
+ Object.assign(contents, doc);
114
+ return contents;
115
+ };
116
+ exports.de_GetReportCommand = de_GetReportCommand;
117
+ const de_GetReportMetadataCommand = async (output, context) => {
118
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
119
+ return de_CommandError(output, context);
120
+ }
121
+ const contents = (0, smithy_client_1.map)({
122
+ $metadata: deserializeMetadata(output),
123
+ });
124
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
125
+ const doc = (0, smithy_client_1.take)(data, {
126
+ reportDetails: (_) => de_ReportDetail(_, context),
127
+ });
128
+ Object.assign(contents, doc);
129
+ return contents;
130
+ };
131
+ exports.de_GetReportMetadataCommand = de_GetReportMetadataCommand;
132
+ const de_GetTermForReportCommand = async (output, context) => {
133
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
134
+ return de_CommandError(output, context);
135
+ }
136
+ const contents = (0, smithy_client_1.map)({
137
+ $metadata: deserializeMetadata(output),
138
+ });
139
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
140
+ const doc = (0, smithy_client_1.take)(data, {
141
+ documentPresignedUrl: smithy_client_1.expectString,
142
+ termToken: smithy_client_1.expectString,
143
+ });
144
+ Object.assign(contents, doc);
145
+ return contents;
146
+ };
147
+ exports.de_GetTermForReportCommand = de_GetTermForReportCommand;
148
+ const de_ListReportsCommand = async (output, context) => {
149
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
150
+ return de_CommandError(output, context);
151
+ }
152
+ const contents = (0, smithy_client_1.map)({
153
+ $metadata: deserializeMetadata(output),
154
+ });
155
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
156
+ const doc = (0, smithy_client_1.take)(data, {
157
+ nextToken: smithy_client_1.expectString,
158
+ reports: (_) => de_ReportsList(_, context),
159
+ });
160
+ Object.assign(contents, doc);
161
+ return contents;
162
+ };
163
+ exports.de_ListReportsCommand = de_ListReportsCommand;
164
+ const de_PutAccountSettingsCommand = async (output, context) => {
165
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
166
+ return de_CommandError(output, context);
167
+ }
168
+ const contents = (0, smithy_client_1.map)({
169
+ $metadata: deserializeMetadata(output),
170
+ });
171
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
172
+ const doc = (0, smithy_client_1.take)(data, {
173
+ accountSettings: smithy_client_1._json,
174
+ });
175
+ Object.assign(contents, doc);
176
+ return contents;
177
+ };
178
+ exports.de_PutAccountSettingsCommand = de_PutAccountSettingsCommand;
179
+ const de_CommandError = async (output, context) => {
180
+ const parsedOutput = {
181
+ ...output,
182
+ body: await parseErrorBody(output.body, context),
183
+ };
184
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
185
+ switch (errorCode) {
186
+ case "AccessDeniedException":
187
+ case "com.amazonaws.artifact#AccessDeniedException":
188
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
189
+ case "ConflictException":
190
+ case "com.amazonaws.artifact#ConflictException":
191
+ throw await de_ConflictExceptionRes(parsedOutput, context);
192
+ case "InternalServerException":
193
+ case "com.amazonaws.artifact#InternalServerException":
194
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
195
+ case "ResourceNotFoundException":
196
+ case "com.amazonaws.artifact#ResourceNotFoundException":
197
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
198
+ case "ServiceQuotaExceededException":
199
+ case "com.amazonaws.artifact#ServiceQuotaExceededException":
200
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
201
+ case "ThrottlingException":
202
+ case "com.amazonaws.artifact#ThrottlingException":
203
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
204
+ case "ValidationException":
205
+ case "com.amazonaws.artifact#ValidationException":
206
+ throw await de_ValidationExceptionRes(parsedOutput, context);
207
+ default:
208
+ const parsedBody = parsedOutput.body;
209
+ return throwDefaultError({
210
+ output,
211
+ parsedBody,
212
+ errorCode,
213
+ });
214
+ }
215
+ };
216
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(ArtifactServiceException_1.ArtifactServiceException);
217
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
218
+ const contents = (0, smithy_client_1.map)({});
219
+ const data = parsedOutput.body;
220
+ const doc = (0, smithy_client_1.take)(data, {
221
+ message: smithy_client_1.expectString,
222
+ });
223
+ Object.assign(contents, doc);
224
+ const exception = new models_0_1.AccessDeniedException({
225
+ $metadata: deserializeMetadata(parsedOutput),
226
+ ...contents,
227
+ });
228
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
229
+ };
230
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
231
+ const contents = (0, smithy_client_1.map)({});
232
+ const data = parsedOutput.body;
233
+ const doc = (0, smithy_client_1.take)(data, {
234
+ message: smithy_client_1.expectString,
235
+ resourceId: smithy_client_1.expectString,
236
+ resourceType: smithy_client_1.expectString,
237
+ });
238
+ Object.assign(contents, doc);
239
+ const exception = new models_0_1.ConflictException({
240
+ $metadata: deserializeMetadata(parsedOutput),
241
+ ...contents,
242
+ });
243
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
244
+ };
245
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
246
+ const contents = (0, smithy_client_1.map)({
247
+ [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
248
+ });
249
+ const data = parsedOutput.body;
250
+ const doc = (0, smithy_client_1.take)(data, {
251
+ message: smithy_client_1.expectString,
252
+ });
253
+ Object.assign(contents, doc);
254
+ const exception = new models_0_1.InternalServerException({
255
+ $metadata: deserializeMetadata(parsedOutput),
256
+ ...contents,
257
+ });
258
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
259
+ };
260
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
261
+ const contents = (0, smithy_client_1.map)({});
262
+ const data = parsedOutput.body;
263
+ const doc = (0, smithy_client_1.take)(data, {
264
+ message: smithy_client_1.expectString,
265
+ resourceId: smithy_client_1.expectString,
266
+ resourceType: smithy_client_1.expectString,
267
+ });
268
+ Object.assign(contents, doc);
269
+ const exception = new models_0_1.ResourceNotFoundException({
270
+ $metadata: deserializeMetadata(parsedOutput),
271
+ ...contents,
272
+ });
273
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
274
+ };
275
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
276
+ const contents = (0, smithy_client_1.map)({});
277
+ const data = parsedOutput.body;
278
+ const doc = (0, smithy_client_1.take)(data, {
279
+ message: smithy_client_1.expectString,
280
+ quotaCode: smithy_client_1.expectString,
281
+ resourceId: smithy_client_1.expectString,
282
+ resourceType: smithy_client_1.expectString,
283
+ serviceCode: smithy_client_1.expectString,
284
+ });
285
+ Object.assign(contents, doc);
286
+ const exception = new models_0_1.ServiceQuotaExceededException({
287
+ $metadata: deserializeMetadata(parsedOutput),
288
+ ...contents,
289
+ });
290
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
291
+ };
292
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
293
+ const contents = (0, smithy_client_1.map)({
294
+ [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
295
+ });
296
+ const data = parsedOutput.body;
297
+ const doc = (0, smithy_client_1.take)(data, {
298
+ message: smithy_client_1.expectString,
299
+ quotaCode: smithy_client_1.expectString,
300
+ serviceCode: smithy_client_1.expectString,
301
+ });
302
+ Object.assign(contents, doc);
303
+ const exception = new models_0_1.ThrottlingException({
304
+ $metadata: deserializeMetadata(parsedOutput),
305
+ ...contents,
306
+ });
307
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
308
+ };
309
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
310
+ const contents = (0, smithy_client_1.map)({});
311
+ const data = parsedOutput.body;
312
+ const doc = (0, smithy_client_1.take)(data, {
313
+ fieldList: smithy_client_1._json,
314
+ message: smithy_client_1.expectString,
315
+ reason: smithy_client_1.expectString,
316
+ });
317
+ Object.assign(contents, doc);
318
+ const exception = new models_0_1.ValidationException({
319
+ $metadata: deserializeMetadata(parsedOutput),
320
+ ...contents,
321
+ });
322
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
323
+ };
324
+ const de_ReportDetail = (output, context) => {
325
+ return (0, smithy_client_1.take)(output, {
326
+ acceptanceType: smithy_client_1.expectString,
327
+ arn: smithy_client_1.expectString,
328
+ category: smithy_client_1.expectString,
329
+ companyName: smithy_client_1.expectString,
330
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
331
+ deletedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
332
+ description: smithy_client_1.expectString,
333
+ id: smithy_client_1.expectString,
334
+ lastModifiedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
335
+ name: smithy_client_1.expectString,
336
+ periodEnd: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
337
+ periodStart: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
338
+ productName: smithy_client_1.expectString,
339
+ sequenceNumber: smithy_client_1.expectLong,
340
+ series: smithy_client_1.expectString,
341
+ state: smithy_client_1.expectString,
342
+ statusMessage: smithy_client_1.expectString,
343
+ termArn: smithy_client_1.expectString,
344
+ uploadState: smithy_client_1.expectString,
345
+ version: smithy_client_1.expectLong,
346
+ });
347
+ };
348
+ const de_ReportsList = (output, context) => {
349
+ const retVal = (output || [])
350
+ .filter((e) => e != null)
351
+ .map((entry) => {
352
+ return de_ReportSummary(entry, context);
353
+ });
354
+ return retVal;
355
+ };
356
+ const de_ReportSummary = (output, context) => {
357
+ return (0, smithy_client_1.take)(output, {
358
+ arn: smithy_client_1.expectString,
359
+ category: smithy_client_1.expectString,
360
+ companyName: smithy_client_1.expectString,
361
+ description: smithy_client_1.expectString,
362
+ id: smithy_client_1.expectString,
363
+ name: smithy_client_1.expectString,
364
+ periodEnd: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
365
+ periodStart: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
366
+ productName: smithy_client_1.expectString,
367
+ series: smithy_client_1.expectString,
368
+ state: smithy_client_1.expectString,
369
+ statusMessage: smithy_client_1.expectString,
370
+ uploadState: smithy_client_1.expectString,
371
+ version: smithy_client_1.expectLong,
372
+ });
373
+ };
374
+ const deserializeMetadata = (output) => ({
375
+ httpStatusCode: output.statusCode,
376
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
377
+ extendedRequestId: output.headers["x-amz-id-2"],
378
+ cfId: output.headers["x-amz-cf-id"],
379
+ });
380
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
381
+ const isSerializableHeaderValue = (value) => value !== undefined &&
382
+ value !== null &&
383
+ value !== "" &&
384
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
385
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
386
+ const _mR = "maxResults";
387
+ const _nT = "nextToken";
388
+ const _rAS = "retryAfterSeconds";
389
+ const _rI = "reportId";
390
+ const _rV = "reportVersion";
391
+ const _ra = "retry-after";
392
+ const _tT = "termToken";
393
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
394
+ if (encoded.length) {
395
+ return JSON.parse(encoded);
396
+ }
397
+ return {};
398
+ });
399
+ const parseErrorBody = async (errorBody, context) => {
400
+ const value = await parseBody(errorBody, context);
401
+ value.message = value.message ?? value.Message;
402
+ return value;
403
+ };
404
+ const loadRestJsonErrorCode = (output, data) => {
405
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
406
+ const sanitizeErrorCode = (rawValue) => {
407
+ let cleanValue = rawValue;
408
+ if (typeof cleanValue === "number") {
409
+ cleanValue = cleanValue.toString();
410
+ }
411
+ if (cleanValue.indexOf(",") >= 0) {
412
+ cleanValue = cleanValue.split(",")[0];
413
+ }
414
+ if (cleanValue.indexOf(":") >= 0) {
415
+ cleanValue = cleanValue.split(":")[0];
416
+ }
417
+ if (cleanValue.indexOf("#") >= 0) {
418
+ cleanValue = cleanValue.split("#")[1];
419
+ }
420
+ return cleanValue;
421
+ };
422
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
423
+ if (headerKey !== undefined) {
424
+ return sanitizeErrorCode(output.headers[headerKey]);
425
+ }
426
+ if (data.code !== undefined) {
427
+ return sanitizeErrorCode(data.code);
428
+ }
429
+ if (data["__type"] !== undefined) {
430
+ return sanitizeErrorCode(data["__type"]);
431
+ }
432
+ };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
+ const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
8
+ const config_resolver_1 = require("@smithy/config-resolver");
9
+ const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
10
+ const invalid_dependency_1 = require("@smithy/invalid-dependency");
11
+ const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
12
+ const util_retry_1 = require("@smithy/util-retry");
13
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
14
+ const smithy_client_1 = require("@smithy/smithy-client");
15
+ const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
16
+ const getRuntimeConfig = (config) => {
17
+ const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
18
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
19
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
20
+ return {
21
+ ...clientSharedValues,
22
+ ...config,
23
+ runtime: "browser",
24
+ defaultsMode,
25
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
26
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
27
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
28
+ (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
29
+ maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
30
+ region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
31
+ requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
32
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
33
+ sha256: config?.sha256 ?? sha256_browser_1.Sha256,
34
+ streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
35
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
36
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
37
+ };
38
+ };
39
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const core_1 = require("@aws-sdk/core");
7
+ const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
8
+ const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
9
+ const config_resolver_1 = require("@smithy/config-resolver");
10
+ const hash_node_1 = require("@smithy/hash-node");
11
+ const middleware_retry_1 = require("@smithy/middleware-retry");
12
+ const node_config_provider_1 = require("@smithy/node-config-provider");
13
+ const node_http_handler_1 = require("@smithy/node-http-handler");
14
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
15
+ const util_retry_1 = require("@smithy/util-retry");
16
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
17
+ const smithy_client_1 = require("@smithy/smithy-client");
18
+ const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
19
+ const smithy_client_2 = require("@smithy/smithy-client");
20
+ const getRuntimeConfig = (config) => {
21
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
22
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
23
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
24
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
25
+ (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
26
+ return {
27
+ ...clientSharedValues,
28
+ ...config,
29
+ runtime: "node",
30
+ defaultsMode,
31
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
32
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
33
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
34
+ (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
35
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
36
+ region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
37
+ requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
38
+ retryMode: config?.retryMode ??
39
+ (0, node_config_provider_1.loadConfig)({
40
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
41
+ default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
42
+ }),
43
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
44
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
45
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
46
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
47
+ };
48
+ };
49
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
+ const getRuntimeConfig = (config) => {
7
+ const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
8
+ return {
9
+ ...browserDefaults,
10
+ ...config,
11
+ runtime: "react-native",
12
+ sha256: config?.sha256 ?? sha256_js_1.Sha256,
13
+ };
14
+ };
15
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const url_parser_1 = require("@smithy/url-parser");
7
+ const util_base64_1 = require("@smithy/util-base64");
8
+ const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
10
+ const endpointResolver_1 = require("./endpoint/endpointResolver");
11
+ const getRuntimeConfig = (config) => {
12
+ return {
13
+ apiVersion: "2018-05-10",
14
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
15
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
16
+ disableHostPrefix: config?.disableHostPrefix ?? false,
17
+ endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
18
+ extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultArtifactHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
27
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
28
+ serviceId: config?.serviceId ?? "Artifact",
29
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
30
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
31
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
32
+ };
33
+ };
34
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveRuntimeExtensions = void 0;
4
+ const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
+ const protocol_http_1 = require("@smithy/protocol-http");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
8
+ const asPartial = (t) => t;
9
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
10
+ const extensionConfiguration = {
11
+ ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
12
+ ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
13
+ ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
14
+ ...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
15
+ };
16
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
17
+ return {
18
+ ...runtimeConfig,
19
+ ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
20
+ ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
21
+ ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
22
+ ...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
23
+ };
24
+ };
25
+ exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
@@ -0,0 +1,19 @@
1
+ import { createAggregatedClient } from "@smithy/smithy-client";
2
+ import { ArtifactClient } from "./ArtifactClient";
3
+ import { GetAccountSettingsCommand, } from "./commands/GetAccountSettingsCommand";
4
+ import { GetReportCommand } from "./commands/GetReportCommand";
5
+ import { GetReportMetadataCommand, } from "./commands/GetReportMetadataCommand";
6
+ import { GetTermForReportCommand, } from "./commands/GetTermForReportCommand";
7
+ import { ListReportsCommand } from "./commands/ListReportsCommand";
8
+ import { PutAccountSettingsCommand, } from "./commands/PutAccountSettingsCommand";
9
+ const commands = {
10
+ GetAccountSettingsCommand,
11
+ GetReportCommand,
12
+ GetReportMetadataCommand,
13
+ GetTermForReportCommand,
14
+ ListReportsCommand,
15
+ PutAccountSettingsCommand,
16
+ };
17
+ export class Artifact extends ArtifactClient {
18
+ }
19
+ createAggregatedClient(commands, Artifact);
@@ -0,0 +1,52 @@
1
+ import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
+ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
+ import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
+ import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
5
+ import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
+ import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
+ import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
+ import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
+ import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultArtifactHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
12
+ import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
13
+ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
14
+ import { resolveRuntimeExtensions } from "./runtimeExtensions";
15
+ export { __Client };
16
+ export class ArtifactClient extends __Client {
17
+ constructor(...[configuration]) {
18
+ const _config_0 = __getRuntimeConfig(configuration || {});
19
+ const _config_1 = resolveClientEndpointParameters(_config_0);
20
+ const _config_2 = resolveRegionConfig(_config_1);
21
+ const _config_3 = resolveEndpointConfig(_config_2);
22
+ const _config_4 = resolveRetryConfig(_config_3);
23
+ const _config_5 = resolveHostHeaderConfig(_config_4);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
26
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
27
+ super(_config_8);
28
+ this.config = _config_8;
29
+ this.middlewareStack.use(getRetryPlugin(this.config));
30
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
31
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
32
+ this.middlewareStack.use(getLoggerPlugin(this.config));
33
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
34
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
40
+ }
41
+ destroy() {
42
+ super.destroy();
43
+ }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultArtifactHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
52
+ }