@memberjunction/actions-apollo 6.1.0-edge.3 → 6.1.0-edge.5

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.
Files changed (56) hide show
  1. package/README.md +79 -0
  2. package/dist/__tests__/apollo-enrichment.test.js +4 -5
  3. package/dist/__tests__/apollo-enrichment.test.js.map +1 -1
  4. package/dist/__tests__/apollo-lists.test.d.ts +2 -0
  5. package/dist/__tests__/apollo-lists.test.d.ts.map +1 -0
  6. package/dist/__tests__/apollo-lists.test.js +957 -0
  7. package/dist/__tests__/apollo-lists.test.js.map +1 -0
  8. package/dist/accounts.d.ts +4 -4
  9. package/dist/accounts.d.ts.map +1 -1
  10. package/dist/accounts.js +20 -18
  11. package/dist/accounts.js.map +1 -1
  12. package/dist/config.d.ts +10 -0
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +10 -0
  15. package/dist/config.js.map +1 -1
  16. package/dist/contacts.d.ts +4 -4
  17. package/dist/contacts.d.ts.map +1 -1
  18. package/dist/contacts.js +24 -22
  19. package/dist/contacts.js.map +1 -1
  20. package/dist/generic/apollo-lists.types.d.ts +246 -0
  21. package/dist/generic/apollo-lists.types.d.ts.map +1 -0
  22. package/dist/generic/apollo-lists.types.js +42 -0
  23. package/dist/generic/apollo-lists.types.js.map +1 -0
  24. package/dist/index.d.ts +8 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +11 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/lists/ApolloListActions.d.ts +49 -0
  29. package/dist/lists/ApolloListActions.d.ts.map +1 -0
  30. package/dist/lists/ApolloListActions.js +135 -0
  31. package/dist/lists/ApolloListActions.js.map +1 -0
  32. package/dist/lists/ApolloMoveActions.d.ts +33 -0
  33. package/dist/lists/ApolloMoveActions.d.ts.map +1 -0
  34. package/dist/lists/ApolloMoveActions.js +272 -0
  35. package/dist/lists/ApolloMoveActions.js.map +1 -0
  36. package/dist/lists/ApolloRESTBaseAction.d.ts +49 -0
  37. package/dist/lists/ApolloRESTBaseAction.d.ts.map +1 -0
  38. package/dist/lists/ApolloRESTBaseAction.js +70 -0
  39. package/dist/lists/ApolloRESTBaseAction.js.map +1 -0
  40. package/dist/lists/ApolloRESTClient.d.ts +136 -0
  41. package/dist/lists/ApolloRESTClient.d.ts.map +1 -0
  42. package/dist/lists/ApolloRESTClient.js +561 -0
  43. package/dist/lists/ApolloRESTClient.js.map +1 -0
  44. package/dist/lists/ApolloSearchActions.d.ts +64 -0
  45. package/dist/lists/ApolloSearchActions.d.ts.map +1 -0
  46. package/dist/lists/ApolloSearchActions.js +239 -0
  47. package/dist/lists/ApolloSearchActions.js.map +1 -0
  48. package/dist/lists/credentials.d.ts +57 -0
  49. package/dist/lists/credentials.d.ts.map +1 -0
  50. package/dist/lists/credentials.js +161 -0
  51. package/dist/lists/credentials.js.map +1 -0
  52. package/dist/lists/params.d.ts +61 -0
  53. package/dist/lists/params.d.ts.map +1 -0
  54. package/dist/lists/params.js +113 -0
  55. package/dist/lists/params.js.map +1 -0
  56. package/package.json +8 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApolloListActions.js","sourceRoot":"","sources":["../../src/lists/ApolloListActions.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oBAAoB;IAChD,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE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EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CACpE,CAAC;YAEF,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,wBAAwB,OAAO,CAAC,IAAI,SAAS,OAAO,CAAC,EAAE,IAAI;gBACpE,UAAU,EAAE,SAAS;gBACrB,MAAM,EAAE,MAAM,CAAC,MAAM;aACxB,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,QAAQ,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;YACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,+BAA+B,GAAG,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;QAClG,CAAC;IACL,CAAC;CACJ,CAAA;AA3DY,sBAAsB;IADlC,aAAa,CAAC,UAAU,EAAE,wBAAwB,CAAC;GACvC,sBAAsB,CA2DlC;;AAED,MAAM,UAAU,qBAAqB;IACjC,8EAA8E;AAClF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
