@memberjunction/core-actions 6.2.0-edge.1 → 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 (86) hide show
  1. package/dist/custom/ai/base-find-agents.action.d.ts.map +1 -1
  2. package/dist/custom/ai/base-find-agents.action.js +2 -7
  3. package/dist/custom/ai/base-find-agents.action.js.map +1 -1
  4. package/dist/custom/ai/execute-agent.action.d.ts +10 -0
  5. package/dist/custom/ai/execute-agent.action.d.ts.map +1 -1
  6. package/dist/custom/ai/execute-agent.action.js +24 -1
  7. package/dist/custom/ai/execute-agent.action.js.map +1 -1
  8. package/dist/custom/ai/execute-ai-prompt.action.d.ts.map +1 -1
  9. package/dist/custom/ai/execute-ai-prompt.action.js +3 -0
  10. package/dist/custom/ai/execute-ai-prompt.action.js.map +1 -1
  11. package/dist/custom/ai/find-candidate-agents.action.d.ts.map +1 -1
  12. package/dist/custom/ai/find-candidate-agents.action.js +2 -1
  13. package/dist/custom/ai/find-candidate-agents.action.js.map +1 -1
  14. package/dist/custom/ai/generate-image.action.d.ts +67 -6
  15. package/dist/custom/ai/generate-image.action.d.ts.map +1 -1
  16. package/dist/custom/ai/generate-image.action.js +208 -141
  17. package/dist/custom/ai/generate-image.action.js.map +1 -1
  18. package/dist/custom/ai/run-decision.action.d.ts +45 -0
  19. package/dist/custom/ai/run-decision.action.d.ts.map +1 -0
  20. package/dist/custom/ai/run-decision.action.js +169 -0
  21. package/dist/custom/ai/run-decision.action.js.map +1 -0
  22. package/dist/custom/ai/summarize-content.action.d.ts.map +1 -1
  23. package/dist/custom/ai/summarize-content.action.js +3 -0
  24. package/dist/custom/ai/summarize-content.action.js.map +1 -1
  25. package/dist/custom/data/run-adhoc-query.action.d.ts.map +1 -1
  26. package/dist/custom/data/run-adhoc-query.action.js +3 -0
  27. package/dist/custom/data/run-adhoc-query.action.js.map +1 -1
  28. package/dist/custom/interactive-forms/_shared.d.ts +113 -31
  29. package/dist/custom/interactive-forms/_shared.d.ts.map +1 -1
  30. package/dist/custom/interactive-forms/_shared.js +198 -74
  31. package/dist/custom/interactive-forms/_shared.js.map +1 -1
  32. package/dist/custom/interactive-forms/activate-form-contribution-version.action.d.ts +23 -0
  33. package/dist/custom/interactive-forms/activate-form-contribution-version.action.d.ts.map +1 -0
  34. package/dist/custom/interactive-forms/activate-form-contribution-version.action.js +151 -0
  35. package/dist/custom/interactive-forms/activate-form-contribution-version.action.js.map +1 -0
  36. package/dist/custom/interactive-forms/activate-interactive-form-version.action.d.ts +23 -7
  37. package/dist/custom/interactive-forms/activate-interactive-form-version.action.d.ts.map +1 -1
  38. package/dist/custom/interactive-forms/activate-interactive-form-version.action.js +114 -58
  39. package/dist/custom/interactive-forms/activate-interactive-form-version.action.js.map +1 -1
  40. package/dist/custom/interactive-forms/create-form-contribution.action.d.ts +35 -0
  41. package/dist/custom/interactive-forms/create-form-contribution.action.d.ts.map +1 -0
  42. package/dist/custom/interactive-forms/create-form-contribution.action.js +149 -0
  43. package/dist/custom/interactive-forms/create-form-contribution.action.js.map +1 -0
  44. package/dist/custom/interactive-forms/get-active-form-for-entity.action.d.ts +3 -0
  45. package/dist/custom/interactive-forms/get-active-form-for-entity.action.d.ts.map +1 -1
  46. package/dist/custom/interactive-forms/get-active-form-for-entity.action.js +5 -1
  47. package/dist/custom/interactive-forms/get-active-form-for-entity.action.js.map +1 -1
  48. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.d.ts +59 -0
  49. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.d.ts.map +1 -0
  50. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.js +313 -0
  51. package/dist/custom/interactive-forms/get-form-composition-for-entity.action.js.map +1 -0
  52. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.d.ts +47 -0
  53. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.d.ts.map +1 -0
  54. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.js +115 -0
  55. package/dist/custom/interactive-forms/get-form-contributions-for-entity.action.js.map +1 -0
  56. package/dist/custom/interactive-forms/index.d.ts +5 -0
  57. package/dist/custom/interactive-forms/index.d.ts.map +1 -1
  58. package/dist/custom/interactive-forms/index.js +5 -0
  59. package/dist/custom/interactive-forms/index.js.map +1 -1
  60. package/dist/custom/interactive-forms/modify-form-contribution.action.d.ts +36 -0
  61. package/dist/custom/interactive-forms/modify-form-contribution.action.d.ts.map +1 -0
  62. package/dist/custom/interactive-forms/modify-form-contribution.action.js +181 -0
  63. package/dist/custom/interactive-forms/modify-form-contribution.action.js.map +1 -0
  64. package/dist/custom/interactive-forms/modify-interactive-form.action.d.ts +13 -11
  65. package/dist/custom/interactive-forms/modify-interactive-form.action.d.ts.map +1 -1
  66. package/dist/custom/interactive-forms/modify-interactive-form.action.js +65 -64
  67. package/dist/custom/interactive-forms/modify-interactive-form.action.js.map +1 -1
  68. package/dist/custom/interactive-forms/revert-interactive-form.action.d.ts +12 -0
  69. package/dist/custom/interactive-forms/revert-interactive-form.action.d.ts.map +1 -1
  70. package/dist/custom/interactive-forms/revert-interactive-form.action.js +29 -4
  71. package/dist/custom/interactive-forms/revert-interactive-form.action.js.map +1 -1
  72. package/dist/custom/record-cloning/clone-record.action.d.ts +15 -0
  73. package/dist/custom/record-cloning/clone-record.action.d.ts.map +1 -0
  74. package/dist/custom/record-cloning/clone-record.action.js +125 -0
  75. package/dist/custom/record-cloning/clone-record.action.js.map +1 -0
  76. package/dist/custom/record-cloning/clone-records.action.d.ts +15 -0
  77. package/dist/custom/record-cloning/clone-records.action.d.ts.map +1 -0
  78. package/dist/custom/record-cloning/clone-records.action.js +175 -0
  79. package/dist/custom/record-cloning/clone-records.action.js.map +1 -0
  80. package/dist/custom/utilities/vectorize-entity.action.js +1 -1
  81. package/dist/custom/utilities/vectorize-entity.action.js.map +1 -1
  82. package/dist/index.d.ts +3 -0
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +3 -0
  85. package/dist/index.js.map +1 -1
  86. package/package.json +42 -40
