@sparkvault/sdk-js 14.2.3 → 15.0.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 +24 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +98 -22
- package/dist/index.mjs +24 -10
- package/dist/index.mjs.map +1 -1
- package/dist/sparks/index.d.ts +20 -9
- package/dist/sparks/types.d.ts +82 -15
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4639,9 +4639,9 @@ declare class FoldersModule {
|
|
|
4639
4639
|
/**
|
|
4640
4640
|
* Sparks Module Types
|
|
4641
4641
|
*
|
|
4642
|
-
* Sparks are
|
|
4643
|
-
*
|
|
4644
|
-
* (snake_case) stay private to the module.
|
|
4642
|
+
* Sparks are ephemeral secrets scoped to the account (no vault/VAT), sealed
|
|
4643
|
+
* server-side under platform-held keys and read once. Public domain objects
|
|
4644
|
+
* are camelCase; wire shapes (snake_case) stay private to the module.
|
|
4645
4645
|
*/
|
|
4646
4646
|
/** A spark summary as returned by list. */
|
|
4647
4647
|
interface SparkSummary {
|
|
@@ -4652,15 +4652,21 @@ interface SparkSummary {
|
|
|
4652
4652
|
/** Size in bytes */
|
|
4653
4653
|
size: number;
|
|
4654
4654
|
/**
|
|
4655
|
-
*
|
|
4656
|
-
*
|
|
4655
|
+
* Its state when the list answers: active while its content is live (a
|
|
4656
|
+
* spark a recipient is reading included), ash once a recipient read or
|
|
4657
|
+
* answered it or its content was recalled (past its expiry too), expired
|
|
4658
|
+
* past its expiry and never burned, deleted once its owner deleted it
|
|
4659
|
+
* (never reported ash)
|
|
4657
4660
|
*/
|
|
4658
|
-
status:
|
|
4661
|
+
status: 'active' | 'ash' | 'expired' | 'deleted';
|
|
4659
4662
|
/** Creation timestamp (Unix seconds) */
|
|
4660
4663
|
createdAt: number;
|
|
4661
4664
|
/** Expiry timestamp (Unix seconds) */
|
|
4662
4665
|
expiresAt: number;
|
|
4663
|
-
/**
|
|
4666
|
+
/**
|
|
4667
|
+
* When it turned ash (Unix seconds); null for every other status, deleted
|
|
4668
|
+
* included, though a delete burns the content too
|
|
4669
|
+
*/
|
|
4664
4670
|
burnedAt: number | null;
|
|
4665
4671
|
/** Seconds remaining until expiry */
|
|
4666
4672
|
timeRemaining: number;
|
|
@@ -4668,7 +4674,11 @@ interface SparkSummary {
|
|
|
4668
4674
|
filename?: string;
|
|
4669
4675
|
/** Optional kindling family ID */
|
|
4670
4676
|
kindling?: string;
|
|
4671
|
-
/**
|
|
4677
|
+
/**
|
|
4678
|
+
* Its x.sv link, while it has one: a link spark (contentType text/uri-list)
|
|
4679
|
+
* from its create, any other spark from its share until it is unshared. A
|
|
4680
|
+
* deleted spark keeps the link it had, which opens nothing.
|
|
4681
|
+
*/
|
|
4672
4682
|
linkUrl?: string;
|
|
4673
4683
|
}
|
|
4674
4684
|
/** The decrypted spark, returned by get (reading burns it). */
|
|
@@ -4739,8 +4749,14 @@ interface CreatedSpark {
|
|
|
4739
4749
|
interface ListSparksOptions {
|
|
4740
4750
|
/** Filter to a kindling family */
|
|
4741
4751
|
kindling?: string;
|
|
4742
|
-
/**
|
|
4743
|
-
|
|
4752
|
+
/**
|
|
4753
|
+
* Filter by status, matching each listed spark's `status`: `active` lists
|
|
4754
|
+
* the sparks whose content is live (not burned, not past its expiry; a spark
|
|
4755
|
+
* mid-read included), `ash` those a recipient read, recalled or answered (a
|
|
4756
|
+
* spark its owner deleted is `deleted`, in neither). The API refuses any
|
|
4757
|
+
* other value.
|
|
4758
|
+
*/
|
|
4759
|
+
status?: 'active' | 'ash';
|
|
4744
4760
|
/** Page size */
|
|
4745
4761
|
limit?: number;
|
|
4746
4762
|
/** Pagination cursor */
|
|
@@ -4773,14 +4789,51 @@ interface CreateSparkOptions {
|
|
|
4773
4789
|
}
|
|
4774
4790
|
/** Visibility mode for a shared spark. */
|
|
4775
4791
|
type SparkVisibility = 'public' | 'authenticated' | 'invite_only';
|
|
4776
|
-
/**
|
|
4792
|
+
/**
|
|
4793
|
+
* Options for share. A spark already shared keeps its link: the settings are
|
|
4794
|
+
* applied to it in place, and its code never changes.
|
|
4795
|
+
*/
|
|
4777
4796
|
interface ShareSparkOptions {
|
|
4778
|
-
/**
|
|
4797
|
+
/**
|
|
4798
|
+
* Visibility mode: public on a spark's first share; an omitted visibility
|
|
4799
|
+
* keeps the link's current one.
|
|
4800
|
+
*/
|
|
4779
4801
|
visibility?: SparkVisibility;
|
|
4780
|
-
/**
|
|
4802
|
+
/**
|
|
4803
|
+
* The identity (an email address or a phone number) invited to an
|
|
4804
|
+
* invite_only link: exactly one, which the link is delivered to. Refused
|
|
4805
|
+
* with any other visibility. An omitted list keeps the link's current
|
|
4806
|
+
* invitee.
|
|
4807
|
+
*/
|
|
4781
4808
|
invites?: string[];
|
|
4782
|
-
/**
|
|
4809
|
+
/**
|
|
4810
|
+
* Link lifetime in seconds, from 60, capped at the spark's own expiry.
|
|
4811
|
+
* Applies to a spark's first share only: a change to an existing link keeps
|
|
4812
|
+
* its lifetime.
|
|
4813
|
+
*/
|
|
4783
4814
|
expiresInSeconds?: number;
|
|
4815
|
+
/**
|
|
4816
|
+
* The link this change was asked of (its `linkCode`, as a share answered
|
|
4817
|
+
* it). When it is no longer the spark's link (turned off, or replaced by
|
|
4818
|
+
* another share), the change is refused with a 409 CONFLICT and changes
|
|
4819
|
+
* nothing. Omitted, the change applies to the spark's link now.
|
|
4820
|
+
*/
|
|
4821
|
+
linkCode?: string;
|
|
4822
|
+
}
|
|
4823
|
+
/**
|
|
4824
|
+
* Options for resendInvite and unshare, which act on a spark's existing link.
|
|
4825
|
+
*/
|
|
4826
|
+
interface SparkLinkActionOptions {
|
|
4827
|
+
/**
|
|
4828
|
+
* The link this request was asked of (its `linkCode`, as a share answered
|
|
4829
|
+
* it). A resend asked of a link that is no longer the spark's link (turned
|
|
4830
|
+
* off, or replaced by another share) is refused with a 409 CONFLICT,
|
|
4831
|
+
* delivering nothing. An unshare is refused only when another share
|
|
4832
|
+
* replaced the link, deleting nothing; a link already turned off answers
|
|
4833
|
+
* `shared: false`, so a retried unshare is never refused. Omitted, the
|
|
4834
|
+
* request acts on the spark's link now.
|
|
4835
|
+
*/
|
|
4836
|
+
linkCode?: string;
|
|
4784
4837
|
}
|
|
4785
4838
|
/** The result of sharing a spark. */
|
|
4786
4839
|
interface SparkShare {
|
|
@@ -4794,6 +4847,13 @@ interface SparkShare {
|
|
|
4794
4847
|
visibility?: SparkVisibility;
|
|
4795
4848
|
/** Invited identities */
|
|
4796
4849
|
invites?: string[];
|
|
4850
|
+
/**
|
|
4851
|
+
* The link's status: active; consumed once it was opened (it opens once);
|
|
4852
|
+
* or expired once a link never opened opens nothing: from its `expiresAt`
|
|
4853
|
+
* on, or once its spark is burned (read by its id) or reaches its own
|
|
4854
|
+
* expiry. A change or a resend is then refused (403 FORBIDDEN).
|
|
4855
|
+
*/
|
|
4856
|
+
status?: 'active' | 'consumed' | 'expired';
|
|
4797
4857
|
/** Link expiry timestamp (Unix seconds) */
|
|
4798
4858
|
expiresAt?: number;
|
|
4799
4859
|
/** Link creation timestamp (Unix seconds) */
|
|
@@ -4804,6 +4864,11 @@ interface SparkShare {
|
|
|
4804
4864
|
* again by resendInvite.
|
|
4805
4865
|
*/
|
|
4806
4866
|
deliveredTo?: string[];
|
|
4867
|
+
/**
|
|
4868
|
+
* True when the spark was already shared, so the share applied its
|
|
4869
|
+
* settings to the existing link in place (share only)
|
|
4870
|
+
*/
|
|
4871
|
+
alreadyShared?: boolean;
|
|
4807
4872
|
}
|
|
4808
4873
|
/** An invitation delivered again, as resendInvite answers it. */
|
|
4809
4874
|
interface SparkInviteResend {
|
|
@@ -4820,8 +4885,9 @@ interface SparkInviteResend {
|
|
|
4820
4885
|
/**
|
|
4821
4886
|
* Sparks Module
|
|
4822
4887
|
*
|
|
4823
|
-
* Create, read, share, and delete
|
|
4824
|
-
*
|
|
4888
|
+
* Create, read, share, and delete ephemeral secrets, sealed server-side under
|
|
4889
|
+
* platform-held keys and read once. Sparks are account-scoped — no vault or
|
|
4890
|
+
* VAT is involved.
|
|
4825
4891
|
*/
|
|
4826
4892
|
|
|
4827
4893
|
declare class SparksModule {
|
|
@@ -4860,7 +4926,12 @@ declare class SparksModule {
|
|
|
4860
4926
|
*/
|
|
4861
4927
|
delete(sparkId: string): Promise<void>;
|
|
4862
4928
|
/**
|
|
4863
|
-
* Share a spark via a
|
|
4929
|
+
* Share a spark via a SparkLink (x.sv URL). A spark already shared keeps
|
|
4930
|
+
* its link: the settings are applied to it in place (`alreadyShared`), an
|
|
4931
|
+
* omitted visibility keeps the current one, and `expiresInSeconds` applies
|
|
4932
|
+
* to the first share only. `linkCode` names the link the change was asked
|
|
4933
|
+
* of: a change asked of a link replaced or turned off since is refused
|
|
4934
|
+
* (409 CONFLICT).
|
|
4864
4935
|
*
|
|
4865
4936
|
* @example
|
|
4866
4937
|
* const share = await sv.sparks.share('spk_abc', { visibility: 'public' });
|
|
@@ -4872,12 +4943,13 @@ declare class SparksModule {
|
|
|
4872
4943
|
* nothing about the link: the way on from an invitation that could not be
|
|
4873
4944
|
* delivered (a share rejected with INVITATION_DELIVERY_FAILED leaves its
|
|
4874
4945
|
* link in place, and the same share again delivers nothing), or one the
|
|
4875
|
-
* invitee never received.
|
|
4946
|
+
* invitee never received. `linkCode` names the link the resend was asked
|
|
4947
|
+
* of: a link replaced since is never delivered in its place (409 CONFLICT).
|
|
4876
4948
|
*
|
|
4877
4949
|
* @example
|
|
4878
4950
|
* const { identity } = await sv.sparks.resendInvite('spk_abc');
|
|
4879
4951
|
*/
|
|
4880
|
-
resendInvite(sparkId: string): Promise<SparkInviteResend>;
|
|
4952
|
+
resendInvite(sparkId: string, options?: SparkLinkActionOptions): Promise<SparkInviteResend>;
|
|
4881
4953
|
/**
|
|
4882
4954
|
* Get a spark's sharing status.
|
|
4883
4955
|
*
|
|
@@ -4886,12 +4958,16 @@ declare class SparksModule {
|
|
|
4886
4958
|
*/
|
|
4887
4959
|
getShare(sparkId: string): Promise<SparkShare>;
|
|
4888
4960
|
/**
|
|
4889
|
-
* Unshare a spark (delete its SparkLink).
|
|
4961
|
+
* Unshare a spark (delete its SparkLink). Idempotent: a spark with no link
|
|
4962
|
+
* answers `shared: false`, the link `linkCode` names included, so a retried
|
|
4963
|
+
* unshare is never refused. A `linkCode` naming a link another share
|
|
4964
|
+
* replaced since is refused (409 CONFLICT), so the link that took its place
|
|
4965
|
+
* is never deleted.
|
|
4890
4966
|
*
|
|
4891
4967
|
* @example
|
|
4892
4968
|
* await sv.sparks.unshare('spk_abc');
|
|
4893
4969
|
*/
|
|
4894
|
-
unshare(sparkId: string): Promise<SparkShare>;
|
|
4970
|
+
unshare(sparkId: string, options?: SparkLinkActionOptions): Promise<SparkShare>;
|
|
4895
4971
|
}
|
|
4896
4972
|
|
|
4897
4973
|
/**
|
|
@@ -5227,4 +5303,4 @@ declare global {
|
|
|
5227
5303
|
}
|
|
5228
5304
|
|
|
5229
5305
|
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, HelpDeskClient, HelpDeskModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UnauthorizedError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
|
|
5230
|
-
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, DownloadIngotOptions, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, HelpDeskAttachmentDownload, HelpDeskAttachmentInput, HelpDeskAttachmentUpload, HelpDeskConnectOptions, HelpDeskCreateTicketOptions, HelpDeskCustomer, HelpDeskCustomerPatch, HelpDeskDesk, HelpDeskDraft, HelpDeskEvent, HelpDeskExternalChallenge, HelpDeskExternalIdentity, HelpDeskFormHandle, HelpDeskFormOptions, HelpDeskFormState, HelpDeskIdentityRequest, HelpDeskListTicketsOptions, HelpDeskMountFormOptions, HelpDeskOpenFormOptions, HelpDeskPinChallenge, HelpDeskReplyCreated, HelpDeskReplyOptions, HelpDeskRequestContext, HelpDeskSession, HelpDeskSessionChange, HelpDeskTicket, HelpDeskTicketCreated, HelpDeskTicketDetail, HelpDeskTicketList, HelpDeskTimeline, HelpDeskVerifyPinOptions, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotificationSender, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigDestinations, NotifyConfigDestinationsPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyDestinationFailureReason, NotifyDestinationKind, NotifyDestinationReason, NotifyDestinationSkipReason, NotifyDestinationState, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifyDestinationTransportReason, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusDestination, NotifySendStatusRecipient, NotifySendSummary, NotifySendSummaryDestination, NotifySlackDestination, NotifySuppressionReason, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyVerificationLevel, NotifyWebhookDestination, NotifyWebhookDestinationRead, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, SignInOptions, SignInResult, Spark, SparkInviteResend, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, StartedVaultDeletion, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreachedAdmin, UnreadCountResponse, UnsealVaultOptions, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultResealDefaults, VaultResealSettings, VaultResealSettingsResult, VaultSessionExtension, VaultSessionTiming, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };
|
|
5306
|
+
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, DownloadIngotOptions, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, HelpDeskAttachmentDownload, HelpDeskAttachmentInput, HelpDeskAttachmentUpload, HelpDeskConnectOptions, HelpDeskCreateTicketOptions, HelpDeskCustomer, HelpDeskCustomerPatch, HelpDeskDesk, HelpDeskDraft, HelpDeskEvent, HelpDeskExternalChallenge, HelpDeskExternalIdentity, HelpDeskFormHandle, HelpDeskFormOptions, HelpDeskFormState, HelpDeskIdentityRequest, HelpDeskListTicketsOptions, HelpDeskMountFormOptions, HelpDeskOpenFormOptions, HelpDeskPinChallenge, HelpDeskReplyCreated, HelpDeskReplyOptions, HelpDeskRequestContext, HelpDeskSession, HelpDeskSessionChange, HelpDeskTicket, HelpDeskTicketCreated, HelpDeskTicketDetail, HelpDeskTicketList, HelpDeskTimeline, HelpDeskVerifyPinOptions, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotificationSender, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigDestinations, NotifyConfigDestinationsPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyDestinationFailureReason, NotifyDestinationKind, NotifyDestinationReason, NotifyDestinationSkipReason, NotifyDestinationState, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifyDestinationTransportReason, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusDestination, NotifySendStatusRecipient, NotifySendSummary, NotifySendSummaryDestination, NotifySlackDestination, NotifySuppressionReason, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyVerificationLevel, NotifyWebhookDestination, NotifyWebhookDestinationRead, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, SignInOptions, SignInResult, Spark, SparkInviteResend, SparkLinkActionOptions, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, StartedVaultDeletion, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreachedAdmin, UnreadCountResponse, UnsealVaultOptions, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultResealDefaults, VaultResealSettings, VaultResealSettingsResult, VaultSessionExtension, VaultSessionTiming, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };
|
package/dist/index.mjs
CHANGED
|
@@ -21349,8 +21349,9 @@ function mapUploadSettings(wire) {
|
|
|
21349
21349
|
/**
|
|
21350
21350
|
* Sparks Module
|
|
21351
21351
|
*
|
|
21352
|
-
* Create, read, share, and delete
|
|
21353
|
-
*
|
|
21352
|
+
* Create, read, share, and delete ephemeral secrets, sealed server-side under
|
|
21353
|
+
* platform-held keys and read once. Sparks are account-scoped — no vault or
|
|
21354
|
+
* VAT is involved.
|
|
21354
21355
|
*/
|
|
21355
21356
|
class SparksModule {
|
|
21356
21357
|
constructor(http) {
|
|
@@ -21448,7 +21449,12 @@ class SparksModule {
|
|
|
21448
21449
|
await this.http.delete(apiPath `/v1/sparks/${id}`);
|
|
21449
21450
|
}
|
|
21450
21451
|
/**
|
|
21451
|
-
* Share a spark via a
|
|
21452
|
+
* Share a spark via a SparkLink (x.sv URL). A spark already shared keeps
|
|
21453
|
+
* its link: the settings are applied to it in place (`alreadyShared`), an
|
|
21454
|
+
* omitted visibility keeps the current one, and `expiresInSeconds` applies
|
|
21455
|
+
* to the first share only. `linkCode` names the link the change was asked
|
|
21456
|
+
* of: a change asked of a link replaced or turned off since is refused
|
|
21457
|
+
* (409 CONFLICT).
|
|
21452
21458
|
*
|
|
21453
21459
|
* @example
|
|
21454
21460
|
* const share = await sv.sparks.share('spk_abc', { visibility: 'public' });
|
|
@@ -21460,6 +21466,7 @@ class SparksModule {
|
|
|
21460
21466
|
visibility: options.visibility,
|
|
21461
21467
|
invites: options.invites,
|
|
21462
21468
|
expires_in_seconds: options.expiresInSeconds,
|
|
21469
|
+
link_code: options.linkCode,
|
|
21463
21470
|
});
|
|
21464
21471
|
return mapShare(response.data);
|
|
21465
21472
|
}
|
|
@@ -21468,14 +21475,15 @@ class SparksModule {
|
|
|
21468
21475
|
* nothing about the link: the way on from an invitation that could not be
|
|
21469
21476
|
* delivered (a share rejected with INVITATION_DELIVERY_FAILED leaves its
|
|
21470
21477
|
* link in place, and the same share again delivers nothing), or one the
|
|
21471
|
-
* invitee never received.
|
|
21478
|
+
* invitee never received. `linkCode` names the link the resend was asked
|
|
21479
|
+
* of: a link replaced since is never delivered in its place (409 CONFLICT).
|
|
21472
21480
|
*
|
|
21473
21481
|
* @example
|
|
21474
21482
|
* const { identity } = await sv.sparks.resendInvite('spk_abc');
|
|
21475
21483
|
*/
|
|
21476
|
-
async resendInvite(sparkId) {
|
|
21484
|
+
async resendInvite(sparkId, options = {}) {
|
|
21477
21485
|
const id = requireResourceId(sparkId, 'sparkId');
|
|
21478
|
-
const response = await this.http.post(apiPath `/v1/sparks/${id}/share/resend
|
|
21486
|
+
const response = await this.http.post(apiPath `/v1/sparks/${id}/share/resend`, options.linkCode === undefined ? undefined : { link_code: options.linkCode });
|
|
21479
21487
|
const data = response.data;
|
|
21480
21488
|
return {
|
|
21481
21489
|
sparkId: data.spark_id,
|
|
@@ -21496,14 +21504,18 @@ class SparksModule {
|
|
|
21496
21504
|
return mapShare(response.data);
|
|
21497
21505
|
}
|
|
21498
21506
|
/**
|
|
21499
|
-
* Unshare a spark (delete its SparkLink).
|
|
21507
|
+
* Unshare a spark (delete its SparkLink). Idempotent: a spark with no link
|
|
21508
|
+
* answers `shared: false`, the link `linkCode` names included, so a retried
|
|
21509
|
+
* unshare is never refused. A `linkCode` naming a link another share
|
|
21510
|
+
* replaced since is refused (409 CONFLICT), so the link that took its place
|
|
21511
|
+
* is never deleted.
|
|
21500
21512
|
*
|
|
21501
21513
|
* @example
|
|
21502
21514
|
* await sv.sparks.unshare('spk_abc');
|
|
21503
21515
|
*/
|
|
21504
|
-
async unshare(sparkId) {
|
|
21516
|
+
async unshare(sparkId, options = {}) {
|
|
21505
21517
|
const id = requireResourceId(sparkId, 'sparkId');
|
|
21506
|
-
const response = await this.http.delete(apiPath `/v1/sparks/${id}/share
|
|
21518
|
+
const response = await this.http.delete(apiPath `/v1/sparks/${id}/share`, { query: { link_code: options.linkCode } });
|
|
21507
21519
|
return mapShare(response.data);
|
|
21508
21520
|
}
|
|
21509
21521
|
}
|
|
@@ -21529,9 +21541,11 @@ function mapShare(wire) {
|
|
|
21529
21541
|
linkCode: wire.link_code,
|
|
21530
21542
|
visibility: wire.visibility,
|
|
21531
21543
|
invites: wire.invites,
|
|
21544
|
+
status: wire.status,
|
|
21532
21545
|
expiresAt: wire.expires_at,
|
|
21533
21546
|
createdAt: wire.created_at,
|
|
21534
21547
|
deliveredTo: wire.delivered_to,
|
|
21548
|
+
alreadyShared: wire.already_shared,
|
|
21535
21549
|
};
|
|
21536
21550
|
}
|
|
21537
21551
|
|
|
@@ -22087,7 +22101,7 @@ class SparkVault {
|
|
|
22087
22101
|
}
|
|
22088
22102
|
/** Get the SDK version */
|
|
22089
22103
|
static get version() {
|
|
22090
|
-
return '
|
|
22104
|
+
return '15.0.0';
|
|
22091
22105
|
}
|
|
22092
22106
|
}
|
|
22093
22107
|
if (typeof window !== 'undefined') {
|