@ostro/filesystem 1.0.4 → 2.0.0-alpha.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.
Files changed (66) hide show
  1. package/adapter/CoreAdapter.js +164 -57
  2. package/adapter/CoreAdapter.js.map +1 -0
  3. package/adapter/azure.js +93 -56
  4. package/adapter/azure.js.map +1 -0
  5. package/adapter/local.js +136 -66
  6. package/adapter/local.js.map +1 -0
  7. package/adapter/s3.js +102 -70
  8. package/adapter/s3.js.map +1 -0
  9. package/callbackHandler.js +93 -23
  10. package/callbackHandler.js.map +1 -0
  11. package/clients/azure.js +43 -13
  12. package/clients/azure.js.map +1 -0
  13. package/clients/s3.js +40 -9
  14. package/clients/s3.js.map +1 -0
  15. package/directoryCreateException.js +27 -5
  16. package/directoryCreateException.js.map +1 -0
  17. package/fileDeleteException.js +28 -4
  18. package/fileDeleteException.js.map +1 -0
  19. package/fileNotFoundException.js +27 -5
  20. package/fileNotFoundException.js.map +1 -0
  21. package/fileUploadException.js +28 -5
  22. package/fileUploadException.js.map +1 -0
  23. package/filesystem.js +388 -193
  24. package/filesystem.js.map +1 -0
  25. package/filesystemAdapter.js +134 -52
  26. package/filesystemAdapter.js.map +1 -0
  27. package/filesystemManager.js +140 -57
  28. package/filesystemManager.js.map +1 -0
  29. package/filesystemServiceProvider.js +49 -21
  30. package/filesystemServiceProvider.js.map +1 -0
  31. package/invalidArgumentException.js +26 -4
  32. package/invalidArgumentException.js.map +1 -0
  33. package/package.json +24 -10
  34. package/types/adapter/CoreAdapter.d.ts +139 -0
  35. package/types/adapter/CoreAdapter.d.ts.map +1 -0
  36. package/types/adapter/azure.d.ts +36 -0
  37. package/types/adapter/azure.d.ts.map +1 -0
  38. package/types/adapter/local.d.ts +78 -0
  39. package/types/adapter/local.d.ts.map +1 -0
  40. package/types/adapter/s3.d.ts +36 -0
  41. package/types/adapter/s3.d.ts.map +1 -0
  42. package/types/callbackHandler.d.ts +69 -0
  43. package/types/callbackHandler.d.ts.map +1 -0
  44. package/types/clients/azure.d.ts +32 -0
  45. package/types/clients/azure.d.ts.map +1 -0
  46. package/types/clients/s3.d.ts +27 -0
  47. package/types/clients/s3.d.ts.map +1 -0
  48. package/types/directoryCreateException.d.ts +18 -0
  49. package/types/directoryCreateException.d.ts.map +1 -0
  50. package/types/fileDeleteException.d.ts +19 -0
  51. package/types/fileDeleteException.d.ts.map +1 -0
  52. package/types/fileNotFoundException.d.ts +18 -0
  53. package/types/fileNotFoundException.d.ts.map +1 -0
  54. package/types/fileUploadException.d.ts +18 -0
  55. package/types/fileUploadException.d.ts.map +1 -0
  56. package/types/filesystem.d.ts +300 -0
  57. package/types/filesystem.d.ts.map +1 -0
  58. package/types/filesystemAdapter.d.ts +91 -0
  59. package/types/filesystemAdapter.d.ts.map +1 -0
  60. package/types/filesystemManager.d.ts +93 -0
  61. package/types/filesystemManager.d.ts.map +1 -0
  62. package/types/filesystemServiceProvider.d.ts +40 -0
  63. package/types/filesystemServiceProvider.d.ts.map +1 -0
  64. package/types/invalidArgumentException.d.ts +17 -0
  65. package/types/invalidArgumentException.d.ts.map +1 -0
  66. package/.github/workflows/npm-publish.yml +0 -22
package/package.json CHANGED
@@ -1,21 +1,29 @@
1
1
  {
2
2
  "name": "@ostro/filesystem",
3
- "version": "1.0.4",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "filesystem module for OstroJS",
5
5
  "main": "filesystemManager.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
6
+ "types": "types/filesystemManager.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./types/filesystemManager.d.ts",
10
+ "default": "./filesystemManager.js"
11
+ },
12
+ "./*": {
13
+ "types": "./types/*.d.ts",
14
+ "default": "./*.js"
15
+ }
8
16
  },
