samva 0.16.0 → 0.18.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 +9 -1
- package/README.md +57 -1
- package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
- package/dist/client/client/client.gen.js +174 -0
- package/dist/client/client/utils.gen.js +177 -0
- package/dist/client/client.gen.js +8 -0
- package/dist/client/core/auth.gen.js +12 -0
- package/dist/client/core/bodySerializer.gen.js +6 -0
- package/dist/client/core/params.gen.js +77 -0
- package/dist/client/core/pathSerializer.gen.js +82 -0
- package/dist/client/core/serverSentEvents.gen.js +96 -0
- package/dist/client/core/utils.gen.js +78 -0
- package/dist/client/sdk.gen.d.ts +174 -3
- package/dist/{promises-KrA2nSLg.js → client/sdk.gen.js} +464 -2289
- package/dist/client/types.gen.d.ts +1126 -11
- package/dist/client-attribution.js +9 -0
- package/dist/effect/analytics.d.ts +6 -6
- package/dist/effect/analytics.js +11 -9
- package/dist/effect/api-keys.d.ts +13 -13
- package/dist/effect/api-keys.js +13 -12
- package/dist/effect/attachments.d.ts +4 -4
- package/dist/effect/attachments.js +9 -7
- package/dist/effect/brands.d.ts +7 -7
- package/dist/effect/brands.js +12 -10
- package/dist/effect/campaigns.d.ts +18 -18
- package/dist/effect/campaigns.js +17 -15
- package/dist/effect/categories.d.ts +2 -2
- package/dist/effect/categories.js +95 -1
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/client.js +4 -5
- package/dist/effect/contact-groups.d.ts +14 -14
- package/dist/effect/contact-groups.js +15 -13
- package/dist/effect/contacts.d.ts +77 -25
- package/dist/effect/contacts.js +27 -22
- package/dist/effect/conversations.d.ts +17 -17
- package/dist/effect/conversations.js +18 -16
- package/dist/effect/custom-fields.d.ts +4 -4
- package/dist/effect/custom-fields.js +9 -7
- package/dist/effect/email.d.ts +78 -77
- package/dist/effect/email.js +68 -65
- package/dist/effect/errors.d.ts +2 -0
- package/dist/effect/errors.js +3 -0
- package/dist/effect/events.d.ts +121 -0
- package/dist/effect/events.js +17 -0
- package/dist/effect/extension-installations.d.ts +11 -11
- package/dist/effect/extension-installations.js +14 -12
- package/dist/effect/extensions.d.ts +9 -9
- package/dist/effect/extensions.js +10 -8
- package/dist/effect/feedback.d.ts +2 -2
- package/dist/effect/feedback.js +6 -5
- package/dist/effect/generated/analytics.d.ts +715 -0
- package/dist/effect/generated/analytics.js +188 -0
- package/dist/effect/generated/api-keys.d.ts +1627 -0
- package/dist/effect/generated/api-keys.js +249 -0
- package/dist/effect/generated/attachments.d.ts +554 -0
- package/dist/effect/generated/attachments.js +125 -0
- package/dist/effect/generated/brands.d.ts +1118 -0
- package/dist/effect/generated/brands.js +155 -0
- package/dist/effect/generated/campaigns.d.ts +3783 -0
- package/dist/effect/generated/campaigns.js +491 -0
- package/dist/effect/generated/contact-events.d.ts +158 -0
- package/dist/effect/generated/contact-events.js +37 -0
- package/dist/effect/generated/contact-groups.d.ts +1445 -0
- package/dist/effect/generated/contact-groups.js +419 -0
- package/dist/effect/generated/contacts.d.ts +3789 -0
- package/dist/effect/generated/contacts.js +709 -0
- package/dist/effect/generated/conversations.d.ts +2870 -0
- package/dist/effect/generated/conversations.js +461 -0
- package/dist/effect/generated/custom-fields.d.ts +562 -0
- package/dist/effect/generated/custom-fields.js +162 -0
- package/dist/effect/generated/email.d.ts +10622 -0
- package/dist/effect/generated/email.js +2347 -0
- package/dist/effect/generated/events.d.ts +463 -0
- package/dist/effect/generated/events.js +70 -0
- package/dist/effect/generated/extension-installations.d.ts +1786 -0
- package/dist/effect/generated/extension-installations.js +382 -0
- package/dist/effect/generated/extensions.d.ts +927 -0
- package/dist/effect/generated/extensions.js +203 -0
- package/dist/effect/generated/feedback.d.ts +116 -0
- package/dist/effect/generated/feedback.js +43 -0
- package/dist/effect/generated/index.d.ts +61 -0
- package/dist/effect/generated/journeys.d.ts +6135 -0
- package/dist/effect/generated/journeys.js +464 -0
- package/dist/effect/generated/mailboxes.d.ts +13641 -0
- package/dist/effect/generated/mailboxes.js +2312 -0
- package/dist/effect/generated/media.d.ts +741 -0
- package/dist/effect/generated/media.js +181 -0
- package/dist/effect/generated/messages.d.ts +2355 -0
- package/dist/effect/generated/messages.js +671 -0
- package/dist/effect/generated/namespaces.d.ts +654 -0
- package/dist/effect/generated/namespaces.js +135 -0
- package/dist/effect/generated/operations.d.ts +514 -0
- package/dist/effect/generated/operations.js +80 -0
- package/dist/effect/generated/organizations.d.ts +1111 -0
- package/dist/effect/generated/organizations.js +231 -0
- package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
- package/dist/effect/generated/scheduled-messages.js +190 -0
- package/dist/effect/generated/shared.d.ts +3250 -0
- package/dist/effect/generated/shared.js +1053 -0
- package/dist/effect/generated/subscriptions.d.ts +188 -0
- package/dist/effect/generated/subscriptions.js +61 -0
- package/dist/effect/generated/templates.d.ts +8177 -0
- package/dist/effect/generated/templates.js +2214 -0
- package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
- package/dist/effect/generated/unsubscribe-groups.js +267 -0
- package/dist/effect/generated/webhooks.d.ts +1697 -0
- package/dist/effect/generated/webhooks.js +500 -0
- package/dist/effect/generated/whoami.d.ts +291 -0
- package/dist/effect/generated/whoami.js +54 -0
- package/dist/effect/generated-metadata.d.ts +1627 -0
- package/dist/effect/generated-metadata.js +919 -0
- package/dist/effect/index.d.ts +3 -2
- package/dist/effect/index.js +33 -31
- package/dist/effect/internal/client.d.ts +10 -7
- package/dist/effect/internal/client.js +69 -0
- package/dist/effect/internal/email-sender.d.ts +17 -0
- package/dist/effect/internal/email-sender.js +21 -0
- package/dist/effect/internal/mailbox-events.js +33 -0
- package/dist/effect/internal/operation.d.ts +12 -72
- package/dist/effect/internal/operation.js +116 -0
- package/dist/effect/internal/send.d.ts +60 -0
- package/dist/effect/internal/send.js +56 -0
- package/dist/effect/journeys.d.ts +2153 -0
- package/dist/effect/journeys.js +39 -0
- package/dist/effect/mailboxes.d.ts +80 -80
- package/dist/effect/mailboxes.js +135 -3
- package/dist/effect/media.d.ts +5 -5
- package/dist/effect/media.js +10 -8
- package/dist/effect/messages.d.ts +16 -16
- package/dist/effect/messages.js +15 -12
- package/dist/effect/namespaces.d.ts +7 -7
- package/dist/effect/namespaces.js +10 -8
- package/dist/effect/operations.d.ts +5 -5
- package/dist/effect/operations.js +8 -6
- package/dist/effect/organizations.d.ts +7 -7
- package/dist/effect/organizations.js +12 -10
- package/dist/effect/pagination.js +39 -0
- package/dist/effect/retry.js +3 -3
- package/dist/effect/runtime.js +25 -0
- package/dist/effect/scheduled-messages.d.ts +7 -7
- package/dist/effect/scheduled-messages.js +10 -8
- package/dist/effect/subscriptions.d.ts +1 -1
- package/dist/effect/subscriptions.js +5 -4
- package/dist/effect/templates.d.ts +40 -40
- package/dist/effect/templates.js +39 -37
- package/dist/effect/unsubscribe-groups.d.ts +11 -11
- package/dist/effect/unsubscribe-groups.js +14 -12
- package/dist/effect/webhooks.d.ts +23 -23
- package/dist/effect/webhooks.js +16 -14
- package/dist/effect/whoami.d.ts +1 -1
- package/dist/effect/whoami.js +5 -4
- package/dist/index.js +4 -3
- package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments.js} +13 -7
- package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +2 -2
- package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
- package/dist/package.js +6 -0
- package/dist/promises/errors.gen.js +1340 -0
- package/dist/promises/index.d.ts +7 -3
- package/dist/promises/index.js +288 -3
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +85 -0
- package/dist/{operation-BTXjPrwf.js → service-map.js} +58 -219
- package/package.json +17 -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,491 @@
|
|
|
1
|
+
import { AbsoluteInstant } from "../runtime.js";
|
|
2
|
+
import { ApiKeySecurityMiddleware, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, ContactGroupId, ContactId, ConversationId, Cursor, EmailContent, EmailDispatchContent, EmailDomainId, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, ResourceNotFoundError, SenderNotReadyError, SendsSeries, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared.js";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
//#region src/effect/generated/campaigns.ts
|
|
6
|
+
const CampaignId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
7
|
+
expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
8
|
+
identifier: "CampaignId"
|
|
9
|
+
})).pipe(Schema.brand("CampaignId"));
|
|
10
|
+
const CampaignContentMetadata = /* @__PURE__ */ Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]).annotate({ identifier: "CampaignContentMetadata" });
|
|
11
|
+
const CampaignDefinitionSummary = /* @__PURE__ */ Schema.Struct({
|
|
12
|
+
state: Schema.Union([
|
|
13
|
+
Schema.Literal("editable"),
|
|
14
|
+
Schema.Literal("frozen"),
|
|
15
|
+
Schema.Literal("archived")
|
|
16
|
+
]),
|
|
17
|
+
frozenAt: Schema.Union([Schema.String, Schema.Null])
|
|
18
|
+
}).annotate({ identifier: "CampaignDefinitionSummary" });
|
|
19
|
+
const CampaignRunId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^crun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
20
|
+
expected: "a string matching the RegExp ^crun_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
21
|
+
identifier: "CampaignRunId"
|
|
22
|
+
})).pipe(Schema.brand("CampaignRunId"));
|
|
23
|
+
const CampaignRecipientId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
|
|
24
|
+
expected: "a string matching the RegExp ^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
25
|
+
identifier: "CampaignRecipientId"
|
|
26
|
+
})).pipe(Schema.brand("CampaignRecipientId"));
|
|
27
|
+
const CampaignPolicy = /* @__PURE__ */ Schema.Struct({
|
|
28
|
+
unsubscribeGroupId: Schema.optionalKey(Schema.Union([UnsubscribeId, Schema.Null])),
|
|
29
|
+
pageSize: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema.isLessThanOrEqualTo(1e3).annotate({ expected: "a value less than or equal to 1000" })), Schema.Null]))
|
|
30
|
+
}).annotate({ identifier: "CampaignPolicy" });
|
|
31
|
+
const CampaignConversationRef = /* @__PURE__ */ Schema.Union([Schema.Union([ConversationId, Schema.Null]), Schema.Null]).annotate({ identifier: "CampaignConversationRef" });
|
|
32
|
+
const CampaignAudience = /* @__PURE__ */ Schema.Struct({
|
|
33
|
+
includeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
|
|
34
|
+
excludeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
|
|
35
|
+
contactIds: Schema.optionalKey(Schema.Union([Schema.Array(ContactId).check(Schema.isMaxLength(25e3).annotate({ expected: "a value with a length of at most 25000" })), Schema.Null])),
|
|
36
|
+
groupIds: Schema.optionalKey(Schema.Union([Schema.Array(ContactGroupId).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema.Null]))
|
|
37
|
+
}).annotate({ identifier: "CampaignAudience" });
|
|
38
|
+
const CampaignLatestRun = /* @__PURE__ */ Schema.Struct({
|
|
39
|
+
id: CampaignRunId,
|
|
40
|
+
status: Schema.Union([
|
|
41
|
+
Schema.Literal("scheduled"),
|
|
42
|
+
Schema.Literal("resolving"),
|
|
43
|
+
Schema.Literal("dispatching"),
|
|
44
|
+
Schema.Literal("paused"),
|
|
45
|
+
Schema.Literal("completed"),
|
|
46
|
+
Schema.Literal("cancelled"),
|
|
47
|
+
Schema.Literal("failed")
|
|
48
|
+
]),
|
|
49
|
+
scheduledFor: Schema.String,
|
|
50
|
+
completedAt: Schema.Union([Schema.String, Schema.Null]),
|
|
51
|
+
totalRecipients: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
52
|
+
dispatchedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
53
|
+
failedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
54
|
+
skippedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
55
|
+
estimatedCompletionAt: Schema.Union([Schema.String, Schema.Null])
|
|
56
|
+
}).annotate({ identifier: "CampaignLatestRun" });
|
|
57
|
+
const CampaignRecipientPage = /* @__PURE__ */ Schema.Struct({
|
|
58
|
+
items: Schema.Array(Schema.Struct({
|
|
59
|
+
id: CampaignRecipientId,
|
|
60
|
+
runId: CampaignRunId,
|
|
61
|
+
contactId: ContactId,
|
|
62
|
+
status: Schema.Union([
|
|
63
|
+
Schema.Literal("pending"),
|
|
64
|
+
Schema.Literal("dispatching"),
|
|
65
|
+
Schema.Literal("dispatched"),
|
|
66
|
+
Schema.Literal("failed"),
|
|
67
|
+
Schema.Literal("skipped")
|
|
68
|
+
]),
|
|
69
|
+
messageId: Schema.Union([Schema.String, Schema.Null]),
|
|
70
|
+
failureReason: Schema.Union([Schema.String, Schema.Null]),
|
|
71
|
+
skippedReason: Schema.Union([Schema.Union([
|
|
72
|
+
Schema.Literal("unsubscribed"),
|
|
73
|
+
Schema.Literal("blocked"),
|
|
74
|
+
Schema.Literal("suppressed"),
|
|
75
|
+
Schema.Literal("no_identity"),
|
|
76
|
+
Schema.Literal("inactive"),
|
|
77
|
+
Schema.Literal("run_cancelled"),
|
|
78
|
+
Schema.Literal("run_failed")
|
|
79
|
+
]), Schema.Null]),
|
|
80
|
+
createdAt: Schema.String,
|
|
81
|
+
updatedAt: Schema.String
|
|
82
|
+
})),
|
|
83
|
+
nextCursor: Schema.Union([Schema.String, Schema.Null])
|
|
84
|
+
}).annotate({ identifier: "CampaignRecipientPage" });
|
|
85
|
+
const CampaignContent = /* @__PURE__ */ Schema.Struct({
|
|
86
|
+
channel: Schema.Literal("email"),
|
|
87
|
+
email: EmailContent,
|
|
88
|
+
conversationId: Schema.optionalKey(CampaignConversationRef),
|
|
89
|
+
metadata: Schema.optionalKey(CampaignContentMetadata)
|
|
90
|
+
}).annotate({ identifier: "CampaignContent" });
|
|
91
|
+
const CampaignContentInput = /* @__PURE__ */ Schema.Struct({
|
|
92
|
+
channel: Schema.Literal("email"),
|
|
93
|
+
email: EmailDispatchContent,
|
|
94
|
+
conversationId: Schema.optionalKey(CampaignConversationRef),
|
|
95
|
+
metadata: Schema.optionalKey(CampaignContentMetadata)
|
|
96
|
+
}).annotate({ identifier: "CampaignContentInput" });
|
|
97
|
+
const CampaignListItem = /* @__PURE__ */ Schema.Struct({
|
|
98
|
+
id: CampaignId,
|
|
99
|
+
name: Schema.String,
|
|
100
|
+
channel: Schema.Literal("email"),
|
|
101
|
+
content: CampaignContent,
|
|
102
|
+
audience: CampaignAudience,
|
|
103
|
+
policy: CampaignPolicy,
|
|
104
|
+
definition: CampaignDefinitionSummary,
|
|
105
|
+
latestRun: Schema.Union([CampaignLatestRun, Schema.Null]),
|
|
106
|
+
createdBy: Schema.Union([Schema.String, Schema.Null]),
|
|
107
|
+
actorEmail: Schema.String,
|
|
108
|
+
memberRole: Schema.String,
|
|
109
|
+
createdAt: Schema.String,
|
|
110
|
+
updatedAt: Schema.String,
|
|
111
|
+
series: SendsSeries
|
|
112
|
+
}).annotate({ identifier: "CampaignListItem" });
|
|
113
|
+
const Campaign = /* @__PURE__ */ Schema.Struct({
|
|
114
|
+
id: CampaignId,
|
|
115
|
+
name: Schema.String,
|
|
116
|
+
channel: Schema.Literal("email"),
|
|
117
|
+
content: CampaignContent,
|
|
118
|
+
audience: CampaignAudience,
|
|
119
|
+
policy: CampaignPolicy,
|
|
120
|
+
definition: CampaignDefinitionSummary,
|
|
121
|
+
latestRun: Schema.Union([CampaignLatestRun, Schema.Null]),
|
|
122
|
+
createdBy: Schema.Union([Schema.String, Schema.Null]),
|
|
123
|
+
actorEmail: Schema.String,
|
|
124
|
+
memberRole: Schema.String,
|
|
125
|
+
createdAt: Schema.String,
|
|
126
|
+
updatedAt: Schema.String
|
|
127
|
+
}).annotate({ identifier: "Campaign" });
|
|
128
|
+
const CampaignRun = /* @__PURE__ */ Schema.Struct({
|
|
129
|
+
id: CampaignRunId,
|
|
130
|
+
campaignId: CampaignId,
|
|
131
|
+
status: Schema.Union([
|
|
132
|
+
Schema.Literal("scheduled"),
|
|
133
|
+
Schema.Literal("resolving"),
|
|
134
|
+
Schema.Literal("dispatching"),
|
|
135
|
+
Schema.Literal("paused"),
|
|
136
|
+
Schema.Literal("completed"),
|
|
137
|
+
Schema.Literal("cancelled"),
|
|
138
|
+
Schema.Literal("failed")
|
|
139
|
+
]),
|
|
140
|
+
scheduledFor: Schema.String,
|
|
141
|
+
idempotencyKey: Schema.Union([Schema.String, Schema.Null]),
|
|
142
|
+
startedAt: Schema.Union([Schema.String, Schema.Null]),
|
|
143
|
+
completedAt: Schema.Union([Schema.String, Schema.Null]),
|
|
144
|
+
contentSnapshot: CampaignContent,
|
|
145
|
+
audienceSnapshot: CampaignAudience,
|
|
146
|
+
policySnapshot: CampaignPolicy,
|
|
147
|
+
totalRecipients: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
148
|
+
dispatchedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
149
|
+
failedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
150
|
+
skippedCount: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
|
|
151
|
+
estimatedCompletionAt: Schema.Union([Schema.String, Schema.Null]),
|
|
152
|
+
failureReason: Schema.Union([Schema.String, Schema.Null]),
|
|
153
|
+
holdReason: Schema.Union([Schema.String, Schema.Null]),
|
|
154
|
+
holdDomainId: Schema.Union([EmailDomainId, Schema.Null]),
|
|
155
|
+
lastContactId: Schema.Union([Schema.String, Schema.Null]),
|
|
156
|
+
createdBy: Schema.Union([Schema.String, Schema.Null]),
|
|
157
|
+
actorEmail: Schema.String,
|
|
158
|
+
memberRole: Schema.String,
|
|
159
|
+
createdAt: Schema.String,
|
|
160
|
+
updatedAt: Schema.String
|
|
161
|
+
}).annotate({ identifier: "CampaignRun" });
|
|
162
|
+
const CampaignPage = /* @__PURE__ */ Schema.Struct({
|
|
163
|
+
items: Schema.Array(CampaignListItem),
|
|
164
|
+
nextCursor: Schema.Union([Schema.String, Schema.Null])
|
|
165
|
+
}).annotate({ identifier: "CampaignPage" });
|
|
166
|
+
const CampaignRunPage = /* @__PURE__ */ Schema.Struct({
|
|
167
|
+
items: Schema.Array(CampaignRun),
|
|
168
|
+
nextCursor: Schema.Union([Schema.String, Schema.Null])
|
|
169
|
+
}).annotate({ identifier: "CampaignRunPage" });
|
|
170
|
+
const CampaignRunAction = /* @__PURE__ */ Schema.Struct({
|
|
171
|
+
success: Schema.Boolean,
|
|
172
|
+
item: CampaignRun
|
|
173
|
+
}).annotate({ identifier: "CampaignRunAction" });
|
|
174
|
+
const CampaignsListQuery = /* @__PURE__ */ Schema.Struct({
|
|
175
|
+
status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("draft"), Schema.Literal("archived")]), Schema.Null])),
|
|
176
|
+
limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
177
|
+
cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
|
|
178
|
+
});
|
|
179
|
+
const CampaignsList200 = CampaignPage;
|
|
180
|
+
const CampaignsList401 = UnauthorizedError;
|
|
181
|
+
const CampaignsList403 = ForbiddenError;
|
|
182
|
+
const CampaignsList422 = ValidationError;
|
|
183
|
+
const CampaignsList500 = InternalError;
|
|
184
|
+
const CampaignsList504 = GatewayTimeoutError;
|
|
185
|
+
const CampaignsCreateRequestJson = /* @__PURE__ */ Schema.Struct({
|
|
186
|
+
name: Schema.String,
|
|
187
|
+
channel: Schema.Literal("email"),
|
|
188
|
+
content: CampaignContentInput,
|
|
189
|
+
audience: CampaignAudience,
|
|
190
|
+
policy: Schema.optionalKey(Schema.Union([CampaignPolicy, Schema.Null]))
|
|
191
|
+
});
|
|
192
|
+
const CampaignsCreate201 = Campaign;
|
|
193
|
+
const CampaignsCreate401 = UnauthorizedError;
|
|
194
|
+
const CampaignsCreate403 = /* @__PURE__ */ Schema.Union([FlagDisabledError, ForbiddenError]);
|
|
195
|
+
const CampaignsCreate422 = ValidationError;
|
|
196
|
+
const CampaignsCreate500 = InternalError;
|
|
197
|
+
const CampaignsCreate504 = GatewayTimeoutError;
|
|
198
|
+
const CampaignsGetPathParams = /* @__PURE__ */ Schema.Struct({ id: CampaignId });
|
|
199
|
+
const CampaignsGet200 = Campaign;
|
|
200
|
+
const CampaignsGet401 = UnauthorizedError;
|
|
201
|
+
const CampaignsGet403 = ForbiddenError;
|
|
202
|
+
const CampaignsGet404 = ResourceNotFoundError;
|
|
203
|
+
const CampaignsGet422 = ValidationError;
|
|
204
|
+
const CampaignsGet500 = InternalError;
|
|
205
|
+
const CampaignsGet504 = GatewayTimeoutError;
|
|
206
|
+
const CampaignsUpdatePathParams = /* @__PURE__ */ Schema.Struct({ id: CampaignId });
|
|
207
|
+
const CampaignsUpdateRequestJson = /* @__PURE__ */ Schema.Struct({
|
|
208
|
+
name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
209
|
+
content: Schema.optionalKey(Schema.Union([CampaignContentInput, Schema.Null])),
|
|
210
|
+
audience: Schema.optionalKey(Schema.Union([CampaignAudience, Schema.Null])),
|
|
211
|
+
policy: Schema.optionalKey(Schema.Union([CampaignPolicy, Schema.Null]))
|
|
212
|
+
});
|
|
213
|
+
const CampaignsUpdate200 = Campaign;
|
|
214
|
+
const CampaignsUpdate401 = UnauthorizedError;
|
|
215
|
+
const CampaignsUpdate403 = /* @__PURE__ */ Schema.Union([FlagDisabledError, ForbiddenError]);
|
|
216
|
+
const CampaignsUpdate404 = ResourceNotFoundError;
|
|
217
|
+
const CampaignsUpdate409 = ConflictError;
|
|
218
|
+
const CampaignsUpdate422 = ValidationError;
|
|
219
|
+
const CampaignsUpdate500 = InternalError;
|
|
220
|
+
const CampaignsUpdate504 = GatewayTimeoutError;
|
|
221
|
+
const CampaignsArchivePathParams = /* @__PURE__ */ Schema.Struct({ id: CampaignId });
|
|
222
|
+
const CampaignsArchive200 = Campaign;
|
|
223
|
+
const CampaignsArchive401 = UnauthorizedError;
|
|
224
|
+
const CampaignsArchive403 = ForbiddenError;
|
|
225
|
+
const CampaignsArchive404 = ResourceNotFoundError;
|
|
226
|
+
const CampaignsArchive409 = ConflictError;
|
|
227
|
+
const CampaignsArchive422 = ValidationError;
|
|
228
|
+
const CampaignsArchive500 = InternalError;
|
|
229
|
+
const CampaignsArchive504 = GatewayTimeoutError;
|
|
230
|
+
const CampaignsListRunsPathParams = /* @__PURE__ */ Schema.Struct({ id: CampaignId });
|
|
231
|
+
const CampaignsListRunsQuery = /* @__PURE__ */ Schema.Struct({
|
|
232
|
+
status: Schema.optionalKey(Schema.Union([Schema.Union([
|
|
233
|
+
Schema.Literal("scheduled"),
|
|
234
|
+
Schema.Literal("resolving"),
|
|
235
|
+
Schema.Literal("dispatching"),
|
|
236
|
+
Schema.Literal("paused"),
|
|
237
|
+
Schema.Literal("completed"),
|
|
238
|
+
Schema.Literal("cancelled"),
|
|
239
|
+
Schema.Literal("failed")
|
|
240
|
+
]), Schema.Null])),
|
|
241
|
+
limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
242
|
+
cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
|
|
243
|
+
});
|
|
244
|
+
const CampaignsListRuns200 = CampaignRunPage;
|
|
245
|
+
const CampaignsListRuns401 = UnauthorizedError;
|
|
246
|
+
const CampaignsListRuns403 = ForbiddenError;
|
|
247
|
+
const CampaignsListRuns404 = ResourceNotFoundError;
|
|
248
|
+
const CampaignsListRuns422 = ValidationError;
|
|
249
|
+
const CampaignsListRuns500 = InternalError;
|
|
250
|
+
const CampaignsListRuns504 = GatewayTimeoutError;
|
|
251
|
+
const CampaignsScheduleRunPathParams = /* @__PURE__ */ Schema.Struct({ id: CampaignId });
|
|
252
|
+
const CampaignsScheduleRunRequestJson = /* @__PURE__ */ Schema.Struct({
|
|
253
|
+
scheduledFor: Schema.optionalKey(Schema.Union([AbsoluteInstant, Schema.Null])),
|
|
254
|
+
idempotencyKey: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[\\s\\S]{1,255}$")).annotate({ expected: "a string matching the RegExp ^[\\s\\S]{1,255}$" })), Schema.Null]))
|
|
255
|
+
});
|
|
256
|
+
const CampaignsScheduleRun201 = CampaignRun;
|
|
257
|
+
const CampaignsScheduleRun401 = UnauthorizedError;
|
|
258
|
+
const CampaignsScheduleRun403 = /* @__PURE__ */ Schema.Union([FlagDisabledError, ForbiddenError]);
|
|
259
|
+
const CampaignsScheduleRun404 = ResourceNotFoundError;
|
|
260
|
+
const CampaignsScheduleRun409 = ConflictError;
|
|
261
|
+
const CampaignsScheduleRun422 = /* @__PURE__ */ Schema.Union([
|
|
262
|
+
ValidationError,
|
|
263
|
+
BrandAddressRequiredError,
|
|
264
|
+
CampaignFooterRequiredError
|
|
265
|
+
]);
|
|
266
|
+
const CampaignsScheduleRun500 = InternalError;
|
|
267
|
+
const CampaignsScheduleRun502 = ExternalServiceError;
|
|
268
|
+
const CampaignsScheduleRun503 = SenderNotReadyError;
|
|
269
|
+
const CampaignsScheduleRun504 = GatewayTimeoutError;
|
|
270
|
+
const CampaignsGetRunPathParams = /* @__PURE__ */ Schema.Struct({
|
|
271
|
+
id: CampaignId,
|
|
272
|
+
runId: CampaignRunId
|
|
273
|
+
});
|
|
274
|
+
const CampaignsGetRun200 = CampaignRun;
|
|
275
|
+
const CampaignsGetRun401 = UnauthorizedError;
|
|
276
|
+
const CampaignsGetRun403 = ForbiddenError;
|
|
277
|
+
const CampaignsGetRun404 = ResourceNotFoundError;
|
|
278
|
+
const CampaignsGetRun422 = ValidationError;
|
|
279
|
+
const CampaignsGetRun500 = InternalError;
|
|
280
|
+
const CampaignsGetRun504 = GatewayTimeoutError;
|
|
281
|
+
const CampaignsCancelRunPathParams = /* @__PURE__ */ Schema.Struct({
|
|
282
|
+
id: CampaignId,
|
|
283
|
+
runId: CampaignRunId
|
|
284
|
+
});
|
|
285
|
+
const CampaignsCancelRun200 = CampaignRunAction;
|
|
286
|
+
const CampaignsCancelRun401 = UnauthorizedError;
|
|
287
|
+
const CampaignsCancelRun403 = ForbiddenError;
|
|
288
|
+
const CampaignsCancelRun404 = ResourceNotFoundError;
|
|
289
|
+
const CampaignsCancelRun409 = ConflictError;
|
|
290
|
+
const CampaignsCancelRun422 = ValidationError;
|
|
291
|
+
const CampaignsCancelRun500 = InternalError;
|
|
292
|
+
const CampaignsCancelRun502 = ExternalServiceError;
|
|
293
|
+
const CampaignsCancelRun504 = GatewayTimeoutError;
|
|
294
|
+
const CampaignsPauseRunPathParams = /* @__PURE__ */ Schema.Struct({
|
|
295
|
+
id: CampaignId,
|
|
296
|
+
runId: CampaignRunId
|
|
297
|
+
});
|
|
298
|
+
const CampaignsPauseRun200 = CampaignRunAction;
|
|
299
|
+
const CampaignsPauseRun401 = UnauthorizedError;
|
|
300
|
+
const CampaignsPauseRun403 = ForbiddenError;
|
|
301
|
+
const CampaignsPauseRun404 = ResourceNotFoundError;
|
|
302
|
+
const CampaignsPauseRun409 = ConflictError;
|
|
303
|
+
const CampaignsPauseRun422 = ValidationError;
|
|
304
|
+
const CampaignsPauseRun500 = InternalError;
|
|
305
|
+
const CampaignsPauseRun502 = ExternalServiceError;
|
|
306
|
+
const CampaignsPauseRun504 = GatewayTimeoutError;
|
|
307
|
+
const CampaignsListRecipientsPathParams = /* @__PURE__ */ Schema.Struct({
|
|
308
|
+
id: CampaignId,
|
|
309
|
+
runId: CampaignRunId
|
|
310
|
+
});
|
|
311
|
+
const CampaignsListRecipientsQuery = /* @__PURE__ */ Schema.Struct({
|
|
312
|
+
status: Schema.optionalKey(Schema.Union([Schema.Union([
|
|
313
|
+
Schema.Literal("pending"),
|
|
314
|
+
Schema.Literal("dispatching"),
|
|
315
|
+
Schema.Literal("dispatched"),
|
|
316
|
+
Schema.Literal("failed"),
|
|
317
|
+
Schema.Literal("skipped")
|
|
318
|
+
]), Schema.Null])),
|
|
319
|
+
limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
320
|
+
cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
|
|
321
|
+
});
|
|
322
|
+
const CampaignsListRecipients200 = CampaignRecipientPage;
|
|
323
|
+
const CampaignsListRecipients401 = UnauthorizedError;
|
|
324
|
+
const CampaignsListRecipients403 = ForbiddenError;
|
|
325
|
+
const CampaignsListRecipients404 = ResourceNotFoundError;
|
|
326
|
+
const CampaignsListRecipients422 = ValidationError;
|
|
327
|
+
const CampaignsListRecipients500 = InternalError;
|
|
328
|
+
const CampaignsListRecipients504 = GatewayTimeoutError;
|
|
329
|
+
const CampaignsResumeRunPathParams = /* @__PURE__ */ Schema.Struct({
|
|
330
|
+
id: CampaignId,
|
|
331
|
+
runId: CampaignRunId
|
|
332
|
+
});
|
|
333
|
+
const CampaignsResumeRun200 = CampaignRunAction;
|
|
334
|
+
const CampaignsResumeRun401 = UnauthorizedError;
|
|
335
|
+
const CampaignsResumeRun403 = ForbiddenError;
|
|
336
|
+
const CampaignsResumeRun404 = ResourceNotFoundError;
|
|
337
|
+
const CampaignsResumeRun409 = ConflictError;
|
|
338
|
+
const CampaignsResumeRun422 = ValidationError;
|
|
339
|
+
const CampaignsResumeRun500 = InternalError;
|
|
340
|
+
const CampaignsResumeRun502 = ExternalServiceError;
|
|
341
|
+
const CampaignsResumeRun504 = GatewayTimeoutError;
|
|
342
|
+
var CampaignsGroup = class extends HttpApiGroup.make("Campaigns").add(HttpApiEndpoint.get("campaignsList", "/v1/campaigns", {
|
|
343
|
+
query: CampaignsListQuery,
|
|
344
|
+
success: CampaignsList200,
|
|
345
|
+
error: [
|
|
346
|
+
CampaignsList401.pipe(HttpApiSchema.status(401)),
|
|
347
|
+
CampaignsList403.pipe(HttpApiSchema.status(403)),
|
|
348
|
+
CampaignsList422.pipe(HttpApiSchema.status(422)),
|
|
349
|
+
CampaignsList500,
|
|
350
|
+
CampaignsList504.pipe(HttpApiSchema.status(504))
|
|
351
|
+
]
|
|
352
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.list").annotate(OpenApi.Summary, "List campaigns").annotate(OpenApi.Description, "Returns the organization's campaigns, newest first, optionally filtered by status. Each row carries `series`, the last 14 days of daily email sends the campaign produced, oldest first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("campaignsCreate", "/v1/campaigns", {
|
|
353
|
+
payload: CampaignsCreateRequestJson,
|
|
354
|
+
success: CampaignsCreate201.pipe(HttpApiSchema.status(201)),
|
|
355
|
+
error: [
|
|
356
|
+
CampaignsCreate401.pipe(HttpApiSchema.status(401)),
|
|
357
|
+
CampaignsCreate403.pipe(HttpApiSchema.status(403)),
|
|
358
|
+
CampaignsCreate422.pipe(HttpApiSchema.status(422)),
|
|
359
|
+
CampaignsCreate500,
|
|
360
|
+
CampaignsCreate504.pipe(HttpApiSchema.status(504))
|
|
361
|
+
]
|
|
362
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.create").annotate(OpenApi.Summary, "Create a campaign").annotate(OpenApi.Description, "Creates an email campaign draft for the given audience and content, returning the created campaign."), HttpApiEndpoint.get("campaignsGet", "/v1/campaigns/:id", {
|
|
363
|
+
params: CampaignsGetPathParams,
|
|
364
|
+
success: CampaignsGet200,
|
|
365
|
+
error: [
|
|
366
|
+
CampaignsGet401.pipe(HttpApiSchema.status(401)),
|
|
367
|
+
CampaignsGet403.pipe(HttpApiSchema.status(403)),
|
|
368
|
+
CampaignsGet404.pipe(HttpApiSchema.status(404)),
|
|
369
|
+
CampaignsGet422.pipe(HttpApiSchema.status(422)),
|
|
370
|
+
CampaignsGet500,
|
|
371
|
+
CampaignsGet504.pipe(HttpApiSchema.status(504))
|
|
372
|
+
]
|
|
373
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.get").annotate(OpenApi.Summary, "Get a campaign").annotate(OpenApi.Description, "Returns a single campaign, including its content, audience, and policy, by its identifier."), HttpApiEndpoint.patch("campaignsUpdate", "/v1/campaigns/:id", {
|
|
374
|
+
params: CampaignsUpdatePathParams,
|
|
375
|
+
payload: CampaignsUpdateRequestJson,
|
|
376
|
+
success: CampaignsUpdate200,
|
|
377
|
+
error: [
|
|
378
|
+
CampaignsUpdate401.pipe(HttpApiSchema.status(401)),
|
|
379
|
+
CampaignsUpdate403.pipe(HttpApiSchema.status(403)),
|
|
380
|
+
CampaignsUpdate404.pipe(HttpApiSchema.status(404)),
|
|
381
|
+
CampaignsUpdate409.pipe(HttpApiSchema.status(409)),
|
|
382
|
+
CampaignsUpdate422.pipe(HttpApiSchema.status(422)),
|
|
383
|
+
CampaignsUpdate500,
|
|
384
|
+
CampaignsUpdate504.pipe(HttpApiSchema.status(504))
|
|
385
|
+
]
|
|
386
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.update").annotate(OpenApi.Summary, "Update a campaign").annotate(OpenApi.Description, "Updates the name, content, audience, or policy of a campaign draft."), HttpApiEndpoint.post("campaignsArchive", "/v1/campaigns/:id/archive", {
|
|
387
|
+
params: CampaignsArchivePathParams,
|
|
388
|
+
success: CampaignsArchive200,
|
|
389
|
+
error: [
|
|
390
|
+
CampaignsArchive401.pipe(HttpApiSchema.status(401)),
|
|
391
|
+
CampaignsArchive403.pipe(HttpApiSchema.status(403)),
|
|
392
|
+
CampaignsArchive404.pipe(HttpApiSchema.status(404)),
|
|
393
|
+
CampaignsArchive409.pipe(HttpApiSchema.status(409)),
|
|
394
|
+
CampaignsArchive422.pipe(HttpApiSchema.status(422)),
|
|
395
|
+
CampaignsArchive500,
|
|
396
|
+
CampaignsArchive504.pipe(HttpApiSchema.status(504))
|
|
397
|
+
]
|
|
398
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.archive").annotate(OpenApi.Summary, "Archive a campaign").annotate(OpenApi.Description, "Archives a draft campaign so it can no longer be scheduled, returning the archived campaign."), HttpApiEndpoint.get("campaignsListRuns", "/v1/campaigns/:id/runs", {
|
|
399
|
+
params: CampaignsListRunsPathParams,
|
|
400
|
+
query: CampaignsListRunsQuery,
|
|
401
|
+
success: CampaignsListRuns200,
|
|
402
|
+
error: [
|
|
403
|
+
CampaignsListRuns401.pipe(HttpApiSchema.status(401)),
|
|
404
|
+
CampaignsListRuns403.pipe(HttpApiSchema.status(403)),
|
|
405
|
+
CampaignsListRuns404.pipe(HttpApiSchema.status(404)),
|
|
406
|
+
CampaignsListRuns422.pipe(HttpApiSchema.status(422)),
|
|
407
|
+
CampaignsListRuns500,
|
|
408
|
+
CampaignsListRuns504.pipe(HttpApiSchema.status(504))
|
|
409
|
+
]
|
|
410
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.listRuns").annotate(OpenApi.Summary, "List campaign runs").annotate(OpenApi.Description, "Returns a campaign's runs, newest first, optionally filtered by status. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("campaignsScheduleRun", "/v1/campaigns/:id/runs", {
|
|
411
|
+
params: CampaignsScheduleRunPathParams,
|
|
412
|
+
payload: CampaignsScheduleRunRequestJson,
|
|
413
|
+
success: CampaignsScheduleRun201.pipe(HttpApiSchema.status(201)),
|
|
414
|
+
error: [
|
|
415
|
+
CampaignsScheduleRun401.pipe(HttpApiSchema.status(401)),
|
|
416
|
+
CampaignsScheduleRun403.pipe(HttpApiSchema.status(403)),
|
|
417
|
+
CampaignsScheduleRun404.pipe(HttpApiSchema.status(404)),
|
|
418
|
+
CampaignsScheduleRun409.pipe(HttpApiSchema.status(409)),
|
|
419
|
+
CampaignsScheduleRun422.pipe(HttpApiSchema.status(422)),
|
|
420
|
+
CampaignsScheduleRun500,
|
|
421
|
+
CampaignsScheduleRun502.pipe(HttpApiSchema.status(502)),
|
|
422
|
+
CampaignsScheduleRun503.pipe(HttpApiSchema.status(503)),
|
|
423
|
+
CampaignsScheduleRun504.pipe(HttpApiSchema.status(504))
|
|
424
|
+
]
|
|
425
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.scheduleRun").annotate(OpenApi.Summary, "Schedule a campaign run").annotate(OpenApi.Description, "Schedules an email campaign run at the absolute ISO-8601 instant in scheduledFor, or immediately when omitted. The optional idempotencyKey is scoped to the organization and replays return the original run. An email campaign must carry the brand footer: it is refused with CampaignFooterRequiredError when its footer is off and its template renders no BrandFooter, and with BrandAddressRequiredError when a brand that signs it off has no postal address."), HttpApiEndpoint.get("campaignsGetRun", "/v1/campaigns/:id/runs/:runId", {
|
|
426
|
+
params: CampaignsGetRunPathParams,
|
|
427
|
+
success: CampaignsGetRun200,
|
|
428
|
+
error: [
|
|
429
|
+
CampaignsGetRun401.pipe(HttpApiSchema.status(401)),
|
|
430
|
+
CampaignsGetRun403.pipe(HttpApiSchema.status(403)),
|
|
431
|
+
CampaignsGetRun404.pipe(HttpApiSchema.status(404)),
|
|
432
|
+
CampaignsGetRun422.pipe(HttpApiSchema.status(422)),
|
|
433
|
+
CampaignsGetRun500,
|
|
434
|
+
CampaignsGetRun504.pipe(HttpApiSchema.status(504))
|
|
435
|
+
]
|
|
436
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.getRun").annotate(OpenApi.Summary, "Get a campaign run").annotate(OpenApi.Description, "Returns a single run of a campaign by its identifier."), HttpApiEndpoint.post("campaignsCancelRun", "/v1/campaigns/:id/runs/:runId/cancel", {
|
|
437
|
+
params: CampaignsCancelRunPathParams,
|
|
438
|
+
success: CampaignsCancelRun200,
|
|
439
|
+
error: [
|
|
440
|
+
CampaignsCancelRun401.pipe(HttpApiSchema.status(401)),
|
|
441
|
+
CampaignsCancelRun403.pipe(HttpApiSchema.status(403)),
|
|
442
|
+
CampaignsCancelRun404.pipe(HttpApiSchema.status(404)),
|
|
443
|
+
CampaignsCancelRun409.pipe(HttpApiSchema.status(409)),
|
|
444
|
+
CampaignsCancelRun422.pipe(HttpApiSchema.status(422)),
|
|
445
|
+
CampaignsCancelRun500,
|
|
446
|
+
CampaignsCancelRun502.pipe(HttpApiSchema.status(502)),
|
|
447
|
+
CampaignsCancelRun504.pipe(HttpApiSchema.status(504))
|
|
448
|
+
]
|
|
449
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.cancelRun").annotate(OpenApi.Summary, "Cancel a campaign run").annotate(OpenApi.Description, "Best-effort cancellation: pending recipients are skipped, while deliveries already handed off for sending may finish. Returns the updated run."), HttpApiEndpoint.post("campaignsPauseRun", "/v1/campaigns/:id/runs/:runId/pause", {
|
|
450
|
+
params: CampaignsPauseRunPathParams,
|
|
451
|
+
success: CampaignsPauseRun200,
|
|
452
|
+
error: [
|
|
453
|
+
CampaignsPauseRun401.pipe(HttpApiSchema.status(401)),
|
|
454
|
+
CampaignsPauseRun403.pipe(HttpApiSchema.status(403)),
|
|
455
|
+
CampaignsPauseRun404.pipe(HttpApiSchema.status(404)),
|
|
456
|
+
CampaignsPauseRun409.pipe(HttpApiSchema.status(409)),
|
|
457
|
+
CampaignsPauseRun422.pipe(HttpApiSchema.status(422)),
|
|
458
|
+
CampaignsPauseRun500,
|
|
459
|
+
CampaignsPauseRun502.pipe(HttpApiSchema.status(502)),
|
|
460
|
+
CampaignsPauseRun504.pipe(HttpApiSchema.status(504))
|
|
461
|
+
]
|
|
462
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.pauseRun").annotate(OpenApi.Summary, "Pause a campaign run").annotate(OpenApi.Description, "Pauses an in-progress campaign run and returns the updated run."), HttpApiEndpoint.get("campaignsListRecipients", "/v1/campaigns/:id/runs/:runId/recipients", {
|
|
463
|
+
params: CampaignsListRecipientsPathParams,
|
|
464
|
+
query: CampaignsListRecipientsQuery,
|
|
465
|
+
success: CampaignsListRecipients200,
|
|
466
|
+
error: [
|
|
467
|
+
CampaignsListRecipients401.pipe(HttpApiSchema.status(401)),
|
|
468
|
+
CampaignsListRecipients403.pipe(HttpApiSchema.status(403)),
|
|
469
|
+
CampaignsListRecipients404.pipe(HttpApiSchema.status(404)),
|
|
470
|
+
CampaignsListRecipients422.pipe(HttpApiSchema.status(422)),
|
|
471
|
+
CampaignsListRecipients500,
|
|
472
|
+
CampaignsListRecipients504.pipe(HttpApiSchema.status(504))
|
|
473
|
+
]
|
|
474
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.listRecipients").annotate(OpenApi.Summary, "List campaign recipients").annotate(OpenApi.Description, "Returns a campaign run's recipients in the order the run admitted them, optionally filtered by status. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("campaignsResumeRun", "/v1/campaigns/:id/runs/:runId/resume", {
|
|
475
|
+
params: CampaignsResumeRunPathParams,
|
|
476
|
+
success: CampaignsResumeRun200,
|
|
477
|
+
error: [
|
|
478
|
+
CampaignsResumeRun401.pipe(HttpApiSchema.status(401)),
|
|
479
|
+
CampaignsResumeRun403.pipe(HttpApiSchema.status(403)),
|
|
480
|
+
CampaignsResumeRun404.pipe(HttpApiSchema.status(404)),
|
|
481
|
+
CampaignsResumeRun409.pipe(HttpApiSchema.status(409)),
|
|
482
|
+
CampaignsResumeRun422.pipe(HttpApiSchema.status(422)),
|
|
483
|
+
CampaignsResumeRun500,
|
|
484
|
+
CampaignsResumeRun502.pipe(HttpApiSchema.status(502)),
|
|
485
|
+
CampaignsResumeRun504.pipe(HttpApiSchema.status(504))
|
|
486
|
+
]
|
|
487
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.resumeRun").annotate(OpenApi.Summary, "Resume a campaign run").annotate(OpenApi.Description, "Resumes a paused campaign run and returns the updated run.")).annotate(OpenApi.Description, "Campaign drafts and scheduled campaign runs") {};
|
|
488
|
+
//#endregion
|
|
489
|
+
export { Campaign, CampaignAudience, CampaignContent, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignDefinitionSummary, CampaignId, CampaignLatestRun, CampaignListItem, CampaignPage, CampaignPolicy, CampaignRecipientId, CampaignRecipientPage, CampaignRun, CampaignRunAction, CampaignRunId, CampaignRunPage, CampaignsArchive200, CampaignsArchive401, CampaignsArchive403, CampaignsArchive404, CampaignsArchive409, CampaignsArchive422, CampaignsArchive500, CampaignsArchive504, CampaignsArchivePathParams, CampaignsCancelRun200, CampaignsCancelRun401, CampaignsCancelRun403, CampaignsCancelRun404, CampaignsCancelRun409, CampaignsCancelRun422, CampaignsCancelRun500, CampaignsCancelRun502, CampaignsCancelRun504, CampaignsCancelRunPathParams, CampaignsCreate201, CampaignsCreate401, CampaignsCreate403, CampaignsCreate422, CampaignsCreate500, CampaignsCreate504, CampaignsCreateRequestJson, CampaignsGet200, CampaignsGet401, CampaignsGet403, CampaignsGet404, CampaignsGet422, CampaignsGet500, CampaignsGet504, CampaignsGetPathParams, CampaignsGetRun200, CampaignsGetRun401, CampaignsGetRun403, CampaignsGetRun404, CampaignsGetRun422, CampaignsGetRun500, CampaignsGetRun504, CampaignsGetRunPathParams, CampaignsGroup, CampaignsList200, CampaignsList401, CampaignsList403, CampaignsList422, CampaignsList500, CampaignsList504, CampaignsListQuery, CampaignsListRecipients200, CampaignsListRecipients401, CampaignsListRecipients403, CampaignsListRecipients404, CampaignsListRecipients422, CampaignsListRecipients500, CampaignsListRecipients504, CampaignsListRecipientsPathParams, CampaignsListRecipientsQuery, CampaignsListRuns200, CampaignsListRuns401, CampaignsListRuns403, CampaignsListRuns404, CampaignsListRuns422, CampaignsListRuns500, CampaignsListRuns504, CampaignsListRunsPathParams, CampaignsListRunsQuery, CampaignsPauseRun200, CampaignsPauseRun401, CampaignsPauseRun403, CampaignsPauseRun404, CampaignsPauseRun409, CampaignsPauseRun422, CampaignsPauseRun500, CampaignsPauseRun502, CampaignsPauseRun504, CampaignsPauseRunPathParams, CampaignsResumeRun200, CampaignsResumeRun401, CampaignsResumeRun403, CampaignsResumeRun404, CampaignsResumeRun409, CampaignsResumeRun422, CampaignsResumeRun500, CampaignsResumeRun502, CampaignsResumeRun504, CampaignsResumeRunPathParams, CampaignsScheduleRun201, CampaignsScheduleRun401, CampaignsScheduleRun403, CampaignsScheduleRun404, CampaignsScheduleRun409, CampaignsScheduleRun422, CampaignsScheduleRun500, CampaignsScheduleRun502, CampaignsScheduleRun503, CampaignsScheduleRun504, CampaignsScheduleRunPathParams, CampaignsScheduleRunRequestJson, CampaignsUpdate200, CampaignsUpdate401, CampaignsUpdate403, CampaignsUpdate404, CampaignsUpdate409, CampaignsUpdate422, CampaignsUpdate500, CampaignsUpdate504, CampaignsUpdatePathParams, CampaignsUpdateRequestJson };
|
|
490
|
+
|
|
491
|
+
//# sourceMappingURL=campaigns.js.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { ApiKeySecurityMiddleware, ContactEvent, ContactId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, ResourceNotFoundError, UnauthorizedError, ValidationError } from "./shared";
|
|
4
|
+
export type ContactEventPage = {
|
|
5
|
+
readonly items: ReadonlyArray<ContactEvent>;
|
|
6
|
+
readonly nextCursor: string | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const ContactEventPage: Schema.Struct<{
|
|
9
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
10
|
+
readonly id: Schema.String;
|
|
11
|
+
readonly contactId: Schema.brand<Schema.String, "ContactId">;
|
|
12
|
+
readonly name: Schema.String;
|
|
13
|
+
readonly source: Schema.Union<readonly [Schema.Literal<"api">, Schema.Literal<"samva">]>;
|
|
14
|
+
readonly properties: Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<import("./shared").JsonValue, import("./shared").JsonValue, never, never>>>;
|
|
15
|
+
readonly occurredAt: Schema.String;
|
|
16
|
+
readonly recordedAt: Schema.String;
|
|
17
|
+
}>>;
|
|
18
|
+
readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
19
|
+
}>;
|
|
20
|
+
export type ContactEventsListEventsPathParams = {
|
|
21
|
+
readonly id: ContactId;
|
|
22
|
+
};
|
|
23
|
+
export declare const ContactEventsListEventsPathParams: Schema.Struct<{
|
|
24
|
+
readonly id: Schema.brand<Schema.String, "ContactId">;
|
|
25
|
+
}>;
|
|
26
|
+
export type ContactEventsListEventsQuery = {
|
|
27
|
+
readonly limit?: string | null;
|
|
28
|
+
readonly cursor?: Cursor | null;
|
|
29
|
+
};
|
|
30
|
+
export declare const ContactEventsListEventsQuery: Schema.Struct<{
|
|
31
|
+
readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
32
|
+
readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
33
|
+
}>;
|
|
34
|
+
export type ContactEventsListEvents200 = ContactEventPage;
|
|
35
|
+
export declare const ContactEventsListEvents200: Schema.Struct<{
|
|
36
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly contactId: Schema.brand<Schema.String, "ContactId">;
|
|
39
|
+
readonly name: Schema.String;
|
|
40
|
+
readonly source: Schema.Union<readonly [Schema.Literal<"api">, Schema.Literal<"samva">]>;
|
|
41
|
+
readonly properties: Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<import("./shared").JsonValue, import("./shared").JsonValue, never, never>>>;
|
|
42
|
+
readonly occurredAt: Schema.String;
|
|
43
|
+
readonly recordedAt: Schema.String;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
46
|
+
}>;
|
|
47
|
+
export type ContactEventsListEvents401 = UnauthorizedError;
|
|
48
|
+
export declare const ContactEventsListEvents401: typeof UnauthorizedError;
|
|
49
|
+
export type ContactEventsListEvents403 = ForbiddenError;
|
|
50
|
+
export declare const ContactEventsListEvents403: typeof ForbiddenError;
|
|
51
|
+
export type ContactEventsListEvents404 = ResourceNotFoundError;
|
|
52
|
+
export declare const ContactEventsListEvents404: typeof ResourceNotFoundError;
|
|
53
|
+
export type ContactEventsListEvents422 = ValidationError;
|
|
54
|
+
export declare const ContactEventsListEvents422: typeof ValidationError;
|
|
55
|
+
export type ContactEventsListEvents500 = InternalError;
|
|
56
|
+
export declare const ContactEventsListEvents500: typeof InternalError;
|
|
57
|
+
export type ContactEventsListEvents504 = GatewayTimeoutError;
|
|
58
|
+
export declare const ContactEventsListEvents504: typeof GatewayTimeoutError;
|
|
59
|
+
declare const ContactEventsGroup_base: HttpApiGroup.HttpApiGroup<"Contact events", HttpApiEndpoint.HttpApiEndpoint<"contactEventsListEvents", "GET", "/v1/contacts/:id/events", Schema.toCodecStringTree<Schema.Struct<{
|
|
60
|
+
readonly id: Schema.brand<Schema.String, "ContactId">;
|
|
61
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
62
|
+
readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
63
|
+
readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
64
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
65
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
66
|
+
readonly id: Schema.String;
|
|
67
|
+
readonly contactId: Schema.brand<Schema.String, "ContactId">;
|
|
68
|
+
readonly name: Schema.String;
|
|
69
|
+
readonly source: Schema.Union<readonly [Schema.Literal<"api">, Schema.Literal<"samva">]>;
|
|
70
|
+
readonly properties: Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<import("./shared").JsonValue, import("./shared").JsonValue, never, never>>>;
|
|
71
|
+
readonly occurredAt: Schema.String;
|
|
72
|
+
readonly recordedAt: Schema.String;
|
|
73
|
+
}>>;
|
|
74
|
+
readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
75
|
+
}>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {
|
|
76
|
+
readonly _tag: "ForbiddenError";
|
|
77
|
+
readonly message: string;
|
|
78
|
+
}, readonly [Schema.Struct<{
|
|
79
|
+
readonly _tag: Schema.tag<"ForbiddenError">;
|
|
80
|
+
readonly message: Schema.String;
|
|
81
|
+
}>], {
|
|
82
|
+
readonly _tag: "ForbiddenError";
|
|
83
|
+
readonly message: string;
|
|
84
|
+
}>, Schema.Struct<{
|
|
85
|
+
readonly _tag: Schema.tag<"ForbiddenError">;
|
|
86
|
+
readonly message: Schema.String;
|
|
87
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<GatewayTimeoutError, {
|
|
88
|
+
readonly _tag: "GatewayTimeoutError";
|
|
89
|
+
readonly message: string;
|
|
90
|
+
readonly retryAfterSeconds: number;
|
|
91
|
+
}, readonly [Schema.Struct<{
|
|
92
|
+
readonly _tag: Schema.tag<"GatewayTimeoutError">;
|
|
93
|
+
readonly message: Schema.String;
|
|
94
|
+
readonly retryAfterSeconds: Schema.Finite;
|
|
95
|
+
}>], {
|
|
96
|
+
readonly _tag: "GatewayTimeoutError";
|
|
97
|
+
readonly message: string;
|
|
98
|
+
readonly retryAfterSeconds: number;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
readonly _tag: Schema.tag<"GatewayTimeoutError">;
|
|
101
|
+
readonly message: Schema.String;
|
|
102
|
+
readonly retryAfterSeconds: Schema.Finite;
|
|
103
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<ResourceNotFoundError, {
|
|
104
|
+
readonly _tag: "ResourceNotFoundError";
|
|
105
|
+
readonly resource: string;
|
|
106
|
+
readonly id: string;
|
|
107
|
+
readonly message: string;
|
|
108
|
+
}, readonly [Schema.Struct<{
|
|
109
|
+
readonly _tag: Schema.tag<"ResourceNotFoundError">;
|
|
110
|
+
readonly resource: Schema.String;
|
|
111
|
+
readonly id: Schema.String;
|
|
112
|
+
readonly message: Schema.String;
|
|
113
|
+
}>], {
|
|
114
|
+
readonly _tag: "ResourceNotFoundError";
|
|
115
|
+
readonly resource: string;
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly message: string;
|
|
118
|
+
}>, Schema.Struct<{
|
|
119
|
+
readonly _tag: Schema.tag<"ResourceNotFoundError">;
|
|
120
|
+
readonly resource: Schema.String;
|
|
121
|
+
readonly id: Schema.String;
|
|
122
|
+
readonly message: Schema.String;
|
|
123
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<UnauthorizedError, {
|
|
124
|
+
readonly _tag: "UnauthorizedError";
|
|
125
|
+
readonly message: string;
|
|
126
|
+
}, readonly [Schema.Struct<{
|
|
127
|
+
readonly _tag: Schema.tag<"UnauthorizedError">;
|
|
128
|
+
readonly message: Schema.String;
|
|
129
|
+
}>], {
|
|
130
|
+
readonly _tag: "UnauthorizedError";
|
|
131
|
+
readonly message: string;
|
|
132
|
+
}>, Schema.Struct<{
|
|
133
|
+
readonly _tag: Schema.tag<"UnauthorizedError">;
|
|
134
|
+
readonly message: Schema.String;
|
|
135
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<ValidationError, {
|
|
136
|
+
readonly _tag: "ValidationError";
|
|
137
|
+
readonly message: string;
|
|
138
|
+
readonly fields?: {
|
|
139
|
+
readonly [x: string]: readonly string[];
|
|
140
|
+
} | null;
|
|
141
|
+
}, readonly [Schema.Struct<{
|
|
142
|
+
readonly _tag: Schema.tag<"ValidationError">;
|
|
143
|
+
readonly message: Schema.String;
|
|
144
|
+
readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
|
|
145
|
+
}>], {
|
|
146
|
+
readonly _tag: "ValidationError";
|
|
147
|
+
readonly message: string;
|
|
148
|
+
readonly fields?: {
|
|
149
|
+
readonly [x: string]: readonly string[];
|
|
150
|
+
} | null;
|
|
151
|
+
}>, Schema.Struct<{
|
|
152
|
+
readonly _tag: Schema.tag<"ValidationError">;
|
|
153
|
+
readonly message: Schema.String;
|
|
154
|
+
readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
|
|
155
|
+
}>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never>, false>;
|
|
156
|
+
export declare class ContactEventsGroup extends ContactEventsGroup_base {
|
|
157
|
+
}
|
|
158
|
+
export {};
|