@proveanything/smartlinks 1.2.1 → 1.2.3
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 +40 -3
- package/dist/api/contact.d.ts +2 -1
- package/dist/api/contact.js +6 -0
- package/dist/types/broadcasts.d.ts +4 -3
- package/dist/types/comms.d.ts +6 -0
- package/dist/types/contact.d.ts +29 -0
- package/dist/types/template.d.ts +9 -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.2.
|
|
3
|
+
Version: 1.2.3 | Generated: 2026-01-24T13:13:09.436Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -454,13 +454,13 @@ interface BroadcastRecord {
|
|
|
454
454
|
}
|
|
455
455
|
broadcastType?: string
|
|
456
456
|
topic: string
|
|
457
|
+
templateParams?: Record<string, unknown>;
|
|
457
458
|
channelSettings?: {
|
|
458
459
|
mode?: 'preferred' | 'channels' | 'all'
|
|
459
460
|
channels?: Array<{
|
|
460
|
-
channel:
|
|
461
|
+
channel: BroadcastChannel
|
|
461
462
|
enabled?: boolean
|
|
462
463
|
priority?: number
|
|
463
|
-
templateId?: string
|
|
464
464
|
}>
|
|
465
465
|
}
|
|
466
466
|
[key: string]: unknown
|
|
@@ -866,9 +866,12 @@ interface TopicConfig {
|
|
|
866
866
|
label?: string
|
|
867
867
|
description?: string
|
|
868
868
|
labels?: string[]
|
|
869
|
+
classification?: 'transactional' | 'marketing'
|
|
869
870
|
defaults?: {
|
|
870
871
|
channels?: Partial<Record<BroadcastChannel, boolean>>
|
|
871
872
|
topics?: Record<string, boolean | undefined>
|
|
873
|
+
policy?: 'opt-in' | 'opt-out'
|
|
874
|
+
byChannel?: Partial<Record<BroadcastChannel, 'opt-in' | 'opt-out'>>
|
|
872
875
|
}
|
|
873
876
|
rules?: {
|
|
874
877
|
allowChannels?: BroadcastChannel[]
|
|
@@ -1193,6 +1196,33 @@ interface CommsState {
|
|
|
1193
1196
|
}
|
|
1194
1197
|
```
|
|
1195
1198
|
|
|
1199
|
+
**BaseField** (interface)
|
|
1200
|
+
```typescript
|
|
1201
|
+
interface BaseField {
|
|
1202
|
+
key: string
|
|
1203
|
+
label: string
|
|
1204
|
+
type: FieldType
|
|
1205
|
+
widget: FieldWidget
|
|
1206
|
+
visible: boolean
|
|
1207
|
+
editable: boolean
|
|
1208
|
+
readOnly: boolean
|
|
1209
|
+
}
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
**ContactSchema** (interface)
|
|
1213
|
+
```typescript
|
|
1214
|
+
interface ContactSchema {
|
|
1215
|
+
version: number // 1
|
|
1216
|
+
fields: CoreField[] // core fields
|
|
1217
|
+
customFields: CustomField[]
|
|
1218
|
+
settings: {
|
|
1219
|
+
publicVisibleFields: string[]
|
|
1220
|
+
publicEditableFields: string[]
|
|
1221
|
+
customFieldsVersion: number
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1196
1226
|
**ContactCustomFields** = `Record<string, any>`
|
|
1197
1227
|
|
|
1198
1228
|
**ContactResponse** = `Contact`
|
|
@@ -1209,6 +1239,10 @@ interface CommsState {
|
|
|
1209
1239
|
|
|
1210
1240
|
**SubjectType** = `'product' | 'proof' | 'batch'`
|
|
1211
1241
|
|
|
1242
|
+
**FieldWidget** = `'text' | 'email' | 'tel' | 'select' | 'checkbox'`
|
|
1243
|
+
|
|
1244
|
+
**FieldType** = ``
|
|
1245
|
+
|
|
1212
1246
|
### error
|
|
1213
1247
|
|
|
1214
1248
|
**ErrorResponse** (interface)
|
|
@@ -1878,6 +1912,7 @@ interface TemplateBase {
|
|
|
1878
1912
|
push: { title: string; body: string, url?: string, iconUrl?: string },
|
|
1879
1913
|
wallet?: { header: string; body: string; imageUri?: string }
|
|
1880
1914
|
}
|
|
1915
|
+
parameters: TemplateParameterSchema[]
|
|
1881
1916
|
subject?: string
|
|
1882
1917
|
body?: string
|
|
1883
1918
|
css?: string
|
|
@@ -2594,6 +2629,8 @@ Logging: Append many communication events for a list of IDs. POST /admin/collect
|
|
|
2594
2629
|
**publicUpdateMine**(collectionId: string,
|
|
2595
2630
|
data: ContactPatch) → `Promise<PublicUpdateMyContactResponse>`
|
|
2596
2631
|
|
|
2632
|
+
**publicGetSchema**(collectionId: string) → `Promise<ContactSchema>`
|
|
2633
|
+
|
|
2597
2634
|
**erase**(collectionId: string, contactId: string, body?: any) → `Promise<ContactResponse>`
|
|
2598
2635
|
|
|
2599
2636
|
**getUser**(collectionId: string,
|
package/dist/api/contact.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContactResponse, ContactCreateRequest, ContactUpdateRequest, ContactListResponse, PublicContactUpsertRequest, PublicContactUpsertResponse, UserSearchResponse, ContactPatch, PublicGetMyContactResponse, PublicUpdateMyContactResponse } from "../types";
|
|
1
|
+
import { ContactResponse, ContactCreateRequest, ContactUpdateRequest, ContactListResponse, PublicContactUpsertRequest, PublicContactUpsertResponse, UserSearchResponse, ContactPatch, PublicGetMyContactResponse, PublicUpdateMyContactResponse, ContactSchema } from "../types";
|
|
2
2
|
export declare namespace contact {
|
|
3
3
|
function create(collectionId: string, data: ContactCreateRequest): Promise<ContactResponse>;
|
|
4
4
|
function list(collectionId: string, params?: {
|
|
@@ -19,6 +19,7 @@ export declare namespace contact {
|
|
|
19
19
|
function publicUpsert(collectionId: string, data: PublicContactUpsertRequest): Promise<PublicContactUpsertResponse>;
|
|
20
20
|
function publicGetMine(collectionId: string): Promise<PublicGetMyContactResponse>;
|
|
21
21
|
function publicUpdateMine(collectionId: string, data: ContactPatch): Promise<PublicUpdateMyContactResponse>;
|
|
22
|
+
function publicGetSchema(collectionId: string): Promise<ContactSchema>;
|
|
22
23
|
function erase(collectionId: string, contactId: string, body?: any): Promise<ContactResponse>;
|
|
23
24
|
function getUser(collectionId: string, userId: string): Promise<UserSearchResponse>;
|
|
24
25
|
}
|
package/dist/api/contact.js
CHANGED
|
@@ -71,6 +71,12 @@ export var contact;
|
|
|
71
71
|
return patch(path, data);
|
|
72
72
|
}
|
|
73
73
|
contact.publicUpdateMine = publicUpdateMine;
|
|
74
|
+
// Public: Get contact update schema for a collection
|
|
75
|
+
async function publicGetSchema(collectionId) {
|
|
76
|
+
const path = `/public/collection/${encodeURIComponent(collectionId)}/contact/schema`;
|
|
77
|
+
return request(path);
|
|
78
|
+
}
|
|
79
|
+
contact.publicGetSchema = publicGetSchema;
|
|
74
80
|
async function erase(collectionId, contactId, body) {
|
|
75
81
|
const path = `/admin/collection/${encodeURIComponent(collectionId)}/contacts/${encodeURIComponent(contactId)}/erase`;
|
|
76
82
|
return post(path, body || {});
|
|
@@ -3,6 +3,7 @@ export interface ListBroadcastsQuery {
|
|
|
3
3
|
offset?: number;
|
|
4
4
|
appId?: string;
|
|
5
5
|
}
|
|
6
|
+
export type BroadcastChannel = 'email' | 'push' | 'sms' | 'wallet';
|
|
6
7
|
export interface BroadcastRecord {
|
|
7
8
|
id: string;
|
|
8
9
|
collectionId: string;
|
|
@@ -22,14 +23,15 @@ export interface BroadcastRecord {
|
|
|
22
23
|
broadcastType?: string;
|
|
23
24
|
/** Required topic key for consent enforcement (e.g. newsletter, marketing, critical) */
|
|
24
25
|
topic: string;
|
|
26
|
+
/** Required topic key for consent enforcement (e.g. newsletter, marketing, critical) */
|
|
27
|
+
templateParams?: Record<string, unknown>;
|
|
25
28
|
/** Per-channel enablement/priority and optional template overrides */
|
|
26
29
|
channelSettings?: {
|
|
27
30
|
mode?: 'preferred' | 'channels' | 'all';
|
|
28
31
|
channels?: Array<{
|
|
29
|
-
channel:
|
|
32
|
+
channel: BroadcastChannel;
|
|
30
33
|
enabled?: boolean;
|
|
31
34
|
priority?: number;
|
|
32
|
-
templateId?: string;
|
|
33
35
|
}>;
|
|
34
36
|
};
|
|
35
37
|
[key: string]: unknown;
|
|
@@ -48,7 +50,6 @@ export interface BroadcastRecipientsResponse {
|
|
|
48
50
|
offset: number;
|
|
49
51
|
note?: string;
|
|
50
52
|
}
|
|
51
|
-
export type BroadcastChannel = 'email' | 'push' | 'sms' | 'wallet';
|
|
52
53
|
export interface BroadcastPreviewRequest {
|
|
53
54
|
contactId?: string;
|
|
54
55
|
email?: string;
|
package/dist/types/comms.d.ts
CHANGED
|
@@ -141,9 +141,15 @@ export interface TopicConfig {
|
|
|
141
141
|
description?: string;
|
|
142
142
|
/** Optional UI-only grouping labels */
|
|
143
143
|
labels?: string[];
|
|
144
|
+
/** Classification for UI and default policy guidance */
|
|
145
|
+
classification?: 'transactional' | 'marketing';
|
|
144
146
|
defaults?: {
|
|
145
147
|
channels?: Partial<Record<BroadcastChannel, boolean>>;
|
|
146
148
|
topics?: Record<string, boolean | undefined>;
|
|
149
|
+
/** Default consent policy when explicit preferences are absent */
|
|
150
|
+
policy?: 'opt-in' | 'opt-out';
|
|
151
|
+
/** Per-channel default policy (overrides policy when present) */
|
|
152
|
+
byChannel?: Partial<Record<BroadcastChannel, 'opt-in' | 'opt-out'>>;
|
|
147
153
|
};
|
|
148
154
|
rules?: {
|
|
149
155
|
allowChannels?: BroadcastChannel[];
|
package/dist/types/contact.d.ts
CHANGED
|
@@ -129,3 +129,32 @@ export interface CommsState {
|
|
|
129
129
|
/** Keyed by `_default` or `${type}_${id}` */
|
|
130
130
|
preferences?: Record<string, PreferenceEntry>;
|
|
131
131
|
}
|
|
132
|
+
export type FieldWidget = 'text' | 'email' | 'tel' | 'select' | 'checkbox';
|
|
133
|
+
export type FieldType = 'string' | 'url' | 'email' | 'tel' | 'text' | 'select' | 'checkbox' | 'boolean';
|
|
134
|
+
export interface BaseField {
|
|
135
|
+
key: string;
|
|
136
|
+
label: string;
|
|
137
|
+
type: FieldType;
|
|
138
|
+
widget: FieldWidget;
|
|
139
|
+
visible: boolean;
|
|
140
|
+
editable: boolean;
|
|
141
|
+
readOnly: boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface CoreField extends BaseField {
|
|
144
|
+
}
|
|
145
|
+
export interface CustomField extends BaseField {
|
|
146
|
+
path: string;
|
|
147
|
+
required: boolean;
|
|
148
|
+
order?: number;
|
|
149
|
+
options?: string[];
|
|
150
|
+
}
|
|
151
|
+
export interface ContactSchema {
|
|
152
|
+
version: number;
|
|
153
|
+
fields: CoreField[];
|
|
154
|
+
customFields: CustomField[];
|
|
155
|
+
settings: {
|
|
156
|
+
publicVisibleFields: string[];
|
|
157
|
+
publicEditableFields: string[];
|
|
158
|
+
customFieldsVersion: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
package/dist/types/template.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
interface TemplateParameterSchema {
|
|
2
|
+
key: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
}
|
|
1
8
|
export interface TemplateBase {
|
|
2
9
|
id: string;
|
|
3
10
|
collectionId: string;
|
|
@@ -31,6 +38,7 @@ export interface TemplateBase {
|
|
|
31
38
|
imageUri?: string;
|
|
32
39
|
};
|
|
33
40
|
};
|
|
41
|
+
parameters: TemplateParameterSchema[];
|
|
34
42
|
subject?: string;
|
|
35
43
|
body?: string;
|
|
36
44
|
css?: string;
|
|
@@ -65,3 +73,4 @@ export interface TemplateRenderSourceResponse {
|
|
|
65
73
|
ok: boolean;
|
|
66
74
|
html: string;
|
|
67
75
|
}
|
|
76
|
+
export {};
|