@venturialstd/file-system 0.0.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 +127 -0
- package/dist/constants/file-system-entity.constant.d.ts +13 -0
- package/dist/constants/file-system-entity.constant.d.ts.map +1 -0
- package/dist/constants/file-system-entity.constant.js +16 -0
- package/dist/constants/file-system-entity.constant.js.map +1 -0
- package/dist/constants/file-system-error.constant.d.ts +25 -0
- package/dist/constants/file-system-error.constant.d.ts.map +1 -0
- package/dist/constants/file-system-error.constant.js +29 -0
- package/dist/constants/file-system-error.constant.js.map +1 -0
- package/dist/constants/file-system-message.constant.d.ts +16 -0
- package/dist/constants/file-system-message.constant.d.ts.map +1 -0
- package/dist/constants/file-system-message.constant.js +19 -0
- package/dist/constants/file-system-message.constant.js.map +1 -0
- package/dist/constants/file-system-provider.constant.d.ts +12 -0
- package/dist/constants/file-system-provider.constant.d.ts.map +1 -0
- package/dist/constants/file-system-provider.constant.js +16 -0
- package/dist/constants/file-system-provider.constant.js.map +1 -0
- package/dist/constants/file-system-tree.constant.d.ts +8 -0
- package/dist/constants/file-system-tree.constant.d.ts.map +1 -0
- package/dist/constants/file-system-tree.constant.js +12 -0
- package/dist/constants/file-system-tree.constant.js.map +1 -0
- package/dist/constants/file-system.constant.d.ts +13 -0
- package/dist/constants/file-system.constant.d.ts.map +1 -0
- package/dist/constants/file-system.constant.js +31 -0
- package/dist/constants/file-system.constant.js.map +1 -0
- package/dist/constants/file-system.settings.constants.d.ts +8 -0
- package/dist/constants/file-system.settings.constants.d.ts.map +1 -0
- package/dist/constants/file-system.settings.constants.js +11 -0
- package/dist/constants/file-system.settings.constants.js.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +20 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/entities/file-system-file.entity.d.ts +22 -0
- package/dist/entities/file-system-file.entity.d.ts.map +1 -0
- package/dist/entities/file-system-file.entity.js +108 -0
- package/dist/entities/file-system-file.entity.js.map +1 -0
- package/dist/entities/file-system-folder.entity.d.ts +17 -0
- package/dist/entities/file-system-folder.entity.d.ts.map +1 -0
- package/dist/entities/file-system-folder.entity.js +92 -0
- package/dist/entities/file-system-folder.entity.js.map +1 -0
- package/dist/errors/file-system-not-found.error.d.ts +6 -0
- package/dist/errors/file-system-not-found.error.d.ts.map +1 -0
- package/dist/errors/file-system-not-found.error.js +17 -0
- package/dist/errors/file-system-not-found.error.js.map +1 -0
- package/dist/errors/file-system-not-supported.error.d.ts +6 -0
- package/dist/errors/file-system-not-supported.error.d.ts.map +1 -0
- package/dist/errors/file-system-not-supported.error.js +17 -0
- package/dist/errors/file-system-not-supported.error.js.map +1 -0
- package/dist/errors/file-system-permission-denied.error.d.ts +6 -0
- package/dist/errors/file-system-permission-denied.error.d.ts.map +1 -0
- package/dist/errors/file-system-permission-denied.error.js +17 -0
- package/dist/errors/file-system-permission-denied.error.js.map +1 -0
- package/dist/errors/file-system-rate-limit.error.d.ts +6 -0
- package/dist/errors/file-system-rate-limit.error.d.ts.map +1 -0
- package/dist/errors/file-system-rate-limit.error.js +17 -0
- package/dist/errors/file-system-rate-limit.error.js.map +1 -0
- package/dist/errors/file-system.error.d.ts +10 -0
- package/dist/errors/file-system.error.d.ts.map +1 -0
- package/dist/errors/file-system.error.js +19 -0
- package/dist/errors/file-system.error.js.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +14 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/file-system.module.d.ts +10 -0
- package/dist/file-system.module.d.ts.map +1 -0
- package/dist/file-system.module.js +68 -0
- package/dist/file-system.module.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/backblaze-file-system-provider-options.interface.d.ts +9 -0
- package/dist/interfaces/backblaze-file-system-provider-options.interface.d.ts.map +1 -0
- package/dist/interfaces/backblaze-file-system-provider-options.interface.js +3 -0
- package/dist/interfaces/backblaze-file-system-provider-options.interface.js.map +1 -0
- package/dist/interfaces/file-system-backblaze-config.interface.d.ts +11 -0
- package/dist/interfaces/file-system-backblaze-config.interface.d.ts.map +1 -0
- package/dist/interfaces/file-system-backblaze-config.interface.js +3 -0
- package/dist/interfaces/file-system-backblaze-config.interface.js.map +1 -0
- package/dist/interfaces/file-system-module-options.interface.d.ts +9 -0
- package/dist/interfaces/file-system-module-options.interface.d.ts.map +1 -0
- package/dist/interfaces/file-system-module-options.interface.js +3 -0
- package/dist/interfaces/file-system-module-options.interface.js.map +1 -0
- package/dist/interfaces/file-system-provider.interface.d.ts +67 -0
- package/dist/interfaces/file-system-provider.interface.d.ts.map +1 -0
- package/dist/interfaces/file-system-provider.interface.js +3 -0
- package/dist/interfaces/file-system-provider.interface.js.map +1 -0
- package/dist/interfaces/file-system-tree-node.interface.d.ts +16 -0
- package/dist/interfaces/file-system-tree-node.interface.d.ts.map +1 -0
- package/dist/interfaces/file-system-tree-node.interface.js +3 -0
- package/dist/interfaces/file-system-tree-node.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +6 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +3 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/providers/backblaze-file-system.provider.d.ts +31 -0
- package/dist/providers/backblaze-file-system.provider.d.ts.map +1 -0
- package/dist/providers/backblaze-file-system.provider.js +160 -0
- package/dist/providers/backblaze-file-system.provider.js.map +1 -0
- package/dist/services/file-system.service.d.ts +52 -0
- package/dist/services/file-system.service.d.ts.map +1 -0
- package/dist/services/file-system.service.js +268 -0
- package/dist/services/file-system.service.js.map +1 -0
- package/dist/settings/file-system.settings.d.ts +5 -0
- package/dist/settings/file-system.settings.d.ts.map +1 -0
- package/dist/settings/file-system.settings.js +36 -0
- package/dist/settings/file-system.settings.js.map +1 -0
- package/dist/types/file-metadata.type.d.ts +12 -0
- package/dist/types/file-metadata.type.d.ts.map +1 -0
- package/dist/types/file-metadata.type.js +3 -0
- package/dist/types/file-metadata.type.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/list-options.type.d.ts +10 -0
- package/dist/types/list-options.type.d.ts.map +1 -0
- package/dist/types/list-options.type.js +3 -0
- package/dist/types/list-options.type.js.map +1 -0
- package/dist/types/list-result-entry.type.d.ts +9 -0
- package/dist/types/list-result-entry.type.d.ts.map +1 -0
- package/dist/types/list-result-entry.type.js +3 -0
- package/dist/types/list-result-entry.type.js.map +1 -0
- package/dist/types/list-result.type.d.ts +10 -0
- package/dist/types/list-result.type.d.ts.map +1 -0
- package/dist/types/list-result.type.js +3 -0
- package/dist/types/list-result.type.js.map +1 -0
- package/dist/types/signed-url-result.type.d.ts +9 -0
- package/dist/types/signed-url-result.type.d.ts.map +1 -0
- package/dist/types/signed-url-result.type.js +3 -0
- package/dist/types/signed-url-result.type.js.map +1 -0
- package/dist/types/upload-options.type.d.ts +12 -0
- package/dist/types/upload-options.type.d.ts.map +1 -0
- package/dist/types/upload-options.type.js +3 -0
- package/dist/types/upload-options.type.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FileSystemFile } from './file-system-file.entity';
|
|
2
|
+
export declare class FileSystemFolder {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string | null;
|
|
6
|
+
path: string | null;
|
|
7
|
+
parent: FileSystemFolder | null;
|
|
8
|
+
parentId: string | null;
|
|
9
|
+
children: FileSystemFolder[];
|
|
10
|
+
files: FileSystemFile[];
|
|
11
|
+
isRoot: boolean;
|
|
12
|
+
ownerId: string | null;
|
|
13
|
+
metadata: Record<string, unknown>;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=file-system-folder.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-folder.entity.d.ts","sourceRoot":"","sources":["../../src/entities/file-system-folder.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAMa,gBAAgB;IAE3B,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAGhC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAG7B,KAAK,EAAE,cAAc,EAAE,CAAC;IAGxB,MAAM,EAAE,OAAO,CAAC;IAGhB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGlC,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FileSystemFolder = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
15
|
+
const file_system_file_entity_1 = require("./file-system-file.entity");
|
|
16
|
+
let FileSystemFolder = class FileSystemFolder {
|
|
17
|
+
id;
|
|
18
|
+
name;
|
|
19
|
+
description;
|
|
20
|
+
path;
|
|
21
|
+
parent;
|
|
22
|
+
parentId;
|
|
23
|
+
children;
|
|
24
|
+
files;
|
|
25
|
+
isRoot;
|
|
26
|
+
ownerId;
|
|
27
|
+
metadata;
|
|
28
|
+
createdAt;
|
|
29
|
+
updatedAt;
|
|
30
|
+
};
|
|
31
|
+
exports.FileSystemFolder = FileSystemFolder;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], FileSystemFolder.prototype, "id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], FileSystemFolder.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], FileSystemFolder.prototype, "description", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 512, nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], FileSystemFolder.prototype, "path", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.TreeParent)(),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], FileSystemFolder.prototype, "parent", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], FileSystemFolder.prototype, "parentId", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.TreeChildren)(),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], FileSystemFolder.prototype, "children", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.OneToMany)(() => file_system_file_entity_1.FileSystemFile, (file) => file.folder),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], FileSystemFolder.prototype, "files", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], FileSystemFolder.prototype, "isRoot", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], FileSystemFolder.prototype, "ownerId", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true, default: {} }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], FileSystemFolder.prototype, "metadata", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'createdAt', type: 'timestamptz' }),
|
|
78
|
+
__metadata("design:type", Date)
|
|
79
|
+
], FileSystemFolder.prototype, "createdAt", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updatedAt', type: 'timestamptz' }),
|
|
82
|
+
__metadata("design:type", Date)
|
|
83
|
+
], FileSystemFolder.prototype, "updatedAt", void 0);
|
|
84
|
+
exports.FileSystemFolder = FileSystemFolder = __decorate([
|
|
85
|
+
(0, typeorm_1.Entity)(constants_1.FILE_SYSTEM_ENTITY_TABLES.FOLDER),
|
|
86
|
+
(0, typeorm_1.Tree)('closure-table', {
|
|
87
|
+
closureTableName: constants_1.FILE_SYSTEM_ENTITY_TABLES.FOLDER_CLOSURE,
|
|
88
|
+
ancestorColumnName: (c) => 'ancestor_' + c.propertyName,
|
|
89
|
+
descendantColumnName: (c) => 'descendant_' + c.propertyName,
|
|
90
|
+
})
|
|
91
|
+
], FileSystemFolder);
|
|
92
|
+
//# sourceMappingURL=file-system-folder.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-folder.entity.js","sourceRoot":"","sources":["../../src/entities/file-system-folder.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAUiB;AAEjB,4CAAuF;AACvF,uEAA2D;AAQpD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAE3B,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,WAAW,CAAgB;IAG3B,IAAI,CAAgB;IAGpB,MAAM,CAA0B;IAGhC,QAAQ,CAAgB;IAGxB,QAAQ,CAAqB;IAG7B,KAAK,CAAmB;IAGxB,MAAM,CAAU;IAGhB,OAAO,CAAgB;IAGvB,QAAQ,CAA0B;IAGlC,SAAS,CAAO;IAGhB,SAAS,CAAO;CACjB,CAAA;AAvCY,4CAAgB;AAE3B;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;4CACpB;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;8CAC5B;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACd;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACrC;AAGpB;IADC,IAAA,oBAAU,GAAE;;gDACmB;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACjB;AAGxB;IADC,IAAA,sBAAY,GAAE;;kDACc;AAG7B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;+CAC/B;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDAC5B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAClB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kDACrB;AAGlC;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAClD,IAAI;mDAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAClD,IAAI;mDAAC;2BAtCL,gBAAgB;IAN5B,IAAA,gBAAM,EAAC,qCAAyB,CAAC,MAAM,CAAC;IACxC,IAAA,cAAI,EAAC,eAAe,EAAE;QACrB,gBAAgB,EAAE,qCAAyB,CAAC,cAAc;QAC1D,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,GAAG,CAAC,CAAC,YAAY;QACvD,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,GAAG,CAAC,CAAC,YAAY;KAC5D,CAAC;GACW,gBAAgB,CAuC5B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FileSystemError } from './file-system.error';
|
|
2
|
+
/** Object or path not found (e.g. 404). */
|
|
3
|
+
export declare class FileSystemNotFoundError extends FileSystemError {
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=file-system-not-found.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-not-found.error.d.ts","sourceRoot":"","sources":["../../src/errors/file-system-not-found.error.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,2CAA2C;AAC3C,qBAAa,uBAAwB,SAAQ,eAAe;gBAC9C,OAAO,CAAC,EAAE,MAAM;CAM7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemNotFoundError = void 0;
|
|
4
|
+
const file_system_error_constant_1 = require("../constants/file-system-error.constant");
|
|
5
|
+
const file_system_error_constant_2 = require("../constants/file-system-error.constant");
|
|
6
|
+
const file_system_error_1 = require("./file-system.error");
|
|
7
|
+
/** Object or path not found (e.g. 404). */
|
|
8
|
+
class FileSystemNotFoundError extends file_system_error_1.FileSystemError {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
const msg = message ?? file_system_error_constant_1.FILE_SYSTEM_ERROR_MESSAGES.RESOURCE_NOT_FOUND;
|
|
11
|
+
super(msg, file_system_error_constant_1.FileSystemErrorCode.NOT_FOUND);
|
|
12
|
+
this.name = file_system_error_constant_2.FILE_SYSTEM_ERROR_NAMES.NOT_FOUND;
|
|
13
|
+
Object.setPrototypeOf(this, FileSystemNotFoundError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FileSystemNotFoundError = FileSystemNotFoundError;
|
|
17
|
+
//# sourceMappingURL=file-system-not-found.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-not-found.error.js","sourceRoot":"","sources":["../../src/errors/file-system-not-found.error.ts"],"names":[],"mappings":";;;AAAA,wFAGiD;AACjD,wFAAkF;AAClF,2DAAsD;AAEtD,2CAA2C;AAC3C,MAAa,uBAAwB,SAAQ,mCAAe;IAC1D,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,uDAA0B,CAAC,kBAAkB,CAAC;QACrE,KAAK,CAAC,GAAG,EAAE,gDAAmB,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,oDAAuB,CAAC,SAAS,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;CACF;AAPD,0DAOC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FileSystemError } from './file-system.error';
|
|
2
|
+
/** Operation not supported by the current provider. */
|
|
3
|
+
export declare class FileSystemNotSupportedError extends FileSystemError {
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=file-system-not-supported.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-not-supported.error.d.ts","sourceRoot":"","sources":["../../src/errors/file-system-not-supported.error.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,uDAAuD;AACvD,qBAAa,2BAA4B,SAAQ,eAAe;gBAClD,OAAO,CAAC,EAAE,MAAM;CAM7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemNotSupportedError = void 0;
|
|
4
|
+
const file_system_error_constant_1 = require("../constants/file-system-error.constant");
|
|
5
|
+
const file_system_error_constant_2 = require("../constants/file-system-error.constant");
|
|
6
|
+
const file_system_error_1 = require("./file-system.error");
|
|
7
|
+
/** Operation not supported by the current provider. */
|
|
8
|
+
class FileSystemNotSupportedError extends file_system_error_1.FileSystemError {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
const msg = message ?? file_system_error_constant_1.FILE_SYSTEM_ERROR_MESSAGES.NOT_SUPPORTED;
|
|
11
|
+
super(msg, file_system_error_constant_1.FileSystemErrorCode.NOT_SUPPORTED);
|
|
12
|
+
this.name = file_system_error_constant_2.FILE_SYSTEM_ERROR_NAMES.NOT_SUPPORTED;
|
|
13
|
+
Object.setPrototypeOf(this, FileSystemNotSupportedError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FileSystemNotSupportedError = FileSystemNotSupportedError;
|
|
17
|
+
//# sourceMappingURL=file-system-not-supported.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-not-supported.error.js","sourceRoot":"","sources":["../../src/errors/file-system-not-supported.error.ts"],"names":[],"mappings":";;;AAAA,wFAGiD;AACjD,wFAAkF;AAClF,2DAAsD;AAEtD,uDAAuD;AACvD,MAAa,2BAA4B,SAAQ,mCAAe;IAC9D,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,uDAA0B,CAAC,aAAa,CAAC;QAChE,KAAK,CAAC,GAAG,EAAE,gDAAmB,CAAC,aAAa,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,oDAAuB,CAAC,aAAa,CAAC;QAClD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAPD,kEAOC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FileSystemError } from './file-system.error';
|
|
2
|
+
/** Permission denied or access forbidden. */
|
|
3
|
+
export declare class FileSystemPermissionDeniedError extends FileSystemError {
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=file-system-permission-denied.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-permission-denied.error.d.ts","sourceRoot":"","sources":["../../src/errors/file-system-permission-denied.error.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,6CAA6C;AAC7C,qBAAa,+BAAgC,SAAQ,eAAe;gBACtD,OAAO,CAAC,EAAE,MAAM;CAM7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemPermissionDeniedError = void 0;
|
|
4
|
+
const file_system_error_constant_1 = require("../constants/file-system-error.constant");
|
|
5
|
+
const file_system_error_constant_2 = require("../constants/file-system-error.constant");
|
|
6
|
+
const file_system_error_1 = require("./file-system.error");
|
|
7
|
+
/** Permission denied or access forbidden. */
|
|
8
|
+
class FileSystemPermissionDeniedError extends file_system_error_1.FileSystemError {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
const msg = message ?? file_system_error_constant_1.FILE_SYSTEM_ERROR_MESSAGES.PERMISSION_DENIED;
|
|
11
|
+
super(msg, file_system_error_constant_1.FileSystemErrorCode.PERMISSION_DENIED);
|
|
12
|
+
this.name = file_system_error_constant_2.FILE_SYSTEM_ERROR_NAMES.PERMISSION_DENIED;
|
|
13
|
+
Object.setPrototypeOf(this, FileSystemPermissionDeniedError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FileSystemPermissionDeniedError = FileSystemPermissionDeniedError;
|
|
17
|
+
//# sourceMappingURL=file-system-permission-denied.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-permission-denied.error.js","sourceRoot":"","sources":["../../src/errors/file-system-permission-denied.error.ts"],"names":[],"mappings":";;;AAAA,wFAGiD;AACjD,wFAAkF;AAClF,2DAAsD;AAEtD,6CAA6C;AAC7C,MAAa,+BAAgC,SAAQ,mCAAe;IAClE,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,uDAA0B,CAAC,iBAAiB,CAAC;QACpE,KAAK,CAAC,GAAG,EAAE,gDAAmB,CAAC,iBAAiB,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,oDAAuB,CAAC,iBAAiB,CAAC;QACtD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC;CACF;AAPD,0EAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-rate-limit.error.d.ts","sourceRoot":"","sources":["../../src/errors/file-system-rate-limit.error.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,2BAA2B;AAC3B,qBAAa,wBAAyB,SAAQ,eAAe;gBAC/C,OAAO,CAAC,EAAE,MAAM;CAM7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemRateLimitError = void 0;
|
|
4
|
+
const file_system_error_constant_1 = require("../constants/file-system-error.constant");
|
|
5
|
+
const file_system_error_constant_2 = require("../constants/file-system-error.constant");
|
|
6
|
+
const file_system_error_1 = require("./file-system.error");
|
|
7
|
+
/** Rate limit exceeded. */
|
|
8
|
+
class FileSystemRateLimitError extends file_system_error_1.FileSystemError {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
const msg = message ?? file_system_error_constant_1.FILE_SYSTEM_ERROR_MESSAGES.RATE_LIMIT_EXCEEDED;
|
|
11
|
+
super(msg, file_system_error_constant_1.FileSystemErrorCode.RATE_LIMIT);
|
|
12
|
+
this.name = file_system_error_constant_2.FILE_SYSTEM_ERROR_NAMES.RATE_LIMIT;
|
|
13
|
+
Object.setPrototypeOf(this, FileSystemRateLimitError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FileSystemRateLimitError = FileSystemRateLimitError;
|
|
17
|
+
//# sourceMappingURL=file-system-rate-limit.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-rate-limit.error.js","sourceRoot":"","sources":["../../src/errors/file-system-rate-limit.error.ts"],"names":[],"mappings":";;;AAAA,wFAGiD;AACjD,wFAAkF;AAClF,2DAAsD;AAEtD,2BAA2B;AAC3B,MAAa,wBAAyB,SAAQ,mCAAe;IAC3D,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,uDAA0B,CAAC,mBAAmB,CAAC;QACtE,KAAK,CAAC,GAAG,EAAE,gDAAmB,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,oDAAuB,CAAC,UAAU,CAAC;QAC/C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;CACF;AAPD,4DAOC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileSystemErrorCode } from '../constants/file-system-error.constant';
|
|
2
|
+
/**
|
|
3
|
+
* Base domain error for the file-system module.
|
|
4
|
+
* Provider-specific errors should be mapped to subclasses so consumers can handle them uniformly.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FileSystemError extends Error {
|
|
7
|
+
readonly code: FileSystemErrorCode | string;
|
|
8
|
+
constructor(message: string, code: FileSystemErrorCode | string);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=file-system.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.error.d.ts","sourceRoot":"","sources":["../../src/errors/file-system.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAG9E;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,IAAI,EAAE,mBAAmB,GAAG,MAAM;gBADlD,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,mBAAmB,GAAG,MAAM;CAMrD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemError = void 0;
|
|
4
|
+
const file_system_error_constant_1 = require("../constants/file-system-error.constant");
|
|
5
|
+
/**
|
|
6
|
+
* Base domain error for the file-system module.
|
|
7
|
+
* Provider-specific errors should be mapped to subclasses so consumers can handle them uniformly.
|
|
8
|
+
*/
|
|
9
|
+
class FileSystemError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
constructor(message, code) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.name = file_system_error_constant_1.FILE_SYSTEM_ERROR_NAMES.BASE;
|
|
15
|
+
Object.setPrototypeOf(this, FileSystemError.prototype);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.FileSystemError = FileSystemError;
|
|
19
|
+
//# sourceMappingURL=file-system.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.error.js","sourceRoot":"","sources":["../../src/errors/file-system.error.ts"],"names":[],"mappings":";;;AACA,wFAAkF;AAElF;;;GAGG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAGtB;IAFlB,YACE,OAAe,EACC,IAAkC;QAElD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAA8B;QAGlD,IAAI,CAAC,IAAI,GAAG,oDAAuB,CAAC,IAAI,CAAC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF;AATD,0CASC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { FileSystemError } from './file-system.error';
|
|
2
|
+
export { FileSystemNotFoundError } from './file-system-not-found.error';
|
|
3
|
+
export { FileSystemPermissionDeniedError } from './file-system-permission-denied.error';
|
|
4
|
+
export { FileSystemRateLimitError } from './file-system-rate-limit.error';
|
|
5
|
+
export { FileSystemNotSupportedError } from './file-system-not-supported.error';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSystemNotSupportedError = exports.FileSystemRateLimitError = exports.FileSystemPermissionDeniedError = exports.FileSystemNotFoundError = exports.FileSystemError = void 0;
|
|
4
|
+
var file_system_error_1 = require("./file-system.error");
|
|
5
|
+
Object.defineProperty(exports, "FileSystemError", { enumerable: true, get: function () { return file_system_error_1.FileSystemError; } });
|
|
6
|
+
var file_system_not_found_error_1 = require("./file-system-not-found.error");
|
|
7
|
+
Object.defineProperty(exports, "FileSystemNotFoundError", { enumerable: true, get: function () { return file_system_not_found_error_1.FileSystemNotFoundError; } });
|
|
8
|
+
var file_system_permission_denied_error_1 = require("./file-system-permission-denied.error");
|
|
9
|
+
Object.defineProperty(exports, "FileSystemPermissionDeniedError", { enumerable: true, get: function () { return file_system_permission_denied_error_1.FileSystemPermissionDeniedError; } });
|
|
10
|
+
var file_system_rate_limit_error_1 = require("./file-system-rate-limit.error");
|
|
11
|
+
Object.defineProperty(exports, "FileSystemRateLimitError", { enumerable: true, get: function () { return file_system_rate_limit_error_1.FileSystemRateLimitError; } });
|
|
12
|
+
var file_system_not_supported_error_1 = require("./file-system-not-supported.error");
|
|
13
|
+
Object.defineProperty(exports, "FileSystemNotSupportedError", { enumerable: true, get: function () { return file_system_not_supported_error_1.FileSystemNotSupportedError; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,6FAAwF;AAA/E,sJAAA,+BAA+B,OAAA;AACxC,+EAA0E;AAAjE,wIAAA,wBAAwB,OAAA;AACjC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
export declare class FileSystemModule {
|
|
3
|
+
/**
|
|
4
|
+
* Register the file system module. Provider and bucket name are read from
|
|
5
|
+
* Settings (FILE-SYSTEM / GENERAL / PROVIDER and FILE-SYSTEM / BACKBLAZE / BUCKET_NAME).
|
|
6
|
+
* Credentials continue to come from the Backblaze package configuration.
|
|
7
|
+
*/
|
|
8
|
+
static forRoot(): DynamicModule;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=file-system.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.module.d.ts","sourceRoot":"","sources":["../src/file-system.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAgBvD,qBACa,gBAAgB;IAC3B;;;;OAIG;IACH,MAAM,CAAC,OAAO,IAAI,aAAa;CA+ChC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var FileSystemModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.FileSystemModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
13
|
+
const core_1 = require("@venturialstd/core");
|
|
14
|
+
const backblaze_1 = require("@venturialstd/backblaze");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const file_system_settings_constants_1 = require("./constants/file-system.settings.constants");
|
|
17
|
+
const file_system_file_entity_1 = require("./entities/file-system-file.entity");
|
|
18
|
+
const file_system_folder_entity_1 = require("./entities/file-system-folder.entity");
|
|
19
|
+
const backblaze_file_system_provider_1 = require("./providers/backblaze-file-system.provider");
|
|
20
|
+
const file_system_service_1 = require("./services/file-system.service");
|
|
21
|
+
let FileSystemModule = FileSystemModule_1 = class FileSystemModule {
|
|
22
|
+
/**
|
|
23
|
+
* Register the file system module. Provider and bucket name are read from
|
|
24
|
+
* Settings (FILE-SYSTEM / GENERAL / PROVIDER and FILE-SYSTEM / BACKBLAZE / BUCKET_NAME).
|
|
25
|
+
* Credentials continue to come from the Backblaze package configuration.
|
|
26
|
+
*/
|
|
27
|
+
static forRoot() {
|
|
28
|
+
return {
|
|
29
|
+
module: FileSystemModule_1,
|
|
30
|
+
imports: [
|
|
31
|
+
core_1.SettingsModule,
|
|
32
|
+
backblaze_1.BackblazeModule,
|
|
33
|
+
typeorm_1.TypeOrmModule.forFeature([file_system_file_entity_1.FileSystemFile, file_system_folder_entity_1.FileSystemFolder]),
|
|
34
|
+
],
|
|
35
|
+
providers: [
|
|
36
|
+
{
|
|
37
|
+
provide: backblaze_file_system_provider_1.BackblazeFileSystemProvider,
|
|
38
|
+
useFactory: async (settingsService, objectService) => {
|
|
39
|
+
const provider = await settingsService.get(file_system_settings_constants_1.FILE_SYSTEM_SETTING_KEYS.GENERAL_PROVIDER);
|
|
40
|
+
const bucketName = await settingsService.get(file_system_settings_constants_1.FILE_SYSTEM_SETTING_KEYS.BACKBLAZE_BUCKET_NAME);
|
|
41
|
+
if (provider !== constants_1.FileSystemProviderName.BACKBLAZE) {
|
|
42
|
+
throw new Error(constants_1.FILE_SYSTEM_MESSAGES.UNSUPPORTED_PROVIDER(provider ?? ''));
|
|
43
|
+
}
|
|
44
|
+
if (!bucketName?.trim()) {
|
|
45
|
+
throw new Error(constants_1.FILE_SYSTEM_MESSAGES.BUCKET_NAME_NOT_CONFIGURED);
|
|
46
|
+
}
|
|
47
|
+
const options = {
|
|
48
|
+
bucketName: bucketName.trim(),
|
|
49
|
+
};
|
|
50
|
+
return new backblaze_file_system_provider_1.BackblazeFileSystemProvider(objectService, options);
|
|
51
|
+
},
|
|
52
|
+
inject: [core_1.SettingsService, backblaze_1.BackblazeObjectService],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
provide: constants_1.FILE_SYSTEM_DI_TOKENS.PROVIDER,
|
|
56
|
+
useExisting: backblaze_file_system_provider_1.BackblazeFileSystemProvider,
|
|
57
|
+
},
|
|
58
|
+
file_system_service_1.FileSystemService,
|
|
59
|
+
],
|
|
60
|
+
exports: [file_system_service_1.FileSystemService, constants_1.FILE_SYSTEM_DI_TOKENS.PROVIDER],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.FileSystemModule = FileSystemModule;
|
|
65
|
+
exports.FileSystemModule = FileSystemModule = FileSystemModule_1 = __decorate([
|
|
66
|
+
(0, common_1.Module)({})
|
|
67
|
+
], FileSystemModule);
|
|
68
|
+
//# sourceMappingURL=file-system.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.module.js","sourceRoot":"","sources":["../src/file-system.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,6CAAgD;AAChD,6CAAqE;AACrE,uDAGiC;AAEjC,2CAAkG;AAClG,+FAAsF;AACtF,gFAAoE;AACpE,oFAAwE;AAExE,+FAAyF;AACzF,wEAAmE;AAG5D,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B;;;;OAIG;IACH,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,qBAAc;gBACd,2BAAe;gBACf,uBAAa,CAAC,UAAU,CAAC,CAAC,wCAAc,EAAE,4CAAgB,CAAC,CAAC;aAC7D;YACD,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,4DAA2B;oBACpC,UAAU,EAAE,KAAK,EACf,eAAgC,EAChC,aAAqC,EACC,EAAE;wBACxC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,GAAG,CACxC,yDAAwB,CAAC,gBAAgB,CAC1C,CAAC;wBACF,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,GAAG,CAC1C,yDAAwB,CAAC,qBAAqB,CAC/C,CAAC;wBAEF,IAAI,QAAQ,KAAK,kCAAsB,CAAC,SAAS,EAAE,CAAC;4BAClD,MAAM,IAAI,KAAK,CACb,gCAAoB,CAAC,oBAAoB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAC1D,CAAC;wBACJ,CAAC;wBACD,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;4BACxB,MAAM,IAAI,KAAK,CAAC,gCAAoB,CAAC,0BAA0B,CAAC,CAAC;wBACnE,CAAC;wBAED,MAAM,OAAO,GAAuC;4BAClD,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE;yBAC9B,CAAC;wBACF,OAAO,IAAI,4DAA2B,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;oBACjE,CAAC;oBACD,MAAM,EAAE,CAAC,sBAAe,EAAE,kCAAsB,CAAC;iBAClD;gBACD;oBACE,OAAO,EAAE,iCAAqB,CAAC,QAAQ;oBACvC,WAAW,EAAE,4DAA2B;iBACzC;gBACD,uCAAiB;aAClB;YACD,OAAO,EAAE,CAAC,uCAAiB,EAAE,iCAAqB,CAAC,QAAQ,CAAC;SAC7D,CAAC;IACJ,CAAC;CACF,CAAA;AArDY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CAqD5B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './errors';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './interfaces';
|
|
5
|
+
export * from './entities/file-system-file.entity';
|
|
6
|
+
export * from './entities/file-system-folder.entity';
|
|
7
|
+
export * from './file-system.module';
|
|
8
|
+
export * from './providers/backblaze-file-system.provider';
|
|
9
|
+
export * from './services/file-system.service';
|
|
10
|
+
export { FILE_SYSTEM_SETTINGS, SETTINGS, } from './settings/file-system.settings';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,QAAQ,GACT,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SETTINGS = exports.FILE_SYSTEM_SETTINGS = void 0;
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./errors"), exports);
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
__exportStar(require("./interfaces"), exports);
|
|
22
|
+
__exportStar(require("./entities/file-system-file.entity"), exports);
|
|
23
|
+
__exportStar(require("./entities/file-system-folder.entity"), exports);
|
|
24
|
+
__exportStar(require("./file-system.module"), exports);
|
|
25
|
+
__exportStar(require("./providers/backblaze-file-system.provider"), exports);
|
|
26
|
+
__exportStar(require("./services/file-system.service"), exports);
|
|
27
|
+
var file_system_settings_1 = require("./settings/file-system.settings");
|
|
28
|
+
Object.defineProperty(exports, "FILE_SYSTEM_SETTINGS", { enumerable: true, get: function () { return file_system_settings_1.FILE_SYSTEM_SETTINGS; } });
|
|
29
|
+
Object.defineProperty(exports, "SETTINGS", { enumerable: true, get: function () { return file_system_settings_1.SETTINGS; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B;AAC7B,qEAAmD;AACnD,uEAAqD;AACrD,uDAAqC;AACrC,6EAA2D;AAC3D,iEAA+C;AAC/C,wEAGyC;AAFvC,4HAAA,oBAAoB,OAAA;AACpB,gHAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for BackblazeFileSystemProvider (injected in module).
|
|
3
|
+
* Only bucketName is supplied; credentials and region are always taken from
|
|
4
|
+
* the Backblaze package configuration (Settings), never from here or .env.
|
|
5
|
+
*/
|
|
6
|
+
export interface BackblazeFileSystemProviderOptions {
|
|
7
|
+
bucketName: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=backblaze-file-system-provider-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backblaze-file-system-provider-options.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/backblaze-file-system-provider-options.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backblaze-file-system-provider-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/backblaze-file-system-provider-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backblaze-specific configuration for file-system module.
|
|
3
|
+
* Credentials and region are never taken here; they are inherited from the
|
|
4
|
+
* Backblaze package configuration (Settings / app config). Only the bucket name
|
|
5
|
+
* is required so the file-system knows which bucket to use.
|
|
6
|
+
*/
|
|
7
|
+
export interface FileSystemBackblazeConfig {
|
|
8
|
+
/** B2 bucket name. Credentials and region come from Backblaze package config. */
|
|
9
|
+
bucketName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=file-system-backblaze-config.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-backblaze-config.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/file-system-backblaze-config.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-backblaze-config.interface.js","sourceRoot":"","sources":["../../src/interfaces/file-system-backblaze-config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FileSystemBackblazeConfig } from './file-system-backblaze-config.interface';
|
|
2
|
+
import { FileSystemProviderName } from '../constants/file-system-provider.constant';
|
|
3
|
+
/** Options passed to FileSystemModule.forRoot(). */
|
|
4
|
+
export interface FileSystemModuleOptions {
|
|
5
|
+
/** Currently only FileSystemProviderName.BACKBLAZE ('backblaze') is supported. */
|
|
6
|
+
provider: FileSystemProviderName | `${FileSystemProviderName}`;
|
|
7
|
+
backblaze: FileSystemBackblazeConfig;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=file-system-module-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-module-options.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/file-system-module-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC,kFAAkF;IAClF,QAAQ,EAAE,sBAAsB,GAAG,GAAG,sBAAsB,EAAE,CAAC;IAC/D,SAAS,EAAE,yBAAyB,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-module-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/file-system-module-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { FileMetadata, ListOptions, ListResult, SignedUrlResult, UploadOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Provider-agnostic file storage contract.
|
|
4
|
+
* All storage providers (Backblaze, AWS S3, etc.) must implement this interface.
|
|
5
|
+
*/
|
|
6
|
+
export interface IFileSystemProvider {
|
|
7
|
+
/**
|
|
8
|
+
* Upload content to the given key (path).
|
|
9
|
+
* @param key - Remote path/key for the object
|
|
10
|
+
* @param body - Buffer, Uint8Array, or string
|
|
11
|
+
* @param options - Optional content-type and metadata
|
|
12
|
+
* @throws FileSystemNotFoundError, FileSystemPermissionDeniedError, FileSystemRateLimitError
|
|
13
|
+
*/
|
|
14
|
+
upload(key: string, body: Buffer | Uint8Array | string, options?: UploadOptions): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Download content from the given key.
|
|
17
|
+
* @param key - Remote path/key of the object
|
|
18
|
+
* @returns ArrayBuffer with the object body
|
|
19
|
+
* @throws FileSystemNotFoundError, FileSystemPermissionDeniedError
|
|
20
|
+
*/
|
|
21
|
+
download(key: string): Promise<ArrayBuffer>;
|
|
22
|
+
/**
|
|
23
|
+
* Delete a single object by key. For versioned buckets (e.g. Backblaze B2), pass versionId
|
|
24
|
+
* for permanent deletion.
|
|
25
|
+
* @param key - Remote path/key of the object
|
|
26
|
+
* @param options - Optional versionId (use when provider returns it from exists/head)
|
|
27
|
+
* @throws FileSystemNotFoundError, FileSystemPermissionDeniedError
|
|
28
|
+
*/
|
|
29
|
+
delete(key: string, options?: {
|
|
30
|
+
versionId?: string;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete multiple objects by key. Optional; default implementation may call delete in loop.
|
|
34
|
+
* @param keys - Array of remote path/keys
|
|
35
|
+
*/
|
|
36
|
+
deleteMany?(keys: string[]): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* List objects under a prefix with optional pagination.
|
|
39
|
+
* @param prefix - Prefix (path) to list under
|
|
40
|
+
* @param options - maxKeys, continuationToken, startAfter
|
|
41
|
+
* @returns ListResult with entries and pagination info
|
|
42
|
+
*/
|
|
43
|
+
list(prefix: string, options?: ListOptions): Promise<ListResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Check if an object exists and optionally return its metadata (head).
|
|
46
|
+
* @param key - Remote path/key of the object
|
|
47
|
+
* @returns FileMetadata if exists
|
|
48
|
+
* @throws FileSystemNotFoundError if not found
|
|
49
|
+
*/
|
|
50
|
+
exists(key: string): Promise<FileMetadata>;
|
|
51
|
+
/**
|
|
52
|
+
* Generate a signed URL for downloading (temporary read access).
|
|
53
|
+
* Optional: providers that don't support it may throw FileSystemNotSupportedError.
|
|
54
|
+
* @param key - Remote path/key
|
|
55
|
+
* @param expiresInSeconds - Optional TTL for the URL
|
|
56
|
+
*/
|
|
57
|
+
getSignedDownloadUrl?(key: string, expiresInSeconds?: number): Promise<SignedUrlResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Generate a signed URL (and optional auth token) for uploading.
|
|
60
|
+
* Optional: providers that don't support it may throw FileSystemNotSupportedError.
|
|
61
|
+
* @param key - Remote path/key where the file will be uploaded
|
|
62
|
+
* @param contentType - Optional content type
|
|
63
|
+
* @param expiresInSeconds - Optional TTL
|
|
64
|
+
*/
|
|
65
|
+
getSignedUploadUrl?(key: string, contentType?: string, expiresInSeconds?: number): Promise<SignedUrlResult>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=file-system-provider.interface.d.ts.map
|