@sparkvault/sdk-js 11.1.14 → 11.2.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 +52 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -7
- package/dist/index.mjs +52 -16
- package/dist/index.mjs.map +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vaults/index.d.ts +7 -4
- package/dist/vaults/types.d.ts +41 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -765,7 +765,27 @@ interface UnsealedVault {
|
|
|
765
765
|
/** VAT lifetime in seconds */
|
|
766
766
|
ttlSeconds: number;
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
/** Lifecycle metadata, including the lockout and seven-day cancellation window. */
|
|
769
|
+
interface VaultLifecycle {
|
|
770
|
+
/** sealed, unsealed, deletion_scheduled, or deleting */
|
|
771
|
+
status: string;
|
|
772
|
+
/** Unix seconds when deletion was requested */
|
|
773
|
+
deletionRequestedAt?: number;
|
|
774
|
+
/** Unix seconds after which deletion cannot be cancelled */
|
|
775
|
+
deletionScheduledFor?: number;
|
|
776
|
+
deletionRequestedBy?: string;
|
|
777
|
+
/** Pass this exact schedule to cancelDeletion. */
|
|
778
|
+
deletionScheduleId?: string;
|
|
779
|
+
}
|
|
780
|
+
interface ScheduledVaultDeletion {
|
|
781
|
+
id: string;
|
|
782
|
+
status: 'deletion_scheduled';
|
|
783
|
+
deletionRequestedAt: number;
|
|
784
|
+
deletionScheduledFor: number;
|
|
785
|
+
deletionRequestedBy: string;
|
|
786
|
+
deletionScheduleId: string;
|
|
787
|
+
}
|
|
788
|
+
interface VaultSummary extends VaultLifecycle {
|
|
769
789
|
/** Vault ID */
|
|
770
790
|
id: string;
|
|
771
791
|
/** Vault name */
|
|
@@ -792,15 +812,13 @@ interface VaultPage {
|
|
|
792
812
|
nextCursor?: string;
|
|
793
813
|
}
|
|
794
814
|
/** A single vault's detail, as returned by get. */
|
|
795
|
-
interface VaultDetail {
|
|
815
|
+
interface VaultDetail extends VaultLifecycle {
|
|
796
816
|
/** Vault ID */
|
|
797
817
|
id: string;
|
|
798
818
|
/** Vault name */
|
|
799
819
|
name: string;
|
|
800
820
|
/** Optional description */
|
|
801
821
|
description: string | null;
|
|
802
|
-
/** Sealed/unsealed status */
|
|
803
|
-
status: string;
|
|
804
822
|
/** Number of ingots */
|
|
805
823
|
ingotCount: number;
|
|
806
824
|
/** Total storage used in bytes */
|
|
@@ -2069,7 +2087,8 @@ declare class VaultsModule {
|
|
|
2069
2087
|
*/
|
|
2070
2088
|
seal(vaultId: string): Promise<void>;
|
|
2071
2089
|
/**
|
|
2072
|
-
*
|
|
2090
|
+
* Schedule permanent deletion in seven days and immediately lock all vault access.
|
|
2091
|
+
* Company admins only; cancelDeletion can abort this schedule before its deadline.
|
|
2073
2092
|
*
|
|
2074
2093
|
* Requires the vault's exact name as confirmation, matched case-sensitively.
|
|
2075
2094
|
* The name is sent base64(UTF-8) as the `X-Confirm-Name-B64` header so a vault
|
|
@@ -2079,7 +2098,9 @@ declare class VaultsModule {
|
|
|
2079
2098
|
* @example
|
|
2080
2099
|
* await sv.vaults.delete('vlt_abc', 'My Vault');
|
|
2081
2100
|
*/
|
|
2082
|
-
delete(vaultId: string, name: string): Promise<
|
|
2101
|
+
delete(vaultId: string, name: string): Promise<ScheduledVaultDeletion>;
|
|
2102
|
+
/** Cancel this exact deletion schedule before its deadline; company admins only. */
|
|
2103
|
+
cancelDeletion(vaultId: string, deletionScheduleId: string): Promise<VaultDetail>;
|
|
2083
2104
|
/**
|
|
2084
2105
|
* Get a vault's public-sharing configuration.
|
|
2085
2106
|
*
|
|
@@ -3507,4 +3528,4 @@ declare global {
|
|
|
3507
3528
|
}
|
|
3508
3529
|
|
|
3509
3530
|
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, IdentityModule, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, logger, setDebugMode };
|
|
3510
|
-
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusRecipient, NotifySendSummary, NotifyVerificationLevel, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, Spark, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreadCountResponse, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushSubscriptionInput };
|
|
3531
|
+
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusRecipient, NotifySendSummary, NotifyVerificationLevel, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, Spark, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreadCountResponse, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushSubscriptionInput };
|
package/dist/index.mjs
CHANGED
|
@@ -15190,6 +15190,7 @@ class VaultsModule {
|
|
|
15190
15190
|
createdAt: v.created_at,
|
|
15191
15191
|
ingotCount: v.ingot_count,
|
|
15192
15192
|
storageBytes: v.storage_bytes,
|
|
15193
|
+
...mapLifecycle(v),
|
|
15193
15194
|
})),
|
|
15194
15195
|
nextCursor: response.data.next_cursor,
|
|
15195
15196
|
};
|
|
@@ -15204,18 +15205,7 @@ class VaultsModule {
|
|
|
15204
15205
|
async get(vaultId) {
|
|
15205
15206
|
const id = requireResourceId(vaultId, 'vaultId');
|
|
15206
15207
|
const response = await this.http.get(apiPath `/v1/vaults/${id}`);
|
|
15207
|
-
|
|
15208
|
-
return {
|
|
15209
|
-
id: v.vault_id,
|
|
15210
|
-
name: v.name,
|
|
15211
|
-
description: v.description ?? null,
|
|
15212
|
-
status: v.status,
|
|
15213
|
-
ingotCount: v.ingot_count ?? 0,
|
|
15214
|
-
storageBytes: v.storage_bytes ?? 0,
|
|
15215
|
-
createdAt: v.created_at,
|
|
15216
|
-
lastUnsealedAt: v.last_unsealed_at ?? null,
|
|
15217
|
-
unsealCount: v.unseal_count ?? 0,
|
|
15218
|
-
};
|
|
15208
|
+
return mapVaultDetail(response.data);
|
|
15219
15209
|
}
|
|
15220
15210
|
/**
|
|
15221
15211
|
* Rename a vault.
|
|
@@ -15250,7 +15240,8 @@ class VaultsModule {
|
|
|
15250
15240
|
await this.http.post(apiPath `/v1/vaults/${id}/seal`);
|
|
15251
15241
|
}
|
|
15252
15242
|
/**
|
|
15253
|
-
*
|
|
15243
|
+
* Schedule permanent deletion in seven days and immediately lock all vault access.
|
|
15244
|
+
* Company admins only; cancelDeletion can abort this schedule before its deadline.
|
|
15254
15245
|
*
|
|
15255
15246
|
* Requires the vault's exact name as confirmation, matched case-sensitively.
|
|
15256
15247
|
* The name is sent base64(UTF-8) as the `X-Confirm-Name-B64` header so a vault
|
|
@@ -15265,9 +15256,32 @@ class VaultsModule {
|
|
|
15265
15256
|
if (!name) {
|
|
15266
15257
|
throw new ValidationError('Vault name is required to confirm deletion');
|
|
15267
15258
|
}
|
|
15268
|
-
await this.http.delete(apiPath `/v1/vaults/${id}`, {
|
|
15269
|
-
headers: {
|
|
15259
|
+
const response = await this.http.delete(apiPath `/v1/vaults/${id}`, {
|
|
15260
|
+
headers: {
|
|
15261
|
+
'X-Confirm-Name-B64': base64EncodeUtf8(name),
|
|
15262
|
+
'X-Vault-Deletion-Mode': 'schedule',
|
|
15263
|
+
},
|
|
15270
15264
|
});
|
|
15265
|
+
const scheduled = response.data;
|
|
15266
|
+
return {
|
|
15267
|
+
id: scheduled.vault_id,
|
|
15268
|
+
status: scheduled.status,
|
|
15269
|
+
deletionRequestedAt: scheduled.deletion_requested_at,
|
|
15270
|
+
deletionScheduledFor: scheduled.deletion_scheduled_for,
|
|
15271
|
+
deletionRequestedBy: scheduled.deletion_requested_by,
|
|
15272
|
+
deletionScheduleId: scheduled.deletion_schedule_id,
|
|
15273
|
+
};
|
|
15274
|
+
}
|
|
15275
|
+
/** Cancel this exact deletion schedule before its deadline; company admins only. */
|
|
15276
|
+
async cancelDeletion(vaultId, deletionScheduleId) {
|
|
15277
|
+
const id = requireResourceId(vaultId, 'vaultId');
|
|
15278
|
+
if (!deletionScheduleId?.trim()) {
|
|
15279
|
+
throw new ValidationError('Deletion schedule is required to cancel deletion');
|
|
15280
|
+
}
|
|
15281
|
+
const response = await this.http.post(apiPath `/v1/vaults/${id}/deletion/cancel`, {
|
|
15282
|
+
deletion_schedule_id: deletionScheduleId,
|
|
15283
|
+
});
|
|
15284
|
+
return mapVaultDetail(response.data);
|
|
15271
15285
|
}
|
|
15272
15286
|
/**
|
|
15273
15287
|
* Get a vault's public-sharing configuration.
|
|
@@ -15448,6 +15462,28 @@ class VaultsModule {
|
|
|
15448
15462
|
}
|
|
15449
15463
|
}
|
|
15450
15464
|
}
|
|
15465
|
+
function mapLifecycle(v) {
|
|
15466
|
+
return {
|
|
15467
|
+
status: v.status,
|
|
15468
|
+
deletionRequestedAt: v.deletion_requested_at,
|
|
15469
|
+
deletionScheduledFor: v.deletion_scheduled_for,
|
|
15470
|
+
deletionRequestedBy: v.deletion_requested_by,
|
|
15471
|
+
deletionScheduleId: v.deletion_schedule_id,
|
|
15472
|
+
};
|
|
15473
|
+
}
|
|
15474
|
+
function mapVaultDetail(v) {
|
|
15475
|
+
return {
|
|
15476
|
+
id: v.vault_id,
|
|
15477
|
+
name: v.name,
|
|
15478
|
+
description: v.description ?? null,
|
|
15479
|
+
...mapLifecycle(v),
|
|
15480
|
+
ingotCount: v.ingot_count ?? 0,
|
|
15481
|
+
storageBytes: v.storage_bytes ?? 0,
|
|
15482
|
+
createdAt: v.created_at,
|
|
15483
|
+
lastUnsealedAt: v.last_unsealed_at ?? null,
|
|
15484
|
+
unsealCount: v.unseal_count ?? 0,
|
|
15485
|
+
};
|
|
15486
|
+
}
|
|
15451
15487
|
function mapSharingConfig$1(wire) {
|
|
15452
15488
|
return {
|
|
15453
15489
|
vaultId: wire.vault_id,
|
|
@@ -17380,7 +17416,7 @@ class SparkVault {
|
|
|
17380
17416
|
}
|
|
17381
17417
|
/** Get the SDK version */
|
|
17382
17418
|
static get version() {
|
|
17383
|
-
return '11.
|
|
17419
|
+
return '11.2.0';
|
|
17384
17420
|
}
|
|
17385
17421
|
}
|
|
17386
17422
|
if (typeof window !== 'undefined') {
|