@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 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.2",
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.4",
24
- "@e-mc/module": "^0.9.4",
25
- "@e-mc/types": "^0.9.4",
26
- "@pi-r/aws-lib": "^0.7.2",
27
- "@aws-sdk/client-dynamodb": "^3.602.0",
28
- "@aws-sdk/client-s3": "^3.600.0",
29
- "@aws-sdk/credential-providers": "^3.600.0",
30
- "@aws-sdk/lib-dynamodb": "^3.602.0",
31
- "@aws-sdk/lib-storage": "^3.600.0"
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 { AwsAuthInputConfig } from '@aws-sdk/middleware-signing';
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 { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
7
- import type { S3ClientConfig } from '@aws-sdk/client-s3';
8
-
9
- export interface AWSBaseCredential extends AwsAuthInputConfig {
10
- provider?: {
11
- http?: unknown;
12
- ini?: unknown;
13
- cognitoIdentity?: unknown;
14
- cognitoIdentityPool?: unknown;
15
- temporaryCredentials?: unknown;
16
- webToken?: unknown;
17
- containerMetadata?: unknown;
18
- instanceMetadata?: unknown;
19
- process?: unknown;
20
- tokenFile?: unknown;
21
- sso?: unknown;
22
- env?: unknown;
23
- nodeProviderChain?: unknown;
24
- };
25
- }
26
-
27
- export type AWSStorage = CloudStorage<AWSStorageCredential, "aws-v3">;
28
-
29
- export interface AWSStorageCredential extends S3ClientConfig, AWSBaseCredential {}
30
-
31
- export interface AWSDatabaseQuery extends CloudDatabase<QueryCommandInput | ObjectMap<NativeAttributeValue>[], PlainObject, UpdateCommandInput, BatchGetCommandInput | ScanCommandInput> {
32
- source: "cloud";
33
- service: "aws-v3";
34
- key?: string | AttributeKey;
35
- }
36
-
37
- export interface AWSDatabaseCredential extends Omit<DynamoDBClientConfig, "credentials">, AWSBaseCredential {
38
- translateConfig?: TranslateConfig;
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>;