@superdurable/connector-intuit-mailchimp 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.
- package/LICENSE +21 -0
- package/README.md +22 -2
- package/dex-connector.json +440 -0
- package/dist/chunk-Z4CC3JDG.js +355 -0
- package/dist/connection-CNe_v9QS.d.ts +372 -0
- package/dist/index.d.ts +505 -0
- package/dist/index.js +1239 -0
- package/dist/mock.d.ts +149 -0
- package/dist/mock.js +359 -0
- package/package.json +63 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import { G as GetMemberInput, M as Member, C as Connection, L as ListMembersInput, a as ListMembersOutput, S as SendCampaignInput, b as SendCampaignOutput, U as UpdateMemberTagsInput, c as UpdateMemberTagsOutput, d as UpsertMemberInput, e as UpsertMemberOutput, f as Config, g as Credentials, O as Operations } from './connection-CNe_v9QS.js';
|
|
2
|
+
export { h as Campaign, i as CampaignSchema, j as ConfigSchema, k as CredentialSource, l as GetMemberInputSchema, m as ListMembersOutputSchema, n as MarketingPermissionInput, o as MarketingPermissionInputSchema, p as MemberSchema, q as SendCampaignInputSchema, r as SendCampaignOutputSchema, s as UpdateMemberTagsInputSchema, t as UpdateMemberTagsOutputSchema, u as UpsertMemberInputSchema, v as UpsertMemberOutputSchema, w as decodeCredentials, x as newConnection, y as newConnectionWithOperations } from './connection-CNe_v9QS.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
5
|
+
import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, Call, QueryAttempt, MutationAttempt, CredentialProvider, Failure, ReceiptDraft, ConnectorConfigurationUI, TriggerTarget, TriggerLogger, TriggerDefinition, TriggerBindingDefinition, TriggerRunner } from '@superdurable/connectors-sdk';
|
|
6
|
+
import { StepTarget } from '@superdurable/dex';
|
|
7
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
8
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
9
|
+
import { CursorStore, Runner } from '@superdurable/connectors-sdk/pollingtrigger';
|
|
10
|
+
|
|
11
|
+
/** Accept Go time.Parse's RFC 3339 forms; the operation validates the timestamp. */
|
|
12
|
+
declare const ListMembersInputSchema: z.ZodObject<{
|
|
13
|
+
listId: z.ZodString;
|
|
14
|
+
status: z.ZodOptional<z.ZodString>;
|
|
15
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
changedSince: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
optedInSince: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
|
|
21
|
+
/** Stable connector identity. */
|
|
22
|
+
declare const ConnectorID = "mailchimp";
|
|
23
|
+
/** Provider identity for named connections. */
|
|
24
|
+
declare const ProviderID = "mailchimp";
|
|
25
|
+
/** Branch IDs for getMember. */
|
|
26
|
+
declare const GetMemberBranch: {
|
|
27
|
+
readonly Found: "found";
|
|
28
|
+
readonly NotFound: "notFound";
|
|
29
|
+
readonly ProviderRejected: "providerRejected";
|
|
30
|
+
readonly InvalidResponse: "invalidResponse";
|
|
31
|
+
readonly Defect: "defect";
|
|
32
|
+
};
|
|
33
|
+
/** The contact exists in the audience, in any status including unsubscribed, cleaned, or archived. */
|
|
34
|
+
declare const GetMemberBranchFound: "found";
|
|
35
|
+
/** The audience has no contact with that address, or the audience does not exist. */
|
|
36
|
+
declare const GetMemberBranchNotFound: "notFound";
|
|
37
|
+
/** Mailchimp conclusively rejected the read, such as an invalid or revoked API key or a role without access. */
|
|
38
|
+
declare const GetMemberBranchProviderRejected: "providerRejected";
|
|
39
|
+
/** Mailchimp returned an invalid or oversized contact. */
|
|
40
|
+
declare const GetMemberBranchInvalidResponse: "invalidResponse";
|
|
41
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
42
|
+
declare const GetMemberBranchDefect: "defect";
|
|
43
|
+
/** Manifest definition for getMember. */
|
|
44
|
+
declare const GetMemberDefinition: QueryDefinition;
|
|
45
|
+
/** Manifest metadata for getMember. */
|
|
46
|
+
declare const GetMemberMetadata: {
|
|
47
|
+
readonly kind: "query";
|
|
48
|
+
readonly idempotency: "none";
|
|
49
|
+
readonly authorization: "required";
|
|
50
|
+
};
|
|
51
|
+
/** Branch IDs for listMembers. */
|
|
52
|
+
declare const ListMembersBranch: {
|
|
53
|
+
readonly Listed: "listed";
|
|
54
|
+
readonly NotFound: "notFound";
|
|
55
|
+
readonly ProviderRejected: "providerRejected";
|
|
56
|
+
readonly InvalidResponse: "invalidResponse";
|
|
57
|
+
readonly Defect: "defect";
|
|
58
|
+
};
|
|
59
|
+
/** One page of the audience's contacts was read; it may be empty. */
|
|
60
|
+
declare const ListMembersBranchListed: "listed";
|
|
61
|
+
/** The audience does not exist. */
|
|
62
|
+
declare const ListMembersBranchNotFound: "notFound";
|
|
63
|
+
/** Mailchimp conclusively rejected the list, such as an invalid API key or a role without access. */
|
|
64
|
+
declare const ListMembersBranchProviderRejected: "providerRejected";
|
|
65
|
+
/** Mailchimp returned an invalid or oversized page of contacts. */
|
|
66
|
+
declare const ListMembersBranchInvalidResponse: "invalidResponse";
|
|
67
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
68
|
+
declare const ListMembersBranchDefect: "defect";
|
|
69
|
+
/** Manifest definition for listMembers. */
|
|
70
|
+
declare const ListMembersDefinition: QueryDefinition;
|
|
71
|
+
/** Manifest metadata for listMembers. */
|
|
72
|
+
declare const ListMembersMetadata: {
|
|
73
|
+
readonly kind: "query";
|
|
74
|
+
readonly idempotency: "none";
|
|
75
|
+
readonly authorization: "required";
|
|
76
|
+
};
|
|
77
|
+
/** Branch IDs for upsertMember. */
|
|
78
|
+
declare const UpsertMemberBranch: {
|
|
79
|
+
readonly Upserted: "upserted";
|
|
80
|
+
readonly ProviderRejected: "providerRejected";
|
|
81
|
+
readonly InvalidResponse: "invalidResponse";
|
|
82
|
+
readonly Defect: "defect";
|
|
83
|
+
};
|
|
84
|
+
/** Mailchimp holds the contact with the requested values, written now or by an earlier attempt, and returned it. */
|
|
85
|
+
declare const UpsertMemberBranchUpserted: "upserted";
|
|
86
|
+
/** 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. */
|
|
87
|
+
declare const UpsertMemberBranchProviderRejected: "providerRejected";
|
|
88
|
+
/** Mailchimp returned an invalid or oversized contact, so the change may have been applied. */
|
|
89
|
+
declare const UpsertMemberBranchInvalidResponse: "invalidResponse";
|
|
90
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
91
|
+
declare const UpsertMemberBranchDefect: "defect";
|
|
92
|
+
/** Manifest definition for upsertMember. */
|
|
93
|
+
declare const UpsertMemberDefinition: MutationDefinition;
|
|
94
|
+
/** Manifest metadata for upsertMember. */
|
|
95
|
+
declare const UpsertMemberMetadata: {
|
|
96
|
+
readonly kind: "mutation";
|
|
97
|
+
readonly idempotency: "required";
|
|
98
|
+
readonly authorization: "required";
|
|
99
|
+
};
|
|
100
|
+
/** Branch IDs for updateMemberTags. */
|
|
101
|
+
declare const UpdateMemberTagsBranch: {
|
|
102
|
+
readonly Updated: "updated";
|
|
103
|
+
readonly NotFound: "notFound";
|
|
104
|
+
readonly ProviderRejected: "providerRejected";
|
|
105
|
+
readonly InvalidResponse: "invalidResponse";
|
|
106
|
+
readonly Defect: "defect";
|
|
107
|
+
};
|
|
108
|
+
/** Mailchimp accepted the tag changes, including tags the contact already had or already lacked. */
|
|
109
|
+
declare const UpdateMemberTagsBranchUpdated: "updated";
|
|
110
|
+
/** The audience has no contact with that address, or the audience does not exist; nothing was changed. */
|
|
111
|
+
declare const UpdateMemberTagsBranchNotFound: "notFound";
|
|
112
|
+
/** Mailchimp conclusively rejected the tag changes, such as an invalid API key or a role without access. */
|
|
113
|
+
declare const UpdateMemberTagsBranchProviderRejected: "providerRejected";
|
|
114
|
+
/** Mailchimp accepted the request but returned an oversized or credential-reflecting body, so the tags may have changed. */
|
|
115
|
+
declare const UpdateMemberTagsBranchInvalidResponse: "invalidResponse";
|
|
116
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
117
|
+
declare const UpdateMemberTagsBranchDefect: "defect";
|
|
118
|
+
/** Manifest definition for updateMemberTags. */
|
|
119
|
+
declare const UpdateMemberTagsDefinition: MutationDefinition;
|
|
120
|
+
/** Manifest metadata for updateMemberTags. */
|
|
121
|
+
declare const UpdateMemberTagsMetadata: {
|
|
122
|
+
readonly kind: "mutation";
|
|
123
|
+
readonly idempotency: "required";
|
|
124
|
+
readonly authorization: "required";
|
|
125
|
+
};
|
|
126
|
+
/** Branch IDs for sendCampaign. */
|
|
127
|
+
declare const SendCampaignBranch: {
|
|
128
|
+
readonly Sent: "sent";
|
|
129
|
+
readonly AlreadySent: "alreadySent";
|
|
130
|
+
readonly NotSendable: "notSendable";
|
|
131
|
+
readonly NotFound: "notFound";
|
|
132
|
+
readonly ProviderRejected: "providerRejected";
|
|
133
|
+
readonly InvalidResponse: "invalidResponse";
|
|
134
|
+
readonly Uncertain: "uncertain";
|
|
135
|
+
readonly Defect: "defect";
|
|
136
|
+
};
|
|
137
|
+
/** Mailchimp accepted the send of the draft campaign this Step read. */
|
|
138
|
+
declare const SendCampaignBranchSent: "sent";
|
|
139
|
+
/** Mailchimp reports the campaign as sending or sent, so this attempt sent nothing. */
|
|
140
|
+
declare const SendCampaignBranchAlreadySent: "alreadySent";
|
|
141
|
+
/** 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. */
|
|
142
|
+
declare const SendCampaignBranchNotSendable: "notSendable";
|
|
143
|
+
/** The campaign does not exist; nothing was sent. */
|
|
144
|
+
declare const SendCampaignBranchNotFound: "notFound";
|
|
145
|
+
/** Mailchimp conclusively rejected the send, such as a campaign that fails its send checklist or a role that cannot send; nothing was sent. */
|
|
146
|
+
declare const SendCampaignBranchProviderRejected: "providerRejected";
|
|
147
|
+
/** Mailchimp returned an invalid or oversized campaign before the send; nothing was sent. */
|
|
148
|
+
declare const SendCampaignBranchInvalidResponse: "invalidResponse";
|
|
149
|
+
/** The send request was sent but its outcome cannot be confirmed, so the campaign may be sending; the connector never sends it again. */
|
|
150
|
+
declare const SendCampaignBranchUncertain: "uncertain";
|
|
151
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
152
|
+
declare const SendCampaignBranchDefect: "defect";
|
|
153
|
+
/** Manifest definition for sendCampaign. */
|
|
154
|
+
declare const SendCampaignDefinition: MutationDefinition;
|
|
155
|
+
/** Manifest metadata for sendCampaign. */
|
|
156
|
+
declare const SendCampaignMetadata: {
|
|
157
|
+
readonly kind: "mutation";
|
|
158
|
+
readonly idempotency: "required";
|
|
159
|
+
readonly authorization: "required";
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/** Configuration for the getMember connector Step. */
|
|
163
|
+
interface GetMemberStepConfig<StepInput, OperationInput = GetMemberInput, OperationOutput = Member> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
164
|
+
/** Named connection supplying this operation. */
|
|
165
|
+
connection: Connection<{
|
|
166
|
+
getMember(): Query<OperationInput, OperationOutput>;
|
|
167
|
+
}>;
|
|
168
|
+
/** Name matching the bound connection. */
|
|
169
|
+
connectionName: string;
|
|
170
|
+
/** The contact exists in the audience, in any status including unsubscribed, cleaned, or archived. */
|
|
171
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
172
|
+
/** The audience has no contact with that address, or the audience does not exist. */
|
|
173
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
174
|
+
/** Mailchimp conclusively rejected the read, such as an invalid or revoked API key or a role without access. */
|
|
175
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
176
|
+
/** Mailchimp returned an invalid or oversized contact. */
|
|
177
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
178
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
179
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
180
|
+
}
|
|
181
|
+
/** Build the getMember Step from a named connection. */
|
|
182
|
+
declare function newGetMemberStep<StepInput, OperationInput = GetMemberInput, OperationOutput = Member>(configuration: GetMemberStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
183
|
+
/** Configuration for the listMembers connector Step. */
|
|
184
|
+
interface ListMembersStepConfig<StepInput, OperationInput = ListMembersInput, OperationOutput = ListMembersOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
185
|
+
/** Named connection supplying this operation. */
|
|
186
|
+
connection: Connection<{
|
|
187
|
+
listMembers(): Query<OperationInput, OperationOutput>;
|
|
188
|
+
}>;
|
|
189
|
+
/** Name matching the bound connection. */
|
|
190
|
+
connectionName: string;
|
|
191
|
+
/** One page of the audience's contacts was read; it may be empty. */
|
|
192
|
+
listed: StepTarget<QueryResult<OperationOutput>>;
|
|
193
|
+
/** The audience does not exist. */
|
|
194
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
195
|
+
/** Mailchimp conclusively rejected the list, such as an invalid API key or a role without access. */
|
|
196
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
197
|
+
/** Mailchimp returned an invalid or oversized page of contacts. */
|
|
198
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
199
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
200
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
201
|
+
}
|
|
202
|
+
/** Build the listMembers Step from a named connection. */
|
|
203
|
+
declare function newListMembersStep<StepInput, OperationInput = ListMembersInput, OperationOutput = ListMembersOutput>(configuration: ListMembersStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
204
|
+
/** Configuration for the upsertMember connector Step. */
|
|
205
|
+
interface UpsertMemberStepConfig<StepInput, OperationInput = UpsertMemberInput, OperationOutput = UpsertMemberOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
206
|
+
/** Named connection supplying this operation. */
|
|
207
|
+
connection: Connection<{
|
|
208
|
+
upsertMember(): Mutation<OperationInput, OperationOutput>;
|
|
209
|
+
}>;
|
|
210
|
+
/** Name matching the bound connection. */
|
|
211
|
+
connectionName: string;
|
|
212
|
+
/** Mailchimp holds the contact with the requested values, written now or by an earlier attempt, and returned it. */
|
|
213
|
+
upserted: StepTarget<MutationResult<OperationOutput>>;
|
|
214
|
+
/** 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. */
|
|
215
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
216
|
+
/** Mailchimp returned an invalid or oversized contact, so the change may have been applied. */
|
|
217
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
218
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
219
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
220
|
+
}
|
|
221
|
+
/** Build the upsertMember Step from a named connection. */
|
|
222
|
+
declare function newUpsertMemberStep<StepInput, OperationInput = UpsertMemberInput, OperationOutput = UpsertMemberOutput>(configuration: UpsertMemberStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
223
|
+
/** Configuration for the updateMemberTags connector Step. */
|
|
224
|
+
interface UpdateMemberTagsStepConfig<StepInput, OperationInput = UpdateMemberTagsInput, OperationOutput = UpdateMemberTagsOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
225
|
+
/** Named connection supplying this operation. */
|
|
226
|
+
connection: Connection<{
|
|
227
|
+
updateMemberTags(): Mutation<OperationInput, OperationOutput>;
|
|
228
|
+
}>;
|
|
229
|
+
/** Name matching the bound connection. */
|
|
230
|
+
connectionName: string;
|
|
231
|
+
/** Mailchimp accepted the tag changes, including tags the contact already had or already lacked. */
|
|
232
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
233
|
+
/** The audience has no contact with that address, or the audience does not exist; nothing was changed. */
|
|
234
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
235
|
+
/** Mailchimp conclusively rejected the tag changes, such as an invalid API key or a role without access. */
|
|
236
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
237
|
+
/** Mailchimp accepted the request but returned an oversized or credential-reflecting body, so the tags may have changed. */
|
|
238
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
239
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
240
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
241
|
+
}
|
|
242
|
+
/** Build the updateMemberTags Step from a named connection. */
|
|
243
|
+
declare function newUpdateMemberTagsStep<StepInput, OperationInput = UpdateMemberTagsInput, OperationOutput = UpdateMemberTagsOutput>(configuration: UpdateMemberTagsStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
244
|
+
/** Configuration for the sendCampaign connector Step. */
|
|
245
|
+
interface SendCampaignStepConfig<StepInput, OperationInput = SendCampaignInput, OperationOutput = SendCampaignOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
246
|
+
/** Named connection supplying this operation. */
|
|
247
|
+
connection: Connection<{
|
|
248
|
+
sendCampaign(): Mutation<OperationInput, OperationOutput>;
|
|
249
|
+
}>;
|
|
250
|
+
/** Name matching the bound connection. */
|
|
251
|
+
connectionName: string;
|
|
252
|
+
/** Mailchimp accepted the send of the draft campaign this Step read. */
|
|
253
|
+
sent: StepTarget<MutationResult<OperationOutput>>;
|
|
254
|
+
/** Mailchimp reports the campaign as sending or sent, so this attempt sent nothing. */
|
|
255
|
+
alreadySent?: StepTarget<MutationResult<OperationOutput>>;
|
|
256
|
+
/** 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. */
|
|
257
|
+
notSendable?: StepTarget<MutationResult<OperationOutput>>;
|
|
258
|
+
/** The campaign does not exist; nothing was sent. */
|
|
259
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
260
|
+
/** Mailchimp conclusively rejected the send, such as a campaign that fails its send checklist or a role that cannot send; nothing was sent. */
|
|
261
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
262
|
+
/** Mailchimp returned an invalid or oversized campaign before the send; nothing was sent. */
|
|
263
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
264
|
+
/** The send request was sent but its outcome cannot be confirmed, so the campaign may be sending; the connector never sends it again. */
|
|
265
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
266
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
267
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
268
|
+
}
|
|
269
|
+
/** Build the sendCampaign Step from a named connection. */
|
|
270
|
+
declare function newSendCampaignStep<StepInput, OperationInput = SendCampaignInput, OperationOutput = SendCampaignOutput>(configuration: SendCampaignStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
271
|
+
|
|
272
|
+
/** Read one audience contact. */
|
|
273
|
+
declare class GetMemberOperation implements Query<GetMemberInput, Member> {
|
|
274
|
+
private readonly client;
|
|
275
|
+
/** Bind the client. */ constructor(client: MailchimpClient);
|
|
276
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
277
|
+
/** Read by Mailchimp subscriber hash. */
|
|
278
|
+
invoke(call: Call, input: GetMemberInput): Promise<QueryAttempt<Member>>;
|
|
279
|
+
}
|
|
280
|
+
/** Read one ordered audience page. */
|
|
281
|
+
declare class ListMembersOperation implements Query<ListMembersInput, ListMembersOutput> {
|
|
282
|
+
private readonly client;
|
|
283
|
+
/** Bind the client. */ constructor(client: MailchimpClient);
|
|
284
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
285
|
+
/** Read one page with optional status and time filters. */
|
|
286
|
+
invoke(call: Call, input: ListMembersInput): Promise<QueryAttempt<ListMembersOutput>>;
|
|
287
|
+
}
|
|
288
|
+
/** Upsert one contact with absolute, repeatable values. */
|
|
289
|
+
declare class UpsertMemberOperation implements Mutation<UpsertMemberInput, UpsertMemberOutput> {
|
|
290
|
+
private readonly client;
|
|
291
|
+
/** Bind the client. */ constructor(client: MailchimpClient);
|
|
292
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
293
|
+
/** Use the stable Call ID for receipt correlation. */ idempotencyKey(callId: string): string;
|
|
294
|
+
/** Write one contact without changing an existing subscription unless requested. */
|
|
295
|
+
invoke(call: Call, input: UpsertMemberInput): Promise<MutationAttempt<UpsertMemberOutput>>;
|
|
296
|
+
}
|
|
297
|
+
/** Set contact tags active or inactive with repeatable declarations. */
|
|
298
|
+
declare class UpdateMemberTagsOperation implements Mutation<UpdateMemberTagsInput, UpdateMemberTagsOutput> {
|
|
299
|
+
private readonly client;
|
|
300
|
+
/** Bind the client. */ constructor(client: MailchimpClient);
|
|
301
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
302
|
+
/** Use the stable Call ID for receipt correlation. */ idempotencyKey(callId: string): string;
|
|
303
|
+
/** Declare tag states for one contact. */
|
|
304
|
+
invoke(call: Call, input: UpdateMemberTagsInput): Promise<MutationAttempt<UpdateMemberTagsOutput>>;
|
|
305
|
+
}
|
|
306
|
+
/** Send a reviewed draft campaign at most once. */
|
|
307
|
+
declare class SendCampaignOperation implements Mutation<SendCampaignInput, SendCampaignOutput> {
|
|
308
|
+
private readonly client;
|
|
309
|
+
/** Bind the client. */ constructor(client: MailchimpClient);
|
|
310
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
311
|
+
/** Use the stable Call ID for receipt correlation. */ idempotencyKey(callId: string): string;
|
|
312
|
+
/** Read status, checkpoint dispatch, and send only a draft. */
|
|
313
|
+
invoke(call: Call, input: SendCampaignInput): Promise<MutationAttempt<SendCampaignOutput>>;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Injectable provider transport for deterministic tests. */
|
|
317
|
+
type MailchimpRequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
318
|
+
/** Constructor dependencies for deterministic tests and local stand-ins. */
|
|
319
|
+
interface MailchimpClientOptions {
|
|
320
|
+
/** Local Mailchimp-compatible endpoint; production derives the host from the API key. */
|
|
321
|
+
apiBaseURL?: string;
|
|
322
|
+
/** Optional request sender; production uses the bounded no-redirect transport. */
|
|
323
|
+
send?: MailchimpRequestSender;
|
|
324
|
+
/** Receipt and Retry-After clock. */
|
|
325
|
+
now?: () => Date;
|
|
326
|
+
}
|
|
327
|
+
/** One classified Mailchimp exchange. */
|
|
328
|
+
interface MailchimpExchange {
|
|
329
|
+
outcome: 'succeeded' | 'notFound' | 'rateLimited' | 'notSent' | 'unavailable' | 'rejected' | 'invalid' | 'defect';
|
|
330
|
+
status: number;
|
|
331
|
+
body: Uint8Array;
|
|
332
|
+
headers: ProviderResponse['headers'];
|
|
333
|
+
failure?: Failure;
|
|
334
|
+
retryAfterMs: number;
|
|
335
|
+
}
|
|
336
|
+
/** Keeps a memberChanged poll loop from occupying Mailchimp's per-user request slots. */
|
|
337
|
+
declare const MinimumPollIntervalMs = 5000;
|
|
338
|
+
/**
|
|
339
|
+
* Authenticated Mailchimp Marketing API client. pollIntervalMs is the memberChanged Trigger's delay between
|
|
340
|
+
* polls of each audience, from Config.pollIntervalMs (omitted or zero uses 30 seconds); the constructor
|
|
341
|
+
* throws for an interval under 5 seconds, as Go's New does.
|
|
342
|
+
*/
|
|
343
|
+
declare class MailchimpClient {
|
|
344
|
+
/** The memberChanged Trigger's delay between polls, in milliseconds. */
|
|
345
|
+
readonly pollIntervalMs: number;
|
|
346
|
+
/** Receipt and Retry-After clock. */
|
|
347
|
+
readonly now: () => Date;
|
|
348
|
+
private readonly maxResponseBytes;
|
|
349
|
+
private readonly credentials;
|
|
350
|
+
private readonly apiBaseURL;
|
|
351
|
+
private readonly send;
|
|
352
|
+
/** Validate configuration and retain immutable dependencies. */
|
|
353
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: MailchimpClientOptions);
|
|
354
|
+
/** Bind the contact read. */
|
|
355
|
+
getMember(): GetMemberOperation;
|
|
356
|
+
/** Bind the audience page read. */
|
|
357
|
+
listMembers(): ListMembersOperation;
|
|
358
|
+
/** Bind the contact upsert. */
|
|
359
|
+
upsertMember(): UpsertMemberOperation;
|
|
360
|
+
/** Bind the tag update. */
|
|
361
|
+
updateMemberTags(): UpdateMemberTagsOperation;
|
|
362
|
+
/** Bind the guarded campaign send. */
|
|
363
|
+
sendCampaign(): SendCampaignOperation;
|
|
364
|
+
/** Resolve the current API key and its data center without exposing it in failures. */
|
|
365
|
+
resolveConnection(call: Call): Promise<{
|
|
366
|
+
key: string;
|
|
367
|
+
baseURL: string;
|
|
368
|
+
} | undefined>;
|
|
369
|
+
/** Send one request and classify the outcome before an operation chooses its branch. */
|
|
370
|
+
exchange(call: Call, connection: {
|
|
371
|
+
key: string;
|
|
372
|
+
baseURL: string;
|
|
373
|
+
}, operation: string, method: string, path: string, query?: URLSearchParams, payload?: unknown): Promise<MailchimpExchange>;
|
|
374
|
+
/** Create a secret-free provider receipt. */
|
|
375
|
+
receipt(call: Call, exchange: MailchimpExchange, objectID: string): ReceiptDraft;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Open one static Mailchimp connection declared in a Dex project, with its maxResponseBytes and pollInterval.
|
|
380
|
+
* options replaces the transport, API base URL, or clock, for local stand-ins and tests.
|
|
381
|
+
*/
|
|
382
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: MailchimpClientOptions): Connection<Operations>;
|
|
383
|
+
|
|
384
|
+
/** Every status the memberStatusPicker offers, in its display order. */
|
|
385
|
+
declare const MemberStatuses: readonly ["subscribed", "unsubscribed", "cleaned", "pending", "transactional", "archived"];
|
|
386
|
+
/**
|
|
387
|
+
* The memberChanged binding configuration that the audienceIdEntry and memberStatusPicker units save in Dex
|
|
388
|
+
* Web. Changing the audience of a binding that already polled makes its next poll record a new baseline.
|
|
389
|
+
*/
|
|
390
|
+
declare const MemberChangedTriggerConfigurationSchema: z.ZodObject<{
|
|
391
|
+
audienceId: z.ZodString;
|
|
392
|
+
statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
393
|
+
}, z.core.$strict>;
|
|
394
|
+
/** The memberChanged binding configuration. */
|
|
395
|
+
type MemberChangedTriggerConfiguration = z.infer<typeof MemberChangedTriggerConfigurationSchema>;
|
|
396
|
+
/**
|
|
397
|
+
* One contact added to or changed in the watched audience; field names match the Go connector, so Go and
|
|
398
|
+
* TypeScript replicas share a binding's inbox. Mailchimp reports no change type, so a new contact and an
|
|
399
|
+
* edited one look alike; member.signedUpAt, member.optedInAt, and member.status tell them apart. A contact
|
|
400
|
+
* that changed several times between two polls is delivered once, in its latest state.
|
|
401
|
+
*/
|
|
402
|
+
declare const MemberChangedEventSchema: z.ZodObject<{
|
|
403
|
+
audienceId: z.ZodString;
|
|
404
|
+
member: z.ZodObject<{
|
|
405
|
+
subscriberHash: z.ZodString;
|
|
406
|
+
emailAddress: z.ZodString;
|
|
407
|
+
contactId: z.ZodOptional<z.ZodString>;
|
|
408
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
409
|
+
status: z.ZodString;
|
|
410
|
+
emailType: z.ZodOptional<z.ZodString>;
|
|
411
|
+
mergeFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
|
|
412
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
413
|
+
tagCount: z.ZodNumber;
|
|
414
|
+
isVip: z.ZodOptional<z.ZodBoolean>;
|
|
415
|
+
language: z.ZodOptional<z.ZodString>;
|
|
416
|
+
listId: z.ZodString;
|
|
417
|
+
webId: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
signedUpAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
419
|
+
optedInAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
420
|
+
lastChangedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
421
|
+
}, z.core.$strict>;
|
|
422
|
+
}, z.core.$strip>;
|
|
423
|
+
/** One memberChanged delivery. */
|
|
424
|
+
type MemberChangedEvent = z.infer<typeof MemberChangedEventSchema>;
|
|
425
|
+
|
|
426
|
+
/** Manifest definition of memberChanged. */
|
|
427
|
+
declare const MemberChangedTriggerDefinition: TriggerDefinition;
|
|
428
|
+
/** Unit ID of the audience ID entry in the connector's UI bundle. */
|
|
429
|
+
declare const UIUnitAudienceIDEntry = "audienceIdEntry";
|
|
430
|
+
/** Port of the audienceIdEntry unit that saves the audience ID. */
|
|
431
|
+
declare const UIAudienceIDEntryPortAudienceID = "audienceId";
|
|
432
|
+
/** Unit ID of the contact status picker in the connector's UI bundle. */
|
|
433
|
+
declare const UIUnitMemberStatusPicker = "memberStatusPicker";
|
|
434
|
+
/** Port of the memberStatusPicker unit that saves the selected statuses. */
|
|
435
|
+
declare const UIMemberStatusPickerPortStatuses = "statuses";
|
|
436
|
+
/** One static application binding of memberChanged. */
|
|
437
|
+
interface MemberChangedTriggerBindingConfig {
|
|
438
|
+
/** Static connection name. */ connectionName: string;
|
|
439
|
+
/** Static binding name. */ bindingName: string;
|
|
440
|
+
/** Connector Studio units that save the binding's audienceId and statuses, such as audienceIdEntry and memberStatusPicker. */ configurationUI?: ConnectorConfigurationUI;
|
|
441
|
+
}
|
|
442
|
+
/** Declare a static memberChanged binding for Flow Definition tooling and Dex Web. */
|
|
443
|
+
declare function defineMemberChangedTriggerBinding(config: MemberChangedTriggerBindingConfig): TriggerBindingDefinition;
|
|
444
|
+
/** Binds one memberChanged configuration to its application target and cursor. */
|
|
445
|
+
interface MemberChangedTriggerRoute {
|
|
446
|
+
/** The stable application binding name, unique within the runner. */ bindingName: string;
|
|
447
|
+
/** Selects the watched audience, which is required, and the delivered statuses. */ configuration: MemberChangedTriggerConfiguration;
|
|
448
|
+
/**
|
|
449
|
+
* Routes each change into the application. A target from newDurableTriggerTarget records each change before
|
|
450
|
+
* the cursor commits past it; any other target consumes it first.
|
|
451
|
+
*/
|
|
452
|
+
target: TriggerTarget<MemberChangedEvent>;
|
|
453
|
+
/**
|
|
454
|
+
* Stores the binding's position, such as LoadedProject.pollCursorStore. Omitted keeps it in memory, so every
|
|
455
|
+
* process start records a new baseline and changes made while stopped are lost.
|
|
456
|
+
*/
|
|
457
|
+
cursor?: CursorStore;
|
|
458
|
+
}
|
|
459
|
+
/** Options of the memberChanged runners. */
|
|
460
|
+
interface MemberTriggerRunnerOptions {
|
|
461
|
+
/** Receives seed, reseed, poll failure, rate-limit, and inbox records, never contact data or credentials; omitted uses defaultTriggerLogger. */ logger?: TriggerLogger;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Create one poll Runner for the connection's memberChanged bindings. Run replays each durable target,
|
|
465
|
+
* records a baseline for a binding without a cursor, then polls every binding each pollInterval with jitter,
|
|
466
|
+
* one request at a time, so the runner holds at most one of the 10 simultaneous requests Mailchimp allows
|
|
467
|
+
* each user. A 429, or a 403 without an error document, pauses every binding of the connection for
|
|
468
|
+
* Retry-After, or backs off exponentially without it; a 400 for the cursor's query records a new baseline
|
|
469
|
+
* and logs a WARN record; other failures back off per binding up to 15 minutes. Delivery is at least once,
|
|
470
|
+
* and each contact version keeps one Trigger event ID across refetches. Throws for a connection without a
|
|
471
|
+
* MailchimpClient, no routes, a blank or repeated binding name, a missing target, or an invalid configuration.
|
|
472
|
+
*/
|
|
473
|
+
declare function newMemberTriggerRunner(connection: Connection, routes: readonly MemberChangedTriggerRoute[], options?: MemberTriggerRunnerOptions): Runner;
|
|
474
|
+
/** Selects one memberChanged binding saved in the project configuration. */
|
|
475
|
+
interface ProjectMemberChangedTriggerRoute {
|
|
476
|
+
/** Names the saved binding. */ bindingName: string;
|
|
477
|
+
/** Routes each change into the application, usually newDexFlowTriggerTarget. */ target: TriggerTarget<MemberChangedEvent>;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Create a durable Runner for memberChanged bindings saved in the loaded project. connection is the one
|
|
481
|
+
* newProjectConnection opened from project. Each route loads its binding's saved audienceId and statuses and
|
|
482
|
+
* records changes in the binding's project Trigger inbox before its position commits in the binding's project
|
|
483
|
+
* poll cursor, so a restarted or replaced replica neither misses nor repeats a change. Inbox payloads use the
|
|
484
|
+
* Go connector's JSON fields, so Go and TypeScript replicas share them. Throws for a binding without a saved
|
|
485
|
+
* audience, an invalid saved configuration, and as newMemberTriggerRunner does.
|
|
486
|
+
*/
|
|
487
|
+
declare function newProjectMemberTriggerRunner(project: LoadedProject, connection: Connection, routes: readonly ProjectMemberChangedTriggerRoute[], options?: MemberTriggerRunnerOptions): Runner;
|
|
488
|
+
/** Configuration of one in-memory memberChanged Trigger. */
|
|
489
|
+
interface MemberChangedTriggerConfig {
|
|
490
|
+
/** Mailchimp connection from newProjectConnection or newConnection with a MailchimpClient. */ connection: Connection;
|
|
491
|
+
/** Static binding name. */ bindingName: string;
|
|
492
|
+
/** Selects the watched audience, which is required, and the delivered statuses. */ configuration: MemberChangedTriggerConfiguration;
|
|
493
|
+
/** Routes accepted changes into the application. */ target: TriggerTarget<MemberChangedEvent>;
|
|
494
|
+
/** Receives the Trigger's records; omitted uses defaultTriggerLogger. */ logger?: TriggerLogger;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Create a single memberChanged TriggerRunner, as Go's generated NewMemberChangedTrigger does. It has no
|
|
498
|
+
* project storage, so it keeps the cursor in memory and records a new baseline on every start; changes made
|
|
499
|
+
* while stopped are lost. Use newProjectMemberTriggerRunner for durable delivery.
|
|
500
|
+
*/
|
|
501
|
+
declare function newMemberChangedTrigger(config: MemberChangedTriggerConfig): TriggerRunner;
|
|
502
|
+
/** Decode a replayed inbox payload, written by a Go or TypeScript replica; throws for another payload. */
|
|
503
|
+
declare function decodeMemberChangedEventPayload(payloadJSON: string): MemberChangedEvent;
|
|
504
|
+
|
|
505
|
+
export { Config, Connection, ConnectorID, Credentials, GetMemberBranch, GetMemberBranchDefect, GetMemberBranchFound, GetMemberBranchInvalidResponse, GetMemberBranchNotFound, GetMemberBranchProviderRejected, GetMemberDefinition, GetMemberInput, GetMemberMetadata, GetMemberOperation, type GetMemberStepConfig, ListMembersBranch, ListMembersBranchDefect, ListMembersBranchInvalidResponse, ListMembersBranchListed, ListMembersBranchNotFound, ListMembersBranchProviderRejected, ListMembersDefinition, ListMembersInput, ListMembersInputSchema, ListMembersMetadata, ListMembersOperation, ListMembersOutput, type ListMembersStepConfig, MailchimpClient, type MailchimpClientOptions, type MailchimpRequestSender, Member, type MemberChangedEvent, MemberChangedEventSchema, type MemberChangedTriggerBindingConfig, type MemberChangedTriggerConfig, type MemberChangedTriggerConfiguration, MemberChangedTriggerConfigurationSchema, MemberChangedTriggerDefinition, type MemberChangedTriggerRoute, MemberStatuses, type MemberTriggerRunnerOptions, MinimumPollIntervalMs, type ProjectMemberChangedTriggerRoute, ProviderID, SendCampaignBranch, SendCampaignBranchAlreadySent, SendCampaignBranchDefect, SendCampaignBranchInvalidResponse, SendCampaignBranchNotFound, SendCampaignBranchNotSendable, SendCampaignBranchProviderRejected, SendCampaignBranchSent, SendCampaignBranchUncertain, SendCampaignDefinition, SendCampaignInput, SendCampaignMetadata, SendCampaignOperation, SendCampaignOutput, type SendCampaignStepConfig, UIAudienceIDEntryPortAudienceID, UIMemberStatusPickerPortStatuses, UIUnitAudienceIDEntry, UIUnitMemberStatusPicker, UpdateMemberTagsBranch, UpdateMemberTagsBranchDefect, UpdateMemberTagsBranchInvalidResponse, UpdateMemberTagsBranchNotFound, UpdateMemberTagsBranchProviderRejected, UpdateMemberTagsBranchUpdated, UpdateMemberTagsDefinition, UpdateMemberTagsInput, UpdateMemberTagsMetadata, UpdateMemberTagsOperation, UpdateMemberTagsOutput, type UpdateMemberTagsStepConfig, UpsertMemberBranch, UpsertMemberBranchDefect, UpsertMemberBranchInvalidResponse, UpsertMemberBranchProviderRejected, UpsertMemberBranchUpserted, UpsertMemberDefinition, UpsertMemberInput, UpsertMemberMetadata, UpsertMemberOperation, UpsertMemberOutput, type UpsertMemberStepConfig, decodeMemberChangedEventPayload, defineMemberChangedTriggerBinding, newGetMemberStep, newListMembersStep, newMemberChangedTrigger, newMemberTriggerRunner, newProjectConnection, newProjectMemberTriggerRunner, newSendCampaignStep, newUpdateMemberTagsStep, newUpsertMemberStep };
|