@aws-sdk/util-create-request 3.369.0 → 3.375.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/README.md +10 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,25 +25,24 @@ import { createRequest } from "@aws-sdk/util-create-request";
|
|
|
25
25
|
JavaScript usage examples:
|
|
26
26
|
|
|
27
27
|
```javascript
|
|
28
|
-
const S3Client = require("@aws-sdk/client-s3
|
|
29
|
-
const GetObject = require("@aws-sdk/client-s3-node/commands/GetObjectCommand").GetObjectCommand;
|
|
28
|
+
const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3");
|
|
30
29
|
|
|
31
30
|
const request = await createRequest(
|
|
32
31
|
new S3Client({}),
|
|
33
|
-
new
|
|
32
|
+
new GetObjectCommand({
|
|
34
33
|
Bucket: "bucket",
|
|
35
34
|
Key: "key",
|
|
36
35
|
})
|
|
37
36
|
);
|
|
38
37
|
/**
|
|
39
|
-
{
|
|
38
|
+
{
|
|
40
39
|
protocol: 'https:',
|
|
41
40
|
path: '/js-sdk-test-bucket/key',
|
|
42
41
|
hostname: 's3.us-east-2.amazonaws.com',
|
|
43
42
|
body: null,
|
|
44
43
|
headers: {},
|
|
45
44
|
method: 'GET',
|
|
46
|
-
query: {}
|
|
45
|
+
query: {}
|
|
47
46
|
}
|
|
48
47
|
*/
|
|
49
48
|
```
|
|
@@ -51,12 +50,12 @@ const request = await createRequest(
|
|
|
51
50
|
TypeScript usage example:
|
|
52
51
|
|
|
53
52
|
```typescript
|
|
54
|
-
import { S3Client } from "@aws-sdk/client-s3
|
|
55
|
-
import { GetObjectCommand } from "@aws-sdk/client-s3
|
|
56
|
-
import {
|
|
53
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
54
|
+
import { GetObjectCommand } from "@aws-sdk/client-s3";
|
|
55
|
+
import { GetObjectCommandInput, GetObjectCommandOutput } from "@aws-sdk/client-s3";
|
|
57
56
|
import { Readable } from "stream";
|
|
58
57
|
|
|
59
|
-
const request = await createRequest<
|
|
58
|
+
const request = await createRequest<any, GetObjectCommandInput, GetObjectCommandOutput>(
|
|
60
59
|
new S3Client({}),
|
|
61
60
|
new GetObjectCommand({
|
|
62
61
|
Bucket: "bucket",
|
|
@@ -70,8 +69,8 @@ way you will lose the type safety for insuring client and command comes from the
|
|
|
70
69
|
service.
|
|
71
70
|
|
|
72
71
|
```typescript
|
|
73
|
-
import { DynamoDBClient } from "@aws-sdk/client-dynamodb
|
|
74
|
-
import { GetObjectCommand } from "@aws-sdk/client-s3
|
|
72
|
+
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
73
|
+
import { GetObjectCommand } from "@aws-sdk/client-s3";
|
|
75
74
|
/*THIS IS WRONG, but TypeScript won't tell you*/
|
|
76
75
|
const request = await createRequest(
|
|
77
76
|
new DynamoDBClient({}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-create-request",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.375.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
24
|
+
"@aws-sdk/types": "3.370.0",
|
|
25
25
|
"@smithy/middleware-stack": "^1.0.1",
|
|
26
26
|
"@smithy/smithy-client": "^1.0.3",
|
|
27
27
|
"@smithy/types": "^1.1.0",
|