sendlit 0.5.0 → 0.7.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/README.md +10 -4
- package/dist/index.d.mts +1874 -485
- package/dist/index.d.ts +1874 -485
- package/dist/index.js +627 -301
- package/dist/index.mjs +627 -302
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -230,6 +230,162 @@ statuses({ skip: "pending_confirmation" }, [
|
|
|
230
230
|
"awaiting_confirmation",
|
|
231
231
|
"not_confirmed"
|
|
232
232
|
]);
|
|
233
|
+
var postalAddressSchema = zod.z.object({
|
|
234
|
+
line1: zod.z.string().trim().min(1).max(200).describe("Street address"),
|
|
235
|
+
line2: zod.z.string().trim().max(200).optional().describe("Apartment, suite, building and so on"),
|
|
236
|
+
city: zod.z.string().trim().max(100).optional(),
|
|
237
|
+
region: zod.z.string().trim().max(100).optional().describe("State, province or region"),
|
|
238
|
+
postalCode: zod.z.string().trim().max(20).optional(),
|
|
239
|
+
country: zod.z.string().regex(/^[A-Z]{2}$/).describe("ISO 3166-1 alpha-2 country code, uppercase (for example `GB`)")
|
|
240
|
+
});
|
|
241
|
+
var generalSettingsSchema = zod.z.object({
|
|
242
|
+
/** The physical postal address shown in marketing email footers; required
|
|
243
|
+
* for broadcasts and sequences. `null` until it is set. */
|
|
244
|
+
postalAddress: postalAddressSchema.nullable(),
|
|
245
|
+
updatedAt: zod.z.string().nullable().optional()
|
|
246
|
+
});
|
|
247
|
+
var updateGeneralSettingsBodySchema = zod.z.object({
|
|
248
|
+
/** Omit to keep the address; `null` clears it. */
|
|
249
|
+
postalAddress: postalAddressSchema.nullable().optional()
|
|
250
|
+
});
|
|
251
|
+
var trackingDomainStatuses = ["pending", "verified", "failed"];
|
|
252
|
+
var trackingDomainSchema = zod.z.object({
|
|
253
|
+
domain: zod.z.string().nullable(),
|
|
254
|
+
/** `pending` until the CNAME and HTTPS work; `failed` after the domain
|
|
255
|
+
* stopped working, when links fall back to SendLit's own host. */
|
|
256
|
+
status: zod.z.enum(trackingDomainStatuses).nullable(),
|
|
257
|
+
/** The host the domain's CNAME record must point to. */
|
|
258
|
+
cnameTarget: zod.z.string(),
|
|
259
|
+
/** Why the last check failed: `cname_missing`, `cname_mismatch`,
|
|
260
|
+
* `unreachable` (no HTTPS answer yet) or `dns_error`. */
|
|
261
|
+
error: zod.z.string().nullable(),
|
|
262
|
+
verifiedAt: zod.z.string().nullable(),
|
|
263
|
+
checkedAt: zod.z.string().nullable()
|
|
264
|
+
});
|
|
265
|
+
var updateTrackingDomainBodySchema = zod.z.object({
|
|
266
|
+
/** A subdomain such as `track.example.com`; `null` removes it. */
|
|
267
|
+
domain: zod.z.string().max(253).nullable()
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// ../api-contract/src/schemas/teams.ts
|
|
271
|
+
var teamSchema = zod.z.object({
|
|
272
|
+
teamId: zod.z.string(),
|
|
273
|
+
/** Public organization identifier. Present when an end user lists the
|
|
274
|
+
* teams they belong to, so the dashboard can keep workspace selection
|
|
275
|
+
* scoped to one organization. */
|
|
276
|
+
organizationId: zod.z.string().optional(),
|
|
277
|
+
organizationName: zod.z.string().optional(),
|
|
278
|
+
name: zod.z.string(),
|
|
279
|
+
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
280
|
+
externalId: zod.z.string().nullable().optional(),
|
|
281
|
+
createdAt: zod.z.string().nullable().optional(),
|
|
282
|
+
updatedAt: zod.z.string().nullable().optional(),
|
|
283
|
+
/** True when the calling human is already a `team_members` row. Always
|
|
284
|
+
* false for organization API keys. Omitted on non-list team payloads. */
|
|
285
|
+
viewerIsMember: zod.z.boolean().optional()
|
|
286
|
+
});
|
|
287
|
+
var apiKeySchema = zod.z.object({
|
|
288
|
+
keyId: zod.z.string(),
|
|
289
|
+
keyPrefix: zod.z.string(),
|
|
290
|
+
name: zod.z.string(),
|
|
291
|
+
expiresAt: zod.z.string().nullable().optional(),
|
|
292
|
+
lastUsedAt: zod.z.string().nullable().optional(),
|
|
293
|
+
revokedAt: zod.z.string().nullable().optional(),
|
|
294
|
+
createdAt: zod.z.string().nullable().optional()
|
|
295
|
+
});
|
|
296
|
+
var createdApiKeySchema = apiKeySchema.extend({
|
|
297
|
+
key: zod.z.string()
|
|
298
|
+
});
|
|
299
|
+
var createTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
300
|
+
var renameTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
301
|
+
var createApiKeyBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
302
|
+
var provisionTeamBodySchema = zod.z.object({
|
|
303
|
+
externalId: zod.z.string().min(1),
|
|
304
|
+
name: zod.z.string().min(1),
|
|
305
|
+
sender: zod.z.object({
|
|
306
|
+
fromName: zod.z.string().min(1).optional(),
|
|
307
|
+
replyTo: zod.z.string().email().optional()
|
|
308
|
+
}).optional(),
|
|
309
|
+
postalAddress: postalAddressSchema.optional(),
|
|
310
|
+
delivery: zod.z.object({
|
|
311
|
+
useOrganizationDefault: zod.z.boolean().optional(),
|
|
312
|
+
teamEspEnabled: zod.z.boolean().optional(),
|
|
313
|
+
teamCanChangeDefault: zod.z.boolean().optional()
|
|
314
|
+
}).optional(),
|
|
315
|
+
quota: zod.z.object({
|
|
316
|
+
dailyLimit: zod.z.number().int().positive().nullable().optional(),
|
|
317
|
+
monthlyLimit: zod.z.number().int().positive().nullable().optional()
|
|
318
|
+
}).optional()
|
|
319
|
+
});
|
|
320
|
+
var provisionedTeamBaseSchema = zod.z.object({
|
|
321
|
+
teamId: zod.z.string(),
|
|
322
|
+
externalId: zod.z.string(),
|
|
323
|
+
name: zod.z.string(),
|
|
324
|
+
deliverySource: zod.z.object({ type: zod.z.literal("organization") })
|
|
325
|
+
});
|
|
326
|
+
var provisionTeamResponseSchema = zod.z.discriminatedUnion("created", [
|
|
327
|
+
provisionedTeamBaseSchema.extend({
|
|
328
|
+
created: zod.z.literal(true),
|
|
329
|
+
apiKey: zod.z.string()
|
|
330
|
+
}),
|
|
331
|
+
provisionedTeamBaseSchema.extend({
|
|
332
|
+
created: zod.z.literal(false),
|
|
333
|
+
apiKey: zod.z.null()
|
|
334
|
+
})
|
|
335
|
+
]);
|
|
336
|
+
var teamHealthSchema = zod.z.object({
|
|
337
|
+
status: zod.z.enum(["normal", "warned", "marketing_paused", "all_paused"]),
|
|
338
|
+
reason: zod.z.string().nullable(),
|
|
339
|
+
scope: zod.z.enum(["team", "shared_mailbox"]).nullable(),
|
|
340
|
+
last7Days: zod.z.object({
|
|
341
|
+
sent: zod.z.number().int().nonnegative(),
|
|
342
|
+
bounced: zod.z.number().int().nonnegative(),
|
|
343
|
+
complained: zod.z.number().int().nonnegative()
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
var provisionedTeamSchema = provisionedTeamBaseSchema.extend({
|
|
347
|
+
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
348
|
+
postalAddress: postalAddressSchema.nullable(),
|
|
349
|
+
teamEspEnabled: zod.z.boolean(),
|
|
350
|
+
teamCanChangeDefault: zod.z.boolean(),
|
|
351
|
+
createdAt: zod.z.string().nullable(),
|
|
352
|
+
updatedAt: zod.z.string().nullable(),
|
|
353
|
+
health: teamHealthSchema
|
|
354
|
+
});
|
|
355
|
+
var updateProvisionedTeamBodySchema = zod.z.object({
|
|
356
|
+
name: zod.z.string().min(1).optional(),
|
|
357
|
+
sender: zod.z.object({
|
|
358
|
+
fromName: zod.z.string().min(1).nullable().optional(),
|
|
359
|
+
replyTo: zod.z.string().email().nullable().optional()
|
|
360
|
+
}).optional(),
|
|
361
|
+
postalAddress: postalAddressSchema.nullable().optional(),
|
|
362
|
+
delivery: zod.z.object({
|
|
363
|
+
teamEspEnabled: zod.z.boolean().optional(),
|
|
364
|
+
teamCanChangeDefault: zod.z.boolean().optional()
|
|
365
|
+
}).optional(),
|
|
366
|
+
quota: zod.z.object({
|
|
367
|
+
dailyLimit: zod.z.number().int().nonnegative().nullable().optional(),
|
|
368
|
+
monthlyLimit: zod.z.number().int().nonnegative().nullable().optional()
|
|
369
|
+
}).optional()
|
|
370
|
+
}).refine((body) => Object.keys(body).length > 0, {
|
|
371
|
+
message: "At least one field is required"
|
|
372
|
+
});
|
|
373
|
+
var usageWindowSchema = zod.z.object({
|
|
374
|
+
limit: zod.z.number().int().nullable(),
|
|
375
|
+
accepted: zod.z.number().int().nonnegative(),
|
|
376
|
+
reserved: zod.z.number().int().nonnegative(),
|
|
377
|
+
remaining: zod.z.number().int().nullable(),
|
|
378
|
+
resetsAt: zod.z.string()
|
|
379
|
+
});
|
|
380
|
+
var teamQuotaUsageSchema = zod.z.object({
|
|
381
|
+
day: usageWindowSchema,
|
|
382
|
+
month: usageWindowSchema
|
|
383
|
+
});
|
|
384
|
+
var provisionedTeamUsageSchema = teamQuotaUsageSchema.extend({
|
|
385
|
+
health: teamHealthSchema
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// ../api-contract/src/schemas/organizations.ts
|
|
233
389
|
var organizationRoleSchema = zod.z.enum(["owner", "admin", "member"]);
|
|
234
390
|
var organizationSchema = zod.z.object({
|
|
235
391
|
organizationId: zod.z.string(),
|
|
@@ -314,14 +470,18 @@ var organizationMailCountsSchema = zod.z.object({
|
|
|
314
470
|
sent: zod.z.number().int().nonnegative(),
|
|
315
471
|
queued: zod.z.number().int().nonnegative(),
|
|
316
472
|
failed: zod.z.number().int().nonnegative(),
|
|
317
|
-
bounced: zod.z.number().int().nonnegative()
|
|
473
|
+
bounced: zod.z.number().int().nonnegative(),
|
|
474
|
+
complained: zod.z.number().int().nonnegative()
|
|
318
475
|
});
|
|
319
476
|
var organizationMailActivityTeamSchema = zod.z.object({
|
|
320
477
|
teamId: zod.z.string(),
|
|
321
478
|
name: zod.z.string(),
|
|
322
479
|
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
323
480
|
externalId: zod.z.string().nullable(),
|
|
324
|
-
mail: organizationMailCountsSchema
|
|
481
|
+
mail: organizationMailCountsSchema,
|
|
482
|
+
health: teamHealthSchema,
|
|
483
|
+
/** Shared-mailbox quota; null when the team has no active grant. */
|
|
484
|
+
quota: teamQuotaUsageSchema.nullable()
|
|
325
485
|
});
|
|
326
486
|
var organizationMailActivitySchema = zod.z.object({
|
|
327
487
|
rangeDays: zod.z.union([zod.z.literal(1), zod.z.literal(3), zod.z.literal(7), zod.z.literal(30)]),
|
|
@@ -678,6 +838,53 @@ var customFieldValueSchema = zod.z.union([
|
|
|
678
838
|
zod.z.array(customFieldScalarSchema)
|
|
679
839
|
]);
|
|
680
840
|
var customFieldsSchema = zod.z.record(customFieldValueSchema).default({});
|
|
841
|
+
var deliveryEventType = [
|
|
842
|
+
"accepted",
|
|
843
|
+
"delivered",
|
|
844
|
+
"delayed",
|
|
845
|
+
"soft_bounce",
|
|
846
|
+
"hard_bounce",
|
|
847
|
+
"failed",
|
|
848
|
+
"complaint",
|
|
849
|
+
"suppressed",
|
|
850
|
+
"rejected",
|
|
851
|
+
"unknown"
|
|
852
|
+
];
|
|
853
|
+
var bounceClass = ["permanent", "transient", "undetermined"];
|
|
854
|
+
var deliverySourceTypes = ["organization", "team"];
|
|
855
|
+
var deliveryEventSchema = zod.z.object({
|
|
856
|
+
eventId: zod.z.string(),
|
|
857
|
+
provider: zod.z.string(),
|
|
858
|
+
espId: zod.z.string().nullable(),
|
|
859
|
+
deliverySourceType: zod.z.enum(deliverySourceTypes).nullable(),
|
|
860
|
+
/** Public `msg_...` id of the correlated outbound message, when the
|
|
861
|
+
* event was matched to one — see the PRD's correlation section. */
|
|
862
|
+
messageId: zod.z.string().nullable(),
|
|
863
|
+
recipientEmail: zod.z.string().nullable(),
|
|
864
|
+
eventType: zod.z.enum(deliveryEventType),
|
|
865
|
+
bounceClass: zod.z.enum(bounceClass).nullable().optional(),
|
|
866
|
+
smtpCode: zod.z.number().nullable().optional(),
|
|
867
|
+
enhancedStatusCode: zod.z.string().nullable().optional(),
|
|
868
|
+
reason: zod.z.string().nullable().optional(),
|
|
869
|
+
occurredAt: zod.z.string(),
|
|
870
|
+
receivedAt: zod.z.string()
|
|
871
|
+
});
|
|
872
|
+
var listDeliveryEventsQuerySchema = zod.z.object({
|
|
873
|
+
espId: zod.z.string().optional(),
|
|
874
|
+
deliverySourceType: zod.z.enum(deliverySourceTypes).optional(),
|
|
875
|
+
eventType: zod.z.enum(deliveryEventType).optional(),
|
|
876
|
+
createdAfter: zod.z.coerce.number().int().optional(),
|
|
877
|
+
createdBefore: zod.z.coerce.number().int().optional(),
|
|
878
|
+
offset: zod.z.coerce.number().int().min(1).optional(),
|
|
879
|
+
itemsPerPage: zod.z.coerce.number().int().min(1).optional()
|
|
880
|
+
});
|
|
881
|
+
var deliveryOutcome = [
|
|
882
|
+
"sent",
|
|
883
|
+
"delivered",
|
|
884
|
+
"bounced",
|
|
885
|
+
"complained",
|
|
886
|
+
"failed"
|
|
887
|
+
];
|
|
681
888
|
var nullableLimit = zod.z.number().int().nonnegative().nullable();
|
|
682
889
|
var organizationDeliveryPolicySchema = zod.z.object({
|
|
683
890
|
defaultEspId: zod.z.string().nullable(),
|
|
@@ -688,6 +895,12 @@ var organizationDeliveryPolicySchema = zod.z.object({
|
|
|
688
895
|
aggregateMonthlyLimit: nullableLimit,
|
|
689
896
|
teamEspEnabledByDefault: zod.z.boolean(),
|
|
690
897
|
teamCanChangeDefault: zod.z.boolean(),
|
|
898
|
+
/** Whether teams on a shared ESP must send from their own verified
|
|
899
|
+
* domain: `off` (default), for `marketing` only, or for `all` mail. */
|
|
900
|
+
requireTeamSendingDomain: zod.z.enum(["off", "marketing", "all"]),
|
|
901
|
+
/** Monthly cap on each team's marketing through a shared ESP while it
|
|
902
|
+
* still uses the shared From domain; `null` for none. */
|
|
903
|
+
sharedDomainMonthlyLimit: nullableLimit,
|
|
691
904
|
updatedAt: zod.z.string()
|
|
692
905
|
});
|
|
693
906
|
var updateOrganizationDeliveryPolicyBodySchema = zod.z.object({
|
|
@@ -698,7 +911,9 @@ var updateOrganizationDeliveryPolicyBodySchema = zod.z.object({
|
|
|
698
911
|
aggregateDailyLimit: nullableLimit.optional(),
|
|
699
912
|
aggregateMonthlyLimit: nullableLimit.optional(),
|
|
700
913
|
teamEspEnabledByDefault: zod.z.boolean().optional(),
|
|
701
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
914
|
+
teamCanChangeDefault: zod.z.boolean().optional(),
|
|
915
|
+
requireTeamSendingDomain: zod.z.enum(["off", "marketing", "all"]).optional(),
|
|
916
|
+
sharedDomainMonthlyLimit: nullableLimit.optional()
|
|
702
917
|
}).refine((value) => Object.keys(value).length > 0, {
|
|
703
918
|
message: "At least one field is required"
|
|
704
919
|
});
|
|
@@ -712,6 +927,15 @@ var espGrantSchema = zod.z.object({
|
|
|
712
927
|
replyTo: zod.z.string().nullable(),
|
|
713
928
|
dailyLimit: nullableLimit,
|
|
714
929
|
monthlyLimit: nullableLimit,
|
|
930
|
+
/** The team's own From address on this mailbox, when it has one. */
|
|
931
|
+
fromEmail: zod.z.string().nullable(),
|
|
932
|
+
/** The team's own sending domain, when it has one (see
|
|
933
|
+
* `/teams/:teamId/sending-domain`). */
|
|
934
|
+
sendingDomain: zod.z.object({
|
|
935
|
+
domain: zod.z.string(),
|
|
936
|
+
status: zod.z.enum(["pending", "verified", "failing"]),
|
|
937
|
+
inUse: zod.z.boolean()
|
|
938
|
+
}).nullable(),
|
|
715
939
|
createdAt: zod.z.string(),
|
|
716
940
|
updatedAt: zod.z.string()
|
|
717
941
|
});
|
|
@@ -777,6 +1001,35 @@ var sendingOptionSchema = zod.z.discriminatedUnion("type", [
|
|
|
777
1001
|
countsAgainstQuota: zod.z.literal(false)
|
|
778
1002
|
})
|
|
779
1003
|
]);
|
|
1004
|
+
var teamSendingDomainRecordSchema = zod.z.object({
|
|
1005
|
+
type: zod.z.enum(["CNAME", "TXT"]),
|
|
1006
|
+
name: zod.z.string(),
|
|
1007
|
+
value: zod.z.string(),
|
|
1008
|
+
purpose: zod.z.enum(["dkim", "dmarc"]),
|
|
1009
|
+
/** Whether the last check found it in place. */
|
|
1010
|
+
present: zod.z.boolean().optional()
|
|
1011
|
+
});
|
|
1012
|
+
var teamSendingDomainSchema = zod.z.object({
|
|
1013
|
+
domain: zod.z.string(),
|
|
1014
|
+
fromEmail: zod.z.string().nullable(),
|
|
1015
|
+
/** `pending` until DKIM and DMARC first pass, `verified` once they have,
|
|
1016
|
+
* `failing` when they stopped passing after that. */
|
|
1017
|
+
status: zod.z.enum(["pending", "verified", "failing"]),
|
|
1018
|
+
dkim: zod.z.enum(["pending", "verified", "failed"]),
|
|
1019
|
+
dmarc: zod.z.enum(["pass", "missing"]),
|
|
1020
|
+
/** Whether the team's mail goes out from this domain right now. */
|
|
1021
|
+
inUse: zod.z.boolean(),
|
|
1022
|
+
records: zod.z.array(teamSendingDomainRecordSchema),
|
|
1023
|
+
verifiedAt: zod.z.string().nullable(),
|
|
1024
|
+
failingSince: zod.z.string().nullable(),
|
|
1025
|
+
/** When the team's marketing pauses if the domain keeps failing. */
|
|
1026
|
+
graceEndsAt: zod.z.string().nullable(),
|
|
1027
|
+
lastCheckedAt: zod.z.string().nullable()
|
|
1028
|
+
});
|
|
1029
|
+
var setTeamSendingDomainBodySchema = zod.z.object({
|
|
1030
|
+
/** The team's From address; its domain is registered with the shared ESP. */
|
|
1031
|
+
fromEmail: zod.z.string().email()
|
|
1032
|
+
});
|
|
780
1033
|
var EVENT_NAME_MAX_LENGTH = 128;
|
|
781
1034
|
var EVENT_PROPERTIES_MAX_BYTES = 32 * 1024;
|
|
782
1035
|
var EVENT_PROPERTIES_MAX_KEYS = 100;
|
|
@@ -962,6 +1215,38 @@ var propertyChangeFilterSchema = zod.z.object({
|
|
|
962
1215
|
from: filterScalarSchema.nullable().optional(),
|
|
963
1216
|
to: filterScalarSchema.nullable().optional()
|
|
964
1217
|
}).strict();
|
|
1218
|
+
var suppressionReason = [
|
|
1219
|
+
"hard_bounce",
|
|
1220
|
+
"complaint",
|
|
1221
|
+
"repeated_soft_bounce",
|
|
1222
|
+
"provider_suppression",
|
|
1223
|
+
"manual"
|
|
1224
|
+
];
|
|
1225
|
+
var suppressionSchema = zod.z.object({
|
|
1226
|
+
suppressionId: zod.z.string(),
|
|
1227
|
+
recipientEmail: zod.z.string().nullable(),
|
|
1228
|
+
reason: zod.z.enum(suppressionReason),
|
|
1229
|
+
active: zod.z.boolean(),
|
|
1230
|
+
firstSuppressedAt: zod.z.string(),
|
|
1231
|
+
lastSuppressedAt: zod.z.string(),
|
|
1232
|
+
releasedAt: zod.z.string().nullable().optional(),
|
|
1233
|
+
releaseReason: zod.z.string().nullable().optional()
|
|
1234
|
+
});
|
|
1235
|
+
var listSuppressionsQuerySchema = zod.z.object({
|
|
1236
|
+
active: zod.z.coerce.boolean().optional(),
|
|
1237
|
+
reason: zod.z.enum(suppressionReason).optional(),
|
|
1238
|
+
offset: zod.z.coerce.number().int().min(1).optional(),
|
|
1239
|
+
itemsPerPage: zod.z.coerce.number().int().min(1).optional()
|
|
1240
|
+
});
|
|
1241
|
+
var releaseSuppressionBodySchema = zod.z.object({
|
|
1242
|
+
explanation: zod.z.string().min(1).max(2e3).optional()
|
|
1243
|
+
});
|
|
1244
|
+
var createSuppressionBodySchema = zod.z.object({
|
|
1245
|
+
email: zod.z.string().email(),
|
|
1246
|
+
note: zod.z.string().max(2e3).optional().describe(
|
|
1247
|
+
"Why the address is blocked, e.g. a legal request; kept in the audit trail"
|
|
1248
|
+
)
|
|
1249
|
+
});
|
|
965
1250
|
|
|
966
1251
|
// ../api-contract/src/schemas/sequences.ts
|
|
967
1252
|
var mailTypes = ["broadcast", "sequence"];
|
|
@@ -1237,6 +1522,40 @@ var waitingContactsPageSchema = zod.z.object({
|
|
|
1237
1522
|
total: zod.z.number().describe("Every waiting contact that matches, across all pages"),
|
|
1238
1523
|
nextCursor: zod.z.string().nullable().describe("Pass as `after` for the next page; null on the last page")
|
|
1239
1524
|
});
|
|
1525
|
+
var sequenceDeliveryOutcomeFilter = ["bounced", "complained"];
|
|
1526
|
+
var listSequenceDeliveriesQuerySchema = zod.z.object({
|
|
1527
|
+
outcome: zod.z.enum(sequenceDeliveryOutcomeFilter).optional().describe(
|
|
1528
|
+
"bounced: sends the ESP reported as bounced. complained: sends the recipient marked as spam. Omit for every send."
|
|
1529
|
+
),
|
|
1530
|
+
offset: zod.z.coerce.number().int().min(1).optional().describe("Page number (default 1)"),
|
|
1531
|
+
itemsPerPage: zod.z.coerce.number().int().min(1).max(100).optional()
|
|
1532
|
+
});
|
|
1533
|
+
var sequenceDeliverySchema = zod.z.object({
|
|
1534
|
+
messageId: zod.z.string().describe("Public `msg_...` id of the send"),
|
|
1535
|
+
contactId: zod.z.string(),
|
|
1536
|
+
email: zod.z.string().describe("The address the email was sent to"),
|
|
1537
|
+
emailId: zod.z.string().describe("Which email of the sequence or broadcast it was"),
|
|
1538
|
+
outcome: zod.z.enum(deliveryOutcome),
|
|
1539
|
+
bounceType: zod.z.enum(["hard", "soft"]).nullable().describe(
|
|
1540
|
+
"hard: permanent (the address doesn't exist or refuses mail). soft: temporary (mailbox full, server down). null when the send didn't bounce or the ESP didn't say"
|
|
1541
|
+
),
|
|
1542
|
+
reason: zod.z.string().nullable().describe(
|
|
1543
|
+
"The ESP's reason or diagnostic for the bounce or complaint, if it sent one"
|
|
1544
|
+
),
|
|
1545
|
+
smtpCode: zod.z.number().nullable(),
|
|
1546
|
+
enhancedStatusCode: zod.z.string().nullable().describe("e.g. 5.1.1"),
|
|
1547
|
+
occurredAt: zod.z.string().nullable().describe(
|
|
1548
|
+
"When the outcome happened (ISO 8601): the complaint, bounce, delivery or send"
|
|
1549
|
+
),
|
|
1550
|
+
suppression: zod.z.object({
|
|
1551
|
+
suppressionId: zod.z.string(),
|
|
1552
|
+
reason: zod.z.enum(suppressionReason)
|
|
1553
|
+
}).nullable().describe("The address's active suppression, if SendLit no longer mails it")
|
|
1554
|
+
});
|
|
1555
|
+
var sequenceDeliveriesPageSchema = zod.z.object({
|
|
1556
|
+
items: zod.z.array(sequenceDeliverySchema),
|
|
1557
|
+
total: zod.z.number().describe("Every matching send, across all pages")
|
|
1558
|
+
});
|
|
1240
1559
|
var sequenceDeletionPreviewSchema = zod.z.object({
|
|
1241
1560
|
status: zod.z.string().describe("The broadcast or sequence's current status"),
|
|
1242
1561
|
blocker: zod.z.enum(["sequence_active", "broadcast_sent"]).nullable().describe(
|
|
@@ -1285,15 +1604,21 @@ var listContactsQuerySchema = zod.z.object({
|
|
|
1285
1604
|
excludeFilter: zod.z.string().optional().describe(
|
|
1286
1605
|
"Serialized ContactFilterWithAggregator JSON; contacts matching it are left out"
|
|
1287
1606
|
),
|
|
1288
|
-
offset: zod.z.coerce.number().int().min(1).optional(),
|
|
1289
|
-
rowsPerPage: zod.z.coerce.number().int().min(1).optional()
|
|
1607
|
+
offset: zod.z.coerce.number().int().min(1).optional().describe("Page number, 1-indexed (default: 1)"),
|
|
1608
|
+
rowsPerPage: zod.z.coerce.number().int().min(1).optional().describe("Contacts per page (default: 10)")
|
|
1290
1609
|
});
|
|
1291
1610
|
zod.z.object({
|
|
1292
1611
|
sequenceId: zod.z.string(),
|
|
1293
1612
|
sequenceTitle: zod.z.string(),
|
|
1294
1613
|
sequenceType: zod.z.string(),
|
|
1295
1614
|
emailId: zod.z.string(),
|
|
1296
|
-
createdAt: zod.z.string().nullable()
|
|
1615
|
+
createdAt: zod.z.string().nullable(),
|
|
1616
|
+
/** Public `msg_...` id of the send; null for sends from before the
|
|
1617
|
+
* outbound message log. */
|
|
1618
|
+
messageId: zod.z.string().nullable(),
|
|
1619
|
+
outcome: zod.z.enum(deliveryOutcome).nullable().describe(
|
|
1620
|
+
"What happened to the send: sent (accepted by the ESP, no report yet), delivered, bounced, complained (marked as spam) or failed. null for sends from before the outbound message log."
|
|
1621
|
+
)
|
|
1297
1622
|
});
|
|
1298
1623
|
var importContactRowSchema = zod.z.object({
|
|
1299
1624
|
/** Validated per row; an invalid address is reported as skipped. */
|
|
@@ -1382,46 +1707,6 @@ var contactDeletionSchema = zod.z.object({
|
|
|
1382
1707
|
deleted: zod.z.number().int().describe("Contacts deleted so far"),
|
|
1383
1708
|
suppressed: zod.z.number().int().describe("Unsubscribed addresses newly added to the suppression list")
|
|
1384
1709
|
});
|
|
1385
|
-
var deliveryEventType = [
|
|
1386
|
-
"accepted",
|
|
1387
|
-
"delivered",
|
|
1388
|
-
"delayed",
|
|
1389
|
-
"soft_bounce",
|
|
1390
|
-
"hard_bounce",
|
|
1391
|
-
"failed",
|
|
1392
|
-
"complaint",
|
|
1393
|
-
"suppressed",
|
|
1394
|
-
"rejected",
|
|
1395
|
-
"unknown"
|
|
1396
|
-
];
|
|
1397
|
-
var bounceClass = ["permanent", "transient", "undetermined"];
|
|
1398
|
-
var deliverySourceTypes = ["organization", "team"];
|
|
1399
|
-
var deliveryEventSchema = zod.z.object({
|
|
1400
|
-
eventId: zod.z.string(),
|
|
1401
|
-
provider: zod.z.string(),
|
|
1402
|
-
espId: zod.z.string().nullable(),
|
|
1403
|
-
deliverySourceType: zod.z.enum(deliverySourceTypes).nullable(),
|
|
1404
|
-
/** Public `msg_...` id of the correlated outbound message, when the
|
|
1405
|
-
* event was matched to one — see the PRD's correlation section. */
|
|
1406
|
-
messageId: zod.z.string().nullable(),
|
|
1407
|
-
recipientEmail: zod.z.string().nullable(),
|
|
1408
|
-
eventType: zod.z.enum(deliveryEventType),
|
|
1409
|
-
bounceClass: zod.z.enum(bounceClass).nullable().optional(),
|
|
1410
|
-
smtpCode: zod.z.number().nullable().optional(),
|
|
1411
|
-
enhancedStatusCode: zod.z.string().nullable().optional(),
|
|
1412
|
-
reason: zod.z.string().nullable().optional(),
|
|
1413
|
-
occurredAt: zod.z.string(),
|
|
1414
|
-
receivedAt: zod.z.string()
|
|
1415
|
-
});
|
|
1416
|
-
var listDeliveryEventsQuerySchema = zod.z.object({
|
|
1417
|
-
espId: zod.z.string().optional(),
|
|
1418
|
-
deliverySourceType: zod.z.enum(deliverySourceTypes).optional(),
|
|
1419
|
-
eventType: zod.z.enum(deliveryEventType).optional(),
|
|
1420
|
-
createdAfter: zod.z.coerce.number().int().optional(),
|
|
1421
|
-
createdBefore: zod.z.coerce.number().int().optional(),
|
|
1422
|
-
offset: zod.z.coerce.number().int().min(1).optional(),
|
|
1423
|
-
itemsPerPage: zod.z.coerce.number().int().min(1).optional()
|
|
1424
|
-
});
|
|
1425
1710
|
var espProviders = [
|
|
1426
1711
|
"smtp",
|
|
1427
1712
|
"sendgrid",
|
|
@@ -1454,6 +1739,9 @@ var espConfigSchema = zod.z.object({
|
|
|
1454
1739
|
secure: zod.z.boolean(),
|
|
1455
1740
|
username: zod.z.string().nullable().optional(),
|
|
1456
1741
|
hasPassword: zod.z.boolean(),
|
|
1742
|
+
/** Organization ESPs: whether a provider API credential is stored, which
|
|
1743
|
+
* lets teams register their own sending domains (SES only for now). */
|
|
1744
|
+
hasManagementCredentials: zod.z.boolean().optional(),
|
|
1457
1745
|
fromName: zod.z.string().nullable().optional(),
|
|
1458
1746
|
fromEmail: zod.z.string().nullable().optional(),
|
|
1459
1747
|
replyTo: zod.z.string().nullable().optional(),
|
|
@@ -1561,6 +1849,12 @@ var domainAuthenticationQuerySchema = zod.z.object({
|
|
|
1561
1849
|
"DKIM selector to check (for Amazon SES, one Easy DKIM token). A selector that passes is saved on the ESP and used by later checks that omit it."
|
|
1562
1850
|
)
|
|
1563
1851
|
});
|
|
1852
|
+
var espManagementCredentialsBodySchema = zod.z.object({
|
|
1853
|
+
accessKeyId: zod.z.string().min(1),
|
|
1854
|
+
secretAccessKey: zod.z.string().min(1),
|
|
1855
|
+
/** Defaults to the region in the SMTP host. */
|
|
1856
|
+
region: zod.z.string().min(1).optional()
|
|
1857
|
+
});
|
|
1564
1858
|
var feedbackConnectionStatus = [
|
|
1565
1859
|
"pending",
|
|
1566
1860
|
"healthy",
|
|
@@ -1635,6 +1929,18 @@ var createSignupFormBodySchema = zod.z.object({
|
|
|
1635
1929
|
redirectUrl: zod.z.string().url().refine((value) => /^https?:\/\//i.test(value), "Must be an http(s) URL").nullable().optional().describe("Where to send people after they submit the hosted or embedded form")
|
|
1636
1930
|
});
|
|
1637
1931
|
var updateSignupFormBodySchema = createSignupFormBodySchema.partial();
|
|
1932
|
+
var submitSignupFormBodySchema = zod.z.object({
|
|
1933
|
+
email: zod.z.string().trim().min(1).max(254),
|
|
1934
|
+
name: zod.z.string().trim().max(200).optional(),
|
|
1935
|
+
clientIp: zod.z.string().trim().min(1).max(64).optional().describe(
|
|
1936
|
+
"IP address of the person signing up. Per-IP rate limits apply to it; without it they apply to the calling server."
|
|
1937
|
+
)
|
|
1938
|
+
});
|
|
1939
|
+
var signupFormSubmissionSchema = zod.z.object({
|
|
1940
|
+
status: zod.z.enum(["confirmation_sent", "subscribed"]).describe(
|
|
1941
|
+
"`confirmation_sent` for double opt-in forms, `subscribed` for single opt-in. The same for every address, accepted or quietly dropped."
|
|
1942
|
+
)
|
|
1943
|
+
});
|
|
1638
1944
|
var mediaSchema = zod.z.object({
|
|
1639
1945
|
mediaId: zod.z.string(),
|
|
1640
1946
|
url: zod.z.string(),
|
|
@@ -1741,96 +2047,36 @@ var reputationSchema = zod.z.object({
|
|
|
1741
2047
|
compliance: zod.z.object({
|
|
1742
2048
|
status: zod.z.enum(["compliant", "needs_work", "unknown"]),
|
|
1743
2049
|
needsWork: zod.z.array(zod.z.string())
|
|
1744
|
-
}).nullable(),
|
|
1745
|
-
days: zod.z.array(googleDaySchema)
|
|
1746
|
-
})
|
|
1747
|
-
)
|
|
1748
|
-
}),
|
|
1749
|
-
snds: zod.z.object({
|
|
1750
|
-
connection: connectionSchema.nullable(),
|
|
1751
|
-
ips: zod.z.array(zod.z.object({ ip: zod.z.string(), days: zod.z.array(sndsDaySchema) }))
|
|
1752
|
-
}),
|
|
1753
|
-
alerts: zod.z.array(reputationAlertSchema)
|
|
1754
|
-
});
|
|
1755
|
-
var connectSndsBodySchema = zod.z.object({
|
|
1756
|
-
dataUrl: zod.z.string().url().describe(
|
|
1757
|
-
"The SNDS automated data access link (Automated Data Access page in SNDS). It expires after 30 days; paste the new one when it does."
|
|
1758
|
-
)
|
|
1759
|
-
});
|
|
1760
|
-
var segmentSchema = zod.z.object({
|
|
1761
|
-
segmentId: zod.z.string(),
|
|
1762
|
-
name: zod.z.string(),
|
|
1763
|
-
filter: contactFilterSchema,
|
|
1764
|
-
createdAt: zod.z.string().nullable(),
|
|
1765
|
-
updatedAt: zod.z.string().nullable()
|
|
1766
|
-
});
|
|
1767
|
-
var createSegmentBodySchema = zod.z.object({
|
|
1768
|
-
name: zod.z.string().min(1),
|
|
1769
|
-
filter: contactFilterSchema
|
|
1770
|
-
});
|
|
1771
|
-
var updateSegmentBodySchema = zod.z.object({
|
|
1772
|
-
name: zod.z.string().min(1).optional(),
|
|
1773
|
-
filter: contactFilterSchema.optional()
|
|
1774
|
-
});
|
|
1775
|
-
var generalSettingsSchema = zod.z.object({
|
|
1776
|
-
/** Physical postal address rendered in email footers
|
|
1777
|
-
* (CAN-SPAM/GDPR requirement). */
|
|
1778
|
-
mailingAddress: zod.z.string().nullable(),
|
|
1779
|
-
updatedAt: zod.z.string().nullable().optional()
|
|
1780
|
-
});
|
|
1781
|
-
var updateGeneralSettingsBodySchema = zod.z.object({
|
|
1782
|
-
/** Send an empty string to clear the mailing address. */
|
|
1783
|
-
mailingAddress: zod.z.string().optional()
|
|
1784
|
-
});
|
|
1785
|
-
var trackingDomainStatuses = ["pending", "verified", "failed"];
|
|
1786
|
-
var trackingDomainSchema = zod.z.object({
|
|
1787
|
-
domain: zod.z.string().nullable(),
|
|
1788
|
-
/** `pending` until the CNAME and HTTPS work; `failed` after the domain
|
|
1789
|
-
* stopped working, when links fall back to SendLit's own host. */
|
|
1790
|
-
status: zod.z.enum(trackingDomainStatuses).nullable(),
|
|
1791
|
-
/** The host the domain's CNAME record must point to. */
|
|
1792
|
-
cnameTarget: zod.z.string(),
|
|
1793
|
-
/** Why the last check failed: `cname_missing`, `cname_mismatch`,
|
|
1794
|
-
* `unreachable` (no HTTPS answer yet) or `dns_error`. */
|
|
1795
|
-
error: zod.z.string().nullable(),
|
|
1796
|
-
verifiedAt: zod.z.string().nullable(),
|
|
1797
|
-
checkedAt: zod.z.string().nullable()
|
|
1798
|
-
});
|
|
1799
|
-
var updateTrackingDomainBodySchema = zod.z.object({
|
|
1800
|
-
/** A subdomain such as `track.example.com`; `null` removes it. */
|
|
1801
|
-
domain: zod.z.string().max(253).nullable()
|
|
2050
|
+
}).nullable(),
|
|
2051
|
+
days: zod.z.array(googleDaySchema)
|
|
2052
|
+
})
|
|
2053
|
+
)
|
|
2054
|
+
}),
|
|
2055
|
+
snds: zod.z.object({
|
|
2056
|
+
connection: connectionSchema.nullable(),
|
|
2057
|
+
ips: zod.z.array(zod.z.object({ ip: zod.z.string(), days: zod.z.array(sndsDaySchema) }))
|
|
2058
|
+
}),
|
|
2059
|
+
alerts: zod.z.array(reputationAlertSchema)
|
|
1802
2060
|
});
|
|
1803
|
-
var
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
"provider_suppression",
|
|
1808
|
-
"manual"
|
|
1809
|
-
];
|
|
1810
|
-
var suppressionSchema = zod.z.object({
|
|
1811
|
-
suppressionId: zod.z.string(),
|
|
1812
|
-
recipientEmail: zod.z.string().nullable(),
|
|
1813
|
-
reason: zod.z.enum(suppressionReason),
|
|
1814
|
-
active: zod.z.boolean(),
|
|
1815
|
-
firstSuppressedAt: zod.z.string(),
|
|
1816
|
-
lastSuppressedAt: zod.z.string(),
|
|
1817
|
-
releasedAt: zod.z.string().nullable().optional(),
|
|
1818
|
-
releaseReason: zod.z.string().nullable().optional()
|
|
2061
|
+
var connectSndsBodySchema = zod.z.object({
|
|
2062
|
+
dataUrl: zod.z.string().url().describe(
|
|
2063
|
+
"The SNDS automated data access link (Automated Data Access page in SNDS). It expires after 30 days; paste the new one when it does."
|
|
2064
|
+
)
|
|
1819
2065
|
});
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
2066
|
+
var segmentSchema = zod.z.object({
|
|
2067
|
+
segmentId: zod.z.string(),
|
|
2068
|
+
name: zod.z.string(),
|
|
2069
|
+
filter: contactFilterSchema,
|
|
2070
|
+
createdAt: zod.z.string().nullable(),
|
|
2071
|
+
updatedAt: zod.z.string().nullable()
|
|
1825
2072
|
});
|
|
1826
|
-
var
|
|
1827
|
-
|
|
2073
|
+
var createSegmentBodySchema = zod.z.object({
|
|
2074
|
+
name: zod.z.string().min(1),
|
|
2075
|
+
filter: contactFilterSchema
|
|
1828
2076
|
});
|
|
1829
|
-
var
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
"Why the address is blocked, e.g. a legal request; kept in the audit trail"
|
|
1833
|
-
)
|
|
2077
|
+
var updateSegmentBodySchema = zod.z.object({
|
|
2078
|
+
name: zod.z.string().min(1).optional(),
|
|
2079
|
+
filter: contactFilterSchema.optional()
|
|
1834
2080
|
});
|
|
1835
2081
|
var tagSummarySchema = zod.z.object({
|
|
1836
2082
|
tag: zod.z.string(),
|
|
@@ -1873,108 +2119,6 @@ var deleteTagResultSchema = zod.z.object({
|
|
|
1873
2119
|
contactsUpdated: zod.z.number().int(),
|
|
1874
2120
|
references: tagReferencesSchema
|
|
1875
2121
|
});
|
|
1876
|
-
var teamSchema = zod.z.object({
|
|
1877
|
-
teamId: zod.z.string(),
|
|
1878
|
-
/** Public organization identifier. Present when an end user lists the
|
|
1879
|
-
* teams they belong to, so the dashboard can keep workspace selection
|
|
1880
|
-
* scoped to one organization. */
|
|
1881
|
-
organizationId: zod.z.string().optional(),
|
|
1882
|
-
organizationName: zod.z.string().optional(),
|
|
1883
|
-
name: zod.z.string(),
|
|
1884
|
-
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
1885
|
-
externalId: zod.z.string().nullable().optional(),
|
|
1886
|
-
createdAt: zod.z.string().nullable().optional(),
|
|
1887
|
-
updatedAt: zod.z.string().nullable().optional(),
|
|
1888
|
-
/** True when the calling human is already a `team_members` row. Always
|
|
1889
|
-
* false for organization API keys. Omitted on non-list team payloads. */
|
|
1890
|
-
viewerIsMember: zod.z.boolean().optional()
|
|
1891
|
-
});
|
|
1892
|
-
var apiKeySchema = zod.z.object({
|
|
1893
|
-
keyId: zod.z.string(),
|
|
1894
|
-
keyPrefix: zod.z.string(),
|
|
1895
|
-
name: zod.z.string(),
|
|
1896
|
-
expiresAt: zod.z.string().nullable().optional(),
|
|
1897
|
-
lastUsedAt: zod.z.string().nullable().optional(),
|
|
1898
|
-
revokedAt: zod.z.string().nullable().optional(),
|
|
1899
|
-
createdAt: zod.z.string().nullable().optional()
|
|
1900
|
-
});
|
|
1901
|
-
var createdApiKeySchema = apiKeySchema.extend({
|
|
1902
|
-
key: zod.z.string()
|
|
1903
|
-
});
|
|
1904
|
-
var createTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1905
|
-
var renameTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1906
|
-
var createApiKeyBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1907
|
-
var provisionTeamBodySchema = zod.z.object({
|
|
1908
|
-
externalId: zod.z.string().min(1),
|
|
1909
|
-
name: zod.z.string().min(1),
|
|
1910
|
-
sender: zod.z.object({
|
|
1911
|
-
fromName: zod.z.string().min(1).optional(),
|
|
1912
|
-
replyTo: zod.z.string().email().optional()
|
|
1913
|
-
}).optional(),
|
|
1914
|
-
mailingAddress: zod.z.string().min(1).optional(),
|
|
1915
|
-
delivery: zod.z.object({
|
|
1916
|
-
useOrganizationDefault: zod.z.boolean().optional(),
|
|
1917
|
-
teamEspEnabled: zod.z.boolean().optional(),
|
|
1918
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
1919
|
-
}).optional(),
|
|
1920
|
-
quota: zod.z.object({
|
|
1921
|
-
dailyLimit: zod.z.number().int().positive().nullable().optional(),
|
|
1922
|
-
monthlyLimit: zod.z.number().int().positive().nullable().optional()
|
|
1923
|
-
}).optional()
|
|
1924
|
-
});
|
|
1925
|
-
var provisionedTeamBaseSchema = zod.z.object({
|
|
1926
|
-
teamId: zod.z.string(),
|
|
1927
|
-
externalId: zod.z.string(),
|
|
1928
|
-
name: zod.z.string(),
|
|
1929
|
-
deliverySource: zod.z.object({ type: zod.z.literal("organization") })
|
|
1930
|
-
});
|
|
1931
|
-
var provisionTeamResponseSchema = zod.z.discriminatedUnion("created", [
|
|
1932
|
-
provisionedTeamBaseSchema.extend({
|
|
1933
|
-
created: zod.z.literal(true),
|
|
1934
|
-
apiKey: zod.z.string()
|
|
1935
|
-
}),
|
|
1936
|
-
provisionedTeamBaseSchema.extend({
|
|
1937
|
-
created: zod.z.literal(false),
|
|
1938
|
-
apiKey: zod.z.null()
|
|
1939
|
-
})
|
|
1940
|
-
]);
|
|
1941
|
-
var provisionedTeamSchema = provisionedTeamBaseSchema.extend({
|
|
1942
|
-
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
1943
|
-
mailingAddress: zod.z.string().nullable(),
|
|
1944
|
-
teamEspEnabled: zod.z.boolean(),
|
|
1945
|
-
teamCanChangeDefault: zod.z.boolean(),
|
|
1946
|
-
createdAt: zod.z.string().nullable(),
|
|
1947
|
-
updatedAt: zod.z.string().nullable()
|
|
1948
|
-
});
|
|
1949
|
-
var updateProvisionedTeamBodySchema = zod.z.object({
|
|
1950
|
-
name: zod.z.string().min(1).optional(),
|
|
1951
|
-
sender: zod.z.object({
|
|
1952
|
-
fromName: zod.z.string().min(1).nullable().optional(),
|
|
1953
|
-
replyTo: zod.z.string().email().nullable().optional()
|
|
1954
|
-
}).optional(),
|
|
1955
|
-
mailingAddress: zod.z.string().min(1).nullable().optional(),
|
|
1956
|
-
delivery: zod.z.object({
|
|
1957
|
-
teamEspEnabled: zod.z.boolean().optional(),
|
|
1958
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
1959
|
-
}).optional(),
|
|
1960
|
-
quota: zod.z.object({
|
|
1961
|
-
dailyLimit: zod.z.number().int().nonnegative().nullable().optional(),
|
|
1962
|
-
monthlyLimit: zod.z.number().int().nonnegative().nullable().optional()
|
|
1963
|
-
}).optional()
|
|
1964
|
-
}).refine((body) => Object.keys(body).length > 0, {
|
|
1965
|
-
message: "At least one field is required"
|
|
1966
|
-
});
|
|
1967
|
-
var usageWindowSchema = zod.z.object({
|
|
1968
|
-
limit: zod.z.number().int().nullable(),
|
|
1969
|
-
accepted: zod.z.number().int().nonnegative(),
|
|
1970
|
-
reserved: zod.z.number().int().nonnegative(),
|
|
1971
|
-
remaining: zod.z.number().int().nullable(),
|
|
1972
|
-
resetsAt: zod.z.string()
|
|
1973
|
-
});
|
|
1974
|
-
var provisionedTeamUsageSchema = zod.z.object({
|
|
1975
|
-
day: usageWindowSchema,
|
|
1976
|
-
month: usageWindowSchema
|
|
1977
|
-
});
|
|
1978
2122
|
var templatePurposes = ["marketing", "transactional"];
|
|
1979
2123
|
var templatePurposeSchema = zod.z.enum(templatePurposes).describe(
|
|
1980
2124
|
"Immutable sending purpose. Marketing templates require a final managed footer; transactional templates are footer-free and are valid for POST /emails."
|
|
@@ -2316,7 +2460,8 @@ var contactsContract = c.router(
|
|
|
2316
2460
|
200: c.type(),
|
|
2317
2461
|
404: errorSchema
|
|
2318
2462
|
},
|
|
2319
|
-
summary: "List broadcasts/sequence emails
|
|
2463
|
+
summary: "List broadcasts/sequence emails sent to a contact",
|
|
2464
|
+
description: "Newest first. Each send has its `outcome`: sent (accepted by the ESP, no report yet), delivered, bounced, complained (marked as spam) or failed; null for sends from before the outbound message log."
|
|
2320
2465
|
},
|
|
2321
2466
|
events: {
|
|
2322
2467
|
method: "GET",
|
|
@@ -2718,7 +2863,7 @@ var sequencesContract = c.router(
|
|
|
2718
2863
|
422: errorSchema
|
|
2719
2864
|
},
|
|
2720
2865
|
summary: "Start a broadcast or activate a sequence",
|
|
2721
|
-
description: "Requires a
|
|
2866
|
+
description: "Requires a postal address in the team's general settings. On SendLit Cloud, a new organization's first broadcast to 1,000 or more contacts through its own ESP is reviewed once before it can start (400 `broadcast_held_for_review`); start it again once approved."
|
|
2722
2867
|
},
|
|
2723
2868
|
pause: {
|
|
2724
2869
|
method: "POST",
|
|
@@ -2752,6 +2897,18 @@ var sequencesContract = c.router(
|
|
|
2752
2897
|
responses: { 200: sequenceStatsSchema, 404: errorSchema },
|
|
2753
2898
|
summary: "Delivery / open-rate / click-through-rate stats for a sequence"
|
|
2754
2899
|
},
|
|
2900
|
+
deliveries: {
|
|
2901
|
+
method: "GET",
|
|
2902
|
+
path: "/sequences/:sequenceId/deliveries",
|
|
2903
|
+
query: listSequenceDeliveriesQuerySchema,
|
|
2904
|
+
responses: {
|
|
2905
|
+
200: sequenceDeliveriesPageSchema,
|
|
2906
|
+
400: errorSchema,
|
|
2907
|
+
404: errorSchema
|
|
2908
|
+
},
|
|
2909
|
+
summary: "List the sends of a sequence or broadcast and what happened to each",
|
|
2910
|
+
description: "One row per email sent (accepted by the ESP), most recent outcome first, with the recipient, the outcome (sent, delivered, bounced, complained, failed), the bounce type and the ESP's reason when it reported one, and the address's active suppression if any. `outcome=bounced` and `outcome=complained` list exactly the sends counted by the `bounceRate` and `complaintRate` of GET /sequences/{sequenceId}/stats. Pages hold `itemsPerPage` sends (default 10, at most 100); `offset` is the page number. Sends whose contact was deleted are not listed."
|
|
2911
|
+
},
|
|
2755
2912
|
schedule: {
|
|
2756
2913
|
method: "GET",
|
|
2757
2914
|
path: "/sequences/:sequenceId/schedule",
|
|
@@ -2800,7 +2957,7 @@ var transactionalContract = c.router(
|
|
|
2800
2957
|
429: errorSchema
|
|
2801
2958
|
},
|
|
2802
2959
|
summary: "Send a transactional email",
|
|
2803
|
-
description: "Requires a
|
|
2960
|
+
description: "Requires a postal address in the team's general settings. `templateId` must identify a team-owned transactional template; marketing templates return 422 template_not_transactional. Unguarded Liquid variables must be supplied in `variables`, or the API returns 422 missing_template_variables without creating a row or queue job. Inline `html` is sent verbatim without Liquid rendering. address, unsubscribe_link, and subscriber are marketing-only server-owned values and are unavailable to transactional templates."
|
|
2804
2961
|
},
|
|
2805
2962
|
get: {
|
|
2806
2963
|
method: "GET",
|
|
@@ -2960,7 +3117,7 @@ var espCollectionContract = c.router(
|
|
|
2960
3117
|
502: testEspConfigResponseSchema
|
|
2961
3118
|
},
|
|
2962
3119
|
summary: "Send a test email through a user-managed ESP",
|
|
2963
|
-
description: "Requires a
|
|
3120
|
+
description: "Requires a postal address in the team's general settings."
|
|
2964
3121
|
},
|
|
2965
3122
|
activate: {
|
|
2966
3123
|
method: "POST",
|
|
@@ -3027,9 +3184,9 @@ var generalSettingsContract = c.router(
|
|
|
3027
3184
|
method: "PUT",
|
|
3028
3185
|
path: "/settings/general",
|
|
3029
3186
|
body: updateGeneralSettingsBodySchema,
|
|
3030
|
-
responses: { 200: generalSettingsSchema },
|
|
3187
|
+
responses: { 200: generalSettingsSchema, 400: errorSchema },
|
|
3031
3188
|
summary: "Update the team's general settings",
|
|
3032
|
-
description: "
|
|
3189
|
+
description: "Omit `postalAddress` to keep it; `null` clears it. 400 `postal_country_invalid` when its country isn't a current ISO 3166-1 alpha-2 code."
|
|
3033
3190
|
}
|
|
3034
3191
|
},
|
|
3035
3192
|
{ metadata: { tag: "Settings" } }
|
|
@@ -3243,7 +3400,7 @@ var provisioningContract = c.router(
|
|
|
3243
3400
|
500: errorSchema
|
|
3244
3401
|
},
|
|
3245
3402
|
summary: "Find-or-create a team for a consumer-supplied tenant id",
|
|
3246
|
-
description: "Server-to-server endpoint for multi-tenant consumers (e.g. CourseLit) to provision one SendLit team per tenant. Requires a scoped organization key as a Bearer token."
|
|
3403
|
+
description: "Server-to-server endpoint for multi-tenant consumers (e.g. CourseLit) to provision one SendLit team per tenant. Requires a scoped organization key as a Bearer token. `postalAddress` sets the team's footer address; 400 `postal_country_invalid` when its country isn't a current ISO 3166-1 alpha-2 code."
|
|
3247
3404
|
},
|
|
3248
3405
|
getTeam: {
|
|
3249
3406
|
method: "GET",
|
|
@@ -3253,7 +3410,8 @@ var provisioningContract = c.router(
|
|
|
3253
3410
|
403: errorSchema,
|
|
3254
3411
|
404: errorSchema
|
|
3255
3412
|
},
|
|
3256
|
-
summary: "Get a provisioned team within the authenticated organization"
|
|
3413
|
+
summary: "Get a provisioned team within the authenticated organization",
|
|
3414
|
+
description: "`health` is the team's sending status: `normal`, `warned`, `marketing_paused` or `all_paused`, with the `reason` code and whether it comes from the team's own reputation or the shared mailbox (`scope`). `last7Days` counts the emails the ESP accepted in the last 7 days and how many bounced or were marked as spam."
|
|
3257
3415
|
},
|
|
3258
3416
|
updateTeam: {
|
|
3259
3417
|
method: "PATCH",
|
|
@@ -3261,11 +3419,13 @@ var provisioningContract = c.router(
|
|
|
3261
3419
|
body: updateProvisionedTeamBodySchema,
|
|
3262
3420
|
responses: {
|
|
3263
3421
|
200: provisionedTeamSchema,
|
|
3422
|
+
400: errorSchema,
|
|
3264
3423
|
403: errorSchema,
|
|
3265
3424
|
404: errorSchema,
|
|
3266
3425
|
409: errorSchema
|
|
3267
3426
|
},
|
|
3268
|
-
summary: "Update a provisioned team's sender, limits, or settings"
|
|
3427
|
+
summary: "Update a provisioned team's sender, limits, or settings",
|
|
3428
|
+
description: "Omitted fields are left unchanged. `postalAddress: null` clears the team's postal address; 400 `postal_country_invalid` when its country isn't a current ISO 3166-1 alpha-2 code."
|
|
3269
3429
|
},
|
|
3270
3430
|
createTeamKey: {
|
|
3271
3431
|
method: "POST",
|
|
@@ -3308,6 +3468,39 @@ var provisioningContract = c.router(
|
|
|
3308
3468
|
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
3309
3469
|
summary: "Archive a provisioned team"
|
|
3310
3470
|
},
|
|
3471
|
+
getTeamSendingDomain: {
|
|
3472
|
+
method: "GET",
|
|
3473
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3474
|
+
responses: {
|
|
3475
|
+
200: teamSendingDomainSchema.nullable(),
|
|
3476
|
+
403: errorSchema,
|
|
3477
|
+
404: errorSchema,
|
|
3478
|
+
422: errorSchema
|
|
3479
|
+
},
|
|
3480
|
+
summary: "Check a provisioned team's own sending domain",
|
|
3481
|
+
description: "Re-checks the domain with the shared ESP and DNS, at most every 30 seconds (calls in between return the last check). Requires `teams:read`. `null` when the team has none."
|
|
3482
|
+
},
|
|
3483
|
+
setTeamSendingDomain: {
|
|
3484
|
+
method: "PUT",
|
|
3485
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3486
|
+
body: setTeamSendingDomainBodySchema,
|
|
3487
|
+
responses: {
|
|
3488
|
+
200: teamSendingDomainSchema,
|
|
3489
|
+
400: errorSchema,
|
|
3490
|
+
403: errorSchema,
|
|
3491
|
+
404: errorSchema,
|
|
3492
|
+
409: errorSchema,
|
|
3493
|
+
422: errorSchema
|
|
3494
|
+
},
|
|
3495
|
+
summary: "Set a provisioned team's own From address and register its domain",
|
|
3496
|
+
description: "Requires `teams:manage`. Returns the DNS records the team must publish (Amazon SES Easy DKIM CNAMEs and a DMARC TXT record). Errors as for the organization route."
|
|
3497
|
+
},
|
|
3498
|
+
removeTeamSendingDomain: {
|
|
3499
|
+
method: "DELETE",
|
|
3500
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3501
|
+
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
3502
|
+
summary: "Stop using a provisioned team's own sending domain"
|
|
3503
|
+
},
|
|
3311
3504
|
getTeamUsage: {
|
|
3312
3505
|
method: "GET",
|
|
3313
3506
|
path: "/provisioning/teams/:teamId/usage",
|
|
@@ -3316,7 +3509,8 @@ var provisioningContract = c.router(
|
|
|
3316
3509
|
403: errorSchema,
|
|
3317
3510
|
404: errorSchema
|
|
3318
3511
|
},
|
|
3319
|
-
summary: "Get organization-delivery quota usage for a provisioned team"
|
|
3512
|
+
summary: "Get organization-delivery quota usage for a provisioned team",
|
|
3513
|
+
description: "Returns the team's day and month quota on the shared mailbox, plus its `health` (see Get a provisioned team)."
|
|
3320
3514
|
}
|
|
3321
3515
|
},
|
|
3322
3516
|
{ metadata: { tag: "Teams" } }
|
|
@@ -3630,6 +3824,31 @@ var organizationsContract = c.router(
|
|
|
3630
3824
|
summary: "Delete an eligible never-activated organization ESP",
|
|
3631
3825
|
description: "Only a never-activated draft with no history is deleted. 409 explains a blocked delete: `esp_retire_instead` (it has been activated; retire it instead), `esp_has_delivery_history`, or `delivery_source_in_use`."
|
|
3632
3826
|
},
|
|
3827
|
+
setEspManagementCredentials: {
|
|
3828
|
+
method: "PUT",
|
|
3829
|
+
path: "/organizations/:organizationId/esps/:espId/management-credentials",
|
|
3830
|
+
body: espManagementCredentialsBodySchema,
|
|
3831
|
+
responses: {
|
|
3832
|
+
200: espConfigSchema,
|
|
3833
|
+
403: errorSchema,
|
|
3834
|
+
404: errorSchema,
|
|
3835
|
+
422: errorSchema
|
|
3836
|
+
},
|
|
3837
|
+
summary: "Store a shared ESP's provider API credential",
|
|
3838
|
+
description: "Lets teams register their own sending domains on this mailbox. Amazon SES only for now (422 `provider_domain_unsupported` otherwise). The credential is encrypted at rest and never returned; the ESP shows `hasManagementCredentials`."
|
|
3839
|
+
},
|
|
3840
|
+
removeEspManagementCredentials: {
|
|
3841
|
+
method: "DELETE",
|
|
3842
|
+
path: "/organizations/:organizationId/esps/:espId/management-credentials",
|
|
3843
|
+
responses: {
|
|
3844
|
+
200: espConfigSchema,
|
|
3845
|
+
403: errorSchema,
|
|
3846
|
+
404: errorSchema,
|
|
3847
|
+
409: errorSchema
|
|
3848
|
+
},
|
|
3849
|
+
summary: "Remove a shared ESP's provider API credential",
|
|
3850
|
+
description: "409 `esp_management_credentials_in_use` while teams' own sending domains are registered through the mailbox: remove those first."
|
|
3851
|
+
},
|
|
3633
3852
|
getEspFeedback: {
|
|
3634
3853
|
method: "GET",
|
|
3635
3854
|
path: "/organizations/:organizationId/esps/:espId/feedback",
|
|
@@ -3729,8 +3948,8 @@ var organizationsContract = c.router(
|
|
|
3729
3948
|
403: errorSchema,
|
|
3730
3949
|
404: errorSchema
|
|
3731
3950
|
},
|
|
3732
|
-
summary: "Get organization
|
|
3733
|
-
description: "Returns per-team and organization-total
|
|
3951
|
+
summary: "Get organization mail activity and team health",
|
|
3952
|
+
description: "Returns per-team and organization-total mail counts (`sent`, `queued`, `failed`, `bounced`, `complained`) from the outbound ledger, covering broadcasts, sequences and transactional email, for a window of 1, 3, 7, or 30 days (default 7). Includes teams with zero activity. Each team also carries its `health` (sending status with reason and scope, plus 7-day sent, bounced and complained counts, whatever the window) and its shared-mailbox `quota` (null without an active grant). No recipients, subjects, or email bodies."
|
|
3734
3953
|
},
|
|
3735
3954
|
enterTeam: {
|
|
3736
3955
|
method: "POST",
|
|
@@ -3790,6 +4009,40 @@ var organizationsContract = c.router(
|
|
|
3790
4009
|
},
|
|
3791
4010
|
summary: "Transition a team's organization ESP grant; revoking detaches safe campaigns"
|
|
3792
4011
|
},
|
|
4012
|
+
getTeamSendingDomain: {
|
|
4013
|
+
method: "GET",
|
|
4014
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4015
|
+
responses: {
|
|
4016
|
+
200: teamSendingDomainSchema.nullable(),
|
|
4017
|
+
403: errorSchema,
|
|
4018
|
+
404: errorSchema,
|
|
4019
|
+
422: errorSchema
|
|
4020
|
+
},
|
|
4021
|
+
summary: "Check a team's own sending domain",
|
|
4022
|
+
description: "Re-checks the domain with the shared ESP and DNS (at most every 30 seconds; calls in between return the last check) and returns its status and the DNS records to publish. `null` when the team has none. The team sends from it once the ESP has verified DKIM and a DMARC record is published."
|
|
4023
|
+
},
|
|
4024
|
+
setTeamSendingDomain: {
|
|
4025
|
+
method: "PUT",
|
|
4026
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4027
|
+
body: setTeamSendingDomainBodySchema,
|
|
4028
|
+
responses: {
|
|
4029
|
+
200: teamSendingDomainSchema,
|
|
4030
|
+
400: errorSchema,
|
|
4031
|
+
403: errorSchema,
|
|
4032
|
+
404: errorSchema,
|
|
4033
|
+
409: errorSchema,
|
|
4034
|
+
422: errorSchema
|
|
4035
|
+
},
|
|
4036
|
+
summary: "Set a team's own From address and register its domain",
|
|
4037
|
+
description: "Registers the From address's domain with the team's shared ESP (Amazon SES for now) and returns the DNS records to publish. Replacing a different domain removes the old one. 422 `esp_management_credentials_required` when the shared ESP has no API credential, `provider_domain_unsupported` for other providers, `organization_delivery_disabled` without an active grant. 409 `domain_in_use` when another team, the organization or the shared mailbox's own From address uses the domain, and `domain_exists_at_provider` when the ESP account already has the domain (SendLit never takes over an identity it did not create). 422 `esp_provider_error` when the provider's API refuses or fails."
|
|
4038
|
+
},
|
|
4039
|
+
removeTeamSendingDomain: {
|
|
4040
|
+
method: "DELETE",
|
|
4041
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4042
|
+
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
4043
|
+
summary: "Stop using a team's own sending domain",
|
|
4044
|
+
description: "Removes the domain from the shared ESP. The team goes back to the shared From domain, which the organization's `requireTeamSendingDomain` policy may refuse."
|
|
4045
|
+
},
|
|
3793
4046
|
listSendingDomains: {
|
|
3794
4047
|
method: "GET",
|
|
3795
4048
|
path: "/organizations/:organizationId/sending-domains",
|
|
@@ -4000,6 +4253,22 @@ var formsContract = c.router(
|
|
|
4000
4253
|
path: "/forms/:formId",
|
|
4001
4254
|
responses: { 204: c.noBody(), 404: errorSchema },
|
|
4002
4255
|
summary: "Delete a signup form"
|
|
4256
|
+
},
|
|
4257
|
+
submit: {
|
|
4258
|
+
method: "POST",
|
|
4259
|
+
path: "/forms/:formId/submissions",
|
|
4260
|
+
body: submitSignupFormBodySchema,
|
|
4261
|
+
responses: {
|
|
4262
|
+
200: signupFormSubmissionSchema,
|
|
4263
|
+
400: errorSchema,
|
|
4264
|
+
404: errorSchema,
|
|
4265
|
+
429: errorSchema,
|
|
4266
|
+
503: signupFormSenderErrorSchema.extend({
|
|
4267
|
+
error: zod.z.literal("form_unavailable")
|
|
4268
|
+
})
|
|
4269
|
+
},
|
|
4270
|
+
summary: "Submit a signup to a form",
|
|
4271
|
+
description: "Signs someone up through the form from your own server, for a signup page you host yourself. It works like a submission to the form's public URL: double opt-in forms email the confirmation link and subscribe only once it's clicked, single opt-in never resubscribes someone who unsubscribed, and suppressed or disposable addresses are dropped quietly. A double opt-in form doesn't email someone who is already subscribed. Pass `clientIp` so the per-IP rate limit applies to the person, not your server. Fails with 400 `invalid_email`, 429 `too_many_requests`, or 503 `form_unavailable` when the team can't send the confirmation email."
|
|
4003
4272
|
}
|
|
4004
4273
|
},
|
|
4005
4274
|
{ metadata: { tag: "Contacts" } }
|
|
@@ -4455,19 +4724,62 @@ var Events = class {
|
|
|
4455
4724
|
}
|
|
4456
4725
|
};
|
|
4457
4726
|
|
|
4727
|
+
// src/resources/forms.ts
|
|
4728
|
+
var routes5 = contract.forms;
|
|
4729
|
+
var Forms = class {
|
|
4730
|
+
constructor(http) {
|
|
4731
|
+
this.http = http;
|
|
4732
|
+
}
|
|
4733
|
+
async list() {
|
|
4734
|
+
return this.http.request(routes5.list);
|
|
4735
|
+
}
|
|
4736
|
+
/** Double opt-in (the default) needs a sending mailbox: without one this
|
|
4737
|
+
* fails with 422 `confirmation_sender_unavailable`. */
|
|
4738
|
+
async create(input) {
|
|
4739
|
+
return this.http.request(routes5.create, { body: input });
|
|
4740
|
+
}
|
|
4741
|
+
async get(formId) {
|
|
4742
|
+
return this.http.request(routes5.get, {
|
|
4743
|
+
params: { formId: assertId(formId, "formId") }
|
|
4744
|
+
});
|
|
4745
|
+
}
|
|
4746
|
+
async update(formId, input) {
|
|
4747
|
+
return this.http.request(routes5.update, {
|
|
4748
|
+
params: { formId: assertId(formId, "formId") },
|
|
4749
|
+
body: input
|
|
4750
|
+
});
|
|
4751
|
+
}
|
|
4752
|
+
async remove(formId) {
|
|
4753
|
+
await this.http.request(routes5.remove, {
|
|
4754
|
+
params: { formId: assertId(formId, "formId") }
|
|
4755
|
+
});
|
|
4756
|
+
}
|
|
4757
|
+
/**
|
|
4758
|
+
* Signs someone up through the form from your server. A double opt-in
|
|
4759
|
+
* form emails them a confirmation link; pass `clientIp` so the per-IP
|
|
4760
|
+
* rate limit applies to them rather than to your server.
|
|
4761
|
+
*/
|
|
4762
|
+
async submit(formId, input) {
|
|
4763
|
+
return this.http.request(routes5.submit, {
|
|
4764
|
+
params: { formId: assertId(formId, "formId") },
|
|
4765
|
+
body: input
|
|
4766
|
+
});
|
|
4767
|
+
}
|
|
4768
|
+
};
|
|
4769
|
+
|
|
4458
4770
|
// src/resources/overview.ts
|
|
4459
|
-
var
|
|
4771
|
+
var routes6 = contract.overview;
|
|
4460
4772
|
var OverviewResource = class {
|
|
4461
4773
|
constructor(http) {
|
|
4462
4774
|
this.http = http;
|
|
4463
4775
|
}
|
|
4464
4776
|
async get(query = {}) {
|
|
4465
|
-
return this.http.request(
|
|
4777
|
+
return this.http.request(routes6.get, { query });
|
|
4466
4778
|
}
|
|
4467
4779
|
};
|
|
4468
4780
|
|
|
4469
4781
|
// src/resources/provisioning.ts
|
|
4470
|
-
var
|
|
4782
|
+
var routes7 = contract.provisioning;
|
|
4471
4783
|
var Provisioning = class {
|
|
4472
4784
|
constructor(http) {
|
|
4473
4785
|
this.http = http;
|
|
@@ -4478,20 +4790,20 @@ var Provisioning = class {
|
|
|
4478
4790
|
* `created: false, apiKey: null`, so it's safe to retry.
|
|
4479
4791
|
*/
|
|
4480
4792
|
async provisionTeam(input) {
|
|
4481
|
-
return this.http.request(
|
|
4793
|
+
return this.http.request(routes7.provisionTeam, {
|
|
4482
4794
|
body: input,
|
|
4483
4795
|
retrySafe: true
|
|
4484
4796
|
});
|
|
4485
4797
|
}
|
|
4486
4798
|
/** `teams:read` */
|
|
4487
4799
|
async getTeam(teamId) {
|
|
4488
|
-
return this.http.request(
|
|
4800
|
+
return this.http.request(routes7.getTeam, {
|
|
4489
4801
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4490
4802
|
});
|
|
4491
4803
|
}
|
|
4492
4804
|
/** `teams:manage` */
|
|
4493
4805
|
async updateTeam(teamId, input) {
|
|
4494
|
-
return this.http.request(
|
|
4806
|
+
return this.http.request(routes7.updateTeam, {
|
|
4495
4807
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4496
4808
|
body: input
|
|
4497
4809
|
});
|
|
@@ -4499,106 +4811,106 @@ var Provisioning = class {
|
|
|
4499
4811
|
/** Replaces the team's integration key (`teams:keys`); keys previously
|
|
4500
4812
|
* issued through provisioning are revoked. */
|
|
4501
4813
|
async createTeamKey(teamId, input) {
|
|
4502
|
-
return this.http.request(
|
|
4814
|
+
return this.http.request(routes7.createTeamKey, {
|
|
4503
4815
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4504
4816
|
body: input
|
|
4505
4817
|
});
|
|
4506
4818
|
}
|
|
4507
4819
|
/** `teams:manage` */
|
|
4508
4820
|
async suspendTeam(teamId) {
|
|
4509
|
-
return this.http.request(
|
|
4821
|
+
return this.http.request(routes7.suspendTeam, {
|
|
4510
4822
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4511
4823
|
});
|
|
4512
4824
|
}
|
|
4513
4825
|
/** `teams:manage` */
|
|
4514
4826
|
async resumeTeam(teamId) {
|
|
4515
|
-
return this.http.request(
|
|
4827
|
+
return this.http.request(routes7.resumeTeam, {
|
|
4516
4828
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4517
4829
|
});
|
|
4518
4830
|
}
|
|
4519
4831
|
/** Soft-deprovisions the team (`teams:manage`). There is no unarchive. */
|
|
4520
4832
|
async archiveTeam(teamId) {
|
|
4521
|
-
await this.http.request(
|
|
4833
|
+
await this.http.request(routes7.archiveTeam, {
|
|
4522
4834
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4523
4835
|
});
|
|
4524
4836
|
}
|
|
4525
4837
|
/** `usage:read` */
|
|
4526
4838
|
async getTeamUsage(teamId) {
|
|
4527
|
-
return this.http.request(
|
|
4839
|
+
return this.http.request(routes7.getTeamUsage, {
|
|
4528
4840
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4529
4841
|
});
|
|
4530
4842
|
}
|
|
4531
4843
|
};
|
|
4532
4844
|
|
|
4533
4845
|
// src/resources/segments.ts
|
|
4534
|
-
var
|
|
4846
|
+
var routes8 = contract.segments;
|
|
4535
4847
|
var Segments = class {
|
|
4536
4848
|
constructor(http) {
|
|
4537
4849
|
this.http = http;
|
|
4538
4850
|
}
|
|
4539
4851
|
async create(input) {
|
|
4540
|
-
return this.http.request(
|
|
4852
|
+
return this.http.request(routes8.create, { body: input });
|
|
4541
4853
|
}
|
|
4542
4854
|
async list() {
|
|
4543
|
-
return this.http.request(
|
|
4855
|
+
return this.http.request(routes8.list);
|
|
4544
4856
|
}
|
|
4545
4857
|
async get(segmentId) {
|
|
4546
|
-
return this.http.request(
|
|
4858
|
+
return this.http.request(routes8.get, {
|
|
4547
4859
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4548
4860
|
});
|
|
4549
4861
|
}
|
|
4550
4862
|
async update(segmentId, input) {
|
|
4551
|
-
return this.http.request(
|
|
4863
|
+
return this.http.request(routes8.update, {
|
|
4552
4864
|
params: { segmentId: assertId(segmentId, "segmentId") },
|
|
4553
4865
|
body: input
|
|
4554
4866
|
});
|
|
4555
4867
|
}
|
|
4556
4868
|
async remove(segmentId) {
|
|
4557
|
-
await this.http.request(
|
|
4869
|
+
await this.http.request(routes8.remove, {
|
|
4558
4870
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4559
4871
|
});
|
|
4560
4872
|
}
|
|
4561
4873
|
};
|
|
4562
4874
|
|
|
4563
4875
|
// src/resources/sequences.ts
|
|
4564
|
-
var
|
|
4876
|
+
var routes9 = contract.sequences;
|
|
4565
4877
|
var Sequences = class {
|
|
4566
4878
|
constructor(http) {
|
|
4567
4879
|
this.http = http;
|
|
4568
4880
|
}
|
|
4569
4881
|
async create(input) {
|
|
4570
|
-
return this.http.request(
|
|
4882
|
+
return this.http.request(routes9.create, { body: input });
|
|
4571
4883
|
}
|
|
4572
4884
|
async list(query) {
|
|
4573
|
-
return this.http.request(
|
|
4885
|
+
return this.http.request(routes9.list, { query });
|
|
4574
4886
|
}
|
|
4575
4887
|
listAll(query) {
|
|
4576
4888
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4577
4889
|
}
|
|
4578
4890
|
async get(sequenceId) {
|
|
4579
|
-
return this.http.request(
|
|
4891
|
+
return this.http.request(routes9.get, {
|
|
4580
4892
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4581
4893
|
});
|
|
4582
4894
|
}
|
|
4583
4895
|
async update(sequenceId, input) {
|
|
4584
|
-
return this.http.request(
|
|
4896
|
+
return this.http.request(routes9.update, {
|
|
4585
4897
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4586
4898
|
body: input
|
|
4587
4899
|
});
|
|
4588
4900
|
}
|
|
4589
4901
|
async remove(sequenceId) {
|
|
4590
|
-
await this.http.request(
|
|
4902
|
+
await this.http.request(routes9.remove, {
|
|
4591
4903
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4592
4904
|
});
|
|
4593
4905
|
}
|
|
4594
4906
|
async addEmail(sequenceId, input) {
|
|
4595
|
-
return this.http.request(
|
|
4907
|
+
return this.http.request(routes9.addEmail, {
|
|
4596
4908
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4597
4909
|
body: input
|
|
4598
4910
|
});
|
|
4599
4911
|
}
|
|
4600
4912
|
async updateEmail(sequenceId, emailId, input) {
|
|
4601
|
-
return this.http.request(
|
|
4913
|
+
return this.http.request(routes9.updateEmail, {
|
|
4602
4914
|
params: {
|
|
4603
4915
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4604
4916
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4610,21 +4922,21 @@ var Sequences = class {
|
|
|
4610
4922
|
* sequence, so sends use them. While it's active, `updateEmail` saves
|
|
4611
4923
|
* subject and content changes as a draft. */
|
|
4612
4924
|
async publishChanges(sequenceId, input = {}) {
|
|
4613
|
-
return this.http.request(
|
|
4925
|
+
return this.http.request(routes9.publishChanges, {
|
|
4614
4926
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4615
4927
|
body: input
|
|
4616
4928
|
});
|
|
4617
4929
|
}
|
|
4618
4930
|
/** Throws away unpublished email changes. Sends are not affected. */
|
|
4619
4931
|
async discardChanges(sequenceId, input = {}) {
|
|
4620
|
-
return this.http.request(
|
|
4932
|
+
return this.http.request(routes9.discardChanges, {
|
|
4621
4933
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4622
4934
|
body: input
|
|
4623
4935
|
});
|
|
4624
4936
|
}
|
|
4625
4937
|
/** The versions an email has been published with, live one first. */
|
|
4626
4938
|
async emailVersions(sequenceId, emailId) {
|
|
4627
|
-
const { items } = await this.http.request(
|
|
4939
|
+
const { items } = await this.http.request(routes9.emailVersions, {
|
|
4628
4940
|
params: {
|
|
4629
4941
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4630
4942
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4635,7 +4947,7 @@ var Sequences = class {
|
|
|
4635
4947
|
/** Loads an earlier published version into the email's draft; publish
|
|
4636
4948
|
* it with `publishChanges` to roll back. */
|
|
4637
4949
|
async restoreEmailVersion(sequenceId, emailId, versionId) {
|
|
4638
|
-
return this.http.request(
|
|
4950
|
+
return this.http.request(routes9.restoreEmailVersion, {
|
|
4639
4951
|
params: {
|
|
4640
4952
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4641
4953
|
emailId: assertId(emailId, "emailId"),
|
|
@@ -4644,7 +4956,7 @@ var Sequences = class {
|
|
|
4644
4956
|
});
|
|
4645
4957
|
}
|
|
4646
4958
|
async removeEmail(sequenceId, emailId) {
|
|
4647
|
-
return this.http.request(
|
|
4959
|
+
return this.http.request(routes9.removeEmail, {
|
|
4648
4960
|
params: {
|
|
4649
4961
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4650
4962
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4654,25 +4966,37 @@ var Sequences = class {
|
|
|
4654
4966
|
/** Sends a broadcast, or activates a sequence so its trigger starts
|
|
4655
4967
|
* enrolling contacts. Requires a mailing address in general settings. */
|
|
4656
4968
|
async start(sequenceId) {
|
|
4657
|
-
return this.http.request(
|
|
4969
|
+
return this.http.request(routes9.start, {
|
|
4658
4970
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4659
4971
|
});
|
|
4660
4972
|
}
|
|
4661
4973
|
async pause(sequenceId) {
|
|
4662
|
-
return this.http.request(
|
|
4974
|
+
return this.http.request(routes9.pause, {
|
|
4663
4975
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4664
4976
|
});
|
|
4665
4977
|
}
|
|
4666
4978
|
async stats(sequenceId) {
|
|
4667
|
-
return this.http.request(
|
|
4979
|
+
return this.http.request(routes9.stats, {
|
|
4668
4980
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4669
4981
|
});
|
|
4670
4982
|
}
|
|
4983
|
+
/** The emails a broadcast or sequence sent and what happened to each.
|
|
4984
|
+
* `outcome: "bounced"` or `"complained"` lists the recipients behind the
|
|
4985
|
+
* stats' bounce and complaint rates. */
|
|
4986
|
+
async deliveries(sequenceId, query = {}) {
|
|
4987
|
+
return this.http.request(routes9.deliveries, {
|
|
4988
|
+
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4989
|
+
query
|
|
4990
|
+
});
|
|
4991
|
+
}
|
|
4992
|
+
listAllDeliveries(sequenceId, query = {}) {
|
|
4993
|
+
return paginate((offset) => this.deliveries(sequenceId, { ...query, offset }));
|
|
4994
|
+
}
|
|
4671
4995
|
/** Sends a test of one broadcast or sequence email, rendered like a real
|
|
4672
4996
|
* send with a `[Test]` subject prefix. Tests count against the team's test
|
|
4673
4997
|
* limits (429 `test_send_limit_reached` / `test_send_email_limit_reached`). */
|
|
4674
4998
|
async sendEmailTest(sequenceId, emailId, input) {
|
|
4675
|
-
return this.http.request(
|
|
4999
|
+
return this.http.request(routes9.sendEmailTest, {
|
|
4676
5000
|
params: {
|
|
4677
5001
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4678
5002
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4682,7 +5006,7 @@ var Sequences = class {
|
|
|
4682
5006
|
}
|
|
4683
5007
|
/** IDs of contacts that have received this broadcast or sequence. */
|
|
4684
5008
|
async subscribers(sequenceId, query = {}) {
|
|
4685
|
-
return this.http.request(
|
|
5009
|
+
return this.http.request(routes9.subscribers, {
|
|
4686
5010
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4687
5011
|
query
|
|
4688
5012
|
});
|
|
@@ -4690,16 +5014,16 @@ var Sequences = class {
|
|
|
4690
5014
|
};
|
|
4691
5015
|
|
|
4692
5016
|
// src/resources/settings.ts
|
|
4693
|
-
var
|
|
5017
|
+
var routes10 = contract.settings.general;
|
|
4694
5018
|
var GeneralSettingsResource = class {
|
|
4695
5019
|
constructor(http) {
|
|
4696
5020
|
this.http = http;
|
|
4697
5021
|
}
|
|
4698
5022
|
async get() {
|
|
4699
|
-
return this.http.request(
|
|
5023
|
+
return this.http.request(routes10.get);
|
|
4700
5024
|
}
|
|
4701
5025
|
async update(input) {
|
|
4702
|
-
return this.http.request(
|
|
5026
|
+
return this.http.request(routes10.update, { body: input });
|
|
4703
5027
|
}
|
|
4704
5028
|
};
|
|
4705
5029
|
var Settings = class {
|
|
@@ -4709,26 +5033,26 @@ var Settings = class {
|
|
|
4709
5033
|
};
|
|
4710
5034
|
|
|
4711
5035
|
// src/resources/suppressions.ts
|
|
4712
|
-
var
|
|
5036
|
+
var routes11 = contract.suppressions;
|
|
4713
5037
|
var Suppressions = class {
|
|
4714
5038
|
constructor(http) {
|
|
4715
5039
|
this.http = http;
|
|
4716
5040
|
}
|
|
4717
5041
|
async list(query = {}) {
|
|
4718
|
-
return this.http.request(
|
|
5042
|
+
return this.http.request(routes11.list, { query });
|
|
4719
5043
|
}
|
|
4720
5044
|
listAll(query = {}) {
|
|
4721
5045
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4722
5046
|
}
|
|
4723
5047
|
async get(suppressionId) {
|
|
4724
|
-
return this.http.request(
|
|
5048
|
+
return this.http.request(routes11.get, {
|
|
4725
5049
|
params: { suppressionId: assertId(suppressionId, "suppressionId") }
|
|
4726
5050
|
});
|
|
4727
5051
|
}
|
|
4728
5052
|
/** Complaint suppressions can't be released (409
|
|
4729
5053
|
* `suppression_not_releasable`). */
|
|
4730
5054
|
async release(suppressionId, input = {}) {
|
|
4731
|
-
return this.http.request(
|
|
5055
|
+
return this.http.request(routes11.release, {
|
|
4732
5056
|
params: { suppressionId: assertId(suppressionId, "suppressionId") },
|
|
4733
5057
|
body: input
|
|
4734
5058
|
});
|
|
@@ -4736,70 +5060,70 @@ var Suppressions = class {
|
|
|
4736
5060
|
};
|
|
4737
5061
|
|
|
4738
5062
|
// src/resources/tags.ts
|
|
4739
|
-
var
|
|
5063
|
+
var routes12 = contract.tags;
|
|
4740
5064
|
var Tags = class {
|
|
4741
5065
|
constructor(http) {
|
|
4742
5066
|
this.http = http;
|
|
4743
5067
|
}
|
|
4744
5068
|
async list() {
|
|
4745
|
-
return this.http.request(
|
|
5069
|
+
return this.http.request(routes12.list);
|
|
4746
5070
|
}
|
|
4747
5071
|
async references(tag) {
|
|
4748
|
-
return this.http.request(
|
|
5072
|
+
return this.http.request(routes12.references, {
|
|
4749
5073
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4750
5074
|
});
|
|
4751
5075
|
}
|
|
4752
5076
|
/** Renames a tag on every contact and everywhere it's referenced. */
|
|
4753
5077
|
async rename(tag, input) {
|
|
4754
|
-
return this.http.request(
|
|
5078
|
+
return this.http.request(routes12.rename, {
|
|
4755
5079
|
params: { tag: encodeSegment(tag, "tag") },
|
|
4756
5080
|
body: input
|
|
4757
5081
|
});
|
|
4758
5082
|
}
|
|
4759
5083
|
/** Removes a tag from every contact. */
|
|
4760
5084
|
async remove(tag) {
|
|
4761
|
-
return this.http.request(
|
|
5085
|
+
return this.http.request(routes12.remove, {
|
|
4762
5086
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4763
5087
|
});
|
|
4764
5088
|
}
|
|
4765
5089
|
};
|
|
4766
5090
|
|
|
4767
5091
|
// src/resources/templates.ts
|
|
4768
|
-
var
|
|
5092
|
+
var routes13 = contract.templates;
|
|
4769
5093
|
var Templates = class {
|
|
4770
5094
|
constructor(http) {
|
|
4771
5095
|
this.http = http;
|
|
4772
5096
|
}
|
|
4773
5097
|
async list(query = {}) {
|
|
4774
|
-
return this.http.request(
|
|
5098
|
+
return this.http.request(routes13.list, { query });
|
|
4775
5099
|
}
|
|
4776
5100
|
/** Built-in starters, shared by every team. Duplicate one into the team
|
|
4777
5101
|
* before using it for transactional sends. */
|
|
4778
5102
|
async listSystem(query = {}) {
|
|
4779
|
-
return this.http.request(
|
|
5103
|
+
return this.http.request(routes13.listSystem, { query });
|
|
4780
5104
|
}
|
|
4781
5105
|
async get(templateId) {
|
|
4782
|
-
return this.http.request(
|
|
5106
|
+
return this.http.request(routes13.get, {
|
|
4783
5107
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4784
5108
|
});
|
|
4785
5109
|
}
|
|
4786
5110
|
async create(input) {
|
|
4787
|
-
return this.http.request(
|
|
5111
|
+
return this.http.request(routes13.create, { body: input });
|
|
4788
5112
|
}
|
|
4789
5113
|
async update(templateId, input) {
|
|
4790
|
-
return this.http.request(
|
|
5114
|
+
return this.http.request(routes13.update, {
|
|
4791
5115
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4792
5116
|
body: input
|
|
4793
5117
|
});
|
|
4794
5118
|
}
|
|
4795
5119
|
async duplicate(templateId, input = {}) {
|
|
4796
|
-
return this.http.request(
|
|
5120
|
+
return this.http.request(routes13.duplicate, {
|
|
4797
5121
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4798
5122
|
body: input
|
|
4799
5123
|
});
|
|
4800
5124
|
}
|
|
4801
5125
|
async remove(templateId) {
|
|
4802
|
-
await this.http.request(
|
|
5126
|
+
await this.http.request(routes13.remove, {
|
|
4803
5127
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4804
5128
|
});
|
|
4805
5129
|
}
|
|
@@ -4864,6 +5188,7 @@ var SendLit = class {
|
|
|
4864
5188
|
this.sequences = new Sequences(http);
|
|
4865
5189
|
this.emails = new Emails(http);
|
|
4866
5190
|
this.events = new Events(http);
|
|
5191
|
+
this.forms = new Forms(http);
|
|
4867
5192
|
this.provisioning = new Provisioning(http);
|
|
4868
5193
|
this.suppressions = new Suppressions(http);
|
|
4869
5194
|
this.deliveryEvents = new DeliveryEvents(http);
|
|
@@ -4879,6 +5204,7 @@ exports.DeliveryEvents = DeliveryEvents;
|
|
|
4879
5204
|
exports.Emails = Emails;
|
|
4880
5205
|
exports.EventDefinitions = EventDefinitions;
|
|
4881
5206
|
exports.Events = Events;
|
|
5207
|
+
exports.Forms = Forms;
|
|
4882
5208
|
exports.GeneralSettingsResource = GeneralSettingsResource;
|
|
4883
5209
|
exports.OverviewResource = OverviewResource;
|
|
4884
5210
|
exports.Provisioning = Provisioning;
|