@aws-sdk/client-abuse-signal 0.0.0-stage → 3.1172.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 (91) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +201 -2
  3. package/dist-cjs/index.js +785 -0
  4. package/dist-es/AbuseSignal.js +21 -0
  5. package/dist-es/AbuseSignalClient.js +48 -0
  6. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  7. package/dist-es/auth/httpAuthSchemeProvider.js +122 -0
  8. package/dist-es/commandBuilder.js +6 -0
  9. package/dist-es/commands/CreateAbuseReportCommand.js +4 -0
  10. package/dist-es/commands/GetAbuseReportStatusCommand.js +4 -0
  11. package/dist-es/commands/ListAbuseReportStatusesCommand.js +4 -0
  12. package/dist-es/commands/index.js +3 -0
  13. package/dist-es/endpoint/EndpointParameters.js +13 -0
  14. package/dist-es/endpoint/bdd.js +46 -0
  15. package/dist-es/endpoint/endpointResolver.js +14 -0
  16. package/dist-es/extensionConfiguration.js +1 -0
  17. package/dist-es/index.js +11 -0
  18. package/dist-es/models/AbuseSignalServiceException.js +9 -0
  19. package/dist-es/models/enums.js +12 -0
  20. package/dist-es/models/errors.js +110 -0
  21. package/dist-es/models/models_0.js +1 -0
  22. package/dist-es/pagination/Interfaces.js +1 -0
  23. package/dist-es/pagination/ListAbuseReportStatusesPaginator.js +4 -0
  24. package/dist-es/pagination/index.js +2 -0
  25. package/dist-es/runtimeConfig.browser.js +29 -0
  26. package/dist-es/runtimeConfig.js +45 -0
  27. package/dist-es/runtimeConfig.native.js +9 -0
  28. package/dist-es/runtimeConfig.shared.js +47 -0
  29. package/dist-es/runtimeExtensions.js +9 -0
  30. package/dist-es/schemas/schemas_0.js +176 -0
  31. package/dist-es/waiters/index.js +1 -0
  32. package/dist-es/waiters/waitForReportProcessing.js +43 -0
  33. package/dist-types/AbuseSignal.d.ts +52 -0
  34. package/dist-types/AbuseSignalClient.d.ts +190 -0
  35. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  36. package/dist-types/auth/httpAuthSchemeProvider.d.ts +83 -0
  37. package/dist-types/commandBuilder.d.ts +18 -0
  38. package/dist-types/commands/CreateAbuseReportCommand.d.ts +112 -0
  39. package/dist-types/commands/GetAbuseReportStatusCommand.d.ts +110 -0
  40. package/dist-types/commands/ListAbuseReportStatusesCommand.d.ts +113 -0
  41. package/dist-types/commands/index.d.ts +3 -0
  42. package/dist-types/endpoint/EndpointParameters.d.ts +50 -0
  43. package/dist-types/endpoint/bdd.d.ts +2 -0
  44. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  45. package/dist-types/extensionConfiguration.d.ts +9 -0
  46. package/dist-types/index.d.ts +19 -0
  47. package/dist-types/models/AbuseSignalServiceException.d.ts +15 -0
  48. package/dist-types/models/enums.d.ts +28 -0
  49. package/dist-types/models/errors.d.ts +133 -0
  50. package/dist-types/models/models_0.d.ts +229 -0
  51. package/dist-types/pagination/Interfaces.d.ts +8 -0
  52. package/dist-types/pagination/ListAbuseReportStatusesPaginator.d.ts +7 -0
  53. package/dist-types/pagination/index.d.ts +2 -0
  54. package/dist-types/runtimeConfig.browser.d.ts +58 -0
  55. package/dist-types/runtimeConfig.d.ts +59 -0
  56. package/dist-types/runtimeConfig.native.d.ts +57 -0
  57. package/dist-types/runtimeConfig.shared.d.ts +30 -0
  58. package/dist-types/runtimeExtensions.d.ts +17 -0
  59. package/dist-types/schemas/schemas_0.d.ts +29 -0
  60. package/dist-types/ts3.4/AbuseSignal.d.ts +83 -0
  61. package/dist-types/ts3.4/AbuseSignalClient.d.ts +119 -0
  62. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +25 -0
  63. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +53 -0
  64. package/dist-types/ts3.4/commandBuilder.d.ts +40 -0
  65. package/dist-types/ts3.4/commands/CreateAbuseReportCommand.d.ts +39 -0
  66. package/dist-types/ts3.4/commands/GetAbuseReportStatusCommand.d.ts +39 -0
  67. package/dist-types/ts3.4/commands/ListAbuseReportStatusesCommand.d.ts +42 -0
  68. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  69. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  70. package/dist-types/ts3.4/endpoint/bdd.d.ts +2 -0
  71. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  72. package/dist-types/ts3.4/extensionConfiguration.d.ts +10 -0
  73. package/dist-types/ts3.4/index.d.ts +14 -0
  74. package/dist-types/ts3.4/models/AbuseSignalServiceException.d.ts +10 -0
  75. package/dist-types/ts3.4/models/enums.d.ts +15 -0
  76. package/dist-types/ts3.4/models/errors.d.ts +56 -0
  77. package/dist-types/ts3.4/models/models_0.d.ts +63 -0
  78. package/dist-types/ts3.4/pagination/Interfaces.d.ts +5 -0
  79. package/dist-types/ts3.4/pagination/ListAbuseReportStatusesPaginator.d.ts +11 -0
  80. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  81. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +99 -0
  82. package/dist-types/ts3.4/runtimeConfig.d.ts +99 -0
  83. package/dist-types/ts3.4/runtimeConfig.native.d.ts +103 -0
  84. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +38 -0
  85. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  86. package/dist-types/ts3.4/schemas/schemas_0.d.ts +29 -0
  87. package/dist-types/ts3.4/waiters/index.d.ts +1 -0
  88. package/dist-types/ts3.4/waiters/waitForReportProcessing.d.ts +15 -0
  89. package/dist-types/waiters/index.d.ts +1 -0
  90. package/dist-types/waiters/waitForReportProcessing.d.ts +29 -0
  91. package/package.json +68 -4
