@proveanything/smartlinks 1.16.4 → 1.16.5
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/api/proof.d.ts +7 -0
- package/dist/api/proof.js +7 -0
- package/dist/docs/API_SUMMARY.md +8 -3
- package/dist/docs/proof-comms-triggers.md +5 -0
- package/dist/docs/proof-ownership-transfer.md +12 -1
- package/dist/openapi.yaml +2 -0
- package/dist/types/proof.d.ts +9 -2
- package/docs/API_SUMMARY.md +8 -3
- package/docs/proof-comms-triggers.md +5 -0
- package/docs/proof-ownership-transfer.md +12 -1
- package/openapi.yaml +2 -0
- package/package.json +1 -1
package/dist/api/proof.d.ts
CHANGED
|
@@ -187,6 +187,13 @@ export declare namespace proof {
|
|
|
187
187
|
* },
|
|
188
188
|
* })
|
|
189
189
|
* ```
|
|
190
|
+
* Direct to an SMS recipient by phone (E.164) and notify them by text:
|
|
191
|
+
* ```ts
|
|
192
|
+
* await proof.transfer(collectionId, productId, proofId, {
|
|
193
|
+
* toPhone: '+14155551234',
|
|
194
|
+
* comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } },
|
|
195
|
+
* })
|
|
196
|
+
* ```
|
|
190
197
|
*/
|
|
191
198
|
function transfer(collectionId: string, productId: string, proofId: string, options: TransferProofOptions): Promise<TransferProofResult>;
|
|
192
199
|
/**
|
package/dist/api/proof.js
CHANGED
|
@@ -280,6 +280,13 @@ export var proof;
|
|
|
280
280
|
* },
|
|
281
281
|
* })
|
|
282
282
|
* ```
|
|
283
|
+
* Direct to an SMS recipient by phone (E.164) and notify them by text:
|
|
284
|
+
* ```ts
|
|
285
|
+
* await proof.transfer(collectionId, productId, proofId, {
|
|
286
|
+
* toPhone: '+14155551234',
|
|
287
|
+
* comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } },
|
|
288
|
+
* })
|
|
289
|
+
* ```
|
|
283
290
|
*/
|
|
284
291
|
async function transfer(collectionId, productId, proofId, options) {
|
|
285
292
|
return post(transferBase(collectionId, productId, proofId), Object.assign({}, options));
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.5 | Generated: 2026-09-05T15:46:49.017Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -7605,9 +7605,14 @@ interface CommsTrigger {
|
|
|
7605
7605
|
```typescript
|
|
7606
7606
|
interface TransferProofOptions {
|
|
7607
7607
|
* Comms to send. Roles: `recipient` (the named new owner) and `sender` (the
|
|
7608
|
-
* initiator) for a directed transfer; `owner` for an open release.
|
|
7608
|
+
* initiator) for a directed transfer; `owner` for an open release. For an
|
|
7609
|
+
* SMS recipient, set `comms.recipient.channel = 'sms'`.
|
|
7609
7610
|
comms?: CommsTriggerMap
|
|
7610
7611
|
toEmail?: string
|
|
7612
|
+
* Directed: recipient phone in E.164 (e.g. `+14155551234`). Resolves to the same
|
|
7613
|
+
* user they log in as via SMS OTP (created if needed). Pair with an SMS comms
|
|
7614
|
+
* trigger to notify them: `comms.recipient.channel = 'sms'`.
|
|
7615
|
+
toPhone?: string
|
|
7611
7616
|
toUserId?: string
|
|
7612
7617
|
toName?: string
|
|
7613
7618
|
release?: boolean
|
|
@@ -10470,7 +10475,7 @@ Redeem a grant token (anonymous or signed-in). Records the redemption and return
|
|
|
10470
10475
|
productId: string,
|
|
10471
10476
|
proofId: string,
|
|
10472
10477
|
options: TransferProofOptions) → `Promise<TransferProofResult>`
|
|
10473
|
-
Start a push transfer of a proof (current owner / collection admin only). Directed — hand it to a named recipient who then calls {@link acceptTransfer}: ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com' }) ``` Open release — make the proof claimable by anyone: ```ts await proof.transfer(collectionId, productId, proofId, { release: true }) ``` Send comms by naming templates per role (server decides who receives each): ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com', comms: { recipient: { templateId: 'transfer-incoming', props: { note: 'Enjoy!' } }, sender: { templateId: 'transfer-sent' }, }, }) ```
|
|
10478
|
+
Start a push transfer of a proof (current owner / collection admin only). Directed — hand it to a named recipient who then calls {@link acceptTransfer}: ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com' }) ``` Open release — make the proof claimable by anyone: ```ts await proof.transfer(collectionId, productId, proofId, { release: true }) ``` Send comms by naming templates per role (server decides who receives each): ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com', comms: { recipient: { templateId: 'transfer-incoming', props: { note: 'Enjoy!' } }, sender: { templateId: 'transfer-sent' }, }, }) ``` Direct to an SMS recipient by phone (E.164) and notify them by text: ```ts await proof.transfer(collectionId, productId, proofId, { toPhone: '+14155551234', comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } }, }) ```
|
|
10474
10479
|
|
|
10475
10480
|
**acceptTransfer**(collectionId: string,
|
|
10476
10481
|
productId: string,
|
|
@@ -128,6 +128,11 @@ Omit `comms` entirely and nothing is sent — comms are **opt-in**.
|
|
|
128
128
|
|
|
129
129
|
- **Email-only recipients work.** A directed transfer to a `toEmail` that isn't a
|
|
130
130
|
contact yet resolves/creates a contact before sending.
|
|
131
|
+
- **SMS recipients work the same way.** A directed transfer to a `toPhone` (E.164)
|
|
132
|
+
resolves the recipient by phone and gives their contact a phone identity, so an
|
|
133
|
+
SMS-channel trigger (`channel: 'sms'`) reaches them. Because the phone maps to a
|
|
134
|
+
stable Firebase uid, they accept by logging in via SMS OTP — the accept is still
|
|
135
|
+
auth-gated exactly as with email.
|
|
131
136
|
- **Consent + suppression apply.** Transactional sends still respect the contact's
|
|
132
137
|
channel consent and suppression list; a template's `topic` governs this.
|
|
133
138
|
- **Delivery is logged** to comms history (with your `appId` and a `ref`), so sends
|
|
@@ -15,9 +15,20 @@ reserves states for them.
|
|
|
15
15
|
|
|
16
16
|
| Mode | How | Who completes it |
|
|
17
17
|
|------|-----|------------------|
|
|
18
|
-
| **Directed** | Owner names a recipient (`toEmail` / `toUserId`). The proof is earmarked for them (`claimUserId`); you notify them with a comms trigger. | The named recipient calls `acceptTransfer`. |
|
|
18
|
+
| **Directed** | Owner names a recipient (`toEmail` / `toPhone` / `toUserId`). The proof is earmarked for them (`claimUserId`); you notify them with a comms trigger. | The named recipient calls `acceptTransfer`. |
|
|
19
19
|
| **Open release** | Owner marks the proof `claimable`. | Anyone claims it via the normal claim flow. |
|
|
20
20
|
|
|
21
|
+
A `toPhone` recipient (E.164) resolves to the **same user they log in as via SMS
|
|
22
|
+
OTP** — Firebase keys the uid by phone number, so the earmark matches when they
|
|
23
|
+
sign in. Pair it with an SMS comms trigger to notify them by text:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
await proof.transfer(collectionId, productId, proofId, {
|
|
27
|
+
toPhone: '+14155551234',
|
|
28
|
+
comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } },
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
21
32
|
Only the current owner (or a collection admin) can start a transfer. A proof can
|
|
22
33
|
have **one active transfer at a time**.
|
|
23
34
|
|
package/dist/openapi.yaml
CHANGED
|
@@ -25882,6 +25882,8 @@ components:
|
|
|
25882
25882
|
$ref: "#/components/schemas/CommsTriggerMap"
|
|
25883
25883
|
toEmail:
|
|
25884
25884
|
type: string
|
|
25885
|
+
toPhone:
|
|
25886
|
+
type: string
|
|
25885
25887
|
toUserId:
|
|
25886
25888
|
type: string
|
|
25887
25889
|
toName:
|
package/dist/types/proof.d.ts
CHANGED
|
@@ -280,17 +280,24 @@ export interface CommsTrigger {
|
|
|
280
280
|
export type CommsTriggerMap = Record<string, CommsTrigger>;
|
|
281
281
|
/**
|
|
282
282
|
* Start a push transfer. Provide **one** of:
|
|
283
|
-
* - `toEmail` / `toUserId` — a directed transfer to a named recipient (they accept).
|
|
283
|
+
* - `toEmail` / `toPhone` / `toUserId` — a directed transfer to a named recipient (they accept).
|
|
284
284
|
* - `release: true` — an open release (the proof becomes claimable by anyone).
|
|
285
285
|
*/
|
|
286
286
|
export interface TransferProofOptions {
|
|
287
287
|
/**
|
|
288
288
|
* Comms to send. Roles: `recipient` (the named new owner) and `sender` (the
|
|
289
|
-
* initiator) for a directed transfer; `owner` for an open release.
|
|
289
|
+
* initiator) for a directed transfer; `owner` for an open release. For an
|
|
290
|
+
* SMS recipient, set `comms.recipient.channel = 'sms'`.
|
|
290
291
|
*/
|
|
291
292
|
comms?: CommsTriggerMap;
|
|
292
293
|
/** Directed: recipient email (created/looked up if needed). */
|
|
293
294
|
toEmail?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Directed: recipient phone in E.164 (e.g. `+14155551234`). Resolves to the same
|
|
297
|
+
* user they log in as via SMS OTP (created if needed). Pair with an SMS comms
|
|
298
|
+
* trigger to notify them: `comms.recipient.channel = 'sms'`.
|
|
299
|
+
*/
|
|
300
|
+
toPhone?: string;
|
|
294
301
|
/** Directed: recipient user id, if already known. */
|
|
295
302
|
toUserId?: string;
|
|
296
303
|
/** Directed: display name for a newly-created recipient. */
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.5 | Generated: 2026-09-05T15:46:49.017Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -7605,9 +7605,14 @@ interface CommsTrigger {
|
|
|
7605
7605
|
```typescript
|
|
7606
7606
|
interface TransferProofOptions {
|
|
7607
7607
|
* Comms to send. Roles: `recipient` (the named new owner) and `sender` (the
|
|
7608
|
-
* initiator) for a directed transfer; `owner` for an open release.
|
|
7608
|
+
* initiator) for a directed transfer; `owner` for an open release. For an
|
|
7609
|
+
* SMS recipient, set `comms.recipient.channel = 'sms'`.
|
|
7609
7610
|
comms?: CommsTriggerMap
|
|
7610
7611
|
toEmail?: string
|
|
7612
|
+
* Directed: recipient phone in E.164 (e.g. `+14155551234`). Resolves to the same
|
|
7613
|
+
* user they log in as via SMS OTP (created if needed). Pair with an SMS comms
|
|
7614
|
+
* trigger to notify them: `comms.recipient.channel = 'sms'`.
|
|
7615
|
+
toPhone?: string
|
|
7611
7616
|
toUserId?: string
|
|
7612
7617
|
toName?: string
|
|
7613
7618
|
release?: boolean
|
|
@@ -10470,7 +10475,7 @@ Redeem a grant token (anonymous or signed-in). Records the redemption and return
|
|
|
10470
10475
|
productId: string,
|
|
10471
10476
|
proofId: string,
|
|
10472
10477
|
options: TransferProofOptions) → `Promise<TransferProofResult>`
|
|
10473
|
-
Start a push transfer of a proof (current owner / collection admin only). Directed — hand it to a named recipient who then calls {@link acceptTransfer}: ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com' }) ``` Open release — make the proof claimable by anyone: ```ts await proof.transfer(collectionId, productId, proofId, { release: true }) ``` Send comms by naming templates per role (server decides who receives each): ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com', comms: { recipient: { templateId: 'transfer-incoming', props: { note: 'Enjoy!' } }, sender: { templateId: 'transfer-sent' }, }, }) ```
|
|
10478
|
+
Start a push transfer of a proof (current owner / collection admin only). Directed — hand it to a named recipient who then calls {@link acceptTransfer}: ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com' }) ``` Open release — make the proof claimable by anyone: ```ts await proof.transfer(collectionId, productId, proofId, { release: true }) ``` Send comms by naming templates per role (server decides who receives each): ```ts await proof.transfer(collectionId, productId, proofId, { toEmail: 'buyer@example.com', comms: { recipient: { templateId: 'transfer-incoming', props: { note: 'Enjoy!' } }, sender: { templateId: 'transfer-sent' }, }, }) ``` Direct to an SMS recipient by phone (E.164) and notify them by text: ```ts await proof.transfer(collectionId, productId, proofId, { toPhone: '+14155551234', comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } }, }) ```
|
|
10474
10479
|
|
|
10475
10480
|
**acceptTransfer**(collectionId: string,
|
|
10476
10481
|
productId: string,
|
|
@@ -128,6 +128,11 @@ Omit `comms` entirely and nothing is sent — comms are **opt-in**.
|
|
|
128
128
|
|
|
129
129
|
- **Email-only recipients work.** A directed transfer to a `toEmail` that isn't a
|
|
130
130
|
contact yet resolves/creates a contact before sending.
|
|
131
|
+
- **SMS recipients work the same way.** A directed transfer to a `toPhone` (E.164)
|
|
132
|
+
resolves the recipient by phone and gives their contact a phone identity, so an
|
|
133
|
+
SMS-channel trigger (`channel: 'sms'`) reaches them. Because the phone maps to a
|
|
134
|
+
stable Firebase uid, they accept by logging in via SMS OTP — the accept is still
|
|
135
|
+
auth-gated exactly as with email.
|
|
131
136
|
- **Consent + suppression apply.** Transactional sends still respect the contact's
|
|
132
137
|
channel consent and suppression list; a template's `topic` governs this.
|
|
133
138
|
- **Delivery is logged** to comms history (with your `appId` and a `ref`), so sends
|
|
@@ -15,9 +15,20 @@ reserves states for them.
|
|
|
15
15
|
|
|
16
16
|
| Mode | How | Who completes it |
|
|
17
17
|
|------|-----|------------------|
|
|
18
|
-
| **Directed** | Owner names a recipient (`toEmail` / `toUserId`). The proof is earmarked for them (`claimUserId`); you notify them with a comms trigger. | The named recipient calls `acceptTransfer`. |
|
|
18
|
+
| **Directed** | Owner names a recipient (`toEmail` / `toPhone` / `toUserId`). The proof is earmarked for them (`claimUserId`); you notify them with a comms trigger. | The named recipient calls `acceptTransfer`. |
|
|
19
19
|
| **Open release** | Owner marks the proof `claimable`. | Anyone claims it via the normal claim flow. |
|
|
20
20
|
|
|
21
|
+
A `toPhone` recipient (E.164) resolves to the **same user they log in as via SMS
|
|
22
|
+
OTP** — Firebase keys the uid by phone number, so the earmark matches when they
|
|
23
|
+
sign in. Pair it with an SMS comms trigger to notify them by text:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
await proof.transfer(collectionId, productId, proofId, {
|
|
27
|
+
toPhone: '+14155551234',
|
|
28
|
+
comms: { recipient: { templateId: 'transfer-incoming', channel: 'sms' } },
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
21
32
|
Only the current owner (or a collection admin) can start a transfer. A proof can
|
|
22
33
|
have **one active transfer at a time**.
|
|
23
34
|
|
package/openapi.yaml
CHANGED
|
@@ -25882,6 +25882,8 @@ components:
|
|
|
25882
25882
|
$ref: "#/components/schemas/CommsTriggerMap"
|
|
25883
25883
|
toEmail:
|
|
25884
25884
|
type: string
|
|
25885
|
+
toPhone:
|
|
25886
|
+
type: string
|
|
25885
25887
|
toUserId:
|
|
25886
25888
|
type: string
|
|
25887
25889
|
toName:
|