@@ -7,13 +7,29 @@ import { BaseAction } from "@memberjunction/actions";
7
7
  * - prior Active sibling Override: Status='Inactive'
8
8
  * - prior Active sibling Component: Status='Inactive'
9
9
  *
10
- * "Sibling" = same EntityID + (Scope, UserID, RoleID) tuple as the target
11
- * Override. The target is the row identified by the input `OverrideID`; the
12
- * priors are any rows currently Status='Active' at the same scope target.
10
+ * "Sibling" = another of the caller's User-scope overrides on the same
11
+ * EntityID that is currently Status='Active'. The target is the row identified
12
+ * by the input `OverrideID`.
13
13
  *
14
- * Idempotency. If the target Override is already Active, returns SUCCESS
15
- * with a no-op message. If it's Inactive, that's a misuse — we surface
16
- * NOT_PENDING so the agent / UI can ask the user what they really want.
14
+ * Only the caller's own User-scope overrides can be activated. A Role or Global
15
+ * override, or another user's, returns FORBIDDEN for every caller (see
16
+ * `CheckPersonalWrite` in `_shared.ts`): shared forms are managed from Form
17
+ * Builder or the form's Manage drawer. The target's Component and Override flip
18
+ * to Active in one entity transaction. Each prior Active sibling is set aside after
19
+ * that transaction: its Override first, then its Component. Every prior is tried.
20
+ * If a save fails, the action returns `PERSIST_FAILED` that names each prior row
21
+ * not updated, and the target stays Active. A prior whose Override could not be
22
+ * set aside is still Active, so a retry sets it aside. A prior whose Override is
23
+ * set aside but whose Component status could not be updated is not found by a
24
+ * retry, and its Component keeps its old status.
25
+ *
26
+ * Idempotency. If the target Override is already Active, the caller's other
27
+ * Active overrides on the entity are set aside and the action returns SUCCESS
28
+ * with a no-op message that carries `DemotedCount`. So a retry after
29
+ * `PERSIST_FAILED` sets aside a prior whose Override could not be set aside; a
30
+ * prior whose Component status could not be updated is not found again. If the
31
+ * target is Inactive, that's a misuse — we surface NOT_PENDING so the agent / UI
32
+ * can ask the user what they really want.
17
33
  *
18
34
  * Inputs:
19
35
  * - `OverrideID` (required, string) — the Pending override to activate
@@ -21,7 +37,7 @@ import { BaseAction } from "@memberjunction/actions";
21
37
  * Outputs:
22
38
  * - `ComponentID` — the Component now Active
23
39
  * - `OverrideID` — echoed for convenience
24
- * - `PreviousActiveOverrideID` — the override that was demoted (or null)
40
+ * - `PreviousActiveOverrideID` — the first override that was demoted (or null)
25
41
  */
