@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.
Files changed (73) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +12 -2
  3. package/dist/contracts/analytics.d.ts +405 -0
  4. package/dist/contracts/analytics.js +77 -0
  5. package/dist/contracts/auth.d.ts +363 -0
  6. package/dist/contracts/auth.js +130 -0
  7. package/dist/contracts/billing.d.ts +143 -0
  8. package/dist/contracts/billing.js +32 -0
  9. package/dist/contracts/campaigns.d.ts +915 -0
  10. package/dist/contracts/campaigns.js +276 -0
  11. package/dist/contracts/common.d.ts +57 -0
  12. package/dist/contracts/common.js +35 -0
  13. package/dist/contracts/connectors.d.ts +179 -0
  14. package/dist/contracts/connectors.js +46 -0
  15. package/dist/contracts/consent.d.ts +628 -0
  16. package/dist/contracts/consent.js +194 -0
  17. package/dist/contracts/content-blocks.d.ts +165 -0
  18. package/dist/contracts/content-blocks.js +62 -0
  19. package/dist/contracts/content-library.d.ts +347 -0
  20. package/dist/contracts/content-library.js +52 -0
  21. package/dist/contracts/content.d.ts +955 -0
  22. package/dist/contracts/content.js +194 -0
  23. package/dist/contracts/delivery.d.ts +602 -0
  24. package/dist/contracts/delivery.js +220 -0
  25. package/dist/contracts/events.d.ts +514 -0
  26. package/dist/contracts/events.js +180 -0
  27. package/dist/contracts/experiments.d.ts +378 -0
  28. package/dist/contracts/experiments.js +140 -0
  29. package/dist/contracts/identity.d.ts +761 -0
  30. package/dist/contracts/identity.js +226 -0
  31. package/dist/contracts/index.d.ts +15 -0
  32. package/dist/contracts/index.js +15 -0
  33. package/dist/contracts/integrations.d.ts +445 -0
  34. package/dist/contracts/integrations.js +139 -0
  35. package/dist/contracts/leads.d.ts +733 -0
  36. package/dist/contracts/leads.js +125 -0
  37. package/dist/contracts/metrics.d.ts +465 -0
  38. package/dist/contracts/metrics.js +96 -0
  39. package/dist/contracts/outbound.d.ts +15535 -0
  40. package/dist/contracts/outbound.js +432 -0
  41. package/dist/contracts/pickers.d.ts +12 -0
  42. package/dist/contracts/pickers.js +20 -0
  43. package/dist/contracts/platform-admin.d.ts +244 -0
  44. package/dist/contracts/platform-admin.js +98 -0
  45. package/dist/contracts/postcards.d.ts +79 -0
  46. package/dist/contracts/postcards.js +29 -0
  47. package/dist/contracts/push.d.ts +530 -0
  48. package/dist/contracts/push.js +102 -0
  49. package/dist/contracts/rcs.d.ts +39 -0
  50. package/dist/contracts/rcs.js +19 -0
  51. package/dist/contracts/segments.d.ts +3187 -0
  52. package/dist/contracts/segments.js +421 -0
  53. package/dist/contracts/workflow-nodes.d.ts +2130 -0
  54. package/dist/contracts/workflow-nodes.js +346 -0
  55. package/dist/contracts/workflows.d.ts +46811 -0
  56. package/dist/contracts/workflows.js +350 -0
  57. package/dist/contracts/x10-platform.d.ts +2603 -0
  58. package/dist/contracts/x10-platform.js +129 -0
  59. package/dist/http.d.ts +30 -0
  60. package/dist/http.js +65 -0
  61. package/dist/index.d.ts +11631 -0
  62. package/dist/index.js +63 -0
  63. package/dist/platform.d.ts +163 -0
  64. package/dist/platform.js +40 -0
  65. package/dist/resources.d.ts +1338 -0
  66. package/dist/resources.js +56 -0
  67. package/dist/signature.d.ts +5 -0
  68. package/dist/signature.js +19 -0
  69. package/dist/x10.d.ts +1608 -0
  70. package/dist/x10.js +66 -0
  71. package/dist/z10.d.ts +256 -0
  72. package/dist/z10.js +46 -0
  73. package/package.json +40 -4
