sendlit 0.6.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 +1 -0
- package/dist/index.d.mts +1456 -553
- package/dist/index.d.ts +1456 -553
- package/dist/index.js +447 -203
- package/dist/index.mjs +447 -204
- 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)]),
|
|
@@ -735,6 +895,12 @@ var organizationDeliveryPolicySchema = zod.z.object({
|
|
|
735
895
|
aggregateMonthlyLimit: nullableLimit,
|
|
736
896
|
teamEspEnabledByDefault: zod.z.boolean(),
|
|
737
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,
|
|
738
904
|
updatedAt: zod.z.string()
|
|
739
905
|
});
|
|
740
906
|
var updateOrganizationDeliveryPolicyBodySchema = zod.z.object({
|
|
@@ -745,7 +911,9 @@ var updateOrganizationDeliveryPolicyBodySchema = zod.z.object({
|
|
|
745
911
|
aggregateDailyLimit: nullableLimit.optional(),
|
|
746
912
|
aggregateMonthlyLimit: nullableLimit.optional(),
|
|
747
913
|
teamEspEnabledByDefault: zod.z.boolean().optional(),
|
|
748
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
914
|
+
teamCanChangeDefault: zod.z.boolean().optional(),
|
|
915
|
+
requireTeamSendingDomain: zod.z.enum(["off", "marketing", "all"]).optional(),
|
|
916
|
+
sharedDomainMonthlyLimit: nullableLimit.optional()
|
|
749
917
|
}).refine((value) => Object.keys(value).length > 0, {
|
|
750
918
|
message: "At least one field is required"
|
|
751
919
|
});
|
|
@@ -759,6 +927,15 @@ var espGrantSchema = zod.z.object({
|
|
|
759
927
|
replyTo: zod.z.string().nullable(),
|
|
760
928
|
dailyLimit: nullableLimit,
|
|
761
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(),
|
|
762
939
|
createdAt: zod.z.string(),
|
|
763
940
|
updatedAt: zod.z.string()
|
|
764
941
|
});
|
|
@@ -824,6 +1001,35 @@ var sendingOptionSchema = zod.z.discriminatedUnion("type", [
|
|
|
824
1001
|
countsAgainstQuota: zod.z.literal(false)
|
|
825
1002
|
})
|
|
826
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
|
+
});
|
|
827
1033
|
var EVENT_NAME_MAX_LENGTH = 128;
|
|
828
1034
|
var EVENT_PROPERTIES_MAX_BYTES = 32 * 1024;
|
|
829
1035
|
var EVENT_PROPERTIES_MAX_KEYS = 100;
|
|
@@ -1398,8 +1604,8 @@ var listContactsQuerySchema = zod.z.object({
|
|
|
1398
1604
|
excludeFilter: zod.z.string().optional().describe(
|
|
1399
1605
|
"Serialized ContactFilterWithAggregator JSON; contacts matching it are left out"
|
|
1400
1606
|
),
|
|
1401
|
-
offset: zod.z.coerce.number().int().min(1).optional(),
|
|
1402
|
-
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)")
|
|
1403
1609
|
});
|
|
1404
1610
|
zod.z.object({
|
|
1405
1611
|
sequenceId: zod.z.string(),
|
|
@@ -1533,6 +1739,9 @@ var espConfigSchema = zod.z.object({
|
|
|
1533
1739
|
secure: zod.z.boolean(),
|
|
1534
1740
|
username: zod.z.string().nullable().optional(),
|
|
1535
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(),
|
|
1536
1745
|
fromName: zod.z.string().nullable().optional(),
|
|
1537
1746
|
fromEmail: zod.z.string().nullable().optional(),
|
|
1538
1747
|
replyTo: zod.z.string().nullable().optional(),
|
|
@@ -1640,6 +1849,12 @@ var domainAuthenticationQuerySchema = zod.z.object({
|
|
|
1640
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."
|
|
1641
1850
|
)
|
|
1642
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
|
+
});
|
|
1643
1858
|
var feedbackConnectionStatus = [
|
|
1644
1859
|
"pending",
|
|
1645
1860
|
"healthy",
|
|
@@ -1714,6 +1929,18 @@ var createSignupFormBodySchema = zod.z.object({
|
|
|
1714
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")
|
|
1715
1930
|
});
|
|
1716
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
|
+
});
|
|
1717
1944
|
var mediaSchema = zod.z.object({
|
|
1718
1945
|
mediaId: zod.z.string(),
|
|
1719
1946
|
url: zod.z.string(),
|
|
@@ -1851,42 +2078,6 @@ var updateSegmentBodySchema = zod.z.object({
|
|
|
1851
2078
|
name: zod.z.string().min(1).optional(),
|
|
1852
2079
|
filter: contactFilterSchema.optional()
|
|
1853
2080
|
});
|
|
1854
|
-
var postalAddressSchema = zod.z.object({
|
|
1855
|
-
line1: zod.z.string().trim().min(1).max(200).describe("Street address"),
|
|
1856
|
-
line2: zod.z.string().trim().max(200).optional().describe("Apartment, suite, building and so on"),
|
|
1857
|
-
city: zod.z.string().trim().max(100).optional(),
|
|
1858
|
-
region: zod.z.string().trim().max(100).optional().describe("State, province or region"),
|
|
1859
|
-
postalCode: zod.z.string().trim().max(20).optional(),
|
|
1860
|
-
country: zod.z.string().regex(/^[A-Z]{2}$/).describe("ISO 3166-1 alpha-2 country code, uppercase (for example `GB`)")
|
|
1861
|
-
});
|
|
1862
|
-
var generalSettingsSchema = zod.z.object({
|
|
1863
|
-
/** The physical postal address shown in marketing email footers; required
|
|
1864
|
-
* for broadcasts and sequences. `null` until it is set. */
|
|
1865
|
-
postalAddress: postalAddressSchema.nullable(),
|
|
1866
|
-
updatedAt: zod.z.string().nullable().optional()
|
|
1867
|
-
});
|
|
1868
|
-
var updateGeneralSettingsBodySchema = zod.z.object({
|
|
1869
|
-
/** Omit to keep the address; `null` clears it. */
|
|
1870
|
-
postalAddress: postalAddressSchema.nullable().optional()
|
|
1871
|
-
});
|
|
1872
|
-
var trackingDomainStatuses = ["pending", "verified", "failed"];
|
|
1873
|
-
var trackingDomainSchema = zod.z.object({
|
|
1874
|
-
domain: zod.z.string().nullable(),
|
|
1875
|
-
/** `pending` until the CNAME and HTTPS work; `failed` after the domain
|
|
1876
|
-
* stopped working, when links fall back to SendLit's own host. */
|
|
1877
|
-
status: zod.z.enum(trackingDomainStatuses).nullable(),
|
|
1878
|
-
/** The host the domain's CNAME record must point to. */
|
|
1879
|
-
cnameTarget: zod.z.string(),
|
|
1880
|
-
/** Why the last check failed: `cname_missing`, `cname_mismatch`,
|
|
1881
|
-
* `unreachable` (no HTTPS answer yet) or `dns_error`. */
|
|
1882
|
-
error: zod.z.string().nullable(),
|
|
1883
|
-
verifiedAt: zod.z.string().nullable(),
|
|
1884
|
-
checkedAt: zod.z.string().nullable()
|
|
1885
|
-
});
|
|
1886
|
-
var updateTrackingDomainBodySchema = zod.z.object({
|
|
1887
|
-
/** A subdomain such as `track.example.com`; `null` removes it. */
|
|
1888
|
-
domain: zod.z.string().max(253).nullable()
|
|
1889
|
-
});
|
|
1890
2081
|
var tagSummarySchema = zod.z.object({
|
|
1891
2082
|
tag: zod.z.string(),
|
|
1892
2083
|
contactCount: zod.z.number().int()
|
|
@@ -1928,108 +2119,6 @@ var deleteTagResultSchema = zod.z.object({
|
|
|
1928
2119
|
contactsUpdated: zod.z.number().int(),
|
|
1929
2120
|
references: tagReferencesSchema
|
|
1930
2121
|
});
|
|
1931
|
-
var teamSchema = zod.z.object({
|
|
1932
|
-
teamId: zod.z.string(),
|
|
1933
|
-
/** Public organization identifier. Present when an end user lists the
|
|
1934
|
-
* teams they belong to, so the dashboard can keep workspace selection
|
|
1935
|
-
* scoped to one organization. */
|
|
1936
|
-
organizationId: zod.z.string().optional(),
|
|
1937
|
-
organizationName: zod.z.string().optional(),
|
|
1938
|
-
name: zod.z.string(),
|
|
1939
|
-
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
1940
|
-
externalId: zod.z.string().nullable().optional(),
|
|
1941
|
-
createdAt: zod.z.string().nullable().optional(),
|
|
1942
|
-
updatedAt: zod.z.string().nullable().optional(),
|
|
1943
|
-
/** True when the calling human is already a `team_members` row. Always
|
|
1944
|
-
* false for organization API keys. Omitted on non-list team payloads. */
|
|
1945
|
-
viewerIsMember: zod.z.boolean().optional()
|
|
1946
|
-
});
|
|
1947
|
-
var apiKeySchema = zod.z.object({
|
|
1948
|
-
keyId: zod.z.string(),
|
|
1949
|
-
keyPrefix: zod.z.string(),
|
|
1950
|
-
name: zod.z.string(),
|
|
1951
|
-
expiresAt: zod.z.string().nullable().optional(),
|
|
1952
|
-
lastUsedAt: zod.z.string().nullable().optional(),
|
|
1953
|
-
revokedAt: zod.z.string().nullable().optional(),
|
|
1954
|
-
createdAt: zod.z.string().nullable().optional()
|
|
1955
|
-
});
|
|
1956
|
-
var createdApiKeySchema = apiKeySchema.extend({
|
|
1957
|
-
key: zod.z.string()
|
|
1958
|
-
});
|
|
1959
|
-
var createTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1960
|
-
var renameTeamBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1961
|
-
var createApiKeyBodySchema = zod.z.object({ name: zod.z.string().min(1) });
|
|
1962
|
-
var provisionTeamBodySchema = zod.z.object({
|
|
1963
|
-
externalId: zod.z.string().min(1),
|
|
1964
|
-
name: zod.z.string().min(1),
|
|
1965
|
-
sender: zod.z.object({
|
|
1966
|
-
fromName: zod.z.string().min(1).optional(),
|
|
1967
|
-
replyTo: zod.z.string().email().optional()
|
|
1968
|
-
}).optional(),
|
|
1969
|
-
postalAddress: postalAddressSchema.optional(),
|
|
1970
|
-
delivery: zod.z.object({
|
|
1971
|
-
useOrganizationDefault: zod.z.boolean().optional(),
|
|
1972
|
-
teamEspEnabled: zod.z.boolean().optional(),
|
|
1973
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
1974
|
-
}).optional(),
|
|
1975
|
-
quota: zod.z.object({
|
|
1976
|
-
dailyLimit: zod.z.number().int().positive().nullable().optional(),
|
|
1977
|
-
monthlyLimit: zod.z.number().int().positive().nullable().optional()
|
|
1978
|
-
}).optional()
|
|
1979
|
-
});
|
|
1980
|
-
var provisionedTeamBaseSchema = zod.z.object({
|
|
1981
|
-
teamId: zod.z.string(),
|
|
1982
|
-
externalId: zod.z.string(),
|
|
1983
|
-
name: zod.z.string(),
|
|
1984
|
-
deliverySource: zod.z.object({ type: zod.z.literal("organization") })
|
|
1985
|
-
});
|
|
1986
|
-
var provisionTeamResponseSchema = zod.z.discriminatedUnion("created", [
|
|
1987
|
-
provisionedTeamBaseSchema.extend({
|
|
1988
|
-
created: zod.z.literal(true),
|
|
1989
|
-
apiKey: zod.z.string()
|
|
1990
|
-
}),
|
|
1991
|
-
provisionedTeamBaseSchema.extend({
|
|
1992
|
-
created: zod.z.literal(false),
|
|
1993
|
-
apiKey: zod.z.null()
|
|
1994
|
-
})
|
|
1995
|
-
]);
|
|
1996
|
-
var provisionedTeamSchema = provisionedTeamBaseSchema.extend({
|
|
1997
|
-
status: zod.z.enum(["active", "sending_suspended", "archived"]),
|
|
1998
|
-
postalAddress: postalAddressSchema.nullable(),
|
|
1999
|
-
teamEspEnabled: zod.z.boolean(),
|
|
2000
|
-
teamCanChangeDefault: zod.z.boolean(),
|
|
2001
|
-
createdAt: zod.z.string().nullable(),
|
|
2002
|
-
updatedAt: zod.z.string().nullable()
|
|
2003
|
-
});
|
|
2004
|
-
var updateProvisionedTeamBodySchema = zod.z.object({
|
|
2005
|
-
name: zod.z.string().min(1).optional(),
|
|
2006
|
-
sender: zod.z.object({
|
|
2007
|
-
fromName: zod.z.string().min(1).nullable().optional(),
|
|
2008
|
-
replyTo: zod.z.string().email().nullable().optional()
|
|
2009
|
-
}).optional(),
|
|
2010
|
-
postalAddress: postalAddressSchema.nullable().optional(),
|
|
2011
|
-
delivery: zod.z.object({
|
|
2012
|
-
teamEspEnabled: zod.z.boolean().optional(),
|
|
2013
|
-
teamCanChangeDefault: zod.z.boolean().optional()
|
|
2014
|
-
}).optional(),
|
|
2015
|
-
quota: zod.z.object({
|
|
2016
|
-
dailyLimit: zod.z.number().int().nonnegative().nullable().optional(),
|
|
2017
|
-
monthlyLimit: zod.z.number().int().nonnegative().nullable().optional()
|
|
2018
|
-
}).optional()
|
|
2019
|
-
}).refine((body) => Object.keys(body).length > 0, {
|
|
2020
|
-
message: "At least one field is required"
|
|
2021
|
-
});
|
|
2022
|
-
var usageWindowSchema = zod.z.object({
|
|
2023
|
-
limit: zod.z.number().int().nullable(),
|
|
2024
|
-
accepted: zod.z.number().int().nonnegative(),
|
|
2025
|
-
reserved: zod.z.number().int().nonnegative(),
|
|
2026
|
-
remaining: zod.z.number().int().nullable(),
|
|
2027
|
-
resetsAt: zod.z.string()
|
|
2028
|
-
});
|
|
2029
|
-
var provisionedTeamUsageSchema = zod.z.object({
|
|
2030
|
-
day: usageWindowSchema,
|
|
2031
|
-
month: usageWindowSchema
|
|
2032
|
-
});
|
|
2033
2122
|
var templatePurposes = ["marketing", "transactional"];
|
|
2034
2123
|
var templatePurposeSchema = zod.z.enum(templatePurposes).describe(
|
|
2035
2124
|
"Immutable sending purpose. Marketing templates require a final managed footer; transactional templates are footer-free and are valid for POST /emails."
|
|
@@ -3321,7 +3410,8 @@ var provisioningContract = c.router(
|
|
|
3321
3410
|
403: errorSchema,
|
|
3322
3411
|
404: errorSchema
|
|
3323
3412
|
},
|
|
3324
|
-
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."
|
|
3325
3415
|
},
|
|
3326
3416
|
updateTeam: {
|
|
3327
3417
|
method: "PATCH",
|
|
@@ -3378,6 +3468,39 @@ var provisioningContract = c.router(
|
|
|
3378
3468
|
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
3379
3469
|
summary: "Archive a provisioned team"
|
|
3380
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
|
+
},
|
|
3381
3504
|
getTeamUsage: {
|
|
3382
3505
|
method: "GET",
|
|
3383
3506
|
path: "/provisioning/teams/:teamId/usage",
|
|
@@ -3386,7 +3509,8 @@ var provisioningContract = c.router(
|
|
|
3386
3509
|
403: errorSchema,
|
|
3387
3510
|
404: errorSchema
|
|
3388
3511
|
},
|
|
3389
|
-
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)."
|
|
3390
3514
|
}
|
|
3391
3515
|
},
|
|
3392
3516
|
{ metadata: { tag: "Teams" } }
|
|
@@ -3700,6 +3824,31 @@ var organizationsContract = c.router(
|
|
|
3700
3824
|
summary: "Delete an eligible never-activated organization ESP",
|
|
3701
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`."
|
|
3702
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
|
+
},
|
|
3703
3852
|
getEspFeedback: {
|
|
3704
3853
|
method: "GET",
|
|
3705
3854
|
path: "/organizations/:organizationId/esps/:espId/feedback",
|
|
@@ -3799,8 +3948,8 @@ var organizationsContract = c.router(
|
|
|
3799
3948
|
403: errorSchema,
|
|
3800
3949
|
404: errorSchema
|
|
3801
3950
|
},
|
|
3802
|
-
summary: "Get organization
|
|
3803
|
-
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."
|
|
3804
3953
|
},
|
|
3805
3954
|
enterTeam: {
|
|
3806
3955
|
method: "POST",
|
|
@@ -3860,6 +4009,40 @@ var organizationsContract = c.router(
|
|
|
3860
4009
|
},
|
|
3861
4010
|
summary: "Transition a team's organization ESP grant; revoking detaches safe campaigns"
|
|
3862
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
|
+
},
|
|
3863
4046
|
listSendingDomains: {
|
|
3864
4047
|
method: "GET",
|
|
3865
4048
|
path: "/organizations/:organizationId/sending-domains",
|
|
@@ -4070,6 +4253,22 @@ var formsContract = c.router(
|
|
|
4070
4253
|
path: "/forms/:formId",
|
|
4071
4254
|
responses: { 204: c.noBody(), 404: errorSchema },
|
|
4072
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."
|
|
4073
4272
|
}
|
|
4074
4273
|
},
|
|
4075
4274
|
{ metadata: { tag: "Contacts" } }
|
|
@@ -4525,19 +4724,62 @@ var Events = class {
|
|
|
4525
4724
|
}
|
|
4526
4725
|
};
|
|
4527
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
|
+
|
|
4528
4770
|
// src/resources/overview.ts
|
|
4529
|
-
var
|
|
4771
|
+
var routes6 = contract.overview;
|
|
4530
4772
|
var OverviewResource = class {
|
|
4531
4773
|
constructor(http) {
|
|
4532
4774
|
this.http = http;
|
|
4533
4775
|
}
|
|
4534
4776
|
async get(query = {}) {
|
|
4535
|
-
return this.http.request(
|
|
4777
|
+
return this.http.request(routes6.get, { query });
|
|
4536
4778
|
}
|
|
4537
4779
|
};
|
|
4538
4780
|
|
|
4539
4781
|
// src/resources/provisioning.ts
|
|
4540
|
-
var
|
|
4782
|
+
var routes7 = contract.provisioning;
|
|
4541
4783
|
var Provisioning = class {
|
|
4542
4784
|
constructor(http) {
|
|
4543
4785
|
this.http = http;
|
|
@@ -4548,20 +4790,20 @@ var Provisioning = class {
|
|
|
4548
4790
|
* `created: false, apiKey: null`, so it's safe to retry.
|
|
4549
4791
|
*/
|
|
4550
4792
|
async provisionTeam(input) {
|
|
4551
|
-
return this.http.request(
|
|
4793
|
+
return this.http.request(routes7.provisionTeam, {
|
|
4552
4794
|
body: input,
|
|
4553
4795
|
retrySafe: true
|
|
4554
4796
|
});
|
|
4555
4797
|
}
|
|
4556
4798
|
/** `teams:read` */
|
|
4557
4799
|
async getTeam(teamId) {
|
|
4558
|
-
return this.http.request(
|
|
4800
|
+
return this.http.request(routes7.getTeam, {
|
|
4559
4801
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4560
4802
|
});
|
|
4561
4803
|
}
|
|
4562
4804
|
/** `teams:manage` */
|
|
4563
4805
|
async updateTeam(teamId, input) {
|
|
4564
|
-
return this.http.request(
|
|
4806
|
+
return this.http.request(routes7.updateTeam, {
|
|
4565
4807
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4566
4808
|
body: input
|
|
4567
4809
|
});
|
|
@@ -4569,106 +4811,106 @@ var Provisioning = class {
|
|
|
4569
4811
|
/** Replaces the team's integration key (`teams:keys`); keys previously
|
|
4570
4812
|
* issued through provisioning are revoked. */
|
|
4571
4813
|
async createTeamKey(teamId, input) {
|
|
4572
|
-
return this.http.request(
|
|
4814
|
+
return this.http.request(routes7.createTeamKey, {
|
|
4573
4815
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4574
4816
|
body: input
|
|
4575
4817
|
});
|
|
4576
4818
|
}
|
|
4577
4819
|
/** `teams:manage` */
|
|
4578
4820
|
async suspendTeam(teamId) {
|
|
4579
|
-
return this.http.request(
|
|
4821
|
+
return this.http.request(routes7.suspendTeam, {
|
|
4580
4822
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4581
4823
|
});
|
|
4582
4824
|
}
|
|
4583
4825
|
/** `teams:manage` */
|
|
4584
4826
|
async resumeTeam(teamId) {
|
|
4585
|
-
return this.http.request(
|
|
4827
|
+
return this.http.request(routes7.resumeTeam, {
|
|
4586
4828
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4587
4829
|
});
|
|
4588
4830
|
}
|
|
4589
4831
|
/** Soft-deprovisions the team (`teams:manage`). There is no unarchive. */
|
|
4590
4832
|
async archiveTeam(teamId) {
|
|
4591
|
-
await this.http.request(
|
|
4833
|
+
await this.http.request(routes7.archiveTeam, {
|
|
4592
4834
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4593
4835
|
});
|
|
4594
4836
|
}
|
|
4595
4837
|
/** `usage:read` */
|
|
4596
4838
|
async getTeamUsage(teamId) {
|
|
4597
|
-
return this.http.request(
|
|
4839
|
+
return this.http.request(routes7.getTeamUsage, {
|
|
4598
4840
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4599
4841
|
});
|
|
4600
4842
|
}
|
|
4601
4843
|
};
|
|
4602
4844
|
|
|
4603
4845
|
// src/resources/segments.ts
|
|
4604
|
-
var
|
|
4846
|
+
var routes8 = contract.segments;
|
|
4605
4847
|
var Segments = class {
|
|
4606
4848
|
constructor(http) {
|
|
4607
4849
|
this.http = http;
|
|
4608
4850
|
}
|
|
4609
4851
|
async create(input) {
|
|
4610
|
-
return this.http.request(
|
|
4852
|
+
return this.http.request(routes8.create, { body: input });
|
|
4611
4853
|
}
|
|
4612
4854
|
async list() {
|
|
4613
|
-
return this.http.request(
|
|
4855
|
+
return this.http.request(routes8.list);
|
|
4614
4856
|
}
|
|
4615
4857
|
async get(segmentId) {
|
|
4616
|
-
return this.http.request(
|
|
4858
|
+
return this.http.request(routes8.get, {
|
|
4617
4859
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4618
4860
|
});
|
|
4619
4861
|
}
|
|
4620
4862
|
async update(segmentId, input) {
|
|
4621
|
-
return this.http.request(
|
|
4863
|
+
return this.http.request(routes8.update, {
|
|
4622
4864
|
params: { segmentId: assertId(segmentId, "segmentId") },
|
|
4623
4865
|
body: input
|
|
4624
4866
|
});
|
|
4625
4867
|
}
|
|
4626
4868
|
async remove(segmentId) {
|
|
4627
|
-
await this.http.request(
|
|
4869
|
+
await this.http.request(routes8.remove, {
|
|
4628
4870
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4629
4871
|
});
|
|
4630
4872
|
}
|
|
4631
4873
|
};
|
|
4632
4874
|
|
|
4633
4875
|
// src/resources/sequences.ts
|
|
4634
|
-
var
|
|
4876
|
+
var routes9 = contract.sequences;
|
|
4635
4877
|
var Sequences = class {
|
|
4636
4878
|
constructor(http) {
|
|
4637
4879
|
this.http = http;
|
|
4638
4880
|
}
|
|
4639
4881
|
async create(input) {
|
|
4640
|
-
return this.http.request(
|
|
4882
|
+
return this.http.request(routes9.create, { body: input });
|
|
4641
4883
|
}
|
|
4642
4884
|
async list(query) {
|
|
4643
|
-
return this.http.request(
|
|
4885
|
+
return this.http.request(routes9.list, { query });
|
|
4644
4886
|
}
|
|
4645
4887
|
listAll(query) {
|
|
4646
4888
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4647
4889
|
}
|
|
4648
4890
|
async get(sequenceId) {
|
|
4649
|
-
return this.http.request(
|
|
4891
|
+
return this.http.request(routes9.get, {
|
|
4650
4892
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4651
4893
|
});
|
|
4652
4894
|
}
|
|
4653
4895
|
async update(sequenceId, input) {
|
|
4654
|
-
return this.http.request(
|
|
4896
|
+
return this.http.request(routes9.update, {
|
|
4655
4897
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4656
4898
|
body: input
|
|
4657
4899
|
});
|
|
4658
4900
|
}
|
|
4659
4901
|
async remove(sequenceId) {
|
|
4660
|
-
await this.http.request(
|
|
4902
|
+
await this.http.request(routes9.remove, {
|
|
4661
4903
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4662
4904
|
});
|
|
4663
4905
|
}
|
|
4664
4906
|
async addEmail(sequenceId, input) {
|
|
4665
|
-
return this.http.request(
|
|
4907
|
+
return this.http.request(routes9.addEmail, {
|
|
4666
4908
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4667
4909
|
body: input
|
|
4668
4910
|
});
|
|
4669
4911
|
}
|
|
4670
4912
|
async updateEmail(sequenceId, emailId, input) {
|
|
4671
|
-
return this.http.request(
|
|
4913
|
+
return this.http.request(routes9.updateEmail, {
|
|
4672
4914
|
params: {
|
|
4673
4915
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4674
4916
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4680,21 +4922,21 @@ var Sequences = class {
|
|
|
4680
4922
|
* sequence, so sends use them. While it's active, `updateEmail` saves
|
|
4681
4923
|
* subject and content changes as a draft. */
|
|
4682
4924
|
async publishChanges(sequenceId, input = {}) {
|
|
4683
|
-
return this.http.request(
|
|
4925
|
+
return this.http.request(routes9.publishChanges, {
|
|
4684
4926
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4685
4927
|
body: input
|
|
4686
4928
|
});
|
|
4687
4929
|
}
|
|
4688
4930
|
/** Throws away unpublished email changes. Sends are not affected. */
|
|
4689
4931
|
async discardChanges(sequenceId, input = {}) {
|
|
4690
|
-
return this.http.request(
|
|
4932
|
+
return this.http.request(routes9.discardChanges, {
|
|
4691
4933
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4692
4934
|
body: input
|
|
4693
4935
|
});
|
|
4694
4936
|
}
|
|
4695
4937
|
/** The versions an email has been published with, live one first. */
|
|
4696
4938
|
async emailVersions(sequenceId, emailId) {
|
|
4697
|
-
const { items } = await this.http.request(
|
|
4939
|
+
const { items } = await this.http.request(routes9.emailVersions, {
|
|
4698
4940
|
params: {
|
|
4699
4941
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4700
4942
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4705,7 +4947,7 @@ var Sequences = class {
|
|
|
4705
4947
|
/** Loads an earlier published version into the email's draft; publish
|
|
4706
4948
|
* it with `publishChanges` to roll back. */
|
|
4707
4949
|
async restoreEmailVersion(sequenceId, emailId, versionId) {
|
|
4708
|
-
return this.http.request(
|
|
4950
|
+
return this.http.request(routes9.restoreEmailVersion, {
|
|
4709
4951
|
params: {
|
|
4710
4952
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4711
4953
|
emailId: assertId(emailId, "emailId"),
|
|
@@ -4714,7 +4956,7 @@ var Sequences = class {
|
|
|
4714
4956
|
});
|
|
4715
4957
|
}
|
|
4716
4958
|
async removeEmail(sequenceId, emailId) {
|
|
4717
|
-
return this.http.request(
|
|
4959
|
+
return this.http.request(routes9.removeEmail, {
|
|
4718
4960
|
params: {
|
|
4719
4961
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4720
4962
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4724,17 +4966,17 @@ var Sequences = class {
|
|
|
4724
4966
|
/** Sends a broadcast, or activates a sequence so its trigger starts
|
|
4725
4967
|
* enrolling contacts. Requires a mailing address in general settings. */
|
|
4726
4968
|
async start(sequenceId) {
|
|
4727
|
-
return this.http.request(
|
|
4969
|
+
return this.http.request(routes9.start, {
|
|
4728
4970
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4729
4971
|
});
|
|
4730
4972
|
}
|
|
4731
4973
|
async pause(sequenceId) {
|
|
4732
|
-
return this.http.request(
|
|
4974
|
+
return this.http.request(routes9.pause, {
|
|
4733
4975
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4734
4976
|
});
|
|
4735
4977
|
}
|
|
4736
4978
|
async stats(sequenceId) {
|
|
4737
|
-
return this.http.request(
|
|
4979
|
+
return this.http.request(routes9.stats, {
|
|
4738
4980
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4739
4981
|
});
|
|
4740
4982
|
}
|
|
@@ -4742,7 +4984,7 @@ var Sequences = class {
|
|
|
4742
4984
|
* `outcome: "bounced"` or `"complained"` lists the recipients behind the
|
|
4743
4985
|
* stats' bounce and complaint rates. */
|
|
4744
4986
|
async deliveries(sequenceId, query = {}) {
|
|
4745
|
-
return this.http.request(
|
|
4987
|
+
return this.http.request(routes9.deliveries, {
|
|
4746
4988
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4747
4989
|
query
|
|
4748
4990
|
});
|
|
@@ -4754,7 +4996,7 @@ var Sequences = class {
|
|
|
4754
4996
|
* send with a `[Test]` subject prefix. Tests count against the team's test
|
|
4755
4997
|
* limits (429 `test_send_limit_reached` / `test_send_email_limit_reached`). */
|
|
4756
4998
|
async sendEmailTest(sequenceId, emailId, input) {
|
|
4757
|
-
return this.http.request(
|
|
4999
|
+
return this.http.request(routes9.sendEmailTest, {
|
|
4758
5000
|
params: {
|
|
4759
5001
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4760
5002
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4764,7 +5006,7 @@ var Sequences = class {
|
|
|
4764
5006
|
}
|
|
4765
5007
|
/** IDs of contacts that have received this broadcast or sequence. */
|
|
4766
5008
|
async subscribers(sequenceId, query = {}) {
|
|
4767
|
-
return this.http.request(
|
|
5009
|
+
return this.http.request(routes9.subscribers, {
|
|
4768
5010
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4769
5011
|
query
|
|
4770
5012
|
});
|
|
@@ -4772,16 +5014,16 @@ var Sequences = class {
|
|
|
4772
5014
|
};
|
|
4773
5015
|
|
|
4774
5016
|
// src/resources/settings.ts
|
|
4775
|
-
var
|
|
5017
|
+
var routes10 = contract.settings.general;
|
|
4776
5018
|
var GeneralSettingsResource = class {
|
|
4777
5019
|
constructor(http) {
|
|
4778
5020
|
this.http = http;
|
|
4779
5021
|
}
|
|
4780
5022
|
async get() {
|
|
4781
|
-
return this.http.request(
|
|
5023
|
+
return this.http.request(routes10.get);
|
|
4782
5024
|
}
|
|
4783
5025
|
async update(input) {
|
|
4784
|
-
return this.http.request(
|
|
5026
|
+
return this.http.request(routes10.update, { body: input });
|
|
4785
5027
|
}
|
|
4786
5028
|
};
|
|
4787
5029
|
var Settings = class {
|
|
@@ -4791,26 +5033,26 @@ var Settings = class {
|
|
|
4791
5033
|
};
|
|
4792
5034
|
|
|
4793
5035
|
// src/resources/suppressions.ts
|
|
4794
|
-
var
|
|
5036
|
+
var routes11 = contract.suppressions;
|
|
4795
5037
|
var Suppressions = class {
|
|
4796
5038
|
constructor(http) {
|
|
4797
5039
|
this.http = http;
|
|
4798
5040
|
}
|
|
4799
5041
|
async list(query = {}) {
|
|
4800
|
-
return this.http.request(
|
|
5042
|
+
return this.http.request(routes11.list, { query });
|
|
4801
5043
|
}
|
|
4802
5044
|
listAll(query = {}) {
|
|
4803
5045
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4804
5046
|
}
|
|
4805
5047
|
async get(suppressionId) {
|
|
4806
|
-
return this.http.request(
|
|
5048
|
+
return this.http.request(routes11.get, {
|
|
4807
5049
|
params: { suppressionId: assertId(suppressionId, "suppressionId") }
|
|
4808
5050
|
});
|
|
4809
5051
|
}
|
|
4810
5052
|
/** Complaint suppressions can't be released (409
|
|
4811
5053
|
* `suppression_not_releasable`). */
|
|
4812
5054
|
async release(suppressionId, input = {}) {
|
|
4813
|
-
return this.http.request(
|
|
5055
|
+
return this.http.request(routes11.release, {
|
|
4814
5056
|
params: { suppressionId: assertId(suppressionId, "suppressionId") },
|
|
4815
5057
|
body: input
|
|
4816
5058
|
});
|
|
@@ -4818,70 +5060,70 @@ var Suppressions = class {
|
|
|
4818
5060
|
};
|
|
4819
5061
|
|
|
4820
5062
|
// src/resources/tags.ts
|
|
4821
|
-
var
|
|
5063
|
+
var routes12 = contract.tags;
|
|
4822
5064
|
var Tags = class {
|
|
4823
5065
|
constructor(http) {
|
|
4824
5066
|
this.http = http;
|
|
4825
5067
|
}
|
|
4826
5068
|
async list() {
|
|
4827
|
-
return this.http.request(
|
|
5069
|
+
return this.http.request(routes12.list);
|
|
4828
5070
|
}
|
|
4829
5071
|
async references(tag) {
|
|
4830
|
-
return this.http.request(
|
|
5072
|
+
return this.http.request(routes12.references, {
|
|
4831
5073
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4832
5074
|
});
|
|
4833
5075
|
}
|
|
4834
5076
|
/** Renames a tag on every contact and everywhere it's referenced. */
|
|
4835
5077
|
async rename(tag, input) {
|
|
4836
|
-
return this.http.request(
|
|
5078
|
+
return this.http.request(routes12.rename, {
|
|
4837
5079
|
params: { tag: encodeSegment(tag, "tag") },
|
|
4838
5080
|
body: input
|
|
4839
5081
|
});
|
|
4840
5082
|
}
|
|
4841
5083
|
/** Removes a tag from every contact. */
|
|
4842
5084
|
async remove(tag) {
|
|
4843
|
-
return this.http.request(
|
|
5085
|
+
return this.http.request(routes12.remove, {
|
|
4844
5086
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4845
5087
|
});
|
|
4846
5088
|
}
|
|
4847
5089
|
};
|
|
4848
5090
|
|
|
4849
5091
|
// src/resources/templates.ts
|
|
4850
|
-
var
|
|
5092
|
+
var routes13 = contract.templates;
|
|
4851
5093
|
var Templates = class {
|
|
4852
5094
|
constructor(http) {
|
|
4853
5095
|
this.http = http;
|
|
4854
5096
|
}
|
|
4855
5097
|
async list(query = {}) {
|
|
4856
|
-
return this.http.request(
|
|
5098
|
+
return this.http.request(routes13.list, { query });
|
|
4857
5099
|
}
|
|
4858
5100
|
/** Built-in starters, shared by every team. Duplicate one into the team
|
|
4859
5101
|
* before using it for transactional sends. */
|
|
4860
5102
|
async listSystem(query = {}) {
|
|
4861
|
-
return this.http.request(
|
|
5103
|
+
return this.http.request(routes13.listSystem, { query });
|
|
4862
5104
|
}
|
|
4863
5105
|
async get(templateId) {
|
|
4864
|
-
return this.http.request(
|
|
5106
|
+
return this.http.request(routes13.get, {
|
|
4865
5107
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4866
5108
|
});
|
|
4867
5109
|
}
|
|
4868
5110
|
async create(input) {
|
|
4869
|
-
return this.http.request(
|
|
5111
|
+
return this.http.request(routes13.create, { body: input });
|
|
4870
5112
|
}
|
|
4871
5113
|
async update(templateId, input) {
|
|
4872
|
-
return this.http.request(
|
|
5114
|
+
return this.http.request(routes13.update, {
|
|
4873
5115
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4874
5116
|
body: input
|
|
4875
5117
|
});
|
|
4876
5118
|
}
|
|
4877
5119
|
async duplicate(templateId, input = {}) {
|
|
4878
|
-
return this.http.request(
|
|
5120
|
+
return this.http.request(routes13.duplicate, {
|
|
4879
5121
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4880
5122
|
body: input
|
|
4881
5123
|
});
|
|
4882
5124
|
}
|
|
4883
5125
|
async remove(templateId) {
|
|
4884
|
-
await this.http.request(
|
|
5126
|
+
await this.http.request(routes13.remove, {
|
|
4885
5127
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4886
5128
|
});
|
|
4887
5129
|
}
|
|
@@ -4946,6 +5188,7 @@ var SendLit = class {
|
|
|
4946
5188
|
this.sequences = new Sequences(http);
|
|
4947
5189
|
this.emails = new Emails(http);
|
|
4948
5190
|
this.events = new Events(http);
|
|
5191
|
+
this.forms = new Forms(http);
|
|
4949
5192
|
this.provisioning = new Provisioning(http);
|
|
4950
5193
|
this.suppressions = new Suppressions(http);
|
|
4951
5194
|
this.deliveryEvents = new DeliveryEvents(http);
|
|
@@ -4961,6 +5204,7 @@ exports.DeliveryEvents = DeliveryEvents;
|
|
|
4961
5204
|
exports.Emails = Emails;
|
|
4962
5205
|
exports.EventDefinitions = EventDefinitions;
|
|
4963
5206
|
exports.Events = Events;
|
|
5207
|
+
exports.Forms = Forms;
|
|
4964
5208
|
exports.GeneralSettingsResource = GeneralSettingsResource;
|
|
4965
5209
|
exports.OverviewResource = OverviewResource;
|
|
4966
5210
|
exports.Provisioning = Provisioning;
|