26
42
  export declare class ActivateInteractiveFormVersionAction extends BaseAction {
27
43
  protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
@@ -1 +1 @@
1
- {"version":3,"file":"activate-interactive-form-version.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/activate-interactive-form-version.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAOrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,oCAAqC,SAAQ,UAAU;cAEhD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAkG1F;AAED,0BAA0B;AAC1B,wBAAgB,wCAAwC,IAAI,IAAI,CAI/D"}
1
+ {"version":3,"file":"activate-interactive-form-version.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/activate-interactive-form-version.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBACa,oCAAqC,SAAQ,UAAU;cAEhD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAmF1F;AAyED,0BAA0B;AAC1B,wBAAgB,wCAAwC,IAAI,IAAI,CAI/D"}
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { BaseAction } from "@memberjunction/actions";
8
8
  import { Metadata, LogError, RunView } from "@memberjunction/core";
9
- import { RegisterClass } from "@memberjunction/global";
10
- import { AddOutput, CheckOverrideOwnership, Failure, GetStringParam, LoadComponent, LoadOverride, MapToComponentStatus, } from "./_shared.js";
9
+ import { EscapeSQLString, RegisterClass } from "@memberjunction/global";
10
+ import { AddOutput, CheckPersonalWrite, Failure, GetStringParam, LoadComponent, LoadOverride, MapToComponentStatus, WriteAtomically, } from "./_shared.js";
11
11
  /**
12
12
  * Promote a Pending override to Active. Flips:
13
13
  * - target Override: Status='Active'
@@ -15,13 +15,29 @@ import { AddOutput, CheckOverrideOwnership, Failure, GetStringParam, LoadCompone
15
15
  * - prior Active sibling Override: Status='Inactive'
16
16
  * - prior Active sibling Component: Status='Inactive'
17
17
  *
18
- * "Sibling" = same EntityID + (Scope, UserID, RoleID) tuple as the target
19
- * Override. The target is the row identified by the input `OverrideID`; the
20
- * priors are any rows currently Status='Active' at the same scope target.
18
+ * "Sibling" = another of the caller's User-scope overrides on the same
19
+ * EntityID that is currently Status='Active'. The target is the row identified
20
+ * by the input `OverrideID`.
21
21
  *
22
- * Idempotency. If the target Override is already Active, returns SUCCESS
23
- * with a no-op message. If it's Inactive, that's a misuse — we surface
24
- * NOT_PENDING so the agent / UI can ask the user what they really want.
22
+ * Only the caller's own User-scope overrides can be activated. A Role or Global
23
+ * override, or another user's, returns FORBIDDEN for every caller (see
24
+ * `CheckPersonalWrite` in `_shared.ts`): shared forms are managed from Form
25
+ * Builder or the form's Manage drawer. The target's Component and Override flip
26
+ * to Active in one entity transaction. Each prior Active sibling is set aside after
27
+ * that transaction: its Override first, then its Component. Every prior is tried.
28
+ * If a save fails, the action returns `PERSIST_FAILED` that names each prior row
29
+ * not updated, and the target stays Active. A prior whose Override could not be
30
+ * set aside is still Active, so a retry sets it aside. A prior whose Override is
31
+ * set aside but whose Component status could not be updated is not found by a
32
+ * retry, and its Component keeps its old status.
33
+ *
34
+ * Idempotency. If the target Override is already Active, the caller's other
35
+ * Active overrides on the entity are set aside and the action returns SUCCESS
36
+ * with a no-op message that carries `DemotedCount`. So a retry after
37
+ * `PERSIST_FAILED` sets aside a prior whose Override could not be set aside; a
38
+ * prior whose Component status could not be updated is not found again. If the
39
+ * target is Inactive, that's a misuse — we surface NOT_PENDING so the agent / UI
40
+ * can ask the user what they really want.
25
41
  *
26
42
  * Inputs:
27
43
  * - `OverrideID` (required, string) — the Pending override to activate
@@ -29,7 +45,7 @@ import { AddOutput, CheckOverrideOwnership, Failure, GetStringParam, LoadCompone
29
45
  * Outputs:
30
46
  * - `ComponentID` — the Component now Active
31
47
  * - `OverrideID` — echoed for convenience
32
- * - `PreviousActiveOverrideID` — the override that was demoted (or null)
48
+ * - `PreviousActiveOverrideID` — the first override that was demoted (or null)
33
49
  */
34
50
  let ActivateInteractiveFormVersionAction = class ActivateInteractiveFormVersionAction extends BaseAction {
35
51
  async InternalRunAction(params) {
@@ -48,75 +64,62 @@ let ActivateInteractiveFormVersionAction = class ActivateInteractiveFormVersionA
48
64
  if (!target) {
49
65
  return Failure("OVERRIDE_NOT_FOUND", `EntityFormOverride '${overrideID}' not found.`);
50
66
  }
51
- const ownershipFail = CheckOverrideOwnership(target, user);
67
+ const ownershipFail = CheckPersonalWrite(target, user);
52
68
  if (ownershipFail)
53
69
  return ownershipFail;
70
+ if (target.Status === 'Inactive') {
71
+ return Failure("NOT_PENDING", `Override ${overrideID} is Inactive. Use 'Revert Interactive Form' to restore an older version, not 'Activate'.`);
72
+ }
73
+ const priors = await findPriorActiveOverrides(provider, user, target);
74
+ if ('error' in priors)
75
+ return priors.error;
76
+ const previousActiveID = priors.rows[0]?.ID ?? null;
54
77
  if (target.Status === 'Active') {
78
+ const notDemoted = await setPriorsAside(provider, user, target.ID, priors.rows);
79
+ if (notDemoted)
80
+ return notDemoted;
55
81
  AddOutput(params, "ComponentID", target.ComponentID);
56
82
  AddOutput(params, "OverrideID", target.ID);
57
- AddOutput(params, "PreviousActiveOverrideID", null);
83
+ AddOutput(params, "PreviousActiveOverrideID", previousActiveID);
58
84
  return { Success: true, ResultCode: "SUCCESS",
59
- Message: JSON.stringify({ noop: true, OverrideID: target.ID, ComponentID: target.ComponentID }) };
60
- }
61
- if (target.Status === 'Inactive') {
62
- return Failure("NOT_PENDING", `Override ${overrideID} is Inactive. Use 'Revert Interactive Form' to restore an older version, not 'Activate'.`);
63
- }
64
- // Find sibling Active overrides at the same (entity, scope target).
65
- const rv = RunView.FromMetadataProvider(provider);
66
- const scopeClause = target.Scope === 'User'
67
- ? `Scope='User' AND UserID='${target.UserID}'`
68
- : target.Scope === 'Role'
69
- ? `Scope='Role' AND RoleID='${target.RoleID}'`
70
- : `Scope='Global' AND UserID IS NULL AND RoleID IS NULL`;
71
- const priorResult = await rv.RunView({
72
- EntityName: "MJ: Entity Form Overrides",
73
- ExtraFilter: `EntityID='${target.EntityID}' AND ${scopeClause} AND Status='Active' AND ID <> '${target.ID}'`,
74
- Fields: ['ID', 'ComponentID'],
75
- ResultType: 'simple',
76
- }, user);
77
- if (!priorResult.Success) {
78
- return Failure("QUERY_FAILED", `Prior-active lookup failed: ${priorResult.ErrorMessage ?? 'unknown error'}`);
85
+ Message: JSON.stringify({
86
+ noop: true,
87
+ OverrideID: target.ID,
88
+ ComponentID: target.ComponentID,
89
+ PreviousActiveOverrideID: previousActiveID,
90
+ DemotedCount: priors.rows.length,
91
+ }) };
79
92
  }
80
93
  // Promote target's component.
81
94
  const newComponent = await LoadComponent(provider, user, target.ComponentID);
82
95
  if (!newComponent) {
83
96
  return Failure("COMPONENT_NOT_FOUND", `Override ${overrideID} points at Component ${target.ComponentID} which no longer exists.`);
84
97
  }
85
- newComponent.Status = MapToComponentStatus('Active');
86
- const ncSaved = await newComponent.Save();
87
- if (!ncSaved) {
88
- return Failure("PERSIST_FAILED", `Could not flip Component to Active: ${newComponent.LatestResult?.CompleteMessage ?? 'unknown error'}`);
89
- }
90
- target.Status = 'Active';
91
- const tSaved = await target.Save();
92
- if (!tSaved) {
93
- return Failure("PERSIST_FAILED", `Could not flip Override to Active: ${target.LatestResult?.CompleteMessage ?? 'unknown error'}`);
94
- }
95
- // Demote priors. Component AND Override flipped in lock-step.
96
- let firstPriorID = null;
97
- for (const prior of priorResult.Results ?? []) {
98
- if (!firstPriorID)
99
- firstPriorID = prior.ID;
100
- const priorO = await LoadOverride(provider, user, prior.ID);
101
- const priorC = await LoadComponent(provider, user, prior.ComponentID);
102
- if (priorO) {
103
- priorO.Status = 'Inactive';
104
- await priorO.Save();
98
+ const promoted = await WriteAtomically(provider, async () => {
99
+ newComponent.Status = MapToComponentStatus('Active');
100
+ if (!(await newComponent.Save())) {
101
+ return { error: Failure("PERSIST_FAILED", `Could not flip Component to Active: ${newComponent.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
105
102
  }
106
- if (priorC) {
107
- priorC.Status = MapToComponentStatus('Inactive');
108
- await priorC.Save();
103
+ target.Status = 'Active';
104
+ if (!(await target.Save())) {
105
+ return { error: Failure("PERSIST_FAILED", `Could not flip Override to Active: ${target.LatestResult?.CompleteMessage ?? 'unknown error'}`) };
109
106
  }
110
- }
107
+ return { ok: true };
108
+ });
109
+ if ('error' in promoted)
110
+ return promoted.error;
111
+ const notDemoted = await setPriorsAside(provider, user, target.ID, priors.rows);
112
+ if (notDemoted)
113
+ return notDemoted;
111
114
  AddOutput(params, "ComponentID", target.ComponentID);
112
115
  AddOutput(params, "OverrideID", target.ID);
113
- AddOutput(params, "PreviousActiveOverrideID", firstPriorID);
116
+ AddOutput(params, "PreviousActiveOverrideID", previousActiveID);
114
117
  return { Success: true, ResultCode: "SUCCESS",
115
118
  Message: JSON.stringify({
116
119
  OverrideID: target.ID,
117
120
  ComponentID: target.ComponentID,
118
- PreviousActiveOverrideID: firstPriorID,
119
- DemotedCount: (priorResult.Results ?? []).length,
121
+ PreviousActiveOverrideID: previousActiveID,
122
+ DemotedCount: priors.rows.length,
120
123
  }) };
121
124
  }
122
125
  catch (err) {
@@ -130,6 +133,59 @@ ActivateInteractiveFormVersionAction = __decorate([
130
133
  RegisterClass(BaseAction, "__ActivateInteractiveFormVersion")
131
134
  ], ActivateInteractiveFormVersionAction);
132
135
  export { ActivateInteractiveFormVersionAction };
136
+ /** The caller's other Active User-scope overrides on the target's entity, or a `QUERY_FAILED` result. */
137
+ async function findPriorActiveOverrides(provider, user, target) {
138
+ const rv = RunView.FromMetadataProvider(provider);
139
+ const result = await rv.RunView({
140
+ EntityName: "MJ: Entity Form Overrides",
141
+ ExtraFilter: `EntityID='${EscapeSQLString(target.EntityID)}' AND Scope='User' AND UserID='${EscapeSQLString(target.UserID ?? '')}' AND Status='Active' AND ID <> '${EscapeSQLString(target.ID)}'`,
142
+ Fields: ['ID', 'ComponentID'],
143
+ ResultType: 'simple',
144
+ }, user);
145
+ if (!result.Success) {
146
+ return { error: Failure("QUERY_FAILED", `Prior-active lookup failed: ${result.ErrorMessage ?? 'unknown error'}`) };
147
+ }
148
+ return { rows: result.Results ?? [] };
149
+ }
150
+ /**
151
+ * Sets each prior version aside: its Override to Inactive, then its Component to Deprecated.
152
+ * Every prior is tried. Returns `PERSIST_FAILED` that names each prior row not updated, or null
153
+ * when every prior is set aside.
154
+ *
155
+ * The Override is saved first, so a Component that cannot be saved never leaves a second Active
156
+ * override. When a prior's Override cannot be loaded or saved, it is reported and its Component
157
+ * is left as it is, so the prior stays fully Active and a later lookup finds it again.
158
+ */
159
+ async function setPriorsAside(provider, user, targetID, priors) {
160
+ const failures = [];
161
+ for (const prior of priors) {
162
+ const priorO = await LoadOverride(provider, user, prior.ID);
163
+ if (!priorO) {
164
+ failures.push(`The prior override ${prior.ID} could not be loaded, so it was not set aside.`);
165
+ continue;
166
+ }
167
+ priorO.Status = 'Inactive';
168
+ if (!(await priorO.Save())) {
169
+ failures.push(`The prior override ${prior.ID} could not be set aside (${reasonOf(priorO)}).`);
170
+ continue;
171
+ }
172
+ const priorC = await LoadComponent(provider, user, prior.ComponentID);
173
+ if (priorC) {
174
+ priorC.Status = MapToComponentStatus('Inactive');
175
+ if (!(await priorC.Save())) {
176
+ failures.push(`The prior override ${prior.ID} is set aside, but the status of its component ` +
177
+ `${prior.ComponentID} could not be updated (${reasonOf(priorC)}).`);
178
+ }
179
+ }
180
+ }
181
+ return failures.length > 0
182
+ ? Failure("PERSIST_FAILED", `Override ${targetID} is now Active. ${failures.join(' ')}`)
183
+ : null;
184
+ }
185
+ /** Why an entity's last save failed, as its latest result reports it. */
186
+ function reasonOf(entity) {
187
+ return entity.LatestResult?.CompleteMessage ?? 'unknown error';
188
+ }
133
189
  /** Tree-shaking guard. */
134
190
  export function LoadActivateInteractiveFormVersionAction() {
135
191
  if (false) {
@@ -1 +1 @@
1
- {"version":3,"file":"activate-interactive-form-version.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/activate-interactive-form-version.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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACH,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB,GAChH,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEI,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,UAAU;IAEtD,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxD,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,OAAO,OAAO,CAAC,mBAAmB,EAAE,qCAAqC,CAAC,CAAC;YAC/E,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;YACtD,IAAI,CAAC,QAAQ;gBAAE,O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;oBACpB,UAAU,EAAE,MAAM,CAAC,EAAE;oBACrB,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,wBAAwB,EAAE,YAAY;oBACtC,YAAY,EAAE,CAAC,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM;iBACnD,CAAC,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,QAAQ,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;YAC7D,OAAO,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC;IACL,CAAC;CACJ,CAAA;AApGY,oCAAoC;IADhD,aAAa,CAAC,UAAU,EAAE,kCAAkC,CAAC;GACjD,oCAAoC,CAoGhD;;AAED,0BAA0B;AAC1B,MAAM,UAAU,wCAAwC;IACpD,IAAI,KAAgB,EAAE,CAAC;QACnB,MAAM,CAAC,GAAY,oCAAoC,CAAC;IAC5D,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"activate-interactive-form-version.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/activate-interactive-form-version.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAyC,MAAM,sBAAsB,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACH,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,oBAAoB,EACzG,eAAe,GAClB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAE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,CAAC,IAAI,CAAC;AACf,CAAC;AAED,yEAAyE;AACzE,SAAS,QAAQ,CAAC,MAA8D;IAC5E,OAAO,MAAM,CAAC,YAAY,EAAE,eAAe,IAAI,eAAe,CAAC;AACnE,CAAC;AAED,0BAA0B;AAC1B,MAAM,UAAU,wCAAwC;IACpD,IAAI,KAAgB,EAAE,CAAC;QACnB,MAAM,CAAC,GAAY,oCAAoC,CAAC;IAC5D,CAAC;AACL,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
2
+ import { BaseAction } from "@memberjunction/actions";
3
+ /**
4
+ * Create a net-new form contribution for the requesting user.
5
+ *
6
+ * Reads the registration intent from `spec.formContribution` (slot, key, claims,
7
+ * presentation, title). Writes a `MJ: Components` row (Type='Widget', v1.0.0, Draft)
8
+ * and a `MJ: Entity Form Contributions` row (Scope='User', Status='Pending').
9
+ * Activation is a separate step (`Activate Form Contribution Version`), which the
10
+ * "Add to my form" apply flow runs immediately after Create.
11
+ *
12
+ * **Security clamp — Scope.** This action *always* writes `Scope='User'`,
13
+ * `UserID=ctx.user.ID`. An agent cannot write Global or Role contributions that would
14
+ * change other users' forms. Promotion is a deliberate human act.
15
+ *
16
+ * `Precedence` is honored when supplied (the apply flow passes `incumbent + 1` after
17
+ * the user confirms replacing an installed contribution). It only ever affects the
18
+ * calling user's own form, so it is not clamped.
19
+ *
20
+ * **Atomicity.** The spec's claim is checked (INVALID_CLAIM) before anything is written, and
21
+ * the Component and row inserts run in one entity transaction, so a refused row leaves no
22
+ * Component behind.
23
+ */
24
+ export declare class CreateFormContributionAction extends BaseAction {
25
+ protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
26
+ /**
27
+ * Rejects a key the caller already holds on this entity, and fails with QUERY_FAILED when
28
+ * that cannot be checked. Covers derived keys too, because the key it tests is the one the
29
+ * row will actually carry.
30
+ */
31
+ private checkKeyAvailable;
32
+ private extractInputs;
33
+ }
34
+ export declare function LoadCreateFormContributionAction(): void;
35
+ //# sourceMappingURL=create-form-contribution.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-form-contribution.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/create-form-contribution.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAiBrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,4BAA6B,SAAQ,UAAU;cAExC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiEvF;;;;OAIG;YACW,iBAAiB;IAwB/B,OAAO,CAAC,aAAa;CAkBxB;AAED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD"}
@@ -0,0 +1,149 @@
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 { AddOutput, Failure, GetPrecedenceParam, GetStringParam, InsertComponent, InsertContribution, LintFormPanelSpec, ParseSpecParam, ResolveContributionRegistration, WriteAtomically, } from "./_shared.js";
11
+ /**
12
+ * Create a net-new form contribution for the requesting user.
13
+ *
14
+ * Reads the registration intent from `spec.formContribution` (slot, key, claims,
15
+ * presentation, title). Writes a `MJ: Components` row (Type='Widget', v1.0.0, Draft)
16
+ * and a `MJ: Entity Form Contributions` row (Scope='User', Status='Pending').
17
+ * Activation is a separate step (`Activate Form Contribution Version`), which the
18
+ * "Add to my form" apply flow runs immediately after Create.
19
+ *
20
+ * **Security clamp — Scope.** This action *always* writes `Scope='User'`,
21
+ * `UserID=ctx.user.ID`. An agent cannot write Global or Role contributions that would
22
+ * change other users' forms. Promotion is a deliberate human act.
23
+ *
24
+ * `Precedence` is honored when supplied (the apply flow passes `incumbent + 1` after
25
+ * the user confirms replacing an installed contribution). It only ever affects the
26
+ * calling user's own form, so it is not clamped.
27
+ *
28
+ * **Atomicity.** The spec's claim is checked (INVALID_CLAIM) before anything is written, and
29
+ * the Component and row inserts run in one entity transaction, so a refused row leaves no
30
+ * Component behind.
31
+ */
32
+ let CreateFormContributionAction = class CreateFormContributionAction extends BaseAction {
33
+ async InternalRunAction(params) {
34
+ try {
35
+ const inputs = this.extractInputs(params);
36
+ if ('error' in inputs)
37
+ return inputs.error;
38
+ const provider = params.Provider ?? Metadata.Provider;
39
+ if (!provider)
40
+ return Failure("NO_PROVIDER", "No metadata provider available.");
41
+ const user = params.ContextUser;
42
+ if (!user)
43
+ return Failure("NO_USER", "Action requires a ContextUser to clamp contribution scope.");
44
+ const entityInfo = provider.EntityByName(inputs.EntityName);
45
+ if (!entityInfo) {
46
+ return Failure("ENTITY_NOT_FOUND", `Entity '${inputs.EntityName}' is not registered with the active metadata provider.`);
47
+ }
48
+ // Lint before any persistence — fail-hard.
49
+ const lintFail = await LintFormPanelSpec(inputs.Spec, user);
50
+ if (lintFail)
51
+ return lintFail;
52
+ const registration = ResolveContributionRegistration(provider, inputs.Spec);
53
+ if ('error' in registration)
54
+ return registration.error;
55
+ // The duplicate check runs before the Component row is written, so a rejected
56
+ // create leaves nothing behind.
57
+ const writeKey = registration.WriteKey;
58
+ const keyCheck = writeKey
59
+ ? await this.checkKeyAvailable(provider, user, entityInfo.ID, inputs.EntityName, writeKey)
60
+ : null;
61
+ if (keyCheck)
62
+ return keyCheck;
63
+ const written = await WriteAtomically(provider, async () => {
64
+ const componentInsert = await InsertComponent({
65
+ provider, user, spec: inputs.Spec, fallbackName: inputs.Name, description: inputs.Description,
66
+ version: "1.0.0", versionSequence: 1, componentStatus: 'Pending', componentType: 'Widget',
67
+ });
68
+ if ('error' in componentInsert)
69
+ return componentInsert;
70
+ const rowInsert = await InsertContribution({
71
+ provider, user, entityID: entityInfo.ID, componentID: componentInsert.id,
72
+ name: inputs.Name, description: inputs.Description, notes: inputs.Notes,
73
+ registration, status: 'Pending', precedence: inputs.Precedence,
74
+ });
75
+ if ('error' in rowInsert)
76
+ return rowInsert;
77
+ return { componentID: componentInsert.id, contributionID: rowInsert.id };
78
+ });
79
+ if ('error' in written)
80
+ return written.error;
81
+ AddOutput(params, "ContributionID", written.contributionID);
82
+ AddOutput(params, "ComponentID", written.componentID);
83
+ AddOutput(params, "Version", "1.0.0");
84
+ return {
85
+ Success: true, ResultCode: "SUCCESS",
86
+ Message: JSON.stringify({
87
+ ContributionID: written.contributionID, ComponentID: written.componentID, EntityName: entityInfo.Name,
88
+ ContributionKey: writeKey, Slot: registration.Contribution.slot,
89
+ Scope: "User", Status: "Pending", Version: "1.0.0",
90
+ }),
91
+ };
92
+ }
93
+ catch (err) {
94
+ const message = err instanceof Error ? err.message : String(err);
95
+ LogError(`CreateFormContributionAction: ${message}`);
96
+ return Failure("UNEXPECTED_ERROR", message);
97
+ }
98
+ }
99
+ /**
100
+ * Rejects a key the caller already holds on this entity, and fails with QUERY_FAILED when
101
+ * that cannot be checked. Covers derived keys too, because the key it tests is the one the
102
+ * row will actually carry.
103
+ */
104
+ async checkKeyAvailable(provider, user, entityID, entityName, writeKey) {
105
+ const rv = RunView.FromMetadataProvider(provider);
106
+ const dup = await rv.RunView({
107
+ EntityName: "MJ: Entity Form Contributions",
108
+ ExtraFilter: `EntityID='${EscapeSQLString(entityID)}' AND Scope='User' AND UserID='${EscapeSQLString(user.ID)}' AND ContributionKey='${EscapeSQLString(writeKey)}' AND Status IN ('Active','Pending')`,
109
+ Fields: ['ID', 'Status'], ResultType: 'simple', MaxRows: 1,
110
+ }, user);
111
+ if (!dup.Success) {
112
+ return Failure("QUERY_FAILED", `Duplicate-key lookup failed: ${dup.ErrorMessage ?? 'unknown error'}`);
113
+ }
114
+ if ((dup.Results ?? []).length > 0) {
115
+ const existing = dup.Results[0];
116
+ return Failure("ALREADY_EXISTS", `A ${existing.Status} User-scope contribution '${writeKey}' already exists on '${entityName}' (ContributionID=${existing.ID}). Use 'Modify Form Contribution' on it.`);
117
+ }
118
+ return null;
119
+ }
120
+ extractInputs(params) {
121
+ const entityName = GetStringParam(params, "EntityName");
122
+ if (!entityName)
123
+ return { error: Failure("MISSING_PARAMETER", "Parameter 'EntityName' is required.") };
124
+ const name = GetStringParam(params, "Name");
125
+ if (!name)
126
+ return { error: Failure("MISSING_PARAMETER", "Parameter 'Name' is required.") };
127
+ const specRaw = params.Params.find(x => x.Name?.trim().toLowerCase() === "spec")?.Value;
128
+ if (specRaw == null)
129
+ return { error: Failure("MISSING_PARAMETER", "Parameter 'Spec' is required.") };
130
+ const parsed = ParseSpecParam(specRaw);
131
+ if ('error' in parsed)
132
+ return { error: Failure("LINT_FAILED", `Spec is not valid JSON: ${parsed.error}`) };
133
+ return {
134
+ EntityName: entityName, Spec: parsed, Name: name,
135
+ Description: GetStringParam(params, "Description"), Notes: GetStringParam(params, "Notes"),
136
+ Precedence: GetPrecedenceParam(params) ?? 0,
137
+ };
138
+ }
139
+ };
140
+ CreateFormContributionAction = __decorate([
141
+ RegisterClass(BaseAction, "__CreateFormContribution")
142
+ ], CreateFormContributionAction);
143
+ export { CreateFormContributionAction };
144
+ export function LoadCreateFormContributionAction() {
145
+ if (false) {
146
+ const _ = CreateFormContributionAction;
147
+ }
148
+ }
149
+ //# sourceMappingURL=create-form-contribution.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-form-contribution.action.js","sourceRoot":"","sources":["../../../src/custom/interact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es 'Pending' rows so the agent can recognize
14
14
  * an in-flight refinement loop and reuse the Pending row instead of
15
15
  * spawning a new one.
16
+ * - On an identity or permission entity only the caller's own `User` rows
17
+ * apply ({@link FormScopeAllowedOnEntity}), so a Role or Global form there
18
+ * is neither active nor listed.
16
19
  *
17
20
  * Output shape (JSON in `Message`, also surfaced as a `Result` output param):
18
21
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"get-active-form-for-entity.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-active-form-for-entity.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBACa,4BAA6B,SAAQ,UAAU;cAExC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkKvF,OAAO,CAAC,cAAc;CAOzB;AAMD,qDAAqD;AACrD,wBAAgB,gCAAgC,IAAI,IAAI,CAIvD"}
1
+ {"version":3,"file":"get-active-form-for-entity.action.d.ts","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-active-form-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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBACa,4BAA6B,SAAQ,UAAU;cAExC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkKvF,OAAO,CAAC,cAAc;CAOzB;AAMD,qDAAqD;AACrD,wBAAgB,gCAAgC,IAAI,IAAI,CAIvD"}
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { BaseAction } from "@memberjunction/actions";
8
8
  import { Metadata, LogError, RunView } from "@memberjunction/core";
9
9
  import { RegisterClass } from "@memberjunction/global";
10
+ import { FormScopeAllowedOnEntity } from "@memberjunction/core-entities";
10
11
  /**
11
12
  * Read-only action that returns the currently-resolved interactive-form
12
13
  * override (if any) for the (entity, user) pair plus the full list of
@@ -20,6 +21,9 @@ import { RegisterClass } from "@memberjunction/global";
20
21
  * full variants list includes 'Pending' rows so the agent can recognize
21
22
  * an in-flight refinement loop and reuse the Pending row instead of
22
23
  * spawning a new one.
24
+ * - On an identity or permission entity only the caller's own `User` rows
25
+ * apply ({@link FormScopeAllowedOnEntity}), so a Role or Global form there
26
+ * is neither active nor listed.
23
27
  *
24
28
  * Output shape (JSON in `Message`, also surfaced as a `Result` output param):
25
29
  * ```
@@ -83,7 +87,7 @@ let GetActiveFormForEntityAction = class GetActiveFormForEntityAction extends Ba
83
87
  if (!overrideResult.Success) {
84
88
  return failure("QUERY_FAILED", `Override lookup failed: ${overrideResult.ErrorMessage ?? 'unknown error'}`);
85
89
  }
86
- const overrides = overrideResult.Results ?? [];
90
+ const overrides = (overrideResult.Results ?? []).filter(o => FormScopeAllowedOnEntity(entity.Name, o.Scope));
87
91
  if (overrides.length === 0) {
88
92
  const payload = { EntityName: entityName, Active: null, Variants: [] };
89
93
  params.Params.push({ Name: "Result", Type: "Output", Value: payload });
@@ -1 +1 @@
1
- {"version":3,"file":"get-active-form-for-entity.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-active-form-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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoC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AG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,CAAC;CACJ,CAAA;AA3KY,4BAA4B;IADxC,aAAa,CAAC,UAAU,EAAE,0BAA0B,CAAC;GACzC,4BAA4B,CA2KxC;;AAED,SAAS,OAAO,CAAC,UAAkB,EAAE,OAAe;IAChD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,gCAAgC;IAC5C,IAAI,KAAgB,EAAE,CAAC;QACnB,MAAM,CAAC,GAAY,4BAA4B,CAAC;IACpD,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"get-active-form-for-entity.action.js","sourceRoot":"","sources":["../../../src/custom/interactive-forms/get-active-form-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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,UAAU;IAE9C,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,OAAO,OAAO,CAAC,mBAAmB,EAAE,qCAAqC,CAAC,CAAC;YAC/E,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC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