@pi-r/aws 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
2
-
3
- https://e-mc.readthedocs.io/en/latest/cloud/aws.html
4
-
5
- ### LICENSE
6
-
1
+ ### @pi-r/aws
2
+
3
+ https://e-mc.readthedocs.io/en/latest/cloud/aws.html
4
+
5
+ ### LICENSE
6
+
7
7
  MIT
package/client/index.d.ts CHANGED
@@ -1,29 +1,29 @@
1
- import type { ICloud, IModule } from '@e-mc/types/lib';
2
- import type { BucketWebsiteOptions, CloudDatabase } from '@e-mc/types/lib/cloud';
3
- import type { BatchQueryResult, QueryResult } from '@e-mc/types/lib/db';
4
-
5
- import type { BucketCannedACL } from '@pi-r/aws-lib';
6
-
7
- import type { AWSDatabaseCredential, AWSDatabaseQuery, AWSStorageCredential, ConfigureBucketOptions } from '../types';
8
-
9
- import type { AttributeValue, DocumentClient } from 'aws-sdk/clients/dynamodb';
10
- import type { CreateBucketRequest } from 'aws-sdk/clients/s3';
11
-
12
- declare namespace AWS {
13
- function validateStorage(credential: AWSStorageCredential): boolean;
14
- function validateDatabase(credential: AWSDatabaseCredential, data: CloudDatabase): boolean;
15
- function createStorageClient(this: IModule, credential: AWSStorageCredential, service?: string, sdk?: string): boolean;
16
- function createDatabaseClient(this: IModule, credential: AWSDatabaseCredential): DocumentClient;
17
- function createBucket(this: IModule, credential: AWSStorageCredential, Bucket: string, publicRead?: boolean, service?: string, sdk?: string): Promise<boolean>;
18
- function createBucketV2(this: IModule, credential: AWSStorageCredential, Bucket: string, ACL?: BucketCannedACL | 1, options?: CreateBucketRequest, service?: string, sdk?: string): Promise<boolean>;
19
- function setBucketPolicy(this: IModule, credential: AWSStorageCredential, Bucket: string, options: ConfigureBucketOptions, service?: string, sdk?: string): Promise<boolean>;
20
- function setBucketWebsite(this: IModule, credential: AWSStorageCredential, Bucket: string, options: BucketWebsiteOptions, service?: string, sdk?: string): Promise<boolean>;
21
- function deleteObjects(this: IModule, credential: AWSStorageCredential, Bucket: string, service?: string, sdk?: string): Promise<void>;
22
- function deleteObjectsV2(this: IModule, credential: AWSStorageCredential, Bucket: string, recursive?: boolean, service?: string, sdk?: string): Promise<void>;
23
- function executeQuery(this: ICloud, credential: AWSDatabaseCredential, data: AWSDatabaseQuery, sessionKey?: string): Promise<QueryResult>;
24
- function executeBatchQuery(this: ICloud, credential: AWSDatabaseCredential, batch: AWSDatabaseQuery[], sessionKey?: string): Promise<BatchQueryResult>;
25
- function parseAttributeValue(value: unknown): AttributeValue;
26
- function isNoSuchBucket(err: unknown): boolean;
27
- }
28
-
1
+ import type { ICloud, IModule } from '@e-mc/types/lib';
2
+ import type { BucketWebsiteOptions, CloudDatabase } from '@e-mc/types/lib/cloud';
3
+ import type { BatchQueryResult, QueryResult } from '@e-mc/types/lib/db';
4
+
5
+ import type { BucketCannedACL } from '@pi-r/aws-lib';
6
+
7
+ import type { AWSDatabaseCredential, AWSDatabaseQuery, AWSStorageCredential, ConfigureBucketOptions } from '../types';
8
+
9
+ import type { AttributeValue, DocumentClient } from 'aws-sdk/clients/dynamodb';
10
+ import type { CreateBucketRequest } from 'aws-sdk/clients/s3';
11
+
12
+ declare namespace AWS {
13
+ function validateStorage(credential: AWSStorageCredential): boolean;
14
+ function validateDatabase(credential: AWSDatabaseCredential, data: CloudDatabase): boolean;
15
+ function createStorageClient(this: IModule, credential: AWSStorageCredential, service?: string, sdk?: string): boolean;
16
+ function createDatabaseClient(this: IModule, credential: AWSDatabaseCredential): DocumentClient;
17
+ function createBucket(this: IModule, credential: AWSStorageCredential, Bucket: string, publicRead?: boolean, service?: string, sdk?: string): Promise<boolean>;
18
+ function createBucketV2(this: IModule, credential: AWSStorageCredential, Bucket: string, ACL?: BucketCannedACL | 1, options?: CreateBucketRequest, service?: string, sdk?: string): Promise<boolean>;
19
+ function setBucketPolicy(this: IModule, credential: AWSStorageCredential, Bucket: string, options: ConfigureBucketOptions, service?: string, sdk?: string): Promise<boolean>;
20
+ function setBucketWebsite(this: IModule, credential: AWSStorageCredential, Bucket: string, options: BucketWebsiteOptions, service?: string, sdk?: string): Promise<boolean>;
21
+ function deleteObjects(this: IModule, credential: AWSStorageCredential, Bucket: string, service?: string, sdk?: string): Promise<void>;
22
+ function deleteObjectsV2(this: IModule, credential: AWSStorageCredential, Bucket: string, recursive?: boolean, service?: string, sdk?: string): Promise<void>;
23
+ function executeQuery(this: ICloud, credential: AWSDatabaseCredential, data: AWSDatabaseQuery, sessionKey?: string): Promise<QueryResult>;
24
+ function executeBatchQuery(this: ICloud, credential: AWSDatabaseCredential, batch: AWSDatabaseQuery[], sessionKey?: string): Promise<BatchQueryResult>;
25
+ function parseAttributeValue(value: unknown): AttributeValue;
26
+ function isNoSuchBucket(err: unknown): boolean;
27
+ }
28
+
29
29
  export = AWS;
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "@pi-r/aws",
3
- "version": "0.7.2",
4
- "description": "AWS V2 cloud functions for E-mc.",
5
- "main": "client/index.js",
6
- "types": "client/index.d.ts",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/anpham6/pi-r.git",
13
- "directory": "src/cloud/aws"
14
- },
15
- "keywords": [
16
- "squared",
17
- "e-mc",
18
- "squared-functions"
19
- ],
20
- "author": "An Pham <anpham6@gmail.com>",
21
- "license": "MIT",
22
- "homepage": "https://github.com/anpham6/pi-r#readme",
23
- "dependencies": {
24
- "@e-mc/cloud": "^0.9.4",
25
- "@e-mc/module": "^0.9.4",
26
- "@e-mc/types": "^0.9.4",
27
- "@pi-r/aws-lib": "^0.7.2",
28
- "aws-sdk": "^2.1646.0"
29
- }
30
- }
1
+ {
2
+ "name": "@pi-r/aws",
3
+ "version": "0.7.4",
4
+ "description": "AWS V2 cloud functions for E-mc.",
5
+ "main": "client/index.js",
6
+ "types": "client/index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/anpham6/pi-r.git",
13
+ "directory": "src/cloud/aws"
14
+ },
15
+ "keywords": [
16
+ "squared",
17
+ "e-mc",
18
+ "squared-functions"
19
+ ],
20
+ "author": "An Pham <anpham6@gmail.com>",
21
+ "license": "MIT",
22
+ "homepage": "https://github.com/anpham6/pi-r#readme",
23
+ "dependencies": {
24
+ "@e-mc/cloud": "^0.9.12",
25
+ "@e-mc/module": "^0.9.12",
26
+ "@e-mc/types": "^0.9.12",
27
+ "@pi-r/aws-lib": "^0.7.4",
28
+ "aws-sdk": "^2.1691.0"
29
+ }
30
+ }
package/types/index.d.ts CHANGED
@@ -1,29 +1,29 @@
1
- import type { CloudDatabase, CloudStorage } from '@e-mc/types/lib/cloud';
2
-
3
- import type { ConfigurationOptions } from 'aws-sdk/lib/core';
4
- import type { ServiceConfigurationOptions } from 'aws-sdk/lib/service';
5
- import type { DocumentClient } from 'aws-sdk/clients/dynamodb';
6
- import type { PutBucketAclRequest, PutBucketPolicyRequest, PutPublicAccessBlockRequest } from 'aws-sdk/clients/s3';
7
-
8
- export type ConfigureBucketOptions = PutBucketAclRequest | PutBucketPolicyRequest | PutPublicAccessBlockRequest;
9
- export type Key = DocumentClient.Key;
10
- export type GetItemInput = DocumentClient.GetItemInput;
11
- export type QueryInput = DocumentClient.QueryInput;
12
- export type UpdateItemInput = DocumentClient.UpdateItemInput;
13
- export type ScanInput = DocumentClient.ScanInput;
14
- export type BatchGetItemInput = DocumentClient.BatchGetItemInput;
15
-
16
- export type AWSStorage = CloudStorage<AWSStorageCredential, "aws">;
17
-
18
- export interface AWSStorageCredential extends ConfigurationOptions {
19
- profile?: string;
20
- fromPath?: string;
21
- }
22
-
23
- export interface AWSDatabaseQuery extends CloudDatabase<QueryInput | Key[], Record<string, unknown>, UpdateItemInput, BatchGetItemInput | ScanInput, AWSDatabaseCredential> {
24
- source: "cloud";
25
- service: "aws";
26
- key?: string | Key;
27
- }
28
-
1
+ import type { CloudDatabase, CloudStorage } from '@e-mc/types/lib/cloud';
2
+
3
+ import type { ConfigurationOptions } from 'aws-sdk/lib/core';
4
+ import type { ServiceConfigurationOptions } from 'aws-sdk/lib/service';
5
+ import type { DocumentClient } from 'aws-sdk/clients/dynamodb';
6
+ import type { PutBucketAclRequest, PutBucketPolicyRequest, PutPublicAccessBlockRequest } from 'aws-sdk/clients/s3';
7
+
8
+ export type ConfigureBucketOptions = PutBucketAclRequest | PutBucketPolicyRequest | PutPublicAccessBlockRequest;
9
+ export type Key = DocumentClient.Key;
10
+ export type GetItemInput = DocumentClient.GetItemInput;
11
+ export type QueryInput = DocumentClient.QueryInput;
12
+ export type UpdateItemInput = DocumentClient.UpdateItemInput;
13
+ export type ScanInput = DocumentClient.ScanInput;
14
+ export type BatchGetItemInput = DocumentClient.BatchGetItemInput;
15
+
16
+ export type AWSStorage = CloudStorage<AWSStorageCredential, "aws">;
17
+
18
+ export interface AWSStorageCredential extends ConfigurationOptions {
19
+ profile?: string;
20
+ fromPath?: string;
21
+ }
22
+
23
+ export interface AWSDatabaseQuery extends CloudDatabase<QueryInput | Key[], Record<string, unknown>, UpdateItemInput, BatchGetItemInput | ScanInput, AWSDatabaseCredential> {
24
+ source: "cloud";
25
+ service: "aws";
26
+ key?: string | Key;
27
+ }
28
+
29
29
  export interface AWSDatabaseCredential extends AWSStorageCredential, ServiceConfigurationOptions {}