@memberjunction/core-actions 6.1.4 → 6.2.0-edge.1
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/dist/config.d.ts +74 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +48 -9
- package/dist/config.js.map +1 -1
- package/dist/custom/ai/base-find-actions.action.js +6 -6
- package/dist/custom/ai/base-find-agents.action.js +6 -6
- package/dist/custom/ai/find-candidate-agents.action.js +2 -2
- package/dist/custom/ai/generate-image.action.d.ts +13 -1
- package/dist/custom/ai/generate-image.action.d.ts.map +1 -1
- package/dist/custom/ai/generate-image.action.js +25 -13
- package/dist/custom/ai/generate-image.action.js.map +1 -1
- package/dist/custom/ai/semantic-entity-search.helper.d.ts +6 -0
- package/dist/custom/ai/semantic-entity-search.helper.d.ts.map +1 -1
- package/dist/custom/ai/semantic-entity-search.helper.js +16 -4
- package/dist/custom/ai/semantic-entity-search.helper.js.map +1 -1
- package/dist/custom/data/search-query-catalog.action.js +2 -2
- package/dist/custom/integration/api-rate-limiter.action.d.ts +4 -0
- package/dist/custom/integration/api-rate-limiter.action.d.ts.map +1 -1
- package/dist/custom/integration/api-rate-limiter.action.js +10 -2
- package/dist/custom/integration/api-rate-limiter.action.js.map +1 -1
- package/dist/custom/integration/gamma-generate-presentation.action.js +2 -2
- package/dist/custom/integration/integration-action-executor.d.ts +22 -22
- package/dist/custom/integration/integration-action-executor.js +83 -83
- package/dist/custom/interactive-forms/_shared.d.ts +69 -0
- package/dist/custom/interactive-forms/_shared.d.ts.map +1 -1
- package/dist/custom/interactive-forms/_shared.js +118 -38
- package/dist/custom/interactive-forms/_shared.js.map +1 -1
- package/dist/custom/interactive-forms/activate-interactive-form-version.action.js +25 -25
- package/dist/custom/interactive-forms/create-interactive-form.action.js +22 -22
- package/dist/custom/interactive-forms/modify-interactive-form.action.js +35 -35
- package/dist/custom/interactive-forms/revert-interactive-form.action.js +32 -32
- package/dist/custom/lists/_action-helpers.d.ts +10 -0
- package/dist/custom/lists/_action-helpers.d.ts.map +1 -1
- package/dist/custom/lists/_action-helpers.js +26 -6
- package/dist/custom/lists/_action-helpers.js.map +1 -1
- package/dist/custom/lists/add-view-results-to-list.action.js +8 -8
- package/dist/custom/lists/bulk-update-list-item-status.action.js +8 -8
- package/dist/custom/lists/compose-lists.action.js +14 -14
- package/dist/custom/lists/invite-to-list.action.js +10 -10
- package/dist/custom/lists/materialize-list-from-view.action.js +13 -13
- package/dist/custom/lists/move-list-members.action.js +12 -12
- package/dist/custom/lists/refresh-list-from-source.action.js +8 -8
- package/dist/custom/lists/resolve-audience.action.js +7 -7
- package/dist/custom/lists/revoke-list-invitation.action.js +3 -3
- package/dist/custom/lists/share-list.action.js +8 -8
- package/dist/custom/lists/unshare-list.action.js +3 -3
- package/dist/custom/utilities/address-services.action.js +2 -2
- package/dist/custom/utilities/artifact-builder-service.d.ts +16 -16
- package/dist/custom/utilities/artifact-builder-service.js +39 -39
- package/dist/custom/utilities/artifact-builder-service.js.map +1 -1
- package/dist/custom/utilities/base-file-handler.d.ts.map +1 -1
- package/dist/custom/utilities/base-file-handler.js +4 -2
- package/dist/custom/utilities/base-file-handler.js.map +1 -1
- package/dist/custom/utilities/docx-renderer.d.ts +17 -11
- package/dist/custom/utilities/docx-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/docx-renderer.js +60 -48
- package/dist/custom/utilities/docx-renderer.js.map +1 -1
- package/dist/custom/utilities/json-param-helper.d.ts +6 -0
- package/dist/custom/utilities/json-param-helper.d.ts.map +1 -1
- package/dist/custom/utilities/json-param-helper.js +16 -4
- package/dist/custom/utilities/json-param-helper.js.map +1 -1
- package/dist/custom/utilities/pdf-renderer.d.ts +13 -7
- package/dist/custom/utilities/pdf-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/pdf-renderer.js +27 -15
- package/dist/custom/utilities/pdf-renderer.js.map +1 -1
- package/dist/custom/utilities/xlsx-renderer.d.ts +19 -11
- package/dist/custom/utilities/xlsx-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/xlsx-renderer.js +55 -39
- package/dist/custom/utilities/xlsx-renderer.js.map +1 -1
- package/dist/custom/visualization/create-svg-chart.action.js +23 -23
- package/dist/custom/visualization/create-svg-diagram.action.js +10 -10
- package/dist/custom/visualization/create-svg-infographic.action.js +4 -4
- package/dist/custom/visualization/create-svg-network.action.js +12 -12
- package/dist/custom/visualization/create-svg-sketch-diagram.action.js +10 -10
- package/dist/custom/visualization/create-svg-word-cloud.action.js +11 -11
- package/dist/custom/visualization/shared/svg-theming.d.ts +17 -0
- package/dist/custom/visualization/shared/svg-theming.d.ts.map +1 -1
- package/dist/custom/visualization/shared/svg-theming.js +34 -10
- package/dist/custom/visualization/shared/svg-theming.js.map +1 -1
- package/dist/custom/visualization/shared/svg-utils.d.ts +39 -0
- package/dist/custom/visualization/shared/svg-utils.d.ts.map +1 -1
- package/dist/custom/visualization/shared/svg-utils.js +81 -17
- package/dist/custom/visualization/shared/svg-utils.js.map +1 -1
- package/dist/custom/web/brave-search.action.d.ts +108 -0
- package/dist/custom/web/brave-search.action.d.ts.map +1 -0
- package/dist/custom/web/brave-search.action.js +285 -0
- package/dist/custom/web/brave-search.action.js.map +1 -0
- package/dist/custom/web/duckduckgo-rate-limiter.d.ts +17 -1
- package/dist/custom/web/duckduckgo-rate-limiter.d.ts.map +1 -1
- package/dist/custom/web/duckduckgo-rate-limiter.js +26 -6
- package/dist/custom/web/duckduckgo-rate-limiter.js.map +1 -1
- package/dist/custom/web/google-custom-search.action.js +2 -2
- package/dist/custom/web/perplexity-search.action.d.ts +76 -44
- package/dist/custom/web/perplexity-search.action.d.ts.map +1 -1
- package/dist/custom/web/perplexity-search.action.js +228 -157
- package/dist/custom/web/perplexity-search.action.js.map +1 -1
- package/dist/custom/web/rss-feed-parsing.d.ts +19 -0
- package/dist/custom/web/rss-feed-parsing.d.ts.map +1 -1
- package/dist/custom/web/rss-feed-parsing.js +45 -13
- package/dist/custom/web/rss-feed-parsing.js.map +1 -1
- package/dist/custom/web/rss-feed-read.action.d.ts.map +1 -1
- package/dist/custom/web/rss-feed-read.action.js +9 -6
- package/dist/custom/web/rss-feed-read.action.js.map +1 -1
- package/dist/custom/web/tavily-search.action.js +2 -2
- package/dist/custom/web/web-search.action.d.ts +56 -40
- package/dist/custom/web/web-search.action.d.ts.map +1 -1
- package/dist/custom/web/web-search.action.js +141 -413
- package/dist/custom/web/web-search.action.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +40 -39
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
* the patterns the older list actions inline individually — extracted here
|
|
4
4
|
* so the new actions stay small.
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function GetStringParam(params, name) {
|
|
7
7
|
const param = params.Params.find((p) => p.Name.toLowerCase() === name.toLowerCase() && p.Type === 'Input');
|
|
8
8
|
return param?.Value != null ? String(param.Value) : undefined;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** @deprecated Use {@link GetStringParam}. */
|
|
11
|
+
export function getStringParam(params, name) {
|
|
12
|
+
return GetStringParam(params, name);
|
|
13
|
+
}
|
|
14
|
+
export function GetBooleanParam(params, name, defaultValue) {
|
|
11
15
|
const param = params.Params.find((p) => p.Name.toLowerCase() === name.toLowerCase() && p.Type === 'Input');
|
|
12
16
|
if (param?.Value == null)
|
|
13
17
|
return defaultValue;
|
|
@@ -18,8 +22,12 @@ export function getBooleanParam(params, name, defaultValue) {
|
|
|
18
22
|
return false;
|
|
19
23
|
return defaultValue;
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
/** @deprecated Use {@link GetBooleanParam}. */
|
|
26
|
+
export function getBooleanParam(params, name, defaultValue) {
|
|
27
|
+
return GetBooleanParam(params, name, defaultValue);
|
|
28
|
+
}
|
|
29
|
+
export function GetJsonParam(params, name) {
|
|
30
|
+
const raw = GetStringParam(params, name);
|
|
23
31
|
if (raw == null || raw.trim().length === 0)
|
|
24
32
|
return undefined;
|
|
25
33
|
try {
|
|
@@ -29,14 +37,26 @@ export function getJsonParam(params, name) {
|
|
|
29
37
|
return undefined;
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
|
-
|
|
40
|
+
/** @deprecated Use {@link GetJsonParam}. */
|
|
41
|
+
export function getJsonParam(params, name) {
|
|
42
|
+
return GetJsonParam(params, name);
|
|
43
|
+
}
|
|
44
|
+
export function AddOutputParam(params, name, value) {
|
|
33
45
|
params.Params.push({ Name: name, Type: 'Output', Value: value });
|
|
34
46
|
}
|
|
35
|
-
|
|
47
|
+
/** @deprecated Use {@link AddOutputParam}. */
|
|
48
|
+
export function addOutputParam(params, name, value) {
|
|
49
|
+
return AddOutputParam(params, name, value);
|
|
50
|
+
}
|
|
51
|
+
export function MissingParam(name) {
|
|
36
52
|
return {
|
|
37
53
|
Success: false,
|
|
38
54
|
ResultCode: 'MISSING_PARAMETER',
|
|
39
55
|
Message: `'${name}' is required`,
|
|
40
56
|
};
|
|
41
57
|
}
|
|
58
|
+
/** @deprecated Use {@link MissingParam}. */
|
|
59
|
+
export function missingParam(name) {
|
|
60
|
+
return MissingParam(name);
|
|
61
|
+
}
|
|
42
62
|
//# sourceMappingURL=_action-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_action-helpers.js","sourceRoot":"","sources":["../../../src/custom/lists/_action-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,UAAU,cAAc,CAAC,MAAuB,EAAE,IAAY;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAC3G,OAAO,KAAK,EAAE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AM,UAAU,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;IAClF,OAAO,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,mBAAmB;QAC/B,OAAO,EAAE,IAAI,IAAI,eAAe;KACjC,CAAC;AACJ,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListOperations } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetStringParam, MissingParam } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Add a User View's current results to an existing List. Always additive;
|
|
13
13
|
* never removes. Cannot trigger the drop-guard.
|
|
@@ -25,17 +25,17 @@ import { addOutputParam, getStringParam, missingParam } from './_action-helpers.
|
|
|
25
25
|
*/
|
|
26
26
|
let AddViewResultsToListAction = class AddViewResultsToListAction extends BaseAction {
|
|
27
27
|
async InternalRunAction(params) {
|
|
28
|
-
const viewId =
|
|
29
|
-
const listId =
|
|
28
|
+
const viewId = GetStringParam(params, 'ViewID');
|
|
29
|
+
const listId = GetStringParam(params, 'ListID');
|
|
30
30
|
if (!viewId)
|
|
31
|
-
return
|
|
31
|
+
return MissingParam('ViewID');
|
|
32
32
|
if (!listId)
|
|
33
|
-
return
|
|
33
|
+
return MissingParam('ListID');
|
|
34
34
|
const ops = new ListOperations(params.ContextUser, params.Provider);
|
|
35
35
|
const result = await ops.AddViewResultsToList(viewId, listId);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
AddOutputParam(params, 'Added', result.Counts?.Added);
|
|
37
|
+
AddOutputParam(params, 'Removed', result.Counts?.Removed);
|
|
38
|
+
AddOutputParam(params, 'Failed', result.Counts?.Failed);
|
|
39
39
|
return {
|
|
40
40
|
Success: result.Success,
|
|
41
41
|
ResultCode: result.ResultCode,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { Metadata, RunView } from '@memberjunction/core';
|
|
9
9
|
import { RegisterClass } from '@memberjunction/global';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetJsonParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Bulk-update the `Status` field on `MJ: List Detail` rows for a given
|
|
13
13
|
* list. Useful for review-style workflows where reviewers triage list
|
|
@@ -22,11 +22,11 @@ import { addOutputParam, getJsonParam, getStringParam, missingParam, } from './_
|
|
|
22
22
|
const ALLOWED_STATUSES = ['Active', 'Complete', 'Disabled', 'Error', 'Other', 'Pending', 'Rejected'];
|
|
23
23
|
let BulkUpdateListItemStatusAction = class BulkUpdateListItemStatusAction extends BaseAction {
|
|
24
24
|
async InternalRunAction(params) {
|
|
25
|
-
const listId =
|
|
26
|
-
const recordIds =
|
|
27
|
-
const newStatus =
|
|
25
|
+
const listId = GetStringParam(params, 'ListID');
|
|
26
|
+
const recordIds = GetJsonParam(params, 'RecordIDs');
|
|
27
|
+
const newStatus = GetStringParam(params, 'NewStatus');
|
|
28
28
|
if (!listId)
|
|
29
|
-
return
|
|
29
|
+
return MissingParam('ListID');
|
|
30
30
|
if (!recordIds || !Array.isArray(recordIds) || recordIds.length === 0) {
|
|
31
31
|
return {
|
|
32
32
|
Success: false,
|
|
@@ -70,9 +70,9 @@ let BulkUpdateListItemStatusAction = class BulkUpdateListItemStatusAction extend
|
|
|
70
70
|
errors.push(`Failed to update '${detail.RecordID}': ${detail.LatestResult?.CompleteMessage ?? 'unknown'}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
AddOutputParam(params, 'Updated', updated);
|
|
74
|
+
AddOutputParam(params, 'Failed', failed);
|
|
75
|
+
AddOutputParam(params, 'Errors', errors);
|
|
76
76
|
return {
|
|
77
77
|
Success: failed === 0,
|
|
78
78
|
ResultCode: failed === 0 ? 'SUCCESS' : 'PARTIAL_SUCCESS',
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListOperations } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetBooleanParam, GetJsonParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Compose multiple List or View sources into a delta via a set-op
|
|
13
13
|
* (union / intersection / difference). Preview-only mode (no Target) is
|
|
@@ -34,9 +34,9 @@ import { addOutputParam, getBooleanParam, getJsonParam, getStringParam, missingP
|
|
|
34
34
|
*/
|
|
35
35
|
let ComposeListsAction = class ComposeListsAction extends BaseAction {
|
|
36
36
|
async InternalRunAction(params) {
|
|
37
|
-
const op =
|
|
37
|
+
const op = GetStringParam(params, 'Op');
|
|
38
38
|
if (!op)
|
|
39
|
-
return
|
|
39
|
+
return MissingParam('Op');
|
|
40
40
|
if (op !== 'union' && op !== 'intersection' && op !== 'difference') {
|
|
41
41
|
return {
|
|
42
42
|
Success: false,
|
|
@@ -44,7 +44,7 @@ let ComposeListsAction = class ComposeListsAction extends BaseAction {
|
|
|
44
44
|
Message: `Op must be one of: union | intersection | difference (got '${op}')`,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const inputs =
|
|
47
|
+
const inputs = GetJsonParam(params, 'Inputs');
|
|
48
48
|
if (!inputs || !Array.isArray(inputs) || inputs.length < 2) {
|
|
49
49
|
return {
|
|
50
50
|
Success: false,
|
|
@@ -52,16 +52,16 @@ let ComposeListsAction = class ComposeListsAction extends BaseAction {
|
|
|
52
52
|
Message: "'Inputs' must be a JSON-stringified array of at least 2 ListSource objects",
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
const target =
|
|
56
|
-
const confirmDrops =
|
|
55
|
+
const target = GetJsonParam(params, 'Target');
|
|
56
|
+
const confirmDrops = GetBooleanParam(params, 'ConfirmDrops', false);
|
|
57
57
|
const ops = new ListOperations(params.ContextUser, params.Provider);
|
|
58
58
|
const delta = await ops.ComputeSetOp(op, inputs, target);
|
|
59
59
|
// Preview-only path: no commit. Surface the delta details as outputs.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
AddOutputParam(params, 'DeltaToken', delta.DeltaToken);
|
|
61
|
+
AddOutputParam(params, 'Add', delta.Counts.Add);
|
|
62
|
+
AddOutputParam(params, 'Remove', delta.Counts.Remove);
|
|
63
|
+
AddOutputParam(params, 'Unchanged', delta.Counts.Unchanged);
|
|
64
|
+
AddOutputParam(params, 'Warnings', delta.Warnings.map((w) => ({ Code: w.Code, Message: w.Message })));
|
|
65
65
|
// If no target, this is a preview-only operation — we don't auto-apply.
|
|
66
66
|
if (!target) {
|
|
67
67
|
return {
|
|
@@ -73,9 +73,9 @@ let ComposeListsAction = class ComposeListsAction extends BaseAction {
|
|
|
73
73
|
// Target provided — commit via ApplyDelta. The drop-guard is enforced
|
|
74
74
|
// server-side: if Remove>0 and ConfirmDrops=false, ApplyDelta rejects.
|
|
75
75
|
const apply = await ops.ApplyDelta(delta, { ConfirmDrops: confirmDrops, DeltaToken: delta.DeltaToken });
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
AddOutputParam(params, 'Added', apply.Counts?.Added);
|
|
77
|
+
AddOutputParam(params, 'Removed', apply.Counts?.Removed);
|
|
78
|
+
AddOutputParam(params, 'Failed', apply.Counts?.Failed);
|
|
79
79
|
return {
|
|
80
80
|
Success: apply.Success,
|
|
81
81
|
ResultCode: apply.ResultCode,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListSharing } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetStringParam, MissingParam } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Issue a pending-email invitation to share a List. Returns the
|
|
13
13
|
* generated token + expiry — the caller (workflow / agent) is expected
|
|
@@ -21,13 +21,13 @@ import { addOutputParam, getStringParam, missingParam } from './_action-helpers.
|
|
|
21
21
|
*/
|
|
22
22
|
let InviteToListAction = class InviteToListAction extends BaseAction {
|
|
23
23
|
async InternalRunAction(params) {
|
|
24
|
-
const listId =
|
|
25
|
-
const email =
|
|
24
|
+
const listId = GetStringParam(params, 'ListID');
|
|
25
|
+
const email = GetStringParam(params, 'Email');
|
|
26
26
|
if (!listId)
|
|
27
|
-
return
|
|
27
|
+
return MissingParam('ListID');
|
|
28
28
|
if (!email)
|
|
29
|
-
return
|
|
30
|
-
const role = (
|
|
29
|
+
return MissingParam('Email');
|
|
30
|
+
const role = (GetStringParam(params, 'Role') ?? 'Viewer');
|
|
31
31
|
if (role !== 'Editor' && role !== 'Viewer') {
|
|
32
32
|
return {
|
|
33
33
|
Success: false,
|
|
@@ -35,13 +35,13 @@ let InviteToListAction = class InviteToListAction extends BaseAction {
|
|
|
35
35
|
Message: `Role must be Editor or Viewer (got '${role}')`,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
const ttlHoursRaw =
|
|
38
|
+
const ttlHoursRaw = GetStringParam(params, 'TtlHours');
|
|
39
39
|
const ttlMs = ttlHoursRaw != null ? Number(ttlHoursRaw) * 60 * 60 * 1000 : undefined;
|
|
40
40
|
const sharing = new ListSharing(params.ContextUser, params.Provider);
|
|
41
41
|
const result = await sharing.Invite({ ListID: listId, Email: email, Role: role, TtlMs: ttlMs });
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
AddOutputParam(params, 'InvitationID', result.InvitationID);
|
|
43
|
+
AddOutputParam(params, 'Token', result.Token);
|
|
44
|
+
AddOutputParam(params, 'ExpiresAt', result.ExpiresAt?.toISOString());
|
|
45
45
|
return { Success: result.Success, ResultCode: result.ResultCode, Message: result.Message };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListOperations } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetBooleanParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Materialize a new MJ List from a User View. Thin wrapper around
|
|
13
13
|
* `ListOperations.MaterializeFromView` — every drop-guard, permission, and
|
|
@@ -30,13 +30,13 @@ import { addOutputParam, getBooleanParam, getStringParam, missingParam, } from '
|
|
|
30
30
|
*/
|
|
31
31
|
let MaterializeListFromViewAction = class MaterializeListFromViewAction extends BaseAction {
|
|
32
32
|
async InternalRunAction(params) {
|
|
33
|
-
const viewId =
|
|
34
|
-
const listName =
|
|
33
|
+
const viewId = GetStringParam(params, 'ViewID');
|
|
34
|
+
const listName = GetStringParam(params, 'ListName');
|
|
35
35
|
if (!viewId)
|
|
36
|
-
return
|
|
36
|
+
return MissingParam('ViewID');
|
|
37
37
|
if (!listName)
|
|
38
|
-
return
|
|
39
|
-
const refreshMode = (
|
|
38
|
+
return MissingParam('ListName');
|
|
39
|
+
const refreshMode = (GetStringParam(params, 'RefreshMode') ?? 'Additive');
|
|
40
40
|
if (refreshMode !== 'Additive' && refreshMode !== 'Sync') {
|
|
41
41
|
return {
|
|
42
42
|
Success: false,
|
|
@@ -46,17 +46,17 @@ let MaterializeListFromViewAction = class MaterializeListFromViewAction extends
|
|
|
46
46
|
}
|
|
47
47
|
const opts = {
|
|
48
48
|
ListName: listName,
|
|
49
|
-
CategoryId:
|
|
50
|
-
Description:
|
|
51
|
-
RememberLineage:
|
|
52
|
-
UseSnapshot:
|
|
49
|
+
CategoryId: GetStringParam(params, 'CategoryID'),
|
|
50
|
+
Description: GetStringParam(params, 'Description'),
|
|
51
|
+
RememberLineage: GetBooleanParam(params, 'RememberLineage', true),
|
|
52
|
+
UseSnapshot: GetBooleanParam(params, 'UseSnapshot', false),
|
|
53
53
|
RefreshMode: refreshMode,
|
|
54
54
|
};
|
|
55
55
|
const ops = new ListOperations(params.ContextUser, params.Provider);
|
|
56
56
|
const result = await ops.MaterializeFromView(viewId, opts);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
AddOutputParam(params, 'CreatedListID', result.CreatedListId);
|
|
58
|
+
AddOutputParam(params, 'Added', result.Counts?.Added);
|
|
59
|
+
AddOutputParam(params, 'Failed', result.Counts?.Failed);
|
|
60
60
|
return {
|
|
61
61
|
Success: result.Success,
|
|
62
62
|
ResultCode: result.ResultCode,
|
|
@@ -8,7 +8,7 @@ import { BaseAction } from '@memberjunction/actions';
|
|
|
8
8
|
import { Metadata, RunView } from '@memberjunction/core';
|
|
9
9
|
import { RegisterClass } from '@memberjunction/global';
|
|
10
10
|
import { ListOperations } from '@memberjunction/lists';
|
|
11
|
-
import {
|
|
11
|
+
import { AddOutputParam, GetBooleanParam, GetJsonParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
12
12
|
/**
|
|
13
13
|
* Move a set of records from one list to another. Implemented as a
|
|
14
14
|
* thin wrapper over `ListOperations` semantics:
|
|
@@ -25,13 +25,13 @@ import { addOutputParam, getBooleanParam, getJsonParam, getStringParam, missingP
|
|
|
25
25
|
*/
|
|
26
26
|
let MoveListMembersAction = class MoveListMembersAction extends BaseAction {
|
|
27
27
|
async InternalRunAction(params) {
|
|
28
|
-
const sourceListId =
|
|
29
|
-
const targetListId =
|
|
30
|
-
const recordIds =
|
|
28
|
+
const sourceListId = GetStringParam(params, 'SourceListID');
|
|
29
|
+
const targetListId = GetStringParam(params, 'TargetListID');
|
|
30
|
+
const recordIds = GetJsonParam(params, 'RecordIDs');
|
|
31
31
|
if (!sourceListId)
|
|
32
|
-
return
|
|
32
|
+
return MissingParam('SourceListID');
|
|
33
33
|
if (!targetListId)
|
|
34
|
-
return
|
|
34
|
+
return MissingParam('TargetListID');
|
|
35
35
|
if (!recordIds || !Array.isArray(recordIds) || recordIds.length === 0) {
|
|
36
36
|
return {
|
|
37
37
|
Success: false,
|
|
@@ -39,7 +39,7 @@ let MoveListMembersAction = class MoveListMembersAction extends BaseAction {
|
|
|
39
39
|
Message: "'RecordIDs' must be a JSON-stringified non-empty string array",
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const mode = (
|
|
42
|
+
const mode = (GetStringParam(params, 'Mode') ?? 'move').toLowerCase();
|
|
43
43
|
if (mode !== 'move' && mode !== 'copy') {
|
|
44
44
|
return {
|
|
45
45
|
Success: false,
|
|
@@ -47,7 +47,7 @@ let MoveListMembersAction = class MoveListMembersAction extends BaseAction {
|
|
|
47
47
|
Message: `Mode must be 'move' or 'copy' (got '${mode}')`,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
const confirmDrops =
|
|
50
|
+
const confirmDrops = GetBooleanParam(params, 'ConfirmDrops', false);
|
|
51
51
|
if (mode === 'move' && !confirmDrops) {
|
|
52
52
|
return {
|
|
53
53
|
Success: false,
|
|
@@ -129,10 +129,10 @@ let MoveListMembersAction = class MoveListMembersAction extends BaseAction {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
AddOutputParam(params, 'Added', added);
|
|
133
|
+
AddOutputParam(params, 'Removed', removed);
|
|
134
|
+
AddOutputParam(params, 'Failed', failedAdds);
|
|
135
|
+
AddOutputParam(params, 'Errors', errors);
|
|
136
136
|
const success = failedAdds === 0 && errors.length === failedAdds;
|
|
137
137
|
return {
|
|
138
138
|
Success: success,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListOperations } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetBooleanParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Refresh an existing List against its captured source view.
|
|
13
13
|
*
|
|
@@ -19,10 +19,10 @@ import { addOutputParam, getBooleanParam, getStringParam, missingParam, } from '
|
|
|
19
19
|
*/
|
|
20
20
|
let RefreshListFromSourceAction = class RefreshListFromSourceAction extends BaseAction {
|
|
21
21
|
async InternalRunAction(params) {
|
|
22
|
-
const listId =
|
|
22
|
+
const listId = GetStringParam(params, 'ListID');
|
|
23
23
|
if (!listId)
|
|
24
|
-
return
|
|
25
|
-
const mode = (
|
|
24
|
+
return MissingParam('ListID');
|
|
25
|
+
const mode = (GetStringParam(params, 'Mode') ?? 'Additive');
|
|
26
26
|
if (mode !== 'Additive' && mode !== 'Sync') {
|
|
27
27
|
return {
|
|
28
28
|
Success: false,
|
|
@@ -30,12 +30,12 @@ let RefreshListFromSourceAction = class RefreshListFromSourceAction extends Base
|
|
|
30
30
|
Message: `Mode must be 'Additive' or 'Sync', got '${mode}'`,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
const confirmDrops =
|
|
33
|
+
const confirmDrops = GetBooleanParam(params, 'ConfirmDrops', false);
|
|
34
34
|
const ops = new ListOperations(params.ContextUser, params.Provider);
|
|
35
35
|
const result = await ops.RefreshFromSource(listId, mode, { ConfirmDrops: confirmDrops });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
AddOutputParam(params, 'Added', result.Counts?.Added);
|
|
37
|
+
AddOutputParam(params, 'Removed', result.Counts?.Removed);
|
|
38
|
+
AddOutputParam(params, 'Failed', result.Counts?.Failed);
|
|
39
39
|
return {
|
|
40
40
|
Success: result.Success,
|
|
41
41
|
ResultCode: result.ResultCode,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { AudienceResolver } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetJsonParam, GetStringParam, MissingParam, } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Resolve an `AudienceSource` to its current record IDs.
|
|
13
13
|
*
|
|
@@ -20,14 +20,14 @@ import { addOutputParam, getJsonParam, getStringParam, missingParam, } from './_
|
|
|
20
20
|
*/
|
|
21
21
|
let ResolveAudienceAction = class ResolveAudienceAction extends BaseAction {
|
|
22
22
|
async InternalRunAction(params) {
|
|
23
|
-
const source =
|
|
23
|
+
const source = GetJsonParam(params, 'Source');
|
|
24
24
|
if (!source) {
|
|
25
25
|
// Surface a clear contract hint — `getJsonParam` swallows parse
|
|
26
26
|
// errors, so the caller might be supplying a non-JSON string by
|
|
27
27
|
// mistake. Distinguish missing vs unparseable for grep-ability.
|
|
28
|
-
const raw =
|
|
28
|
+
const raw = GetStringParam(params, 'Source');
|
|
29
29
|
if (raw == null || raw.length === 0)
|
|
30
|
-
return
|
|
30
|
+
return MissingParam('Source');
|
|
31
31
|
return {
|
|
32
32
|
Success: false,
|
|
33
33
|
ResultCode: 'INVALID_PARAMETER',
|
|
@@ -37,9 +37,9 @@ let ResolveAudienceAction = class ResolveAudienceAction extends BaseAction {
|
|
|
37
37
|
const resolver = new AudienceResolver(params.ContextUser, params.Provider);
|
|
38
38
|
try {
|
|
39
39
|
const resolved = await resolver.Resolve(source);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
AddOutputParam(params, 'EntityName', resolved.EntityName);
|
|
41
|
+
AddOutputParam(params, 'RecordCount', resolved.RecordIds.length);
|
|
42
|
+
AddOutputParam(params, 'RecordIDs', resolved.RecordIds);
|
|
43
43
|
return {
|
|
44
44
|
Success: true,
|
|
45
45
|
ResultCode: 'SUCCESS',
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListSharing } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { GetStringParam, MissingParam } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Revoke a pending List invitation before acceptance. Once an invitation
|
|
13
13
|
* has been accepted, callers should `Unshare List` the resulting
|
|
@@ -16,9 +16,9 @@ import { getStringParam, missingParam } from './_action-helpers.js';
|
|
|
16
16
|
*/
|
|
17
17
|
let RevokeListInvitationAction = class RevokeListInvitationAction extends BaseAction {
|
|
18
18
|
async InternalRunAction(params) {
|
|
19
|
-
const invitationId =
|
|
19
|
+
const invitationId = GetStringParam(params, 'InvitationID');
|
|
20
20
|
if (!invitationId)
|
|
21
|
-
return
|
|
21
|
+
return MissingParam('InvitationID');
|
|
22
22
|
const sharing = new ListSharing(params.ContextUser, params.Provider);
|
|
23
23
|
const result = await sharing.RevokeInvitation(invitationId);
|
|
24
24
|
return { Success: result.Success, ResultCode: result.ResultCode, Message: result.Message };
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListSharing } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { AddOutputParam, GetStringParam, MissingParam } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Grant a direct share on a List to a user or role. Mirrors
|
|
13
13
|
* `ListSharing.Share` — idempotent at the (list, target) pair.
|
|
@@ -20,11 +20,11 @@ import { addOutputParam, getStringParam, missingParam } from './_action-helpers.
|
|
|
20
20
|
*/
|
|
21
21
|
let ShareListAction = class ShareListAction extends BaseAction {
|
|
22
22
|
async InternalRunAction(params) {
|
|
23
|
-
const listId =
|
|
24
|
-
const targetKind =
|
|
25
|
-
const targetId =
|
|
23
|
+
const listId = GetStringParam(params, 'ListID');
|
|
24
|
+
const targetKind = GetStringParam(params, 'TargetKind');
|
|
25
|
+
const targetId = GetStringParam(params, 'TargetID');
|
|
26
26
|
if (!listId)
|
|
27
|
-
return
|
|
27
|
+
return MissingParam('ListID');
|
|
28
28
|
if (targetKind !== 'user' && targetKind !== 'role') {
|
|
29
29
|
return {
|
|
30
30
|
Success: false,
|
|
@@ -33,8 +33,8 @@ let ShareListAction = class ShareListAction extends BaseAction {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
if (!targetId)
|
|
36
|
-
return
|
|
37
|
-
const level = (
|
|
36
|
+
return MissingParam('TargetID');
|
|
37
|
+
const level = (GetStringParam(params, 'PermissionLevel') ?? 'View');
|
|
38
38
|
if (level !== 'View' && level !== 'Edit' && level !== 'Owner') {
|
|
39
39
|
return {
|
|
40
40
|
Success: false,
|
|
@@ -45,7 +45,7 @@ let ShareListAction = class ShareListAction extends BaseAction {
|
|
|
45
45
|
const target = targetKind === 'user' ? { kind: 'user', userId: targetId } : { kind: 'role', roleId: targetId };
|
|
46
46
|
const sharing = new ListSharing(params.ContextUser, params.Provider);
|
|
47
47
|
const result = await sharing.Share({ ListID: listId, Target: target, PermissionLevel: level });
|
|
48
|
-
|
|
48
|
+
AddOutputParam(params, 'PermissionID', result.PermissionID);
|
|
49
49
|
return { Success: result.Success, ResultCode: result.ResultCode, Message: result.Message };
|
|
50
50
|
}
|
|
51
51
|
};
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseAction } from '@memberjunction/actions';
|
|
8
8
|
import { RegisterClass } from '@memberjunction/global';
|
|
9
9
|
import { ListSharing } from '@memberjunction/lists';
|
|
10
|
-
import {
|
|
10
|
+
import { GetStringParam, MissingParam } from './_action-helpers.js';
|
|
11
11
|
/**
|
|
12
12
|
* Revoke a previously-granted permission row. Soft-revokes (sets
|
|
13
13
|
* `Status='Revoked'` on `MJResourcePermission`) so the audit trail
|
|
@@ -15,9 +15,9 @@ import { getStringParam, missingParam } from './_action-helpers.js';
|
|
|
15
15
|
*/
|
|
16
16
|
let UnshareListAction = class UnshareListAction extends BaseAction {
|
|
17
17
|
async InternalRunAction(params) {
|
|
18
|
-
const permissionId =
|
|
18
|
+
const permissionId = GetStringParam(params, 'PermissionID');
|
|
19
19
|
if (!permissionId)
|
|
20
|
-
return
|
|
20
|
+
return MissingParam('PermissionID');
|
|
21
21
|
const sharing = new ListSharing(params.ContextUser, params.Provider);
|
|
22
22
|
const result = await sharing.Unshare(permissionId);
|
|
23
23
|
return { Success: result.Success, ResultCode: result.ResultCode, Message: result.Message };
|
|
@@ -8,13 +8,13 @@ import { BaseAction } from "@memberjunction/actions";
|
|
|
8
8
|
import { RegisterClass } from "@memberjunction/global";
|
|
9
9
|
import { HttpPost, IsHttpError } from "@memberjunction/network-utils";
|
|
10
10
|
import { GeocodingProviderRegistry } from "@memberjunction/geo-core";
|
|
11
|
-
import {
|
|
11
|
+
import { GetApiIntegrationsConfig } from "../../config.js";
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Helper: get Google API key from config (used by ValidateAddressAction only;
|
|
14
14
|
// the geocoding actions below now resolve their provider via the registry)
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
16
|
function getGoogleApiKey() {
|
|
17
|
-
const config =
|
|
17
|
+
const config = GetApiIntegrationsConfig();
|
|
18
18
|
return config.google?.geocoding?.apiKey
|
|
19
19
|
|| process.env.GOOGLE_GEOCODING_API_KEY
|
|
20
20
|
|| process.env.GOOGLE_MAPS_API_KEY;
|