@pi-r/aws-v3 0.7.2 → 0.7.4
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 +6 -6
- package/client/index.js +1 -1
- package/package.json +33 -33
- package/types/index.d.ts +39 -40
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @pi-r/aws-v3
|
|
2
|
-
|
|
3
|
-
https://e-mc.readthedocs.io/en/latest/cloud/aws-v3.html
|
|
4
|
-
|
|
5
|
-
### LICENSE
|
|
6
|
-
|
|
1
|
+
### @pi-r/aws-v3
|
|
2
|
+
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/cloud/aws-v3.html
|
|
4
|
+
|
|
5
|
+
### LICENSE
|
|
6
|
+
|
|
7
7
|
MIT
|
package/client/index.js
CHANGED
|
@@ -314,7 +314,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
314
314
|
const [db, AWS] = createClient();
|
|
315
315
|
const Key = (0, types_1.isPlainObject)(key) ? key : { [key]: id };
|
|
316
316
|
const command = { TableName, Key };
|
|
317
|
-
if (update) {
|
|
317
|
+
if ((0, types_1.isPlainObject)(update)) {
|
|
318
318
|
await db.send(new AWS.UpdateCommand({ ...command, ...update }));
|
|
319
319
|
}
|
|
320
320
|
const Item = (await db.send(new AWS.GetCommand(command))).Item;
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pi-r/aws-v3",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "AWS V3 cloud functions for E-mc.",
|
|
5
|
-
"main": "client/index.js",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
12
|
-
"directory": "src/cloud/aws-v3"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"squared",
|
|
16
|
-
"e-mc",
|
|
17
|
-
"squared-functions"
|
|
18
|
-
],
|
|
19
|
-
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.9.
|
|
24
|
-
"@e-mc/module": "^0.9.
|
|
25
|
-
"@e-mc/types": "^0.9.
|
|
26
|
-
"@pi-r/aws-lib": "^0.7.
|
|
27
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
28
|
-
"@aws-sdk/client-s3": "^3.
|
|
29
|
-
"@aws-sdk/credential-providers": "^3.
|
|
30
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
31
|
-
"@aws-sdk/lib-storage": "^3.
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pi-r/aws-v3",
|
|
3
|
+
"version": "0.7.4",
|
|
4
|
+
"description": "AWS V3 cloud functions for E-mc.",
|
|
5
|
+
"main": "client/index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
12
|
+
"directory": "src/cloud/aws-v3"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"squared",
|
|
16
|
+
"e-mc",
|
|
17
|
+
"squared-functions"
|
|
18
|
+
],
|
|
19
|
+
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@e-mc/cloud": "^0.9.12",
|
|
24
|
+
"@e-mc/module": "^0.9.12",
|
|
25
|
+
"@e-mc/types": "^0.9.12",
|
|
26
|
+
"@pi-r/aws-lib": "^0.7.4",
|
|
27
|
+
"@aws-sdk/client-dynamodb": "^3.666.0",
|
|
28
|
+
"@aws-sdk/client-s3": "^3.666.0",
|
|
29
|
+
"@aws-sdk/credential-providers": "^3.666.0",
|
|
30
|
+
"@aws-sdk/lib-dynamodb": "^3.666.0",
|
|
31
|
+
"@aws-sdk/lib-storage": "^3.666.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import type { CloudDatabase, CloudStorage } from '@e-mc/types/lib/cloud';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
import type { DynamoDBClientConfig, QueryCommandInput, ScanCommandInput } from '@aws-sdk/client-dynamodb';
|
|
5
|
-
import type { BatchGetCommandInput, TranslateConfig, UpdateCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
import type { CloudDatabase, CloudStorage } from '@e-mc/types/lib/cloud';
|
|
2
|
+
|
|
3
|
+
import type { AwsSdkSigV4AuthInputConfig } from '@aws-sdk/core';
|
|
4
|
+
import type { DynamoDBClientConfig, QueryCommandInput, ScanCommandInput } from '@aws-sdk/client-dynamodb';
|
|
5
|
+
import type { BatchGetCommandInput, NativeAttributeValue, TranslateConfig, UpdateCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
6
|
+
import type { S3ClientConfig } from '@aws-sdk/client-s3';
|
|
7
|
+
|
|
8
|
+
export interface AWSBaseCredential extends AwsSdkSigV4AuthInputConfig {
|
|
9
|
+
provider?: {
|
|
10
|
+
http?: unknown;
|
|
11
|
+
ini?: unknown;
|
|
12
|
+
cognitoIdentity?: unknown;
|
|
13
|
+
cognitoIdentityPool?: unknown;
|
|
14
|
+
temporaryCredentials?: unknown;
|
|
15
|
+
webToken?: unknown;
|
|
16
|
+
containerMetadata?: unknown;
|
|
17
|
+
instanceMetadata?: unknown;
|
|
18
|
+
process?: unknown;
|
|
19
|
+
tokenFile?: unknown;
|
|
20
|
+
sso?: unknown;
|
|
21
|
+
env?: unknown;
|
|
22
|
+
nodeProviderChain?: unknown;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AWSStorage = CloudStorage<AWSStorageCredential, "aws-v3">;
|
|
27
|
+
|
|
28
|
+
export interface AWSStorageCredential extends S3ClientConfig, AWSBaseCredential {}
|
|
29
|
+
|
|
30
|
+
export interface AWSDatabaseQuery extends CloudDatabase<QueryCommandInput | ObjectMap<NativeAttributeValue>[] | string, PlainObject, UpdateCommandInput | string, BatchGetCommandInput | ScanCommandInput | NativeAttributeValue[]> {
|
|
31
|
+
source: "cloud";
|
|
32
|
+
service: "aws-v3";
|
|
33
|
+
key?: string | AttributeKey;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AWSDatabaseCredential extends Omit<DynamoDBClientConfig, "credentials">, AWSBaseCredential {
|
|
37
|
+
translateConfig?: TranslateConfig;
|
|
38
|
+
}
|
|
39
|
+
|
|
41
40
|
export type AttributeKey = Record<string, NativeAttributeValue>;
|