@geekmidas/storage 9.0.2 → 10.0.0-alpha.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/dist/aws.cjs +159 -4
- package/dist/aws.cjs.map +1 -0
- package/dist/aws.d.cts +51 -3
- package/dist/aws.d.cts.map +1 -0
- package/dist/aws.d.mts +51 -3
- package/dist/aws.d.mts.map +1 -0
- package/dist/aws.mjs +151 -3
- package/dist/aws.mjs.map +1 -0
- package/dist/chunk-B9dir_RE.mjs +11 -0
- package/dist/errors-Bce0CJ11.cjs +109 -0
- package/dist/errors-Bce0CJ11.cjs.map +1 -0
- package/dist/errors-D5UnAd-X.mjs +79 -0
- package/dist/errors-D5UnAd-X.mjs.map +1 -0
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +66 -2
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +66 -2
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +32 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{StorageClient-COs9SOsU.d.cts → registry-DBsAUTT3.d.cts} +27 -2
- package/dist/registry-DBsAUTT3.d.cts.map +1 -0
- package/dist/{StorageClient-DH4tP-Mf.d.mts → registry-DEqSHjx-.d.mts} +27 -2
- package/dist/registry-DEqSHjx-.d.mts.map +1 -0
- package/dist/s3Url-BfztIltX.d.cts +39 -0
- package/dist/s3Url-BfztIltX.d.cts.map +1 -0
- package/dist/s3Url-Bo32UTTA.cjs +103 -0
- package/dist/s3Url-Bo32UTTA.cjs.map +1 -0
- package/dist/s3Url-C8FGPNrG.mjs +52 -0
- package/dist/s3Url-C8FGPNrG.mjs.map +1 -0
- package/dist/s3Url-COpMIgF9.d.mts +42 -0
- package/dist/s3Url-COpMIgF9.d.mts.map +1 -0
- package/dist/s3Url.cjs +5 -0
- package/dist/s3Url.d.cts +2 -0
- package/dist/s3Url.d.mts +2 -0
- package/dist/s3Url.mjs +4 -0
- package/package.json +16 -3
- package/CHANGELOG.md +0 -72
- package/dist/AmazonStorageClient-BHpWawGD.d.mts +0 -45
- package/dist/AmazonStorageClient-BHpWawGD.d.mts.map +0 -1
- package/dist/AmazonStorageClient-BNoY2PL6.d.cts +0 -45
- package/dist/AmazonStorageClient-BNoY2PL6.d.cts.map +0 -1
- package/dist/AmazonStorageClient-BvoZepKJ.cjs +0 -161
- package/dist/AmazonStorageClient-BvoZepKJ.cjs.map +0 -1
- package/dist/AmazonStorageClient-Dz-KCJ_4.mjs +0 -127
- package/dist/AmazonStorageClient-Dz-KCJ_4.mjs.map +0 -1
- package/dist/AmazonStorageClient.cjs +0 -5
- package/dist/AmazonStorageClient.d.cts +0 -3
- package/dist/AmazonStorageClient.d.mts +0 -3
- package/dist/AmazonStorageClient.mjs +0 -4
- package/dist/StorageClient-4ADnTPnJ.mjs +0 -11
- package/dist/StorageClient-4ADnTPnJ.mjs.map +0 -1
- package/dist/StorageClient-BDRVrMJj.cjs +0 -17
- package/dist/StorageClient-BDRVrMJj.cjs.map +0 -1
- package/dist/StorageClient-COs9SOsU.d.cts.map +0 -1
- package/dist/StorageClient-DH4tP-Mf.d.mts.map +0 -1
- package/dist/StorageClient.cjs +0 -3
- package/dist/StorageClient.d.cts +0 -2
- package/dist/StorageClient.d.mts +0 -2
- package/dist/StorageClient.mjs +0 -3
- package/src/AmazonStorageClient.ts +0 -207
- package/src/StorageClient.ts +0 -108
- package/src/__tests__/AmazonStorageClient.spec.ts +0 -606
- package/src/__tests__/StorageClient.spec.ts +0 -98
- package/src/aws.ts +0 -11
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -9
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __export } from "./chunk-B9dir_RE.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/s3Url.d.ts
|
|
4
|
+
declare namespace s3Url_d_exports {
|
|
5
|
+
export { S3Address, build, parse };
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The `s3://` URL codec — how an S3 bucket is addressed as a single string.
|
|
9
|
+
*
|
|
10
|
+
* It lives beside the client rather than in a neutral package because `bucket`,
|
|
11
|
+
* `region`, and `forcePathStyle` are S3's vocabulary. The neutral layer only
|
|
12
|
+
* knows that a construct provides *one URL*; what that URL says is between the
|
|
13
|
+
* component that composes it and the client that parses it. A `gs://` codec
|
|
14
|
+
* would sit beside its own client and share nothing with this one.
|
|
15
|
+
*
|
|
16
|
+
* Both directions live here so they cannot drift: `parse(build(x))` is `x`.
|
|
17
|
+
*/
|
|
18
|
+
/** What an S3 URL addresses. Credentials are deliberately absent — see below. */
|
|
19
|
+
interface S3Address {
|
|
20
|
+
bucket: string;
|
|
21
|
+
/** Read off the bucket, never inherited: a bucket may live in another region. */
|
|
22
|
+
region?: string;
|
|
23
|
+
/** Set for S3-compatible backends such as MinIO. */
|
|
24
|
+
endpoint?: string;
|
|
25
|
+
/** MinIO and most S3-compatible servers need path-style addressing. */
|
|
26
|
+
forcePathStyle?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compose an address into a URL.
|
|
30
|
+
*
|
|
31
|
+
* Credentials never appear. The AWS SDK resolves them from its own chain — an
|
|
32
|
+
* execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`
|
|
33
|
+
* locally — so the URL stays safe to log and identical across environments that
|
|
34
|
+
* differ only in who is calling.
|
|
35
|
+
*/
|
|
36
|
+
declare function build(address: S3Address): string;
|
|
37
|
+
/** Parse a URL back into an address. Throws if it is not an `s3://` URL. */
|
|
38
|
+
declare function parse(url: string): S3Address;
|
|
39
|
+
//# sourceMappingURL=s3Url.d.ts.map
|
|
40
|
+
//#endregion
|
|
41
|
+
export { S3Address, build, parse, s3Url_d_exports };
|
|
42
|
+
//# sourceMappingURL=s3Url-COpMIgF9.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3Url-COpMIgF9.d.mts","names":[],"sources":["../src/s3Url.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;AAmBA;AAoBA;AAYA;UAhCiB,SAAA;;;;;;;;;;;;;;;;;iBAoBD,KAAA,UAAe;;iBAYf,KAAA,eAAoB"}
|
package/dist/s3Url.cjs
ADDED
package/dist/s3Url.d.cts
ADDED
package/dist/s3Url.d.mts
ADDED
package/dist/s3Url.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/storage",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-alpha.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,15 +31,28 @@
|
|
|
31
31
|
"types": "./dist/index.d.cts",
|
|
32
32
|
"default": "./dist/index.cjs"
|
|
33
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"./s3-url": {
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/s3Url.d.mts",
|
|
38
|
+
"default": "./dist/s3Url.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/s3Url.d.cts",
|
|
42
|
+
"default": "./dist/s3Url.cjs"
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist"
|
|
48
|
+
],
|
|
36
49
|
"dependencies": {},
|
|
37
50
|
"peerDependencies": {
|
|
38
51
|
"zod": "~4.1.13",
|
|
39
52
|
"@aws-sdk/client-s3": "~3.844.0",
|
|
40
53
|
"@aws-sdk/s3-presigned-post": "^3.844.0",
|
|
41
54
|
"@aws-sdk/s3-request-presigner": "~3.844.0",
|
|
42
|
-
"@geekmidas/cache": "^
|
|
55
|
+
"@geekmidas/cache": "^10.0.0-alpha.0"
|
|
43
56
|
},
|
|
44
57
|
"peerDependenciesMeta": {
|
|
45
58
|
"@geekmidas/cache": {
|
|
@@ -59,7 +72,7 @@
|
|
|
59
72
|
}
|
|
60
73
|
},
|
|
61
74
|
"devDependencies": {
|
|
62
|
-
"@geekmidas/cache": "^
|
|
75
|
+
"@geekmidas/cache": "^10.0.0-alpha.0"
|
|
63
76
|
},
|
|
64
77
|
"scripts": {}
|
|
65
78
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# @geekmidas/storage
|
|
2
|
-
|
|
3
|
-
## 9.0.2
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- [#12](https://github.com/geekmidas/toolbox/pull/12) [`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42) Thanks [@geekmidas](https://github.com/geekmidas)! - Align every published package on a single version and keep them in step.
|
|
8
|
-
|
|
9
|
-
All packages now share one version, enforced by a changesets `fixed` group. The
|
|
10
|
-
baseline is 9.0.1 — @geekmidas/client's published version — so nothing moves
|
|
11
|
-
backwards; this release takes the whole set to 9.0.2 together.
|
|
12
|
-
|
|
13
|
-
Independent versions made "which version of the docs applies to me"
|
|
14
|
-
unanswerable: a reader on constructs@7 and cli@2 was on no version at all. One
|
|
15
|
-
number per release makes versioned documentation possible, and lets 9 freeze as
|
|
16
|
-
the current paradigm while the constructs rework is developed against it.
|
|
17
|
-
|
|
18
|
-
Every release now publishes every package, and a major anywhere is a major
|
|
19
|
-
everywhere. Peer ranges get simpler in return.
|
|
20
|
-
|
|
21
|
-
- Updated dependencies [[`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42)]:
|
|
22
|
-
- @geekmidas/cache@9.0.2
|
|
23
|
-
|
|
24
|
-
## 2.0.4
|
|
25
|
-
|
|
26
|
-
### Patch Changes
|
|
27
|
-
|
|
28
|
-
- 🐛 [#11](https://github.com/geekmidas/toolbox/pull/11) [`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309) Thanks [@geekmidas](https://github.com/geekmidas)! - Patch release across all packages to realign published versions with the
|
|
29
|
-
registry. The previous release only published the four packages that had
|
|
30
|
-
version bumps; the remaining packages failed with "cannot publish over the
|
|
31
|
-
previously published versions" because their versions were unchanged.
|
|
32
|
-
- Updated dependencies [[`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309)]:
|
|
33
|
-
- @geekmidas/cache@1.1.2
|
|
34
|
-
|
|
35
|
-
## 2.0.3
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
|
|
40
|
-
|
|
41
|
-
- Updated dependencies [[`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651)]:
|
|
42
|
-
- @geekmidas/cache@1.1.1
|
|
43
|
-
|
|
44
|
-
## 2.0.2
|
|
45
|
-
|
|
46
|
-
### Patch Changes
|
|
47
|
-
|
|
48
|
-
- ✨ [`f843d08`](https://github.com/geekmidas/toolbox/commit/f843d08e512d5d5410fb93376a8b9b127434ff39) Thanks [@geekmidas](https://github.com/geekmidas)! - Add response type and content dispotion
|
|
49
|
-
|
|
50
|
-
## 2.0.1
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
- ✨ [`d19d376`](https://github.com/geekmidas/toolbox/commit/d19d376738017d21f5df1e814fd9898b610554df) Thanks [@geekmidas](https://github.com/geekmidas)! - Add delete for storage client
|
|
55
|
-
|
|
56
|
-
## 2.0.0
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- Updated dependencies [[`be4f7a9`](https://github.com/geekmidas/toolbox/commit/be4f7a9bd5de7f08adbca582916d6902e0c24de2)]:
|
|
61
|
-
- @geekmidas/cache@1.1.0
|
|
62
|
-
|
|
63
|
-
## 1.0.0
|
|
64
|
-
|
|
65
|
-
### Major Changes
|
|
66
|
-
|
|
67
|
-
- [`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8) Thanks [@geekmidas](https://github.com/geekmidas)! - Version 1 Stable release
|
|
68
|
-
|
|
69
|
-
### Patch Changes
|
|
70
|
-
|
|
71
|
-
- Updated dependencies [[`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8)]:
|
|
72
|
-
- @geekmidas/cache@1.0.0
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider } from "./StorageClient-DH4tP-Mf.mjs";
|
|
2
|
-
import { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
-
import { Cache } from "@geekmidas/cache";
|
|
4
|
-
|
|
5
|
-
//#region src/AmazonStorageClient.d.ts
|
|
6
|
-
declare class AmazonStorageClient implements StorageClient {
|
|
7
|
-
private readonly client;
|
|
8
|
-
private readonly bucket;
|
|
9
|
-
private readonly acl;
|
|
10
|
-
readonly cache?: Cache;
|
|
11
|
-
readonly provider = StorageProvider.AWSS3;
|
|
12
|
-
static create(options: AmazonStorageClientCreateOptions): AmazonStorageClient;
|
|
13
|
-
constructor(client: S3Client, bucket: string, acl?: AmazonCannedAccessControlList, cache?: Cache);
|
|
14
|
-
private createGetObjectCommand;
|
|
15
|
-
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
16
|
-
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
17
|
-
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
18
|
-
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
19
|
-
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
20
|
-
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
21
|
-
delete(key: string): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
declare enum AmazonCannedAccessControlList {
|
|
24
|
-
AuthenticatedRead = "authenticated-read",
|
|
25
|
-
Private = "private",
|
|
26
|
-
PublicRead = "public-read",
|
|
27
|
-
PublicReadWrite = "public-read-write",
|
|
28
|
-
AwsExecRead = "aws-exec-read",
|
|
29
|
-
BucketOwnerRead = "bucket-owner-read",
|
|
30
|
-
BucketOwnerFullControl = "bucket-owner-full-control",
|
|
31
|
-
LogDeliveryWrite = "log-delivery-write",
|
|
32
|
-
}
|
|
33
|
-
interface AmazonStorageClientCreateOptions {
|
|
34
|
-
bucket: string;
|
|
35
|
-
region?: string;
|
|
36
|
-
acl?: AmazonCannedAccessControlList;
|
|
37
|
-
accessKeyId?: string;
|
|
38
|
-
secretAccessKey?: string;
|
|
39
|
-
endpoint?: string;
|
|
40
|
-
forcePathStyle?: boolean;
|
|
41
|
-
cache?: Cache;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { AmazonCannedAccessControlList, AmazonStorageClient };
|
|
45
|
-
//# sourceMappingURL=AmazonStorageClient-BHpWawGD.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonStorageClient-BHpWawGD.d.mts","names":[],"sources":["../src/AmazonStorageClient.ts"],"sourcesContent":[],"mappings":";;;;;cAoBa,mBAAA,YAA+B;;EAA/B,iBAAA,MAAoB;EAAA,iBAAA,GAAA;EAAA,SAkCd,KAAA,CAAA,EAAA,KAAA;EAAK,SAjCN,QAAA,GAAA,eAAA,CAAA,KAAA;EAAA,OAGP,MAAA,CAAA,OAAA,EAAA,gCAAA,CAAA,EACP,mBADO;EAAgC,WACvC,CAAA,MAAA,EA0BuB,QA1BvB,EAAA,MAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EA4BkB,6BA5BlB,EAAA,KAAA,CAAA,EA6Be,KA7Bf;EAAmB,QA0BI,sBAAA;EAAQ,qBAEb,CAAA,IAAA,EAyBO,IAzBP,EAAA,SAAA,EAAA,MAAA,CAAA,EAyBiC,OAzBjC,CAAA,MAAA,CAAA;EAAkD,WACrD,CAAA,GAAA,EAAA,MAAA,CAAA,EA6Bc,OA7Bd,CA6BsB,eA7BtB,EAAA,CAAA;EAAK,cAwBK,CAAA,IAAA,EAmBD,IAnBC,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAmB2B,OAnB3B,CAAA,MAAA,CAAA;EAAI,YAAsB,CAAA,MAAA,EAuC7C,eAvC6C,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAyCnD,OAzCmD,CAAA,MAAA,CAAA;EAAO,SAKrB,CAAA,MAAA,EAgD/B,eAhD+B,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAkDrC,OAlDqC,CAkD7B,iBAlD6B,CAAA;EAAe,MAAvB,CAAA,GAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,GA4EhB,MA5EgB,EAAA,WAAA,EAAA,MAAA,CAAA,EA8E7B,OA9E6B,CAAA,IAAA,CAAA;EAAO,MAcZ,CAAA,GAAA,EAAA,MAAA,CAAA,EA+EA,OA/EA,CAAA,IAAA,CAAA;;AAoBlB,aAqEE,6BAAA;EArEa,iBAErB,GAAA,oBAAA;EAAO,OAYD,GAAA,SAAA;EAAe,UAEb,GAAA,aAAA;EAAiB,eAAzB,GAAA,mBAAA;EAAO,WA0BM,GAAA,eAAA;EAAM,eAEnB,GAAA,mBAAA;EAAO,sBAeiB,GAAA,2BAAA;EAAO,gBA5JS,GAAA,oBAAA;AAAa;AAsKzD,UAWU,gCAAA,CAX+B;EAW/B,MAAA,EAAA,MAAA;EAAgC,MAAA,CAAA,EAAA,MAAA;EAAA,GAGnC,CAAA,EAAA,6BAAA;EAA6B,WAK3B,CAAA,EAAA,MAAA;EAAK,eAAA,CAAA,EAAA,MAAA;;;UAAL"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider } from "./StorageClient-COs9SOsU.cjs";
|
|
2
|
-
import { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
-
import { Cache } from "@geekmidas/cache";
|
|
4
|
-
|
|
5
|
-
//#region src/AmazonStorageClient.d.ts
|
|
6
|
-
declare class AmazonStorageClient implements StorageClient {
|
|
7
|
-
private readonly client;
|
|
8
|
-
private readonly bucket;
|
|
9
|
-
private readonly acl;
|
|
10
|
-
readonly cache?: Cache;
|
|
11
|
-
readonly provider = StorageProvider.AWSS3;
|
|
12
|
-
static create(options: AmazonStorageClientCreateOptions): AmazonStorageClient;
|
|
13
|
-
constructor(client: S3Client, bucket: string, acl?: AmazonCannedAccessControlList, cache?: Cache);
|
|
14
|
-
private createGetObjectCommand;
|
|
15
|
-
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
16
|
-
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
17
|
-
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
18
|
-
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
19
|
-
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
20
|
-
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
21
|
-
delete(key: string): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
declare enum AmazonCannedAccessControlList {
|
|
24
|
-
AuthenticatedRead = "authenticated-read",
|
|
25
|
-
Private = "private",
|
|
26
|
-
PublicRead = "public-read",
|
|
27
|
-
PublicReadWrite = "public-read-write",
|
|
28
|
-
AwsExecRead = "aws-exec-read",
|
|
29
|
-
BucketOwnerRead = "bucket-owner-read",
|
|
30
|
-
BucketOwnerFullControl = "bucket-owner-full-control",
|
|
31
|
-
LogDeliveryWrite = "log-delivery-write",
|
|
32
|
-
}
|
|
33
|
-
interface AmazonStorageClientCreateOptions {
|
|
34
|
-
bucket: string;
|
|
35
|
-
region?: string;
|
|
36
|
-
acl?: AmazonCannedAccessControlList;
|
|
37
|
-
accessKeyId?: string;
|
|
38
|
-
secretAccessKey?: string;
|
|
39
|
-
endpoint?: string;
|
|
40
|
-
forcePathStyle?: boolean;
|
|
41
|
-
cache?: Cache;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { AmazonCannedAccessControlList, AmazonStorageClient };
|
|
45
|
-
//# sourceMappingURL=AmazonStorageClient-BNoY2PL6.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonStorageClient-BNoY2PL6.d.cts","names":[],"sources":["../src/AmazonStorageClient.ts"],"sourcesContent":[],"mappings":";;;;;cAoBa,mBAAA,YAA+B;;EAA/B,iBAAA,MAAoB;EAAA,iBAAA,GAAA;EAAA,SAkCd,KAAA,CAAA,EAAA,KAAA;EAAK,SAjCN,QAAA,GAAA,eAAA,CAAA,KAAA;EAAA,OAGP,MAAA,CAAA,OAAA,EAAA,gCAAA,CAAA,EACP,mBADO;EAAgC,WACvC,CAAA,MAAA,EA0BuB,QA1BvB,EAAA,MAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EA4BkB,6BA5BlB,EAAA,KAAA,CAAA,EA6Be,KA7Bf;EAAmB,QA0BI,sBAAA;EAAQ,qBAEb,CAAA,IAAA,EAyBO,IAzBP,EAAA,SAAA,EAAA,MAAA,CAAA,EAyBiC,OAzBjC,CAAA,MAAA,CAAA;EAAkD,WACrD,CAAA,GAAA,EAAA,MAAA,CAAA,EA6Bc,OA7Bd,CA6BsB,eA7BtB,EAAA,CAAA;EAAK,cAwBK,CAAA,IAAA,EAmBD,IAnBC,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAmB2B,OAnB3B,CAAA,MAAA,CAAA;EAAI,YAAsB,CAAA,MAAA,EAuC7C,eAvC6C,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAyCnD,OAzCmD,CAAA,MAAA,CAAA;EAAO,SAKrB,CAAA,MAAA,EAgD/B,eAhD+B,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAkDrC,OAlDqC,CAkD7B,iBAlD6B,CAAA;EAAe,MAAvB,CAAA,GAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,GA4EhB,MA5EgB,EAAA,WAAA,EAAA,MAAA,CAAA,EA8E7B,OA9E6B,CAAA,IAAA,CAAA;EAAO,MAcZ,CAAA,GAAA,EAAA,MAAA,CAAA,EA+EA,OA/EA,CAAA,IAAA,CAAA;;AAoBlB,aAqEE,6BAAA;EArEa,iBAErB,GAAA,oBAAA;EAAO,OAYD,GAAA,SAAA;EAAe,UAEb,GAAA,aAAA;EAAiB,eAAzB,GAAA,mBAAA;EAAO,WA0BM,GAAA,eAAA;EAAM,eAEnB,GAAA,mBAAA;EAAO,sBAeiB,GAAA,2BAAA;EAAO,gBA5JS,GAAA,oBAAA;AAAa;AAsKzD,UAWU,gCAAA,CAX+B;EAW/B,MAAA,EAAA,MAAA;EAAgC,MAAA,CAAA,EAAA,MAAA;EAAA,GAGnC,CAAA,EAAA,6BAAA;EAA6B,WAK3B,CAAA,EAAA,MAAA;EAAK,eAAA,CAAA,EAAA,MAAA;;;UAAL"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
const require_StorageClient = require('./StorageClient-BDRVrMJj.cjs');
|
|
25
|
-
const __aws_sdk_client_s3 = __toESM(require("@aws-sdk/client-s3"));
|
|
26
|
-
const __aws_sdk_s3_presigned_post = __toESM(require("@aws-sdk/s3-presigned-post"));
|
|
27
|
-
const __aws_sdk_s3_request_presigner = __toESM(require("@aws-sdk/s3-request-presigner"));
|
|
28
|
-
|
|
29
|
-
//#region src/AmazonStorageClient.ts
|
|
30
|
-
var AmazonStorageClient = class AmazonStorageClient {
|
|
31
|
-
provider = require_StorageClient.StorageProvider.AWSS3;
|
|
32
|
-
static create(options) {
|
|
33
|
-
const { bucket, region, accessKeyId, acl, endpoint, secretAccessKey, forcePathStyle = false, cache } = options;
|
|
34
|
-
const hasCredentials = accessKeyId && secretAccessKey;
|
|
35
|
-
const credentials = hasCredentials ? {
|
|
36
|
-
accessKeyId,
|
|
37
|
-
secretAccessKey
|
|
38
|
-
} : void 0;
|
|
39
|
-
const client = new __aws_sdk_client_s3.S3Client({
|
|
40
|
-
region,
|
|
41
|
-
credentials,
|
|
42
|
-
endpoint,
|
|
43
|
-
forcePathStyle
|
|
44
|
-
});
|
|
45
|
-
return new AmazonStorageClient(client, bucket, acl, cache);
|
|
46
|
-
}
|
|
47
|
-
constructor(client, bucket, acl = AmazonCannedAccessControlList.AuthenticatedRead, cache) {
|
|
48
|
-
this.client = client;
|
|
49
|
-
this.bucket = bucket;
|
|
50
|
-
this.acl = acl;
|
|
51
|
-
this.cache = cache;
|
|
52
|
-
}
|
|
53
|
-
createGetObjectCommand(file, overrides) {
|
|
54
|
-
const disposition = file.disposition ?? (file.name ? "attachment" : void 0);
|
|
55
|
-
const ResponseContentDisposition = disposition ? file.name ? `${disposition}; filename=${encodeURIComponent(file.name)}` : disposition : void 0;
|
|
56
|
-
return new __aws_sdk_client_s3.GetObjectCommand({
|
|
57
|
-
Bucket: this.bucket,
|
|
58
|
-
Key: file.path,
|
|
59
|
-
ResponseContentDisposition,
|
|
60
|
-
ResponseContentType: file.responseContentType,
|
|
61
|
-
...overrides
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
getVersionDownloadURL(file, versionId) {
|
|
65
|
-
const command = this.createGetObjectCommand(file, { VersionId: versionId });
|
|
66
|
-
return (0, __aws_sdk_s3_request_presigner.getSignedUrl)(this.client, command, { expiresIn: 60 * 60 * 24 });
|
|
67
|
-
}
|
|
68
|
-
async getVersions(key) {
|
|
69
|
-
const command = new __aws_sdk_client_s3.ListObjectVersionsCommand({
|
|
70
|
-
Bucket: this.bucket,
|
|
71
|
-
Prefix: key
|
|
72
|
-
});
|
|
73
|
-
const { Versions = [] } = await this.client.send(command);
|
|
74
|
-
return Versions.map((version) => ({
|
|
75
|
-
id: version.VersionId || "",
|
|
76
|
-
createdAt: version.LastModified || /* @__PURE__ */ new Date()
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
async getDownloadURL(file, expiresIn = 60 * 60) {
|
|
80
|
-
const cacheKey = `download-url:${file.path}`;
|
|
81
|
-
const cachedURL = await this.cache?.get(cacheKey);
|
|
82
|
-
if (cachedURL) return cachedURL;
|
|
83
|
-
const command = this.createGetObjectCommand(file);
|
|
84
|
-
const url = await (0, __aws_sdk_s3_request_presigner.getSignedUrl)(this.client, command, { expiresIn });
|
|
85
|
-
const cacheExpiration = Math.max(expiresIn - 60, 0);
|
|
86
|
-
if (cacheExpiration) await this.cache?.set(cacheKey, url, cacheExpiration);
|
|
87
|
-
return url;
|
|
88
|
-
}
|
|
89
|
-
async getUploadURL(params, expiresIn = 60 * 60) {
|
|
90
|
-
const command = new __aws_sdk_client_s3.PutObjectCommand({
|
|
91
|
-
Bucket: this.bucket,
|
|
92
|
-
Key: params.path,
|
|
93
|
-
ContentType: params.contentType,
|
|
94
|
-
ContentLength: params.contentLength
|
|
95
|
-
});
|
|
96
|
-
return (0, __aws_sdk_s3_request_presigner.getSignedUrl)(this.client, command, { expiresIn });
|
|
97
|
-
}
|
|
98
|
-
async getUpload(params, expiresIn = 5) {
|
|
99
|
-
const { path } = params;
|
|
100
|
-
const { fields: values, url } = await (0, __aws_sdk_s3_presigned_post.createPresignedPost)(this.client, {
|
|
101
|
-
Expires: expiresIn * 60,
|
|
102
|
-
Bucket: this.bucket,
|
|
103
|
-
Fields: { acl: this.acl },
|
|
104
|
-
Conditions: [],
|
|
105
|
-
Key: path
|
|
106
|
-
});
|
|
107
|
-
const keys = Object.keys(values);
|
|
108
|
-
const fields = keys.map((key) => ({
|
|
109
|
-
key,
|
|
110
|
-
value: values[key] || ""
|
|
111
|
-
}));
|
|
112
|
-
return {
|
|
113
|
-
url,
|
|
114
|
-
fields
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
async upload(key, data, contentType) {
|
|
118
|
-
const Body = typeof data === "string" ? Buffer.from(data, "base64") : data;
|
|
119
|
-
const params = {
|
|
120
|
-
Bucket: this.bucket,
|
|
121
|
-
Key: key,
|
|
122
|
-
Body,
|
|
123
|
-
ContentType: contentType
|
|
124
|
-
};
|
|
125
|
-
const command = new __aws_sdk_client_s3.PutObjectCommand(params);
|
|
126
|
-
await this.client.send(command);
|
|
127
|
-
}
|
|
128
|
-
async delete(key) {
|
|
129
|
-
const command = new __aws_sdk_client_s3.DeleteObjectCommand({
|
|
130
|
-
Bucket: this.bucket,
|
|
131
|
-
Key: key
|
|
132
|
-
});
|
|
133
|
-
await this.client.send(command);
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
let AmazonCannedAccessControlList = /* @__PURE__ */ function(AmazonCannedAccessControlList$1) {
|
|
137
|
-
AmazonCannedAccessControlList$1["AuthenticatedRead"] = "authenticated-read";
|
|
138
|
-
AmazonCannedAccessControlList$1["Private"] = "private";
|
|
139
|
-
AmazonCannedAccessControlList$1["PublicRead"] = "public-read";
|
|
140
|
-
AmazonCannedAccessControlList$1["PublicReadWrite"] = "public-read-write";
|
|
141
|
-
AmazonCannedAccessControlList$1["AwsExecRead"] = "aws-exec-read";
|
|
142
|
-
AmazonCannedAccessControlList$1["BucketOwnerRead"] = "bucket-owner-read";
|
|
143
|
-
AmazonCannedAccessControlList$1["BucketOwnerFullControl"] = "bucket-owner-full-control";
|
|
144
|
-
AmazonCannedAccessControlList$1["LogDeliveryWrite"] = "log-delivery-write";
|
|
145
|
-
return AmazonCannedAccessControlList$1;
|
|
146
|
-
}({});
|
|
147
|
-
|
|
148
|
-
//#endregion
|
|
149
|
-
Object.defineProperty(exports, 'AmazonCannedAccessControlList', {
|
|
150
|
-
enumerable: true,
|
|
151
|
-
get: function () {
|
|
152
|
-
return AmazonCannedAccessControlList;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
Object.defineProperty(exports, 'AmazonStorageClient', {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
get: function () {
|
|
158
|
-
return AmazonStorageClient;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
//# sourceMappingURL=AmazonStorageClient-BvoZepKJ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonStorageClient-BvoZepKJ.cjs","names":["StorageProvider","options: AmazonStorageClientCreateOptions","S3Client","client: S3Client","bucket: string","cache?: Cache","file: File","overrides?: { VersionId?: string }","GetObjectCommand","versionId: string","key: string","ListObjectVersionsCommand","params: GetUploadParams","PutObjectCommand","data: string | Buffer","contentType: string","DeleteObjectCommand"],"sources":["../src/AmazonStorageClient.ts"],"sourcesContent":["import {\n\tDeleteObjectCommand,\n\tGetObjectCommand,\n\tListObjectVersionsCommand,\n\tPutObjectCommand,\n\tS3Client,\n} from '@aws-sdk/client-s3';\nimport { createPresignedPost } from '@aws-sdk/s3-presigned-post';\nimport { getSignedUrl } from '@aws-sdk/s3-request-presigner';\n\nimport type { Cache } from '@geekmidas/cache';\nimport {\n\ttype DocumentVersion,\n\ttype File,\n\ttype GetUploadParams,\n\ttype GetUploadResponse,\n\ttype StorageClient,\n\tStorageProvider,\n} from './StorageClient';\n\nexport class AmazonStorageClient implements StorageClient {\n\treadonly provider = StorageProvider.AWSS3;\n\n\tstatic create(\n\t\toptions: AmazonStorageClientCreateOptions,\n\t): AmazonStorageClient {\n\t\tconst {\n\t\t\tbucket,\n\t\t\tregion,\n\t\t\taccessKeyId,\n\t\t\tacl,\n\t\t\tendpoint,\n\t\t\tsecretAccessKey,\n\t\t\tforcePathStyle = false,\n\t\t\tcache,\n\t\t} = options;\n\t\tconst hasCredentials = accessKeyId && secretAccessKey;\n\t\tconst credentials = hasCredentials\n\t\t\t? { accessKeyId, secretAccessKey }\n\t\t\t: undefined;\n\n\t\tconst client = new S3Client({\n\t\t\tregion,\n\t\t\tcredentials,\n\t\t\tendpoint,\n\t\t\tforcePathStyle,\n\t\t});\n\n\t\treturn new AmazonStorageClient(client, bucket, acl, cache);\n\t}\n\tconstructor(\n\t\tprivate readonly client: S3Client,\n\t\tprivate readonly bucket: string,\n\t\tprivate readonly acl = AmazonCannedAccessControlList.AuthenticatedRead,\n\t\treadonly cache?: Cache,\n\t) {}\n\n\tprivate createGetObjectCommand(\n\t\tfile: File,\n\t\toverrides?: { VersionId?: string },\n\t): GetObjectCommand {\n\t\tconst disposition =\n\t\t\tfile.disposition ?? (file.name ? 'attachment' : undefined);\n\t\tconst ResponseContentDisposition = disposition\n\t\t\t? file.name\n\t\t\t\t? `${disposition}; filename=${encodeURIComponent(file.name)}`\n\t\t\t\t: disposition\n\t\t\t: undefined;\n\n\t\treturn new GetObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: file.path,\n\t\t\tResponseContentDisposition,\n\t\t\tResponseContentType: file.responseContentType,\n\t\t\t...overrides,\n\t\t});\n\t}\n\n\tgetVersionDownloadURL(file: File, versionId: string): Promise<string> {\n\t\tconst command = this.createGetObjectCommand(file, { VersionId: versionId });\n\t\treturn getSignedUrl(this.client, command, { expiresIn: 60 * 60 * 24 });\n\t}\n\n\tasync getVersions(key: string): Promise<DocumentVersion[]> {\n\t\tconst command = new ListObjectVersionsCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tPrefix: key,\n\t\t});\n\n\t\tconst { Versions = [] } = await this.client.send(command);\n\n\t\treturn Versions.map((version) => ({\n\t\t\tid: version.VersionId || '',\n\t\t\tcreatedAt: version.LastModified || new Date(),\n\t\t}));\n\t}\n\n\tasync getDownloadURL(file: File, expiresIn = 60 * 60): Promise<string> {\n\t\tconst cacheKey = `download-url:${file.path}`;\n\t\tconst cachedURL = await this.cache?.get<string>(cacheKey);\n\n\t\tif (cachedURL) {\n\t\t\treturn cachedURL;\n\t\t}\n\n\t\tconst command = this.createGetObjectCommand(file);\n\t\tconst url = await getSignedUrl(this.client, command, { expiresIn });\n\t\tconst cacheExpiration = Math.max(expiresIn - 60, 0);\n\n\t\tif (cacheExpiration) {\n\t\t\tawait this.cache?.set(cacheKey, url, cacheExpiration);\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tasync getUploadURL(\n\t\tparams: GetUploadParams,\n\t\texpiresIn = 60 * 60,\n\t): Promise<string> {\n\t\tconst command = new PutObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: params.path,\n\t\t\tContentType: params.contentType,\n\t\t\tContentLength: params.contentLength,\n\t\t});\n\n\t\treturn getSignedUrl(this.client, command, { expiresIn });\n\t}\n\n\tasync getUpload(\n\t\tparams: GetUploadParams,\n\t\texpiresIn = 5,\n\t): Promise<GetUploadResponse> {\n\t\tconst { path } = params;\n\t\tconst { fields: values, url } = await createPresignedPost(this.client, {\n\t\t\tExpires: expiresIn * 60,\n\t\t\tBucket: this.bucket,\n\t\t\tFields: {\n\t\t\t\tacl: this.acl,\n\t\t\t},\n\t\t\tConditions: [\n\t\t\t\t// content length restrictions: 0-1MB]\n\t\t\t\t// ['content-length-range', 0, contentLength],\n\t\t\t\t// specify content-type to be more generic- images only\n\t\t\t\t// ['starts-with', '$Content-Type', 'image/'],\n\t\t\t\t// ['starts-with', '$Content-Type', contentType],\n\t\t\t],\n\t\t\tKey: path,\n\t\t});\n\n\t\tconst keys = Object.keys(values);\n\t\tconst fields = keys.map((key) => ({ key, value: values[key] || '' }));\n\n\t\treturn { url, fields };\n\t}\n\n\tasync upload(\n\t\tkey: string,\n\t\tdata: string | Buffer,\n\t\tcontentType: string,\n\t): Promise<void> {\n\t\tconst Body = typeof data === 'string' ? Buffer.from(data, 'base64') : data;\n\n\t\tconst params = {\n\t\t\tBucket: this.bucket,\n\t\t\tKey: key,\n\t\t\tBody,\n\t\t\tContentType: contentType,\n\t\t};\n\n\t\tconst command = new PutObjectCommand(params);\n\n\t\tawait this.client.send(command);\n\t}\n\n\tasync delete(key: string): Promise<void> {\n\t\tconst command = new DeleteObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: key,\n\t\t});\n\n\t\tawait this.client.send(command);\n\t}\n}\n\nexport enum AmazonCannedAccessControlList {\n\tAuthenticatedRead = 'authenticated-read',\n\tPrivate = 'private',\n\tPublicRead = 'public-read',\n\tPublicReadWrite = 'public-read-write',\n\tAwsExecRead = 'aws-exec-read',\n\tBucketOwnerRead = 'bucket-owner-read',\n\tBucketOwnerFullControl = 'bucket-owner-full-control',\n\tLogDeliveryWrite = 'log-delivery-write',\n}\n\ninterface AmazonStorageClientCreateOptions {\n\tbucket: string;\n\tregion?: string;\n\tacl?: AmazonCannedAccessControlList;\n\taccessKeyId?: string;\n\tsecretAccessKey?: string;\n\tendpoint?: string;\n\tforcePathStyle?: boolean;\n\tcache?: Cache;\n}\n"],"mappings":"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"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { StorageProvider } from "./StorageClient-4ADnTPnJ.mjs";
|
|
2
|
-
import { DeleteObjectCommand, GetObjectCommand, ListObjectVersionsCommand, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
|
|
3
|
-
import { createPresignedPost } from "@aws-sdk/s3-presigned-post";
|
|
4
|
-
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
|
5
|
-
|
|
6
|
-
//#region src/AmazonStorageClient.ts
|
|
7
|
-
var AmazonStorageClient = class AmazonStorageClient {
|
|
8
|
-
provider = StorageProvider.AWSS3;
|
|
9
|
-
static create(options) {
|
|
10
|
-
const { bucket, region, accessKeyId, acl, endpoint, secretAccessKey, forcePathStyle = false, cache } = options;
|
|
11
|
-
const hasCredentials = accessKeyId && secretAccessKey;
|
|
12
|
-
const credentials = hasCredentials ? {
|
|
13
|
-
accessKeyId,
|
|
14
|
-
secretAccessKey
|
|
15
|
-
} : void 0;
|
|
16
|
-
const client = new S3Client({
|
|
17
|
-
region,
|
|
18
|
-
credentials,
|
|
19
|
-
endpoint,
|
|
20
|
-
forcePathStyle
|
|
21
|
-
});
|
|
22
|
-
return new AmazonStorageClient(client, bucket, acl, cache);
|
|
23
|
-
}
|
|
24
|
-
constructor(client, bucket, acl = AmazonCannedAccessControlList.AuthenticatedRead, cache) {
|
|
25
|
-
this.client = client;
|
|
26
|
-
this.bucket = bucket;
|
|
27
|
-
this.acl = acl;
|
|
28
|
-
this.cache = cache;
|
|
29
|
-
}
|
|
30
|
-
createGetObjectCommand(file, overrides) {
|
|
31
|
-
const disposition = file.disposition ?? (file.name ? "attachment" : void 0);
|
|
32
|
-
const ResponseContentDisposition = disposition ? file.name ? `${disposition}; filename=${encodeURIComponent(file.name)}` : disposition : void 0;
|
|
33
|
-
return new GetObjectCommand({
|
|
34
|
-
Bucket: this.bucket,
|
|
35
|
-
Key: file.path,
|
|
36
|
-
ResponseContentDisposition,
|
|
37
|
-
ResponseContentType: file.responseContentType,
|
|
38
|
-
...overrides
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
getVersionDownloadURL(file, versionId) {
|
|
42
|
-
const command = this.createGetObjectCommand(file, { VersionId: versionId });
|
|
43
|
-
return getSignedUrl(this.client, command, { expiresIn: 60 * 60 * 24 });
|
|
44
|
-
}
|
|
45
|
-
async getVersions(key) {
|
|
46
|
-
const command = new ListObjectVersionsCommand({
|
|
47
|
-
Bucket: this.bucket,
|
|
48
|
-
Prefix: key
|
|
49
|
-
});
|
|
50
|
-
const { Versions = [] } = await this.client.send(command);
|
|
51
|
-
return Versions.map((version) => ({
|
|
52
|
-
id: version.VersionId || "",
|
|
53
|
-
createdAt: version.LastModified || /* @__PURE__ */ new Date()
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
async getDownloadURL(file, expiresIn = 60 * 60) {
|
|
57
|
-
const cacheKey = `download-url:${file.path}`;
|
|
58
|
-
const cachedURL = await this.cache?.get(cacheKey);
|
|
59
|
-
if (cachedURL) return cachedURL;
|
|
60
|
-
const command = this.createGetObjectCommand(file);
|
|
61
|
-
const url = await getSignedUrl(this.client, command, { expiresIn });
|
|
62
|
-
const cacheExpiration = Math.max(expiresIn - 60, 0);
|
|
63
|
-
if (cacheExpiration) await this.cache?.set(cacheKey, url, cacheExpiration);
|
|
64
|
-
return url;
|
|
65
|
-
}
|
|
66
|
-
async getUploadURL(params, expiresIn = 60 * 60) {
|
|
67
|
-
const command = new PutObjectCommand({
|
|
68
|
-
Bucket: this.bucket,
|
|
69
|
-
Key: params.path,
|
|
70
|
-
ContentType: params.contentType,
|
|
71
|
-
ContentLength: params.contentLength
|
|
72
|
-
});
|
|
73
|
-
return getSignedUrl(this.client, command, { expiresIn });
|
|
74
|
-
}
|
|
75
|
-
async getUpload(params, expiresIn = 5) {
|
|
76
|
-
const { path } = params;
|
|
77
|
-
const { fields: values, url } = await createPresignedPost(this.client, {
|
|
78
|
-
Expires: expiresIn * 60,
|
|
79
|
-
Bucket: this.bucket,
|
|
80
|
-
Fields: { acl: this.acl },
|
|
81
|
-
Conditions: [],
|
|
82
|
-
Key: path
|
|
83
|
-
});
|
|
84
|
-
const keys = Object.keys(values);
|
|
85
|
-
const fields = keys.map((key) => ({
|
|
86
|
-
key,
|
|
87
|
-
value: values[key] || ""
|
|
88
|
-
}));
|
|
89
|
-
return {
|
|
90
|
-
url,
|
|
91
|
-
fields
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
async upload(key, data, contentType) {
|
|
95
|
-
const Body = typeof data === "string" ? Buffer.from(data, "base64") : data;
|
|
96
|
-
const params = {
|
|
97
|
-
Bucket: this.bucket,
|
|
98
|
-
Key: key,
|
|
99
|
-
Body,
|
|
100
|
-
ContentType: contentType
|
|
101
|
-
};
|
|
102
|
-
const command = new PutObjectCommand(params);
|
|
103
|
-
await this.client.send(command);
|
|
104
|
-
}
|
|
105
|
-
async delete(key) {
|
|
106
|
-
const command = new DeleteObjectCommand({
|
|
107
|
-
Bucket: this.bucket,
|
|
108
|
-
Key: key
|
|
109
|
-
});
|
|
110
|
-
await this.client.send(command);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
let AmazonCannedAccessControlList = /* @__PURE__ */ function(AmazonCannedAccessControlList$1) {
|
|
114
|
-
AmazonCannedAccessControlList$1["AuthenticatedRead"] = "authenticated-read";
|
|
115
|
-
AmazonCannedAccessControlList$1["Private"] = "private";
|
|
116
|
-
AmazonCannedAccessControlList$1["PublicRead"] = "public-read";
|
|
117
|
-
AmazonCannedAccessControlList$1["PublicReadWrite"] = "public-read-write";
|
|
118
|
-
AmazonCannedAccessControlList$1["AwsExecRead"] = "aws-exec-read";
|
|
119
|
-
AmazonCannedAccessControlList$1["BucketOwnerRead"] = "bucket-owner-read";
|
|
120
|
-
AmazonCannedAccessControlList$1["BucketOwnerFullControl"] = "bucket-owner-full-control";
|
|
121
|
-
AmazonCannedAccessControlList$1["LogDeliveryWrite"] = "log-delivery-write";
|
|
122
|
-
return AmazonCannedAccessControlList$1;
|
|
123
|
-
}({});
|
|
124
|
-
|
|
125
|
-
//#endregion
|
|
126
|
-
export { AmazonCannedAccessControlList, AmazonStorageClient };
|
|
127
|
-
//# sourceMappingURL=AmazonStorageClient-Dz-KCJ_4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonStorageClient-Dz-KCJ_4.mjs","names":["options: AmazonStorageClientCreateOptions","client: S3Client","bucket: string","cache?: Cache","file: File","overrides?: { VersionId?: string }","versionId: string","key: string","params: GetUploadParams","data: string | Buffer","contentType: string"],"sources":["../src/AmazonStorageClient.ts"],"sourcesContent":["import {\n\tDeleteObjectCommand,\n\tGetObjectCommand,\n\tListObjectVersionsCommand,\n\tPutObjectCommand,\n\tS3Client,\n} from '@aws-sdk/client-s3';\nimport { createPresignedPost } from '@aws-sdk/s3-presigned-post';\nimport { getSignedUrl } from '@aws-sdk/s3-request-presigner';\n\nimport type { Cache } from '@geekmidas/cache';\nimport {\n\ttype DocumentVersion,\n\ttype File,\n\ttype GetUploadParams,\n\ttype GetUploadResponse,\n\ttype StorageClient,\n\tStorageProvider,\n} from './StorageClient';\n\nexport class AmazonStorageClient implements StorageClient {\n\treadonly provider = StorageProvider.AWSS3;\n\n\tstatic create(\n\t\toptions: AmazonStorageClientCreateOptions,\n\t): AmazonStorageClient {\n\t\tconst {\n\t\t\tbucket,\n\t\t\tregion,\n\t\t\taccessKeyId,\n\t\t\tacl,\n\t\t\tendpoint,\n\t\t\tsecretAccessKey,\n\t\t\tforcePathStyle = false,\n\t\t\tcache,\n\t\t} = options;\n\t\tconst hasCredentials = accessKeyId && secretAccessKey;\n\t\tconst credentials = hasCredentials\n\t\t\t? { accessKeyId, secretAccessKey }\n\t\t\t: undefined;\n\n\t\tconst client = new S3Client({\n\t\t\tregion,\n\t\t\tcredentials,\n\t\t\tendpoint,\n\t\t\tforcePathStyle,\n\t\t});\n\n\t\treturn new AmazonStorageClient(client, bucket, acl, cache);\n\t}\n\tconstructor(\n\t\tprivate readonly client: S3Client,\n\t\tprivate readonly bucket: string,\n\t\tprivate readonly acl = AmazonCannedAccessControlList.AuthenticatedRead,\n\t\treadonly cache?: Cache,\n\t) {}\n\n\tprivate createGetObjectCommand(\n\t\tfile: File,\n\t\toverrides?: { VersionId?: string },\n\t): GetObjectCommand {\n\t\tconst disposition =\n\t\t\tfile.disposition ?? (file.name ? 'attachment' : undefined);\n\t\tconst ResponseContentDisposition = disposition\n\t\t\t? file.name\n\t\t\t\t? `${disposition}; filename=${encodeURIComponent(file.name)}`\n\t\t\t\t: disposition\n\t\t\t: undefined;\n\n\t\treturn new GetObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: file.path,\n\t\t\tResponseContentDisposition,\n\t\t\tResponseContentType: file.responseContentType,\n\t\t\t...overrides,\n\t\t});\n\t}\n\n\tgetVersionDownloadURL(file: File, versionId: string): Promise<string> {\n\t\tconst command = this.createGetObjectCommand(file, { VersionId: versionId });\n\t\treturn getSignedUrl(this.client, command, { expiresIn: 60 * 60 * 24 });\n\t}\n\n\tasync getVersions(key: string): Promise<DocumentVersion[]> {\n\t\tconst command = new ListObjectVersionsCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tPrefix: key,\n\t\t});\n\n\t\tconst { Versions = [] } = await this.client.send(command);\n\n\t\treturn Versions.map((version) => ({\n\t\t\tid: version.VersionId || '',\n\t\t\tcreatedAt: version.LastModified || new Date(),\n\t\t}));\n\t}\n\n\tasync getDownloadURL(file: File, expiresIn = 60 * 60): Promise<string> {\n\t\tconst cacheKey = `download-url:${file.path}`;\n\t\tconst cachedURL = await this.cache?.get<string>(cacheKey);\n\n\t\tif (cachedURL) {\n\t\t\treturn cachedURL;\n\t\t}\n\n\t\tconst command = this.createGetObjectCommand(file);\n\t\tconst url = await getSignedUrl(this.client, command, { expiresIn });\n\t\tconst cacheExpiration = Math.max(expiresIn - 60, 0);\n\n\t\tif (cacheExpiration) {\n\t\t\tawait this.cache?.set(cacheKey, url, cacheExpiration);\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tasync getUploadURL(\n\t\tparams: GetUploadParams,\n\t\texpiresIn = 60 * 60,\n\t): Promise<string> {\n\t\tconst command = new PutObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: params.path,\n\t\t\tContentType: params.contentType,\n\t\t\tContentLength: params.contentLength,\n\t\t});\n\n\t\treturn getSignedUrl(this.client, command, { expiresIn });\n\t}\n\n\tasync getUpload(\n\t\tparams: GetUploadParams,\n\t\texpiresIn = 5,\n\t): Promise<GetUploadResponse> {\n\t\tconst { path } = params;\n\t\tconst { fields: values, url } = await createPresignedPost(this.client, {\n\t\t\tExpires: expiresIn * 60,\n\t\t\tBucket: this.bucket,\n\t\t\tFields: {\n\t\t\t\tacl: this.acl,\n\t\t\t},\n\t\t\tConditions: [\n\t\t\t\t// content length restrictions: 0-1MB]\n\t\t\t\t// ['content-length-range', 0, contentLength],\n\t\t\t\t// specify content-type to be more generic- images only\n\t\t\t\t// ['starts-with', '$Content-Type', 'image/'],\n\t\t\t\t// ['starts-with', '$Content-Type', contentType],\n\t\t\t],\n\t\t\tKey: path,\n\t\t});\n\n\t\tconst keys = Object.keys(values);\n\t\tconst fields = keys.map((key) => ({ key, value: values[key] || '' }));\n\n\t\treturn { url, fields };\n\t}\n\n\tasync upload(\n\t\tkey: string,\n\t\tdata: string | Buffer,\n\t\tcontentType: string,\n\t): Promise<void> {\n\t\tconst Body = typeof data === 'string' ? Buffer.from(data, 'base64') : data;\n\n\t\tconst params = {\n\t\t\tBucket: this.bucket,\n\t\t\tKey: key,\n\t\t\tBody,\n\t\t\tContentType: contentType,\n\t\t};\n\n\t\tconst command = new PutObjectCommand(params);\n\n\t\tawait this.client.send(command);\n\t}\n\n\tasync delete(key: string): Promise<void> {\n\t\tconst command = new DeleteObjectCommand({\n\t\t\tBucket: this.bucket,\n\t\t\tKey: key,\n\t\t});\n\n\t\tawait this.client.send(command);\n\t}\n}\n\nexport enum AmazonCannedAccessControlList {\n\tAuthenticatedRead = 'authenticated-read',\n\tPrivate = 'private',\n\tPublicRead = 'public-read',\n\tPublicReadWrite = 'public-read-write',\n\tAwsExecRead = 'aws-exec-read',\n\tBucketOwnerRead = 'bucket-owner-read',\n\tBucketOwnerFullControl = 'bucket-owner-full-control',\n\tLogDeliveryWrite = 'log-delivery-write',\n}\n\ninterface AmazonStorageClientCreateOptions {\n\tbucket: string;\n\tregion?: string;\n\tacl?: AmazonCannedAccessControlList;\n\taccessKeyId?: string;\n\tsecretAccessKey?: string;\n\tendpoint?: string;\n\tforcePathStyle?: boolean;\n\tcache?: Cache;\n}\n"],"mappings":";;;;;;AAoBA,IAAa,sBAAb,MAAa,oBAA6C;CACzD,AAAS,WAAW,gBAAgB;CAEpC,OAAO,OACNA,SACsB;EACtB,MAAM,EACL,QACA,QACA,aACA,KACA,UACA,iBACA,iBAAiB,OACjB,OACA,GAAG;EACJ,MAAM,iBAAiB,eAAe;EACtC,MAAM,cAAc,iBACjB;GAAE;GAAa;EAAiB;EAGnC,MAAM,SAAS,IAAI,SAAS;GAC3B;GACA;GACA;GACA;EACA;AAED,SAAO,IAAI,oBAAoB,QAAQ,QAAQ,KAAK;CACpD;CACD,YACkBC,QACAC,QACA,MAAM,8BAA8B,mBAC5CC,OACR;EAJgB;EACA;EACA;EACR;CACN;CAEJ,AAAQ,uBACPC,MACAC,WACmB;EACnB,MAAM,cACL,KAAK,gBAAgB,KAAK,OAAO;EAClC,MAAM,6BAA6B,cAChC,KAAK,QACH,EAAE,YAAY,aAAa,mBAAmB,KAAK,KAAK,CAAC,IAC1D;AAGJ,SAAO,IAAI,iBAAiB;GAC3B,QAAQ,KAAK;GACb,KAAK,KAAK;GACV;GACA,qBAAqB,KAAK;GAC1B,GAAG;EACH;CACD;CAED,sBAAsBD,MAAYE,WAAoC;EACrE,MAAM,UAAU,KAAK,uBAAuB,MAAM,EAAE,WAAW,UAAW,EAAC;AAC3E,SAAO,aAAa,KAAK,QAAQ,SAAS,EAAE,WAAW,KAAK,KAAK,GAAI,EAAC;CACtE;CAED,MAAM,YAAYC,KAAyC;EAC1D,MAAM,UAAU,IAAI,0BAA0B;GAC7C,QAAQ,KAAK;GACb,QAAQ;EACR;EAED,MAAM,EAAE,WAAW,CAAE,GAAE,GAAG,MAAM,KAAK,OAAO,KAAK,QAAQ;AAEzD,SAAO,SAAS,IAAI,CAAC,aAAa;GACjC,IAAI,QAAQ,aAAa;GACzB,WAAW,QAAQ,gCAAgB,IAAI;EACvC,GAAE;CACH;CAED,MAAM,eAAeH,MAAY,YAAY,KAAK,IAAqB;EACtE,MAAM,YAAY,eAAe,KAAK,KAAK;EAC3C,MAAM,YAAY,MAAM,KAAK,OAAO,IAAY,SAAS;AAEzD,MAAI,UACH,QAAO;EAGR,MAAM,UAAU,KAAK,uBAAuB,KAAK;EACjD,MAAM,MAAM,MAAM,aAAa,KAAK,QAAQ,SAAS,EAAE,UAAW,EAAC;EACnE,MAAM,kBAAkB,KAAK,IAAI,YAAY,IAAI,EAAE;AAEnD,MAAI,gBACH,OAAM,KAAK,OAAO,IAAI,UAAU,KAAK,gBAAgB;AAGtD,SAAO;CACP;CAED,MAAM,aACLI,QACA,YAAY,KAAK,IACC;EAClB,MAAM,UAAU,IAAI,iBAAiB;GACpC,QAAQ,KAAK;GACb,KAAK,OAAO;GACZ,aAAa,OAAO;GACpB,eAAe,OAAO;EACtB;AAED,SAAO,aAAa,KAAK,QAAQ,SAAS,EAAE,UAAW,EAAC;CACxD;CAED,MAAM,UACLA,QACA,YAAY,GACiB;EAC7B,MAAM,EAAE,MAAM,GAAG;EACjB,MAAM,EAAE,QAAQ,QAAQ,KAAK,GAAG,MAAM,oBAAoB,KAAK,QAAQ;GACtE,SAAS,YAAY;GACrB,QAAQ,KAAK;GACb,QAAQ,EACP,KAAK,KAAK,IACV;GACD,YAAY,CAMX;GACD,KAAK;EACL,EAAC;EAEF,MAAM,OAAO,OAAO,KAAK,OAAO;EAChC,MAAM,SAAS,KAAK,IAAI,CAAC,SAAS;GAAE;GAAK,OAAO,OAAO,QAAQ;EAAI,GAAE;AAErE,SAAO;GAAE;GAAK;EAAQ;CACtB;CAED,MAAM,OACLD,KACAE,MACAC,aACgB;EAChB,MAAM,cAAc,SAAS,WAAW,OAAO,KAAK,MAAM,SAAS,GAAG;EAEtE,MAAM,SAAS;GACd,QAAQ,KAAK;GACb,KAAK;GACL;GACA,aAAa;EACb;EAED,MAAM,UAAU,IAAI,iBAAiB;AAErC,QAAM,KAAK,OAAO,KAAK,QAAQ;CAC/B;CAED,MAAM,OAAOH,KAA4B;EACxC,MAAM,UAAU,IAAI,oBAAoB;GACvC,QAAQ,KAAK;GACb,KAAK;EACL;AAED,QAAM,KAAK,OAAO,KAAK,QAAQ;CAC/B;AACD;AAED,IAAY,0FAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const require_AmazonStorageClient = require('./AmazonStorageClient-BvoZepKJ.cjs');
|
|
2
|
-
require('./StorageClient-BDRVrMJj.cjs');
|
|
3
|
-
|
|
4
|
-
exports.AmazonCannedAccessControlList = require_AmazonStorageClient.AmazonCannedAccessControlList;
|
|
5
|
-
exports.AmazonStorageClient = require_AmazonStorageClient.AmazonStorageClient;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/StorageClient.ts
|
|
2
|
-
let StorageProvider = /* @__PURE__ */ function(StorageProvider$1) {
|
|
3
|
-
StorageProvider$1["AWSS3"] = "geekimdas.toolbox.storage.aws.s3";
|
|
4
|
-
StorageProvider$1["GCP"] = "geekimdas.toolbox.storage.gcp";
|
|
5
|
-
StorageProvider$1["AZURE"] = "geekimdas.toolbox.storage.azure";
|
|
6
|
-
return StorageProvider$1;
|
|
7
|
-
}({});
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { StorageProvider };
|
|
11
|
-
//# sourceMappingURL=StorageClient-4ADnTPnJ.mjs.map
|