@meistrari/vault-sdk 1.2.0 → 1.3.0
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/index.cjs +16 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +16 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -489,6 +489,22 @@ class VaultFile {
|
|
|
489
489
|
return blob;
|
|
490
490
|
return await blobToBase64(blob);
|
|
491
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* Deletes the file from the vault.
|
|
494
|
+
* @param options - The options for the request
|
|
495
|
+
* @param options.signal - The signal to abort the request
|
|
496
|
+
*
|
|
497
|
+
*/
|
|
498
|
+
async delete(options) {
|
|
499
|
+
if (!this.id) {
|
|
500
|
+
throw new Error("File ID is not set");
|
|
501
|
+
}
|
|
502
|
+
await this._fetch({
|
|
503
|
+
method: "DELETE",
|
|
504
|
+
path: `/v2/files/${this.id}`,
|
|
505
|
+
signal: options?.signal
|
|
506
|
+
});
|
|
507
|
+
}
|
|
492
508
|
}
|
|
493
509
|
|
|
494
510
|
function vaultClient(config) {
|
package/dist/index.d.cts
CHANGED
|
@@ -306,6 +306,15 @@ declare class VaultFile {
|
|
|
306
306
|
download(responseType: 'base64', options?: {
|
|
307
307
|
signal?: AbortSignal;
|
|
308
308
|
}): Promise<string>;
|
|
309
|
+
/**
|
|
310
|
+
* Deletes the file from the vault.
|
|
311
|
+
* @param options - The options for the request
|
|
312
|
+
* @param options.signal - The signal to abort the request
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
delete(options?: {
|
|
316
|
+
signal?: AbortSignal;
|
|
317
|
+
}): Promise<void>;
|
|
309
318
|
}
|
|
310
319
|
|
|
311
320
|
declare function vaultClient(config: VaultConfig): {
|
package/dist/index.d.mts
CHANGED
|
@@ -306,6 +306,15 @@ declare class VaultFile {
|
|
|
306
306
|
download(responseType: 'base64', options?: {
|
|
307
307
|
signal?: AbortSignal;
|
|
308
308
|
}): Promise<string>;
|
|
309
|
+
/**
|
|
310
|
+
* Deletes the file from the vault.
|
|
311
|
+
* @param options - The options for the request
|
|
312
|
+
* @param options.signal - The signal to abort the request
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
delete(options?: {
|
|
316
|
+
signal?: AbortSignal;
|
|
317
|
+
}): Promise<void>;
|
|
309
318
|
}
|
|
310
319
|
|
|
311
320
|
declare function vaultClient(config: VaultConfig): {
|
package/dist/index.d.ts
CHANGED
|
@@ -306,6 +306,15 @@ declare class VaultFile {
|
|
|
306
306
|
download(responseType: 'base64', options?: {
|
|
307
307
|
signal?: AbortSignal;
|
|
308
308
|
}): Promise<string>;
|
|
309
|
+
/**
|
|
310
|
+
* Deletes the file from the vault.
|
|
311
|
+
* @param options - The options for the request
|
|
312
|
+
* @param options.signal - The signal to abort the request
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
delete(options?: {
|
|
316
|
+
signal?: AbortSignal;
|
|
317
|
+
}): Promise<void>;
|
|
309
318
|
}
|
|
310
319
|
|
|
311
320
|
declare function vaultClient(config: VaultConfig): {
|
package/dist/index.mjs
CHANGED
|
@@ -487,6 +487,22 @@ class VaultFile {
|
|
|
487
487
|
return blob;
|
|
488
488
|
return await blobToBase64(blob);
|
|
489
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Deletes the file from the vault.
|
|
492
|
+
* @param options - The options for the request
|
|
493
|
+
* @param options.signal - The signal to abort the request
|
|
494
|
+
*
|
|
495
|
+
*/
|
|
496
|
+
async delete(options) {
|
|
497
|
+
if (!this.id) {
|
|
498
|
+
throw new Error("File ID is not set");
|
|
499
|
+
}
|
|
500
|
+
await this._fetch({
|
|
501
|
+
method: "DELETE",
|
|
502
|
+
path: `/v2/files/${this.id}`,
|
|
503
|
+
signal: options?.signal
|
|
504
|
+
});
|
|
505
|
+
}
|
|
490
506
|
}
|
|
491
507
|
|
|
492
508
|
function vaultClient(config) {
|