@aws-sdk/client-inspector-scan 3.456.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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +213 -0
  3. package/dist-cjs/InspectorScan.js +13 -0
  4. package/dist-cjs/InspectorScanClient.js +43 -0
  5. package/dist-cjs/commands/ScanSbomCommand.js +51 -0
  6. package/dist-cjs/commands/index.js +4 -0
  7. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  8. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  9. package/dist-cjs/endpoint/ruleset.js +7 -0
  10. package/dist-cjs/extensionConfiguration.js +2 -0
  11. package/dist-cjs/index.js +11 -0
  12. package/dist-cjs/models/InspectorScanServiceException.js +12 -0
  13. package/dist-cjs/models/index.js +4 -0
  14. package/dist-cjs/models/models_0.js +80 -0
  15. package/dist-cjs/protocols/Aws_restJson1.js +196 -0
  16. package/dist-cjs/runtimeConfig.browser.js +39 -0
  17. package/dist-cjs/runtimeConfig.js +50 -0
  18. package/dist-cjs/runtimeConfig.native.js +15 -0
  19. package/dist-cjs/runtimeConfig.shared.js +24 -0
  20. package/dist-cjs/runtimeExtensions.js +22 -0
  21. package/dist-es/InspectorScan.js +9 -0
  22. package/dist-es/InspectorScanClient.js +39 -0
  23. package/dist-es/commands/ScanSbomCommand.js +47 -0
  24. package/dist-es/commands/index.js +1 -0
  25. package/dist-es/endpoint/EndpointParameters.js +8 -0
  26. package/dist-es/endpoint/endpointResolver.js +8 -0
  27. package/dist-es/endpoint/ruleset.js +4 -0
  28. package/dist-es/extensionConfiguration.js +1 -0
  29. package/dist-es/index.js +6 -0
  30. package/dist-es/models/InspectorScanServiceException.js +8 -0
  31. package/dist-es/models/index.js +1 -0
  32. package/dist-es/models/models_0.js +73 -0
  33. package/dist-es/protocols/Aws_restJson1.js +191 -0
  34. package/dist-es/runtimeConfig.browser.js +34 -0
  35. package/dist-es/runtimeConfig.js +45 -0
  36. package/dist-es/runtimeConfig.native.js +11 -0
  37. package/dist-es/runtimeConfig.shared.js +20 -0
  38. package/dist-es/runtimeExtensions.js +18 -0
  39. package/dist-types/InspectorScan.d.ts +17 -0
  40. package/dist-types/InspectorScanClient.d.ts +170 -0
  41. package/dist-types/commands/ScanSbomCommand.d.ts +91 -0
  42. package/dist-types/commands/index.d.ts +1 -0
  43. package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
  44. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  45. package/dist-types/endpoint/ruleset.d.ts +2 -0
  46. package/dist-types/extensionConfiguration.d.ts +8 -0
  47. package/dist-types/index.d.ts +14 -0
  48. package/dist-types/models/InspectorScanServiceException.d.ts +13 -0
  49. package/dist-types/models/index.d.ts +1 -0
  50. package/dist-types/models/models_0.d.ts +169 -0
  51. package/dist-types/protocols/Aws_restJson1.d.ts +11 -0
  52. package/dist-types/runtimeConfig.browser.d.ts +46 -0
  53. package/dist-types/runtimeConfig.d.ts +46 -0
  54. package/dist-types/runtimeConfig.native.d.ts +45 -0
  55. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  56. package/dist-types/runtimeExtensions.d.ts +17 -0
  57. package/dist-types/ts3.4/InspectorScan.d.ts +24 -0
  58. package/dist-types/ts3.4/InspectorScanClient.d.ts +123 -0
  59. package/dist-types/ts3.4/commands/ScanSbomCommand.d.ts +35 -0
  60. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  61. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  62. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  63. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  64. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  65. package/dist-types/ts3.4/index.d.ts +9 -0
  66. package/dist-types/ts3.4/models/InspectorScanServiceException.d.ts +8 -0
  67. package/dist-types/ts3.4/models/index.d.ts +1 -0
  68. package/dist-types/ts3.4/models/models_0.d.ts +71 -0
  69. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +17 -0
  70. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  71. package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
  72. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  73. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  74. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  75. package/package.json +102 -0
