@hermeticacomms/sdk-node 0.1.0 → 0.4.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/contracts/auth.d.ts +10 -6
- package/dist/contracts/auth.js +14 -5
- package/dist/contracts/billing.d.ts +2 -0
- package/dist/contracts/billing.js +2 -1
- package/dist/contracts/campaigns.d.ts +6 -9
- package/dist/contracts/campaigns.js +9 -2
- package/dist/contracts/consent.d.ts +24 -0
- package/dist/contracts/consent.js +15 -1
- package/dist/contracts/content-blocks.d.ts +1 -0
- package/dist/contracts/content-blocks.js +5 -3
- package/dist/contracts/content-library.d.ts +8 -0
- package/dist/contracts/content-library.js +3 -1
- package/dist/contracts/content.d.ts +6 -0
- package/dist/contracts/content.js +5 -3
- package/dist/contracts/delivery.d.ts +3 -0
- package/dist/contracts/delivery.js +6 -0
- package/dist/contracts/events.d.ts +2 -1
- package/dist/contracts/events.js +4 -2
- package/dist/contracts/experiments.d.ts +4 -2
- package/dist/contracts/experiments.js +7 -3
- package/dist/contracts/identity.d.ts +6 -1
- package/dist/contracts/identity.js +5 -4
- package/dist/contracts/integrations.d.ts +66 -2
- package/dist/contracts/integrations.js +32 -5
- package/dist/contracts/metrics.d.ts +6 -1
- package/dist/contracts/metrics.js +8 -2
- package/dist/contracts/outbound.d.ts +25 -0
- package/dist/contracts/outbound.js +14 -5
- package/dist/contracts/pickers.d.ts +1 -1
- package/dist/contracts/pickers.js +1 -1
- package/dist/contracts/platform-admin.d.ts +14 -0
- package/dist/contracts/platform-admin.js +7 -0
- package/dist/contracts/segments.d.ts +5 -0
- package/dist/contracts/segments.js +8 -3
- package/dist/contracts/workflow-nodes.d.ts +12 -0
- package/dist/contracts/workflow-nodes.js +5 -0
- package/dist/contracts/workflows.d.ts +398 -0
- package/dist/contracts/workflows.js +11 -2
- package/dist/index.d.ts +126 -2
- package/dist/resources.d.ts +20 -0
- package/dist/x10.d.ts +1 -0
- package/dist/z10.d.ts +5 -0
- package/package.json +1 -1
package/dist/contracts/auth.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const WorkspaceDto: z.ZodObject<{
|
|
|
34
34
|
organizationId: z.ZodUUID;
|
|
35
35
|
name: z.ZodString;
|
|
36
36
|
timezone: z.ZodString;
|
|
37
|
+
defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
37
38
|
locale: z.ZodString;
|
|
38
39
|
postalAddress: z.ZodNullable<z.ZodString>;
|
|
39
40
|
adminEmail: z.ZodNullable<z.ZodString>;
|
|
@@ -59,6 +60,7 @@ export declare const Currency: z.ZodString;
|
|
|
59
60
|
export declare const WorkspacePatch: z.ZodObject<{
|
|
60
61
|
name: z.ZodOptional<z.ZodString>;
|
|
61
62
|
timezone: z.ZodOptional<z.ZodString>;
|
|
63
|
+
defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
64
|
locale: z.ZodOptional<z.ZodString>;
|
|
63
65
|
postalAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
66
|
adminEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
@@ -67,11 +69,7 @@ export declare const WorkspacePatch: z.ZodObject<{
|
|
|
67
69
|
start: z.ZodString;
|
|
68
70
|
end: z.ZodString;
|
|
69
71
|
}, z.core.$strip>>;
|
|
70
|
-
quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.
|
|
71
|
-
email: "email";
|
|
72
|
-
push: "push";
|
|
73
|
-
whatsapp: "whatsapp";
|
|
74
|
-
}> & z.core.$partial, z.ZodObject<{
|
|
72
|
+
quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
75
73
|
start: z.ZodString;
|
|
76
74
|
end: z.ZodString;
|
|
77
75
|
}, z.core.$strip>>>;
|
|
@@ -114,6 +112,7 @@ export declare const AuthResult: z.ZodObject<{
|
|
|
114
112
|
organizationId: z.ZodUUID;
|
|
115
113
|
name: z.ZodString;
|
|
116
114
|
timezone: z.ZodString;
|
|
115
|
+
defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
117
116
|
locale: z.ZodString;
|
|
118
117
|
postalAddress: z.ZodNullable<z.ZodString>;
|
|
119
118
|
adminEmail: z.ZodNullable<z.ZodString>;
|
|
@@ -154,6 +153,7 @@ export declare const MeResult: z.ZodObject<{
|
|
|
154
153
|
viewer: "viewer";
|
|
155
154
|
}>>;
|
|
156
155
|
scopes: z.ZodArray<z.ZodString>;
|
|
156
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
157
|
}, z.core.$strip>;
|
|
158
158
|
user: z.ZodNullable<z.ZodObject<{
|
|
159
159
|
id: z.ZodUUID;
|
|
@@ -199,11 +199,13 @@ export declare const ApiKeyCreate: z.ZodObject<{
|
|
|
199
199
|
allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
200
200
|
allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
201
201
|
rateLimitPerMin: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
202
203
|
expiresAt: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
203
204
|
}, z.core.$strip>;
|
|
204
205
|
/** Change a live key's own rate budget; null drops it back to the default limit. */
|
|
205
206
|
export declare const ApiKeyUpdate: z.ZodObject<{
|
|
206
|
-
rateLimitPerMin: z.ZodNullable<z.ZodNumber
|
|
207
|
+
rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
208
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
209
|
}, z.core.$strip>;
|
|
208
210
|
export declare const ApiKeyDto: z.ZodObject<{
|
|
209
211
|
id: z.ZodUUID;
|
|
@@ -219,6 +221,7 @@ export declare const ApiKeyDto: z.ZodObject<{
|
|
|
219
221
|
allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
222
|
allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
223
|
rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
224
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
225
|
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
223
226
|
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
224
227
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
@@ -239,6 +242,7 @@ export declare const ApiKeyCreated: z.ZodObject<{
|
|
|
239
242
|
allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
240
243
|
allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
241
244
|
rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
245
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
242
246
|
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
243
247
|
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
244
248
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
package/dist/contracts/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Id, Timestamp, TimestampIn } from './common.js';
|
|
2
|
+
import { AppSlug, Id, Timestamp, TimestampIn } from './common.js';
|
|
3
3
|
export const Role = z.enum(['owner', 'admin', 'marketer', 'sales', 'analyst', 'viewer']);
|
|
4
4
|
export const ApiKeyKind = z.enum(['secret', 'site']);
|
|
5
5
|
const Hhmm = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
|
|
@@ -12,6 +12,7 @@ export const WorkspaceDto = z.object({
|
|
|
12
12
|
organizationId: Id,
|
|
13
13
|
name: z.string(),
|
|
14
14
|
timezone: z.string(),
|
|
15
|
+
defaultSendHour: z.number().int().nullable().optional(),
|
|
15
16
|
locale: z.string(),
|
|
16
17
|
postalAddress: z.string().nullable(),
|
|
17
18
|
adminEmail: z.string().nullable(),
|
|
@@ -31,13 +32,18 @@ export const Currency = z.string().regex(/^[A-Z]{3}$/, 'Use a 3-letter currency
|
|
|
31
32
|
export const WorkspacePatch = z.object({
|
|
32
33
|
name: z.string().min(1).max(120).optional(),
|
|
33
34
|
timezone: z.string().max(64).optional(),
|
|
35
|
+
/** Local hour (0-23) optimized sends use when there is too little engagement data; null = 10. */
|
|
36
|
+
defaultSendHour: z.number().int().min(0).max(23).nullable().optional(),
|
|
34
37
|
locale: z.string().min(2).max(16).optional(),
|
|
35
38
|
postalAddress: z.string().max(500).nullable().optional(),
|
|
36
39
|
adminEmail: z.email().nullable().optional(),
|
|
37
40
|
unsubscribeRedirectUrl: z.url({ protocol: /^https$/ }).nullable().optional(),
|
|
38
41
|
quietHours: z.object({ start: Hhmm, end: Hhmm }).optional(),
|
|
39
|
-
/**
|
|
40
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Replaces `quietHours` for one channel (`email`), or for one channel's recipients in one country (`email:DE`, ISO code; wins over the
|
|
44
|
+
* channel's own). Omit a key to fall back. SMS uses its own sending hours and country rules.
|
|
45
|
+
*/
|
|
46
|
+
quietHoursByChannel: z.record(z.string().regex(/^(email|whatsapp|push)(:[A-Z]{2})?$/, 'Use email, whatsapp or push, optionally with a country: email:DE'), z.object({ start: Hhmm, end: Hhmm })).optional(),
|
|
41
47
|
apiKeyExpiryDays: z.number().int().min(1).max(730).nullable().optional(),
|
|
42
48
|
displayCurrency: Currency.optional(),
|
|
43
49
|
fxRates: z.record(Currency, z.number().positive().max(1_000_000)).optional(),
|
|
@@ -51,7 +57,7 @@ export const DevLoginBody = z.object({ email: z.email().max(254), name: z.string
|
|
|
51
57
|
export const AuthResult = z.object({ user: UserDto, workspace: WorkspaceDto.nullable(), expiresAt: Timestamp.nullable() });
|
|
52
58
|
export const LogoutResult = z.object({ ok: z.literal(true), /** Atlas end-session URL the browser should visit next (null without Atlas). */ redirectTo: z.string().nullable() });
|
|
53
59
|
export const MeResult = z.object({
|
|
54
|
-
actor: z.object({ type: z.string(), id: z.string(), workspaceId: Id, role: Role.optional(), scopes: z.array(z.string()) }),
|
|
60
|
+
actor: z.object({ type: z.string(), id: z.string(), workspaceId: Id, role: Role.optional(), scopes: z.array(z.string()), /** API key bound to one product: it only sees that app's topics, lists, segments, fields and webhooks. */ app: z.string().nullable().optional() }),
|
|
55
61
|
user: UserDto.nullable(),
|
|
56
62
|
workspaces: z.array(z.object({ id: Id, name: z.string(), role: Role })),
|
|
57
63
|
/** Set while an owner is viewing the app as this user. */
|
|
@@ -72,11 +78,13 @@ export const ApiKeyCreate = z.object({
|
|
|
72
78
|
allowedSequenceIds: z.array(z.uuid()).max(50).optional(),
|
|
73
79
|
/** Optional cap on requests per minute for this key; over it the API answers 429. */
|
|
74
80
|
rateLimitPerMin: z.number().int().min(1).max(100_000).optional(),
|
|
81
|
+
/** Secret keys: bind the key to one product (app slug) that shares this workspace. It then sees and creates only that app's topics, lists, segments, fields and webhook endpoints. */
|
|
82
|
+
app: AppSlug.nullish(),
|
|
75
83
|
/** Optional expiry; after it the key answers 401 like a revoked one. */
|
|
76
84
|
expiresAt: TimestampIn.optional(),
|
|
77
85
|
});
|
|
78
86
|
/** Change a live key's own rate budget; null drops it back to the default limit. */
|
|
79
|
-
export const ApiKeyUpdate = z.object({ rateLimitPerMin: z.number().int().min(1).max(100_000).nullable() });
|
|
87
|
+
export const ApiKeyUpdate = z.object({ rateLimitPerMin: z.number().int().min(1).max(100_000).nullable().optional(), /** Bind to an app slug, or null to unbind (secret keys only). */ app: AppSlug.nullable().optional() });
|
|
80
88
|
export const ApiKeyDto = z.object({
|
|
81
89
|
id: Id,
|
|
82
90
|
name: z.string(),
|
|
@@ -88,6 +96,7 @@ export const ApiKeyDto = z.object({
|
|
|
88
96
|
allowedConnectionIds: z.array(z.string()).optional(),
|
|
89
97
|
allowedSequenceIds: z.array(z.string()).optional(),
|
|
90
98
|
rateLimitPerMin: z.number().int().nullable().optional(),
|
|
99
|
+
app: z.string().nullable().optional(),
|
|
91
100
|
lastUsedAt: Timestamp.nullable(),
|
|
92
101
|
revokedAt: Timestamp.nullable(),
|
|
93
102
|
expiresAt: Timestamp.nullable().optional(),
|
|
@@ -136,6 +136,8 @@ export declare const PayoutAccountDto: z.ZodObject<{
|
|
|
136
136
|
payoutsEnabled: z.ZodBoolean;
|
|
137
137
|
detailsSubmitted: z.ZodBoolean;
|
|
138
138
|
}, z.core.$strip>;
|
|
139
|
+
/** `country` (ISO code) of the writer's payout account, asked before the account exists; another country than the platform's gets Stripe's recipient agreement. */
|
|
139
140
|
export declare const PayoutOnboardBody: z.ZodObject<{
|
|
140
141
|
returnUrl: z.ZodURL;
|
|
142
|
+
country: z.ZodOptional<z.ZodString>;
|
|
141
143
|
}, z.core.$strip>;
|
|
@@ -28,4 +28,5 @@ export const UrlResult = z.object({ url: z.string() });
|
|
|
28
28
|
export const MyReferralDto = z.object({ enabled: z.boolean(), code: z.string().nullable(), link: z.string().nullable(), terms: z.record(z.string(), z.string()).nullable() });
|
|
29
29
|
/** Stripe Connect payouts (boost bounties, ad network earnings). `configured` false = no platform Stripe account: everything is settled by hand. */
|
|
30
30
|
export const PayoutAccountDto = z.object({ configured: z.boolean(), started: z.boolean(), payoutsEnabled: z.boolean(), detailsSubmitted: z.boolean() });
|
|
31
|
-
|
|
31
|
+
/** `country` (ISO code) of the writer's payout account, asked before the account exists; another country than the platform's gets Stripe's recipient agreement. */
|
|
32
|
+
export const PayoutOnboardBody = z.object({ returnUrl: z.url(), country: z.string().trim().length(2).toUpperCase().optional() });
|
|
@@ -222,6 +222,7 @@ export declare const CreateCampaignBody: z.ZodObject<{
|
|
|
222
222
|
}>;
|
|
223
223
|
}, z.core.$strip>>>;
|
|
224
224
|
smartAudience: z.ZodOptional<z.ZodBoolean>;
|
|
225
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
226
|
}, z.core.$strip>;
|
|
226
227
|
export type CreateCampaignBody = z.input<typeof CreateCampaignBody>;
|
|
227
228
|
/** Explicit (no defaults): a PATCH must only touch the fields it names. */
|
|
@@ -326,6 +327,7 @@ export declare const UpdateCampaignBody: z.ZodObject<{
|
|
|
326
327
|
}>;
|
|
327
328
|
}, z.core.$strip>>>;
|
|
328
329
|
smartAudience: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
329
331
|
}, z.core.$strip>;
|
|
330
332
|
/** Planning details, editable at any status. Dates are calendar days; the campaign's real send time is its schedule. */
|
|
331
333
|
export declare const CampaignDetailsBody: z.ZodObject<{
|
|
@@ -498,6 +500,7 @@ export declare const CampaignDto: z.ZodObject<{
|
|
|
498
500
|
}, z.core.$strip>>>;
|
|
499
501
|
failureReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
500
502
|
smartAudience: z.ZodOptional<z.ZodBoolean>;
|
|
503
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
501
504
|
createdAt: z.ZodISODateTime;
|
|
502
505
|
updatedAt: z.ZodISODateTime;
|
|
503
506
|
}, z.core.$strip>;
|
|
@@ -646,6 +649,7 @@ export declare const CampaignPage: z.ZodObject<{
|
|
|
646
649
|
}, z.core.$strip>>>;
|
|
647
650
|
failureReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
648
651
|
smartAudience: z.ZodOptional<z.ZodBoolean>;
|
|
652
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
649
653
|
createdAt: z.ZodISODateTime;
|
|
650
654
|
updatedAt: z.ZodISODateTime;
|
|
651
655
|
}, z.core.$strip>>;
|
|
@@ -655,15 +659,7 @@ export declare const CampaignPage: z.ZodObject<{
|
|
|
655
659
|
export declare const CampaignListQuery: z.ZodObject<{
|
|
656
660
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
657
661
|
cursor: z.ZodOptional<z.ZodUUID>;
|
|
658
|
-
status: z.ZodOptional<z.
|
|
659
|
-
cancelled: "cancelled";
|
|
660
|
-
completed: "completed";
|
|
661
|
-
draft: "draft";
|
|
662
|
-
failed: "failed";
|
|
663
|
-
paused: "paused";
|
|
664
|
-
scheduled: "scheduled";
|
|
665
|
-
sending: "sending";
|
|
666
|
-
}>>;
|
|
662
|
+
status: z.ZodOptional<z.ZodString>;
|
|
667
663
|
q: z.ZodOptional<z.ZodString>;
|
|
668
664
|
channel: z.ZodOptional<z.ZodEnum<{
|
|
669
665
|
email: "email";
|
|
@@ -679,6 +675,7 @@ export declare const CampaignListQuery: z.ZodObject<{
|
|
|
679
675
|
transactional: "transactional";
|
|
680
676
|
}>>;
|
|
681
677
|
folderId: z.ZodOptional<z.ZodUUID>;
|
|
678
|
+
app: z.ZodOptional<z.ZodString>;
|
|
682
679
|
tag: z.ZodOptional<z.ZodString>;
|
|
683
680
|
listId: z.ZodOptional<z.ZodUUID>;
|
|
684
681
|
from: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Channel, DateTimeIn, Id, PageQuery, Purpose, ReplyToList, Timestamp, pageResult } from './common.js';
|
|
2
|
+
import { AppSlug, Channel, DateTimeIn, Id, PageQuery, Purpose, ReplyToList, Timestamp, pageResult } from './common.js';
|
|
3
3
|
import { AbTestConfig } from './experiments.js';
|
|
4
4
|
import { PushTestTarget } from './push.js';
|
|
5
5
|
import { MetricCounts, AvailabilityMap } from './analytics.js';
|
|
@@ -98,6 +98,8 @@ export const CreateCampaignBody = z.object({
|
|
|
98
98
|
reviewDeadline: ReviewDeadline.nullish(),
|
|
99
99
|
/** Smart audience: at send time, leave out people predicted to unsubscribe or complain (past complaint, or long unengaged). */
|
|
100
100
|
smartAudience: z.boolean().optional(),
|
|
101
|
+
/** Product (app slug) that owns the campaign; an app-bound API key stamps its own. Its messages carry `app:<slug>`, so webhook endpoints of other apps skip their events. */
|
|
102
|
+
app: AppSlug.nullish(),
|
|
101
103
|
});
|
|
102
104
|
/** Explicit (no defaults): a PATCH must only touch the fields it names. */
|
|
103
105
|
export const UpdateCampaignBody = z.object({
|
|
@@ -119,6 +121,8 @@ export const UpdateCampaignBody = z.object({
|
|
|
119
121
|
reviewDrafts: z.boolean().optional(),
|
|
120
122
|
reviewDeadline: ReviewDeadline.nullish(),
|
|
121
123
|
smartAudience: z.boolean().optional(),
|
|
124
|
+
/** Move the campaign to another product (app slug), or null to share it. App-bound keys cannot. */
|
|
125
|
+
app: AppSlug.nullable().optional(),
|
|
122
126
|
});
|
|
123
127
|
/** Planning details, editable at any status. Dates are calendar days; the campaign's real send time is its schedule. */
|
|
124
128
|
export const CampaignDetailsBody = z.object({
|
|
@@ -176,6 +180,7 @@ export const CampaignDto = z.object({
|
|
|
176
180
|
/** Why fan-out failed (status `failed`). */
|
|
177
181
|
failureReason: z.string().nullish(),
|
|
178
182
|
smartAudience: z.boolean().optional(),
|
|
183
|
+
app: z.string().nullable().optional(),
|
|
179
184
|
createdAt: Timestamp,
|
|
180
185
|
updatedAt: Timestamp,
|
|
181
186
|
});
|
|
@@ -183,11 +188,13 @@ export const CampaignEraseResult = z.object({ outcome: z.enum(['deleted', 'conte
|
|
|
183
188
|
export const CampaignPage = pageResult(CampaignDto);
|
|
184
189
|
/** Shared by the list and search routes. `q` matches name, message subject and message content. */
|
|
185
190
|
export const CampaignListQuery = PageQuery.extend({
|
|
186
|
-
status
|
|
191
|
+
/** One status or a comma-separated list (`failed,paused,sending`). */
|
|
192
|
+
status: z.string().max(120).refine((s) => s.split(',').every((x) => CampaignStatus.safeParse(x).success), { message: `Each status must be one of ${CampaignStatus.options.join(', ')}` }).optional(),
|
|
187
193
|
q: z.string().max(200).optional(),
|
|
188
194
|
channel: Channel.optional(),
|
|
189
195
|
purpose: Purpose.optional(),
|
|
190
196
|
folderId: Id.optional(),
|
|
197
|
+
app: AppSlug.optional(),
|
|
191
198
|
tag: z.string().max(80).optional(),
|
|
192
199
|
listId: Id.optional(),
|
|
193
200
|
/** Created-at range. */
|
|
@@ -498,6 +498,7 @@ export declare const EligibilityRequest: z.ZodObject<{
|
|
|
498
498
|
topicId: z.ZodOptional<z.ZodUUID>;
|
|
499
499
|
destination: z.ZodString;
|
|
500
500
|
recipientCountry: z.ZodOptional<z.ZodString>;
|
|
501
|
+
sequenceId: z.ZodOptional<z.ZodUUID>;
|
|
501
502
|
}, z.core.$strip>;
|
|
502
503
|
export type EligibilityRequest = z.infer<typeof EligibilityRequest>;
|
|
503
504
|
/** `liaId`: the legitimate-interest assessment that lifted this prospecting send's jurisdiction block. */
|
|
@@ -577,6 +578,19 @@ export declare const LiaInput: z.ZodObject<{
|
|
|
577
578
|
balancingTest: z.ZodString;
|
|
578
579
|
optOutWording: z.ZodString;
|
|
579
580
|
countries: z.ZodArray<z.ZodString>;
|
|
581
|
+
sequenceIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
582
|
+
segmentIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
583
|
+
reviewAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
584
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
585
|
+
documentAssetId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
586
|
+
}, z.core.$strip>;
|
|
587
|
+
/** Scope, dates and document of a recorded assessment; the assessment text itself is evidence and does not change (record a new one). */
|
|
588
|
+
export declare const LiaPatch: z.ZodObject<{
|
|
589
|
+
sequenceIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
590
|
+
segmentIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
591
|
+
reviewAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
592
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
593
|
+
documentAssetId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
580
594
|
}, z.core.$strip>;
|
|
581
595
|
export declare const LiaDto: z.ZodObject<{
|
|
582
596
|
id: z.ZodUUID;
|
|
@@ -587,6 +601,11 @@ export declare const LiaDto: z.ZodObject<{
|
|
|
587
601
|
assessedBy: z.ZodNullable<z.ZodUUID>;
|
|
588
602
|
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
589
603
|
createdAt: z.ZodISODateTime;
|
|
604
|
+
sequenceIds: z.ZodArray<z.ZodUUID>;
|
|
605
|
+
segmentIds: z.ZodArray<z.ZodUUID>;
|
|
606
|
+
reviewAt: z.ZodNullable<z.ZodISODateTime>;
|
|
607
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
608
|
+
documentAssetId: z.ZodNullable<z.ZodUUID>;
|
|
590
609
|
}, z.core.$strip>;
|
|
591
610
|
export declare const LiaList: z.ZodObject<{
|
|
592
611
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -598,6 +617,11 @@ export declare const LiaList: z.ZodObject<{
|
|
|
598
617
|
assessedBy: z.ZodNullable<z.ZodUUID>;
|
|
599
618
|
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
600
619
|
createdAt: z.ZodISODateTime;
|
|
620
|
+
sequenceIds: z.ZodArray<z.ZodUUID>;
|
|
621
|
+
segmentIds: z.ZodArray<z.ZodUUID>;
|
|
622
|
+
reviewAt: z.ZodNullable<z.ZodISODateTime>;
|
|
623
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
624
|
+
documentAssetId: z.ZodNullable<z.ZodUUID>;
|
|
601
625
|
}, z.core.$strip>>;
|
|
602
626
|
blockedCountries: z.ZodArray<z.ZodString>;
|
|
603
627
|
unlockableCountries: z.ZodArray<z.ZodString>;
|
|
@@ -32,7 +32,7 @@ export const ConsentInputBody = z.object({
|
|
|
32
32
|
disclosureVersion: z.string().max(64).nullish(),
|
|
33
33
|
ip: z.string().max(64).nullish(),
|
|
34
34
|
userAgent: z.string().max(512).nullish(),
|
|
35
|
-
proof: z.record(z.string(), z.unknown()).nullish(),
|
|
35
|
+
proof: z.record(z.string(), z.unknown()).nullish().describe('From an API key, a proof source needs evidence: form → formSubmissionId; double_opt_in / sms_keyword → consentRecordId of that flow'),
|
|
36
36
|
expiresAt: DateTimeIn().nullish(),
|
|
37
37
|
revocationScope: RevocationScope.nullish(),
|
|
38
38
|
});
|
|
@@ -153,6 +153,8 @@ export const EligibilityRequest = z.object({
|
|
|
153
153
|
topicId: Id.optional(),
|
|
154
154
|
destination: z.string().min(1).max(320),
|
|
155
155
|
recipientCountry: z.string().length(2).optional(),
|
|
156
|
+
/** Outbound sequence the send belongs to: a legitimate-interest assessment scoped to it may lift a jurisdiction block. */
|
|
157
|
+
sequenceId: Id.optional(),
|
|
156
158
|
});
|
|
157
159
|
/** `liaId`: the legitimate-interest assessment that lifted this prospecting send's jurisdiction block. */
|
|
158
160
|
export const Eligibility = z.object({ eligible: z.boolean(), reasons: z.array(BlockReason), liaId: z.string().optional() });
|
|
@@ -172,9 +174,21 @@ export const LiaInput = z.object({
|
|
|
172
174
|
balancingTest: z.string().trim().min(10).max(8000),
|
|
173
175
|
optOutWording: z.string().trim().min(5).max(1000),
|
|
174
176
|
countries: z.array(z.string().length(2)).min(1).max(40),
|
|
177
|
+
/** Limit it to these outbound sequences and/or profiles in these segments; both empty = every prospecting path. */
|
|
178
|
+
sequenceIds: z.array(Id).max(50).optional(), segmentIds: z.array(Id).max(50).optional(),
|
|
179
|
+
/** When to look at it again (a reminder, not enforced) and when it stops unlocking anything. */
|
|
180
|
+
reviewAt: DateTimeIn().nullable().optional(), expiresAt: DateTimeIn().nullable().optional(),
|
|
181
|
+
/** The full assessment document: a file in the content library. */
|
|
182
|
+
documentAssetId: Id.nullable().optional(),
|
|
183
|
+
});
|
|
184
|
+
/** Scope, dates and document of a recorded assessment; the assessment text itself is evidence and does not change (record a new one). */
|
|
185
|
+
export const LiaPatch = z.object({
|
|
186
|
+
sequenceIds: z.array(Id).max(50).optional(), segmentIds: z.array(Id).max(50).optional(),
|
|
187
|
+
reviewAt: DateTimeIn().nullable().optional(), expiresAt: DateTimeIn().nullable().optional(), documentAssetId: Id.nullable().optional(),
|
|
175
188
|
});
|
|
176
189
|
export const LiaDto = z.object({
|
|
177
190
|
id: Id, purpose: z.string(), balancingTest: z.string(), optOutWording: z.string(), countries: z.array(z.string()),
|
|
178
191
|
assessedBy: Id.nullable(), revokedAt: Timestamp.nullable(), createdAt: Timestamp,
|
|
192
|
+
sequenceIds: z.array(Id), segmentIds: z.array(Id), reviewAt: Timestamp.nullable(), expiresAt: Timestamp.nullable(), documentAssetId: Id.nullable(),
|
|
179
193
|
});
|
|
180
194
|
export const LiaList = z.object({ items: z.array(LiaDto), blockedCountries: z.array(z.string()), unlockableCountries: z.array(z.string()) });
|
|
@@ -35,7 +35,9 @@ export const Block = z.lazy(() => z.discriminatedUnion('type', [
|
|
|
35
35
|
// `to`: ISO-8601 instant. Sends show a live timer image (`/t/cd/<signed>.gif`, drawn at open time with these colours, size and zone label); the text computed at render is its alt and the fallback.
|
|
36
36
|
z.object({ ...base, type: z.literal('countdown'), to: z.iso.datetime({ offset: true }), label: z.string().max(100).optional(), expiredText: z.string().max(200).optional(),
|
|
37
37
|
color: z.string().regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/).optional(), background: z.string().regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/).optional(),
|
|
38
|
-
fontSize: z.number().int().min(10).max(70).optional(), width: z.number().int().min(120).max(600).optional(), zone: z.string().regex(/^[A-Za-z0-9 :+/.-]{1,24}$/).optional()
|
|
38
|
+
fontSize: z.number().int().min(10).max(70).optional(), width: z.number().int().min(120).max(600).optional(), zone: z.string().regex(/^[A-Za-z0-9 :+/.-]{1,24}$/).optional(),
|
|
39
|
+
/** Words under the days, hours, minutes and seconds digits of the timer image (A-Z and 0-9 drawn; accents dropped; about 5 letters fit). */
|
|
40
|
+
unitLabels: z.array(z.string().max(12)).length(4).optional() }),
|
|
39
41
|
z.object({ ...base, type: z.literal('saved'), sectionId: z.uuid() }),
|
|
40
42
|
// Video thumbnail: email clients cannot play video, so a still image links out to the video page.
|
|
41
43
|
z.object({ ...base, type: z.literal('video'), thumbnail: z.string().max(2048), href: z.string().max(2048), alt: z.string().max(500).optional(), width: z.number().int().min(1).max(1200).optional(), label: z.string().max(100).optional() }),
|
|
@@ -47,7 +49,7 @@ export const Block = z.lazy(() => z.discriminatedUnion('type', [
|
|
|
47
49
|
z.object({ ...base, type: z.literal('poll'), pollId: z.uuid(), question: z.string().max(500), options: z.array(z.object({ id: z.string().regex(/^[a-z0-9_-]{1,40}$/), label: z.string().max(200) })).min(2).max(20) }),
|
|
48
50
|
// Sponsor ad: `slot` is filled with a booked or network ad at send/render time (sponsorships module); the other fields hold the ad itself. Renders nothing without headline and href.
|
|
49
51
|
z.object({ ...base, type: z.literal('sponsor'), slot: z.string().regex(/^[a-z0-9_-]{1,32}$/).optional(), sponsor: z.string().max(200).optional(), headline: z.string().max(200).optional(), body: z.string().max(1000).optional(), imageUrl: z.string().max(2048).optional(), href: z.string().max(2048).optional(), cta: z.string().max(60).optional() }),
|
|
50
|
-
]));
|
|
52
|
+
])).meta({ id: 'Block' }); // recursive: an `id` makes it one OpenAPI component instead of a dangling `$ref`
|
|
51
53
|
/** A language variant: replaces the base blocks (and optionally subject/preheader) for recipients whose locale matches the key (`fr`, `pt-BR`). */
|
|
52
54
|
export const Translation = z.object({ subject: z.string().max(998).optional(), preheader: z.string().max(500).optional(), blocks: z.array(Block).max(100) });
|
|
53
55
|
export const LOCALE_RE = /^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/;
|
|
@@ -57,4 +59,4 @@ export const BlockDoc = z.object({
|
|
|
57
59
|
background: Color.optional(),
|
|
58
60
|
blocks: z.array(Block).max(100),
|
|
59
61
|
translations: z.record(z.string().regex(LOCALE_RE), Translation).optional(),
|
|
60
|
-
});
|
|
62
|
+
}).meta({ title: 'BlockDoc' });
|
|
@@ -98,6 +98,9 @@ export declare const AssetDto: z.ZodObject<{
|
|
|
98
98
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
99
|
scanStatus: z.ZodDefault<z.ZodEnum<{
|
|
100
100
|
clean: "clean";
|
|
101
|
+
error: "error";
|
|
102
|
+
infected: "infected";
|
|
103
|
+
pending: "pending";
|
|
101
104
|
quarantined: "quarantined";
|
|
102
105
|
unscanned: "unscanned";
|
|
103
106
|
}>>;
|
|
@@ -184,6 +187,9 @@ export declare const AssetPage: z.ZodObject<{
|
|
|
184
187
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
188
|
scanStatus: z.ZodDefault<z.ZodEnum<{
|
|
186
189
|
clean: "clean";
|
|
190
|
+
error: "error";
|
|
191
|
+
infected: "infected";
|
|
192
|
+
pending: "pending";
|
|
187
193
|
quarantined: "quarantined";
|
|
188
194
|
unscanned: "unscanned";
|
|
189
195
|
}>>;
|
|
@@ -219,6 +225,7 @@ export declare const TrackingDomainDto: z.ZodObject<{
|
|
|
219
225
|
}>;
|
|
220
226
|
certCheckedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
221
227
|
certError: z.ZodNullable<z.ZodString>;
|
|
228
|
+
certExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
222
229
|
}, z.core.$strip>;
|
|
223
230
|
export declare const TrackingDomainPage: z.ZodObject<{
|
|
224
231
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -241,6 +248,7 @@ export declare const TrackingDomainPage: z.ZodObject<{
|
|
|
241
248
|
}>;
|
|
242
249
|
certCheckedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
243
250
|
certError: z.ZodNullable<z.ZodString>;
|
|
251
|
+
certExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
244
252
|
}, z.core.$strip>>;
|
|
245
253
|
nextCursor: z.ZodNullable<z.ZodUUID>;
|
|
246
254
|
}, z.core.$strip>;
|
|
@@ -12,7 +12,7 @@ export const AssetAccess = z.enum(['public_indexable', 'public_not_indexable', '
|
|
|
12
12
|
export const ContentSettingsDto = z.object({ approvalRequired: z.boolean(), campaignApprovalRequired: z.boolean().default(false), transactionalPromo: z.enum(['warn', 'block']).default('warn'), uploadTypes: z.array(UploadTypeGroup).max(7).default(['image', 'pdf', 'video']), defaultAssetAccess: AssetAccess.default('public_indexable') });
|
|
13
13
|
export const ContentSettingsPatch = z.object({ approvalRequired: z.boolean(), campaignApprovalRequired: z.boolean(), transactionalPromo: z.enum(['warn', 'block']), uploadTypes: z.array(UploadTypeGroup).max(7), defaultAssetAccess: AssetAccess }).partial();
|
|
14
14
|
export const AssetDto = z.object({
|
|
15
|
-
id: Id, filename: z.string(), contentType: z.string(), bytes: z.number(), width: z.number(), height: z.number(), url: z.string(), thumbUrl: z.string().nullable().default(null), altText: z.string().nullable(), folderId: Id.nullable(), language: z.string().nullable(), tags: z.array(z.string()).default([]), scanStatus: z.enum(['unscanned', 'clean', 'quarantined']).default('unscanned'), access: AssetAccess.default('public_indexable'), createdAt: Timestamp,
|
|
15
|
+
id: Id, filename: z.string(), contentType: z.string(), bytes: z.number(), width: z.number(), height: z.number(), url: z.string(), thumbUrl: z.string().nullable().default(null), altText: z.string().nullable(), folderId: Id.nullable(), language: z.string().nullable(), tags: z.array(z.string()).default([]), scanStatus: z.enum(['unscanned', 'clean', 'quarantined', 'pending', 'infected', 'error']).default('unscanned'), access: AssetAccess.default('public_indexable'), createdAt: Timestamp,
|
|
16
16
|
});
|
|
17
17
|
export const FolderDto = z.object({ id: Id, kind: z.enum(['template', 'asset']), name: z.string(), parentId: Id.nullable(), itemCount: z.number(), createdAt: Timestamp });
|
|
18
18
|
export const FolderInput = z.object({ name: z.string().trim().min(1).max(200), parentId: Id.nullable().optional() });
|
|
@@ -29,6 +29,8 @@ export const TrackingDomainDto = z.object({
|
|
|
29
29
|
lastCheckedAt: Timestamp.nullable(), lastError: z.string().nullable(), createdAt: Timestamp,
|
|
30
30
|
/** HTTPS certificate on the host. Links use https only once `issued`; until then they go out over http. */
|
|
31
31
|
certStatus: z.enum(['pending', 'issued', 'failed']), certCheckedAt: Timestamp.nullable(), certError: z.string().nullable(),
|
|
32
|
+
/** Expiry of the certificate the last successful probe saw (the proxy renews it automatically). */
|
|
33
|
+
certExpiresAt: Timestamp.nullable().optional(),
|
|
32
34
|
});
|
|
33
35
|
export const TrackingDomainPage = pageResult(TrackingDomainDto);
|
|
34
36
|
export const LinkCheckDto = z.object({ url: z.string(), status: z.number().nullable(), error: z.string().nullable(), checkedAt: Timestamp });
|
|
@@ -194,6 +194,7 @@ export declare const TemplateDto: z.ZodObject<{
|
|
|
194
194
|
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
195
195
|
topicId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
196
196
|
createdBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
app: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
197
198
|
createdAt: z.ZodISODateTime;
|
|
198
199
|
updatedAt: z.ZodISODateTime;
|
|
199
200
|
}, z.core.$strip>;
|
|
@@ -223,6 +224,7 @@ export declare const TemplateWithVersion: z.ZodObject<{
|
|
|
223
224
|
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
224
225
|
topicId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
225
226
|
createdBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
app: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
226
228
|
createdAt: z.ZodISODateTime;
|
|
227
229
|
updatedAt: z.ZodISODateTime;
|
|
228
230
|
currentVersion: z.ZodNullable<z.ZodObject<{
|
|
@@ -312,6 +314,7 @@ export declare const CreateTemplateBody: z.ZodObject<{
|
|
|
312
314
|
folderId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
313
315
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
314
316
|
topicId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
317
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
318
|
version: z.ZodOptional<z.ZodObject<{
|
|
316
319
|
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
317
320
|
kind: z.ZodLiteral<"blocks">;
|
|
@@ -379,6 +382,7 @@ export declare const UpdateTemplateBody: z.ZodObject<{
|
|
|
379
382
|
brandKitId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
380
383
|
topicId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
381
384
|
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
382
386
|
}, z.core.$strip>;
|
|
383
387
|
export declare const ListTemplatesQuery: z.ZodObject<{
|
|
384
388
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -405,6 +409,7 @@ export declare const ListTemplatesQuery: z.ZodObject<{
|
|
|
405
409
|
sms: "sms";
|
|
406
410
|
text: "text";
|
|
407
411
|
}>>;
|
|
412
|
+
app: z.ZodOptional<z.ZodString>;
|
|
408
413
|
createdAfter: z.ZodOptional<z.ZodISODateTime>;
|
|
409
414
|
createdBefore: z.ZodOptional<z.ZodISODateTime>;
|
|
410
415
|
sort: z.ZodDefault<z.ZodEnum<{
|
|
@@ -442,6 +447,7 @@ export declare const TemplatePage: z.ZodObject<{
|
|
|
442
447
|
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
443
448
|
topicId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
444
449
|
createdBy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
450
|
+
app: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
445
451
|
createdAt: z.ZodISODateTime;
|
|
446
452
|
updatedAt: z.ZodISODateTime;
|
|
447
453
|
}, z.core.$strip>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Channel, Id, Purpose, PageQuery, ReplyToList, Timestamp, pageResult } from './common.js';
|
|
2
|
+
import { AppSlug, Channel, Id, Purpose, PageQuery, ReplyToList, Timestamp, pageResult } from './common.js';
|
|
3
3
|
import { Block, BlockDoc } from './content-blocks.js';
|
|
4
4
|
import { LintResult } from './content-library.js';
|
|
5
5
|
import { RcsContent } from './rcs.js';
|
|
@@ -40,7 +40,7 @@ export const TemplateVersionDto = z.object({
|
|
|
40
40
|
});
|
|
41
41
|
export const TemplateDto = z.object({
|
|
42
42
|
id: Id, workspaceId: Id, channel: Channel, name: z.string(), kind: TemplateKind, folder: z.string().nullable(), tags: z.array(z.string()),
|
|
43
|
-
currentVersionId: Id.nullable(), archived: z.boolean(), folderId: Id.nullable(), brandKitId: Id.nullable(), isDefault: z.boolean().default(false), topicId: Id.nullable().default(null), createdBy: z.string().nullable().default(null), createdAt: Timestamp, updatedAt: Timestamp,
|
|
43
|
+
currentVersionId: Id.nullable(), archived: z.boolean(), folderId: Id.nullable(), brandKitId: Id.nullable(), isDefault: z.boolean().default(false), topicId: Id.nullable().default(null), createdBy: z.string().nullable().default(null), app: z.string().nullable().default(null), createdAt: Timestamp, updatedAt: Timestamp,
|
|
44
44
|
});
|
|
45
45
|
export const TemplateWithVersion = TemplateDto.extend({ currentVersion: TemplateVersionDto.nullable() });
|
|
46
46
|
export const CreateTemplateBody = z.object({
|
|
@@ -54,6 +54,7 @@ export const CreateTemplateBody = z.object({
|
|
|
54
54
|
tags: z.array(z.string().max(64)).max(50).default([]),
|
|
55
55
|
/** Preference topic for this template's marketing sends that name no topic (as on PATCH). */
|
|
56
56
|
topicId: Id.nullable().optional(),
|
|
57
|
+
app: AppSlug.nullish().describe('Product (app slug) that owns the template; an app-bound API key stamps its own and only sees its own'),
|
|
57
58
|
version: TemplateVersionInput.optional(),
|
|
58
59
|
});
|
|
59
60
|
export const UpdateTemplateBody = z.object({
|
|
@@ -68,13 +69,14 @@ export const UpdateTemplateBody = z.object({
|
|
|
68
69
|
topicId: Id.nullable().optional(),
|
|
69
70
|
/** The pre-selected template for new campaigns on this channel; setting it clears the previous default. */
|
|
70
71
|
isDefault: z.boolean().optional(),
|
|
72
|
+
app: AppSlug.nullable().optional().describe('Move to another product (app slug), or null to share; app-bound keys cannot'),
|
|
71
73
|
});
|
|
72
74
|
export const ListTemplatesQuery = PageQuery.extend({
|
|
73
75
|
channel: Channel.optional(), folder: z.string().optional(), folderId: Id.optional(), tag: z.string().max(64).optional(), q: z.string().max(200).optional(),
|
|
74
76
|
archived: z.enum(['true', 'false']).transform((v) => v === 'true').optional(),
|
|
75
77
|
/** Actor id of the creator (a user id, or `me` for the caller). */
|
|
76
78
|
createdBy: z.string().max(128).optional(),
|
|
77
|
-
kind: TemplateKind.optional(),
|
|
79
|
+
kind: TemplateKind.optional(), app: AppSlug.optional(),
|
|
78
80
|
createdAfter: Timestamp.optional(), createdBefore: Timestamp.optional(),
|
|
79
81
|
sort: z.enum(['newest', 'oldest', 'name', 'name_desc', 'updated']).default('newest'),
|
|
80
82
|
});
|
|
@@ -168,12 +168,14 @@ export declare const SendRequest: z.ZodObject<{
|
|
|
168
168
|
preheaderOverride: z.ZodOptional<z.ZodString>;
|
|
169
169
|
replyToStep: z.ZodOptional<z.ZodString>;
|
|
170
170
|
inReplyToJobId: z.ZodOptional<z.ZodUUID>;
|
|
171
|
+
inReplyToInboundId: z.ZodOptional<z.ZodUUID>;
|
|
171
172
|
plainText: z.ZodOptional<z.ZodBoolean>;
|
|
172
173
|
unsubscribeText: z.ZodOptional<z.ZodString>;
|
|
173
174
|
spintaxMode: z.ZodOptional<z.ZodEnum<{
|
|
174
175
|
random: "random";
|
|
175
176
|
sequential: "sequential";
|
|
176
177
|
}>>;
|
|
178
|
+
matchProvider: z.ZodOptional<z.ZodBoolean>;
|
|
177
179
|
variantKey: z.ZodOptional<z.ZodString>;
|
|
178
180
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
179
181
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -326,6 +328,7 @@ export declare const MessageListQuery: z.ZodObject<{
|
|
|
326
328
|
to: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
327
329
|
vars: z.ZodOptional<z.ZodString>;
|
|
328
330
|
eventKind: z.ZodOptional<z.ZodString>;
|
|
331
|
+
app: z.ZodOptional<z.ZodString>;
|
|
329
332
|
}, z.core.$strip>;
|
|
330
333
|
/** One policy stage of the send pipeline (destination, eligibility, caps, route, render, reserve, send, events). */
|
|
331
334
|
export declare const DecisionEntry: z.ZodObject<{
|
|
@@ -62,11 +62,15 @@ export const SendRequest = z.object({
|
|
|
62
62
|
replyToStep: z.string().max(128).optional(),
|
|
63
63
|
/** Transactional threading: reply to this earlier message job of the same profile. */
|
|
64
64
|
inReplyToJobId: Id.optional(),
|
|
65
|
+
/** Answer a received email (inbound message id) of the same profile in its thread: In-Reply-To / References its Message-ID, from the mailbox it came in on. */
|
|
66
|
+
inReplyToInboundId: Id.optional(),
|
|
65
67
|
/** Outreach email without an HTML part or open pixel; `unsubscribeText` words the footer unsubscribe link. */
|
|
66
68
|
plainText: z.boolean().optional(),
|
|
67
69
|
unsubscribeText: z.string().max(120).optional(),
|
|
68
70
|
/** `{a|b}` wording: `random` per send (default) or `sequential` (rotate evenly across the sends of a source step). */
|
|
69
71
|
spintaxMode: z.enum(['random', 'sequential']).optional(),
|
|
72
|
+
/** ESP matching for this send's rotated route: a sequence's own choice; unset = the workspace's `matchRecipientProvider`. */
|
|
73
|
+
matchProvider: z.boolean().optional(),
|
|
70
74
|
/** Experiment/A-B variant this send belongs to; stamped on the job so rollups group by variant. */
|
|
71
75
|
variantKey: z.string().max(32).optional(),
|
|
72
76
|
/** Transactional envelope (B1/B2): searchable tags and metadata, stored attachments, X- headers, verified from/reply-to override. */
|
|
@@ -166,6 +170,8 @@ export const MessageListQuery = PageQuery.extend({
|
|
|
166
170
|
vars: z.string().max(500).optional(),
|
|
167
171
|
/** Only messages that have at least one event of this kind (open, click, delivered, hard_bounce, ...). */
|
|
168
172
|
eventKind: z.string().max(40).optional(),
|
|
173
|
+
/** Only messages of this app: an `app:<slug>` tag or `metadata.app`. A key bound to an app always gets its own. */
|
|
174
|
+
app: z.string().max(63).optional(),
|
|
169
175
|
});
|
|
170
176
|
/** One policy stage of the send pipeline (destination, eligibility, caps, route, render, reserve, send, events). */
|
|
171
177
|
export const DecisionEntry = z.object({ stage: z.string(), outcome: z.enum(['allow', 'block', 'defer']), reason: z.string().nullish(), liaId: z.string().nullish(), at: Timestamp.nullish() });
|
|
@@ -387,7 +387,6 @@ export declare const SiteSdkSettings: z.ZodObject<{
|
|
|
387
387
|
trackVideo: z.ZodDefault<z.ZodBoolean>;
|
|
388
388
|
}, z.core.$strip>;
|
|
389
389
|
export type SiteSdkSettings = z.infer<typeof SiteSdkSettings>;
|
|
390
|
-
/** GET/PUT /v1/sites/:id/settings: the SDK settings plus the server-side ingest switches of the site. */
|
|
391
390
|
export declare const SiteSettingsDto: z.ZodObject<{
|
|
392
391
|
consentMode: z.ZodDefault<z.ZodEnum<{
|
|
393
392
|
none: "none";
|
|
@@ -421,6 +420,7 @@ export declare const SiteSettingsDto: z.ZodObject<{
|
|
|
421
420
|
botFilter: z.ZodBoolean;
|
|
422
421
|
trustBrowserRevenue: z.ZodBoolean;
|
|
423
422
|
identitySecretSet: z.ZodBoolean;
|
|
423
|
+
retentionDays: z.ZodNullable<z.ZodNumber>;
|
|
424
424
|
}, z.core.$strip>;
|
|
425
425
|
export declare const SiteSettingsBody: z.ZodObject<{
|
|
426
426
|
consentMode: z.ZodDefault<z.ZodEnum<{
|
|
@@ -454,6 +454,7 @@ export declare const SiteSettingsBody: z.ZodObject<{
|
|
|
454
454
|
trackVideo: z.ZodDefault<z.ZodBoolean>;
|
|
455
455
|
botFilter: z.ZodDefault<z.ZodBoolean>;
|
|
456
456
|
trustBrowserRevenue: z.ZodDefault<z.ZodBoolean>;
|
|
457
|
+
retentionDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
457
458
|
}, z.core.$strip>;
|
|
458
459
|
/** GET /ingest/v1/config: what the snippet applies; `consentMode` is already resolved for the visitor's region. */
|
|
459
460
|
export declare const SdkRemoteConfig: z.ZodObject<{
|
package/dist/contracts/events.js
CHANGED
|
@@ -155,8 +155,10 @@ export const SiteSdkSettings = z.object({
|
|
|
155
155
|
trackVideo: z.boolean().default(false),
|
|
156
156
|
});
|
|
157
157
|
/** GET/PUT /v1/sites/:id/settings: the SDK settings plus the server-side ingest switches of the site. */
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
/** `retentionDays`: this site's events are deleted after this many days, null = the workspace's events retention (a site can only be stricter). */
|
|
159
|
+
const SiteRetentionDays = z.number().int().min(30).max(3650).nullable();
|
|
160
|
+
export const SiteSettingsDto = SiteSdkSettings.extend({ botFilter: z.boolean(), trustBrowserRevenue: z.boolean(), identitySecretSet: z.boolean(), retentionDays: SiteRetentionDays });
|
|
161
|
+
export const SiteSettingsBody = SiteSdkSettings.extend({ botFilter: z.boolean().default(true), trustBrowserRevenue: z.boolean().default(false), /** Left out: unchanged. */ retentionDays: SiteRetentionDays.optional() });
|
|
160
162
|
/** GET /ingest/v1/config: what the snippet applies; `consentMode` is already resolved for the visitor's region. */
|
|
161
163
|
export const SdkRemoteConfig = SiteSdkSettings.omit({ regions: true });
|
|
162
164
|
/** The identity secret, shown once; signing identities with it is done on the site's server, never in the browser. */
|