@superdurable/connector-amazon-ses 0.0.0-stage → 0.2.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.
@@ -0,0 +1,754 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var goTimeJSONPattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{2}):(\d{2})(?:[.,](\d+))?(Z|([+-])(\d{2}):(\d{2}))$/;
5
+ function isGoTimeJSON(value) {
6
+ const match = goTimeJSONPattern.exec(value);
7
+ if (!match) return false;
8
+ const [, yearText, monthText, dayText, hourText, minuteText, secondText, , zone, , zoneHourText, zoneMinuteText] = match;
9
+ const year = Number(yearText);
10
+ const month = Number(monthText);
11
+ const day = Number(dayText);
12
+ const isLeap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
13
+ const monthDays = [31, isLeap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
14
+ return month >= 1 && month <= 12 && day >= 1 && day <= monthDays[month - 1] && Number(hourText) <= 23 && Number(minuteText) <= 59 && Number(secondText) <= 59 && (zone === "Z" || Number(zoneHourText) <= 24 && Number(zoneMinuteText) <= 60);
15
+ }
16
+ function canonicalGoTimeJSON(value) {
17
+ const match = goTimeJSONPattern.exec(value);
18
+ const [, year, month, day, hour, minute, second, fraction, zone, sign, zoneHour, zoneMinute] = match;
19
+ const clock = year + "-" + month + "-" + day + "T" + hour.padStart(2, "0") + ":" + minute + ":" + second;
20
+ const digits = (fraction ?? "").slice(0, 9).replace(/0+$/, "");
21
+ const offsetMinutes = zone === "Z" ? 0 : (Number(zoneHour) * 60 + Number(zoneMinute)) * (sign === "+" ? 1 : -1);
22
+ if (Math.abs(offsetMinutes) >= 1440) return value;
23
+ const offset = offsetMinutes === 0 ? "Z" : (offsetMinutes > 0 ? "+" : "-") + String(Math.floor(Math.abs(offsetMinutes) / 60)).padStart(2, "0") + ":" + String(Math.abs(offsetMinutes) % 60).padStart(2, "0");
24
+ return clock + (digits ? "." + digits : "") + offset;
25
+ }
26
+ var GoTimeJSONSchema = z.string().refine(isGoTimeJSON, "invalid Go time.Time JSON timestamp").transform(canonicalGoTimeJSON);
27
+ var ConfigSchema = z.object({
28
+ "region": z.string().optional(),
29
+ "endpoint": z.string().optional(),
30
+ "timeoutMs": z.number().int().optional(),
31
+ "maxResponseBytes": z.number().int().optional()
32
+ });
33
+ var CredentialMaterialError = class extends TypeError {
34
+ constructor(message) {
35
+ super(message);
36
+ this.name = "CredentialMaterialError";
37
+ }
38
+ };
39
+ var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
40
+ "project credential decoding failed",
41
+ "shared project credential decoding failed",
42
+ "project credential decoding failed: this connector version does not support shared credentials"
43
+ ]);
44
+ function isCredentialMaterialError(error) {
45
+ return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
46
+ }
47
+ function decodeCredentials(value) {
48
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
49
+ const fields = value;
50
+ const allowed = /* @__PURE__ */ new Set(["access_key_id", "secret_access_key", "session_token"]);
51
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
52
+ if (fields["access_key_id"] != null && !(typeof fields["access_key_id"] === "string")) throw new CredentialMaterialError("credential access_key_id has an invalid type");
53
+ if (fields["secret_access_key"] != null && !(typeof fields["secret_access_key"] === "string")) throw new CredentialMaterialError("credential secret_access_key has an invalid type");
54
+ if (fields["session_token"] != null && !(typeof fields["session_token"] === "string")) throw new CredentialMaterialError("credential session_token has an invalid type");
55
+ const credentials = {};
56
+ if (!fields["access_key_id"]) throw new CredentialMaterialError("credential access_key_id is required");
57
+ credentials.accessKeyId = new SecretString(fields["access_key_id"] ?? "");
58
+ if (!fields["secret_access_key"]) throw new CredentialMaterialError("credential secret_access_key is required");
59
+ credentials.secretAccessKey = new SecretString(fields["secret_access_key"] ?? "");
60
+ credentials.sessionToken = new SecretString(fields["session_token"] ?? "");
61
+ return credentials;
62
+ }
63
+ var CreateEmailIdentityInputSchema = z.strictObject({
64
+ "emailIdentity": z.string()
65
+ });
66
+ var CreatedEmailIdentitySchema = z.strictObject({
67
+ "name": z.string(),
68
+ "identityType": z.string(),
69
+ "verifiedForSending": z.boolean(),
70
+ "dkimTokens": z.array(z.string()).optional()
71
+ });
72
+ var GetEmailIdentityInputSchema = z.strictObject({
73
+ "emailIdentity": z.string()
74
+ });
75
+ var EmailIdentityDetailsSchema = z.strictObject({
76
+ "name": z.string(),
77
+ "verificationStatus": z.string()
78
+ });
79
+ var ListEmailIdentitiesInputSchema = z.strictObject({
80
+ "nextToken": z.string().optional(),
81
+ "pageSize": z.number().int().optional()
82
+ });
83
+ var EmailIdentitySummarySchema = z.strictObject({
84
+ "name": z.string(),
85
+ "identityType": z.string(),
86
+ "verificationStatus": z.string(),
87
+ "sendingEnabled": z.boolean()
88
+ });
89
+ var EmailIdentityPageSchema = z.strictObject({
90
+ "identities": z.array(EmailIdentitySummarySchema).nullable(),
91
+ "nextToken": z.string().optional()
92
+ });
93
+ var DeleteEmailIdentityInputSchema = z.strictObject({
94
+ "emailIdentity": z.string()
95
+ });
96
+ var DeletedEmailIdentitySchema = z.strictObject({
97
+ "name": z.string()
98
+ });
99
+ var SendEmailInputSchema = z.strictObject({
100
+ "fromEmailAddress": z.string(),
101
+ "toEmailAddress": z.string(),
102
+ "subject": z.string(),
103
+ "textBody": z.string()
104
+ });
105
+ var SentEmailSchema = z.strictObject({
106
+ "messageId": z.string()
107
+ });
108
+ var EmailTemplateContentSchema = z.strictObject({
109
+ "subject": z.string(),
110
+ "text": z.string().optional(),
111
+ "html": z.string().optional()
112
+ });
113
+ var CreateEmailTemplateInputSchema = z.strictObject({
114
+ "templateName": z.string(),
115
+ "content": EmailTemplateContentSchema
116
+ });
117
+ var EmailTemplateSchema = z.strictObject({
118
+ "name": z.string(),
119
+ "content": EmailTemplateContentSchema
120
+ });
121
+ var GetEmailTemplateInputSchema = z.strictObject({
122
+ "templateName": z.string()
123
+ });
124
+ var ListEmailTemplatesInputSchema = z.strictObject({
125
+ "nextToken": z.string().optional(),
126
+ "pageSize": z.number().int().optional()
127
+ });
128
+ var EmailTemplateSummarySchema = z.strictObject({
129
+ "name": z.string(),
130
+ "createdAt": GoTimeJSONSchema
131
+ });
132
+ var EmailTemplatePageSchema = z.strictObject({
133
+ "templates": z.array(EmailTemplateSummarySchema).nullable(),
134
+ "nextToken": z.string().optional()
135
+ });
136
+ var UpdateEmailTemplateInputSchema = z.strictObject({
137
+ "templateName": z.string(),
138
+ "content": EmailTemplateContentSchema
139
+ });
140
+ var DeleteEmailTemplateInputSchema = z.strictObject({
141
+ "templateName": z.string()
142
+ });
143
+ var DeletedEmailTemplateSchema = z.strictObject({
144
+ "name": z.string()
145
+ });
146
+ var SendTemplatedEmailInputSchema = z.strictObject({
147
+ "fromEmailAddress": z.string(),
148
+ "toEmailAddress": z.string(),
149
+ "templateName": z.string(),
150
+ "templateData": z.record(z.string(), z.string()).optional()
151
+ });
152
+ var CustomVerificationEmailTemplateSchema = z.strictObject({
153
+ "name": z.string(),
154
+ "fromEmailAddress": z.string(),
155
+ "subject": z.string(),
156
+ "content": z.string(),
157
+ "successRedirectionURL": z.string(),
158
+ "failureRedirectionURL": z.string()
159
+ });
160
+ var CreateCustomVerificationEmailTemplateInputSchema = z.strictObject({
161
+ "template": CustomVerificationEmailTemplateSchema
162
+ });
163
+ var GetCustomVerificationEmailTemplateInputSchema = z.strictObject({
164
+ "templateName": z.string()
165
+ });
166
+ var ListCustomVerificationEmailTemplatesInputSchema = z.strictObject({
167
+ "nextToken": z.string().optional(),
168
+ "pageSize": z.number().int().optional()
169
+ });
170
+ var CustomVerificationEmailTemplateSummarySchema = z.strictObject({
171
+ "name": z.string(),
172
+ "fromEmailAddress": z.string(),
173
+ "subject": z.string(),
174
+ "successRedirectionURL": z.string(),
175
+ "failureRedirectionURL": z.string()
176
+ });
177
+ var CustomVerificationEmailTemplatePageSchema = z.strictObject({
178
+ "templates": z.array(CustomVerificationEmailTemplateSummarySchema).nullable(),
179
+ "nextToken": z.string().optional()
180
+ });
181
+ var UpdateCustomVerificationEmailTemplateInputSchema = z.strictObject({
182
+ "template": CustomVerificationEmailTemplateSchema
183
+ });
184
+ var DeleteCustomVerificationEmailTemplateInputSchema = z.strictObject({
185
+ "templateName": z.string()
186
+ });
187
+ var SendCustomVerificationEmailInputSchema = z.strictObject({
188
+ "emailAddress": z.string(),
189
+ "templateName": z.string(),
190
+ "configurationSetName": z.string().optional()
191
+ });
192
+
193
+ // src/generated/definitions.ts
194
+ var ConnectorID = "amazon-ses";
195
+ var ProviderID = "amazon-ses";
196
+ var CreateEmailIdentityBranch = {
197
+ Created: "created",
198
+ ProviderRejected: "providerRejected",
199
+ Uncertain: "uncertain",
200
+ Defect: "defect"
201
+ };
202
+ var CreateEmailIdentityBranchCreated = CreateEmailIdentityBranch.Created;
203
+ var CreateEmailIdentityBranchProviderRejected = CreateEmailIdentityBranch.ProviderRejected;
204
+ var CreateEmailIdentityBranchUncertain = CreateEmailIdentityBranch.Uncertain;
205
+ var CreateEmailIdentityBranchDefect = CreateEmailIdentityBranch.Defect;
206
+ var CreateEmailIdentityDefinition = {
207
+ operation: { connectorId: ConnectorID, operationId: "createEmailIdentity" },
208
+ branches: [
209
+ { id: "created", description: "SES accepted the identity for verification." },
210
+ { id: "providerRejected", description: "SES conclusively rejected the identity creation.", optional: true },
211
+ { id: "uncertain", description: "SES may have created the identity but the capped sends could not confirm it.", optional: true },
212
+ { id: "defect", description: "The identity or connection is invalid.", optional: true }
213
+ ],
214
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
215
+ repeatOnUnknown: "limited",
216
+ maxSends: 3
217
+ };
218
+ var CreateEmailIdentityMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
219
+ var GetEmailIdentityBranch = {
220
+ Found: "found",
221
+ Missing: "missing",
222
+ ProviderRejected: "providerRejected",
223
+ InvalidResponse: "invalidResponse",
224
+ Defect: "defect"
225
+ };
226
+ var GetEmailIdentityBranchFound = GetEmailIdentityBranch.Found;
227
+ var GetEmailIdentityBranchMissing = GetEmailIdentityBranch.Missing;
228
+ var GetEmailIdentityBranchProviderRejected = GetEmailIdentityBranch.ProviderRejected;
229
+ var GetEmailIdentityBranchInvalidResponse = GetEmailIdentityBranch.InvalidResponse;
230
+ var GetEmailIdentityBranchDefect = GetEmailIdentityBranch.Defect;
231
+ var GetEmailIdentityDefinition = {
232
+ operation: { connectorId: ConnectorID, operationId: "getEmailIdentity" },
233
+ branches: [
234
+ { id: "found", description: "AWS returned the identity verification status." },
235
+ { id: "missing", description: "The identity does not exist in the selected Region.", optional: true },
236
+ { id: "providerRejected", description: "AWS conclusively rejected the request or credentials.", optional: true },
237
+ { id: "invalidResponse", description: "AWS returned malformed or oversized identity metadata.", optional: true },
238
+ { id: "defect", description: "The identity, endpoint, Region, or credentials are invalid.", optional: true }
239
+ ],
240
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
241
+ };
242
+ var GetEmailIdentityMetadata = { kind: "query", idempotency: "none", authorization: "required" };
243
+ var ListEmailIdentitiesBranch = {
244
+ Page: "page",
245
+ ProviderRejected: "providerRejected",
246
+ InvalidResponse: "invalidResponse",
247
+ Defect: "defect"
248
+ };
249
+ var ListEmailIdentitiesBranchPage = ListEmailIdentitiesBranch.Page;
250
+ var ListEmailIdentitiesBranchProviderRejected = ListEmailIdentitiesBranch.ProviderRejected;
251
+ var ListEmailIdentitiesBranchInvalidResponse = ListEmailIdentitiesBranch.InvalidResponse;
252
+ var ListEmailIdentitiesBranchDefect = ListEmailIdentitiesBranch.Defect;
253
+ var ListEmailIdentitiesDefinition = {
254
+ operation: { connectorId: ConnectorID, operationId: "listEmailIdentities" },
255
+ branches: [
256
+ { id: "page", description: "AWS returned a page of identities." },
257
+ { id: "providerRejected", description: "AWS conclusively rejected the listing.", optional: true },
258
+ { id: "invalidResponse", description: "AWS returned malformed or oversized identity data.", optional: true },
259
+ { id: "defect", description: "The page size or token is invalid.", optional: true }
260
+ ],
261
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
262
+ };
263
+ var ListEmailIdentitiesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
264
+ var DeleteEmailIdentityBranch = {
265
+ Deleted: "deleted",
266
+ ProviderRejected: "providerRejected",
267
+ Defect: "defect"
268
+ };
269
+ var DeleteEmailIdentityBranchDeleted = DeleteEmailIdentityBranch.Deleted;
270
+ var DeleteEmailIdentityBranchProviderRejected = DeleteEmailIdentityBranch.ProviderRejected;
271
+ var DeleteEmailIdentityBranchDefect = DeleteEmailIdentityBranch.Defect;
272
+ var DeleteEmailIdentityDefinition = {
273
+ operation: { connectorId: ConnectorID, operationId: "deleteEmailIdentity" },
274
+ branches: [
275
+ { id: "deleted", description: "The identity is absent after the deletion." },
276
+ { id: "providerRejected", description: "AWS conclusively rejected the deletion.", optional: true },
277
+ { id: "defect", description: "The identity or connection is invalid.", optional: true }
278
+ ],
279
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
280
+ repeatOnUnknown: "safe"
281
+ };
282
+ var DeleteEmailIdentityMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
283
+ var SendEmailBranch = {
284
+ Sent: "sent",
285
+ ProviderRejected: "providerRejected",
286
+ Uncertain: "uncertain",
287
+ Defect: "defect"
288
+ };
289
+ var SendEmailBranchSent = SendEmailBranch.Sent;
290
+ var SendEmailBranchProviderRejected = SendEmailBranch.ProviderRejected;
291
+ var SendEmailBranchUncertain = SendEmailBranch.Uncertain;
292
+ var SendEmailBranchDefect = SendEmailBranch.Defect;
293
+ var SendEmailDefinition = {
294
+ operation: { connectorId: ConnectorID, operationId: "sendEmail" },
295
+ branches: [
296
+ { id: "sent", description: "SES accepted the message and returned its message ID." },
297
+ { id: "providerRejected", description: "SES definitively rejected the sender, recipient, or content.", optional: true },
298
+ { id: "uncertain", description: "The send cap was reached without confirmation; a duplicate email may have been sent.", optional: true },
299
+ { id: "defect", description: "The input or connection is invalid.", optional: true }
300
+ ],
301
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
302
+ repeatOnUnknown: "limited",
303
+ maxSends: 3
304
+ };
305
+ var SendEmailMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
306
+ var CreateEmailTemplateBranch = {
307
+ Created: "created",
308
+ ProviderRejected: "providerRejected",
309
+ Uncertain: "uncertain",
310
+ Defect: "defect"
311
+ };
312
+ var CreateEmailTemplateBranchCreated = CreateEmailTemplateBranch.Created;
313
+ var CreateEmailTemplateBranchProviderRejected = CreateEmailTemplateBranch.ProviderRejected;
314
+ var CreateEmailTemplateBranchUncertain = CreateEmailTemplateBranch.Uncertain;
315
+ var CreateEmailTemplateBranchDefect = CreateEmailTemplateBranch.Defect;
316
+ var CreateEmailTemplateDefinition = {
317
+ operation: { connectorId: ConnectorID, operationId: "createEmailTemplate" },
318
+ branches: [
319
+ { id: "created", description: "SES accepted the template creation." },
320
+ { id: "providerRejected", description: "SES conclusively refused creation or the name has different content.", optional: true },
321
+ { id: "uncertain", description: "The template might exist but the capped sends could not confirm it.", optional: true },
322
+ { id: "defect", description: "The template content or connection is invalid.", optional: true }
323
+ ],
324
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
325
+ repeatOnUnknown: "limited",
326
+ maxSends: 3
327
+ };
328
+ var CreateEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
329
+ var GetEmailTemplateBranch = {
330
+ Found: "found",
331
+ Missing: "missing",
332
+ ProviderRejected: "providerRejected",
333
+ InvalidResponse: "invalidResponse",
334
+ Defect: "defect"
335
+ };
336
+ var GetEmailTemplateBranchFound = GetEmailTemplateBranch.Found;
337
+ var GetEmailTemplateBranchMissing = GetEmailTemplateBranch.Missing;
338
+ var GetEmailTemplateBranchProviderRejected = GetEmailTemplateBranch.ProviderRejected;
339
+ var GetEmailTemplateBranchInvalidResponse = GetEmailTemplateBranch.InvalidResponse;
340
+ var GetEmailTemplateBranchDefect = GetEmailTemplateBranch.Defect;
341
+ var GetEmailTemplateDefinition = {
342
+ operation: { connectorId: ConnectorID, operationId: "getEmailTemplate" },
343
+ branches: [
344
+ { id: "found", description: "SES returned the complete template." },
345
+ { id: "missing", description: "The template does not exist.", optional: true },
346
+ { id: "providerRejected", description: "SES conclusively refused the read.", optional: true },
347
+ { id: "invalidResponse", description: "SES returned invalid or oversized template content.", optional: true },
348
+ { id: "defect", description: "The name or connection is invalid.", optional: true }
349
+ ],
350
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
351
+ };
352
+ var GetEmailTemplateMetadata = { kind: "query", idempotency: "none", authorization: "required" };
353
+ var ListEmailTemplatesBranch = {
354
+ Page: "page",
355
+ ProviderRejected: "providerRejected",
356
+ InvalidResponse: "invalidResponse",
357
+ Defect: "defect"
358
+ };
359
+ var ListEmailTemplatesBranchPage = ListEmailTemplatesBranch.Page;
360
+ var ListEmailTemplatesBranchProviderRejected = ListEmailTemplatesBranch.ProviderRejected;
361
+ var ListEmailTemplatesBranchInvalidResponse = ListEmailTemplatesBranch.InvalidResponse;
362
+ var ListEmailTemplatesBranchDefect = ListEmailTemplatesBranch.Defect;
363
+ var ListEmailTemplatesDefinition = {
364
+ operation: { connectorId: ConnectorID, operationId: "listEmailTemplates" },
365
+ branches: [
366
+ { id: "page", description: "SES returned one page of template names." },
367
+ { id: "providerRejected", description: "SES conclusively refused the listing.", optional: true },
368
+ { id: "invalidResponse", description: "SES returned invalid or oversized metadata.", optional: true },
369
+ { id: "defect", description: "The page size or token is invalid.", optional: true }
370
+ ],
371
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
372
+ };
373
+ var ListEmailTemplatesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
374
+ var UpdateEmailTemplateBranch = {
375
+ Updated: "updated",
376
+ ProviderRejected: "providerRejected",
377
+ Defect: "defect"
378
+ };
379
+ var UpdateEmailTemplateBranchUpdated = UpdateEmailTemplateBranch.Updated;
380
+ var UpdateEmailTemplateBranchProviderRejected = UpdateEmailTemplateBranch.ProviderRejected;
381
+ var UpdateEmailTemplateBranchDefect = UpdateEmailTemplateBranch.Defect;
382
+ var UpdateEmailTemplateDefinition = {
383
+ operation: { connectorId: ConnectorID, operationId: "updateEmailTemplate" },
384
+ branches: [
385
+ { id: "updated", description: "SES accepted the replacement." },
386
+ { id: "providerRejected", description: "SES conclusively refused the replacement.", optional: true },
387
+ { id: "defect", description: "The name, content, or connection is invalid.", optional: true }
388
+ ],
389
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
390
+ repeatOnUnknown: "safe"
391
+ };
392
+ var UpdateEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
393
+ var DeleteEmailTemplateBranch = {
394
+ Deleted: "deleted",
395
+ ProviderRejected: "providerRejected",
396
+ Defect: "defect"
397
+ };
398
+ var DeleteEmailTemplateBranchDeleted = DeleteEmailTemplateBranch.Deleted;
399
+ var DeleteEmailTemplateBranchProviderRejected = DeleteEmailTemplateBranch.ProviderRejected;
400
+ var DeleteEmailTemplateBranchDefect = DeleteEmailTemplateBranch.Defect;
401
+ var DeleteEmailTemplateDefinition = {
402
+ operation: { connectorId: ConnectorID, operationId: "deleteEmailTemplate" },
403
+ branches: [
404
+ { id: "deleted", description: "The template is absent." },
405
+ { id: "providerRejected", description: "SES conclusively refused deletion.", optional: true },
406
+ { id: "defect", description: "The name or connection is invalid.", optional: true }
407
+ ],
408
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
409
+ repeatOnUnknown: "safe"
410
+ };
411
+ var DeleteEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
412
+ var SendTemplatedEmailBranch = {
413
+ Sent: "sent",
414
+ ProviderRejected: "providerRejected",
415
+ Uncertain: "uncertain",
416
+ Defect: "defect"
417
+ };
418
+ var SendTemplatedEmailBranchSent = SendTemplatedEmailBranch.Sent;
419
+ var SendTemplatedEmailBranchProviderRejected = SendTemplatedEmailBranch.ProviderRejected;
420
+ var SendTemplatedEmailBranchUncertain = SendTemplatedEmailBranch.Uncertain;
421
+ var SendTemplatedEmailBranchDefect = SendTemplatedEmailBranch.Defect;
422
+ var SendTemplatedEmailDefinition = {
423
+ operation: { connectorId: ConnectorID, operationId: "sendTemplatedEmail" },
424
+ branches: [
425
+ { id: "sent", description: "SES accepted the templated message." },
426
+ { id: "providerRejected", description: "SES conclusively refused the sender, template, or recipient.", optional: true },
427
+ { id: "uncertain", description: "The send cap was reached without confirmation.", optional: true },
428
+ { id: "defect", description: "The sender, recipient, data, or connection is invalid.", optional: true }
429
+ ],
430
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
431
+ repeatOnUnknown: "limited",
432
+ maxSends: 3
433
+ };
434
+ var SendTemplatedEmailMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
435
+ var CreateCustomVerificationEmailTemplateBranch = {
436
+ Created: "created",
437
+ ProviderRejected: "providerRejected",
438
+ Uncertain: "uncertain",
439
+ Defect: "defect"
440
+ };
441
+ var CreateCustomVerificationEmailTemplateBranchCreated = CreateCustomVerificationEmailTemplateBranch.Created;
442
+ var CreateCustomVerificationEmailTemplateBranchProviderRejected = CreateCustomVerificationEmailTemplateBranch.ProviderRejected;
443
+ var CreateCustomVerificationEmailTemplateBranchUncertain = CreateCustomVerificationEmailTemplateBranch.Uncertain;
444
+ var CreateCustomVerificationEmailTemplateBranchDefect = CreateCustomVerificationEmailTemplateBranch.Defect;
445
+ var CreateCustomVerificationEmailTemplateDefinition = {
446
+ operation: { connectorId: ConnectorID, operationId: "createCustomVerificationEmailTemplate" },
447
+ branches: [
448
+ { id: "created", description: "SES accepted the template creation." },
449
+ { id: "providerRejected", description: "SES conclusively rejected creation or the name has different content.", optional: true },
450
+ { id: "uncertain", description: "Creation may have happened but could not be confirmed.", optional: true },
451
+ { id: "defect", description: "The template content or connection is invalid.", optional: true }
452
+ ],
453
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
454
+ repeatOnUnknown: "limited",
455
+ maxSends: 3
456
+ };
457
+ var CreateCustomVerificationEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
458
+ var GetCustomVerificationEmailTemplateBranch = {
459
+ Found: "found",
460
+ Missing: "missing",
461
+ ProviderRejected: "providerRejected",
462
+ InvalidResponse: "invalidResponse",
463
+ Defect: "defect"
464
+ };
465
+ var GetCustomVerificationEmailTemplateBranchFound = GetCustomVerificationEmailTemplateBranch.Found;
466
+ var GetCustomVerificationEmailTemplateBranchMissing = GetCustomVerificationEmailTemplateBranch.Missing;
467
+ var GetCustomVerificationEmailTemplateBranchProviderRejected = GetCustomVerificationEmailTemplateBranch.ProviderRejected;
468
+ var GetCustomVerificationEmailTemplateBranchInvalidResponse = GetCustomVerificationEmailTemplateBranch.InvalidResponse;
469
+ var GetCustomVerificationEmailTemplateBranchDefect = GetCustomVerificationEmailTemplateBranch.Defect;
470
+ var GetCustomVerificationEmailTemplateDefinition = {
471
+ operation: { connectorId: ConnectorID, operationId: "getCustomVerificationEmailTemplate" },
472
+ branches: [
473
+ { id: "found", description: "SES returned the verification template." },
474
+ { id: "missing", description: "The verification template is absent.", optional: true },
475
+ { id: "providerRejected", description: "SES refused the read.", optional: true },
476
+ { id: "invalidResponse", description: "SES returned invalid template content.", optional: true },
477
+ { id: "defect", description: "The name or connection is invalid.", optional: true }
478
+ ],
479
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
480
+ };
481
+ var GetCustomVerificationEmailTemplateMetadata = { kind: "query", idempotency: "none", authorization: "required" };
482
+ var ListCustomVerificationEmailTemplatesBranch = {
483
+ Page: "page",
484
+ ProviderRejected: "providerRejected",
485
+ InvalidResponse: "invalidResponse",
486
+ Defect: "defect"
487
+ };
488
+ var ListCustomVerificationEmailTemplatesBranchPage = ListCustomVerificationEmailTemplatesBranch.Page;
489
+ var ListCustomVerificationEmailTemplatesBranchProviderRejected = ListCustomVerificationEmailTemplatesBranch.ProviderRejected;
490
+ var ListCustomVerificationEmailTemplatesBranchInvalidResponse = ListCustomVerificationEmailTemplatesBranch.InvalidResponse;
491
+ var ListCustomVerificationEmailTemplatesBranchDefect = ListCustomVerificationEmailTemplatesBranch.Defect;
492
+ var ListCustomVerificationEmailTemplatesDefinition = {
493
+ operation: { connectorId: ConnectorID, operationId: "listCustomVerificationEmailTemplates" },
494
+ branches: [
495
+ { id: "page", description: "SES returned a page of verification templates." },
496
+ { id: "providerRejected", description: "SES refused the listing.", optional: true },
497
+ { id: "invalidResponse", description: "SES returned invalid template metadata.", optional: true },
498
+ { id: "defect", description: "The page size or token is invalid.", optional: true }
499
+ ],
500
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
501
+ };
502
+ var ListCustomVerificationEmailTemplatesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
503
+ var UpdateCustomVerificationEmailTemplateBranch = {
504
+ Updated: "updated",
505
+ ProviderRejected: "providerRejected",
506
+ Defect: "defect"
507
+ };
508
+ var UpdateCustomVerificationEmailTemplateBranchUpdated = UpdateCustomVerificationEmailTemplateBranch.Updated;
509
+ var UpdateCustomVerificationEmailTemplateBranchProviderRejected = UpdateCustomVerificationEmailTemplateBranch.ProviderRejected;
510
+ var UpdateCustomVerificationEmailTemplateBranchDefect = UpdateCustomVerificationEmailTemplateBranch.Defect;
511
+ var UpdateCustomVerificationEmailTemplateDefinition = {
512
+ operation: { connectorId: ConnectorID, operationId: "updateCustomVerificationEmailTemplate" },
513
+ branches: [
514
+ { id: "updated", description: "SES accepted the absolute replacement." },
515
+ { id: "providerRejected", description: "SES refused the replacement.", optional: true },
516
+ { id: "defect", description: "The template content or connection is invalid.", optional: true }
517
+ ],
518
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
519
+ repeatOnUnknown: "safe"
520
+ };
521
+ var UpdateCustomVerificationEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
522
+ var DeleteCustomVerificationEmailTemplateBranch = {
523
+ Deleted: "deleted",
524
+ ProviderRejected: "providerRejected",
525
+ Defect: "defect"
526
+ };
527
+ var DeleteCustomVerificationEmailTemplateBranchDeleted = DeleteCustomVerificationEmailTemplateBranch.Deleted;
528
+ var DeleteCustomVerificationEmailTemplateBranchProviderRejected = DeleteCustomVerificationEmailTemplateBranch.ProviderRejected;
529
+ var DeleteCustomVerificationEmailTemplateBranchDefect = DeleteCustomVerificationEmailTemplateBranch.Defect;
530
+ var DeleteCustomVerificationEmailTemplateDefinition = {
531
+ operation: { connectorId: ConnectorID, operationId: "deleteCustomVerificationEmailTemplate" },
532
+ branches: [
533
+ { id: "deleted", description: "The template is absent." },
534
+ { id: "providerRejected", description: "SES refused the deletion.", optional: true },
535
+ { id: "defect", description: "The template name or connection is invalid.", optional: true }
536
+ ],
537
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
538
+ repeatOnUnknown: "safe"
539
+ };
540
+ var DeleteCustomVerificationEmailTemplateMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
541
+ var SendCustomVerificationEmailBranch = {
542
+ Sent: "sent",
543
+ ProviderRejected: "providerRejected",
544
+ Uncertain: "uncertain",
545
+ Defect: "defect"
546
+ };
547
+ var SendCustomVerificationEmailBranchSent = SendCustomVerificationEmailBranch.Sent;
548
+ var SendCustomVerificationEmailBranchProviderRejected = SendCustomVerificationEmailBranch.ProviderRejected;
549
+ var SendCustomVerificationEmailBranchUncertain = SendCustomVerificationEmailBranch.Uncertain;
550
+ var SendCustomVerificationEmailBranchDefect = SendCustomVerificationEmailBranch.Defect;
551
+ var SendCustomVerificationEmailDefinition = {
552
+ operation: { connectorId: ConnectorID, operationId: "sendCustomVerificationEmail" },
553
+ branches: [
554
+ { id: "sent", description: "SES accepted the verification email." },
555
+ { id: "providerRejected", description: "SES refused the template or recipient.", optional: true },
556
+ { id: "uncertain", description: "The send cap was reached without confirmation.", optional: true },
557
+ { id: "defect", description: "The template, recipient, or connection is invalid.", optional: true }
558
+ ],
559
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
560
+ repeatOnUnknown: "limited",
561
+ maxSends: 3
562
+ };
563
+ var SendCustomVerificationEmailMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
564
+
565
+ // src/generated/connection.ts
566
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
567
+ var Connection = class {
568
+ /** Stable provider and connection name. */
569
+ reference;
570
+ /** Bound provider operations. */
571
+ operations;
572
+ /** Validate a reference and bind operations. */
573
+ constructor(reference, operations) {
574
+ this.reference = ConnectionRefSchema.parse(reference);
575
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
576
+ if (!operations) throw new TypeError("connector operations are required");
577
+ this.operations = operations;
578
+ }
579
+ };
580
+ function newConnection(client, reference) {
581
+ if (!client) throw new TypeError("connector client is required");
582
+ return new Connection(reference, client);
583
+ }
584
+ function newConnectionWithOperations(operations, reference) {
585
+ return new Connection(reference, operations);
586
+ }
587
+ function newProjectConnection(project, connectionName, createClient) {
588
+ if (!project) throw new TypeError("loaded project is required");
589
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
590
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
591
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
592
+ return newConnection(createClient(project, connectionName), reference);
593
+ }
594
+
595
+ export {
596
+ ConfigSchema,
597
+ CredentialMaterialError,
598
+ isCredentialMaterialError,
599
+ decodeCredentials,
600
+ CreateEmailIdentityInputSchema,
601
+ CreatedEmailIdentitySchema,
602
+ GetEmailIdentityInputSchema,
603
+ EmailIdentityDetailsSchema,
604
+ ListEmailIdentitiesInputSchema,
605
+ EmailIdentitySummarySchema,
606
+ EmailIdentityPageSchema,
607
+ DeleteEmailIdentityInputSchema,
608
+ DeletedEmailIdentitySchema,
609
+ SendEmailInputSchema,
610
+ SentEmailSchema,
611
+ EmailTemplateContentSchema,
612
+ CreateEmailTemplateInputSchema,
613
+ EmailTemplateSchema,
614
+ GetEmailTemplateInputSchema,
615
+ ListEmailTemplatesInputSchema,
616
+ EmailTemplateSummarySchema,
617
+ EmailTemplatePageSchema,
618
+ UpdateEmailTemplateInputSchema,
619
+ DeleteEmailTemplateInputSchema,
620
+ DeletedEmailTemplateSchema,
621
+ SendTemplatedEmailInputSchema,
622
+ CustomVerificationEmailTemplateSchema,
623
+ CreateCustomVerificationEmailTemplateInputSchema,
624
+ GetCustomVerificationEmailTemplateInputSchema,
625
+ ListCustomVerificationEmailTemplatesInputSchema,
626
+ CustomVerificationEmailTemplateSummarySchema,
627
+ CustomVerificationEmailTemplatePageSchema,
628
+ UpdateCustomVerificationEmailTemplateInputSchema,
629
+ DeleteCustomVerificationEmailTemplateInputSchema,
630
+ SendCustomVerificationEmailInputSchema,
631
+ ConnectorID,
632
+ ProviderID,
633
+ CreateEmailIdentityBranch,
634
+ CreateEmailIdentityBranchCreated,
635
+ CreateEmailIdentityBranchProviderRejected,
636
+ CreateEmailIdentityBranchUncertain,
637
+ CreateEmailIdentityBranchDefect,
638
+ CreateEmailIdentityDefinition,
639
+ CreateEmailIdentityMetadata,
640
+ GetEmailIdentityBranch,
641
+ GetEmailIdentityBranchFound,
642
+ GetEmailIdentityBranchMissing,
643
+ GetEmailIdentityBranchProviderRejected,
644
+ GetEmailIdentityBranchInvalidResponse,
645
+ GetEmailIdentityBranchDefect,
646
+ GetEmailIdentityDefinition,
647
+ GetEmailIdentityMetadata,
648
+ ListEmailIdentitiesBranch,
649
+ ListEmailIdentitiesBranchPage,
650
+ ListEmailIdentitiesBranchProviderRejected,
651
+ ListEmailIdentitiesBranchInvalidResponse,
652
+ ListEmailIdentitiesBranchDefect,
653
+ ListEmailIdentitiesDefinition,
654
+ ListEmailIdentitiesMetadata,
655
+ DeleteEmailIdentityBranch,
656
+ DeleteEmailIdentityBranchDeleted,
657
+ DeleteEmailIdentityBranchProviderRejected,
658
+ DeleteEmailIdentityBranchDefect,
659
+ DeleteEmailIdentityDefinition,
660
+ DeleteEmailIdentityMetadata,
661
+ SendEmailBranch,
662
+ SendEmailBranchSent,
663
+ SendEmailBranchProviderRejected,
664
+ SendEmailBranchUncertain,
665
+ SendEmailBranchDefect,
666
+ SendEmailDefinition,
667
+ SendEmailMetadata,
668
+ CreateEmailTemplateBranch,
669
+ CreateEmailTemplateBranchCreated,
670
+ CreateEmailTemplateBranchProviderRejected,
671
+ CreateEmailTemplateBranchUncertain,
672
+ CreateEmailTemplateBranchDefect,
673
+ CreateEmailTemplateDefinition,
674
+ CreateEmailTemplateMetadata,
675
+ GetEmailTemplateBranch,
676
+ GetEmailTemplateBranchFound,
677
+ GetEmailTemplateBranchMissing,
678
+ GetEmailTemplateBranchProviderRejected,
679
+ GetEmailTemplateBranchInvalidResponse,
680
+ GetEmailTemplateBranchDefect,
681
+ GetEmailTemplateDefinition,
682
+ GetEmailTemplateMetadata,
683
+ ListEmailTemplatesBranch,
684
+ ListEmailTemplatesBranchPage,
685
+ ListEmailTemplatesBranchProviderRejected,
686
+ ListEmailTemplatesBranchInvalidResponse,
687
+ ListEmailTemplatesBranchDefect,
688
+ ListEmailTemplatesDefinition,
689
+ ListEmailTemplatesMetadata,
690
+ UpdateEmailTemplateBranch,
691
+ UpdateEmailTemplateBranchUpdated,
692
+ UpdateEmailTemplateBranchProviderRejected,
693
+ UpdateEmailTemplateBranchDefect,
694
+ UpdateEmailTemplateDefinition,
695
+ UpdateEmailTemplateMetadata,
696
+ DeleteEmailTemplateBranch,
697
+ DeleteEmailTemplateBranchDeleted,
698
+ DeleteEmailTemplateBranchProviderRejected,
699
+ DeleteEmailTemplateBranchDefect,
700
+ DeleteEmailTemplateDefinition,
701
+ DeleteEmailTemplateMetadata,
702
+ SendTemplatedEmailBranch,
703
+ SendTemplatedEmailBranchSent,
704
+ SendTemplatedEmailBranchProviderRejected,
705
+ SendTemplatedEmailBranchUncertain,
706
+ SendTemplatedEmailBranchDefect,
707
+ SendTemplatedEmailDefinition,
708
+ SendTemplatedEmailMetadata,
709
+ CreateCustomVerificationEmailTemplateBranch,
710
+ CreateCustomVerificationEmailTemplateBranchCreated,
711
+ CreateCustomVerificationEmailTemplateBranchProviderRejected,
712
+ CreateCustomVerificationEmailTemplateBranchUncertain,
713
+ CreateCustomVerificationEmailTemplateBranchDefect,
714
+ CreateCustomVerificationEmailTemplateDefinition,
715
+ CreateCustomVerificationEmailTemplateMetadata,
716
+ GetCustomVerificationEmailTemplateBranch,
717
+ GetCustomVerificationEmailTemplateBranchFound,
718
+ GetCustomVerificationEmailTemplateBranchMissing,
719
+ GetCustomVerificationEmailTemplateBranchProviderRejected,
720
+ GetCustomVerificationEmailTemplateBranchInvalidResponse,
721
+ GetCustomVerificationEmailTemplateBranchDefect,
722
+ GetCustomVerificationEmailTemplateDefinition,
723
+ GetCustomVerificationEmailTemplateMetadata,
724
+ ListCustomVerificationEmailTemplatesBranch,
725
+ ListCustomVerificationEmailTemplatesBranchPage,
726
+ ListCustomVerificationEmailTemplatesBranchProviderRejected,
727
+ ListCustomVerificationEmailTemplatesBranchInvalidResponse,
728
+ ListCustomVerificationEmailTemplatesBranchDefect,
729
+ ListCustomVerificationEmailTemplatesDefinition,
730
+ ListCustomVerificationEmailTemplatesMetadata,
731
+ UpdateCustomVerificationEmailTemplateBranch,
732
+ UpdateCustomVerificationEmailTemplateBranchUpdated,
733
+ UpdateCustomVerificationEmailTemplateBranchProviderRejected,
734
+ UpdateCustomVerificationEmailTemplateBranchDefect,
735
+ UpdateCustomVerificationEmailTemplateDefinition,
736
+ UpdateCustomVerificationEmailTemplateMetadata,
737
+ DeleteCustomVerificationEmailTemplateBranch,
738
+ DeleteCustomVerificationEmailTemplateBranchDeleted,
739
+ DeleteCustomVerificationEmailTemplateBranchProviderRejected,
740
+ DeleteCustomVerificationEmailTemplateBranchDefect,
741
+ DeleteCustomVerificationEmailTemplateDefinition,
742
+ DeleteCustomVerificationEmailTemplateMetadata,
743
+ SendCustomVerificationEmailBranch,
744
+ SendCustomVerificationEmailBranchSent,
745
+ SendCustomVerificationEmailBranchProviderRejected,
746
+ SendCustomVerificationEmailBranchUncertain,
747
+ SendCustomVerificationEmailBranchDefect,
748
+ SendCustomVerificationEmailDefinition,
749
+ SendCustomVerificationEmailMetadata,
750
+ Connection,
751
+ newConnection,
752
+ newConnectionWithOperations,
753
+ newProjectConnection
754
+ };