@superdurable/connector-constantcontact 0.1.0 → 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,832 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var nativeJSON = JSON;
5
+ var signedIntegerToken = /^-?(?:0|[1-9][0-9]*)$/;
6
+ var minimumSignedInteger = -(1n << 63n);
7
+ var maximumSignedInteger = (1n << 63n) - 1n;
8
+ function decodeSignedInteger(value) {
9
+ if (typeof value === "number" && Number.isSafeInteger(value)) return value === 0 ? 0 : value;
10
+ if (!nativeJSON.isRawJSON(value) || value.rawJSON.length > 20 || !signedIntegerToken.test(value.rawJSON)) {
11
+ throw new TypeError("expected a signed 64-bit integer");
12
+ }
13
+ const integer = BigInt(value.rawJSON);
14
+ if (integer < minimumSignedInteger || integer > maximumSignedInteger) throw new RangeError("signed 64-bit integer out of range");
15
+ const number = Number(integer);
16
+ return Number.isSafeInteger(number) ? number : value;
17
+ }
18
+ var signedIntegerSchema = z.unknown().transform((value, context) => {
19
+ try {
20
+ return decodeSignedInteger(value);
21
+ } catch {
22
+ context.addIssue({ code: "custom", message: "expected a signed 64-bit integer" });
23
+ return z.NEVER;
24
+ }
25
+ });
26
+ function parseJSONNumberTokens(text) {
27
+ return JSON.parse(text, (_key, value, context) => typeof value === "number" && context?.source !== void 0 ? nativeJSON.rawJSON(context.source) : value);
28
+ }
29
+ function parseExactIntegerJSON(text) {
30
+ return JSON.parse(text, (_key, field, context) => typeof field === "number" && !Number.isSafeInteger(field) && context?.source && signedIntegerToken.test(context.source) ? nativeJSON.rawJSON(context.source) : field);
31
+ }
32
+ function exactIntegerJSONCodec(decode) {
33
+ return {
34
+ typeName: "json",
35
+ wireKind: "json",
36
+ encode(value) {
37
+ const data = JSON.stringify(value, (_key, field) => {
38
+ if (typeof field === "number" && Number.isInteger(field) && !Number.isSafeInteger(field)) {
39
+ throw new RangeError("use a raw JSON token for integers outside the safe number range");
40
+ }
41
+ return field;
42
+ });
43
+ if (data === void 0) throw new TypeError("value cannot be encoded as JSON");
44
+ return { kind: "json", data };
45
+ },
46
+ decode(wire) {
47
+ if (wire.kind !== "json" || typeof wire.data !== "string") throw new TypeError("expected Dex JSON wire data");
48
+ const value = parseExactIntegerJSON(wire.data);
49
+ return decode ? decode(value) : value;
50
+ }
51
+ };
52
+ }
53
+ var ConfigSchema = z.object({
54
+ "baseUrl": z.string().optional(),
55
+ "timeoutMs": z.number().int().optional(),
56
+ "maxResponseBytes": z.number().int().optional()
57
+ });
58
+ var CredentialMaterialError = class extends TypeError {
59
+ constructor(message) {
60
+ super(message);
61
+ this.name = "CredentialMaterialError";
62
+ }
63
+ };
64
+ var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
65
+ "project credential decoding failed",
66
+ "shared project credential decoding failed",
67
+ "project credential decoding failed: this connector version does not support shared credentials"
68
+ ]);
69
+ function isCredentialMaterialError(error) {
70
+ return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
71
+ }
72
+ function decodeCredentials(value) {
73
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
74
+ const fields = value;
75
+ const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
76
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
77
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
78
+ if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
79
+ if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
80
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
81
+ const credentials = {};
82
+ if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
83
+ credentials.oauthClientId = fields["oauth_client_id"] ?? "";
84
+ if (!fields["oauth_client_secret"]) throw new CredentialMaterialError("credential oauth_client_secret is required");
85
+ credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
86
+ if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
87
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
88
+ if (!fields["refresh_token"]) throw new CredentialMaterialError("credential refresh_token is required");
89
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
90
+ return credentials;
91
+ }
92
+ function decodeSharedCredentials(value) {
93
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
94
+ const fields = value;
95
+ const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
96
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
97
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
98
+ if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
99
+ if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
100
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
101
+ const credentials = {};
102
+ if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
103
+ credentials.oauthClientId = fields["oauth_client_id"] ?? "";
104
+ credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
105
+ if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
106
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
107
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
108
+ return credentials;
109
+ }
110
+ var GetSegmentInputSchema = z.strictObject({
111
+ "segmentId": signedIntegerSchema
112
+ });
113
+ var SegmentMetadataSchema = z.strictObject({
114
+ "segmentId": signedIntegerSchema,
115
+ "name": z.string(),
116
+ "segmentCriteria": z.string().optional()
117
+ });
118
+ var ListSegmentsInputSchema = z.strictObject({
119
+ "limit": z.number().int().optional(),
120
+ "sortBy": z.string().optional(),
121
+ "cursor": z.string().optional()
122
+ });
123
+ var SegmentsPageSchema = z.strictObject({
124
+ "segments": z.array(SegmentMetadataSchema).nullable(),
125
+ "nextCursor": z.string().optional()
126
+ });
127
+ var CreateSegmentInputSchema = z.strictObject({
128
+ "name": z.string(),
129
+ "segmentCriteria": z.string()
130
+ });
131
+ var UpdateSegmentInputSchema = z.strictObject({
132
+ "segmentId": signedIntegerSchema,
133
+ "name": z.string(),
134
+ "segmentCriteria": z.string()
135
+ });
136
+ var DeleteSegmentInputSchema = z.strictObject({
137
+ "segmentId": signedIntegerSchema
138
+ });
139
+ var DeleteSegmentOutputSchema = z.strictObject({
140
+ "segmentId": signedIntegerSchema
141
+ });
142
+ var GetActivityInputSchema = z.strictObject({
143
+ "activityId": z.string()
144
+ });
145
+ var ActivityMetadataSchema = z.strictObject({
146
+ "activityId": z.string(),
147
+ "state": z.string(),
148
+ "percentDone": signedIntegerSchema,
149
+ "itemsTotalCount": signedIntegerSchema.optional(),
150
+ "itemsCompletedCount": signedIntegerSchema.optional()
151
+ });
152
+ var ListActivitiesInputSchema = z.strictObject({
153
+ "maxItems": z.number().int().optional()
154
+ });
155
+ var ActivitiesPageSchema = z.strictObject({
156
+ "activities": z.array(ActivityMetadataSchema).nullable()
157
+ });
158
+ var CreateContactInputSchema = z.strictObject({
159
+ "emailAddress": z.string(),
160
+ "firstName": z.string().optional(),
161
+ "lastName": z.string().optional(),
162
+ "emailPermission": z.string(),
163
+ "createSource": z.string()
164
+ });
165
+ var ContactMetadataSchema = z.strictObject({
166
+ "contactId": z.string(),
167
+ "emailAddress": z.string().optional(),
168
+ "firstName": z.string().optional(),
169
+ "lastName": z.string().optional(),
170
+ "emailPermission": z.string().optional()
171
+ });
172
+ var ListContactsInputSchema = z.strictObject({
173
+ "emailAddress": z.string().optional(),
174
+ "limit": z.number().int().optional(),
175
+ "cursor": z.string().optional()
176
+ });
177
+ var ContactsPageSchema = z.strictObject({
178
+ "contacts": z.array(ContactMetadataSchema).nullable(),
179
+ "nextCursor": z.string().optional()
180
+ });
181
+ var UpdateContactInputSchema = z.strictObject({
182
+ "contactId": z.string(),
183
+ "updateSource": z.string(),
184
+ "firstName": z.string().optional(),
185
+ "lastName": z.string().optional(),
186
+ "jobTitle": z.string().optional(),
187
+ "companyName": z.string().optional()
188
+ });
189
+ var DeleteContactInputSchema = z.strictObject({
190
+ "contactId": z.string()
191
+ });
192
+ var DeleteContactOutputSchema = z.strictObject({
193
+ "contactId": z.string()
194
+ });
195
+ var GetContactInputSchema = z.strictObject({
196
+ "contactId": z.string()
197
+ });
198
+ var GetContactListInputSchema = z.strictObject({
199
+ "listId": z.string()
200
+ });
201
+ var ContactListMetadataSchema = z.strictObject({
202
+ "listId": z.string(),
203
+ "name": z.string(),
204
+ "description": z.string().optional(),
205
+ "favorite": z.boolean()
206
+ });
207
+ var ListContactListsInputSchema = z.strictObject({
208
+ "limit": z.number().int().optional(),
209
+ "name": z.string().optional()
210
+ });
211
+ var ContactListsPageSchema = z.strictObject({
212
+ "lists": z.array(ContactListMetadataSchema).nullable()
213
+ });
214
+ var CreateContactListInputSchema = z.strictObject({
215
+ "name": z.string(),
216
+ "description": z.string().optional(),
217
+ "favorite": z.boolean()
218
+ });
219
+ var UpdateContactListInputSchema = z.strictObject({
220
+ "listId": z.string(),
221
+ "name": z.string(),
222
+ "description": z.string(),
223
+ "favorite": z.boolean()
224
+ });
225
+ var DeleteContactListInputSchema = z.strictObject({
226
+ "listId": z.string()
227
+ });
228
+ var DeleteContactListOutputSchema = z.strictObject({
229
+ "listId": z.string(),
230
+ "activityId": z.string()
231
+ });
232
+
233
+ // src/generated/definitions.ts
234
+ var ConnectorID = "constantcontact";
235
+ var ProviderID = "constantcontact";
236
+ var GetSegmentBranch = {
237
+ Found: "found",
238
+ NotFound: "notFound",
239
+ ProviderRejected: "providerRejected",
240
+ InvalidResponse: "invalidResponse",
241
+ Defect: "defect"
242
+ };
243
+ var GetSegmentBranchFound = GetSegmentBranch.Found;
244
+ var GetSegmentBranchNotFound = GetSegmentBranch.NotFound;
245
+ var GetSegmentBranchProviderRejected = GetSegmentBranch.ProviderRejected;
246
+ var GetSegmentBranchInvalidResponse = GetSegmentBranch.InvalidResponse;
247
+ var GetSegmentBranchDefect = GetSegmentBranch.Defect;
248
+ var GetSegmentDefinition = {
249
+ operation: { connectorId: ConnectorID, operationId: "getSegment" },
250
+ branches: [
251
+ { id: "found", description: "Constant Contact returned the segment." },
252
+ { id: "notFound", description: "The segment does not exist.", optional: true },
253
+ { id: "providerRejected", description: "Constant Contact rejected the lookup.", optional: true },
254
+ { id: "invalidResponse", description: "Constant Contact returned malformed segment JSON.", optional: true },
255
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
256
+ ],
257
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
258
+ };
259
+ var GetSegmentMetadata = { kind: "query", idempotency: "none", authorization: "required" };
260
+ var ListSegmentsBranch = {
261
+ Listed: "listed",
262
+ ProviderRejected: "providerRejected",
263
+ InvalidResponse: "invalidResponse",
264
+ Defect: "defect"
265
+ };
266
+ var ListSegmentsBranchListed = ListSegmentsBranch.Listed;
267
+ var ListSegmentsBranchProviderRejected = ListSegmentsBranch.ProviderRejected;
268
+ var ListSegmentsBranchInvalidResponse = ListSegmentsBranch.InvalidResponse;
269
+ var ListSegmentsBranchDefect = ListSegmentsBranch.Defect;
270
+ var ListSegmentsDefinition = {
271
+ operation: { connectorId: ConnectorID, operationId: "listSegments" },
272
+ branches: [
273
+ { id: "listed", description: "Constant Contact returned a segment page." },
274
+ { id: "providerRejected", description: "Constant Contact rejected the lookup.", optional: true },
275
+ { id: "invalidResponse", description: "Constant Contact returned malformed segment JSON.", optional: true },
276
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
277
+ ],
278
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
279
+ };
280
+ var ListSegmentsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
281
+ var CreateSegmentBranch = {
282
+ Created: "created",
283
+ Uncertain: "uncertain",
284
+ AlreadyExists: "alreadyExists",
285
+ ProviderRejected: "providerRejected",
286
+ Defect: "defect"
287
+ };
288
+ var CreateSegmentBranchCreated = CreateSegmentBranch.Created;
289
+ var CreateSegmentBranchUncertain = CreateSegmentBranch.Uncertain;
290
+ var CreateSegmentBranchAlreadyExists = CreateSegmentBranch.AlreadyExists;
291
+ var CreateSegmentBranchProviderRejected = CreateSegmentBranch.ProviderRejected;
292
+ var CreateSegmentBranchDefect = CreateSegmentBranch.Defect;
293
+ var CreateSegmentDefinition = {
294
+ operation: { connectorId: ConnectorID, operationId: "createSegment" },
295
+ branches: [
296
+ { id: "created", description: "Constant Contact created the segment." },
297
+ { id: "uncertain", description: "An earlier segment creation could not be confirmed after the send cap.", optional: true },
298
+ { id: "alreadyExists", description: "No longer selected; a 409 cannot prove this segment was not created.", optional: true },
299
+ { id: "providerRejected", description: "Constant Contact rejected creation.", optional: true },
300
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
301
+ ],
302
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
303
+ repeatOnUnknown: "limited",
304
+ maxSends: 3
305
+ };
306
+ var CreateSegmentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
307
+ var UpdateSegmentBranch = {
308
+ Updated: "updated",
309
+ NotFound: "notFound",
310
+ ProviderRejected: "providerRejected",
311
+ InvalidResponse: "invalidResponse",
312
+ Defect: "defect"
313
+ };
314
+ var UpdateSegmentBranchUpdated = UpdateSegmentBranch.Updated;
315
+ var UpdateSegmentBranchNotFound = UpdateSegmentBranch.NotFound;
316
+ var UpdateSegmentBranchProviderRejected = UpdateSegmentBranch.ProviderRejected;
317
+ var UpdateSegmentBranchInvalidResponse = UpdateSegmentBranch.InvalidResponse;
318
+ var UpdateSegmentBranchDefect = UpdateSegmentBranch.Defect;
319
+ var UpdateSegmentDefinition = {
320
+ operation: { connectorId: ConnectorID, operationId: "updateSegment" },
321
+ branches: [
322
+ { id: "updated", description: "Constant Contact updated the segment." },
323
+ { id: "notFound", description: "The segment does not exist.", optional: true },
324
+ { id: "providerRejected", description: "Constant Contact rejected the update.", optional: true },
325
+ { id: "invalidResponse", description: "Constant Contact returned malformed segment JSON.", optional: true },
326
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
327
+ ],
328
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
329
+ repeatOnUnknown: "safe"
330
+ };
331
+ var UpdateSegmentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
332
+ var DeleteSegmentBranch = {
333
+ Deleted: "deleted",
334
+ NotFound: "notFound",
335
+ ProviderRejected: "providerRejected",
336
+ Defect: "defect"
337
+ };
338
+ var DeleteSegmentBranchDeleted = DeleteSegmentBranch.Deleted;
339
+ var DeleteSegmentBranchNotFound = DeleteSegmentBranch.NotFound;
340
+ var DeleteSegmentBranchProviderRejected = DeleteSegmentBranch.ProviderRejected;
341
+ var DeleteSegmentBranchDefect = DeleteSegmentBranch.Defect;
342
+ var DeleteSegmentDefinition = {
343
+ operation: { connectorId: ConnectorID, operationId: "deleteSegment" },
344
+ branches: [
345
+ { id: "deleted", description: "Constant Contact deleted the segment." },
346
+ { id: "notFound", description: "The segment does not exist.", optional: true },
347
+ { id: "providerRejected", description: "Constant Contact rejected deletion.", optional: true },
348
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
349
+ ],
350
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
351
+ repeatOnUnknown: "safe"
352
+ };
353
+ var DeleteSegmentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
354
+ var GetActivityBranch = {
355
+ Found: "found",
356
+ NotFound: "notFound",
357
+ ProviderRejected: "providerRejected",
358
+ InvalidResponse: "invalidResponse",
359
+ Defect: "defect"
360
+ };
361
+ var GetActivityBranchFound = GetActivityBranch.Found;
362
+ var GetActivityBranchNotFound = GetActivityBranch.NotFound;
363
+ var GetActivityBranchProviderRejected = GetActivityBranch.ProviderRejected;
364
+ var GetActivityBranchInvalidResponse = GetActivityBranch.InvalidResponse;
365
+ var GetActivityBranchDefect = GetActivityBranch.Defect;
366
+ var GetActivityDefinition = {
367
+ operation: { connectorId: ConnectorID, operationId: "getActivity" },
368
+ branches: [
369
+ { id: "found", description: "Constant Contact returned the activity." },
370
+ { id: "notFound", description: "The activity is absent or older than ten days.", optional: true },
371
+ { id: "providerRejected", description: "Constant Contact rejected the lookup.", optional: true },
372
+ { id: "invalidResponse", description: "Constant Contact returned malformed activity JSON.", optional: true },
373
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
374
+ ],
375
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
376
+ };
377
+ var GetActivityMetadata = { kind: "query", idempotency: "none", authorization: "required" };
378
+ var ListActivitiesBranch = {
379
+ Listed: "listed",
380
+ ProviderRejected: "providerRejected",
381
+ InvalidResponse: "invalidResponse",
382
+ Defect: "defect"
383
+ };
384
+ var ListActivitiesBranchListed = ListActivitiesBranch.Listed;
385
+ var ListActivitiesBranchProviderRejected = ListActivitiesBranch.ProviderRejected;
386
+ var ListActivitiesBranchInvalidResponse = ListActivitiesBranch.InvalidResponse;
387
+ var ListActivitiesBranchDefect = ListActivitiesBranch.Defect;
388
+ var ListActivitiesDefinition = {
389
+ operation: { connectorId: ConnectorID, operationId: "listActivities" },
390
+ branches: [
391
+ { id: "listed", description: "Constant Contact returned recent activities." },
392
+ { id: "providerRejected", description: "Constant Contact rejected the lookup.", optional: true },
393
+ { id: "invalidResponse", description: "Constant Contact returned malformed activity JSON.", optional: true },
394
+ { id: "defect", description: "Credentials are invalid.", optional: true }
395
+ ],
396
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
397
+ };
398
+ var ListActivitiesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
399
+ var CreateContactBranch = {
400
+ Created: "created",
401
+ Uncertain: "uncertain",
402
+ AlreadyExists: "alreadyExists",
403
+ ProviderRejected: "providerRejected",
404
+ Defect: "defect"
405
+ };
406
+ var CreateContactBranchCreated = CreateContactBranch.Created;
407
+ var CreateContactBranchUncertain = CreateContactBranch.Uncertain;
408
+ var CreateContactBranchAlreadyExists = CreateContactBranch.AlreadyExists;
409
+ var CreateContactBranchProviderRejected = CreateContactBranch.ProviderRejected;
410
+ var CreateContactBranchDefect = CreateContactBranch.Defect;
411
+ var CreateContactDefinition = {
412
+ operation: { connectorId: ConnectorID, operationId: "createContact" },
413
+ branches: [
414
+ { id: "created", description: "Constant Contact created the contact." },
415
+ { id: "uncertain", description: "An earlier contact creation could not be confirmed after the send cap.", optional: true },
416
+ { id: "alreadyExists", description: "No longer selected; a 409 cannot prove this contact was not created.", optional: true },
417
+ { id: "providerRejected", description: "Constant Contact rejected the creation.", optional: true },
418
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
419
+ ],
420
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
421
+ repeatOnUnknown: "limited",
422
+ maxSends: 3
423
+ };
424
+ var CreateContactMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
425
+ var ListContactsBranch = {
426
+ Listed: "listed",
427
+ ProviderRejected: "providerRejected",
428
+ InvalidResponse: "invalidResponse",
429
+ Defect: "defect"
430
+ };
431
+ var ListContactsBranchListed = ListContactsBranch.Listed;
432
+ var ListContactsBranchProviderRejected = ListContactsBranch.ProviderRejected;
433
+ var ListContactsBranchInvalidResponse = ListContactsBranch.InvalidResponse;
434
+ var ListContactsBranchDefect = ListContactsBranch.Defect;
435
+ var ListContactsDefinition = {
436
+ operation: { connectorId: ConnectorID, operationId: "listContacts" },
437
+ branches: [
438
+ { id: "listed", description: "Constant Contact returned a page of contacts." },
439
+ { id: "providerRejected", description: "Constant Contact rejected the search.", optional: true },
440
+ { id: "invalidResponse", description: "Constant Contact returned malformed or oversized JSON.", optional: true },
441
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
442
+ ],
443
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
444
+ };
445
+ var ListContactsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
446
+ var UpdateContactBranch = {
447
+ Updated: "updated",
448
+ NotFound: "notFound",
449
+ ProviderRejected: "providerRejected",
450
+ InvalidResponse: "invalidResponse",
451
+ Defect: "defect"
452
+ };
453
+ var UpdateContactBranchUpdated = UpdateContactBranch.Updated;
454
+ var UpdateContactBranchNotFound = UpdateContactBranch.NotFound;
455
+ var UpdateContactBranchProviderRejected = UpdateContactBranch.ProviderRejected;
456
+ var UpdateContactBranchInvalidResponse = UpdateContactBranch.InvalidResponse;
457
+ var UpdateContactBranchDefect = UpdateContactBranch.Defect;
458
+ var UpdateContactDefinition = {
459
+ operation: { connectorId: ConnectorID, operationId: "updateContact" },
460
+ branches: [
461
+ { id: "updated", description: "Constant Contact updated the contact." },
462
+ { id: "notFound", description: "The contact does not exist.", optional: true },
463
+ { id: "providerRejected", description: "Constant Contact rejected the update.", optional: true },
464
+ { id: "invalidResponse", description: "Constant Contact returned malformed contact JSON.", optional: true },
465
+ { id: "defect", description: "Input or credentials are invalid.", optional: true }
466
+ ],
467
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
468
+ repeatOnUnknown: "safe"
469
+ };
470
+ var UpdateContactMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
471
+ var DeleteContactBranch = {
472
+ Deleted: "deleted",
473
+ NotFound: "notFound",
474
+ ProviderRejected: "providerRejected",
475
+ Defect: "defect"
476
+ };
477
+ var DeleteContactBranchDeleted = DeleteContactBranch.Deleted;
478
+ var DeleteContactBranchNotFound = DeleteContactBranch.NotFound;
479
+ var DeleteContactBranchProviderRejected = DeleteContactBranch.ProviderRejected;
480
+ var DeleteContactBranchDefect = DeleteContactBranch.Defect;
481
+ var DeleteContactDefinition = {
482
+ operation: { connectorId: ConnectorID, operationId: "deleteContact" },
483
+ branches: [
484
+ { id: "deleted", description: "Constant Contact deleted the contact." },
485
+ { id: "notFound", description: "The contact was already absent.", optional: true },
486
+ { id: "providerRejected", description: "Constant Contact rejected the deletion.", optional: true },
487
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
488
+ ],
489
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
490
+ repeatOnUnknown: "safe"
491
+ };
492
+ var DeleteContactMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
493
+ var GetContactBranch = {
494
+ Found: "found",
495
+ NotFound: "notFound",
496
+ ProviderRejected: "providerRejected",
497
+ InvalidResponse: "invalidResponse",
498
+ Defect: "defect"
499
+ };
500
+ var GetContactBranchFound = GetContactBranch.Found;
501
+ var GetContactBranchNotFound = GetContactBranch.NotFound;
502
+ var GetContactBranchProviderRejected = GetContactBranch.ProviderRejected;
503
+ var GetContactBranchInvalidResponse = GetContactBranch.InvalidResponse;
504
+ var GetContactBranchDefect = GetContactBranch.Defect;
505
+ var GetContactDefinition = {
506
+ operation: { connectorId: ConnectorID, operationId: "getContact" },
507
+ branches: [
508
+ { id: "found", description: "Constant Contact returned the contact." },
509
+ { id: "notFound", description: "The contact does not exist or is inaccessible.", optional: true },
510
+ { id: "providerRejected", description: "Constant Contact conclusively rejected the request.", optional: true },
511
+ { id: "invalidResponse", description: "Constant Contact returned malformed or oversized JSON.", optional: true },
512
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
513
+ ],
514
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
515
+ };
516
+ var GetContactMetadata = { kind: "query", idempotency: "none", authorization: "required" };
517
+ var GetContactListBranch = {
518
+ Found: "found",
519
+ NotFound: "notFound",
520
+ ProviderRejected: "providerRejected",
521
+ InvalidResponse: "invalidResponse",
522
+ Defect: "defect"
523
+ };
524
+ var GetContactListBranchFound = GetContactListBranch.Found;
525
+ var GetContactListBranchNotFound = GetContactListBranch.NotFound;
526
+ var GetContactListBranchProviderRejected = GetContactListBranch.ProviderRejected;
527
+ var GetContactListBranchInvalidResponse = GetContactListBranch.InvalidResponse;
528
+ var GetContactListBranchDefect = GetContactListBranch.Defect;
529
+ var GetContactListDefinition = {
530
+ operation: { connectorId: ConnectorID, operationId: "getContactList" },
531
+ branches: [
532
+ { id: "found", description: "Constant Contact returned the list." },
533
+ { id: "notFound", description: "The list does not exist.", optional: true },
534
+ { id: "providerRejected", description: "Constant Contact rejected the request.", optional: true },
535
+ { id: "invalidResponse", description: "Constant Contact returned malformed or oversized JSON.", optional: true },
536
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
537
+ ],
538
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
539
+ };
540
+ var GetContactListMetadata = { kind: "query", idempotency: "none", authorization: "required" };
541
+ var ListContactListsBranch = {
542
+ Listed: "listed",
543
+ ProviderRejected: "providerRejected",
544
+ InvalidResponse: "invalidResponse",
545
+ Defect: "defect"
546
+ };
547
+ var ListContactListsBranchListed = ListContactListsBranch.Listed;
548
+ var ListContactListsBranchProviderRejected = ListContactListsBranch.ProviderRejected;
549
+ var ListContactListsBranchInvalidResponse = ListContactListsBranch.InvalidResponse;
550
+ var ListContactListsBranchDefect = ListContactListsBranch.Defect;
551
+ var ListContactListsDefinition = {
552
+ operation: { connectorId: ConnectorID, operationId: "listContactLists" },
553
+ branches: [
554
+ { id: "listed", description: "Constant Contact returned a page of lists." },
555
+ { id: "providerRejected", description: "Constant Contact rejected the request.", optional: true },
556
+ { id: "invalidResponse", description: "Constant Contact returned malformed or oversized JSON.", optional: true },
557
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
558
+ ],
559
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
560
+ };
561
+ var ListContactListsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
562
+ var CreateContactListBranch = {
563
+ Created: "created",
564
+ Uncertain: "uncertain",
565
+ AlreadyExists: "alreadyExists",
566
+ ProviderRejected: "providerRejected",
567
+ Defect: "defect"
568
+ };
569
+ var CreateContactListBranchCreated = CreateContactListBranch.Created;
570
+ var CreateContactListBranchUncertain = CreateContactListBranch.Uncertain;
571
+ var CreateContactListBranchAlreadyExists = CreateContactListBranch.AlreadyExists;
572
+ var CreateContactListBranchProviderRejected = CreateContactListBranch.ProviderRejected;
573
+ var CreateContactListBranchDefect = CreateContactListBranch.Defect;
574
+ var CreateContactListDefinition = {
575
+ operation: { connectorId: ConnectorID, operationId: "createContactList" },
576
+ branches: [
577
+ { id: "created", description: "Constant Contact created the list." },
578
+ { id: "uncertain", description: "An earlier list creation could not be confirmed after the send cap.", optional: true },
579
+ { id: "alreadyExists", description: "No longer selected; a 409 cannot prove this list was not created.", optional: true },
580
+ { id: "providerRejected", description: "Constant Contact rejected the request.", optional: true },
581
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
582
+ ],
583
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
584
+ repeatOnUnknown: "limited",
585
+ maxSends: 3
586
+ };
587
+ var CreateContactListMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
588
+ var UpdateContactListBranch = {
589
+ Updated: "updated",
590
+ NotFound: "notFound",
591
+ ProviderRejected: "providerRejected",
592
+ Defect: "defect"
593
+ };
594
+ var UpdateContactListBranchUpdated = UpdateContactListBranch.Updated;
595
+ var UpdateContactListBranchNotFound = UpdateContactListBranch.NotFound;
596
+ var UpdateContactListBranchProviderRejected = UpdateContactListBranch.ProviderRejected;
597
+ var UpdateContactListBranchDefect = UpdateContactListBranch.Defect;
598
+ var UpdateContactListDefinition = {
599
+ operation: { connectorId: ConnectorID, operationId: "updateContactList" },
600
+ branches: [
601
+ { id: "updated", description: "Constant Contact updated the list." },
602
+ { id: "notFound", description: "The list does not exist.", optional: true },
603
+ { id: "providerRejected", description: "Constant Contact rejected the request.", optional: true },
604
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
605
+ ],
606
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
607
+ repeatOnUnknown: "safe"
608
+ };
609
+ var UpdateContactListMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
610
+ var DeleteContactListBranch = {
611
+ Accepted: "accepted",
612
+ NotFound: "notFound",
613
+ ProviderRejected: "providerRejected",
614
+ Defect: "defect"
615
+ };
616
+ var DeleteContactListBranchAccepted = DeleteContactListBranch.Accepted;
617
+ var DeleteContactListBranchNotFound = DeleteContactListBranch.NotFound;
618
+ var DeleteContactListBranchProviderRejected = DeleteContactListBranch.ProviderRejected;
619
+ var DeleteContactListBranchDefect = DeleteContactListBranch.Defect;
620
+ var DeleteContactListDefinition = {
621
+ operation: { connectorId: ConnectorID, operationId: "deleteContactList" },
622
+ branches: [
623
+ { id: "accepted", description: "Constant Contact accepted the list deletion." },
624
+ { id: "notFound", description: "The list does not exist.", optional: true },
625
+ { id: "providerRejected", description: "Constant Contact rejected the request.", optional: true },
626
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
627
+ ],
628
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
629
+ repeatOnUnknown: "safe"
630
+ };
631
+ var DeleteContactListMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
632
+
633
+ // src/generated/connection.ts
634
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
635
+ import { newRefreshingCredentialProvider } from "@superdurable/connectors-sdk/projectconfig";
636
+ var Connection = class {
637
+ /** Stable provider and connection name. */
638
+ reference;
639
+ /** Bound provider operations. */
640
+ operations;
641
+ /** Validate a reference and bind operations. */
642
+ constructor(reference, operations) {
643
+ this.reference = ConnectionRefSchema.parse(reference);
644
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
645
+ if (!operations) throw new TypeError("connector operations are required");
646
+ this.operations = operations;
647
+ }
648
+ };
649
+ function newConnection(client, reference) {
650
+ if (!client) throw new TypeError("connector client is required");
651
+ return new Connection(reference, client);
652
+ }
653
+ function newConnectionWithOperations(operations, reference) {
654
+ return new Connection(reference, operations);
655
+ }
656
+ function newProjectCredentialProvider(project, connectionName, decode, encode, decodeShared) {
657
+ return newRefreshingCredentialProvider(project.connections, { connectorId: ConnectorID, connectionName }, decode, encode, decodeShared);
658
+ }
659
+
660
+ export {
661
+ decodeSignedInteger,
662
+ parseJSONNumberTokens,
663
+ parseExactIntegerJSON,
664
+ exactIntegerJSONCodec,
665
+ ConfigSchema,
666
+ CredentialMaterialError,
667
+ isCredentialMaterialError,
668
+ decodeCredentials,
669
+ decodeSharedCredentials,
670
+ GetSegmentInputSchema,
671
+ SegmentMetadataSchema,
672
+ ListSegmentsInputSchema,
673
+ SegmentsPageSchema,
674
+ CreateSegmentInputSchema,
675
+ UpdateSegmentInputSchema,
676
+ DeleteSegmentInputSchema,
677
+ DeleteSegmentOutputSchema,
678
+ GetActivityInputSchema,
679
+ ActivityMetadataSchema,
680
+ ListActivitiesInputSchema,
681
+ ActivitiesPageSchema,
682
+ CreateContactInputSchema,
683
+ ContactMetadataSchema,
684
+ ListContactsInputSchema,
685
+ ContactsPageSchema,
686
+ UpdateContactInputSchema,
687
+ DeleteContactInputSchema,
688
+ DeleteContactOutputSchema,
689
+ GetContactInputSchema,
690
+ GetContactListInputSchema,
691
+ ContactListMetadataSchema,
692
+ ListContactListsInputSchema,
693
+ ContactListsPageSchema,
694
+ CreateContactListInputSchema,
695
+ UpdateContactListInputSchema,
696
+ DeleteContactListInputSchema,
697
+ DeleteContactListOutputSchema,
698
+ ConnectorID,
699
+ ProviderID,
700
+ GetSegmentBranch,
701
+ GetSegmentBranchFound,
702
+ GetSegmentBranchNotFound,
703
+ GetSegmentBranchProviderRejected,
704
+ GetSegmentBranchInvalidResponse,
705
+ GetSegmentBranchDefect,
706
+ GetSegmentDefinition,
707
+ GetSegmentMetadata,
708
+ ListSegmentsBranch,
709
+ ListSegmentsBranchListed,
710
+ ListSegmentsBranchProviderRejected,
711
+ ListSegmentsBranchInvalidResponse,
712
+ ListSegmentsBranchDefect,
713
+ ListSegmentsDefinition,
714
+ ListSegmentsMetadata,
715
+ CreateSegmentBranch,
716
+ CreateSegmentBranchCreated,
717
+ CreateSegmentBranchUncertain,
718
+ CreateSegmentBranchAlreadyExists,
719
+ CreateSegmentBranchProviderRejected,
720
+ CreateSegmentBranchDefect,
721
+ CreateSegmentDefinition,
722
+ CreateSegmentMetadata,
723
+ UpdateSegmentBranch,
724
+ UpdateSegmentBranchUpdated,
725
+ UpdateSegmentBranchNotFound,
726
+ UpdateSegmentBranchProviderRejected,
727
+ UpdateSegmentBranchInvalidResponse,
728
+ UpdateSegmentBranchDefect,
729
+ UpdateSegmentDefinition,
730
+ UpdateSegmentMetadata,
731
+ DeleteSegmentBranch,
732
+ DeleteSegmentBranchDeleted,
733
+ DeleteSegmentBranchNotFound,
734
+ DeleteSegmentBranchProviderRejected,
735
+ DeleteSegmentBranchDefect,
736
+ DeleteSegmentDefinition,
737
+ DeleteSegmentMetadata,
738
+ GetActivityBranch,
739
+ GetActivityBranchFound,
740
+ GetActivityBranchNotFound,
741
+ GetActivityBranchProviderRejected,
742
+ GetActivityBranchInvalidResponse,
743
+ GetActivityBranchDefect,
744
+ GetActivityDefinition,
745
+ GetActivityMetadata,
746
+ ListActivitiesBranch,
747
+ ListActivitiesBranchListed,
748
+ ListActivitiesBranchProviderRejected,
749
+ ListActivitiesBranchInvalidResponse,
750
+ ListActivitiesBranchDefect,
751
+ ListActivitiesDefinition,
752
+ ListActivitiesMetadata,
753
+ CreateContactBranch,
754
+ CreateContactBranchCreated,
755
+ CreateContactBranchUncertain,
756
+ CreateContactBranchAlreadyExists,
757
+ CreateContactBranchProviderRejected,
758
+ CreateContactBranchDefect,
759
+ CreateContactDefinition,
760
+ CreateContactMetadata,
761
+ ListContactsBranch,
762
+ ListContactsBranchListed,
763
+ ListContactsBranchProviderRejected,
764
+ ListContactsBranchInvalidResponse,
765
+ ListContactsBranchDefect,
766
+ ListContactsDefinition,
767
+ ListContactsMetadata,
768
+ UpdateContactBranch,
769
+ UpdateContactBranchUpdated,
770
+ UpdateContactBranchNotFound,
771
+ UpdateContactBranchProviderRejected,
772
+ UpdateContactBranchInvalidResponse,
773
+ UpdateContactBranchDefect,
774
+ UpdateContactDefinition,
775
+ UpdateContactMetadata,
776
+ DeleteContactBranch,
777
+ DeleteContactBranchDeleted,
778
+ DeleteContactBranchNotFound,
779
+ DeleteContactBranchProviderRejected,
780
+ DeleteContactBranchDefect,
781
+ DeleteContactDefinition,
782
+ DeleteContactMetadata,
783
+ GetContactBranch,
784
+ GetContactBranchFound,
785
+ GetContactBranchNotFound,
786
+ GetContactBranchProviderRejected,
787
+ GetContactBranchInvalidResponse,
788
+ GetContactBranchDefect,
789
+ GetContactDefinition,
790
+ GetContactMetadata,
791
+ GetContactListBranch,
792
+ GetContactListBranchFound,
793
+ GetContactListBranchNotFound,
794
+ GetContactListBranchProviderRejected,
795
+ GetContactListBranchInvalidResponse,
796
+ GetContactListBranchDefect,
797
+ GetContactListDefinition,
798
+ GetContactListMetadata,
799
+ ListContactListsBranch,
800
+ ListContactListsBranchListed,
801
+ ListContactListsBranchProviderRejected,
802
+ ListContactListsBranchInvalidResponse,
803
+ ListContactListsBranchDefect,
804
+ ListContactListsDefinition,
805
+ ListContactListsMetadata,
806
+ CreateContactListBranch,
807
+ CreateContactListBranchCreated,
808
+ CreateContactListBranchUncertain,
809
+ CreateContactListBranchAlreadyExists,
810
+ CreateContactListBranchProviderRejected,
811
+ CreateContactListBranchDefect,
812
+ CreateContactListDefinition,
813
+ CreateContactListMetadata,
814
+ UpdateContactListBranch,
815
+ UpdateContactListBranchUpdated,
816
+ UpdateContactListBranchNotFound,
817
+ UpdateContactListBranchProviderRejected,
818
+ UpdateContactListBranchDefect,
819
+ UpdateContactListDefinition,
820
+ UpdateContactListMetadata,
821
+ DeleteContactListBranch,
822
+ DeleteContactListBranchAccepted,
823
+ DeleteContactListBranchNotFound,
824
+ DeleteContactListBranchProviderRejected,
825
+ DeleteContactListBranchDefect,
826
+ DeleteContactListDefinition,
827
+ DeleteContactListMetadata,
828
+ Connection,
829
+ newConnection,
830
+ newConnectionWithOperations,
831
+ newProjectCredentialProvider
832
+ };