samva 0.16.0 → 0.17.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/AGENTS.md +4 -1
- package/README.md +44 -1
- package/dist/analytics-CaqPRsry.js +207 -0
- package/dist/api-keys-Ce1Y4_Ip.js +274 -0
- package/dist/attachments-DYqVIraC.js +140 -0
- package/dist/brands-ZwuOGIWO.js +175 -0
- package/dist/campaigns-DZlz1E9E.js +522 -0
- package/dist/categories-CA4XIQAb.js +1011 -0
- package/dist/client/sdk.gen.d.ts +174 -3
- package/dist/client/types.gen.d.ts +1126 -11
- package/dist/client-DOzUrdTE.js +1115 -0
- package/dist/contact-groups-BLbFXnjq.js +446 -0
- package/dist/contacts-BbsoXXB4.js +787 -0
- package/dist/conversations-_sRHueML.js +494 -0
- package/dist/custom-fields-BHWbwlKn.js +176 -0
- package/dist/effect/analytics.js +2 -21
- package/dist/effect/api-keys.d.ts +1 -1
- package/dist/effect/api-keys.js +2 -28
- package/dist/effect/attachments.js +2 -17
- package/dist/effect/brands.d.ts +1 -1
- package/dist/effect/brands.js +3 -24
- package/dist/effect/campaigns.js +2 -33
- package/dist/effect/categories.js +1 -1
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/client.js +3 -4
- package/dist/effect/contact-groups.js +2 -29
- package/dist/effect/contacts.d.ts +52 -0
- package/dist/effect/contacts.js +2 -47
- package/dist/effect/conversations.js +2 -35
- package/dist/effect/custom-fields.js +2 -17
- package/dist/effect/email.d.ts +3 -2
- package/dist/effect/email.js +2 -137
- package/dist/effect/events.d.ts +121 -0
- package/dist/effect/events.js +3 -0
- package/dist/effect/extension-installations.js +2 -27
- package/dist/effect/extensions.js +2 -19
- package/dist/effect/feedback.d.ts +1 -1
- package/dist/effect/feedback.js +3 -13
- package/dist/effect/generated/analytics.d.ts +715 -0
- package/dist/effect/generated/api-keys.d.ts +1627 -0
- package/dist/effect/generated/attachments.d.ts +554 -0
- package/dist/effect/generated/brands.d.ts +1118 -0
- package/dist/effect/generated/campaigns.d.ts +3783 -0
- package/dist/effect/generated/contact-events.d.ts +158 -0
- package/dist/effect/generated/contact-groups.d.ts +1445 -0
- package/dist/effect/generated/contacts.d.ts +3789 -0
- package/dist/effect/generated/conversations.d.ts +2870 -0
- package/dist/effect/generated/custom-fields.d.ts +562 -0
- package/dist/effect/generated/email.d.ts +10622 -0
- package/dist/effect/generated/events.d.ts +463 -0
- package/dist/effect/generated/extension-installations.d.ts +1786 -0
- package/dist/effect/generated/extensions.d.ts +927 -0
- package/dist/effect/generated/feedback.d.ts +116 -0
- package/dist/effect/generated/index.d.ts +61 -0
- package/dist/effect/generated/journeys.d.ts +6135 -0
- package/dist/effect/generated/mailboxes.d.ts +13641 -0
- package/dist/effect/generated/media.d.ts +741 -0
- package/dist/effect/generated/messages.d.ts +2355 -0
- package/dist/effect/generated/namespaces.d.ts +654 -0
- package/dist/effect/generated/operations.d.ts +514 -0
- package/dist/effect/generated/organizations.d.ts +1111 -0
- package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
- package/dist/effect/generated/shared.d.ts +3250 -0
- package/dist/effect/generated/subscriptions.d.ts +188 -0
- package/dist/effect/generated/templates.d.ts +8177 -0
- package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
- package/dist/effect/generated/webhooks.d.ts +1697 -0
- package/dist/effect/generated/whoami.d.ts +291 -0
- package/dist/effect/generated-metadata.d.ts +1627 -0
- package/dist/effect/index.d.ts +3 -1
- package/dist/effect/index.js +29 -27
- package/dist/effect/internal/client.d.ts +10 -7
- package/dist/effect/internal/email-sender.d.ts +17 -0
- package/dist/effect/internal/operation.d.ts +12 -72
- package/dist/effect/internal/send.d.ts +60 -0
- package/dist/effect/journeys.d.ts +2153 -0
- package/dist/effect/journeys.js +2 -0
- package/dist/effect/mailboxes.d.ts +112 -112
- package/dist/effect/mailboxes.js +1 -1
- package/dist/effect/media.js +3 -1
- package/dist/effect/messages.d.ts +2 -2
- package/dist/effect/messages.js +3 -1
- package/dist/effect/namespaces.js +2 -19
- package/dist/effect/operations.js +2 -15
- package/dist/effect/organizations.js +2 -23
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.js +2 -19
- package/dist/effect/subscriptions.js +2 -9
- package/dist/effect/templates.d.ts +1 -1
- package/dist/effect/templates.js +3 -78
- package/dist/effect/unsubscribe-groups.js +2 -27
- package/dist/effect/webhooks.d.ts +9 -9
- package/dist/effect/webhooks.js +3 -33
- package/dist/effect/whoami.d.ts +8 -8
- package/dist/effect/whoami.js +2 -9
- package/dist/email-R0NAA9PW.js +2498 -0
- package/dist/events-CxbTUHYT.js +82 -0
- package/dist/extension-installations-CD94LPmk.js +407 -0
- package/dist/extensions-BKyNQLvu.js +220 -0
- package/dist/feedback-Bpa09JOS.js +52 -0
- package/dist/index.js +2 -2
- package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments-Bi1hDltp.js} +2 -2
- package/dist/journeys-CARo_BJT.js +499 -0
- package/dist/mailboxes-BRDn7BIK.js +2470 -0
- package/dist/media-VrrtNnft.js +181 -0
- package/dist/namespaces-CcvEbG-y.js +152 -0
- package/dist/{operation-BTXjPrwf.js → operation-n_IYgNVK.js} +75 -90
- package/dist/operations-CmB3FHwf.js +93 -0
- package/dist/organizations-A-plufWc.js +252 -0
- package/dist/promises/index.d.ts +7 -3
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-KrA2nSLg.js → promises---Kbh-7z.js} +467 -3
- package/dist/runtime-P0l1_2-C.js +25 -0
- package/dist/scheduled-messages-DkKZRRaN.js +207 -0
- package/dist/send-Bxc0XfGE.js +722 -0
- package/dist/service-map.d.ts +85 -0
- package/dist/subscriptions-DEXYtMXg.js +67 -0
- package/dist/templates-DZomxsG7.js +2289 -0
- package/dist/unsubscribe-groups-Iqk4Isf9.js +291 -0
- package/dist/webhooks-CPXuu8Xf.js +530 -0
- package/dist/whoami-Ccz0jwlt.js +59 -0
- package/package.json +13 -3
- package/dist/categories-DV51kr2H.js +0 -187
- package/dist/client-BMUew5Wp.js +0 -13794
- package/dist/effect/generated.d.ts +0 -64004
- package/dist/mailboxes-Thp5z0oX.js +0 -161
|
@@ -0,0 +1,1115 @@
|
|
|
1
|
+
import { i as uploadContentType, o as CLIENT_ATTRIBUTION_HEADER, s as clientAttribution, t as MediaUploadError } from "./inline-attachments-Bi1hDltp.js";
|
|
2
|
+
import { HttpApi, HttpApiClient, HttpApiMiddleware, HttpApiSecurity } from "effect/http-api";
|
|
3
|
+
import * as Schema$1 from "effect/Schema";
|
|
4
|
+
import { Context, Effect, Layer, Redacted } from "effect";
|
|
5
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
6
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
7
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
8
|
+
//#region src/effect/generated/shared.ts
|
|
9
|
+
const JsonValue = Schema$1.suspend(() => __recursive_JsonValue);
|
|
10
|
+
var AnalyticsQueryError = class extends Schema$1.TaggedError()("AnalyticsQueryError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
11
|
+
var UnauthorizedError = class extends Schema$1.TaggedError()("UnauthorizedError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
12
|
+
var ForbiddenError = class extends Schema$1.TaggedError()("ForbiddenError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
13
|
+
var ValidationError = class extends Schema$1.TaggedError()("ValidationError", Schema$1.Struct({
|
|
14
|
+
message: Schema$1.String,
|
|
15
|
+
fields: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String)), Schema$1.Null]))
|
|
16
|
+
})) {};
|
|
17
|
+
var InternalError = class extends Schema$1.TaggedError()("InternalError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
18
|
+
var GatewayTimeoutError = class extends Schema$1.TaggedError()("GatewayTimeoutError", Schema$1.Struct({
|
|
19
|
+
message: Schema$1.String,
|
|
20
|
+
retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
21
|
+
})) {};
|
|
22
|
+
const Cursor = /* @__PURE__ */ Schema$1.String.annotate({ identifier: "Cursor" });
|
|
23
|
+
const ApiKeyResourceAccess = /* @__PURE__ */ Schema$1.Struct({
|
|
24
|
+
messages: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
25
|
+
email: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
26
|
+
domains: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
27
|
+
phoneNumbers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
28
|
+
contacts: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
29
|
+
conversations: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
30
|
+
templates: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
31
|
+
webhooks: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
32
|
+
apiKeys: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
33
|
+
organization: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
34
|
+
billing: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null])),
|
|
35
|
+
analytics: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("read"), Schema$1.Literal("write")]), Schema$1.Null]))
|
|
36
|
+
}).annotate({ identifier: "ApiKeyResourceAccess" });
|
|
37
|
+
const MailboxId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mbx_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
38
|
+
expected: "a string matching the RegExp ^mbx_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
39
|
+
identifier: "MailboxId"
|
|
40
|
+
})).pipe(Schema$1.brand("MailboxId"));
|
|
41
|
+
const MailboxSendMode = /* @__PURE__ */ Schema$1.Union([Schema$1.Literal("send"), Schema$1.Literal("approval")]).annotate({
|
|
42
|
+
description: "How the grantee's sends execute: `send` runs them within account limits; `approval` holds each one until a different member approves it.",
|
|
43
|
+
identifier: "MailboxSendMode"
|
|
44
|
+
});
|
|
45
|
+
const NamespaceId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^ns_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
46
|
+
expected: "a string matching the RegExp ^ns_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
47
|
+
identifier: "NamespaceId"
|
|
48
|
+
})).pipe(Schema$1.brand("NamespaceId"));
|
|
49
|
+
var PaymentRequiredError = class extends Schema$1.TaggedError()("PaymentRequiredError", Schema$1.Struct({
|
|
50
|
+
message: Schema$1.String,
|
|
51
|
+
resource: Schema$1.String,
|
|
52
|
+
currentUsage: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
|
|
53
|
+
limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
54
|
+
})) {};
|
|
55
|
+
var ResourceNotFoundError = class extends Schema$1.TaggedError()("ResourceNotFoundError", Schema$1.Struct({
|
|
56
|
+
resource: Schema$1.String,
|
|
57
|
+
id: Schema$1.String,
|
|
58
|
+
message: Schema$1.String
|
|
59
|
+
})) {};
|
|
60
|
+
var RateLimitedError = class extends Schema$1.TaggedError()("RateLimitedError", Schema$1.Struct({
|
|
61
|
+
message: Schema$1.String,
|
|
62
|
+
retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
63
|
+
})) {};
|
|
64
|
+
var BillingProviderError = class extends Schema$1.TaggedError()("BillingProviderError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
65
|
+
const ApiKeyId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^key_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
66
|
+
expected: "a string matching the RegExp ^key_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
67
|
+
identifier: "ApiKeyId"
|
|
68
|
+
})).pipe(Schema$1.brand("ApiKeyId"));
|
|
69
|
+
const SuccessResponse = /* @__PURE__ */ Schema$1.Struct({ success: Schema$1.Boolean }).annotate({ identifier: "SuccessResponse" });
|
|
70
|
+
const MessageId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
71
|
+
expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
72
|
+
identifier: "MessageId"
|
|
73
|
+
})).pipe(Schema$1.brand("MessageId"));
|
|
74
|
+
const AttachmentId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
75
|
+
expected: "a string matching the RegExp ^att_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
76
|
+
identifier: "AttachmentId"
|
|
77
|
+
})).pipe(Schema$1.brand("AttachmentId"));
|
|
78
|
+
const OrganizationId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^org_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
79
|
+
expected: "a string matching the RegExp ^org_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
80
|
+
identifier: "OrganizationId"
|
|
81
|
+
})).pipe(Schema$1.brand("OrganizationId"));
|
|
82
|
+
const BrandAssets = /* @__PURE__ */ Schema$1.Struct({
|
|
83
|
+
logoUrl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })), Schema$1.Null])),
|
|
84
|
+
logoDarkUrl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })), Schema$1.Null])),
|
|
85
|
+
iconUrl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })), Schema$1.Null]))
|
|
86
|
+
}).annotate({ identifier: "BrandAssets" });
|
|
87
|
+
const BrandAddress = /* @__PURE__ */ Schema$1.Struct({
|
|
88
|
+
street1: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
89
|
+
street2: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
90
|
+
city: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
91
|
+
region: Schema$1.String,
|
|
92
|
+
postalCode: Schema$1.String,
|
|
93
|
+
country: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))
|
|
94
|
+
}).annotate({ identifier: "BrandAddress" });
|
|
95
|
+
const BrandSocialLink = /* @__PURE__ */ Schema$1.Struct({
|
|
96
|
+
label: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" })).check(Schema$1.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })),
|
|
97
|
+
url: Schema$1.String.check(Schema$1.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))
|
|
98
|
+
}).annotate({ identifier: "BrandSocialLink" });
|
|
99
|
+
var ConflictError = class extends Schema$1.TaggedError()("ConflictError", Schema$1.Struct({
|
|
100
|
+
message: Schema$1.String,
|
|
101
|
+
resource: Schema$1.String,
|
|
102
|
+
id: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
103
|
+
})) {};
|
|
104
|
+
const MediaId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^media_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
105
|
+
expected: "a string matching the RegExp ^media_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
106
|
+
identifier: "MediaId"
|
|
107
|
+
})).pipe(Schema$1.brand("MediaId"));
|
|
108
|
+
const TemplatePublicationId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
109
|
+
expected: "a string matching the RegExp ^tpub_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
110
|
+
identifier: "TemplatePublicationId"
|
|
111
|
+
})).pipe(Schema$1.brand("TemplatePublicationId"));
|
|
112
|
+
const TemplateInputContractId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tcon_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
113
|
+
expected: "a string matching the RegExp ^tcon_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
114
|
+
identifier: "TemplateInputContractId"
|
|
115
|
+
})).pipe(Schema$1.brand("TemplateInputContractId"));
|
|
116
|
+
const TemplateId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
117
|
+
expected: "a string matching the RegExp ^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
118
|
+
identifier: "TemplateId"
|
|
119
|
+
})).pipe(Schema$1.brand("TemplateId"));
|
|
120
|
+
const JsonObject = /* @__PURE__ */ Schema$1.Record(Schema$1.String, JsonValue).annotate({ identifier: "JsonObject" });
|
|
121
|
+
const RenderLocale = /* @__PURE__ */ Schema$1.String.check(Schema$1.isMaxCodePoints(64).annotate({
|
|
122
|
+
expected: "a string with at most 64 code points",
|
|
123
|
+
identifier: "RenderLocale"
|
|
124
|
+
})).check(Schema$1.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" }));
|
|
125
|
+
const RenderTimeZone = /* @__PURE__ */ Schema$1.String.check(Schema$1.isMaxCodePoints(64).annotate({
|
|
126
|
+
expected: "a string with at most 64 code points",
|
|
127
|
+
identifier: "RenderTimeZone"
|
|
128
|
+
})).check(Schema$1.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" }));
|
|
129
|
+
const ReplyToAddresses = /* @__PURE__ */ Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "ReplyToAddresses" });
|
|
130
|
+
const UnsubscribeId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
131
|
+
expected: "a string matching the RegExp ^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
132
|
+
identifier: "UnsubscribeId"
|
|
133
|
+
})).pipe(Schema$1.brand("UnsubscribeId"));
|
|
134
|
+
const EmailTrackingOverrideV1 = /* @__PURE__ */ Schema$1.Struct({
|
|
135
|
+
opens: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override open tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." })),
|
|
136
|
+
clicks: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override click tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." }))
|
|
137
|
+
}).annotate({
|
|
138
|
+
description: "Requested per-send engagement tracking policy. Recipient opt-out takes precedence, then explicit fields, organization defaults, and product defaults.",
|
|
139
|
+
identifier: "EmailTrackingOverrideV1"
|
|
140
|
+
});
|
|
141
|
+
const EmailFooterOverride = /* @__PURE__ */ Schema$1.Struct({ enabled: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])) }).annotate({ identifier: "EmailFooterOverride" });
|
|
142
|
+
const ConversationId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^conv_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
143
|
+
expected: "a string matching the RegExp ^conv_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
144
|
+
identifier: "ConversationId"
|
|
145
|
+
})).pipe(Schema$1.brand("ConversationId"));
|
|
146
|
+
const ContactId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^contact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
147
|
+
expected: "a string matching the RegExp ^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
148
|
+
identifier: "ContactId"
|
|
149
|
+
})).pipe(Schema$1.brand("ContactId"));
|
|
150
|
+
const ContactGroupId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
151
|
+
expected: "a string matching the RegExp ^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
152
|
+
identifier: "ContactGroupId"
|
|
153
|
+
})).pipe(Schema$1.brand("ContactGroupId"));
|
|
154
|
+
const SendsSeries = /* @__PURE__ */ Schema$1.Array(Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))).annotate({
|
|
155
|
+
description: "Daily email sends for the last 14 calendar days in the organization's own timezone, oldest first and zero-filled. Always fourteen entries; an entity that has never sent reports fourteen zeroes.",
|
|
156
|
+
identifier: "SendsSeries"
|
|
157
|
+
});
|
|
158
|
+
var FlagDisabledError = class extends Schema$1.TaggedError()("FlagDisabledError", Schema$1.Struct({
|
|
159
|
+
flag: Schema$1.String,
|
|
160
|
+
message: Schema$1.String
|
|
161
|
+
})) {};
|
|
162
|
+
const EmailDomainId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^dom_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
163
|
+
expected: "a string matching the RegExp ^dom_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
164
|
+
identifier: "EmailDomainId"
|
|
165
|
+
})).pipe(Schema$1.brand("EmailDomainId"));
|
|
166
|
+
var BrandAddressRequiredError = class extends Schema$1.TaggedError()("BrandAddressRequiredError", Schema$1.Struct({
|
|
167
|
+
message: Schema$1.String,
|
|
168
|
+
brand: Schema$1.Union([Schema$1.String, Schema$1.Null])
|
|
169
|
+
})) {};
|
|
170
|
+
var CampaignFooterRequiredError = class extends Schema$1.TaggedError()("CampaignFooterRequiredError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
171
|
+
var ExternalServiceError = class extends Schema$1.TaggedError()("ExternalServiceError", Schema$1.Struct({ message: Schema$1.String })) {};
|
|
172
|
+
var SenderNotReadyError = class extends Schema$1.TaggedError()("SenderNotReadyError", Schema$1.Struct({
|
|
173
|
+
message: Schema$1.String,
|
|
174
|
+
sender: Schema$1.String,
|
|
175
|
+
retryAfterSeconds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null]))
|
|
176
|
+
})) {};
|
|
177
|
+
const ContactIdentityId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^cident_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
178
|
+
expected: "a string matching the RegExp ^cident_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
179
|
+
identifier: "ContactIdentityId"
|
|
180
|
+
})).pipe(Schema$1.brand("ContactIdentityId"));
|
|
181
|
+
const WebhookEndpointId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^wep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
182
|
+
expected: "a string matching the RegExp ^wep_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
183
|
+
identifier: "WebhookEndpointId"
|
|
184
|
+
})).pipe(Schema$1.brand("WebhookEndpointId"));
|
|
185
|
+
var EmailChannelError = class extends Schema$1.TaggedError()("EmailChannelError", Schema$1.Struct({
|
|
186
|
+
reason: Schema$1.Union([
|
|
187
|
+
Schema$1.Literal("transport"),
|
|
188
|
+
Schema$1.Literal("rejected"),
|
|
189
|
+
Schema$1.Literal("rate_limited"),
|
|
190
|
+
Schema$1.Literal("auth")
|
|
191
|
+
]),
|
|
192
|
+
message: Schema$1.String,
|
|
193
|
+
statusCode: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null]))
|
|
194
|
+
})) {};
|
|
195
|
+
const OperationId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^op_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
196
|
+
expected: "a string matching the RegExp ^op_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
197
|
+
identifier: "OperationId"
|
|
198
|
+
})).pipe(Schema$1.brand("OperationId"));
|
|
199
|
+
const EmailSenderId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^sender_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
200
|
+
expected: "a string matching the RegExp ^sender_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
201
|
+
identifier: "EmailSenderId"
|
|
202
|
+
})).pipe(Schema$1.brand("EmailSenderId"));
|
|
203
|
+
const ExtensionId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^ext_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
204
|
+
expected: "a string matching the RegExp ^ext_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
205
|
+
identifier: "ExtensionId"
|
|
206
|
+
})).pipe(Schema$1.brand("ExtensionId"));
|
|
207
|
+
const ExtensionVersionId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^extver_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
208
|
+
expected: "a string matching the RegExp ^extver_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
209
|
+
identifier: "ExtensionVersionId"
|
|
210
|
+
})).pipe(Schema$1.brand("ExtensionVersionId"));
|
|
211
|
+
const UserId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
212
|
+
expected: "a string matching the RegExp ^user_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
213
|
+
identifier: "UserId"
|
|
214
|
+
})).pipe(Schema$1.brand("UserId"));
|
|
215
|
+
const FeedbackContext = /* @__PURE__ */ Schema$1.Struct({
|
|
216
|
+
operation: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.annotate({ description: "The operation the report is about, as an SDK method, MCP tool, CLI command, or `METHOD /path` (for example `POST /v1/messages`)." }).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })), Schema$1.Null])),
|
|
217
|
+
resourceId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.annotate({ description: "The id of the resource involved, such as a message or domain id." }).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })), Schema$1.Null]))
|
|
218
|
+
}).annotate({ identifier: "FeedbackContext" });
|
|
219
|
+
const JourneyName = /* @__PURE__ */ Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\S[\\s\\S]*\\S$|^\\S$|^$", "u")).annotate({
|
|
220
|
+
expected: "a string matching the RegExp ^\\S[\\s\\S]*\\S$|^\\S$|^$",
|
|
221
|
+
identifier: "JourneyName"
|
|
222
|
+
})).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" }));
|
|
223
|
+
const JourneyCustomEventName = /* @__PURE__ */ Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(255).annotate({
|
|
224
|
+
expected: "a string with at most 255 code points",
|
|
225
|
+
identifier: "JourneyCustomEventName"
|
|
226
|
+
})).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$")).annotate({ expected: "a string matching the RegExp ^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$" }));
|
|
227
|
+
const JourneyContactCreatedTrigger = /* @__PURE__ */ Schema$1.Struct({ type: Schema$1.Literal("contact.created") }).annotate({ identifier: "JourneyContactCreatedTrigger" });
|
|
228
|
+
const JourneyTagAddedTrigger = /* @__PURE__ */ Schema$1.Struct({
|
|
229
|
+
type: Schema$1.Literal("contact.tag_added"),
|
|
230
|
+
tag: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))
|
|
231
|
+
}).annotate({ identifier: "JourneyTagAddedTrigger" });
|
|
232
|
+
const JourneyNodeId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isMinLength(1).annotate({
|
|
233
|
+
expected: "a value with a length of at least 1",
|
|
234
|
+
identifier: "JourneyNodeId"
|
|
235
|
+
}));
|
|
236
|
+
const JourneyWaitConfig = /* @__PURE__ */ Schema$1.Struct({ durationSeconds: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(7776e3).annotate({ expected: "a value less than or equal to 7776000" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })) }).annotate({ identifier: "JourneyWaitConfig" });
|
|
237
|
+
const JourneyEmptyConfig = /* @__PURE__ */ Schema$1.Record(Schema$1.String, Schema$1.Never).annotate({ identifier: "JourneyEmptyConfig" });
|
|
238
|
+
const JourneyTagPredicate = /* @__PURE__ */ Schema$1.Struct({
|
|
239
|
+
type: Schema$1.Literal("tag"),
|
|
240
|
+
tag: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
241
|
+
present: Schema$1.Boolean
|
|
242
|
+
}).annotate({ identifier: "JourneyTagPredicate" });
|
|
243
|
+
const JourneyContactProperty = /* @__PURE__ */ Schema$1.Union([
|
|
244
|
+
Schema$1.Literal("name"),
|
|
245
|
+
Schema$1.Literal("displayName"),
|
|
246
|
+
Schema$1.Literal("externalId"),
|
|
247
|
+
Schema$1.Literal("status"),
|
|
248
|
+
Schema$1.Literal("profile.firstName"),
|
|
249
|
+
Schema$1.Literal("profile.lastName"),
|
|
250
|
+
Schema$1.Literal("profile.company"),
|
|
251
|
+
Schema$1.Literal("profile.jobTitle"),
|
|
252
|
+
Schema$1.Literal("profile.source"),
|
|
253
|
+
Schema$1.Literal("profile.location.country"),
|
|
254
|
+
Schema$1.Literal("profile.location.state"),
|
|
255
|
+
Schema$1.Literal("profile.location.city"),
|
|
256
|
+
Schema$1.Literal("profile.location.timezone")
|
|
257
|
+
]).annotate({ identifier: "JourneyContactProperty" });
|
|
258
|
+
const JourneyEqualityComparison = /* @__PURE__ */ Schema$1.Struct({
|
|
259
|
+
operator: Schema$1.Union([Schema$1.Literal("eq"), Schema$1.Literal("neq")]),
|
|
260
|
+
value: Schema$1.Union([
|
|
261
|
+
Schema$1.String,
|
|
262
|
+
Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
|
|
263
|
+
Schema$1.Boolean,
|
|
264
|
+
Schema$1.Null
|
|
265
|
+
])
|
|
266
|
+
}).annotate({ identifier: "JourneyEqualityComparison" });
|
|
267
|
+
const JourneyNumericComparison = /* @__PURE__ */ Schema$1.Struct({
|
|
268
|
+
operator: Schema$1.Union([
|
|
269
|
+
Schema$1.Literal("gt"),
|
|
270
|
+
Schema$1.Literal("gte"),
|
|
271
|
+
Schema$1.Literal("lt"),
|
|
272
|
+
Schema$1.Literal("lte")
|
|
273
|
+
]),
|
|
274
|
+
value: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
275
|
+
}).annotate({ identifier: "JourneyNumericComparison" });
|
|
276
|
+
const JourneyStringComparison = /* @__PURE__ */ Schema$1.Struct({
|
|
277
|
+
operator: Schema$1.Union([
|
|
278
|
+
Schema$1.Literal("contains"),
|
|
279
|
+
Schema$1.Literal("not_contains"),
|
|
280
|
+
Schema$1.Literal("starts_with"),
|
|
281
|
+
Schema$1.Literal("ends_with")
|
|
282
|
+
]),
|
|
283
|
+
value: Schema$1.String
|
|
284
|
+
}).annotate({ identifier: "JourneyStringComparison" });
|
|
285
|
+
const JourneyPresenceComparison = /* @__PURE__ */ Schema$1.Struct({ operator: Schema$1.Union([Schema$1.Literal("exists"), Schema$1.Literal("not_exists")]) }).annotate({ identifier: "JourneyPresenceComparison" });
|
|
286
|
+
const JourneyUpdateTagsConfig = /* @__PURE__ */ Schema$1.Struct({
|
|
287
|
+
add: Schema$1.Array(Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))),
|
|
288
|
+
remove: Schema$1.Array(Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })))
|
|
289
|
+
}).annotate({ identifier: "JourneyUpdateTagsConfig" });
|
|
290
|
+
const MailboxChannel = /* @__PURE__ */ Schema$1.Literal("email").annotate({
|
|
291
|
+
description: "The channel an endpoint, thread, or message belongs to.",
|
|
292
|
+
identifier: "MailboxChannel"
|
|
293
|
+
});
|
|
294
|
+
const MailboxMetadata = /* @__PURE__ */ Schema$1.Record(Schema$1.String, Schema$1.String.check(Schema$1.isMaxCodePoints(512).annotate({ expected: "a string with at most 512 code points" })).check(Schema$1.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" }))).check(Schema$1.isPropertyNames(Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" }))).annotate({
|
|
295
|
+
expected: "an object with property names matching the schema",
|
|
296
|
+
identifier: "MailboxMetadata"
|
|
297
|
+
}));
|
|
298
|
+
const MailboxEndpointId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
299
|
+
expected: "a string matching the RegExp ^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
300
|
+
identifier: "MailboxEndpointId"
|
|
301
|
+
})).pipe(Schema$1.brand("MailboxEndpointId"));
|
|
302
|
+
var MailboxChannelUnsupportedError = class extends Schema$1.TaggedError()("MailboxChannelUnsupportedError", Schema$1.Struct({
|
|
303
|
+
message: Schema$1.String,
|
|
304
|
+
channel: Schema$1.String
|
|
305
|
+
})) {};
|
|
306
|
+
const MailboxMetadataPatch = /* @__PURE__ */ Schema$1.Record(Schema$1.String, Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(512).annotate({ expected: "a string with at most 512 code points" })).check(Schema$1.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })), Schema$1.Null])).check(Schema$1.isPropertyNames(Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" }))).annotate({
|
|
307
|
+
expected: "an object with property names matching the schema",
|
|
308
|
+
identifier: "MailboxMetadataPatch"
|
|
309
|
+
}));
|
|
310
|
+
const MailboxThreadId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
311
|
+
expected: "a string matching the RegExp ^thread_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
312
|
+
identifier: "MailboxThreadId"
|
|
313
|
+
})).pipe(Schema$1.brand("MailboxThreadId"));
|
|
314
|
+
const MailboxActionId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
315
|
+
expected: "a string matching the RegExp ^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
316
|
+
identifier: "MailboxActionId"
|
|
317
|
+
})).pipe(Schema$1.brand("MailboxActionId"));
|
|
318
|
+
const MailboxDraftId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
319
|
+
expected: "a string matching the RegExp ^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
320
|
+
identifier: "MailboxDraftId"
|
|
321
|
+
})).pipe(Schema$1.brand("MailboxDraftId"));
|
|
322
|
+
const MailboxPolicyId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
323
|
+
expected: "a string matching the RegExp ^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
324
|
+
identifier: "MailboxPolicyId"
|
|
325
|
+
})).pipe(Schema$1.brand("MailboxPolicyId"));
|
|
326
|
+
const MailboxSendError = /* @__PURE__ */ Schema$1.Union([
|
|
327
|
+
Schema$1.Struct({
|
|
328
|
+
_tag: Schema$1.Literal("SenderNotReadyError"),
|
|
329
|
+
message: Schema$1.String,
|
|
330
|
+
sender: Schema$1.String,
|
|
331
|
+
retryAfterSeconds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null]))
|
|
332
|
+
}),
|
|
333
|
+
Schema$1.Struct({
|
|
334
|
+
_tag: Schema$1.Literal("RateLimitedError"),
|
|
335
|
+
message: Schema$1.String,
|
|
336
|
+
retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
337
|
+
}),
|
|
338
|
+
Schema$1.Struct({
|
|
339
|
+
_tag: Schema$1.Literal("OnboardingReviewRequiredError"),
|
|
340
|
+
message: Schema$1.String,
|
|
341
|
+
code: Schema$1.Union([
|
|
342
|
+
Schema$1.Literal("review_required"),
|
|
343
|
+
Schema$1.Literal("review_in_progress"),
|
|
344
|
+
Schema$1.Literal("information_required"),
|
|
345
|
+
Schema$1.Literal("review_rejected"),
|
|
346
|
+
Schema$1.Literal("identity_review_required"),
|
|
347
|
+
Schema$1.Literal("identity_review_rejected"),
|
|
348
|
+
Schema$1.Literal("identity_changed")
|
|
349
|
+
]),
|
|
350
|
+
decision: Schema$1.Union([
|
|
351
|
+
Schema$1.Literal("undecided"),
|
|
352
|
+
Schema$1.Literal("approved"),
|
|
353
|
+
Schema$1.Literal("rejected")
|
|
354
|
+
]),
|
|
355
|
+
stage: Schema$1.Union([
|
|
356
|
+
Schema$1.Literal("collecting"),
|
|
357
|
+
Schema$1.Literal("automated_review"),
|
|
358
|
+
Schema$1.Literal("manual_review"),
|
|
359
|
+
Schema$1.Literal("information_requested"),
|
|
360
|
+
Schema$1.Literal("complete")
|
|
361
|
+
]),
|
|
362
|
+
nextAction: Schema$1.Union([
|
|
363
|
+
Schema$1.Literal("wait_for_review"),
|
|
364
|
+
Schema$1.Literal("provide_information"),
|
|
365
|
+
Schema$1.Literal("verify_sending_identity"),
|
|
366
|
+
Schema$1.Literal("reapply"),
|
|
367
|
+
Schema$1.Literal("contact_support")
|
|
368
|
+
]),
|
|
369
|
+
identityId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
370
|
+
}),
|
|
371
|
+
Schema$1.Struct({
|
|
372
|
+
_tag: Schema$1.Literal("PaymentRequiredError"),
|
|
373
|
+
message: Schema$1.String,
|
|
374
|
+
resource: Schema$1.String,
|
|
375
|
+
currentUsage: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
|
|
376
|
+
limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
377
|
+
}),
|
|
378
|
+
Schema$1.Struct({
|
|
379
|
+
_tag: Schema$1.Literal("ValidationError"),
|
|
380
|
+
message: Schema$1.String,
|
|
381
|
+
fields: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String)), Schema$1.Null]))
|
|
382
|
+
}),
|
|
383
|
+
Schema$1.Struct({
|
|
384
|
+
_tag: Schema$1.Literal("ForbiddenError"),
|
|
385
|
+
message: Schema$1.String
|
|
386
|
+
}),
|
|
387
|
+
Schema$1.Struct({
|
|
388
|
+
_tag: Schema$1.Literal("ResourceNotFoundError"),
|
|
389
|
+
resource: Schema$1.String,
|
|
390
|
+
id: Schema$1.String,
|
|
391
|
+
message: Schema$1.String
|
|
392
|
+
})
|
|
393
|
+
]).annotate({ identifier: "MailboxSendError" });
|
|
394
|
+
var OnboardingReviewRequiredError = class extends Schema$1.TaggedError()("OnboardingReviewRequiredError", Schema$1.Struct({
|
|
395
|
+
message: Schema$1.String,
|
|
396
|
+
code: Schema$1.Union([
|
|
397
|
+
Schema$1.Literal("review_required"),
|
|
398
|
+
Schema$1.Literal("review_in_progress"),
|
|
399
|
+
Schema$1.Literal("information_required"),
|
|
400
|
+
Schema$1.Literal("review_rejected"),
|
|
401
|
+
Schema$1.Literal("identity_review_required"),
|
|
402
|
+
Schema$1.Literal("identity_review_rejected"),
|
|
403
|
+
Schema$1.Literal("identity_changed")
|
|
404
|
+
]),
|
|
405
|
+
decision: Schema$1.Union([
|
|
406
|
+
Schema$1.Literal("undecided"),
|
|
407
|
+
Schema$1.Literal("approved"),
|
|
408
|
+
Schema$1.Literal("rejected")
|
|
409
|
+
]),
|
|
410
|
+
stage: Schema$1.Union([
|
|
411
|
+
Schema$1.Literal("collecting"),
|
|
412
|
+
Schema$1.Literal("automated_review"),
|
|
413
|
+
Schema$1.Literal("manual_review"),
|
|
414
|
+
Schema$1.Literal("information_requested"),
|
|
415
|
+
Schema$1.Literal("complete")
|
|
416
|
+
]),
|
|
417
|
+
nextAction: Schema$1.Union([
|
|
418
|
+
Schema$1.Literal("wait_for_review"),
|
|
419
|
+
Schema$1.Literal("provide_information"),
|
|
420
|
+
Schema$1.Literal("verify_sending_identity"),
|
|
421
|
+
Schema$1.Literal("reapply"),
|
|
422
|
+
Schema$1.Literal("contact_support")
|
|
423
|
+
]),
|
|
424
|
+
identityId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
425
|
+
})) {};
|
|
426
|
+
const MailboxThreadFolder = /* @__PURE__ */ Schema$1.Union([
|
|
427
|
+
Schema$1.Literal("inbox"),
|
|
428
|
+
Schema$1.Literal("assigned"),
|
|
429
|
+
Schema$1.Literal("pending"),
|
|
430
|
+
Schema$1.Literal("sent"),
|
|
431
|
+
Schema$1.Literal("archived"),
|
|
432
|
+
Schema$1.Literal("trash")
|
|
433
|
+
]).annotate({ identifier: "MailboxThreadFolder" });
|
|
434
|
+
const MailboxGrantRole = /* @__PURE__ */ Schema$1.Union([
|
|
435
|
+
Schema$1.Literal("admin"),
|
|
436
|
+
Schema$1.Literal("collaborator"),
|
|
437
|
+
Schema$1.Literal("viewer")
|
|
438
|
+
]).annotate({ identifier: "MailboxGrantRole" });
|
|
439
|
+
const MailboxLabelId = /* @__PURE__ */ Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^label_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
440
|
+
expected: "a string matching the RegExp ^label_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
441
|
+
identifier: "MailboxLabelId"
|
|
442
|
+
})).pipe(Schema$1.brand("MailboxLabelId"));
|
|
443
|
+
const MailboxPolicyOutcomeKind = /* @__PURE__ */ Schema$1.Union([Schema$1.Literal("requireApproval"), Schema$1.Literal("deny")]).annotate({ identifier: "MailboxPolicyOutcomeKind" });
|
|
444
|
+
const MailboxThreadPriority = /* @__PURE__ */ Schema$1.Union([
|
|
445
|
+
Schema$1.Literal("low"),
|
|
446
|
+
Schema$1.Literal("normal"),
|
|
447
|
+
Schema$1.Literal("high"),
|
|
448
|
+
Schema$1.Literal("urgent")
|
|
449
|
+
]).annotate({ identifier: "MailboxThreadPriority" });
|
|
450
|
+
const MessageMetadata = /* @__PURE__ */ Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]).annotate({ identifier: "MessageMetadata" });
|
|
451
|
+
const EmailSender = /* @__PURE__ */ Schema$1.Union([Schema$1.Struct({
|
|
452
|
+
email: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
453
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
454
|
+
}), Schema$1.Null]).annotate({ identifier: "EmailSender" });
|
|
455
|
+
var DeliveryUnavailableError = class extends Schema$1.TaggedError()("DeliveryUnavailableError", Schema$1.Struct({
|
|
456
|
+
message: Schema$1.String,
|
|
457
|
+
retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
|
|
458
|
+
})) {};
|
|
459
|
+
const IanaTimezone = /* @__PURE__ */ Schema$1.String.annotate({ identifier: "IanaTimezone" });
|
|
460
|
+
const NamespaceMetadata = /* @__PURE__ */ Schema$1.Record(Schema$1.String, Schema$1.String).annotate({
|
|
461
|
+
description: "Your own labels for the namespace, such as the id of your customer it serves. Samva stores them and never reads them.",
|
|
462
|
+
identifier: "NamespaceMetadata"
|
|
463
|
+
});
|
|
464
|
+
const OperationResource = /* @__PURE__ */ Schema$1.Struct({
|
|
465
|
+
type: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(80).annotate({ expected: "a string with at most 80 code points" })).check(Schema$1.isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
|
|
466
|
+
id: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))
|
|
467
|
+
}).annotate({ identifier: "OperationResource" });
|
|
468
|
+
const TemplateFromDefault = /* @__PURE__ */ Schema$1.Struct({
|
|
469
|
+
email: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
470
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
471
|
+
}).annotate({ identifier: "TemplateFromDefault" });
|
|
472
|
+
const CreateTemplatePayload = /* @__PURE__ */ Schema$1.Struct({
|
|
473
|
+
name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })),
|
|
474
|
+
projectName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })), Schema$1.Null])),
|
|
475
|
+
slug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
|
|
476
|
+
galleryTemplateId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema$1.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })), Schema$1.Null])),
|
|
477
|
+
useBrand: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean.annotate({ description: "With `galleryTemplateId`: whether the new project's `theme.css` imports the organization's default brand (`@import \"samva:brand\";`) over the starter's look. Defaults to false." }), Schema$1.Null])),
|
|
478
|
+
description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
|
|
479
|
+
category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Union([
|
|
480
|
+
Schema$1.Literal("transactional"),
|
|
481
|
+
Schema$1.Literal("marketing"),
|
|
482
|
+
Schema$1.Literal("support"),
|
|
483
|
+
Schema$1.Literal("notification"),
|
|
484
|
+
Schema$1.Literal("verification"),
|
|
485
|
+
Schema$1.Literal("reminder"),
|
|
486
|
+
Schema$1.Literal("alert")
|
|
487
|
+
]), Schema$1.Null]), Schema$1.Null])),
|
|
488
|
+
isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
|
|
489
|
+
idempotencyKey: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))
|
|
490
|
+
}).annotate({ identifier: "CreateTemplatePayload" });
|
|
491
|
+
const TestWebhookPayload = /* @__PURE__ */ Schema$1.Struct({ data: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])) }).annotate({ identifier: "TestWebhookPayload" });
|
|
492
|
+
const ApiKeyMailboxAccess = /* @__PURE__ */ Schema$1.Struct({
|
|
493
|
+
permissions: Schema$1.TupleWithRest(Schema$1.Tuple([Schema$1.Union([
|
|
494
|
+
Schema$1.Literal("read"),
|
|
495
|
+
Schema$1.Literal("update"),
|
|
496
|
+
Schema$1.Literal("send"),
|
|
497
|
+
Schema$1.Literal("quarantine.read")
|
|
498
|
+
])]), [Schema$1.Union([
|
|
499
|
+
Schema$1.Literal("read"),
|
|
500
|
+
Schema$1.Literal("update"),
|
|
501
|
+
Schema$1.Literal("send"),
|
|
502
|
+
Schema$1.Literal("quarantine.read")
|
|
503
|
+
])]).annotate({ description: "`read` reads mailboxes, threads, and messages; `update` changes thread state, labels, drafts, and notes; `send` sends and replies; `quarantine.read` reads quarantined mail." }),
|
|
504
|
+
mailboxIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.TupleWithRest(Schema$1.Tuple([MailboxId]), [MailboxId]), Schema$1.Null]).annotate({ description: "The mailboxes the key may act on. Omit to reach every mailbox the owner can." })),
|
|
505
|
+
sendMode: Schema$1.optionalKey(Schema$1.Union([MailboxSendMode, Schema$1.Null]).annotate({ description: "Defaults to `send`. With `approval`, each send waits until a person other than the key approves it." }))
|
|
506
|
+
}).annotate({ identifier: "ApiKeyMailboxAccess" });
|
|
507
|
+
const CreateWebhookPayload = /* @__PURE__ */ Schema$1.Struct({
|
|
508
|
+
name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(100).annotate({ expected: "a string with at most 100 code points" })).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })),
|
|
509
|
+
url: Schema$1.String,
|
|
510
|
+
eventTypes: Schema$1.Array(Schema$1.Union([
|
|
511
|
+
Schema$1.Literal("message.sent"),
|
|
512
|
+
Schema$1.Literal("message.delivered"),
|
|
513
|
+
Schema$1.Literal("message.read"),
|
|
514
|
+
Schema$1.Literal("message.failed"),
|
|
515
|
+
Schema$1.Literal("message.bounced"),
|
|
516
|
+
Schema$1.Literal("message.complained"),
|
|
517
|
+
Schema$1.Literal("message.received"),
|
|
518
|
+
Schema$1.Literal("message.opened"),
|
|
519
|
+
Schema$1.Literal("message.clicked"),
|
|
520
|
+
Schema$1.Literal("contact.created"),
|
|
521
|
+
Schema$1.Literal("contact.updated"),
|
|
522
|
+
Schema$1.Literal("contact.deleted"),
|
|
523
|
+
Schema$1.Literal("contact.subscribed"),
|
|
524
|
+
Schema$1.Literal("contact.unsubscribed"),
|
|
525
|
+
Schema$1.Literal("contact.resubscribed"),
|
|
526
|
+
Schema$1.Literal("conversation.created"),
|
|
527
|
+
Schema$1.Literal("conversation.updated"),
|
|
528
|
+
Schema$1.Literal("conversation.archived"),
|
|
529
|
+
Schema$1.Literal("webhook.created"),
|
|
530
|
+
Schema$1.Literal("webhook.updated"),
|
|
531
|
+
Schema$1.Literal("webhook.deleted"),
|
|
532
|
+
Schema$1.Literal("webhook.test"),
|
|
533
|
+
Schema$1.Literal("domain.updated"),
|
|
534
|
+
Schema$1.Literal("domain.warming.updated"),
|
|
535
|
+
Schema$1.Literal("mailbox.message.received"),
|
|
536
|
+
Schema$1.Literal("mailbox.message.sent"),
|
|
537
|
+
Schema$1.Literal("mailbox.action.pending_approval"),
|
|
538
|
+
Schema$1.Literal("mailbox.message.quarantined"),
|
|
539
|
+
Schema$1.Literal("mailbox.message.released"),
|
|
540
|
+
Schema$1.Literal("mailbox.message.discarded"),
|
|
541
|
+
Schema$1.Literal("journey.webhook")
|
|
542
|
+
])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
543
|
+
channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
|
|
544
|
+
mailboxIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.TupleWithRest(Schema$1.Tuple([MailboxId]), [MailboxId]), Schema$1.Null])),
|
|
545
|
+
namespaceId: Schema$1.optionalKey(Schema$1.Union([NamespaceId, Schema$1.Null])),
|
|
546
|
+
headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
|
|
547
|
+
status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("active"), Schema$1.Literal("disabled")]), Schema$1.Null]))
|
|
548
|
+
}).annotate({ identifier: "CreateWebhookPayload" });
|
|
549
|
+
const UpdateWebhookPayload = /* @__PURE__ */ Schema$1.Struct({
|
|
550
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(100).annotate({ expected: "a string with at most 100 code points" })).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema$1.Null])),
|
|
551
|
+
url: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
552
|
+
eventTypes: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Union([
|
|
553
|
+
Schema$1.Literal("message.sent"),
|
|
554
|
+
Schema$1.Literal("message.delivered"),
|
|
555
|
+
Schema$1.Literal("message.read"),
|
|
556
|
+
Schema$1.Literal("message.failed"),
|
|
557
|
+
Schema$1.Literal("message.bounced"),
|
|
558
|
+
Schema$1.Literal("message.complained"),
|
|
559
|
+
Schema$1.Literal("message.received"),
|
|
560
|
+
Schema$1.Literal("message.opened"),
|
|
561
|
+
Schema$1.Literal("message.clicked"),
|
|
562
|
+
Schema$1.Literal("contact.created"),
|
|
563
|
+
Schema$1.Literal("contact.updated"),
|
|
564
|
+
Schema$1.Literal("contact.deleted"),
|
|
565
|
+
Schema$1.Literal("contact.subscribed"),
|
|
566
|
+
Schema$1.Literal("contact.unsubscribed"),
|
|
567
|
+
Schema$1.Literal("contact.resubscribed"),
|
|
568
|
+
Schema$1.Literal("conversation.created"),
|
|
569
|
+
Schema$1.Literal("conversation.updated"),
|
|
570
|
+
Schema$1.Literal("conversation.archived"),
|
|
571
|
+
Schema$1.Literal("webhook.created"),
|
|
572
|
+
Schema$1.Literal("webhook.updated"),
|
|
573
|
+
Schema$1.Literal("webhook.deleted"),
|
|
574
|
+
Schema$1.Literal("webhook.test"),
|
|
575
|
+
Schema$1.Literal("domain.updated"),
|
|
576
|
+
Schema$1.Literal("domain.warming.updated"),
|
|
577
|
+
Schema$1.Literal("mailbox.message.received"),
|
|
578
|
+
Schema$1.Literal("mailbox.message.sent"),
|
|
579
|
+
Schema$1.Literal("mailbox.action.pending_approval"),
|
|
580
|
+
Schema$1.Literal("mailbox.message.quarantined"),
|
|
581
|
+
Schema$1.Literal("mailbox.message.released"),
|
|
582
|
+
Schema$1.Literal("mailbox.message.discarded"),
|
|
583
|
+
Schema$1.Literal("journey.webhook")
|
|
584
|
+
])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
|
|
585
|
+
channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null]), Schema$1.Null])),
|
|
586
|
+
mailboxIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.TupleWithRest(Schema$1.Tuple([MailboxId]), [MailboxId]), Schema$1.Null]), Schema$1.Null])),
|
|
587
|
+
namespaceId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([NamespaceId, Schema$1.Null]), Schema$1.Null])),
|
|
588
|
+
headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
|
|
589
|
+
status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literal("active"), Schema$1.Literal("disabled")]), Schema$1.Null]))
|
|
590
|
+
}).annotate({ identifier: "UpdateWebhookPayload" });
|
|
591
|
+
const MessageSummary = /* @__PURE__ */ Schema$1.Struct({
|
|
592
|
+
id: MessageId,
|
|
593
|
+
channel: Schema$1.Literal("email"),
|
|
594
|
+
direction: Schema$1.Union([Schema$1.Literal("outbound"), Schema$1.Literal("inbound")]),
|
|
595
|
+
status: Schema$1.Union([
|
|
596
|
+
Schema$1.Literal("pending"),
|
|
597
|
+
Schema$1.Literal("scheduled"),
|
|
598
|
+
Schema$1.Literal("queued"),
|
|
599
|
+
Schema$1.Literal("processing"),
|
|
600
|
+
Schema$1.Literal("sent"),
|
|
601
|
+
Schema$1.Literal("delivered"),
|
|
602
|
+
Schema$1.Literal("read"),
|
|
603
|
+
Schema$1.Literal("failed"),
|
|
604
|
+
Schema$1.Literal("bounced"),
|
|
605
|
+
Schema$1.Literal("complained")
|
|
606
|
+
]),
|
|
607
|
+
from: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
608
|
+
to: Schema$1.Array(Schema$1.String),
|
|
609
|
+
subject: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
610
|
+
waitReason: Schema$1.Union([Schema$1.Union([
|
|
611
|
+
Schema$1.Literal("rate"),
|
|
612
|
+
Schema$1.Literal("daily-quota"),
|
|
613
|
+
Schema$1.Literal("domain-health"),
|
|
614
|
+
Schema$1.Literal("sending-paused"),
|
|
615
|
+
Schema$1.Literal("upstream-unavailable"),
|
|
616
|
+
Schema$1.Literal("retry"),
|
|
617
|
+
Schema$1.Literal("campaign-paused"),
|
|
618
|
+
Schema$1.Literal("domain-warming"),
|
|
619
|
+
Schema$1.Literal("onboarding-review"),
|
|
620
|
+
Schema$1.Literal("content-review"),
|
|
621
|
+
Schema$1.Literal("screening-unavailable")
|
|
622
|
+
]), Schema$1.Null]),
|
|
623
|
+
createdAt: Schema$1.String
|
|
624
|
+
}).annotate({ identifier: "MessageSummary" });
|
|
625
|
+
const BrandFooter = /* @__PURE__ */ Schema$1.Struct({
|
|
626
|
+
companyName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })), Schema$1.Null])),
|
|
627
|
+
address: Schema$1.optionalKey(Schema$1.Union([BrandAddress, Schema$1.Null])),
|
|
628
|
+
socialLinks: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(BrandSocialLink).check(Schema$1.isMaxLength(12).annotate({ expected: "a value with a length of at most 12" })), Schema$1.Null]))
|
|
629
|
+
}).annotate({ identifier: "BrandFooter" });
|
|
630
|
+
const EmailAttachment = /* @__PURE__ */ Schema$1.Struct({
|
|
631
|
+
filename: Schema$1.String,
|
|
632
|
+
content: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
633
|
+
mediaId: Schema$1.optionalKey(Schema$1.Union([MediaId, Schema$1.Null])),
|
|
634
|
+
contentType: Schema$1.String,
|
|
635
|
+
size: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
|
|
636
|
+
}).annotate({ identifier: "EmailAttachment" });
|
|
637
|
+
const TemplateData = /* @__PURE__ */ Schema$1.Union([JsonObject, Schema$1.Null]).annotate({ identifier: "TemplateData" });
|
|
638
|
+
const JourneyWebhookConfig = /* @__PURE__ */ Schema$1.Struct({ data: Schema$1.optionalKey(JsonObject) }).annotate({ identifier: "JourneyWebhookConfig" });
|
|
639
|
+
const SkippedRecipient = /* @__PURE__ */ Schema$1.Struct({
|
|
640
|
+
address: Schema$1.String,
|
|
641
|
+
reason: Schema$1.Union([
|
|
642
|
+
Schema$1.Literal("bounce"),
|
|
643
|
+
Schema$1.Literal("complaint"),
|
|
644
|
+
Schema$1.Literal("unsubscribe"),
|
|
645
|
+
Schema$1.Literal("manual"),
|
|
646
|
+
Schema$1.Literal("group-unsubscribe")
|
|
647
|
+
]),
|
|
648
|
+
unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null]))
|
|
649
|
+
}).annotate({ identifier: "SkippedRecipient" });
|
|
650
|
+
const ContactEvent = /* @__PURE__ */ Schema$1.Struct({
|
|
651
|
+
id: Schema$1.String,
|
|
652
|
+
contactId: ContactId,
|
|
653
|
+
name: Schema$1.String,
|
|
654
|
+
source: Schema$1.Union([Schema$1.Literal("api"), Schema$1.Literal("samva")]),
|
|
655
|
+
properties: JsonObject,
|
|
656
|
+
occurredAt: Schema$1.String,
|
|
657
|
+
recordedAt: Schema$1.String
|
|
658
|
+
}).annotate({ identifier: "ContactEvent" });
|
|
659
|
+
const ContactEventReference = /* @__PURE__ */ Schema$1.Union([
|
|
660
|
+
Schema$1.Struct({
|
|
661
|
+
id: ContactId,
|
|
662
|
+
externalId: Schema$1.optionalKey(Schema$1.Never),
|
|
663
|
+
email: Schema$1.optionalKey(Schema$1.Never)
|
|
664
|
+
}),
|
|
665
|
+
Schema$1.Struct({
|
|
666
|
+
externalId: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
667
|
+
id: Schema$1.optionalKey(Schema$1.Never),
|
|
668
|
+
email: Schema$1.optionalKey(Schema$1.Never)
|
|
669
|
+
}),
|
|
670
|
+
Schema$1.Struct({
|
|
671
|
+
email: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", "u")).annotate({ expected: "a string matching the RegExp ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$" })),
|
|
672
|
+
id: Schema$1.optionalKey(Schema$1.Never),
|
|
673
|
+
externalId: Schema$1.optionalKey(Schema$1.Never)
|
|
674
|
+
})
|
|
675
|
+
]).annotate({ identifier: "ContactEventReference" });
|
|
676
|
+
const EmailRecipient = /* @__PURE__ */ Schema$1.Union([Schema$1.Struct({ contactId: ContactId }), Schema$1.Struct({
|
|
677
|
+
email: Schema$1.String,
|
|
678
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
679
|
+
displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
|
|
680
|
+
})]).annotate({ identifier: "EmailRecipient" });
|
|
681
|
+
const JourneyGroupJoinedTrigger = /* @__PURE__ */ Schema$1.Struct({
|
|
682
|
+
type: Schema$1.Literal("contact.joined_group"),
|
|
683
|
+
groupId: ContactGroupId
|
|
684
|
+
}).annotate({ identifier: "JourneyGroupJoinedTrigger" });
|
|
685
|
+
const ContactIdentity = /* @__PURE__ */ Schema$1.Struct({
|
|
686
|
+
id: ContactIdentityId,
|
|
687
|
+
channel: Schema$1.Literal("email"),
|
|
688
|
+
identifier: Schema$1.String,
|
|
689
|
+
verified: Schema$1.Boolean
|
|
690
|
+
}).annotate({ identifier: "ContactIdentity" });
|
|
691
|
+
const JourneySendEmailConfig = /* @__PURE__ */ Schema$1.Struct({
|
|
692
|
+
template: Schema$1.Union([TemplateId, Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" }))]),
|
|
693
|
+
senderId: Schema$1.optionalKey(EmailSenderId),
|
|
694
|
+
templateData: Schema$1.optionalKey(JsonObject)
|
|
695
|
+
}).annotate({ identifier: "JourneySendEmailConfig" });
|
|
696
|
+
const ExtensionVersionRef = /* @__PURE__ */ Schema$1.Struct({
|
|
697
|
+
id: ExtensionVersionId,
|
|
698
|
+
version: Schema$1.String
|
|
699
|
+
}).annotate({ identifier: "ExtensionVersionRef" });
|
|
700
|
+
const SendFeedback = /* @__PURE__ */ Schema$1.Struct({
|
|
701
|
+
message: Schema$1.String.annotate({ description: "What happened and what you expected, in plain language (at most 4000 characters)." }).check(Schema$1.isMaxCodePoints(4e3).annotate({ expected: "a string with at most 4000 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("\\S", "u")).annotate({ expected: "a string matching the RegExp \\S" })).check(Schema$1.isMaxLength(4e3).annotate({ expected: "a value with a length of at most 4000" })),
|
|
702
|
+
category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([
|
|
703
|
+
Schema$1.Literal("bug"),
|
|
704
|
+
Schema$1.Literal("confusing"),
|
|
705
|
+
Schema$1.Literal("missing"),
|
|
706
|
+
Schema$1.Literal("other")
|
|
707
|
+
]).annotate({ description: "`bug`: the API behaved wrongly. `confusing`: a response, error, or doc was hard to act on. `missing`: a capability or field you needed does not exist. `other`: anything else." }), Schema$1.Null])),
|
|
708
|
+
context: Schema$1.optionalKey(Schema$1.Union([FeedbackContext, Schema$1.Null]))
|
|
709
|
+
}).annotate({ identifier: "SendFeedback" });
|
|
710
|
+
const JourneyCustomEventTrigger = /* @__PURE__ */ Schema$1.Struct({
|
|
711
|
+
type: Schema$1.Literal("event"),
|
|
712
|
+
eventName: JourneyCustomEventName
|
|
713
|
+
}).annotate({ identifier: "JourneyCustomEventTrigger" });
|
|
714
|
+
const JourneyEventName = /* @__PURE__ */ Schema$1.Union([JourneyCustomEventName, Schema$1.Union([
|
|
715
|
+
Schema$1.Literal("contact.created"),
|
|
716
|
+
Schema$1.Literal("contact.tag_added"),
|
|
717
|
+
Schema$1.Literal("contact.joined_group")
|
|
718
|
+
])]).annotate({ identifier: "JourneyEventName" });
|
|
719
|
+
const JourneyNextEdge = /* @__PURE__ */ Schema$1.Struct({ nodeId: JourneyNodeId }).annotate({ identifier: "JourneyNextEdge" });
|
|
720
|
+
const JourneyWaitEventEdge = /* @__PURE__ */ Schema$1.Struct({
|
|
721
|
+
nodeId: JourneyNodeId,
|
|
722
|
+
outcome: Schema$1.Union([Schema$1.Literal("matched"), Schema$1.Literal("timed_out")])
|
|
723
|
+
}).annotate({ identifier: "JourneyWaitEventEdge" });
|
|
724
|
+
const JourneyExitNode = /* @__PURE__ */ Schema$1.Struct({
|
|
725
|
+
type: Schema$1.Literal("exit"),
|
|
726
|
+
config: JourneyEmptyConfig,
|
|
727
|
+
next: Schema$1.Tuple([])
|
|
728
|
+
}).annotate({ identifier: "JourneyExitNode" });
|
|
729
|
+
const JourneyComparison = /* @__PURE__ */ Schema$1.Union([
|
|
730
|
+
JourneyEqualityComparison,
|
|
731
|
+
JourneyNumericComparison,
|
|
732
|
+
JourneyStringComparison,
|
|
733
|
+
JourneyPresenceComparison
|
|
734
|
+
]).annotate({ identifier: "JourneyComparison" });
|
|
735
|
+
const CreateMailboxEndpointPayload = /* @__PURE__ */ Schema$1.Struct({
|
|
736
|
+
channel: MailboxChannel,
|
|
737
|
+
address: Schema$1.String,
|
|
738
|
+
displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
|
|
739
|
+
}).annotate({ identifier: "CreateMailboxEndpointPayload" });
|
|
740
|
+
const MailboxActionDecision = /* @__PURE__ */ Schema$1.Struct({
|
|
741
|
+
outcome: Schema$1.Union([
|
|
742
|
+
Schema$1.Literal("allow"),
|
|
743
|
+
Schema$1.Literal("requireApproval"),
|
|
744
|
+
Schema$1.Literal("deny")
|
|
745
|
+
]),
|
|
746
|
+
reason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
747
|
+
policyId: Schema$1.Union([MailboxPolicyId, Schema$1.Null]),
|
|
748
|
+
source: Schema$1.Union([Schema$1.Union([
|
|
749
|
+
Schema$1.Literal("grant"),
|
|
750
|
+
Schema$1.Literal("installation"),
|
|
751
|
+
Schema$1.Literal("policy")
|
|
752
|
+
]), Schema$1.Null]),
|
|
753
|
+
decidedAt: Schema$1.String
|
|
754
|
+
}).annotate({ identifier: "MailboxActionDecision" });
|
|
755
|
+
const MailboxSendOutcome = /* @__PURE__ */ Schema$1.Struct({
|
|
756
|
+
code: Schema$1.String,
|
|
757
|
+
message: Schema$1.String,
|
|
758
|
+
error: Schema$1.optionalKey(Schema$1.Union([MailboxSendError, Schema$1.Null]))
|
|
759
|
+
}).annotate({ identifier: "MailboxSendOutcome" });
|
|
760
|
+
const Operation = /* @__PURE__ */ Schema$1.Struct({
|
|
761
|
+
id: OperationId,
|
|
762
|
+
organizationId: Schema$1.String,
|
|
763
|
+
kind: Schema$1.Union([Schema$1.Literal("email-domain-provisioning"), Schema$1.Literal("organization-deletion")]),
|
|
764
|
+
subject: OperationResource,
|
|
765
|
+
actor: Schema$1.Struct({
|
|
766
|
+
type: Schema$1.Union([
|
|
767
|
+
Schema$1.Literal("user"),
|
|
768
|
+
Schema$1.Literal("api-key"),
|
|
769
|
+
Schema$1.Literal("system")
|
|
770
|
+
]),
|
|
771
|
+
id: Schema$1.String
|
|
772
|
+
}),
|
|
773
|
+
status: Schema$1.Union([
|
|
774
|
+
Schema$1.Literal("pending"),
|
|
775
|
+
Schema$1.Literal("running"),
|
|
776
|
+
Schema$1.Literal("succeeded"),
|
|
777
|
+
Schema$1.Literal("failed")
|
|
778
|
+
]),
|
|
779
|
+
phase: Schema$1.Union([
|
|
780
|
+
Schema$1.Literal("accepted"),
|
|
781
|
+
Schema$1.Literal("dispatching"),
|
|
782
|
+
Schema$1.Literal("provisioning"),
|
|
783
|
+
Schema$1.Literal("deleting"),
|
|
784
|
+
Schema$1.Literal("finalizing"),
|
|
785
|
+
Schema$1.Literal("completed")
|
|
786
|
+
]),
|
|
787
|
+
error: Schema$1.Union([Schema$1.Struct({
|
|
788
|
+
code: Schema$1.Union([
|
|
789
|
+
Schema$1.Literal("validation-failed"),
|
|
790
|
+
Schema$1.Literal("conflict"),
|
|
791
|
+
Schema$1.Literal("capacity-unavailable"),
|
|
792
|
+
Schema$1.Literal("rejected"),
|
|
793
|
+
Schema$1.Literal("unavailable"),
|
|
794
|
+
Schema$1.Literal("timed-out"),
|
|
795
|
+
Schema$1.Literal("internal")
|
|
796
|
+
]),
|
|
797
|
+
message: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(240).annotate({ expected: "a string with at most 240 code points" })).check(Schema$1.isMaxLength(240).annotate({ expected: "a value with a length of at most 240" }))
|
|
798
|
+
}), Schema$1.Null]),
|
|
799
|
+
createdAt: Schema$1.String,
|
|
800
|
+
updatedAt: Schema$1.String,
|
|
801
|
+
startedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
802
|
+
completedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
|
|
803
|
+
}).annotate({ identifier: "Operation" });
|
|
804
|
+
const OperationResourceLink = /* @__PURE__ */ Schema$1.Struct({
|
|
805
|
+
resource: OperationResource,
|
|
806
|
+
href: Schema$1.String.check(Schema$1.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/", "u")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })).check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" }))
|
|
807
|
+
}).annotate({ identifier: "OperationResourceLink" });
|
|
808
|
+
const UpdateTemplatePayload = /* @__PURE__ */ Schema$1.Struct({ data: Schema$1.Struct({
|
|
809
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
810
|
+
slug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
|
|
811
|
+
entryPath: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(1024).annotate({ expected: "a string with at most 1024 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?!\\/)(?!.*\\\\)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))(?!.*(?:^|\\/)\\.git(?:\\/|$))(?:templates|emails)\\/.+\\.tsx$", "u")).annotate({ expected: "a string matching the RegExp ^(?!\\/)(?!.*\\\\)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))(?!.*(?:^|\\/)\\.git(?:\\/|$))(?:templates|emails)\\/.+\\.tsx$" })).check(Schema$1.isMaxLength(1024).annotate({ expected: "a value with a length of at most 1024" })), Schema$1.Null])),
|
|
812
|
+
description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
|
|
813
|
+
category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Union([
|
|
814
|
+
Schema$1.Literal("transactional"),
|
|
815
|
+
Schema$1.Literal("marketing"),
|
|
816
|
+
Schema$1.Literal("support"),
|
|
817
|
+
Schema$1.Literal("notification"),
|
|
818
|
+
Schema$1.Literal("verification"),
|
|
819
|
+
Schema$1.Literal("reminder"),
|
|
820
|
+
Schema$1.Literal("alert")
|
|
821
|
+
]), Schema$1.Null]), Schema$1.Null])),
|
|
822
|
+
fromDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateFromDefault, Schema$1.Null]), Schema$1.Null])),
|
|
823
|
+
replyToDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null])),
|
|
824
|
+
isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null]))
|
|
825
|
+
}) }).annotate({ identifier: "UpdateTemplatePayload" });
|
|
826
|
+
const ApiKeyAccess = /* @__PURE__ */ Schema$1.Union([Schema$1.Struct({ mode: Schema$1.Literal("full") }), Schema$1.Struct({
|
|
827
|
+
mode: Schema$1.Literal("restricted"),
|
|
828
|
+
resources: ApiKeyResourceAccess,
|
|
829
|
+
mailboxes: Schema$1.optionalKey(Schema$1.Union([ApiKeyMailboxAccess, Schema$1.Null])),
|
|
830
|
+
namespaceId: Schema$1.optionalKey(Schema$1.Union([NamespaceId, Schema$1.Null]).annotate({ description: "Confines the key to one namespace: it reaches only that namespace's mailboxes. A key scoped to a namespace or to listed mailboxes holds mailbox access only." }))
|
|
831
|
+
})]).annotate({ identifier: "ApiKeyAccess" });
|
|
832
|
+
const MessagePage = /* @__PURE__ */ Schema$1.Struct({
|
|
833
|
+
items: Schema$1.Array(MessageSummary),
|
|
834
|
+
nextCursor: Schema$1.Union([Schema$1.String, Schema$1.Null])
|
|
835
|
+
}).annotate({ identifier: "MessagePage" });
|
|
836
|
+
const CreateBrand = /* @__PURE__ */ Schema$1.Struct({
|
|
837
|
+
slug: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })),
|
|
838
|
+
name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema$1.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })),
|
|
839
|
+
css: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema$1.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema$1.Null])),
|
|
840
|
+
assets: Schema$1.optionalKey(Schema$1.Union([BrandAssets, Schema$1.Null])),
|
|
841
|
+
footer: Schema$1.optionalKey(Schema$1.Union([BrandFooter, Schema$1.Null])),
|
|
842
|
+
isDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null]))
|
|
843
|
+
}).annotate({ identifier: "CreateBrand" });
|
|
844
|
+
const UpdateBrand = /* @__PURE__ */ Schema$1.Struct({
|
|
845
|
+
newSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.annotate({ description: "Renames the brand. Projects importing `samva:brand/<old slug>` stop building until they import the new slug." }).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })), Schema$1.Null])),
|
|
846
|
+
name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema$1.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })), Schema$1.Null])),
|
|
847
|
+
css: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema$1.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema$1.Null])),
|
|
848
|
+
assets: Schema$1.optionalKey(Schema$1.Union([BrandAssets, Schema$1.Null])),
|
|
849
|
+
footer: Schema$1.optionalKey(Schema$1.Union([BrandFooter, Schema$1.Null]))
|
|
850
|
+
}).annotate({ identifier: "UpdateBrand" });
|
|
851
|
+
const EmailAttachments = /* @__PURE__ */ Schema$1.Union([Schema$1.Array(EmailAttachment).check(Schema$1.isMaxLength(10).annotate({ expected: "a value with a length of at most 10" })), Schema$1.Null]).annotate({ identifier: "EmailAttachments" });
|
|
852
|
+
const CreateEventPayload = /* @__PURE__ */ Schema$1.Struct({
|
|
853
|
+
contact: ContactEventReference,
|
|
854
|
+
name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$")).annotate({ expected: "a string matching the RegExp ^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$" })),
|
|
855
|
+
properties: Schema$1.optionalKey(Schema$1.Union([JsonObject, Schema$1.Null])),
|
|
856
|
+
occurredAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
857
|
+
idempotencyKey: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })), Schema$1.Null]))
|
|
858
|
+
}).annotate({ identifier: "CreateEventPayload" });
|
|
859
|
+
const EmailRecipients = /* @__PURE__ */ Schema$1.Array(EmailRecipient).check(Schema$1.isMinLength(1).annotate({
|
|
860
|
+
expected: "a value with a length of at least 1",
|
|
861
|
+
identifier: "EmailRecipients"
|
|
862
|
+
}));
|
|
863
|
+
const EmailCcRecipients = /* @__PURE__ */ Schema$1.Union([Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "EmailCcRecipients" });
|
|
864
|
+
const EmailBccRecipients = /* @__PURE__ */ Schema$1.Union([Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "EmailBccRecipients" });
|
|
865
|
+
const JourneyTrigger = /* @__PURE__ */ Schema$1.Union([
|
|
866
|
+
JourneyCustomEventTrigger,
|
|
867
|
+
JourneyContactCreatedTrigger,
|
|
868
|
+
JourneyTagAddedTrigger,
|
|
869
|
+
JourneyGroupJoinedTrigger
|
|
870
|
+
]).annotate({ identifier: "JourneyTrigger" });
|
|
871
|
+
const JourneyWaitForEventConfig = /* @__PURE__ */ Schema$1.Struct({
|
|
872
|
+
eventName: JourneyEventName,
|
|
873
|
+
timeoutSeconds: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(7776e3).annotate({ expected: "a value less than or equal to 7776000" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
|
|
874
|
+
}).annotate({ identifier: "JourneyWaitForEventConfig" });
|
|
875
|
+
const JourneyEventPredicate = /* @__PURE__ */ Schema$1.Struct({
|
|
876
|
+
type: Schema$1.Literal("event"),
|
|
877
|
+
eventName: JourneyEventName,
|
|
878
|
+
occurred: Schema$1.Boolean
|
|
879
|
+
}).annotate({ identifier: "JourneyEventPredicate" });
|
|
880
|
+
const JourneyGoal = /* @__PURE__ */ Schema$1.Struct({ eventName: JourneyEventName }).annotate({ identifier: "JourneyGoal" });
|
|
881
|
+
const JourneySendEmailNode = /* @__PURE__ */ Schema$1.Struct({
|
|
882
|
+
type: Schema$1.Literal("send_email"),
|
|
883
|
+
config: JourneySendEmailConfig,
|
|
884
|
+
next: Schema$1.Tuple([JourneyNextEdge])
|
|
885
|
+
}).annotate({ identifier: "JourneySendEmailNode" });
|
|
886
|
+
const JourneyWaitNode = /* @__PURE__ */ Schema$1.Struct({
|
|
887
|
+
type: Schema$1.Literal("wait"),
|
|
888
|
+
config: JourneyWaitConfig,
|
|
889
|
+
next: Schema$1.Tuple([JourneyNextEdge])
|
|
890
|
+
}).annotate({ identifier: "JourneyWaitNode" });
|
|
891
|
+
const JourneyUpdateTagsNode = /* @__PURE__ */ Schema$1.Struct({
|
|
892
|
+
type: Schema$1.Literal("update_tags"),
|
|
893
|
+
config: JourneyUpdateTagsConfig,
|
|
894
|
+
next: Schema$1.Tuple([JourneyNextEdge])
|
|
895
|
+
}).annotate({ identifier: "JourneyUpdateTagsNode" });
|
|
896
|
+
const JourneyWebhookNode = /* @__PURE__ */ Schema$1.Struct({
|
|
897
|
+
type: Schema$1.Literal("webhook"),
|
|
898
|
+
config: JourneyWebhookConfig,
|
|
899
|
+
next: Schema$1.Tuple([JourneyNextEdge])
|
|
900
|
+
}).annotate({ identifier: "JourneyWebhookNode" });
|
|
901
|
+
const JourneyPropertyPredicate = /* @__PURE__ */ Schema$1.Struct({
|
|
902
|
+
type: Schema$1.Literal("property"),
|
|
903
|
+
field: JourneyContactProperty,
|
|
904
|
+
comparison: JourneyComparison
|
|
905
|
+
}).annotate({ identifier: "JourneyPropertyPredicate" });
|
|
906
|
+
const JourneyCustomFieldPredicate = /* @__PURE__ */ Schema$1.Struct({
|
|
907
|
+
type: Schema$1.Literal("custom_field"),
|
|
908
|
+
key: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
|
|
909
|
+
comparison: JourneyComparison
|
|
910
|
+
}).annotate({ identifier: "JourneyCustomFieldPredicate" });
|
|
911
|
+
const MailboxSendReceipt = /* @__PURE__ */ Schema$1.Struct({
|
|
912
|
+
actionId: MailboxActionId,
|
|
913
|
+
draftId: Schema$1.Union([MailboxDraftId, Schema$1.Null]),
|
|
914
|
+
messageId: Schema$1.Union([MessageId, Schema$1.Null]),
|
|
915
|
+
threadId: Schema$1.Union([MailboxThreadId, Schema$1.Null]),
|
|
916
|
+
state: Schema$1.Union([
|
|
917
|
+
Schema$1.Literal("approvalRequired"),
|
|
918
|
+
Schema$1.Literal("queued"),
|
|
919
|
+
Schema$1.Literal("accepted"),
|
|
920
|
+
Schema$1.Literal("completed"),
|
|
921
|
+
Schema$1.Literal("notSent"),
|
|
922
|
+
Schema$1.Literal("uncertain")
|
|
923
|
+
]),
|
|
924
|
+
acceptedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
925
|
+
waitReason: Schema$1.Union([Schema$1.Union([
|
|
926
|
+
Schema$1.Literal("rate"),
|
|
927
|
+
Schema$1.Literal("daily-quota"),
|
|
928
|
+
Schema$1.Literal("domain-health"),
|
|
929
|
+
Schema$1.Literal("sending-paused"),
|
|
930
|
+
Schema$1.Literal("upstream-unavailable"),
|
|
931
|
+
Schema$1.Literal("retry"),
|
|
932
|
+
Schema$1.Literal("campaign-paused"),
|
|
933
|
+
Schema$1.Literal("domain-warming"),
|
|
934
|
+
Schema$1.Literal("onboarding-review"),
|
|
935
|
+
Schema$1.Literal("content-review"),
|
|
936
|
+
Schema$1.Literal("screening-unavailable")
|
|
937
|
+
]), Schema$1.Null]),
|
|
938
|
+
reviewExpectedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
939
|
+
skippedRecipients: Schema$1.Array(SkippedRecipient),
|
|
940
|
+
executeUntil: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
941
|
+
retryAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
|
|
942
|
+
problem: Schema$1.Union([MailboxSendOutcome, Schema$1.Null]),
|
|
943
|
+
retryEligible: Schema$1.Boolean,
|
|
944
|
+
decision: Schema$1.Union([MailboxActionDecision, Schema$1.Null]),
|
|
945
|
+
createdAt: Schema$1.String,
|
|
946
|
+
updatedAt: Schema$1.String
|
|
947
|
+
}).annotate({ identifier: "MailboxSendReceipt" });
|
|
948
|
+
const OperationAccepted = /* @__PURE__ */ Schema$1.Struct({
|
|
949
|
+
operation: Operation,
|
|
950
|
+
links: Schema$1.Struct({
|
|
951
|
+
self: Schema$1.String.check(Schema$1.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/", "u")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })).check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })),
|
|
952
|
+
resource: OperationResourceLink
|
|
953
|
+
})
|
|
954
|
+
}).annotate({ identifier: "OperationAccepted" });
|
|
955
|
+
const EmailContent = /* @__PURE__ */ Schema$1.Struct({
|
|
956
|
+
subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
957
|
+
html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
958
|
+
text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
959
|
+
attachments: Schema$1.optionalKey(EmailAttachments),
|
|
960
|
+
publicationId: Schema$1.optionalKey(TemplatePublicationId),
|
|
961
|
+
inputContractId: Schema$1.optionalKey(TemplateInputContractId),
|
|
962
|
+
templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
|
|
963
|
+
templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
|
|
964
|
+
templateData: Schema$1.optionalKey(TemplateData),
|
|
965
|
+
locale: Schema$1.optionalKey(RenderLocale),
|
|
966
|
+
timeZone: Schema$1.optionalKey(RenderTimeZone),
|
|
967
|
+
inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
|
|
968
|
+
replyTo: Schema$1.optionalKey(ReplyToAddresses),
|
|
969
|
+
unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([UnsubscribeId, Schema$1.Null]), Schema$1.Null]).annotate({ description: "The unsubscribe group for this send. Omit to inherit the template group; null disables group inheritance for a direct send. Campaigns require a group." })),
|
|
970
|
+
tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
|
|
971
|
+
footer: Schema$1.optionalKey(EmailFooterOverride)
|
|
972
|
+
}).annotate({ identifier: "EmailContent" });
|
|
973
|
+
const EmailDispatchContent = /* @__PURE__ */ Schema$1.Struct({
|
|
974
|
+
subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
975
|
+
html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
976
|
+
text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
|
|
977
|
+
attachments: Schema$1.optionalKey(EmailAttachments),
|
|
978
|
+
publicationId: Schema$1.optionalKey(TemplatePublicationId),
|
|
979
|
+
inputContractId: Schema$1.optionalKey(TemplateInputContractId),
|
|
980
|
+
templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
|
|
981
|
+
templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
|
|
982
|
+
templateData: Schema$1.optionalKey(TemplateData),
|
|
983
|
+
locale: Schema$1.optionalKey(RenderLocale),
|
|
984
|
+
timeZone: Schema$1.optionalKey(RenderTimeZone),
|
|
985
|
+
inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
|
|
986
|
+
replyTo: Schema$1.optionalKey(ReplyToAddresses),
|
|
987
|
+
unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([UnsubscribeId, Schema$1.Null]), Schema$1.Null]).annotate({ description: "The unsubscribe group for this send. Omit to inherit the template group; null disables group inheritance for a direct send. Campaigns require a group." })),
|
|
988
|
+
tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
|
|
989
|
+
footer: Schema$1.optionalKey(EmailFooterOverride)
|
|
990
|
+
}).annotate({ identifier: "EmailDispatchContent" });
|
|
991
|
+
const JourneyWaitForEventNode = /* @__PURE__ */ Schema$1.Struct({
|
|
992
|
+
type: Schema$1.Literal("wait_for_event"),
|
|
993
|
+
config: JourneyWaitForEventConfig,
|
|
994
|
+
next: Schema$1.Tuple([JourneyWaitEventEdge, JourneyWaitEventEdge])
|
|
995
|
+
}).annotate({ identifier: "JourneyWaitForEventNode" });
|
|
996
|
+
const JourneyPredicate = /* @__PURE__ */ Schema$1.Union([
|
|
997
|
+
JourneyTagPredicate,
|
|
998
|
+
JourneyPropertyPredicate,
|
|
999
|
+
JourneyCustomFieldPredicate,
|
|
1000
|
+
JourneyEventPredicate
|
|
1001
|
+
]).annotate({ identifier: "JourneyPredicate" });
|
|
1002
|
+
var MailboxSendRefusedError = class extends Schema$1.TaggedError()("MailboxSendRefusedError", Schema$1.Struct({
|
|
1003
|
+
message: Schema$1.String,
|
|
1004
|
+
receipt: MailboxSendReceipt
|
|
1005
|
+
})) {};
|
|
1006
|
+
var MailboxSendConflictError = class extends Schema$1.TaggedError()("MailboxSendConflictError", Schema$1.Struct({
|
|
1007
|
+
message: Schema$1.String,
|
|
1008
|
+
resource: Schema$1.String,
|
|
1009
|
+
id: MailboxActionId,
|
|
1010
|
+
receipt: MailboxSendReceipt
|
|
1011
|
+
})) {};
|
|
1012
|
+
const JourneyCondition = /* @__PURE__ */ Schema$1.Struct({
|
|
1013
|
+
match: Schema$1.Union([Schema$1.Literal("all"), Schema$1.Literal("any")]),
|
|
1014
|
+
predicates: Schema$1.TupleWithRest(Schema$1.Tuple([JourneyPredicate]), [JourneyPredicate])
|
|
1015
|
+
}).annotate({ identifier: "JourneyCondition" });
|
|
1016
|
+
const JourneyBranchEdge = /* @__PURE__ */ Schema$1.Struct({
|
|
1017
|
+
nodeId: JourneyNodeId,
|
|
1018
|
+
condition: Schema$1.optionalKey(JourneyCondition)
|
|
1019
|
+
}).annotate({ identifier: "JourneyBranchEdge" });
|
|
1020
|
+
const JourneyBranchNode = /* @__PURE__ */ Schema$1.Struct({
|
|
1021
|
+
type: Schema$1.Literal("branch"),
|
|
1022
|
+
config: JourneyEmptyConfig,
|
|
1023
|
+
next: Schema$1.Array(JourneyBranchEdge).check(Schema$1.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }))
|
|
1024
|
+
}).annotate({ identifier: "JourneyBranchNode" });
|
|
1025
|
+
const JourneyNode = /* @__PURE__ */ Schema$1.Union([
|
|
1026
|
+
JourneySendEmailNode,
|
|
1027
|
+
JourneyWaitNode,
|
|
1028
|
+
JourneyWaitForEventNode,
|
|
1029
|
+
JourneyBranchNode,
|
|
1030
|
+
JourneyUpdateTagsNode,
|
|
1031
|
+
JourneyWebhookNode,
|
|
1032
|
+
JourneyExitNode
|
|
1033
|
+
]).annotate({ identifier: "JourneyNode" });
|
|
1034
|
+
const JourneyDefinition = /* @__PURE__ */ Schema$1.Struct({
|
|
1035
|
+
trigger: JourneyTrigger,
|
|
1036
|
+
rootNodeId: JourneyNodeId,
|
|
1037
|
+
nodes: Schema$1.Record(Schema$1.String, JourneyNode).check(Schema$1.isMinProperties(1).annotate({ expected: "a value with at least 1 entry" })).check(Schema$1.isMaxProperties(200).annotate({ expected: "a value with at most 200 entries" })),
|
|
1038
|
+
goal: Schema$1.optionalKey(JourneyGoal),
|
|
1039
|
+
reentry: Schema$1.optionalKey(Schema$1.Boolean)
|
|
1040
|
+
}).annotate({ identifier: "JourneyDefinition" });
|
|
1041
|
+
const __recursive_JsonValue = Schema$1.Union([
|
|
1042
|
+
Schema$1.String,
|
|
1043
|
+
Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
|
|
1044
|
+
Schema$1.Boolean,
|
|
1045
|
+
Schema$1.Null,
|
|
1046
|
+
Schema$1.Array(Schema$1.suspend(() => JsonValue)),
|
|
1047
|
+
Schema$1.Record(Schema$1.String, Schema$1.suspend(() => JsonValue))
|
|
1048
|
+
]).annotate({ identifier: "JsonValue" });
|
|
1049
|
+
const ApiKeySecurity = HttpApiSecurity.apiKey({
|
|
1050
|
+
key: "x-api-key",
|
|
1051
|
+
in: "header"
|
|
1052
|
+
});
|
|
1053
|
+
var ApiKeySecurityMiddleware = class extends HttpApiMiddleware.Service()("apiKey security", { security: { apiKey: ApiKeySecurity } }) {};
|
|
1054
|
+
//#endregion
|
|
1055
|
+
//#region src/effect/internal/client.ts
|
|
1056
|
+
const DEFAULT_BASE_URL = "https://api.samva.dev";
|
|
1057
|
+
var Service = class extends Context.Service()("samva/Client") {};
|
|
1058
|
+
const authHeaders = (config) => config.authToken !== void 0 ? { Authorization: `Bearer ${config.authToken}` } : { "x-api-key": Redacted.isRedacted(config.apiKey) ? Redacted.value(config.apiKey) : config.apiKey };
|
|
1059
|
+
const AuthorizationClient = HttpApiMiddleware.layerClient(ApiKeySecurityMiddleware, ({ next, request }) => next(request));
|
|
1060
|
+
const make = (config) => Effect.gen(function* () {
|
|
1061
|
+
const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
1062
|
+
const removesAttribution = Object.entries(config.headers ?? {}).some(([name, value]) => name.toLowerCase() === "x-samva-client" && value === void 0);
|
|
1063
|
+
const storage = yield* HttpClient.HttpClient;
|
|
1064
|
+
const httpClient = storage.pipe(HttpClient.mapRequest((request) => {
|
|
1065
|
+
let attributed = HttpClientRequest.setHeader(request, CLIENT_ATTRIBUTION_HEADER, clientAttribution("typescript-effect"));
|
|
1066
|
+
if (config.headers !== void 0) attributed = HttpClientRequest.setHeaders(attributed, config.headers);
|
|
1067
|
+
if (removesAttribution) attributed = HttpClientRequest.removeHeader(attributed, CLIENT_ATTRIBUTION_HEADER);
|
|
1068
|
+
return HttpClientRequest.setHeaders(attributed, authHeaders(config));
|
|
1069
|
+
}));
|
|
1070
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1071
|
+
const groupClient = (group) => {
|
|
1072
|
+
const built = groups.get(group.identifier);
|
|
1073
|
+
if (built !== void 0) return Effect.succeed(built);
|
|
1074
|
+
return HttpApiClient.group(HttpApi.make("SamvaApi").add(group), {
|
|
1075
|
+
group: group.identifier,
|
|
1076
|
+
httpClient,
|
|
1077
|
+
baseUrl
|
|
1078
|
+
}).pipe(Effect.provide(AuthorizationClient), Effect.map((client) => {
|
|
1079
|
+
const calls = client;
|
|
1080
|
+
groups.set(group.identifier, calls);
|
|
1081
|
+
return calls;
|
|
1082
|
+
}));
|
|
1083
|
+
};
|
|
1084
|
+
const headers = removesAttribution ? {} : { [CLIENT_ATTRIBUTION_HEADER]: clientAttribution("typescript-effect") };
|
|
1085
|
+
for (const [name, value] of Object.entries(config.headers ?? {})) if (value !== void 0) headers[name] = value;
|
|
1086
|
+
const putUpload = (input) => storage.execute(HttpClientRequest.make(input.method)(input.url).pipe(HttpClientRequest.bodyUint8Array(input.bytes, uploadContentType(input.headers)), HttpClientRequest.setHeaders(input.headers))).pipe(Effect.mapError((cause) => new MediaUploadError({
|
|
1087
|
+
filename: input.filename,
|
|
1088
|
+
mediaId: input.mediaId,
|
|
1089
|
+
cause
|
|
1090
|
+
})), Effect.flatMap((response) => response.status >= 200 && response.status < 300 ? Effect.void : Effect.fail(new MediaUploadError({
|
|
1091
|
+
filename: input.filename,
|
|
1092
|
+
mediaId: input.mediaId,
|
|
1093
|
+
status: response.status
|
|
1094
|
+
}))));
|
|
1095
|
+
return Service.of({
|
|
1096
|
+
putUpload,
|
|
1097
|
+
endpoint: (group, name) => Effect.flatMap(groupClient(group), (client) => {
|
|
1098
|
+
const call = client[name];
|
|
1099
|
+
return call === void 0 ? Effect.die(/* @__PURE__ */ new Error(`${name} is not an endpoint of ${group.identifier}`)) : Effect.succeed(call);
|
|
1100
|
+
}),
|
|
1101
|
+
connection: {
|
|
1102
|
+
baseUrl,
|
|
1103
|
+
headers: {
|
|
1104
|
+
...headers,
|
|
1105
|
+
...authHeaders(config)
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
});
|
|
1110
|
+
const layer = (config) => Layer.effect(Service, make(config));
|
|
1111
|
+
const layerFetch = (config) => layer(config).pipe(Layer.provide(FetchHttpClient.layer));
|
|
1112
|
+
//#endregion
|
|
1113
|
+
export { JsonObject as $, UserId as $t, EmailBccRecipients as A, OperationAccepted as At, ExtensionId as B, SendsSeries as Bt, CreateEventPayload as C, MessageId as Ct, Cursor as D, NamespaceMetadata as Dt, CreateWebhookPayload as E, NamespaceId as Et, EmailDomainId as F, RenderLocale as Ft, FlagDisabledError as G, TemplateInputContractId as Gt, ExtensionVersionRef as H, SuccessResponse as Ht, EmailRecipients as I, RenderTimeZone as It, IanaTimezone as J, UnauthorizedError as Jt, ForbiddenError as K, TemplatePublicationId as Kt, EmailSender as L, ResourceNotFoundError as Lt, EmailChannelError as M, OrganizationId as Mt, EmailContent as N, PaymentRequiredError as Nt, DeliveryUnavailableError as O, OnboardingReviewRequiredError as Ot, EmailDispatchContent as P, RateLimitedError as Pt, JourneyNodeId as Q, UpdateWebhookPayload as Qt, EmailSenderId as R, SendFeedback as Rt, CreateBrand as S, MediaId as St, CreateTemplatePayload as T, MessagePage as Tt, ExternalServiceError as U, TemplateFromDefault as Ut, ExtensionVersionId as V, SkippedRecipient as Vt, FeedbackContext as W, TemplateId as Wt, JourneyDefinition as X, UpdateBrand as Xt, InternalError as Y, UnsubscribeId as Yt, JourneyName as Z, UpdateTemplatePayload as Zt, ContactGroupId as _, MailboxSendReceipt as _t, ApiKeyAccess as a, MailboxDraftId as at, ContactIdentityId as b, MailboxThreadId as bt, AttachmentId as c, MailboxId as ct, BrandAssets as d, MailboxMetadataPatch as dt, ValidationError as en, JsonValue as et, BrandFooter as f, MailboxPolicyId as ft, ContactEventReference as g, MailboxSendOutcome as gt, ContactEvent as h, MailboxSendMode as ht, AnalyticsQueryError as i, MailboxChannelUnsupportedError as it, EmailCcRecipients as j, OperationId as jt, EmailAttachment as k, Operation as kt, BillingProviderError as l, MailboxLabelId as lt, ConflictError as m, MailboxSendConflictError as mt, layer as n, MailboxActionId as nt, ApiKeyId as o, MailboxEndpointId as ot, CampaignFooterRequiredError as p, MailboxPolicyOutcomeKind as pt, GatewayTimeoutError as q, TestWebhookPayload as qt, layerFetch as r, MailboxChannel as rt, ApiKeySecurityMiddleware as s, MailboxGrantRole as st, Service as t, WebhookEndpointId as tn, MailboxActionDecision as tt, BrandAddressRequiredError as u, MailboxMetadata as ut, ContactId as v, MailboxSendRefusedError as vt, CreateMailboxEndpointPayload as w, MessageMetadata as wt, ConversationId as x, MailboxThreadPriority as xt, ContactIdentity as y, MailboxThreadFolder as yt, EmailTrackingOverrideV1 as z, SenderNotReadyError as zt };
|
|
1114
|
+
|
|
1115
|
+
//# sourceMappingURL=client-DOzUrdTE.js.map
|