9
17
  "dependencies": {
10
- "@ostro/support": "^1.0.11",
11
- "@ostro/contracts": "^1.0.2",
12
- "fs-extra": "^10.0.0",
13
- "lodash.get": "^4.4.2",
18
+ "@ostro/contracts": "^2.0.0-alpha.2",
19
+ "@ostro/support": "^2.0.0-alpha.2",
14
20
  "filehound": "^1.17.4",
15
- "uuid": "^8.3.2"
21
+ "fs-extra": "^11.4.1",
22
+ "lodash.get": "^4.4.2",
23
+ "uuid": "^11.1.1"
16
24
  },
17
25
  "engines": {
18
- "node": ">=12.0.0"
26
+ "node": ">=18.0.0"
19
27
  },
20
28
  "engineStrict": true,
21
29
  "keywords": [
@@ -33,5 +41,11 @@
33
41
  "bugs": {
34
42
  "url": "https://github.com/ostrojs/filesystem/issues"
35
43
  },
36
- "homepage": "https://github.com/ostrojs/filesystem#readme"
44
+ "homepage": "https://github.com/ostrojs/filesystem#readme",
45
+ "overrides": {
46
+ "sprintf-js": "^1.1.3",
47
+ "braces": "^3.0.3",
48
+ "argparse": "^2.0.1",
49
+ "js-yaml": "^4.1.0"
50
+ }
37
51
  }
