@hermeticacomms/sdk-node 0.0.0-stage → 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/LICENSE +9 -0
- package/README.md +12 -2
- package/dist/contracts/analytics.d.ts +405 -0
- package/dist/contracts/analytics.js +77 -0
- package/dist/contracts/auth.d.ts +363 -0
- package/dist/contracts/auth.js +130 -0
- package/dist/contracts/billing.d.ts +143 -0
- package/dist/contracts/billing.js +32 -0
- package/dist/contracts/campaigns.d.ts +915 -0
- package/dist/contracts/campaigns.js +276 -0
- package/dist/contracts/common.d.ts +57 -0
- package/dist/contracts/common.js +35 -0
- package/dist/contracts/connectors.d.ts +179 -0
- package/dist/contracts/connectors.js +46 -0
- package/dist/contracts/consent.d.ts +628 -0
- package/dist/contracts/consent.js +194 -0
- package/dist/contracts/content-blocks.d.ts +165 -0
- package/dist/contracts/content-blocks.js +62 -0
- package/dist/contracts/content-library.d.ts +347 -0
- package/dist/contracts/content-library.js +52 -0
- package/dist/contracts/content.d.ts +955 -0
- package/dist/contracts/content.js +194 -0
- package/dist/contracts/delivery.d.ts +602 -0
- package/dist/contracts/delivery.js +220 -0
- package/dist/contracts/events.d.ts +514 -0
- package/dist/contracts/events.js +180 -0
- package/dist/contracts/experiments.d.ts +378 -0
- package/dist/contracts/experiments.js +140 -0
- package/dist/contracts/identity.d.ts +761 -0
- package/dist/contracts/identity.js +226 -0
- package/dist/contracts/index.d.ts +15 -0
- package/dist/contracts/index.js +15 -0
- package/dist/contracts/integrations.d.ts +445 -0
- package/dist/contracts/integrations.js +139 -0
- package/dist/contracts/leads.d.ts +733 -0
- package/dist/contracts/leads.js +125 -0
- package/dist/contracts/metrics.d.ts +465 -0
- package/dist/contracts/metrics.js +96 -0
- package/dist/contracts/outbound.d.ts +15535 -0
- package/dist/contracts/outbound.js +432 -0
- package/dist/contracts/pickers.d.ts +12 -0
- package/dist/contracts/pickers.js +20 -0
- package/dist/contracts/platform-admin.d.ts +244 -0
- package/dist/contracts/platform-admin.js +98 -0
- package/dist/contracts/postcards.d.ts +79 -0
- package/dist/contracts/postcards.js +29 -0
- package/dist/contracts/push.d.ts +530 -0
- package/dist/contracts/push.js +102 -0
- package/dist/contracts/rcs.d.ts +39 -0
- package/dist/contracts/rcs.js +19 -0
- package/dist/contracts/segments.d.ts +3187 -0
- package/dist/contracts/segments.js +421 -0
- package/dist/contracts/workflow-nodes.d.ts +2130 -0
- package/dist/contracts/workflow-nodes.js +346 -0
- package/dist/contracts/workflows.d.ts +46811 -0
- package/dist/contracts/workflows.js +350 -0
- package/dist/contracts/x10-platform.d.ts +2603 -0
- package/dist/contracts/x10-platform.js +129 -0
- package/dist/http.d.ts +30 -0
- package/dist/http.js +65 -0
- package/dist/index.d.ts +11631 -0
- package/dist/index.js +63 -0
- package/dist/platform.d.ts +163 -0
- package/dist/platform.js +40 -0
- package/dist/resources.d.ts +1338 -0
- package/dist/resources.js +56 -0
- package/dist/signature.d.ts +5 -0
- package/dist/signature.js +19 -0
- package/dist/x10.d.ts +1608 -0
- package/dist/x10.js +66 -0
- package/dist/z10.d.ts +256 -0
- package/dist/z10.js +46 -0
- package/package.json +40 -4
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AppSlug, DateTimeIn, Id, PageQuery, Purpose, Timestamp, pageResult } from './common.js';
|
|
3
|
+
import { PostcardDesign } from './postcards.js';
|
|
4
|
+
export const ProspectStatus = z.enum(['new', 'contacted', 'replied', 'interested', 'meeting_booked', 'won', 'lost', 'not_interested', 'bounced', 'unsubscribed', 'do_not_contact']);
|
|
5
|
+
export const ReplyCategory = z.enum(['positive', 'negative', 'neutral', 'ooo', 'auto_reply', 'bounce', 'unsubscribe', 'meeting', 'wrong_person']);
|
|
6
|
+
export const TaskKind = z.enum(['call', 'linkedin_visit', 'linkedin_connect', 'linkedin_message', 'sms', 'whatsapp', 'manual_email', 'reply_received', 'custom']);
|
|
7
|
+
// ---- sequences ------------------------------------------------------------------------------------------------
|
|
8
|
+
const Wait = { waitDays: z.number().int().min(0).max(365).default(0), businessDays: z.boolean().default(false) };
|
|
9
|
+
/** Evaluated after the step's wait, right before it runs. `engagement` looks at every earlier send of this sequence. */
|
|
10
|
+
export const StepCondition = z.discriminatedUnion('kind', [
|
|
11
|
+
z.object({ kind: z.literal('engagement'), event: z.enum(['opened', 'clicked', 'replied']), negate: z.boolean().default(false) }),
|
|
12
|
+
/** Outcome a rep recorded on an earlier task step (`step` = that step's key, e.g. `s3`; omitted = the latest task). Call dispositions are free keys. */
|
|
13
|
+
z.object({ kind: z.literal('task_outcome'), outcome: z.string().min(1).max(40), step: z.string().max(64).optional(), negate: z.boolean().default(false) }),
|
|
14
|
+
z.object({ kind: z.literal('has_phone'), negate: z.boolean().default(false) }),
|
|
15
|
+
/** The prospect accepted our LinkedIn connection request (set by the provider's new-relation signal, or by a rep completing the task). */
|
|
16
|
+
z.object({ kind: z.literal('linkedin_connected'), negate: z.boolean().default(false) }),
|
|
17
|
+
/** The prospect's latest reply was in this category (only matters when stop rules let the sequence continue, e.g. out-of-office). */
|
|
18
|
+
z.object({ kind: z.literal('reply'), category: ReplyCategory, negate: z.boolean().default(false) }),
|
|
19
|
+
/** Email verified valid: reads the profile's `email_status` attribute (set by lead verification or import customFields). */
|
|
20
|
+
z.object({ kind: z.literal('verified'), negate: z.boolean().default(false) }),
|
|
21
|
+
z.object({ kind: z.literal('field'), field: z.string().min(1).max(128), op: z.enum(['eq', 'ne', 'gt', 'gte', 'lt', 'lte', 'contains', 'exists', 'not_exists']), value: z.unknown().optional() }),
|
|
22
|
+
]);
|
|
23
|
+
const StepWindow = z.object({ startMin: z.number().int().min(0).max(1440), endMin: z.number().int().min(0).max(1440), weekdays: z.array(z.number().int().min(1).max(7)).min(1).optional() });
|
|
24
|
+
/** `when` false: the step is skipped. `window`: per-step send window overriding the sequence schedule. */
|
|
25
|
+
const Gate = { when: StepCondition.optional(), window: StepWindow.optional() };
|
|
26
|
+
export const EmailVariant = z.object({ templateId: Id, versionId: Id.optional(), weight: z.number().int().min(1).max(1000).default(1) });
|
|
27
|
+
const EmailStep = z.object({
|
|
28
|
+
type: z.literal('email'), templateId: Id, versionId: Id.optional(), thread: z.enum(['new', 'reply']).default('new'), ...Wait, ...Gate,
|
|
29
|
+
/** Extra variants (B to Z, 26 in all) next to the main template (A, weight `weightA`); each prospect gets one, sticky. */
|
|
30
|
+
alternates: z.array(EmailVariant).max(25).default([]), weightA: z.number().int().min(1).max(1000).default(1),
|
|
31
|
+
/** Re-weight variants toward the best reply rate once each has enough sends (maintenance job). */
|
|
32
|
+
optimize: z.boolean().default(false),
|
|
33
|
+
/** Send this step from this mailbox instead of the sequence's pool/pin (a fixed sender for a follow-up). */
|
|
34
|
+
senderConnectionId: Id.optional(),
|
|
35
|
+
});
|
|
36
|
+
const WaitStep = z.object({ type: z.literal('wait'), days: z.number().int().min(1).max(365), businessDays: z.boolean().default(false) });
|
|
37
|
+
const TaskStep = z.object({
|
|
38
|
+
type: z.literal('task'), kind: z.enum(['call', 'linkedin_visit', 'linkedin_connect', 'linkedin_message', 'sms', 'whatsapp', 'manual_email', 'custom']),
|
|
39
|
+
title: z.string().trim().min(1).max(200), notes: z.string().max(5000).optional(), draft: z.string().max(20_000).optional(), ...Wait, ...Gate,
|
|
40
|
+
});
|
|
41
|
+
/** Sub-sequence: move the prospect into another sequence (e.g. "interested -> nurture") and end this one. */
|
|
42
|
+
const JumpStep = z.object({ type: z.literal('jump'), sequenceId: Id, ...Wait, ...Gate });
|
|
43
|
+
/**
|
|
44
|
+
* Automated SMS. Prospecting SMS stays blocked by default: the send is made with the `marketing` purpose, so delivery only sends
|
|
45
|
+
* when the prospect has granted SMS consent, and STOP (a suppression) always wins.
|
|
46
|
+
*/
|
|
47
|
+
const SmsStep = z.object({ type: z.literal('sms'), templateId: Id, versionId: Id.optional(), ...Wait, ...Gate });
|
|
48
|
+
/** API call / webhook step. `signingSecret` is write-only (sealed by the API; reads show `signingSecretSet`). */
|
|
49
|
+
const WebhookStep = z.object({
|
|
50
|
+
type: z.literal('webhook'), url: z.url(), body: z.record(z.string(), z.unknown()).optional(), headers: z.record(z.string(), z.string()).optional(),
|
|
51
|
+
maxAttempts: z.number().int().min(1).max(8).default(5), signingSecret: z.string().min(8).max(200).optional(), signingSecretSealed: z.string().max(2000).optional(), signingSecretSet: z.boolean().optional(),
|
|
52
|
+
responseMap: z.array(z.object({ path: z.string().min(1).max(200), field: z.string().min(1).max(128) })).max(20).default([]), ...Wait, ...Gate,
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* LinkedIn action through the customer's own provider account, within that account's daily limits and random spacing.
|
|
56
|
+
* With no connected LinkedIn provider it becomes a manual task for a person instead. `message` is the connection note or chat text (liquid; notes cap at 300 characters).
|
|
57
|
+
*/
|
|
58
|
+
const LinkedinStep = z.object({ type: z.literal('linkedin'), action: z.enum(['visit', 'connect', 'message', 'like_post', 'inmail']), message: z.string().max(4000).optional(), ...Wait, ...Gate });
|
|
59
|
+
/** WhatsApp send of an approved template (a content template of channel whatsapp). Needs explicit WhatsApp consent; blocked otherwise. */
|
|
60
|
+
const WhatsappStep = z.object({ type: z.literal('whatsapp'), templateId: Id, versionId: Id.optional(), ...Wait, ...Gate });
|
|
61
|
+
/**
|
|
62
|
+
* Voice message from an uploaded clip (`/v1/outbound/voice-clips`): a LinkedIn voice note through the connected provider account (same gate,
|
|
63
|
+
* limits and spacing as a LinkedIn message; a manual task without one), or a call task carrying the clip for a voicemail drop through the workspace's own Twilio.
|
|
64
|
+
*/
|
|
65
|
+
const VoiceStep = z.object({ type: z.literal('voice'), clipId: Id, via: z.enum(['linkedin', 'voicemail']), message: z.string().max(4000).optional(), title: z.string().trim().max(200).optional(), ...Wait, ...Gate });
|
|
66
|
+
/** Printed postcard through a print connection (Lob, PostGrid). Prospects without a complete postal address, or suppressed, are skipped. */
|
|
67
|
+
const PostcardStep = z.object({ type: z.literal('postcard'), design: PostcardDesign, connectionId: Id, ...Wait, ...Gate });
|
|
68
|
+
const leafSteps = [EmailStep, WaitStep, TaskStep, JumpStep, SmsStep, WebhookStep, LinkedinStep, WhatsappStep, VoiceStep, PostcardStep];
|
|
69
|
+
/** A step that is not a branch: what a branch path may contain (one level of branching, no nesting). */
|
|
70
|
+
export const SequenceLeafStep = z.discriminatedUnion('type', leafSteps);
|
|
71
|
+
/** Real branching: the first branch whose condition holds runs its own steps; none matching runs `otherwise`; all paths then rejoin. */
|
|
72
|
+
export const BranchStep = z.object({
|
|
73
|
+
type: z.literal('branch'), ...Wait,
|
|
74
|
+
branches: z.array(z.object({ key: z.string().regex(/^[a-z0-9]{1,8}$/), label: z.string().max(80).optional(), when: StepCondition, steps: z.array(SequenceLeafStep).max(20).default([]) })).min(1).max(8),
|
|
75
|
+
otherwise: z.array(SequenceLeafStep).max(20).default([]),
|
|
76
|
+
});
|
|
77
|
+
export const SequenceStep = z.discriminatedUnion('type', [...leafSteps, BranchStep]);
|
|
78
|
+
export const StopRules = z.object({
|
|
79
|
+
/** `human`: auto-replies/OOO do not count as a reply; `any`: every inbound reply stops the sequence. */
|
|
80
|
+
onReply: z.enum(['human', 'any']).default('human'),
|
|
81
|
+
onAutoReply: z.enum(['continue', 'pause']).default('continue'),
|
|
82
|
+
onOoo: z.enum(['pause_until_return', 'continue', 'stop']).default('pause_until_return'),
|
|
83
|
+
/** A human reply from anyone at the same company domain: end the other live enrollments there (default for new sequences), pause them, or leave them alone. */
|
|
84
|
+
onCompanyReply: z.enum(['none', 'stop', 'pause']).default('stop'),
|
|
85
|
+
});
|
|
86
|
+
export const DedupeRules = z.object({
|
|
87
|
+
/** Prospect already live in another sequence: skip (default) or allow. */
|
|
88
|
+
crossSequence: z.enum(['skip', 'allow']).default('skip'),
|
|
89
|
+
/** Skip prospects contacted by any sequence within N days. */
|
|
90
|
+
contactedWithinDays: z.number().int().min(0).max(3650).default(0),
|
|
91
|
+
/** One contact per company domain at a time. */
|
|
92
|
+
domain: z.boolean().default(false),
|
|
93
|
+
});
|
|
94
|
+
export const SequenceSettings = z.object({
|
|
95
|
+
steps: z.array(SequenceStep).max(50).default([]),
|
|
96
|
+
schedule: z.object({
|
|
97
|
+
weekdays: z.array(z.number().int().min(1).max(7)).min(1).default([1, 2, 3, 4, 5]),
|
|
98
|
+
startMin: z.number().int().min(0).max(1440).default(540),
|
|
99
|
+
endMin: z.number().int().min(0).max(1440).default(1020),
|
|
100
|
+
timezoneSource: z.enum(['prospect', 'sequence']).default('prospect'),
|
|
101
|
+
timezone: z.string().default('UTC'),
|
|
102
|
+
}).default({ weekdays: [1, 2, 3, 4, 5], startMin: 540, endMin: 1020, timezoneSource: 'prospect', timezone: 'UTC' }),
|
|
103
|
+
mailbox: z.object({
|
|
104
|
+
poolId: Id.optional(),
|
|
105
|
+
connectionId: Id.optional(),
|
|
106
|
+
sticky: z.boolean().default(true),
|
|
107
|
+
/** Sticky mailbox became unavailable: pause the enrollment (default) or move it to another pool member (new thread). */
|
|
108
|
+
onUnavailable: z.enum(['pause', 'reassign']).default('pause'),
|
|
109
|
+
/** ESP matching (unset = the workspace default, delivery settings `matchRecipientProvider`, on unless turned off): a new prospect on Gmail/Google Workspace gets a Google mailbox, on Outlook/M365 a Microsoft one, when such a mailbox has room today. */
|
|
110
|
+
matchProvider: z.boolean().optional(),
|
|
111
|
+
}).default({ sticky: true, onUnavailable: 'pause' }),
|
|
112
|
+
dailyNewLimit: z.number().int().min(1).max(100_000).optional(),
|
|
113
|
+
/** Share (%) of `dailyNewLimit` held back for follow-ups, so new prospects can use only the rest. */
|
|
114
|
+
followUpPercent: z.number().int().min(0).max(90).optional(),
|
|
115
|
+
/** Send every email of this sequence as plain text: no HTML part, no tracking pixel. */
|
|
116
|
+
plainTextOnly: z.boolean().optional(),
|
|
117
|
+
/** Add an open pixel to this sequence's HTML emails so "opened" conditions can fire. Prospecting mail has none by default; ignored with `plainTextOnly`. */
|
|
118
|
+
trackOpens: z.boolean().optional(),
|
|
119
|
+
/** Wording of the unsubscribe link in the footer (default "Unsubscribe"). */
|
|
120
|
+
unsubscribeText: z.string().trim().min(1).max(120).optional(),
|
|
121
|
+
/** `{a|b}` wording: random per send (default) or rotated evenly across the sequence's sends of a step. */
|
|
122
|
+
spintaxMode: z.enum(['random', 'sequential']).optional(),
|
|
123
|
+
/** Campaign variables: `{{ vars.key }}` in every email of this sequence. */
|
|
124
|
+
variables: z.record(z.string().regex(/^[a-z][a-z0-9_]{0,39}$/), z.string().max(500)).refine((v) => Object.keys(v).length <= 30, 'At most 30 variables').refine((v) => !['locale', 'rss', 'trigger', 'message'].some((k) => k in v), 'locale, rss, trigger and message are reserved names').optional(),
|
|
125
|
+
/** This campaign's own do-not-send list (on top of the workspace blocklist): lower-case addresses and domains (a domain covers its subdomains). */
|
|
126
|
+
blocklist: z.object({
|
|
127
|
+
emails: z.array(z.email().transform((v) => v.toLowerCase())).max(2000).default([]),
|
|
128
|
+
domains: z.array(z.string().trim().toLowerCase().regex(/^[a-z0-9.-]+\.[a-z]{2,}$/, 'Enter a domain such as example.com')).max(500).default([]),
|
|
129
|
+
}).optional(),
|
|
130
|
+
/** Lemlist-style review gate: enrolled prospects wait (status `pending_review`) until someone launches them. */
|
|
131
|
+
reviewBeforeSend: z.boolean().optional(),
|
|
132
|
+
/** Per-message review gate: every rendered email waits in the review queue (never auto-sends) until approved, edited or rejected. */
|
|
133
|
+
reviewEachMessage: z.boolean().optional(),
|
|
134
|
+
stop: StopRules.default({ onReply: 'human', onAutoReply: 'continue', onOoo: 'pause_until_return', onCompanyReply: 'stop' }),
|
|
135
|
+
/** Sub-sequences: when a reply to this sequence is classified as `category`, start `sequenceId` for that person (ending their other live sequences when `stopCurrent`). Consent, dedupe and blocklists still apply. */
|
|
136
|
+
onCategory: z.array(z.object({ category: ReplyCategory, sequenceId: Id, stopCurrent: z.boolean().default(true) })).max(10).optional(),
|
|
137
|
+
/** Positive reply -> opt-in ask: email the prospect a double opt-in link for `listId` (the list's confirmation email). Only their click grants marketing consent. */
|
|
138
|
+
optInAsk: z.object({ listId: Id, connectionId: Id.optional() }).optional(),
|
|
139
|
+
/** Default owner for prospects this sequence enrolls who have none yet. */
|
|
140
|
+
ownerUserId: Id.optional(),
|
|
141
|
+
/** Reusable schedule object: when set, its window replaces `schedule` on save (and again when the schedule is edited). */
|
|
142
|
+
scheduleId: Id.optional(),
|
|
143
|
+
dedupe: DedupeRules.default({ crossSequence: 'skip', contactedWithinDays: 0, domain: false }),
|
|
144
|
+
/** Nothing is sent before this instant: every enrollment waits at the start until then. */
|
|
145
|
+
startAt: DateTimeIn().optional(),
|
|
146
|
+
/** Minimum minutes between two emails of this sequence from one mailbox (across prospects and steps; clock-aligned windows). */
|
|
147
|
+
minGapMinutes: z.number().int().min(1).max(1440).optional(),
|
|
148
|
+
/** Per-mailbox overrides inside this sequence only: a lower daily limit, or leave the mailbox out of new assignments. Keyed by connection id. */
|
|
149
|
+
senderOverrides: z.record(Id, z.object({ dailyLimit: z.number().int().min(0).max(100_000).optional(), paused: z.boolean().optional() })).optional(),
|
|
150
|
+
/** Account-based (ABM) settings, used when enrolling companies: at most this many contacts per account, and what a colleague's human reply does. */
|
|
151
|
+
abm: z.object({ maxPerAccount: z.number().int().min(1).max(100).default(5), onAccountReply: z.enum(['none', 'stop', 'pause']).default('stop') }).optional(),
|
|
152
|
+
});
|
|
153
|
+
export const CreateSequenceBody = z.object({ name: z.string().trim().min(1).max(200), settings: SequenceSettings });
|
|
154
|
+
/** PATCH settings: only the keys sent change, an omitted key keeps its saved value and `null` resets a key (e.g. detaches `scheduleId`). */
|
|
155
|
+
const SequenceSettingsPatch = z.object(Object.fromEntries(Object.entries(SequenceSettings.shape).map(([k, s]) => [k, (s instanceof z.ZodDefault ? s.unwrap() : s).nullable().optional()])));
|
|
156
|
+
export const UpdateSequenceBody = z.object({ name: z.string().trim().min(1).max(200).optional(), settings: SequenceSettingsPatch.optional() });
|
|
157
|
+
/** Enroll chosen prospects, or every member of a list (`listId`). */
|
|
158
|
+
export const EnrollProspectsBody = z.object({ profileIds: z.array(Id).max(1000).default([]), listId: Id.optional(), ownerUserId: Id.optional() })
|
|
159
|
+
.refine((b) => b.profileIds.length > 0 || !!b.listId, { message: 'Pass profileIds or listId', path: ['profileIds'] });
|
|
160
|
+
/** ABM: enroll the contacts of these companies, grouped per account (the sequence's `abm` caps and stop rules apply). */
|
|
161
|
+
export const EnrollAccountsBody = z.object({ companyIds: z.array(Id).min(1).max(200), ownerUserId: Id.optional() });
|
|
162
|
+
export const EnrollProspectsResult = z.object({
|
|
163
|
+
enrolled: z.number().int(),
|
|
164
|
+
skipped: z.array(z.object({ profileId: Id, reason: z.string() })),
|
|
165
|
+
warnings: z.array(z.object({ profileId: Id, warning: z.string() })),
|
|
166
|
+
});
|
|
167
|
+
// ---- prospects ------------------------------------------------------------------------------------------------
|
|
168
|
+
export const ProspectInput = z.object({
|
|
169
|
+
email: z.email(),
|
|
170
|
+
firstName: z.string().max(128).optional(),
|
|
171
|
+
lastName: z.string().max(128).optional(),
|
|
172
|
+
title: z.string().max(200).optional(),
|
|
173
|
+
company: z.string().max(200).optional(),
|
|
174
|
+
website: z.string().max(300).optional(),
|
|
175
|
+
linkedinUrl: z.string().max(300).optional(),
|
|
176
|
+
country: z.string().length(2).optional(),
|
|
177
|
+
timezone: z.string().max(64).optional(),
|
|
178
|
+
customFields: z.record(z.string().regex(/^[A-Za-z0-9_]{1,64}$/), z.unknown()).default({}),
|
|
179
|
+
});
|
|
180
|
+
export const ImportProspectsBody = z.object({
|
|
181
|
+
/** email is checked per row by the import (bad rows come back in `errors[]`), so one typo does not reject the batch. */
|
|
182
|
+
rows: z.array(ProspectInput.extend({ email: z.string().max(320) })).min(1).max(5000),
|
|
183
|
+
/** Someone already a prospect: refresh their details (default) or leave them untouched and count the row as skipped. */
|
|
184
|
+
onExisting: z.enum(['update', 'skip']).default('update'),
|
|
185
|
+
ownerRule: z.discriminatedUnion('kind', [
|
|
186
|
+
z.object({ kind: z.literal('none') }),
|
|
187
|
+
z.object({ kind: z.literal('user'), userId: Id }),
|
|
188
|
+
z.object({ kind: z.literal('round_robin') }),
|
|
189
|
+
z.object({ kind: z.literal('field'), field: z.string().min(1).max(64) }),
|
|
190
|
+
]).default({ kind: 'none' }),
|
|
191
|
+
});
|
|
192
|
+
export const ImportProspectsResult = z.object({
|
|
193
|
+
created: z.number().int(), updated: z.number().int(), skipped: z.number().int(),
|
|
194
|
+
errors: z.array(z.object({ row: z.number().int(), error: z.string() })),
|
|
195
|
+
warnings: z.array(z.object({ row: z.number().int(), warning: z.string() })),
|
|
196
|
+
profileIds: z.array(Id),
|
|
197
|
+
});
|
|
198
|
+
export const AdoptProspectsBody = z.object({ profileIds: z.array(Id).min(1).max(1000) });
|
|
199
|
+
export const ProspectListQuery = PageQuery.extend({ app: AppSlug.optional(), status: ProspectStatus.optional(), ownerUserId: Id.optional(), domain: z.string().optional() });
|
|
200
|
+
export const UpdateProspectBody = z.object({ status: ProspectStatus.optional(), ownerUserId: Id.nullable().optional(), dealValueCents: z.number().int().min(0).max(2_000_000_000).nullable().optional() });
|
|
201
|
+
export const DncImportBody = z.object({ emails: z.array(z.email()).max(10_000).default([]), domains: z.array(z.string().min(3).max(253)).max(1000).default([]) });
|
|
202
|
+
export const DncImportResult = z.object({ suppressed: z.number().int(), domainsBlocked: z.number().int() });
|
|
203
|
+
/** Display data of the person behind a prospect / task / reply, so lists need no per-row profile fetch. */
|
|
204
|
+
export const ProfileRef = z.object({ id: Id, name: z.string().nullable(), email: z.string().nullable() });
|
|
205
|
+
export const ProspectDto = z.object({
|
|
206
|
+
id: Id,
|
|
207
|
+
profileId: Id,
|
|
208
|
+
status: ProspectStatus,
|
|
209
|
+
ownerUserId: Id.nullable(),
|
|
210
|
+
companyObjectId: Id.nullable(),
|
|
211
|
+
domain: z.string().nullable(),
|
|
212
|
+
title: z.string().nullable(),
|
|
213
|
+
linkedinUrl: z.string().nullable(),
|
|
214
|
+
website: z.string().nullable(),
|
|
215
|
+
lastContactedAt: Timestamp.nullable(),
|
|
216
|
+
lastSequenceId: Id.nullable(),
|
|
217
|
+
enrichment: z.record(z.string(), z.unknown()),
|
|
218
|
+
dealValueCents: z.number().int().nullable().optional(),
|
|
219
|
+
createdAt: Timestamp,
|
|
220
|
+
updatedAt: Timestamp,
|
|
221
|
+
profile: ProfileRef.nullable(),
|
|
222
|
+
});
|
|
223
|
+
export const ProspectPage = pageResult(ProspectDto);
|
|
224
|
+
/** A sequence is a workflow in `sequence` mode; `sequence` is its editable settings (steps, schedule, mailbox, stop rules). */
|
|
225
|
+
export const SequenceDto = z.object({
|
|
226
|
+
id: Id,
|
|
227
|
+
name: z.string(),
|
|
228
|
+
purpose: Purpose,
|
|
229
|
+
mode: z.literal('sequence'),
|
|
230
|
+
status: z.enum(['draft', 'live', 'paused', 'archived']),
|
|
231
|
+
publishedVersionId: Id.nullable(),
|
|
232
|
+
folder: z.string().nullable(),
|
|
233
|
+
tags: z.array(z.string()),
|
|
234
|
+
app: z.string().nullable().default(null),
|
|
235
|
+
sequence: SequenceSettings,
|
|
236
|
+
createdAt: Timestamp,
|
|
237
|
+
updatedAt: Timestamp,
|
|
238
|
+
});
|
|
239
|
+
export const SequencePage = pageResult(SequenceDto);
|
|
240
|
+
// ---- tasks ----------------------------------------------------------------------------------------------------
|
|
241
|
+
export const TaskListQuery = PageQuery.extend({
|
|
242
|
+
app: AppSlug.optional(),
|
|
243
|
+
assigneeUserId: Id.optional(), status: z.enum(['open', 'done', 'skipped']).optional(),
|
|
244
|
+
bucket: z.enum(['overdue', 'today', 'upcoming']).optional(), kind: TaskKind.optional(),
|
|
245
|
+
profileId: Id.optional(), unassigned: z.coerce.boolean().optional(), dueBefore: DateTimeIn().optional(), dueAfter: DateTimeIn().optional(), outcome: z.string().max(40).optional(),
|
|
246
|
+
});
|
|
247
|
+
const TaskFilterField = z.enum(['kind', 'status', 'outcome', 'assigneeUserId', 'profileId', 'dueAt', 'title']);
|
|
248
|
+
const TaskFilterLeaf = z.object({ field: TaskFilterField, op: z.enum(['eq', 'ne', 'lt', 'lte', 'gt', 'gte', 'in', 'is_null', 'not_null']), value: z.union([z.string().max(200), z.array(z.string().max(200)).max(50)]).optional() });
|
|
249
|
+
/** Nested and / or / not over task columns, at most 20 conditions deep-or-wide in total (checked on the server). */
|
|
250
|
+
export const TaskFilterNode = z.lazy(() => z.union([
|
|
251
|
+
TaskFilterLeaf,
|
|
252
|
+
z.object({ op: z.enum(['and', 'or']), filters: z.array(TaskFilterNode).min(1).max(20) }),
|
|
253
|
+
z.object({ op: z.literal('not'), filter: TaskFilterNode }),
|
|
254
|
+
])).meta({ id: 'TaskFilterNode' }); // recursive: one OpenAPI component
|
|
255
|
+
export const TaskSearchBody = z.object({ filter: TaskFilterNode.optional(), limit: z.number().int().min(1).max(200).default(50), cursor: z.string().regex(/^\d{1,6}$/).optional() });
|
|
256
|
+
const TaskLinks = {
|
|
257
|
+
/** Team-defined task type (`/v1/outbound/task-types`). */
|
|
258
|
+
typeId: Id.nullable().optional(),
|
|
259
|
+
/** Linked company (leads companies) and further contacts besides the main one. */
|
|
260
|
+
companyId: Id.nullable().optional(), contactIds: z.array(Id).max(20).optional(),
|
|
261
|
+
/** Planned length in minutes. */
|
|
262
|
+
plannedMin: z.number().int().min(1).max(1440).nullable().optional(),
|
|
263
|
+
/** Remind the assignee this many minutes before the due time (0 = at the due time); null turns the reminder off. */
|
|
264
|
+
remindBeforeMin: z.number().int().min(0).max(10_080).nullable().optional(),
|
|
265
|
+
};
|
|
266
|
+
export const CreateTaskBody = z.object({
|
|
267
|
+
kind: TaskKind.default('custom'), profileId: Id, title: z.string().trim().min(1).max(200), notes: z.string().max(5000).optional(),
|
|
268
|
+
assigneeUserId: Id.optional(), dueAt: DateTimeIn().optional(), ...TaskLinks,
|
|
269
|
+
});
|
|
270
|
+
export const UpdateTaskBody = z.object({ title: z.string().trim().min(1).max(200).optional(), notes: z.string().max(5000).nullable().optional(), dueAt: DateTimeIn().optional(), kind: TaskKind.optional(), ...TaskLinks });
|
|
271
|
+
/** Bulk edit of open tasks: assign, snooze (new due time) or complete / skip. */
|
|
272
|
+
export const BulkTaskBody = z.object({
|
|
273
|
+
ids: z.array(Id).min(1).max(200),
|
|
274
|
+
action: z.discriminatedUnion('op', [
|
|
275
|
+
z.object({ op: z.literal('assign'), assigneeUserId: Id.nullable() }),
|
|
276
|
+
z.object({ op: z.literal('snooze'), until: DateTimeIn() }),
|
|
277
|
+
z.object({ op: z.literal('complete'), outcome: z.string().trim().min(1).max(40).optional() }),
|
|
278
|
+
z.object({ op: z.literal('skip') }),
|
|
279
|
+
]),
|
|
280
|
+
});
|
|
281
|
+
export const BulkTaskResult = z.object({ updated: z.number().int(), failed: z.array(z.object({ id: Id, error: z.string() })) });
|
|
282
|
+
export const AssignTaskBody = z.object({ assigneeUserId: Id.nullable() });
|
|
283
|
+
export const CompleteTaskBody = z.object({
|
|
284
|
+
notes: z.string().max(5000).optional(),
|
|
285
|
+
outcome: z.string().trim().min(1).max(40).optional(),
|
|
286
|
+
/** Call detail (call tasks). */
|
|
287
|
+
durationSec: z.number().int().min(0).max(86_400).optional(), recordingUrl: z.url().max(1000).optional(), externalId: z.string().max(200).optional(),
|
|
288
|
+
});
|
|
289
|
+
export const SnoozeBody = z.object({ until: DateTimeIn() });
|
|
290
|
+
export const TaskDto = z.object({
|
|
291
|
+
id: Id,
|
|
292
|
+
kind: TaskKind,
|
|
293
|
+
profileId: Id,
|
|
294
|
+
enrollmentId: Id.nullable(),
|
|
295
|
+
nodeId: z.string().nullable(),
|
|
296
|
+
assigneeUserId: Id.nullable(),
|
|
297
|
+
title: z.string(),
|
|
298
|
+
notes: z.string().nullable(),
|
|
299
|
+
outcome: z.string().nullable(),
|
|
300
|
+
durationSec: z.number().int().nullable().optional(),
|
|
301
|
+
recordingUrl: z.string().nullable().optional(),
|
|
302
|
+
transcript: z.string().nullable().optional(),
|
|
303
|
+
externalId: z.string().nullable().optional(),
|
|
304
|
+
dueAt: Timestamp,
|
|
305
|
+
status: z.enum(['open', 'done', 'skipped']),
|
|
306
|
+
completedAt: Timestamp.nullable(),
|
|
307
|
+
typeId: Id.nullable().optional(), companyId: Id.nullable().optional(), contactIds: z.array(Id).optional(), plannedMin: z.number().int().nullable().optional(),
|
|
308
|
+
remindBeforeMin: z.number().int().nullable().optional(), voicemailClipId: Id.nullable().optional(),
|
|
309
|
+
createdAt: Timestamp,
|
|
310
|
+
updatedAt: Timestamp,
|
|
311
|
+
profile: ProfileRef.nullable(),
|
|
312
|
+
});
|
|
313
|
+
export const TaskPage = pageResult(TaskDto);
|
|
314
|
+
// ---- inbox ----------------------------------------------------------------------------------------------------
|
|
315
|
+
export const InboxQuery = PageQuery.extend({
|
|
316
|
+
app: AppSlug.optional(),
|
|
317
|
+
category: ReplyCategory.optional(), connectionId: Id.optional(), assigneeUserId: Id.optional(), sequenceId: Id.optional(),
|
|
318
|
+
unread: z.coerce.boolean().optional(), label: z.string().max(40).optional(), leadStatus: ProspectStatus.optional(), includeSnoozed: z.coerce.boolean().default(false),
|
|
319
|
+
sourceKind: z.enum(['campaign', 'sequence', 'workflow']).optional(), campaignId: Id.optional(),
|
|
320
|
+
important: z.coerce.boolean().optional(), reminders: z.coerce.boolean().optional(), unmatched: z.coerce.boolean().optional(), ignored: z.coerce.boolean().optional(),
|
|
321
|
+
/** Archived replies only / snoozed (still waiting) only / replies from members of one list. */
|
|
322
|
+
archived: z.coerce.boolean().optional(), snoozed: z.coerce.boolean().optional(), listId: Id.optional(),
|
|
323
|
+
});
|
|
324
|
+
export const OverrideBody = z.object({ category: ReplyCategory });
|
|
325
|
+
export const LabelsBody = z.object({ labels: z.array(z.string().trim().min(1).max(40)).max(20) });
|
|
326
|
+
export const InboxAssignBody = z.object({ assigneeUserId: Id.nullable() });
|
|
327
|
+
export const InboxReplyBody = z.object({ text: z.string().trim().min(1).max(20_000), subject: z.string().max(300).optional(), /** Send from this mailbox instead of the one that got the reply. */ connectionId: Id.optional(),
|
|
328
|
+
/** Hold the reply and send it at this time (it appears in the scheduled view until then). */ scheduledFor: DateTimeIn().optional() });
|
|
329
|
+
export const ReferralBody = z.object({ enrollSequenceId: Id.optional() });
|
|
330
|
+
export const ReplyMetaDto = z.object({
|
|
331
|
+
category: ReplyCategory,
|
|
332
|
+
confidence: z.number(),
|
|
333
|
+
source: z.enum(['rule', 'llm', 'manual']),
|
|
334
|
+
labels: z.array(z.string()),
|
|
335
|
+
snoozedUntil: Timestamp.nullable(),
|
|
336
|
+
oooUntil: Timestamp.nullable(),
|
|
337
|
+
referral: z.object({ name: z.string().optional(), email: z.string() }).nullable(),
|
|
338
|
+
/** Set when a human changed the category: what the machine had said. */
|
|
339
|
+
machineCategory: ReplyCategory.nullable(),
|
|
340
|
+
important: z.boolean().optional(), ignored: z.boolean().optional(), remindAt: Timestamp.nullable().optional(), latencySec: z.number().int().nullable().optional(),
|
|
341
|
+
});
|
|
342
|
+
export const InboxDto = z.object({
|
|
343
|
+
id: Id,
|
|
344
|
+
connectionId: Id,
|
|
345
|
+
fromAddr: z.string(),
|
|
346
|
+
toAddr: z.string(),
|
|
347
|
+
subject: z.string().nullable(),
|
|
348
|
+
text: z.string().nullable(),
|
|
349
|
+
receivedAt: Timestamp,
|
|
350
|
+
profileId: Id.nullable(),
|
|
351
|
+
classification: z.string().nullable(),
|
|
352
|
+
classificationSource: z.string().nullable(),
|
|
353
|
+
oooUntil: Timestamp.nullable(),
|
|
354
|
+
readAt: Timestamp.nullable(),
|
|
355
|
+
assignedUserId: Id.nullable(),
|
|
356
|
+
archived: z.boolean(),
|
|
357
|
+
/** The send this reply answers (campaign/sequence/...), when matched. */
|
|
358
|
+
sourceKind: z.string().nullable(),
|
|
359
|
+
sourceId: z.string().nullable(),
|
|
360
|
+
stepKey: z.string().nullable(),
|
|
361
|
+
meta: ReplyMetaDto.nullable(),
|
|
362
|
+
profile: ProfileRef.nullable(),
|
|
363
|
+
});
|
|
364
|
+
export const InboxPage = pageResult(InboxDto);
|
|
365
|
+
export const ThreadItemDto = z.object({
|
|
366
|
+
kind: z.enum(['sent', 'received']),
|
|
367
|
+
id: Id,
|
|
368
|
+
at: Timestamp,
|
|
369
|
+
subject: z.string().nullable(),
|
|
370
|
+
text: z.string().nullable(),
|
|
371
|
+
status: z.string().nullable(),
|
|
372
|
+
connectionId: Id.nullable(),
|
|
373
|
+
stepKey: z.string().nullable(),
|
|
374
|
+
classification: z.string().nullable(),
|
|
375
|
+
/** Set by the one-inbox profile conversation: email, sms, whatsapp, linkedin, instagram, facebook. */
|
|
376
|
+
channel: z.string().optional(),
|
|
377
|
+
});
|
|
378
|
+
export const ThreadDto = z.object({ profileId: Id.nullable(), items: z.array(ThreadItemDto) });
|
|
379
|
+
export const ClassifierAccuracyRow = z.object({ source: z.string(), total: z.number().int(), corrected: z.number().int(), accuracy: z.number() });
|
|
380
|
+
export const ReferralResult = z.object({ profileId: Id, enroll: EnrollProspectsResult.nullable() });
|
|
381
|
+
// ---- meetings & analytics -------------------------------------------------------------------------------------
|
|
382
|
+
export const MeetingBody = z.object({ profileId: Id, at: DateTimeIn().optional(), ref: z.string().max(300).optional() });
|
|
383
|
+
export const MeetingDto = z.object({ id: Id, profileId: Id, source: z.enum(['calendar_link', 'reply_detected', 'manual']), at: Timestamp, ref: z.string().nullable(), sequenceId: Id.nullable(), createdAt: Timestamp, completedAt: Timestamp.nullable().optional(), outcome: z.string().nullable().optional() });
|
|
384
|
+
export const OutboundStatsQuery = z.object({ from: z.iso.date().optional(), to: z.iso.date().optional(), sequenceId: Id.optional(), app: z.string().max(63).optional(), group: z.enum(['sequence', 'step', 'mailbox']).default('sequence') });
|
|
385
|
+
export const OutboundStatsRow = z.object({
|
|
386
|
+
key: z.string(), sent: z.number().int(), bounced: z.number().int(), replied: z.number().int(), positive: z.number().int(), negative: z.number().int(),
|
|
387
|
+
optOuts: z.number().int(), meetings: z.number().int(), positiveRate: z.number(), replyRate: z.number(), bounceRate: z.number(),
|
|
388
|
+
});
|
|
389
|
+
export const OutboundStats = z.object({ items: z.array(OutboundStatsRow) });
|
|
390
|
+
// ---- mailboxes ------------------------------------------------------------------------------------------------
|
|
391
|
+
export const RampSchedule = z.object({
|
|
392
|
+
startDaily: z.number().int().min(1).max(100_000), targetDaily: z.number().int().min(1).max(100_000),
|
|
393
|
+
incrementPerDay: z.number().int().min(1).max(10_000), startedOn: z.iso.date(),
|
|
394
|
+
});
|
|
395
|
+
export const MailboxSettingsBody = z.object({
|
|
396
|
+
dailyCap: z.number().int().min(1).max(100_000).nullable().optional(),
|
|
397
|
+
hourlyCap: z.number().int().min(1).max(10_000).nullable().optional(),
|
|
398
|
+
ramp: RampSchedule.nullable().optional(),
|
|
399
|
+
timezone: z.string().max(64).nullable().optional(),
|
|
400
|
+
sendingWindow: z.object({ startMin: z.number().int().min(0).max(1440), endMin: z.number().int().min(0).max(1440), weekdays: z.array(z.number().int().min(1).max(7)).optional() }).nullable().optional(),
|
|
401
|
+
pacing: z.object({ minGapSec: z.number().int().min(0).max(3600), jitterSec: z.number().int().min(0).max(3600) }).nullable().optional(),
|
|
402
|
+
});
|
|
403
|
+
export const HealthFactor = z.object({ key: z.string(), ok: z.boolean(), value: z.union([z.number(), z.string()]).nullable(), limit: z.union([z.number(), z.string()]).optional() });
|
|
404
|
+
export const MailboxDay = z.object({ day: z.string(), sent: z.number().int(), bounced: z.number().int(), replied: z.number().int(), complaints: z.number().int(), opens: z.number().int(), clicks: z.number().int() });
|
|
405
|
+
/** A sending mailbox: health with explicit factors plus its caps, ramp, pacing and sending window (the same shapes PATCH accepts). */
|
|
406
|
+
export const MailboxHealthDto = z.object({
|
|
407
|
+
connectionId: Id,
|
|
408
|
+
name: z.string(),
|
|
409
|
+
app: z.string().nullable(),
|
|
410
|
+
status: z.string(),
|
|
411
|
+
health: z.string(),
|
|
412
|
+
dailyCap: z.number().int().nullable(),
|
|
413
|
+
hourlyCap: z.number().int().nullable(),
|
|
414
|
+
ramp: RampSchedule.nullable(),
|
|
415
|
+
timezone: z.string().nullable(),
|
|
416
|
+
sendingWindow: MailboxSettingsBody.shape.sendingWindow.unwrap().unwrap().nullable(),
|
|
417
|
+
pacing: z.object({ minGapSec: z.number().int(), jitterSec: z.number().int() }).nullable(),
|
|
418
|
+
/** Campaign plus warmup sends today (the mailbox's own day): one daily cap covers both. */
|
|
419
|
+
sentToday: z.number().int(),
|
|
420
|
+
/** The warmup share of `sentToday`. */
|
|
421
|
+
warmupToday: z.number().int().optional(),
|
|
422
|
+
bounceRate7d: z.number(),
|
|
423
|
+
replyRate7d: z.number(),
|
|
424
|
+
totals: z.object({ sent: z.number().int(), bounced: z.number().int(), complaints: z.number().int(), replied: z.number().int() }),
|
|
425
|
+
factors: z.array(HealthFactor),
|
|
426
|
+
/** Why the mailbox would be auto-paused (`bounce_rate`, `complaint_rate`), or null. */
|
|
427
|
+
pause: z.string().nullable(),
|
|
428
|
+
history: z.array(MailboxDay),
|
|
429
|
+
});
|
|
430
|
+
/** Inbox "Send opt-in ask": the list defaults to the reply's sequence opt-in ask. */
|
|
431
|
+
export const OptInAskBody = z.object({ listId: Id.optional() });
|
|
432
|
+
export const OptInAskResultDto = z.object({ result: z.enum(['sent', 'no_email', 'no_mailbox', 'no_list', 'already_subscribed', 'opted_out', 'suppressed', 'pending']) });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a config value refers to, so a form generated from the schema shows a live picker (lists, events seen, field registry...) instead
|
|
4
|
+
* of a text box. Stored as `x-picker` metadata: a valid OpenAPI extension, so API clients see it too.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PICKER_KINDS: readonly ['template', 'list', 'segment', 'tag', 'topic', 'field', 'event', 'connection', 'sender', 'webhook_template', 'user', 'product', 'form', 'sequence', 'workflow', 'node', 'object_type', 'score', 'integration', 'company', 'collection', 'in_app', 'site_message', 'wa_flow', 'slack_install', 'slack_template', 'ad_account', 'timezone', 'lifecycle_stage', 'experiment', 'secret', 'message_event', 'reply_class', 'custom_trigger', 'custom_action', 'loyalty_program', 'sender_pool', 'route_policy', 'geofence', 'loyalty_tier', 'loyalty_reward', 'event_path', 'collection_column', 'field_value', 'social_account'];
|
|
7
|
+
export type PickerKind = (typeof PICKER_KINDS)[number];
|
|
8
|
+
export declare const PICKER_KEY = "x-picker";
|
|
9
|
+
/** Marks `schema` as a reference to `kind` (keeps any description already on it; never copies a registry `id`, which must stay unique). */
|
|
10
|
+
export declare const pick: <T extends z.ZodType>(schema: T, kind: PickerKind) => T;
|
|
11
|
+
/** Message activity / delivery states a `message_event` trigger can start on. */
|
|
12
|
+
export declare const MESSAGE_EVENT_KINDS: readonly ['open', 'click', 'reply', 'unsubscribe', 'accepted', 'delivered', 'bounced', 'complained', 'failed', 'deferred', 'blocked'];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a config value refers to, so a form generated from the schema shows a live picker (lists, events seen, field registry...) instead
|
|
4
|
+
* of a text box. Stored as `x-picker` metadata: a valid OpenAPI extension, so API clients see it too.
|
|
5
|
+
*/
|
|
6
|
+
export const PICKER_KINDS = [
|
|
7
|
+
'template', 'list', 'segment', 'tag', 'topic', 'field', 'event', 'connection', 'sender', 'webhook_template', 'user', 'product', 'form',
|
|
8
|
+
'sequence', 'workflow', 'node', 'object_type', 'score', 'integration', 'company', 'collection', 'in_app', 'site_message', 'wa_flow',
|
|
9
|
+
'slack_install', 'slack_template', 'ad_account', 'timezone', 'lifecycle_stage', 'experiment', 'secret', 'message_event', 'reply_class',
|
|
10
|
+
'custom_trigger', 'custom_action', 'loyalty_program', 'sender_pool', 'route_policy', 'geofence',
|
|
11
|
+
'loyalty_tier', 'loyalty_reward', 'event_path', 'collection_column', 'field_value', 'social_account',
|
|
12
|
+
];
|
|
13
|
+
export const PICKER_KEY = 'x-picker';
|
|
14
|
+
/** Marks `schema` as a reference to `kind` (keeps any description already on it; never copies a registry `id`, which must stay unique). */
|
|
15
|
+
export const pick = (schema, kind) => {
|
|
16
|
+
const { id: _id, ...rest } = schema.meta() ?? {};
|
|
17
|
+
return schema.meta({ ...rest, [PICKER_KEY]: kind });
|
|
18
|
+
};
|
|
19
|
+
/** Message activity / delivery states a `message_event` trigger can start on. */
|
|
20
|
+
export const MESSAGE_EVENT_KINDS = ['open', 'click', 'reply', 'unsubscribe', 'accepted', 'delivered', 'bounced', 'complained', 'failed', 'deferred', 'blocked'];
|