@@ -0,0 +1,785 @@
1
+ const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, getDefaultSocketTimeout, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
2
+ const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, createPaginator } = require("@smithy/core");
3
+ const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, makeBuilder, createWaiter, checkExceptions, WaiterState, createAggregatedClient } = require("@smithy/core/client");
4
+ const { Command: $Command } = require("@smithy/core/client");
5
+ exports.$Command = $Command;
6
+ exports.__Client = Client;
7
+ const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config");
8
+ const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveParams, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
9
+ const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
10
+ const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
11
+ const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema");
12
+ const { resolveAwsSdkSigV4Config, resolveAwsSdkSigV4AConfig, AwsSdkSigV4Signer, AwsSdkSigV4ASigner, NODE_SIGV4A_CONFIG_OPTIONS, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
13
+ const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
14
+ const { defaultProvider } = require("@aws-sdk/credential-provider-node");
15
+ const { toUtf8, fromUtf8, toBase64, fromBase64, calculateBodyLength } = require("@smithy/core/serde");
16
+ const { streamCollector, NodeHttpHandler } = require("@smithy/node-http-handler");
17
+ const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
18
+ const { Sha256 } = require("@smithy/core/checksum");
19
+
20
+ const k = "ref";
21
+ const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
22
+ const _data = {
23
+ conditions: [
24
+ [c, [g]],
25
+ [c, j],
26
+ ["aws.partition", j, d],
27
+ [e, [{ [k]: "UseFIPS" }, b]],
28
+ [e, [{ [k]: "UseDualStack" }, b]],
29
+ [e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
30
+ [e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]]
31
+ ],
32
+ results: [
33
+ [a],
34
+ [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
35
+ [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
36
+ [g, i],
37
+ ["https://abuse-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
38
+ [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
39
+ ["https://abuse-fips.{Region}.{PartitionResult#dnsSuffix}", i],
40
+ [a, "FIPS is enabled but this partition does not support FIPS"],
41
+ ["https://abuse.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
42
+ [a, "DualStack is enabled but this partition does not support DualStack"],
43
+ ["https://abuse.{Region}.{PartitionResult#dnsSuffix}", i],
44
+ [a, "Invalid Configuration: Missing Region"]
45
+ ]
46
+ };
47
+ const root = 2;
48
+ const r = 100_000_000;
49
+ const nodes = new Int32Array([
50
+ -1, 1, -1,
51
+ 0, 12, 3,
52
+ 1, 4, r + 11,
53
+ 2, 5, r + 11,
54
+ 3, 8, 6,
55
+ 4, 7, r + 10,
56
+ 5, r + 8, r + 9,
57
+ 4, 10, 9,
58
+ 6, r + 6, r + 7,
59
+ 5, 11, r + 5,
60
+ 6, r + 4, r + 5,
61
+ 3, r + 1, 13,
62
+ 4, r + 2, r + 3,
63
+ ]);
64
+ const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
65
+
66
+ const cache = new EndpointCache({
67
+ size: 50,
68
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
69
+ });
70
+ const defaultEndpointResolver = (endpointParams, context = {}) => {
71
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
72
+ endpointParams: endpointParams,
73
+ logger: context.logger,
74
+ }));
75
+ };
76
+ customEndpointFunctions.aws = awsEndpointFunctions;
77
+
78
+ const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
79
+ if (!input) {
80
+ throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
81
+ }
82
+ const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
83
+ const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
84
+ ?.getEndpointParameterInstructions;
85
+ if (!instructionsFn) {
86
+ throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
87
+ }
88
+ const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
89
+ return Object.assign(defaultParameters, endpointParameters);
90
+ };
91
+ const _defaultAbuseSignalHttpAuthSchemeParametersProvider = async (config, context, input) => {
92
+ return {
93
+ operation: getSmithyContext(context).operation,
94
+ region: await normalizeProvider(config.region)() || (() => {
95
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
96
+ })(),
97
+ };
98
+ };
99
+ const defaultAbuseSignalHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultAbuseSignalHttpAuthSchemeParametersProvider);
100
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
101
+ return {
102
+ schemeId: "aws.auth#sigv4",
103
+ signingProperties: {
104
+ name: "abuse",
105
+ region: authParameters.region,
106
+ },
107
+ propertiesExtractor: (config, context) => ({
108
+ signingProperties: {
109
+ config,
110
+ context,
111
+ },
112
+ }),
113
+ };
114
+ }
115
+ function createAwsAuthSigv4aHttpAuthOption(authParameters) {
116
+ return {
117
+ schemeId: "aws.auth#sigv4a",
118
+ signingProperties: {
119
+ name: "abuse",
120
+ region: authParameters.region,
121
+ },
122
+ propertiesExtractor: (config, context) => ({
123
+ signingProperties: {
124
+ config,
125
+ context,
126
+ },
127
+ }),
128
+ };
129
+ }
130
+ const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
131
+ const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
132
+ const endpoint = defaultEndpointResolver(authParameters);
133
+ const authSchemes = endpoint.properties?.authSchemes;
134
+ if (!authSchemes) {
135
+ return defaultHttpAuthSchemeResolver(authParameters);
136
+ }
137
+ const options = [];
138
+ for (const scheme of authSchemes) {
139
+ const { name: resolvedName, properties = {}, ...rest } = scheme;
140
+ const name = resolvedName.toLowerCase();
141
+ if (resolvedName !== name) {
142
+ console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
143
+ }
144
+ let schemeId;
145
+ if (name === "sigv4a") {
146
+ schemeId = "aws.auth#sigv4a";
147
+ const sigv4Present = authSchemes.find((s) => {
148
+ const name = s.name.toLowerCase();
149
+ return name !== "sigv4a" && name.startsWith("sigv4");
150
+ });
151
+ if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
152
+ continue;
153
+ }
154
+ }
155
+ else if (name.startsWith("sigv4")) {
156
+ schemeId = "aws.auth#sigv4";
157
+ }
158
+ else {
159
+ throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
160
+ }
161
+ const createOption = createHttpAuthOptionFunctions[schemeId];
162
+ if (!createOption) {
163
+ throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
164
+ }
165
+ const option = createOption(authParameters);
166
+ option.schemeId = schemeId;
167
+ option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
168
+ options.push(option);
169
+ }
170
+ return options;
171
+ };
172
+ return endpointRuleSetHttpAuthSchemeProvider;
173
+ };
174
+ const _defaultAbuseSignalHttpAuthSchemeProvider = (authParameters) => {
175
+ const options = [];
176
+ switch (authParameters.operation) {
177
+ default: {
178
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
179
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
180
+ }
181
+ }
182
+ return options;
183
+ };
184
+ const defaultAbuseSignalHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultAbuseSignalHttpAuthSchemeProvider, {
185
+ "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
186
+ "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
187
+ });
188
+ const resolveHttpAuthSchemeConfig = (config) => {
189
+ const config_0 = resolveAwsSdkSigV4Config(config);
190
+ const config_1 = resolveAwsSdkSigV4AConfig(config_0);
191
+ return Object.assign(config_1, {
192
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
193
+ });
194
+ };
195
+
196
+ const resolveClientEndpointParameters = (options) => {
197
+ return Object.assign(options, {
198
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
199
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
200
+ defaultSigningName: "abuse",
201
+ });
202
+ };
203
+ const commonParams = {
204
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
205
+ Endpoint: { type: "builtInParams", name: "endpoint" },
206
+ Region: { type: "builtInParams", name: "region" },
207
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
208
+ };
209
+
210
+ var version = "3.0.0";
211
+ var packageInfo = {
212
+ version: version};
213
+
214
+ class AbuseSignalServiceException extends ServiceException {
215
+ static shapeId = "smithy.ts.sdk.synthetic.com.amazonaws.abusesignal#AbuseSignalServiceException";
216
+ constructor(options) {
217
+ super(options);
218
+ Object.setPrototypeOf(this, AbuseSignalServiceException.prototype);
219
+ }
220
+ }
221
+
222
+ class AccessDeniedException extends AbuseSignalServiceException {
223
+ static shapeId = "com.amazonaws.abusesignal#AccessDeniedException";
224
+ name = "AccessDeniedException";
225
+ $fault = "client";
226
+ constructor(opts) {
227
+ super({
228
+ name: "AccessDeniedException",
229
+ $fault: "client",
230
+ ...opts,
231
+ });
232
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
233
+ }
234
+ }
235
+ class ConflictException extends AbuseSignalServiceException {
236
+ static shapeId = "com.amazonaws.abusesignal#ConflictException";
237
+ name = "ConflictException";
238
+ $fault = "client";
239
+ constructor(opts) {
240
+ super({
241
+ name: "ConflictException",
242
+ $fault: "client",
243
+ ...opts,
244
+ });
245
+ Object.setPrototypeOf(this, ConflictException.prototype);
246
+ }
247
+ }
248
+ class InternalServerException extends AbuseSignalServiceException {
249
+ static shapeId = "com.amazonaws.abusesignal#InternalServerException";
250
+ name = "InternalServerException";
251
+ $fault = "server";
252
+ $retryable = {};
253
+ retryAfterSeconds;
254
+ constructor(opts) {
255
+ super({
256
+ name: "InternalServerException",
257
+ $fault: "server",
258
+ ...opts,
259
+ });
260
+ Object.setPrototypeOf(this, InternalServerException.prototype);
261
+ this.retryAfterSeconds = opts.retryAfterSeconds;
262
+ }
263
+ }
264
+ class SubmissionRequirementException extends AbuseSignalServiceException {
265
+ static shapeId = "com.amazonaws.abusesignal#SubmissionRequirementException";
266
+ name = "SubmissionRequirementException";
267
+ $fault = "client";
268
+ unmetRequirements;
269
+ constructor(opts) {
270
+ super({
271
+ name: "SubmissionRequirementException",
272
+ $fault: "client",
273
+ ...opts,
274
+ });
275
+ Object.setPrototypeOf(this, SubmissionRequirementException.prototype);
276
+ this.unmetRequirements = opts.unmetRequirements;
277
+ }
278
+ }
279
+ class ThrottlingException extends AbuseSignalServiceException {
280
+ static shapeId = "com.amazonaws.abusesignal#ThrottlingException";
281
+ name = "ThrottlingException";
282
+ $fault = "client";
283
+ $retryable = {
284
+ throttling: true,
285
+ };
286
+ serviceCode;
287
+ quotaCode;
288
+ retryAfterSeconds;
289
+ constructor(opts) {
290
+ super({
291
+ name: "ThrottlingException",
292
+ $fault: "client",
293
+ ...opts,
294
+ });
295
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
296
+ this.serviceCode = opts.serviceCode;
297
+ this.quotaCode = opts.quotaCode;
298
+ this.retryAfterSeconds = opts.retryAfterSeconds;
299
+ }
300
+ }
301
+ class ValidationException extends AbuseSignalServiceException {
302
+ static shapeId = "com.amazonaws.abusesignal#ValidationException";
303
+ name = "ValidationException";
304
+ $fault = "client";
305
+ fieldList;
306
+ constructor(opts) {
307
+ super({
308
+ name: "ValidationException",
309
+ $fault: "client",
310
+ ...opts,
311
+ });
312
+ Object.setPrototypeOf(this, ValidationException.prototype);
313
+ this.fieldList = opts.fieldList;
314
+ }
315
+ }
316
+ class ResourceNotFoundException extends AbuseSignalServiceException {
317
+ static shapeId = "com.amazonaws.abusesignal#ResourceNotFoundException";
318
+ name = "ResourceNotFoundException";
319
+ $fault = "client";
320
+ resourceId;
321
+ constructor(opts) {
322
+ super({
323
+ name: "ResourceNotFoundException",
324
+ $fault: "client",
325
+ ...opts,
326
+ });
327
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
328
+ this.resourceId = opts.resourceId;
329
+ }
330
+ }
331
+
332
+ const _ADE = "AccessDeniedException";
333
+ const _CAR = "CreateAbuseReport";
334
+ const _CARR = "CreateAbuseReportRequest";
335
+ const _CARRr = "CreateAbuseReportResponse";
336
+ const _CE = "ConflictException";
337
+ const _GARS = "GetAbuseReportStatus";
338
+ const _GARSR = "GetAbuseReportStatusRequest";
339
+ const _GARSRe = "GetAbuseReportStatusResponse";
340
+ const _ISE = "InternalServerException";
341
+ const _LARS = "ListAbuseReportStatuses";
342
+ const _LARSR = "ListAbuseReportStatusesRequest";
343
+ const _LARSRi = "ListAbuseReportStatusesResponse";
344
+ const _RA = "Retry-After";
345
+ const _RD = "ReportData";
346
+ const _RNFE = "ResourceNotFoundException";
347
+ const _RSL = "ReportStatusList";
348
+ const _RSLI = "ReportStatusListItem";
349
+ const _SR = "SubmissionRequirement";
350
+ const _SRE = "SubmissionRequirementException";
351
+ const _SRL = "SubmissionRequirementList";
352
+ const _TE = "ThrottlingException";
353
+ const _VE = "ValidationException";
354
+ const _VEF = "ValidationExceptionField";
355
+ const _VEFL = "ValidationExceptionFieldList";
356
+ const _c = "client";
357
+ const _cI = "correlationId";
358
+ const _cT = "clientToken";
359
+ const _co = "code";
360
+ const _d = "description";
361
+ const _e = "error";
362
+ const _fL = "fieldList";
363
+ const _h = "http";
364
+ const _hE = "httpError";
365
+ const _hH = "httpHeader";
366
+ const _hQ = "httpQuery";
367
+ const _lUA = "lastUpdatedAt";
368
+ const _m = "message";
369
+ const _mR = "maxResults";
370
+ const _nT = "nextToken";
371
+ const _p = "path";
372
+ const _qC = "quotaCode";
373
+ const _r = "report";
374
+ const _rAS = "retryAfterSeconds";
375
+ const _rC = "reasonCode";
376
+ const _rI = "resourceId";
377
+ const _rIe = "reportId";
378
+ const _re = "reports";
379
+ const _s = "smithy.ts.sdk.synthetic.com.amazonaws.abusesignal";
380
+ const _sA = "submittedAt";
381
+ const _sC = "serviceCode";
382
+ const _se = "server";
383
+ const _st = "status";
384
+ const _uR = "unmetRequirements";
385
+ const _x = "xarf";
386
+ const n0 = "com.amazonaws.abusesignal";
387
+ const _s_registry = new TypeRegistry(_s);
388
+ var AbuseSignalServiceException$ = [-3, _s, "AbuseSignalServiceException", 0, [], []];
389
+ _s_registry.registerError(AbuseSignalServiceException$, AbuseSignalServiceException);
390
+ const n0_registry = new TypeRegistry(n0);
391
+ var AccessDeniedException$ = [-3, n0, _ADE,
392
+ { [_e]: _c, [_hE]: 403 },
393
+ [_m],
394
+ [0], 1
395
+ ];
396
+ n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
397
+ var ConflictException$ = [-3, n0, _CE,
398
+ { [_e]: _c, [_hE]: 409 },
399
+ [_m],
400
+ [0], 1
401
+ ];
402
+ n0_registry.registerError(ConflictException$, ConflictException);
403
+ var InternalServerException$ = [-3, n0, _ISE,
404
+ { [_e]: _se, [_hE]: 500 },
405
+ [_m, _rAS],
406
+ [0, [1, { [_hH]: _RA }]], 1
407
+ ];
408
+ n0_registry.registerError(InternalServerException$, InternalServerException);
409
+ var ResourceNotFoundException$ = [-3, n0, _RNFE,
410
+ { [_e]: _c, [_hE]: 404 },
411
+ [_m, _rI],
412
+ [0, 0], 2
413
+ ];
414
+ n0_registry.registerError(ResourceNotFoundException$, ResourceNotFoundException);
415
+ var SubmissionRequirementException$ = [-3, n0, _SRE,
416
+ { [_e]: _c, [_hE]: 422 },
417
+ [_m, _uR],
418
+ [0, () => SubmissionRequirementList], 1
419
+ ];
420
+ n0_registry.registerError(SubmissionRequirementException$, SubmissionRequirementException);
421
+ var ThrottlingException$ = [-3, n0, _TE,
422
+ { [_e]: _c, [_hE]: 429 },
423
+ [_m, _sC, _qC, _rAS],
424
+ [0, 0, 0, [1, { [_hH]: _RA }]], 1
425
+ ];
426
+ n0_registry.registerError(ThrottlingException$, ThrottlingException);
427
+ var ValidationException$ = [-3, n0, _VE,
428
+ { [_e]: _c, [_hE]: 400 },
429
+ [_m, _fL],
430
+ [0, () => ValidationExceptionFieldList], 1
431
+ ];
432
+ n0_registry.registerError(ValidationException$, ValidationException);
433
+ const errorTypeRegistries = [
434
+ _s_registry,
435
+ n0_registry,
436
+ ];
437
+ var CreateAbuseReportRequest$ = [3, n0, _CARR,
438
+ 0,
439
+ [_r, _cI, _cT],
440
+ [[() => ReportData$, 0], 0, 0], 1
441
+ ];
442
+ var CreateAbuseReportResponse$ = [3, n0, _CARRr,
443
+ 0,
444
+ [_rIe, _cI],
445
+ [0, 0], 1
446
+ ];
447
+ var GetAbuseReportStatusRequest$ = [3, n0, _GARSR,
448
+ 0,
449
+ [_rIe],
450
+ [[0, 1]], 1
451
+ ];
452
+ var GetAbuseReportStatusResponse$ = [3, n0, _GARSRe,
453
+ 0,
454
+ [_rIe, _st, _d, _sA, _cI, _rC, _lUA],
455
+ [0, 0, 0, 4, 0, 0, 4], 4
456
+ ];
457
+ var ListAbuseReportStatusesRequest$ = [3, n0, _LARSR,
458
+ 0,
459
+ [_cI, _nT, _mR],
460
+ [[0, { [_hQ]: _cI }], [0, { [_hQ]: _nT }], [1, { [_hQ]: _mR }]]
461
+ ];
462
+ var ListAbuseReportStatusesResponse$ = [3, n0, _LARSRi,
463
+ 0,
464
+ [_re, _nT],
465
+ [() => ReportStatusList, 0], 1
466
+ ];
467
+ var ReportStatusListItem$ = [3, n0, _RSLI,
468
+ 0,
469
+ [_rIe, _st, _d, _cI, _rC],
470
+ [0, 0, 0, 0, 0], 3
471
+ ];
472
+ var SubmissionRequirement$ = [3, n0, _SR,
473
+ 0,
474
+ [_p, _m, _co],
475
+ [0, 0, 0], 2
476
+ ];
477
+ var ValidationExceptionField$ = [3, n0, _VEF,
478
+ 0,
479
+ [_p, _m],
480
+ [0, 0], 2
481
+ ];
482
+ var ReportStatusList = [1, n0, _RSL,
483
+ 0, () => ReportStatusListItem$
484
+ ];
485
+ var SubmissionRequirementList = [1, n0, _SRL,
486
+ 0, () => SubmissionRequirement$
487
+ ];
488
+ var ValidationExceptionFieldList = [1, n0, _VEFL,
489
+ 0, () => ValidationExceptionField$
490
+ ];
491
+ var ReportData$ = [4, n0, _RD,
492
+ 8,
493
+ [_x],
494
+ [15]
495
+ ];
496
+ var CreateAbuseReport$ = [9, n0, _CAR,
497
+ { [_h]: ["POST", "/v1/abuse", 202] }, () => CreateAbuseReportRequest$, () => CreateAbuseReportResponse$
498
+ ];
499
+ var GetAbuseReportStatus$ = [9, n0, _GARS,
500
+ { [_h]: ["GET", "/v1/abuse/{reportId}", 200] }, () => GetAbuseReportStatusRequest$, () => GetAbuseReportStatusResponse$
501
+ ];
502
+ var ListAbuseReportStatuses$ = [9, n0, _LARS,
503
+ { [_h]: ["GET", "/v1/abusestatuses", 200] }, () => ListAbuseReportStatusesRequest$, () => ListAbuseReportStatusesResponse$
504
+ ];
505
+
506
+ const getRuntimeConfig$1 = (config) => {
507
+ return {
508
+ apiVersion: "2026-01-12",
509
+ base64Decoder: config?.base64Decoder ?? fromBase64,
510
+ base64Encoder: config?.base64Encoder ?? toBase64,
511
+ disableHostPrefix: config?.disableHostPrefix ?? false,
512
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
513
+ extensions: config?.extensions ?? [],
514
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultAbuseSignalHttpAuthSchemeProvider,
515
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
516
+ {
517
+ schemeId: "aws.auth#sigv4",
518
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
519
+ signer: new AwsSdkSigV4Signer(),
520
+ },
521
+ {
522
+ schemeId: "aws.auth#sigv4a",
523
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
524
+ signer: new AwsSdkSigV4ASigner(),
525
+ },
526
+ ],
527
+ logger: config?.logger ?? new NoOpLogger(),
528
+ protocol: config?.protocol ?? AwsRestJsonProtocol,
529
+ protocolSettings: config?.protocolSettings ?? {
530
+ defaultNamespace: "com.amazonaws.abusesignal",
531
+ errorTypeRegistries,
532
+ version: "2026-01-12",
533
+ serviceTarget: "AbuseReportApi",
534
+ },
535
+ serviceId: config?.serviceId ?? "Abuse Signal",
536
+ sha256: config?.sha256 ?? Sha256,
537
+ signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
538
+ urlParser: config?.urlParser ?? parseUrl,
539
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
540
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
541
+ };
542
+ };
543
+
544
+ const getRuntimeConfig = (config) => {
545
+ emitWarningIfUnsupportedVersion(process.version);
546
+ const defaultsMode = resolveDefaultsModeConfig(config);
547
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
548
+ const clientSharedValues = getRuntimeConfig$1(config);
549
+ emitWarningIfUnsupportedVersion$1(process.version);
550
+ const loaderConfig = {
551
+ profile: config?.profile,
552
+ logger: clientSharedValues.logger,
553
+ };
554
+ return {
555
+ ...clientSharedValues,
556
+ ...config,
557
+ runtime: "node",
558
+ defaultsMode,
559
+ authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
560
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
561
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
562
+ defaultSocketTimeout: getDefaultSocketTimeout(config?.requestHandler, 300_000),
563
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
564
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
565
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
566
+ requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
567
+ retryMode: config?.retryMode ??
568
+ loadConfig({
569
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
570
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
571
+ }, config),
572
+ sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
573
+ streamCollector: config?.streamCollector ?? streamCollector,
574
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
575
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
576
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
577
+ };
578
+ };
579
+
580
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
581
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
582
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
583
+ let _credentials = runtimeConfig.credentials;
584
+ return {
585
+ setHttpAuthScheme(httpAuthScheme) {
586
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
587
+ if (index === -1) {
588
+ _httpAuthSchemes.push(httpAuthScheme);
589
+ }
590
+ else {
591
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
592
+ }
593
+ },
594
+ httpAuthSchemes() {
595
+ return _httpAuthSchemes;
596
+ },
597
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
598
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
599
+ },
600
+ httpAuthSchemeProvider() {
601
+ return _httpAuthSchemeProvider;
602
+ },
603
+ setCredentials(credentials) {
604
+ _credentials = credentials;
605
+ },
606
+ credentials() {
607
+ return _credentials;
608
+ },
609
+ };
610
+ };
611
+ const resolveHttpAuthRuntimeConfig = (config) => {
612
+ return {
613
+ httpAuthSchemes: config.httpAuthSchemes(),
614
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
615
+ credentials: config.credentials(),
616
+ };
617
+ };
618
+
619
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
620
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
621
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
622
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
623
+ };
624
+
625
+ class AbuseSignalClient extends Client {
626
+ config;
627
+ constructor(...[configuration]) {
628
+ const _config_0 = getRuntimeConfig(configuration || {});
629
+ super(_config_0);
630
+ this.initConfig = _config_0;
631
+ const _config_1 = resolveClientEndpointParameters(_config_0);
632
+ const _config_2 = resolveUserAgentConfig(_config_1);
633
+ const _config_3 = resolveRetryConfig(_config_2);
634
+ const _config_4 = resolveRegionConfig(_config_3);
635
+ const _config_5 = resolveHostHeaderConfig(_config_4);
636
+ const _config_6 = resolveEndpointConfig(_config_5);
637
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
638
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
639
+ this.config = _config_8;
640
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
641
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
642
+ this.middlewareStack.use(getRetryPlugin(this.config));
643
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
644
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
645
+ this.middlewareStack.use(getLoggerPlugin(this.config));
646
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
647
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
648
+ httpAuthSchemeParametersProvider: defaultAbuseSignalHttpAuthSchemeParametersProvider,
649
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
650
+ "aws.auth#sigv4": config.credentials,
651
+ "aws.auth#sigv4a": config.credentials,
652
+ }),
653
+ }));
654
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
655
+ }
656
+ destroy() {
657
+ super.destroy();
658
+ }
659
+ }
660
+
661
+ const command = makeBuilder(commonParams, "AbuseReportApi", "AbuseSignalClient", getEndpointPlugin);
662
+ const _ep0 = {};
663
+ const _mw0 = (Command, cs, config, o) => [];
664
+
665
+ class CreateAbuseReportCommand extends command(_ep0, _mw0, "CreateAbuseReport", CreateAbuseReport$) {
666
+ }
667
+
668
+ class GetAbuseReportStatusCommand extends command(_ep0, _mw0, "GetAbuseReportStatus", GetAbuseReportStatus$) {
669
+ }
670
+
671
+ class ListAbuseReportStatusesCommand extends command(_ep0, _mw0, "ListAbuseReportStatuses", ListAbuseReportStatuses$) {
672
+ }
673
+
674
+ const paginateListAbuseReportStatuses = createPaginator(AbuseSignalClient, ListAbuseReportStatusesCommand, "nextToken", "nextToken", "maxResults");
675
+
676
+ const checkState = async (client, input) => {
677
+ let reason;
678
+ try {
679
+ let result = await client.send(new GetAbuseReportStatusCommand(input));
680
+ reason = result;
681
+ try {
682
+ const returnComparator = () => {
683
+ return result.status;
684
+ };
685
+ if (returnComparator() === "PROCESSING") {
686
+ return { state: WaiterState.SUCCESS, reason };
687
+ }
688
+ }
689
+ catch (e) { }
690
+ try {
691
+ const returnComparator = () => {
692
+ return result.status;
693
+ };
694
+ if (returnComparator() === "COMPLETED") {
695
+ return { state: WaiterState.SUCCESS, reason };
696
+ }
697
+ }
698
+ catch (e) { }
699
+ }
700
+ catch (exception) {
701
+ reason = exception;
702
+ if (exception.name === "ResourceNotFoundException") {
703
+ return { state: WaiterState.RETRY, reason };
704
+ }
705
+ }
706
+ return { state: WaiterState.RETRY, reason };
707
+ };
708
+ const waitForReportProcessing = async (params, input) => {
709
+ const serviceDefaults = { minDelay: 1, maxDelay: 5 };
710
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
711
+ };
712
+ const waitUntilReportProcessing = async (params, input) => {
713
+ const serviceDefaults = { minDelay: 1, maxDelay: 5 };
714
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
715
+ return checkExceptions(result);
716
+ };
717
+
718
+ const commands = {
719
+ CreateAbuseReportCommand,
720
+ GetAbuseReportStatusCommand,
721
+ ListAbuseReportStatusesCommand,
722
+ };
723
+ const paginators = {
724
+ paginateListAbuseReportStatuses,
725
+ };
726
+ const waiters = {
727
+ waitUntilReportProcessing,
728
+ };
729
+ class AbuseSignal extends AbuseSignalClient {
730
+ }
731
+ createAggregatedClient(commands, AbuseSignal, { paginators, waiters });
732
+
733
+ const ReasonCode = {
734
+ ACTIONED: "ACTIONED",
735
+ CONTENT_DOWN_OR_INACCESSIBLE: "CONTENT_DOWN_OR_INACCESSIBLE",
736
+ NEED_MORE_INFORMATION: "NEED_MORE_INFORMATION",
737
+ NOT_RESOLVABLE_TO_AWS: "NOT_RESOLVABLE_TO_AWS",
738
+ REVIEWED_NO_AWS_ACTION: "REVIEWED_NO_AWS_ACTION",
739
+ };
740
+ const ReportSubmissionStatus = {
741
+ COMPLETED: "COMPLETED",
742
+ PROCESSING: "PROCESSING",
743
+ QUEUED: "QUEUED",
744
+ };
745
+
746
+ exports.AbuseSignal = AbuseSignal;
747
+ exports.AbuseSignalClient = AbuseSignalClient;
748
+ exports.AbuseSignalServiceException = AbuseSignalServiceException;
749
+ exports.AbuseSignalServiceException$ = AbuseSignalServiceException$;
750
+ exports.AccessDeniedException = AccessDeniedException;
751
+ exports.AccessDeniedException$ = AccessDeniedException$;
752
+ exports.ConflictException = ConflictException;
753
+ exports.ConflictException$ = ConflictException$;
754
+ exports.CreateAbuseReport$ = CreateAbuseReport$;
755
+ exports.CreateAbuseReportCommand = CreateAbuseReportCommand;
756
+ exports.CreateAbuseReportRequest$ = CreateAbuseReportRequest$;
757
+ exports.CreateAbuseReportResponse$ = CreateAbuseReportResponse$;
758
+ exports.GetAbuseReportStatus$ = GetAbuseReportStatus$;
759
+ exports.GetAbuseReportStatusCommand = GetAbuseReportStatusCommand;
760
+ exports.GetAbuseReportStatusRequest$ = GetAbuseReportStatusRequest$;
761
+ exports.GetAbuseReportStatusResponse$ = GetAbuseReportStatusResponse$;
762
+ exports.InternalServerException = InternalServerException;
763
+ exports.InternalServerException$ = InternalServerException$;
764
+ exports.ListAbuseReportStatuses$ = ListAbuseReportStatuses$;
765
+ exports.ListAbuseReportStatusesCommand = ListAbuseReportStatusesCommand;
766
+ exports.ListAbuseReportStatusesRequest$ = ListAbuseReportStatusesRequest$;
767
+ exports.ListAbuseReportStatusesResponse$ = ListAbuseReportStatusesResponse$;
768
+ exports.ReasonCode = ReasonCode;
769
+ exports.ReportData$ = ReportData$;
770
+ exports.ReportStatusListItem$ = ReportStatusListItem$;
771
+ exports.ReportSubmissionStatus = ReportSubmissionStatus;
772
+ exports.ResourceNotFoundException = ResourceNotFoundException;
773
+ exports.ResourceNotFoundException$ = ResourceNotFoundException$;
774
+ exports.SubmissionRequirement$ = SubmissionRequirement$;
775
+ exports.SubmissionRequirementException = SubmissionRequirementException;
776
+ exports.SubmissionRequirementException$ = SubmissionRequirementException$;
777
+ exports.ThrottlingException = ThrottlingException;
778
+ exports.ThrottlingException$ = ThrottlingException$;
779
+ exports.ValidationException = ValidationException;
780
+ exports.ValidationException$ = ValidationException$;
781
+ exports.ValidationExceptionField$ = ValidationExceptionField$;
782
+ exports.errorTypeRegistries = errorTypeRegistries;
783
+ exports.paginateListAbuseReportStatuses = paginateListAbuseReportStatuses;
784
+ exports.waitForReportProcessing = waitForReportProcessing;
785
+ exports.waitUntilReportProcessing = waitUntilReportProcessing;