@memberjunction/core-actions 6.2.0-edge.2 → 6.2.0-edge.3

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 (62) hide show
  1. package/dist/custom/ai/execute-agent.action.d.ts +10 -0
  2. package/dist/custom/ai/execute-agent.action.d.ts.map +1 -1
  3. package/dist/custom/ai/execute-agent.action.js +24 -1
  4. package/dist/custom/ai/execute-agent.action.js.map +1 -1
  5. package/dist/custom/ai/execute-ai-prompt.action.d.ts.map +1 -1
  6. package/dist/custom/ai/execute-ai-prompt.action.js +3 -0
  7. package/dist/custom/ai/execute-ai-prompt.action.js.map +1 -1
  8. package/dist/custom/ai/generate-image.action.d.ts +5 -2
  9. package/dist/custom/ai/generate-image.action.d.ts.map +1 -1
  10. package/dist/custom/ai/generate-image.action.js +18 -8
  11. package/dist/custom/ai/generate-image.action.js.map +1 -1
  12. package/dist/custom/ai/summarize-content.action.d.ts.map +1 -1
  13. package/dist/custom/ai/summarize-content.action.js +3 -0
  14. package/dist/custom/ai/summarize-content.action.js.map +1 -1
  15. package/dist/custom/data/run-adhoc-query.action.d.ts.map +1 -1
  16. package/dist/custom/data/run-adhoc-query.action.js +3 -0
  17. package/dist/custom/data/run-adhoc-query.action.js.map +1 -1
  18. package/dist/custom/interactive-forms/_shared.d.ts +113 -31
  19. package/dist/custom/interactive-forms/_shared.d.ts.map +1 -1
  20. package/dist/custom/interactive-forms/_shared.js +198 -74
  21. package/dist/custom/interactive-forms/_shared.js.map +1 -1
  22. package/dist/custom/interactive-forms/activate-form-contribution-version.action.d.ts +23 -0
  23. package/dist/custom/interactive-forms/activate-form-contribution-version.action.d.ts.map +1 -0
  24. package/dist/custom/interactive-forms/activate-form-contribution-version.action.js +151 -0
  25. package/dist/custom/interactive-forms/activate-form-contribution-version.action.js.map +1 -0
  26. package/dist/custom/interactive-forms/activate-interactive-form-version.action.d.ts +23 -7
  27. package/dist/custom/interactive-forms/activate-interactive-form-version.action.d.ts.map +1 -1
  28. package/dist/custom/interactive-forms/activate-interactive-form-version.action.js +114 -58
  29. package/dist/custom/interactive-forms/activate-interactive-form-version.action.js.map +1 -1
  30. package/dist/custom/interactive-forms/create-form-contribution.action.d.ts +35 -0
  31. package/dist/custom/interactive-forms/create-form-contribution.action.d.ts.map +1 -0
  32. package/dist/custom/interactive-forms/create-form-contribution.action.js +149 -0
  33. package/dist/custom/interactive-forms/create-form-contribution.action.js.map +1 -0
  34. package/dist/custom/interactive-forms/get-active-form-for-entity.action.d.ts +3 -0
  35. package/dist/custom/interactive-forms/get-active-form-for-entity.action.d.ts.map +1 -1
  36. package/dist/custom/interactive-forms/get-active-form-for-entity.action.js +5 -1
  37. package/dist/custom/interactive-forms/get-active-form-for-entity.action.js.map +1 -1
  38. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.d.ts +59 -0
  39. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.d.ts.map +1 -0
  40. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.js +313 -0
  41. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.js.map +1 -0
  42. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.d.ts +47 -0
  43. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.d.ts.map +1 -0
  44. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.js +115 -0
  45. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.js.map +1 -0
  46. package/dist/custom/interactive-forms/index.d.ts +5 -0
  47. package/dist/custom/interactive-forms/index.d.ts.map +1 -1
  48. package/dist/custom/interactive-forms/index.js +5 -0
  49. package/dist/custom/interactive-forms/index.js.map +1 -1
  50. package/dist/custom/interactive-forms/modify-form-contribution.action.d.ts +36 -0
  51. package/dist/custom/interactive-forms/modify-form-contribution.action.d.ts.map +1 -0
  52. package/dist/custom/interactive-forms/modify-form-contribution.action.js +181 -0
  53. package/dist/custom/interactive-forms/modify-form-contribution.action.js.map +1 -0
  54. package/dist/custom/interactive-forms/modify-interactive-form.action.d.ts +13 -11
  55. package/dist/custom/interactive-forms/modify-interactive-form.action.d.ts.map +1 -1
  56. package/dist/custom/interactive-forms/modify-interactive-form.action.js +65 -64
  57. package/dist/custom/interactive-forms/modify-interactive-form.action.js.map +1 -1
  58. package/dist/custom/interactive-forms/revert-interactive-form.action.d.ts +12 -0
  59. package/dist/custom/interactive-forms/revert-interactive-form.action.d.ts.map +1 -1
  60. package/dist/custom/interactive-forms/revert-interactive-form.action.js +29 -4
  61. package/dist/custom/interactive-forms/revert-interactive-form.action.js.map +1 -1
  62. package/package.json +42 -42
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-form-composition-for-entity.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-form-composition-for-entity.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,yBAAyB,EAAoE,MAAM,sBAAsB,CAAC;AAChK,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EACH,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,GAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACjH,OAAO,EACH,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,iCAAiC,EACjC,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,GACzB,MAAM,mDAAmD,CAAC;AAyB3D,MAAM,sBAAsB,GACxB,8FAA8F;IAC9F,gGAAgG;IAChG,8FAA8F;IAC9F,oBAAoB;IACpB,qGAAqG;IACrG,+FAA+F,CAAC;AAEpG,MAAM,qBAAqB,GACvB,gGAA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GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClC,CAAC;AAwBD,MAAM,UAAU,qCAAqC;IACjD,IAAI,KAAgB,EAAE,CAAC;QAAC,MAAM,CAAC,GAAY,iCAAiC,CAAC;IAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
2
+ import { BaseAction } from "@memberjunction/actions";
3
+ /** One contribution row, flattened for an agent or an apply flow to reason about. */
4
+ export interface FormContributionSummary {
5
+ ContributionID: string;
6
+ ComponentID: string;
7
+ ComponentName: string | null;
8
+ ComponentVersion: string | null;
9
+ Name: string;
10
+ Scope: string;
11
+ Status: string;
12
+ Precedence: number;
13
+ Slot: string;
14
+ ContributionKey: string | null;
15
+ RelatedEntity: string | null;
16
+ RelatedJoinField: string | null;
17
+ ReplacesSectionKey: string | null;
18
+ /** The blocks it stands in for, when it replaces several. */
19
+ ReplacesSectionKeys: string[];
20
+ ReplacesFieldNames: string[];
21
+ /** The section it draws inside, replacing nothing. */
22
+ InSectionKey: string | null;
23
+ /** Where inside its section it draws. */
24
+ SectionPosition: 'start' | 'end' | null;
25
+ Inclusion: string | null;
26
+ Presentation: string;
27
+ Title: string | null;
28
+ }
29
+ /**
30
+ * Read-only: every `MJ: Entity Form Contributions` row that applies to (entity, caller),
31
+ * in every status, so an apply flow or agent can decide Create vs Modify and see what
32
+ * already exists. Companion of `Get Active Form For Entity`. On an identity or permission
33
+ * entity only the caller's own rows apply ({@link FormScopeAllowedOnEntity}), as on the form.
34
+ *
35
+ * Sorted Active first, then Pending, then Inactive; within a status, highest `Precedence`
36
+ * then highest `SortKey` — the order the renderer resolves them in.
37
+ *
38
+ * With metadata contributions switched off ({@link MetadataContributionsOn}) it lists none and
39
+ * reports `MetadataContributionsEnabled: false`.
40
+ */
41
+ export declare class GetFormContributionsForEntityAction extends BaseAction {
42
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
43
+ /** Component name + version for each distinct ComponentID, in one query, or the query's error. */
44
+ private loadComponentLabels;
45
+ }
46
+ export declare function LoadGetFormContributionsForEntityAction(): void;
47
+ //# sourceMappingURL=get-form-contributions-for-entity.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-form-contributions-for-entity.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-form-contributions-for-entity.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMrD,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,6DAA6D;IAC7D,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,sDAAsD;IACtD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yCAAyC;IACzC,eAAe,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,qBACa,mCAAoC,SAAQ,UAAU;cAE/C,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA6DvF,kGAAkG;YACpF,mBAAmB;CAmBpC;AAED,wBAAgB,uCAAuC,IAAI,IAAI,CAE9D"}
@@ -0,0 +1,115 @@
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
+ import { BaseAction } from "@memberjunction/actions";
8
+ import { Metadata, LogError, RunView } from "@memberjunction/core";
9
+ import { EscapeSQLString, RegisterClass } from "@memberjunction/global";
10
+ import { FormScopeAllowedOnEntity, ParseClaimedFieldNames } from "@memberjunction/core-entities";
11
+ import { AddOutput, ContributionScopeFilter, Failure, GetStringParam, MetadataContributionsOn } from "./_shared.js";
12
+ /**
13
+ * Read-only: every `MJ: Entity Form Contributions` row that applies to (entity, caller),
14
+ * in every status, so an apply flow or agent can decide Create vs Modify and see what
15
+ * already exists. Companion of `Get Active Form For Entity`. On an identity or permission
16
+ * entity only the caller's own rows apply ({@link FormScopeAllowedOnEntity}), as on the form.
17
+ *
18
+ * Sorted Active first, then Pending, then Inactive; within a status, highest `Precedence`
19
+ * then highest `SortKey` — the order the renderer resolves them in.
20
+ *
21
+ * With metadata contributions switched off ({@link MetadataContributionsOn}) it lists none and
22
+ * reports `MetadataContributionsEnabled: false`.
23
+ */
24
+ let GetFormContributionsForEntityAction = class GetFormContributionsForEntityAction extends BaseAction {
25
+ async InternalRunAction(params) {
26
+ try {
27
+ const entityName = GetStringParam(params, "EntityName");
28
+ if (!entityName)
29
+ return Failure("MISSING_PARAMETER", "Parameter 'EntityName' is required.");
30
+ const provider = params.Provider ?? Metadata.Provider;
31
+ if (!provider)
32
+ return Failure("NO_PROVIDER", "No metadata provider available.");
33
+ const user = params.ContextUser;
34
+ if (!user)
35
+ return Failure("NO_USER", "Action requires a ContextUser.");
36
+ const entity = provider.EntityByName(entityName);
37
+ if (!entity)
38
+ return Failure("ENTITY_NOT_FOUND", `Entity '${entityName}' is not registered.`);
39
+ if (!(await MetadataContributionsOn(provider, user))) {
40
+ const off = { EntityName: entity.Name, MetadataContributionsEnabled: false, Contributions: [] };
41
+ AddOutput(params, "Result", off);
42
+ return { Success: true, ResultCode: "SUCCESS", Message: JSON.stringify(off) };
43
+ }
44
+ const rv = RunView.FromMetadataProvider(provider);
45
+ const rows = await rv.RunView({
46
+ EntityName: "MJ: Entity Form Contributions",
47
+ ExtraFilter: ContributionScopeFilter(entity.ID, user),
48
+ OrderBy: "Precedence DESC, SortKey DESC",
49
+ ResultType: 'entity_object',
50
+ }, user);
51
+ if (!rows.Success)
52
+ return Failure("QUERY_FAILED", rows.ErrorMessage ?? 'Contribution lookup failed.');
53
+ const applicable = (rows.Results ?? []).filter(r => FormScopeAllowedOnEntity(entity.Name, r.Scope));
54
+ const labels = await this.loadComponentLabels(rv, applicable, user);
55
+ if ('error' in labels)
56
+ return Failure("QUERY_FAILED", `Component lookup failed: ${labels.error}`);
57
+ const components = labels.labels;
58
+ const statusRank = (s) => (s === 'Active' ? 0 : s === 'Pending' ? 1 : 2);
59
+ const summaries = applicable
60
+ .slice()
61
+ .sort((a, b) => statusRank(a.Status) - statusRank(b.Status) || (b.Precedence ?? 0) - (a.Precedence ?? 0))
62
+ .map(r => {
63
+ const component = components.get(r.ComponentID.toLowerCase());
64
+ return {
65
+ ContributionID: r.ID, ComponentID: r.ComponentID,
66
+ ComponentName: component?.Name ?? null,
67
+ ComponentVersion: component?.Version ?? null,
68
+ Name: r.Name, Scope: r.Scope, Status: r.Status, Precedence: r.Precedence ?? 0, Slot: r.Slot,
69
+ ContributionKey: r.ContributionKey, RelatedEntity: r.RelatedEntity,
70
+ RelatedJoinField: r.RelatedJoinField, ReplacesSectionKey: r.ReplacesSectionKey,
71
+ ReplacesSectionKeys: ParseClaimedFieldNames(r.ReplacesSectionKeys),
72
+ ReplacesFieldNames: ParseClaimedFieldNames(r.ReplacesFieldNames),
73
+ InSectionKey: r.InSectionKey ?? null, SectionPosition: r.SectionPosition ?? null,
74
+ Inclusion: r.Inclusion, Presentation: r.Presentation, Title: r.Title,
75
+ };
76
+ });
77
+ const payload = { EntityName: entity.Name, MetadataContributionsEnabled: true, Contributions: summaries };
78
+ AddOutput(params, "Result", payload);
79
+ return { Success: true, ResultCode: "SUCCESS", Message: JSON.stringify(payload) };
80
+ }
81
+ catch (err) {
82
+ const message = err instanceof Error ? err.message : String(err);
83
+ LogError(`GetFormContributionsForEntityAction: ${message}`);
84
+ return Failure("UNEXPECTED_ERROR", message);
85
+ }
86
+ }
87
+ /** Component name + version for each distinct ComponentID, in one query, or the query's error. */
88
+ async loadComponentLabels(rv, rows, user) {
89
+ const components = new Map();
90
+ const componentIDs = [...new Set(rows.map(r => r.ComponentID))];
91
+ if (componentIDs.length === 0)
92
+ return { labels: components };
93
+ const comps = await rv.RunView({
94
+ EntityName: "MJ: Components",
95
+ ExtraFilter: `ID IN (${componentIDs.map(id => `'${EscapeSQLString(id)}'`).join(',')})`,
96
+ Fields: ['ID', 'Name', 'Version'], ResultType: 'simple',
97
+ }, user);
98
+ if (!comps.Success)
99
+ return { error: comps.ErrorMessage || 'unknown error' };
100
+ for (const c of comps.Results ?? []) {
101
+ components.set(c.ID.toLowerCase(), { Name: c.Name, Version: c.Version });
102
+ }
103
+ return { labels: components };
104
+ }
105
+ };
106
+ GetFormContributionsForEntityAction = __decorate([
107
+ RegisterClass(BaseAction, "__GetFormContributionsForEntity")
108
+ ], GetFormContributionsForEntityAction);
109
+ export { GetFormContributionsForEntityAction };
110
+ export function LoadGetFormContributionsForEntityAction() {
111
+ if (false) {
112
+ const _ = GetFormContributionsForEntityAction;
113
+ }
114
+ }
115
+ //# sourceMappingURL=get-form-contributions-for-entity.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-form-contributions-for-entity.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-form-contributions-for-entity.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAuC,MAAM,+BAA+B,CAAC;AACtI,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AA6BjH;;;;;;;;;;;GAWG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,UAAU;IAErD,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxD,IAAI,CAAC,UAAU;gBAAE,OAAO,OAAO,CAAC,mBAAmB,EAAE,qCAAqC,CAAC,CAAC;YAC5F,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;YACtD,IAAI,CAAC,QAAQ;gBAAE,OAAO,OAAO,CAAC,aAAa,EAAE,iCAAiC,CAAC,CAAC;YAChF,MAAM,IAAI,GAAG,MAAM,CAA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M,UAAU,uCAAuC;IACnD,IAAI,KAAgB,EAAE,CAAC;QAAC,MAAM,CAAC,GAAY,mCAAmC,CAAC;IAAC,CAAC;AACrF,CAAC"}
@@ -5,4 +5,9 @@ export * from './create-interactive-form.action.js';
5
5
  export * from './modify-interactive-form.action.js';
