@sparkvault/sdk-js 12.0.0 → 12.0.1

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.d.ts CHANGED
@@ -3098,13 +3098,16 @@ interface SparkSummary {
3098
3098
  contentType: string;
3099
3099
  /** Size in bytes */
3100
3100
  size: number;
3101
- /** Lifecycle status (active | expired | ash) */
3101
+ /**
3102
+ * Lifecycle status: active, expired, ash (a recipient read it, and it
3103
+ * burned) or deleted (its owner deleted it, which burns its content too)
3104
+ */
3102
3105
  status: string;
3103
3106
  /** Creation timestamp (Unix seconds) */
3104
3107
  createdAt: number;
3105
3108
  /** Expiry timestamp (Unix seconds) */
3106
3109
  expiresAt: number;
3107
- /** Burn timestamp (Unix seconds), or null if not yet read */
3110
+ /** The read's burn timestamp (Unix seconds), or null if not read (a deleted spark's included) */
3108
3111
  burnedAt: number | null;
3109
3112
  /** Seconds remaining until expiry */
3110
3113
  timeRemaining: number;
@@ -3112,6 +3115,8 @@ interface SparkSummary {
3112
3115
  filename?: string;
3113
3116
  /** Optional kindling family ID */
3114
3117
  kindling?: string;
3118
+ /** A link spark (contentType text/uri-list) only: its x.sv link */
3119
+ linkUrl?: string;
3115
3120
  }
3116
3121
  /** The decrypted spark, returned by get (reading burns it). */
3117
3122
  interface Spark {
@@ -3166,6 +3171,13 @@ interface CreatedSpark {
3166
3171
  filename?: string;
3167
3172
  /** Optional kindling family ID (echoed when provided) */
3168
3173
  kindling?: string;
3174
+ /**
3175
+ * A link spark (contentType text/uri-list) only: its x.sv link, which opens
3176
+ * once and redirects to the payload's URL. It is minted with the spark.
3177
+ */
3178
+ linkUrl?: string;
3179
+ /** A link spark only: the code in linkUrl */
3180
+ linkCode?: string;
3169
3181
  }
3170
3182
  /** Options for list. */
3171
3183
  interface ListSparksOptions {
@@ -3230,6 +3242,23 @@ interface SparkShare {
3230
3242
  expiresAt?: number;
3231
3243
  /** Link creation timestamp (Unix seconds) */
3232
3244
  createdAt?: number;
3245
+ /**
3246
+ * The invitees this share delivered the link to (share only): none for a
3247
+ * share that invites no one new. An invitee already on the link is sent it
3248
+ * again by resendInvite.
3249
+ */
3250
+ deliveredTo?: string[];
3251
+ }
3252
+ /** An invitation delivered again, as resendInvite answers it. */
3253
+ interface SparkInviteResend {
3254
+ /** Spark ID */
3255
+ sparkId: string;
3256
+ /** The invitee the link was delivered to */
3257
+ identity: string;
3258
+ /** How it was delivered: by email or by SMS */
3259
+ identityType: 'email' | 'phone';
3260
+ /** Delivery timestamp (Unix seconds) */
3261
+ sentAt: number;
3233
3262
  }
3234
3263
 
3235
3264
  /**
@@ -3259,10 +3288,12 @@ declare class SparksModule {
3259
3288
  */
3260
3289
  get(sparkId: string): Promise<Spark>;
3261
3290
  /**
3262
- * Create a spark.
3291
+ * Create a spark. A link spark (contentType text/uri-list, the payload its
3292
+ * destination URL) is created with its x.sv link, `linkUrl`.
3263
3293
  *
3264
3294
  * @example
3265
3295
  * const spark = await sv.sparks.create({ payload: 'top secret', ttlMinutes: 60 });
3296
+ * const { linkUrl } = await sv.sparks.create({ payload: 'https://example.com', contentType: 'text/uri-list' });
3266
3297
  */
3267
3298
  create(options: CreateSparkOptions): Promise<CreatedSpark>;
3268
3299
  /**
@@ -3280,6 +3311,17 @@ declare class SparksModule {
3280
3311
  * console.log(share.shareUrl);
3281
3312
  */
3282
3313
  share(sparkId: string, options?: ShareSparkOptions): Promise<SparkShare>;
3314
+ /**
3315
+ * Deliver an invite-only spark's link to its invitee again, changing
3316
+ * nothing about the link: the way on from an invitation that could not be
3317
+ * delivered (a share rejected with INVITATION_DELIVERY_FAILED leaves its
3318
+ * link in place, and the same share again delivers nothing), or one the
3319
+ * invitee never received.
3320
+ *
3321
+ * @example
3322
+ * const { identity } = await sv.sparks.resendInvite('spk_abc');
3323
+ */
3324
+ resendInvite(sparkId: string): Promise<SparkInviteResend>;
3283
3325
  /**
3284
3326
  * Get a spark's sharing status.
3285
3327
  *
@@ -3650,4 +3692,4 @@ declare global {
3650
3692
  }
3651
3693
 
3652
3694
  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 };
3653
- export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, 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, 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 };
3695
+ export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, 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, 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, SparkInviteResend, 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
@@ -16983,10 +16983,12 @@ class SparksModule {
16983
16983
  };
16984
16984
  }
16985
16985
  /**
16986
- * Create a spark.
16986
+ * Create a spark. A link spark (contentType text/uri-list, the payload its
16987
+ * destination URL) is created with its x.sv link, `linkUrl`.
16987
16988
  *
16988
16989
  * @example
16989
16990
  * const spark = await sv.sparks.create({ payload: 'top secret', ttlMinutes: 60 });
16991
+ * const { linkUrl } = await sv.sparks.create({ payload: 'https://example.com', contentType: 'text/uri-list' });
16990
16992
  */
16991
16993
  async create(options) {
16992
16994
  if (typeof options.payload !== 'string' || options.payload.length === 0) {
@@ -17013,6 +17015,8 @@ class SparksModule {
17013
17015
  ttlMinutes: data.ttl_minutes,
17014
17016
  filename: data.filename,
17015
17017
  kindling: data.kindling,
17018
+ linkUrl: data.link_url,
17019
+ linkCode: data.link_code,
17016
17020
  };
17017
17021
  }
17018
17022
  /**
@@ -17041,6 +17045,27 @@ class SparksModule {
17041
17045
  });
17042
17046
  return mapShare(response.data);
17043
17047
  }
17048
+ /**
17049
+ * Deliver an invite-only spark's link to its invitee again, changing
17050
+ * nothing about the link: the way on from an invitation that could not be
17051
+ * delivered (a share rejected with INVITATION_DELIVERY_FAILED leaves its
17052
+ * link in place, and the same share again delivers nothing), or one the
17053
+ * invitee never received.
17054
+ *
17055
+ * @example
17056
+ * const { identity } = await sv.sparks.resendInvite('spk_abc');
17057
+ */
17058
+ async resendInvite(sparkId) {
17059
+ const id = requireResourceId(sparkId, 'sparkId');
17060
+ const response = await this.http.post(apiPath `/v1/sparks/${id}/share/resend`);
17061
+ const data = response.data;
17062
+ return {
17063
+ sparkId: data.spark_id,
17064
+ identity: data.identity,
17065
+ identityType: data.identity_type,
17066
+ sentAt: data.sent_at,
17067
+ };
17068
+ }
17044
17069
  /**
17045
17070
  * Get a spark's sharing status.
17046
17071
  *
@@ -17076,6 +17101,7 @@ function mapSummary(wire) {
17076
17101
  timeRemaining: wire.time_remaining ?? 0,
17077
17102
  filename: wire.filename,
17078
17103
  kindling: wire.kindling,
17104
+ linkUrl: wire.link_url,
17079
17105
  };
17080
17106
  }
17081
17107
  function mapShare(wire) {
@@ -17087,6 +17113,7 @@ function mapShare(wire) {
17087
17113
  invites: wire.invites,
17088
17114
  expiresAt: wire.expires_at,
17089
17115
  createdAt: wire.created_at,
17116
+ deliveredTo: wire.delivered_to,
17090
17117
  };
17091
17118
  }
17092
17119
 
@@ -17621,7 +17648,7 @@ class SparkVault {
17621
17648
  }
17622
17649
  /** Get the SDK version */
17623
17650
  static get version() {
17624
- return '12.0.0';
17651
+ return '12.0.1';
17625
17652
  }
17626
17653
  }
17627
17654
  if (typeof window !== 'undefined') {