@corsair-dev/activecampaign 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 +191 -0
- package/dist/behaviour.test.d.ts +2 -0
- package/dist/behaviour.test.d.ts.map +1 -0
- package/dist/client.d.ts +29 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/endpoints/accounts.d.ts +107 -0
- package/dist/endpoints/accounts.d.ts.map +1 -0
- package/dist/endpoints/contacts.d.ts +166 -0
- package/dist/endpoints/contacts.d.ts.map +1 -0
- package/dist/endpoints/content.d.ts +178 -0
- package/dist/endpoints/content.d.ts.map +1 -0
- package/dist/endpoints/deals.d.ts +89 -0
- package/dist/endpoints/deals.d.ts.map +1 -0
- package/dist/endpoints/fields.d.ts +44 -0
- package/dist/endpoints/fields.d.ts.map +1 -0
- package/dist/endpoints/imports.d.ts +31 -0
- package/dist/endpoints/imports.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +21 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/lists.d.ts +21 -0
- package/dist/endpoints/lists.d.ts.map +1 -0
- package/dist/endpoints/logging.d.ts +20 -0
- package/dist/endpoints/logging.d.ts.map +1 -0
- package/dist/endpoints/persist.d.ts +57 -0
- package/dist/endpoints/persist.d.ts.map +1 -0
- package/dist/endpoints/platform.d.ts +239 -0
- package/dist/endpoints/platform.d.ts.map +1 -0
- package/dist/endpoints/resource.d.ts +81 -0
- package/dist/endpoints/resource.d.ts.map +1 -0
- package/dist/endpoints/segments-v2.d.ts +71 -0
- package/dist/endpoints/segments-v2.d.ts.map +1 -0
- package/dist/endpoints/shared.d.ts +55 -0
- package/dist/endpoints/shared.d.ts.map +1 -0
- package/dist/endpoints/tags.d.ts +17 -0
- package/dist/endpoints/tags.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +10533 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/endpoints.test.d.ts +2 -0
- package/dist/endpoints.test.d.ts.map +1 -0
- package/dist/error-handlers.d.ts +85 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +7901 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/integration.test.d.ts +2 -0
- package/dist/integration.test.d.ts.map +1 -0
- package/dist/persist.test.d.ts +2 -0
- package/dist/persist.test.d.ts.map +1 -0
- package/dist/routing.test.d.ts +2 -0
- package/dist/routing.test.d.ts.map +1 -0
- package/dist/schema/database.d.ts +874 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +731 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema.test.d.ts +2 -0
- package/dist/schema.test.d.ts.map +1 -0
- package/dist/segments-v2.test.d.ts +2 -0
- package/dist/segments-v2.test.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { ActiveCampaignEndpoints } from '../index';
|
|
2
|
+
export declare const listConnections: ActiveCampaignEndpoints["connectionsList"];
|
|
3
|
+
export declare const getConnection: ActiveCampaignEndpoints["connectionsGet"];
|
|
4
|
+
export declare const createConnection: ActiveCampaignEndpoints["connectionsCreate"];
|
|
5
|
+
export declare const updateConnection: ActiveCampaignEndpoints["connectionsUpdate"];
|
|
6
|
+
export declare const removeConnection: ActiveCampaignEndpoints["connectionsDelete"];
|
|
7
|
+
export declare const listCustomers: ActiveCampaignEndpoints["ecomCustomersList"];
|
|
8
|
+
export declare const getCustomer: ActiveCampaignEndpoints["ecomCustomersGet"];
|
|
9
|
+
export declare const createCustomer: ActiveCampaignEndpoints["ecomCustomersCreate"];
|
|
10
|
+
export declare const updateCustomer: ActiveCampaignEndpoints["ecomCustomersUpdate"];
|
|
11
|
+
export declare const removeCustomer: ActiveCampaignEndpoints["ecomCustomersDelete"];
|
|
12
|
+
export declare const listOrders: ActiveCampaignEndpoints["ecomOrdersList"];
|
|
13
|
+
export declare const getOrder: ActiveCampaignEndpoints["ecomOrdersGet"];
|
|
14
|
+
export declare const createOrder: ActiveCampaignEndpoints["ecomOrdersCreate"];
|
|
15
|
+
export declare const updateOrder: ActiveCampaignEndpoints["ecomOrdersUpdate"];
|
|
16
|
+
export declare const removeOrder: ActiveCampaignEndpoints["ecomOrdersDelete"];
|
|
17
|
+
export declare const listOrderProducts: ActiveCampaignEndpoints["ecomOrderProductsList"];
|
|
18
|
+
export declare const getOrderProduct: ActiveCampaignEndpoints["ecomOrderProductsGet"];
|
|
19
|
+
export declare const listSchemas: ActiveCampaignEndpoints["customObjectSchemasList"];
|
|
20
|
+
export declare const getSchema: ActiveCampaignEndpoints["customObjectSchemasGet"];
|
|
21
|
+
export declare const createSchema: ActiveCampaignEndpoints["customObjectSchemasCreate"];
|
|
22
|
+
export declare const updateSchema: ActiveCampaignEndpoints["customObjectSchemasUpdate"];
|
|
23
|
+
export declare const removeSchema: ActiveCampaignEndpoints["customObjectSchemasDelete"];
|
|
24
|
+
export declare const listWebhooks: ActiveCampaignEndpoints["webhooksList"];
|
|
25
|
+
export declare const getWebhook: ActiveCampaignEndpoints["webhooksGet"];
|
|
26
|
+
export declare const createWebhook: ActiveCampaignEndpoints["webhooksCreate"];
|
|
27
|
+
export declare const updateWebhook: ActiveCampaignEndpoints["webhooksUpdate"];
|
|
28
|
+
export declare const removeWebhook: ActiveCampaignEndpoints["webhooksDelete"];
|
|
29
|
+
export declare const listUsers: ActiveCampaignEndpoints["usersList"];
|
|
30
|
+
export declare const getUser: ActiveCampaignEndpoints["usersGet"];
|
|
31
|
+
export declare const createUser: ActiveCampaignEndpoints["usersCreate"];
|
|
32
|
+
export declare const updateUser: ActiveCampaignEndpoints["usersUpdate"];
|
|
33
|
+
export declare const removeUser: ActiveCampaignEndpoints["usersDelete"];
|
|
34
|
+
export declare const listGroups: ActiveCampaignEndpoints["groupsList"];
|
|
35
|
+
export declare const getGroup: ActiveCampaignEndpoints["groupsGet"];
|
|
36
|
+
export declare const createGroup: ActiveCampaignEndpoints["groupsCreate"];
|
|
37
|
+
export declare const updateGroup: ActiveCampaignEndpoints["groupsUpdate"];
|
|
38
|
+
export declare const removeGroup: ActiveCampaignEndpoints["groupsDelete"];
|
|
39
|
+
export declare const listAddresses: ActiveCampaignEndpoints["addressesList"];
|
|
40
|
+
export declare const getAddress: ActiveCampaignEndpoints["addressesGet"];
|
|
41
|
+
export declare const createAddress: ActiveCampaignEndpoints["addressesCreate"];
|
|
42
|
+
export declare const updateAddress: ActiveCampaignEndpoints["addressesUpdate"];
|
|
43
|
+
export declare const removeAddress: ActiveCampaignEndpoints["addressesDelete"];
|
|
44
|
+
export declare const listCalendars: ActiveCampaignEndpoints["calendarsList"];
|
|
45
|
+
export declare const getCalendar: ActiveCampaignEndpoints["calendarsGet"];
|
|
46
|
+
export declare const createCalendar: ActiveCampaignEndpoints["calendarsCreate"];
|
|
47
|
+
export declare const updateCalendar: ActiveCampaignEndpoints["calendarsUpdate"];
|
|
48
|
+
export declare const removeCalendar: ActiveCampaignEndpoints["calendarsDelete"];
|
|
49
|
+
export declare const listEvents: ActiveCampaignEndpoints["eventTrackingEventsList"];
|
|
50
|
+
export declare const createEvent: ActiveCampaignEndpoints["eventTrackingEventsCreate"];
|
|
51
|
+
export declare const removeEvent: ActiveCampaignEndpoints["eventTrackingEventsDelete"];
|
|
52
|
+
export declare const searchProducts: ActiveCampaignEndpoints['productsSearch'];
|
|
53
|
+
export declare const getProduct: ActiveCampaignEndpoints['productsGet'];
|
|
54
|
+
export declare const createProduct: ActiveCampaignEndpoints['productsCreate'];
|
|
55
|
+
export declare const updateProduct: ActiveCampaignEndpoints['productsUpdate'];
|
|
56
|
+
export declare const removeProduct: ActiveCampaignEndpoints['productsDelete'];
|
|
57
|
+
export declare const upsertProductsBulk: ActiveCampaignEndpoints['productsUpsertBulk'];
|
|
58
|
+
export declare const upsertOrdersBulk: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
59
|
+
orders: Record<string, unknown>[];
|
|
60
|
+
}) => Promise<{
|
|
61
|
+
[x: string]: unknown;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const upsertOrdersBulkAsync: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
64
|
+
orders: Record<string, unknown>[];
|
|
65
|
+
}) => Promise<{
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const searchRecurringPayments: ActiveCampaignEndpoints['recurringPaymentsSearch'];
|
|
69
|
+
export declare const upsertRecurringPaymentsBulk: ActiveCampaignEndpoints['recurringPaymentsUpsertBulk'];
|
|
70
|
+
export declare const searchBrowseSessions: ActiveCampaignEndpoints['browseSessionsSearch'];
|
|
71
|
+
export declare const saveBrowseSession: ActiveCampaignEndpoints['browseSessionsSave'];
|
|
72
|
+
export declare const addBrowseSessionToCart: ActiveCampaignEndpoints['browseSessionsAddToCart'];
|
|
73
|
+
export declare const getSiteTrackingStatus: (ctx: import("../index").ActiveCampaignContext, args: Record<string, never>) => Promise<{
|
|
74
|
+
[x: string]: unknown;
|
|
75
|
+
siteTracking: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
80
|
+
export declare const getEventTrackingStatus: (ctx: import("../index").ActiveCampaignContext, args: Record<string, never>) => Promise<{
|
|
81
|
+
[x: string]: unknown;
|
|
82
|
+
eventTracking: {
|
|
83
|
+
[x: string]: unknown;
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
export declare const setSiteTrackingStatus: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
}) => Promise<{
|
|
90
|
+
[x: string]: unknown;
|
|
91
|
+
siteTracking: {
|
|
92
|
+
[x: string]: unknown;
|
|
93
|
+
enabled: boolean;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
export declare const setEventTrackingStatus: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
97
|
+
enabled: boolean;
|
|
98
|
+
}) => Promise<{
|
|
99
|
+
[x: string]: unknown;
|
|
100
|
+
eventTracking: {
|
|
101
|
+
[x: string]: unknown;
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Records a custom event against a contact.
|
|
107
|
+
*
|
|
108
|
+
* Event tracking uses a separate host and form encoding rather than the v3
|
|
109
|
+
* JSON API, and needs the account's event key alongside the actor id. Both are
|
|
110
|
+
* caller-supplied because neither is derivable from the API token.
|
|
111
|
+
*/
|
|
112
|
+
export declare const trackEvent: ActiveCampaignEndpoints['trackingTrackEvent'];
|
|
113
|
+
export declare const listWhitelistedDomains: ActiveCampaignEndpoints['trackingListWhitelist'];
|
|
114
|
+
export declare const addWhitelistedDomain: ActiveCampaignEndpoints['trackingAddWhitelist'];
|
|
115
|
+
export declare const removeWhitelistedDomain: ActiveCampaignEndpoints['trackingRemoveWhitelist'];
|
|
116
|
+
export declare const getLoggedInUser: ActiveCampaignEndpoints['usersGetMe'];
|
|
117
|
+
export declare const getUserByUsername: ActiveCampaignEndpoints['usersGetByUsername'];
|
|
118
|
+
export declare const listGroupLimits: ActiveCampaignEndpoints['groupLimitsList'];
|
|
119
|
+
export declare const listScores: ActiveCampaignEndpoints['scoresList'];
|
|
120
|
+
/**
|
|
121
|
+
* Email activity is transactional and can be very large, so ActiveCampaign
|
|
122
|
+
* expects a subscriber or deal filter. Neither is required by the API, but
|
|
123
|
+
* omitting both degrades badly, so the input documents that.
|
|
124
|
+
*/
|
|
125
|
+
export declare const listEmailActivities: ActiveCampaignEndpoints['emailActivitiesList'];
|
|
126
|
+
export declare const getBranding: ActiveCampaignEndpoints['brandingsGet'];
|
|
127
|
+
export declare const updateBranding: ActiveCampaignEndpoints['brandingsUpdate'];
|
|
128
|
+
export declare const updateConfig: ActiveCampaignEndpoints['configsUpdate'];
|
|
129
|
+
/** Custom object records, keyed either by internal id or by external id. */
|
|
130
|
+
export declare const upsertRecord: ActiveCampaignEndpoints['customObjectRecordsUpsert'];
|
|
131
|
+
export declare const listRecords: ActiveCampaignEndpoints['customObjectRecordsList'];
|
|
132
|
+
export declare const getRecord: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
133
|
+
schemaId: string;
|
|
134
|
+
id: string;
|
|
135
|
+
}) => Promise<{
|
|
136
|
+
[x: string]: unknown;
|
|
137
|
+
record: unknown;
|
|
138
|
+
}>;
|
|
139
|
+
export declare const getRecordByExternalId: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
140
|
+
schemaId: string;
|
|
141
|
+
externalId: string;
|
|
142
|
+
}) => Promise<{
|
|
143
|
+
[x: string]: unknown;
|
|
144
|
+
record: unknown;
|
|
145
|
+
}>;
|
|
146
|
+
export declare const removeRecord: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
147
|
+
schemaId: string;
|
|
148
|
+
id: string;
|
|
149
|
+
}) => Promise<{
|
|
150
|
+
[x: string]: unknown;
|
|
151
|
+
schemaId: string;
|
|
152
|
+
id?: string | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const removeRecordByExternalId: (ctx: import("../index").ActiveCampaignContext, args: {
|
|
155
|
+
schemaId: string;
|
|
156
|
+
externalId: string;
|
|
157
|
+
}) => Promise<{
|
|
158
|
+
[x: string]: unknown;
|
|
159
|
+
schemaId: string;
|
|
160
|
+
externalId?: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const listSmsBroadcasts: ActiveCampaignEndpoints['smsBroadcastsList'];
|
|
163
|
+
export declare const getSmsCredits: ActiveCampaignEndpoints['smsCreditsGet'];
|
|
164
|
+
export declare const getSmsMetricsSnapshot: ActiveCampaignEndpoints['smsBroadcastsGetSnapshot'];
|
|
165
|
+
export declare const createSmsMetricsSnapshot: ActiveCampaignEndpoints['smsBroadcastsCreateSnapshot'];
|
|
166
|
+
export declare const getSmsMetrics: ActiveCampaignEndpoints['smsBroadcastsGetMetrics'];
|
|
167
|
+
export declare const getSmsFailures: ActiveCampaignEndpoints['smsBroadcastsGetFailures'];
|
|
168
|
+
/**
|
|
169
|
+
* Recipients of one SMS broadcast. Rows carry phone numbers, so only the
|
|
170
|
+
* returned count reaches the event log.
|
|
171
|
+
*/
|
|
172
|
+
export declare const getSmsRecipients: ActiveCampaignEndpoints['smsBroadcastsGetRecipients'];
|
|
173
|
+
/**
|
|
174
|
+
* The JavaScript snippet to embed for site tracking. Lives at
|
|
175
|
+
* `siteTracking/code`, not the `siteTrackingCode` the naming would suggest.
|
|
176
|
+
*/
|
|
177
|
+
export declare const getSiteTrackingCode: ActiveCampaignEndpoints['trackingGetCode'];
|
|
178
|
+
/** SMS broadcast lists live at `sms/lists`, under the `lists` envelope. */
|
|
179
|
+
export declare const listSmsBroadcastLists: ActiveCampaignEndpoints['smsBroadcastListsList'];
|
|
180
|
+
export declare const removeAddressGroup: ActiveCampaignEndpoints['addressGroupsDelete'];
|
|
181
|
+
/**
|
|
182
|
+
* Finds one order by the identifiers the source system knows it by.
|
|
183
|
+
*
|
|
184
|
+
* ActiveCampaign has no route taking a store order id directly, so the
|
|
185
|
+
* collection is filtered on `externalid` within a connection, and an exact
|
|
186
|
+
* comparison decides - the filter is not guaranteed to be exact.
|
|
187
|
+
*/
|
|
188
|
+
export declare const findOrder: ActiveCampaignEndpoints['ecomOrdersFind'];
|
|
189
|
+
/**
|
|
190
|
+
* Creates an order, or updates the existing one with the same store order id
|
|
191
|
+
* within the connection.
|
|
192
|
+
*
|
|
193
|
+
* Lookup and write are separate requests, so concurrent calls for the same
|
|
194
|
+
* connectionid and externalid can both miss and POST duplicates. Callers must
|
|
195
|
+
* serialize those upserts, or use orders.upsertBulk which matches server-side.
|
|
196
|
+
*
|
|
197
|
+
* The lookup is a read, so a transport failure before the write is safe to
|
|
198
|
+
* replay; the write half is listed as non-idempotent.
|
|
199
|
+
*/
|
|
200
|
+
export declare const upsertOrder: ActiveCampaignEndpoints['ecomOrdersUpsert'];
|
|
201
|
+
/** The product lines belonging to one order, filtered on the collection. */
|
|
202
|
+
export declare const listProductsForOrder: ActiveCampaignEndpoints['ecomOrderProductsListForOrder'];
|
|
203
|
+
/**
|
|
204
|
+
* Creates a reminder on a deal task.
|
|
205
|
+
*
|
|
206
|
+
* The route is `taskNotifications`, not the `taskReminders` the catalog name
|
|
207
|
+
* suggests - confirmed 200 against a live account on 2026-08-14. `interval` is
|
|
208
|
+
* minutes before the due date.
|
|
209
|
+
*/
|
|
210
|
+
export declare const createTaskReminder: ActiveCampaignEndpoints['taskRemindersCreate'];
|
|
211
|
+
/**
|
|
212
|
+
* Creates a child schema under a public parent schema.
|
|
213
|
+
*
|
|
214
|
+
* Posts to the same `customObjects/schemas` collection the other schema
|
|
215
|
+
* operations use - that route is confirmed - with the parent identifiers
|
|
216
|
+
* added. The child-specific body fields themselves are from the documentation
|
|
217
|
+
* rather than a captured request, since the development account has no public
|
|
218
|
+
* parent schema to create a child of.
|
|
219
|
+
*/
|
|
220
|
+
export declare const createChildSchema: ActiveCampaignEndpoints['customObjectSchemasCreateChild'];
|
|
221
|
+
/**
|
|
222
|
+
* Aggregate bulk-import progress across all batches.
|
|
223
|
+
*
|
|
224
|
+
* ROUTE UNVERIFIED: `import/bulk_import/aggregate` and every variant tried
|
|
225
|
+
* answered 404 on the development account, while `import/bulk_import` itself
|
|
226
|
+
* answers 200. The path below follows the documented shape; see
|
|
227
|
+
* UNVERIFIED_ROUTES in `segments-v2.ts` for the same caveat applied to the V2
|
|
228
|
+
* segments surface.
|
|
229
|
+
*/
|
|
230
|
+
export declare const listImportAggregate: ActiveCampaignEndpoints['importsListAggregate'];
|
|
231
|
+
/**
|
|
232
|
+
* Simulates a tracking event through the browse-session system, returning the
|
|
233
|
+
* debug output that shows how a URL would be matched to a product.
|
|
234
|
+
*
|
|
235
|
+
* ROUTE UNVERIFIED: the mutation name follows the documented shape but could
|
|
236
|
+
* not be exercised - the development account has no e-commerce connection.
|
|
237
|
+
*/
|
|
238
|
+
export declare const testTrackingEvent: ActiveCampaignEndpoints['browseSessionsTestEvent'];
|
|
239
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../endpoints/platform.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAuNxD,eAAO,MAAM,eAAe,EACP,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AAChE,eAAO,MAAM,aAAa,EACN,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB,EACN,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,gBAAgB,EACN,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,gBAAgB,EACN,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AAEpE,eAAO,MAAM,aAAa,EACH,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,WAAW,EACF,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;AAClE,eAAO,MAAM,cAAc,EACF,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;AACxE,eAAO,MAAM,cAAc,EACF,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;AACxE,eAAO,MAAM,cAAc,EACF,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;AAExE,eAAO,MAAM,UAAU,EACH,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,QAAQ,EACF,uBAAuB,CAAC,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,WAAW,EACF,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;AAClE,eAAO,MAAM,WAAW,EACF,uBAAuB,CAAC,kBAAkB,CAAC,C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AO,MAAM,gBAAgB,EAAE,uBAAuB,CAAC,4BAA4B,CAiBjF,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,CAAC,iBAAiB,CAczE,CAAC;AAOH,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,EAAE,uBAAuB,CAAC,uBAAuB,CAoBjF,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,qBAAqB,CAiB5E,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,EAAE,uBAAuB,CAAC,gBAAgB,CAgC/D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,EAAE,uBAAuB,CAAC,kBAAkB,CAyCnE,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,EAAE,uBAAuB,CAAC,+BAA+B,CAwBxF,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,qBAAqB,CAsB5E,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,gCAAgC,CAuBtF,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,CAAC,sBAAsB,CAc9E,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,yBAAyB,CAmB/E,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the five standard operations for an ActiveCampaign REST resource.
|
|
4
|
+
*
|
|
5
|
+
* Nearly every resource on the v3 API follows one shape: a collection at
|
|
6
|
+
* `/<path>` returning rows under a plural envelope key, a single record at
|
|
7
|
+
* `/<path>/{id}` under a singular key, and create/update taking a body wrapped
|
|
8
|
+
* in that same singular key. Rather than repeat that eleven times with only
|
|
9
|
+
* the strings changed, it is declared once here.
|
|
10
|
+
*
|
|
11
|
+
* Every rule the hand-written groups follow is preserved:
|
|
12
|
+
*
|
|
13
|
+
* - rows are validated against the entity schema before being cached, and a
|
|
14
|
+
* rejected row warns rather than failing the call
|
|
15
|
+
* - cache writes are best-effort; a mirror failure never fails the operation
|
|
16
|
+
* - an explicit DELETE evicts, a read never does
|
|
17
|
+
* - `undefined` is stripped from bodies and queries so that "leave this alone"
|
|
18
|
+
* is not serialised as "clear this"
|
|
19
|
+
* - audit payloads allow-list identifiers; everything else is logged by field
|
|
20
|
+
* name only
|
|
21
|
+
*
|
|
22
|
+
* The `ctx` and returned handlers are typed loosely here and re-typed at each
|
|
23
|
+
* export site against the operation's own key, so the per-operation input and
|
|
24
|
+
* output types are still enforced at the boundary. This is the only place in
|
|
25
|
+
* the plugin where that widening happens.
|
|
26
|
+
*/
|
|
27
|
+
type ResourceCtx = {
|
|
28
|
+
key: string;
|
|
29
|
+
options: {
|
|
30
|
+
account?: string;
|
|
31
|
+
};
|
|
32
|
+
keys: {
|
|
33
|
+
get_account: () => Promise<string | null | undefined>;
|
|
34
|
+
};
|
|
35
|
+
db: Record<string, unknown>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The generic handler shape. `input` is `Record<string, unknown>` rather than
|
|
39
|
+
* a narrower type on purpose: each export site re-types the handler against
|
|
40
|
+
* its own operation key, and a narrower parameter here (`Record<string,
|
|
41
|
+
* never>`, say) would make every one of those casts a non-overlapping
|
|
42
|
+
* conversion.
|
|
43
|
+
*/
|
|
44
|
+
type Handler = (ctx: ResourceCtx, input: Record<string, unknown>) => Promise<unknown>;
|
|
45
|
+
export interface ResourceConfig {
|
|
46
|
+
/** REST path segment, e.g. `dealGroups`. */
|
|
47
|
+
path: string;
|
|
48
|
+
/** Envelope key on a single-record response, e.g. `dealGroup`. */
|
|
49
|
+
one: string;
|
|
50
|
+
/** Envelope key on a collection response, e.g. `dealGroups`. */
|
|
51
|
+
many: string;
|
|
52
|
+
/** Event name prefix, e.g. `activecampaign.dealGroups`. */
|
|
53
|
+
event: string;
|
|
54
|
+
/** Entity schema used to validate rows before caching. Omit to skip. */
|
|
55
|
+
entity?: z.ZodType;
|
|
56
|
+
/** Key in `ctx.db` to mirror into. Omit to skip mirroring. */
|
|
57
|
+
store?: string;
|
|
58
|
+
/** Human label used in warnings, e.g. `dealGroup`. */
|
|
59
|
+
label?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Input keys that may be logged by value. Identifiers, pagination and
|
|
62
|
+
* status flags only - never names, emails, or free text.
|
|
63
|
+
*/
|
|
64
|
+
logKeys?: readonly string[];
|
|
65
|
+
/** Extra query parameters passed through on list, beyond pagination. */
|
|
66
|
+
queryKeys?: readonly string[];
|
|
67
|
+
/** Maps caller-facing keys to ActiveCampaign's wire-level query keys. */
|
|
68
|
+
queryMap?: Readonly<Record<string, string>>;
|
|
69
|
+
/** Body keys accepted by create and update. */
|
|
70
|
+
bodyKeys?: readonly string[];
|
|
71
|
+
}
|
|
72
|
+
export declare function mapQuery(input: Record<string, unknown>, mapping: Readonly<Record<string, string>>): Record<string, string | number | boolean | undefined>;
|
|
73
|
+
export declare function makeResource(config: ResourceConfig): {
|
|
74
|
+
list: Handler;
|
|
75
|
+
get: Handler;
|
|
76
|
+
create: Handler;
|
|
77
|
+
update: Handler;
|
|
78
|
+
remove: Handler;
|
|
79
|
+
};
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../endpoints/resource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAW7B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,KAAK,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,I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;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc;;;;;;EA+JlD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ActiveCampaignEndpoints } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* The V2 segments API: segment definitions keyed by UUID, their count history,
|
|
4
|
+
* and contact match evaluation.
|
|
5
|
+
*
|
|
6
|
+
* ROUTE VERIFICATION STATUS - read before changing anything here.
|
|
7
|
+
*
|
|
8
|
+
* Every other operation in this plugin was confirmed against a live account
|
|
9
|
+
* before being written. These could not be: the account used for development
|
|
10
|
+
* answers 404 to `/v2/segments`, `/segments/v2`, `/segments/{id}/counts`,
|
|
11
|
+
* `/segments/{id}/match` and `/api/v2/segments`, and the ActiveCampaign
|
|
12
|
+
* documentation pages for the V2 segments API were not reachable either. The
|
|
13
|
+
* legacy `/segments` collection - which this plugin does implement, in
|
|
14
|
+
* `content.ts` - answers 200 on the same account, so the V2 surface appears to
|
|
15
|
+
* be gated by plan or by feature flag rather than simply misnamed.
|
|
16
|
+
*
|
|
17
|
+
* The paths below therefore follow the shape the OSS catalog descriptions
|
|
18
|
+
* imply, and are listed in {@link UNVERIFIED_ROUTES} so the uncertainty is
|
|
19
|
+
* visible in code rather than buried in a commit message. `segments.test.ts`
|
|
20
|
+
* asserts that list stays in step with this file.
|
|
21
|
+
*
|
|
22
|
+
* Before relying on these: run them against an account that has the V2
|
|
23
|
+
* segments feature, correct the paths against what actually answers, and
|
|
24
|
+
* remove the entries from UNVERIFIED_ROUTES.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Operations whose route could not be confirmed against a live account.
|
|
28
|
+
*
|
|
29
|
+
* Kept as an exported constant so the PR body, the docs and the tests all read
|
|
30
|
+
* the same list, and so a reviewer can see the honest state at a glance.
|
|
31
|
+
*/
|
|
32
|
+
export declare const UNVERIFIED_ROUTES: ReadonlySet<string>;
|
|
33
|
+
export declare const create: ActiveCampaignEndpoints['segmentsV2Create'];
|
|
34
|
+
export declare const get: ActiveCampaignEndpoints['segmentsV2Get'];
|
|
35
|
+
export declare const update: ActiveCampaignEndpoints['segmentsV2Update'];
|
|
36
|
+
/**
|
|
37
|
+
* Deleting a segment removes every historic version of it as well, so the API
|
|
38
|
+
* returns the segment's final state as an audit trail.
|
|
39
|
+
*/
|
|
40
|
+
export declare const remove: ActiveCampaignEndpoints['segmentsV2Delete'];
|
|
41
|
+
/** The segment definition as it stood at a point in time. */
|
|
42
|
+
export declare const getAtTimestamp: ActiveCampaignEndpoints['segmentsV2GetAtTimestamp'];
|
|
43
|
+
/** Restores a segment to how it looked at a point in time. */
|
|
44
|
+
export declare const revertToTimestamp: ActiveCampaignEndpoints['segmentsV2RevertToTimestamp'];
|
|
45
|
+
export declare const recentCounts: ActiveCampaignEndpoints['segmentsV2RecentCounts'];
|
|
46
|
+
/**
|
|
47
|
+
* Historic counts for one segment. ActiveCampaign documents a cap of 50
|
|
48
|
+
* results and 90 days of retention.
|
|
49
|
+
*/
|
|
50
|
+
export declare const countHistory: ActiveCampaignEndpoints['segmentsV2CountHistory'];
|
|
51
|
+
export declare const countAtTimestamp: ActiveCampaignEndpoints['segmentsV2CountAtTimestamp'];
|
|
52
|
+
/** Whether one contact matches a segment. */
|
|
53
|
+
export declare const match: ActiveCampaignEndpoints['segmentsV2Match'];
|
|
54
|
+
export declare const matchByExternalId: ActiveCampaignEndpoints['segmentsV2MatchByExternalId'];
|
|
55
|
+
/**
|
|
56
|
+
* Starts a match-all evaluation.
|
|
57
|
+
*
|
|
58
|
+
* ActiveCampaign answers within about four seconds if it can, and otherwise
|
|
59
|
+
* returns `is_ready: false` with a run id to poll - which is what
|
|
60
|
+
* `matchAllResult` is for.
|
|
61
|
+
*/
|
|
62
|
+
export declare const matchAll: ActiveCampaignEndpoints['segmentsV2MatchAll'];
|
|
63
|
+
/**
|
|
64
|
+
* Fetches a match-all result set by run id.
|
|
65
|
+
*
|
|
66
|
+
* `is_ready: false` with `run_id_end` populated means the run errored rather
|
|
67
|
+
* than that it is still working - worth checking both before polling again.
|
|
68
|
+
*/
|
|
69
|
+
export declare const matchAllResult: ActiveCampaignEndpoints['segmentsV2MatchAllResult'];
|
|
70
|
+
export declare const matchSomeResult: ActiveCampaignEndpoints['segmentsV2MatchSomeResult'];
|
|
71
|
+
//# sourceMappingURL=segments-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments-v2.d.ts","sourceRoot":"","sources":["../../endpoints/segments-v2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAKxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAehD,CAAC;AAIH,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,kBAAkB,CA2B9D,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,uBAAuB,CAAC,eAAe,CAgBxD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,kBAAkB,CA2B9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,kBAAkB,CAgB9D,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,cAAc,EAAE,uBAAuB,CAAC,0BAA0B,CAgB7E,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,6BAA6B,CAgBnF,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,uBAAuB,CAAC,wBAAwB,CAiBzE,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,uBAAuB,CAAC,wBAAwB,CAczE,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,CAAC,4BAA4B,CAgBjF,CAAC;AAEH,6CAA6C;AAC7C,eAAO,MAAM,KAAK,EAAE,uBAAuB,CAAC,iBAAiB,CAkB5D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,6BAA6B,CAqBnF,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,uBAAuB,CAAC,oBAAoB,CAgBlE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,uBAAuB,CAAC,0BAA0B,CAc7E,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,uBAAuB,CAAC,2BAA2B,CAc/E,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strips keys whose value is `undefined`.
|
|
3
|
+
*
|
|
4
|
+
* ActiveCampaign distinguishes an absent field from an explicit `null`:
|
|
5
|
+
* omitting a field leaves the stored value alone, while sending `null` clears
|
|
6
|
+
* it. `JSON.stringify` drops `undefined` from objects but not from the shape
|
|
7
|
+
* callers build up conditionally, so compacting here keeps "leave this alone"
|
|
8
|
+
* from being serialised as "clear this".
|
|
9
|
+
*/
|
|
10
|
+
export declare function compactBody(body: Record<string, unknown>): Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Same rule as {@link compactBody}, for query strings. A `undefined` query
|
|
13
|
+
* value would otherwise be serialised as the literal string "undefined".
|
|
14
|
+
*/
|
|
15
|
+
export declare function compactQuery(query: Record<string, string | number | boolean | undefined>): Record<string, string | number | boolean | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* ActiveCampaign's REST collections share one pagination contract: `limit` and
|
|
18
|
+
* `offset` query parameters, the rows under a resource-named key, and the
|
|
19
|
+
* total under `meta.total`. Declared once here and reused by every list
|
|
20
|
+
* operation so the envelope cannot drift between resources.
|
|
21
|
+
*
|
|
22
|
+
* The default page size is 20 and the documented maximum is 100; a caller
|
|
23
|
+
* asking for more than 100 would be silently capped by the API, so the limit
|
|
24
|
+
* is clamped here where it is visible instead.
|
|
25
|
+
*
|
|
26
|
+
* @see https://developers.activecampaign.com/reference/pagination
|
|
27
|
+
*/
|
|
28
|
+
export declare const AC_PAGE_SIZE_DEFAULT = 20;
|
|
29
|
+
export declare const AC_PAGE_SIZE_MAX = 100;
|
|
30
|
+
export declare function buildPaginationQuery(input: {
|
|
31
|
+
limit?: number;
|
|
32
|
+
offset?: number;
|
|
33
|
+
}): Record<string, string | number | boolean | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the account slug - the second half of the ActiveCampaign
|
|
36
|
+
* credential.
|
|
37
|
+
*
|
|
38
|
+
* Declared once here rather than per endpoint file. It raises rather than
|
|
39
|
+
* returning an empty string, because an empty slug would otherwise be
|
|
40
|
+
* interpolated into the base URL and the failure would surface as a confusing
|
|
41
|
+
* transport error against `https://.api-us1.com` instead of as the missing
|
|
42
|
+
* credential it actually is.
|
|
43
|
+
*
|
|
44
|
+
* `AuthMissingError` is the core's own signal for this, so the runtime can
|
|
45
|
+
* tell a configuration gap apart from an API failure.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveAccount(ctx: {
|
|
48
|
+
options?: {
|
|
49
|
+
account?: string;
|
|
50
|
+
};
|
|
51
|
+
keys?: {
|
|
52
|
+
get_account?: () => Promise<string | null | undefined>;
|
|
53
|
+
};
|
|
54
|
+
}): Promise<string>;
|
|
55
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../endpoints/shared.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAC1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAQvD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAMxD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE;IACzC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;KAAE,CAAC;CAClE,GAAG,OAAO,CAAC,MAAM,CAAC,CAalB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActiveCampaignEndpoints } from '../index';
|
|
2
|
+
export declare const list: ActiveCampaignEndpoints['tagsList'];
|
|
3
|
+
export declare const get: ActiveCampaignEndpoints['tagsGet'];
|
|
4
|
+
export declare const create: ActiveCampaignEndpoints['tagsCreate'];
|
|
5
|
+
export declare const update: ActiveCampaignEndpoints['tagsUpdate'];
|
|
6
|
+
export declare const remove: ActiveCampaignEndpoints['tagsDelete'];
|
|
7
|
+
export declare const addToContact: ActiveCampaignEndpoints['tagsAddToContact'];
|
|
8
|
+
/**
|
|
9
|
+
* Removes a tag from a contact.
|
|
10
|
+
*
|
|
11
|
+
* The id is the contactTag association id, not the tag id - deleting by tag id
|
|
12
|
+
* would delete the tag itself for every contact. Only the association row is
|
|
13
|
+
* evicted; the tag stays in the mirror because it still exists upstream.
|
|
14
|
+
*/
|
|
15
|
+
export declare const removeFromContact: ActiveCampaignEndpoints['tagsRemoveFromContact'];
|
|
16
|
+
export declare const listContactTags: ActiveCampaignEndpoints['contactTagsList'];
|
|
17
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../endpoints/tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAexD,eAAO,MAAM,IAAI,EAAE,uBAAuB,CAAC,UAAU,CAqBpD,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,uBAAuB,CAAC,SAAS,CAelD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,YAAY,CA2BxD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,YAAY,CA2BxD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,uBAAuB,CAAC,YAAY,CA0BxD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,uBAAuB,CAAC,kBAAkB,CA0BpE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,uBAAuB,CAmB7E,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,uBAAuB,CAAC,iBAAiB,CA4BrE,CAAC"}
|