6
6
  export * from './activate-interactive-form-version.action.js';
7
7
  export * from './revert-interactive-form.action.js';
8
+ export * from './create-form-contribution.action.js';
9
+ export * from './modify-form-contribution.action.js';
10
+ export * from './activate-form-contribution-version.action.js';
11
+ export * from './get-form-contributions-for-entity.action.js';
12
+ export * from './get-form-composition-for-entity.action.js';
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC"}
@@ -5,4 +5,9 @@ export * from './create-interactive-form.action.js';
5
5
  export * from './modify-interactive-form.action.js';
6
6
  export * from './activate-interactive-form-version.action.js';
7
7
  export * from './revert-interactive-form.action.js';
8
+ export * from './create-form-contribution.action.js';
9
+ export * from './modify-form-contribution.action.js';
10
+ export * from './activate-form-contribution-version.action.js';
11
+ export * from './get-form-contributions-for-entity.action.js';
12
+ export * from './get-form-composition-for-entity.action.js';
8
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
2
+ import { BaseAction } from "@memberjunction/actions";
3
+ /**
4
+ * Modify one of the caller's own form contributions.
5
+ *
6
+ * | Source Status | `VersionBumpKind` | Behavior |
7
+ * |---|---|---|
8
+ * | Pending | `in-place` (default) | Overwrite the source Component's spec; refresh the row's registration fields; append Notes |
9
+ * | Pending | `patch`/`minor`/`major` | Supersede source row + component; insert new Pending component + row |
10
+ * | Active | `in-place` | `INVALID_BUMP_FOR_STATUS` |
11
+ * | Active | bump (default `minor`) | New Pending component + row; the live Active row is untouched |
12
+ * | Inactive | `in-place` | `INVALID_BUMP_FOR_STATUS` |
13
+ * | Inactive | bump (default `patch`) | Branch from the historical version: new Pending component + row |
14
+ *
15
+ * Only the caller's own User-scope rows can be modified; a Role or Global row, or another user's
16
+ * row, returns `FORBIDDEN` (shared panels are managed from the form's Manage drawer or Form
17
+ * Builder). A new row is written User-scope, as `Create` writes it. The row's registration fields
18
+ * are refreshed from the spec's `formContribution` block, so a moved slot or a renamed title lands
19
+ * together with the code that assumes it. An optional `Precedence` replaces the row's precedence.
20
+ *
21
+ * The spec's claim is checked (`INVALID_CLAIM`) before anything is written, and the component and
22
+ * row writes run in one entity transaction, so a refused row save leaves the component unchanged.
23
+ */
24
+ export declare class ModifyFormContributionAction extends BaseAction {
25
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
26
+ private extractInputs;
27
+ /** Overwrite the Pending source's component and refresh its registration fields. */
28
+ private modifyInPlace;
29
+ /** Insert a new Pending component + User-scope row, superseding the source only when it was Pending. */
30
+ private createNextVersion;
31
+ /** Mark the source row and its component Inactive; a refused save fails the whole modification. */
32
+ private supersede;
33
+ private success;
34
+ }
35
+ export declare function LoadModifyFormContributionAction(): void;
36
+ //# sourceMappingURL=modify-form-contribution.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modify-form-contribution.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/modify-form-contribution.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AA0DrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,4BAA6B,SAAQ,UAAU;cAExC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2CvF,OAAO,CAAC,aAAa;IAmBrB,oFAAoF;YACtE,aAAa;IAuB3B,wGAAwG;YAC1F,iBAAiB;IA8B/B,mGAAmG;YACrF,SAAS;IAiBvB,OAAO,CAAC,OAAO;CAOlB;AAED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD"}
@@ -0,0 +1,181 @@
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
+ import { BaseAction } from "@memberjunction/actions";
8
+ import { Metadata, LogError } from "@memberjunction/core";
9
+ import { RegisterClass } from "@memberjunction/global";
10
+ import { ApplyContributionSpecToRow } from "@memberjunction/core-entities";
11
+ import { AddOutput, BumpVersion, CheckPersonalWrite, Failure, GetPrecedenceParam, GetStringParam, InsertComponent, InsertContribution, LintFormPanelSpec, LoadComponent, LoadContribution, MapToComponentStatus, ParseSpecParam, ParseVersionBumpKind, ResolveContributionRegistration, WriteAtomically, } from "./_shared.js";
12
+ /**
13
+ * Modify one of the caller's own form contributions.
14
+ *
15
+ * | Source Status | `VersionBumpKind` | Behavior |
16
+ * |---|---|---|
17
+ * | Pending | `in-place` (default) | Overwrite the source Component's spec; refresh the row's registration fields; append Notes |
18
+ * | Pending | `patch`/`minor`/`major` | Supersede source row + component; insert new Pending component + row |
19
+ * | Active | `in-place` | `INVALID_BUMP_FOR_STATUS` |
20
+ * | Active | bump (default `minor`) | New Pending component + row; the live Active row is untouched |
21
+ * | Inactive | `in-place` | `INVALID_BUMP_FOR_STATUS` |
22
+ * | Inactive | bump (default `patch`) | Branch from the historical version: new Pending component + row |
23
+ *
24
+ * Only the caller's own User-scope rows can be modified; a Role or Global row, or another user's
25
+ * row, returns `FORBIDDEN` (shared panels are managed from the form's Manage drawer or Form
26
+ * Builder). A new row is written User-scope, as `Create` writes it. The row's registration fields
27
+ * are refreshed from the spec's `formContribution` block, so a moved slot or a renamed title lands
28
+ * together with the code that assumes it. An optional `Precedence` replaces the row's precedence.
29
+ *
30
+ * The spec's claim is checked (`INVALID_CLAIM`) before anything is written, and the component and
31
+ * row writes run in one entity transaction, so a refused row save leaves the component unchanged.
32
+ */
33
+ let ModifyFormContributionAction = class ModifyFormContributionAction extends BaseAction {
34
+ async InternalRunAction(params) {
35
+ try {
36
+ const inputs = this.extractInputs(params);
37
+ if ('error' in inputs)
38
+ return inputs.error;
39
+ const provider = params.Provider ?? Metadata.Provider;
40
+ if (!provider)
41
+ return Failure("NO_PROVIDER", "No metadata provider available.");
42
+ const user = params.ContextUser;
43
+ if (!user)
44
+ return Failure("NO_USER", "Action requires a ContextUser.");
45
+ const source = await LoadContribution(provider, user, inputs.ContributionID);
46
+ if (!source)
47
+ return Failure("CONTRIBUTION_NOT_FOUND", `Contribution '${inputs.ContributionID}' not found.`);
48
+ const forbidden = CheckPersonalWrite(source, user);
49
+ if (forbidden)
50
+ return forbidden;
51
+ const lintFail = await LintFormPanelSpec(inputs.Spec, user);
52
+ if (lintFail)
53
+ return lintFail;
54
+ const registration = ResolveContributionRegistration(provider, inputs.Spec, source.ContributionKey);
55
+ if ('error' in registration)
56
+ return registration.error;
57
+ const sourceComponent = await LoadComponent(provider, user, source.ComponentID);
58
+ if (!sourceComponent) {
59
+ return Failure("COMPONENT_NOT_FOUND", `Contribution ${source.ID} points at Component ${source.ComponentID} which no longer exists.`);
60
+ }
61
+ const bump = inputs.Bump
62
+ ?? (source.Status === 'Pending' ? 'in-place' : source.Status === 'Active' ? 'minor' : 'patch');
63
+ if (bump === 'in-place' && source.Status !== 'Pending') {
64
+ return Failure("INVALID_BUMP_FOR_STATUS", `In-place modification is only valid for a Pending contribution; ${source.ID} is ${source.Status}. Supply VersionBumpKind patch | minor | major.`);
65
+ }
66
+ const ctx = { source, sourceComponent, registration, inputs, provider, user };
67
+ const written = await WriteAtomically(provider, () => bump === 'in-place' ? this.modifyInPlace(ctx) : this.createNextVersion(ctx, bump));
68
+ if ('error' in written)
69
+ return written.error;
70
+ return this.success(params, written);
71
+ }
72
+ catch (err) {
73
+ const message = err instanceof Error ? err.message : String(err);
74
+ LogError(`ModifyFormContributionAction: ${message}`);
75
+ return Failure("UNEXPECTED_ERROR", message);
76
+ }
77
+ }
78
+ extractInputs(params) {
79
+ const contributionID = GetStringParam(params, "ContributionID");
80
+ if (!contributionID)
81
+ return { error: Failure("MISSING_PARAMETER", "Parameter 'ContributionID' is required.") };
82
+ const specRaw = params.Params.find(x => x.Name?.trim().toLowerCase() === "spec")?.Value;
83
+ if (specRaw == null)
84
+ return { error: Failure("MISSING_PARAMETER", "Parameter 'Spec' is required.") };
85
+ const parsed = ParseSpecParam(specRaw);
86
+ if ('error' in parsed)
87
+ return { error: Failure("LINT_FAILED", `Spec is not valid JSON: ${parsed.error}`) };
88
+ const bumpRaw = GetStringParam(params, "VersionBumpKind");
89
+ const bump = bumpRaw ? ParseVersionBumpKind(bumpRaw) : null;
90
+ if (bumpRaw && !bump) {
91
+ return { error: Failure("INVALID_PARAMETER", `VersionBumpKind '${bumpRaw}' is not one of in-place | patch | minor | major.`) };
92
+ }
93
+ return {
94
+ ContributionID: contributionID, Spec: parsed, Notes: GetStringParam(params, "Notes"),
95
+ Bump: bump, Precedence: GetPrecedenceParam(params),
96
+ };
97
+ }
98
+ /** Overwrite the Pending source's component and refresh its registration fields. */
99
+ async modifyInPlace(ctx) {
100
+ const { source, sourceComponent, registration, inputs } = ctx;
101
+ const spec = inputs.Spec;
102
+ sourceComponent.Specification = JSON.stringify(spec);
103
+ sourceComponent.Title = spec.title ?? sourceComponent.Title;
104
+ sourceComponent.Description = spec.description ?? sourceComponent.Description;
105
+ if (!(await sourceComponent.Save())) {
106
+ return { error: Failure("PERSIST_FAILED", `Component update failed: ${sourceComponent.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
107
+ }
108
+ ApplyContributionSpecToRow(source, registration.Contribution, registration.RowOptions);
109
+ if (inputs.Precedence != null)
110
+ source.Precedence = inputs.Precedence;
111
+ if (inputs.Notes)
112
+ source.Notes = `${source.Notes ? source.Notes + "\n" : ""}${inputs.Notes}`;
113
+ if (!(await source.Save())) {
114
+ return { error: Failure("PERSIST_FAILED", `Contribution update failed: ${source.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
115
+ }
116
+ return {
117
+ ContributionID: source.ID, ComponentID: source.ComponentID,
118
+ Version: sourceComponent.Version ?? '1.0.0', Mode: 'in-place', BumpKind: 'in-place',
119
+ };
120
+ }
121
+ /** Insert a new Pending component + User-scope row, superseding the source only when it was Pending. */
122
+ async createNextVersion(ctx, bump) {
123
+ const { source, sourceComponent, registration, inputs, provider, user } = ctx;
124
+ const spec = inputs.Spec;
125
+ const nextVersion = BumpVersion(sourceComponent.Version, bump);
126
+ const componentInsert = await InsertComponent({
127
+ provider, user, spec, fallbackName: sourceComponent.Name,
128
+ description: spec.description ?? sourceComponent.Description,
129
+ version: nextVersion, versionSequence: (sourceComponent.VersionSequence ?? 0) + 1,
130
+ componentStatus: 'Pending', componentType: 'Widget',
131
+ });
132
+ if ('error' in componentInsert)
133
+ return componentInsert;
134
+ const rowInsert = await InsertContribution({
135
+ provider, user, entityID: source.EntityID, componentID: componentInsert.id,
136
+ name: source.Name, description: spec.description ?? source.Description, notes: inputs.Notes,
137
+ registration, status: 'Pending', precedence: inputs.Precedence ?? source.Precedence ?? 0,
138
+ });
139
+ if ('error' in rowInsert)
140
+ return rowInsert;
141
+ if (source.Status === 'Pending') {
142
+ // Bumping from a Pending draft supersedes it — there is nothing live to preserve.
143
+ const superseded = await this.supersede(source, sourceComponent);
144
+ if (superseded)
145
+ return superseded;
146
+ }
147
+ return {
148
+ ContributionID: rowInsert.id, ComponentID: componentInsert.id,
149
+ Version: nextVersion, Mode: 'new-version', BumpKind: bump,
150
+ };
151
+ }
152
+ /** Mark the source row and its component Inactive; a refused save fails the whole modification. */
153
+ async supersede(source, sourceComponent) {
154
+ source.Status = 'Inactive';
155
+ if (!(await source.Save())) {
156
+ return { error: Failure("PERSIST_FAILED", `Could not supersede contribution ${source.ID}: ${source.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
157
+ }
158
+ sourceComponent.Status = MapToComponentStatus('Inactive');
159
+ if (!(await sourceComponent.Save())) {
160
+ return { error: Failure("PERSIST_FAILED", `Could not supersede component ${sourceComponent.ID}: ${sourceComponent.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
161
+ }
162
+ return null;
163
+ }
164
+ success(params, payload) {
165
+ AddOutput(params, "ContributionID", payload.ContributionID);
166
+ AddOutput(params, "ComponentID", payload.ComponentID);
167
+ AddOutput(params, "Version", payload.Version);
168
+ AddOutput(params, "Mode", payload.Mode);
169
+ return { Success: true, ResultCode: "SUCCESS", Message: JSON.stringify(payload) };
170
+ }
171
+ };
172
+ ModifyFormContributionAction = __decorate([
173
+ RegisterClass(BaseAction, "__ModifyFormContribution")
174
+ ], ModifyFormContributionAction);
175
+ export { ModifyFormContributionAction };
176
+ export function LoadModifyFormContributionAction() {
177
+ if (false) {
178
+ const _ = ModifyFormContributionAction;
179
+ }
180
+ }
181
+ //# sourceMappingURL=modify-form-contribution.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modify-form-contribution.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/modify-form-contribution.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAA+D,MAAM,+BAA+B,CAAC;AAExI,OAAO,EACH,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,kBAAkB,EAClB,cAAc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,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC1D,IAAI,CAAC,CAAC,MAAM,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAClC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,EACpC,iCAAiC,eAAe,CAAC,EAAE,KAAK,eAAe,CAAC,YAAY,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC,EAAE,CAAC;QACtI,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,OAAO,CAAC,MAAuB,EAAE,OAAsB;QAC3D,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5D,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QACtD,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9C,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IACtF,CAAC;CACJ,CAAA;AAhJY,4BAA4B;IADxC,aAAa,CAAC,UAAU,EAAE,0BAA0B,CAAC;GACzC,4BAA4B,CAgJxC;;AAED,MAAM,UAAU,gCAAgC;IAC5C,IAAI,KAAgB,EAAE,CAAC;QAAC,MAAM,CAAC,GAAY,4BAA4B,CAAC;IAAC,CAAC;AAC9E,CAAC"}
@@ -20,18 +20,15 @@ import { BaseAction } from "@memberjunction/actions";
20
20
  * Pending sources stay in-place, Active sources bump minor, Inactive
21
21
  * sources bump patch (the conservative branch-from-historical case).
22
22
  *
23
- * **Security clamp.** Modify *always* writes a User-scope Pending Override,
24
- * regardless of the original override's scope. Even if the caller is
25
- * modifying a Role-scope or Global override (which they have permission to
26
- * read because they pass the ownership check), the new Pending sibling
27
- * is always User-scoped to the calling user. Scope promotion (User → Role
28
- * → Global) is a separate, deliberate human action with its own permission
29
- * gate in Component Studio / Form Builder. The agent cannot widen scope
30
- * through Modify any more than through Create.
23
+ * **Ownership.** Only the caller's own User-scope overrides can be modified.
24
+ * A Role or Global override, or another user's, returns FORBIDDEN for every
25
+ * caller (see `CheckPersonalWrite` in `_shared.ts`): shared forms are managed
26
+ * from Form Builder or the form's Manage drawer. A new Pending Override is
27
+ * written User-scope, as Create writes it.
31
28
  *
32
- * **Ownership check.** The caller must own (or have role membership for, or
33
- * be admin over) the existing override they're modifying. See
34
- * `checkOverrideOwnership` in `_shared.ts`. Returns FORBIDDEN if rejected.
29
+ * **Atomicity.** The in-place Component and Override writes run in one entity
30
+ * transaction, and so do the new-version Component and Override inserts, so a
31
+ * refused Override save leaves no Component change behind.
35
32
  *
36
33
  * Inputs:
37
34
  * - `OverrideID` (required, string) — the override to modify
@@ -47,6 +44,11 @@ import { BaseAction } from "@memberjunction/actions";
47
44
  */
48
45
  export declare class ModifyInteractiveFormAction extends BaseAction {
49
46
  protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
47
+ /**
48
+ * Overwrite the Pending Component's spec and append any notes to the Override. Returns an
49
+ * `{ error }` result on a refused save, so the caller's transaction rolls both back.
50
+ */
51
+ private modifyInPlace;
50
52
  private findParam;
51
53
  }
52
54
  /** Tree-shaking guard. */
@@ -1 +1 @@
1
- {"version":3,"file":"modify-interactive-form.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/modify-interactive-form.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAWrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBACa,2BAA4B,SAAQ,UAAU;cAEvC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAuOvF,OAAO,CAAC,SAAS;CAKpB;AAED,0BAA0B;AAC1B,wBAAgB,+BAA+B,IAAI,IAAI,CAItD"}
1
+ {"version":3,"file":"modify-interactive-form.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/modify-interactive-form.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAYrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBACa,2BAA4B,SAAQ,UAAU;cAEvC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkNvF;;;OAGG;YACW,aAAa;IAuB3B,OAAO,CAAC,SAAS;CAKpB;AAED,0BAA0B;AAC1B,wBAAgB,+BAA+B,IAAI,IAAI,CAItD"}