@devbro/neko-storage 0.1.0 → 0.1.2

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.
@@ -1,162 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var __async = (__this, __arguments, generator) => {
31
- return new Promise((resolve, reject) => {
32
- var fulfilled = (value) => {
33
- try {
34
- step(generator.next(value));
35
- } catch (e) {
36
- reject(e);
37
- }
38
- };
39
- var rejected = (value) => {
40
- try {
41
- step(generator.throw(value));
42
- } catch (e) {
43
- reject(e);
44
- }
45
- };
46
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
47
- step((generator = generator.apply(__this, __arguments)).next());
48
- });
49
- };
50
- var LocalStorage_exports = {};
51
- __export(LocalStorage_exports, {
52
- LocalStorage: () => LocalStorage
53
- });
54
- module.exports = __toCommonJS(LocalStorage_exports);
55
- var import_stream = __toESM(require("stream"));
56
- var fs = __toESM(require("fs/promises"));
57
- var import_fs = require("fs");
58
- var path = __toESM(require("path"));
59
- var mime = __toESM(require("mime-types"));
60
- var import_Storage = require("./Storage");
61
- const _LocalStorage = class _LocalStorage extends import_Storage.Storage {
62
- constructor(config) {
63
- super(config);
64
- if (!_LocalStorage.canHandle(config)) {
65
- throw new Error(`storage engine cannot handle this config.`);
66
- }
67
- fs.mkdir(this.config.basePath, {
68
- recursive: true
69
- }).catch((error) => {
70
- throw error;
71
- });
72
- }
73
- metadata(path2) {
74
- return __async(this, null, function* () {
75
- const fullPath = this.getFullPath(path2);
76
- const stats = yield fs.stat(fullPath);
77
- return {
78
- size: stats.size,
79
- mimeType: mime.lookup(fullPath) || "unknown",
80
- lastModifiedDate: stats.mtime.toISOString()
81
- };
82
- });
83
- }
84
- static canHandle(config) {
85
- if (config.engine === "local") {
86
- return true;
87
- }
88
- return false;
89
- }
90
- getFullPath(filePath) {
91
- return path.join(this.config.basePath, filePath);
92
- }
93
- exists(path2) {
94
- return __async(this, null, function* () {
95
- try {
96
- yield fs.access(this.getFullPath(path2));
97
- return true;
98
- } catch (e) {
99
- return false;
100
- }
101
- });
102
- }
103
- put(path2, content) {
104
- return __async(this, null, function* () {
105
- const fullPath = this.getFullPath(path2);
106
- if (typeof content === "string" || content instanceof Buffer) {
107
- yield fs.writeFile(fullPath, content);
108
- } else if (typeof content === "object" && !(content instanceof import_stream.default)) {
109
- yield fs.writeFile(fullPath, JSON.stringify(content, null, 2));
110
- } else if (typeof content === "object" && content instanceof import_stream.default) {
111
- const writeStream = (0, import_fs.createWriteStream)(fullPath);
112
- yield new Promise((resolve, reject) => {
113
- content.pipe(writeStream);
114
- content.on("end", resolve);
115
- content.on("error", reject);
116
- });
117
- } else {
118
- throw new Error("Unsupported content type");
119
- }
120
- return true;
121
- });
122
- }
123
- getJson(path2) {
124
- return __async(this, null, function* () {
125
- const fullPath = this.getFullPath(path2);
126
- const content = yield fs.readFile(fullPath, "utf-8");
127
- return JSON.parse(content);
128
- });
129
- }
130
- getString(path2, encoding = "utf-8") {
131
- return __async(this, null, function* () {
132
- const fullPath = this.getFullPath(path2);
133
- return yield fs.readFile(fullPath, encoding);
134
- });
135
- }
136
- getBuffer(path2) {
137
- return __async(this, null, function* () {
138
- const fullPath = this.getFullPath(path2);
139
- return yield fs.readFile(fullPath);
140
- });
141
- }
142
- getStream(path2) {
143
- return __async(this, null, function* () {
144
- const fullPath = this.getFullPath(path2);
145
- return (0, import_fs.createReadStream)(fullPath);
146
- });
147
- }
148
- delete(path2) {
149
- return __async(this, null, function* () {
150
- const fullPath = this.getFullPath(path2);
151
- yield fs.unlink(fullPath);
152
- return true;
153
- });
154
- }
155
- };
156
- __name(_LocalStorage, "LocalStorage");
157
- let LocalStorage = _LocalStorage;
158
- // Annotate the CommonJS export names for ESM import in node:
159
- 0 && (module.exports = {
160
- LocalStorage
161
- });
162
- //# sourceMappingURL=LocalStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/LocalStorage.ts"],"sourcesContent":["import Stream from 'stream';\nimport * as fs from 'fs/promises';\nimport { createWriteStream, createReadStream, ReadStream } from 'fs';\nimport * as path from 'path';\nimport * as mime from 'mime-types';\nimport { Metadata, StorageConfig } from './types';\nimport { Storage } from './Storage';\n\nexport class LocalStorage extends Storage {\n constructor(config: StorageConfig) {\n super(config);\n\n if (!LocalStorage.canHandle(config)) {\n throw new Error(`storage engine cannot handle this config.`);\n }\n // Ensure the base folder exists\n fs.mkdir(this.config.basePath, { recursive: true }).catch((error) => {\n throw error;\n });\n }\n\n async metadata(path: string): Promise<Metadata> {\n const fullPath = this.getFullPath(path);\n const stats = await fs.stat(fullPath);\n return {\n size: stats.size,\n mimeType: mime.lookup(fullPath) || 'unknown',\n lastModifiedDate: stats.mtime.toISOString(),\n };\n }\n\n static canHandle(config: StorageConfig) {\n if (config.engine === 'local') {\n return true;\n }\n return false;\n }\n\n getFullPath(filePath: string) {\n return path.join(this.config.basePath, filePath);\n }\n\n async exists(path: string): Promise<boolean> {\n try {\n await fs.access(this.getFullPath(path));\n return true;\n } catch {\n return false;\n }\n }\n\n async put(path: string, content: string | object | Stream | Buffer): Promise<boolean> {\n const fullPath = this.getFullPath(path);\n\n if (typeof content === 'string' || content instanceof Buffer) {\n await fs.writeFile(fullPath, content);\n } else if (typeof content === 'object' && !(content instanceof Stream)) {\n await fs.writeFile(fullPath, JSON.stringify(content, null, 2));\n } else if (typeof content === 'object' && content instanceof Stream) {\n const writeStream = createWriteStream(fullPath);\n await new Promise((resolve, reject) => {\n (content as Stream).pipe(writeStream);\n (content as Stream).on('end', resolve);\n (content as Stream).on('error', reject);\n });\n } else {\n throw new Error('Unsupported content type');\n }\n\n return true;\n }\n\n async getJson(path: string): Promise<object> {\n const fullPath = this.getFullPath(path);\n const content = await fs.readFile(fullPath, 'utf-8');\n return JSON.parse(content);\n }\n\n async getString(path: string, encoding: BufferEncoding = 'utf-8'): Promise<string> {\n const fullPath = this.getFullPath(path);\n return await fs.readFile(fullPath, encoding);\n }\n\n async getBuffer(path: string): Promise<Buffer> {\n const fullPath = this.getFullPath(path);\n return await fs.readFile(fullPath);\n }\n\n async getStream(path: string): Promise<ReadStream> {\n const fullPath = this.getFullPath(path);\n return createReadStream(fullPath);\n }\n\n async delete(path: string): Promise<boolean> {\n const fullPath = this.getFullPath(path);\n await fs.unlink(fullPath);\n return true;\n }\n}\n"],"mappings":"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","names":["LocalStorage","Storage","config","canHandle","Error","fs","mkdir","basePath","recursive","catch","error","metadata","path","fullPath","getFullPath","stats","stat","size","mimeType","mime","lookup","lastModifiedDate","mtime","toISOString","engine","filePath","join","exists","access","put","content","Buffer","writeFile","Stream","JSON","stringify","writeStream","createWriteStream","Promise","resolve","reject","pipe","on","getJson","readFile","parse","getString","encoding","getBuffer","getStream","createReadStream","delete","unlink"]}
package/dist/Storage.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import { ReadStream } from 'fs';
2
- import { Stream } from 'stream';
3
- import { StorageConfig, Metadata } from './types.js';
4
- import '@aws-sdk/client-s3';
5
-
6
- declare abstract class Storage {
7
- protected config: StorageConfig;
8
- constructor(config: StorageConfig);
9
- static canHandle(config: StorageConfig): boolean;
10
- abstract exists(path: string): Promise<boolean>;
11
- abstract put(path: string, content: string | object | Stream | Buffer): Promise<boolean>;
12
- abstract getJson(path: string): Promise<object>;
13
- abstract getString(path: string): Promise<string>;
14
- abstract getBuffer(path: string): Promise<Buffer>;
15
- abstract getStream(path: string): Promise<ReadStream>;
16
- abstract delete(path: string): Promise<boolean>;
17
- abstract metadata(path: string): Promise<Metadata>;
18
- }
19
-
20
- export { Storage };
package/dist/Storage.js DELETED
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
- var Storage_exports = {};
23
- __export(Storage_exports, {
24
- Storage: () => Storage
25
- });
26
- module.exports = __toCommonJS(Storage_exports);
27
- const _Storage = class _Storage {
28
- constructor(config) {
29
- __publicField(this, "config");
30
- this.config = config;
31
- }
32
- static canHandle(config) {
33
- throw new Error("Method not implemented.");
34
- }
35
- };
36
- __name(_Storage, "Storage");
37
- let Storage = _Storage;
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- Storage
41
- });
42
- //# sourceMappingURL=Storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Storage.ts"],"sourcesContent":["import { ReadStream } from 'fs';\nimport { Stream } from 'stream';\nimport { Metadata } from './types';\nimport { StorageConfig } from './types';\n\nexport abstract class Storage {\n constructor(protected config: StorageConfig) {}\n\n static canHandle(config: StorageConfig): boolean {\n throw new Error('Method not implemented.');\n }\n\n abstract exists(path: string): Promise<boolean>;\n abstract put(path: string, content: string | object | Stream | Buffer): Promise<boolean>;\n abstract getJson(path: string): Promise<object>;\n abstract getString(path: string): Promise<string>;\n abstract getBuffer(path: string): Promise<Buffer>;\n abstract getStream(path: string): Promise<ReadStream>;\n abstract delete(path: string): Promise<boolean>;\n abstract metadata(path: string): Promise<Metadata>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAO,MAAeA,WAAf,MAAeA,SAAAA;EACpB,YAAsBC,QAAuB;;SAAvBA,SAAAA;EAAwB;EAE9C,OAAOC,UAAUD,QAAgC;AAC/C,UAAM,IAAIE,MAAM,yBAAA;EAClB;AAUF;AAfsBH;AAAf,IAAeA,UAAf;","names":["Storage","config","canHandle","Error"]}
@@ -1,13 +0,0 @@
1
- import { Storage } from './Storage.js';
2
- import { StorageConfig } from './types.js';
3
- import 'fs';
4
- import 'stream';
5
- import '@aws-sdk/client-s3';
6
-
7
- declare class StorageFactory {
8
- static storageEngines: (typeof Storage)[];
9
- registerStorageEngine(engine: typeof Storage): void;
10
- static create(config: StorageConfig): Storage;
11
- }
12
-
13
- export { StorageFactory };
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
- var StorageFactory_exports = {};
23
- __export(StorageFactory_exports, {
24
- StorageFactory: () => StorageFactory
25
- });
26
- module.exports = __toCommonJS(StorageFactory_exports);
27
- var import_AWSS3Storage = require("./AWSS3Storage");
28
- var import_LocalStorage = require("./LocalStorage");
29
- const _StorageFactory = class _StorageFactory {
30
- registerStorageEngine(engine) {
31
- _StorageFactory.storageEngines.push(engine);
32
- }
33
- static create(config) {
34
- for (const engine of _StorageFactory.storageEngines) {
35
- if (engine.canHandle(config)) {
36
- return new engine(config);
37
- }
38
- }
39
- throw new Error("No matchin storage engine found");
40
- }
41
- };
42
- __name(_StorageFactory, "StorageFactory");
43
- __publicField(_StorageFactory, "storageEngines", [
44
- import_LocalStorage.LocalStorage,
45
- import_AWSS3Storage.AWSS3Storage
46
- ]);
47
- let StorageFactory = _StorageFactory;
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- StorageFactory
51
- });
52
- //# sourceMappingURL=StorageFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/StorageFactory.ts"],"sourcesContent":["import { AWSS3Storage } from './AWSS3Storage';\nimport { LocalStorage } from './LocalStorage';\nimport { Storage } from './Storage';\nimport { StorageConfig } from './types';\n\nexport class StorageFactory {\n public static storageEngines: (typeof Storage)[] = [LocalStorage, AWSS3Storage];\n\n registerStorageEngine(engine: typeof Storage) {\n StorageFactory.storageEngines.push(engine);\n }\n\n public static create(config: StorageConfig): Storage {\n for (const engine of StorageFactory.storageEngines) {\n if (engine.canHandle(config)) {\n // @ts-ignore\n return new engine(config);\n }\n }\n throw new Error('No matchin storage engine found');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,0BAA6B;AAC7B,0BAA6B;AAItB,MAAMA,kBAAN,MAAMA,gBAAAA;EAGXC,sBAAsBC,QAAwB;AAC5CF,oBAAeG,eAAeC,KAAKF,MAAAA;EACrC;EAEA,OAAcG,OAAOC,QAAgC;AACnD,eAAWJ,UAAUF,gBAAeG,gBAAgB;AAClD,UAAID,OAAOK,UAAUD,MAAAA,GAAS;AAE5B,eAAO,IAAIJ,OAAOI,MAAAA;MACpB;IACF;AACA,UAAM,IAAIE,MAAM,iCAAA;EAClB;AACF;AAhBaR;AACX,cADWA,iBACGG,kBAAqC;EAACM;EAAcC;;AAD7D,IAAMV,iBAAN;","names":["StorageFactory","registerStorageEngine","engine","storageEngines","push","create","config","canHandle","Error","LocalStorage","AWSS3Storage"]}
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { Metadata, StorageConfig } from './types.js';
2
- export { Storage } from './Storage.js';
3
- export { AWSS3Storage } from './AWSS3Storage.js';
4
- export { LocalStorage } from './LocalStorage.js';
5
- export { StorageFactory } from './StorageFactory.js';
6
- import '@aws-sdk/client-s3';
7
- import 'fs';
8
- import 'stream';
package/dist/types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { S3ClientConfig } from '@aws-sdk/client-s3';
2
-
3
- type Metadata = {
4
- size: number;
5
- mimeType: string;
6
- lastModifiedDate: string;
7
- };
8
- type StorageConfig = {
9
- engine: string;
10
- basePath: string;
11
- bucket?: string;
12
- s3Config?: S3ClientConfig;
13
- };
14
-
15
- export type { Metadata, StorageConfig };
package/dist/types.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
17
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import { S3ClientConfig } from '@aws-sdk/client-s3';\n\nexport type Metadata = {\n size: number;\n mimeType: string;\n lastModifiedDate: string;\n};\n\nexport type StorageConfig = {\n engine: string;\n basePath: string;\n bucket?: string;\n s3Config?: S3ClientConfig;\n};\n"],"mappings":";;;;;;;;;;;;;;AAQA;;","names":[]}