@proveanything/smartlinks 1.0.65 → 1.1.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/API_SUMMARY.md +652 -20
- package/README.md +43 -0
- package/dist/api/actions.d.ts +32 -0
- package/dist/api/actions.js +99 -0
- package/dist/api/broadcasts.d.ts +8 -0
- package/dist/api/broadcasts.js +50 -0
- package/dist/api/comms.d.ts +36 -1
- package/dist/api/comms.js +54 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/journeys.d.ts +8 -0
- package/dist/api/journeys.js +48 -0
- package/dist/api/segments.d.ts +13 -0
- package/dist/api/segments.js +60 -0
- package/dist/types/actions.d.ts +120 -0
- package/dist/types/actions.js +2 -0
- package/dist/types/analytics.d.ts +0 -0
- package/dist/types/analytics.js +3 -0
- package/dist/types/broadcasts.d.ts +31 -0
- package/dist/types/broadcasts.js +2 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/common.js +2 -0
- package/dist/types/comms.d.ts +77 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/journeys.d.ts +57 -0
- package/dist/types/journeys.js +2 -0
- package/dist/types/segments.d.ts +40 -0
- package/dist/types/segments.js +2 -0
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1 | Generated: 2025-12-18T22:33:00.019Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -8,25 +8,44 @@ This is a concise summary of all available API functions and types.
|
|
|
8
8
|
|
|
9
9
|
The Smartlinks SDK is organized into the following namespaces:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
11
|
+
— Core Data & Configuration —
|
|
12
|
+
- **collection** - Manage collections, settings, and identifiers for your workspace.
|
|
13
|
+
- **product** - Create and manage products within a collection; metadata, tags, media.
|
|
14
|
+
- **variant** - Manage product variants per product; includes serial number helpers.
|
|
15
|
+
- **asset** - Upload and manage media assets for collections, products, and proofs.
|
|
16
|
+
- **batch** - Group products into batches; manage serial number ranges and lookups.
|
|
17
|
+
- **crate** - Organize products in containers/crates for logistics and grouping.
|
|
18
|
+
- **form** - Build and manage dynamic forms used by apps and workflows.
|
|
19
|
+
- **appRecord** - Store and retrieve application-level records tied to a collection.
|
|
20
|
+
- **appConfiguration** - Read/write app configuration and scoped data (collection/product/proof).
|
|
21
|
+
|
|
22
|
+
— Identity & Access —
|
|
23
|
+
- **auth** - Admin authentication and account ops: login/logout, tokens, account info.
|
|
24
|
+
- **authKit** - End‑user auth flows (email/password, OAuth, phone); profiles and verification.
|
|
25
|
+
- **contact** - Manage customer contacts; CRUD, lookup, upsert, erase.
|
|
26
|
+
|
|
27
|
+
— Messaging & Audience —
|
|
28
|
+
- **comms** - Send notifications (push, email, wallet); templating, severity, delivery status.
|
|
29
|
+
- **broadcasts** - Define broadcast campaigns; append recipients/events; analytics and CRUD.
|
|
30
|
+
- **segments** - Define dynamic/static audience segments; estimate and list recipients; schedule calculations.
|
|
31
|
+
|
|
32
|
+
— Analytics & Events —
|
|
33
|
+
- **actions** - Log and analyze actions/outcomes; aggregates and actor lists; action definition CRUD.
|
|
34
|
+
|
|
35
|
+
— Automation —
|
|
36
|
+
- **journeys** - Configure automated flows triggered by events or schedules; steps, rules; full CRUD.
|
|
37
|
+
|
|
38
|
+
— NFC, Proofs & Claims —
|
|
39
|
+
- **nfc** - Claim and validate NFC tags; perform tag lookups.
|
|
40
|
+
- **proof** - Create, update, claim, and list product proofs (digital certificates).
|
|
41
|
+
- **claimSet** - Manage claim sets and tag assignments; queries, reports, and updates.
|
|
42
|
+
|
|
43
|
+
— AI & Utilities —
|
|
44
|
+
- **ai** - Generate content and images, search photos, chat, upload files, and cache.
|
|
45
|
+
- **serialNumber** - Assign, lookup, and manage serial numbers across scopes.
|
|
46
|
+
|
|
47
|
+
— Other —
|
|
48
|
+
- **attestation** - Functions for attestation operations
|
|
30
49
|
|
|
31
50
|
## HTTP Utilities
|
|
32
51
|
|
|
@@ -87,6 +106,189 @@ Sends a custom proxy message to the parent Smartlinks application when running i
|
|
|
87
106
|
|
|
88
107
|
## Types
|
|
89
108
|
|
|
109
|
+
### actions
|
|
110
|
+
|
|
111
|
+
**AdminByUserRequest** (interface)
|
|
112
|
+
```typescript
|
|
113
|
+
interface AdminByUserRequest {
|
|
114
|
+
userId?: string
|
|
115
|
+
contactId?: string
|
|
116
|
+
appId?: string
|
|
117
|
+
actionId?: string
|
|
118
|
+
broadcastId?: string
|
|
119
|
+
outcome?: string | null
|
|
120
|
+
from?: string
|
|
121
|
+
to?: string
|
|
122
|
+
limit?: number
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**AdminCountsByOutcomeRequest** (interface)
|
|
127
|
+
```typescript
|
|
128
|
+
interface AdminCountsByOutcomeRequest {
|
|
129
|
+
appId?: string
|
|
130
|
+
actionId?: string
|
|
131
|
+
from?: string
|
|
132
|
+
to?: string
|
|
133
|
+
limit?: number
|
|
134
|
+
dedupeLatest?: boolean
|
|
135
|
+
idField?: IdField
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**AdminActorIdsByActionRequest** (interface)
|
|
140
|
+
```typescript
|
|
141
|
+
interface AdminActorIdsByActionRequest {
|
|
142
|
+
actionId: string
|
|
143
|
+
idField?: IdField
|
|
144
|
+
outcome?: string | null
|
|
145
|
+
includeOutcome?: boolean
|
|
146
|
+
from?: string
|
|
147
|
+
to?: string
|
|
148
|
+
limit?: number
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**PublicCountsByOutcomeRequest** (interface)
|
|
153
|
+
```typescript
|
|
154
|
+
interface PublicCountsByOutcomeRequest {
|
|
155
|
+
appId: string
|
|
156
|
+
actionId: string
|
|
157
|
+
from?: string
|
|
158
|
+
to?: string
|
|
159
|
+
limit?: number
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**PublicByUserRequest** (interface)
|
|
164
|
+
```typescript
|
|
165
|
+
interface PublicByUserRequest {
|
|
166
|
+
appId: string
|
|
167
|
+
actionId: string
|
|
168
|
+
from?: string
|
|
169
|
+
to?: string
|
|
170
|
+
limit?: number
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**ActionEventRow** (interface)
|
|
175
|
+
```typescript
|
|
176
|
+
interface ActionEventRow {
|
|
177
|
+
orgId: string
|
|
178
|
+
timestamp: string
|
|
179
|
+
appId?: string
|
|
180
|
+
actionId?: string
|
|
181
|
+
broadcastId?: string
|
|
182
|
+
userId?: string
|
|
183
|
+
contactId?: string
|
|
184
|
+
outcome?: string | null
|
|
185
|
+
[k: string]: unknown
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**OutcomeCount** (interface)
|
|
190
|
+
```typescript
|
|
191
|
+
interface OutcomeCount {
|
|
192
|
+
outcome: string | null; count: number
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**ActorWithOutcome** (interface)
|
|
197
|
+
```typescript
|
|
198
|
+
interface ActorWithOutcome {
|
|
199
|
+
id: string; outcome: string | null
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**AppendActionBody** (interface)
|
|
204
|
+
```typescript
|
|
205
|
+
interface AppendActionBody {
|
|
206
|
+
userId?: string
|
|
207
|
+
contactId?: string
|
|
208
|
+
actionId: string
|
|
209
|
+
appId?: string
|
|
210
|
+
broadcastId?: string
|
|
211
|
+
outcome?: string
|
|
212
|
+
timestamp?: string
|
|
213
|
+
[k: string]: any
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**ActionPermissions** (interface)
|
|
218
|
+
```typescript
|
|
219
|
+
interface ActionPermissions {
|
|
220
|
+
allowOwnRead?: boolean
|
|
221
|
+
allowPublicSummary?: boolean
|
|
222
|
+
allowAuthenticatedSummary?: boolean
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**ActionRecord** (interface)
|
|
227
|
+
```typescript
|
|
228
|
+
interface ActionRecord {
|
|
229
|
+
id: string
|
|
230
|
+
collectionId: string
|
|
231
|
+
appId: string
|
|
232
|
+
permissions?: ActionPermissions
|
|
233
|
+
data?: {
|
|
234
|
+
display?: {
|
|
235
|
+
title?: string
|
|
236
|
+
description?: string
|
|
237
|
+
icon?: string
|
|
238
|
+
color?: string
|
|
239
|
+
}
|
|
240
|
+
actionType?: string
|
|
241
|
+
[key: string]: unknown
|
|
242
|
+
}
|
|
243
|
+
createdAt: string
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**ActionList** (interface)
|
|
248
|
+
```typescript
|
|
249
|
+
interface ActionList {
|
|
250
|
+
items: ActionRecord[]
|
|
251
|
+
limit: number
|
|
252
|
+
offset: number
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**CreateActionBody** (interface)
|
|
257
|
+
```typescript
|
|
258
|
+
interface CreateActionBody {
|
|
259
|
+
id: string
|
|
260
|
+
appId: string
|
|
261
|
+
permissions?: ActionPermissions
|
|
262
|
+
data?: Record<string, unknown>
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**UpdateActionBody** (interface)
|
|
267
|
+
```typescript
|
|
268
|
+
interface UpdateActionBody {
|
|
269
|
+
appId?: string
|
|
270
|
+
permissions?: ActionPermissions
|
|
271
|
+
data?: Record<string, unknown>
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**ListActionsQuery** (interface)
|
|
276
|
+
```typescript
|
|
277
|
+
interface ListActionsQuery {
|
|
278
|
+
appId?: string
|
|
279
|
+
limit?: number
|
|
280
|
+
offset?: number
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**ActorId** = `string`
|
|
285
|
+
|
|
286
|
+
**ActionQueryByUser** = `AdminByUserRequest`
|
|
287
|
+
|
|
288
|
+
**ActionCountsQuery** = `AdminCountsByOutcomeRequest`
|
|
289
|
+
|
|
290
|
+
**ActorIdsByActionQuery** = `AdminActorIdsByActionRequest`
|
|
291
|
+
|
|
90
292
|
### appConfiguration
|
|
91
293
|
|
|
92
294
|
**AppConfigurationResponse** (interface)
|
|
@@ -328,6 +530,51 @@ interface AuthKitConfig {
|
|
|
328
530
|
|
|
329
531
|
**BatchUpdateRequest** = `any`
|
|
330
532
|
|
|
533
|
+
### broadcasts
|
|
534
|
+
|
|
535
|
+
**ListBroadcastsQuery** (interface)
|
|
536
|
+
```typescript
|
|
537
|
+
interface ListBroadcastsQuery {
|
|
538
|
+
limit?: number
|
|
539
|
+
offset?: number
|
|
540
|
+
appId?: string
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
**BroadcastRecord** (interface)
|
|
545
|
+
```typescript
|
|
546
|
+
interface BroadcastRecord {
|
|
547
|
+
id: string
|
|
548
|
+
collectionId: string
|
|
549
|
+
appId: string
|
|
550
|
+
templateId?: string | null
|
|
551
|
+
segmentId?: string | null
|
|
552
|
+
status?: string | null
|
|
553
|
+
scheduledAt?: string | null
|
|
554
|
+
sentAt?: string | null
|
|
555
|
+
data?: {
|
|
556
|
+
display?: {
|
|
557
|
+
title?: string
|
|
558
|
+
description?: string
|
|
559
|
+
icon?: string
|
|
560
|
+
color?: string
|
|
561
|
+
}
|
|
562
|
+
broadcastType?: string
|
|
563
|
+
[key: string]: unknown
|
|
564
|
+
}
|
|
565
|
+
createdAt: string
|
|
566
|
+
}
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
**BroadcastList** (interface)
|
|
570
|
+
```typescript
|
|
571
|
+
interface BroadcastList {
|
|
572
|
+
items: BroadcastRecord[]
|
|
573
|
+
limit: number
|
|
574
|
+
offset: number
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
331
578
|
### claimSet
|
|
332
579
|
|
|
333
580
|
**ClaimCodeRef** (interface)
|
|
@@ -405,6 +652,10 @@ interface CollectionResponse {
|
|
|
405
652
|
}
|
|
406
653
|
```
|
|
407
654
|
|
|
655
|
+
### common
|
|
656
|
+
|
|
657
|
+
**IdField** = `'userId' | 'contactId'`
|
|
658
|
+
|
|
408
659
|
### comms
|
|
409
660
|
|
|
410
661
|
**NotificationSubjectTarget** (interface)
|
|
@@ -491,6 +742,119 @@ interface SendNotificationResponse {
|
|
|
491
742
|
}
|
|
492
743
|
```
|
|
493
744
|
|
|
745
|
+
**CommunicationEvent** (interface)
|
|
746
|
+
```typescript
|
|
747
|
+
interface CommunicationEvent {
|
|
748
|
+
orgId: string
|
|
749
|
+
sourceId?: string
|
|
750
|
+
userId?: string
|
|
751
|
+
contactId?: string
|
|
752
|
+
channel?: string
|
|
753
|
+
timestamp: string
|
|
754
|
+
eventType?: string
|
|
755
|
+
outcome?: string | null
|
|
756
|
+
templateId?: string | null
|
|
757
|
+
[k: string]: any
|
|
758
|
+
}
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
**CommsQueryByUser** (interface)
|
|
762
|
+
```typescript
|
|
763
|
+
interface CommsQueryByUser {
|
|
764
|
+
userId?: string
|
|
765
|
+
contactId?: string
|
|
766
|
+
from?: string
|
|
767
|
+
to?: string
|
|
768
|
+
limit?: number
|
|
769
|
+
}
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
**RecipientWithOutcome** (interface)
|
|
773
|
+
```typescript
|
|
774
|
+
interface RecipientWithOutcome {
|
|
775
|
+
id: string; outcome: string
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
**CommsRecipientIdsQuery** (interface)
|
|
780
|
+
```typescript
|
|
781
|
+
interface CommsRecipientIdsQuery {
|
|
782
|
+
sourceId: string
|
|
783
|
+
idField?: 'userId' | 'contactId'
|
|
784
|
+
from?: string
|
|
785
|
+
to?: string
|
|
786
|
+
limit?: number
|
|
787
|
+
}
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
**CommsRecipientsWithoutActionQuery** (interface)
|
|
791
|
+
```typescript
|
|
792
|
+
interface CommsRecipientsWithoutActionQuery {
|
|
793
|
+
sourceId: string
|
|
794
|
+
actionId?: string
|
|
795
|
+
appId?: string
|
|
796
|
+
idField?: 'userId' | 'contactId'
|
|
797
|
+
from?: string
|
|
798
|
+
to?: string
|
|
799
|
+
limit?: number
|
|
800
|
+
}
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
**CommsRecipientsWithActionQuery** (interface)
|
|
804
|
+
```typescript
|
|
805
|
+
interface CommsRecipientsWithActionQuery {
|
|
806
|
+
sourceId: string
|
|
807
|
+
actionId?: string
|
|
808
|
+
appId?: string
|
|
809
|
+
outcome?: string
|
|
810
|
+
idField?: 'userId' | 'contactId'
|
|
811
|
+
includeOutcome?: boolean
|
|
812
|
+
from?: string
|
|
813
|
+
to?: string
|
|
814
|
+
limit?: number
|
|
815
|
+
}
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
**LogCommunicationEventBody** (interface)
|
|
819
|
+
```typescript
|
|
820
|
+
interface LogCommunicationEventBody {
|
|
821
|
+
sourceId: string
|
|
822
|
+
userId?: string
|
|
823
|
+
contactId?: string
|
|
824
|
+
channel?: string
|
|
825
|
+
eventType?: string
|
|
826
|
+
outcome?: string
|
|
827
|
+
templateId?: string
|
|
828
|
+
timestamp?: string
|
|
829
|
+
[k: string]: any
|
|
830
|
+
}
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
**LogBulkCommunicationEventsBody** (interface)
|
|
834
|
+
```typescript
|
|
835
|
+
interface LogBulkCommunicationEventsBody {
|
|
836
|
+
params: { sourceId: string; [k: string]: any }
|
|
837
|
+
ids: string[]
|
|
838
|
+
idField?: 'userId' | 'contactId'
|
|
839
|
+
}
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
**AppendResult** (interface)
|
|
843
|
+
```typescript
|
|
844
|
+
interface AppendResult {
|
|
845
|
+
success: true
|
|
846
|
+
}
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
**AppendBulkResult** (interface)
|
|
850
|
+
```typescript
|
|
851
|
+
interface AppendBulkResult {
|
|
852
|
+
success: true; count: number
|
|
853
|
+
}
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
**RecipientId** = `string`
|
|
857
|
+
|
|
494
858
|
### contact
|
|
495
859
|
|
|
496
860
|
**ContactResponse** (interface)
|
|
@@ -561,6 +925,78 @@ interface ErrorResponse {
|
|
|
561
925
|
}
|
|
562
926
|
```
|
|
563
927
|
|
|
928
|
+
### journeys
|
|
929
|
+
|
|
930
|
+
**JourneyRecord** (interface)
|
|
931
|
+
```typescript
|
|
932
|
+
interface JourneyRecord {
|
|
933
|
+
id: string
|
|
934
|
+
collectionId: string
|
|
935
|
+
appId?: string
|
|
936
|
+
name: string
|
|
937
|
+
active: boolean
|
|
938
|
+
journeyType: 'event_triggered' | 'scheduled'
|
|
939
|
+
data?: {
|
|
940
|
+
display?: {
|
|
941
|
+
title?: string
|
|
942
|
+
description?: string
|
|
943
|
+
icon?: string
|
|
944
|
+
color?: string
|
|
945
|
+
}
|
|
946
|
+
steps?: Array<{ id: string; type: string; config?: Record<string, unknown> }>
|
|
947
|
+
triggers?: Array<{ type: string; config?: Record<string, unknown> }>
|
|
948
|
+
entryRules?: any[]
|
|
949
|
+
exitRules?: any[]
|
|
950
|
+
metadata?: Record<string, unknown>
|
|
951
|
+
[key: string]: unknown
|
|
952
|
+
}
|
|
953
|
+
createdAt: string
|
|
954
|
+
updatedAt: string
|
|
955
|
+
}
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
**JourneyList** (interface)
|
|
959
|
+
```typescript
|
|
960
|
+
interface JourneyList {
|
|
961
|
+
items: JourneyRecord[]
|
|
962
|
+
limit: number
|
|
963
|
+
offset: number
|
|
964
|
+
}
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
**ListJourneysQuery** (interface)
|
|
968
|
+
```typescript
|
|
969
|
+
interface ListJourneysQuery {
|
|
970
|
+
appId?: string
|
|
971
|
+
active?: boolean
|
|
972
|
+
journeyType?: 'event_triggered' | 'scheduled'
|
|
973
|
+
limit?: number
|
|
974
|
+
offset?: number
|
|
975
|
+
}
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
**CreateJourneyBody** (interface)
|
|
979
|
+
```typescript
|
|
980
|
+
interface CreateJourneyBody {
|
|
981
|
+
appId?: string
|
|
982
|
+
name: string
|
|
983
|
+
active?: boolean
|
|
984
|
+
journeyType: 'event_triggered' | 'scheduled'
|
|
985
|
+
data?: Record<string, unknown>
|
|
986
|
+
}
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
**UpdateJourneyBody** (interface)
|
|
990
|
+
```typescript
|
|
991
|
+
interface UpdateJourneyBody {
|
|
992
|
+
appId?: string
|
|
993
|
+
name?: string
|
|
994
|
+
active?: boolean
|
|
995
|
+
journeyType?: 'event_triggered' | 'scheduled'
|
|
996
|
+
data?: Record<string, unknown>
|
|
997
|
+
}
|
|
998
|
+
```
|
|
999
|
+
|
|
564
1000
|
### nfc
|
|
565
1001
|
|
|
566
1002
|
**NfcTagInfo** (interface)
|
|
@@ -669,6 +1105,68 @@ interface ProofResponse {
|
|
|
669
1105
|
}
|
|
670
1106
|
```
|
|
671
1107
|
|
|
1108
|
+
### segments
|
|
1109
|
+
|
|
1110
|
+
**SegmentRecord** (interface)
|
|
1111
|
+
```typescript
|
|
1112
|
+
interface SegmentRecord {
|
|
1113
|
+
id: string
|
|
1114
|
+
collectionId: string
|
|
1115
|
+
appId?: string
|
|
1116
|
+
name: string
|
|
1117
|
+
filterType: 'dynamic' | 'static'
|
|
1118
|
+
estimatedCount?: number
|
|
1119
|
+
lastCalculatedAt?: string
|
|
1120
|
+
createdAt: string
|
|
1121
|
+
data?: {
|
|
1122
|
+
filterRules: any[]
|
|
1123
|
+
description?: string
|
|
1124
|
+
staticContactIds?: string[]
|
|
1125
|
+
[key: string]: unknown
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
**ListSegmentsQuery** (interface)
|
|
1131
|
+
```typescript
|
|
1132
|
+
interface ListSegmentsQuery {
|
|
1133
|
+
appId?: string
|
|
1134
|
+
filterType?: 'dynamic' | 'static'
|
|
1135
|
+
limit?: number
|
|
1136
|
+
offset?: number
|
|
1137
|
+
}
|
|
1138
|
+
```
|
|
1139
|
+
|
|
1140
|
+
**SegmentList** (interface)
|
|
1141
|
+
```typescript
|
|
1142
|
+
interface SegmentList {
|
|
1143
|
+
items: SegmentRecord[]
|
|
1144
|
+
limit: number
|
|
1145
|
+
offset: number
|
|
1146
|
+
}
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
**SegmentCalculateResult** (interface)
|
|
1150
|
+
```typescript
|
|
1151
|
+
interface SegmentCalculateResult {
|
|
1152
|
+
scheduled: true
|
|
1153
|
+
lastCalculatedAt?: string
|
|
1154
|
+
estimatedCount?: number | null
|
|
1155
|
+
note?: string
|
|
1156
|
+
}
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
**SegmentRecipientsResponse** (interface)
|
|
1160
|
+
```typescript
|
|
1161
|
+
interface SegmentRecipientsResponse {
|
|
1162
|
+
items: string[]
|
|
1163
|
+
limit: number
|
|
1164
|
+
offset: number
|
|
1165
|
+
total: number
|
|
1166
|
+
note?: string
|
|
1167
|
+
}
|
|
1168
|
+
```
|
|
1169
|
+
|
|
672
1170
|
### variant
|
|
673
1171
|
|
|
674
1172
|
**VariantResponse** = `any`
|
|
@@ -805,6 +1303,55 @@ type AccountInfoResponse = {
|
|
|
805
1303
|
|
|
806
1304
|
## API Functions
|
|
807
1305
|
|
|
1306
|
+
### actions
|
|
1307
|
+
|
|
1308
|
+
**byUser**(collectionId: string,
|
|
1309
|
+
query: AdminByUserRequest | ActionQueryByUser = {}) → `Promise<ActionEventRow[]>`
|
|
1310
|
+
POST /admin/collection/:collectionId/actions/by-user Returns BigQuery action rows, newest first.
|
|
1311
|
+
|
|
1312
|
+
**countsByOutcome**(collectionId: string,
|
|
1313
|
+
query: AdminCountsByOutcomeRequest | ActionCountsQuery = {}) → `Promise<OutcomeCount[]>`
|
|
1314
|
+
POST /admin/collection/:collectionId/actions/counts-by-outcome Returns array of { outcome, count }.
|
|
1315
|
+
|
|
1316
|
+
**actorIdsByAction**(collectionId: string,
|
|
1317
|
+
query: AdminActorIdsByActionRequest | ActorIdsByActionQuery) → `Promise<ActorId[] | ActorWithOutcome[]>`
|
|
1318
|
+
POST /admin/collection/:collectionId/actions/actor-ids/by-action Returns list of IDs, optionally with outcome when includeOutcome=true.
|
|
1319
|
+
|
|
1320
|
+
**append**(collectionId: string,
|
|
1321
|
+
body: AppendActionBody) → `Promise<`
|
|
1322
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1323
|
+
|
|
1324
|
+
**create**(collectionId: string,
|
|
1325
|
+
body: CreateActionBody) → `Promise<ActionRecord>`
|
|
1326
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1327
|
+
|
|
1328
|
+
**list**(collectionId: string,
|
|
1329
|
+
query: ListActionsQuery = {}) → `Promise<ActionList>`
|
|
1330
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1331
|
+
|
|
1332
|
+
**get**(collectionId: string,
|
|
1333
|
+
id: string) → `Promise<ActionRecord>`
|
|
1334
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1335
|
+
|
|
1336
|
+
**update**(collectionId: string,
|
|
1337
|
+
id: string,
|
|
1338
|
+
patchBody: UpdateActionBody) → `Promise<ActionRecord>`
|
|
1339
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1340
|
+
|
|
1341
|
+
**remove**(collectionId: string,
|
|
1342
|
+
id: string) → `Promise<void>`
|
|
1343
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1344
|
+
|
|
1345
|
+
**publicCountsByOutcome**(collectionId: string,
|
|
1346
|
+
body: PublicCountsByOutcomeRequest,
|
|
1347
|
+
authToken?: string) → `Promise<OutcomeCount[]>`
|
|
1348
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1349
|
+
|
|
1350
|
+
**publicMyActions**(collectionId: string,
|
|
1351
|
+
body: PublicByUserRequest,
|
|
1352
|
+
authToken?: string) → `Promise<ActionEventRow[]>`
|
|
1353
|
+
POST /admin/collection/:collectionId/actions/append Appends one action event.
|
|
1354
|
+
|
|
808
1355
|
### ai
|
|
809
1356
|
|
|
810
1357
|
**generateContent**(collectionId: string,
|
|
@@ -1074,6 +1621,24 @@ Get serial numbers for a batch (admin only).
|
|
|
1074
1621
|
codeId: string) → `Promise<any>`
|
|
1075
1622
|
Look up a serial number by code for a batch (admin only).
|
|
1076
1623
|
|
|
1624
|
+
### broadcasts
|
|
1625
|
+
|
|
1626
|
+
**create**(collectionId: string,
|
|
1627
|
+
body: Omit<BroadcastRecord, 'id' | 'collectionId' | 'createdAt'>) → `Promise<BroadcastRecord>`
|
|
1628
|
+
|
|
1629
|
+
**list**(collectionId: string,
|
|
1630
|
+
query: ListBroadcastsQuery = {}) → `Promise<BroadcastList>`
|
|
1631
|
+
|
|
1632
|
+
**get**(collectionId: string,
|
|
1633
|
+
id: string) → `Promise<BroadcastRecord>`
|
|
1634
|
+
|
|
1635
|
+
**update**(collectionId: string,
|
|
1636
|
+
id: string,
|
|
1637
|
+
body: Partial<Omit<BroadcastRecord, 'id' | 'collectionId' | 'createdAt'>>) → `Promise<BroadcastRecord>`
|
|
1638
|
+
|
|
1639
|
+
**remove**(collectionId: string,
|
|
1640
|
+
id: string) → `Promise<void>`
|
|
1641
|
+
|
|
1077
1642
|
### claimSet
|
|
1078
1643
|
|
|
1079
1644
|
**getAllForCollection**(collectionId: string) → `Promise<any[]>`
|
|
@@ -1158,6 +1723,30 @@ Assign a value to a serial number for a collection (admin only).
|
|
|
1158
1723
|
request: SendNotificationRequest) → `Promise<SendNotificationResponse>`
|
|
1159
1724
|
Send a notification to specified targets within a collection. Supports multiple delivery methods including push notifications, email, and wallet pass updates. The notification will be delivered based on user preferences and the specified delivery mode. ```typescript const result = await comms.sendNotification('my-collection', { subjectTargets: [{ type: 'product', id: 'prod_123' }], severity: 'important', mode: 'preferred', template: { push: { title: 'Update available', body: 'We\'ve shipped an important update.', icon: 'https://cdn.example.com/brand/logo-128.png' }, email: { subject: 'Important update for your product', body: 'There\'s an important update. Open your pass or profile to learn more.' }, walletUpdate: { textModulesData: [ { id: 'notice', header: 'Update', body: 'Open your wallet pass for details.' } ] } } }) if (result.ok) { console.log('Notification queued:', result.notificationId) console.log('Totals:', result.status.totals) } ```
|
|
1160
1725
|
|
|
1726
|
+
**queryByUser**(collectionId: string,
|
|
1727
|
+
body: CommsQueryByUser = {}) → `Promise<CommunicationEvent[]>`
|
|
1728
|
+
Analytics: Query communication events by user or contact. POST /admin/collection/:collectionId/comm/query/by-user
|
|
1729
|
+
|
|
1730
|
+
**queryRecipientIds**(collectionId: string,
|
|
1731
|
+
body: CommsRecipientIdsQuery) → `Promise<RecipientId[]>`
|
|
1732
|
+
Analytics: Recipient IDs for a communication source. POST /admin/collection/:collectionId/comm/query/recipient-ids
|
|
1733
|
+
|
|
1734
|
+
**queryRecipientsWithoutAction**(collectionId: string,
|
|
1735
|
+
body: CommsRecipientsWithoutActionQuery) → `Promise<RecipientId[]>`
|
|
1736
|
+
Analytics: Recipients who did not perform an action. POST /admin/collection/:collectionId/comm/query/recipients/without-action
|
|
1737
|
+
|
|
1738
|
+
**queryRecipientsWithAction**(collectionId: string,
|
|
1739
|
+
body: CommsRecipientsWithActionQuery) → `Promise<RecipientId[] | RecipientWithOutcome[]>`
|
|
1740
|
+
Analytics: Recipients who performed an action, optionally with outcome. POST /admin/collection/:collectionId/comm/query/recipients/with-action
|
|
1741
|
+
|
|
1742
|
+
**logCommunicationEvent**(collectionId: string,
|
|
1743
|
+
body: LogCommunicationEventBody) → `Promise<AppendResult>`
|
|
1744
|
+
Logging: Append a single communication event. POST /admin/collection/:collectionId/comm/log
|
|
1745
|
+
|
|
1746
|
+
**logBulkCommunicationEvents**(collectionId: string,
|
|
1747
|
+
body: LogBulkCommunicationEventsBody | ({ sourceId: string; ids: string[]; idField?: 'userId'|'contactId'; [k: string]: any }) → `void`
|
|
1748
|
+
Logging: Append many communication events for a list of IDs. POST /admin/collection/:collectionId/comm/log/bulk
|
|
1749
|
+
|
|
1161
1750
|
### contact
|
|
1162
1751
|
|
|
1163
1752
|
**create**(collectionId: string, data: ContactCreateRequest) → `Promise<ContactResponse>`
|
|
@@ -1217,6 +1806,24 @@ Update a form for a collection (admin only).
|
|
|
1217
1806
|
**remove**(collectionId: string, formId: string) → `Promise<void>`
|
|
1218
1807
|
Delete a form for a collection (admin only).
|
|
1219
1808
|
|
|
1809
|
+
### journeys
|
|
1810
|
+
|
|
1811
|
+
**create**(collectionId: string,
|
|
1812
|
+
body: CreateJourneyBody) → `Promise<JourneyRecord>`
|
|
1813
|
+
|
|
1814
|
+
**list**(collectionId: string,
|
|
1815
|
+
query: ListJourneysQuery = {}) → `Promise<JourneyList>`
|
|
1816
|
+
|
|
1817
|
+
**get**(collectionId: string,
|
|
1818
|
+
id: string) → `Promise<JourneyRecord>`
|
|
1819
|
+
|
|
1820
|
+
**update**(collectionId: string,
|
|
1821
|
+
id: string,
|
|
1822
|
+
body: UpdateJourneyBody) → `Promise<JourneyRecord>`
|
|
1823
|
+
|
|
1824
|
+
**remove**(collectionId: string,
|
|
1825
|
+
id: string) → `Promise<void>`
|
|
1826
|
+
|
|
1220
1827
|
### nfc
|
|
1221
1828
|
|
|
1222
1829
|
**claimTag**(data: NfcClaimTagRequest) → `Promise<NfcTagInfo>`
|
|
@@ -1316,6 +1923,31 @@ Find proofs for a product (admin only). POST /admin/collection/:collectionId/pro
|
|
|
1316
1923
|
batchId: string) → `Promise<ProofResponse[]>`
|
|
1317
1924
|
Get proofs for a batch (admin only). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof
|
|
1318
1925
|
|
|
1926
|
+
### segments
|
|
1927
|
+
|
|
1928
|
+
**create**(collectionId: string,
|
|
1929
|
+
body: Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>) → `Promise<SegmentRecord>`
|
|
1930
|
+
|
|
1931
|
+
**list**(collectionId: string,
|
|
1932
|
+
query: ListSegmentsQuery = {}) → `Promise<SegmentList>`
|
|
1933
|
+
|
|
1934
|
+
**get**(collectionId: string,
|
|
1935
|
+
id: string) → `Promise<SegmentRecord>`
|
|
1936
|
+
|
|
1937
|
+
**update**(collectionId: string,
|
|
1938
|
+
id: string,
|
|
1939
|
+
body: Partial<Omit<SegmentRecord, 'id' | 'collectionId' | 'createdAt'>>) → `Promise<SegmentRecord>`
|
|
1940
|
+
|
|
1941
|
+
**remove**(collectionId: string,
|
|
1942
|
+
id: string) → `Promise<void>`
|
|
1943
|
+
|
|
1944
|
+
**calculate**(collectionId: string,
|
|
1945
|
+
id: string) → `Promise<SegmentCalculateResult>`
|
|
1946
|
+
|
|
1947
|
+
**recipients**(collectionId: string,
|
|
1948
|
+
id: string,
|
|
1949
|
+
query: { limit?: number; offset?: number } = {}) → `Promise<SegmentRecipientsResponse>`
|
|
1950
|
+
|
|
1319
1951
|
### variant
|
|
1320
1952
|
|
|
1321
1953
|
**get**(collectionId: string,
|