@runplex/storage-s3 0.1.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/README.md +19 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +17 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +129 -0
- package/dist/provider.js.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @runplex/storage-s3
|
|
2
|
+
|
|
3
|
+
S3-compatible storage provider for Runplex
|
|
4
|
+
|
|
5
|
+
Part of the [Runplex](https://github.com/runplex/runplex) framework.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @runplex/storage-s3
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Documentation
|
|
14
|
+
|
|
15
|
+
See the [Runplex documentation](https://github.com/runplex/runplex/tree/main/docs) for guides and API reference.
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { S3StorageProvider } from "./provider.js";
|
|
2
|
+
export type { S3StorageConfig } from "./types.js";
|
|
3
|
+
import type { S3StorageConfig } from "./types.js";
|
|
4
|
+
import { S3StorageProvider } from "./provider.js";
|
|
5
|
+
export declare function createS3Storage(config: S3StorageConfig): S3StorageProvider;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,CAE1E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StorageProvider } from "@runplex/core";
|
|
2
|
+
import type { S3StorageConfig } from "./types.js";
|
|
3
|
+
export declare class S3StorageProvider implements StorageProvider {
|
|
4
|
+
private client;
|
|
5
|
+
private bucket;
|
|
6
|
+
private prefix;
|
|
7
|
+
constructor(config: S3StorageConfig);
|
|
8
|
+
private fullKey;
|
|
9
|
+
get(key: string): Promise<Buffer | null>;
|
|
10
|
+
put(key: string, body: Buffer | string): Promise<void>;
|
|
11
|
+
delete(key: string): Promise<void>;
|
|
12
|
+
exists(key: string): Promise<boolean>;
|
|
13
|
+
list(prefix: string): Promise<string[]>;
|
|
14
|
+
syncToLocal(prefix: string, localDir: string): Promise<number>;
|
|
15
|
+
syncFromLocal(localDir: string, prefix: string): Promise<number>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,qBAAa,iBAAkB,YAAW,eAAe;IACvD,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,eAAe;IAenC,OAAO,CAAC,OAAO;IAIT,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAcxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUtD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAWrC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA+BvC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB9D,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAcvE"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { S3Client, GetObjectCommand, PutObjectCommand, DeleteObjectCommand, HeadObjectCommand, ListObjectsV2Command, } from "@aws-sdk/client-s3";
|
|
2
|
+
import { readdir, readFile, writeFile, mkdir } from "node:fs/promises";
|
|
3
|
+
import { join, relative, dirname } from "node:path";
|
|
4
|
+
export class S3StorageProvider {
|
|
5
|
+
client;
|
|
6
|
+
bucket;
|
|
7
|
+
prefix;
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.bucket = config.bucket;
|
|
10
|
+
this.prefix = config.prefix ? config.prefix.replace(/\/$/, "") + "/" : "";
|
|
11
|
+
this.client = new S3Client({
|
|
12
|
+
region: config.region ?? "us-east-1",
|
|
13
|
+
endpoint: config.endpoint,
|
|
14
|
+
forcePathStyle: config.forcePathStyle,
|
|
15
|
+
credentials: {
|
|
16
|
+
accessKeyId: config.accessKeyId,
|
|
17
|
+
secretAccessKey: config.secretAccessKey,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
fullKey(key) {
|
|
22
|
+
return this.prefix + key;
|
|
23
|
+
}
|
|
24
|
+
async get(key) {
|
|
25
|
+
try {
|
|
26
|
+
const result = await this.client.send(new GetObjectCommand({ Bucket: this.bucket, Key: this.fullKey(key) }));
|
|
27
|
+
if (!result.Body)
|
|
28
|
+
return null;
|
|
29
|
+
const bytes = await result.Body.transformToByteArray();
|
|
30
|
+
return Buffer.from(bytes);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (isNoSuchKey(err))
|
|
34
|
+
return null;
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async put(key, body) {
|
|
39
|
+
await this.client.send(new PutObjectCommand({
|
|
40
|
+
Bucket: this.bucket,
|
|
41
|
+
Key: this.fullKey(key),
|
|
42
|
+
Body: typeof body === "string" ? Buffer.from(body) : body,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
async delete(key) {
|
|
46
|
+
await this.client.send(new DeleteObjectCommand({ Bucket: this.bucket, Key: this.fullKey(key) }));
|
|
47
|
+
}
|
|
48
|
+
async exists(key) {
|
|
49
|
+
try {
|
|
50
|
+
await this.client.send(new HeadObjectCommand({ Bucket: this.bucket, Key: this.fullKey(key) }));
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async list(prefix) {
|
|
58
|
+
const keys = [];
|
|
59
|
+
let continuationToken;
|
|
60
|
+
const fullPrefix = this.fullKey(prefix);
|
|
61
|
+
do {
|
|
62
|
+
const result = await this.client.send(new ListObjectsV2Command({
|
|
63
|
+
Bucket: this.bucket,
|
|
64
|
+
Prefix: fullPrefix,
|
|
65
|
+
ContinuationToken: continuationToken,
|
|
66
|
+
}));
|
|
67
|
+
if (result.Contents) {
|
|
68
|
+
for (const obj of result.Contents) {
|
|
69
|
+
if (obj.Key) {
|
|
70
|
+
// Strip the provider prefix to return relative keys
|
|
71
|
+
keys.push(obj.Key.slice(this.prefix.length));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
continuationToken = result.IsTruncated
|
|
76
|
+
? result.NextContinuationToken
|
|
77
|
+
: undefined;
|
|
78
|
+
} while (continuationToken);
|
|
79
|
+
return keys;
|
|
80
|
+
}
|
|
81
|
+
async syncToLocal(prefix, localDir) {
|
|
82
|
+
const keys = await this.list(prefix);
|
|
83
|
+
let count = 0;
|
|
84
|
+
for (const key of keys) {
|
|
85
|
+
const data = await this.get(key);
|
|
86
|
+
if (!data)
|
|
87
|
+
continue;
|
|
88
|
+
const relativePath = key.slice(prefix.length).replace(/^\//, "");
|
|
89
|
+
const localPath = join(localDir, relativePath);
|
|
90
|
+
await mkdir(dirname(localPath), { recursive: true });
|
|
91
|
+
await writeFile(localPath, data);
|
|
92
|
+
count++;
|
|
93
|
+
}
|
|
94
|
+
return count;
|
|
95
|
+
}
|
|
96
|
+
async syncFromLocal(localDir, prefix) {
|
|
97
|
+
const files = await walkDir(localDir);
|
|
98
|
+
let count = 0;
|
|
99
|
+
for (const filePath of files) {
|
|
100
|
+
const relativePath = relative(localDir, filePath);
|
|
101
|
+
const key = prefix.replace(/\/$/, "") + "/" + relativePath;
|
|
102
|
+
const data = await readFile(filePath);
|
|
103
|
+
await this.put(key, data);
|
|
104
|
+
count++;
|
|
105
|
+
}
|
|
106
|
+
return count;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function isNoSuchKey(err) {
|
|
110
|
+
return (typeof err === "object" &&
|
|
111
|
+
err !== null &&
|
|
112
|
+
"name" in err &&
|
|
113
|
+
err.name === "NoSuchKey");
|
|
114
|
+
}
|
|
115
|
+
async function walkDir(dir) {
|
|
116
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
117
|
+
const files = [];
|
|
118
|
+
for (const entry of entries) {
|
|
119
|
+
const fullPath = join(dir, entry.name);
|
|
120
|
+
if (entry.isDirectory()) {
|
|
121
|
+
files.push(...(await walkDir(fullPath)));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
files.push(fullPath);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return files;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAW;IACjB,MAAM,CAAS;IACf,MAAM,CAAS;IAEvB,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAE1E,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC;YACzB,MAAM,EAA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*/
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
/** AWS region. Default: "us-east-1" */
|
|
7
|
+
region?: string;
|
|
8
|
+
/** AWS access key ID */
|
|
9
|
+
accessKeyId: string;
|
|
10
|
+
/** AWS secret access key */
|
|
11
|
+
secretAccessKey: string;
|
|
12
|
+
/** Use path-style URLs (required for MinIO). Default: false */
|
|
13
|
+
forcePathStyle?: boolean;
|
|
14
|
+
/** Optional key prefix for all operations */
|
|
15
|
+
prefix?: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@runplex/storage-s3",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "S3-compatible storage provider for Runplex",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@aws-sdk/client-s3": "^3.700.0",
|
|
18
|
+
"@runplex/core": "0.1.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^22.0.0",
|
|
22
|
+
"typescript": "^5.7.3"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "restricted"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/runplex/runplex.git",
|
|
30
|
+
"directory": "providers/storage-s3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"test": "vitest run --passWithNoTests",
|
|
36
|
+
"lint": "eslint src/"
|
|
37
|
+
}
|
|
38
|
+
}
|