@superdurable/connector-intuit-mailchimp 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +10 -2
- package/dex-connector.json +211 -0
- package/dist/chunk-FFHIGEZ2.js +350 -0
- package/dist/connection-CR-ewlWK.d.ts +369 -0
- package/dist/index.d.ts +371 -0
- package/dist/index.js +829 -0
- package/dist/mock.d.ts +149 -0
- package/dist/mock.js +359 -0
- package/package.json +61 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Mailchimp TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@superdurable/connector-intuit-mailchimp` provides typed Dex operations for reading and listing audience contacts, upserting contacts, updating tags, and sending a reviewed campaign.
|
|
4
|
+
|
|
5
|
+
Install with `npm install @superdurable/connector-intuit-mailchimp@0.1.0`. Configure a Mailchimp API key in Dex Web as described in the [connector README](../README.md#mailchimp-setup). The package derives the data center from the key suffix and never puts the key in Flow input or output.
|
|
6
|
+
|
|
7
|
+
The runnable [get-member example](examples/get-member/README.md) shows the static connection name, Worker, and Flow. Its integration test uses a local Mailchimp stand-in and a real `dexcli dev` server. The Go-recorded [conformance scenarios](../../../../conformance/connectors/intuit/mailchimp/scenarios.json) cover all five operations, including retries and campaign send recovery.
|
|
8
|
+
|
|
9
|
+
For `sendCampaign`, a Mailchimp throttle or a connection failure proven to occur before the send clears the dispatch checkpoint and retries. A send that might have reached Mailchimp keeps the checkpoint; a later attempt reads campaign status and reports `alreadySent` only when Mailchimp shows `sending` or `sent`, otherwise `uncertain`.
|
|
10
|
+
|
|
11
|
+
Live Mailchimp provider authorization and behavior have not been verified for this TypeScript package.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "mailchimp",
|
|
3
|
+
"releaseTag": "connectors/intuit/mailchimp/go/v0.23.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-intuit-mailchimp",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newGetMemberStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "getMember",
|
|
14
|
+
"fields": {
|
|
15
|
+
"stepType": "stepType",
|
|
16
|
+
"annotations": "annotations",
|
|
17
|
+
"connectionName": "connectionName",
|
|
18
|
+
"resultAttribute": "resultAttribute"
|
|
19
|
+
},
|
|
20
|
+
"branches": [
|
|
21
|
+
{
|
|
22
|
+
"id": "found",
|
|
23
|
+
"field": "found",
|
|
24
|
+
"optional": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "notFound",
|
|
28
|
+
"field": "notFound",
|
|
29
|
+
"optional": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "providerRejected",
|
|
33
|
+
"field": "providerRejected",
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "invalidResponse",
|
|
38
|
+
"field": "invalidResponse",
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "defect",
|
|
43
|
+
"field": "defect",
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "newListMembersStep",
|
|
50
|
+
"kind": "query",
|
|
51
|
+
"operationId": "listMembers",
|
|
52
|
+
"fields": {
|
|
53
|
+
"stepType": "stepType",
|
|
54
|
+
"annotations": "annotations",
|
|
55
|
+
"connectionName": "connectionName",
|
|
56
|
+
"resultAttribute": "resultAttribute"
|
|
57
|
+
},
|
|
58
|
+
"branches": [
|
|
59
|
+
{
|
|
60
|
+
"id": "listed",
|
|
61
|
+
"field": "listed",
|
|
62
|
+
"optional": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "notFound",
|
|
66
|
+
"field": "notFound",
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "providerRejected",
|
|
71
|
+
"field": "providerRejected",
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "invalidResponse",
|
|
76
|
+
"field": "invalidResponse",
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "defect",
|
|
81
|
+
"field": "defect",
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "newUpsertMemberStep",
|
|
88
|
+
"kind": "mutation",
|
|
89
|
+
"operationId": "upsertMember",
|
|
90
|
+
"fields": {
|
|
91
|
+
"stepType": "stepType",
|
|
92
|
+
"annotations": "annotations",
|
|
93
|
+
"connectionName": "connectionName",
|
|
94
|
+
"resultAttribute": "resultAttribute"
|
|
95
|
+
},
|
|
96
|
+
"branches": [
|
|
97
|
+
{
|
|
98
|
+
"id": "upserted",
|
|
99
|
+
"field": "upserted",
|
|
100
|
+
"optional": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "providerRejected",
|
|
104
|
+
"field": "providerRejected",
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "invalidResponse",
|
|
109
|
+
"field": "invalidResponse",
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "defect",
|
|
114
|
+
"field": "defect",
|
|
115
|
+
"optional": true
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "newUpdateMemberTagsStep",
|
|
121
|
+
"kind": "mutation",
|
|
122
|
+
"operationId": "updateMemberTags",
|
|
123
|
+
"fields": {
|
|
124
|
+
"stepType": "stepType",
|
|
125
|
+
"annotations": "annotations",
|
|
126
|
+
"connectionName": "connectionName",
|
|
127
|
+
"resultAttribute": "resultAttribute"
|
|
128
|
+
},
|
|
129
|
+
"branches": [
|
|
130
|
+
{
|
|
131
|
+
"id": "updated",
|
|
132
|
+
"field": "updated",
|
|
133
|
+
"optional": false
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "notFound",
|
|
137
|
+
"field": "notFound",
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "providerRejected",
|
|
142
|
+
"field": "providerRejected",
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "invalidResponse",
|
|
147
|
+
"field": "invalidResponse",
|
|
148
|
+
"optional": true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "defect",
|
|
152
|
+
"field": "defect",
|
|
153
|
+
"optional": true
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "newSendCampaignStep",
|
|
159
|
+
"kind": "mutation",
|
|
160
|
+
"operationId": "sendCampaign",
|
|
161
|
+
"fields": {
|
|
162
|
+
"stepType": "stepType",
|
|
163
|
+
"annotations": "annotations",
|
|
164
|
+
"connectionName": "connectionName",
|
|
165
|
+
"resultAttribute": "resultAttribute"
|
|
166
|
+
},
|
|
167
|
+
"branches": [
|
|
168
|
+
{
|
|
169
|
+
"id": "sent",
|
|
170
|
+
"field": "sent",
|
|
171
|
+
"optional": false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "alreadySent",
|
|
175
|
+
"field": "alreadySent",
|
|
176
|
+
"optional": true
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "notSendable",
|
|
180
|
+
"field": "notSendable",
|
|
181
|
+
"optional": true
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "notFound",
|
|
185
|
+
"field": "notFound",
|
|
186
|
+
"optional": true
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "providerRejected",
|
|
190
|
+
"field": "providerRejected",
|
|
191
|
+
"optional": true
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "invalidResponse",
|
|
195
|
+
"field": "invalidResponse",
|
|
196
|
+
"optional": true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "uncertain",
|
|
200
|
+
"field": "uncertain",
|
|
201
|
+
"optional": true
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "defect",
|
|
205
|
+
"field": "defect",
|
|
206
|
+
"optional": true
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
@@ -0,0 +1,350 @@
|
|
|
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
|
+
"maxResponseBytes": z.number().int().optional()
|
|
29
|
+
});
|
|
30
|
+
function decodeCredentials(value) {
|
|
31
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
32
|
+
const fields = value;
|
|
33
|
+
const allowed = /* @__PURE__ */ new Set(["api_key"]);
|
|
34
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
35
|
+
if (fields["api_key"] != null && !(typeof fields["api_key"] === "string")) throw new TypeError("credential api_key has an invalid type");
|
|
36
|
+
const credentials = {};
|
|
37
|
+
if (!fields["api_key"]) throw new TypeError("credential api_key is required");
|
|
38
|
+
credentials.apiKey = new SecretString(fields["api_key"] ?? "");
|
|
39
|
+
return credentials;
|
|
40
|
+
}
|
|
41
|
+
var GetMemberInputSchema = z.strictObject({
|
|
42
|
+
"listId": z.string(),
|
|
43
|
+
"emailAddress": z.string()
|
|
44
|
+
});
|
|
45
|
+
var MemberSchema = z.strictObject({
|
|
46
|
+
"subscriberHash": z.string(),
|
|
47
|
+
"emailAddress": z.string(),
|
|
48
|
+
"contactId": z.string().optional(),
|
|
49
|
+
"fullName": z.string().optional(),
|
|
50
|
+
"status": z.string(),
|
|
51
|
+
"emailType": z.string().optional(),
|
|
52
|
+
"mergeFields": z.record(z.string(), z.unknown().nullable()).optional(),
|
|
53
|
+
"tags": z.array(z.string()).optional(),
|
|
54
|
+
"tagCount": z.number().int(),
|
|
55
|
+
"isVip": z.boolean().optional(),
|
|
56
|
+
"language": z.string().optional(),
|
|
57
|
+
"listId": z.string(),
|
|
58
|
+
"webId": z.number().int().optional(),
|
|
59
|
+
"signedUpAt": GoTimeJSONSchema.nullable().optional(),
|
|
60
|
+
"optedInAt": GoTimeJSONSchema.nullable().optional(),
|
|
61
|
+
"lastChangedAt": GoTimeJSONSchema.nullable().optional()
|
|
62
|
+
});
|
|
63
|
+
var ListMembersInputSchema = z.strictObject({
|
|
64
|
+
"listId": z.string(),
|
|
65
|
+
"status": z.string().optional(),
|
|
66
|
+
"changedSince": GoTimeJSONSchema.nullable().optional(),
|
|
67
|
+
"optedInSince": GoTimeJSONSchema.nullable().optional(),
|
|
68
|
+
"pageSize": z.number().int().optional(),
|
|
69
|
+
"offset": z.number().int().optional()
|
|
70
|
+
});
|
|
71
|
+
var ListMembersOutputSchema = z.strictObject({
|
|
72
|
+
"members": z.array(MemberSchema).nullable(),
|
|
73
|
+
"totalItems": z.number().int(),
|
|
74
|
+
"nextOffset": z.number().int().optional()
|
|
75
|
+
});
|
|
76
|
+
var MarketingPermissionInputSchema = z.strictObject({
|
|
77
|
+
"marketingPermissionId": z.string(),
|
|
78
|
+
"isEnabled": z.boolean()
|
|
79
|
+
});
|
|
80
|
+
var UpsertMemberInputSchema = z.strictObject({
|
|
81
|
+
"listId": z.string(),
|
|
82
|
+
"emailAddress": z.string(),
|
|
83
|
+
"statusIfNew": z.string(),
|
|
84
|
+
"status": z.string().optional(),
|
|
85
|
+
"isResubscribeAllowed": z.boolean().optional(),
|
|
86
|
+
"mergeFields": z.record(z.string(), z.unknown().nullable()).optional(),
|
|
87
|
+
"marketingPermissions": z.array(MarketingPermissionInputSchema).optional(),
|
|
88
|
+
"shouldSkipMergeValidation": z.boolean().optional()
|
|
89
|
+
});
|
|
90
|
+
var UpsertMemberOutputSchema = z.strictObject({
|
|
91
|
+
"member": MemberSchema
|
|
92
|
+
});
|
|
93
|
+
var UpdateMemberTagsInputSchema = z.strictObject({
|
|
94
|
+
"listId": z.string(),
|
|
95
|
+
"emailAddress": z.string(),
|
|
96
|
+
"addTags": z.array(z.string()).optional(),
|
|
97
|
+
"removeTags": z.array(z.string()).optional(),
|
|
98
|
+
"shouldSuppressAutomations": z.boolean().optional()
|
|
99
|
+
});
|
|
100
|
+
var UpdateMemberTagsOutputSchema = z.strictObject({
|
|
101
|
+
"subscriberHash": z.string(),
|
|
102
|
+
"activeTags": z.array(z.string()).optional(),
|
|
103
|
+
"inactiveTags": z.array(z.string()).optional()
|
|
104
|
+
});
|
|
105
|
+
var SendCampaignInputSchema = z.strictObject({
|
|
106
|
+
"campaignId": z.string(),
|
|
107
|
+
"expectedListId": z.string().optional()
|
|
108
|
+
});
|
|
109
|
+
var CampaignSchema = z.strictObject({
|
|
110
|
+
"id": z.string(),
|
|
111
|
+
"webId": z.number().int().optional(),
|
|
112
|
+
"type": z.string(),
|
|
113
|
+
"status": z.string(),
|
|
114
|
+
"title": z.string().optional(),
|
|
115
|
+
"subjectLine": z.string().optional(),
|
|
116
|
+
"listId": z.string().optional(),
|
|
117
|
+
"listName": z.string().optional(),
|
|
118
|
+
"recipientCount": z.number().int(),
|
|
119
|
+
"emailsSent": z.number().int(),
|
|
120
|
+
"createdAt": GoTimeJSONSchema.nullable().optional(),
|
|
121
|
+
"sentAt": GoTimeJSONSchema.nullable().optional()
|
|
122
|
+
});
|
|
123
|
+
var SendCampaignOutputSchema = z.strictObject({
|
|
124
|
+
"campaign": CampaignSchema
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// src/generated/definitions.ts
|
|
128
|
+
var ConnectorID = "mailchimp";
|
|
129
|
+
var ProviderID = "mailchimp";
|
|
130
|
+
var GetMemberBranch = {
|
|
131
|
+
Found: "found",
|
|
132
|
+
NotFound: "notFound",
|
|
133
|
+
ProviderRejected: "providerRejected",
|
|
134
|
+
InvalidResponse: "invalidResponse",
|
|
135
|
+
Defect: "defect"
|
|
136
|
+
};
|
|
137
|
+
var GetMemberBranchFound = GetMemberBranch.Found;
|
|
138
|
+
var GetMemberBranchNotFound = GetMemberBranch.NotFound;
|
|
139
|
+
var GetMemberBranchProviderRejected = GetMemberBranch.ProviderRejected;
|
|
140
|
+
var GetMemberBranchInvalidResponse = GetMemberBranch.InvalidResponse;
|
|
141
|
+
var GetMemberBranchDefect = GetMemberBranch.Defect;
|
|
142
|
+
var GetMemberDefinition = {
|
|
143
|
+
operation: { connectorId: ConnectorID, operationId: "getMember" },
|
|
144
|
+
branches: [
|
|
145
|
+
{ id: "found", description: "The contact exists in the audience, in any status including unsubscribed, cleaned, or archived." },
|
|
146
|
+
{ id: "notFound", description: "The audience has no contact with that address, or the audience does not exist.", optional: true },
|
|
147
|
+
{ id: "providerRejected", description: "Mailchimp conclusively rejected the read, such as an invalid or revoked API key or a role without access.", optional: true },
|
|
148
|
+
{ id: "invalidResponse", description: "Mailchimp returned an invalid or oversized contact.", optional: true },
|
|
149
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
150
|
+
],
|
|
151
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
152
|
+
};
|
|
153
|
+
var GetMemberMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
154
|
+
var ListMembersBranch = {
|
|
155
|
+
Listed: "listed",
|
|
156
|
+
NotFound: "notFound",
|
|
157
|
+
ProviderRejected: "providerRejected",
|
|
158
|
+
InvalidResponse: "invalidResponse",
|
|
159
|
+
Defect: "defect"
|
|
160
|
+
};
|
|
161
|
+
var ListMembersBranchListed = ListMembersBranch.Listed;
|
|
162
|
+
var ListMembersBranchNotFound = ListMembersBranch.NotFound;
|
|
163
|
+
var ListMembersBranchProviderRejected = ListMembersBranch.ProviderRejected;
|
|
164
|
+
var ListMembersBranchInvalidResponse = ListMembersBranch.InvalidResponse;
|
|
165
|
+
var ListMembersBranchDefect = ListMembersBranch.Defect;
|
|
166
|
+
var ListMembersDefinition = {
|
|
167
|
+
operation: { connectorId: ConnectorID, operationId: "listMembers" },
|
|
168
|
+
branches: [
|
|
169
|
+
{ id: "listed", description: "One page of the audience's contacts was read; it may be empty." },
|
|
170
|
+
{ id: "notFound", description: "The audience does not exist.", optional: true },
|
|
171
|
+
{ id: "providerRejected", description: "Mailchimp conclusively rejected the list, such as an invalid API key or a role without access.", optional: true },
|
|
172
|
+
{ id: "invalidResponse", description: "Mailchimp returned an invalid or oversized page of contacts.", optional: true },
|
|
173
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
174
|
+
],
|
|
175
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
176
|
+
};
|
|
177
|
+
var ListMembersMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
178
|
+
var UpsertMemberBranch = {
|
|
179
|
+
Upserted: "upserted",
|
|
180
|
+
ProviderRejected: "providerRejected",
|
|
181
|
+
InvalidResponse: "invalidResponse",
|
|
182
|
+
Defect: "defect"
|
|
183
|
+
};
|
|
184
|
+
var UpsertMemberBranchUpserted = UpsertMemberBranch.Upserted;
|
|
185
|
+
var UpsertMemberBranchProviderRejected = UpsertMemberBranch.ProviderRejected;
|
|
186
|
+
var UpsertMemberBranchInvalidResponse = UpsertMemberBranch.InvalidResponse;
|
|
187
|
+
var UpsertMemberBranchDefect = UpsertMemberBranch.Defect;
|
|
188
|
+
var UpsertMemberDefinition = {
|
|
189
|
+
operation: { connectorId: ConnectorID, operationId: "upsertMember" },
|
|
190
|
+
branches: [
|
|
191
|
+
{ id: "upserted", description: "Mailchimp holds the contact with the requested values, written now or by an earlier attempt, and returned it." },
|
|
192
|
+
{ id: "providerRejected", description: "Mailchimp conclusively rejected the contact, such as an invalid merge field, a permanently deleted address, or a contact in a compliance state; nothing was written.", optional: true },
|
|
193
|
+
{ id: "invalidResponse", description: "Mailchimp returned an invalid or oversized contact, so the change may have been applied.", optional: true },
|
|
194
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
195
|
+
],
|
|
196
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
197
|
+
};
|
|
198
|
+
var UpsertMemberMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
199
|
+
var UpdateMemberTagsBranch = {
|
|
200
|
+
Updated: "updated",
|
|
201
|
+
NotFound: "notFound",
|
|
202
|
+
ProviderRejected: "providerRejected",
|
|
203
|
+
InvalidResponse: "invalidResponse",
|
|
204
|
+
Defect: "defect"
|
|
205
|
+
};
|
|
206
|
+
var UpdateMemberTagsBranchUpdated = UpdateMemberTagsBranch.Updated;
|
|
207
|
+
var UpdateMemberTagsBranchNotFound = UpdateMemberTagsBranch.NotFound;
|
|
208
|
+
var UpdateMemberTagsBranchProviderRejected = UpdateMemberTagsBranch.ProviderRejected;
|
|
209
|
+
var UpdateMemberTagsBranchInvalidResponse = UpdateMemberTagsBranch.InvalidResponse;
|
|
210
|
+
var UpdateMemberTagsBranchDefect = UpdateMemberTagsBranch.Defect;
|
|
211
|
+
var UpdateMemberTagsDefinition = {
|
|
212
|
+
operation: { connectorId: ConnectorID, operationId: "updateMemberTags" },
|
|
213
|
+
branches: [
|
|
214
|
+
{ id: "updated", description: "Mailchimp accepted the tag changes, including tags the contact already had or already lacked." },
|
|
215
|
+
{ id: "notFound", description: "The audience has no contact with that address, or the audience does not exist; nothing was changed.", optional: true },
|
|
216
|
+
{ id: "providerRejected", description: "Mailchimp conclusively rejected the tag changes, such as an invalid API key or a role without access.", optional: true },
|
|
217
|
+
{ id: "invalidResponse", description: "Mailchimp accepted the request but returned an oversized or credential-reflecting body, so the tags may have changed.", optional: true },
|
|
218
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
219
|
+
],
|
|
220
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
221
|
+
};
|
|
222
|
+
var UpdateMemberTagsMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
223
|
+
var SendCampaignBranch = {
|
|
224
|
+
Sent: "sent",
|
|
225
|
+
AlreadySent: "alreadySent",
|
|
226
|
+
NotSendable: "notSendable",
|
|
227
|
+
NotFound: "notFound",
|
|
228
|
+
ProviderRejected: "providerRejected",
|
|
229
|
+
InvalidResponse: "invalidResponse",
|
|
230
|
+
Uncertain: "uncertain",
|
|
231
|
+
Defect: "defect"
|
|
232
|
+
};
|
|
233
|
+
var SendCampaignBranchSent = SendCampaignBranch.Sent;
|
|
234
|
+
var SendCampaignBranchAlreadySent = SendCampaignBranch.AlreadySent;
|
|
235
|
+
var SendCampaignBranchNotSendable = SendCampaignBranch.NotSendable;
|
|
236
|
+
var SendCampaignBranchNotFound = SendCampaignBranch.NotFound;
|
|
237
|
+
var SendCampaignBranchProviderRejected = SendCampaignBranch.ProviderRejected;
|
|
238
|
+
var SendCampaignBranchInvalidResponse = SendCampaignBranch.InvalidResponse;
|
|
239
|
+
var SendCampaignBranchUncertain = SendCampaignBranch.Uncertain;
|
|
240
|
+
var SendCampaignBranchDefect = SendCampaignBranch.Defect;
|
|
241
|
+
var SendCampaignDefinition = {
|
|
242
|
+
operation: { connectorId: ConnectorID, operationId: "sendCampaign" },
|
|
243
|
+
branches: [
|
|
244
|
+
{ id: "sent", description: "Mailchimp accepted the send of the draft campaign this Step read." },
|
|
245
|
+
{ id: "alreadySent", description: "Mailchimp reports the campaign as sending or sent, so this attempt sent nothing.", optional: true },
|
|
246
|
+
{ id: "notSendable", description: "The campaign is not a draft that can be sent now, such as a scheduled, paused, canceled, or RSS campaign, or it targets another audience than expectedListId; nothing was sent.", optional: true },
|
|
247
|
+
{ id: "notFound", description: "The campaign does not exist; nothing was sent.", optional: true },
|
|
248
|
+
{ id: "providerRejected", description: "Mailchimp conclusively rejected the send, such as a campaign that fails its send checklist or a role that cannot send; nothing was sent.", optional: true },
|
|
249
|
+
{ id: "invalidResponse", description: "Mailchimp returned an invalid or oversized campaign before the send; nothing was sent.", optional: true },
|
|
250
|
+
{ id: "uncertain", description: "The send request was sent but its outcome cannot be confirmed, so the campaign may be sending; the connector never sends it again.", optional: true },
|
|
251
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
252
|
+
],
|
|
253
|
+
stepDefaults: { executeMethodTimeoutMs: 6e4, executeDurability: "sync" }
|
|
254
|
+
};
|
|
255
|
+
var SendCampaignMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
256
|
+
|
|
257
|
+
// src/generated/connection.ts
|
|
258
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
259
|
+
var Connection = class {
|
|
260
|
+
/** Stable provider and connection name. */
|
|
261
|
+
reference;
|
|
262
|
+
/** Bound provider operations. */
|
|
263
|
+
operations;
|
|
264
|
+
/** Validate a reference and bind operations. */
|
|
265
|
+
constructor(reference, operations) {
|
|
266
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
267
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
268
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
269
|
+
this.operations = operations;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
function newConnection(client, reference) {
|
|
273
|
+
if (!client) throw new TypeError("connector client is required");
|
|
274
|
+
return new Connection(reference, client);
|
|
275
|
+
}
|
|
276
|
+
function newConnectionWithOperations(operations, reference) {
|
|
277
|
+
return new Connection(reference, operations);
|
|
278
|
+
}
|
|
279
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
280
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
281
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
282
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
283
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
284
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export {
|
|
288
|
+
ConfigSchema,
|
|
289
|
+
decodeCredentials,
|
|
290
|
+
GetMemberInputSchema,
|
|
291
|
+
MemberSchema,
|
|
292
|
+
ListMembersInputSchema,
|
|
293
|
+
ListMembersOutputSchema,
|
|
294
|
+
MarketingPermissionInputSchema,
|
|
295
|
+
UpsertMemberInputSchema,
|
|
296
|
+
UpsertMemberOutputSchema,
|
|
297
|
+
UpdateMemberTagsInputSchema,
|
|
298
|
+
UpdateMemberTagsOutputSchema,
|
|
299
|
+
SendCampaignInputSchema,
|
|
300
|
+
CampaignSchema,
|
|
301
|
+
SendCampaignOutputSchema,
|
|
302
|
+
ConnectorID,
|
|
303
|
+
ProviderID,
|
|
304
|
+
GetMemberBranch,
|
|
305
|
+
GetMemberBranchFound,
|
|
306
|
+
GetMemberBranchNotFound,
|
|
307
|
+
GetMemberBranchProviderRejected,
|
|
308
|
+
GetMemberBranchInvalidResponse,
|
|
309
|
+
GetMemberBranchDefect,
|
|
310
|
+
GetMemberDefinition,
|
|
311
|
+
GetMemberMetadata,
|
|
312
|
+
ListMembersBranch,
|
|
313
|
+
ListMembersBranchListed,
|
|
314
|
+
ListMembersBranchNotFound,
|
|
315
|
+
ListMembersBranchProviderRejected,
|
|
316
|
+
ListMembersBranchInvalidResponse,
|
|
317
|
+
ListMembersBranchDefect,
|
|
318
|
+
ListMembersDefinition,
|
|
319
|
+
ListMembersMetadata,
|
|
320
|
+
UpsertMemberBranch,
|
|
321
|
+
UpsertMemberBranchUpserted,
|
|
322
|
+
UpsertMemberBranchProviderRejected,
|
|
323
|
+
UpsertMemberBranchInvalidResponse,
|
|
324
|
+
UpsertMemberBranchDefect,
|
|
325
|
+
UpsertMemberDefinition,
|
|
326
|
+
UpsertMemberMetadata,
|
|
327
|
+
UpdateMemberTagsBranch,
|
|
328
|
+
UpdateMemberTagsBranchUpdated,
|
|
329
|
+
UpdateMemberTagsBranchNotFound,
|
|
330
|
+
UpdateMemberTagsBranchProviderRejected,
|
|
331
|
+
UpdateMemberTagsBranchInvalidResponse,
|
|
332
|
+
UpdateMemberTagsBranchDefect,
|
|
333
|
+
UpdateMemberTagsDefinition,
|
|
334
|
+
UpdateMemberTagsMetadata,
|
|
335
|
+
SendCampaignBranch,
|
|
336
|
+
SendCampaignBranchSent,
|
|
337
|
+
SendCampaignBranchAlreadySent,
|
|
338
|
+
SendCampaignBranchNotSendable,
|
|
339
|
+
SendCampaignBranchNotFound,
|
|
340
|
+
SendCampaignBranchProviderRejected,
|
|
341
|
+
SendCampaignBranchInvalidResponse,
|
|
342
|
+
SendCampaignBranchUncertain,
|
|
343
|
+
SendCampaignBranchDefect,
|
|
344
|
+
SendCampaignDefinition,
|
|
345
|
+
SendCampaignMetadata,
|
|
346
|
+
Connection,
|
|
347
|
+
newConnection,
|
|
348
|
+
newConnectionWithOperations,
|
|
349
|
+
newProjectConnection
|
|
350
|
+
};
|