@toa.io/extensions.storages 1.0.0-alpha.13 → 1.0.0-alpha.143
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 +13 -14
- package/readme.md +94 -49
- package/schemas/annotation.cos.yaml +1 -0
- package/schemas/cloudinary.cos.yaml +30 -0
- package/schemas/fs.cos.yaml +2 -0
- package/schemas/s3.cos.yaml +1 -0
- package/schemas/tmp.cos.yaml +0 -1
- package/source/Entry.ts +11 -11
- package/source/Factory.ts +16 -9
- package/source/Provider.ts +19 -19
- package/source/Scanner.ts +57 -24
- package/source/Secrets.ts +6 -0
- package/source/Storage.test.ts +103 -279
- package/source/Storage.ts +55 -204
- package/source/deployment.ts +48 -15
- package/source/errors.ts +3 -0
- package/source/index.ts +1 -1
- package/source/manifest.ts +7 -6
- package/source/providers/Cloudinary.ts +274 -0
- package/source/providers/Declaration.ts +2 -1
- package/source/providers/FileSystem.ts +79 -25
- package/source/providers/S3.ts +81 -80
- package/source/providers/Temporary.ts +2 -3
- package/source/providers/Test.ts +4 -4
- package/source/providers/index.test.ts +102 -76
- package/source/providers/index.ts +9 -4
- package/source/schemas.ts +1 -0
- package/source/test/.env.example +4 -0
- package/source/test/arny.jpg +0 -0
- package/source/test/lenna.48x48.jpeg +0 -0
- package/source/test/sample.avi +0 -0
- package/source/test/sample.svg +4 -0
- package/source/test/sample.wav +0 -0
- package/source/test/util.ts +54 -12
- package/transpiled/Entry.d.ts +12 -10
- package/transpiled/Factory.js +11 -5
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Provider.d.ts +15 -15
- package/transpiled/Provider.js +3 -3
- package/transpiled/Provider.js.map +1 -1
- package/transpiled/Scanner.d.ts +5 -2
- package/transpiled/Scanner.js +49 -22
- package/transpiled/Scanner.js.map +1 -1
- package/transpiled/Secrets.d.ts +5 -0
- package/transpiled/Secrets.js +3 -0
- package/transpiled/Secrets.js.map +1 -0
- package/transpiled/Storage.d.ts +10 -19
- package/transpiled/Storage.js +47 -153
- package/transpiled/Storage.js.map +1 -1
- package/transpiled/deployment.d.ts +1 -1
- package/transpiled/deployment.js +40 -15
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/errors.d.ts +2 -0
- package/transpiled/errors.js +6 -0
- package/transpiled/errors.js.map +1 -0
- package/transpiled/index.d.ts +1 -1
- package/transpiled/manifest.js +5 -2
- package/transpiled/manifest.js.map +1 -1
- package/transpiled/providers/Cloudinary.d.ts +42 -0
- package/transpiled/providers/Cloudinary.js +189 -0
- package/transpiled/providers/Cloudinary.js.map +1 -0
- package/transpiled/providers/Declaration.d.ts +3 -2
- package/transpiled/providers/FileSystem.d.ts +15 -7
- package/transpiled/providers/FileSystem.js +64 -24
- package/transpiled/providers/FileSystem.js.map +1 -1
- package/transpiled/providers/S3.d.ts +14 -14
- package/transpiled/providers/S3.js +62 -60
- package/transpiled/providers/S3.js.map +1 -1
- package/transpiled/providers/Temporary.d.ts +1 -2
- package/transpiled/providers/Temporary.js +2 -2
- package/transpiled/providers/Temporary.js.map +1 -1
- package/transpiled/providers/Test.d.ts +3 -3
- package/transpiled/providers/Test.js +2 -2
- package/transpiled/providers/Test.js.map +1 -1
- package/transpiled/providers/index.d.ts +6 -2
- package/transpiled/providers/index.js +2 -2
- package/transpiled/providers/index.js.map +1 -1
- package/transpiled/schemas.d.ts +1 -0
- package/transpiled/schemas.js +2 -1
- package/transpiled/schemas.js.map +1 -1
- package/transpiled/test/util.d.ts +70 -5
- package/transpiled/test/util.js +43 -4
- package/transpiled/test/util.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/source/providers/FileSystem.test.ts +0 -5
- package/source/providers/Memory.ts +0 -41
- package/source/providers/S3.test.ts +0 -133
- package/transpiled/providers/Memory.d.ts +0 -13
- package/transpiled/providers/Memory.js +0 -60
- package/transpiled/providers/Memory.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { S3Options } from './S3';
|
|
2
|
+
import type { CloudinaryOptions } from './Cloudinary';
|
|
2
3
|
import type { FileSystemOptions } from './FileSystem';
|
|
3
4
|
import type { TemporaryOptions } from './Temporary';
|
|
4
5
|
export type Declaration = ({
|
|
5
6
|
provider: 's3';
|
|
6
7
|
} & S3Options) | ({
|
|
8
|
+
provider: 'cloudinary';
|
|
9
|
+
} & CloudinaryOptions) | ({
|
|
7
10
|
provider: 'fs';
|
|
8
11
|
} & FileSystemOptions) | ({
|
|
9
12
|
provider: 'tmp';
|
|
10
13
|
} & TemporaryOptions) | ({
|
|
11
|
-
provider: 'mem';
|
|
12
|
-
}) | ({
|
|
13
14
|
provider: 'test';
|
|
14
15
|
} & TemporaryOptions);
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { type Readable } from 'node:stream';
|
|
3
2
|
import { Provider } from '../Provider';
|
|
4
|
-
import type {
|
|
3
|
+
import type { Readable } from 'node:stream';
|
|
4
|
+
import type { Maybe } from '@toa.io/types';
|
|
5
|
+
import type { Metadata, Stream } from '../Entry';
|
|
5
6
|
export interface FileSystemOptions {
|
|
6
7
|
path: string;
|
|
8
|
+
claim?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare class FileSystem extends Provider<FileSystemOptions> {
|
|
9
|
-
|
|
10
|
-
constructor(options: FileSystemOptions
|
|
11
|
-
get(
|
|
12
|
-
|
|
11
|
+
readonly root: string;
|
|
12
|
+
constructor(options: FileSystemOptions);
|
|
13
|
+
get(rel: string): Promise<Maybe<Stream>>;
|
|
14
|
+
head(rel: string): Promise<Maybe<Metadata>>;
|
|
15
|
+
put(rel: string, stream: Readable): Promise<void>;
|
|
16
|
+
commit(rel: string, metadata: Metadata): Promise<void>;
|
|
13
17
|
delete(path: string): Promise<void>;
|
|
14
|
-
move(from: string, to: string): Promise<void
|
|
18
|
+
move(from: string, to: string): Promise<Maybe<void>>;
|
|
19
|
+
private blob;
|
|
20
|
+
private meta;
|
|
21
|
+
private join;
|
|
22
|
+
private try;
|
|
15
23
|
}
|
|
@@ -4,40 +4,80 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FileSystem = void 0;
|
|
7
|
-
const node_path_1 = require("node:path");
|
|
8
7
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
9
10
|
const Provider_1 = require("../Provider");
|
|
11
|
+
const errors_1 = require("../errors");
|
|
10
12
|
class FileSystem extends Provider_1.Provider {
|
|
11
|
-
|
|
12
|
-
constructor(options
|
|
13
|
-
super(options
|
|
14
|
-
this.
|
|
13
|
+
root;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super(options);
|
|
16
|
+
this.root = options.path;
|
|
15
17
|
}
|
|
16
|
-
async get(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
throw err;
|
|
25
|
-
}
|
|
18
|
+
async get(rel) {
|
|
19
|
+
const path = this.blob(rel);
|
|
20
|
+
const metadata = await this.head(rel);
|
|
21
|
+
if (metadata instanceof Error)
|
|
22
|
+
return metadata;
|
|
23
|
+
const stream = (0, node_fs_1.createReadStream)(path);
|
|
24
|
+
return { stream, ...metadata };
|
|
26
25
|
}
|
|
27
|
-
async
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
async head(rel) {
|
|
27
|
+
const path = this.meta(rel);
|
|
28
|
+
return this.try(async () => {
|
|
29
|
+
const contents = await promises_1.default.readFile(path, 'utf8');
|
|
30
|
+
return JSON.parse(contents);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async put(rel, stream) {
|
|
34
|
+
const path = this.blob(rel);
|
|
35
|
+
const dir = (0, node_path_1.dirname)(path);
|
|
36
|
+
await promises_1.default.mkdir(dir, { recursive: true });
|
|
31
37
|
await promises_1.default.writeFile(path, stream);
|
|
32
38
|
}
|
|
39
|
+
async commit(rel, metadata) {
|
|
40
|
+
const path = this.meta(rel);
|
|
41
|
+
await promises_1.default.writeFile(path, JSON.stringify(metadata), 'utf8');
|
|
42
|
+
}
|
|
33
43
|
async delete(path) {
|
|
34
|
-
await
|
|
44
|
+
await Promise.all([
|
|
45
|
+
promises_1.default.rm(this.blob(path), { force: true }),
|
|
46
|
+
promises_1.default.rm(this.meta(path), { force: true })
|
|
47
|
+
]);
|
|
35
48
|
}
|
|
36
49
|
async move(from, to) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
const bf = this.blob(from);
|
|
51
|
+
const bt = this.blob(to);
|
|
52
|
+
const mf = this.meta(from);
|
|
53
|
+
const mt = this.meta(to);
|
|
54
|
+
await promises_1.default.mkdir((0, node_path_1.dirname)(bt), { recursive: true });
|
|
55
|
+
return await this.try(async () => {
|
|
56
|
+
await Promise.all([
|
|
57
|
+
promises_1.default.rename(bf, bt),
|
|
58
|
+
promises_1.default.rename(mf, mt)
|
|
59
|
+
]);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
blob(rel) {
|
|
63
|
+
return this.join(rel, '.blob');
|
|
64
|
+
}
|
|
65
|
+
meta(rel) {
|
|
66
|
+
return this.join(rel, '.meta');
|
|
67
|
+
}
|
|
68
|
+
join(rel, ext) {
|
|
69
|
+
return (0, node_path_1.join)(this.root, rel) + ext;
|
|
70
|
+
}
|
|
71
|
+
async try(action) {
|
|
72
|
+
try {
|
|
73
|
+
return await action();
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
if (err?.code === 'ENOENT')
|
|
77
|
+
return errors_1.ERR_NOT_FOUND;
|
|
78
|
+
else
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
41
81
|
}
|
|
42
82
|
}
|
|
43
83
|
exports.FileSystem = FileSystem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../source/providers/FileSystem.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../source/providers/FileSystem.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAiC;AACjC,qCAA0C;AAC1C,yCAAyC;AACzC,0CAAsC;AACtC,sCAAyC;AAUzC,MAAa,UAAW,SAAQ,mBAA2B;IAChC,IAAI,CAAQ;IAErC,YAAoB,OAA0B;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAA;QAEd,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,GAAG,CAAE,GAAW;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAErC,IAAI,QAAQ,YAAY,KAAK;YAC3B,OAAO,QAAQ,CAAA;QAEjB,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,IAAI,CAAC,CAAA;QAErC,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAChC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAE,GAAW;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE3B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YACzB,MAAM,QAAQ,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YAEhD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;IAEM,KAAK,CAAC,GAAG,CAAE,GAAW,EAAE,MAAgB;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,IAA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IAAI,EAAE,CAAC,CAAA;QAEhD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,kBAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;gBACjB,kBAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;aAClB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,IAAI,CAAE,GAAW;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAChC,CAAC;IAEO,IAAI,CAAE,GAAW;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAChC,CAAC;IAEO,IAAI,CAAE,GAAW,EAAE,GAAW;QACpC,OAAO,IAAA,gBAAI,EAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,CAAA;IACnC,CAAC;IAEO,KAAK,CAAC,GAAG,CAAY,MAAwB;QACnD,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,EAAE,CAAA;QACvB,CAAC;QAAC,OAAO,GAAgC,EAAE,CAAC;YAC1C,IAAI,GAAG,EAAE,IAAI,KAAK,QAAQ;gBACxB,OAAO,sBAAa,CAAA;;gBAEpB,MAAM,GAAG,CAAA;QACb,CAAC;IACH,CAAC;CACF;AA1FD,gCA0FC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { Provider } from '../Provider';
|
|
4
|
+
import type { Maybe } from '@toa.io/types';
|
|
5
|
+
import type { Metadata, Stream } from '../Entry';
|
|
6
|
+
import type { Secret, Secrets } from '../Secrets';
|
|
5
7
|
export interface S3Options {
|
|
6
8
|
bucket: string;
|
|
7
9
|
region?: string;
|
|
8
10
|
prefix?: string;
|
|
9
11
|
endpoint?: string;
|
|
10
12
|
}
|
|
11
|
-
type S3Secrets =
|
|
13
|
+
type S3Secrets = Secrets<'ACCESS_KEY_ID' | 'SECRET_ACCESS_KEY'>;
|
|
12
14
|
export declare class S3 extends Provider<S3Options> {
|
|
13
|
-
static readonly SECRETS: readonly
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
static readonly SECRETS: readonly Secret[];
|
|
16
|
+
private readonly bucket;
|
|
17
|
+
private readonly client;
|
|
16
18
|
constructor(options: S3Options, secrets?: S3Secrets);
|
|
17
|
-
get(Key: string): Promise<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* with given prefix (prefix will be enforced to finish with `/`)
|
|
22
|
-
* @param Key - key name or path prefix
|
|
23
|
-
*/
|
|
19
|
+
get(Key: string): Promise<Maybe<Stream>>;
|
|
20
|
+
head(Key: string): Promise<Maybe<Metadata>>;
|
|
21
|
+
put(Key: string, stream: Readable): Promise<void>;
|
|
22
|
+
commit(Key: string, metadata: object): Promise<void>;
|
|
24
23
|
delete(Key: string): Promise<void>;
|
|
25
|
-
move(from: string, keyTo: string): Promise<void
|
|
24
|
+
move(from: string, keyTo: string): Promise<Maybe<void>>;
|
|
25
|
+
private try;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -32,9 +32,11 @@ const node_buffer_1 = require("node:buffer");
|
|
|
32
32
|
const posix_1 = require("node:path/posix");
|
|
33
33
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
34
34
|
const lib_storage_1 = require("@aws-sdk/lib-storage");
|
|
35
|
-
const
|
|
35
|
+
const s3 = __importStar(require("@aws-sdk/client-s3"));
|
|
36
36
|
const nodeNativeFetch = __importStar(require("smithy-node-native-fetch"));
|
|
37
|
+
const openspan_1 = require("openspan");
|
|
37
38
|
const Provider_1 = require("../Provider");
|
|
39
|
+
const errors_1 = require("../errors");
|
|
38
40
|
class S3 extends Provider_1.Provider {
|
|
39
41
|
static SECRETS = [
|
|
40
42
|
{ name: 'ACCESS_KEY_ID', optional: true },
|
|
@@ -43,7 +45,7 @@ class S3 extends Provider_1.Provider {
|
|
|
43
45
|
bucket;
|
|
44
46
|
client;
|
|
45
47
|
constructor(options, secrets) {
|
|
46
|
-
super(options);
|
|
48
|
+
super(options, secrets);
|
|
47
49
|
this.bucket = options.bucket;
|
|
48
50
|
const s3Config = {
|
|
49
51
|
retryMode: 'adaptive',
|
|
@@ -62,13 +64,13 @@ class S3 extends Provider_1.Provider {
|
|
|
62
64
|
secretAccessKey: secrets.SECRET_ACCESS_KEY
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
|
-
this.client = new
|
|
67
|
+
this.client = new s3.S3Client(s3Config);
|
|
66
68
|
this.client.middlewareStack.add((next, _context) => async (args) => {
|
|
69
|
+
// removes leading slash
|
|
67
70
|
if ('Key' in args.input && typeof args.input.Key === 'string')
|
|
68
|
-
// removes leading slash
|
|
69
71
|
args.input.Key = args.input.Key.replace(/^\//, '');
|
|
72
|
+
// removes leading slash and ensures finishing slash
|
|
70
73
|
if ('Prefix' in args.input && typeof args.input.Prefix === 'string')
|
|
71
|
-
// removes leading slash and ensures finishing slash
|
|
72
74
|
args.input.Prefix = args.input.Prefix.replace(/^\/|\/$/g, '') + '/';
|
|
73
75
|
return next(args);
|
|
74
76
|
}, {
|
|
@@ -78,76 +80,76 @@ class S3 extends Provider_1.Provider {
|
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
82
|
async get(Key) {
|
|
81
|
-
try {
|
|
82
|
-
const
|
|
83
|
+
return await this.try(async () => {
|
|
84
|
+
const entry = await this.client.send(new s3.GetObjectCommand({
|
|
83
85
|
Bucket: this.bucket,
|
|
84
86
|
Key
|
|
85
87
|
}));
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return null;
|
|
97
|
-
else
|
|
98
|
-
throw err;
|
|
99
|
-
}
|
|
88
|
+
const stream = entry.Body instanceof node_stream_1.Readable
|
|
89
|
+
? entry.Body
|
|
90
|
+
: node_stream_1.Readable.fromWeb((entry.Body instanceof node_buffer_1.Blob
|
|
91
|
+
? entry.Body.stream()
|
|
92
|
+
: entry.Body));
|
|
93
|
+
if (entry.Metadata?.value === undefined)
|
|
94
|
+
return errors_1.ERR_NOT_FOUND;
|
|
95
|
+
const metadata = JSON.parse(entry.Metadata.value);
|
|
96
|
+
return { stream, ...metadata };
|
|
97
|
+
});
|
|
100
98
|
}
|
|
101
|
-
async
|
|
99
|
+
async head(Key) {
|
|
100
|
+
return await this.try(async () => {
|
|
101
|
+
const entry = await this.client.send(new s3.HeadObjectCommand({
|
|
102
|
+
Bucket: this.bucket,
|
|
103
|
+
Key
|
|
104
|
+
}));
|
|
105
|
+
if (entry.Metadata?.value === undefined)
|
|
106
|
+
return errors_1.ERR_NOT_FOUND;
|
|
107
|
+
return JSON.parse(entry.Metadata.value);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async put(Key, stream) {
|
|
102
111
|
await new lib_storage_1.Upload({
|
|
103
112
|
client: this.client,
|
|
104
113
|
params: {
|
|
105
114
|
Bucket: this.bucket,
|
|
106
|
-
Key
|
|
115
|
+
Key,
|
|
107
116
|
Body: stream
|
|
108
117
|
}
|
|
109
118
|
}).done();
|
|
110
119
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
async commit(Key, metadata) {
|
|
121
|
+
await this.client.send(new s3.CopyObjectCommand({
|
|
122
|
+
Bucket: this.bucket,
|
|
123
|
+
Key,
|
|
124
|
+
CopySource: (0, posix_1.join)(this.bucket, Key),
|
|
125
|
+
Metadata: { value: JSON.stringify(metadata) },
|
|
126
|
+
MetadataDirective: 'REPLACE'
|
|
127
|
+
}));
|
|
128
|
+
openspan_1.console.debug('Uploaded to S3', { bucket: this.bucket, path: Key, metadata });
|
|
129
|
+
}
|
|
116
130
|
async delete(Key) {
|
|
117
|
-
|
|
118
|
-
// checking if given key is a single file
|
|
119
|
-
if (!Key.endsWith('/'))
|
|
120
|
-
try {
|
|
121
|
-
// DeleteObject on S3 returns no error if object does not exist
|
|
122
|
-
await client.send(new client_s3_1.HeadObjectCommand({ Bucket, Key }));
|
|
123
|
-
await client.send(new client_s3_1.DeleteObjectCommand({ Bucket, Key }));
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
catch (err) {
|
|
127
|
-
node_assert_1.default.ok(err instanceof client_s3_1.NotFound || err instanceof client_s3_1.NoSuchKey, err);
|
|
128
|
-
}
|
|
129
|
-
const objectsToRemove = [];
|
|
130
|
-
for await (const page of (0, client_s3_1.paginateListObjectsV2)({ client }, { Bucket, Prefix: Key }))
|
|
131
|
-
for (const { Key } of page.Contents ?? [])
|
|
132
|
-
objectsToRemove.push({ Key });
|
|
133
|
-
// Removing all objects in parallel in batches
|
|
134
|
-
await Promise.all((function* () {
|
|
135
|
-
while (objectsToRemove.length > 0)
|
|
136
|
-
yield client.send(new client_s3_1.DeleteObjectsCommand({
|
|
137
|
-
Bucket,
|
|
138
|
-
Delete: {
|
|
139
|
-
Objects: objectsToRemove.splice(0, 1000 /* max batch size for DeleteObjects */)
|
|
140
|
-
}
|
|
141
|
-
}));
|
|
142
|
-
})());
|
|
131
|
+
await this.client.send(new s3.DeleteObjectCommand({ Bucket: this.bucket, Key }));
|
|
143
132
|
}
|
|
144
133
|
async move(from, keyTo) {
|
|
145
|
-
await this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
134
|
+
return await this.try(async () => {
|
|
135
|
+
await this.client.send(new s3.CopyObjectCommand({
|
|
136
|
+
Bucket: this.bucket,
|
|
137
|
+
Key: keyTo,
|
|
138
|
+
CopySource: (0, posix_1.join)(this.bucket, from)
|
|
139
|
+
}));
|
|
140
|
+
await this.client.send(new s3.DeleteObjectCommand({ Bucket: this.bucket, Key: from }));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async try(action) {
|
|
144
|
+
try {
|
|
145
|
+
return await action();
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
if (err?.name === 'NotFound' || err?.name === 'NoSuchKey')
|
|
149
|
+
return errors_1.ERR_NOT_FOUND;
|
|
150
|
+
else
|
|
151
|
+
throw err;
|
|
152
|
+
}
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
exports.S3 = S3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"S3.js","sourceRoot":"","sources":["../../source/providers/S3.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,6CAAkC;AAClC,2CAAsC;AACtC,8DAAgC;AAChC,sDAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"S3.js","sourceRoot":"","sources":["../../source/providers/S3.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,6CAAkC;AAClC,2CAAsC;AACtC,8DAAgC;AAChC,sDAA6C;AAC7C,uDAAwC;AACxC,0EAA2D;AAC3D,uCAAkC;AAClC,0CAAsC;AACtC,sCAAyC;AAezC,MAAa,EAAG,SAAQ,mBAAmB;IAClC,MAAM,CAAmB,OAAO,GAAsB;QAC3D,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC9C,CAAA;IAEgB,MAAM,CAAQ;IACd,MAAM,CAAa;IAEpC,YAAoB,OAAkB,EAAE,OAAmB;QACzD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAE5B,MAAM,QAAQ,GAA0B;YACtC,SAAS,EAAE,UAAU;YACrB,GA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,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;IAEM,KAAK,CAAC,IAAI,CAAE,IAAY,EAAE,KAAa;QAC5C,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC;gBAC9C,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,KAAK;gBACV,UAAU,EAAE,IAAA,YAAI,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;aACpC,CAAC,CAAC,CAAA;YAEH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QACxF,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,GAAG,CAAY,MAAwB;QACnD,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,EAAE,CAAA;QACvB,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,EAAE,IAAI,KAAK,UAAU,IAAI,GAAG,EAAE,IAAI,KAAK,WAAW;gBACvD,OAAO,sBAAa,CAAA;;gBAEpB,MAAM,GAAG,CAAA;QACb,CAAC;IACH,CAAC;;AA7IH,gBA8IC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FileSystem } from './FileSystem';
|
|
2
|
-
import type { ProviderSecrets } from '../Provider';
|
|
3
2
|
export interface TemporaryOptions {
|
|
4
3
|
directory: string;
|
|
5
4
|
}
|
|
6
5
|
export declare class Temporary extends FileSystem {
|
|
7
|
-
constructor(options: TemporaryOptions
|
|
6
|
+
constructor(options: TemporaryOptions);
|
|
8
7
|
}
|
|
@@ -5,9 +5,9 @@ const node_os_1 = require("node:os");
|
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const FileSystem_1 = require("./FileSystem");
|
|
7
7
|
class Temporary extends FileSystem_1.FileSystem {
|
|
8
|
-
constructor(options
|
|
8
|
+
constructor(options) {
|
|
9
9
|
const path = (0, node_path_1.join)((0, node_os_1.tmpdir)(), options.directory);
|
|
10
|
-
super({ path }
|
|
10
|
+
super({ path });
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.Temporary = Temporary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Temporary.js","sourceRoot":"","sources":["../../source/providers/Temporary.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAChC,yCAAgC;AAChC,6CAAyC;
|
|
1
|
+
{"version":3,"file":"Temporary.js","sourceRoot":"","sources":["../../source/providers/Temporary.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAChC,yCAAgC;AAChC,6CAAyC;AAMzC,MAAa,SAAU,SAAQ,uBAAU;IACvC,YAAoB,OAAyB;QAC3C,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,IAAA,gBAAM,GAAE,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAE9C,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;IACjB,CAAC;CACF;AAND,8BAMC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporary, type TemporaryOptions } from './Temporary';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Secret } from '../Secrets';
|
|
3
3
|
export declare class Test extends Temporary {
|
|
4
|
-
static readonly SECRETS: readonly
|
|
5
|
-
constructor(options: TemporaryOptions
|
|
4
|
+
static readonly SECRETS: readonly Secret[];
|
|
5
|
+
constructor(options: TemporaryOptions);
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Test.js","sourceRoot":"","sources":["../../source/providers/Test.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAG9D,MAAa,IAAK,SAAQ,qBAAS;IAC1B,MAAM,CAAmB,OAAO,
|
|
1
|
+
{"version":3,"file":"Test.js","sourceRoot":"","sources":["../../source/providers/Test.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAG9D,MAAa,IAAK,SAAQ,qBAAS;IAC1B,MAAM,CAAmB,OAAO,GAAsB;QAC3D,EAAE,IAAI,EAAE,UAAU,EAAE;QACpB,EAAE,IAAI,EAAE,UAAU,EAAE;KACrB,CAAA;IAED,YAAoB,OAAyB;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;;AARH,oBASC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { FileSystem } from './FileSystem';
|
|
2
2
|
import { S3 } from './S3';
|
|
3
|
+
import { Cloudinary } from './Cloudinary';
|
|
3
4
|
import { Temporary } from './Temporary';
|
|
4
5
|
import { Test } from './Test';
|
|
5
|
-
import { InMemory } from './Memory';
|
|
6
6
|
export declare const providers: {
|
|
7
7
|
readonly s3: typeof S3;
|
|
8
|
+
readonly cloudinary: typeof Cloudinary;
|
|
8
9
|
readonly fs: typeof FileSystem;
|
|
9
10
|
readonly tmp: typeof Temporary;
|
|
10
|
-
readonly mem: typeof InMemory;
|
|
11
11
|
readonly test: typeof Test;
|
|
12
12
|
};
|
|
13
13
|
export type { Declaration } from './Declaration';
|
|
14
|
+
export type { S3Options } from './S3';
|
|
15
|
+
export type { CloudinaryOptions } from './Cloudinary';
|
|
16
|
+
export type { FileSystemOptions } from './FileSystem';
|
|
17
|
+
export type { TemporaryOptions } from './Temporary';
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.providers = void 0;
|
|
4
4
|
const FileSystem_1 = require("./FileSystem");
|
|
5
5
|
const S3_1 = require("./S3");
|
|
6
|
+
const Cloudinary_1 = require("./Cloudinary");
|
|
6
7
|
const Temporary_1 = require("./Temporary");
|
|
7
8
|
const Test_1 = require("./Test");
|
|
8
|
-
const Memory_1 = require("./Memory");
|
|
9
9
|
exports.providers = {
|
|
10
10
|
s3: S3_1.S3,
|
|
11
|
+
cloudinary: Cloudinary_1.Cloudinary,
|
|
11
12
|
fs: FileSystem_1.FileSystem,
|
|
12
13
|
tmp: Temporary_1.Temporary,
|
|
13
|
-
mem: Memory_1.InMemory,
|
|
14
14
|
test: Test_1.Test
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/providers/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,6BAAyB;AACzB,2CAAuC;AACvC,iCAA6B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/providers/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,6BAAyB;AACzB,6CAAyC;AACzC,2CAAuC;AACvC,iCAA6B;AAGhB,QAAA,SAAS,GAAG;IACvB,EAAE,EAAE,OAAE;IACN,UAAU,EAAE,uBAAU;IACtB,EAAE,EAAE,uBAAU;IACd,GAAG,EAAE,qBAAS;IACd,IAAI,EAAE,WAAI;CACoC,CAAA"}
|
package/transpiled/schemas.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Schema } from '@toa.io/schemas';
|
|
|
3
3
|
import type { Annotation } from './Annotation';
|
|
4
4
|
export declare const annotation: Schema<Annotation>;
|
|
5
5
|
export declare const s3: Schema<Declaration>;
|
|
6
|
+
export declare const cloudinary: Schema<Declaration>;
|
|
6
7
|
export declare const fs: Schema<Declaration>;
|
|
7
8
|
export declare const mem: Schema<Declaration>;
|
|
8
9
|
export declare const tmp: Schema<Declaration>;
|
package/transpiled/schemas.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.test = exports.tmp = exports.mem = exports.fs = exports.s3 = exports.annotation = void 0;
|
|
3
|
+
exports.test = exports.tmp = exports.mem = exports.fs = exports.cloudinary = exports.s3 = exports.annotation = void 0;
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
5
|
const schemas_1 = require("@toa.io/schemas");
|
|
6
6
|
const path = (0, node_path_1.resolve)(__dirname, '../schemas');
|
|
7
7
|
const ns = (0, schemas_1.namespace)(path);
|
|
8
8
|
exports.annotation = ns.schema('annotation');
|
|
9
9
|
exports.s3 = ns.schema('s3');
|
|
10
|
+
exports.cloudinary = ns.schema('cloudinary');
|
|
10
11
|
exports.fs = ns.schema('fs');
|
|
11
12
|
exports.mem = ns.schema('mem');
|
|
12
13
|
exports.tmp = ns.schema('tmp');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../source/schemas.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AACnC,6CAA2C;AAK3C,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAC7C,MAAM,EAAE,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,CAAA;AAEb,QAAA,UAAU,GAAuB,EAAE,CAAC,MAAM,CAAa,YAAY,CAAC,CAAA;AACpE,QAAA,EAAE,GAAwB,EAAE,CAAC,MAAM,CAAc,IAAI,CAAC,CAAA;AACtD,QAAA,EAAE,GAAwB,EAAE,CAAC,MAAM,CAAc,IAAI,CAAC,CAAA;AACtD,QAAA,GAAG,GAAwB,EAAE,CAAC,MAAM,CAAc,KAAK,CAAC,CAAA;AACxD,QAAA,GAAG,GAAwB,EAAE,CAAC,MAAM,CAAc,KAAK,CAAC,CAAA;AACxD,QAAA,IAAI,GAAwB,EAAE,CAAC,MAAM,CAAc,MAAM,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../source/schemas.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AACnC,6CAA2C;AAK3C,MAAM,IAAI,GAAG,IAAA,mB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