@edirect/storage-gateway 11.0.50 → 11.0.52
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/dist/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @edirect/storage-gateway
|
|
2
2
|
|
|
3
|
-
Storage Gateway client library for eDirect applications. Provides a simple interface to interact with the Storage Gateway API for managing storage configurations and file operations.
|
|
3
|
+
Storage Gateway client library for eDirect applications. Provides a simple interface to interact with the Storage Gateway API for managing storage configurations and file operations across multiple cloud providers (S3, Azure Blob, GCS, local).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @edirect/storage-gateway
|
|
9
|
+
# or
|
|
8
10
|
npm install @edirect/storage-gateway
|
|
9
11
|
```
|
|
10
12
|
|
package/dist/package.json
CHANGED
|
@@ -188,6 +188,32 @@ export declare class StorageGatewayClient {
|
|
|
188
188
|
storageKey: string;
|
|
189
189
|
path: string;
|
|
190
190
|
}): Promise<unknown>;
|
|
191
|
+
/**
|
|
192
|
+
* Move a file from one location to another within the same storage or between different storages
|
|
193
|
+
*
|
|
194
|
+
* @param params - Move parameters
|
|
195
|
+
* @param params.storageKey - Source storage configuration key
|
|
196
|
+
* @param params.sourcePath - Source path of the file to move
|
|
197
|
+
* @param params.destinationPath - Destination path where the file will be moved
|
|
198
|
+
* @param params.destination - Optional destination storage configuration key
|
|
199
|
+
* @returns Promise resolving to the destination path of the moved file
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const result = await client.moveFile({
|
|
204
|
+
* storageKey: 'my-storage',
|
|
205
|
+
* sourcePath: 'documents/old.txt',
|
|
206
|
+
* destinationPath: 'archive/old.txt',
|
|
207
|
+
* destination: 'other-storage' // optional
|
|
208
|
+
* });
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
moveFile(params: {
|
|
212
|
+
storageKey: string;
|
|
213
|
+
sourcePath: string;
|
|
214
|
+
destinationPath: string;
|
|
215
|
+
destination?: string;
|
|
216
|
+
}): Promise<unknown>;
|
|
191
217
|
/**
|
|
192
218
|
* List available storage providers
|
|
193
219
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage-gateway/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAC,CAAyB;gBAE7B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAe5D,OAAO,CAAC,UAAU;IAMlB;;;;;;;;;;;;OAYG;IACU,yBAAyB,CAAC,MAAM,CAAC,EAAE;QAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAWD;;;;;;;;;;;;;;OAcG;IACU,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAarE;;;;;;;;;;OAUG;IACU,uBAAuB,CAAC,GAAG,EAAE,MAAM;IAShD;;;;;;;;;;;;;;;OAeG;IACU,0BAA0B,CAAC,MAAM,EAAE;QAC9C,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B;IAaD;;;;;;;;;;OAUG;IACU,0BAA0B,CAAC,GAAG,EAAE,MAAM;IAcnD;;;;;;;;;;;;;;;OAeG;IACU,SAAS,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAOpE;;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
|
253
|
+
/**
|
|
254
|
+
* Move a file from one location to another within the same storage or between different storages
|
|
255
|
+
*
|
|
256
|
+
* @param params - Move parameters
|
|
257
|
+
* @param params.storageKey - Source storage configuration key
|
|
258
|
+
* @param params.sourcePath - Source path of the file to move
|
|
259
|
+
* @param params.destinationPath - Destination path where the file will be moved
|
|
260
|
+
* @param params.destination - Optional destination storage configuration key
|
|
261
|
+
* @returns Promise resolving to the destination path of the moved file
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* const result = await client.moveFile({
|
|
266
|
+
* storageKey: 'my-storage',
|
|
267
|
+
* sourcePath: 'documents/old.txt',
|
|
268
|
+
* destinationPath: 'archive/old.txt',
|
|
269
|
+
* destination: 'other-storage' // optional
|
|
270
|
+
* });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
async moveFile(params) {
|
|
274
|
+
const headers = this.getHeaders();
|
|
275
|
+
const queryParams = new URLSearchParams({
|
|
276
|
+
sourcePath: params.sourcePath,
|
|
277
|
+
destinationPath: params.destinationPath,
|
|
278
|
+
});
|
|
279
|
+
if (params.destination)
|
|
280
|
+
queryParams.append('destination', params.destination);
|
|
281
|
+
const url = `${this.BASE_URL}/api/v1/storage/${params.storageKey}/move?${queryParams.toString()}`;
|
|
282
|
+
const response = await fetch(url, {
|
|
283
|
+
method: 'POST',
|
|
284
|
+
headers,
|
|
285
|
+
});
|
|
286
|
+
return response.json();
|
|
287
|
+
}
|
|
253
288
|
// ==================== Storage Provider Methods ====================
|
|
254
289
|
/**
|
|
255
290
|
* List available storage providers
|