@@ -0,0 +1,139 @@
1
+ import path from 'path';
2
+ declare const kConfig: unique symbol;
3
+ declare const kRootPath: unique symbol;
4
+ declare const kRootUrlPath: unique symbol;
5
+ /**
6
+ * Class CoreAdapter.
7
+ */
8
+ declare class CoreAdapter {
9
+ [kConfig]: Record<string, any> | null;
10
+ [kRootPath]: string;
11
+ [kRootUrlPath]: string;
12
+ /**
13
+ * setConfig method.
14
+ *
15
+ * @param config - Configuration object.
16
+ */
17
+ setConfig(config: Record<string, any>): void;
18
+ /**
19
+ * getConfig method.
20
+ *
21
+ * @returns Configuration object or null.
22
+ */
23
+ getConfig(): Record<string, any> | null;
24
+ /**
25
+ * setPathPrefix method.
26
+ *
27
+ * @param root - Root directory path prefix.
28
+ */
29
+ setPathPrefix(root: string): void;
30
+ /**
31
+ * setUrlPrefix method.
32
+ *
33
+ * @param root - Root URL prefix.
34
+ */
35
+ setUrlPrefix(root: string): void;
36
+ /**
37
+ * applyPathPrefix method.
38
+ *
39
+ * @param dest - Target path.
40
+ * @returns Resolved absolute path.
41
+ */
42
+ applyPathPrefix(dest: string): string;
43
+ /**
44
+ * applyUrlPrefix method.
45
+ *
46
+ * @param dest - Target path or URL segment.
47
+ * @returns Resolved URL string.
48
+ */
49
+ applyUrlPrefix(dest?: string): string;
50
+ /**
51
+ * ensureDirectory method.
52
+ *
53
+ * @param dir - Directory path to ensure exists.
54
+ * @param callback - Completion callback.
55
+ */
56
+ ensureDirectory(dir: string, callback: (err?: any) => void): void;
57
+ /**
58
+ * parsePath method.
59
+ *
60
+ * @param dest - Path to parse.
61
+ * @returns Parsed path object.
62
+ */
63
+ parsePath(dest: string): path.ParsedPath;
64
+ /**
65
+ * dirname method.
66
+ *
67
+ * @param dest - Path to get directory name of.
68
+ * @returns Directory path.
69
+ */
70
+ dirname(dest: string): string;
71
+ /**
72
+ * getContent method.
73
+ *
74
+ * @param content - Content or array of contents.
75
+ * @returns Single content element.
76
+ */
77
+ getContent<T = unknown>(content: T | T[]): T;
78
+ /**
79
+ * getBufferData method.
80
+ *
81
+ * @param content - Content containing buffer.
82
+ * @returns Buffer instance.
83
+ */
84
+ getBufferData(content: any): any;
85
+ /**
86
+ * move method.
87
+ *
88
+ * @param path - Source path.
89
+ * @param newpath - Destination path.
90
+ * @param callback - Result callback.
91
+ */
92
+ move(path: string, newpath: any, callback: Function): void;
93
+ /**
94
+ * delete method.
95
+ *
96
+ * @param $path - Target path.
97
+ * @param options - Deletion options.
98
+ * @param callback - Result callback.
99
+ */
100
+ delete($path: string, options: Record<string, any>, callback: Function): void;
101
+ /**
102
+ * has method.
103
+ *
104
+ * @param $path - Target path.
105
+ * @param options - Check options.
106
+ * @param callback - Result callback.
107
+ */
108
+ has($path: string, options: Record<string, any>, callback: Function): void;
109
+ /**
110
+ * write method.
111
+ *
112
+ * @param $path - Target path.
113
+ * @param $contents - Contents to write.
114
+ * @param options - Write options.
115
+ * @param rest - Additional arguments including callback.
116
+ */
117
+ write($path: string, $contents: any, options?: Record<string, any>, ...rest: any[]): void;
118
+ /**
119
+ * read method.
120
+ *
121
+ * @param $path - Target path.
122
+ * @param options - Read options.
123
+ * @param callback - Result callback.
124
+ */
125
+ read($path: string, options: Record<string, any>, callback: Function): void;
126
+ /**
127
+ * formatError method.
128
+ *
129
+ * @param err - Inner error.
130
+ * @returns Formatted error object.
131
+ */
132
+ formatError(err: unknown): {
133
+ message: string;
134
+ errors: unknown;
135
+ status: number;
136
+ };
137
+ }
138
+ export default CoreAdapter;
139
+ //# sourceMappingURL=CoreAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapter/CoreAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,QAAA,MAAM,OAAO,EAAE,OAAO,MAAyB,CAAC;AAChD,QAAA,MAAM,SAAS,EAAE,OAAO,MAA2B,CAAC;AACpD,QAAA,MAAM,YAAY,EAAE,OAAO,MAA8B,CAAC;AAE1D;;GAEG;AACH,cAAM,WAAW;IACb,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAQ;IAC7C,CAAC,SAAS,CAAC,EAAE,MAAM,CAAM;IACzB,CAAC,YAAY,CAAC,EAAE,MAAM,CAAM;IAE5B;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAInD;;;;OAIG;IACI,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAI9C;;;;OAIG;IACI,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxC;;;;OAIG;IACI,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvC;;;;;OAKG;IACI,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;;OAKG;IACI,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;;OAKG;IACH,eAAe,CAAC,GAA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C,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAOzF;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,36 @@
1
+ import CoreAdapter from './CoreAdapter';
2
+ declare const kClient: unique symbol;
3
+ declare const kHandler: unique symbol;
4
+ /**
5
+ * Class Azure.
6
+ */
7
+ declare class Azure extends CoreAdapter {
8
+ [kClient]: any;
9
+ [kHandler]: any;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param $client - Azure client instance.
14
+ * @param $config - Configuration options.
15
+ */
16
+ constructor($client: any, $config: Record<string, any>);
17
+ /**
18
+ * read method.
19
+ *
20
+ * @param $path - File path to read.
21
+ * @param options - Read options.
22
+ * @param callback - Completion callback.
23
+ */
24
+ read($path: string, options: Record<string, any>, callback: Function): void;
25
+ /**
26
+ * write method.
27
+ *
28
+ * @param $path - Destination file path.
29
+ * @param data - File content to upload.
30
+ * @param options - Upload options.
31
+ * @param callback - Completion callback.
32
+ */
33
+ write($path: string, data: any, options: Record<string, any>, callback: Function): void;
34
+ }
35
+ export default Azure;
36
+ //# sourceMappingURL=azure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure.d.ts","sourceRoot":"","sources":["../../../src/adapter/azure.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,QAAA,MAAM,OAAO,EAAE,OAAO,MAAyB,CAAC;AAChD,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAElD;;GAEG;AACH,cAAM,KAAM,SAAQ,WAAW;IAC3B,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACf,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEhB;;;;;OAKG;gBACS,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOtD;;;;;;OAMG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA2BvF;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;CA2BtG;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,78 @@
1
+ import fs from 'fs-extra';
2
+ import CoreAdapter from './CoreAdapter';
3
+ declare const kHandler: unique symbol;
4
+ /**
5
+ * Class Local.
6
+ */
7
+ declare class Local extends CoreAdapter {
8
+ [kHandler]: any;
9
+ /**
10
+ * Create a new instance.
11
+ *
12
+ * @param root - Base root directory.
13
+ * @param $config - Configuration object.
14
+ */
15
+ constructor(root: string, $config: Record<string, any>);
16
+ /**
17
+ * move method.
18
+ *
19
+ * @param path - Source path.
20
+ * @param newpath - Destination path.
21
+ * @param callback - Optional completion callback.
22
+ * @returns Promise if no callback, or void.
23
+ */
24
+ move(path: string, newpath: any, callback?: Function): any;
25
+ /**
26
+ * delete method.
27
+ *
28
+ * @param $path - File or directory path to delete.
29
+ * @param options - Deletion options.
30
+ * @param callback - Completion callback.
31
+ */
32
+ delete($path: string, options: Record<string, any>, callback: Function): void;
33
+ /**
34
+ * createDir method.
35
+ *
36
+ * @param $path - Directory path to create.
37
+ * @param options - Directory options.
38
+ * @param callback - Completion callback.
39
+ */
40
+ createDir($path: string, options: Record<string, any>, callback: Function): void;
41
+ /**
42
+ * has method.
43
+ *
44
+ * @param $path - File path to check.
45
+ * @param options - Access options.
46
+ * @param callback - Result callback.
47
+ */
48
+ has($path: string, options: {
49
+ constants: keyof typeof fs.constants | string;
50
+ }, callback: Function): void;
51
+ /**
52
+ * write method.
53
+ *
54
+ * @param $path - File path to write to.
55
+ * @param $contents - Content to write.
56
+ * @param options - Write options.
57
+ * @param rest - Extra arguments including callback.
58
+ */
59
+ write($path: string, $contents: any, options?: Record<string, any>, ...rest: any[]): void;
60
+ /**
61
+ * read method.
62
+ *
63
+ * @param $path - File path to read from.
64
+ * @param options - Read options.
65
+ * @param callback - Result callback.
66
+ */
67
+ read($path: string, options: Record<string, any>, callback: Function): void;
68
+ /**
69
+ * global method.
70
+ *
71
+ * @param $path - Optional path.
72
+ * @param options - Optional options.
73
+ * @param callback - Optional callback.
74
+ */
75
+ global($path?: string, options?: Record<string, any>, callback?: Function): void;
76
+ }
77
+ export default Local;
78
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/adapter/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,WAAW,MAAM,eAAe,CAAC;AAIxC,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAElD;;GAEG;AACH,cAAM,KAAM,SAAQ,WAAW;IAC3B,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEhB;;;;;OAKG;gBACS,IAAI,EAAE,MAAW,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAO3D;;;;;;;OAOG;IACI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,GAAG;IAcjE;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAiBzF;;;;;;OAMG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAgB5F;;;;;;OAMG;IACI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,OAAO,EAAE,CAAC,SAAS,GAAG,MAAM,CAAA;KAA0B,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAiBvI;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAkCpG;;;;;;OAMG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAwBvF;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI;CAE9F;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,36 @@
1
+ import CoreAdapter from './CoreAdapter';
2
+ declare const kClient: unique symbol;
3
+ declare const kHandler: unique symbol;
4
+ /**
5
+ * Class S3.
6
+ */
7
+ declare class S3 extends CoreAdapter {
8
+ [kClient]: any;
9
+ [kHandler]: any;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param $client - S3 client instance.
14
+ * @param $config - Configuration options.
15
+ */
16
+ constructor($client: any, $config: Record<string, any>);
17
+ /**
18
+ * read method.
19
+ *
20
+ * @param $path - File path to read.
21
+ * @param options - Read options.
22
+ * @param callback - Completion callback.
23
+ */
24
+ read($path: string, options: Record<string, any>, callback: Function): void;
25
+ /**
26
+ * write method.
27
+ *
28
+ * @param $path - Destination file path.
29
+ * @param data - File content to upload.
30
+ * @param options - Upload options.
31
+ * @param callback - Completion callback.
32
+ */
33
+ write($path: string, data: any, options: Record<string, any>, callback: Function): void;
34
+ }
35
+ export default S3;
36
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/adapter/s3.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,QAAA,MAAM,OAAO,EAAE,OAAO,MAAyB,CAAC;AAChD,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAElD;;GAEG;AACH,cAAM,EAAG,SAAQ,WAAW;IACxB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACf,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEhB;;;;;OAKG;gBACS,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOtD;;;;;;OAMG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA+BvF;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAkCtG;AAED,eAAe,EAAE,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Class FilesystemHandler.
3
+ */
4
+ declare class FilesystemHandler {
5
+ /**
6
+ * exists method.
7
+ *
8
+ * @param error - Potential error.
9
+ * @param data - Existence check result.
10
+ * @param callback - Resolution callback.
11
+ * @param path - File path.
12
+ * @param options - Options object.
13
+ * @param basePath - Base path.
14
+ */
15
+ exists(error: unknown, data: Record<string, any> | boolean | null, callback: (res: any) => void, path?: string, options?: Record<string, any>, basePath?: any): void;
16
+ /**
17
+ * get method.
18
+ *
19
+ * @param error - Potential error.
20
+ * @param data - Retrieved data.
21
+ * @param callback - Resolution callback.
22
+ * @param path - File path.
23
+ * @param options - Options object.
24
+ * @param basePath - Base path.
25
+ */
26
+ get(error: unknown, data: any, callback: (res: any) => void, path?: string, options?: Record<string, any>, basePath?: any): void;
27
+ /**
28
+ * delete method.
29
+ *
30
+ * @param error - Potential error.
31
+ * @param data - Deletion result.
32
+ * @param callback - Resolution callback.
33
+ * @param path - File path.
34
+ * @param options - Options object.
35
+ * @param basePath - Base path.
36
+ */
37
+ delete(error: unknown, data: any, callback: (res: any) => void, path?: string, options?: Record<string, any>, basePath?: any): void;
38
+ /**
39
+ * put method.
40
+ *
41
+ * @param error - Potential error.
42
+ * @param data - Write result.
43
+ * @param callback - Resolution callback.
44
+ * @param path - File path.
45
+ * @param options - Options object.
46
+ * @param basePath - Base path.
47
+ */
48
+ put(error: unknown, data: any, callback: (res: any) => void, path?: string, options?: Record<string, any>, basePath?: any): void;
49
+ /**
50
+ * global method.
51
+ *
52
+ * @param error - Potential error.
53
+ * @param data - Global data.
54
+ * @param callback - Resolution callback.
55
+ * @param path - File path.
56
+ * @param options - Options object.
57
+ */
58
+ global(error: unknown, data: any, callback: (res: any) => void, path?: string, options?: Record<string, any>): void;
59
+ /**
60
+ * createDir method.
61
+ *
62
+ * @param error - Potential error.
63
+ * @param data - Creation result.
64
+ * @param callback - Resolution callback.
65
+ */
66
+ createDir(error: unknown, data: any, callback: (res: any) => void): void;
67
+ }
68
+ export default FilesystemHandler;
69
+ //# sourceMappingURL=callbackHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callbackHandler.d.ts","sourceRoot":"","sources":["../../src/callbackHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAM,iBAAiB;IACnB;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,EAAE,IAAI,CA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EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAO3E;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,32 @@
1
+ declare const kContainer: unique symbol;
2
+ declare const kConnection: unique symbol;
3
+ /**
4
+ * Class AzureClient.
5
+ */
6
+ declare class AzureClient {
7
+ [kContainer]: any;
8
+ [kConnection]: any;
9
+ /**
10
+ * Create a new instance.
11
+ *
12
+ * @param $config - Azure connection configuration.
13
+ */
14
+ constructor($config: Record<string, any>);
15
+ /**
16
+ * getConnection method.
17
+ *
18
+ * @param account - Storage account name.
19
+ * @param key - Storage account key.
20
+ * @returns BlobServiceClient instance or existing connection.
21
+ */
22
+ getConnection(account?: string, key?: string): any;
23
+ /**
24
+ * getContainer method.
25
+ *
26
+ * @param container - Container name.
27
+ * @returns ContainerClient instance or default container.
28
+ */
29
+ getContainer(container?: string): any;
30
+ }
31
+ export default AzureClient;
32
+ //# sourceMappingURL=azure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure.d.ts","sourceRoot":"","sources":["../../../src/clients/azure.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,UAAU,EAAE,OAAO,MAA4B,CAAC;AACtD,QAAA,MAAM,WAAW,EAAE,OAAO,MAA6B,CAAC;AAExD;;GAEG;AACH,cAAM,WAAW;IACb,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC;IAClB,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAEnB;;;;OAIG;gBACS,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMxC;;;;;;OAMG;IACI,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG;IAazD;;;;;OAKG;IACI,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG;CAM/C;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,27 @@
1
+ declare const kConnection: unique symbol;
2
+ /**
3
+ * Class S3Client.
4
+ */
5
+ declare class S3Client {
6
+ [kConnection]: any;
7
+ /**
8
+ * Create a new instance.
9
+ *
10
+ * @param $config - S3 connection options.
11
+ */
12
+ constructor($config: Record<string, any>);
13
+ /**
14
+ * getConnection method.
15
+ *
16
+ * @returns S3 instance.
17
+ */
18
+ getConnection(): any;
19
+ /**
20
+ * applyConnection method.
21
+ *
22
+ * @param $config - S3 connection options.
23
+ */
24
+ applyConnection($config: Record<string, any>): void;
25
+ }
26
+ export default S3Client;
27
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/clients/s3.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,EAAE,OAAO,MAA6B,CAAC;AAExD;;GAEG;AACH,cAAM,QAAQ;IACV,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAEnB;;;;OAIG;gBACS,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKxC;;;;OAIG;IACI,aAAa,IAAI,GAAG;IAI3B;;;;OAIG;IACI,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;CAS7D;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import DirectoryCreateExceptionContract from '@ostro/contracts/filesystem/directoryCreateException';
2
+ /**
3
+ * Class DirectoryCreateException.
4
+ */
5
+ declare class DirectoryCreateException extends DirectoryCreateExceptionContract {
6
+ name: string;
7
+ message: string;
8
+ errors: unknown;
9
+ statusCode: number;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param errors - Error details or message.
14
+ */
15
+ constructor(errors: unknown);
16
+ }
17
+ export default DirectoryCreateException;
18
+ //# sourceMappingURL=directoryCreateException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directoryCreateException.d.ts","sourceRoot":"","sources":["../../src/directoryCreateException.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,sDAAsD,CAAC;AAEpG;;GAEG;AACH,cAAM,wBAAyB,SAAQ,gCAAgC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;gBACS,MAAM,EAAE,OAAO;CAQ9B;AAED,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import FileNotFoundExceptionContract from '@ostro/contracts/filesystem/fileNotFoundException';
2
+ /**
3
+ * Class FileNotFoundException.
4
+ */
5
+ declare class FileNotFoundException extends FileNotFoundExceptionContract {
6
+ name: string;
7
+ message: string;
8
+ errors: unknown;
9
+ statusCode: number;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param errors - Error details or message.
14
+ * @param path - File path that failed to delete.
15
+ */
16
+ constructor(errors: unknown, path?: string);
17
+ }
18
+ export default FileNotFoundException;
19
+ //# sourceMappingURL=fileDeleteException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileDeleteException.d.ts","sourceRoot":"","sources":["../../src/fileDeleteException.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,MAAM,mDAAmD,CAAC;AAE9F;;GAEG;AACH,cAAM,qBAAsB,SAAQ,6BAA6B;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;gBACS,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM;CAQ7C;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import FileNotFoundExceptionContract from '@ostro/contracts/filesystem/fileNotFoundException';
2
+ /**
3
+ * Class FileNotFoundException.
4
+ */
5
+ declare class FileNotFoundException extends FileNotFoundExceptionContract {
6
+ name: string;
7
+ message: string;
8
+ errors: unknown;
9
+ statusCode: number;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param errors - Error details or message.
14
+ */
15
+ constructor(errors: unknown);
16
+ }
17
+ export default FileNotFoundException;
18
+ //# sourceMappingURL=fileNotFoundException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileNotFoundException.d.ts","sourceRoot":"","sources":["../../src/fileNotFoundException.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,MAAM,mDAAmD,CAAC;AAE9F;;GAEG;AACH,cAAM,qBAAsB,SAAQ,6BAA6B;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;gBACS,MAAM,EAAE,OAAO;CAQ9B;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import FileUploadExceptionContract from '@ostro/contracts/filesystem/fileUploadException';
2
+ /**
3
+ * Class FileUploadException.
4
+ */
5
+ declare class FileUploadException extends FileUploadExceptionContract {
6
+ name: string;
7
+ message: string;
8
+ errors: unknown;
9
+ statusCode: number;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param errors - Error details or message.
14
+ */
15
+ constructor(errors: unknown);
16
+ }
17
+ export default FileUploadException;
18
+ //# sourceMappingURL=fileUploadException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileUploadException.d.ts","sourceRoot":"","sources":["../../src/fileUploadException.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,iDAAiD,CAAC;AAE1F;;GAEG;AACH,cAAM,mBAAoB,SAAQ,2BAA2B;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;gBACS,MAAM,EAAE,OAAO;CAQ9B;AAED,eAAe,mBAAmB,CAAC"}