@@ -0,0 +1,363 @@
1
+ import { z } from 'zod';
2
+ export declare const Role: z.ZodEnum<{
3
+ admin: "admin";
4
+ analyst: "analyst";
5
+ marketer: "marketer";
6
+ owner: "owner";
7
+ sales: "sales";
8
+ viewer: "viewer";
9
+ }>;
10
+ export declare const ApiKeyKind: z.ZodEnum<{
11
+ secret: "secret";
12
+ site: "site";
13
+ }>;
14
+ export declare const MemberListsBody: z.ZodObject<{
15
+ listIds: z.ZodNullable<z.ZodArray<z.ZodUUID>>;
16
+ }, z.core.$strip>;
17
+ export declare const SignupDomainRulesDto: z.ZodObject<{
18
+ allow: z.ZodArray<z.ZodString>;
19
+ block: z.ZodArray<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export declare const UserDto: z.ZodObject<{
22
+ id: z.ZodUUID;
23
+ email: z.ZodString;
24
+ name: z.ZodString;
25
+ avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ emailVerified: z.ZodOptional<z.ZodBoolean>;
27
+ }, z.core.$strip>;
28
+ export declare const MeProfileBody: z.ZodObject<{
29
+ name: z.ZodOptional<z.ZodString>;
30
+ avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
31
+ }, z.core.$strip>;
32
+ export declare const WorkspaceDto: z.ZodObject<{
33
+ id: z.ZodUUID;
34
+ organizationId: z.ZodUUID;
35
+ name: z.ZodString;
36
+ timezone: z.ZodString;
37
+ defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
38
+ locale: z.ZodString;
39
+ postalAddress: z.ZodNullable<z.ZodString>;
40
+ adminEmail: z.ZodNullable<z.ZodString>;
41
+ unsubscribeRedirectUrl: z.ZodNullable<z.ZodString>;
42
+ quietHours: z.ZodObject<{
43
+ start: z.ZodString;
44
+ end: z.ZodString;
45
+ }, z.core.$strip>;
46
+ quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
47
+ start: z.ZodString;
48
+ end: z.ZodString;
49
+ }, z.core.$strip>>>;
50
+ apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
51
+ displayCurrency: z.ZodString;
52
+ fxRates: z.ZodRecord<z.ZodString, z.ZodNumber>;
53
+ sessionDays: z.ZodNullable<z.ZodNumber>;
54
+ campaignNotifyEmails: z.ZodArray<z.ZodString>;
55
+ websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ industry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ }, z.core.$strip>;
58
+ export declare const INDUSTRIES: readonly ['ecommerce', 'saas', 'agency', 'media', 'education', 'nonprofit', 'finance', 'health', 'travel', 'real_estate', 'b2b_services', 'other'];
59
+ export declare const Currency: z.ZodString;
60
+ export declare const WorkspacePatch: z.ZodObject<{
61
+ name: z.ZodOptional<z.ZodString>;
62
+ timezone: z.ZodOptional<z.ZodString>;
63
+ defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
64
+ locale: z.ZodOptional<z.ZodString>;
65
+ postalAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ adminEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
67
+ unsubscribeRedirectUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
68
+ quietHours: z.ZodOptional<z.ZodObject<{
69
+ start: z.ZodString;
70
+ end: z.ZodString;
71
+ }, z.core.$strip>>;
72
+ quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
73
+ start: z.ZodString;
74
+ end: z.ZodString;
75
+ }, z.core.$strip>>>;
76
+ apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
77
+ displayCurrency: z.ZodOptional<z.ZodString>;
78
+ fxRates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
79
+ sessionDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
80
+ campaignNotifyEmails: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
81
+ websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
82
+ industry: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
83
+ agency: "agency";
84
+ b2b_services: "b2b_services";
85
+ ecommerce: "ecommerce";
86
+ education: "education";
87
+ finance: "finance";
88
+ health: "health";
89
+ media: "media";
90
+ nonprofit: "nonprofit";
91
+ other: "other";
92
+ real_estate: "real_estate";
93
+ saas: "saas";
94
+ travel: "travel";
95
+ }>>>;
96
+ }, z.core.$strip>;
97
+ /** Dev-only sign-in (AUTH_DEV_LOGIN, never production): tests and local dev without Atlas. */
98
+ export declare const DevLoginBody: z.ZodObject<{
99
+ email: z.ZodEmail;
100
+ name: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>;
102
+ export declare const AuthResult: z.ZodObject<{
103
+ user: z.ZodObject<{
104
+ id: z.ZodUUID;
105
+ email: z.ZodString;
106
+ name: z.ZodString;
107
+ avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ emailVerified: z.ZodOptional<z.ZodBoolean>;
109
+ }, z.core.$strip>;
110
+ workspace: z.ZodNullable<z.ZodObject<{
111
+ id: z.ZodUUID;
112
+ organizationId: z.ZodUUID;
113
+ name: z.ZodString;
114
+ timezone: z.ZodString;
115
+ defaultSendHour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
116
+ locale: z.ZodString;
117
+ postalAddress: z.ZodNullable<z.ZodString>;
118
+ adminEmail: z.ZodNullable<z.ZodString>;
119
+ unsubscribeRedirectUrl: z.ZodNullable<z.ZodString>;
120
+ quietHours: z.ZodObject<{
121
+ start: z.ZodString;
122
+ end: z.ZodString;
123
+ }, z.core.$strip>;
124
+ quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
125
+ start: z.ZodString;
126
+ end: z.ZodString;
127
+ }, z.core.$strip>>>;
128
+ apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
129
+ displayCurrency: z.ZodString;
130
+ fxRates: z.ZodRecord<z.ZodString, z.ZodNumber>;
131
+ sessionDays: z.ZodNullable<z.ZodNumber>;
132
+ campaignNotifyEmails: z.ZodArray<z.ZodString>;
133
+ websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
+ industry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ }, z.core.$strip>>;
136
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
137
+ }, z.core.$strip>;
138
+ export declare const LogoutResult: z.ZodObject<{
139
+ ok: z.ZodLiteral<true>;
140
+ redirectTo: z.ZodNullable<z.ZodString>;
141
+ }, z.core.$strip>;
142
+ export declare const MeResult: z.ZodObject<{
143
+ actor: z.ZodObject<{
144
+ type: z.ZodString;
145
+ id: z.ZodString;
146
+ workspaceId: z.ZodUUID;
147
+ role: z.ZodOptional<z.ZodEnum<{
148
+ admin: "admin";
149
+ analyst: "analyst";
150
+ marketer: "marketer";
151
+ owner: "owner";
152
+ sales: "sales";
153
+ viewer: "viewer";
154
+ }>>;
155
+ scopes: z.ZodArray<z.ZodString>;
156
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
157
+ }, z.core.$strip>;
158
+ user: z.ZodNullable<z.ZodObject<{
159
+ id: z.ZodUUID;
160
+ email: z.ZodString;
161
+ name: z.ZodString;
162
+ avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ emailVerified: z.ZodOptional<z.ZodBoolean>;
164
+ }, z.core.$strip>>;
165
+ workspaces: z.ZodArray<z.ZodObject<{
166
+ id: z.ZodUUID;
167
+ name: z.ZodString;
168
+ role: z.ZodEnum<{
169
+ admin: "admin";
170
+ analyst: "analyst";
171
+ marketer: "marketer";
172
+ owner: "owner";
173
+ sales: "sales";
174
+ viewer: "viewer";
175
+ }>;
176
+ }, z.core.$strip>>;
177
+ impersonatedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
178
+ id: z.ZodUUID;
179
+ name: z.ZodString;
180
+ }, z.core.$strip>>>;
181
+ operator: z.ZodOptional<z.ZodBoolean>;
182
+ }, z.core.$strip>;
183
+ export declare const SessionDto: z.ZodObject<{
184
+ id: z.ZodUUID;
185
+ ip: z.ZodNullable<z.ZodString>;
186
+ userAgent: z.ZodNullable<z.ZodString>;
187
+ createdAt: z.ZodISODateTime;
188
+ expiresAt: z.ZodISODateTime;
189
+ }, z.core.$strip>;
190
+ export declare const ApiKeyCreate: z.ZodObject<{
191
+ name: z.ZodString;
192
+ kind: z.ZodEnum<{
193
+ secret: "secret";
194
+ site: "site";
195
+ }>;
196
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
197
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
198
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
199
+ allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
200
+ allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
201
+ rateLimitPerMin: z.ZodOptional<z.ZodNumber>;
202
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
203
+ expiresAt: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
204
+ }, z.core.$strip>;
205
+ /** Change a live key's own rate budget; null drops it back to the default limit. */
206
+ export declare const ApiKeyUpdate: z.ZodObject<{
207
+ rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
208
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
209
+ }, z.core.$strip>;
210
+ export declare const ApiKeyDto: z.ZodObject<{
211
+ id: z.ZodUUID;
212
+ name: z.ZodString;
213
+ kind: z.ZodEnum<{
214
+ secret: "secret";
215
+ site: "site";
216
+ }>;
217
+ prefix: z.ZodString;
218
+ scopes: z.ZodArray<z.ZodString>;
219
+ allowedOrigins: z.ZodArray<z.ZodString>;
220
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
221
+ allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
222
+ allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
223
+ rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
224
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
226
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
227
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
228
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
229
+ createdAt: z.ZodISODateTime;
230
+ }, z.core.$strip>;
231
+ export declare const ApiKeyCreated: z.ZodObject<{
232
+ id: z.ZodUUID;
233
+ name: z.ZodString;
234
+ kind: z.ZodEnum<{
235
+ secret: "secret";
236
+ site: "site";
237
+ }>;
238
+ prefix: z.ZodString;
239
+ scopes: z.ZodArray<z.ZodString>;
240
+ allowedOrigins: z.ZodArray<z.ZodString>;
241
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
242
+ allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
243
+ allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
+ rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
245
+ app: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
247
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
248
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
249
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
250
+ createdAt: z.ZodISODateTime;
251
+ plaintext: z.ZodString;
252
+ }, z.core.$strip>;
253
+ export declare const MemberDto: z.ZodObject<{
254
+ userId: z.ZodUUID;
255
+ email: z.ZodString;
256
+ name: z.ZodString;
257
+ role: z.ZodEnum<{
258
+ admin: "admin";
259
+ analyst: "analyst";
260
+ marketer: "marketer";
261
+ owner: "owner";
262
+ sales: "sales";
263
+ viewer: "viewer";
264
+ }>;
265
+ listIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
266
+ }, z.core.$strip>;
267
+ export declare const InviteBody: z.ZodObject<{
268
+ email: z.ZodEmail;
269
+ role: z.ZodEnum<{
270
+ admin: "admin";
271
+ analyst: "analyst";
272
+ marketer: "marketer";
273
+ owner: "owner";
274
+ sales: "sales";
275
+ viewer: "viewer";
276
+ }>;
277
+ }, z.core.$strip>;
278
+ export declare const InvitationResult: z.ZodObject<{
279
+ id: z.ZodUUID;
280
+ email: z.ZodString;
281
+ role: z.ZodEnum<{
282
+ admin: "admin";
283
+ analyst: "analyst";
284
+ marketer: "marketer";
285
+ owner: "owner";
286
+ sales: "sales";
287
+ viewer: "viewer";
288
+ }>;
289
+ token: z.ZodString;
290
+ expiresAt: z.ZodISODateTime;
291
+ emailed: z.ZodOptional<z.ZodBoolean>;
292
+ }, z.core.$strip>;
293
+ export declare const RoleBody: z.ZodObject<{
294
+ role: z.ZodEnum<{
295
+ admin: "admin";
296
+ analyst: "analyst";
297
+ marketer: "marketer";
298
+ owner: "owner";
299
+ sales: "sales";
300
+ viewer: "viewer";
301
+ }>;
302
+ }, z.core.$strip>;
303
+ export declare const AcceptInvitationBody: z.ZodObject<{
304
+ token: z.ZodString;
305
+ }, z.core.$strip>;
306
+ export declare const AuditDto: z.ZodObject<{
307
+ id: z.ZodUUID;
308
+ actorType: z.ZodString;
309
+ actorId: z.ZodString;
310
+ impersonatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ action: z.ZodString;
312
+ targetType: z.ZodString;
313
+ targetId: z.ZodNullable<z.ZodString>;
314
+ before: z.ZodNullable<z.ZodUnknown>;
315
+ after: z.ZodNullable<z.ZodUnknown>;
316
+ at: z.ZodISODateTime;
317
+ }, z.core.$strip>;
318
+ export declare const AuditFilter: z.ZodObject<{
319
+ action: z.ZodOptional<z.ZodString>;
320
+ targetType: z.ZodOptional<z.ZodString>;
321
+ actorId: z.ZodOptional<z.ZodString>;
322
+ from: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
323
+ to: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
324
+ }, z.core.$strip>;
325
+ export declare const AuditExportQuery: z.ZodObject<{
326
+ action: z.ZodOptional<z.ZodString>;
327
+ targetType: z.ZodOptional<z.ZodString>;
328
+ actorId: z.ZodOptional<z.ZodString>;
329
+ from: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
330
+ to: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
331
+ format: z.ZodDefault<z.ZodEnum<{
332
+ csv: "csv";
333
+ ndjson: "ndjson";
334
+ }>>;
335
+ order: z.ZodDefault<z.ZodEnum<{
336
+ asc: "asc";
337
+ desc: "desc";
338
+ }>>;
339
+ }, z.core.$strip>;
340
+ export declare const AuditExport: z.ZodObject<{
341
+ filename: z.ZodString;
342
+ format: z.ZodEnum<{
343
+ csv: "csv";
344
+ ndjson: "ndjson";
345
+ }>;
346
+ rowCount: z.ZodNumber;
347
+ truncated: z.ZodBoolean;
348
+ content: z.ZodString;
349
+ }, z.core.$strip>;
350
+ /** Company sign-on through the workspace's Atlas organization. */
351
+ export declare const SsoStatusDto: z.ZodObject<{
352
+ available: z.ZodBoolean;
353
+ configured: z.ZodBoolean;
354
+ connections: z.ZodArray<z.ZodObject<{
355
+ id: z.ZodString;
356
+ type: z.ZodString;
357
+ status: z.ZodString;
358
+ }, z.core.$strip>>;
359
+ }, z.core.$strip>;
360
+ export declare const SsoSetupLinkDto: z.ZodObject<{
361
+ url: z.ZodURL;
362
+ expiresAt: z.ZodNullable<z.ZodString>;
363
+ }, z.core.$strip>;
@@ -0,0 +1,130 @@
1
+ import { z } from 'zod';
2
+ import { AppSlug, Id, Timestamp, TimestampIn } from './common.js';
3
+ export const Role = z.enum(['owner', 'admin', 'marketer', 'sales', 'analyst', 'viewer']);
4
+ export const ApiKeyKind = z.enum(['secret', 'site']);
5
+ const Hhmm = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
6
+ export const MemberListsBody = z.object({ listIds: z.array(z.uuid()).max(500).nullable() });
7
+ export const SignupDomainRulesDto = z.object({ allow: z.array(z.string().max(255)).max(500), block: z.array(z.string().max(255)).max(500) });
8
+ export const UserDto = z.object({ id: Id, email: z.string(), name: z.string(), avatarUrl: z.string().nullable().optional(), emailVerified: z.boolean().optional() });
9
+ export const MeProfileBody = z.object({ name: z.string().trim().min(1).max(120).optional(), avatarUrl: z.url({ protocol: /^https$/ }).max(500).nullable().optional() });
10
+ export const WorkspaceDto = z.object({
11
+ id: Id,
12
+ organizationId: Id,
13
+ name: z.string(),
14
+ timezone: z.string(),
15
+ defaultSendHour: z.number().int().nullable().optional(),
16
+ locale: z.string(),
17
+ postalAddress: z.string().nullable(),
18
+ adminEmail: z.string().nullable(),
19
+ unsubscribeRedirectUrl: z.string().nullable(),
20
+ quietHours: z.object({ start: Hhmm, end: Hhmm }),
21
+ quietHoursByChannel: z.partialRecord(z.string(), z.object({ start: Hhmm, end: Hhmm })).optional(),
22
+ apiKeyExpiryDays: z.number().int().nullable().optional(),
23
+ displayCurrency: z.string(),
24
+ fxRates: z.record(z.string(), z.number()),
25
+ sessionDays: z.number().int().nullable(),
26
+ campaignNotifyEmails: z.array(z.string()),
27
+ websiteUrl: z.string().nullable().optional(),
28
+ industry: z.string().nullable().optional(),
29
+ });
30
+ export const INDUSTRIES = ['ecommerce', 'saas', 'agency', 'media', 'education', 'nonprofit', 'finance', 'health', 'travel', 'real_estate', 'b2b_services', 'other'];
31
+ export const Currency = z.string().regex(/^[A-Z]{3}$/, 'Use a 3-letter currency code such as USD');
32
+ export const WorkspacePatch = z.object({
33
+ name: z.string().min(1).max(120).optional(),
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(),
37
+ locale: z.string().min(2).max(16).optional(),
38
+ postalAddress: z.string().max(500).nullable().optional(),
39
+ adminEmail: z.email().nullable().optional(),
40
+ unsubscribeRedirectUrl: z.url({ protocol: /^https$/ }).nullable().optional(),
41
+ quietHours: z.object({ start: Hhmm, end: Hhmm }).optional(),
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(),
47
+ apiKeyExpiryDays: z.number().int().min(1).max(730).nullable().optional(),
48
+ displayCurrency: Currency.optional(),
49
+ fxRates: z.record(Currency, z.number().positive().max(1_000_000)).optional(),
50
+ sessionDays: z.number().int().min(1).max(365).nullable().optional(),
51
+ campaignNotifyEmails: z.array(z.email()).max(10).optional(),
52
+ websiteUrl: z.url({ protocol: /^https?$/ }).max(500).nullable().optional(),
53
+ industry: z.enum(INDUSTRIES).nullable().optional(),
54
+ });
55
+ /** Dev-only sign-in (AUTH_DEV_LOGIN, never production): tests and local dev without Atlas. */
56
+ export const DevLoginBody = z.object({ email: z.email().max(254), name: z.string().min(1).max(120).optional() });
57
+ export const AuthResult = z.object({ user: UserDto, workspace: WorkspaceDto.nullable(), expiresAt: Timestamp.nullable() });
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() });
59
+ export const MeResult = z.object({
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() }),
61
+ user: UserDto.nullable(),
62
+ workspaces: z.array(z.object({ id: Id, name: z.string(), role: Role })),
63
+ /** Set while an owner is viewing the app as this user. */
64
+ impersonatedBy: z.object({ id: Id, name: z.string() }).nullable().optional(),
65
+ /** Platform operator (PLATFORM_OPERATOR_EMAILS): the operator console is open to them. */
66
+ operator: z.boolean().optional(),
67
+ });
68
+ export const SessionDto = z.object({ id: Id, ip: z.string().nullable(), userAgent: z.string().nullable(), createdAt: Timestamp, expiresAt: Timestamp });
69
+ export const ApiKeyCreate = z.object({
70
+ name: z.string().min(1).max(120),
71
+ kind: ApiKeyKind,
72
+ scopes: z.array(z.string().max(64)).max(64).default([]),
73
+ allowedOrigins: z.array(z.string().max(255)).max(50).optional(),
74
+ /** Secret keys: restrict sends to these from-domains / connection ids. Empty = unrestricted. */
75
+ allowedDomains: z.array(z.string().max(255)).max(50).optional(),
76
+ allowedConnectionIds: z.array(z.uuid()).max(50).optional(),
77
+ /** Secret keys: limit the outbound API to these campaigns (sequences). Empty = every campaign. */
78
+ allowedSequenceIds: z.array(z.uuid()).max(50).optional(),
79
+ /** Optional cap on requests per minute for this key; over it the API answers 429. */
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(),
83
+ /** Optional expiry; after it the key answers 401 like a revoked one. */
84
+ expiresAt: TimestampIn.optional(),
85
+ });
86
+ /** Change a live key's own rate budget; null drops it back to the default limit. */
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() });
88
+ export const ApiKeyDto = z.object({
89
+ id: Id,
90
+ name: z.string(),
91
+ kind: ApiKeyKind,
92
+ prefix: z.string(),
93
+ scopes: z.array(z.string()),
94
+ allowedOrigins: z.array(z.string()),
95
+ allowedDomains: z.array(z.string()).optional(),
96
+ allowedConnectionIds: z.array(z.string()).optional(),
97
+ allowedSequenceIds: z.array(z.string()).optional(),
98
+ rateLimitPerMin: z.number().int().nullable().optional(),
99
+ app: z.string().nullable().optional(),
100
+ lastUsedAt: Timestamp.nullable(),
101
+ revokedAt: Timestamp.nullable(),
102
+ expiresAt: Timestamp.nullable().optional(),
103
+ /** User id of the developer who minted the key. */
104
+ createdBy: Id.nullable().optional(),
105
+ createdAt: Timestamp,
106
+ });
107
+ export const ApiKeyCreated = ApiKeyDto.extend({ plaintext: z.string() });
108
+ export const MemberDto = z.object({ userId: Id, email: z.string(), name: z.string(), role: Role, listIds: z.array(z.string()).nullable().optional() });
109
+ export const InviteBody = z.object({ email: z.email().max(254), role: Role });
110
+ export const InvitationResult = z.object({ id: Id, email: z.string(), role: Role, token: z.string(), expiresAt: Timestamp, emailed: z.boolean().optional() });
111
+ export const RoleBody = z.object({ role: Role });
112
+ export const AcceptInvitationBody = z.object({ token: z.string().min(10).max(200) });
113
+ export const AuditDto = z.object({
114
+ id: Id,
115
+ actorType: z.string(),
116
+ actorId: z.string(),
117
+ impersonatedBy: z.string().nullable().optional(),
118
+ action: z.string(),
119
+ targetType: z.string(),
120
+ targetId: z.string().nullable(),
121
+ before: z.unknown().nullable(),
122
+ after: z.unknown().nullable(),
123
+ at: Timestamp,
124
+ });
125
+ export const AuditFilter = z.object({ action: z.string().optional(), targetType: z.string().optional(), actorId: z.string().max(200).optional(), from: TimestampIn.optional(), to: TimestampIn.optional() });
126
+ export const AuditExportQuery = AuditFilter.extend({ format: z.enum(['csv', 'ndjson']).default('csv'), order: z.enum(['asc', 'desc']).default('desc') });
127
+ export const AuditExport = z.object({ filename: z.string(), format: z.enum(['csv', 'ndjson']), rowCount: z.number().int(), truncated: z.boolean(), content: z.string() });
128
+ /** Company sign-on through the workspace's Atlas organization. */
129
+ export const SsoStatusDto = z.object({ available: z.boolean(), configured: z.boolean(), connections: z.array(z.object({ id: z.string(), type: z.string(), status: z.string() })) });
130
+ export const SsoSetupLinkDto = z.object({ url: z.url(), expiresAt: z.string().nullable() });
@@ -0,0 +1,143 @@
1
+ import { z } from 'zod';
2
+ /** `profiles` is a gauge, not a counter: the month's peak of active profiles (the overage basis). */
3
+ export declare const USAGE_METRICS: readonly ['sends_email', 'sends_sms', 'sends_whatsapp', 'sends_push', 'sends_postcard', 'ai_tokens', 'profiles'];
4
+ export declare const UsageMetric: z.ZodEnum<{
5
+ ai_tokens: "ai_tokens";
6
+ profiles: "profiles";
7
+ sends_email: "sends_email";
8
+ sends_postcard: "sends_postcard";
9
+ sends_push: "sends_push";
10
+ sends_sms: "sends_sms";
11
+ sends_whatsapp: "sends_whatsapp";
12
+ }>;
13
+ export type UsageMetric = z.infer<typeof UsageMetric>;
14
+ export declare const PlanLimits: z.ZodObject<{
15
+ sends_email: z.ZodNullable<z.ZodNumber>;
16
+ sends_sms: z.ZodNullable<z.ZodNumber>;
17
+ sends_whatsapp: z.ZodNullable<z.ZodNumber>;
18
+ sends_push: z.ZodNullable<z.ZodNumber>;
19
+ sends_postcard: z.ZodNullable<z.ZodNumber>;
20
+ ai_tokens: z.ZodNullable<z.ZodNumber>;
21
+ seats: z.ZodNullable<z.ZodNumber>;
22
+ profiles: z.ZodNullable<z.ZodNumber>;
23
+ mailboxes: z.ZodNullable<z.ZodNumber>;
24
+ }, z.core.$strip>;
25
+ export type PlanLimits = z.infer<typeof PlanLimits>;
26
+ /** `limits` are hard caps; `includedProfiles` is the band a paid plan bills overage past (null = no band). */
27
+ export declare const PlanDto: z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ limits: z.ZodObject<{
31
+ sends_email: z.ZodNullable<z.ZodNumber>;
32
+ sends_sms: z.ZodNullable<z.ZodNumber>;
33
+ sends_whatsapp: z.ZodNullable<z.ZodNumber>;
34
+ sends_push: z.ZodNullable<z.ZodNumber>;
35
+ sends_postcard: z.ZodNullable<z.ZodNumber>;
36
+ ai_tokens: z.ZodNullable<z.ZodNumber>;
37
+ seats: z.ZodNullable<z.ZodNumber>;
38
+ profiles: z.ZodNullable<z.ZodNumber>;
39
+ mailboxes: z.ZodNullable<z.ZodNumber>;
40
+ }, z.core.$strip>;
41
+ monthlyUsd: z.ZodNullable<z.ZodNumber>;
42
+ includedProfiles: z.ZodNullable<z.ZodNumber>;
43
+ profileOveragePer1kUsd: z.ZodNullable<z.ZodNumber>;
44
+ }, z.core.$strip>;
45
+ export declare const UsageLine: z.ZodObject<{
46
+ metric: z.ZodEnum<{
47
+ ai_tokens: "ai_tokens";
48
+ profiles: "profiles";
49
+ sends_email: "sends_email";
50
+ sends_postcard: "sends_postcard";
51
+ sends_push: "sends_push";
52
+ sends_sms: "sends_sms";
53
+ sends_whatsapp: "sends_whatsapp";
54
+ }>;
55
+ used: z.ZodNumber;
56
+ limit: z.ZodNullable<z.ZodNumber>;
57
+ softLimit: z.ZodNullable<z.ZodNumber>;
58
+ }, z.core.$strip>;
59
+ export declare const BillingSummary: z.ZodObject<{
60
+ plan: z.ZodObject<{
61
+ id: z.ZodString;
62
+ name: z.ZodString;
63
+ limits: z.ZodObject<{
64
+ sends_email: z.ZodNullable<z.ZodNumber>;
65
+ sends_sms: z.ZodNullable<z.ZodNumber>;
66
+ sends_whatsapp: z.ZodNullable<z.ZodNumber>;
67
+ sends_push: z.ZodNullable<z.ZodNumber>;
68
+ sends_postcard: z.ZodNullable<z.ZodNumber>;
69
+ ai_tokens: z.ZodNullable<z.ZodNumber>;
70
+ seats: z.ZodNullable<z.ZodNumber>;
71
+ profiles: z.ZodNullable<z.ZodNumber>;
72
+ mailboxes: z.ZodNullable<z.ZodNumber>;
73
+ }, z.core.$strip>;
74
+ monthlyUsd: z.ZodNullable<z.ZodNumber>;
75
+ includedProfiles: z.ZodNullable<z.ZodNumber>;
76
+ profileOveragePer1kUsd: z.ZodNullable<z.ZodNumber>;
77
+ }, z.core.$strip>;
78
+ status: z.ZodString;
79
+ period: z.ZodString;
80
+ currentPeriodEnd: z.ZodNullable<z.ZodISODateTime>;
81
+ limits: z.ZodObject<{
82
+ sends_email: z.ZodNullable<z.ZodNumber>;
83
+ sends_sms: z.ZodNullable<z.ZodNumber>;
84
+ sends_whatsapp: z.ZodNullable<z.ZodNumber>;
85
+ sends_push: z.ZodNullable<z.ZodNumber>;
86
+ sends_postcard: z.ZodNullable<z.ZodNumber>;
87
+ ai_tokens: z.ZodNullable<z.ZodNumber>;
88
+ seats: z.ZodNullable<z.ZodNumber>;
89
+ profiles: z.ZodNullable<z.ZodNumber>;
90
+ mailboxes: z.ZodNullable<z.ZodNumber>;
91
+ }, z.core.$strip>;
92
+ usage: z.ZodArray<z.ZodObject<{
93
+ metric: z.ZodEnum<{
94
+ ai_tokens: "ai_tokens";
95
+ profiles: "profiles";
96
+ sends_email: "sends_email";
97
+ sends_postcard: "sends_postcard";
98
+ sends_push: "sends_push";
99
+ sends_sms: "sends_sms";
100
+ sends_whatsapp: "sends_whatsapp";
101
+ }>;
102
+ used: z.ZodNumber;
103
+ limit: z.ZodNullable<z.ZodNumber>;
104
+ softLimit: z.ZodNullable<z.ZodNumber>;
105
+ }, z.core.$strip>>;
106
+ managedByProvider: z.ZodBoolean;
107
+ }, z.core.$strip>;
108
+ export declare const SetPlanBody: z.ZodObject<{
109
+ planId: z.ZodString;
110
+ limitOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>>;
111
+ }, z.core.$strip>;
112
+ export declare const UrlBody: z.ZodObject<{
113
+ returnUrl: z.ZodURL;
114
+ }, z.core.$strip>;
115
+ export declare const CheckoutBody: z.ZodObject<{
116
+ planId: z.ZodString;
117
+ successUrl: z.ZodURL;
118
+ cancelUrl: z.ZodURL;
119
+ }, z.core.$strip>;
120
+ export declare const UrlResult: z.ZodObject<{
121
+ url: z.ZodString;
122
+ }, z.core.$strip>;
123
+ /** The caller's own link in Hermeticor's referral program (Referalli). `enabled: false` = the program is not configured here. */
124
+ /** `percent`/`months` come from the program's published rule (null when Referalli did not answer), so the copy cannot drift from it. */
125
+ /** `terms` is Referalli's own summary of the reward per locale (en, es, de, fr, pt, it, nl, ja, …), so tiered or capped rules read right. */
126
+ export declare const MyReferralDto: z.ZodObject<{
127
+ enabled: z.ZodBoolean;
128
+ code: z.ZodNullable<z.ZodString>;
129
+ link: z.ZodNullable<z.ZodString>;
130
+ terms: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
131
+ }, z.core.$strip>;
132
+ /** Stripe Connect payouts (boost bounties, ad network earnings). `configured` false = no platform Stripe account: everything is settled by hand. */
133
+ export declare const PayoutAccountDto: z.ZodObject<{
134
+ configured: z.ZodBoolean;
135
+ started: z.ZodBoolean;
136
+ payoutsEnabled: z.ZodBoolean;
137
+ detailsSubmitted: z.ZodBoolean;
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. */
140
+ export declare const PayoutOnboardBody: z.ZodObject<{
141
+ returnUrl: z.ZodURL;
142
+ country: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>;
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { Timestamp } from './common.js';
3
+ /** `profiles` is a gauge, not a counter: the month's peak of active profiles (the overage basis). */
4
+ export const USAGE_METRICS = ['sends_email', 'sends_sms', 'sends_whatsapp', 'sends_push', 'sends_postcard', 'ai_tokens', 'profiles'];
5
+ export const UsageMetric = z.enum(USAGE_METRICS);
6
+ /** null = unlimited. */
7
+ const Limit = z.number().int().nonnegative().nullable();
8
+ export const PlanLimits = z.object({ sends_email: Limit, sends_sms: Limit, sends_whatsapp: Limit, sends_push: Limit, sends_postcard: Limit, ai_tokens: Limit, seats: Limit, profiles: Limit, mailboxes: Limit });
9
+ /** `limits` are hard caps; `includedProfiles` is the band a paid plan bills overage past (null = no band). */
10
+ export const PlanDto = z.object({ id: z.string(), name: z.string(), limits: PlanLimits, monthlyUsd: z.number().nullable(), includedProfiles: z.number().int().nullable(), profileOveragePer1kUsd: z.number().nullable() });
11
+ export const UsageLine = z.object({ metric: UsageMetric, used: z.number().int(), limit: Limit, softLimit: Limit });
12
+ export const BillingSummary = z.object({
13
+ plan: PlanDto,
14
+ status: z.string(),
15
+ period: z.string(),
16
+ currentPeriodEnd: Timestamp.nullable(),
17
+ limits: PlanLimits,
18
+ usage: z.array(UsageLine),
19
+ managedByProvider: z.boolean(),
20
+ });
21
+ export const SetPlanBody = z.object({ planId: z.string().min(1).max(40), limitOverrides: z.record(z.string(), z.number().int().nonnegative().nullable()).optional() });
22
+ export const UrlBody = z.object({ returnUrl: z.url().max(2048) });
23
+ export const CheckoutBody = z.object({ planId: z.string().min(1).max(40), successUrl: z.url().max(2048), cancelUrl: z.url().max(2048) });
24
+ export const UrlResult = z.object({ url: z.string() });
25
+ /** The caller's own link in Hermeticor's referral program (Referalli). `enabled: false` = the program is not configured here. */
26
+ /** `percent`/`months` come from the program's published rule (null when Referalli did not answer), so the copy cannot drift from it. */
27
+ /** `terms` is Referalli's own summary of the reward per locale (en, es, de, fr, pt, it, nl, ja, …), so tiered or capped rules read right. */
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
+ /** Stripe Connect payouts (boost bounties, ad network earnings). `configured` false = no platform Stripe account: everything is settled by hand. */
30
+ export const PayoutAccountDto = z.object({ configured: z.boolean(), started: z.boolean(), payoutsEnabled: z.boolean(), detailsSubmitted: z.boolean() });
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() });