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.mjs
CHANGED
|
@@ -228,6 +228,162 @@ statuses({ skip: "pending_confirmation" }, [
|
|
|
228
228
|
"awaiting_confirmation",
|
|
229
229
|
"not_confirmed"
|
|
230
230
|
]);
|
|
231
|
+
var postalAddressSchema = z.object({
|
|
232
|
+
line1: z.string().trim().min(1).max(200).describe("Street address"),
|
|
233
|
+
line2: z.string().trim().max(200).optional().describe("Apartment, suite, building and so on"),
|
|
234
|
+
city: z.string().trim().max(100).optional(),
|
|
235
|
+
region: z.string().trim().max(100).optional().describe("State, province or region"),
|
|
236
|
+
postalCode: z.string().trim().max(20).optional(),
|
|
237
|
+
country: z.string().regex(/^[A-Z]{2}$/).describe("ISO 3166-1 alpha-2 country code, uppercase (for example `GB`)")
|
|
238
|
+
});
|
|
239
|
+
var generalSettingsSchema = z.object({
|
|
240
|
+
/** The physical postal address shown in marketing email footers; required
|
|
241
|
+
* for broadcasts and sequences. `null` until it is set. */
|
|
242
|
+
postalAddress: postalAddressSchema.nullable(),
|
|
243
|
+
updatedAt: z.string().nullable().optional()
|
|
244
|
+
});
|
|
245
|
+
var updateGeneralSettingsBodySchema = z.object({
|
|
246
|
+
/** Omit to keep the address; `null` clears it. */
|
|
247
|
+
postalAddress: postalAddressSchema.nullable().optional()
|
|
248
|
+
});
|
|
249
|
+
var trackingDomainStatuses = ["pending", "verified", "failed"];
|
|
250
|
+
var trackingDomainSchema = z.object({
|
|
251
|
+
domain: z.string().nullable(),
|
|
252
|
+
/** `pending` until the CNAME and HTTPS work; `failed` after the domain
|
|
253
|
+
* stopped working, when links fall back to SendLit's own host. */
|
|
254
|
+
status: z.enum(trackingDomainStatuses).nullable(),
|
|
255
|
+
/** The host the domain's CNAME record must point to. */
|
|
256
|
+
cnameTarget: z.string(),
|
|
257
|
+
/** Why the last check failed: `cname_missing`, `cname_mismatch`,
|
|
258
|
+
* `unreachable` (no HTTPS answer yet) or `dns_error`. */
|
|
259
|
+
error: z.string().nullable(),
|
|
260
|
+
verifiedAt: z.string().nullable(),
|
|
261
|
+
checkedAt: z.string().nullable()
|
|
262
|
+
});
|
|
263
|
+
var updateTrackingDomainBodySchema = z.object({
|
|
264
|
+
/** A subdomain such as `track.example.com`; `null` removes it. */
|
|
265
|
+
domain: z.string().max(253).nullable()
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// ../api-contract/src/schemas/teams.ts
|
|
269
|
+
var teamSchema = z.object({
|
|
270
|
+
teamId: z.string(),
|
|
271
|
+
/** Public organization identifier. Present when an end user lists the
|
|
272
|
+
* teams they belong to, so the dashboard can keep workspace selection
|
|
273
|
+
* scoped to one organization. */
|
|
274
|
+
organizationId: z.string().optional(),
|
|
275
|
+
organizationName: z.string().optional(),
|
|
276
|
+
name: z.string(),
|
|
277
|
+
status: z.enum(["active", "sending_suspended", "archived"]),
|
|
278
|
+
externalId: z.string().nullable().optional(),
|
|
279
|
+
createdAt: z.string().nullable().optional(),
|
|
280
|
+
updatedAt: z.string().nullable().optional(),
|
|
281
|
+
/** True when the calling human is already a `team_members` row. Always
|
|
282
|
+
* false for organization API keys. Omitted on non-list team payloads. */
|
|
283
|
+
viewerIsMember: z.boolean().optional()
|
|
284
|
+
});
|
|
285
|
+
var apiKeySchema = z.object({
|
|
286
|
+
keyId: z.string(),
|
|
287
|
+
keyPrefix: z.string(),
|
|
288
|
+
name: z.string(),
|
|
289
|
+
expiresAt: z.string().nullable().optional(),
|
|
290
|
+
lastUsedAt: z.string().nullable().optional(),
|
|
291
|
+
revokedAt: z.string().nullable().optional(),
|
|
292
|
+
createdAt: z.string().nullable().optional()
|
|
293
|
+
});
|
|
294
|
+
var createdApiKeySchema = apiKeySchema.extend({
|
|
295
|
+
key: z.string()
|
|
296
|
+
});
|
|
297
|
+
var createTeamBodySchema = z.object({ name: z.string().min(1) });
|
|
298
|
+
var renameTeamBodySchema = z.object({ name: z.string().min(1) });
|
|
299
|
+
var createApiKeyBodySchema = z.object({ name: z.string().min(1) });
|
|
300
|
+
var provisionTeamBodySchema = z.object({
|
|
301
|
+
externalId: z.string().min(1),
|
|
302
|
+
name: z.string().min(1),
|
|
303
|
+
sender: z.object({
|
|
304
|
+
fromName: z.string().min(1).optional(),
|
|
305
|
+
replyTo: z.string().email().optional()
|
|
306
|
+
}).optional(),
|
|
307
|
+
postalAddress: postalAddressSchema.optional(),
|
|
308
|
+
delivery: z.object({
|
|
309
|
+
useOrganizationDefault: z.boolean().optional(),
|
|
310
|
+
teamEspEnabled: z.boolean().optional(),
|
|
311
|
+
teamCanChangeDefault: z.boolean().optional()
|
|
312
|
+
}).optional(),
|
|
313
|
+
quota: z.object({
|
|
314
|
+
dailyLimit: z.number().int().positive().nullable().optional(),
|
|
315
|
+
monthlyLimit: z.number().int().positive().nullable().optional()
|
|
316
|
+
}).optional()
|
|
317
|
+
});
|
|
318
|
+
var provisionedTeamBaseSchema = z.object({
|
|
319
|
+
teamId: z.string(),
|
|
320
|
+
externalId: z.string(),
|
|
321
|
+
name: z.string(),
|
|
322
|
+
deliverySource: z.object({ type: z.literal("organization") })
|
|
323
|
+
});
|
|
324
|
+
var provisionTeamResponseSchema = z.discriminatedUnion("created", [
|
|
325
|
+
provisionedTeamBaseSchema.extend({
|
|
326
|
+
created: z.literal(true),
|
|
327
|
+
apiKey: z.string()
|
|
328
|
+
}),
|
|
329
|
+
provisionedTeamBaseSchema.extend({
|
|
330
|
+
created: z.literal(false),
|
|
331
|
+
apiKey: z.null()
|
|
332
|
+
})
|
|
333
|
+
]);
|
|
334
|
+
var teamHealthSchema = z.object({
|
|
335
|
+
status: z.enum(["normal", "warned", "marketing_paused", "all_paused"]),
|
|
336
|
+
reason: z.string().nullable(),
|
|
337
|
+
scope: z.enum(["team", "shared_mailbox"]).nullable(),
|
|
338
|
+
last7Days: z.object({
|
|
339
|
+
sent: z.number().int().nonnegative(),
|
|
340
|
+
bounced: z.number().int().nonnegative(),
|
|
341
|
+
complained: z.number().int().nonnegative()
|
|
342
|
+
})
|
|
343
|
+
});
|
|
344
|
+
var provisionedTeamSchema = provisionedTeamBaseSchema.extend({
|
|
345
|
+
status: z.enum(["active", "sending_suspended", "archived"]),
|
|
346
|
+
postalAddress: postalAddressSchema.nullable(),
|
|
347
|
+
teamEspEnabled: z.boolean(),
|
|
348
|
+
teamCanChangeDefault: z.boolean(),
|
|
349
|
+
createdAt: z.string().nullable(),
|
|
350
|
+
updatedAt: z.string().nullable(),
|
|
351
|
+
health: teamHealthSchema
|
|
352
|
+
});
|
|
353
|
+
var updateProvisionedTeamBodySchema = z.object({
|
|
354
|
+
name: z.string().min(1).optional(),
|
|
355
|
+
sender: z.object({
|
|
356
|
+
fromName: z.string().min(1).nullable().optional(),
|
|
357
|
+
replyTo: z.string().email().nullable().optional()
|
|
358
|
+
}).optional(),
|
|
359
|
+
postalAddress: postalAddressSchema.nullable().optional(),
|
|
360
|
+
delivery: z.object({
|
|
361
|
+
teamEspEnabled: z.boolean().optional(),
|
|
362
|
+
teamCanChangeDefault: z.boolean().optional()
|
|
363
|
+
}).optional(),
|
|
364
|
+
quota: z.object({
|
|
365
|
+
dailyLimit: z.number().int().nonnegative().nullable().optional(),
|
|
366
|
+
monthlyLimit: z.number().int().nonnegative().nullable().optional()
|
|
367
|
+
}).optional()
|
|
368
|
+
}).refine((body) => Object.keys(body).length > 0, {
|
|
369
|
+
message: "At least one field is required"
|
|
370
|
+
});
|
|
371
|
+
var usageWindowSchema = z.object({
|
|
372
|
+
limit: z.number().int().nullable(),
|
|
373
|
+
accepted: z.number().int().nonnegative(),
|
|
374
|
+
reserved: z.number().int().nonnegative(),
|
|
375
|
+
remaining: z.number().int().nullable(),
|
|
376
|
+
resetsAt: z.string()
|
|
377
|
+
});
|
|
378
|
+
var teamQuotaUsageSchema = z.object({
|
|
379
|
+
day: usageWindowSchema,
|
|
380
|
+
month: usageWindowSchema
|
|
381
|
+
});
|
|
382
|
+
var provisionedTeamUsageSchema = teamQuotaUsageSchema.extend({
|
|
383
|
+
health: teamHealthSchema
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// ../api-contract/src/schemas/organizations.ts
|
|
231
387
|
var organizationRoleSchema = z.enum(["owner", "admin", "member"]);
|
|
232
388
|
var organizationSchema = z.object({
|
|
233
389
|
organizationId: z.string(),
|
|
@@ -312,14 +468,18 @@ var organizationMailCountsSchema = z.object({
|
|
|
312
468
|
sent: z.number().int().nonnegative(),
|
|
313
469
|
queued: z.number().int().nonnegative(),
|
|
314
470
|
failed: z.number().int().nonnegative(),
|
|
315
|
-
bounced: z.number().int().nonnegative()
|
|
471
|
+
bounced: z.number().int().nonnegative(),
|
|
472
|
+
complained: z.number().int().nonnegative()
|
|
316
473
|
});
|
|
317
474
|
var organizationMailActivityTeamSchema = z.object({
|
|
318
475
|
teamId: z.string(),
|
|
319
476
|
name: z.string(),
|
|
320
477
|
status: z.enum(["active", "sending_suspended", "archived"]),
|
|
321
478
|
externalId: z.string().nullable(),
|
|
322
|
-
mail: organizationMailCountsSchema
|
|
479
|
+
mail: organizationMailCountsSchema,
|
|
480
|
+
health: teamHealthSchema,
|
|
481
|
+
/** Shared-mailbox quota; null when the team has no active grant. */
|
|
482
|
+
quota: teamQuotaUsageSchema.nullable()
|
|
323
483
|
});
|
|
324
484
|
var organizationMailActivitySchema = z.object({
|
|
325
485
|
rangeDays: z.union([z.literal(1), z.literal(3), z.literal(7), z.literal(30)]),
|
|
@@ -733,6 +893,12 @@ var organizationDeliveryPolicySchema = z.object({
|
|
|
733
893
|
aggregateMonthlyLimit: nullableLimit,
|
|
734
894
|
teamEspEnabledByDefault: z.boolean(),
|
|
735
895
|
teamCanChangeDefault: z.boolean(),
|
|
896
|
+
/** Whether teams on a shared ESP must send from their own verified
|
|
897
|
+
* domain: `off` (default), for `marketing` only, or for `all` mail. */
|
|
898
|
+
requireTeamSendingDomain: z.enum(["off", "marketing", "all"]),
|
|
899
|
+
/** Monthly cap on each team's marketing through a shared ESP while it
|
|
900
|
+
* still uses the shared From domain; `null` for none. */
|
|
901
|
+
sharedDomainMonthlyLimit: nullableLimit,
|
|
736
902
|
updatedAt: z.string()
|
|
737
903
|
});
|
|
738
904
|
var updateOrganizationDeliveryPolicyBodySchema = z.object({
|
|
@@ -743,7 +909,9 @@ var updateOrganizationDeliveryPolicyBodySchema = z.object({
|
|
|
743
909
|
aggregateDailyLimit: nullableLimit.optional(),
|
|
744
910
|
aggregateMonthlyLimit: nullableLimit.optional(),
|
|
745
911
|
teamEspEnabledByDefault: z.boolean().optional(),
|
|
746
|
-
teamCanChangeDefault: z.boolean().optional()
|
|
912
|
+
teamCanChangeDefault: z.boolean().optional(),
|
|
913
|
+
requireTeamSendingDomain: z.enum(["off", "marketing", "all"]).optional(),
|
|
914
|
+
sharedDomainMonthlyLimit: nullableLimit.optional()
|
|
747
915
|
}).refine((value) => Object.keys(value).length > 0, {
|
|
748
916
|
message: "At least one field is required"
|
|
749
917
|
});
|
|
@@ -757,6 +925,15 @@ var espGrantSchema = z.object({
|
|
|
757
925
|
replyTo: z.string().nullable(),
|
|
758
926
|
dailyLimit: nullableLimit,
|
|
759
927
|
monthlyLimit: nullableLimit,
|
|
928
|
+
/** The team's own From address on this mailbox, when it has one. */
|
|
929
|
+
fromEmail: z.string().nullable(),
|
|
930
|
+
/** The team's own sending domain, when it has one (see
|
|
931
|
+
* `/teams/:teamId/sending-domain`). */
|
|
932
|
+
sendingDomain: z.object({
|
|
933
|
+
domain: z.string(),
|
|
934
|
+
status: z.enum(["pending", "verified", "failing"]),
|
|
935
|
+
inUse: z.boolean()
|
|
936
|
+
}).nullable(),
|
|
760
937
|
createdAt: z.string(),
|
|
761
938
|
updatedAt: z.string()
|
|
762
939
|
});
|
|
@@ -822,6 +999,35 @@ var sendingOptionSchema = z.discriminatedUnion("type", [
|
|
|
822
999
|
countsAgainstQuota: z.literal(false)
|
|
823
1000
|
})
|
|
824
1001
|
]);
|
|
1002
|
+
var teamSendingDomainRecordSchema = z.object({
|
|
1003
|
+
type: z.enum(["CNAME", "TXT"]),
|
|
1004
|
+
name: z.string(),
|
|
1005
|
+
value: z.string(),
|
|
1006
|
+
purpose: z.enum(["dkim", "dmarc"]),
|
|
1007
|
+
/** Whether the last check found it in place. */
|
|
1008
|
+
present: z.boolean().optional()
|
|
1009
|
+
});
|
|
1010
|
+
var teamSendingDomainSchema = z.object({
|
|
1011
|
+
domain: z.string(),
|
|
1012
|
+
fromEmail: z.string().nullable(),
|
|
1013
|
+
/** `pending` until DKIM and DMARC first pass, `verified` once they have,
|
|
1014
|
+
* `failing` when they stopped passing after that. */
|
|
1015
|
+
status: z.enum(["pending", "verified", "failing"]),
|
|
1016
|
+
dkim: z.enum(["pending", "verified", "failed"]),
|
|
1017
|
+
dmarc: z.enum(["pass", "missing"]),
|
|
1018
|
+
/** Whether the team's mail goes out from this domain right now. */
|
|
1019
|
+
inUse: z.boolean(),
|
|
1020
|
+
records: z.array(teamSendingDomainRecordSchema),
|
|
1021
|
+
verifiedAt: z.string().nullable(),
|
|
1022
|
+
failingSince: z.string().nullable(),
|
|
1023
|
+
/** When the team's marketing pauses if the domain keeps failing. */
|
|
1024
|
+
graceEndsAt: z.string().nullable(),
|
|
1025
|
+
lastCheckedAt: z.string().nullable()
|
|
1026
|
+
});
|
|
1027
|
+
var setTeamSendingDomainBodySchema = z.object({
|
|
1028
|
+
/** The team's From address; its domain is registered with the shared ESP. */
|
|
1029
|
+
fromEmail: z.string().email()
|
|
1030
|
+
});
|
|
825
1031
|
var EVENT_NAME_MAX_LENGTH = 128;
|
|
826
1032
|
var EVENT_PROPERTIES_MAX_BYTES = 32 * 1024;
|
|
827
1033
|
var EVENT_PROPERTIES_MAX_KEYS = 100;
|
|
@@ -1396,8 +1602,8 @@ var listContactsQuerySchema = z.object({
|
|
|
1396
1602
|
excludeFilter: z.string().optional().describe(
|
|
1397
1603
|
"Serialized ContactFilterWithAggregator JSON; contacts matching it are left out"
|
|
1398
1604
|
),
|
|
1399
|
-
offset: z.coerce.number().int().min(1).optional(),
|
|
1400
|
-
rowsPerPage: z.coerce.number().int().min(1).optional()
|
|
1605
|
+
offset: z.coerce.number().int().min(1).optional().describe("Page number, 1-indexed (default: 1)"),
|
|
1606
|
+
rowsPerPage: z.coerce.number().int().min(1).optional().describe("Contacts per page (default: 10)")
|
|
1401
1607
|
});
|
|
1402
1608
|
z.object({
|
|
1403
1609
|
sequenceId: z.string(),
|
|
@@ -1531,6 +1737,9 @@ var espConfigSchema = z.object({
|
|
|
1531
1737
|
secure: z.boolean(),
|
|
1532
1738
|
username: z.string().nullable().optional(),
|
|
1533
1739
|
hasPassword: z.boolean(),
|
|
1740
|
+
/** Organization ESPs: whether a provider API credential is stored, which
|
|
1741
|
+
* lets teams register their own sending domains (SES only for now). */
|
|
1742
|
+
hasManagementCredentials: z.boolean().optional(),
|
|
1534
1743
|
fromName: z.string().nullable().optional(),
|
|
1535
1744
|
fromEmail: z.string().nullable().optional(),
|
|
1536
1745
|
replyTo: z.string().nullable().optional(),
|
|
@@ -1638,6 +1847,12 @@ var domainAuthenticationQuerySchema = z.object({
|
|
|
1638
1847
|
"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."
|
|
1639
1848
|
)
|
|
1640
1849
|
});
|
|
1850
|
+
var espManagementCredentialsBodySchema = z.object({
|
|
1851
|
+
accessKeyId: z.string().min(1),
|
|
1852
|
+
secretAccessKey: z.string().min(1),
|
|
1853
|
+
/** Defaults to the region in the SMTP host. */
|
|
1854
|
+
region: z.string().min(1).optional()
|
|
1855
|
+
});
|
|
1641
1856
|
var feedbackConnectionStatus = [
|
|
1642
1857
|
"pending",
|
|
1643
1858
|
"healthy",
|
|
@@ -1712,6 +1927,18 @@ var createSignupFormBodySchema = z.object({
|
|
|
1712
1927
|
redirectUrl: 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")
|
|
1713
1928
|
});
|
|
1714
1929
|
var updateSignupFormBodySchema = createSignupFormBodySchema.partial();
|
|
1930
|
+
var submitSignupFormBodySchema = z.object({
|
|
1931
|
+
email: z.string().trim().min(1).max(254),
|
|
1932
|
+
name: z.string().trim().max(200).optional(),
|
|
1933
|
+
clientIp: z.string().trim().min(1).max(64).optional().describe(
|
|
1934
|
+
"IP address of the person signing up. Per-IP rate limits apply to it; without it they apply to the calling server."
|
|
1935
|
+
)
|
|
1936
|
+
});
|
|
1937
|
+
var signupFormSubmissionSchema = z.object({
|
|
1938
|
+
status: z.enum(["confirmation_sent", "subscribed"]).describe(
|
|
1939
|
+
"`confirmation_sent` for double opt-in forms, `subscribed` for single opt-in. The same for every address, accepted or quietly dropped."
|
|
1940
|
+
)
|
|
1941
|
+
});
|
|
1715
1942
|
var mediaSchema = z.object({
|
|
1716
1943
|
mediaId: z.string(),
|
|
1717
1944
|
url: z.string(),
|
|
@@ -1849,42 +2076,6 @@ var updateSegmentBodySchema = z.object({
|
|
|
1849
2076
|
name: z.string().min(1).optional(),
|
|
1850
2077
|
filter: contactFilterSchema.optional()
|
|
1851
2078
|
});
|
|
1852
|
-
var postalAddressSchema = z.object({
|
|
1853
|
-
line1: z.string().trim().min(1).max(200).describe("Street address"),
|
|
1854
|
-
line2: z.string().trim().max(200).optional().describe("Apartment, suite, building and so on"),
|
|
1855
|
-
city: z.string().trim().max(100).optional(),
|
|
1856
|
-
region: z.string().trim().max(100).optional().describe("State, province or region"),
|
|
1857
|
-
postalCode: z.string().trim().max(20).optional(),
|
|
1858
|
-
country: z.string().regex(/^[A-Z]{2}$/).describe("ISO 3166-1 alpha-2 country code, uppercase (for example `GB`)")
|
|
1859
|
-
});
|
|
1860
|
-
var generalSettingsSchema = z.object({
|
|
1861
|
-
/** The physical postal address shown in marketing email footers; required
|
|
1862
|
-
* for broadcasts and sequences. `null` until it is set. */
|
|
1863
|
-
postalAddress: postalAddressSchema.nullable(),
|
|
1864
|
-
updatedAt: z.string().nullable().optional()
|
|
1865
|
-
});
|
|
1866
|
-
var updateGeneralSettingsBodySchema = z.object({
|
|
1867
|
-
/** Omit to keep the address; `null` clears it. */
|
|
1868
|
-
postalAddress: postalAddressSchema.nullable().optional()
|
|
1869
|
-
});
|
|
1870
|
-
var trackingDomainStatuses = ["pending", "verified", "failed"];
|
|
1871
|
-
var trackingDomainSchema = z.object({
|
|
1872
|
-
domain: z.string().nullable(),
|
|
1873
|
-
/** `pending` until the CNAME and HTTPS work; `failed` after the domain
|
|
1874
|
-
* stopped working, when links fall back to SendLit's own host. */
|
|
1875
|
-
status: z.enum(trackingDomainStatuses).nullable(),
|
|
1876
|
-
/** The host the domain's CNAME record must point to. */
|
|
1877
|
-
cnameTarget: z.string(),
|
|
1878
|
-
/** Why the last check failed: `cname_missing`, `cname_mismatch`,
|
|
1879
|
-
* `unreachable` (no HTTPS answer yet) or `dns_error`. */
|
|
1880
|
-
error: z.string().nullable(),
|
|
1881
|
-
verifiedAt: z.string().nullable(),
|
|
1882
|
-
checkedAt: z.string().nullable()
|
|
1883
|
-
});
|
|
1884
|
-
var updateTrackingDomainBodySchema = z.object({
|
|
1885
|
-
/** A subdomain such as `track.example.com`; `null` removes it. */
|
|
1886
|
-
domain: z.string().max(253).nullable()
|
|
1887
|
-
});
|
|
1888
2079
|
var tagSummarySchema = z.object({
|
|
1889
2080
|
tag: z.string(),
|
|
1890
2081
|
contactCount: z.number().int()
|
|
@@ -1926,108 +2117,6 @@ var deleteTagResultSchema = z.object({
|
|
|
1926
2117
|
contactsUpdated: z.number().int(),
|
|
1927
2118
|
references: tagReferencesSchema
|
|
1928
2119
|
});
|
|
1929
|
-
var teamSchema = z.object({
|
|
1930
|
-
teamId: z.string(),
|
|
1931
|
-
/** Public organization identifier. Present when an end user lists the
|
|
1932
|
-
* teams they belong to, so the dashboard can keep workspace selection
|
|
1933
|
-
* scoped to one organization. */
|
|
1934
|
-
organizationId: z.string().optional(),
|
|
1935
|
-
organizationName: z.string().optional(),
|
|
1936
|
-
name: z.string(),
|
|
1937
|
-
status: z.enum(["active", "sending_suspended", "archived"]),
|
|
1938
|
-
externalId: z.string().nullable().optional(),
|
|
1939
|
-
createdAt: z.string().nullable().optional(),
|
|
1940
|
-
updatedAt: z.string().nullable().optional(),
|
|
1941
|
-
/** True when the calling human is already a `team_members` row. Always
|
|
1942
|
-
* false for organization API keys. Omitted on non-list team payloads. */
|
|
1943
|
-
viewerIsMember: z.boolean().optional()
|
|
1944
|
-
});
|
|
1945
|
-
var apiKeySchema = z.object({
|
|
1946
|
-
keyId: z.string(),
|
|
1947
|
-
keyPrefix: z.string(),
|
|
1948
|
-
name: z.string(),
|
|
1949
|
-
expiresAt: z.string().nullable().optional(),
|
|
1950
|
-
lastUsedAt: z.string().nullable().optional(),
|
|
1951
|
-
revokedAt: z.string().nullable().optional(),
|
|
1952
|
-
createdAt: z.string().nullable().optional()
|
|
1953
|
-
});
|
|
1954
|
-
var createdApiKeySchema = apiKeySchema.extend({
|
|
1955
|
-
key: z.string()
|
|
1956
|
-
});
|
|
1957
|
-
var createTeamBodySchema = z.object({ name: z.string().min(1) });
|
|
1958
|
-
var renameTeamBodySchema = z.object({ name: z.string().min(1) });
|
|
1959
|
-
var createApiKeyBodySchema = z.object({ name: z.string().min(1) });
|
|
1960
|
-
var provisionTeamBodySchema = z.object({
|
|
1961
|
-
externalId: z.string().min(1),
|
|
1962
|
-
name: z.string().min(1),
|
|
1963
|
-
sender: z.object({
|
|
1964
|
-
fromName: z.string().min(1).optional(),
|
|
1965
|
-
replyTo: z.string().email().optional()
|
|
1966
|
-
}).optional(),
|
|
1967
|
-
postalAddress: postalAddressSchema.optional(),
|
|
1968
|
-
delivery: z.object({
|
|
1969
|
-
useOrganizationDefault: z.boolean().optional(),
|
|
1970
|
-
teamEspEnabled: z.boolean().optional(),
|
|
1971
|
-
teamCanChangeDefault: z.boolean().optional()
|
|
1972
|
-
}).optional(),
|
|
1973
|
-
quota: z.object({
|
|
1974
|
-
dailyLimit: z.number().int().positive().nullable().optional(),
|
|
1975
|
-
monthlyLimit: z.number().int().positive().nullable().optional()
|
|
1976
|
-
}).optional()
|
|
1977
|
-
});
|
|
1978
|
-
var provisionedTeamBaseSchema = z.object({
|
|
1979
|
-
teamId: z.string(),
|
|
1980
|
-
externalId: z.string(),
|
|
1981
|
-
name: z.string(),
|
|
1982
|
-
deliverySource: z.object({ type: z.literal("organization") })
|
|
1983
|
-
});
|
|
1984
|
-
var provisionTeamResponseSchema = z.discriminatedUnion("created", [
|
|
1985
|
-
provisionedTeamBaseSchema.extend({
|
|
1986
|
-
created: z.literal(true),
|
|
1987
|
-
apiKey: z.string()
|
|
1988
|
-
}),
|
|
1989
|
-
provisionedTeamBaseSchema.extend({
|
|
1990
|
-
created: z.literal(false),
|
|
1991
|
-
apiKey: z.null()
|
|
1992
|
-
})
|
|
1993
|
-
]);
|
|
1994
|
-
var provisionedTeamSchema = provisionedTeamBaseSchema.extend({
|
|
1995
|
-
status: z.enum(["active", "sending_suspended", "archived"]),
|
|
1996
|
-
postalAddress: postalAddressSchema.nullable(),
|
|
1997
|
-
teamEspEnabled: z.boolean(),
|
|
1998
|
-
teamCanChangeDefault: z.boolean(),
|
|
1999
|
-
createdAt: z.string().nullable(),
|
|
2000
|
-
updatedAt: z.string().nullable()
|
|
2001
|
-
});
|
|
2002
|
-
var updateProvisionedTeamBodySchema = z.object({
|
|
2003
|
-
name: z.string().min(1).optional(),
|
|
2004
|
-
sender: z.object({
|
|
2005
|
-
fromName: z.string().min(1).nullable().optional(),
|
|
2006
|
-
replyTo: z.string().email().nullable().optional()
|
|
2007
|
-
}).optional(),
|
|
2008
|
-
postalAddress: postalAddressSchema.nullable().optional(),
|
|
2009
|
-
delivery: z.object({
|
|
2010
|
-
teamEspEnabled: z.boolean().optional(),
|
|
2011
|
-
teamCanChangeDefault: z.boolean().optional()
|
|
2012
|
-
}).optional(),
|
|
2013
|
-
quota: z.object({
|
|
2014
|
-
dailyLimit: z.number().int().nonnegative().nullable().optional(),
|
|
2015
|
-
monthlyLimit: z.number().int().nonnegative().nullable().optional()
|
|
2016
|
-
}).optional()
|
|
2017
|
-
}).refine((body) => Object.keys(body).length > 0, {
|
|
2018
|
-
message: "At least one field is required"
|
|
2019
|
-
});
|
|
2020
|
-
var usageWindowSchema = z.object({
|
|
2021
|
-
limit: z.number().int().nullable(),
|
|
2022
|
-
accepted: z.number().int().nonnegative(),
|
|
2023
|
-
reserved: z.number().int().nonnegative(),
|
|
2024
|
-
remaining: z.number().int().nullable(),
|
|
2025
|
-
resetsAt: z.string()
|
|
2026
|
-
});
|
|
2027
|
-
var provisionedTeamUsageSchema = z.object({
|
|
2028
|
-
day: usageWindowSchema,
|
|
2029
|
-
month: usageWindowSchema
|
|
2030
|
-
});
|
|
2031
2120
|
var templatePurposes = ["marketing", "transactional"];
|
|
2032
2121
|
var templatePurposeSchema = z.enum(templatePurposes).describe(
|
|
2033
2122
|
"Immutable sending purpose. Marketing templates require a final managed footer; transactional templates are footer-free and are valid for POST /emails."
|
|
@@ -3319,7 +3408,8 @@ var provisioningContract = c.router(
|
|
|
3319
3408
|
403: errorSchema,
|
|
3320
3409
|
404: errorSchema
|
|
3321
3410
|
},
|
|
3322
|
-
summary: "Get a provisioned team within the authenticated organization"
|
|
3411
|
+
summary: "Get a provisioned team within the authenticated organization",
|
|
3412
|
+
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."
|
|
3323
3413
|
},
|
|
3324
3414
|
updateTeam: {
|
|
3325
3415
|
method: "PATCH",
|
|
@@ -3376,6 +3466,39 @@ var provisioningContract = c.router(
|
|
|
3376
3466
|
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
3377
3467
|
summary: "Archive a provisioned team"
|
|
3378
3468
|
},
|
|
3469
|
+
getTeamSendingDomain: {
|
|
3470
|
+
method: "GET",
|
|
3471
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3472
|
+
responses: {
|
|
3473
|
+
200: teamSendingDomainSchema.nullable(),
|
|
3474
|
+
403: errorSchema,
|
|
3475
|
+
404: errorSchema,
|
|
3476
|
+
422: errorSchema
|
|
3477
|
+
},
|
|
3478
|
+
summary: "Check a provisioned team's own sending domain",
|
|
3479
|
+
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."
|
|
3480
|
+
},
|
|
3481
|
+
setTeamSendingDomain: {
|
|
3482
|
+
method: "PUT",
|
|
3483
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3484
|
+
body: setTeamSendingDomainBodySchema,
|
|
3485
|
+
responses: {
|
|
3486
|
+
200: teamSendingDomainSchema,
|
|
3487
|
+
400: errorSchema,
|
|
3488
|
+
403: errorSchema,
|
|
3489
|
+
404: errorSchema,
|
|
3490
|
+
409: errorSchema,
|
|
3491
|
+
422: errorSchema
|
|
3492
|
+
},
|
|
3493
|
+
summary: "Set a provisioned team's own From address and register its domain",
|
|
3494
|
+
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."
|
|
3495
|
+
},
|
|
3496
|
+
removeTeamSendingDomain: {
|
|
3497
|
+
method: "DELETE",
|
|
3498
|
+
path: "/provisioning/teams/:teamId/sending-domain",
|
|
3499
|
+
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
3500
|
+
summary: "Stop using a provisioned team's own sending domain"
|
|
3501
|
+
},
|
|
3379
3502
|
getTeamUsage: {
|
|
3380
3503
|
method: "GET",
|
|
3381
3504
|
path: "/provisioning/teams/:teamId/usage",
|
|
@@ -3384,7 +3507,8 @@ var provisioningContract = c.router(
|
|
|
3384
3507
|
403: errorSchema,
|
|
3385
3508
|
404: errorSchema
|
|
3386
3509
|
},
|
|
3387
|
-
summary: "Get organization-delivery quota usage for a provisioned team"
|
|
3510
|
+
summary: "Get organization-delivery quota usage for a provisioned team",
|
|
3511
|
+
description: "Returns the team's day and month quota on the shared mailbox, plus its `health` (see Get a provisioned team)."
|
|
3388
3512
|
}
|
|
3389
3513
|
},
|
|
3390
3514
|
{ metadata: { tag: "Teams" } }
|
|
@@ -3698,6 +3822,31 @@ var organizationsContract = c.router(
|
|
|
3698
3822
|
summary: "Delete an eligible never-activated organization ESP",
|
|
3699
3823
|
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`."
|
|
3700
3824
|
},
|
|
3825
|
+
setEspManagementCredentials: {
|
|
3826
|
+
method: "PUT",
|
|
3827
|
+
path: "/organizations/:organizationId/esps/:espId/management-credentials",
|
|
3828
|
+
body: espManagementCredentialsBodySchema,
|
|
3829
|
+
responses: {
|
|
3830
|
+
200: espConfigSchema,
|
|
3831
|
+
403: errorSchema,
|
|
3832
|
+
404: errorSchema,
|
|
3833
|
+
422: errorSchema
|
|
3834
|
+
},
|
|
3835
|
+
summary: "Store a shared ESP's provider API credential",
|
|
3836
|
+
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`."
|
|
3837
|
+
},
|
|
3838
|
+
removeEspManagementCredentials: {
|
|
3839
|
+
method: "DELETE",
|
|
3840
|
+
path: "/organizations/:organizationId/esps/:espId/management-credentials",
|
|
3841
|
+
responses: {
|
|
3842
|
+
200: espConfigSchema,
|
|
3843
|
+
403: errorSchema,
|
|
3844
|
+
404: errorSchema,
|
|
3845
|
+
409: errorSchema
|
|
3846
|
+
},
|
|
3847
|
+
summary: "Remove a shared ESP's provider API credential",
|
|
3848
|
+
description: "409 `esp_management_credentials_in_use` while teams' own sending domains are registered through the mailbox: remove those first."
|
|
3849
|
+
},
|
|
3701
3850
|
getEspFeedback: {
|
|
3702
3851
|
method: "GET",
|
|
3703
3852
|
path: "/organizations/:organizationId/esps/:espId/feedback",
|
|
@@ -3797,8 +3946,8 @@ var organizationsContract = c.router(
|
|
|
3797
3946
|
403: errorSchema,
|
|
3798
3947
|
404: errorSchema
|
|
3799
3948
|
},
|
|
3800
|
-
summary: "Get organization
|
|
3801
|
-
description: "Returns per-team and organization-total
|
|
3949
|
+
summary: "Get organization mail activity and team health",
|
|
3950
|
+
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."
|
|
3802
3951
|
},
|
|
3803
3952
|
enterTeam: {
|
|
3804
3953
|
method: "POST",
|
|
@@ -3858,6 +4007,40 @@ var organizationsContract = c.router(
|
|
|
3858
4007
|
},
|
|
3859
4008
|
summary: "Transition a team's organization ESP grant; revoking detaches safe campaigns"
|
|
3860
4009
|
},
|
|
4010
|
+
getTeamSendingDomain: {
|
|
4011
|
+
method: "GET",
|
|
4012
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4013
|
+
responses: {
|
|
4014
|
+
200: teamSendingDomainSchema.nullable(),
|
|
4015
|
+
403: errorSchema,
|
|
4016
|
+
404: errorSchema,
|
|
4017
|
+
422: errorSchema
|
|
4018
|
+
},
|
|
4019
|
+
summary: "Check a team's own sending domain",
|
|
4020
|
+
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."
|
|
4021
|
+
},
|
|
4022
|
+
setTeamSendingDomain: {
|
|
4023
|
+
method: "PUT",
|
|
4024
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4025
|
+
body: setTeamSendingDomainBodySchema,
|
|
4026
|
+
responses: {
|
|
4027
|
+
200: teamSendingDomainSchema,
|
|
4028
|
+
400: errorSchema,
|
|
4029
|
+
403: errorSchema,
|
|
4030
|
+
404: errorSchema,
|
|
4031
|
+
409: errorSchema,
|
|
4032
|
+
422: errorSchema
|
|
4033
|
+
},
|
|
4034
|
+
summary: "Set a team's own From address and register its domain",
|
|
4035
|
+
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."
|
|
4036
|
+
},
|
|
4037
|
+
removeTeamSendingDomain: {
|
|
4038
|
+
method: "DELETE",
|
|
4039
|
+
path: "/organizations/:organizationId/teams/:teamId/sending-domain",
|
|
4040
|
+
responses: { 204: c.noBody(), 403: errorSchema, 404: errorSchema },
|
|
4041
|
+
summary: "Stop using a team's own sending domain",
|
|
4042
|
+
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."
|
|
4043
|
+
},
|
|
3861
4044
|
listSendingDomains: {
|
|
3862
4045
|
method: "GET",
|
|
3863
4046
|
path: "/organizations/:organizationId/sending-domains",
|
|
@@ -4068,6 +4251,22 @@ var formsContract = c.router(
|
|
|
4068
4251
|
path: "/forms/:formId",
|
|
4069
4252
|
responses: { 204: c.noBody(), 404: errorSchema },
|
|
4070
4253
|
summary: "Delete a signup form"
|
|
4254
|
+
},
|
|
4255
|
+
submit: {
|
|
4256
|
+
method: "POST",
|
|
4257
|
+
path: "/forms/:formId/submissions",
|
|
4258
|
+
body: submitSignupFormBodySchema,
|
|
4259
|
+
responses: {
|
|
4260
|
+
200: signupFormSubmissionSchema,
|
|
4261
|
+
400: errorSchema,
|
|
4262
|
+
404: errorSchema,
|
|
4263
|
+
429: errorSchema,
|
|
4264
|
+
503: signupFormSenderErrorSchema.extend({
|
|
4265
|
+
error: z.literal("form_unavailable")
|
|
4266
|
+
})
|
|
4267
|
+
},
|
|
4268
|
+
summary: "Submit a signup to a form",
|
|
4269
|
+
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."
|
|
4071
4270
|
}
|
|
4072
4271
|
},
|
|
4073
4272
|
{ metadata: { tag: "Contacts" } }
|
|
@@ -4523,19 +4722,62 @@ var Events = class {
|
|
|
4523
4722
|
}
|
|
4524
4723
|
};
|
|
4525
4724
|
|
|
4725
|
+
// src/resources/forms.ts
|
|
4726
|
+
var routes5 = contract.forms;
|
|
4727
|
+
var Forms = class {
|
|
4728
|
+
constructor(http) {
|
|
4729
|
+
this.http = http;
|
|
4730
|
+
}
|
|
4731
|
+
async list() {
|
|
4732
|
+
return this.http.request(routes5.list);
|
|
4733
|
+
}
|
|
4734
|
+
/** Double opt-in (the default) needs a sending mailbox: without one this
|
|
4735
|
+
* fails with 422 `confirmation_sender_unavailable`. */
|
|
4736
|
+
async create(input) {
|
|
4737
|
+
return this.http.request(routes5.create, { body: input });
|
|
4738
|
+
}
|
|
4739
|
+
async get(formId) {
|
|
4740
|
+
return this.http.request(routes5.get, {
|
|
4741
|
+
params: { formId: assertId(formId, "formId") }
|
|
4742
|
+
});
|
|
4743
|
+
}
|
|
4744
|
+
async update(formId, input) {
|
|
4745
|
+
return this.http.request(routes5.update, {
|
|
4746
|
+
params: { formId: assertId(formId, "formId") },
|
|
4747
|
+
body: input
|
|
4748
|
+
});
|
|
4749
|
+
}
|
|
4750
|
+
async remove(formId) {
|
|
4751
|
+
await this.http.request(routes5.remove, {
|
|
4752
|
+
params: { formId: assertId(formId, "formId") }
|
|
4753
|
+
});
|
|
4754
|
+
}
|
|
4755
|
+
/**
|
|
4756
|
+
* Signs someone up through the form from your server. A double opt-in
|
|
4757
|
+
* form emails them a confirmation link; pass `clientIp` so the per-IP
|
|
4758
|
+
* rate limit applies to them rather than to your server.
|
|
4759
|
+
*/
|
|
4760
|
+
async submit(formId, input) {
|
|
4761
|
+
return this.http.request(routes5.submit, {
|
|
4762
|
+
params: { formId: assertId(formId, "formId") },
|
|
4763
|
+
body: input
|
|
4764
|
+
});
|
|
4765
|
+
}
|
|
4766
|
+
};
|
|
4767
|
+
|
|
4526
4768
|
// src/resources/overview.ts
|
|
4527
|
-
var
|
|
4769
|
+
var routes6 = contract.overview;
|
|
4528
4770
|
var OverviewResource = class {
|
|
4529
4771
|
constructor(http) {
|
|
4530
4772
|
this.http = http;
|
|
4531
4773
|
}
|
|
4532
4774
|
async get(query = {}) {
|
|
4533
|
-
return this.http.request(
|
|
4775
|
+
return this.http.request(routes6.get, { query });
|
|
4534
4776
|
}
|
|
4535
4777
|
};
|
|
4536
4778
|
|
|
4537
4779
|
// src/resources/provisioning.ts
|
|
4538
|
-
var
|
|
4780
|
+
var routes7 = contract.provisioning;
|
|
4539
4781
|
var Provisioning = class {
|
|
4540
4782
|
constructor(http) {
|
|
4541
4783
|
this.http = http;
|
|
@@ -4546,20 +4788,20 @@ var Provisioning = class {
|
|
|
4546
4788
|
* `created: false, apiKey: null`, so it's safe to retry.
|
|
4547
4789
|
*/
|
|
4548
4790
|
async provisionTeam(input) {
|
|
4549
|
-
return this.http.request(
|
|
4791
|
+
return this.http.request(routes7.provisionTeam, {
|
|
4550
4792
|
body: input,
|
|
4551
4793
|
retrySafe: true
|
|
4552
4794
|
});
|
|
4553
4795
|
}
|
|
4554
4796
|
/** `teams:read` */
|
|
4555
4797
|
async getTeam(teamId) {
|
|
4556
|
-
return this.http.request(
|
|
4798
|
+
return this.http.request(routes7.getTeam, {
|
|
4557
4799
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4558
4800
|
});
|
|
4559
4801
|
}
|
|
4560
4802
|
/** `teams:manage` */
|
|
4561
4803
|
async updateTeam(teamId, input) {
|
|
4562
|
-
return this.http.request(
|
|
4804
|
+
return this.http.request(routes7.updateTeam, {
|
|
4563
4805
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4564
4806
|
body: input
|
|
4565
4807
|
});
|
|
@@ -4567,106 +4809,106 @@ var Provisioning = class {
|
|
|
4567
4809
|
/** Replaces the team's integration key (`teams:keys`); keys previously
|
|
4568
4810
|
* issued through provisioning are revoked. */
|
|
4569
4811
|
async createTeamKey(teamId, input) {
|
|
4570
|
-
return this.http.request(
|
|
4812
|
+
return this.http.request(routes7.createTeamKey, {
|
|
4571
4813
|
params: { teamId: assertId(teamId, "teamId") },
|
|
4572
4814
|
body: input
|
|
4573
4815
|
});
|
|
4574
4816
|
}
|
|
4575
4817
|
/** `teams:manage` */
|
|
4576
4818
|
async suspendTeam(teamId) {
|
|
4577
|
-
return this.http.request(
|
|
4819
|
+
return this.http.request(routes7.suspendTeam, {
|
|
4578
4820
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4579
4821
|
});
|
|
4580
4822
|
}
|
|
4581
4823
|
/** `teams:manage` */
|
|
4582
4824
|
async resumeTeam(teamId) {
|
|
4583
|
-
return this.http.request(
|
|
4825
|
+
return this.http.request(routes7.resumeTeam, {
|
|
4584
4826
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4585
4827
|
});
|
|
4586
4828
|
}
|
|
4587
4829
|
/** Soft-deprovisions the team (`teams:manage`). There is no unarchive. */
|
|
4588
4830
|
async archiveTeam(teamId) {
|
|
4589
|
-
await this.http.request(
|
|
4831
|
+
await this.http.request(routes7.archiveTeam, {
|
|
4590
4832
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4591
4833
|
});
|
|
4592
4834
|
}
|
|
4593
4835
|
/** `usage:read` */
|
|
4594
4836
|
async getTeamUsage(teamId) {
|
|
4595
|
-
return this.http.request(
|
|
4837
|
+
return this.http.request(routes7.getTeamUsage, {
|
|
4596
4838
|
params: { teamId: assertId(teamId, "teamId") }
|
|
4597
4839
|
});
|
|
4598
4840
|
}
|
|
4599
4841
|
};
|
|
4600
4842
|
|
|
4601
4843
|
// src/resources/segments.ts
|
|
4602
|
-
var
|
|
4844
|
+
var routes8 = contract.segments;
|
|
4603
4845
|
var Segments = class {
|
|
4604
4846
|
constructor(http) {
|
|
4605
4847
|
this.http = http;
|
|
4606
4848
|
}
|
|
4607
4849
|
async create(input) {
|
|
4608
|
-
return this.http.request(
|
|
4850
|
+
return this.http.request(routes8.create, { body: input });
|
|
4609
4851
|
}
|
|
4610
4852
|
async list() {
|
|
4611
|
-
return this.http.request(
|
|
4853
|
+
return this.http.request(routes8.list);
|
|
4612
4854
|
}
|
|
4613
4855
|
async get(segmentId) {
|
|
4614
|
-
return this.http.request(
|
|
4856
|
+
return this.http.request(routes8.get, {
|
|
4615
4857
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4616
4858
|
});
|
|
4617
4859
|
}
|
|
4618
4860
|
async update(segmentId, input) {
|
|
4619
|
-
return this.http.request(
|
|
4861
|
+
return this.http.request(routes8.update, {
|
|
4620
4862
|
params: { segmentId: assertId(segmentId, "segmentId") },
|
|
4621
4863
|
body: input
|
|
4622
4864
|
});
|
|
4623
4865
|
}
|
|
4624
4866
|
async remove(segmentId) {
|
|
4625
|
-
await this.http.request(
|
|
4867
|
+
await this.http.request(routes8.remove, {
|
|
4626
4868
|
params: { segmentId: assertId(segmentId, "segmentId") }
|
|
4627
4869
|
});
|
|
4628
4870
|
}
|
|
4629
4871
|
};
|
|
4630
4872
|
|
|
4631
4873
|
// src/resources/sequences.ts
|
|
4632
|
-
var
|
|
4874
|
+
var routes9 = contract.sequences;
|
|
4633
4875
|
var Sequences = class {
|
|
4634
4876
|
constructor(http) {
|
|
4635
4877
|
this.http = http;
|
|
4636
4878
|
}
|
|
4637
4879
|
async create(input) {
|
|
4638
|
-
return this.http.request(
|
|
4880
|
+
return this.http.request(routes9.create, { body: input });
|
|
4639
4881
|
}
|
|
4640
4882
|
async list(query) {
|
|
4641
|
-
return this.http.request(
|
|
4883
|
+
return this.http.request(routes9.list, { query });
|
|
4642
4884
|
}
|
|
4643
4885
|
listAll(query) {
|
|
4644
4886
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4645
4887
|
}
|
|
4646
4888
|
async get(sequenceId) {
|
|
4647
|
-
return this.http.request(
|
|
4889
|
+
return this.http.request(routes9.get, {
|
|
4648
4890
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4649
4891
|
});
|
|
4650
4892
|
}
|
|
4651
4893
|
async update(sequenceId, input) {
|
|
4652
|
-
return this.http.request(
|
|
4894
|
+
return this.http.request(routes9.update, {
|
|
4653
4895
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4654
4896
|
body: input
|
|
4655
4897
|
});
|
|
4656
4898
|
}
|
|
4657
4899
|
async remove(sequenceId) {
|
|
4658
|
-
await this.http.request(
|
|
4900
|
+
await this.http.request(routes9.remove, {
|
|
4659
4901
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4660
4902
|
});
|
|
4661
4903
|
}
|
|
4662
4904
|
async addEmail(sequenceId, input) {
|
|
4663
|
-
return this.http.request(
|
|
4905
|
+
return this.http.request(routes9.addEmail, {
|
|
4664
4906
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4665
4907
|
body: input
|
|
4666
4908
|
});
|
|
4667
4909
|
}
|
|
4668
4910
|
async updateEmail(sequenceId, emailId, input) {
|
|
4669
|
-
return this.http.request(
|
|
4911
|
+
return this.http.request(routes9.updateEmail, {
|
|
4670
4912
|
params: {
|
|
4671
4913
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4672
4914
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4678,21 +4920,21 @@ var Sequences = class {
|
|
|
4678
4920
|
* sequence, so sends use them. While it's active, `updateEmail` saves
|
|
4679
4921
|
* subject and content changes as a draft. */
|
|
4680
4922
|
async publishChanges(sequenceId, input = {}) {
|
|
4681
|
-
return this.http.request(
|
|
4923
|
+
return this.http.request(routes9.publishChanges, {
|
|
4682
4924
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4683
4925
|
body: input
|
|
4684
4926
|
});
|
|
4685
4927
|
}
|
|
4686
4928
|
/** Throws away unpublished email changes. Sends are not affected. */
|
|
4687
4929
|
async discardChanges(sequenceId, input = {}) {
|
|
4688
|
-
return this.http.request(
|
|
4930
|
+
return this.http.request(routes9.discardChanges, {
|
|
4689
4931
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4690
4932
|
body: input
|
|
4691
4933
|
});
|
|
4692
4934
|
}
|
|
4693
4935
|
/** The versions an email has been published with, live one first. */
|
|
4694
4936
|
async emailVersions(sequenceId, emailId) {
|
|
4695
|
-
const { items } = await this.http.request(
|
|
4937
|
+
const { items } = await this.http.request(routes9.emailVersions, {
|
|
4696
4938
|
params: {
|
|
4697
4939
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4698
4940
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4703,7 +4945,7 @@ var Sequences = class {
|
|
|
4703
4945
|
/** Loads an earlier published version into the email's draft; publish
|
|
4704
4946
|
* it with `publishChanges` to roll back. */
|
|
4705
4947
|
async restoreEmailVersion(sequenceId, emailId, versionId) {
|
|
4706
|
-
return this.http.request(
|
|
4948
|
+
return this.http.request(routes9.restoreEmailVersion, {
|
|
4707
4949
|
params: {
|
|
4708
4950
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4709
4951
|
emailId: assertId(emailId, "emailId"),
|
|
@@ -4712,7 +4954,7 @@ var Sequences = class {
|
|
|
4712
4954
|
});
|
|
4713
4955
|
}
|
|
4714
4956
|
async removeEmail(sequenceId, emailId) {
|
|
4715
|
-
return this.http.request(
|
|
4957
|
+
return this.http.request(routes9.removeEmail, {
|
|
4716
4958
|
params: {
|
|
4717
4959
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4718
4960
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4722,17 +4964,17 @@ var Sequences = class {
|
|
|
4722
4964
|
/** Sends a broadcast, or activates a sequence so its trigger starts
|
|
4723
4965
|
* enrolling contacts. Requires a mailing address in general settings. */
|
|
4724
4966
|
async start(sequenceId) {
|
|
4725
|
-
return this.http.request(
|
|
4967
|
+
return this.http.request(routes9.start, {
|
|
4726
4968
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4727
4969
|
});
|
|
4728
4970
|
}
|
|
4729
4971
|
async pause(sequenceId) {
|
|
4730
|
-
return this.http.request(
|
|
4972
|
+
return this.http.request(routes9.pause, {
|
|
4731
4973
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4732
4974
|
});
|
|
4733
4975
|
}
|
|
4734
4976
|
async stats(sequenceId) {
|
|
4735
|
-
return this.http.request(
|
|
4977
|
+
return this.http.request(routes9.stats, {
|
|
4736
4978
|
params: { sequenceId: assertId(sequenceId, "sequenceId") }
|
|
4737
4979
|
});
|
|
4738
4980
|
}
|
|
@@ -4740,7 +4982,7 @@ var Sequences = class {
|
|
|
4740
4982
|
* `outcome: "bounced"` or `"complained"` lists the recipients behind the
|
|
4741
4983
|
* stats' bounce and complaint rates. */
|
|
4742
4984
|
async deliveries(sequenceId, query = {}) {
|
|
4743
|
-
return this.http.request(
|
|
4985
|
+
return this.http.request(routes9.deliveries, {
|
|
4744
4986
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4745
4987
|
query
|
|
4746
4988
|
});
|
|
@@ -4752,7 +4994,7 @@ var Sequences = class {
|
|
|
4752
4994
|
* send with a `[Test]` subject prefix. Tests count against the team's test
|
|
4753
4995
|
* limits (429 `test_send_limit_reached` / `test_send_email_limit_reached`). */
|
|
4754
4996
|
async sendEmailTest(sequenceId, emailId, input) {
|
|
4755
|
-
return this.http.request(
|
|
4997
|
+
return this.http.request(routes9.sendEmailTest, {
|
|
4756
4998
|
params: {
|
|
4757
4999
|
sequenceId: assertId(sequenceId, "sequenceId"),
|
|
4758
5000
|
emailId: assertId(emailId, "emailId")
|
|
@@ -4762,7 +5004,7 @@ var Sequences = class {
|
|
|
4762
5004
|
}
|
|
4763
5005
|
/** IDs of contacts that have received this broadcast or sequence. */
|
|
4764
5006
|
async subscribers(sequenceId, query = {}) {
|
|
4765
|
-
return this.http.request(
|
|
5007
|
+
return this.http.request(routes9.subscribers, {
|
|
4766
5008
|
params: { sequenceId: assertId(sequenceId, "sequenceId") },
|
|
4767
5009
|
query
|
|
4768
5010
|
});
|
|
@@ -4770,16 +5012,16 @@ var Sequences = class {
|
|
|
4770
5012
|
};
|
|
4771
5013
|
|
|
4772
5014
|
// src/resources/settings.ts
|
|
4773
|
-
var
|
|
5015
|
+
var routes10 = contract.settings.general;
|
|
4774
5016
|
var GeneralSettingsResource = class {
|
|
4775
5017
|
constructor(http) {
|
|
4776
5018
|
this.http = http;
|
|
4777
5019
|
}
|
|
4778
5020
|
async get() {
|
|
4779
|
-
return this.http.request(
|
|
5021
|
+
return this.http.request(routes10.get);
|
|
4780
5022
|
}
|
|
4781
5023
|
async update(input) {
|
|
4782
|
-
return this.http.request(
|
|
5024
|
+
return this.http.request(routes10.update, { body: input });
|
|
4783
5025
|
}
|
|
4784
5026
|
};
|
|
4785
5027
|
var Settings = class {
|
|
@@ -4789,26 +5031,26 @@ var Settings = class {
|
|
|
4789
5031
|
};
|
|
4790
5032
|
|
|
4791
5033
|
// src/resources/suppressions.ts
|
|
4792
|
-
var
|
|
5034
|
+
var routes11 = contract.suppressions;
|
|
4793
5035
|
var Suppressions = class {
|
|
4794
5036
|
constructor(http) {
|
|
4795
5037
|
this.http = http;
|
|
4796
5038
|
}
|
|
4797
5039
|
async list(query = {}) {
|
|
4798
|
-
return this.http.request(
|
|
5040
|
+
return this.http.request(routes11.list, { query });
|
|
4799
5041
|
}
|
|
4800
5042
|
listAll(query = {}) {
|
|
4801
5043
|
return paginate((offset) => this.list({ ...query, offset }));
|
|
4802
5044
|
}
|
|
4803
5045
|
async get(suppressionId) {
|
|
4804
|
-
return this.http.request(
|
|
5046
|
+
return this.http.request(routes11.get, {
|
|
4805
5047
|
params: { suppressionId: assertId(suppressionId, "suppressionId") }
|
|
4806
5048
|
});
|
|
4807
5049
|
}
|
|
4808
5050
|
/** Complaint suppressions can't be released (409
|
|
4809
5051
|
* `suppression_not_releasable`). */
|
|
4810
5052
|
async release(suppressionId, input = {}) {
|
|
4811
|
-
return this.http.request(
|
|
5053
|
+
return this.http.request(routes11.release, {
|
|
4812
5054
|
params: { suppressionId: assertId(suppressionId, "suppressionId") },
|
|
4813
5055
|
body: input
|
|
4814
5056
|
});
|
|
@@ -4816,70 +5058,70 @@ var Suppressions = class {
|
|
|
4816
5058
|
};
|
|
4817
5059
|
|
|
4818
5060
|
// src/resources/tags.ts
|
|
4819
|
-
var
|
|
5061
|
+
var routes12 = contract.tags;
|
|
4820
5062
|
var Tags = class {
|
|
4821
5063
|
constructor(http) {
|
|
4822
5064
|
this.http = http;
|
|
4823
5065
|
}
|
|
4824
5066
|
async list() {
|
|
4825
|
-
return this.http.request(
|
|
5067
|
+
return this.http.request(routes12.list);
|
|
4826
5068
|
}
|
|
4827
5069
|
async references(tag) {
|
|
4828
|
-
return this.http.request(
|
|
5070
|
+
return this.http.request(routes12.references, {
|
|
4829
5071
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4830
5072
|
});
|
|
4831
5073
|
}
|
|
4832
5074
|
/** Renames a tag on every contact and everywhere it's referenced. */
|
|
4833
5075
|
async rename(tag, input) {
|
|
4834
|
-
return this.http.request(
|
|
5076
|
+
return this.http.request(routes12.rename, {
|
|
4835
5077
|
params: { tag: encodeSegment(tag, "tag") },
|
|
4836
5078
|
body: input
|
|
4837
5079
|
});
|
|
4838
5080
|
}
|
|
4839
5081
|
/** Removes a tag from every contact. */
|
|
4840
5082
|
async remove(tag) {
|
|
4841
|
-
return this.http.request(
|
|
5083
|
+
return this.http.request(routes12.remove, {
|
|
4842
5084
|
params: { tag: encodeSegment(tag, "tag") }
|
|
4843
5085
|
});
|
|
4844
5086
|
}
|
|
4845
5087
|
};
|
|
4846
5088
|
|
|
4847
5089
|
// src/resources/templates.ts
|
|
4848
|
-
var
|
|
5090
|
+
var routes13 = contract.templates;
|
|
4849
5091
|
var Templates = class {
|
|
4850
5092
|
constructor(http) {
|
|
4851
5093
|
this.http = http;
|
|
4852
5094
|
}
|
|
4853
5095
|
async list(query = {}) {
|
|
4854
|
-
return this.http.request(
|
|
5096
|
+
return this.http.request(routes13.list, { query });
|
|
4855
5097
|
}
|
|
4856
5098
|
/** Built-in starters, shared by every team. Duplicate one into the team
|
|
4857
5099
|
* before using it for transactional sends. */
|
|
4858
5100
|
async listSystem(query = {}) {
|
|
4859
|
-
return this.http.request(
|
|
5101
|
+
return this.http.request(routes13.listSystem, { query });
|
|
4860
5102
|
}
|
|
4861
5103
|
async get(templateId) {
|
|
4862
|
-
return this.http.request(
|
|
5104
|
+
return this.http.request(routes13.get, {
|
|
4863
5105
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4864
5106
|
});
|
|
4865
5107
|
}
|
|
4866
5108
|
async create(input) {
|
|
4867
|
-
return this.http.request(
|
|
5109
|
+
return this.http.request(routes13.create, { body: input });
|
|
4868
5110
|
}
|
|
4869
5111
|
async update(templateId, input) {
|
|
4870
|
-
return this.http.request(
|
|
5112
|
+
return this.http.request(routes13.update, {
|
|
4871
5113
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4872
5114
|
body: input
|
|
4873
5115
|
});
|
|
4874
5116
|
}
|
|
4875
5117
|
async duplicate(templateId, input = {}) {
|
|
4876
|
-
return this.http.request(
|
|
5118
|
+
return this.http.request(routes13.duplicate, {
|
|
4877
5119
|
params: { templateId: assertId(templateId, "templateId") },
|
|
4878
5120
|
body: input
|
|
4879
5121
|
});
|
|
4880
5122
|
}
|
|
4881
5123
|
async remove(templateId) {
|
|
4882
|
-
await this.http.request(
|
|
5124
|
+
await this.http.request(routes13.remove, {
|
|
4883
5125
|
params: { templateId: assertId(templateId, "templateId") }
|
|
4884
5126
|
});
|
|
4885
5127
|
}
|
|
@@ -4944,6 +5186,7 @@ var SendLit = class {
|
|
|
4944
5186
|
this.sequences = new Sequences(http);
|
|
4945
5187
|
this.emails = new Emails(http);
|
|
4946
5188
|
this.events = new Events(http);
|
|
5189
|
+
this.forms = new Forms(http);
|
|
4947
5190
|
this.provisioning = new Provisioning(http);
|
|
4948
5191
|
this.suppressions = new Suppressions(http);
|
|
4949
5192
|
this.deliveryEvents = new DeliveryEvents(http);
|
|
@@ -4953,4 +5196,4 @@ var SendLit = class {
|
|
|
4953
5196
|
}
|
|
4954
5197
|
};
|
|
4955
5198
|
|
|
4956
|
-
export { Contacts, DEFAULT_ENDPOINT, DeliveryEvents, Emails, EventDefinitions, Events, GeneralSettingsResource, OverviewResource, Provisioning, Segments, SendLit, SendLitError, Sequences, Settings, Suppressions, Tags, Templates };
|
|
5199
|
+
export { Contacts, DEFAULT_ENDPOINT, DeliveryEvents, Emails, EventDefinitions, Events, Forms, GeneralSettingsResource, OverviewResource, Provisioning, Segments, SendLit, SendLitError, Sequences, Settings, Suppressions, Tags, Templates };
|