@aws-sdk/client-securityhub
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -6,2 +6,19 @@ # Change Log | ||
# [3.3.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.2.0...v3.3.0) (2021-01-14) | ||
### Bug Fixes | ||
* **clients:** export explicit dependencies on @aws-sdk/types ([#1902](https://github.com/aws/aws-sdk-js-v3/issues/1902)) ([96f1087](https://github.com/aws/aws-sdk-js-v3/commit/96f1087333ba916593d557051297983912b27caa)) | ||
* **url-parser:** merge browser and node url parser, add rn url parser ([#1903](https://github.com/aws/aws-sdk-js-v3/issues/1903)) ([99be092](https://github.com/aws/aws-sdk-js-v3/commit/99be092fded13bb00802549e17dbdb6d760a8679)) | ||
### Features | ||
* **clients:** update README with documentation, usage and more ([#1907](https://github.com/aws/aws-sdk-js-v3/issues/1907)) ([03be111](https://github.com/aws/aws-sdk-js-v3/commit/03be111a086360687f20b2ac1d490584fb4fbefe)) | ||
# [3.2.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.1.0...v3.2.0) (2021-01-09) | ||
@@ -8,0 +25,0 @@ |
{ | ||
"name": "@aws-sdk/client-securityhub", | ||
"description": "AWS SDK for JavaScript Securityhub Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
@@ -10,3 +10,2 @@ "use strict"; | ||
const middleware_retry_1 = require("@aws-sdk/middleware-retry"); | ||
const url_parser_browser_1 = require("@aws-sdk/url-parser-browser"); | ||
const util_base64_browser_1 = require("@aws-sdk/util-base64-browser"); | ||
@@ -36,3 +35,2 @@ const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); | ||
streamCollector: fetch_http_handler_1.streamCollector, | ||
urlParser: url_parser_browser_1.parseUrl, | ||
utf8Decoder: util_utf8_browser_1.fromUtf8, | ||
@@ -39,0 +37,0 @@ utf8Encoder: util_utf8_browser_1.toUtf8, |
@@ -12,3 +12,2 @@ "use strict"; | ||
const node_http_handler_1 = require("@aws-sdk/node-http-handler"); | ||
const url_parser_node_1 = require("@aws-sdk/url-parser-node"); | ||
const util_base64_node_1 = require("@aws-sdk/util-base64-node"); | ||
@@ -38,3 +37,2 @@ const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); | ||
streamCollector: node_http_handler_1.streamCollector, | ||
urlParser: url_parser_node_1.parseUrl, | ||
utf8Decoder: util_utf8_node_1.fromUtf8, | ||
@@ -41,0 +39,0 @@ utf8Encoder: util_utf8_node_1.toUtf8, |
@@ -5,3 +5,3 @@ "use strict"; | ||
const sha256_js_1 = require("@aws-crypto/sha256-js"); | ||
const url_parser_node_1 = require("@aws-sdk/url-parser-node"); | ||
const url_parser_native_1 = require("@aws-sdk/url-parser-native"); | ||
const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); | ||
@@ -15,4 +15,4 @@ /** | ||
sha256: sha256_js_1.Sha256, | ||
urlParser: url_parser_node_1.parseUrl, | ||
urlParser: url_parser_native_1.parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.native.js.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
const endpoints_1 = require("./endpoints"); | ||
const url_parser_1 = require("@aws-sdk/url-parser"); | ||
/** | ||
@@ -15,3 +16,4 @@ * @internal | ||
serviceId: "SecurityHub", | ||
urlParser: url_parser_1.parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.shared.js.map |
{ | ||
"name": "@aws-sdk/client-securityhub", | ||
"description": "AWS SDK for JavaScript Securityhub Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
@@ -7,3 +7,2 @@ import { __assign } from "tslib"; | ||
import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/middleware-retry"; | ||
import { parseUrl } from "@aws-sdk/url-parser-browser"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; | ||
@@ -20,3 +19,3 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; | ||
clientVersion: packageInfo.version, | ||
}), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider("Region is missing"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, urlParser: parseUrl, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
}), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider("Region is missing"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
//# sourceMappingURL=runtimeConfig.browser.js.map |
@@ -9,3 +9,2 @@ import { __assign } from "tslib"; | ||
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; | ||
@@ -22,3 +21,3 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; | ||
clientVersion: packageInfo.version, | ||
}), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), sha256: Hash.bind(null, "sha256"), streamCollector: streamCollector, urlParser: parseUrl, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
}), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), sha256: Hash.bind(null, "sha256"), streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 }); | ||
//# sourceMappingURL=runtimeConfig.js.map |
import { __assign } from "tslib"; | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { parseUrl } from "@aws-sdk/url-parser-native"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
@@ -5,0 +5,0 @@ /** |
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
/** | ||
@@ -11,3 +12,4 @@ * @internal | ||
serviceId: "SecurityHub", | ||
urlParser: parseUrl, | ||
}; | ||
//# sourceMappingURL=runtimeConfig.shared.js.map |
{ | ||
"name": "@aws-sdk/client-securityhub", | ||
"description": "AWS SDK for JavaScript Securityhub Client for Node.js, Browser and React Native", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"scripts": { | ||
@@ -31,21 +31,22 @@ "clean": "yarn remove-definitions && yarn remove-dist && yarn remove-documentation", | ||
"@aws-crypto/sha256-js": "^1.0.0", | ||
"@aws-sdk/config-resolver": "3.2.0", | ||
"@aws-sdk/credential-provider-node": "3.1.0", | ||
"@aws-sdk/fetch-http-handler": "3.2.0", | ||
"@aws-sdk/hash-node": "3.1.0", | ||
"@aws-sdk/invalid-dependency": "3.2.0", | ||
"@aws-sdk/middleware-content-length": "3.2.0", | ||
"@aws-sdk/middleware-host-header": "3.2.0", | ||
"@aws-sdk/middleware-logger": "3.2.0", | ||
"@aws-sdk/middleware-retry": "3.2.0", | ||
"@aws-sdk/middleware-serde": "3.2.0", | ||
"@aws-sdk/middleware-signing": "3.2.0", | ||
"@aws-sdk/config-resolver": "3.3.0", | ||
"@aws-sdk/credential-provider-node": "3.3.0", | ||
"@aws-sdk/fetch-http-handler": "3.3.0", | ||
"@aws-sdk/hash-node": "3.3.0", | ||
"@aws-sdk/invalid-dependency": "3.3.0", | ||
"@aws-sdk/middleware-content-length": "3.3.0", | ||
"@aws-sdk/middleware-host-header": "3.3.0", | ||
"@aws-sdk/middleware-logger": "3.3.0", | ||
"@aws-sdk/middleware-retry": "3.3.0", | ||
"@aws-sdk/middleware-serde": "3.3.0", | ||
"@aws-sdk/middleware-signing": "3.3.0", | ||
"@aws-sdk/middleware-stack": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.2.0", | ||
"@aws-sdk/node-config-provider": "3.1.0", | ||
"@aws-sdk/node-http-handler": "3.2.0", | ||
"@aws-sdk/protocol-http": "3.2.0", | ||
"@aws-sdk/smithy-client": "3.2.0", | ||
"@aws-sdk/url-parser-browser": "3.1.0", | ||
"@aws-sdk/url-parser-node": "3.1.0", | ||
"@aws-sdk/middleware-user-agent": "3.3.0", | ||
"@aws-sdk/node-config-provider": "3.3.0", | ||
"@aws-sdk/node-http-handler": "3.3.0", | ||
"@aws-sdk/protocol-http": "3.3.0", | ||
"@aws-sdk/smithy-client": "3.3.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@aws-sdk/url-parser": "3.3.0", | ||
"@aws-sdk/url-parser-native": "3.3.0", | ||
"@aws-sdk/util-base64-browser": "3.1.0", | ||
@@ -55,4 +56,4 @@ "@aws-sdk/util-base64-node": "3.1.0", | ||
"@aws-sdk/util-body-length-node": "3.1.0", | ||
"@aws-sdk/util-user-agent-browser": "3.2.0", | ||
"@aws-sdk/util-user-agent-node": "3.2.0", | ||
"@aws-sdk/util-user-agent-browser": "3.3.0", | ||
"@aws-sdk/util-user-agent-node": "3.3.0", | ||
"@aws-sdk/util-utf8-browser": "3.1.0", | ||
@@ -64,3 +65,2 @@ "@aws-sdk/util-utf8-node": "3.1.0", | ||
"@aws-sdk/client-documentation-generator": "3.1.0", | ||
"@aws-sdk/types": "3.1.0", | ||
"@types/node": "^12.7.5", | ||
@@ -67,0 +67,0 @@ "jest": "^26.1.0", |
253
README.md
@@ -6,2 +6,253 @@ # @aws-sdk/client-securityhub | ||
For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). | ||
## Description | ||
AWS SDK for JavaScript SecurityHub Client for Node.js, Browser and React Native. | ||
<p>Security Hub provides you with a comprehensive view of the security state of your AWS | ||
environment and resources. It also provides you with the readiness status of your | ||
environment based on controls from supported security standards. Security Hub collects security | ||
data from AWS accounts, services, and integrated third-party products and helps you analyze | ||
security trends in your environment to identify the highest priority security issues. For | ||
more information about Security Hub, see the <i> | ||
<a href="https://docs.aws.amazon.com/securityhub/latest/userguide/what-is-securityhub.html">AWS Security Hub User | ||
Guide</a> | ||
</i>.</p> | ||
<p>When you use operations in the Security Hub API, the requests are executed only in the AWS | ||
Region that is currently active or in the specific AWS Region that you specify in your | ||
request. Any configuration or settings change that results from the operation is applied | ||
only to that Region. To make the same change in other Regions, execute the same command for | ||
each Region to apply the change to.</p> | ||
<p>For example, if your Region is set to <code>us-west-2</code>, when you use <code> | ||
<a>CreateMembers</a> | ||
</code> to add a member account to Security Hub, the association of | ||
the member account with the master account is created only in the <code>us-west-2</code> | ||
Region. Security Hub must be enabled for the member account in the same Region that the invitation | ||
was sent from.</p> | ||
<p>The following throttling limits apply to using Security Hub API operations.</p> | ||
<ul> | ||
<li> | ||
<p> | ||
<code> | ||
<a>BatchEnableStandards</a> | ||
</code> - <code>RateLimit</code> of 1 | ||
request per second, <code>BurstLimit</code> of 1 request per second.</p> | ||
</li> | ||
<li> | ||
<p> | ||
<code> | ||
<a>GetFindings</a> | ||
</code> - <code>RateLimit</code> of 3 requests per second. | ||
<code>BurstLimit</code> of 6 requests per second.</p> | ||
</li> | ||
<li> | ||
<p> | ||
<code> | ||
<a>UpdateFindings</a> | ||
</code> - <code>RateLimit</code> of 1 request per | ||
second. <code>BurstLimit</code> of 5 requests per second.</p> | ||
</li> | ||
<li> | ||
<p> | ||
<code> | ||
<a>UpdateStandardsControl</a> | ||
</code> - <code>RateLimit</code> of | ||
1 request per second, <code>BurstLimit</code> of 5 requests per second.</p> | ||
</li> | ||
<li> | ||
<p>All other operations - <code>RateLimit</code> of 10 requests per second. | ||
<code>BurstLimit</code> of 30 requests per second.</p> | ||
</li> | ||
</ul> | ||
## Installing | ||
To install the this package, simply type add or install @aws-sdk/client-securityhub | ||
using your favorite package manager: | ||
- `npm install @aws-sdk/client-securityhub` | ||
- `yarn add @aws-sdk/client-securityhub` | ||
- `pnpm add @aws-sdk/client-securityhub` | ||
## Getting Started | ||
### Import | ||
The AWS SDK is modulized by clients and commands. | ||
To send a request, you only need to import the `SecurityHubClient` and | ||
the commands you need, for example `AcceptInvitationCommand`: | ||
```js | ||
// ES5 example | ||
const { SecurityHubClient, AcceptInvitationCommand } = require("@aws-sdk/client-securityhub"); | ||
``` | ||
```ts | ||
// ES6+ example | ||
import { SecurityHubClient, AcceptInvitationCommand } from "@aws-sdk/client-securityhub"; | ||
``` | ||
### Usage | ||
To send a request, you: | ||
- Initiate client with configuration (e.g. credentials, region). | ||
- Initiate command with input parameters. | ||
- Call `send` operation on client with command object as input. | ||
- If you are using a custom http handler, you may call `destroy()` to close open connections. | ||
```js | ||
// a client can be shared by difference commands. | ||
const client = new SecurityHubClient({ region: "REGION" }); | ||
const params = { | ||
/** input parameters */ | ||
}; | ||
const command = new AcceptInvitationCommand(params); | ||
``` | ||
#### Async/await | ||
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) | ||
operator to wait for the promise returned by send operation as follows: | ||
```js | ||
// async/await. | ||
try { | ||
const data = await client.send(command); | ||
// process data. | ||
} catch (error) { | ||
// error handling. | ||
} finally { | ||
// finally. | ||
} | ||
``` | ||
Async-await is clean, concise, intuitive, easy to debug and has better error handling | ||
as compared to using Promise chains or callbacks. | ||
#### Promises | ||
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) | ||
to execute send operation. | ||
```js | ||
client.send(command).then( | ||
(data) => { | ||
// process data. | ||
}, | ||
(error) => { | ||
// error handling. | ||
} | ||
); | ||
``` | ||
Promises can also be called using `.catch()` and `.finally()` as follows: | ||
```js | ||
client | ||
.send(command) | ||
.then((data) => { | ||
// process data. | ||
}) | ||
.catch((error) => { | ||
// error handling. | ||
}) | ||
.finally(() => { | ||
// finally. | ||
}); | ||
``` | ||
#### Callbacks | ||
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), | ||
but they are supported by the send operation. | ||
```js | ||
// callbacks. | ||
client.send(command, (err, data) => { | ||
// proccess err and data. | ||
}); | ||
``` | ||
#### v2 compatible style | ||
The client can also send requests using v2 compatible style. | ||
However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post | ||
on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) | ||
```ts | ||
import * as AWS from "@aws-sdk/client-securityhub"; | ||
const client = new AWS.SecurityHub({ region: "REGION" }); | ||
// async/await. | ||
try { | ||
const data = client.acceptInvitation(params); | ||
// process data. | ||
} catch (error) { | ||
// error handling. | ||
} | ||
// Promises. | ||
client | ||
.acceptInvitation(params) | ||
.then((data) => { | ||
// process data. | ||
}) | ||
.catch((error) => { | ||
// error handling. | ||
}); | ||
// callbacks. | ||
client.acceptInvitation(params, (err, data) => { | ||
// proccess err and data. | ||
}); | ||
``` | ||
### Troubleshooting | ||
When the service returns an exception, the error will include the exception information, | ||
as well as response metadata (e.g. request id). | ||
```js | ||
try { | ||
const data = await client.send(command); | ||
// process data. | ||
} catch (error) { | ||
const { requestId, cfId, extendedRequestId } = error.$metadata; | ||
console.log({ requestId, cfId, extendedRequestId }); | ||
/** | ||
* The keys within exceptions are also parsed. | ||
* You can access them by specifying exception names: | ||
* if (error.name === 'SomeServiceException') { | ||
* const value = error.specialKeyInException; | ||
* } | ||
*/ | ||
} | ||
``` | ||
## Getting Help | ||
Please use these community resources for getting help. | ||
We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. | ||
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) | ||
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). | ||
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) | ||
on AWS Developer Blog. | ||
- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. | ||
- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). | ||
- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). | ||
To test your universal JavaScript code in Node.js, browser and react-native environments, | ||
visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). | ||
## Contributing | ||
This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-securityhub` package is updated. | ||
To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). | ||
## License | ||
This SDK is distributed under the | ||
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), | ||
see LICENSE for more information. |
@@ -7,3 +7,2 @@ import packageInfo from "./package.json"; | ||
import { DEFAULT_MAX_ATTEMPTS } from "@aws-sdk/middleware-retry"; | ||
import { parseUrl } from "@aws-sdk/url-parser-browser"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; | ||
@@ -35,5 +34,4 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; | ||
streamCollector, | ||
urlParser: parseUrl, | ||
utf8Decoder: fromUtf8, | ||
utf8Encoder: toUtf8, | ||
}; |
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { parseUrl } from "@aws-sdk/url-parser-native"; | ||
import { ClientDefaults } from "./SecurityHubClient"; | ||
@@ -4,0 +4,0 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; |
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
@@ -13,2 +14,3 @@ /** | ||
serviceId: "SecurityHub", | ||
urlParser: parseUrl, | ||
}; |
@@ -9,3 +9,2 @@ import packageInfo from "./package.json"; | ||
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; | ||
import { parseUrl } from "@aws-sdk/url-parser-node"; | ||
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; | ||
@@ -37,5 +36,4 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; | ||
streamCollector, | ||
urlParser: parseUrl, | ||
utf8Decoder: fromUtf8, | ||
utf8Encoder: toUtf8, | ||
}; |
@@ -11,2 +11,3 @@ import { Logger as __Logger } from "@aws-sdk/types"; | ||
serviceId: string; | ||
urlParser: import("@aws-sdk/types").UrlParser; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5484174
6
258
31
84568
+ Added@aws-sdk/types@3.1.0
+ Added@aws-sdk/url-parser@3.3.0
+ Added@aws-sdk/abort-controller@3.3.0(transitive)
+ Added@aws-sdk/config-resolver@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-env@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-imds@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.3.0(transitive)
+ Added@aws-sdk/credential-provider-process@3.3.0(transitive)
+ Added@aws-sdk/fetch-http-handler@3.3.0(transitive)
+ Added@aws-sdk/hash-node@3.3.0(transitive)
+ Added@aws-sdk/invalid-dependency@3.3.0(transitive)
+ Added@aws-sdk/middleware-content-length@3.3.0(transitive)
+ Added@aws-sdk/middleware-host-header@3.3.0(transitive)
+ Added@aws-sdk/middleware-logger@3.3.0(transitive)
+ Added@aws-sdk/middleware-retry@3.3.0(transitive)
+ Added@aws-sdk/middleware-serde@3.3.0(transitive)
+ Added@aws-sdk/middleware-signing@3.3.0(transitive)
+ Added@aws-sdk/middleware-user-agent@3.3.0(transitive)
+ Added@aws-sdk/node-config-provider@3.3.0(transitive)
+ Added@aws-sdk/node-http-handler@3.3.0(transitive)
+ Added@aws-sdk/property-provider@3.3.0(transitive)
+ Added@aws-sdk/protocol-http@3.3.0(transitive)
+ Added@aws-sdk/querystring-builder@3.3.0(transitive)
+ Added@aws-sdk/querystring-parser@3.3.0(transitive)
+ Added@aws-sdk/service-error-classification@3.3.0(transitive)
+ Added@aws-sdk/signature-v4@3.3.0(transitive)
+ Added@aws-sdk/smithy-client@3.3.0(transitive)
+ Added@aws-sdk/types@3.1.0(transitive)
+ Added@aws-sdk/url-parser@3.3.0(transitive)
+ Added@aws-sdk/url-parser-native@3.3.0(transitive)
+ Added@aws-sdk/util-user-agent-browser@3.3.0(transitive)
+ Added@aws-sdk/util-user-agent-node@3.3.0(transitive)
- Removed@aws-sdk/url-parser-browser@3.1.0
- Removed@aws-sdk/url-parser-node@3.1.0
- Removed@aws-sdk/abort-controller@3.1.0(transitive)
- Removed@aws-sdk/config-resolver@3.2.0(transitive)
- Removed@aws-sdk/credential-provider-env@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-imds@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-ini@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-node@3.1.0(transitive)
- Removed@aws-sdk/credential-provider-process@3.1.0(transitive)
- Removed@aws-sdk/fetch-http-handler@3.2.0(transitive)
- Removed@aws-sdk/hash-node@3.1.0(transitive)
- Removed@aws-sdk/invalid-dependency@3.2.0(transitive)
- Removed@aws-sdk/middleware-content-length@3.2.0(transitive)
- Removed@aws-sdk/middleware-host-header@3.2.0(transitive)
- Removed@aws-sdk/middleware-logger@3.2.0(transitive)
- Removed@aws-sdk/middleware-retry@3.2.0(transitive)
- Removed@aws-sdk/middleware-serde@3.2.0(transitive)
- Removed@aws-sdk/middleware-signing@3.2.0(transitive)
- Removed@aws-sdk/middleware-user-agent@3.2.0(transitive)
- Removed@aws-sdk/node-config-provider@3.1.0(transitive)
- Removed@aws-sdk/node-http-handler@3.2.0(transitive)
- Removed@aws-sdk/property-provider@3.1.0(transitive)
- Removed@aws-sdk/protocol-http@3.2.0(transitive)
- Removed@aws-sdk/querystring-builder@3.1.0(transitive)
- Removed@aws-sdk/querystring-parser@3.1.0(transitive)
- Removed@aws-sdk/service-error-classification@3.2.0(transitive)
- Removed@aws-sdk/signature-v4@3.2.0(transitive)
- Removed@aws-sdk/smithy-client@3.2.0(transitive)
- Removed@aws-sdk/types@3.723.0(transitive)
- Removed@aws-sdk/url-parser-browser@3.1.0(transitive)
- Removed@aws-sdk/url-parser-node@3.1.0(transitive)
- Removed@aws-sdk/util-user-agent-browser@3.2.0(transitive)
- Removed@aws-sdk/util-user-agent-node@3.2.0(transitive)
- Removed@smithy/types@4.1.0(transitive)
Updated@aws-sdk/hash-node@3.3.0
Updated@aws-sdk/protocol-http@3.3.0
Updated@aws-sdk/smithy-client@3.3.0