2
+ import { ApolloRESTBaseAction } from './ApolloRESTBaseAction.js';
3
+ /**
4
+ * Moves accounts from one Apollo list to another.
5
+ *
6
+ * Inputs:
7
+ * - AccountIDs (required) JSON array or comma-separated Apollo account ids
8
+ * - FromList (required) exact source label name
9
+ * - ToList (required) exact destination label name
10
+ * - CompanyID (optional) per-company credential resolution
11
+ *
12
+ * Outputs:
13
+ * - MovedCount / FailedCount / PossiblyStuckCount
14
+ * - Results per-account { id, added, removed, possiblyStuck, error }
15
+ * - NotOnSourcePage supplied ids that were not on page 1 of the source list
16
+ * - KeySource
17
+ *
18
+ * `PARTIAL_FAILURE` means at least one PATCH failed outright. Possibly-stuck
19
+ * records are NOT failures — the write succeeded and Apollo did not honour it.
20
+ */
21
+ export declare class ApolloMoveListAccountsAction extends ApolloRESTBaseAction {
22
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
23
+ }
24
+ /**
25
+ * Moves contacts from one Apollo list to another. Identical semantics to
26
+ * {@link ApolloMoveListAccountsAction}; the id param is `ContactIDs` and the
27
+ * outputs carry contact results.
28
+ */
29
+ export declare class ApolloMoveListContactsAction extends ApolloRESTBaseAction {
30
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
31
+ }
32
+ export declare function LoadApolloMoveActions(): void;
33
+ //# sourceMappingURL=ApolloMoveActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApolloMoveActions.d.ts","sourceRoot":"","sources":["../../src/lists/ApolloMoveActions.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA0IjE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,4BAA6B,SAAQ,oBAAoB;cAClD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAwE1F;AAED;;;;GAIG;AACH,qBACa,4BAA6B,SAAQ,oBAAoB;cAClD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAuE1F;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
@@ -0,0 +1,272 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /**
8
+ * Apollo list-move actions.
9
+ *
10
+ * A move is the only genuinely dangerous thing in this surface, so the two actions
11
+ * below are more cautious than their size suggests:
12
+ *
13
+ * - Both list names are resolved to real labels BEFORE any write. A typo in
14
+ * `ToList` that was only noticed halfway through would leave a batch split
15
+ * across two lists with no record of which half moved.
16
+ * - The source list is re-read to get each record's CURRENT labels. The caller
17
+ * supplies ids, never labels: Apollo replaces the whole label array on every
18
+ * update, so writing a stale set silently strips memberships the record picked
19
+ * up since the caller last looked.
20
+ * - Removes are verified, and records whose remove silently no-op'd are reported
21
+ * rather than retried. Apollo fails this way on roughly 15-17% of removes and
22
+ * an immediate retry flakes the same way; the next page-1 drain sees them
23
+ * carrying both labels and finishes the job.
24
+ *
25
+ * Both require a MASTER Apollo key. There is no delete surface.
26
+ */
27
+ import { RegisterClass } from '@memberjunction/global';
28
+ import { LogError, LogStatus } from '@memberjunction/core';
29
+ import { BaseAction } from '@memberjunction/actions';
30
+ import { ApolloRESTBaseAction } from './ApolloRESTBaseAction.js';
31
+ import { LIST_NOT_FOUND_HINT, getParam, getParamRaw, parseStringArrayParam } from './params.js';
32
+ /** Apollo's per-page maximum, which is also the widest source page a move can see. */
33
+ const MOVE_SOURCE_PER_PAGE = 100;
34
+ /**
35
+ * Validate the shared inputs. Identical `FromList`/`ToList` is rejected here
36
+ * rather than left to the client, so the caller gets a validation error instead of
37
+ * an exception out of the move engine.
38
+ */
39
+ function parseMoveInputs(params, idsParamName) {
40
+ const idsParsed = parseStringArrayParam(getParamRaw(params, idsParamName), idsParamName);
41
+ if (idsParsed.error !== null) {
42
+ return { inputs: null, error: { Success: false, Message: idsParsed.error, ResultCode: 'VALIDATION_ERROR' } };
43
+ }
44
+ if (idsParsed.value === undefined) {
45
+ return {
46
+ inputs: null,
47
+ error: {
48
+ Success: false,
49
+ Message: `Missing required field: ${idsParamName} (JSON array or comma-separated Apollo ids)`,
50
+ ResultCode: 'MISSING_REQUIRED_FIELDS',
51
+ },
52
+ };
53
+ }
54
+ const fromList = getParam(params, 'FromList');
55
+ if (!fromList) {
56
+ return { inputs: null, error: { Success: false, Message: 'Missing required field: FromList', ResultCode: 'MISSING_REQUIRED_FIELDS' } };
57
+ }
58
+ const toList = getParam(params, 'ToList');
59
+ if (!toList) {
60
+ return { inputs: null, error: { Success: false, Message: 'Missing required field: ToList', ResultCode: 'MISSING_REQUIRED_FIELDS' } };
61
+ }
62
+ if (fromList.toLowerCase() === toList.toLowerCase()) {
63
+ return {
64
+ inputs: null,
65
+ error: {
66
+ Success: false,
67
+ Message: `FromList and ToList are identical ('${fromList}') — nothing to move.`,
68
+ ResultCode: 'VALIDATION_ERROR',
69
+ },
70
+ };
71
+ }
72
+ return { inputs: { ids: idsParsed.value, fromList, toList }, error: null };
73
+ }
74
+ /** Resolve both list names to labels before any write happens. */
75
+ async function resolveBothLabels(client, fromList, toList) {
76
+ const from = await client.findLabelByName(fromList);
77
+ if (!from) {
78
+ return {
79
+ from: null,
80
+ to: null,
81
+ error: {
82
+ Success: false,
83
+ Message: `No Apollo list named '${fromList}' (FromList) was found. ${LIST_NOT_FOUND_HINT}`,
84
+ ResultCode: 'NOT_FOUND',
85
+ },
86
+ };
87
+ }
88
+ const to = await client.findLabelByName(toList);
89
+ if (!to) {
90
+ return {
91
+ from: null,
92
+ to: null,
93
+ error: {
94
+ Success: false,
95
+ Message: `No Apollo list named '${toList}' (ToList) was found. ${LIST_NOT_FOUND_HINT}`,
96
+ ResultCode: 'NOT_FOUND',
97
+ },
98
+ };
99
+ }
100
+ return { from, to, error: null };
101
+ }
102
+ /** The note appended when Apollo's silent-fail removes showed up. */
103
+ function stuckNote(possiblyStuckCount, kind) {
104
+ return possiblyStuckCount > 0
105
+ ? ` ${possiblyStuckCount} ${kind} may be stuck — Apollo's remove reported success without applying. ` +
106
+ `They will resurface on the next page-1 drain carrying both labels; strip the source label then. ` +
107
+ `An immediate retry flakes the same way, which is why this action does not attempt one.`
108
+ : '';
109
+ }
110
+ /**
111
+ * Builds the caller-facing outcome, counting ids that were never ATTEMPTED as well as those that
112
+ * failed.
113
+ *
114
+ * This reads only page 1 of the source list, so ids beyond it land in `notOnSourcePage` and are
115
+ * silently skipped. The previous message was `Moved N of ${toMove.length}` where `toMove` counted
116
+ * only what page 1 contained — so passing 300 ids reported `Moved 100 of 100` with `Success: true`
117
+ * while 200 were never touched. `LogStatus` said so; the caller-facing result did not, and a caller
118
+ * acting on `Success` had no way to discover it.
119
+ *
120
+ * Skipped ids are therefore a PARTIAL_FAILURE, not a success: the caller asked for work that did not
121
+ * happen. `NotOnSourcePage` carries exactly which ones, so a retry is mechanical.
122
+ */
123
+ function moveOutcome(result, attempted, requested, notOnSourcePage, from, to, kind) {
124
+ const skipped = notOnSourcePage.length;
125
+ const incomplete = result.failedCount > 0 || skipped > 0;
126
+ return {
127
+ // Reported against what the caller ASKED for, not against what page 1 happened to contain.
128
+ Success: !incomplete,
129
+ Message: `Moved ${result.movedCount} of ${requested} ${kind} from '${from}' to '${to}'` +
130
+ `${result.failedCount > 0 ? `; ${result.failedCount} failed` : ''}` +
131
+ `${skipped > 0
132
+ ? `; ${skipped} not on page 1 of '${from}' and NOT attempted — see NotOnSourcePage` +
133
+ `${attempted !== requested ? ` (${attempted} attempted)` : ''}`
134
+ : ''}` +
135
+ `.${stuckNote(result.possiblyStuckCount, kind)}`,
136
+ ResultCode: incomplete ? 'PARTIAL_FAILURE' : 'SUCCESS',
137
+ };
138
+ }
139
+ /**
140
+ * Moves accounts from one Apollo list to another.
141
+ *
142
+ * Inputs:
143
+ * - AccountIDs (required) JSON array or comma-separated Apollo account ids
144
+ * - FromList (required) exact source label name
145
+ * - ToList (required) exact destination label name
146
+ * - CompanyID (optional) per-company credential resolution
147
+ *
148
+ * Outputs:
149
+ * - MovedCount / FailedCount / PossiblyStuckCount
150
+ * - Results per-account { id, added, removed, possiblyStuck, error }
151
+ * - NotOnSourcePage supplied ids that were not on page 1 of the source list
152
+ * - KeySource
153
+ *
154
+ * `PARTIAL_FAILURE` means at least one PATCH failed outright. Possibly-stuck
155
+ * records are NOT failures — the write succeeded and Apollo did not honour it.
156
+ */
157
+ let ApolloMoveListAccountsAction = class ApolloMoveListAccountsAction extends ApolloRESTBaseAction {
158
+ async InternalRunAction(params) {
159
+ const parsed = parseMoveInputs(params, 'AccountIDs');
160
+ if (parsed.error)
161
+ return parsed.error;
162
+ const { ids, fromList, toList } = parsed.inputs;
163
+ const { resolved, error } = await this.ResolveClient(params);
164
+ if (error)
165
+ return error;
166
+ try {
167
+ const labels = await resolveBothLabels(resolved.client, fromList, toList);
168
+ if (labels.error)
169
+ return labels.error;
170
+ // Re-read the source list to capture CURRENT labels — page 1, drain-safe.
171
+ const sourcePage = await resolved.client.searchAccounts({ labelIds: [labels.from.id] }, { page: 1, perPage: MOVE_SOURCE_PER_PAGE });
172
+ const byId = new Map(sourcePage.accounts.map((a) => [a.id, a]));
173
+ const toMove = [];
174
+ const notOnSourcePage = [];
175
+ for (const id of new Set(ids)) {
176
+ const account = byId.get(id);
177
+ if (account)
178
+ toMove.push(account);
179
+ else
180
+ notOnSourcePage.push(id);
181
+ }
182
+ if (toMove.length === 0) {
183
+ return {
184
+ Success: false,
185
+ Message: `None of the ${ids.length} supplied account id(s) were found on page 1 of '${labels.from.name}'. ` +
186
+ `They may already have moved, or sit on a later page — re-read page 1, since removals shift pages.`,
187
+ ResultCode: 'NOT_FOUND',
188
+ };
189
+ }
190
+ const result = await resolved.client.moveAccounts(toMove, labels.from.name, labels.to.name, { verify: true });
191
+ LogStatus(`ApolloMoveListAccounts: '${labels.from.name}' → '${labels.to.name}' — ${result.movedCount} moved, ` +
192
+ `${result.possiblyStuckCount} possibly stuck, ${result.failedCount} failed of ${toMove.length} ` +
193
+ `(${notOnSourcePage.length} supplied id(s) not on source page 1).`);
194
+ params.Params.push({ Name: 'MovedCount', Type: 'Output', Value: result.movedCount }, { Name: 'FailedCount', Type: 'Output', Value: result.failedCount }, { Name: 'PossiblyStuckCount', Type: 'Output', Value: result.possiblyStuckCount }, { Name: 'Results', Type: 'Output', Value: result.items }, { Name: 'NotOnSourcePage', Type: 'Output', Value: notOnSourcePage }, { Name: 'KeySource', Type: 'Output', Value: resolved.key.source });
195
+ return {
196
+ ...moveOutcome(result, toMove.length, new Set(ids).size, notOnSourcePage, labels.from.name, labels.to.name, 'account(s)'),
197
+ Params: params.Params,
198
+ };
199
+ }
200
+ catch (err) {
201
+ const msg = err instanceof Error ? err.message : String(err);
202
+ LogError(`ApolloMoveListAccounts: ${msg}`);
203
+ return { Success: false, Message: `Error moving Apollo accounts: ${msg}`, ResultCode: 'ERROR' };
204
+ }
205
+ }
206
+ };
207
+ ApolloMoveListAccountsAction = __decorate([
208
+ RegisterClass(BaseAction, 'ApolloMoveListAccountsAction')
209
+ ], ApolloMoveListAccountsAction);
210
+ export { ApolloMoveListAccountsAction };
211
+ /**
212
+ * Moves contacts from one Apollo list to another. Identical semantics to
213
+ * {@link ApolloMoveListAccountsAction}; the id param is `ContactIDs` and the
214
+ * outputs carry contact results.
215
+ */
216
+ let ApolloMoveListContactsAction = class ApolloMoveListContactsAction extends ApolloRESTBaseAction {
217
+ async InternalRunAction(params) {
218
+ const parsed = parseMoveInputs(params, 'ContactIDs');
219
+ if (parsed.error)
220
+ return parsed.error;
221
+ const { ids, fromList, toList } = parsed.inputs;
222
+ const { resolved, error } = await this.ResolveClient(params);
223
+ if (error)
224
+ return error;
225
+ try {
226
+ const labels = await resolveBothLabels(resolved.client, fromList, toList);
227
+ if (labels.error)
228
+ return labels.error;
229
+ const sourcePage = await resolved.client.searchContacts({ labelIds: [labels.from.id] }, { page: 1, perPage: MOVE_SOURCE_PER_PAGE });
230
+ const byId = new Map(sourcePage.contacts.map((c) => [c.id, c]));
231
+ const toMove = [];
232
+ const notOnSourcePage = [];
233
+ for (const id of new Set(ids)) {
234
+ const contact = byId.get(id);
235
+ if (contact)
236
+ toMove.push(contact);
237
+ else
238
+ notOnSourcePage.push(id);
239
+ }
240
+ if (toMove.length === 0) {
241
+ return {
242
+ Success: false,
243
+ Message: `None of the ${ids.length} supplied contact id(s) were found on page 1 of '${labels.from.name}'. ` +
244
+ `They may already have moved, or sit on a later page — re-read page 1, since removals shift pages.`,
245
+ ResultCode: 'NOT_FOUND',
246
+ };
247
+ }
248
+ const result = await resolved.client.moveContacts(toMove, labels.from.name, labels.to.name, { verify: true });
249
+ LogStatus(`ApolloMoveListContacts: '${labels.from.name}' → '${labels.to.name}' — ${result.movedCount} moved, ` +
250
+ `${result.possiblyStuckCount} possibly stuck, ${result.failedCount} failed of ${toMove.length} ` +
251
+ `(${notOnSourcePage.length} supplied id(s) not on source page 1).`);
252
+ params.Params.push({ Name: 'MovedCount', Type: 'Output', Value: result.movedCount }, { Name: 'FailedCount', Type: 'Output', Value: result.failedCount }, { Name: 'PossiblyStuckCount', Type: 'Output', Value: result.possiblyStuckCount }, { Name: 'Results', Type: 'Output', Value: result.items }, { Name: 'NotOnSourcePage', Type: 'Output', Value: notOnSourcePage }, { Name: 'KeySource', Type: 'Output', Value: resolved.key.source });
253
+ return {
254
+ ...moveOutcome(result, toMove.length, new Set(ids).size, notOnSourcePage, labels.from.name, labels.to.name, 'contact(s)'),
255
+ Params: params.Params,
256
+ };
257
+ }
258
+ catch (err) {
259
+ const msg = err instanceof Error ? err.message : String(err);
260
+ LogError(`ApolloMoveListContacts: ${msg}`);
261
+ return { Success: false, Message: `Error moving Apollo contacts: ${msg}`, ResultCode: 'ERROR' };
262
+ }
263
+ }
264
+ };
265
+ ApolloMoveListContactsAction = __decorate([
266
+ RegisterClass(BaseAction, 'ApolloMoveListContactsAction')
267
+ ], ApolloMoveListContactsAction);
268
+ export { ApolloMoveListContactsAction };
269
+ export function LoadApolloMoveActions() {
270
+ // Referenced by consumers to keep these registrations from being tree-shaken.
271
+ }
272
+ //# s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KAAK,EAAE,MAAM,CAAC,kBAAkB,EAAE,EAChF,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EACxD,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,EACnE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CACpE,CAAC;YAEF,OAAO;gBACH,GAAG,WAAW,CACV,MAAM,EACN,MAAM,CAAC,MAAM,EACb,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EACjB,eAAe,EACf,MAAM,CAAC,IAAI,CAAC,IAAI,EAChB,MAAM,CAAC,EAAE,CAAC,IAAI,EACd,YAAY,CACf;gBACD,MAAM,EAAE,MAAM,CAAC,MAAM;aACxB,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,QAAQ,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YAC3C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iCAAiC,GAAG,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;QACpG,CAAC;IACL,CAAC;CACJ,CAAA;AAxEY,4BAA4B;IADxC,aAAa,CAAC,UAAU,EAAE,8BAA8B,CAAC;GAC7C,4BAA4B,CAwExC;;AAED,MAAM,UAAU,qBAAqB;IACjC,8EAA8E;AAClF,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Shared plumbing for the Apollo list and search actions.
3
+ *
4
+ * Each of these actions does the same three things before it does anything
5
+ * interesting: resolve a key, build a client, and turn whatever went wrong into a
6
+ * result object rather than an exception. That lives here so seven actions cannot
7
+ * drift into seven different answers for "no credential configured".
8
+ *
9
+ * {@link CreateClient} is a protected seam purely so tests can substitute a fake
10
+ * client. Nothing in this package may reach api.apollo.io from a test: a live call
11
+ * would spend real credits, and the move surface would mutate a real Apollo
12
+ * account's list membership with no undo.
13
+ */
14
+ import { BaseAction } from '@memberjunction/actions';
15
+ import type { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
16
+ import type { IApolloRESTClient } from '../generic/apollo-lists.types.js';
17
+ import { type ResolvedApolloKey } from './credentials.js';
18
+ /** A resolved client plus how its key was found. */
19
+ export interface ResolvedApolloClient {
20
+ client: IApolloRESTClient;
21
+ key: ResolvedApolloKey;
22
+ }
23
+ export declare abstract class ApolloRESTBaseAction extends BaseAction {
24
+ /**
25
+ * Build the client. Overridden in tests; the only place `ApolloRESTClient` is
26
+ * constructed in this surface.
27
+ */
28
+ protected CreateClient(apiKey: string): IApolloRESTClient;
29
+ /**
30
+ * Resolve the key and construct the client, or return the failure result to
31
+ * hand straight back to the caller.
32
+ *
33
+ * `CompanyID` is optional here, unlike in the CDP actions this ports from,
34
+ * because a single-tenant instance with `APOLLO_API_KEY` set has no company
35
+ * to name. Supplying it switches on the per-company credential path.
36
+ */
37
+ protected ResolveClient(params: RunActionParams): Promise<{
38
+ resolved: ResolvedApolloClient;
39
+ error: null;
40
+ } | {
41
+ resolved: null;
42
+ error: ActionResultSimple;
43
+ }>;
44
+ /** A uniform missing-input failure. */
45
+ protected MissingField(name: string, detail?: string): ActionResultSimple;
46
+ /** A uniform validation failure. */
47
+ protected Invalid(message: string): ActionResultSimple;
48
+ }
49
+ //# sourceMappingURL=ApolloRESTBaseAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApolloRESTBaseAction.d.ts","sourceRoot":"","sources":["../../src/lists/ApolloRESTBaseAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGtG,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,iBAAiB,CAAC;CAC1B;AAED,8BAAsB,oBAAqB,SAAQ,UAAU;IACzD;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAIzD;;;;;;;OAOG;cACa,aAAa,CACzB,MAAM,EAAE,eAAe,GACxB,OAAO,CAAC;QAAE,QAAQ,EAAE,oBAAoB,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAuB3G,uCAAuC;IACvC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB;IAQzE,oCAAoC;IACpC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;CAGzD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared plumbing for the Apollo list and search actions.
3
+ *
4
+ * Each of these actions does the same three things before it does anything
5
+ * interesting: resolve a key, build a client, and turn whatever went wrong into a
6
+ * result object rather than an exception. That lives here so seven actions cannot
7
+ * drift into seven different answers for "no credential configured".
8
+ *
9
+ * {@link CreateClient} is a protected seam purely so tests can substitute a fake
10
+ * client. Nothing in this package may reach api.apollo.io from a test: a live call
11
+ * would spend real credits, and the move surface would mutate a real Apollo
12
+ * account's list membership with no undo.
13
+ */
14
+ import { BaseAction } from '@memberjunction/actions';
15
+ import { ApolloRESTClient } from './ApolloRESTClient.js';
16
+ import { NO_APOLLO_KEY_MESSAGE, resolveApolloAPIKey } from './credentials.js';
17
+ import { getParam } from './params.js';
18
+ export class ApolloRESTBaseAction extends BaseAction {
19
+ /**
20
+ * Build the client. Overridden in tests; the only place `ApolloRESTClient` is
21
+ * constructed in this surface.
22
+ */
23
+ CreateClient(apiKey) {
24
+ return new ApolloRESTClient(apiKey);
25
+ }
26
+ /**
27
+ * Resolve the key and construct the client, or return the failure result to
28
+ * hand straight back to the caller.
29
+ *
30
+ * `CompanyID` is optional here, unlike in the CDP actions this ports from,
31
+ * because a single-tenant instance with `APOLLO_API_KEY` set has no company
32
+ * to name. Supplying it switches on the per-company credential path.
33
+ */
34
+ async ResolveClient(params) {
35
+ const companyID = getParam(params, 'CompanyID');
36
+ let key;
37
+ try {
38
+ key = await resolveApolloAPIKey(companyID, params.ContextUser);
39
+ }
40
+ catch (error) {
41
+ // A credential that exists but is malformed — say so, rather than
42
+ // falling back to a different workspace's key from the environment.
43
+ return {
44
+ resolved: null,
45
+ error: {
46
+ Success: false,
47
+ Message: error instanceof Error ? error.message : String(error),
48
+ ResultCode: 'CONFIGURATION_ERROR',
49
+ },
50
+ };
51
+ }
52
+ if (!key) {
53
+ return { resolved: null, error: { Success: false, Message: NO_APOLLO_KEY_MESSAGE, ResultCode: 'CREDENTIALS_NOT_FOUND' } };
54
+ }
55
+ return { resolved: { client: this.CreateClient(key.apiKey), key }, error: null };
56
+ }
57
+ /** A uniform missing-input failure. */
58
+ MissingField(name, detail) {
59
+ return {
60
+ Success: false,
61
+ Message: `Missing required field: ${name}${detail ? ` (${detail})` : ''}`,
62
+ ResultCode: 'MISSING_REQUIRED_FIELDS',
63
+ };
64
+ }
65
+ /** A uniform validation failure. */
66
+ Invalid(message) {
67
+ return { Success: false, Message: message, ResultCode: 'VALIDATION_ERROR' };
68
+ }
69
+ }
70
+ //# sourceMappingURL=ApolloRESTBaseAction.js.map
@@ -0,0 +1 @@
1
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AC9H,CAAC;QACD,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACrF,CAAC;IAED,uCAAuC;IAC7B,YAAY,CAAC,IAAY,EAAE,MAAe;QAChD,OAAO;YACH,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,2BAA2B,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACzE,UAAU,EAAE,yBAAyB;SACxC,CAAC;IACN,CAAC;IAED,oCAAoC;IAC1B,OAAO,CAAC,OAAe;QAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;IAChF,CAAC;CACJ"}
@@ -0,0 +1,136 @@
1
+ import type { ApolloAccount, ApolloAccountSearchFilter, ApolloAccountsPage, ApolloContact, ApolloContactSearchFilter, ApolloContactsPage, ApolloLabel, ApolloMoveResult, ApolloPagingOptions, ApolloPeoplePage, ApolloPeopleSearchFilter, IApolloRESTClient } from '../generic/apollo-lists.types.js';
2
+ /** Options for {@link ApolloRESTClient}. */
3
+ export interface ApolloRESTClientOptions {
4
+ /**
5
+ * Injected fetch, for tests. Tests must never reach api.apollo.io — a live
6
+ * call would consume real credits and mutate a real account's lists.
7
+ */
8
+ fetchImpl?: typeof fetch;
9
+ }
10
+ /**
11
+ * Apollo.io list/search client. See the module doc, and the quirk list on
12
+ * `apollo-lists.types.ts`, for the behaviours it encodes.
13
+ */
14
+ export declare class ApolloRESTClient implements IApolloRESTClient {
15
+ private readonly apiKey;
16
+ private readonly fetchImpl;
17
+ /**
18
+ * The label id↔name maps, built on first use and cached for the instance
19
+ * lifetime (quirk #5). One labels call per client, shared by every search and
20
+ * move. No TTL: a single drain or move operation uses one instance, and
21
+ * labels do not churn mid-operation. Construct a new client to see label
22
+ * changes made since.
23
+ */
24
+ private labelMaps;
25
+ constructor(apiKey: string, options?: ApolloRESTClientOptions);
26
+ /**
27
+ * Issue one request and return the parsed body. A non-2xx throws with the
28
+ * method, path, status and whatever detail Apollo supplied; a 403 on a
29
+ * master-key operation throws the master-key explanation instead (quirk #4).
30
+ * Nothing is swallowed — a body that will not parse still surfaces its text.
31
+ */
32
+ private request;
33
+ /**
34
+ * Every label, account lists and contact lists alike. Master key required.
35
+ * Apollo returns either a bare array or a `{ labels: [...] }` envelope
36
+ * depending on the account; both are accepted.
37
+ */
38
+ listLabels(): Promise<ApolloLabel[]>;
39
+ /**
40
+ * Create a label. Master key required.
41
+ *
42
+ * `modality` is not optional to Apollo despite reading like it should be:
43
+ * posting without it returns HTTP 422 "Please enter a non-empty modality!".
44
+ * It defaults to 'contacts' here because a people list is the common case.
45
+ *
46
+ * The create response shape is not pinned in Apollo's docs, so a bare label
47
+ * object, a `{ label: {...} }` envelope and a `{ labels: [...] }` envelope
48
+ * are all accepted — mirroring how {@link listLabels} tolerates two read
49
+ * shapes. A shape none of those match throws rather than returning a label
50
+ * with an empty id, which would then be written into a membership array.
51
+ */
52
+ createLabel(name: string, modality?: 'contacts' | 'accounts'): Promise<ApolloLabel>;
53
+ /**
54
+ * Resolve a label by exact name, case-insensitive; null when nothing matches.
55
+ * This is how a human-supplied list name becomes the id a search filter needs.
56
+ */
57
+ findLabelByName(name: string): Promise<ApolloLabel | null>;
58
+ /**
59
+ * Build (once per instance) the id↔name maps that resolve search-response
60
+ * `label_ids` into names (quirk #5). When two labels share a name — rare — the
61
+ * last one wins in `nameToId`.
62
+ */
63
+ private getLabelMaps;
64
+ /** One aggregated warning for label ids that did not resolve to a name (quirk #5). */
65
+ private warnUnresolvedLabels;
66
+ /**
67
+ * One page of saved accounts. Paging defaults to page 1 — when draining a
68
+ * list, never advance (quirk #3).
69
+ */
70
+ searchAccounts(filter: ApolloAccountSearchFilter, paging?: ApolloPagingOptions): Promise<ApolloAccountsPage>;
71
+ /** One page of saved contacts. Same drain-page-1 default as {@link searchAccounts}. */
72
+ searchContacts(filter: ApolloContactSearchFilter, paging?: ApolloPagingOptions): Promise<ApolloContactsPage>;
73
+ /**
74
+ * One page of prospecting people — net-new, not your saved contacts. Apollo
75
+ * does not return emails or phones here by design.
76
+ *
77
+ * Unlike the two searches above, this one does not need the label maps: the
78
+ * prospecting response carries no memberships, so fetching them would be a
79
+ * wasted master-key call on a read a scoped key can otherwise serve.
80
+ */
81
+ searchPeople(filter: ApolloPeopleSearchFilter, paging?: ApolloPagingOptions): Promise<ApolloPeoplePage>;
82
+ /**
83
+ * Replace one account's label set with `labelNames` — which must be the
84
+ * COMPLETE intended set, because Apollo overwrites wholesale (quirk #1).
85
+ * Master key required.
86
+ */
87
+ private updateAccountLabels;
88
+ /** The same for one contact. Identical full-replace and master-key semantics. */
89
+ private updateContactLabels;
90
+ /**
91
+ * Re-read one account's current labels for the verify pass (quirk #2), by
92
+ * searching the destination list and matching on id. Null when the record is
93
+ * not on that page, which is not the same as "the remove worked" — hence
94
+ * `possiblyStuck` stays null rather than becoming false.
95
+ */
96
+ private readAccountLabels;
97
+ private readContactLabels;
98
+ /**
99
+ * The ADD phase's label set: current ∪ {toList}. Idempotent — adding a label
100
+ * the record already carries is a set no-op, so re-running a partial move
101
+ * does not duplicate anything.
102
+ */
103
+ private addPhaseLabels;
104
+ /**
105
+ * The REMOVE phase's label set: (current ∪ {toList}) \ {fromList}.
106
+ *
107
+ * It is computed from the post-add state rather than from `current` so that
108
+ * the destination label survives the second write. Deriving it from `current`
109
+ * alone would add the record to the destination and then immediately take it
110
+ * back out.
111
+ */
112
+ private removePhaseLabels;
113
+ /**
114
+ * The move engine, shared by accounts and contacts through the injected
115
+ * update/read closures so the label-preservation math and the stuck detection
116
+ * exist in exactly one place.
117
+ */
118
+ private moveRecords;
119
+ /**
120
+ * Move accounts between lists. The supplied accounts must carry current
121
+ * `labelNames` from a fresh {@link searchAccounts} read — this method writes
122
+ * whatever it is given as the intended set, so stale labels here mean real
123
+ * memberships silently disappear.
124
+ *
125
+ * With `verify`, the destination list is re-read after each remove to flag
126
+ * silent-fail records. Never deletes, never auto-retries.
127
+ */
128
+ moveAccounts(accounts: ApolloAccount[], fromList: string, toList: string, options?: {
129
+ verify?: boolean;
130
+ }): Promise<ApolloMoveResult>;
131
+ /** Move contacts between lists. Same two-step and verify semantics as accounts. */
132
+ moveContacts(contacts: ApolloContact[], fromList: string, toList: string, options?: {
133
+ verify?: boolean;
134
+ }): Promise<ApolloMoveResult>;
135
+ }
136
+ //# sourceMappingURL=ApolloRESTClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApolloRESTClient.d.ts","sourceRoot":"","sources":["../../src/lists/ApolloRESTClient.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EACR,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,WAAW,EAEX,gBAAgB,EAEhB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EAExB,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAO1C,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC5B;AA+GD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC;;;;;;OAMG;IACH,OAAO,CAAC,SAAS,CAA0B;gBAE/B,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB;IAW7D;;;;;OAKG;YACW,OAAO;IAgErB;;;;OAIG;IACU,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAiBjD;;;;;;;;;;;;OAYG;IACU,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,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