@memberjunction/core-entities-server 6.2.0 → 6.3.0-edge.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/custom/AnchoredConversationReadSecurityHook.d.ts +0 -14
- package/dist/custom/AnchoredConversationReadSecurityHook.d.ts.map +1 -1
- package/dist/custom/AnchoredConversationReadSecurityHook.js +27 -2
- package/dist/custom/AnchoredConversationReadSecurityHook.js.map +1 -1
- package/dist/custom/ConversationAndCommentDrivers.d.ts +82 -0
- package/dist/custom/ConversationAndCommentDrivers.d.ts.map +1 -0
- package/dist/custom/ConversationAndCommentDrivers.js +543 -0
- package/dist/custom/ConversationAndCommentDrivers.js.map +1 -0
- package/dist/custom/FieldSuggestionRecordChangeHook.d.ts +17 -0
- package/dist/custom/FieldSuggestionRecordChangeHook.d.ts.map +1 -0
- package/dist/custom/FieldSuggestionRecordChangeHook.js +142 -0
- package/dist/custom/FieldSuggestionRecordChangeHook.js.map +1 -0
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.d.ts +11 -0
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js +41 -0
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js.map +1 -1
- package/dist/custom/MJAIPromptRunEntityServer.server.d.ts +21 -0
- package/dist/custom/MJAIPromptRunEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIPromptRunEntityServer.server.js +76 -5
- package/dist/custom/MJAIPromptRunEntityServer.server.js.map +1 -1
- package/dist/custom/MJCommentEntityServer.server.d.ts +19 -0
- package/dist/custom/MJCommentEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJCommentEntityServer.server.js +137 -0
- package/dist/custom/MJCommentEntityServer.server.js.map +1 -0
- package/dist/custom/MJConversationEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJConversationEntityServer.server.js +16 -1
- package/dist/custom/MJConversationEntityServer.server.js.map +1 -1
- package/dist/custom/MJFieldSuggestionEntityServer.server.d.ts +29 -0
- package/dist/custom/MJFieldSuggestionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJFieldSuggestionEntityServer.server.js +249 -0
- package/dist/custom/MJFieldSuggestionEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +197 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.js +459 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphEdgeProviderEntityServer.server.d.ts +22 -0
- package/dist/custom/MJGraphEdgeProviderEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphEdgeProviderEntityServer.server.js +85 -0
- package/dist/custom/MJGraphEdgeProviderEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphEdgeTypeEntityServer.server.d.ts +21 -0
- package/dist/custom/MJGraphEdgeTypeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphEdgeTypeEntityServer.server.js +88 -0
- package/dist/custom/MJGraphEdgeTypeEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLEvaluationProtocolEntityServer.server.d.ts +39 -0
- package/dist/custom/MJMLEvaluationProtocolEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLEvaluationProtocolEntityServer.server.js +124 -0
- package/dist/custom/MJMLEvaluationProtocolEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts +124 -0
- package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLPredictionUnitEntityServer.server.js +214 -0
- package/dist/custom/MJMLPredictionUnitEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLTrainingPipelineEntityServer.server.d.ts +101 -1
- package/dist/custom/MJMLTrainingPipelineEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJMLTrainingPipelineEntityServer.server.js +266 -12
- package/dist/custom/MJMLTrainingPipelineEntityServer.server.js.map +1 -1
- package/dist/custom/MJMLTrainingSnapshotEntityServer.server.d.ts +14 -0
- package/dist/custom/MJMLTrainingSnapshotEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLTrainingSnapshotEntityServer.server.js +42 -0
- package/dist/custom/MJMLTrainingSnapshotEntityServer.server.js.map +1 -0
- package/dist/custom/MJQueryEntityServer.server.d.ts +2 -2
- package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.js +7 -5
- package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
- package/dist/custom/MJTaskDependencyEntityServer.server.d.ts +24 -0
- package/dist/custom/MJTaskDependencyEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJTaskDependencyEntityServer.server.js +75 -0
- package/dist/custom/MJTaskDependencyEntityServer.server.js.map +1 -0
- package/dist/custom/MJTaskEntityServer.server.d.ts +148 -0
- package/dist/custom/MJTaskEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJTaskEntityServer.server.js +413 -0
- package/dist/custom/MJTaskEntityServer.server.js.map +1 -0
- package/dist/custom/query-extraction/childRowWriter.d.ts +2 -2
- package/dist/custom/query-extraction/childRowWriter.d.ts.map +1 -1
- package/dist/custom/query-extraction/childRowWriter.js +7 -2
- package/dist/custom/query-extraction/childRowWriter.js.map +1 -1
- package/dist/custom/query-extraction/describeFacts.d.ts +2 -0
- package/dist/custom/query-extraction/describeFacts.d.ts.map +1 -1
- package/dist/custom/query-extraction/describeFacts.js +17 -10
- package/dist/custom/query-extraction/describeFacts.js.map +1 -1
- package/dist/custom/query-extraction/descriptionPass.d.ts.map +1 -1
- package/dist/custom/query-extraction/descriptionPass.js +4 -1
- package/dist/custom/query-extraction/descriptionPass.js.map +1 -1
- package/dist/custom/query-extraction/extractQuery.js +5 -3
- package/dist/custom/query-extraction/extractQuery.js.map +1 -1
- package/dist/custom/query-extraction/extractionTypes.d.ts +5 -0
- package/dist/custom/query-extraction/extractionTypes.d.ts.map +1 -1
- package/dist/custom/sessionConfigGuard.d.ts +7 -0
- package/dist/custom/sessionConfigGuard.d.ts.map +1 -1
- package/dist/custom/sessionConfigGuard.js +13 -1
- package/dist/custom/sessionConfigGuard.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +30 -30
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EntityDeleteOptions, EntitySaveOptions } from '@memberjunction/core';
|
|
2
|
+
import { MJTaskDependencyEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/**
|
|
4
|
+
* Server-side `MJ: Task Dependencies` entity: a workflow's edges are the task-graph service's.
|
|
5
|
+
*
|
|
6
|
+
* An edge decides when a step may run and what it reads: deleting the one into a send step would release it without
|
|
7
|
+
* the approval step before it, and adding one would hand a step another's output. So an edge that gates a workflow
|
|
8
|
+
* step, before or after the write, is created, changed or deleted only inside the dispatcher's runtime-security scope
|
|
9
|
+
* ({@link TASK_GRAPH_RUNTIME_SECURITY_OPERATION}), where the task-graph service writes a graph's edges. An edge that gates no
|
|
10
|
+
* workflow step, an ordinary task waiting on one included, is left alone.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MJTaskDependencyEntityServer extends MJTaskDependencyEntity {
|
|
13
|
+
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
14
|
+
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the edge gates a step of a workflow: its `TaskID`, as stored or as this write leaves it, is one. That is the
|
|
17
|
+
* end the dispatcher reads (a step's prerequisites); an ordinary task waiting on a step changes nothing it runs.
|
|
18
|
+
*/
|
|
19
|
+
private touchesWorkflowStep;
|
|
20
|
+
private refuse;
|
|
21
|
+
/** Whether this write runs inside the dispatcher's runtime-security scope, bound to its user. */
|
|
22
|
+
private inDispatcherScope;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=MJTaskDependencyEntityServer.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJTaskDependencyEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJTaskDependencyEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EACnB,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE;;;;;;;;GAQG;AACH,qBACa,4BAA6B,SAAQ,sBAAsB;IAC9C,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAOnD,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7E;;;OAGG;YACW,mBAAmB;IAgBjC,OAAO,CAAC,MAAM;IAWd,iGAAiG;IACjG,OAAO,CAAC,iBAAiB;CAK5B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { BaseEntity, BaseEntityResult, ServerOperationScopeManager, } from '@memberjunction/core';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { MJTaskDependencyEntity } from '@memberjunction/core-entities';
|
|
10
|
+
import { TASK_GRAPH_RUNTIME_SECURITY_OPERATION } from '@memberjunction/ai-core-plus';
|
|
11
|
+
import { IsWorkflowStepTask, ResolveWorkflowTaskTypeID } from './MJTaskEntityServer.server.js';
|
|
12
|
+
/**
|
|
13
|
+
* Server-side `MJ: Task Dependencies` entity: a workflow's edges are the task-graph service's.
|
|
14
|
+
*
|
|
15
|
+
* An edge decides when a step may run and what it reads: deleting the one into a send step would release it without
|
|
16
|
+
* the approval step before it, and adding one would hand a step another's output. So an edge that gates a workflow
|
|
17
|
+
* step, before or after the write, is created, changed or deleted only inside the dispatcher's runtime-security scope
|
|
18
|
+
* ({@link TASK_GRAPH_RUNTIME_SECURITY_OPERATION}), where the task-graph service writes a graph's edges. An edge that gates no
|
|
19
|
+
* workflow step, an ordinary task waiting on one included, is left alone.
|
|
20
|
+
*/
|
|
21
|
+
let MJTaskDependencyEntityServer = class MJTaskDependencyEntityServer extends MJTaskDependencyEntity {
|
|
22
|
+
async Save(options) {
|
|
23
|
+
if (!this.inDispatcherScope() && (await this.touchesWorkflowStep())) {
|
|
24
|
+
return this.refuse(this.IsSaved ? 'update' : 'create');
|
|
25
|
+
}
|
|
26
|
+
return super.Save(options);
|
|
27
|
+
}
|
|
28
|
+
async Delete(options) {
|
|
29
|
+
if (!this.inDispatcherScope() && (await this.touchesWorkflowStep())) {
|
|
30
|
+
return this.refuse('delete');
|
|
31
|
+
}
|
|
32
|
+
return super.Delete(options);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether the edge gates a step of a workflow: its `TaskID`, as stored or as this write leaves it, is one. That is the
|
|
36
|
+
* end the dispatcher reads (a step's prerequisites); an ordinary task waiting on a step changes nothing it runs.
|
|
37
|
+
*/
|
|
38
|
+
async touchesWorkflowStep() {
|
|
39
|
+
const ends = new Set();
|
|
40
|
+
const entityField = this.GetFieldByName('TaskID');
|
|
41
|
+
for (const value of [entityField?.Value, this.IsSaved ? entityField?.OldValue : undefined]) {
|
|
42
|
+
if (typeof value === 'string' && value)
|
|
43
|
+
ends.add(value.toUpperCase());
|
|
44
|
+
}
|
|
45
|
+
if (ends.size === 0)
|
|
46
|
+
return false;
|
|
47
|
+
const provider = this.RunViewProviderToUse;
|
|
48
|
+
const user = this.ContextCurrentUser;
|
|
49
|
+
const workflowTypeID = await ResolveWorkflowTaskTypeID(provider, user);
|
|
50
|
+
for (const taskID of ends) {
|
|
51
|
+
if (await IsWorkflowStepTask(provider, user, taskID, workflowTypeID))
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
refuse(type) {
|
|
57
|
+
const result = new BaseEntityResult();
|
|
58
|
+
result.Success = false;
|
|
59
|
+
result.Type = type;
|
|
60
|
+
result.Message = "A workflow's dependencies are written only by the task-graph service: they decide when its steps run and what they read.";
|
|
61
|
+
result.StartedAt = new Date();
|
|
62
|
+
result.EndedAt = new Date();
|
|
63
|
+
this.ResultHistory.push(result);
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
/** Whether this write runs inside the dispatcher's runtime-security scope, bound to its user. */
|
|
67
|
+
inDispatcherScope() {
|
|
68
|
+
return this.ContextCurrentUser != null && ServerOperationScopeManager.Instance.IsOperationActive([TASK_GRAPH_RUNTIME_SECURITY_OPERATION], 'MJ: Task Dependencies', this.ContextCurrentUser);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
MJTaskDependencyEntityServer = __decorate([
|
|
72
|
+
RegisterClass(BaseEntity, 'MJ: Task Dependencies')
|
|
73
|
+
], MJTaskDependencyEntityServer);
|
|
74
|
+
export { MJTaskDependencyEntityServer };
|
|
75
|
+
//# sourceMappingURL=MJTaskDependencyEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJTaskDependencyEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJTaskDependencyEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,UAAU,EACV,gBAAgB,EAGhB,2BAA2B,GAC9B,MA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ApDY,4BAA4B;IADxC,aAAa,CAAC,UAAU,EAAE,uBAAuB,CAAC;GACtC,4BAA4B,CAoDxC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { EntitySaveOptions, IRunViewProvider, UserInfo, ValidationResult } from '@memberjunction/core';
|
|
2
|
+
import { MJTaskEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/**
|
|
4
|
+
* Why a save must not write `Task.SecurityEnvelope`, or null when it may.
|
|
5
|
+
*
|
|
6
|
+
* The envelope holds the constraints of the agent run that submitted a task graph — its bound
|
|
7
|
+
* parameters, audience, tenant scope and taint — and the dispatcher enforces it on every node. It is
|
|
8
|
+
* written once, when the row is created (the server's own graph submission and its compensation
|
|
9
|
+
* tasks), and never changed: a later edit could only loosen what the submitting run was held to, so
|
|
10
|
+
* any change to it on an existing row is refused, whoever makes it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SecurityEnvelopeChangeRefusal(isSaved: boolean, securityEnvelopeDirty: boolean): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Why a save must not write `Configuration` as given, or null when it may: it changes a key of its
|
|
15
|
+
* `runtime` object.
|
|
16
|
+
*
|
|
17
|
+
* Those keys record what happened when a step ran (whether its output was tainted, the parameters its
|
|
18
|
+
* action was given, who completed a Human step, which action log and prompt run it produced, the loop's
|
|
19
|
+
* iterations), and the dispatcher reads them back: for taint, and for what a compensation undoes (the
|
|
20
|
+
* action log names the record changes it reverts). Only the dispatcher writes them: through
|
|
21
|
+
* its guarded completion procedure, beneath the entity layer, or inside its server operation scope
|
|
22
|
+
* ({@link TASK_GRAPH_RUNTIME_SECURITY_OPERATION}, which `MJTaskEntityServer` checks before calling
|
|
23
|
+
* this). So any other change to them through the entity layer is refused, whoever makes it: a client,
|
|
24
|
+
* or server code such as the Update Record action a tainted agent calls on its own graph's rows.
|
|
25
|
+
* Setting `isOutputTainted` back to false would otherwise run every step downstream of an untrusted
|
|
26
|
+
* fetch clean. A create counts as a change from nothing, and a `Configuration` that does not parse
|
|
27
|
+
* reads as having none of them, so neither can slip one in.
|
|
28
|
+
*
|
|
29
|
+
* @param storedConfiguration the column before this save (`null` for a create)
|
|
30
|
+
* @param nextConfiguration the column being saved
|
|
31
|
+
* @param serverStamped keys this save's own server stamp sets ({@link MJTaskEntityServer.Save}), not compared
|
|
32
|
+
*/
|
|
33
|
+
export declare function RuntimeSecurityChangeRefusal(storedConfiguration: string | null | undefined, nextConfiguration: string | null | undefined, serverStamped?: readonly string[]): string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a save changes what a step's `Configuration` tells it to do (input mapping, action, human step,
|
|
36
|
+
* compensation and the rest), as opposed to its `layout` or `runtime` keys. A `Configuration` that does not
|
|
37
|
+
* parse counts as changed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ExecutableConfigurationChanged(stored: string | null | undefined, next: string | null | undefined): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Why a save must not change a workflow step this way, or null when it may.
|
|
42
|
+
*
|
|
43
|
+
* A workflow step (a task with a parent and a `StepType`) feeds what it produced into the steps after it,
|
|
44
|
+
* runs what its definition names, waits on whom it is assigned to, and its name and description become the
|
|
45
|
+
* question its Human step's request asks. The submitter's own code (an agent run calling Update Record, which
|
|
46
|
+
* runs as the submitter) could otherwise rewrite the output of a step that ran clean, the input or the action
|
|
47
|
+
* of a step waiting to run, the answer a Human step will carry before its person approves it, or who that
|
|
48
|
+
* person is; or rerun, skip or settle a step by its status. The graph would treat the result as trusted. So
|
|
49
|
+
* outside the dispatcher's scope those cannot change on a saved step, except that the person a Human step is
|
|
50
|
+
* assigned to may complete or reject it and give its output, their answer, in their own client request.
|
|
51
|
+
*
|
|
52
|
+
* @param changedFields the owned columns this save changes
|
|
53
|
+
* @param personCompletesOwnHumanStep this save is the assignee completing their Human step, as their own client request
|
|
54
|
+
*/
|
|
55
|
+
export declare function WorkflowStepDataChangeRefusal(changedFields: readonly string[], personCompletesOwnHumanStep: boolean): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The ID of the `MJ: Task Types` row a workflow is filed under ({@link TASK_GRAPH_WORKFLOW_TYPE_NAME}), or null while it
|
|
58
|
+
* does not exist. Read as the system user, so a caller who cannot read task types cannot make the guards miss it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ResolveWorkflowTaskTypeID(provider: IRunViewProvider, user: UserInfo | undefined): Promise<string | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether `taskID` is a workflow: a task graph's parent, a parentless task of the workflow type. A task this user
|
|
63
|
+
* cannot read counts as one, so whatever hangs under it is judged as a workflow step (fail closed).
|
|
64
|
+
*/
|
|
65
|
+
export declare function IsWorkflowTask(provider: IRunViewProvider, user: UserInfo | undefined, taskID: string, workflowTypeID: string | null): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Whether `taskID` is a step of a workflow: a task with a parent and a `StepType` or the workflow type, or any task
|
|
68
|
+
* whose parent is a workflow. A task this user cannot read counts as one (fail closed).
|
|
69
|
+
*/
|
|
70
|
+
export declare function IsWorkflowStepTask(provider: IRunViewProvider, user: UserInfo | undefined, taskID: string, workflowTypeID: string | null): Promise<boolean>;
|
|
71
|
+
/** What a save needs to know about workflow membership, resolved before it validates (the lookups are asynchronous). */
|
|
72
|
+
interface WorkflowFacts {
|
|
73
|
+
WorkflowTypeID: string | null;
|
|
74
|
+
StoredParentIsWorkflow: boolean;
|
|
75
|
+
NextParentIsWorkflow: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* `configuration` with `runtime.completedByUserID` set to `userID` (removed when `null`). A
|
|
79
|
+
* `Configuration` that does not parse is returned unchanged: the step then records no completer, so its
|
|
80
|
+
* completion clears nothing.
|
|
81
|
+
*/
|
|
82
|
+
export declare function WithCompletedByUserID(configuration: string | null, userID: string | null): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Server-side `MJ: Tasks` entity: keeps a task's security envelope immutable after insert
|
|
85
|
+
* ({@link SecurityEnvelopeChangeRefusal}), its runtime record, a workflow step's definition and data, and a
|
|
86
|
+
* workflow's metadata dispatcher-owned ({@link RuntimeSecurityChangeRefusal}, {@link WorkflowStepDataChangeRefusal}),
|
|
87
|
+
* and records who completes a Human step.
|
|
88
|
+
*/
|
|
89
|
+
export declare class MJTaskEntityServer extends MJTaskEntity {
|
|
90
|
+
/**
|
|
91
|
+
* Records who completed a Human step (`runtime.completedByUserID`) when this save moves one to
|
|
92
|
+
* `Complete`, whatever the caller put there: the user the save runs as when it arrived as a direct
|
|
93
|
+
* client CRUD request (`ServerOperationScopeManager.IsInDirectClientCrud`), and nobody otherwise. A completed Human step
|
|
94
|
+
* clears taint only when the record names its assignee (`HumanReviewClearsTaint` in
|
|
95
|
+
* `@memberjunction/task-graph`). The assignee is the graph's submitter, and the graph's agents and
|
|
96
|
+
* actions run as that same user, so the user alone cannot tell a person's review from server code
|
|
97
|
+
* completing the step; where the save came from can. The dispatcher, settling a step from the
|
|
98
|
+
* answered request, records the request's responder itself, inside {@link TASK_GRAPH_RUNTIME_SECURITY_OPERATION}.
|
|
99
|
+
*/
|
|
100
|
+
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* The workflow checks for a save that did not come through {@link Save} (a path that validates a row it then writes
|
|
103
|
+
* some other way): it resolves the facts itself. Within {@link Save} the synchronous {@link Validate} has already run
|
|
104
|
+
* them, with the facts {@link Save} resolved.
|
|
105
|
+
*/
|
|
106
|
+
ValidateAsync(): Promise<ValidationResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Workflow membership of this row before and after the save. Set only while a save (or {@link ValidateAsync})
|
|
109
|
+
* validates it: a bare {@link Validate} call (REST validates before it saves) has none, and skips the checks that
|
|
110
|
+
* need it, which the save that follows runs.
|
|
111
|
+
*/
|
|
112
|
+
private workflowFacts;
|
|
113
|
+
/** Resolves {@link WorkflowFacts}: the workflow type, and whether the stored and the new parent are workflows. */
|
|
114
|
+
protected resolveWorkflowFacts(): Promise<WorkflowFacts>;
|
|
115
|
+
Validate(): ValidationResult;
|
|
116
|
+
/**
|
|
117
|
+
* The checks that need {@link workflowFacts}: a workflow, or a step of one, made by an ordinary save (created, or an
|
|
118
|
+
* existing task retyped or re-parented into one), and the freezes on a workflow step's and a workflow's own columns.
|
|
119
|
+
* Called only with the facts resolved, and outside the dispatcher's scope.
|
|
120
|
+
*/
|
|
121
|
+
private applyWorkflowChecks;
|
|
122
|
+
/** The column's value before this save (its current value on a create). */
|
|
123
|
+
private stored;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the row, as stored or as this save leaves it, is a step of a task graph: it has a parent, and a `StepType`,
|
|
126
|
+
* the workflow type (the dispatcher finds graphs by their steps' type), or a parent that is a workflow. Called only
|
|
127
|
+
* with {@link workflowFacts} resolved; without them it counts any task with a parent (fail closed).
|
|
128
|
+
*/
|
|
129
|
+
private isWorkflowStep;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the row, as stored or as this save leaves it, is a task graph's workflow (parent) task: no parent, no
|
|
132
|
+
* `StepType`, filed under the workflow type. Without resolved facts, the joined type name decides for the stored row,
|
|
133
|
+
* and a changed type counts (fail closed).
|
|
134
|
+
*/
|
|
135
|
+
private isWorkflowParent;
|
|
136
|
+
/**
|
|
137
|
+
* Whether this save is the assignee settling their own Human step, as their own client request: completing it
|
|
138
|
+
* (approving) or failing it (rejecting) while it waits on them. A Human step waits in `Pending`; settling one that
|
|
139
|
+
* is Skipped, Cancelled or Blocked would undo the owner's choice or release steps past a failed prerequisite.
|
|
140
|
+
*/
|
|
141
|
+
private personSettlesOwnHumanStep;
|
|
142
|
+
/** Whether this save moves a Human step to `Complete` (a create already `Complete` included). */
|
|
143
|
+
private completesHumanStep;
|
|
144
|
+
/** Whether this save runs inside the dispatcher's runtime-security scope, bound to this row's user. */
|
|
145
|
+
private inDispatcherScope;
|
|
146
|
+
}
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=MJTaskEntityServer.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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