@proveanything/smartlinks 1.13.6 → 1.13.8
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/README.md +37 -14
- package/dist/README.md +15 -10
- package/dist/api/analytics.js +6 -3
- package/dist/api/appObjects.d.ts +5 -2
- package/dist/api/appObjects.js +5 -2
- package/dist/api/authKit.d.ts +13 -1
- package/dist/api/authKit.js +34 -0
- package/dist/api/comms.d.ts +1 -1
- package/dist/api/comms.js +14 -3
- package/dist/docs/API_SUMMARY.md +145 -31
- package/dist/docs/auth-kit.md +55 -0
- package/dist/docs/comms.md +4 -4
- package/dist/docs/overview.md +2 -0
- package/dist/openapi.yaml +351 -35
- package/dist/types/appObjects.d.ts +5 -0
- package/dist/types/authKit.d.ts +57 -0
- package/dist/types/comms.d.ts +6 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/docs/API_SUMMARY.md +145 -31
- package/docs/auth-kit.md +55 -0
- package/docs/comms.md +4 -4
- package/docs/overview.md +2 -0
- package/openapi.yaml +351 -35
- package/package.json +1 -1
package/dist/docs/auth-kit.md
CHANGED
|
@@ -78,6 +78,61 @@ await authKit.sendPhoneCode(clientId, '+61400000000');
|
|
|
78
78
|
const session = await authKit.verifyPhoneCode(clientId, '+61400000000', '123456');
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
### Lightweight verification (WhatsApp + SMS)
|
|
82
|
+
|
|
83
|
+
Use these flows when you want low-friction verification before or without full account sign-in.
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { authKit } from '@proveanything/smartlinks';
|
|
87
|
+
|
|
88
|
+
// 1) Send WhatsApp verification deep link
|
|
89
|
+
const wa = await authKit.sendWhatsApp(clientId, {
|
|
90
|
+
phoneNumber: '+447911123456',
|
|
91
|
+
redirectUrl: 'https://app.example.com/checkout/continue',
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// wa.waLink can be opened directly by the app/browser
|
|
95
|
+
// Poll status while user switches to WhatsApp and back
|
|
96
|
+
const status = await authKit.getWhatsAppStatus(clientId, wa.token);
|
|
97
|
+
|
|
98
|
+
// Optional fallback path if webhook confirmation is unavailable
|
|
99
|
+
await authKit.verifyWhatsApp(clientId, wa.token, '+447911123456');
|
|
100
|
+
|
|
101
|
+
// 2) Or send SMS click-to-verify link
|
|
102
|
+
await authKit.sendSmsVerify(clientId, {
|
|
103
|
+
phoneNumber: '+447911123456',
|
|
104
|
+
redirectUrl: 'https://app.example.com/raffle/checkout',
|
|
105
|
+
ctaText: 'Tap to continue',
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Optional API verification path
|
|
109
|
+
await authKit.verifySms(clientId, '<token>', '+447911123456');
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Contact bootstrap / durable identity
|
|
113
|
+
|
|
114
|
+
After verification, upsert contact identity and store `contactId` on downstream records (raffle ticket, bid, claim intent).
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const contact = await authKit.upsertContact(clientId, {
|
|
118
|
+
phone: '+447911123456',
|
|
119
|
+
name: 'Jane Doe',
|
|
120
|
+
source: 'raffle-checkout',
|
|
121
|
+
customFields: { channelVerified: 'whatsapp' },
|
|
122
|
+
externalIds: { raffleSessionId: 'rfl_123' },
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Persist these on your business record
|
|
126
|
+
// contact.contactId, contact.collectionId, verified channel, verifiedAt
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Verification status values returned by `authKit.getWhatsAppStatus` are:
|
|
130
|
+
- `pending`
|
|
131
|
+
- `verified`
|
|
132
|
+
- `failed`
|
|
133
|
+
- `expired`
|
|
134
|
+
- `unknown`
|
|
135
|
+
|
|
81
136
|
### Google OAuth
|
|
82
137
|
|
|
83
138
|
```ts
|
package/dist/docs/comms.md
CHANGED
|
@@ -19,7 +19,7 @@ This guide covers the full communications surface of the SDK: transactional send
|
|
|
19
19
|
|
|
20
20
|
Sends a single message to one contact using a template. No broadcast record is created. The send is logged to the contact's communication history with `sourceType: 'transactional'`.
|
|
21
21
|
|
|
22
|
-
**Endpoint:** `POST /admin/collection/:collectionId/comm
|
|
22
|
+
**Endpoint:** `POST /admin/collection/:collectionId/comm/send`
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
import { comms } from '@proveanything/smartlinks'
|
|
@@ -28,7 +28,7 @@ import type { TransactionalSendRequest } from '@proveanything/smartlinks'
|
|
|
28
28
|
const result = await comms.sendTransactional('collectionId', {
|
|
29
29
|
contactId: 'e4f2a1b0-...',
|
|
30
30
|
templateId: 'warranty-update',
|
|
31
|
-
channel: 'preferred', // 'email' | 'sms' | 'push' | 'wallet' | 'preferred' (default)
|
|
31
|
+
channel: 'preferred', // 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet' | 'preferred' (default)
|
|
32
32
|
props: { claimRef: 'CLM-0042', decision: 'approved' },
|
|
33
33
|
include: {
|
|
34
34
|
productId: 'prod-abc123', // hydrate product context into template
|
|
@@ -51,7 +51,7 @@ if (result.ok) {
|
|
|
51
51
|
|-------|------|-------------|
|
|
52
52
|
| `contactId` | `string` | **Required.** Contact to send to. |
|
|
53
53
|
| `templateId` | `string` | **Required.** Template to render. |
|
|
54
|
-
| `channel` | `'email' \| 'sms' \| 'push' \| 'wallet' \| 'preferred'` | Channel to send on. `'preferred'` (default) picks the contact's best available channel. |
|
|
54
|
+
| `channel` | `'email' \| 'sms' \| 'whatsapp' \| 'push' \| 'wallet' \| 'preferred'` | Channel to send on. `'preferred'` (default) picks the contact's best available channel. |
|
|
55
55
|
| `props` | `Record<string, unknown>` | Extra variables merged into template rendering. |
|
|
56
56
|
| `include` | object | Hydration flags — see table below. |
|
|
57
57
|
| `ref` | `string` | Arbitrary reference string stored with the event. |
|
|
@@ -73,7 +73,7 @@ if (result.ok) {
|
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
// Success
|
|
76
|
-
{ ok: true; channel: 'email' | 'sms' | 'push' | 'wallet'; messageId?: string }
|
|
76
|
+
{ ok: true; channel: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet'; messageId?: string }
|
|
77
77
|
|
|
78
78
|
// Failure
|
|
79
79
|
{ ok: false; error: string }
|
package/dist/docs/overview.md
CHANGED
|
@@ -43,6 +43,8 @@ Widgets and containers run in the parent's React tree (not iframes). Mobile Admi
|
|
|
43
43
|
|
|
44
44
|
The SmartLinks SDK (`@proveanything/smartlinks`) includes comprehensive documentation in `node_modules/@proveanything/smartlinks/docs/`. **Always read these files for detailed implementation guidance.**
|
|
45
45
|
|
|
46
|
+
> Product endpoints: use `products` (plural) for new integrations. The older `product` (singular) namespace remains for backward compatibility and is deprecated.
|
|
47
|
+
|
|
46
48
|
> **Minimum SDK version: `1.4.1`** — Ensure `@proveanything/smartlinks` is at least this version. If not, update with `npm install @proveanything/smartlinks@latest`.
|
|
47
49
|
|
|
48
50
|
| Topic | File | When to Use |
|
package/dist/openapi.yaml
CHANGED
|
@@ -2198,39 +2198,6 @@ paths:
|
|
|
2198
2198
|
application/json:
|
|
2199
2199
|
schema:
|
|
2200
2200
|
$ref: "#/components/schemas/BroadcastSendTestRequest"
|
|
2201
|
-
/admin/collection/{collectionId}/comm.send:
|
|
2202
|
-
post:
|
|
2203
|
-
tags:
|
|
2204
|
-
- comms
|
|
2205
|
-
summary: Send a single transactional message to one contact using a template.
|
|
2206
|
-
operationId: comms_sendTransactional
|
|
2207
|
-
security:
|
|
2208
|
-
- bearerAuth: []
|
|
2209
|
-
parameters:
|
|
2210
|
-
- name: collectionId
|
|
2211
|
-
in: path
|
|
2212
|
-
required: true
|
|
2213
|
-
schema:
|
|
2214
|
-
type: string
|
|
2215
|
-
responses:
|
|
2216
|
-
200:
|
|
2217
|
-
description: Success
|
|
2218
|
-
content:
|
|
2219
|
-
application/json:
|
|
2220
|
-
schema:
|
|
2221
|
-
$ref: "#/components/schemas/TransactionalSendResult"
|
|
2222
|
-
400:
|
|
2223
|
-
description: Bad request
|
|
2224
|
-
401:
|
|
2225
|
-
description: Unauthorized
|
|
2226
|
-
404:
|
|
2227
|
-
description: Not found
|
|
2228
|
-
requestBody:
|
|
2229
|
-
required: true
|
|
2230
|
-
content:
|
|
2231
|
-
application/json:
|
|
2232
|
-
schema:
|
|
2233
|
-
$ref: "#/components/schemas/TransactionalSendRequest"
|
|
2234
2201
|
/admin/collection/{collectionId}/comm.settings:
|
|
2235
2202
|
get:
|
|
2236
2203
|
tags:
|
|
@@ -7856,6 +7823,39 @@ paths:
|
|
|
7856
7823
|
application/json:
|
|
7857
7824
|
schema:
|
|
7858
7825
|
$ref: "#/components/schemas/TranslationUpdateRequest"
|
|
7826
|
+
/admin/collection/{encodedCollectionId}/comm/send:
|
|
7827
|
+
post:
|
|
7828
|
+
tags:
|
|
7829
|
+
- comms
|
|
7830
|
+
summary: Send a single transactional message to one contact using a template.
|
|
7831
|
+
operationId: comms_sendTransactional
|
|
7832
|
+
security:
|
|
7833
|
+
- bearerAuth: []
|
|
7834
|
+
parameters:
|
|
7835
|
+
- name: encodedCollectionId
|
|
7836
|
+
in: path
|
|
7837
|
+
required: true
|
|
7838
|
+
schema:
|
|
7839
|
+
type: string
|
|
7840
|
+
responses:
|
|
7841
|
+
200:
|
|
7842
|
+
description: Success
|
|
7843
|
+
content:
|
|
7844
|
+
application/json:
|
|
7845
|
+
schema:
|
|
7846
|
+
$ref: "#/components/schemas/TransactionalSendResult"
|
|
7847
|
+
400:
|
|
7848
|
+
description: Bad request
|
|
7849
|
+
401:
|
|
7850
|
+
description: Unauthorized
|
|
7851
|
+
404:
|
|
7852
|
+
description: Not found
|
|
7853
|
+
requestBody:
|
|
7854
|
+
required: true
|
|
7855
|
+
content:
|
|
7856
|
+
application/json:
|
|
7857
|
+
schema:
|
|
7858
|
+
$ref: "#/components/schemas/TransactionalSendRequest"
|
|
7859
7859
|
/authKit/{authKitId}/config:
|
|
7860
7860
|
get:
|
|
7861
7861
|
tags:
|
|
@@ -8329,7 +8329,7 @@ paths:
|
|
|
8329
8329
|
post:
|
|
8330
8330
|
tags:
|
|
8331
8331
|
- authKit
|
|
8332
|
-
summary:
|
|
8332
|
+
summary: Upsert contact identity after lightweight verification (public).
|
|
8333
8333
|
operationId: authKit_requestPasswordReset
|
|
8334
8334
|
security: []
|
|
8335
8335
|
parameters:
|
|
@@ -8391,6 +8391,64 @@ paths:
|
|
|
8391
8391
|
schema:
|
|
8392
8392
|
type: object
|
|
8393
8393
|
additionalProperties: true
|
|
8394
|
+
/authkit/{clientId}/auth/sms/send:
|
|
8395
|
+
post:
|
|
8396
|
+
tags:
|
|
8397
|
+
- authKit
|
|
8398
|
+
summary: Send an SMS click-to-verify link (public).
|
|
8399
|
+
operationId: authKit_sendSmsVerify
|
|
8400
|
+
security: []
|
|
8401
|
+
parameters:
|
|
8402
|
+
- name: clientId
|
|
8403
|
+
in: path
|
|
8404
|
+
required: true
|
|
8405
|
+
schema:
|
|
8406
|
+
type: string
|
|
8407
|
+
responses:
|
|
8408
|
+
200:
|
|
8409
|
+
description: Success
|
|
8410
|
+
content:
|
|
8411
|
+
application/json:
|
|
8412
|
+
schema:
|
|
8413
|
+
$ref: "#/components/schemas/SendSmsVerifyResponse"
|
|
8414
|
+
400:
|
|
8415
|
+
description: Bad request
|
|
8416
|
+
401:
|
|
8417
|
+
description: Unauthorized
|
|
8418
|
+
404:
|
|
8419
|
+
description: Not found
|
|
8420
|
+
requestBody:
|
|
8421
|
+
required: true
|
|
8422
|
+
content:
|
|
8423
|
+
application/json:
|
|
8424
|
+
schema:
|
|
8425
|
+
$ref: "#/components/schemas/SendSmsVerifyRequest"
|
|
8426
|
+
/authkit/{clientId}/auth/sms/verify:
|
|
8427
|
+
post:
|
|
8428
|
+
tags:
|
|
8429
|
+
- authKit
|
|
8430
|
+
summary: Verify an SMS click-to-verify token via API (public).
|
|
8431
|
+
operationId: authKit_verifySms
|
|
8432
|
+
security: []
|
|
8433
|
+
parameters:
|
|
8434
|
+
- name: clientId
|
|
8435
|
+
in: path
|
|
8436
|
+
required: true
|
|
8437
|
+
schema:
|
|
8438
|
+
type: string
|
|
8439
|
+
responses:
|
|
8440
|
+
200:
|
|
8441
|
+
description: Success
|
|
8442
|
+
content:
|
|
8443
|
+
application/json:
|
|
8444
|
+
schema:
|
|
8445
|
+
$ref: "#/components/schemas/VerifySmsResponse"
|
|
8446
|
+
400:
|
|
8447
|
+
description: Bad request
|
|
8448
|
+
401:
|
|
8449
|
+
description: Unauthorized
|
|
8450
|
+
404:
|
|
8451
|
+
description: Not found
|
|
8394
8452
|
/authkit/{clientId}/auth/verify-email:
|
|
8395
8453
|
post:
|
|
8396
8454
|
tags:
|
|
@@ -8443,6 +8501,122 @@ paths:
|
|
|
8443
8501
|
description: Unauthorized
|
|
8444
8502
|
404:
|
|
8445
8503
|
description: Not found
|
|
8504
|
+
/authkit/{clientId}/auth/whatsapp/send:
|
|
8505
|
+
post:
|
|
8506
|
+
tags:
|
|
8507
|
+
- authKit
|
|
8508
|
+
summary: Send a WhatsApp verification deep-link (public).
|
|
8509
|
+
operationId: authKit_sendWhatsApp
|
|
8510
|
+
security: []
|
|
8511
|
+
parameters:
|
|
8512
|
+
- name: clientId
|
|
8513
|
+
in: path
|
|
8514
|
+
required: true
|
|
8515
|
+
schema:
|
|
8516
|
+
type: string
|
|
8517
|
+
responses:
|
|
8518
|
+
200:
|
|
8519
|
+
description: Success
|
|
8520
|
+
content:
|
|
8521
|
+
application/json:
|
|
8522
|
+
schema:
|
|
8523
|
+
$ref: "#/components/schemas/SendWhatsAppResponse"
|
|
8524
|
+
400:
|
|
8525
|
+
description: Bad request
|
|
8526
|
+
401:
|
|
8527
|
+
description: Unauthorized
|
|
8528
|
+
404:
|
|
8529
|
+
description: Not found
|
|
8530
|
+
requestBody:
|
|
8531
|
+
required: true
|
|
8532
|
+
content:
|
|
8533
|
+
application/json:
|
|
8534
|
+
schema:
|
|
8535
|
+
$ref: "#/components/schemas/SendWhatsAppRequest"
|
|
8536
|
+
/authkit/{clientId}/auth/whatsapp/status:
|
|
8537
|
+
get:
|
|
8538
|
+
tags:
|
|
8539
|
+
- authKit
|
|
8540
|
+
summary: Poll WhatsApp verification status for a token (public).
|
|
8541
|
+
operationId: authKit_getWhatsAppStatus
|
|
8542
|
+
security: []
|
|
8543
|
+
parameters:
|
|
8544
|
+
- name: clientId
|
|
8545
|
+
in: path
|
|
8546
|
+
required: true
|
|
8547
|
+
schema:
|
|
8548
|
+
type: string
|
|
8549
|
+
responses:
|
|
8550
|
+
200:
|
|
8551
|
+
description: Success
|
|
8552
|
+
content:
|
|
8553
|
+
application/json:
|
|
8554
|
+
schema:
|
|
8555
|
+
$ref: "#/components/schemas/WhatsAppStatusResponse"
|
|
8556
|
+
400:
|
|
8557
|
+
description: Bad request
|
|
8558
|
+
401:
|
|
8559
|
+
description: Unauthorized
|
|
8560
|
+
404:
|
|
8561
|
+
description: Not found
|
|
8562
|
+
/authkit/{clientId}/auth/whatsapp/verify:
|
|
8563
|
+
post:
|
|
8564
|
+
tags:
|
|
8565
|
+
- authKit
|
|
8566
|
+
summary: Manually verify WhatsApp token if inbound webhook path is unavailable (public).
|
|
8567
|
+
operationId: authKit_verifyWhatsApp
|
|
8568
|
+
security: []
|
|
8569
|
+
parameters:
|
|
8570
|
+
- name: clientId
|
|
8571
|
+
in: path
|
|
8572
|
+
required: true
|
|
8573
|
+
schema:
|
|
8574
|
+
type: string
|
|
8575
|
+
responses:
|
|
8576
|
+
200:
|
|
8577
|
+
description: Success
|
|
8578
|
+
content:
|
|
8579
|
+
application/json:
|
|
8580
|
+
schema:
|
|
8581
|
+
$ref: "#/components/schemas/VerifyWhatsAppResponse"
|
|
8582
|
+
400:
|
|
8583
|
+
description: Bad request
|
|
8584
|
+
401:
|
|
8585
|
+
description: Unauthorized
|
|
8586
|
+
404:
|
|
8587
|
+
description: Not found
|
|
8588
|
+
/authkit/{clientId}/contact/upsert:
|
|
8589
|
+
post:
|
|
8590
|
+
tags:
|
|
8591
|
+
- authKit
|
|
8592
|
+
summary: Upsert contact identity after lightweight verification (public).
|
|
8593
|
+
operationId: authKit_upsertContact
|
|
8594
|
+
security: []
|
|
8595
|
+
parameters:
|
|
8596
|
+
- name: clientId
|
|
8597
|
+
in: path
|
|
8598
|
+
required: true
|
|
8599
|
+
schema:
|
|
8600
|
+
type: string
|
|
8601
|
+
responses:
|
|
8602
|
+
200:
|
|
8603
|
+
description: Success
|
|
8604
|
+
content:
|
|
8605
|
+
application/json:
|
|
8606
|
+
schema:
|
|
8607
|
+
$ref: "#/components/schemas/UpsertContactResponse"
|
|
8608
|
+
400:
|
|
8609
|
+
description: Bad request
|
|
8610
|
+
401:
|
|
8611
|
+
description: Unauthorized
|
|
8612
|
+
404:
|
|
8613
|
+
description: Not found
|
|
8614
|
+
requestBody:
|
|
8615
|
+
required: true
|
|
8616
|
+
content:
|
|
8617
|
+
application/json:
|
|
8618
|
+
schema:
|
|
8619
|
+
$ref: "#/components/schemas/UpsertContactRequest"
|
|
8446
8620
|
/platform/location:
|
|
8447
8621
|
post:
|
|
8448
8622
|
tags:
|
|
@@ -12328,7 +12502,7 @@ paths:
|
|
|
12328
12502
|
get:
|
|
12329
12503
|
tags:
|
|
12330
12504
|
- records
|
|
12331
|
-
summary: List records with optional query parameters GET /records
|
|
12505
|
+
summary: "List records with optional query parameters GET /records Public/owner callers only receive records with `status: \"active\"`."
|
|
12332
12506
|
operationId: records_list
|
|
12333
12507
|
security: []
|
|
12334
12508
|
parameters:
|
|
@@ -12347,6 +12521,11 @@ paths:
|
|
|
12347
12521
|
required: true
|
|
12348
12522
|
schema:
|
|
12349
12523
|
type: string
|
|
12524
|
+
- name: status
|
|
12525
|
+
in: query
|
|
12526
|
+
required: false
|
|
12527
|
+
schema:
|
|
12528
|
+
type: string
|
|
12350
12529
|
- name: recordType
|
|
12351
12530
|
in: query
|
|
12352
12531
|
required: false
|
|
@@ -16266,6 +16445,8 @@ components:
|
|
|
16266
16445
|
RecordListQueryParams:
|
|
16267
16446
|
type: object
|
|
16268
16447
|
properties:
|
|
16448
|
+
status:
|
|
16449
|
+
type: string
|
|
16269
16450
|
recordType:
|
|
16270
16451
|
type: string
|
|
16271
16452
|
ref:
|
|
@@ -17683,6 +17864,139 @@ components:
|
|
|
17683
17864
|
required:
|
|
17684
17865
|
- success
|
|
17685
17866
|
- message
|
|
17867
|
+
SendWhatsAppRequest:
|
|
17868
|
+
type: object
|
|
17869
|
+
properties:
|
|
17870
|
+
phoneNumber:
|
|
17871
|
+
type: string
|
|
17872
|
+
redirectUrl:
|
|
17873
|
+
type: string
|
|
17874
|
+
required:
|
|
17875
|
+
- phoneNumber
|
|
17876
|
+
- redirectUrl
|
|
17877
|
+
SendWhatsAppResponse:
|
|
17878
|
+
type: object
|
|
17879
|
+
properties:
|
|
17880
|
+
waLink:
|
|
17881
|
+
type: string
|
|
17882
|
+
code:
|
|
17883
|
+
type: string
|
|
17884
|
+
token:
|
|
17885
|
+
type: string
|
|
17886
|
+
expiresAt:
|
|
17887
|
+
type: string
|
|
17888
|
+
required:
|
|
17889
|
+
- waLink
|
|
17890
|
+
- code
|
|
17891
|
+
- token
|
|
17892
|
+
- expiresAt
|
|
17893
|
+
VerifyWhatsAppResponse:
|
|
17894
|
+
type: object
|
|
17895
|
+
properties:
|
|
17896
|
+
success:
|
|
17897
|
+
type: boolean
|
|
17898
|
+
verified:
|
|
17899
|
+
type: boolean
|
|
17900
|
+
redirectUrl:
|
|
17901
|
+
type: string
|
|
17902
|
+
required:
|
|
17903
|
+
- success
|
|
17904
|
+
- verified
|
|
17905
|
+
WhatsAppStatusResponse:
|
|
17906
|
+
type: object
|
|
17907
|
+
properties:
|
|
17908
|
+
ok:
|
|
17909
|
+
type: boolean
|
|
17910
|
+
status:
|
|
17911
|
+
$ref: "#/components/schemas/VerifyStatus"
|
|
17912
|
+
verified:
|
|
17913
|
+
type: boolean
|
|
17914
|
+
redirectUrl:
|
|
17915
|
+
type: string
|
|
17916
|
+
phoneNumber:
|
|
17917
|
+
type: string
|
|
17918
|
+
updatedAt: {}
|
|
17919
|
+
required:
|
|
17920
|
+
- ok
|
|
17921
|
+
- status
|
|
17922
|
+
- verified
|
|
17923
|
+
SendSmsVerifyRequest:
|
|
17924
|
+
type: object
|
|
17925
|
+
properties:
|
|
17926
|
+
phoneNumber:
|
|
17927
|
+
type: string
|
|
17928
|
+
redirectUrl:
|
|
17929
|
+
type: string
|
|
17930
|
+
ctaText:
|
|
17931
|
+
type: string
|
|
17932
|
+
required:
|
|
17933
|
+
- phoneNumber
|
|
17934
|
+
- redirectUrl
|
|
17935
|
+
SendSmsVerifyResponse:
|
|
17936
|
+
type: object
|
|
17937
|
+
properties:
|
|
17938
|
+
success:
|
|
17939
|
+
type: boolean
|
|
17940
|
+
expiresAt:
|
|
17941
|
+
type: string
|
|
17942
|
+
required:
|
|
17943
|
+
- success
|
|
17944
|
+
- expiresAt
|
|
17945
|
+
VerifySmsResponse:
|
|
17946
|
+
type: object
|
|
17947
|
+
properties:
|
|
17948
|
+
verified:
|
|
17949
|
+
type: boolean
|
|
17950
|
+
redirectUrl:
|
|
17951
|
+
type: string
|
|
17952
|
+
phoneNumber:
|
|
17953
|
+
type: string
|
|
17954
|
+
required:
|
|
17955
|
+
- verified
|
|
17956
|
+
UpsertContactRequest:
|
|
17957
|
+
type: object
|
|
17958
|
+
properties:
|
|
17959
|
+
collectionId:
|
|
17960
|
+
type: string
|
|
17961
|
+
phone:
|
|
17962
|
+
type: string
|
|
17963
|
+
email:
|
|
17964
|
+
type: string
|
|
17965
|
+
name:
|
|
17966
|
+
type: string
|
|
17967
|
+
firstName:
|
|
17968
|
+
type: string
|
|
17969
|
+
lastName:
|
|
17970
|
+
type: string
|
|
17971
|
+
displayName:
|
|
17972
|
+
type: string
|
|
17973
|
+
source:
|
|
17974
|
+
type: string
|
|
17975
|
+
customFields:
|
|
17976
|
+
type: object
|
|
17977
|
+
additionalProperties: true
|
|
17978
|
+
externalIds:
|
|
17979
|
+
type: object
|
|
17980
|
+
additionalProperties: true
|
|
17981
|
+
UpsertContactResponse:
|
|
17982
|
+
type: object
|
|
17983
|
+
properties:
|
|
17984
|
+
ok:
|
|
17985
|
+
type: boolean
|
|
17986
|
+
collectionId:
|
|
17987
|
+
type: string
|
|
17988
|
+
contactId:
|
|
17989
|
+
type: string
|
|
17990
|
+
userId:
|
|
17991
|
+
type: string
|
|
17992
|
+
created:
|
|
17993
|
+
type: boolean
|
|
17994
|
+
required:
|
|
17995
|
+
- ok
|
|
17996
|
+
- collectionId
|
|
17997
|
+
- contactId
|
|
17998
|
+
- userId
|
|
17999
|
+
- created
|
|
17686
18000
|
AuthKitBrandingConfig:
|
|
17687
18001
|
type: object
|
|
17688
18002
|
properties:
|
|
@@ -18865,6 +19179,7 @@ components:
|
|
|
18865
19179
|
enum:
|
|
18866
19180
|
- email
|
|
18867
19181
|
- sms
|
|
19182
|
+
- whatsapp
|
|
18868
19183
|
- push
|
|
18869
19184
|
- wallet
|
|
18870
19185
|
- preferred
|
|
@@ -18906,6 +19221,7 @@ components:
|
|
|
18906
19221
|
enum:
|
|
18907
19222
|
- email
|
|
18908
19223
|
- sms
|
|
19224
|
+
- whatsapp
|
|
18909
19225
|
- push
|
|
18910
19226
|
- wallet
|
|
18911
19227
|
messageId:
|
|
@@ -590,6 +590,11 @@ export interface UpdateRecordInput {
|
|
|
590
590
|
* Query parameters for listing records
|
|
591
591
|
*/
|
|
592
592
|
export interface RecordListQueryParams extends ListQueryParams {
|
|
593
|
+
/**
|
|
594
|
+
* Admin: any status or `in:a,b,c` filter is allowed.
|
|
595
|
+
* Public/owner: results are restricted to active records.
|
|
596
|
+
*/
|
|
597
|
+
status?: string;
|
|
593
598
|
recordType?: string;
|
|
594
599
|
ref?: string;
|
|
595
600
|
/** Filter records whose ref starts with this value */
|
package/dist/types/authKit.d.ts
CHANGED
|
@@ -75,6 +75,63 @@ export interface EmailVerifyTokenResponse {
|
|
|
75
75
|
accountData?: Record<string, any>;
|
|
76
76
|
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
|
|
77
77
|
}
|
|
78
|
+
export type VerifyStatus = 'pending' | 'verified' | 'failed' | 'expired' | 'unknown';
|
|
79
|
+
export interface SendWhatsAppRequest {
|
|
80
|
+
phoneNumber: string;
|
|
81
|
+
redirectUrl: string;
|
|
82
|
+
}
|
|
83
|
+
export interface SendWhatsAppResponse {
|
|
84
|
+
waLink: string;
|
|
85
|
+
code: string;
|
|
86
|
+
token: string;
|
|
87
|
+
expiresAt: string;
|
|
88
|
+
}
|
|
89
|
+
export interface VerifyWhatsAppResponse {
|
|
90
|
+
success: boolean;
|
|
91
|
+
verified: boolean;
|
|
92
|
+
redirectUrl?: string | null;
|
|
93
|
+
}
|
|
94
|
+
export interface WhatsAppStatusResponse {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
status: VerifyStatus;
|
|
97
|
+
verified: boolean;
|
|
98
|
+
redirectUrl?: string | null;
|
|
99
|
+
phoneNumber?: string | null;
|
|
100
|
+
updatedAt?: unknown;
|
|
101
|
+
}
|
|
102
|
+
export interface SendSmsVerifyRequest {
|
|
103
|
+
phoneNumber: string;
|
|
104
|
+
redirectUrl: string;
|
|
105
|
+
ctaText?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface SendSmsVerifyResponse {
|
|
108
|
+
success: boolean;
|
|
109
|
+
expiresAt: string;
|
|
110
|
+
}
|
|
111
|
+
export interface VerifySmsResponse {
|
|
112
|
+
verified: boolean;
|
|
113
|
+
redirectUrl?: string | null;
|
|
114
|
+
phoneNumber?: string | null;
|
|
115
|
+
}
|
|
116
|
+
export interface UpsertContactRequest {
|
|
117
|
+
collectionId?: string;
|
|
118
|
+
phone?: string;
|
|
119
|
+
email?: string;
|
|
120
|
+
name?: string;
|
|
121
|
+
firstName?: string;
|
|
122
|
+
lastName?: string;
|
|
123
|
+
displayName?: string;
|
|
124
|
+
source?: string;
|
|
125
|
+
customFields?: Record<string, unknown>;
|
|
126
|
+
externalIds?: Record<string, unknown>;
|
|
127
|
+
}
|
|
128
|
+
export interface UpsertContactResponse {
|
|
129
|
+
ok: boolean;
|
|
130
|
+
collectionId: string;
|
|
131
|
+
contactId: string;
|
|
132
|
+
userId: string | null;
|
|
133
|
+
created: boolean;
|
|
134
|
+
}
|
|
78
135
|
export interface AuthKitBrandingConfig {
|
|
79
136
|
logoUrl?: string;
|
|
80
137
|
title?: string;
|
package/dist/types/comms.d.ts
CHANGED
|
@@ -280,7 +280,7 @@ export interface SubscriptionsResolveResponse {
|
|
|
280
280
|
* No broadcast record is created; the send is logged directly to the
|
|
281
281
|
* contact's communication history with sourceType: 'transactional'.
|
|
282
282
|
*
|
|
283
|
-
* POST /admin/collection/:collectionId/comm
|
|
283
|
+
* POST /admin/collection/:collectionId/comm/send
|
|
284
284
|
*/
|
|
285
285
|
export interface TransactionalSendRequest {
|
|
286
286
|
/** CRM contact UUID */
|
|
@@ -290,9 +290,9 @@ export interface TransactionalSendRequest {
|
|
|
290
290
|
/**
|
|
291
291
|
* Channel to send on. Defaults to 'preferred', which auto-selects the
|
|
292
292
|
* contact's best available channel respecting consent, suppression, and
|
|
293
|
-
|
|
293
|
+
* template availability.
|
|
294
294
|
*/
|
|
295
|
-
channel?: 'email' | 'sms' | 'push' | 'wallet' | 'preferred';
|
|
295
|
+
channel?: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet' | 'preferred';
|
|
296
296
|
/** Extra Liquid variables merged into the top-level render context */
|
|
297
297
|
props?: Record<string, unknown>;
|
|
298
298
|
/** Context objects to hydrate into the Liquid template */
|
|
@@ -320,8 +320,8 @@ export interface TransactionalSendRequest {
|
|
|
320
320
|
export interface TransactionalSendResponse {
|
|
321
321
|
ok: true;
|
|
322
322
|
/** The channel the message was actually sent on */
|
|
323
|
-
channel: 'email' | 'sms' | 'push' | 'wallet';
|
|
324
|
-
/** Provider message ID (email/SMS); absent for push/wallet */
|
|
323
|
+
channel: 'email' | 'sms' | 'whatsapp' | 'push' | 'wallet';
|
|
324
|
+
/** Provider message ID (email/SMS/WhatsApp); absent for push/wallet */
|
|
325
325
|
messageId?: string;
|
|
326
326
|
}
|
|
327
327
|
export interface TransactionalSendError {
|
|
@@ -333,6 +333,7 @@ export interface TransactionalSendError {
|
|
|
333
333
|
* - `transactional.no_channel_available`
|
|
334
334
|
* - `transactional.email_missing`
|
|
335
335
|
* - `transactional.phone_missing`
|
|
336
|
+
* - `transactional.whatsapp_missing`
|
|
336
337
|
* - `transactional.no_push_methods`
|
|
337
338
|
* - `transactional.no_wallet_methods`
|
|
338
339
|
*/
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED