@marlinjai/mail-contract 0.13.0 → 0.15.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/dist/index.d.mts +525 -71
- package/dist/index.d.ts +525 -71
- package/dist/index.js +112 -7
- package/dist/index.mjs +103 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -107,10 +107,13 @@ __export(index_exports, {
|
|
|
107
107
|
BILLING_NOT_CONFIGURED_REASON: () => BILLING_NOT_CONFIGURED_REASON,
|
|
108
108
|
BoundedAutomationFilter: () => BoundedAutomationFilter,
|
|
109
109
|
BoundedSegmentFilter: () => BoundedSegmentFilter,
|
|
110
|
+
COMPANY_GRANT_ROLES: () => COMPANY_GRANT_ROLES,
|
|
111
|
+
COMPANY_ROLE_MAX_AGE_HOURS: () => COMPANY_ROLE_MAX_AGE_HOURS,
|
|
110
112
|
CONTACT_PROPERTY_TYPES: () => CONTACT_PROPERTY_TYPES,
|
|
111
113
|
CatalogPlan: () => CatalogPlan,
|
|
112
114
|
CheckoutRequest: () => CheckoutRequest,
|
|
113
115
|
CheckoutSession: () => CheckoutSession,
|
|
116
|
+
CompanyGrantRole: () => CompanyGrantRole,
|
|
114
117
|
CompanyId: () => CompanyId,
|
|
115
118
|
CompileMessage: () => CompileMessage,
|
|
116
119
|
CompileRequest: () => CompileRequest,
|
|
@@ -249,6 +252,7 @@ __export(index_exports, {
|
|
|
249
252
|
MAX_STEPS: () => MAX_STEPS,
|
|
250
253
|
MAX_STEP_VISITS: () => MAX_STEP_VISITS,
|
|
251
254
|
MAX_SUBJECT_LENGTH: () => MAX_SUBJECT_LENGTH,
|
|
255
|
+
MAX_SYNC_COMPANIES: () => MAX_SYNC_COMPANIES,
|
|
252
256
|
MAX_TEMPLATE_INPUTS: () => MAX_TEMPLATE_INPUTS,
|
|
253
257
|
MAX_TEMPLATE_INPUTS_APP_LENGTH: () => MAX_TEMPLATE_INPUTS_APP_LENGTH,
|
|
254
258
|
MAX_TEMPLATE_INPUTS_SEEN: () => MAX_TEMPLATE_INPUTS_SEEN,
|
|
@@ -259,6 +263,7 @@ __export(index_exports, {
|
|
|
259
263
|
MAX_TEMPLATE_TRANSLATIONS: () => MAX_TEMPLATE_TRANSLATIONS,
|
|
260
264
|
MAX_TRIGGERS: () => MAX_TRIGGERS,
|
|
261
265
|
MEMBER_ROLES: () => MEMBER_ROLES,
|
|
266
|
+
MEMBER_SOURCES: () => MEMBER_SOURCES,
|
|
262
267
|
MERGE_FIELD_PATTERN: () => MERGE_FIELD_PATTERN,
|
|
263
268
|
MESSAGE_OUTCOMES: () => MESSAGE_OUTCOMES,
|
|
264
269
|
MIN_SPLIT_BRANCHES: () => MIN_SPLIT_BRANCHES,
|
|
@@ -294,8 +299,11 @@ __export(index_exports, {
|
|
|
294
299
|
MailingTestResult: () => MailingTestResult,
|
|
295
300
|
MailingUpdate: () => MailingUpdate,
|
|
296
301
|
Member: () => Member,
|
|
302
|
+
MemberCompanySync: () => MemberCompanySync,
|
|
303
|
+
MemberCompanySyncResult: () => MemberCompanySyncResult,
|
|
297
304
|
MemberCreate: () => MemberCreate,
|
|
298
305
|
MemberRole: () => MemberRole,
|
|
306
|
+
MemberSource: () => MemberSource,
|
|
299
307
|
MemberUpdate: () => MemberUpdate,
|
|
300
308
|
MergeDefaultValue: () => MergeDefaultValue,
|
|
301
309
|
MergeDefaults: () => MergeDefaults,
|
|
@@ -503,6 +511,7 @@ __export(index_exports, {
|
|
|
503
511
|
billingRoutes: () => billingRoutes,
|
|
504
512
|
buildPath: () => buildPath,
|
|
505
513
|
buildTemplatePatch: () => buildTemplatePatch,
|
|
514
|
+
canDeleteMailing: () => canDeleteMailing,
|
|
506
515
|
canTransition: () => canTransition,
|
|
507
516
|
canonicalLocale: () => canonicalLocale,
|
|
508
517
|
choiceKeyProblem: () => choiceKeyProblem,
|
|
@@ -1826,6 +1835,10 @@ var Mailing = import_zod8.z.object({
|
|
|
1826
1835
|
updated_at: Timestamp
|
|
1827
1836
|
});
|
|
1828
1837
|
var MailingSummary = Mailing.omit({ document: true });
|
|
1838
|
+
function canDeleteMailing(mailing) {
|
|
1839
|
+
if (mailing.kind !== "broadcast") return false;
|
|
1840
|
+
return mailing.status === "draft" || mailing.status === "cancelled" && mailing.started_at === null;
|
|
1841
|
+
}
|
|
1829
1842
|
var MailingContent = {
|
|
1830
1843
|
name: import_zod8.z.string().max(200).optional(),
|
|
1831
1844
|
subject: import_zod8.z.string().min(1).max(998),
|
|
@@ -3474,12 +3487,13 @@ var WorkspaceCreate = import_zod11.z.object({
|
|
|
3474
3487
|
name: import_zod11.z.string().max(200).nullable().optional()
|
|
3475
3488
|
}),
|
|
3476
3489
|
/**
|
|
3477
|
-
* The
|
|
3478
|
-
*
|
|
3479
|
-
* erasure
|
|
3480
|
-
*
|
|
3490
|
+
* The auth-brain company the workspace is created in. Required since 0.14.0:
|
|
3491
|
+
* every new workspace belongs to a company, which is what links it to that
|
|
3492
|
+
* company's erasure and lets the company's owners and admins in without an
|
|
3493
|
+
* invitation (`members.syncCompanyRole`). A workspace created before, without
|
|
3494
|
+
* one, keeps working and simply has no such inheritance.
|
|
3481
3495
|
*/
|
|
3482
|
-
company_id: CompanyId
|
|
3496
|
+
company_id: CompanyId
|
|
3483
3497
|
});
|
|
3484
3498
|
var WorkspaceUpdate = import_zod11.z.object({
|
|
3485
3499
|
name: import_zod11.z.string().min(1).max(120),
|
|
@@ -3489,14 +3503,58 @@ var WorkspaceMove = import_zod11.z.object({ company_id: CompanyId });
|
|
|
3489
3503
|
var MEMBER_ROLES = ["owner", "admin", "editor", "viewer"];
|
|
3490
3504
|
var MemberRole = import_zod11.z.enum(MEMBER_ROLES);
|
|
3491
3505
|
var WorkspaceMembership = Workspace.extend({ role: MemberRole });
|
|
3506
|
+
var MEMBER_SOURCES = ["invited", "company"];
|
|
3507
|
+
var MemberSource = import_zod11.z.enum(MEMBER_SOURCES);
|
|
3508
|
+
var COMPANY_GRANT_ROLES = ["owner", "admin"];
|
|
3509
|
+
var CompanyGrantRole = import_zod11.z.enum(COMPANY_GRANT_ROLES);
|
|
3510
|
+
var COMPANY_ROLE_MAX_AGE_HOURS = 24;
|
|
3492
3511
|
var Member = import_zod11.z.object({
|
|
3493
3512
|
id: Id,
|
|
3494
3513
|
/** The person's auth-brain subject. */
|
|
3495
3514
|
subject: import_zod11.z.string().min(1).max(255),
|
|
3496
3515
|
email: Email,
|
|
3497
3516
|
name: import_zod11.z.string().max(200).nullable(),
|
|
3517
|
+
/**
|
|
3518
|
+
* The role in force: the higher of the person's own role in the workspace
|
|
3519
|
+
* and the one a confirmed company role carries. For a `company` row that is
|
|
3520
|
+
* no longer confirmed, the role it would carry once confirmed again.
|
|
3521
|
+
*/
|
|
3498
3522
|
role: MemberRole,
|
|
3499
|
-
created_at: Timestamp
|
|
3523
|
+
created_at: Timestamp,
|
|
3524
|
+
/*
|
|
3525
|
+
* The five fields below exist since 0.14.0 and are optional only so that a
|
|
3526
|
+
* client built against this contract can still read a service that predates
|
|
3527
|
+
* them: absent means an ordinary, invited member.
|
|
3528
|
+
*/
|
|
3529
|
+
source: MemberSource.optional(),
|
|
3530
|
+
/** The company role last reported for the person (`members.syncCompanyRole`), or null. */
|
|
3531
|
+
company_role: CompanyGrantRole.nullable().optional(),
|
|
3532
|
+
/** When the dashboard last confirmed `company_role`; null without one. */
|
|
3533
|
+
company_checked_at: Timestamp.nullable().optional(),
|
|
3534
|
+
/** The person's own role in the workspace; null for a `company` row. */
|
|
3535
|
+
direct_role: MemberRole.nullable().optional(),
|
|
3536
|
+
/**
|
|
3537
|
+
* True while `role` is held only through a confirmed company role. Such a
|
|
3538
|
+
* member cannot be changed or removed here (`inherited_from_company`): the
|
|
3539
|
+
* role is managed in the shared login. A `company` row with `inherited`
|
|
3540
|
+
* false is one whose company role has not been confirmed within
|
|
3541
|
+
* `COMPANY_ROLE_MAX_AGE_HOURS`; it grants nothing and an admin may remove it.
|
|
3542
|
+
*/
|
|
3543
|
+
inherited: import_zod11.z.boolean().optional()
|
|
3544
|
+
});
|
|
3545
|
+
var MAX_SYNC_COMPANIES = 100;
|
|
3546
|
+
var MemberCompanySync = import_zod11.z.object({
|
|
3547
|
+
email: Email,
|
|
3548
|
+
name: import_zod11.z.string().max(200).nullable().optional(),
|
|
3549
|
+
companies: import_zod11.z.array(import_zod11.z.object({ company_id: CompanyId, role: CompanyGrantRole })).max(MAX_SYNC_COMPANIES).refine((list2) => new Set(list2.map((c) => c.company_id)).size === list2.length, "each company at most once")
|
|
3550
|
+
});
|
|
3551
|
+
var MemberCompanySyncResult = import_zod11.z.object({
|
|
3552
|
+
/** Workspaces in which the person now holds a company role they did not hold, or held differently, before this call. */
|
|
3553
|
+
granted: import_zod11.z.array(Id),
|
|
3554
|
+
/** Workspaces in which a company role was taken away by this call. */
|
|
3555
|
+
revoked: import_zod11.z.array(Id),
|
|
3556
|
+
/** Workspaces in which the person's company role was already as stated. */
|
|
3557
|
+
unchanged: import_zod11.z.array(Id)
|
|
3500
3558
|
});
|
|
3501
3559
|
var MemberCreate = import_zod11.z.object({
|
|
3502
3560
|
subject: import_zod11.z.string().min(1).max(255),
|
|
@@ -3564,6 +3622,7 @@ var AUDIT_ACTIONS = [
|
|
|
3564
3622
|
"mailing.paused",
|
|
3565
3623
|
"mailing.resumed",
|
|
3566
3624
|
"mailing.cancelled",
|
|
3625
|
+
"mailing.deleted",
|
|
3567
3626
|
"mailing.retried",
|
|
3568
3627
|
"webhook.created",
|
|
3569
3628
|
"webhook.updated",
|
|
@@ -5104,6 +5163,24 @@ var foundationRoutes = {
|
|
|
5104
5163
|
access: "admin",
|
|
5105
5164
|
phase: "S0"
|
|
5106
5165
|
},
|
|
5166
|
+
/**
|
|
5167
|
+
* The dashboard states the signed-in person's owner and admin roles in
|
|
5168
|
+
* companies, and the service brings the member lists in line (see
|
|
5169
|
+
* `MemberCompanySync`). `dashboard` access: the dashboard's service token
|
|
5170
|
+
* and the person's subject, no workspace. An API key is refused, and so is
|
|
5171
|
+
* every trusted application: it is not in any `TRUSTED_APP_OPERATIONS` list
|
|
5172
|
+
* and the handler refuses an application once more by itself.
|
|
5173
|
+
*/
|
|
5174
|
+
"members.syncCompanyRole": {
|
|
5175
|
+
method: "POST",
|
|
5176
|
+
path: "/v1/members/company-sync",
|
|
5177
|
+
body: MemberCompanySync,
|
|
5178
|
+
response: MemberCompanySyncResult,
|
|
5179
|
+
status: 200,
|
|
5180
|
+
access: "dashboard",
|
|
5181
|
+
phase: "S0",
|
|
5182
|
+
statement: true
|
|
5183
|
+
},
|
|
5107
5184
|
"apiKeys.list": {
|
|
5108
5185
|
method: "GET",
|
|
5109
5186
|
path: "/v1/api-keys",
|
|
@@ -5675,6 +5752,25 @@ var sendingRoutes = {
|
|
|
5675
5752
|
access: "write",
|
|
5676
5753
|
phase: "S2"
|
|
5677
5754
|
},
|
|
5755
|
+
/**
|
|
5756
|
+
* Deletes a mailing that never started: a broadcast in `draft`, or one
|
|
5757
|
+
* `cancelled` before any send began (`canDeleteMailing`). Its recipients,
|
|
5758
|
+
* A/B variants and compiled content go with it. Test sends made from it stay
|
|
5759
|
+
* in the archive, with `mailing_id` null: they are mail that really went out.
|
|
5760
|
+
* Anything else is `mailing_invalid_state` (409): a scheduled mailing is
|
|
5761
|
+
* unscheduled first, and a mailing that started is the record of what was
|
|
5762
|
+
* sent. An automation's mailing is `conflict`; a transactional letter is
|
|
5763
|
+
* deleted only by a key that may write one (`forbidden`).
|
|
5764
|
+
*/
|
|
5765
|
+
"mailings.delete": {
|
|
5766
|
+
method: "DELETE",
|
|
5767
|
+
path: "/v1/mailings/:id",
|
|
5768
|
+
params: IdParams,
|
|
5769
|
+
response: Ok,
|
|
5770
|
+
status: 200,
|
|
5771
|
+
access: "write",
|
|
5772
|
+
phase: "S2"
|
|
5773
|
+
},
|
|
5678
5774
|
"mailings.retryFailed": {
|
|
5679
5775
|
method: "POST",
|
|
5680
5776
|
path: "/v1/mailings/:id/retry-failed",
|
|
@@ -6407,7 +6503,7 @@ function trustedAppMayCall(app, id) {
|
|
|
6407
6503
|
return TRUSTED_APP_OPERATIONS[app].includes(id);
|
|
6408
6504
|
}
|
|
6409
6505
|
function acceptsIdempotencyKey(route) {
|
|
6410
|
-
return route.method !== "GET";
|
|
6506
|
+
return route.method !== "GET" && route.statement !== true;
|
|
6411
6507
|
}
|
|
6412
6508
|
function buildPath(path, params = {}) {
|
|
6413
6509
|
return path.replace(/:([a-z_]+)/g, (_, name) => {
|
|
@@ -6528,10 +6624,13 @@ function matchRoute(method, pathname) {
|
|
|
6528
6624
|
BILLING_NOT_CONFIGURED_REASON,
|
|
6529
6625
|
BoundedAutomationFilter,
|
|
6530
6626
|
BoundedSegmentFilter,
|
|
6627
|
+
COMPANY_GRANT_ROLES,
|
|
6628
|
+
COMPANY_ROLE_MAX_AGE_HOURS,
|
|
6531
6629
|
CONTACT_PROPERTY_TYPES,
|
|
6532
6630
|
CatalogPlan,
|
|
6533
6631
|
CheckoutRequest,
|
|
6534
6632
|
CheckoutSession,
|
|
6633
|
+
CompanyGrantRole,
|
|
6535
6634
|
CompanyId,
|
|
6536
6635
|
CompileMessage,
|
|
6537
6636
|
CompileRequest,
|
|
@@ -6670,6 +6769,7 @@ function matchRoute(method, pathname) {
|
|
|
6670
6769
|
MAX_STEPS,
|
|
6671
6770
|
MAX_STEP_VISITS,
|
|
6672
6771
|
MAX_SUBJECT_LENGTH,
|
|
6772
|
+
MAX_SYNC_COMPANIES,
|
|
6673
6773
|
MAX_TEMPLATE_INPUTS,
|
|
6674
6774
|
MAX_TEMPLATE_INPUTS_APP_LENGTH,
|
|
6675
6775
|
MAX_TEMPLATE_INPUTS_SEEN,
|
|
@@ -6680,6 +6780,7 @@ function matchRoute(method, pathname) {
|
|
|
6680
6780
|
MAX_TEMPLATE_TRANSLATIONS,
|
|
6681
6781
|
MAX_TRIGGERS,
|
|
6682
6782
|
MEMBER_ROLES,
|
|
6783
|
+
MEMBER_SOURCES,
|
|
6683
6784
|
MERGE_FIELD_PATTERN,
|
|
6684
6785
|
MESSAGE_OUTCOMES,
|
|
6685
6786
|
MIN_SPLIT_BRANCHES,
|
|
@@ -6715,8 +6816,11 @@ function matchRoute(method, pathname) {
|
|
|
6715
6816
|
MailingTestResult,
|
|
6716
6817
|
MailingUpdate,
|
|
6717
6818
|
Member,
|
|
6819
|
+
MemberCompanySync,
|
|
6820
|
+
MemberCompanySyncResult,
|
|
6718
6821
|
MemberCreate,
|
|
6719
6822
|
MemberRole,
|
|
6823
|
+
MemberSource,
|
|
6720
6824
|
MemberUpdate,
|
|
6721
6825
|
MergeDefaultValue,
|
|
6722
6826
|
MergeDefaults,
|
|
@@ -6924,6 +7028,7 @@ function matchRoute(method, pathname) {
|
|
|
6924
7028
|
billingRoutes,
|
|
6925
7029
|
buildPath,
|
|
6926
7030
|
buildTemplatePatch,
|
|
7031
|
+
canDeleteMailing,
|
|
6927
7032
|
canTransition,
|
|
6928
7033
|
canonicalLocale,
|
|
6929
7034
|
choiceKeyProblem,
|
package/dist/index.mjs
CHANGED
|
@@ -1195,6 +1195,10 @@ var Mailing = z8.object({
|
|
|
1195
1195
|
updated_at: Timestamp
|
|
1196
1196
|
});
|
|
1197
1197
|
var MailingSummary = Mailing.omit({ document: true });
|
|
1198
|
+
function canDeleteMailing(mailing) {
|
|
1199
|
+
if (mailing.kind !== "broadcast") return false;
|
|
1200
|
+
return mailing.status === "draft" || mailing.status === "cancelled" && mailing.started_at === null;
|
|
1201
|
+
}
|
|
1198
1202
|
var MailingContent = {
|
|
1199
1203
|
name: z8.string().max(200).optional(),
|
|
1200
1204
|
subject: z8.string().min(1).max(998),
|
|
@@ -2843,12 +2847,13 @@ var WorkspaceCreate = z11.object({
|
|
|
2843
2847
|
name: z11.string().max(200).nullable().optional()
|
|
2844
2848
|
}),
|
|
2845
2849
|
/**
|
|
2846
|
-
* The
|
|
2847
|
-
*
|
|
2848
|
-
* erasure
|
|
2849
|
-
*
|
|
2850
|
+
* The auth-brain company the workspace is created in. Required since 0.14.0:
|
|
2851
|
+
* every new workspace belongs to a company, which is what links it to that
|
|
2852
|
+
* company's erasure and lets the company's owners and admins in without an
|
|
2853
|
+
* invitation (`members.syncCompanyRole`). A workspace created before, without
|
|
2854
|
+
* one, keeps working and simply has no such inheritance.
|
|
2850
2855
|
*/
|
|
2851
|
-
company_id: CompanyId
|
|
2856
|
+
company_id: CompanyId
|
|
2852
2857
|
});
|
|
2853
2858
|
var WorkspaceUpdate = z11.object({
|
|
2854
2859
|
name: z11.string().min(1).max(120),
|
|
@@ -2858,14 +2863,58 @@ var WorkspaceMove = z11.object({ company_id: CompanyId });
|
|
|
2858
2863
|
var MEMBER_ROLES = ["owner", "admin", "editor", "viewer"];
|
|
2859
2864
|
var MemberRole = z11.enum(MEMBER_ROLES);
|
|
2860
2865
|
var WorkspaceMembership = Workspace.extend({ role: MemberRole });
|
|
2866
|
+
var MEMBER_SOURCES = ["invited", "company"];
|
|
2867
|
+
var MemberSource = z11.enum(MEMBER_SOURCES);
|
|
2868
|
+
var COMPANY_GRANT_ROLES = ["owner", "admin"];
|
|
2869
|
+
var CompanyGrantRole = z11.enum(COMPANY_GRANT_ROLES);
|
|
2870
|
+
var COMPANY_ROLE_MAX_AGE_HOURS = 24;
|
|
2861
2871
|
var Member = z11.object({
|
|
2862
2872
|
id: Id,
|
|
2863
2873
|
/** The person's auth-brain subject. */
|
|
2864
2874
|
subject: z11.string().min(1).max(255),
|
|
2865
2875
|
email: Email,
|
|
2866
2876
|
name: z11.string().max(200).nullable(),
|
|
2877
|
+
/**
|
|
2878
|
+
* The role in force: the higher of the person's own role in the workspace
|
|
2879
|
+
* and the one a confirmed company role carries. For a `company` row that is
|
|
2880
|
+
* no longer confirmed, the role it would carry once confirmed again.
|
|
2881
|
+
*/
|
|
2867
2882
|
role: MemberRole,
|
|
2868
|
-
created_at: Timestamp
|
|
2883
|
+
created_at: Timestamp,
|
|
2884
|
+
/*
|
|
2885
|
+
* The five fields below exist since 0.14.0 and are optional only so that a
|
|
2886
|
+
* client built against this contract can still read a service that predates
|
|
2887
|
+
* them: absent means an ordinary, invited member.
|
|
2888
|
+
*/
|
|
2889
|
+
source: MemberSource.optional(),
|
|
2890
|
+
/** The company role last reported for the person (`members.syncCompanyRole`), or null. */
|
|
2891
|
+
company_role: CompanyGrantRole.nullable().optional(),
|
|
2892
|
+
/** When the dashboard last confirmed `company_role`; null without one. */
|
|
2893
|
+
company_checked_at: Timestamp.nullable().optional(),
|
|
2894
|
+
/** The person's own role in the workspace; null for a `company` row. */
|
|
2895
|
+
direct_role: MemberRole.nullable().optional(),
|
|
2896
|
+
/**
|
|
2897
|
+
* True while `role` is held only through a confirmed company role. Such a
|
|
2898
|
+
* member cannot be changed or removed here (`inherited_from_company`): the
|
|
2899
|
+
* role is managed in the shared login. A `company` row with `inherited`
|
|
2900
|
+
* false is one whose company role has not been confirmed within
|
|
2901
|
+
* `COMPANY_ROLE_MAX_AGE_HOURS`; it grants nothing and an admin may remove it.
|
|
2902
|
+
*/
|
|
2903
|
+
inherited: z11.boolean().optional()
|
|
2904
|
+
});
|
|
2905
|
+
var MAX_SYNC_COMPANIES = 100;
|
|
2906
|
+
var MemberCompanySync = z11.object({
|
|
2907
|
+
email: Email,
|
|
2908
|
+
name: z11.string().max(200).nullable().optional(),
|
|
2909
|
+
companies: z11.array(z11.object({ company_id: CompanyId, role: CompanyGrantRole })).max(MAX_SYNC_COMPANIES).refine((list2) => new Set(list2.map((c) => c.company_id)).size === list2.length, "each company at most once")
|
|
2910
|
+
});
|
|
2911
|
+
var MemberCompanySyncResult = z11.object({
|
|
2912
|
+
/** Workspaces in which the person now holds a company role they did not hold, or held differently, before this call. */
|
|
2913
|
+
granted: z11.array(Id),
|
|
2914
|
+
/** Workspaces in which a company role was taken away by this call. */
|
|
2915
|
+
revoked: z11.array(Id),
|
|
2916
|
+
/** Workspaces in which the person's company role was already as stated. */
|
|
2917
|
+
unchanged: z11.array(Id)
|
|
2869
2918
|
});
|
|
2870
2919
|
var MemberCreate = z11.object({
|
|
2871
2920
|
subject: z11.string().min(1).max(255),
|
|
@@ -2933,6 +2982,7 @@ var AUDIT_ACTIONS = [
|
|
|
2933
2982
|
"mailing.paused",
|
|
2934
2983
|
"mailing.resumed",
|
|
2935
2984
|
"mailing.cancelled",
|
|
2985
|
+
"mailing.deleted",
|
|
2936
2986
|
"mailing.retried",
|
|
2937
2987
|
"webhook.created",
|
|
2938
2988
|
"webhook.updated",
|
|
@@ -4473,6 +4523,24 @@ var foundationRoutes = {
|
|
|
4473
4523
|
access: "admin",
|
|
4474
4524
|
phase: "S0"
|
|
4475
4525
|
},
|
|
4526
|
+
/**
|
|
4527
|
+
* The dashboard states the signed-in person's owner and admin roles in
|
|
4528
|
+
* companies, and the service brings the member lists in line (see
|
|
4529
|
+
* `MemberCompanySync`). `dashboard` access: the dashboard's service token
|
|
4530
|
+
* and the person's subject, no workspace. An API key is refused, and so is
|
|
4531
|
+
* every trusted application: it is not in any `TRUSTED_APP_OPERATIONS` list
|
|
4532
|
+
* and the handler refuses an application once more by itself.
|
|
4533
|
+
*/
|
|
4534
|
+
"members.syncCompanyRole": {
|
|
4535
|
+
method: "POST",
|
|
4536
|
+
path: "/v1/members/company-sync",
|
|
4537
|
+
body: MemberCompanySync,
|
|
4538
|
+
response: MemberCompanySyncResult,
|
|
4539
|
+
status: 200,
|
|
4540
|
+
access: "dashboard",
|
|
4541
|
+
phase: "S0",
|
|
4542
|
+
statement: true
|
|
4543
|
+
},
|
|
4476
4544
|
"apiKeys.list": {
|
|
4477
4545
|
method: "GET",
|
|
4478
4546
|
path: "/v1/api-keys",
|
|
@@ -5044,6 +5112,25 @@ var sendingRoutes = {
|
|
|
5044
5112
|
access: "write",
|
|
5045
5113
|
phase: "S2"
|
|
5046
5114
|
},
|
|
5115
|
+
/**
|
|
5116
|
+
* Deletes a mailing that never started: a broadcast in `draft`, or one
|
|
5117
|
+
* `cancelled` before any send began (`canDeleteMailing`). Its recipients,
|
|
5118
|
+
* A/B variants and compiled content go with it. Test sends made from it stay
|
|
5119
|
+
* in the archive, with `mailing_id` null: they are mail that really went out.
|
|
5120
|
+
* Anything else is `mailing_invalid_state` (409): a scheduled mailing is
|
|
5121
|
+
* unscheduled first, and a mailing that started is the record of what was
|
|
5122
|
+
* sent. An automation's mailing is `conflict`; a transactional letter is
|
|
5123
|
+
* deleted only by a key that may write one (`forbidden`).
|
|
5124
|
+
*/
|
|
5125
|
+
"mailings.delete": {
|
|
5126
|
+
method: "DELETE",
|
|
5127
|
+
path: "/v1/mailings/:id",
|
|
5128
|
+
params: IdParams,
|
|
5129
|
+
response: Ok,
|
|
5130
|
+
status: 200,
|
|
5131
|
+
access: "write",
|
|
5132
|
+
phase: "S2"
|
|
5133
|
+
},
|
|
5047
5134
|
"mailings.retryFailed": {
|
|
5048
5135
|
method: "POST",
|
|
5049
5136
|
path: "/v1/mailings/:id/retry-failed",
|
|
@@ -5776,7 +5863,7 @@ function trustedAppMayCall(app, id) {
|
|
|
5776
5863
|
return TRUSTED_APP_OPERATIONS[app].includes(id);
|
|
5777
5864
|
}
|
|
5778
5865
|
function acceptsIdempotencyKey(route) {
|
|
5779
|
-
return route.method !== "GET";
|
|
5866
|
+
return route.method !== "GET" && route.statement !== true;
|
|
5780
5867
|
}
|
|
5781
5868
|
function buildPath(path, params = {}) {
|
|
5782
5869
|
return path.replace(/:([a-z_]+)/g, (_, name) => {
|
|
@@ -5896,10 +5983,13 @@ export {
|
|
|
5896
5983
|
BILLING_NOT_CONFIGURED_REASON,
|
|
5897
5984
|
BoundedAutomationFilter,
|
|
5898
5985
|
BoundedSegmentFilter,
|
|
5986
|
+
COMPANY_GRANT_ROLES,
|
|
5987
|
+
COMPANY_ROLE_MAX_AGE_HOURS,
|
|
5899
5988
|
CONTACT_PROPERTY_TYPES,
|
|
5900
5989
|
CatalogPlan,
|
|
5901
5990
|
CheckoutRequest,
|
|
5902
5991
|
CheckoutSession,
|
|
5992
|
+
CompanyGrantRole,
|
|
5903
5993
|
CompanyId,
|
|
5904
5994
|
CompileMessage,
|
|
5905
5995
|
CompileRequest,
|
|
@@ -6038,6 +6128,7 @@ export {
|
|
|
6038
6128
|
MAX_STEPS,
|
|
6039
6129
|
MAX_STEP_VISITS,
|
|
6040
6130
|
MAX_SUBJECT_LENGTH,
|
|
6131
|
+
MAX_SYNC_COMPANIES,
|
|
6041
6132
|
MAX_TEMPLATE_INPUTS,
|
|
6042
6133
|
MAX_TEMPLATE_INPUTS_APP_LENGTH,
|
|
6043
6134
|
MAX_TEMPLATE_INPUTS_SEEN,
|
|
@@ -6048,6 +6139,7 @@ export {
|
|
|
6048
6139
|
MAX_TEMPLATE_TRANSLATIONS,
|
|
6049
6140
|
MAX_TRIGGERS,
|
|
6050
6141
|
MEMBER_ROLES,
|
|
6142
|
+
MEMBER_SOURCES,
|
|
6051
6143
|
MERGE_FIELD_PATTERN,
|
|
6052
6144
|
MESSAGE_OUTCOMES,
|
|
6053
6145
|
MIN_SPLIT_BRANCHES,
|
|
@@ -6083,8 +6175,11 @@ export {
|
|
|
6083
6175
|
MailingTestResult,
|
|
6084
6176
|
MailingUpdate,
|
|
6085
6177
|
Member,
|
|
6178
|
+
MemberCompanySync,
|
|
6179
|
+
MemberCompanySyncResult,
|
|
6086
6180
|
MemberCreate,
|
|
6087
6181
|
MemberRole,
|
|
6182
|
+
MemberSource,
|
|
6088
6183
|
MemberUpdate,
|
|
6089
6184
|
MergeDefaultValue,
|
|
6090
6185
|
MergeDefaults,
|
|
@@ -6292,6 +6387,7 @@ export {
|
|
|
6292
6387
|
billingRoutes,
|
|
6293
6388
|
buildPath,
|
|
6294
6389
|
buildTemplatePatch,
|
|
6390
|
+
canDeleteMailing,
|
|
6295
6391
|
canTransition,
|
|
6296
6392
|
canonicalLocale,
|
|
6297
6393
|
choiceKeyProblem,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.15.0",
|
|
7
7
|
"description": "The v1 API contract of the mail service: zod schemas and types for every request, response, error and webhook, the route table, and webhook signing helpers",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|