@sparkvault/sdk-js 12.0.0 → 12.0.2

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 CHANGED
@@ -16987,10 +16987,12 @@ class SparksModule {
16987
16987
  };
16988
16988
  }
16989
16989
  /**
16990
- * Create a spark.
16990
+ * Create a spark. A link spark (contentType text/uri-list, the payload its
16991
+ * destination URL) is created with its x.sv link, `linkUrl`.
16991
16992
  *
16992
16993
  * @example
16993
16994
  * const spark = await sv.sparks.create({ payload: 'top secret', ttlMinutes: 60 });
16995
+ * const { linkUrl } = await sv.sparks.create({ payload: 'https://example.com', contentType: 'text/uri-list' });
16994
16996
  */
16995
16997
  async create(options) {
16996
16998
  if (typeof options.payload !== 'string' || options.payload.length === 0) {
@@ -17017,6 +17019,8 @@ class SparksModule {
17017
17019
  ttlMinutes: data.ttl_minutes,
17018
17020
  filename: data.filename,
17019
17021
  kindling: data.kindling,
17022
+ linkUrl: data.link_url,
17023
+ linkCode: data.link_code,
17020
17024
  };
17021
17025
  }
17022
17026
  /**
@@ -17045,6 +17049,27 @@ class SparksModule {
17045
17049
  });
17046
17050
  return mapShare(response.data);
17047
17051
  }
17052
+ /**
17053
+ * Deliver an invite-only spark's link to its invitee again, changing
17054
+ * nothing about the link: the way on from an invitation that could not be
17055
+ * delivered (a share rejected with INVITATION_DELIVERY_FAILED leaves its
17056
+ * link in place, and the same share again delivers nothing), or one the
17057
+ * invitee never received.
17058
+ *
17059
+ * @example
17060
+ * const { identity } = await sv.sparks.resendInvite('spk_abc');
17061
+ */
17062
+ async resendInvite(sparkId) {
17063
+ const id = requireResourceId(sparkId, 'sparkId');
17064
+ const response = await this.http.post(apiPath `/v1/sparks/${id}/share/resend`);
17065
+ const data = response.data;
17066
+ return {
17067
+ sparkId: data.spark_id,
17068
+ identity: data.identity,
17069
+ identityType: data.identity_type,
17070
+ sentAt: data.sent_at,
17071
+ };
17072
+ }
17048
17073
  /**
17049
17074
  * Get a spark's sharing status.
17050
17075
  *
@@ -17080,6 +17105,7 @@ function mapSummary(wire) {
17080
17105
  timeRemaining: wire.time_remaining ?? 0,
17081
17106
  filename: wire.filename,
17082
17107
  kindling: wire.kindling,
17108
+ linkUrl: wire.link_url,
17083
17109
  };
17084
17110
  }
17085
17111
  function mapShare(wire) {
@@ -17091,6 +17117,7 @@ function mapShare(wire) {
17091
17117
  invites: wire.invites,
17092
17118
  expiresAt: wire.expires_at,
17093
17119
  createdAt: wire.created_at,
17120
+ deliveredTo: wire.delivered_to,
17094
17121
  };
17095
17122
  }
17096
17123
 
@@ -17625,7 +17652,7 @@ class SparkVault {
17625
17652
  }
17626
17653
  /** Get the SDK version */
17627
17654
  static get version() {
17628
- return '12.0.0';
17655
+ return '12.0.2';
17629
17656
  }
17630
17657
  }
17631
17658
  if (typeof window !== 'undefined') {