@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.
- package/LICENSE +201 -0
- package/README.md +201 -2
- package/dist-cjs/index.js +785 -0
- package/dist-es/AbuseSignal.js +21 -0
- package/dist-es/AbuseSignalClient.js +48 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +122 -0
- package/dist-es/commandBuilder.js +6 -0
- package/dist-es/commands/CreateAbuseReportCommand.js +4 -0
- package/dist-es/commands/GetAbuseReportStatusCommand.js +4 -0
- package/dist-es/commands/ListAbuseReportStatusesCommand.js +4 -0
- package/dist-es/commands/index.js +3 -0
- package/dist-es/endpoint/EndpointParameters.js +13 -0
- package/dist-es/endpoint/bdd.js +46 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +11 -0
- package/dist-es/models/AbuseSignalServiceException.js +9 -0
- package/dist-es/models/enums.js +12 -0
- package/dist-es/models/errors.js +110 -0
- package/dist-es/models/models_0.js +1 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListAbuseReportStatusesPaginator.js +4 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/runtimeConfig.browser.js +29 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +9 -0
- package/dist-es/runtimeConfig.shared.js +47 -0
- package/dist-es/runtimeExtensions.js +9 -0
- package/dist-es/schemas/schemas_0.js +176 -0
- package/dist-es/waiters/index.js +1 -0
- package/dist-es/waiters/waitForReportProcessing.js +43 -0
- package/dist-types/AbuseSignal.d.ts +52 -0
- package/dist-types/AbuseSignalClient.d.ts +190 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +83 -0
- package/dist-types/commandBuilder.d.ts +18 -0
- package/dist-types/commands/CreateAbuseReportCommand.d.ts +112 -0
- package/dist-types/commands/GetAbuseReportStatusCommand.d.ts +110 -0
- package/dist-types/commands/ListAbuseReportStatusesCommand.d.ts +113 -0
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +19 -0
- package/dist-types/models/AbuseSignalServiceException.d.ts +15 -0
- package/dist-types/models/enums.d.ts +28 -0
- package/dist-types/models/errors.d.ts +133 -0
- package/dist-types/models/models_0.d.ts +229 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListAbuseReportStatusesPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/runtimeConfig.browser.d.ts +58 -0
- package/dist-types/runtimeConfig.d.ts +59 -0
- package/dist-types/runtimeConfig.native.d.ts +57 -0
- package/dist-types/runtimeConfig.shared.d.ts +30 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +29 -0
- package/dist-types/ts3.4/AbuseSignal.d.ts +83 -0
- package/dist-types/ts3.4/AbuseSignalClient.d.ts +119 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +25 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +53 -0
- package/dist-types/ts3.4/commandBuilder.d.ts +40 -0
- package/dist-types/ts3.4/commands/CreateAbuseReportCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetAbuseReportStatusCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListAbuseReportStatusesCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/bdd.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +10 -0
- package/dist-types/ts3.4/index.d.ts +14 -0
- package/dist-types/ts3.4/models/AbuseSignalServiceException.d.ts +10 -0
- package/dist-types/ts3.4/models/enums.d.ts +15 -0
- package/dist-types/ts3.4/models/errors.d.ts +56 -0
- package/dist-types/ts3.4/models/models_0.d.ts +63 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +5 -0
- package/dist-types/ts3.4/pagination/ListAbuseReportStatusesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +103 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/schemas/schemas_0.d.ts +29 -0
- package/dist-types/ts3.4/waiters/index.d.ts +1 -0
- package/dist-types/ts3.4/waiters/waitForReportProcessing.d.ts +15 -0
- package/dist-types/waiters/index.d.ts +1 -0
- package/dist-types/waiters/waitForReportProcessing.d.ts +29 -0
- package/package.json +68 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createAggregatedClient } from "@smithy/core/client";
|
|
2
|
+
import { AbuseSignalClient } from "./AbuseSignalClient";
|
|
3
|
+
import { CreateAbuseReportCommand, } from "./commands/CreateAbuseReportCommand";
|
|
4
|
+
import { GetAbuseReportStatusCommand, } from "./commands/GetAbuseReportStatusCommand";
|
|
5
|
+
import { ListAbuseReportStatusesCommand, } from "./commands/ListAbuseReportStatusesCommand";
|
|
6
|
+
import { paginateListAbuseReportStatuses } from "./pagination/ListAbuseReportStatusesPaginator";
|
|
7
|
+
import { waitUntilReportProcessing } from "./waiters/waitForReportProcessing";
|
|
8
|
+
const commands = {
|
|
9
|
+
CreateAbuseReportCommand,
|
|
10
|
+
GetAbuseReportStatusCommand,
|
|
11
|
+
ListAbuseReportStatusesCommand,
|
|
12
|
+
};
|
|
13
|
+
const paginators = {
|
|
14
|
+
paginateListAbuseReportStatuses,
|
|
15
|
+
};
|
|
16
|
+
const waiters = {
|
|
17
|
+
waitUntilReportProcessing,
|
|
18
|
+
};
|
|
19
|
+
export class AbuseSignal extends AbuseSignalClient {
|
|
20
|
+
}
|
|
21
|
+
createAggregatedClient(commands, AbuseSignal, { paginators, waiters });
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin, getUserAgentPlugin, resolveHostHeaderConfig, resolveUserAgentConfig, } from "@aws-sdk/core/client";
|
|
2
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
3
|
+
import { Client as __Client, } from "@smithy/core/client";
|
|
4
|
+
import { resolveRegionConfig } from "@smithy/core/config";
|
|
5
|
+
import { resolveEndpointConfig } from "@smithy/core/endpoints";
|
|
6
|
+
import { getContentLengthPlugin } from "@smithy/core/protocols";
|
|
7
|
+
import { getRetryPlugin, resolveRetryConfig, } from "@smithy/core/retry";
|
|
8
|
+
import { getSchemaSerdePlugin } from "@smithy/core/schema";
|
|
9
|
+
import { defaultAbuseSignalHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
10
|
+
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
11
|
+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
12
|
+
import { resolveRuntimeExtensions } from "./runtimeExtensions";
|
|
13
|
+
export { __Client };
|
|
14
|
+
export class AbuseSignalClient extends __Client {
|
|
15
|
+
config;
|
|
16
|
+
constructor(...[configuration]) {
|
|
17
|
+
const _config_0 = __getRuntimeConfig(configuration || {});
|
|
18
|
+
super(_config_0);
|
|
19
|
+
this.initConfig = _config_0;
|
|
20
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
21
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
22
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
23
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
24
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
25
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
26
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
27
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
28
|
+
this.config = _config_8;
|
|
29
|
+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
30
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
31
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
32
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
33
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
34
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
35
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
36
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
37
|
+
httpAuthSchemeParametersProvider: defaultAbuseSignalHttpAuthSchemeParametersProvider,
|
|
38
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
39
|
+
"aws.auth#sigv4": config.credentials,
|
|
40
|
+
"aws.auth#sigv4a": config.credentials,
|
|
41
|
+
}),
|
|
42
|
+
}));
|
|
43
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
44
|
+
}
|
|
45
|
+
destroy() {
|
|
46
|
+
super.destroy();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
4
|
+
let _credentials = runtimeConfig.credentials;
|
|
5
|
+
return {
|
|
6
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
7
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8
|
+
if (index === -1) {
|
|
9
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
httpAuthSchemes() {
|
|
16
|
+
return _httpAuthSchemes;
|
|
17
|
+
},
|
|
18
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
19
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
20
|
+
},
|
|
21
|
+
httpAuthSchemeProvider() {
|
|
22
|
+
return _httpAuthSchemeProvider;
|
|
23
|
+
},
|
|
24
|
+
setCredentials(credentials) {
|
|
25
|
+
_credentials = credentials;
|
|
26
|
+
},
|
|
27
|
+
credentials() {
|
|
28
|
+
return _credentials;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const resolveHttpAuthRuntimeConfig = (config) => {
|
|
33
|
+
return {
|
|
34
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
35
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
36
|
+
credentials: config.credentials(),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config, } from "@aws-sdk/core/httpAuthSchemes";
|
|
2
|
+
import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region";
|
|
3
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/core/client";
|
|
4
|
+
import { resolveParams } from "@smithy/core/endpoints";
|
|
5
|
+
import { defaultEndpointResolver } from "../endpoint/endpointResolver";
|
|
6
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
7
|
+
if (!input) {
|
|
8
|
+
throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
|
|
9
|
+
}
|
|
10
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
11
|
+
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
|
|
12
|
+
?.getEndpointParameterInstructions;
|
|
13
|
+
if (!instructionsFn) {
|
|
14
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
|
|
15
|
+
}
|
|
16
|
+
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
17
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
18
|
+
};
|
|
19
|
+
const _defaultAbuseSignalHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
20
|
+
return {
|
|
21
|
+
operation: getSmithyContext(context).operation,
|
|
22
|
+
region: await normalizeProvider(config.region)() || (() => {
|
|
23
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
24
|
+
})(),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export const defaultAbuseSignalHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultAbuseSignalHttpAuthSchemeParametersProvider);
|
|
28
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
29
|
+
return {
|
|
30
|
+
schemeId: "aws.auth#sigv4",
|
|
31
|
+
signingProperties: {
|
|
32
|
+
name: "abuse",
|
|
33
|
+
region: authParameters.region,
|
|
34
|
+
},
|
|
35
|
+
propertiesExtractor: (config, context) => ({
|
|
36
|
+
signingProperties: {
|
|
37
|
+
config,
|
|
38
|
+
context,
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
44
|
+
return {
|
|
45
|
+
schemeId: "aws.auth#sigv4a",
|
|
46
|
+
signingProperties: {
|
|
47
|
+
name: "abuse",
|
|
48
|
+
region: authParameters.region,
|
|
49
|
+
},
|
|
50
|
+
propertiesExtractor: (config, context) => ({
|
|
51
|
+
signingProperties: {
|
|
52
|
+
config,
|
|
53
|
+
context,
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
59
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
60
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
61
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
62
|
+
if (!authSchemes) {
|
|
63
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
64
|
+
}
|
|
65
|
+
const options = [];
|
|
66
|
+
for (const scheme of authSchemes) {
|
|
67
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
68
|
+
const name = resolvedName.toLowerCase();
|
|
69
|
+
if (resolvedName !== name) {
|
|
70
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
|
|
71
|
+
}
|
|
72
|
+
let schemeId;
|
|
73
|
+
if (name === "sigv4a") {
|
|
74
|
+
schemeId = "aws.auth#sigv4a";
|
|
75
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
76
|
+
const name = s.name.toLowerCase();
|
|
77
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
78
|
+
});
|
|
79
|
+
if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (name.startsWith("sigv4")) {
|
|
84
|
+
schemeId = "aws.auth#sigv4";
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
|
|
88
|
+
}
|
|
89
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
90
|
+
if (!createOption) {
|
|
91
|
+
throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
|
|
92
|
+
}
|
|
93
|
+
const option = createOption(authParameters);
|
|
94
|
+
option.schemeId = schemeId;
|
|
95
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
96
|
+
options.push(option);
|
|
97
|
+
}
|
|
98
|
+
return options;
|
|
99
|
+
};
|
|
100
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
101
|
+
};
|
|
102
|
+
const _defaultAbuseSignalHttpAuthSchemeProvider = (authParameters) => {
|
|
103
|
+
const options = [];
|
|
104
|
+
switch (authParameters.operation) {
|
|
105
|
+
default: {
|
|
106
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
107
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return options;
|
|
111
|
+
};
|
|
112
|
+
export const defaultAbuseSignalHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultAbuseSignalHttpAuthSchemeProvider, {
|
|
113
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
114
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
115
|
+
});
|
|
116
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
117
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
118
|
+
const config_1 = resolveAwsSdkSigV4AConfig(config_0);
|
|
119
|
+
return Object.assign(config_1, {
|
|
120
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
121
|
+
});
|
|
122
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { makeBuilder } from "@smithy/core/client";
|
|
2
|
+
import { getEndpointPlugin } from "@smithy/core/endpoints";
|
|
3
|
+
import { commonParams } from "./endpoint/EndpointParameters";
|
|
4
|
+
export const command = makeBuilder(commonParams, "AbuseReportApi", "AbuseSignalClient", getEndpointPlugin);
|
|
5
|
+
export const _ep0 = {};
|
|
6
|
+
export const _mw0 = (Command, cs, config, o) => [];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const resolveClientEndpointParameters = (options) => {
|
|
2
|
+
return Object.assign(options, {
|
|
3
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
4
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
5
|
+
defaultSigningName: "abuse",
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export const commonParams = {
|
|
9
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
10
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
11
|
+
Region: { type: "builtInParams", name: "region" },
|
|
12
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
13
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BinaryDecisionDiagram } from "@smithy/core/endpoints";
|
|
2
|
+
const k = "ref";
|
|
3
|
+
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
|
|
4
|
+
const _data = {
|
|
5
|
+
conditions: [
|
|
6
|
+
[c, [g]],
|
|
7
|
+
[c, j],
|
|
8
|
+
["aws.partition", j, d],
|
|
9
|
+
[e, [{ [k]: "UseFIPS" }, b]],
|
|
10
|
+
[e, [{ [k]: "UseDualStack" }, b]],
|
|
11
|
+
[e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
|
|
12
|
+
[e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]]
|
|
13
|
+
],
|
|
14
|
+
results: [
|
|
15
|
+
[a],
|
|
16
|
+
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
17
|
+
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
18
|
+
[g, i],
|
|
19
|
+
["https://abuse-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
|
|
20
|
+
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
21
|
+
["https://abuse-fips.{Region}.{PartitionResult#dnsSuffix}", i],
|
|
22
|
+
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
23
|
+
["https://abuse.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
|
|
24
|
+
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
25
|
+
["https://abuse.{Region}.{PartitionResult#dnsSuffix}", i],
|
|
26
|
+
[a, "Invalid Configuration: Missing Region"]
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
const root = 2;
|
|
30
|
+
const r = 100_000_000;
|
|
31
|
+
const nodes = new Int32Array([
|
|
32
|
+
-1, 1, -1,
|
|
33
|
+
0, 12, 3,
|
|
34
|
+
1, 4, r + 11,
|
|
35
|
+
2, 5, r + 11,
|
|
36
|
+
3, 8, 6,
|
|
37
|
+
4, 7, r + 10,
|
|
38
|
+
5, r + 8, r + 9,
|
|
39
|
+
4, 10, 9,
|
|
40
|
+
6, r + 6, r + 7,
|
|
41
|
+
5, 11, r + 5,
|
|
42
|
+
6, r + 4, r + 5,
|
|
43
|
+
3, r + 1, 13,
|
|
44
|
+
4, r + 2, r + 3,
|
|
45
|
+
]);
|
|
46
|
+
export const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { awsEndpointFunctions } from "@aws-sdk/core/client";
|
|
2
|
+
import { customEndpointFunctions, decideEndpoint, EndpointCache } from "@smithy/core/endpoints";
|
|
3
|
+
import { bdd } from "./bdd";
|
|
4
|
+
const cache = new EndpointCache({
|
|
5
|
+
size: 50,
|
|
6
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
7
|
+
});
|
|
8
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
10
|
+
endpointParams: endpointParams,
|
|
11
|
+
logger: context.logger,
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./AbuseSignalClient";
|
|
2
|
+
export * from "./AbuseSignal";
|
|
3
|
+
export * from "./commands";
|
|
4
|
+
export { Command as $Command } from "@smithy/core/client";
|
|
5
|
+
export * from "./pagination";
|
|
6
|
+
export * from "./waiters";
|
|
7
|
+
export * from "./schemas/schemas_0";
|
|
8
|
+
export * from "./models/enums";
|
|
9
|
+
export * from "./models/errors";
|
|
10
|
+
export * from "./models/models_0";
|
|
11
|
+
export { AbuseSignalServiceException } from "./models/AbuseSignalServiceException";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/core/client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class AbuseSignalServiceException extends __ServiceException {
|
|
4
|
+
static shapeId = "smithy.ts.sdk.synthetic.com.amazonaws.abusesignal#AbuseSignalServiceException";
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
|
+
Object.setPrototypeOf(this, AbuseSignalServiceException.prototype);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const ReasonCode = {
|
|
2
|
+
ACTIONED: "ACTIONED",
|
|
3
|
+
CONTENT_DOWN_OR_INACCESSIBLE: "CONTENT_DOWN_OR_INACCESSIBLE",
|
|
4
|
+
NEED_MORE_INFORMATION: "NEED_MORE_INFORMATION",
|
|
5
|
+
NOT_RESOLVABLE_TO_AWS: "NOT_RESOLVABLE_TO_AWS",
|
|
6
|
+
REVIEWED_NO_AWS_ACTION: "REVIEWED_NO_AWS_ACTION",
|
|
7
|
+
};
|
|
8
|
+
export const ReportSubmissionStatus = {
|
|
9
|
+
COMPLETED: "COMPLETED",
|
|
10
|
+
PROCESSING: "PROCESSING",
|
|
11
|
+
QUEUED: "QUEUED",
|
|
12
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { AbuseSignalServiceException as __BaseException } from "./AbuseSignalServiceException";
|
|
2
|
+
export class AccessDeniedException extends __BaseException {
|
|
3
|
+
static shapeId = "com.amazonaws.abusesignal#AccessDeniedException";
|
|
4
|
+
name = "AccessDeniedException";
|
|
5
|
+
$fault = "client";
|
|
6
|
+
constructor(opts) {
|
|
7
|
+
super({
|
|
8
|
+
name: "AccessDeniedException",
|
|
9
|
+
$fault: "client",
|
|
10
|
+
...opts,
|
|
11
|
+
});
|
|
12
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class ConflictException extends __BaseException {
|
|
16
|
+
static shapeId = "com.amazonaws.abusesignal#ConflictException";
|
|
17
|
+
name = "ConflictException";
|
|
18
|
+
$fault = "client";
|
|
19
|
+
constructor(opts) {
|
|
20
|
+
super({
|
|
21
|
+
name: "ConflictException",
|
|
22
|
+
$fault: "client",
|
|
23
|
+
...opts,
|
|
24
|
+
});
|
|
25
|
+
Object.setPrototypeOf(this, ConflictException.prototype);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export class InternalServerException extends __BaseException {
|
|
29
|
+
static shapeId = "com.amazonaws.abusesignal#InternalServerException";
|
|
30
|
+
name = "InternalServerException";
|
|
31
|
+
$fault = "server";
|
|
32
|
+
$retryable = {};
|
|
33
|
+
retryAfterSeconds;
|
|
34
|
+
constructor(opts) {
|
|
35
|
+
super({
|
|
36
|
+
name: "InternalServerException",
|
|
37
|
+
$fault: "server",
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
41
|
+
this.retryAfterSeconds = opts.retryAfterSeconds;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class SubmissionRequirementException extends __BaseException {
|
|
45
|
+
static shapeId = "com.amazonaws.abusesignal#SubmissionRequirementException";
|
|
46
|
+
name = "SubmissionRequirementException";
|
|
47
|
+
$fault = "client";
|
|
48
|
+
unmetRequirements;
|
|
49
|
+
constructor(opts) {
|
|
50
|
+
super({
|
|
51
|
+
name: "SubmissionRequirementException",
|
|
52
|
+
$fault: "client",
|
|
53
|
+
...opts,
|
|
54
|
+
});
|
|
55
|
+
Object.setPrototypeOf(this, SubmissionRequirementException.prototype);
|
|
56
|
+
this.unmetRequirements = opts.unmetRequirements;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export class ThrottlingException extends __BaseException {
|
|
60
|
+
static shapeId = "com.amazonaws.abusesignal#ThrottlingException";
|
|
61
|
+
name = "ThrottlingException";
|
|
62
|
+
$fault = "client";
|
|
63
|
+
$retryable = {
|
|
64
|
+
throttling: true,
|
|
65
|
+
};
|
|
66
|
+
serviceCode;
|
|
67
|
+
quotaCode;
|
|
68
|
+
retryAfterSeconds;
|
|
69
|
+
constructor(opts) {
|
|
70
|
+
super({
|
|
71
|
+
name: "ThrottlingException",
|
|
72
|
+
$fault: "client",
|
|
73
|
+
...opts,
|
|
74
|
+
});
|
|
75
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
76
|
+
this.serviceCode = opts.serviceCode;
|
|
77
|
+
this.quotaCode = opts.quotaCode;
|
|
78
|
+
this.retryAfterSeconds = opts.retryAfterSeconds;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export class ValidationException extends __BaseException {
|
|
82
|
+
static shapeId = "com.amazonaws.abusesignal#ValidationException";
|
|
83
|
+
name = "ValidationException";
|
|
84
|
+
$fault = "client";
|
|
85
|
+
fieldList;
|
|
86
|
+
constructor(opts) {
|
|
87
|
+
super({
|
|
88
|
+
name: "ValidationException",
|
|
89
|
+
$fault: "client",
|
|
90
|
+
...opts,
|
|
91
|
+
});
|
|
92
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
93
|
+
this.fieldList = opts.fieldList;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export class ResourceNotFoundException extends __BaseException {
|
|
97
|
+
static shapeId = "com.amazonaws.abusesignal#ResourceNotFoundException";
|
|
98
|
+
name = "ResourceNotFoundException";
|
|
99
|
+
$fault = "client";
|
|
100
|
+
resourceId;
|
|
101
|
+
constructor(opts) {
|
|
102
|
+
super({
|
|
103
|
+
name: "ResourceNotFoundException",
|
|
104
|
+
$fault: "client",
|
|
105
|
+
...opts,
|
|
106
|
+
});
|
|
107
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
108
|
+
this.resourceId = opts.resourceId;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createPaginator } from "@smithy/core";
|
|
2
|
+
import { AbuseSignalClient } from "../AbuseSignalClient";
|
|
3
|
+
import { ListAbuseReportStatusesCommand, } from "../commands/ListAbuseReportStatusesCommand";
|
|
4
|
+
export const paginateListAbuseReportStatuses = createPaginator(AbuseSignalClient, ListAbuseReportStatusesCommand, "nextToken", "nextToken", "maxResults");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/core/client";
|
|
3
|
+
import { invalidProvider, loadConfigsForDefaultMode } from "@smithy/core/client";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig, } from "@smithy/core/config";
|
|
5
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/core/retry";
|
|
6
|
+
import { calculateBodyLength } from "@smithy/core/serde";
|
|
7
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
8
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
9
|
+
export const getRuntimeConfig = (config) => {
|
|
10
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
11
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
12
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
13
|
+
return {
|
|
14
|
+
...clientSharedValues,
|
|
15
|
+
...config,
|
|
16
|
+
runtime: "browser",
|
|
17
|
+
defaultsMode,
|
|
18
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
19
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
20
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
21
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
22
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
23
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
24
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
25
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
26
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
27
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion as awsCheckVersion, getDefaultSocketTimeout, NODE_APP_ID_CONFIG_OPTIONS, } from "@aws-sdk/core/client";
|
|
3
|
+
import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS } from "@aws-sdk/core/httpAuthSchemes";
|
|
4
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
5
|
+
import { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from "@smithy/core/client";
|
|
6
|
+
import { loadConfig as loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig, } from "@smithy/core/config";
|
|
7
|
+
import { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@smithy/core/retry";
|
|
8
|
+
import { calculateBodyLength } from "@smithy/core/serde";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
11
|
+
export const getRuntimeConfig = (config) => {
|
|
12
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
awsCheckVersion(process.version);
|
|
17
|
+
const loaderConfig = {
|
|
18
|
+
profile: config?.profile,
|
|
19
|
+
logger: clientSharedValues.logger,
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
...clientSharedValues,
|
|
23
|
+
...config,
|
|
24
|
+
runtime: "node",
|
|
25
|
+
defaultsMode,
|
|
26
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
28
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
29
|
+
defaultSocketTimeout: getDefaultSocketTimeout(config?.requestHandler, 300_000),
|
|
30
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
32
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
33
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
34
|
+
retryMode: config?.retryMode ??
|
|
35
|
+
loadNodeConfig({
|
|
36
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
37
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
38
|
+
}, config),
|
|
39
|
+
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
40
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
41
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
42
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
43
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
2
|
+
export const getRuntimeConfig = (config) => {
|
|
3
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
4
|
+
return {
|
|
5
|
+
...browserDefaults,
|
|
6
|
+
...config,
|
|
7
|
+
runtime: "react-native",
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } from "@aws-sdk/core/httpAuthSchemes";
|
|
2
|
+
import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols";
|
|
3
|
+
import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region";
|
|
4
|
+
import { Sha256 } from "@smithy/core/checksum";
|
|
5
|
+
import { NoOpLogger } from "@smithy/core/client";
|
|
6
|
+
import { parseUrl } from "@smithy/core/protocols";
|
|
7
|
+
import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@smithy/core/serde";
|
|
8
|
+
import { defaultAbuseSignalHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
9
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
10
|
+
import { errorTypeRegistries } from "./schemas/schemas_0";
|
|
11
|
+
export const getRuntimeConfig = (config) => {
|
|
12
|
+
return {
|
|
13
|
+
apiVersion: "2026-01-12",
|
|
14
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
15
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
16
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
17
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
18
|
+
extensions: config?.extensions ?? [],
|
|
19
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultAbuseSignalHttpAuthSchemeProvider,
|
|
20
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
21
|
+
{
|
|
22
|
+
schemeId: "aws.auth#sigv4",
|
|
23
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
24
|
+
signer: new AwsSdkSigV4Signer(),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
schemeId: "aws.auth#sigv4a",
|
|
28
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
29
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
33
|
+
protocol: config?.protocol ?? AwsRestJsonProtocol,
|
|
34
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
35
|
+
defaultNamespace: "com.amazonaws.abusesignal",
|
|
36
|
+
errorTypeRegistries,
|
|
37
|
+
version: "2026-01-12",
|
|
38
|
+
serviceTarget: "AbuseReportApi",
|
|
39
|
+
},
|
|
40
|
+
serviceId: config?.serviceId ?? "Abuse Signal",
|
|
41
|
+
sha256: config?.sha256 ?? Sha256,
|
|
42
|
+
signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
|
|
43
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
44
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
45
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
46
|
+
};
|
|
47
|
+
};
|