@iyio/aws-s3 0.0.11 → 0.0.13
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/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyio/aws-s3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@iyio/common": "0.0.
|
|
9
|
+
"@iyio/common": "0.0.13",
|
|
10
10
|
"rxjs": "^7.5.7",
|
|
11
11
|
"uuid": "^9.0.0",
|
|
12
|
-
"@iyio/aws-credential-providers": "0.0.
|
|
13
|
-
"@iyio/aws": "0.0.
|
|
12
|
+
"@iyio/aws-credential-providers": "0.0.13",
|
|
13
|
+
"@iyio/aws": "0.0.13",
|
|
14
14
|
"@aws-sdk/credential-providers": "^3.199.0",
|
|
15
15
|
"amazon-cognito-identity-js": "^5.2.12",
|
|
16
16
|
"@aws-sdk/client-s3": "^3.200.0",
|
package/src/lib/S3Client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { S3Client as AwsS3Client, S3ClientConfig } from "@aws-sdk/client-s3";
|
|
2
|
-
import {
|
|
2
|
+
import { CancelToken, IWithStoreAdapter, Scope } from "@iyio/common";
|
|
3
3
|
import { S3StoreAdapter, S3StoreAdapterOptions } from "./S3StoreAdapter";
|
|
4
|
-
export declare class S3Client
|
|
5
|
-
static fromScope
|
|
4
|
+
export declare class S3Client implements IWithStoreAdapter {
|
|
5
|
+
static fromScope(scope: Scope, storeAdapterOptions?: S3StoreAdapterOptions): S3Client;
|
|
6
6
|
readonly clientConfig: Readonly<S3ClientConfig>;
|
|
7
7
|
constructor(clientConfig: S3ClientConfig, storeAdapterOptions?: S3StoreAdapterOptions);
|
|
8
8
|
private client;
|
|
@@ -10,7 +10,7 @@ export declare class S3Client<T = any> extends BaseStore<T> implements IWithStor
|
|
|
10
10
|
private readonly storeAdapterOptions;
|
|
11
11
|
private storeAdapter;
|
|
12
12
|
getStoreAdapter(): S3StoreAdapter;
|
|
13
|
-
getAsync(bucket: string, key: string, cancel?: CancelToken): Promise<T | undefined>;
|
|
14
|
-
putAsync(bucket: string, key: string, value: T): Promise<void>;
|
|
13
|
+
getAsync<T>(bucket: string, key: string, cancel?: CancelToken): Promise<T | undefined>;
|
|
14
|
+
putAsync<T>(bucket: string, key: string, value: T): Promise<void>;
|
|
15
15
|
deleteAsync(bucket: string, key: string): Promise<boolean | undefined>;
|
|
16
16
|
}
|
package/src/lib/S3Client.js
CHANGED
|
@@ -6,9 +6,8 @@ const client_s3_1 = require("@aws-sdk/client-s3");
|
|
|
6
6
|
const aws_1 = require("@iyio/aws");
|
|
7
7
|
const common_1 = require("@iyio/common");
|
|
8
8
|
const S3StoreAdapter_1 = require("./S3StoreAdapter");
|
|
9
|
-
class S3Client
|
|
9
|
+
class S3Client {
|
|
10
10
|
constructor(clientConfig, storeAdapterOptions = {}) {
|
|
11
|
-
super();
|
|
12
11
|
this.client = null;
|
|
13
12
|
this.storeAdapter = null;
|
|
14
13
|
this.storeAdapterOptions = storeAdapterOptions;
|
|
@@ -18,7 +17,7 @@ class S3Client extends common_1.BaseStore {
|
|
|
18
17
|
var _a;
|
|
19
18
|
return new S3Client({
|
|
20
19
|
region: (0, aws_1.awsRegionParam)(scope),
|
|
21
|
-
credentials: (_a = scope.get(aws_1.
|
|
20
|
+
credentials: (_a = scope.get(aws_1.AwsAuthProviders)) === null || _a === void 0 ? void 0 : _a.getAuthProvider()
|
|
22
21
|
}, storeAdapterOptions);
|
|
23
22
|
}
|
|
24
23
|
getClient() {
|
package/src/lib/S3Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"S3Client.js","sourceRoot":"","sources":["../../../../../packages/aws-s3/src/lib/S3Client.ts"],"names":[],"mappings":";;;;AAAA,kDAA8J;AAC9J,
|
|
1
|
+
{"version":3,"file":"S3Client.js","sourceRoot":"","sources":["../../../../../packages/aws-s3/src/lib/S3Client.ts"],"names":[],"mappings":";;;;AAAA,kDAA8J;AAC9J,mCAA6D;AAC7D,yCAAuF;AACvF,qDAAyE;AAIzE,MAAa,QAAQ;IAajB,YACI,YAA2B,EAC3B,sBAA0C,EAAE;QAOxC,WAAM,GAAkB,IAAI,CAAC;QAW7B,iBAAY,GAAqB,IAAI,CAAC;QAhB1C,IAAI,CAAC,mBAAmB,GAAC,mBAAmB,CAAC;QAE7C,IAAI,CAAC,YAAY,GAAC,YAAY,CAAC;IACnC,CAAC;IAjBM,MAAM,CAAC,SAAS,CAAC,KAAW,EAAC,mBAA0C;;QAE1E,OAAO,IAAI,QAAQ,CAAC;YAChB,MAAM,EAAC,IAAA,oBAAc,EAAC,KAAK,CAAC;YAC5B,WAAW,EAAC,MAAA,KAAK,CAAC,GAAG,CAAC,sBAAgB,CAAC,0CAAE,eAAe,EAAE;SAC7D,EAAC,mBAAmB,CAAC,CAAA;IAC1B,CAAC;IAcM,SAAS;QACZ,IAAG,IAAI,CAAC,MAAM,EAAC;YACX,OAAO,IAAI,CAAC,MAAM,CAAC;SACtB;QACD,IAAI,CAAC,MAAM,GAAC,IAAI,oBAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAKM,eAAe;QAElB,IAAG,IAAI,CAAC,YAAY,EAAC;YACjB,OAAO,IAAI,CAAC,YAAY,CAAC;SAC5B;QACD,IAAI,CAAC,YAAY,GAAC,IAAI,+BAAc,CAAC,IAAI,EAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEY,QAAQ,CAAI,MAAa,EAAC,GAAU,EAAC,MAAmB;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C,KAAO;;YAErD,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,yBAAgB,CAAC,CAAA,CAAC;gBAC5D,IAAI,4BAAgB,CAAC;oBACjB,GAAG,EAAC,GAAG;oBACP,MAAM,EAAC,MAAM;oBACb,IAAI,EAAC,KAAK,CAAC,OAAO;oBAClB,WAAW,EAAC,KAAK,CAAC,WAAW;iBAChC,CAAC;gBACN,CAAC;oBACG,IAAI,4BAAgB,CAAC;wBACjB,GAAG,EAAC,GAAG;wBACP,MAAM,EAAC,MAAM;wBACb,IAAI,EAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;wBAC1B,WAAW,EAAC,kBAAkB;qBACjC,CAAC,CACL,CAAA;QACL,CAAC;KAAA;IAEY,WAAW,CAAC,MAAa,EAAC,GAAU;;YAE7C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,+BAAmB,CAAC;gBAChD,GAAG,EAAC,GAAG;gBACP,MAAM,EAAC,MAAM;aAChB,CAAC,CAAC,CAAC;YAEJ,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAnHD,4BAmHC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { S3Client } from "./S3Client";
|
|
2
|
-
export declare const s3Client: import("@iyio/common").
|
|
2
|
+
export declare const s3Client: import("@iyio/common").ClientTypeDef<S3Client>;
|