palbase 0.8.0 → 0.9.0
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/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{RO5Y5YU4.js → 23G5YVSL.js} +1 -1
- package/dist/chunks/{JSJVV43D.js → 3X7CRIHE.js} +1 -1
- package/dist/chunks/5UXVSEM2.js +2 -0
- package/dist/chunks/6YCANJ7U.js +2 -0
- package/dist/chunks/{BO5KR2EQ.js → 7HMBZG2R.js} +2 -2
- package/dist/chunks/{RBA6V3UO.js → 7OZCS3BA.js} +2 -2
- package/dist/chunks/FFWT3RBE.js +13 -0
- package/dist/chunks/{TUGRIOFX.js → GGKL7UV2.js} +2 -2
- package/dist/chunks/HGQXQMYU.js +95 -0
- package/dist/chunks/{Z5JVQNAZ.js → I45DYZZL.js} +2 -2
- package/dist/chunks/{WEI32SAJ.js → KSU226RI.js} +2 -2
- package/dist/chunks/MEIN5GAG.js +22 -0
- package/dist/chunks/OEZLXSQN.js +6 -0
- package/dist/chunks/{BRBCWPR3.js → OGREZP5F.js} +1 -1
- package/dist/chunks/{PGPQGKH2.js → ONP77MHF.js} +2 -2
- package/dist/chunks/{KDWDPSL2.js → QR4Z3ORW.js} +1 -1
- package/dist/chunks/{K6RRNI23.js → R5NCHIW3.js} +2 -2
- package/dist/chunks/{PDOHT46N.js → RV35QG7V.js} +2 -2
- package/dist/chunks/{P4Z5E6ZI.js → YOTK5642.js} +2 -2
- package/dist/chunks/{5VTGMNPL.js → Z7VRCVKE.js} +6 -6
- package/dist/cli.js +129 -127
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -0
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +2 -0
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +9 -2
- package/types/backend/src/services.d.ts +2 -2
- package/types/internal/src/modules/ai.d.ts +1 -1
- package/types/internal/src/modules/analytics.d.ts +618 -1
- package/types/internal/src/modules/auth.d.ts +409 -90
- package/types/internal/src/modules/events.d.ts +7 -3
- package/types/internal/src/modules/flags.d.ts +380 -14
- package/types/internal/src/modules/notify.d.ts +2270 -99
- package/types/internal/src/modules/purchases.d.ts +773 -2
- package/types/server/src/webhooks.d.ts +1 -1
- package/types/web/src/analytics.d.ts +56 -5
- package/types/web/src/client.d.ts +26 -4
- package/types/web/src/consent.d.ts +218 -0
- package/types/web/src/flags.d.ts +75 -0
- package/types/web/src/inapp.d.ts +129 -0
- package/types/web/src/inbox.d.ts +59 -0
- package/types/web/src/index.d.ts +9 -3
- package/types/web/src/installation.d.ts +16 -0
- package/types/web/src/message/index.d.ts +5 -0
- package/types/web/src/message/present.d.ts +20 -0
- package/types/web/src/notify.d.ts +67 -0
- package/types/web/src/paywall/index.d.ts +4 -4
- package/types/web/src/paywall/placement.d.ts +11 -12
- package/types/web/src/paywall/prices.d.ts +7 -2
- package/types/web/src/purchases.d.ts +80 -5
- package/types/web/src/{paywall → screen}/assets.d.ts +6 -6
- package/types/web/src/screen/render.d.ts +186 -0
- package/types/web/src/{paywall → screen}/resolve.d.ts +56 -8
- package/dist/chunks/DB3SIBKB.js +0 -2
- package/dist/chunks/EGNEXFTZ.js +0 -2
- package/dist/chunks/FZ3MQOVA.js +0 -6
- package/dist/chunks/WINBISC2.js +0 -92
- package/types/web/src/paywall/render.d.ts +0 -93
- /package/types/web/src/{paywall → screen}/icons.d.ts +0 -0
|
@@ -11,7 +11,7 @@ export type ChannelQueued = {
|
|
|
11
11
|
*/
|
|
12
12
|
export type ChannelReadiness = {
|
|
13
13
|
because?: string;
|
|
14
|
-
channel: "email" | "sms" | "verify" | "whatsapp" | "push";
|
|
14
|
+
channel: "email" | "sms" | "verify" | "whatsapp" | "push" | "iys";
|
|
15
15
|
ok: boolean;
|
|
16
16
|
remedy?: string;
|
|
17
17
|
/**
|
|
@@ -42,7 +42,7 @@ export type DeliveryEvent = {
|
|
|
42
42
|
provider: string;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* A user's
|
|
45
|
+
* A device — never its token: a signed-in user's, or, with no one signed in on it, its installation's (user_id absent).
|
|
46
46
|
*/
|
|
47
47
|
export type Device = {
|
|
48
48
|
app_version?: string;
|
|
@@ -53,8 +53,15 @@ export type Device = {
|
|
|
53
53
|
last_used_at?: string;
|
|
54
54
|
locale?: string;
|
|
55
55
|
platform: "android" | "ios" | "ios_voip" | "web";
|
|
56
|
+
/**
|
|
57
|
+
* The device's clock, an IANA time zone (Europe/Istanbul): when a push for its person's own hour goes, and their quiet hours. A registration that says none keeps the one it had.
|
|
58
|
+
*/
|
|
59
|
+
timezone?: string;
|
|
56
60
|
updated_at: string;
|
|
57
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Who is signed in on it; absent while no one is: the device is its installation's.
|
|
63
|
+
*/
|
|
64
|
+
user_id?: string;
|
|
58
65
|
};
|
|
59
66
|
/**
|
|
60
67
|
* A user's devices.
|
|
@@ -70,7 +77,7 @@ export type DevicePage = {
|
|
|
70
77
|
next_cursor?: string;
|
|
71
78
|
};
|
|
72
79
|
/**
|
|
73
|
-
* A device's push token as the app's push SDK gave it: FCM's, APNs' (a PushKit VoIP token on ios_voip),
|
|
80
|
+
* A device's push token as the app's push SDK gave it: FCM's, APNs' (a PushKit VoIP token on ios_voip), Expo's (ExponentPushToken[…]), or a browser's push subscription (platform web: PushSubscription.toJSON(), its endpoint one of the browsers' push services). A token another device held moves here.
|
|
74
81
|
*/
|
|
75
82
|
export type DeviceRegistration = {
|
|
76
83
|
app_version?: string | null;
|
|
@@ -78,12 +85,19 @@ export type DeviceRegistration = {
|
|
|
78
85
|
* The app's own stable name for the device.
|
|
79
86
|
*/
|
|
80
87
|
device_id: string;
|
|
88
|
+
/**
|
|
89
|
+
* The app install's label (the SDK's installation id): required with no one signed in — the device is the installation's.
|
|
90
|
+
*/
|
|
81
91
|
installation_id?: string | null;
|
|
82
92
|
/**
|
|
83
93
|
* The device's language: the push it gets is in it.
|
|
84
94
|
*/
|
|
85
95
|
locale?: string | null;
|
|
86
96
|
platform: "android" | "ios" | "ios_voip" | "web";
|
|
97
|
+
/**
|
|
98
|
+
* The device's clock, an IANA time zone (Europe/Istanbul): when a push for its person's own hour goes, and their quiet hours. A registration that says none keeps the one it had.
|
|
99
|
+
*/
|
|
100
|
+
timezone?: string;
|
|
87
101
|
token: string;
|
|
88
102
|
};
|
|
89
103
|
/**
|
|
@@ -118,6 +132,10 @@ export type EmailSend = {
|
|
|
118
132
|
* The message's kind: transactional (the default) reaches every user; any other — marketing, news — only users who did not turn it off on this channel (preferences). 1 to 64 of a-z, 0-9, _ . -.
|
|
119
133
|
*/
|
|
120
134
|
category?: string;
|
|
135
|
+
/**
|
|
136
|
+
* One of purchases' coupons: {{coupon}} is the user's (user_id) own code of it — a shared coupon's code, or one of its one-time codes given to them, recorded as theirs.
|
|
137
|
+
*/
|
|
138
|
+
coupon?: string;
|
|
121
139
|
from?: EmailFrom;
|
|
122
140
|
html?: string;
|
|
123
141
|
locale?: string;
|
|
@@ -143,115 +161,1569 @@ export type EmailSend = {
|
|
|
143
161
|
/**
|
|
144
162
|
* One email address.
|
|
145
163
|
*/
|
|
146
|
-
to: string;
|
|
164
|
+
to: string;
|
|
165
|
+
/**
|
|
166
|
+
* The user the message is for: their preferences hold, and deleting them deletes it.
|
|
167
|
+
*/
|
|
168
|
+
user_id?: string;
|
|
169
|
+
variables?: {
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* A template as it renders now.
|
|
175
|
+
*/
|
|
176
|
+
export type EmailTemplate = {
|
|
177
|
+
customized: boolean;
|
|
178
|
+
html_body: string;
|
|
179
|
+
locale: string;
|
|
180
|
+
slug: string;
|
|
181
|
+
subject: string;
|
|
182
|
+
text_body: string;
|
|
183
|
+
/**
|
|
184
|
+
* When the project last wrote its override; absent on the platform's default, which was never written.
|
|
185
|
+
*/
|
|
186
|
+
updated_at?: string;
|
|
187
|
+
variables: string[];
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Every template the project's email renders from, as a list shows it.
|
|
191
|
+
*/
|
|
192
|
+
export type EmailTemplateList = {
|
|
193
|
+
templates: EmailTemplateSummary[];
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* An email template in one locale, as a list shows it: its subject (998 bytes at most), never its body — a body is up to 256 KiB of HTML and as much text.
|
|
197
|
+
*/
|
|
198
|
+
export type EmailTemplateSummary = {
|
|
199
|
+
/**
|
|
200
|
+
* Whether the project overrides it.
|
|
201
|
+
*/
|
|
202
|
+
customized: boolean;
|
|
203
|
+
locale: string;
|
|
204
|
+
slug: string;
|
|
205
|
+
subject: string;
|
|
206
|
+
/**
|
|
207
|
+
* When the project last wrote its override; absent on the platform's default, which was never written.
|
|
208
|
+
*/
|
|
209
|
+
updated_at?: string;
|
|
210
|
+
variables: string[];
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* A template override. Its subject, and an HTML body, a text body or both: a template with neither is refused (422).
|
|
214
|
+
*/
|
|
215
|
+
export type EmailTemplateWrite = {
|
|
216
|
+
html_body?: string;
|
|
217
|
+
subject: string;
|
|
218
|
+
text_body?: string;
|
|
219
|
+
};
|
|
220
|
+
export type ErrorResponse = {
|
|
221
|
+
/**
|
|
222
|
+
* Machine-readable error code (snake_case)
|
|
223
|
+
*/
|
|
224
|
+
error: string;
|
|
225
|
+
/**
|
|
226
|
+
* Human-readable explanation
|
|
227
|
+
*/
|
|
228
|
+
error_description: string;
|
|
229
|
+
/**
|
|
230
|
+
* Correlation ID
|
|
231
|
+
*/
|
|
232
|
+
request_id: string;
|
|
233
|
+
/**
|
|
234
|
+
* Seconds to wait before retrying, when the refusal ends with time.
|
|
235
|
+
*/
|
|
236
|
+
retry_after?: number;
|
|
237
|
+
/**
|
|
238
|
+
* HTTP status code
|
|
239
|
+
*/
|
|
240
|
+
status: number;
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* An in-app campaign.
|
|
244
|
+
*/
|
|
245
|
+
export type InAppCampaign = {
|
|
246
|
+
/**
|
|
247
|
+
* An analytics audience: its members who allowed personalization; none: everyone.
|
|
248
|
+
*/
|
|
249
|
+
audience_id?: string;
|
|
250
|
+
conversion?: InAppConversion;
|
|
251
|
+
/**
|
|
252
|
+
* The coupon whose code {{coupon}} is, for each person.
|
|
253
|
+
*/
|
|
254
|
+
coupon?: string;
|
|
255
|
+
created_at: string;
|
|
256
|
+
definition: MessageDefinition;
|
|
257
|
+
ends_at?: string;
|
|
258
|
+
id: string;
|
|
259
|
+
limits: InAppLimits;
|
|
260
|
+
name: string;
|
|
261
|
+
/**
|
|
262
|
+
* Which shows when two would (higher first).
|
|
263
|
+
*/
|
|
264
|
+
priority: number;
|
|
265
|
+
starts_at?: string;
|
|
266
|
+
status: "draft" | "active" | "paused" | "ended";
|
|
267
|
+
trigger: InAppTrigger;
|
|
268
|
+
updated_at: string;
|
|
269
|
+
/**
|
|
270
|
+
* The values its texts name.
|
|
271
|
+
*/
|
|
272
|
+
variables?: {
|
|
273
|
+
[key: string]: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* The project's campaigns.
|
|
278
|
+
*/
|
|
279
|
+
export type InAppCampaignList = {
|
|
280
|
+
campaigns: InAppCampaign[];
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* An in-app campaign, written whole.
|
|
284
|
+
*/
|
|
285
|
+
export type InAppCampaignWrite = {
|
|
286
|
+
/**
|
|
287
|
+
* An analytics audience: its members who allowed personalization; none: everyone.
|
|
288
|
+
*/
|
|
289
|
+
audience_id?: string;
|
|
290
|
+
conversion?: InAppConversion;
|
|
291
|
+
/**
|
|
292
|
+
* One of purchases' coupons: {{coupon}} is each person's own code of it — the campaign is shown to users alone, and waits for one the coupon has no code for.
|
|
293
|
+
*/
|
|
294
|
+
coupon?: string;
|
|
295
|
+
definition: MessageDefinition;
|
|
296
|
+
ends_at?: string;
|
|
297
|
+
limits?: InAppLimits;
|
|
298
|
+
name: string;
|
|
299
|
+
/**
|
|
300
|
+
* Which shows when two would (higher first).
|
|
301
|
+
*/
|
|
302
|
+
priority?: number;
|
|
303
|
+
starts_at?: string;
|
|
304
|
+
status?: "draft" | "active" | "paused" | "ended";
|
|
305
|
+
trigger: InAppTrigger;
|
|
306
|
+
/**
|
|
307
|
+
* The values its texts name.
|
|
308
|
+
*/
|
|
309
|
+
variables?: {
|
|
310
|
+
[key: string]: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* What counts as a campaign's conversion: the person's event within hours of seeing it.
|
|
315
|
+
*/
|
|
316
|
+
export type InAppConversion = {
|
|
317
|
+
event: string;
|
|
318
|
+
hours: number;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* What a person did with a campaign shown to them.
|
|
322
|
+
*/
|
|
323
|
+
export type InAppEvent = {
|
|
324
|
+
/**
|
|
325
|
+
* The button's action (deep_link, custom …).
|
|
326
|
+
*/
|
|
327
|
+
action?: string;
|
|
328
|
+
type: "clicked" | "dismissed" | "converted";
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* A campaign shown.
|
|
332
|
+
*/
|
|
333
|
+
export type InAppImpression = {
|
|
334
|
+
id: string;
|
|
335
|
+
/**
|
|
336
|
+
* Values that come with the showing: coupon, the person's own code of the campaign's coupon (the same each time).
|
|
337
|
+
*/
|
|
338
|
+
variables?: {
|
|
339
|
+
[key: string]: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* A campaign to show now, in a session.
|
|
344
|
+
*/
|
|
345
|
+
export type InAppImpressionWrite = {
|
|
346
|
+
campaign_id: string;
|
|
347
|
+
/**
|
|
348
|
+
* The install's id, when no one is signed in.
|
|
349
|
+
*/
|
|
350
|
+
installation_id?: string;
|
|
351
|
+
session_id: string;
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* How often a campaign reaches a person at most, beside the project's in_app settings.
|
|
355
|
+
*/
|
|
356
|
+
export type InAppLimits = {
|
|
357
|
+
/**
|
|
358
|
+
* Ever.
|
|
359
|
+
*/
|
|
360
|
+
max_total?: number;
|
|
361
|
+
/**
|
|
362
|
+
* The least time between two.
|
|
363
|
+
*/
|
|
364
|
+
min_minutes?: number;
|
|
365
|
+
/**
|
|
366
|
+
* In 24 hours.
|
|
367
|
+
*/
|
|
368
|
+
per_day?: number;
|
|
369
|
+
/**
|
|
370
|
+
* In a session.
|
|
371
|
+
*/
|
|
372
|
+
per_session?: number;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* A campaign as the person's app takes it.
|
|
376
|
+
*/
|
|
377
|
+
export type InAppMessage = {
|
|
378
|
+
campaign_id: string;
|
|
379
|
+
conversion?: InAppConversion;
|
|
380
|
+
/**
|
|
381
|
+
* {{coupon}} is the person's own code of the campaign's coupon, which comes with its showing (POST /notify/in-app/impressions answers it): a campaign with a coupon is listed to accounts alone.
|
|
382
|
+
*/
|
|
383
|
+
coupon?: boolean;
|
|
384
|
+
definition: MessageDefinition;
|
|
385
|
+
limits: InAppLimits;
|
|
386
|
+
priority: number;
|
|
387
|
+
shown: InAppShown;
|
|
388
|
+
trigger: InAppTrigger;
|
|
389
|
+
variables?: {
|
|
390
|
+
[key: string]: string;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* The person's campaigns now, and how often in-app messages may reach them across every campaign and did.
|
|
395
|
+
*/
|
|
396
|
+
export type InAppMessageList = {
|
|
397
|
+
limits: InAppSettings;
|
|
398
|
+
messages: InAppMessage[];
|
|
399
|
+
shown: InAppShown;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* How often in-app messages reach a person at most, unless a campaign says less.
|
|
403
|
+
*/
|
|
404
|
+
export type InAppSettings = {
|
|
405
|
+
/**
|
|
406
|
+
* The least time between two (10 unwritten).
|
|
407
|
+
*/
|
|
408
|
+
min_minutes: number;
|
|
409
|
+
/**
|
|
410
|
+
* How many in a day (3 unwritten).
|
|
411
|
+
*/
|
|
412
|
+
per_day: number;
|
|
413
|
+
/**
|
|
414
|
+
* How many in a session of the app (1 unwritten).
|
|
415
|
+
*/
|
|
416
|
+
per_session: number;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* How often a person was shown in-app messages.
|
|
420
|
+
*/
|
|
421
|
+
export type InAppShown = {
|
|
422
|
+
/**
|
|
423
|
+
* In the last 24 hours.
|
|
424
|
+
*/
|
|
425
|
+
day: number;
|
|
426
|
+
last_at?: string;
|
|
427
|
+
/**
|
|
428
|
+
* In this session.
|
|
429
|
+
*/
|
|
430
|
+
session: number;
|
|
431
|
+
total: number;
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* A campaign's counts.
|
|
435
|
+
*/
|
|
436
|
+
export type InAppStats = {
|
|
437
|
+
clicked: number;
|
|
438
|
+
converted: number;
|
|
439
|
+
dismissed: number;
|
|
440
|
+
/**
|
|
441
|
+
* How many people it was shown to.
|
|
442
|
+
*/
|
|
443
|
+
people: number;
|
|
444
|
+
shown: number;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* A designed message.
|
|
448
|
+
*/
|
|
449
|
+
export type InAppTemplate = {
|
|
450
|
+
definition: MessageDefinition;
|
|
451
|
+
description: string;
|
|
452
|
+
key: string;
|
|
453
|
+
name: string;
|
|
454
|
+
/**
|
|
455
|
+
* How it is shown.
|
|
456
|
+
*/
|
|
457
|
+
presentation: "modal" | "fullscreen" | "banner" | "card";
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* The designed messages.
|
|
461
|
+
*/
|
|
462
|
+
export type InAppTemplateList = {
|
|
463
|
+
templates: InAppTemplate[];
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* What shows a campaign: an event of the app's (session_start as it comes to the foreground), with properties it must have, each equal.
|
|
467
|
+
*/
|
|
468
|
+
export type InAppTrigger = {
|
|
469
|
+
event: string;
|
|
470
|
+
where?: {
|
|
471
|
+
[key: string]: string;
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* A WhatsApp message a user sent the project's number.
|
|
476
|
+
*/
|
|
477
|
+
export type Inbound = {
|
|
478
|
+
id: string;
|
|
479
|
+
/**
|
|
480
|
+
* text, image, audio, location, … as Meta names it.
|
|
481
|
+
*/
|
|
482
|
+
kind: string;
|
|
483
|
+
message: MetaMessage;
|
|
484
|
+
phone_number_id: string;
|
|
485
|
+
received_at: string;
|
|
486
|
+
sent_at: string;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* A page of the WhatsApp messages users sent, newest first.
|
|
490
|
+
*/
|
|
491
|
+
export type InboundPage = {
|
|
492
|
+
messages: Inbound[];
|
|
493
|
+
next_cursor?: string;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* An inbox message, written out in its reader's language.
|
|
497
|
+
*/
|
|
498
|
+
export type InboxItem = {
|
|
499
|
+
body: string;
|
|
500
|
+
card?: MessageDefinition;
|
|
501
|
+
category?: string;
|
|
502
|
+
created_at: string;
|
|
503
|
+
data?: {
|
|
504
|
+
[key: string]: string;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* Where a tap goes.
|
|
508
|
+
*/
|
|
509
|
+
deep_link?: string;
|
|
510
|
+
expires_at: string;
|
|
511
|
+
id: string;
|
|
512
|
+
image?: string;
|
|
513
|
+
/**
|
|
514
|
+
* The push it is a copy of.
|
|
515
|
+
*/
|
|
516
|
+
message_id?: string;
|
|
517
|
+
/**
|
|
518
|
+
* When it was read, on any of the person's devices.
|
|
519
|
+
*/
|
|
520
|
+
read_at?: string;
|
|
521
|
+
title: string;
|
|
522
|
+
/**
|
|
523
|
+
* Whose it is: in the project's list.
|
|
524
|
+
*/
|
|
525
|
+
user_id?: string;
|
|
526
|
+
/**
|
|
527
|
+
* The sender's values, for its card.
|
|
528
|
+
*/
|
|
529
|
+
variables?: {
|
|
530
|
+
[key: string]: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* A page of an inbox, newest first.
|
|
535
|
+
*/
|
|
536
|
+
export type InboxPage = {
|
|
537
|
+
items: InboxItem[];
|
|
538
|
+
/**
|
|
539
|
+
* The next page's cursor; none at the end.
|
|
540
|
+
*/
|
|
541
|
+
next_cursor?: string;
|
|
542
|
+
/**
|
|
543
|
+
* How many of the whole inbox are unread.
|
|
544
|
+
*/
|
|
545
|
+
unread: number;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* The messages read: some (ids), or all.
|
|
549
|
+
*/
|
|
550
|
+
export type InboxRead = {
|
|
551
|
+
all?: boolean;
|
|
552
|
+
ids?: string[];
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* How many messages became read.
|
|
556
|
+
*/
|
|
557
|
+
export type InboxReadResult = {
|
|
558
|
+
read: number;
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Who: each person once.
|
|
562
|
+
*/
|
|
563
|
+
export type InboxRecipients = {
|
|
564
|
+
user_ids: string[];
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* A message to people's inboxes: a title, a body (a text, or one per locale; Handlebars, filled with variables), or a designed card.
|
|
568
|
+
*/
|
|
569
|
+
export type InboxSend = {
|
|
570
|
+
body?: LocalizedText;
|
|
571
|
+
card?: MessageDefinition;
|
|
572
|
+
category?: string;
|
|
573
|
+
data?: {
|
|
574
|
+
[key: string]: string;
|
|
575
|
+
};
|
|
576
|
+
deep_link?: string;
|
|
577
|
+
default_locale?: string;
|
|
578
|
+
/**
|
|
579
|
+
* How long it stays: the project's inbox.days unless it says; 365 at most.
|
|
580
|
+
*/
|
|
581
|
+
expires_in_days?: number;
|
|
582
|
+
image?: string;
|
|
583
|
+
title?: LocalizedText;
|
|
584
|
+
to: InboxRecipients;
|
|
585
|
+
variables?: {
|
|
586
|
+
[key: string]: string;
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* The messages a send left: one a person, in its people's order, the deleted people left out — who those were is skipped_user_ids.
|
|
591
|
+
*/
|
|
592
|
+
export type InboxSent = {
|
|
593
|
+
ids: string[];
|
|
594
|
+
/**
|
|
595
|
+
* The people sent to who were deleted: they keep nothing.
|
|
596
|
+
*/
|
|
597
|
+
skipped_user_ids: string[];
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* The project's inbox.
|
|
601
|
+
*/
|
|
602
|
+
export type InboxSettings = {
|
|
603
|
+
/**
|
|
604
|
+
* Days a message stays, unless it says (90 unwritten).
|
|
605
|
+
*/
|
|
606
|
+
days: number;
|
|
607
|
+
/**
|
|
608
|
+
* Whether a push leaves its copy in its person's inbox when its send does not say.
|
|
609
|
+
*/
|
|
610
|
+
push_copy: boolean;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* A text per BCP 47 locale.
|
|
614
|
+
*/
|
|
615
|
+
export type LocaleTexts = {
|
|
616
|
+
[key: string]: string;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* A text, or one per locale: each device gets the one in its language (its locale, that language, default_locale, the project's default, English), filled with variables (Handlebars, as a template) and cut to what a banner shows (65 characters for a title, 240 for a body).
|
|
620
|
+
*/
|
|
621
|
+
export type LocalizedText = PlainText | LocaleTexts;
|
|
622
|
+
/**
|
|
623
|
+
* How many messages that are not transactional a recipient gets at most in a window; one more is skipped (skip_reason frequency_cap). Null: no cap. count messages at most in hours.
|
|
624
|
+
*/
|
|
625
|
+
export type MarketingCap = ({
|
|
626
|
+
/**
|
|
627
|
+
* How many.
|
|
628
|
+
*/
|
|
629
|
+
count: number;
|
|
630
|
+
/**
|
|
631
|
+
* In how many hours.
|
|
632
|
+
*/
|
|
633
|
+
hours: number;
|
|
634
|
+
}) | null;
|
|
635
|
+
/**
|
|
636
|
+
* What a button does: closes the message (close), opens an https address (open_url) or a link the app opens (deep_link), asks for push — the system's prompt, after the message's own ask (request_push) —, shows the paywall of a placement (show_paywall), hands a name and a value to the app's own code (custom), opens one of the message's sheets (sheet), or takes one of the catalog's offers (offer: the app buys it with the offer, or claims its grant). The message closes as the action is taken unless dismiss says false.
|
|
637
|
+
*/
|
|
638
|
+
export type MessageAction = {
|
|
639
|
+
/**
|
|
640
|
+
* Dismiss.
|
|
641
|
+
*/
|
|
642
|
+
dismiss?: boolean;
|
|
643
|
+
/**
|
|
644
|
+
* Link.
|
|
645
|
+
*/
|
|
646
|
+
link?: string;
|
|
647
|
+
/**
|
|
648
|
+
* Name.
|
|
649
|
+
*/
|
|
650
|
+
name?: string;
|
|
651
|
+
/**
|
|
652
|
+
* Offer.
|
|
653
|
+
*/
|
|
654
|
+
offer?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Placement.
|
|
657
|
+
*/
|
|
658
|
+
placement?: string;
|
|
659
|
+
/**
|
|
660
|
+
* Sheet.
|
|
661
|
+
*/
|
|
662
|
+
sheet?: string;
|
|
663
|
+
/**
|
|
664
|
+
* Type.
|
|
665
|
+
*/
|
|
666
|
+
type: "close" | "open_url" | "deep_link" | "request_push" | "show_paywall" | "custom" | "sheet" | "offer";
|
|
667
|
+
/**
|
|
668
|
+
* Url.
|
|
669
|
+
*/
|
|
670
|
+
url?: string;
|
|
671
|
+
/**
|
|
672
|
+
* Value.
|
|
673
|
+
*/
|
|
674
|
+
value?: string;
|
|
675
|
+
};
|
|
676
|
+
/**
|
|
677
|
+
* How the component appears; a renderer skips it when the system asks to reduce motion.
|
|
678
|
+
*/
|
|
679
|
+
export type MessageAnimation = {
|
|
680
|
+
/**
|
|
681
|
+
* Delay ms.
|
|
682
|
+
*/
|
|
683
|
+
delay_ms?: number;
|
|
684
|
+
/**
|
|
685
|
+
* Duration ms.
|
|
686
|
+
*/
|
|
687
|
+
duration_ms?: number;
|
|
688
|
+
/**
|
|
689
|
+
* Easing.
|
|
690
|
+
*/
|
|
691
|
+
easing?: "ease_out" | "ease_in_out" | "spring";
|
|
692
|
+
/**
|
|
693
|
+
* Type.
|
|
694
|
+
*/
|
|
695
|
+
type: "fade" | "slide_up" | "slide_down" | "slide_leading" | "slide_trailing" | "scale";
|
|
696
|
+
};
|
|
697
|
+
/**
|
|
698
|
+
* A border.
|
|
699
|
+
*/
|
|
700
|
+
export type MessageBorder = {
|
|
701
|
+
/**
|
|
702
|
+
* Color.
|
|
703
|
+
*/
|
|
704
|
+
color: string;
|
|
705
|
+
/**
|
|
706
|
+
* Width.
|
|
707
|
+
*/
|
|
708
|
+
width: number;
|
|
709
|
+
};
|
|
710
|
+
/**
|
|
711
|
+
* A button that does an action: closes the message, opens an address or a link of the app, asks for push, shows a paywall, hands a name to the app's code, opens one of the message's sheets, or takes an offer.
|
|
712
|
+
*/
|
|
713
|
+
export type MessageButton = {
|
|
714
|
+
action: MessageAction;
|
|
715
|
+
animation?: MessageAnimation;
|
|
716
|
+
content: MessageComponent;
|
|
717
|
+
/**
|
|
718
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
719
|
+
*/
|
|
720
|
+
id?: string;
|
|
721
|
+
states?: MessageStates;
|
|
722
|
+
style?: MessageStyle;
|
|
723
|
+
/**
|
|
724
|
+
* The component.
|
|
725
|
+
*/
|
|
726
|
+
type: "button";
|
|
727
|
+
visible?: MessageCondition;
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* Pages the customer swipes through, the next peeking in, advancing on their own, with an indicator.
|
|
731
|
+
*/
|
|
732
|
+
export type MessageCarousel = {
|
|
733
|
+
animation?: MessageAnimation;
|
|
734
|
+
/**
|
|
735
|
+
* Auto advance ms.
|
|
736
|
+
*/
|
|
737
|
+
auto_advance_ms?: number;
|
|
738
|
+
/**
|
|
739
|
+
* Height.
|
|
740
|
+
*/
|
|
741
|
+
height?: MessageSizeKeyword | MessageLength;
|
|
742
|
+
/**
|
|
743
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
744
|
+
*/
|
|
745
|
+
id?: string;
|
|
746
|
+
indicator?: MessageIndicator;
|
|
747
|
+
/**
|
|
748
|
+
* Loop.
|
|
749
|
+
*/
|
|
750
|
+
loop?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Pages.
|
|
753
|
+
*/
|
|
754
|
+
pages: MessageComponent[];
|
|
755
|
+
/**
|
|
756
|
+
* Peek.
|
|
757
|
+
*/
|
|
758
|
+
peek?: number;
|
|
759
|
+
/**
|
|
760
|
+
* Spacing.
|
|
761
|
+
*/
|
|
762
|
+
spacing?: number;
|
|
763
|
+
states?: MessageStates;
|
|
764
|
+
style?: MessageStyle;
|
|
765
|
+
/**
|
|
766
|
+
* The component.
|
|
767
|
+
*/
|
|
768
|
+
type: "carousel";
|
|
769
|
+
visible?: MessageCondition;
|
|
770
|
+
};
|
|
771
|
+
/**
|
|
772
|
+
* A color: a token of the theme's colors (the light or the dark value, as the app appears), or #RRGGBB / #RRGGBBAA.
|
|
773
|
+
*/
|
|
774
|
+
export type MessageColorValue = string;
|
|
775
|
+
/**
|
|
776
|
+
* The theme's colors by name, for each appearance; both name the same colors, at least background, surface, text, muted, accent and on_accent.
|
|
777
|
+
*/
|
|
778
|
+
export type MessageColors = {
|
|
779
|
+
dark: MessagePalette;
|
|
780
|
+
light: MessagePalette;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* A component, by its type. A newer schema adds components; an app never draws a definition with one it does not know.
|
|
784
|
+
*/
|
|
785
|
+
export type MessageComponent = MessageButton | MessageCarousel | MessageCountdown | MessageCustomHtml | MessageDivider | MessageFeatures | MessageIcon | MessageImage | MessageSpacer | MessageStack | MessageSwitch | MessageTabs | MessageText | MessageTimeline | MessageVideo;
|
|
786
|
+
/**
|
|
787
|
+
* When the component is shown: every field named holds at once.
|
|
788
|
+
*/
|
|
789
|
+
export type MessageCondition = {
|
|
790
|
+
/**
|
|
791
|
+
* Appearance.
|
|
792
|
+
*/
|
|
793
|
+
appearance?: "light" | "dark";
|
|
794
|
+
/**
|
|
795
|
+
* Locale.
|
|
796
|
+
*/
|
|
797
|
+
locale?: string[];
|
|
798
|
+
/**
|
|
799
|
+
* Platform.
|
|
800
|
+
*/
|
|
801
|
+
platform?: ("ios" | "android" | "web")[];
|
|
802
|
+
/**
|
|
803
|
+
* Tab.
|
|
804
|
+
*/
|
|
805
|
+
tab?: string;
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Each corner its own, in points or a token of the theme's radii.
|
|
809
|
+
*/
|
|
810
|
+
export type MessageCorners = {
|
|
811
|
+
/**
|
|
812
|
+
* Bottom leading.
|
|
813
|
+
*/
|
|
814
|
+
bottom_leading?: MessagePoints | MessageToken;
|
|
815
|
+
/**
|
|
816
|
+
* Bottom trailing.
|
|
817
|
+
*/
|
|
818
|
+
bottom_trailing?: MessagePoints | MessageToken;
|
|
819
|
+
/**
|
|
820
|
+
* Top leading.
|
|
821
|
+
*/
|
|
822
|
+
top_leading?: MessagePoints | MessageToken;
|
|
823
|
+
/**
|
|
824
|
+
* Top trailing.
|
|
825
|
+
*/
|
|
826
|
+
top_trailing?: MessagePoints | MessageToken;
|
|
827
|
+
};
|
|
828
|
+
/**
|
|
829
|
+
* A countdown to an instant, or for a time from the moment the message opened: one content while it counts — its texts name {{countdown}}, {{days}}, {{hours}}, {{minutes}}, {{seconds}} —, another once it ended.
|
|
830
|
+
*/
|
|
831
|
+
export type MessageCountdown = {
|
|
832
|
+
animation?: MessageAnimation;
|
|
833
|
+
counting: MessageComponent;
|
|
834
|
+
ended?: MessageComponent;
|
|
835
|
+
/**
|
|
836
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
837
|
+
*/
|
|
838
|
+
id?: string;
|
|
839
|
+
states?: MessageStates;
|
|
840
|
+
style?: MessageStyle;
|
|
841
|
+
target: MessageTarget;
|
|
842
|
+
/**
|
|
843
|
+
* The component.
|
|
844
|
+
*/
|
|
845
|
+
type: "countdown";
|
|
846
|
+
visible?: MessageCondition;
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* A decorative HTML block from an archive the project uploaded (an animation, a Lottie or Rive scene): drawn in a sandbox of an origin of its own: it reaches neither the page around it, nor the app, nor the purchase, and loads only what came in its archive (a content security policy) — it may still navigate its own frame away and open a WebRTC connection (a content security policy does not cover WebRTC). It is told the selected package, the language and the appearance, and is hidden from screen readers. It cannot buy anything.
|
|
850
|
+
*/
|
|
851
|
+
export type MessageCustomHtml = {
|
|
852
|
+
animation?: MessageAnimation;
|
|
853
|
+
/**
|
|
854
|
+
* Height.
|
|
855
|
+
*/
|
|
856
|
+
height: MessageSizeKeyword | MessageLength;
|
|
857
|
+
/**
|
|
858
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
859
|
+
*/
|
|
860
|
+
id?: string;
|
|
861
|
+
/**
|
|
862
|
+
* Src.
|
|
863
|
+
*/
|
|
864
|
+
src: string;
|
|
865
|
+
states?: MessageStates;
|
|
866
|
+
style?: MessageStyle;
|
|
867
|
+
/**
|
|
868
|
+
* The component.
|
|
869
|
+
*/
|
|
870
|
+
type: "custom_html";
|
|
871
|
+
visible?: MessageCondition;
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* A message shown in the app, or a card of its inbox: a design system (the theme's colors, type scale, radii and spacing) and a free layout of components that name it, drawn by the same renderer as a paywall, and how it is shown (presentation). Its texts name the values its sender gives. Its assets (asset:<id>) are the project's, downloaded before it is shown. The server refuses what it does not know and holds a definition to a paywall's bounds: 128 KiB of JSON, 400 components, 16 deep, 500 characters a text, 40 languages.
|
|
875
|
+
*/
|
|
876
|
+
export type MessageDefinition = {
|
|
877
|
+
/**
|
|
878
|
+
* The language a text falls back to: a tag such as en or pt-BR.
|
|
879
|
+
*/
|
|
880
|
+
default_locale: string;
|
|
881
|
+
footer?: MessageComponent;
|
|
882
|
+
header?: MessageComponent;
|
|
883
|
+
locales?: MessageLocales;
|
|
884
|
+
/**
|
|
885
|
+
* The message's name, for the people who edit it (1 to 100 characters).
|
|
886
|
+
*/
|
|
887
|
+
name: string;
|
|
888
|
+
presentation: MessagePresentation;
|
|
889
|
+
root: MessageComponent;
|
|
890
|
+
/**
|
|
891
|
+
* The schema the definition is written in: 2. An app says the newest schema it draws (X-Palbase-Screen-Schema) and is given only messages written in one it draws.
|
|
892
|
+
*/
|
|
893
|
+
schema: number;
|
|
894
|
+
sheets?: MessageSheets;
|
|
895
|
+
theme: MessageTheme;
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* A thin line across its stack.
|
|
899
|
+
*/
|
|
900
|
+
export type MessageDivider = {
|
|
901
|
+
animation?: MessageAnimation;
|
|
902
|
+
/**
|
|
903
|
+
* Color.
|
|
904
|
+
*/
|
|
905
|
+
color?: string;
|
|
906
|
+
/**
|
|
907
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
908
|
+
*/
|
|
909
|
+
id?: string;
|
|
910
|
+
states?: MessageStates;
|
|
911
|
+
style?: MessageStyle;
|
|
912
|
+
/**
|
|
913
|
+
* Thickness.
|
|
914
|
+
*/
|
|
915
|
+
thickness?: number;
|
|
916
|
+
/**
|
|
917
|
+
* The component.
|
|
918
|
+
*/
|
|
919
|
+
type: "divider";
|
|
920
|
+
visible?: MessageCondition;
|
|
921
|
+
};
|
|
922
|
+
/**
|
|
923
|
+
* Each edge its own, in points or a token of the theme's spacing.
|
|
924
|
+
*/
|
|
925
|
+
export type MessageEdges = {
|
|
926
|
+
/**
|
|
927
|
+
* Bottom.
|
|
928
|
+
*/
|
|
929
|
+
bottom?: MessagePoints | MessageToken;
|
|
930
|
+
/**
|
|
931
|
+
* Leading.
|
|
932
|
+
*/
|
|
933
|
+
leading?: MessagePoints | MessageToken;
|
|
934
|
+
/**
|
|
935
|
+
* Top.
|
|
936
|
+
*/
|
|
937
|
+
top?: MessagePoints | MessageToken;
|
|
938
|
+
/**
|
|
939
|
+
* Trailing.
|
|
940
|
+
*/
|
|
941
|
+
trailing?: MessagePoints | MessageToken;
|
|
942
|
+
};
|
|
943
|
+
/**
|
|
944
|
+
* A feature.
|
|
945
|
+
*/
|
|
946
|
+
export type MessageFeature = {
|
|
947
|
+
icon: MessageIconName;
|
|
948
|
+
text: MessageString;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* What the purchase gives, each with an icon.
|
|
952
|
+
*/
|
|
953
|
+
export type MessageFeatures = {
|
|
954
|
+
animation?: MessageAnimation;
|
|
955
|
+
/**
|
|
956
|
+
* Color.
|
|
957
|
+
*/
|
|
958
|
+
color?: string;
|
|
959
|
+
/**
|
|
960
|
+
* Icon color.
|
|
961
|
+
*/
|
|
962
|
+
icon_color?: string;
|
|
963
|
+
/**
|
|
964
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
965
|
+
*/
|
|
966
|
+
id?: string;
|
|
967
|
+
/**
|
|
968
|
+
* Items.
|
|
969
|
+
*/
|
|
970
|
+
items: MessageFeature[];
|
|
971
|
+
/**
|
|
972
|
+
* Spacing.
|
|
973
|
+
*/
|
|
974
|
+
spacing?: number;
|
|
975
|
+
states?: MessageStates;
|
|
976
|
+
style?: MessageStyle;
|
|
977
|
+
/**
|
|
978
|
+
* The component.
|
|
979
|
+
*/
|
|
980
|
+
type: "features";
|
|
981
|
+
visible?: MessageCondition;
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
* A size in points, scaled with the platform's body style.
|
|
985
|
+
*/
|
|
986
|
+
export type MessageFontSize = number;
|
|
987
|
+
/**
|
|
988
|
+
* An icon every renderer draws.
|
|
989
|
+
*/
|
|
990
|
+
export type MessageIcon = {
|
|
991
|
+
animation?: MessageAnimation;
|
|
992
|
+
/**
|
|
993
|
+
* Color.
|
|
994
|
+
*/
|
|
995
|
+
color?: string;
|
|
996
|
+
/**
|
|
997
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
998
|
+
*/
|
|
999
|
+
id?: string;
|
|
1000
|
+
name: MessageIconName;
|
|
1001
|
+
/**
|
|
1002
|
+
* Size.
|
|
1003
|
+
*/
|
|
1004
|
+
size?: number;
|
|
1005
|
+
states?: MessageStates;
|
|
1006
|
+
style?: MessageStyle;
|
|
1007
|
+
/**
|
|
1008
|
+
* The component.
|
|
1009
|
+
*/
|
|
1010
|
+
type: "icon";
|
|
1011
|
+
visible?: MessageCondition;
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* An icon every renderer draws (SF Symbols on iOS).
|
|
1015
|
+
*/
|
|
1016
|
+
export type MessageIconName = "ad_free" | "arrow_right" | "bell" | "bolt" | "book" | "calendar" | "chart" | "chat" | "check" | "check_circle" | "clock" | "close" | "cloud" | "crown" | "download" | "gift" | "globe" | "heart" | "infinity" | "lock" | "lock_open" | "music" | "people" | "person" | "photo" | "play" | "quote" | "shield" | "sparkles" | "star" | "trophy" | "video";
|
|
1017
|
+
/**
|
|
1018
|
+
* An image the app downloads before it shows the message: an https address, or an image the project uploaded.
|
|
1019
|
+
*/
|
|
1020
|
+
export type MessageImage = {
|
|
1021
|
+
alt?: MessageString;
|
|
1022
|
+
animation?: MessageAnimation;
|
|
1023
|
+
/**
|
|
1024
|
+
* Aspect.
|
|
1025
|
+
*/
|
|
1026
|
+
aspect?: number;
|
|
1027
|
+
/**
|
|
1028
|
+
* Decorative.
|
|
1029
|
+
*/
|
|
1030
|
+
decorative?: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* Fit.
|
|
1033
|
+
*/
|
|
1034
|
+
fit?: "fit" | "fill";
|
|
1035
|
+
/**
|
|
1036
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1037
|
+
*/
|
|
1038
|
+
id?: string;
|
|
1039
|
+
mask?: MessageMask;
|
|
1040
|
+
/**
|
|
1041
|
+
* Overlay.
|
|
1042
|
+
*/
|
|
1043
|
+
overlay?: MessageLinear | MessageRadial;
|
|
1044
|
+
/**
|
|
1045
|
+
* Src.
|
|
1046
|
+
*/
|
|
1047
|
+
src: string;
|
|
1048
|
+
states?: MessageStates;
|
|
1049
|
+
style?: MessageStyle;
|
|
1050
|
+
/**
|
|
1051
|
+
* The component.
|
|
1052
|
+
*/
|
|
1053
|
+
type: "image";
|
|
1054
|
+
visible?: MessageCondition;
|
|
1055
|
+
};
|
|
1056
|
+
/**
|
|
1057
|
+
* An image behind the component.
|
|
1058
|
+
*/
|
|
1059
|
+
export type MessageImageFill = {
|
|
1060
|
+
/**
|
|
1061
|
+
* Fit.
|
|
1062
|
+
*/
|
|
1063
|
+
fit?: "fit" | "fill";
|
|
1064
|
+
/**
|
|
1065
|
+
* Src.
|
|
1066
|
+
*/
|
|
1067
|
+
src: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* Type.
|
|
1070
|
+
*/
|
|
1071
|
+
type: "image";
|
|
1072
|
+
};
|
|
1073
|
+
/**
|
|
1074
|
+
* A carousel's page indicator.
|
|
1075
|
+
*/
|
|
1076
|
+
export type MessageIndicator = {
|
|
1077
|
+
/**
|
|
1078
|
+
* Active color.
|
|
1079
|
+
*/
|
|
1080
|
+
active_color?: string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Color.
|
|
1083
|
+
*/
|
|
1084
|
+
color?: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Size.
|
|
1087
|
+
*/
|
|
1088
|
+
size?: number;
|
|
1089
|
+
/**
|
|
1090
|
+
* Spacing.
|
|
1091
|
+
*/
|
|
1092
|
+
spacing?: number;
|
|
1093
|
+
/**
|
|
1094
|
+
* Its style.
|
|
1095
|
+
*/
|
|
1096
|
+
style?: "dots" | "bars" | "none";
|
|
1097
|
+
};
|
|
1098
|
+
/**
|
|
1099
|
+
* A length in points.
|
|
1100
|
+
*/
|
|
1101
|
+
export type MessageLength = number;
|
|
1102
|
+
/**
|
|
1103
|
+
* A linear gradient: its angle (0 up, clockwise, 180 down) and 2 to 8 stops.
|
|
1104
|
+
*/
|
|
1105
|
+
export type MessageLinear = {
|
|
1106
|
+
/**
|
|
1107
|
+
* Angle.
|
|
1108
|
+
*/
|
|
1109
|
+
angle?: number;
|
|
1110
|
+
/**
|
|
1111
|
+
* Stops.
|
|
1112
|
+
*/
|
|
1113
|
+
stops: MessageStop[];
|
|
1114
|
+
/**
|
|
1115
|
+
* Type.
|
|
1116
|
+
*/
|
|
1117
|
+
type: "linear";
|
|
1118
|
+
};
|
|
1119
|
+
/**
|
|
1120
|
+
* The text itself, in every language.
|
|
1121
|
+
*/
|
|
1122
|
+
export type MessageLiteral = string;
|
|
1123
|
+
/**
|
|
1124
|
+
* The texts in each language (at most 40), by language tag: a component's `{"t": key}` is the app's language's, or the default locale's when it lacks the key.
|
|
1125
|
+
*/
|
|
1126
|
+
export type MessageLocales = {
|
|
1127
|
+
[key: string]: MessageTexts;
|
|
1128
|
+
};
|
|
1129
|
+
/**
|
|
1130
|
+
* The image's shape: a rectangle with corners, a circle, or a rectangle whose bottom edge curves in (concave) or out (convex).
|
|
1131
|
+
*/
|
|
1132
|
+
export type MessageMask = {
|
|
1133
|
+
/**
|
|
1134
|
+
* Depth.
|
|
1135
|
+
*/
|
|
1136
|
+
depth?: number;
|
|
1137
|
+
/**
|
|
1138
|
+
* Radius.
|
|
1139
|
+
*/
|
|
1140
|
+
radius?: MessagePoints | MessageToken;
|
|
1141
|
+
/**
|
|
1142
|
+
* Shape.
|
|
1143
|
+
*/
|
|
1144
|
+
shape: "rect" | "circle" | "concave" | "convex";
|
|
1145
|
+
};
|
|
1146
|
+
/**
|
|
1147
|
+
* Colors by token (lowercase letters, digits and _, at most 32), each #RRGGBB or #RRGGBBAA.
|
|
1148
|
+
*/
|
|
1149
|
+
export type MessagePalette = {
|
|
1150
|
+
[key: string]: string;
|
|
1151
|
+
};
|
|
1152
|
+
/**
|
|
1153
|
+
* Points.
|
|
1154
|
+
*/
|
|
1155
|
+
export type MessagePoints = number;
|
|
1156
|
+
/**
|
|
1157
|
+
* How the message is shown: over the app (modal), the whole screen (fullscreen), a strip at an edge that goes by itself if it says so (banner), or a card of the inbox. A banner and a card are one part: no header, footer or sheets.
|
|
1158
|
+
*/
|
|
1159
|
+
export type MessagePresentation = {
|
|
1160
|
+
/**
|
|
1161
|
+
* A banner's time on screen.
|
|
1162
|
+
*/
|
|
1163
|
+
auto_dismiss_seconds?: number;
|
|
1164
|
+
/**
|
|
1165
|
+
* What covers the app behind a modal.
|
|
1166
|
+
*/
|
|
1167
|
+
backdrop?: string;
|
|
1168
|
+
/**
|
|
1169
|
+
* Whether a tap outside (a modal) or a swipe (a banner) closes it.
|
|
1170
|
+
*/
|
|
1171
|
+
dismissible?: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* A banner's edge.
|
|
1174
|
+
*/
|
|
1175
|
+
position?: "top" | "bottom";
|
|
1176
|
+
/**
|
|
1177
|
+
* Type.
|
|
1178
|
+
*/
|
|
1179
|
+
type: "modal" | "fullscreen" | "banner" | "card";
|
|
1180
|
+
};
|
|
1181
|
+
/**
|
|
1182
|
+
* A radial gradient: its center and radius as shares of the component, and 2 to 8 stops.
|
|
1183
|
+
*/
|
|
1184
|
+
export type MessageRadial = {
|
|
1185
|
+
/**
|
|
1186
|
+
* Center x.
|
|
1187
|
+
*/
|
|
1188
|
+
center_x?: number;
|
|
1189
|
+
/**
|
|
1190
|
+
* Center y.
|
|
1191
|
+
*/
|
|
1192
|
+
center_y?: number;
|
|
1193
|
+
/**
|
|
1194
|
+
* Radius.
|
|
1195
|
+
*/
|
|
1196
|
+
radius?: number;
|
|
1197
|
+
/**
|
|
1198
|
+
* Stops.
|
|
1199
|
+
*/
|
|
1200
|
+
stops: MessageStop[];
|
|
1201
|
+
/**
|
|
1202
|
+
* Type.
|
|
1203
|
+
*/
|
|
1204
|
+
type: "radial";
|
|
1205
|
+
};
|
|
1206
|
+
/**
|
|
1207
|
+
* Points by token (lowercase letters, digits and _, at most 32).
|
|
1208
|
+
*/
|
|
1209
|
+
export type MessageScale = {
|
|
1210
|
+
[key: string]: number;
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* A shadow.
|
|
1214
|
+
*/
|
|
1215
|
+
export type MessageShadow = {
|
|
1216
|
+
/**
|
|
1217
|
+
* Color.
|
|
1218
|
+
*/
|
|
1219
|
+
color: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* Radius.
|
|
1222
|
+
*/
|
|
1223
|
+
radius?: number;
|
|
1224
|
+
/**
|
|
1225
|
+
* X.
|
|
1226
|
+
*/
|
|
1227
|
+
x?: number;
|
|
1228
|
+
/**
|
|
1229
|
+
* Y.
|
|
1230
|
+
*/
|
|
1231
|
+
y?: number;
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* A second page a button opens over the message.
|
|
1235
|
+
*/
|
|
1236
|
+
export type MessageSheet = {
|
|
1237
|
+
root: MessageComponent;
|
|
1238
|
+
title?: MessageString;
|
|
1239
|
+
};
|
|
1240
|
+
/**
|
|
1241
|
+
* The sheets by id (lowercase letters, digits, _ and -, starting with a letter).
|
|
1242
|
+
*/
|
|
1243
|
+
export type MessageSheets = {
|
|
1244
|
+
[key: string]: MessageSheet;
|
|
1245
|
+
};
|
|
1246
|
+
/**
|
|
1247
|
+
* fit: the content's size; fill: all the parent gives; a share of the parent ("50%").
|
|
1248
|
+
*/
|
|
1249
|
+
export type MessageSizeKeyword = string;
|
|
1250
|
+
/**
|
|
1251
|
+
* Space: a fixed size, or all that is left along its stack when absent.
|
|
1252
|
+
*/
|
|
1253
|
+
export type MessageSpacer = {
|
|
1254
|
+
animation?: MessageAnimation;
|
|
1255
|
+
/**
|
|
1256
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1257
|
+
*/
|
|
1258
|
+
id?: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* Size.
|
|
1261
|
+
*/
|
|
1262
|
+
size?: MessagePoints | MessageToken;
|
|
1263
|
+
states?: MessageStates;
|
|
1264
|
+
style?: MessageStyle;
|
|
1265
|
+
/**
|
|
1266
|
+
* The component.
|
|
1267
|
+
*/
|
|
1268
|
+
type: "spacer";
|
|
1269
|
+
visible?: MessageCondition;
|
|
1270
|
+
};
|
|
1271
|
+
/**
|
|
1272
|
+
* A part of a text: bold, italic, underlined, struck through, colored, a link.
|
|
1273
|
+
*/
|
|
1274
|
+
export type MessageSpan = {
|
|
1275
|
+
/**
|
|
1276
|
+
* Bold.
|
|
1277
|
+
*/
|
|
1278
|
+
bold?: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* Color.
|
|
1281
|
+
*/
|
|
1282
|
+
color?: string;
|
|
1283
|
+
/**
|
|
1284
|
+
* Italic.
|
|
1285
|
+
*/
|
|
1286
|
+
italic?: boolean;
|
|
1287
|
+
/**
|
|
1288
|
+
* Link.
|
|
1289
|
+
*/
|
|
1290
|
+
link?: string;
|
|
1291
|
+
/**
|
|
1292
|
+
* Strikethrough.
|
|
1293
|
+
*/
|
|
1294
|
+
strikethrough?: boolean;
|
|
1295
|
+
text: MessageString;
|
|
1296
|
+
/**
|
|
1297
|
+
* Underline.
|
|
1298
|
+
*/
|
|
1299
|
+
underline?: boolean;
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* Components laid out one after another — down, across — or over each other (z). The root, the header and the footer are each one; the root scrolls between the fixed header and footer.
|
|
1303
|
+
*/
|
|
1304
|
+
export type MessageStack = {
|
|
1305
|
+
/**
|
|
1306
|
+
* Align.
|
|
1307
|
+
*/
|
|
1308
|
+
align?: "start" | "center" | "end" | "stretch";
|
|
1309
|
+
animation?: MessageAnimation;
|
|
1310
|
+
/**
|
|
1311
|
+
* Axis.
|
|
1312
|
+
*/
|
|
1313
|
+
axis?: "vertical" | "horizontal" | "z";
|
|
1314
|
+
/**
|
|
1315
|
+
* The components.
|
|
1316
|
+
*/
|
|
1317
|
+
children?: MessageComponent[];
|
|
1318
|
+
/**
|
|
1319
|
+
* Distribution.
|
|
1320
|
+
*/
|
|
1321
|
+
distribution?: "start" | "center" | "end" | "space_between" | "space_around" | "space_evenly";
|
|
1322
|
+
/**
|
|
1323
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1324
|
+
*/
|
|
1325
|
+
id?: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* Scroll.
|
|
1328
|
+
*/
|
|
1329
|
+
scroll?: boolean;
|
|
1330
|
+
/**
|
|
1331
|
+
* Spacing.
|
|
1332
|
+
*/
|
|
1333
|
+
spacing?: MessagePoints | MessageToken;
|
|
1334
|
+
states?: MessageStates;
|
|
1335
|
+
style?: MessageStyle;
|
|
1336
|
+
/**
|
|
1337
|
+
* The component.
|
|
1338
|
+
*/
|
|
1339
|
+
type: "stack";
|
|
1340
|
+
visible?: MessageCondition;
|
|
1341
|
+
};
|
|
1342
|
+
/**
|
|
1343
|
+
* The component's style while what it is in is selected: the tab whose label it is.
|
|
1344
|
+
*/
|
|
1345
|
+
export type MessageStates = {
|
|
1346
|
+
selected?: MessageStyle;
|
|
1347
|
+
};
|
|
1348
|
+
/**
|
|
1349
|
+
* A gradient's color at a point along it (0 to 1).
|
|
1350
|
+
*/
|
|
1351
|
+
export type MessageStop = {
|
|
1352
|
+
/**
|
|
1353
|
+
* At.
|
|
1354
|
+
*/
|
|
1355
|
+
at: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* Color.
|
|
1358
|
+
*/
|
|
1359
|
+
color: string;
|
|
1360
|
+
};
|
|
1361
|
+
/**
|
|
1362
|
+
* A text: the string itself, or {"t": key} of the language table. Either may hold variables (`{{first_name}}`, `{{order}}` …: lowercase letters, digits and _, at most 32) the message's sender gives; a text that names a variable it gave no value for is not drawn.
|
|
1363
|
+
*/
|
|
1364
|
+
export type MessageString = MessageLiteral | MessageTextKey;
|
|
1365
|
+
/**
|
|
1366
|
+
* What every component takes: padding and margin by edge, a size, a fill, a border, corners each their own, a shadow, an opacity. Points and colors name the theme's tokens or are given as they are.
|
|
1367
|
+
*/
|
|
1368
|
+
export type MessageStyle = {
|
|
1369
|
+
/**
|
|
1370
|
+
* Background.
|
|
1371
|
+
*/
|
|
1372
|
+
background?: MessageColorValue | MessageLinear | MessageRadial | MessageImageFill | MessageVideoFill;
|
|
1373
|
+
border?: MessageBorder;
|
|
1374
|
+
/**
|
|
1375
|
+
* Corners.
|
|
1376
|
+
*/
|
|
1377
|
+
corners?: MessagePoints | MessageToken | MessageCorners;
|
|
1378
|
+
/**
|
|
1379
|
+
* Height.
|
|
1380
|
+
*/
|
|
1381
|
+
height?: MessageSizeKeyword | MessageLength;
|
|
1382
|
+
/**
|
|
1383
|
+
* Margin.
|
|
1384
|
+
*/
|
|
1385
|
+
margin?: MessagePoints | MessageToken | MessageEdges;
|
|
1386
|
+
/**
|
|
1387
|
+
* Max width.
|
|
1388
|
+
*/
|
|
1389
|
+
max_width?: number;
|
|
1390
|
+
/**
|
|
1391
|
+
* Opacity.
|
|
1392
|
+
*/
|
|
1393
|
+
opacity?: number;
|
|
1394
|
+
/**
|
|
1395
|
+
* Padding.
|
|
1396
|
+
*/
|
|
1397
|
+
padding?: MessagePoints | MessageToken | MessageEdges;
|
|
1398
|
+
shadow?: MessageShadow;
|
|
1399
|
+
/**
|
|
1400
|
+
* Width.
|
|
1401
|
+
*/
|
|
1402
|
+
width?: MessageSizeKeyword | MessageLength;
|
|
1403
|
+
};
|
|
1404
|
+
/**
|
|
1405
|
+
* A switch between two contents, each shown on its side.
|
|
1406
|
+
*/
|
|
1407
|
+
export type MessageSwitch = {
|
|
1408
|
+
animation?: MessageAnimation;
|
|
1409
|
+
/**
|
|
1410
|
+
* Default.
|
|
1411
|
+
*/
|
|
1412
|
+
default?: boolean;
|
|
1413
|
+
/**
|
|
1414
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1415
|
+
*/
|
|
1416
|
+
id?: string;
|
|
1417
|
+
label?: MessageString;
|
|
1418
|
+
off: MessageComponent;
|
|
1419
|
+
on: MessageComponent;
|
|
1420
|
+
states?: MessageStates;
|
|
1421
|
+
style?: MessageStyle;
|
|
1422
|
+
/**
|
|
1423
|
+
* Tint.
|
|
1424
|
+
*/
|
|
1425
|
+
tint?: string;
|
|
1426
|
+
/**
|
|
1427
|
+
* The component.
|
|
1428
|
+
*/
|
|
1429
|
+
type: "switch";
|
|
1430
|
+
visible?: MessageCondition;
|
|
1431
|
+
};
|
|
1432
|
+
/**
|
|
1433
|
+
* A tab: its label and its content.
|
|
1434
|
+
*/
|
|
1435
|
+
export type MessageTab = {
|
|
1436
|
+
content: MessageComponent;
|
|
1437
|
+
/**
|
|
1438
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1439
|
+
*/
|
|
1440
|
+
id: string;
|
|
1441
|
+
label: MessageComponent;
|
|
1442
|
+
};
|
|
1443
|
+
/**
|
|
1444
|
+
* Tabs, each its own content; the labels, in a bar, are components whose selected state is the shown tab's.
|
|
1445
|
+
*/
|
|
1446
|
+
export type MessageTabs = {
|
|
1447
|
+
animation?: MessageAnimation;
|
|
1448
|
+
bar?: MessageStyle;
|
|
1449
|
+
/**
|
|
1450
|
+
* Default.
|
|
1451
|
+
*/
|
|
1452
|
+
default?: string;
|
|
1453
|
+
/**
|
|
1454
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1455
|
+
*/
|
|
1456
|
+
id?: string;
|
|
1457
|
+
states?: MessageStates;
|
|
1458
|
+
style?: MessageStyle;
|
|
1459
|
+
/**
|
|
1460
|
+
* Tabs.
|
|
1461
|
+
*/
|
|
1462
|
+
tabs: MessageTab[];
|
|
1463
|
+
/**
|
|
1464
|
+
* The component.
|
|
1465
|
+
*/
|
|
1466
|
+
type: "tabs";
|
|
1467
|
+
visible?: MessageCondition;
|
|
1468
|
+
};
|
|
1469
|
+
/**
|
|
1470
|
+
* What a countdown counts to: an instant (at), or a time from the moment the message opened (after_open_seconds) — one of them.
|
|
1471
|
+
*/
|
|
1472
|
+
export type MessageTarget = {
|
|
1473
|
+
/**
|
|
1474
|
+
* After open seconds.
|
|
1475
|
+
*/
|
|
1476
|
+
after_open_seconds?: number;
|
|
1477
|
+
/**
|
|
1478
|
+
* At.
|
|
1479
|
+
*/
|
|
1480
|
+
at?: string;
|
|
1481
|
+
};
|
|
1482
|
+
/**
|
|
1483
|
+
* A text: one string, or spans — bold, italic, colored parts and links —, in a type style of the theme or its own.
|
|
1484
|
+
*/
|
|
1485
|
+
export type MessageText = {
|
|
1486
|
+
/**
|
|
1487
|
+
* Align.
|
|
1488
|
+
*/
|
|
1489
|
+
align?: "start" | "center" | "end";
|
|
1490
|
+
animation?: MessageAnimation;
|
|
1491
|
+
/**
|
|
1492
|
+
* Color.
|
|
1493
|
+
*/
|
|
1494
|
+
color?: MessageColorValue | MessageLinear | MessageRadial;
|
|
1495
|
+
/**
|
|
1496
|
+
* Font.
|
|
1497
|
+
*/
|
|
1498
|
+
font?: string;
|
|
1499
|
+
/**
|
|
1500
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1501
|
+
*/
|
|
1502
|
+
id?: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Letter spacing.
|
|
1505
|
+
*/
|
|
1506
|
+
letter_spacing?: number;
|
|
1507
|
+
/**
|
|
1508
|
+
* Line height.
|
|
1509
|
+
*/
|
|
1510
|
+
line_height?: number;
|
|
1511
|
+
/**
|
|
1512
|
+
* Max lines.
|
|
1513
|
+
*/
|
|
1514
|
+
max_lines?: number;
|
|
1515
|
+
/**
|
|
1516
|
+
* Size.
|
|
1517
|
+
*/
|
|
1518
|
+
size?: MessageFontSize | MessageToken;
|
|
1519
|
+
/**
|
|
1520
|
+
* Spans.
|
|
1521
|
+
*/
|
|
1522
|
+
spans?: MessageSpan[];
|
|
1523
|
+
states?: MessageStates;
|
|
1524
|
+
style?: MessageStyle;
|
|
1525
|
+
text?: MessageString;
|
|
1526
|
+
/**
|
|
1527
|
+
* The component.
|
|
1528
|
+
*/
|
|
1529
|
+
type: "text";
|
|
1530
|
+
/**
|
|
1531
|
+
* Uppercase.
|
|
1532
|
+
*/
|
|
1533
|
+
uppercase?: boolean;
|
|
1534
|
+
visible?: MessageCondition;
|
|
1535
|
+
/**
|
|
1536
|
+
* Weight.
|
|
1537
|
+
*/
|
|
1538
|
+
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
1539
|
+
};
|
|
1540
|
+
/**
|
|
1541
|
+
* A text of the language table.
|
|
1542
|
+
*/
|
|
1543
|
+
export type MessageTextKey = {
|
|
1544
|
+
/**
|
|
1545
|
+
* The text's key.
|
|
1546
|
+
*/
|
|
1547
|
+
t: string;
|
|
1548
|
+
};
|
|
1549
|
+
/**
|
|
1550
|
+
* One language's texts, by key (lowercase letters, digits, `_` `.` `-`, at most 64): each at most 500 characters, with variables.
|
|
1551
|
+
*/
|
|
1552
|
+
export type MessageTexts = {
|
|
1553
|
+
[key: string]: string;
|
|
1554
|
+
};
|
|
1555
|
+
/**
|
|
1556
|
+
* The message's design system: colors for light and dark, a type scale, radii and spacing; the components name them.
|
|
1557
|
+
*/
|
|
1558
|
+
export type MessageTheme = {
|
|
1559
|
+
colors: MessageColors;
|
|
1560
|
+
radii?: MessageScale;
|
|
1561
|
+
spacing?: MessageScale;
|
|
1562
|
+
typography?: MessageTypeScale;
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* Steps in time — a trial's today, its reminder, its first charge —, each with an icon, joined by a line.
|
|
1566
|
+
*/
|
|
1567
|
+
export type MessageTimeline = {
|
|
1568
|
+
animation?: MessageAnimation;
|
|
1569
|
+
/**
|
|
1570
|
+
* Color.
|
|
1571
|
+
*/
|
|
1572
|
+
color?: string;
|
|
1573
|
+
/**
|
|
1574
|
+
* Icon color.
|
|
1575
|
+
*/
|
|
1576
|
+
icon_color?: string;
|
|
1577
|
+
/**
|
|
1578
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
1579
|
+
*/
|
|
1580
|
+
id?: string;
|
|
1581
|
+
/**
|
|
1582
|
+
* Items.
|
|
1583
|
+
*/
|
|
1584
|
+
items: MessageTimelineItem[];
|
|
1585
|
+
/**
|
|
1586
|
+
* Line color.
|
|
1587
|
+
*/
|
|
1588
|
+
line_color?: string;
|
|
1589
|
+
/**
|
|
1590
|
+
* Line width.
|
|
1591
|
+
*/
|
|
1592
|
+
line_width?: number;
|
|
1593
|
+
/**
|
|
1594
|
+
* Spacing.
|
|
1595
|
+
*/
|
|
1596
|
+
spacing?: number;
|
|
1597
|
+
states?: MessageStates;
|
|
1598
|
+
style?: MessageStyle;
|
|
147
1599
|
/**
|
|
148
|
-
* The
|
|
1600
|
+
* The component.
|
|
149
1601
|
*/
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
[key: string]: unknown;
|
|
153
|
-
};
|
|
1602
|
+
type: "timeline";
|
|
1603
|
+
visible?: MessageCondition;
|
|
154
1604
|
};
|
|
155
1605
|
/**
|
|
156
|
-
* A
|
|
1606
|
+
* A step of a timeline.
|
|
157
1607
|
*/
|
|
158
|
-
export type
|
|
159
|
-
customized: boolean;
|
|
160
|
-
html_body: string;
|
|
161
|
-
locale: string;
|
|
162
|
-
slug: string;
|
|
163
|
-
subject: string;
|
|
164
|
-
text_body: string;
|
|
1608
|
+
export type MessageTimelineItem = {
|
|
165
1609
|
/**
|
|
166
|
-
*
|
|
1610
|
+
* Color.
|
|
167
1611
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
1612
|
+
color?: string;
|
|
1613
|
+
icon: MessageIconName;
|
|
1614
|
+
text?: MessageString;
|
|
1615
|
+
title: MessageString;
|
|
170
1616
|
};
|
|
171
1617
|
/**
|
|
172
|
-
*
|
|
1618
|
+
* A token of the theme's scale.
|
|
173
1619
|
*/
|
|
174
|
-
export type
|
|
175
|
-
|
|
1620
|
+
export type MessageToken = string;
|
|
1621
|
+
/**
|
|
1622
|
+
* Type styles by token (lowercase letters, digits and _, at most 32).
|
|
1623
|
+
*/
|
|
1624
|
+
export type MessageTypeScale = {
|
|
1625
|
+
[key: string]: MessageTypography;
|
|
176
1626
|
};
|
|
177
1627
|
/**
|
|
178
|
-
*
|
|
1628
|
+
* A type style of the theme: what a text whose size names it is drawn in. It scales with its text style (Dynamic Type on iOS, the root font size on the web).
|
|
179
1629
|
*/
|
|
180
|
-
export type
|
|
1630
|
+
export type MessageTypography = {
|
|
181
1631
|
/**
|
|
182
|
-
*
|
|
1632
|
+
* Font.
|
|
183
1633
|
*/
|
|
184
|
-
|
|
185
|
-
locale: string;
|
|
186
|
-
slug: string;
|
|
187
|
-
subject: string;
|
|
1634
|
+
font?: string;
|
|
188
1635
|
/**
|
|
189
|
-
*
|
|
1636
|
+
* Letter spacing.
|
|
190
1637
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
1638
|
+
letter_spacing?: number;
|
|
1639
|
+
/**
|
|
1640
|
+
* Line height.
|
|
1641
|
+
*/
|
|
1642
|
+
line_height?: number;
|
|
1643
|
+
/**
|
|
1644
|
+
* Size.
|
|
1645
|
+
*/
|
|
1646
|
+
size: number;
|
|
1647
|
+
/**
|
|
1648
|
+
* Text style.
|
|
1649
|
+
*/
|
|
1650
|
+
text_style?: "large_title" | "title" | "title2" | "title3" | "headline" | "body" | "callout" | "subheadline" | "footnote" | "caption";
|
|
1651
|
+
/**
|
|
1652
|
+
* Weight.
|
|
1653
|
+
*/
|
|
1654
|
+
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
193
1655
|
};
|
|
194
1656
|
/**
|
|
195
|
-
* A
|
|
1657
|
+
* A video the app downloads before it shows the message; muted and looping unless it says otherwise.
|
|
196
1658
|
*/
|
|
197
|
-
export type
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
text_body?: string;
|
|
201
|
-
};
|
|
202
|
-
export type ErrorResponse = {
|
|
1659
|
+
export type MessageVideo = {
|
|
1660
|
+
alt?: MessageString;
|
|
1661
|
+
animation?: MessageAnimation;
|
|
203
1662
|
/**
|
|
204
|
-
*
|
|
1663
|
+
* Aspect.
|
|
205
1664
|
*/
|
|
206
|
-
|
|
1665
|
+
aspect?: number;
|
|
207
1666
|
/**
|
|
208
|
-
*
|
|
1667
|
+
* Autoplay.
|
|
209
1668
|
*/
|
|
210
|
-
|
|
1669
|
+
autoplay?: boolean;
|
|
211
1670
|
/**
|
|
212
|
-
*
|
|
1671
|
+
* Controls.
|
|
213
1672
|
*/
|
|
214
|
-
|
|
1673
|
+
controls?: boolean;
|
|
215
1674
|
/**
|
|
216
|
-
*
|
|
1675
|
+
* Fit.
|
|
217
1676
|
*/
|
|
218
|
-
|
|
1677
|
+
fit?: "fit" | "fill";
|
|
219
1678
|
/**
|
|
220
|
-
*
|
|
1679
|
+
* Names the component, unique in the message: an app's code can draw its own part in its place.
|
|
221
1680
|
*/
|
|
222
|
-
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* A WhatsApp message a user sent the project's number.
|
|
226
|
-
*/
|
|
227
|
-
export type Inbound = {
|
|
228
|
-
id: string;
|
|
1681
|
+
id?: string;
|
|
229
1682
|
/**
|
|
230
|
-
*
|
|
1683
|
+
* Loop.
|
|
231
1684
|
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
1685
|
+
loop?: boolean;
|
|
1686
|
+
/**
|
|
1687
|
+
* Mute.
|
|
1688
|
+
*/
|
|
1689
|
+
mute?: boolean;
|
|
1690
|
+
/**
|
|
1691
|
+
* Poster.
|
|
1692
|
+
*/
|
|
1693
|
+
poster?: string;
|
|
1694
|
+
/**
|
|
1695
|
+
* Src.
|
|
1696
|
+
*/
|
|
1697
|
+
src: string;
|
|
1698
|
+
states?: MessageStates;
|
|
1699
|
+
style?: MessageStyle;
|
|
1700
|
+
/**
|
|
1701
|
+
* The component.
|
|
1702
|
+
*/
|
|
1703
|
+
type: "video";
|
|
1704
|
+
visible?: MessageCondition;
|
|
244
1705
|
};
|
|
245
1706
|
/**
|
|
246
|
-
* A
|
|
1707
|
+
* A muted video behind the component.
|
|
247
1708
|
*/
|
|
248
|
-
export type
|
|
249
|
-
|
|
1709
|
+
export type MessageVideoFill = {
|
|
1710
|
+
/**
|
|
1711
|
+
* Loop.
|
|
1712
|
+
*/
|
|
1713
|
+
loop?: boolean;
|
|
1714
|
+
/**
|
|
1715
|
+
* Poster.
|
|
1716
|
+
*/
|
|
1717
|
+
poster?: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* Src.
|
|
1720
|
+
*/
|
|
1721
|
+
src: string;
|
|
1722
|
+
/**
|
|
1723
|
+
* Type.
|
|
1724
|
+
*/
|
|
1725
|
+
type: "video";
|
|
250
1726
|
};
|
|
251
|
-
/**
|
|
252
|
-
* A text, or one per locale: each device gets the one in its language (its locale, that language, default_locale, the project's default, English), filled with variables (Handlebars, as a template) and cut to what a banner shows (65 characters for a title, 240 for a body).
|
|
253
|
-
*/
|
|
254
|
-
export type LocalizedText = PlainText | LocaleTexts;
|
|
255
1727
|
/**
|
|
256
1728
|
* Meta's message object whole: its sender (from), its text or media.
|
|
257
1729
|
*/
|
|
@@ -305,6 +1777,96 @@ export type MetricsSummary = {
|
|
|
305
1777
|
[key: string]: MetricsStatusCounts;
|
|
306
1778
|
};
|
|
307
1779
|
};
|
|
1780
|
+
/**
|
|
1781
|
+
* A message's move: notification.<status>. A push's device stages name the device; every event names whom it was for, when its send named them.
|
|
1782
|
+
*/
|
|
1783
|
+
export type NotificationEvent = {
|
|
1784
|
+
/**
|
|
1785
|
+
* The button tapped (notification.action).
|
|
1786
|
+
*/
|
|
1787
|
+
action_id?: string;
|
|
1788
|
+
/**
|
|
1789
|
+
* When it got there.
|
|
1790
|
+
*/
|
|
1791
|
+
at?: string;
|
|
1792
|
+
/**
|
|
1793
|
+
* email, sms, whatsapp or push.
|
|
1794
|
+
*/
|
|
1795
|
+
channel: string;
|
|
1796
|
+
/**
|
|
1797
|
+
* The device (a push's stage).
|
|
1798
|
+
*/
|
|
1799
|
+
device_id?: string;
|
|
1800
|
+
/**
|
|
1801
|
+
* Why it failed.
|
|
1802
|
+
*/
|
|
1803
|
+
error?: string;
|
|
1804
|
+
/**
|
|
1805
|
+
* The installation it was for, or the device's.
|
|
1806
|
+
*/
|
|
1807
|
+
installation_id?: string;
|
|
1808
|
+
/**
|
|
1809
|
+
* The message.
|
|
1810
|
+
*/
|
|
1811
|
+
message_id: string;
|
|
1812
|
+
/**
|
|
1813
|
+
* The device's platform.
|
|
1814
|
+
*/
|
|
1815
|
+
platform?: string;
|
|
1816
|
+
/**
|
|
1817
|
+
* The provider that took it.
|
|
1818
|
+
*/
|
|
1819
|
+
provider?: string;
|
|
1820
|
+
/**
|
|
1821
|
+
* Whose sender: the platform's shared one, or the project's own.
|
|
1822
|
+
*/
|
|
1823
|
+
rail?: string;
|
|
1824
|
+
/**
|
|
1825
|
+
* Why a push could not be shown (notification.not_shown).
|
|
1826
|
+
*/
|
|
1827
|
+
reason?: string;
|
|
1828
|
+
/**
|
|
1829
|
+
* How many followers a topic push reached.
|
|
1830
|
+
*/
|
|
1831
|
+
recipients?: number;
|
|
1832
|
+
/**
|
|
1833
|
+
* The stage reached (on a provider's or a device's report).
|
|
1834
|
+
*/
|
|
1835
|
+
status?: string;
|
|
1836
|
+
/**
|
|
1837
|
+
* The template it was made from.
|
|
1838
|
+
*/
|
|
1839
|
+
template?: string | null;
|
|
1840
|
+
/**
|
|
1841
|
+
* The topic a follower push spread from.
|
|
1842
|
+
*/
|
|
1843
|
+
topic_id?: string;
|
|
1844
|
+
/**
|
|
1845
|
+
* The user it was for.
|
|
1846
|
+
*/
|
|
1847
|
+
user_id?: string;
|
|
1848
|
+
};
|
|
1849
|
+
/**
|
|
1850
|
+
* notification.received: a message came in on WhatsApp.
|
|
1851
|
+
*/
|
|
1852
|
+
export type NotificationReceivedEvent = {
|
|
1853
|
+
/**
|
|
1854
|
+
* whatsapp.
|
|
1855
|
+
*/
|
|
1856
|
+
channel: string;
|
|
1857
|
+
/**
|
|
1858
|
+
* The inbound message: read it with GET /notify/whatsapp/inbound.
|
|
1859
|
+
*/
|
|
1860
|
+
inbound_id: string;
|
|
1861
|
+
/**
|
|
1862
|
+
* What it is: text, image, …
|
|
1863
|
+
*/
|
|
1864
|
+
kind?: string;
|
|
1865
|
+
/**
|
|
1866
|
+
* The number it came to.
|
|
1867
|
+
*/
|
|
1868
|
+
phone_number_id?: string;
|
|
1869
|
+
};
|
|
308
1870
|
/**
|
|
309
1871
|
* A message's delivery report.
|
|
310
1872
|
*/
|
|
@@ -327,6 +1889,10 @@ export type NotifyMessage = {
|
|
|
327
1889
|
*/
|
|
328
1890
|
events?: DeliveryEvent[];
|
|
329
1891
|
id: string;
|
|
1892
|
+
/**
|
|
1893
|
+
* The installation the message is for, when its send named one.
|
|
1894
|
+
*/
|
|
1895
|
+
installation_id?: string;
|
|
330
1896
|
locale?: string;
|
|
331
1897
|
metadata?: Metadata;
|
|
332
1898
|
/**
|
|
@@ -350,8 +1916,16 @@ export type NotifyMessage = {
|
|
|
350
1916
|
* How many SMS segments a text took: what its provider bills.
|
|
351
1917
|
*/
|
|
352
1918
|
segments?: number;
|
|
1919
|
+
/**
|
|
1920
|
+
* When one waiting goes: scheduled for its time, or held until its recipient's quiet hours end.
|
|
1921
|
+
*/
|
|
1922
|
+
send_at?: string;
|
|
353
1923
|
sent_at?: string;
|
|
354
|
-
|
|
1924
|
+
skip_reason?: string;
|
|
1925
|
+
/**
|
|
1926
|
+
* queued, sending, sent and what its provider reported after (delivered, read, …), failed — or, before it goes: scheduled (for its time), held (through its recipient's quiet hours), skipped (skip_reason says why), canceled (taken back while it waited).
|
|
1927
|
+
*/
|
|
1928
|
+
status: "queued" | "sending" | "sent" | "failed" | "delivered" | "read" | "bounced" | "complained" | "undelivered" | "expired" | "rejected" | "scheduled" | "held" | "skipped" | "canceled";
|
|
355
1929
|
template?: string;
|
|
356
1930
|
/**
|
|
357
1931
|
* The user the message is for, when its send named one.
|
|
@@ -373,7 +1947,7 @@ export type NotifyMessagePage = {
|
|
|
373
1947
|
*/
|
|
374
1948
|
export type NotifyProvider = {
|
|
375
1949
|
active: boolean;
|
|
376
|
-
channel: "email" | "sms" | "verify" | "whatsapp" | "push";
|
|
1950
|
+
channel: "email" | "sms" | "verify" | "whatsapp" | "push" | "iys";
|
|
377
1951
|
created_at: string;
|
|
378
1952
|
/**
|
|
379
1953
|
* Lower is tried first.
|
|
@@ -406,6 +1980,10 @@ export type NotifyProviderWrite = {
|
|
|
406
1980
|
*/
|
|
407
1981
|
export type NotifySettings = {
|
|
408
1982
|
default_locale: string;
|
|
1983
|
+
/**
|
|
1984
|
+
* The clock of a recipient whose devices say none, an IANA time zone; UTC when unset.
|
|
1985
|
+
*/
|
|
1986
|
+
default_timezone?: string;
|
|
409
1987
|
/**
|
|
410
1988
|
* Who email through the project's own provider is from.
|
|
411
1989
|
*/
|
|
@@ -414,10 +1992,14 @@ export type NotifySettings = {
|
|
|
414
1992
|
* The sender's display name, through the project's own SMTP, SendGrid or SES provider. ACS shows the name its sender username is registered with on the domain.
|
|
415
1993
|
*/
|
|
416
1994
|
from_name: string | null;
|
|
1995
|
+
in_app?: InAppSettings;
|
|
1996
|
+
inbox?: InboxSettings;
|
|
1997
|
+
marketing_cap?: MarketingCap;
|
|
417
1998
|
/**
|
|
418
1999
|
* Refuse an email whose recipient's domain takes no mail (no MX record, a null one, or no address), before it is queued. Off unless set.
|
|
419
2000
|
*/
|
|
420
2001
|
mx_check?: boolean;
|
|
2002
|
+
quiet_hours?: QuietHours;
|
|
421
2003
|
/**
|
|
422
2004
|
* Where replies go.
|
|
423
2005
|
*/
|
|
@@ -464,21 +2046,102 @@ export type PushData = {
|
|
|
464
2046
|
[key: string]: string;
|
|
465
2047
|
};
|
|
466
2048
|
/**
|
|
467
|
-
* How a push went to one device:
|
|
2049
|
+
* How a push went to one device: sent (its provider took it), failed, token_invalid (no app holds the token: the device is forgotten); then as the app reports it — delivered (it reached the phone), not_shown (notifications off), dismissed, opened, action (a button tapped) — or unconfirmed: no report by the time it expired; the phone may have been off, or its report lost. The status is the furthest it got.
|
|
468
2050
|
*/
|
|
469
2051
|
export type PushDelivery = {
|
|
2052
|
+
/**
|
|
2053
|
+
* When a button was tapped.
|
|
2054
|
+
*/
|
|
2055
|
+
action_at?: string;
|
|
2056
|
+
/**
|
|
2057
|
+
* The button tapped.
|
|
2058
|
+
*/
|
|
2059
|
+
action_id?: string;
|
|
470
2060
|
at: string;
|
|
2061
|
+
/**
|
|
2062
|
+
* When it reached the phone.
|
|
2063
|
+
*/
|
|
2064
|
+
delivered_at?: string;
|
|
471
2065
|
device_id: string;
|
|
2066
|
+
/**
|
|
2067
|
+
* When the person dismissed it.
|
|
2068
|
+
*/
|
|
2069
|
+
dismissed_at?: string;
|
|
472
2070
|
error?: string;
|
|
2071
|
+
/**
|
|
2072
|
+
* When its provider stops trying: unreported by then, it is unconfirmed.
|
|
2073
|
+
*/
|
|
2074
|
+
expires_at?: string;
|
|
2075
|
+
/**
|
|
2076
|
+
* When the phone could not show it.
|
|
2077
|
+
*/
|
|
2078
|
+
not_shown_at?: string;
|
|
2079
|
+
/**
|
|
2080
|
+
* Why it could not be shown: the app's notifications are off (permission), or the notification's channel is (channel).
|
|
2081
|
+
*/
|
|
2082
|
+
not_shown_reason?: "permission" | "channel";
|
|
2083
|
+
/**
|
|
2084
|
+
* When the person opened it.
|
|
2085
|
+
*/
|
|
2086
|
+
opened_at?: string;
|
|
473
2087
|
platform: string;
|
|
474
2088
|
provider: string;
|
|
475
2089
|
provider_message_id?: string;
|
|
476
|
-
|
|
2090
|
+
/**
|
|
2091
|
+
* The furthest it got.
|
|
2092
|
+
*/
|
|
2093
|
+
status: "sent" | "failed" | "token_invalid" | "delivered" | "not_shown" | "dismissed" | "opened" | "action" | "unconfirmed";
|
|
2094
|
+
};
|
|
2095
|
+
/**
|
|
2096
|
+
* One report from the app about a push on this device.
|
|
2097
|
+
*/
|
|
2098
|
+
export type PushReceipt = {
|
|
2099
|
+
/**
|
|
2100
|
+
* The button tapped (status action).
|
|
2101
|
+
*/
|
|
2102
|
+
action_id?: string;
|
|
2103
|
+
/**
|
|
2104
|
+
* When, on the device's clock; now when absent.
|
|
2105
|
+
*/
|
|
2106
|
+
at?: string;
|
|
2107
|
+
/**
|
|
2108
|
+
* Why it could not be shown (status not_shown).
|
|
2109
|
+
*/
|
|
2110
|
+
reason?: "permission" | "channel";
|
|
2111
|
+
/**
|
|
2112
|
+
* The push's pb_receipt, as it came in its data.
|
|
2113
|
+
*/
|
|
2114
|
+
receipt: string;
|
|
2115
|
+
/**
|
|
2116
|
+
* What happened: it reached the phone, could not be shown, was opened, dismissed, or a button was tapped.
|
|
2117
|
+
*/
|
|
2118
|
+
status: "delivered" | "not_shown" | "opened" | "dismissed" | "action";
|
|
2119
|
+
};
|
|
2120
|
+
/**
|
|
2121
|
+
* The reports an app sends at once.
|
|
2122
|
+
*/
|
|
2123
|
+
export type PushReceiptBatch = {
|
|
2124
|
+
receipts: PushReceipt[];
|
|
2125
|
+
};
|
|
2126
|
+
/**
|
|
2127
|
+
* How many reports were recorded, and how many named no push of this project's (a token that does not open, or a push long gone).
|
|
2128
|
+
*/
|
|
2129
|
+
export type PushReceiptResult = {
|
|
2130
|
+
recorded: number;
|
|
2131
|
+
unknown: number;
|
|
477
2132
|
};
|
|
478
2133
|
/**
|
|
479
|
-
* Who the push is for: users,
|
|
2134
|
+
* Who the push is for: users, installations (a device whoever is signed in on it, no one included), the followers of a topic, or the members of an analytics audience — one of them.
|
|
480
2135
|
*/
|
|
481
2136
|
export type PushRecipients = {
|
|
2137
|
+
/**
|
|
2138
|
+
* An analytics audience's id: the push reaches each of its members once, spread by the worker — a member who signed in as their user (their preferences hold), one who never did on each install of theirs.
|
|
2139
|
+
*/
|
|
2140
|
+
audience?: string;
|
|
2141
|
+
/**
|
|
2142
|
+
* Installations: their devices, whoever is signed in. A person who never signed in is reached by their installation.
|
|
2143
|
+
*/
|
|
2144
|
+
installation_ids?: string[];
|
|
482
2145
|
/**
|
|
483
2146
|
* A topic's name: the push reaches its followers, spread by the worker.
|
|
484
2147
|
*/
|
|
@@ -501,6 +2164,10 @@ export type PushSend = {
|
|
|
501
2164
|
category?: string;
|
|
502
2165
|
collapse_key?: string;
|
|
503
2166
|
content_available?: boolean;
|
|
2167
|
+
/**
|
|
2168
|
+
* One of purchases' coupons: {{coupon}} is each user's own code of it, given as the push goes (a shared coupon's code, or one of its one-time codes, recorded as theirs). A push to an installation of no one fails: a code is a user's.
|
|
2169
|
+
*/
|
|
2170
|
+
coupon?: string;
|
|
504
2171
|
data?: PushData;
|
|
505
2172
|
/**
|
|
506
2173
|
* A URL with a scheme (https://, myapp://); not javascript:.
|
|
@@ -511,6 +2178,10 @@ export type PushSend = {
|
|
|
511
2178
|
* An https URL.
|
|
512
2179
|
*/
|
|
513
2180
|
image?: string;
|
|
2181
|
+
/**
|
|
2182
|
+
* Whether the push leaves its copy in its person's inbox as it is delivered (once, whatever their devices take); the project's inbox.push_copy unless it says.
|
|
2183
|
+
*/
|
|
2184
|
+
inbox?: boolean;
|
|
514
2185
|
metadata?: Metadata;
|
|
515
2186
|
/**
|
|
516
2187
|
* An alert the app's notification service extension rewrites before it shows (an end-to-end encrypted message's wake).
|
|
@@ -521,11 +2192,16 @@ export type PushSend = {
|
|
|
521
2192
|
* voip: a PushKit call ring, to ios_voip devices only; none: every other device.
|
|
522
2193
|
*/
|
|
523
2194
|
push_type?: "voip";
|
|
2195
|
+
schedule?: Schedule;
|
|
524
2196
|
/**
|
|
525
2197
|
* A background push the user does not see.
|
|
526
2198
|
*/
|
|
527
2199
|
silent?: boolean;
|
|
528
2200
|
sound?: string;
|
|
2201
|
+
/**
|
|
2202
|
+
* A push template of the project's (notify/templates/push), by slug: its title, body, image and link, filled with variables, in place of a title and a body.
|
|
2203
|
+
*/
|
|
2204
|
+
template?: string;
|
|
529
2205
|
title?: LocalizedText;
|
|
530
2206
|
to: PushRecipients;
|
|
531
2207
|
/**
|
|
@@ -535,12 +2211,72 @@ export type PushSend = {
|
|
|
535
2211
|
variables?: PushData;
|
|
536
2212
|
};
|
|
537
2213
|
/**
|
|
538
|
-
* A
|
|
2214
|
+
* A push template in one locale.
|
|
2215
|
+
*/
|
|
2216
|
+
export type PushTemplate = {
|
|
2217
|
+
/**
|
|
2218
|
+
* Handlebars.
|
|
2219
|
+
*/
|
|
2220
|
+
body: string;
|
|
2221
|
+
/**
|
|
2222
|
+
* Where a tap goes: https:// or the app's own scheme.
|
|
2223
|
+
*/
|
|
2224
|
+
deep_link?: string;
|
|
2225
|
+
/**
|
|
2226
|
+
* An https image.
|
|
2227
|
+
*/
|
|
2228
|
+
image?: string;
|
|
2229
|
+
locale: string;
|
|
2230
|
+
slug: string;
|
|
2231
|
+
/**
|
|
2232
|
+
* Handlebars.
|
|
2233
|
+
*/
|
|
2234
|
+
title: string;
|
|
2235
|
+
updated_at: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* The variables the title and the body use.
|
|
2238
|
+
*/
|
|
2239
|
+
variables: string[];
|
|
2240
|
+
};
|
|
2241
|
+
/**
|
|
2242
|
+
* The project's push templates, by slug and locale.
|
|
2243
|
+
*/
|
|
2244
|
+
export type PushTemplateList = {
|
|
2245
|
+
templates: PushTemplate[];
|
|
2246
|
+
};
|
|
2247
|
+
/**
|
|
2248
|
+
* A push template in one locale, written whole: a title or a body (or both).
|
|
2249
|
+
*/
|
|
2250
|
+
export type PushTemplateWrite = {
|
|
2251
|
+
body?: string;
|
|
2252
|
+
deep_link?: string | null;
|
|
2253
|
+
image?: string | null;
|
|
2254
|
+
title?: string;
|
|
2255
|
+
};
|
|
2256
|
+
/**
|
|
2257
|
+
* A message accepted for sending — or skipped: its user turned its category off on this channel (nothing queued or counted, no message_id), or a send rule skipped it (its message in the log with skip_reason).
|
|
539
2258
|
*/
|
|
540
2259
|
export type Queued = {
|
|
541
2260
|
message_id?: string;
|
|
2261
|
+
/**
|
|
2262
|
+
* Why a send rule skipped it — consent, frequency_cap or iys (NotifyMessage.skip_reason) — when its message is in the log; absent when its user's preferences turned it off.
|
|
2263
|
+
*/
|
|
2264
|
+
skip_reason?: string;
|
|
542
2265
|
skipped?: boolean;
|
|
543
2266
|
};
|
|
2267
|
+
/**
|
|
2268
|
+
* The hours no message that is not transactional reaches a recipient, on their clock: held until they end, then sent. Null: none. From start to end on the recipient's clock; 22:00 to 08:00 spans midnight.
|
|
2269
|
+
*/
|
|
2270
|
+
export type QuietHours = ({
|
|
2271
|
+
/**
|
|
2272
|
+
* HH:MM
|
|
2273
|
+
*/
|
|
2274
|
+
end: string;
|
|
2275
|
+
/**
|
|
2276
|
+
* HH:MM
|
|
2277
|
+
*/
|
|
2278
|
+
start: string;
|
|
2279
|
+
}) | null;
|
|
544
2280
|
/**
|
|
545
2281
|
* A text: a template with its variables, or a body.
|
|
546
2282
|
*/
|
|
@@ -602,6 +2338,19 @@ export type SMSTemplateList = {
|
|
|
602
2338
|
export type SMSTemplateWrite = {
|
|
603
2339
|
body: string;
|
|
604
2340
|
};
|
|
2341
|
+
/**
|
|
2342
|
+
* When a send goes: at a moment for everyone (at), or at an hour on each recipient's own clock (local_time: a date and time with no zone, 2026-10-15T10:00) — their device's time zone, the project's default_timezone for one whose devices say none. A local time already past on a recipient's clock goes to them at once. Within 30 days.
|
|
2343
|
+
*/
|
|
2344
|
+
export type Schedule = {
|
|
2345
|
+
/**
|
|
2346
|
+
* The moment it goes, for everyone.
|
|
2347
|
+
*/
|
|
2348
|
+
at?: string;
|
|
2349
|
+
/**
|
|
2350
|
+
* The hour it goes on each recipient's clock.
|
|
2351
|
+
*/
|
|
2352
|
+
local_time?: string;
|
|
2353
|
+
};
|
|
605
2354
|
/**
|
|
606
2355
|
* One SendGrid event, as SendGrid sends it.
|
|
607
2356
|
*/
|
|
@@ -613,7 +2362,7 @@ export type SendGridEvent = {
|
|
|
613
2362
|
*/
|
|
614
2363
|
export type SendGridEvents = SendGridEvent[];
|
|
615
2364
|
/**
|
|
616
|
-
* A text accepted for sending, and what its body takes on the wire — or skipped: its user turned its category off by SMS, and
|
|
2365
|
+
* A text accepted for sending, and what its body takes on the wire — or skipped: its user turned its category off by SMS (nothing queued or counted, no message_id), or a send rule skipped it (its message in the log with skip_reason; the number's per-minute and per-day texts are not spent).
|
|
617
2366
|
*/
|
|
618
2367
|
export type Texted = {
|
|
619
2368
|
/**
|
|
@@ -625,6 +2374,10 @@ export type Texted = {
|
|
|
625
2374
|
* The SMS segments the text takes.
|
|
626
2375
|
*/
|
|
627
2376
|
segments?: number;
|
|
2377
|
+
/**
|
|
2378
|
+
* Why a send rule skipped it — consent, frequency_cap or iys (NotifyMessage.skip_reason) — when its message is in the log; absent when its user's preferences turned it off.
|
|
2379
|
+
*/
|
|
2380
|
+
skip_reason?: string;
|
|
628
2381
|
skipped?: boolean;
|
|
629
2382
|
};
|
|
630
2383
|
/**
|
|
@@ -675,12 +2428,63 @@ export type TopicPage = {
|
|
|
675
2428
|
export type TopicSubscribers = {
|
|
676
2429
|
user_ids: string[];
|
|
677
2430
|
};
|
|
2431
|
+
/**
|
|
2432
|
+
* A text a person sent the project's Twilio number, as Twilio posts it (more fields than these come).
|
|
2433
|
+
*/
|
|
2434
|
+
export type TwilioIncomingText = {
|
|
2435
|
+
/**
|
|
2436
|
+
* The project's Twilio account.
|
|
2437
|
+
*/
|
|
2438
|
+
AccountSid?: string;
|
|
2439
|
+
/**
|
|
2440
|
+
* What they wrote.
|
|
2441
|
+
*/
|
|
2442
|
+
Body: string;
|
|
2443
|
+
/**
|
|
2444
|
+
* The sender's number (E.164).
|
|
2445
|
+
*/
|
|
2446
|
+
From: string;
|
|
2447
|
+
/**
|
|
2448
|
+
* Twilio's id of the text.
|
|
2449
|
+
*/
|
|
2450
|
+
MessageSid?: string;
|
|
2451
|
+
/**
|
|
2452
|
+
* The project's number.
|
|
2453
|
+
*/
|
|
2454
|
+
To?: string;
|
|
2455
|
+
[key: string]: unknown;
|
|
2456
|
+
};
|
|
678
2457
|
/**
|
|
679
2458
|
* Twilio's status callback for a message, as Twilio sends it (a form).
|
|
680
2459
|
*/
|
|
681
2460
|
export type TwilioStatusCallback = {
|
|
682
2461
|
[key: string]: unknown;
|
|
683
2462
|
};
|
|
2463
|
+
/**
|
|
2464
|
+
* notification.uninstalled: a device no app holds any more.
|
|
2465
|
+
*/
|
|
2466
|
+
export type UninstalledEvent = {
|
|
2467
|
+
/**
|
|
2468
|
+
* The app's own name for the device.
|
|
2469
|
+
*/
|
|
2470
|
+
device_id: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* Its installation, when the app named one.
|
|
2473
|
+
*/
|
|
2474
|
+
installation_id?: string;
|
|
2475
|
+
/**
|
|
2476
|
+
* android, ios, ios_voip or web.
|
|
2477
|
+
*/
|
|
2478
|
+
platform: string;
|
|
2479
|
+
/**
|
|
2480
|
+
* The push service that said so: fcm, apns or expo.
|
|
2481
|
+
*/
|
|
2482
|
+
provider: string;
|
|
2483
|
+
/**
|
|
2484
|
+
* The user signed in on it, when one was.
|
|
2485
|
+
*/
|
|
2486
|
+
user_id?: string;
|
|
2487
|
+
};
|
|
684
2488
|
/**
|
|
685
2489
|
* Whether the code is the one the service sent: false for a wrong code and for one that is over (expired, used, out of attempts).
|
|
686
2490
|
*/
|
|
@@ -725,6 +2529,33 @@ export type VerificationStarted = {
|
|
|
725
2529
|
export type VonageReceipt = {
|
|
726
2530
|
[key: string]: unknown;
|
|
727
2531
|
};
|
|
2532
|
+
/**
|
|
2533
|
+
* What a browser subscribes with.
|
|
2534
|
+
*/
|
|
2535
|
+
export type WebPushKey = {
|
|
2536
|
+
/**
|
|
2537
|
+
* The project's VAPID public key: an uncompressed P-256 point, base64url.
|
|
2538
|
+
*/
|
|
2539
|
+
public_key: string;
|
|
2540
|
+
};
|
|
2541
|
+
/**
|
|
2542
|
+
* The project's web push.
|
|
2543
|
+
*/
|
|
2544
|
+
export type WebPushStatus = {
|
|
2545
|
+
created_at?: string;
|
|
2546
|
+
/**
|
|
2547
|
+
* The browsers subscribed now.
|
|
2548
|
+
*/
|
|
2549
|
+
devices: number;
|
|
2550
|
+
/**
|
|
2551
|
+
* The VAPID public key, base64url; null until an app asked for one.
|
|
2552
|
+
*/
|
|
2553
|
+
public_key: string | null;
|
|
2554
|
+
/**
|
|
2555
|
+
* Who a push service may write to about the project's pushes.
|
|
2556
|
+
*/
|
|
2557
|
+
subject: string;
|
|
2558
|
+
};
|
|
728
2559
|
/**
|
|
729
2560
|
* One of a Meta template's components, in Meta's own shape: a body's parameters, a button.
|
|
730
2561
|
*/
|
|
@@ -808,6 +2639,73 @@ export type WhatsAppTemplateWrite = {
|
|
|
808
2639
|
name: string;
|
|
809
2640
|
variables?: string[];
|
|
810
2641
|
};
|
|
2642
|
+
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
2643
|
+
export interface Events {
|
|
2644
|
+
/**
|
|
2645
|
+
* notification.action: the person tapped a push's button.
|
|
2646
|
+
*/
|
|
2647
|
+
"notification.action": NotificationEvent;
|
|
2648
|
+
/**
|
|
2649
|
+
* notification.bounced: the receiving server refused it.
|
|
2650
|
+
*/
|
|
2651
|
+
"notification.bounced": NotificationEvent;
|
|
2652
|
+
/**
|
|
2653
|
+
* notification.complained: the recipient marked it spam.
|
|
2654
|
+
*/
|
|
2655
|
+
"notification.complained": NotificationEvent;
|
|
2656
|
+
/**
|
|
2657
|
+
* notification.delivered: its provider says it was delivered, or — a push — the app says it reached the phone.
|
|
2658
|
+
*/
|
|
2659
|
+
"notification.delivered": NotificationEvent;
|
|
2660
|
+
/**
|
|
2661
|
+
* notification.dismissed: the person dismissed a push.
|
|
2662
|
+
*/
|
|
2663
|
+
"notification.dismissed": NotificationEvent;
|
|
2664
|
+
/**
|
|
2665
|
+
* notification.expired: its provider gave up.
|
|
2666
|
+
*/
|
|
2667
|
+
"notification.expired": NotificationEvent;
|
|
2668
|
+
/**
|
|
2669
|
+
* notification.failed: a message failed for good.
|
|
2670
|
+
*/
|
|
2671
|
+
"notification.failed": NotificationEvent;
|
|
2672
|
+
/**
|
|
2673
|
+
* notification.not_shown: a push reached the phone and could not be shown: its notifications are off.
|
|
2674
|
+
*/
|
|
2675
|
+
"notification.not_shown": NotificationEvent;
|
|
2676
|
+
/**
|
|
2677
|
+
* notification.opened: the person opened a push.
|
|
2678
|
+
*/
|
|
2679
|
+
"notification.opened": NotificationEvent;
|
|
2680
|
+
/**
|
|
2681
|
+
* notification.read: the recipient read it (WhatsApp).
|
|
2682
|
+
*/
|
|
2683
|
+
"notification.read": NotificationEvent;
|
|
2684
|
+
/**
|
|
2685
|
+
* notification.received: a message came in on WhatsApp.
|
|
2686
|
+
*/
|
|
2687
|
+
"notification.received": NotificationReceivedEvent;
|
|
2688
|
+
/**
|
|
2689
|
+
* notification.rejected: its provider refused it.
|
|
2690
|
+
*/
|
|
2691
|
+
"notification.rejected": NotificationEvent;
|
|
2692
|
+
/**
|
|
2693
|
+
* notification.sent: a message left: its provider took it (a topic push: its followers were reached).
|
|
2694
|
+
*/
|
|
2695
|
+
"notification.sent": NotificationEvent;
|
|
2696
|
+
/**
|
|
2697
|
+
* notification.unconfirmed: no report of a push came from the device by the time it expired: the phone may have been off, or its report lost.
|
|
2698
|
+
*/
|
|
2699
|
+
"notification.unconfirmed": NotificationEvent;
|
|
2700
|
+
/**
|
|
2701
|
+
* notification.undelivered: its provider could not deliver it.
|
|
2702
|
+
*/
|
|
2703
|
+
"notification.undelivered": NotificationEvent;
|
|
2704
|
+
/**
|
|
2705
|
+
* notification.uninstalled: the push service says no app holds a device's token any more — the app was uninstalled (or its push token dropped). The device is forgotten; the event names whom it was: the user signed in on it, or its installation.
|
|
2706
|
+
*/
|
|
2707
|
+
"notification.uninstalled": UninstalledEvent;
|
|
2708
|
+
}
|
|
811
2709
|
/** Palbase Notify */
|
|
812
2710
|
export declare function client(t: Transport): {
|
|
813
2711
|
/**
|
|
@@ -835,11 +2733,12 @@ export declare function client(t: Transport): {
|
|
|
835
2733
|
/**
|
|
836
2734
|
* Register a device
|
|
837
2735
|
*
|
|
838
|
-
* Records the signed-in user's device,
|
|
2736
|
+
* Records the device, or its new token: the signed-in user's, with their access token; with the publishable key alone, its installation's — a push that names the installation reaches it, whoever is signed in, no one included; when someone signs in, their registration takes the token and the device is theirs, and signed out the app registers it as the installation's again. A token another device held moves here: one token reaches one device. A signed-in user's device is the session's it is registered in: when that session ends — the user signs out, ends it from another device, an admin revokes it — the device is forgotten; registered again in another session, it is that one's. A registration in a session that has ended is refused (401 session_ended).
|
|
839
2737
|
*/
|
|
840
2738
|
registerDevice(input: {
|
|
841
2739
|
headers?: {
|
|
842
|
-
"Idempotency-Key"?: string;
|
|
2740
|
+
"Idempotency-Key"?: string; /** The install's secret, as its SDK keeps it (32 random bytes, base64url): the installation id is made from it (the first 16 bytes of its SHA-256, base64url), so it proves the request holds the install it names. Required whenever the request names an installation. */
|
|
2741
|
+
"X-Palbase-Installation-Secret"?: string;
|
|
843
2742
|
};
|
|
844
2743
|
body: DeviceRegistration; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
845
2744
|
signal?: AbortSignal;
|
|
@@ -878,6 +2777,192 @@ export declare function client(t: Transport): {
|
|
|
878
2777
|
body: EmailSend; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
879
2778
|
signal?: AbortSignal;
|
|
880
2779
|
}): Promise<Reply<202, Queued>>;
|
|
2780
|
+
/**
|
|
2781
|
+
* List the in-app campaigns
|
|
2782
|
+
*
|
|
2783
|
+
* The project's in-app campaigns, newest first.
|
|
2784
|
+
*/
|
|
2785
|
+
listInAppCampaigns(input?: {
|
|
2786
|
+
signal?: AbortSignal;
|
|
2787
|
+
}): Promise<Reply<200, InAppCampaignList>>;
|
|
2788
|
+
/**
|
|
2789
|
+
* Create an in-app campaign
|
|
2790
|
+
*
|
|
2791
|
+
* A campaign: a message (a screen of the message kind: a modal, a banner, the whole screen), who sees it (everyone, or an analytics audience's members who allowed personalization), what shows it (an event of the app's), how often at most (beside the project's in_app settings), and what counts as its conversion.
|
|
2792
|
+
*/
|
|
2793
|
+
createInAppCampaign(input: {
|
|
2794
|
+
headers?: {
|
|
2795
|
+
"Idempotency-Key"?: string;
|
|
2796
|
+
};
|
|
2797
|
+
body: InAppCampaignWrite; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2798
|
+
signal?: AbortSignal;
|
|
2799
|
+
}): Promise<Reply<201, InAppCampaign>>;
|
|
2800
|
+
/**
|
|
2801
|
+
* Get an in-app campaign
|
|
2802
|
+
*
|
|
2803
|
+
* The campaign.
|
|
2804
|
+
*/
|
|
2805
|
+
getInAppCampaign(input: {
|
|
2806
|
+
path: {
|
|
2807
|
+
id: string;
|
|
2808
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2809
|
+
signal?: AbortSignal;
|
|
2810
|
+
}): Promise<Reply<200, InAppCampaign>>;
|
|
2811
|
+
/**
|
|
2812
|
+
* Write an in-app campaign
|
|
2813
|
+
*
|
|
2814
|
+
* Writes the campaign whole: active, it shows from now; paused or ended, it no longer does.
|
|
2815
|
+
*/
|
|
2816
|
+
putInAppCampaign(input: {
|
|
2817
|
+
path: {
|
|
2818
|
+
id: string;
|
|
2819
|
+
};
|
|
2820
|
+
headers?: {
|
|
2821
|
+
"Idempotency-Key"?: string;
|
|
2822
|
+
};
|
|
2823
|
+
body: InAppCampaignWrite; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2824
|
+
signal?: AbortSignal;
|
|
2825
|
+
}): Promise<Reply<200, InAppCampaign>>;
|
|
2826
|
+
/**
|
|
2827
|
+
* Delete an in-app campaign
|
|
2828
|
+
*
|
|
2829
|
+
* Deletes the campaign, with what it was shown and its counts.
|
|
2830
|
+
*/
|
|
2831
|
+
deleteInAppCampaign(input: {
|
|
2832
|
+
path: {
|
|
2833
|
+
id: string;
|
|
2834
|
+
};
|
|
2835
|
+
headers?: {
|
|
2836
|
+
"Idempotency-Key"?: string;
|
|
2837
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2838
|
+
signal?: AbortSignal;
|
|
2839
|
+
}): Promise<Reply<204, undefined>>;
|
|
2840
|
+
/**
|
|
2841
|
+
* Count an in-app campaign
|
|
2842
|
+
*
|
|
2843
|
+
* How many times the campaign was shown, tapped, closed and converted, and to how many people.
|
|
2844
|
+
*/
|
|
2845
|
+
getInAppCampaignStats(input: {
|
|
2846
|
+
path: {
|
|
2847
|
+
id: string;
|
|
2848
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2849
|
+
signal?: AbortSignal;
|
|
2850
|
+
}): Promise<Reply<200, InAppStats>>;
|
|
2851
|
+
/**
|
|
2852
|
+
* Show an in-app message
|
|
2853
|
+
*
|
|
2854
|
+
* Asks to show a campaign now: shown — counted at once on every device of the person's — or refused when a cap holds (409 frequency_capped: not now).
|
|
2855
|
+
*/
|
|
2856
|
+
showInAppMessage(input: {
|
|
2857
|
+
headers?: {
|
|
2858
|
+
"Idempotency-Key"?: string;
|
|
2859
|
+
};
|
|
2860
|
+
body: InAppImpressionWrite; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2861
|
+
signal?: AbortSignal;
|
|
2862
|
+
}): Promise<Reply<201, InAppImpression>>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Report what was done with an in-app message
|
|
2865
|
+
*
|
|
2866
|
+
* What the person did with a campaign shown to them: tapped a button (clicked), closed it (dismissed), or did what it was for (converted, within its hours). Each once.
|
|
2867
|
+
*/
|
|
2868
|
+
reportInAppEvent(input: {
|
|
2869
|
+
path: {
|
|
2870
|
+
id: string;
|
|
2871
|
+
};
|
|
2872
|
+
query?: {
|
|
2873
|
+
installation_id?: string;
|
|
2874
|
+
};
|
|
2875
|
+
headers?: {
|
|
2876
|
+
"Idempotency-Key"?: string;
|
|
2877
|
+
};
|
|
2878
|
+
body: InAppEvent; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2879
|
+
signal?: AbortSignal;
|
|
2880
|
+
}): Promise<Reply<204, undefined>>;
|
|
2881
|
+
/**
|
|
2882
|
+
* List my in-app messages
|
|
2883
|
+
*
|
|
2884
|
+
* The person's campaigns now — everyone's, and their audiences' when they allowed personalization — with what shows each, how often each may and did, and how often in-app messages may reach them at all: what their app takes as it comes to the foreground.
|
|
2885
|
+
*/
|
|
2886
|
+
listMyInAppMessages(input: {
|
|
2887
|
+
query: {
|
|
2888
|
+
session_id: string; /** The install's id (its secret in X-Palbase-Installation-Secret), when no one is signed in. */
|
|
2889
|
+
installation_id?: string;
|
|
2890
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2891
|
+
signal?: AbortSignal;
|
|
2892
|
+
}): Promise<Reply<200, InAppMessageList>>;
|
|
2893
|
+
/**
|
|
2894
|
+
* List the message templates
|
|
2895
|
+
*
|
|
2896
|
+
* The designed messages a project starts an in-app message or an inbox card from: each a definition every app draws with the renderer of its paywalls.
|
|
2897
|
+
*/
|
|
2898
|
+
listInAppTemplates(input?: {
|
|
2899
|
+
signal?: AbortSignal;
|
|
2900
|
+
}): Promise<Reply<200, InAppTemplateList>>;
|
|
2901
|
+
/**
|
|
2902
|
+
* List my inbox
|
|
2903
|
+
*
|
|
2904
|
+
* The signed-in person's inbox, newest first: the same on each of their devices, each message written out in their language and filled with its sender's values, with how many are unread.
|
|
2905
|
+
*/
|
|
2906
|
+
listMyInbox(input?: {
|
|
2907
|
+
query?: {
|
|
2908
|
+
limit?: number; /** The next_cursor of the previous page. Opaque; omit it for the first page. */
|
|
2909
|
+
cursor?: string; /** The language to write it in (a BCP 47 tag); the one the person chose unless given. */
|
|
2910
|
+
locale?: string;
|
|
2911
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2912
|
+
signal?: AbortSignal;
|
|
2913
|
+
}): Promise<Reply<200, InboxPage>>;
|
|
2914
|
+
/**
|
|
2915
|
+
* Send to inboxes
|
|
2916
|
+
*
|
|
2917
|
+
* Leaves a message in each person's inbox, now: on each of their devices until they delete it or it expires (the project's inbox.days, unless it says; a year at most). A person's inbox keeps 250 messages; the oldest goes. A deleted person keeps nothing.
|
|
2918
|
+
*/
|
|
2919
|
+
sendInbox(input: {
|
|
2920
|
+
headers?: {
|
|
2921
|
+
"Idempotency-Key"?: string;
|
|
2922
|
+
};
|
|
2923
|
+
body: InboxSend; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2924
|
+
signal?: AbortSignal;
|
|
2925
|
+
}): Promise<Reply<201, InboxSent>>;
|
|
2926
|
+
/**
|
|
2927
|
+
* List inbox messages
|
|
2928
|
+
*
|
|
2929
|
+
* The project's inbox messages, a person's or everyone's, newest first, written out in the project's language: what Studio's message log shows.
|
|
2930
|
+
*/
|
|
2931
|
+
listInboxMessages(input?: {
|
|
2932
|
+
query?: {
|
|
2933
|
+
limit?: number; /** The next_cursor of the previous page. Opaque; omit it for the first page. */
|
|
2934
|
+
cursor?: string; /** A person's alone. */
|
|
2935
|
+
user_id?: string; /** The language to write it in (a BCP 47 tag); the one the person chose unless given. */
|
|
2936
|
+
locale?: string;
|
|
2937
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2938
|
+
signal?: AbortSignal;
|
|
2939
|
+
}): Promise<Reply<200, InboxPage>>;
|
|
2940
|
+
/**
|
|
2941
|
+
* Mark my inbox read
|
|
2942
|
+
*
|
|
2943
|
+
* Marks some of the signed-in person's messages read (ids), or all of them: read on every device.
|
|
2944
|
+
*/
|
|
2945
|
+
readMyInbox(input: {
|
|
2946
|
+
headers?: {
|
|
2947
|
+
"Idempotency-Key"?: string;
|
|
2948
|
+
};
|
|
2949
|
+
body: InboxRead; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2950
|
+
signal?: AbortSignal;
|
|
2951
|
+
}): Promise<Reply<200, InboxReadResult>>;
|
|
2952
|
+
/**
|
|
2953
|
+
* Delete a message from my inbox
|
|
2954
|
+
*
|
|
2955
|
+
* Deletes one of the signed-in person's messages: gone from every device.
|
|
2956
|
+
*/
|
|
2957
|
+
deleteMyInboxMessage(input: {
|
|
2958
|
+
path: {
|
|
2959
|
+
id: string;
|
|
2960
|
+
};
|
|
2961
|
+
headers?: {
|
|
2962
|
+
"Idempotency-Key"?: string;
|
|
2963
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2964
|
+
signal?: AbortSignal;
|
|
2965
|
+
}): Promise<Reply<204, undefined>>;
|
|
881
2966
|
/**
|
|
882
2967
|
* List the project's messages
|
|
883
2968
|
*
|
|
@@ -888,9 +2973,9 @@ export declare function client(t: Transport): {
|
|
|
888
2973
|
limit?: number; /** The next_cursor of the previous page. Opaque; omit it for the first page. */
|
|
889
2974
|
cursor?: string; /** Only this channel's messages. */
|
|
890
2975
|
channel?: "email" | "sms" | "whatsapp" | "push"; /** Only messages in this status. */
|
|
891
|
-
status?: "queued" | "sending" | "sent" | "failed" | "delivered" | "read" | "bounced" | "complained" | "undelivered" | "expired" | "rejected"; /** Only messages for this user. */
|
|
2976
|
+
status?: "queued" | "sending" | "sent" | "failed" | "delivered" | "read" | "bounced" | "complained" | "undelivered" | "expired" | "rejected" | "scheduled" | "held" | "skipped" | "canceled"; /** Only messages for this user. */
|
|
892
2977
|
user_id?: string; /** Only this category's messages. */
|
|
893
|
-
category?: string; /** Only the followers' pushes of this topic push. */
|
|
2978
|
+
category?: string; /** Only the followers' (members') pushes of this topic (audience) push. */
|
|
894
2979
|
parent_id?: string; /** Only messages created at or after this time (RFC 3339). */
|
|
895
2980
|
created_after?: string; /** Only messages created before this time (RFC 3339). */
|
|
896
2981
|
created_before?: string;
|
|
@@ -908,6 +2993,17 @@ export declare function client(t: Transport): {
|
|
|
908
2993
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
909
2994
|
signal?: AbortSignal;
|
|
910
2995
|
}): Promise<Reply<200, NotifyMessage>>;
|
|
2996
|
+
/**
|
|
2997
|
+
* Take back a waiting message
|
|
2998
|
+
*
|
|
2999
|
+
* Takes back a message waiting for its time — scheduled, or held through its recipient's quiet hours: it never goes, and is answered canceled. A topic's or an audience's push is taken back whole: its spreading stops (one asked for a moment to come has not spread yet), and each follower's (member's) push still waiting is taken back. One already on its way is not taken back (409 message_not_waiting).
|
|
3000
|
+
*/
|
|
3001
|
+
cancelMessage(input: {
|
|
3002
|
+
path: {
|
|
3003
|
+
id: string;
|
|
3004
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3005
|
+
signal?: AbortSignal;
|
|
3006
|
+
}): Promise<Reply<200, NotifyMessage>>;
|
|
911
3007
|
/**
|
|
912
3008
|
* Get the metrics summary
|
|
913
3009
|
*
|
|
@@ -948,15 +3044,10 @@ export declare function client(t: Transport): {
|
|
|
948
3044
|
listNotifyProviders(input?: {
|
|
949
3045
|
signal?: AbortSignal;
|
|
950
3046
|
}): Promise<Reply<200, NotifyProviderList>>;
|
|
951
|
-
/**
|
|
952
|
-
* Bring a provider
|
|
953
|
-
*
|
|
954
|
-
* Stores the project's own provider for a channel — its credentials sealed with the project's key, checked as the sender will use them. A project with an active email provider sends its email through it instead of the platform's shared sender. Texts go through the project's own SMS providers only, and its one-time codes through them or through its own verification service (Twilio Verify).
|
|
955
|
-
*/
|
|
956
3047
|
putNotifyProvider(input: {
|
|
957
3048
|
path: {
|
|
958
|
-
channel: "email" | "sms" | "verify" | "whatsapp" | "push"; /** The provider: for email acs, ses, sendgrid or smtp; for sms twilio, vonage or acs; for verify twilio_verify; for whatsapp meta; for push fcm, apns or expo. */
|
|
959
|
-
provider: "acs" | "ses" | "sendgrid" | "smtp" | "twilio" | "vonage" | "twilio_verify" | "meta" | "fcm" | "apns" | "expo";
|
|
3049
|
+
channel: "email" | "sms" | "verify" | "whatsapp" | "push" | "iys"; /** The provider: for email acs, ses, sendgrid or smtp; for sms twilio, vonage or acs; for verify twilio_verify; for whatsapp meta; for push fcm, apns or expo; for iys iys. */
|
|
3050
|
+
provider: "acs" | "ses" | "sendgrid" | "smtp" | "twilio" | "vonage" | "twilio_verify" | "meta" | "fcm" | "apns" | "expo" | "iys";
|
|
960
3051
|
};
|
|
961
3052
|
headers?: {
|
|
962
3053
|
"Idempotency-Key"?: string;
|
|
@@ -971,8 +3062,8 @@ export declare function client(t: Transport): {
|
|
|
971
3062
|
*/
|
|
972
3063
|
deleteNotifyProvider(input: {
|
|
973
3064
|
path: {
|
|
974
|
-
channel: "email" | "sms" | "verify" | "whatsapp" | "push"; /** The provider: for email acs, ses, sendgrid or smtp; for sms twilio, vonage or acs; for verify twilio_verify; for whatsapp meta; for push fcm, apns or expo. */
|
|
975
|
-
provider: "acs" | "ses" | "sendgrid" | "smtp" | "twilio" | "vonage" | "twilio_verify" | "meta" | "fcm" | "apns" | "expo";
|
|
3065
|
+
channel: "email" | "sms" | "verify" | "whatsapp" | "push" | "iys"; /** The provider: for email acs, ses, sendgrid or smtp; for sms twilio, vonage or acs; for verify twilio_verify; for whatsapp meta; for push fcm, apns or expo. */
|
|
3066
|
+
provider: "acs" | "ses" | "sendgrid" | "smtp" | "twilio" | "vonage" | "twilio_verify" | "meta" | "fcm" | "apns" | "expo" | "iys";
|
|
976
3067
|
};
|
|
977
3068
|
headers?: {
|
|
978
3069
|
"Idempotency-Key"?: string;
|
|
@@ -991,10 +3082,19 @@ export declare function client(t: Transport): {
|
|
|
991
3082
|
body: PushSend; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
992
3083
|
signal?: AbortSignal;
|
|
993
3084
|
}): Promise<Reply<202, ChannelQueued>>;
|
|
3085
|
+
/**
|
|
3086
|
+
* Report how pushes went on the device
|
|
3087
|
+
*
|
|
3088
|
+
* The app's SDK reports what happened to a push on this device: it reached the phone (the iOS Notification Service Extension, or the Android SDK as it draws it), could not be shown, was opened, dismissed, or a button was tapped. The push's own sealed token (pb_receipt) is the credential: only a push this project sent to this device can be reported, with no sign-in. Each delivery keeps the furthest it got; each stage reached for the first time is told (notification.<stage>).
|
|
3089
|
+
*/
|
|
3090
|
+
recordPushReceipts(input: {
|
|
3091
|
+
body: PushReceiptBatch; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3092
|
+
signal?: AbortSignal;
|
|
3093
|
+
}): Promise<Reply<200, PushReceiptResult>>;
|
|
994
3094
|
/**
|
|
995
3095
|
* Read the project's message settings
|
|
996
3096
|
*
|
|
997
|
-
* The locale a template falls back to,
|
|
3097
|
+
* The locale a template falls back to, who an email through the project's own provider is from, where texts may go, and when messages that are not transactional go (the default time zone, quiet hours and the marketing cap), with their revision in the ETag header. A save sends that ETag back in If-Match.
|
|
998
3098
|
*/
|
|
999
3099
|
getNotifySettings(input?: {
|
|
1000
3100
|
signal?: AbortSignal;
|
|
@@ -1002,7 +3102,7 @@ export declare function client(t: Transport): {
|
|
|
1002
3102
|
/**
|
|
1003
3103
|
* Write the project's message settings
|
|
1004
3104
|
*
|
|
1005
|
-
* Sets the default locale, the from address and name
|
|
3105
|
+
* Sets the default locale, the from address and name and the reply-to address used with the project's own provider, the countries texts may reach, and when messages that are not transactional go: default_timezone, quiet_hours and marketing_cap. A write that names none of those three keeps them as they are (a client built before them); one named null is taken off. Requires If-Match with the ETag of the settings the change was made against: without it 428 settings_revision_required, with a revision that is no longer current 412 settings_revision_conflict (read again and review before saving). Answers the saved settings and their new ETag.
|
|
1006
3106
|
*/
|
|
1007
3107
|
putNotifySettings(input: {
|
|
1008
3108
|
headers: {
|
|
@@ -1075,6 +3175,57 @@ export declare function client(t: Transport): {
|
|
|
1075
3175
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1076
3176
|
signal?: AbortSignal;
|
|
1077
3177
|
}): Promise<Reply<204, undefined>>;
|
|
3178
|
+
/**
|
|
3179
|
+
* List the push templates
|
|
3180
|
+
*
|
|
3181
|
+
* Every push template of the project, in every locale it is written in, with the variables each uses.
|
|
3182
|
+
*/
|
|
3183
|
+
listPushTemplates(input?: {
|
|
3184
|
+
signal?: AbortSignal;
|
|
3185
|
+
}): Promise<Reply<200, PushTemplateList>>;
|
|
3186
|
+
/**
|
|
3187
|
+
* Get a push template
|
|
3188
|
+
*
|
|
3189
|
+
* The template in this locale.
|
|
3190
|
+
*/
|
|
3191
|
+
getPushTemplate(input: {
|
|
3192
|
+
path: {
|
|
3193
|
+
slug: string; /** A BCP 47 locale, e.g. en or tr. */
|
|
3194
|
+
locale: string;
|
|
3195
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3196
|
+
signal?: AbortSignal;
|
|
3197
|
+
}): Promise<Reply<200, PushTemplate>>;
|
|
3198
|
+
/**
|
|
3199
|
+
* Write a push template
|
|
3200
|
+
*
|
|
3201
|
+
* Writes the template in this locale: a title and a body in Handlebars ({{name}}, {{#if}} {{#unless}} {{#each}} {{#with}}, lookup, equal), an image and a link. A push that names it (template) is filled with its variables, each device in its person's language: the locale they chose, else the device's, else the project's default, else the template's first.
|
|
3202
|
+
*/
|
|
3203
|
+
putPushTemplate(input: {
|
|
3204
|
+
path: {
|
|
3205
|
+
slug: string; /** A BCP 47 locale, e.g. en or tr. */
|
|
3206
|
+
locale: string;
|
|
3207
|
+
};
|
|
3208
|
+
headers?: {
|
|
3209
|
+
"Idempotency-Key"?: string;
|
|
3210
|
+
};
|
|
3211
|
+
body: PushTemplateWrite; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3212
|
+
signal?: AbortSignal;
|
|
3213
|
+
}): Promise<Reply<200, PushTemplate>>;
|
|
3214
|
+
/**
|
|
3215
|
+
* Remove a push template
|
|
3216
|
+
*
|
|
3217
|
+
* Removes the template in this locale; a push that names it is written in the locales left (none left: it is refused, template_not_found).
|
|
3218
|
+
*/
|
|
3219
|
+
deletePushTemplate(input: {
|
|
3220
|
+
path: {
|
|
3221
|
+
slug: string; /** A BCP 47 locale, e.g. en or tr. */
|
|
3222
|
+
locale: string;
|
|
3223
|
+
};
|
|
3224
|
+
headers?: {
|
|
3225
|
+
"Idempotency-Key"?: string;
|
|
3226
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3227
|
+
signal?: AbortSignal;
|
|
3228
|
+
}): Promise<Reply<204, undefined>>;
|
|
1078
3229
|
/**
|
|
1079
3230
|
* List the SMS templates
|
|
1080
3231
|
*
|
|
@@ -1367,6 +3518,10 @@ export declare function client(t: Transport): {
|
|
|
1367
3518
|
body: TwilioStatusCallback; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1368
3519
|
signal?: AbortSignal;
|
|
1369
3520
|
}): Promise<Reply<204, undefined>>;
|
|
3521
|
+
receiveTwilioText(input: {
|
|
3522
|
+
body: TwilioIncomingText; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3523
|
+
signal?: AbortSignal;
|
|
3524
|
+
}): Promise<Reply<204, undefined>>;
|
|
1370
3525
|
/**
|
|
1371
3526
|
* Vonage receipt (query)
|
|
1372
3527
|
*
|
|
@@ -1422,6 +3577,22 @@ export declare function client(t: Transport): {
|
|
|
1422
3577
|
body: MetaNotification; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1423
3578
|
signal?: AbortSignal;
|
|
1424
3579
|
}): Promise<Reply<204, undefined>>;
|
|
3580
|
+
/**
|
|
3581
|
+
* Get the project's web push
|
|
3582
|
+
*
|
|
3583
|
+
* The project's web push: its VAPID key (none until an app asked for one to subscribe with), who a push service may write to about its pushes, and the browsers subscribed now.
|
|
3584
|
+
*/
|
|
3585
|
+
getWebPushStatus(input?: {
|
|
3586
|
+
signal?: AbortSignal;
|
|
3587
|
+
}): Promise<Reply<200, WebPushStatus>>;
|
|
3588
|
+
/**
|
|
3589
|
+
* Get the key a browser subscribes with
|
|
3590
|
+
*
|
|
3591
|
+
* The project's VAPID public key, base64url: what a browser subscribes with (PushManager.subscribe's applicationServerKey). Made the first time an app asks; the browser's subscription is then its device's token (platform web).
|
|
3592
|
+
*/
|
|
3593
|
+
getWebPushKey(input?: {
|
|
3594
|
+
signal?: AbortSignal;
|
|
3595
|
+
}): Promise<Reply<200, WebPushKey>>;
|
|
1425
3596
|
/**
|
|
1426
3597
|
* Send a WhatsApp message
|
|
1427
3598
|
*
|