@@ -0,0 +1,191 @@
1
+ import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { InspectorScanServiceException as __BaseException } from "../models/InspectorScanServiceException";
4
+ import { AccessDeniedException, InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ export const se_ScanSbomCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scan/sbom";
11
+ let body;
12
+ body = JSON.stringify(take(input, {
13
+ outputFormat: [],
14
+ sbom: (_) => se_Sbom(_, context),
15
+ }));
16
+ return new __HttpRequest({
17
+ protocol,
18
+ hostname,
19
+ port,
20
+ method: "POST",
21
+ headers,
22
+ path: resolvedPath,
23
+ body,
24
+ });
25
+ };
26
+ export const de_ScanSbomCommand = async (output, context) => {
27
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
28
+ return de_ScanSbomCommandError(output, context);
29
+ }
30
+ const contents = map({
31
+ $metadata: deserializeMetadata(output),
32
+ });
33
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
34
+ const doc = take(data, {
35
+ sbom: (_) => de_Sbom(_, context),
36
+ });
37
+ Object.assign(contents, doc);
38
+ return contents;
39
+ };
40
+ const de_ScanSbomCommandError = async (output, context) => {
41
+ const parsedOutput = {
42
+ ...output,
43
+ body: await parseErrorBody(output.body, context),
44
+ };
45
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
46
+ switch (errorCode) {
47
+ case "AccessDeniedException":
48
+ case "com.amazonaws.inspectorscan#AccessDeniedException":
49
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
50
+ case "InternalServerException":
51
+ case "com.amazonaws.inspectorscan#InternalServerException":
52
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
53
+ case "ThrottlingException":
54
+ case "com.amazonaws.inspectorscan#ThrottlingException":
55
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
56
+ case "ValidationException":
57
+ case "com.amazonaws.inspectorscan#ValidationException":
58
+ throw await de_ValidationExceptionRes(parsedOutput, context);
59
+ default:
60
+ const parsedBody = parsedOutput.body;
61
+ return throwDefaultError({
62
+ output,
63
+ parsedBody,
64
+ errorCode,
65
+ });
66
+ }
67
+ };
68
+ const throwDefaultError = withBaseException(__BaseException);
69
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
70
+ const contents = map({});
71
+ const data = parsedOutput.body;
72
+ const doc = take(data, {
73
+ message: __expectString,
74
+ });
75
+ Object.assign(contents, doc);
76
+ const exception = new AccessDeniedException({
77
+ $metadata: deserializeMetadata(parsedOutput),
78
+ ...contents,
79
+ });
80
+ return __decorateServiceException(exception, parsedOutput.body);
81
+ };
82
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
83
+ const contents = map({
84
+ retryAfterSeconds: [
85
+ () => void 0 !== parsedOutput.headers["retry-after"],
86
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
87
+ ],
88
+ });
89
+ const data = parsedOutput.body;
90
+ const doc = take(data, {
91
+ message: __expectString,
92
+ reason: __expectString,
93
+ });
94
+ Object.assign(contents, doc);
95
+ const exception = new InternalServerException({
96
+ $metadata: deserializeMetadata(parsedOutput),
97
+ ...contents,
98
+ });
99
+ return __decorateServiceException(exception, parsedOutput.body);
100
+ };
101
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
102
+ const contents = map({
103
+ retryAfterSeconds: [
104
+ () => void 0 !== parsedOutput.headers["retry-after"],
105
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
106
+ ],
107
+ });
108
+ const data = parsedOutput.body;
109
+ const doc = take(data, {
110
+ message: __expectString,
111
+ });
112
+ Object.assign(contents, doc);
113
+ const exception = new ThrottlingException({
114
+ $metadata: deserializeMetadata(parsedOutput),
115
+ ...contents,
116
+ });
117
+ return __decorateServiceException(exception, parsedOutput.body);
118
+ };
119
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
120
+ const contents = map({});
121
+ const data = parsedOutput.body;
122
+ const doc = take(data, {
123
+ fields: _json,
124
+ message: __expectString,
125
+ reason: __expectString,
126
+ });
127
+ Object.assign(contents, doc);
128
+ const exception = new ValidationException({
129
+ $metadata: deserializeMetadata(parsedOutput),
130
+ ...contents,
131
+ });
132
+ return __decorateServiceException(exception, parsedOutput.body);
133
+ };
134
+ const se_Sbom = (input, context) => {
135
+ return input;
136
+ };
137
+ const de_Sbom = (output, context) => {
138
+ return output;
139
+ };
140
+ const deserializeMetadata = (output) => ({
141
+ httpStatusCode: output.statusCode,
142
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
143
+ extendedRequestId: output.headers["x-amz-id-2"],
144
+ cfId: output.headers["x-amz-cf-id"],
145
+ });
146
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
147
+ const isSerializableHeaderValue = (value) => value !== undefined &&
148
+ value !== null &&
149
+ value !== "" &&
150
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
151
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
152
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
153
+ if (encoded.length) {
154
+ return JSON.parse(encoded);
155
+ }
156
+ return {};
157
+ });
158
+ const parseErrorBody = async (errorBody, context) => {
159
+ const value = await parseBody(errorBody, context);
160
+ value.message = value.message ?? value.Message;
161
+ return value;
162
+ };
163
+ const loadRestJsonErrorCode = (output, data) => {
164
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
165
+ const sanitizeErrorCode = (rawValue) => {
166
+ let cleanValue = rawValue;
167
+ if (typeof cleanValue === "number") {
168
+ cleanValue = cleanValue.toString();
169
+ }
170
+ if (cleanValue.indexOf(",") >= 0) {
171
+ cleanValue = cleanValue.split(",")[0];
172
+ }
173
+ if (cleanValue.indexOf(":") >= 0) {
174
+ cleanValue = cleanValue.split(":")[0];
175
+ }
176
+ if (cleanValue.indexOf("#") >= 0) {
177
+ cleanValue = cleanValue.split("#")[1];
178
+ }
179
+ return cleanValue;
180
+ };
181
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
182
+ if (headerKey !== undefined) {
183
+ return sanitizeErrorCode(output.headers[headerKey]);
184
+ }
185
+ if (data.code !== undefined) {
186
+ return sanitizeErrorCode(data.code);
187
+ }
188
+ if (data["__type"] !== undefined) {
189
+ return sanitizeErrorCode(data["__type"]);
190
+ }
191
+ };
@@ -0,0 +1,34 @@
1
+ import packageInfo from "../package.json";
2
+ import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
4
+ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
5
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
6
+ import { invalidProvider } from "@smithy/invalid-dependency";
7
+ import { calculateBodyLength } from "@smithy/util-body-length-browser";
8
+ import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
9
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
10
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
11
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
12
+ export const getRuntimeConfig = (config) => {
13
+ const defaultsMode = resolveDefaultsModeConfig(config);
14
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
+ const clientSharedValues = getSharedRuntimeConfig(config);
16
+ return {
17
+ ...clientSharedValues,
18
+ ...config,
19
+ runtime: "browser",
20
+ defaultsMode,
21
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
22
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
23
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
24
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
25
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
26
+ region: config?.region ?? invalidProvider("Region is missing"),
27
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
28
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
29
+ sha256: config?.sha256 ?? Sha256,
30
+ streamCollector: config?.streamCollector ?? streamCollector,
31
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
32
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
33
+ };
34
+ };
@@ -0,0 +1,45 @@
1
+ import packageInfo from "../package.json";
2
+ import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
3
+ import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
4
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
5
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
6
+ import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
7
+ import { Hash } from "@smithy/hash-node";
8
+ import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
9
+ import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
10
+ import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
11
+ import { calculateBodyLength } from "@smithy/util-body-length-node";
12
+ import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
13
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
14
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
15
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
16
+ import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
17
+ export const getRuntimeConfig = (config) => {
18
+ emitWarningIfUnsupportedVersion(process.version);
19
+ const defaultsMode = resolveDefaultsModeConfig(config);
20
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
21
+ const clientSharedValues = getSharedRuntimeConfig(config);
22
+ awsCheckVersion(process.version);
23
+ return {
24
+ ...clientSharedValues,
25
+ ...config,
26
+ runtime: "node",
27
+ defaultsMode,
28
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
29
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
30
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
31
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
33
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
34
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
35
+ retryMode: config?.retryMode ??
36
+ loadNodeConfig({
37
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
38
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
39
+ }),
40
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
41
+ streamCollector: config?.streamCollector ?? streamCollector,
42
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
43
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
44
+ };
45
+ };
@@ -0,0 +1,11 @@
1
+ import { Sha256 } from "@aws-crypto/sha256-js";
2
+ import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
3
+ export const getRuntimeConfig = (config) => {
4
+ const browserDefaults = getBrowserRuntimeConfig(config);
5
+ return {
6
+ ...browserDefaults,
7
+ ...config,
8
+ runtime: "react-native",
9
+ sha256: config?.sha256 ?? Sha256,
10
+ };
11
+ };
@@ -0,0 +1,20 @@
1
+ import { NoOpLogger } from "@smithy/smithy-client";
2
+ import { parseUrl } from "@smithy/url-parser";
3
+ import { fromBase64, toBase64 } from "@smithy/util-base64";
4
+ import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
5
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
6
+ export const getRuntimeConfig = (config) => {
7
+ return {
8
+ apiVersion: "2023-08-08",
9
+ base64Decoder: config?.base64Decoder ?? fromBase64,
10
+ base64Encoder: config?.base64Encoder ?? toBase64,
11
+ disableHostPrefix: config?.disableHostPrefix ?? false,
12
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
13
+ extensions: config?.extensions ?? [],
14
+ logger: config?.logger ?? new NoOpLogger(),
15
+ serviceId: config?.serviceId ?? "Inspector Scan",
16
+ urlParser: config?.urlParser ?? parseUrl,
17
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
18
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
19
+ };
20
+ };
@@ -0,0 +1,18 @@
1
+ import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
+ import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
+ import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ const asPartial = (t) => t;
5
+ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
+ const extensionConfiguration = {
7
+ ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
8
+ ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
9
+ ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
10
+ };
11
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
12
+ return {
13
+ ...runtimeConfig,
14
+ ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
15
+ ...resolveDefaultRuntimeConfig(extensionConfiguration),
16
+ ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
17
+ };
18
+ };
@@ -0,0 +1,17 @@
1
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2
+ import { ScanSbomCommandInput, ScanSbomCommandOutput } from "./commands/ScanSbomCommand";
3
+ import { InspectorScanClient } from "./InspectorScanClient";
4
+ export interface InspectorScan {
5
+ /**
6
+ * @see {@link ScanSbomCommand}
7
+ */
8
+ scanSbom(args: ScanSbomCommandInput, options?: __HttpHandlerOptions): Promise<ScanSbomCommandOutput>;
9
+ scanSbom(args: ScanSbomCommandInput, cb: (err: any, data?: ScanSbomCommandOutput) => void): void;
10
+ scanSbom(args: ScanSbomCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ScanSbomCommandOutput) => void): void;
11
+ }
12
+ /**
13
+ * @public
14
+ * <p>Amazon Inspector Scan is a vulnerability discovery service that scans a provided Software Bill of Materials (SBOM) for security vulnerabilities.</p>
15
+ */
16
+ export declare class InspectorScan extends InspectorScanClient implements InspectorScan {
17
+ }
@@ -0,0 +1,170 @@
1
+ import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
2
+ import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
3
+ import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
+ import { Credentials as __Credentials } from "@aws-sdk/types";
5
+ import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
6
+ import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
7
+ import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
8
+ import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
9
+ import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
10
+ import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
11
+ import { ScanSbomCommandInput, ScanSbomCommandOutput } from "./commands/ScanSbomCommand";
12
+ import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
13
+ import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
14
+ export { __Client };
15
+ /**
16
+ * @public
17
+ */
18
+ export type ServiceInputTypes = ScanSbomCommandInput;
19
+ /**
20
+ * @public
21
+ */
22
+ export type ServiceOutputTypes = ScanSbomCommandOutput;
23
+ /**
24
+ * @public
25
+ */
26
+ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
27
+ /**
28
+ * The HTTP handler to use. Fetch in browser and Https in Nodejs.
29
+ */
30
+ requestHandler?: __HttpHandler;
31
+ /**
32
+ * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface
33
+ * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
34
+ * @internal
35
+ */
36
+ sha256?: __ChecksumConstructor | __HashConstructor;
37
+ /**
38
+ * The function that will be used to convert strings into HTTP endpoints.
39
+ * @internal
40
+ */
41
+ urlParser?: __UrlParser;
42
+ /**
43
+ * A function that can calculate the length of a request body.
44
+ * @internal
45
+ */
46
+ bodyLengthChecker?: __BodyLengthCalculator;
47
+ /**
48
+ * A function that converts a stream into an array of bytes.
49
+ * @internal
50
+ */
51
+ streamCollector?: __StreamCollector;
52
+ /**
53
+ * The function that will be used to convert a base64-encoded string to a byte array.
54
+ * @internal
55
+ */
56
+ base64Decoder?: __Decoder;
57
+ /**
58
+ * The function that will be used to convert binary data to a base64-encoded string.
59
+ * @internal
60
+ */
61
+ base64Encoder?: __Encoder;
62
+ /**
63
+ * The function that will be used to convert a UTF8-encoded string to a byte array.
64
+ * @internal
65
+ */
66
+ utf8Decoder?: __Decoder;
67
+ /**
68
+ * The function that will be used to convert binary data to a UTF-8 encoded string.
69
+ * @internal
70
+ */
71
+ utf8Encoder?: __Encoder;
72
+ /**
73
+ * The runtime environment.
74
+ * @internal
75
+ */
76
+ runtime?: string;
77
+ /**
78
+ * Disable dynamically changing the endpoint of the client based on the hostPrefix
79
+ * trait of an operation.
80
+ */
81
+ disableHostPrefix?: boolean;
82
+ /**
83
+ * Unique service identifier.
84
+ * @internal
85
+ */
86
+ serviceId?: string;
87
+ /**
88
+ * Enables IPv6/IPv4 dualstack endpoint.
89
+ */
90
+ useDualstackEndpoint?: boolean | __Provider<boolean>;
91
+ /**
92
+ * Enables FIPS compatible endpoints.
93
+ */
94
+ useFipsEndpoint?: boolean | __Provider<boolean>;
95
+ /**
96
+ * The AWS region to which this client will send requests
97
+ */
98
+ region?: string | __Provider<string>;
99
+ /**
100
+ * Default credentials provider; Not available in browser runtime.
101
+ * @internal
102
+ */
103
+ credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
104
+ /**
105
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
106
+ * @internal
107
+ */
108
+ defaultUserAgentProvider?: Provider<__UserAgent>;
109
+ /**
110
+ * Value for how many times a request will be made at most in case of retry.
111
+ */
112
+ maxAttempts?: number | __Provider<number>;
113
+ /**
114
+ * Specifies which retry algorithm to use.
115
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/
116
+ *
117
+ */
118
+ retryMode?: string | __Provider<string>;
119
+ /**
120
+ * Optional logger for logging debug/info/warn/error.
121
+ */
122
+ logger?: __Logger;
123
+ /**
124
+ * Optional extensions
125
+ */
126
+ extensions?: RuntimeExtension[];
127
+ /**
128
+ * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
129
+ */
130
+ defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
131
+ }
132
+ /**
133
+ * @public
134
+ */
135
+ export type InspectorScanClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
136
+ /**
137
+ * @public
138
+ *
139
+ * The configuration interface of InspectorScanClient class constructor that set the region, credentials and other options.
140
+ */
141
+ export interface InspectorScanClientConfig extends InspectorScanClientConfigType {
142
+ }
143
+ /**
144
+ * @public
145
+ */
146
+ export type InspectorScanClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
147
+ /**
148
+ * @public
149
+ *
150
+ * The resolved configuration interface of InspectorScanClient class. This is resolved and normalized from the {@link InspectorScanClientConfig | constructor configuration interface}.
151
+ */
152
+ export interface InspectorScanClientResolvedConfig extends InspectorScanClientResolvedConfigType {
153
+ }
154
+ /**
155
+ * @public
156
+ * <p>Amazon Inspector Scan is a vulnerability discovery service that scans a provided Software Bill of Materials (SBOM) for security vulnerabilities.</p>
157
+ */
158
+ export declare class InspectorScanClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, InspectorScanClientResolvedConfig> {
159
+ /**
160
+ * The resolved configuration of InspectorScanClient class. This is resolved and normalized from the {@link InspectorScanClientConfig | constructor configuration interface}.
161
+ */
162
+ readonly config: InspectorScanClientResolvedConfig;
163
+ constructor(...[configuration]: __CheckOptionalClientConfig<InspectorScanClientConfig>);
164
+ /**
165
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
166
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
167
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
168
+ */
169
+ destroy(): void;
170
+ }
@@ -0,0 +1,91 @@
1
+ import { EndpointParameterInstructions } from "@smithy/middleware-endpoint";
2
+ import { Command as $Command } from "@smithy/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@smithy/types";
4
+ import { InspectorScanClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InspectorScanClient";
5
+ import { ScanSbomRequest, ScanSbomResponse } from "../models/models_0";
6
+ /**
7
+ * @public
8
+ */
9
+ export { __MetadataBearer, $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link ScanSbomCommand}.
14
+ */
15
+ export interface ScanSbomCommandInput extends ScanSbomRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link ScanSbomCommand}.
21
+ */
22
+ export interface ScanSbomCommandOutput extends ScanSbomResponse, __MetadataBearer {
23
+ }
24
+ /**
25
+ * @public
26
+ * <p>Scans a provided CycloneDX 1.5 SBOM and reports on any vulnerabilities discovered in that SBOM. You can generate compatible SBOMs for your resources using the <a href="">Amazon Inspector SBOM generator</a>.</p>
27
+ * @example
28
+ * Use a bare-bones client and the command you need to make an API call.
29
+ * ```javascript
30
+ * import { InspectorScanClient, ScanSbomCommand } from "@aws-sdk/client-inspector-scan"; // ES Modules import
31
+ * // const { InspectorScanClient, ScanSbomCommand } = require("@aws-sdk/client-inspector-scan"); // CommonJS import
32
+ * const client = new InspectorScanClient(config);
33
+ * const input = { // ScanSbomRequest
34
+ * sbom: "DOCUMENT_VALUE", // required
35
+ * outputFormat: "CYCLONE_DX_1_5" || "INSPECTOR",
36
+ * };
37
+ * const command = new ScanSbomCommand(input);
38
+ * const response = await client.send(command);
39
+ * // { // ScanSbomResponse
40
+ * // sbom: "DOCUMENT_VALUE",
41
+ * // };
42
+ *
43
+ * ```
44
+ *
45
+ * @param ScanSbomCommandInput - {@link ScanSbomCommandInput}
46
+ * @returns {@link ScanSbomCommandOutput}
47
+ * @see {@link ScanSbomCommandInput} for command's `input` shape.
48
+ * @see {@link ScanSbomCommandOutput} for command's `response` shape.
49
+ * @see {@link InspectorScanClientResolvedConfig | config} for InspectorScanClient's `config` shape.
50
+ *
51
+ * @throws {@link AccessDeniedException} (client fault)
52
+ * <p>You do not have sufficient access to perform this action.
53
+ * </p>
54
+ *
55
+ * @throws {@link InternalServerException} (server fault)
56
+ * <p>The request processing has failed because of an unknown error, exception or failure.
57
+ *
58
+ * </p>
59
+ *
60
+ * @throws {@link ThrottlingException} (client fault)
61
+ * <p>The request was denied due to request throttling.
62
+ *
63
+ * </p>
64
+ *
65
+ * @throws {@link ValidationException} (client fault)
66
+ * <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
67
+ *
68
+ * @throws {@link InspectorScanServiceException}
69
+ * <p>Base exception class for all service exceptions from InspectorScan service.</p>
70
+ *
71
+ */
72
+ export declare class ScanSbomCommand extends $Command<ScanSbomCommandInput, ScanSbomCommandOutput, InspectorScanClientResolvedConfig> {
73
+ readonly input: ScanSbomCommandInput;
74
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
75
+ /**
76
+ * @public
77
+ */
78
+ constructor(input: ScanSbomCommandInput);
79
+ /**
80
+ * @internal
81
+ */
82
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: InspectorScanClientResolvedConfig, options?: __HttpHandlerOptions): Handler<ScanSbomCommandInput, ScanSbomCommandOutput>;
83
+ /**
84
+ * @internal
85
+ */
86
+ private serialize;
87
+ /**
88
+ * @internal
89
+ */
90
+ private deserialize;
91
+ }
@@ -0,0 +1 @@
1
+ export * from "./ScanSbomCommand";
@@ -0,0 +1,22 @@
1
+ import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types";
2
+ /**
3
+ * @public
4
+ */
5
+ export interface ClientInputEndpointParameters {
6
+ region?: string | Provider<string>;
7
+ useDualstackEndpoint?: boolean | Provider<boolean>;
8
+ useFipsEndpoint?: boolean | Provider<boolean>;
9
+ endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
10
+ }
11
+ export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & {
12
+ defaultSigningName: string;
13
+ };
14
+ export declare const resolveClientEndpointParameters: <T>(options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & {
15
+ defaultSigningName: string;
16
+ };
17
+ export interface EndpointParameters extends __EndpointParameters {
18
+ Region?: string;
19
+ UseDualStack?: boolean;
20
+ UseFIPS?: boolean;
21
+ Endpoint?: string;
22
+ }
@@ -0,0 +1,5 @@
1
+ import { EndpointV2, Logger } from "@smithy/types";
2
+ import { EndpointParameters } from "./EndpointParameters";
3
+ export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: {
4
+ logger?: Logger;
5
+ }) => EndpointV2;
@@ -0,0 +1,2 @@
1
+ import { RuleSetObject } from "@smithy/types";
2
+ export declare const ruleSet: RuleSetObject;
@@ -0,0 +1,8 @@
1
+ import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
2
+ import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
3
+ import { DefaultExtensionConfiguration } from "@smithy/types";
4
+ /**
5
+ * @internal
6
+ */
7
+ export interface InspectorScanExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration {
8
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * <p>Amazon Inspector Scan is a vulnerability discovery service that scans a provided Software Bill of Materials (SBOM) for security vulnerabilities.</p>
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from "./InspectorScanClient";
7
+ export * from "./InspectorScan";
8
+ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
9
+ export { RuntimeExtension } from "./runtimeExtensions";
10
+ export { InspectorScanExtensionConfiguration } from "./extensionConfiguration";
11
+ export * from "./commands";
12
+ export * from "./models";
13
+ import "@aws-sdk/util-endpoints";
14
+ export { InspectorScanServiceException } from "./models/InspectorScanServiceException";