@hermeticacomms/sdk-node 0.0.0-stage → 0.1.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 +359 -0
- package/dist/contracts/auth.js +121 -0
- package/dist/contracts/billing.d.ts +141 -0
- package/dist/contracts/billing.js +31 -0
- package/dist/contracts/campaigns.d.ts +918 -0
- package/dist/contracts/campaigns.js +269 -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 +604 -0
- package/dist/contracts/consent.js +180 -0
- package/dist/contracts/content-blocks.d.ts +164 -0
- package/dist/contracts/content-blocks.js +60 -0
- package/dist/contracts/content-library.d.ts +339 -0
- package/dist/contracts/content-library.js +50 -0
- package/dist/contracts/content.d.ts +949 -0
- package/dist/contracts/content.js +192 -0
- package/dist/contracts/delivery.d.ts +599 -0
- package/dist/contracts/delivery.js +214 -0
- package/dist/contracts/events.d.ts +513 -0
- package/dist/contracts/events.js +178 -0
- package/dist/contracts/experiments.d.ts +376 -0
- package/dist/contracts/experiments.js +136 -0
- package/dist/contracts/identity.d.ts +756 -0
- package/dist/contracts/identity.js +225 -0
- package/dist/contracts/index.d.ts +15 -0
- package/dist/contracts/index.js +15 -0
- package/dist/contracts/integrations.d.ts +381 -0
- package/dist/contracts/integrations.js +112 -0
- package/dist/contracts/leads.d.ts +733 -0
- package/dist/contracts/leads.js +125 -0
- package/dist/contracts/metrics.d.ts +460 -0
- package/dist/contracts/metrics.js +90 -0
- package/dist/contracts/outbound.d.ts +15510 -0
- package/dist/contracts/outbound.js +423 -0
- package/dist/contracts/pickers.d.ts +12 -0
- package/dist/contracts/pickers.js +20 -0
- package/dist/contracts/platform-admin.d.ts +230 -0
- package/dist/contracts/platform-admin.js +91 -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 +3182 -0
- package/dist/contracts/segments.js +416 -0
- package/dist/contracts/workflow-nodes.d.ts +2118 -0
- package/dist/contracts/workflow-nodes.js +341 -0
- package/dist/contracts/workflows.d.ts +46413 -0
- package/dist/contracts/workflows.js +341 -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 +11507 -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 +1318 -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 +1607 -0
- package/dist/x10.js +66 -0
- package/dist/z10.d.ts +251 -0
- package/dist/z10.js +46 -0
- package/package.json +40 -4
|
@@ -0,0 +1,359 @@
|
|
|
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
|
+
locale: z.ZodString;
|
|
38
|
+
postalAddress: z.ZodNullable<z.ZodString>;
|
|
39
|
+
adminEmail: z.ZodNullable<z.ZodString>;
|
|
40
|
+
unsubscribeRedirectUrl: z.ZodNullable<z.ZodString>;
|
|
41
|
+
quietHours: z.ZodObject<{
|
|
42
|
+
start: z.ZodString;
|
|
43
|
+
end: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
|
|
46
|
+
start: z.ZodString;
|
|
47
|
+
end: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
|
+
displayCurrency: z.ZodString;
|
|
51
|
+
fxRates: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
52
|
+
sessionDays: z.ZodNullable<z.ZodNumber>;
|
|
53
|
+
campaignNotifyEmails: z.ZodArray<z.ZodString>;
|
|
54
|
+
websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
industry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export declare const INDUSTRIES: readonly ['ecommerce', 'saas', 'agency', 'media', 'education', 'nonprofit', 'finance', 'health', 'travel', 'real_estate', 'b2b_services', 'other'];
|
|
58
|
+
export declare const Currency: z.ZodString;
|
|
59
|
+
export declare const WorkspacePatch: z.ZodObject<{
|
|
60
|
+
name: z.ZodOptional<z.ZodString>;
|
|
61
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
62
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
63
|
+
postalAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
adminEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
65
|
+
unsubscribeRedirectUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
66
|
+
quietHours: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
start: z.ZodString;
|
|
68
|
+
end: z.ZodString;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
71
|
+
email: "email";
|
|
72
|
+
push: "push";
|
|
73
|
+
whatsapp: "whatsapp";
|
|
74
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
75
|
+
start: z.ZodString;
|
|
76
|
+
end: z.ZodString;
|
|
77
|
+
}, z.core.$strip>>>;
|
|
78
|
+
apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
79
|
+
displayCurrency: z.ZodOptional<z.ZodString>;
|
|
80
|
+
fxRates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
81
|
+
sessionDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
82
|
+
campaignNotifyEmails: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
|
|
83
|
+
websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
84
|
+
industry: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
85
|
+
agency: "agency";
|
|
86
|
+
b2b_services: "b2b_services";
|
|
87
|
+
ecommerce: "ecommerce";
|
|
88
|
+
education: "education";
|
|
89
|
+
finance: "finance";
|
|
90
|
+
health: "health";
|
|
91
|
+
media: "media";
|
|
92
|
+
nonprofit: "nonprofit";
|
|
93
|
+
other: "other";
|
|
94
|
+
real_estate: "real_estate";
|
|
95
|
+
saas: "saas";
|
|
96
|
+
travel: "travel";
|
|
97
|
+
}>>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
/** Dev-only sign-in (AUTH_DEV_LOGIN, never production): tests and local dev without Atlas. */
|
|
100
|
+
export declare const DevLoginBody: z.ZodObject<{
|
|
101
|
+
email: z.ZodEmail;
|
|
102
|
+
name: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export declare const AuthResult: z.ZodObject<{
|
|
105
|
+
user: z.ZodObject<{
|
|
106
|
+
id: z.ZodUUID;
|
|
107
|
+
email: z.ZodString;
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
113
|
+
id: z.ZodUUID;
|
|
114
|
+
organizationId: z.ZodUUID;
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
timezone: z.ZodString;
|
|
117
|
+
locale: z.ZodString;
|
|
118
|
+
postalAddress: z.ZodNullable<z.ZodString>;
|
|
119
|
+
adminEmail: z.ZodNullable<z.ZodString>;
|
|
120
|
+
unsubscribeRedirectUrl: z.ZodNullable<z.ZodString>;
|
|
121
|
+
quietHours: z.ZodObject<{
|
|
122
|
+
start: z.ZodString;
|
|
123
|
+
end: z.ZodString;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
quietHoursByChannel: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodObject<{
|
|
126
|
+
start: z.ZodString;
|
|
127
|
+
end: z.ZodString;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
apiKeyExpiryDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
130
|
+
displayCurrency: z.ZodString;
|
|
131
|
+
fxRates: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
132
|
+
sessionDays: z.ZodNullable<z.ZodNumber>;
|
|
133
|
+
campaignNotifyEmails: z.ZodArray<z.ZodString>;
|
|
134
|
+
websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
industry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
export declare const LogoutResult: z.ZodObject<{
|
|
140
|
+
ok: z.ZodLiteral<true>;
|
|
141
|
+
redirectTo: z.ZodNullable<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export declare const MeResult: z.ZodObject<{
|
|
144
|
+
actor: z.ZodObject<{
|
|
145
|
+
type: z.ZodString;
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
workspaceId: z.ZodUUID;
|
|
148
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
admin: "admin";
|
|
150
|
+
analyst: "analyst";
|
|
151
|
+
marketer: "marketer";
|
|
152
|
+
owner: "owner";
|
|
153
|
+
sales: "sales";
|
|
154
|
+
viewer: "viewer";
|
|
155
|
+
}>>;
|
|
156
|
+
scopes: z.ZodArray<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
|
+
expiresAt: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
/** Change a live key's own rate budget; null drops it back to the default limit. */
|
|
205
|
+
export declare const ApiKeyUpdate: z.ZodObject<{
|
|
206
|
+
rateLimitPerMin: z.ZodNullable<z.ZodNumber>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
export declare const ApiKeyDto: z.ZodObject<{
|
|
209
|
+
id: z.ZodUUID;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
kind: z.ZodEnum<{
|
|
212
|
+
secret: "secret";
|
|
213
|
+
site: "site";
|
|
214
|
+
}>;
|
|
215
|
+
prefix: z.ZodString;
|
|
216
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
217
|
+
allowedOrigins: z.ZodArray<z.ZodString>;
|
|
218
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
219
|
+
allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
+
rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
222
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
223
|
+
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
224
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
225
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
226
|
+
createdAt: z.ZodISODateTime;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
export declare const ApiKeyCreated: z.ZodObject<{
|
|
229
|
+
id: z.ZodUUID;
|
|
230
|
+
name: z.ZodString;
|
|
231
|
+
kind: z.ZodEnum<{
|
|
232
|
+
secret: "secret";
|
|
233
|
+
site: "site";
|
|
234
|
+
}>;
|
|
235
|
+
prefix: z.ZodString;
|
|
236
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
237
|
+
allowedOrigins: z.ZodArray<z.ZodString>;
|
|
238
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
239
|
+
allowedConnectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
240
|
+
allowedSequenceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
241
|
+
rateLimitPerMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
242
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
243
|
+
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
244
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
245
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
246
|
+
createdAt: z.ZodISODateTime;
|
|
247
|
+
plaintext: z.ZodString;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export declare const MemberDto: z.ZodObject<{
|
|
250
|
+
userId: z.ZodUUID;
|
|
251
|
+
email: z.ZodString;
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
role: z.ZodEnum<{
|
|
254
|
+
admin: "admin";
|
|
255
|
+
analyst: "analyst";
|
|
256
|
+
marketer: "marketer";
|
|
257
|
+
owner: "owner";
|
|
258
|
+
sales: "sales";
|
|
259
|
+
viewer: "viewer";
|
|
260
|
+
}>;
|
|
261
|
+
listIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
export declare const InviteBody: z.ZodObject<{
|
|
264
|
+
email: z.ZodEmail;
|
|
265
|
+
role: z.ZodEnum<{
|
|
266
|
+
admin: "admin";
|
|
267
|
+
analyst: "analyst";
|
|
268
|
+
marketer: "marketer";
|
|
269
|
+
owner: "owner";
|
|
270
|
+
sales: "sales";
|
|
271
|
+
viewer: "viewer";
|
|
272
|
+
}>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export declare const InvitationResult: z.ZodObject<{
|
|
275
|
+
id: z.ZodUUID;
|
|
276
|
+
email: z.ZodString;
|
|
277
|
+
role: z.ZodEnum<{
|
|
278
|
+
admin: "admin";
|
|
279
|
+
analyst: "analyst";
|
|
280
|
+
marketer: "marketer";
|
|
281
|
+
owner: "owner";
|
|
282
|
+
sales: "sales";
|
|
283
|
+
viewer: "viewer";
|
|
284
|
+
}>;
|
|
285
|
+
token: z.ZodString;
|
|
286
|
+
expiresAt: z.ZodISODateTime;
|
|
287
|
+
emailed: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
export declare const RoleBody: z.ZodObject<{
|
|
290
|
+
role: z.ZodEnum<{
|
|
291
|
+
admin: "admin";
|
|
292
|
+
analyst: "analyst";
|
|
293
|
+
marketer: "marketer";
|
|
294
|
+
owner: "owner";
|
|
295
|
+
sales: "sales";
|
|
296
|
+
viewer: "viewer";
|
|
297
|
+
}>;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
export declare const AcceptInvitationBody: z.ZodObject<{
|
|
300
|
+
token: z.ZodString;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
export declare const AuditDto: z.ZodObject<{
|
|
303
|
+
id: z.ZodUUID;
|
|
304
|
+
actorType: z.ZodString;
|
|
305
|
+
actorId: z.ZodString;
|
|
306
|
+
impersonatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
307
|
+
action: z.ZodString;
|
|
308
|
+
targetType: z.ZodString;
|
|
309
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
310
|
+
before: z.ZodNullable<z.ZodUnknown>;
|
|
311
|
+
after: z.ZodNullable<z.ZodUnknown>;
|
|
312
|
+
at: z.ZodISODateTime;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
export declare const AuditFilter: z.ZodObject<{
|
|
315
|
+
action: z.ZodOptional<z.ZodString>;
|
|
316
|
+
targetType: z.ZodOptional<z.ZodString>;
|
|
317
|
+
actorId: z.ZodOptional<z.ZodString>;
|
|
318
|
+
from: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
319
|
+
to: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
export declare const AuditExportQuery: z.ZodObject<{
|
|
322
|
+
action: z.ZodOptional<z.ZodString>;
|
|
323
|
+
targetType: z.ZodOptional<z.ZodString>;
|
|
324
|
+
actorId: z.ZodOptional<z.ZodString>;
|
|
325
|
+
from: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
326
|
+
to: z.ZodOptional<z.ZodCodec<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodString]>, z.ZodISODateTime>>;
|
|
327
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
328
|
+
csv: "csv";
|
|
329
|
+
ndjson: "ndjson";
|
|
330
|
+
}>>;
|
|
331
|
+
order: z.ZodDefault<z.ZodEnum<{
|
|
332
|
+
asc: "asc";
|
|
333
|
+
desc: "desc";
|
|
334
|
+
}>>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
export declare const AuditExport: z.ZodObject<{
|
|
337
|
+
filename: z.ZodString;
|
|
338
|
+
format: z.ZodEnum<{
|
|
339
|
+
csv: "csv";
|
|
340
|
+
ndjson: "ndjson";
|
|
341
|
+
}>;
|
|
342
|
+
rowCount: z.ZodNumber;
|
|
343
|
+
truncated: z.ZodBoolean;
|
|
344
|
+
content: z.ZodString;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
/** Company sign-on through the workspace's Atlas organization. */
|
|
347
|
+
export declare const SsoStatusDto: z.ZodObject<{
|
|
348
|
+
available: z.ZodBoolean;
|
|
349
|
+
configured: z.ZodBoolean;
|
|
350
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
351
|
+
id: z.ZodString;
|
|
352
|
+
type: z.ZodString;
|
|
353
|
+
status: z.ZodString;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export declare const SsoSetupLinkDto: z.ZodObject<{
|
|
357
|
+
url: z.ZodURL;
|
|
358
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
359
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 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
|
+
locale: z.string(),
|
|
16
|
+
postalAddress: z.string().nullable(),
|
|
17
|
+
adminEmail: z.string().nullable(),
|
|
18
|
+
unsubscribeRedirectUrl: z.string().nullable(),
|
|
19
|
+
quietHours: z.object({ start: Hhmm, end: Hhmm }),
|
|
20
|
+
quietHoursByChannel: z.partialRecord(z.string(), z.object({ start: Hhmm, end: Hhmm })).optional(),
|
|
21
|
+
apiKeyExpiryDays: z.number().int().nullable().optional(),
|
|
22
|
+
displayCurrency: z.string(),
|
|
23
|
+
fxRates: z.record(z.string(), z.number()),
|
|
24
|
+
sessionDays: z.number().int().nullable(),
|
|
25
|
+
campaignNotifyEmails: z.array(z.string()),
|
|
26
|
+
websiteUrl: z.string().nullable().optional(),
|
|
27
|
+
industry: z.string().nullable().optional(),
|
|
28
|
+
});
|
|
29
|
+
export const INDUSTRIES = ['ecommerce', 'saas', 'agency', 'media', 'education', 'nonprofit', 'finance', 'health', 'travel', 'real_estate', 'b2b_services', 'other'];
|
|
30
|
+
export const Currency = z.string().regex(/^[A-Z]{3}$/, 'Use a 3-letter currency code such as USD');
|
|
31
|
+
export const WorkspacePatch = z.object({
|
|
32
|
+
name: z.string().min(1).max(120).optional(),
|
|
33
|
+
timezone: z.string().max(64).optional(),
|
|
34
|
+
locale: z.string().min(2).max(16).optional(),
|
|
35
|
+
postalAddress: z.string().max(500).nullable().optional(),
|
|
36
|
+
adminEmail: z.email().nullable().optional(),
|
|
37
|
+
unsubscribeRedirectUrl: z.url({ protocol: /^https$/ }).nullable().optional(),
|
|
38
|
+
quietHours: z.object({ start: Hhmm, end: Hhmm }).optional(),
|
|
39
|
+
/** Replaces `quietHours` for one channel; omit a channel to use the workspace hours. SMS uses its own sending hours. */
|
|
40
|
+
quietHoursByChannel: z.partialRecord(z.enum(['email', 'whatsapp', 'push']), z.object({ start: Hhmm, end: Hhmm })).optional(),
|
|
41
|
+
apiKeyExpiryDays: z.number().int().min(1).max(730).nullable().optional(),
|
|
42
|
+
displayCurrency: Currency.optional(),
|
|
43
|
+
fxRates: z.record(Currency, z.number().positive().max(1_000_000)).optional(),
|
|
44
|
+
sessionDays: z.number().int().min(1).max(365).nullable().optional(),
|
|
45
|
+
campaignNotifyEmails: z.array(z.email()).max(10).optional(),
|
|
46
|
+
websiteUrl: z.url({ protocol: /^https?$/ }).max(500).nullable().optional(),
|
|
47
|
+
industry: z.enum(INDUSTRIES).nullable().optional(),
|
|
48
|
+
});
|
|
49
|
+
/** Dev-only sign-in (AUTH_DEV_LOGIN, never production): tests and local dev without Atlas. */
|
|
50
|
+
export const DevLoginBody = z.object({ email: z.email().max(254), name: z.string().min(1).max(120).optional() });
|
|
51
|
+
export const AuthResult = z.object({ user: UserDto, workspace: WorkspaceDto.nullable(), expiresAt: Timestamp.nullable() });
|
|
52
|
+
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
|
+
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()) }),
|
|
55
|
+
user: UserDto.nullable(),
|
|
56
|
+
workspaces: z.array(z.object({ id: Id, name: z.string(), role: Role })),
|
|
57
|
+
/** Set while an owner is viewing the app as this user. */
|
|
58
|
+
impersonatedBy: z.object({ id: Id, name: z.string() }).nullable().optional(),
|
|
59
|
+
/** Platform operator (PLATFORM_OPERATOR_EMAILS): the operator console is open to them. */
|
|
60
|
+
operator: z.boolean().optional(),
|
|
61
|
+
});
|
|
62
|
+
export const SessionDto = z.object({ id: Id, ip: z.string().nullable(), userAgent: z.string().nullable(), createdAt: Timestamp, expiresAt: Timestamp });
|
|
63
|
+
export const ApiKeyCreate = z.object({
|
|
64
|
+
name: z.string().min(1).max(120),
|
|
65
|
+
kind: ApiKeyKind,
|
|
66
|
+
scopes: z.array(z.string().max(64)).max(64).default([]),
|
|
67
|
+
allowedOrigins: z.array(z.string().max(255)).max(50).optional(),
|
|
68
|
+
/** Secret keys: restrict sends to these from-domains / connection ids. Empty = unrestricted. */
|
|
69
|
+
allowedDomains: z.array(z.string().max(255)).max(50).optional(),
|
|
70
|
+
allowedConnectionIds: z.array(z.uuid()).max(50).optional(),
|
|
71
|
+
/** Secret keys: limit the outbound API to these campaigns (sequences). Empty = every campaign. */
|
|
72
|
+
allowedSequenceIds: z.array(z.uuid()).max(50).optional(),
|
|
73
|
+
/** Optional cap on requests per minute for this key; over it the API answers 429. */
|
|
74
|
+
rateLimitPerMin: z.number().int().min(1).max(100_000).optional(),
|
|
75
|
+
/** Optional expiry; after it the key answers 401 like a revoked one. */
|
|
76
|
+
expiresAt: TimestampIn.optional(),
|
|
77
|
+
});
|
|
78
|
+
/** 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() });
|
|
80
|
+
export const ApiKeyDto = z.object({
|
|
81
|
+
id: Id,
|
|
82
|
+
name: z.string(),
|
|
83
|
+
kind: ApiKeyKind,
|
|
84
|
+
prefix: z.string(),
|
|
85
|
+
scopes: z.array(z.string()),
|
|
86
|
+
allowedOrigins: z.array(z.string()),
|
|
87
|
+
allowedDomains: z.array(z.string()).optional(),
|
|
88
|
+
allowedConnectionIds: z.array(z.string()).optional(),
|
|
89
|
+
allowedSequenceIds: z.array(z.string()).optional(),
|
|
90
|
+
rateLimitPerMin: z.number().int().nullable().optional(),
|
|
91
|
+
lastUsedAt: Timestamp.nullable(),
|
|
92
|
+
revokedAt: Timestamp.nullable(),
|
|
93
|
+
expiresAt: Timestamp.nullable().optional(),
|
|
94
|
+
/** User id of the developer who minted the key. */
|
|
95
|
+
createdBy: Id.nullable().optional(),
|
|
96
|
+
createdAt: Timestamp,
|
|
97
|
+
});
|
|
98
|
+
export const ApiKeyCreated = ApiKeyDto.extend({ plaintext: z.string() });
|
|
99
|
+
export const MemberDto = z.object({ userId: Id, email: z.string(), name: z.string(), role: Role, listIds: z.array(z.string()).nullable().optional() });
|
|
100
|
+
export const InviteBody = z.object({ email: z.email().max(254), role: Role });
|
|
101
|
+
export const InvitationResult = z.object({ id: Id, email: z.string(), role: Role, token: z.string(), expiresAt: Timestamp, emailed: z.boolean().optional() });
|
|
102
|
+
export const RoleBody = z.object({ role: Role });
|
|
103
|
+
export const AcceptInvitationBody = z.object({ token: z.string().min(10).max(200) });
|
|
104
|
+
export const AuditDto = z.object({
|
|
105
|
+
id: Id,
|
|
106
|
+
actorType: z.string(),
|
|
107
|
+
actorId: z.string(),
|
|
108
|
+
impersonatedBy: z.string().nullable().optional(),
|
|
109
|
+
action: z.string(),
|
|
110
|
+
targetType: z.string(),
|
|
111
|
+
targetId: z.string().nullable(),
|
|
112
|
+
before: z.unknown().nullable(),
|
|
113
|
+
after: z.unknown().nullable(),
|
|
114
|
+
at: Timestamp,
|
|
115
|
+
});
|
|
116
|
+
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() });
|
|
117
|
+
export const AuditExportQuery = AuditFilter.extend({ format: z.enum(['csv', 'ndjson']).default('csv'), order: z.enum(['asc', 'desc']).default('desc') });
|
|
118
|
+
export const AuditExport = z.object({ filename: z.string(), format: z.enum(['csv', 'ndjson']), rowCount: z.number().int(), truncated: z.boolean(), content: z.string() });
|
|
119
|
+
/** Company sign-on through the workspace's Atlas organization. */
|
|
120
|
+
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() })) });
|
|
121
|
+
export const SsoSetupLinkDto = z.object({ url: z.url(), expiresAt: z.string().nullable() });
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
export declare const PayoutOnboardBody: z.ZodObject<{
|
|
140
|
+
returnUrl: z.ZodURL;
|
|
141
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export const PayoutOnboardBody = z.object({ returnUrl: z.url() });
|