@acmekit/file 2.13.1
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 +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/joiner-config.d.ts +2 -0
- package/dist/joiner-config.d.ts.map +1 -0
- package/dist/joiner-config.js +8 -0
- package/dist/joiner-config.js.map +1 -0
- package/dist/loaders/providers.d.ts +6 -0
- package/dist/loaders/providers.d.ts.map +1 -0
- package/dist/loaders/providers.js +23 -0
- package/dist/loaders/providers.js.map +1 -0
- package/dist/services/file-module-service.d.ts +57 -0
- package/dist/services/file-module-service.d.ts.map +1 -0
- package/dist/services/file-module-service.js +108 -0
- package/dist/services/file-module-service.js.map +1 -0
- package/dist/services/file-provider-service.d.ts +25 -0
- package/dist/services/file-provider-service.d.ts.map +1 -0
- package/dist/services/file-provider-service.js +45 -0
- package/dist/services/file-provider-service.js.map +1 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +11 -0
- package/dist/services/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +29 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# File Module
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;;;;AAI7C,wBAGE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require("./types");
|
|
7
|
+
const _services_1 = require("./services");
|
|
8
|
+
const providers_1 = __importDefault(require("./loaders/providers"));
|
|
9
|
+
const utils_1 = require("@acmekit/framework/utils");
|
|
10
|
+
exports.default = (0, utils_1.Module)(utils_1.Modules.FILE, {
|
|
11
|
+
service: _services_1.FileModuleService,
|
|
12
|
+
loaders: [providers_1.default],
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,mBAAgB;AAChB,yCAA6C;AAC7C,oEAA+C;AAC/C,oDAA0D;AAE1D,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,IAAI,EAAE;IAClC,OAAO,EAAE,6BAAiB;IAC1B,OAAO,EAAE,CAAC,mBAAa,CAAC;CACzB,CAAC,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const joinerConfig: Omit<import("@acmekit/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys"> & Required<Pick<import("@acmekit/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys">>;
|
|
2
|
+
//# sourceMappingURL=joiner-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joiner-config.d.ts","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,qOAEvB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.joinerConfig = void 0;
|
|
4
|
+
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
+
exports.joinerConfig = (0, utils_1.defineJoinerConfig)(utils_1.Modules.FILE, {
|
|
6
|
+
models: [{ name: "File" }],
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=joiner-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":";;;AAAA,oDAAsE;AAEzD,QAAA,YAAY,GAAG,IAAA,0BAAkB,EAAC,eAAO,CAAC,IAAI,EAAE;IAC3D,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoaderOptions, ModuleProvider, ModulesSdkTypes } from "@acmekit/framework/types";
|
|
2
|
+
declare const _default: ({ container, options, }: LoaderOptions<(ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions) & {
|
|
3
|
+
providers: ModuleProvider[];
|
|
4
|
+
}>) => Promise<void>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/loaders/providers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,0BAA0B,CAAA;yBA0BX,yBAGnB,aAAa,CACd,CACI,eAAe,CAAC,8BAA8B,GAC9C,eAAe,CAAC,6CAA6C,CAChE,GAAG;IAAE,SAAS,EAAE,cAAc,EAAE,CAAA;CAAE,CACpC,KAAG,OAAO,CAAC,IAAI,CAAC;AARjB,wBAcC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const modules_sdk_1 = require("@acmekit/framework/modules-sdk");
|
|
4
|
+
const _services_1 = require("../services");
|
|
5
|
+
const _types_1 = require("../types");
|
|
6
|
+
const awilix_1 = require("@acmekit/framework/awilix");
|
|
7
|
+
const registrationFn = async (klass, container, pluginOptions) => {
|
|
8
|
+
const key = _services_1.FileProviderService.getRegistrationIdentifier(klass, pluginOptions.id);
|
|
9
|
+
container.register({
|
|
10
|
+
[_types_1.FileProviderRegistrationPrefix + key]: (0, awilix_1.asFunction)((cradle) => new klass(cradle, pluginOptions.options ?? {}), {
|
|
11
|
+
lifetime: klass.LIFE_TIME || awilix_1.Lifetime.SINGLETON,
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
container.registerAdd(_types_1.FileProviderIdentifierRegistrationName, (0, awilix_1.asValue)(key));
|
|
15
|
+
};
|
|
16
|
+
exports.default = async ({ container, options, }) => {
|
|
17
|
+
await (0, modules_sdk_1.moduleProviderLoader)({
|
|
18
|
+
container,
|
|
19
|
+
providers: options?.providers || [],
|
|
20
|
+
registerServiceFn: registrationFn,
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/loaders/providers.ts"],"names":[],"mappings":";;AAAA,gEAAqE;AAMrE,yCAA+C;AAC/C,mCAGe;AACf,sDAAyE;AAEzE,MAAM,cAAc,GAAG,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE;IAC/D,MAAM,GAAG,GAAG,+BAAmB,CAAC,yBAAyB,CACvD,KAAK,EACL,aAAa,CAAC,EAAE,CACjB,CAAA;IAED,SAAS,CAAC,QAAQ,CAAC;QACjB,CAAC,uCAA8B,GAAG,GAAG,CAAC,EAAE,IAAA,mBAAU,EAChD,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC,EAC1D;YACE,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS;SAChD,CACF;KACF,CAAC,CAAA;IAEF,SAAS,CAAC,WAAW,CAAC,+CAAsC,EAAE,IAAA,gBAAO,EAAC,GAAG,CAAC,CAAC,CAAA;AAC7E,CAAC,CAAA;AAED,kBAAe,KAAK,EAAE,EACpB,SAAS,EACT,OAAO,GAMR,EAAiB,EAAE;IAClB,MAAM,IAAA,kCAAoB,EAAC;QACzB,SAAS;QACT,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,EAAE;QACnC,iBAAiB,EAAE,cAAc;KAClC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Context, CreateFileDTO, FileDTO, FileTypes, FilterableFileProps, FindConfig, GetUploadFileUrlDTO, ModuleJoinerConfig, UploadFileUrlDTO } from "@acmekit/framework/types";
|
|
2
|
+
import type { Readable, Writable } from "stream";
|
|
3
|
+
import FileProviderService from "./file-provider-service";
|
|
4
|
+
type InjectedDependencies = {
|
|
5
|
+
fileProviderService: FileProviderService;
|
|
6
|
+
};
|
|
7
|
+
export default class FileModuleService implements FileTypes.IFileModuleService {
|
|
8
|
+
protected readonly fileProviderService_: FileProviderService;
|
|
9
|
+
constructor({ fileProviderService }: InjectedDependencies);
|
|
10
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
11
|
+
getProvider(): FileProviderService;
|
|
12
|
+
createFiles(data: CreateFileDTO[], sharedContext?: Context): Promise<FileDTO[]>;
|
|
13
|
+
createFiles(data: CreateFileDTO, sharedContext?: Context): Promise<FileDTO>;
|
|
14
|
+
getUploadFileUrls(data: GetUploadFileUrlDTO[], sharedContext?: Context): Promise<UploadFileUrlDTO[]>;
|
|
15
|
+
getUploadFileUrls(data: GetUploadFileUrlDTO, sharedContext?: Context): Promise<UploadFileUrlDTO>;
|
|
16
|
+
deleteFiles(ids: string[], sharedContext?: Context): Promise<void>;
|
|
17
|
+
deleteFiles(id: string, sharedContext?: Context): Promise<void>;
|
|
18
|
+
retrieveFile(id: string): Promise<FileDTO>;
|
|
19
|
+
listFiles(filters?: FilterableFileProps, config?: FindConfig<FileDTO>, sharedContext?: Context): Promise<FileDTO[]>;
|
|
20
|
+
listAndCountFiles(filters?: FilterableFileProps, config?: FindConfig<FileDTO>, sharedContext?: Context): Promise<[FileDTO[], number]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get the file contents as a readable stream.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const stream = await fileModuleService.getAsStream("file_123")
|
|
26
|
+
* writeable.pipe(stream)
|
|
27
|
+
*/
|
|
28
|
+
getDownloadStream(id: string): Promise<Readable>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the file contents as a Node.js Buffer
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const contents = await fileModuleService.getAsBuffer("file_123")
|
|
34
|
+
* contents.toString('utf-8')
|
|
35
|
+
*/
|
|
36
|
+
getAsBuffer(id: string): Promise<Buffer>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a writeable stream to upload a file.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const { writeStream, promise } = await fileModuleService.getUploadStream({
|
|
42
|
+
* filename: "test.csv",
|
|
43
|
+
* mimeType: "text/csv",
|
|
44
|
+
* })
|
|
45
|
+
*
|
|
46
|
+
* stream.pipe(writeStream)
|
|
47
|
+
* const result = await promise
|
|
48
|
+
*/
|
|
49
|
+
getUploadStream(data: FileTypes.ProviderUploadStreamDTO): Promise<{
|
|
50
|
+
writeStream: Writable;
|
|
51
|
+
promise: Promise<FileTypes.ProviderFileResultDTO>;
|
|
52
|
+
url: string;
|
|
53
|
+
fileKey: string;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=file-module-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-module-service.d.ts","sourceRo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E,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW1C,SAAS,CACb,OAAO,CAAC,EAAE,mBAAmB,EAC7B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAC5B,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,OAAO,EAAE,CAAC;IAsBf,iBAAiB,CACrB,OAAO,CAAC,EAAE,mBAAmB,EAC7B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAC5B,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAsB/B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIhD;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxC;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,uBAAuB,GAAG,OAAO,CAAC;QAChE,WAAW,EAAE,QAAQ,CAAA;QACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAA;QACjD,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,EAAE,MAAM,CAAA;KAChB,CAAC;CAGH"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@acmekit/framework/utils");
|
|
4
|
+
const joiner_config_1 = require("../joiner-config");
|
|
5
|
+
class FileModuleService {
|
|
6
|
+
constructor({ fileProviderService }) {
|
|
7
|
+
this.fileProviderService_ = fileProviderService;
|
|
8
|
+
}
|
|
9
|
+
__joinerConfig() {
|
|
10
|
+
return joiner_config_1.joinerConfig;
|
|
11
|
+
}
|
|
12
|
+
getProvider() {
|
|
13
|
+
return this.fileProviderService_;
|
|
14
|
+
}
|
|
15
|
+
async createFiles(data) {
|
|
16
|
+
const input = Array.isArray(data) ? data : [data];
|
|
17
|
+
// TODO: Validate file mime type, have config for allowed types
|
|
18
|
+
const files = await Promise.all(input.map((file) => this.fileProviderService_.upload(file)));
|
|
19
|
+
const result = files.map((file) => ({
|
|
20
|
+
id: file.key,
|
|
21
|
+
url: file.url,
|
|
22
|
+
}));
|
|
23
|
+
return Array.isArray(data) ? result : result[0];
|
|
24
|
+
}
|
|
25
|
+
async getUploadFileUrls(data) {
|
|
26
|
+
const input = Array.isArray(data) ? data : [data];
|
|
27
|
+
const result = await Promise.all(input.map((file) => this.fileProviderService_.getPresignedUploadUrl(file)));
|
|
28
|
+
return Array.isArray(data) ? result : result[0];
|
|
29
|
+
}
|
|
30
|
+
async deleteFiles(ids) {
|
|
31
|
+
const input = Array.isArray(ids) ? ids : [ids];
|
|
32
|
+
await this.fileProviderService_.delete(input.map((id) => {
|
|
33
|
+
return { fileKey: id };
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
async retrieveFile(id) {
|
|
37
|
+
const res = await this.fileProviderService_.getPresignedDownloadUrl({
|
|
38
|
+
fileKey: id,
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
url: res,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async listFiles(filters, config, sharedContext) {
|
|
46
|
+
if (!filters?.id) {
|
|
47
|
+
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "Listing of files is only supported when filtering by ID.");
|
|
48
|
+
}
|
|
49
|
+
const ids = Array.isArray(filters?.id) ? filters?.id : [filters?.id];
|
|
50
|
+
const res = await Promise.all(ids.map(async (id) => {
|
|
51
|
+
const res = await this.fileProviderService_.getPresignedDownloadUrl({
|
|
52
|
+
fileKey: id,
|
|
53
|
+
});
|
|
54
|
+
return { id, url: res };
|
|
55
|
+
}));
|
|
56
|
+
return res;
|
|
57
|
+
}
|
|
58
|
+
async listAndCountFiles(filters, config, sharedContext) {
|
|
59
|
+
if (!filters?.id) {
|
|
60
|
+
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "Listing of files is only supported when filtering by ID.");
|
|
61
|
+
}
|
|
62
|
+
const ids = Array.isArray(filters?.id) ? filters?.id : [filters?.id];
|
|
63
|
+
const res = await Promise.all(ids.map(async (id) => {
|
|
64
|
+
const res = await this.fileProviderService_.getPresignedDownloadUrl({
|
|
65
|
+
fileKey: id,
|
|
66
|
+
});
|
|
67
|
+
return { id, url: res };
|
|
68
|
+
}));
|
|
69
|
+
return [res, res.length];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get the file contents as a readable stream.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const stream = await fileModuleService.getAsStream("file_123")
|
|
76
|
+
* writeable.pipe(stream)
|
|
77
|
+
*/
|
|
78
|
+
getDownloadStream(id) {
|
|
79
|
+
return this.fileProviderService_.getDownloadStream({ fileKey: id });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the file contents as a Node.js Buffer
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* const contents = await fileModuleService.getAsBuffer("file_123")
|
|
86
|
+
* contents.toString('utf-8')
|
|
87
|
+
*/
|
|
88
|
+
getAsBuffer(id) {
|
|
89
|
+
return this.fileProviderService_.getAsBuffer({ fileKey: id });
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get a writeable stream to upload a file.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* const { writeStream, promise } = await fileModuleService.getUploadStream({
|
|
96
|
+
* filename: "test.csv",
|
|
97
|
+
* mimeType: "text/csv",
|
|
98
|
+
* })
|
|
99
|
+
*
|
|
100
|
+
* stream.pipe(writeStream)
|
|
101
|
+
* const result = await promise
|
|
102
|
+
*/
|
|
103
|
+
getUploadStream(data) {
|
|
104
|
+
return this.fileProviderService_.getUploadStream(data);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.default = FileModuleService;
|
|
108
|
+
//# sourceMappingURL=file-module-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-module-service.js","sourceRoot":"","sources":["../../src/services/file-module-service.ts"],"names":[],"mappings":";;AAaA,oDAAuD;AACvD,oDAA+C;AAO/C,MAAqB,iBAAiB;IAEpC,YAAY,EAAE,mBAAmB,EAAwB;QACvD,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAA;IACjD,CAAC;IAED,cAAc;QACZ,OAAO,4BAAY,CAAA;IACrB,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,oBAAoB,CAAA;IAClC,CAAC;IAQD,KAAK,CAAC,WAAW,CACf,IAAqC;QAErC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACjD,+DAA+D;QAE/D,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAC5D,CAAA;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClC,EAAE,EAAE,IAAI,CAAC,GAAG;YACZ,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAC,CAAA;QAEH,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACjD,CAAC;IAWD,KAAK,CAAC,iBAAiB,CACrB,IAAiD;QAEjD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,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;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACrE,CAAC;IAED;;;;;;OAMG;IACH,WAAW,CAAC,EAAU;QACpB,OAAO,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,IAAuC;QAMrD,OAAO,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACxD,CAAC;CACF;AA9KD,oCA8KC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Constructor, FileTypes } from "@acmekit/framework/types";
|
|
2
|
+
import { FileProviderRegistrationPrefix } from "../types";
|
|
3
|
+
import type { Readable, Writable } from "stream";
|
|
4
|
+
type InjectedDependencies = {
|
|
5
|
+
[key: `${typeof FileProviderRegistrationPrefix}${string}`]: FileTypes.IFileProvider;
|
|
6
|
+
};
|
|
7
|
+
export default class FileProviderService {
|
|
8
|
+
protected readonly fileProvider_: FileTypes.IFileProvider;
|
|
9
|
+
constructor(container: InjectedDependencies);
|
|
10
|
+
static getRegistrationIdentifier(providerClass: Constructor<FileTypes.IFileProvider>, optionName?: string): string;
|
|
11
|
+
upload(file: FileTypes.ProviderUploadFileDTO): Promise<FileTypes.ProviderFileResultDTO>;
|
|
12
|
+
delete(fileData: FileTypes.ProviderDeleteFileDTO | FileTypes.ProviderDeleteFileDTO[]): Promise<void>;
|
|
13
|
+
getPresignedDownloadUrl(fileData: FileTypes.ProviderGetFileDTO): Promise<string>;
|
|
14
|
+
getPresignedUploadUrl(fileData: FileTypes.ProviderGetPresignedUploadUrlDTO): Promise<FileTypes.ProviderFileResultDTO>;
|
|
15
|
+
getDownloadStream(fileData: FileTypes.ProviderGetFileDTO): Promise<Readable>;
|
|
16
|
+
getAsBuffer(fileData: FileTypes.ProviderGetFileDTO): Promise<Buffer>;
|
|
17
|
+
getUploadStream(fileData: FileTypes.ProviderUploadStreamDTO): Promise<{
|
|
18
|
+
writeStream: Writable;
|
|
19
|
+
promise: Promise<FileTypes.ProviderFileResultDTO>;
|
|
20
|
+
url: string;
|
|
21
|
+
fileKey: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=file-provider-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-provider-service.d.ts","sourceRoot":"","sources":["../../src/services/file-provider-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEhD,KAAK,oBAAoB,GAAG;IAC1B,CACE,GAAG,EAAE,GAAG,OAAO,8BAA8B,GAAG,MAAM,EAAE,GACvD,SAAS,CAAC,aAAa,CAAA;CAC3B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,aAAa,CAAA;gBAE7C,SAAS,EAAE,oBAAoB;IAe3C,MAAM,CAAC,yBAAyB,CAC9B,aAAa,EAAE,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,EACnD,UAAU,CAAC,EAAE,MAAM;IAKrB,MAAM,CACJ,IAAI,EAAE,SAAS,CAAC,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAI3C,MAAM,CACJ,QAAQ,EACJ,SAAS,CAAC,qBAAqB,GAC/B,SAAS,CAAC,qBAAqB,EAAE,GACpC,OAAO,CAAC,IAAI,CAAC;IAIhB,uBAAuB,CACrB,QAAQ,EAAE,SAAS,CAAC,kBAAkB,GACrC,OAAO,CAAC,MAAM,CAAC;IAIlB,qBAAqB,CACnB,QAAQ,EAAE,SAAS,CAAC,gCAAgC,GACnD,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAkB3C,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI5E,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIpE,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,uBAAuB,GAAG,OAAO,CAAC;QACpE,WAAW,EAAE,QAAQ,CAAA;QACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAA;QACjD,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,EAAE,MAAM,CAAA;KAChB,CAAC;CAGH"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@acmekit/framework/utils");
|
|
4
|
+
const _types_1 = require("../types");
|
|
5
|
+
class FileProviderService {
|
|
6
|
+
constructor(container) {
|
|
7
|
+
const fileProviderKeys = Object.keys(container).filter((k) => k.startsWith(_types_1.FileProviderRegistrationPrefix));
|
|
8
|
+
if (fileProviderKeys.length !== 1) {
|
|
9
|
+
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, `File module should be initialized with exactly one provider`);
|
|
10
|
+
}
|
|
11
|
+
this.fileProvider_ = container[fileProviderKeys[0]];
|
|
12
|
+
}
|
|
13
|
+
static getRegistrationIdentifier(providerClass, optionName) {
|
|
14
|
+
return `${providerClass.identifier}_${optionName}`;
|
|
15
|
+
}
|
|
16
|
+
upload(file) {
|
|
17
|
+
return this.fileProvider_.upload(file);
|
|
18
|
+
}
|
|
19
|
+
delete(fileData) {
|
|
20
|
+
return this.fileProvider_.delete(fileData);
|
|
21
|
+
}
|
|
22
|
+
getPresignedDownloadUrl(fileData) {
|
|
23
|
+
return this.fileProvider_.getPresignedDownloadUrl(fileData);
|
|
24
|
+
}
|
|
25
|
+
getPresignedUploadUrl(fileData) {
|
|
26
|
+
if (!this.fileProvider_.getPresignedUploadUrl) {
|
|
27
|
+
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "Provider does not support presigned upload URLs");
|
|
28
|
+
}
|
|
29
|
+
if (!fileData.filename) {
|
|
30
|
+
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "File name is required to get a presigned upload URL");
|
|
31
|
+
}
|
|
32
|
+
return this.fileProvider_.getPresignedUploadUrl(fileData);
|
|
33
|
+
}
|
|
34
|
+
getDownloadStream(fileData) {
|
|
35
|
+
return this.fileProvider_.getDownloadStream(fileData);
|
|
36
|
+
}
|
|
37
|
+
getAsBuffer(fileData) {
|
|
38
|
+
return this.fileProvider_.getAsBuffer(fileData);
|
|
39
|
+
}
|
|
40
|
+
getUploadStream(fileData) {
|
|
41
|
+
return this.fileProvider_.getUploadStream(fileData);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = FileProviderService;
|
|
45
|
+
//# sourceMappingURL=file-provider-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-provider-service.js","sourceRoot":"","sources":["../../src/services/file-provider-service.ts"],"names":[],"mappings":";;AACA,oDAAuD;AACvD,mCAAuD;AASvD,MAAqB,mBAAmB;IAGtC,YAAY,SAA+B;QACzC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3D,CAAC,CAAC,UAAU,CAAC,uCAA8B,CAAC,CAC7C,CAAA;QAED,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,oBAAY,CACpB,oBAAY,CAAC,KAAK,CAAC,YAAY,EAC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C;QAMzD,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;IACrD,CAAC;CACF;AAjFD,sCAiFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FileProviderService = exports.FileModuleService = void 0;
|
|
7
|
+
var file_module_service_1 = require("./file-module-service");
|
|
8
|
+
Object.defineProperty(exports, "FileModuleService", { enumerable: true, get: function () { return __importDefault(file_module_service_1).default; } });
|
|
9
|
+
var file_provider_service_1 = require("./file-provider-service");
|
|
10
|
+
Object.defineProperty(exports, "FileProviderService", { enumerable: true, get: function () { return __importDefault(file_provider_service_1).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAoE;AAA3D,yIAAA,OAAO,OAAqB;AACrC,iEAAwE;AAA/D,6IAAA,OAAO,OAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/joiner-config.ts","../src/loaders/providers.ts","../src/services/file-module-service.ts","../src/services/file-provider-service.ts","../src/services/index.ts","../src/services/__tests__/file.spec.ts","../src/types/index.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ModuleProviderExports, ModuleServiceInitializeOptions } from "@acmekit/framework/types";
|
|
2
|
+
export declare const FileProviderIdentifierRegistrationName = "file_providers_identifier";
|
|
3
|
+
export declare const FileProviderRegistrationPrefix = "fs_";
|
|
4
|
+
export type FileModuleOptions = Partial<ModuleServiceInitializeOptions> & {
|
|
5
|
+
/**
|
|
6
|
+
* Providers to be registered
|
|
7
|
+
*/
|
|
8
|
+
provider?: {
|
|
9
|
+
/**
|
|
10
|
+
* The module provider to be registered
|
|
11
|
+
*/
|
|
12
|
+
resolve: string | ModuleProviderExports;
|
|
13
|
+
/**
|
|
14
|
+
* The id of the provider
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* key value pair of the configuration to be passed to the provider constructor
|
|
19
|
+
*/
|
|
20
|
+
options?: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
declare module "@acmekit/types" {
|
|
24
|
+
interface ModuleOptions {
|
|
25
|
+
"@acmekit/file": FileModuleOptions;
|
|
26
|
+
"@acmekit/acmekit/file": FileModuleOptions;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC/B,MAAM,0BAA0B,CAAA;AAEjC,eAAO,MAAM,sCAAsC,8BACtB,CAAA;AAE7B,eAAO,MAAM,8BAA8B,QAAQ,CAAA;AAEnD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,8BAA8B,CAAC,GAAG;IACxE;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAAA;QACvC;;WAEG;QACH,EAAE,EAAE,MAAM,CAAA;QACV;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAClC,CAAA;CACF,CAAA;AAED,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,aAAa;QACrB,eAAe,EAAE,iBAAiB,CAAA;QAClC,uBAAuB,EAAE,iBAAiB,CAAA;KAC3C;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileProviderRegistrationPrefix = exports.FileProviderIdentifierRegistrationName = void 0;
|
|
4
|
+
exports.FileProviderIdentifierRegistrationName = "file_providers_identifier";
|
|
5
|
+
exports.FileProviderRegistrationPrefix = "fs_";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAKa,QAAA,sCAAsC,GACjD,2BAA2B,CAAA;AAEhB,QAAA,8BAA8B,GAAG,KAAK,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acmekit/file",
|
|
3
|
+
"version": "2.13.1",
|
|
4
|
+
"description": "AcmeKit File module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/__tests__",
|
|
10
|
+
"!dist/**/__mocks__",
|
|
11
|
+
"!dist/**/__fixtures__"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/acmekit/acmekit",
|
|
19
|
+
"directory": "packages/modules/file"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"author": "AcmeKit",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"watch": "yarn run -T tsc --build --watch",
|
|
28
|
+
"watch:test": "yarn run -T tsc --build tsconfig.spec.json --watch",
|
|
29
|
+
"resolve:aliases": "yarn run -T tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && yarn run -T tsc-alias -p tsconfig.resolved.json && yarn run -T rimraf tsconfig.resolved.json",
|
|
30
|
+
"build": "yarn run -T rimraf dist && yarn run -T tsc --build && npm run resolve:aliases",
|
|
31
|
+
"test": "../../../node_modules/.bin/jest --passWithNoTests --bail --forceExit --testPathPattern=src",
|
|
32
|
+
"test:integration": "../../../node_modules/.bin/jest --passWithNoTests --forceExit --testPathPattern=\"integration-tests/__tests__/.*\\.ts\"",
|
|
33
|
+
"migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true acmekit-mikro-orm migration:create --initial",
|
|
34
|
+
"migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true acmekit-mikro-orm migration:create",
|
|
35
|
+
"migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true acmekit-mikro-orm migration:up",
|
|
36
|
+
"orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true acmekit-mikro-orm cache:clear"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@acmekit/framework": "2.13.1",
|
|
40
|
+
"@acmekit/test-utils": "2.13.1"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@acmekit/framework": "2.13.1"
|
|
44
|
+
}
|
|
45
|
+
}
|