@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
@@ -0,0 +1,300 @@
1
+ import type { IFilesystem } from '@ostro/contracts/filesystem/filesystem';
2
+ import FilesystemContract from '@ostro/contracts/filesystem/filesystem';
3
+ /**
4
+ * Class Filesystem.
5
+ */
6
+ declare class Filesystem extends FilesystemContract implements IFilesystem {
7
+ /**
8
+ * exists method.
9
+ *
10
+ * @param $path - File path to check.
11
+ * @returns Promise resolving to boolean.
12
+ */
13
+ exists($path: string): Promise<boolean>;
14
+ /**
15
+ * missing method.
16
+ *
17
+ * @param $path - File path to check.
18
+ * @returns Promise resolving to boolean.
19
+ */
20
+ missing($path: string): Promise<boolean>;
21
+ /**
22
+ * get method.
23
+ *
24
+ * @param $path - File path to read.
25
+ * @returns Promise resolving to file content string.
26
+ */
27
+ get($path: string): Promise<string>;
28
+ /**
29
+ * put method.
30
+ *
31
+ * @param $path - File path to write.
32
+ * @param $contents - Contents to write.
33
+ * @returns Promise resolving on completion.
34
+ */
35
+ put($path: string, $contents: any): Promise<void>;
36
+ /**
37
+ * replaceInFile method.
38
+ *
39
+ * @param $search - Search string or RegExp.
40
+ * @param $replace - Replacement string.
41
+ * @param $path - File path.
42
+ * @returns Promise resolving on completion.
43
+ */
44
+ replaceInFile($search: any, $replace: any, $path: string): Promise<void>;
45
+ /**
46
+ * prepend method.
47
+ *
48
+ * @param $path - File path.
49
+ * @param $data - Data to prepend.
50
+ * @returns Promise resolving on completion.
51
+ */
52
+ prepend($path: string, $data: any): Promise<void>;
53
+ /**
54
+ * append method.
55
+ *
56
+ * @param $path - File path.
57
+ * @param $data - Data to append.
58
+ * @returns Promise resolving on completion.
59
+ */
60
+ append($path: string, $data: any): Promise<void>;
61
+ /**
62
+ * chmod method.
63
+ *
64
+ * @param $path - File path.
65
+ * @param $mode - Mode number.
66
+ * @returns Promise resolving to mode or void.
67
+ */
68
+ chmod($path: string, $mode?: any): Promise<any>;
69
+ /**
70
+ * delete method.
71
+ *
72
+ * @param $paths - Path or array of paths to delete.
73
+ * @returns Promise resolving to boolean success.
74
+ */
75
+ delete($paths: any): Promise<boolean>;
76
+ /**
77
+ * move method.
78
+ *
79
+ * @param $path - Source path.
80
+ * @param $target - Destination path.
81
+ * @returns Promise resolving on completion.
82
+ */
83
+ move($path: string, $target: any): Promise<void>;
84
+ /**
85
+ * copy method.
86
+ *
87
+ * @param $path - Source path.
88
+ * @param $target - Destination path.
89
+ * @returns Promise resolving on completion.
90
+ */
91
+ copy($path: string, $target: any): Promise<void>;
92
+ /**
93
+ * link method.
94
+ *
95
+ * @param $target - Target path.
96
+ * @param $link - Symlink path.
97
+ * @param $force - Force flag.
98
+ * @returns Promise resolving on completion.
99
+ */
100
+ link($target: any, $link: any, $force?: boolean): Promise<void>;
101
+ /**
102
+ * relativeLink method.
103
+ *
104
+ * @param $target - Target path.
105
+ * @param $link - Symlink path.
106
+ * @param $force - Force flag.
107
+ * @returns Promise resolving on completion.
108
+ */
109
+ relativeLink($target: any, $link: any, $force?: boolean): Promise<void>;
110
+ /**
111
+ * name method.
112
+ *
113
+ * @param $path - File path.
114
+ * @returns File name without extension.
115
+ */
116
+ name($path: string): string;
117
+ /**
118
+ * basename method.
119
+ *
120
+ * @param $path - File path.
121
+ * @returns Base filename with extension.
122
+ */
123
+ basename($path: string): string;
124
+ /**
125
+ * dirname method.
126
+ *
127
+ * @param $path - File path.
128
+ * @returns Directory path.
129
+ */
130
+ dirname($path: string): string;
131
+ /**
132
+ * extension method.
133
+ *
134
+ * @param $path - File path.
135
+ * @returns File extension without leading dot.
136
+ */
137
+ extension($path: string): string;
138
+ /**
139
+ * guessExtension method.
140
+ *
141
+ * @param $path - File path.
142
+ * @returns Extension with dot.
143
+ */
144
+ guessExtension($path: string): string;
145
+ /**
146
+ * type method.
147
+ *
148
+ * @param $path - Path to check.
149
+ * @returns 'dir' or 'file'.
150
+ */
151
+ type($path: string): Promise<string>;
152
+ /**
153
+ * mimeType method.
154
+ *
155
+ * @param $path - File path.
156
+ * @returns Extension as mime identifier.
157
+ */
158
+ mimeType($path: string): string;
159
+ /**
160
+ * size method.
161
+ *
162
+ * @param $path - File path.
163
+ * @returns Size in bytes.
164
+ */
165
+ size($path: string): Promise<number>;
166
+ /**
167
+ * lastModified method.
168
+ *
169
+ * @param $path - File path.
170
+ * @returns Last modified timestamp in seconds.
171
+ */
172
+ lastModified($path: string): Promise<number>;
173
+ /**
174
+ * isDirectory method.
175
+ *
176
+ * @param $directory - Directory path.
177
+ * @returns Boolean indicating if directory.
178
+ */
179
+ isDirectory($directory: any): Promise<boolean>;
180
+ /**
181
+ * isReadable method.
182
+ *
183
+ * @param $path - Path to check.
184
+ * @returns Boolean indicating if readable.
185
+ */
186
+ isReadable($path: string): Promise<boolean>;
187
+ /**
188
+ * isWritable method.
189
+ *
190
+ * @param $path - Path to check.
191
+ * @returns Boolean indicating if writable.
192
+ */
193
+ isWritable($path: string): Promise<boolean>;
194
+ /**
195
+ * isFile method.
196
+ *
197
+ * @param $file - Path to check.
198
+ * @returns Boolean indicating if regular file.
199
+ */
200
+ isFile($file: any): Promise<boolean>;
201
+ /**
202
+ * glob method.
203
+ *
204
+ * @param $pattern - Pattern to match.
205
+ * @returns Matching file paths.
206
+ */
207
+ glob($pattern: string): Promise<string[]>;
208
+ /**
209
+ * requireOnce method.
210
+ *
211
+ * @param $path - Module path to require.
212
+ * @param $data - Additional data.
213
+ * @returns Required module export.
214
+ */
215
+ requireOnce($path: string, $data?: any[]): Promise<any>;
216
+ /**
217
+ * files method.
218
+ *
219
+ * @param $directory - Directory path.
220
+ * @param $hidden - Whether to ignore hidden.
221
+ * @returns List of file paths.
222
+ */
223
+ files($directory: any, $hidden?: boolean): Promise<string[]>;
224
+ /**
225
+ * allFiles method.
226
+ *
227
+ * @param $directory - Directory path.
228
+ * @param $hidden - Whether to ignore hidden.
229
+ * @returns List of all recursive file paths.
230
+ */
231
+ allFiles($directory: any, $hidden?: boolean): Promise<string[]>;
232
+ /**
233
+ * directories method.
234
+ *
235
+ * @param $directory - Directory path.
236
+ * @returns List of directories.
237
+ */
238
+ directories($directory: any): Promise<string[]>;
239
+ /**
240
+ * ensureDirectoryExists method.
241
+ *
242
+ * @param $path - Directory path.
243
+ * @param $mode - Directory mode permissions.
244
+ * @param $recursive - Recursive creation flag.
245
+ * @returns Boolean success.
246
+ */
247
+ ensureDirectoryExists($path: string, $mode?: any, $recursive?: boolean): Promise<boolean>;
248
+ /**
249
+ * makeDirectory method.
250
+ *
251
+ * @param $path - Directory path.
252
+ * @param $mode - Permissions mode.
253
+ * @param $recursive - Recursive flag.
254
+ * @param $force - Force flag.
255
+ * @returns Result of mkdir.
256
+ */
257
+ makeDirectory($path: string, $mode?: any, $recursive?: boolean, $force?: boolean): Promise<any>;
258
+ /**
259
+ * moveDirectory method.
260
+ *
261
+ * @param $from - Source directory.
262
+ * @param $to - Destination directory.
263
+ * @param $overwrite - Overwrite flag.
264
+ * @returns Boolean success.
265
+ */
266
+ moveDirectory($from: any, $to: any, $overwrite?: boolean): Promise<boolean>;
267
+ /**
268
+ * copyDirectory method.
269
+ *
270
+ * @param $directory - Source directory.
271
+ * @param $destination - Destination directory.
272
+ * @param $options - Copy options.
273
+ * @returns Boolean success.
274
+ */
275
+ copyDirectory($directory: any, $destination: any, $options?: Record<string, any>): Promise<boolean>;
276
+ /**
277
+ * deleteDirectory method.
278
+ *
279
+ * @param $directory - Directory path.
280
+ * @param $preserve - Preserve directory flag.
281
+ * @returns Boolean success.
282
+ */
283
+ deleteDirectory($directory: any, $preserve?: boolean): Promise<boolean>;
284
+ /**
285
+ * deleteDirectories method.
286
+ *
287
+ * @param $directory - Directory path.
288
+ * @returns Boolean success.
289
+ */
290
+ deleteDirectories($directory: any): Promise<boolean>;
291
+ /**
292
+ * cleanDirectory method.
293
+ *
294
+ * @param $directory - Directory path.
295
+ * @returns Boolean success.
296
+ */
297
+ cleanDirectory($directory: any): Promise<boolean>;
298
+ }
299
+ export default Filesystem;
300
+ //# sourceMappingURL=filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,kBAAkB,MAAM,wCAAwC,CAAC;AASxE;;GAEG;AACH,cAAM,UAAW,SAAQ,kBAAmB,YAAW,WAAW;IAE9D;;;;;OAKG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C;;;;;OAKG;IACU,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrD;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMnC;;;;;;OAMG;IACI,GAAG,CAAC,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AAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ7E;;;;;OAKG;IACI,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAItD;;;;;;;OAOG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,GAAW,EAAE,UAAU,GAAE,OAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7G;;;;;;;;OAQG;IACI,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,GAAW,EAAE,UAAU,GAAE,OAAe,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IAO3H;;;;;;;OAOG;IACU,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAa/F;;;;;;;OAOG;IACU,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAepH;;;;;;OAMG;IACU,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAc3F;;;;;OAKG;IACU,iBAAiB,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAcjE;;;;;OAKG;IACI,cAAc,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;CAG3D;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,91 @@
1
+ declare const kAdapter: unique symbol;
2
+ declare const kHandler: unique symbol;
3
+ /**
4
+ * Class FilesystemAdapter.
5
+ */
6
+ declare class FilesystemAdapter {
7
+ [kAdapter]: any;
8
+ [kHandler]: any;
9
+ /**
10
+ * Create a new instance.
11
+ *
12
+ * @param $adapter - Adapter instance.
13
+ * @param $handler - Callback handler instance.
14
+ */
15
+ constructor($adapter: any, $handler: any);
16
+ /**
17
+ * exists method.
18
+ *
19
+ * @param $path - File path to check.
20
+ * @param options - Check options.
21
+ * @returns Promise resolving to boolean.
22
+ */
23
+ exists($path: string, options?: Record<string, any>): Promise<boolean>;
24
+ /**
25
+ * path method.
26
+ *
27
+ * @param $path - Relative path.
28
+ * @returns Resolved path.
29
+ */
30
+ path($path: string): string;
31
+ /**
32
+ * get method.
33
+ *
34
+ * @param $path - File path to read.
35
+ * @param options - Read options.
36
+ * @returns Promise resolving to file contents.
37
+ */
38
+ get($path: string, options?: Record<string, any>): Promise<any>;
39
+ /**
40
+ * delete method.
41
+ *
42
+ * @param $path - File path to delete.
43
+ * @param rest - Optional callback and options.
44
+ * @returns Promise or adapter result.
45
+ */
46
+ delete($path: string, ...rest: any[]): any;
47
+ /**
48
+ * makeDirectory method.
49
+ *
50
+ * @param $path - Directory path to create.
51
+ * @param options - Directory options.
52
+ * @returns Promise resolving on completion.
53
+ */
54
+ makeDirectory($path: string, options?: Record<string, any>): Promise<any>;
55
+ /**
56
+ * put method.
57
+ *
58
+ * @param $path - File path to write.
59
+ * @param content - File contents.
60
+ * @param options - Write options.
61
+ * @returns Promise resolving on completion.
62
+ */
63
+ put($path: string, content: any, options?: Record<string, any>): Promise<any>;
64
+ /**
65
+ * putFile method.
66
+ *
67
+ * @param $path - Directory path.
68
+ * @param $file - File object.
69
+ * @param $options - Write options.
70
+ * @returns Promise resolving to write result.
71
+ */
72
+ putFile($path: string, $file: any, $options?: Record<string, any>): Promise<any>;
73
+ /**
74
+ * putFileAs method.
75
+ *
76
+ * @param $path - Directory path.
77
+ * @param $file - File object.
78
+ * @param $name - Filename.
79
+ * @param $options - Write options.
80
+ * @returns Promise resolving to write result.
81
+ */
82
+ putFileAs($path: string, $file: any, $name: string, $options?: Record<string, any>): Promise<any>;
83
+ /**
84
+ * getAdapter method.
85
+ *
86
+ * @returns Underlying adapter instance.
87
+ */
88
+ getAdapter(): any;
89
+ }
90
+ export default FilesystemAdapter;
91
+ //# sourceMappingURL=filesystemAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystemAdapter.d.ts","sourceRoot":"","sources":["../../src/filesystemAdapter.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAClD,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAElD;;GAEG;AACH,cAAM,iBAAiB;IACnB,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAChB,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEhB;;;;;OAKG;gBACS,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAKxC;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ7E;;;;;OAKG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOlC;;;;;;OAMG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAY/D;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG;IAmBjD;;;;;;OAMG;IACI,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAYhF;;;;;;;OAOG;IACI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAYxF;;;;;;;OAOG;IACI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI3F;;;;;;;;OAQG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAK5G;;;;OAIG;IACI,UAAU,IAAI,GAAG;CAG3B;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,93 @@
1
+ import Manager from '@ostro/support/manager';
2
+ import FilesystemAdapter from './filesystemAdapter';
3
+ declare const kHandler: unique symbol;
4
+ /**
5
+ * Class FileSystemManager.
6
+ */
7
+ declare class FileSystemManager extends Manager {
8
+ $type: string;
9
+ [kHandler]: any;
10
+ /**
11
+ * Create a new instance.
12
+ *
13
+ * @param $app - Application instance.
14
+ */
15
+ constructor($app: any);
16
+ /**
17
+ * drive method.
18
+ *
19
+ * @param $name - Driver or disk name.
20
+ * @returns FilesystemAdapter instance.
21
+ */
22
+ drive($name?: string | null): any;
23
+ /**
24
+ * disk method.
25
+ *
26
+ * @param name - Disk name.
27
+ * @returns FilesystemAdapter instance.
28
+ */
29
+ disk(name?: string | null): any;
30
+ /**
31
+ * cloud method.
32
+ *
33
+ * @returns Default cloud FilesystemAdapter instance.
34
+ */
35
+ cloud(): any;
36
+ /**
37
+ * resolve method.
38
+ *
39
+ * @param $name - Disk name to resolve.
40
+ * @returns Resolved FilesystemAdapter instance.
41
+ */
42
+ resolve($name: string): any;
43
+ /**
44
+ * createLocalDriver method.
45
+ *
46
+ * @param $config - Driver configuration.
47
+ * @returns FilesystemAdapter for local storage.
48
+ */
49
+ createLocalDriver($config: Record<string, any>): FilesystemAdapter;
50
+ /**
51
+ * createAzureDriver method.
52
+ *
53
+ * @param $config - Driver configuration.
54
+ * @returns FilesystemAdapter for Azure storage.
55
+ */
56
+ createAzureDriver($config: Record<string, any>): FilesystemAdapter;
57
+ /**
58
+ * createS3Driver method.
59
+ *
60
+ * @param $config - Driver configuration.
61
+ * @returns FilesystemAdapter for S3 storage.
62
+ */
63
+ createS3Driver($config: Record<string, any>): FilesystemAdapter;
64
+ /**
65
+ * adapt method.
66
+ *
67
+ * @param adapter - Core adapter instance.
68
+ * @param config - Driver configuration.
69
+ * @returns FilesystemAdapter wrapping core adapter.
70
+ */
71
+ adapt(adapter: any, config: Record<string, any>): FilesystemAdapter;
72
+ /**
73
+ * getConfig method.
74
+ *
75
+ * @param name - Disk configuration key.
76
+ * @returns Configuration object.
77
+ */
78
+ getConfig(name: string): any;
79
+ /**
80
+ * getDefaultCloudDriver method.
81
+ *
82
+ * @returns Name of default cloud driver.
83
+ */
84
+ getDefaultCloudDriver(): string;
85
+ /**
86
+ * registerToRequest method.
87
+ *
88
+ * @param FileRequest - Request constructor to extend.
89
+ */
90
+ registerToRequest(FileRequest: any): void;
91
+ }
92
+ export default FileSystemManager;
93
+ //# sourceMappingURL=filesystemManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystemManager.d.ts","sourceRoot":"","sources":["../../src/filesystemManager.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAE7C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAQpD,QAAA,MAAM,QAAQ,EAAE,OAAO,MAA0B,CAAC;AAElD;;GAEG;AACH,cAAM,iBAAkB,SAAQ,OAAO;IAC5B,KAAK,EAAE,MAAM,CAAgB;IACpC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEhB;;;;OAIG;gBACS,IAAI,EAAE,GAAG;IAmBrB;;;;;OAKG;IACI,KAAK,CAAC,KAAK,GAAE,MAAM,GAAG,IAAW,GAAG,GAAG;IAI9C;;;;;OAKG;IACI,IAAI,CAAC,IAAI,GAAE,MAAM,GAAG,IAAW,GAAG,GAAG;IAI5C;;;;OAIG;IACI,KAAK,IAAI,GAAG;IAKnB;;;;;OAKG;IACI,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG;IAQlC;;;;;OAKG;IACI,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAIzE;;;;;OAKG;IACI,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAIzE;;;;;OAKG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAItE;;;;;;OAMG;IACI,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,iBAAiB;IAI1E;;;;;OAKG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAInC;;;;OAIG;IACI,qBAAqB,IAAI,MAAM;IAItC;;;;OAIG;IACI,iBAAiB,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI;CAenD;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import ServiceProvider from '@ostro/support/serviceProvider';
2
+ /**
3
+ * Class filesystemServiceProvider.
4
+ */
5
+ declare class filesystemServiceProvider extends ServiceProvider {
6
+ /**
7
+ * register method.
8
+ */
9
+ register(): void;
10
+ /**
11
+ * registerNativeFilesystem method.
12
+ */
13
+ registerNativeFilesystem(): void;
14
+ /**
15
+ * registerFlysystem method.
16
+ */
17
+ registerFlysystem(): void;
18
+ /**
19
+ * registerManager method.
20
+ */
21
+ registerManager(): void;
22
+ /**
23
+ * getDefaultDriver method.
24
+ *
25
+ * @returns Default driver name.
26
+ */
27
+ getDefaultDriver(): string;
28
+ /**
29
+ * getCloudDriver method.
30
+ *
31
+ * @returns Cloud driver name.
32
+ */
33
+ getCloudDriver(): string;
34
+ /**
35
+ * boot method.
36
+ */
37
+ boot(): void;
38
+ }
39
+ export default filesystemServiceProvider;
40
+ //# sourceMappingURL=filesystemServiceProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystemServiceProvider.d.ts","sourceRoot":"","sources":["../../src/filesystemServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAI7D;;GAEG;AACH,cAAM,yBAA0B,SAAQ,eAAe;IAEnD;;OAEG;IACI,QAAQ,IAAI,IAAI;IAKvB;;OAEG;IACI,wBAAwB,IAAI,IAAI;IAMvC;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAYhC;;OAEG;IACI,eAAe,IAAI,IAAI;IAM9B;;;;OAIG;IACI,gBAAgB,IAAI,MAAM;IAIjC;;;;OAIG;IACI,cAAc,IAAI,MAAM;IAI/B;;OAEG;IACI,IAAI,IAAI,IAAI;CAEtB;AAED,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import InvalidArgumentExceptionContract from '@ostro/contracts/exception/invalidArgumentException';
2
+ /**
3
+ * Class InvalidArgumentException.
4
+ */
5
+ declare class InvalidArgumentException extends InvalidArgumentExceptionContract {
6
+ name: string;
7
+ message: string;
8
+ statusCode: number;
9
+ /**
10
+ * Create a new instance.
11
+ *
12
+ * @param error - Error message.
13
+ */
14
+ constructor(error: string);
15
+ }
16
+ export default InvalidArgumentException;
17
+ //# sourceMappingURL=invalidArgumentException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invalidArgumentException.d.ts","sourceRoot":"","sources":["../../src/invalidArgumentException.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,qDAAqD,CAAC;AAEnG;;GAEG;AACH,cAAM,wBAAyB,SAAQ,gCAAgC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;gBACS,KAAK,EAAE,MAAM;CAO5B;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,22 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
-
12
- publish-npm:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v2
16
- - uses: actions/setup-node@v2
17
- with:
18
- node-version: 14
19
- registry-url: https://registry.npmjs.org/
20
- - run: npm publish
21
- env:
22
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}