@memberjunction/core-entities-server 6.3.0-edge.2 → 6.3.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.
- package/README.md +13 -0
- package/dist/custom/ArtifactSecurityHookHelpers.d.ts.map +1 -1
- package/dist/custom/ArtifactSecurityHookHelpers.js +50 -0
- package/dist/custom/ArtifactSecurityHookHelpers.js.map +1 -1
- package/dist/custom/GraphConceptReadSecurityHook.d.ts +75 -0
- package/dist/custom/GraphConceptReadSecurityHook.d.ts.map +1 -0
- package/dist/custom/GraphConceptReadSecurityHook.js +574 -0
- package/dist/custom/GraphConceptReadSecurityHook.js.map +1 -0
- package/dist/custom/GraphRecordChangesReadSecurityHook.d.ts +45 -0
- package/dist/custom/GraphRecordChangesReadSecurityHook.d.ts.map +1 -0
- package/dist/custom/GraphRecordChangesReadSecurityHook.js +744 -0
- package/dist/custom/GraphRecordChangesReadSecurityHook.js.map +1 -0
- package/dist/custom/MJAIAgentActionEntityServer.server.d.ts +13 -0
- package/dist/custom/MJAIAgentActionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentActionEntityServer.server.js +52 -0
- package/dist/custom/MJAIAgentActionEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentCategoryEntityServer.server.d.ts +30 -0
- package/dist/custom/MJAIAgentCategoryEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentCategoryEntityServer.server.js +127 -0
- package/dist/custom/MJAIAgentCategoryEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentClientToolEntityServer.server.d.ts +12 -0
- package/dist/custom/MJAIAgentClientToolEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentClientToolEntityServer.server.js +46 -0
- package/dist/custom/MJAIAgentClientToolEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentEntityServer.server.d.ts +113 -7
- package/dist/custom/MJAIAgentEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentEntityServer.server.js +1946 -96
- package/dist/custom/MJAIAgentEntityServer.server.js.map +1 -1
- package/dist/custom/MJAIAgentModalityEntityServer.server.d.ts +13 -0
- package/dist/custom/MJAIAgentModalityEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentModalityEntityServer.server.js +52 -0
- package/dist/custom/MJAIAgentModalityEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentNoteEntityServer.server.d.ts +64 -8
- package/dist/custom/MJAIAgentNoteEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentNoteEntityServer.server.js +263 -9
- package/dist/custom/MJAIAgentNoteEntityServer.server.js.map +1 -1
- package/dist/custom/MJAIAgentPersonaEntityServer.server.d.ts +2 -2
- package/dist/custom/MJAIAgentPersonaEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentPersonaEntityServer.server.js +10 -8
- package/dist/custom/MJAIAgentPersonaEntityServer.server.js.map +1 -1
- package/dist/custom/MJAIAgentRelationshipEntityServer.server.d.ts +5 -2
- package/dist/custom/MJAIAgentRelationshipEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentRelationshipEntityServer.server.js +25 -2
- package/dist/custom/MJAIAgentRelationshipEntityServer.server.js.map +1 -1
- package/dist/custom/MJAIAgentSkillEntityServer.server.d.ts +12 -0
- package/dist/custom/MJAIAgentSkillEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentSkillEntityServer.server.js +46 -0
- package/dist/custom/MJAIAgentSkillEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentStepTypeEntityServer.server.d.ts +28 -0
- package/dist/custom/MJAIAgentStepTypeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentStepTypeEntityServer.server.js +117 -0
- package/dist/custom/MJAIAgentStepTypeEntityServer.server.js.map +1 -0
- package/dist/custom/MJAIAgentTypeEntityServer.server.d.ts +34 -0
- package/dist/custom/MJAIAgentTypeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentTypeEntityServer.server.js +231 -0
- package/dist/custom/MJAIAgentTypeEntityServer.server.js.map +1 -0
- package/dist/custom/MJActionEntityServer.server.d.ts +37 -0
- package/dist/custom/MJActionEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJActionEntityServer.server.js +208 -3
- package/dist/custom/MJActionEntityServer.server.js.map +1 -1
- package/dist/custom/MJComponentEntityServer.server.d.ts +6 -0
- package/dist/custom/MJComponentEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJComponentEntityServer.server.js +20 -2
- package/dist/custom/MJComponentEntityServer.server.js.map +1 -1
- package/dist/custom/MJContentSourceEntityServer.server.d.ts +28 -0
- package/dist/custom/MJContentSourceEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJContentSourceEntityServer.server.js +73 -0
- package/dist/custom/MJContentSourceEntityServer.server.js.map +1 -0
- package/dist/custom/MJContentSourceTypeEntityServer.server.d.ts +25 -0
- package/dist/custom/MJContentSourceTypeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJContentSourceTypeEntityServer.server.js +73 -0
- package/dist/custom/MJContentSourceTypeEntityServer.server.js.map +1 -0
- package/dist/custom/MJDashboardEntityServer.server.d.ts +6 -0
- package/dist/custom/MJDashboardEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJDashboardEntityServer.server.js +24 -2
- package/dist/custom/MJDashboardEntityServer.server.js.map +1 -1
- package/dist/custom/MJGraphConceptEntityServer.server.d.ts +175 -23
- package/dist/custom/MJGraphConceptEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJGraphConceptEntityServer.server.js +584 -41
- package/dist/custom/MJGraphConceptEntityServer.server.js.map +1 -1
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +38 -11
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJGraphEdgeEntityServer.server.js +249 -39
- package/dist/custom/MJGraphEdgeEntityServer.server.js.map +1 -1
- package/dist/custom/MJGraphEntityServer.server.d.ts +58 -0
- package/dist/custom/MJGraphEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphEntityServer.server.js +357 -0
- package/dist/custom/MJGraphEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphLinkEntityServer.server.d.ts +98 -0
- package/dist/custom/MJGraphLinkEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphLinkEntityServer.server.js +375 -0
- package/dist/custom/MJGraphLinkEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphPermissionEntityServer.server.d.ts +29 -0
- package/dist/custom/MJGraphPermissionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphPermissionEntityServer.server.js +141 -0
- package/dist/custom/MJGraphPermissionEntityServer.server.js.map +1 -0
- package/dist/custom/MJListDetailEntityServer.server.d.ts +4 -4
- package/dist/custom/MJListDetailEntityServer.server.js +4 -4
- package/dist/custom/MJListEntityServer.server.d.ts +2 -1
- package/dist/custom/MJListEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJListEntityServer.server.js +5 -2
- package/dist/custom/MJListEntityServer.server.js.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.d.ts +51 -3
- package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.js +142 -28
- package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
- package/dist/custom/MJQueryParameterEntityServer.server.d.ts +37 -0
- package/dist/custom/MJQueryParameterEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJQueryParameterEntityServer.server.js +160 -0
- package/dist/custom/MJQueryParameterEntityServer.server.js.map +1 -0
- package/dist/custom/MJQuerySQLEntityServer.server.d.ts +23 -0
- package/dist/custom/MJQuerySQLEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQuerySQLEntityServer.server.js +106 -9
- package/dist/custom/MJQuerySQLEntityServer.server.js.map +1 -1
- package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.d.ts +1 -1
- package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.js +8 -5
- package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.js.map +1 -1
- package/dist/custom/MJUserRoleEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserRoleEntityServer.server.js +9 -0
- package/dist/custom/MJUserRoleEntityServer.server.js.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.d.ts +9 -0
- package/dist/custom/MJUserViewEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.js +59 -3
- package/dist/custom/MJUserViewEntityServer.server.js.map +1 -1
- package/dist/custom/agentRelationalGrantGuard.d.ts +73 -0
- package/dist/custom/agentRelationalGrantGuard.d.ts.map +1 -0
- package/dist/custom/agentRelationalGrantGuard.js +375 -0
- package/dist/custom/agentRelationalGrantGuard.js.map +1 -0
- package/dist/custom/approvalStamp.d.ts +68 -4
- package/dist/custom/approvalStamp.d.ts.map +1 -1
- package/dist/custom/approvalStamp.js +107 -13
- package/dist/custom/approvalStamp.js.map +1 -1
- package/dist/custom/canon/CanonFingerprintRecorderServer.d.ts +20 -0
- package/dist/custom/canon/CanonFingerprintRecorderServer.d.ts.map +1 -0
- package/dist/custom/canon/CanonFingerprintRecorderServer.js +148 -0
- package/dist/custom/canon/CanonFingerprintRecorderServer.js.map +1 -0
- package/dist/custom/canon/index.d.ts +2 -0
- package/dist/custom/canon/index.d.ts.map +1 -0
- package/dist/custom/canon/index.js +2 -0
- package/dist/custom/canon/index.js.map +1 -0
- package/dist/custom/graph/GraphFindPathServerOperation.d.ts +7 -5
- package/dist/custom/graph/GraphFindPathServerOperation.d.ts.map +1 -1
- package/dist/custom/graph/GraphFindPathServerOperation.js +41 -12
- package/dist/custom/graph/GraphFindPathServerOperation.js.map +1 -1
- package/dist/custom/graphPermissionGuard.d.ts +69 -0
- package/dist/custom/graphPermissionGuard.d.ts.map +1 -0
- package/dist/custom/graphPermissionGuard.js +229 -0
- package/dist/custom/graphPermissionGuard.js.map +1 -0
- package/dist/custom/graphRlsCacheInvalidation.d.ts +38 -0
- package/dist/custom/graphRlsCacheInvalidation.d.ts.map +1 -0
- package/dist/custom/graphRlsCacheInvalidation.js +111 -0
- package/dist/custom/graphRlsCacheInvalidation.js.map +1 -0
- package/dist/custom/queryParentFingerprint.d.ts +36 -0
- package/dist/custom/queryParentFingerprint.d.ts.map +1 -0
- package/dist/custom/queryParentFingerprint.js +159 -0
- package/dist/custom/queryParentFingerprint.js.map +1 -0
- package/dist/custom/queryParentSaveChain.d.ts +5 -0
- package/dist/custom/queryParentSaveChain.d.ts.map +1 -0
- package/dist/custom/queryParentSaveChain.js +25 -0
- package/dist/custom/queryParentSaveChain.js.map +1 -0
- package/dist/custom/seededMetadataPush.d.ts +7 -0
- package/dist/custom/seededMetadataPush.d.ts.map +1 -0
- package/dist/custom/seededMetadataPush.js +23 -0
- package/dist/custom/seededMetadataPush.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -31
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-side `MJ: Content Source Types` entity rejecting any `GraphOverlay.Enabled`
|
|
3
|
+
* or legacy enablement flag at the content-source-type level on every save (Finding 155).
|
|
4
|
+
*
|
|
5
|
+
* @module @memberjunction/core-entities-server
|
|
6
|
+
*/
|
|
7
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
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;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
import { BaseEntity, ValidationErrorInfo, ValidationErrorType, } from '@memberjunction/core';
|
|
14
|
+
import { MJContentSourceTypeEntity, ValidateGraphOverlayConfigShape, } from '@memberjunction/core-entities';
|
|
15
|
+
import { RegisterClass, SafeJSONParse } from '@memberjunction/global';
|
|
16
|
+
/** Clear migration message when `GraphOverlay` is placed on `MJ: Content Source Types` (Finding 155). */
|
|
17
|
+
export const CONTENT_SOURCE_TYPE_GRAPH_OVERLAY_ERROR = 'GraphOverlay settings on MJ: Content Source Types are not read by Canon and belong on MJ: Content Sources; remove GraphOverlay from Content Source Type configuration.';
|
|
18
|
+
/**
|
|
19
|
+
* Pure validation helper for `MJ: Content Source Types.Configuration` (Finding 155):
|
|
20
|
+
* rejects malformed JSON, any `GraphOverlay` settings (even `Enabled: false`), and all legacy
|
|
21
|
+
* enablement keys (`EnableGraphOverlay`, `Options.GraphOverlay`).
|
|
22
|
+
*/
|
|
23
|
+
export function ValidateContentSourceTypeGraphOverlayConfig(configuration) {
|
|
24
|
+
if (configuration == null || configuration.trim().length === 0) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const parsed = SafeJSONParse(configuration.trim());
|
|
28
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
29
|
+
return [
|
|
30
|
+
new ValidationErrorInfo('Configuration', 'Configuration must be a valid JSON object.', configuration, ValidationErrorType.Failure),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
const errors = [];
|
|
34
|
+
const hasGraphOverlay = 'GraphOverlay' in parsed && parsed['GraphOverlay'] !== undefined;
|
|
35
|
+
if (hasGraphOverlay) {
|
|
36
|
+
errors.push(new ValidationErrorInfo('Configuration', CONTENT_SOURCE_TYPE_GRAPH_OVERLAY_ERROR, configuration, ValidationErrorType.Failure));
|
|
37
|
+
}
|
|
38
|
+
// Check remaining legacy keys (e.g., top-level EnableGraphOverlay or Options.GraphOverlay) without
|
|
39
|
+
// duplicating or emitting misleading "cannot be enabled" errors for GraphOverlay itself.
|
|
40
|
+
const rest = { ...parsed };
|
|
41
|
+
delete rest['GraphOverlay'];
|
|
42
|
+
const shapeCheck = ValidateGraphOverlayConfigShape(rest, { IsContentSourceType: true });
|
|
43
|
+
if (!shapeCheck.Valid) {
|
|
44
|
+
for (const message of shapeCheck.Errors) {
|
|
45
|
+
errors.push(new ValidationErrorInfo('Configuration', `${message} Legacy GraphOverlay shapes on MJ: Content Source Types are not read by Canon.`, configuration, ValidationErrorType.Failure));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return errors;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Server-side `MJ: Content Source Types` entity enforcing that graph building enablement flags
|
|
52
|
+
* are never written to a Content Source Type while allowing unrelated edits on existing rows with
|
|
53
|
+
* untouched legacy `Configuration` values (Finding 155).
|
|
54
|
+
*/
|
|
55
|
+
let MJContentSourceTypeEntityServer = class MJContentSourceTypeEntityServer extends MJContentSourceTypeEntity {
|
|
56
|
+
Validate() {
|
|
57
|
+
const result = super.Validate();
|
|
58
|
+
const shouldValidateConfiguration = !this.IsSaved || this.GetFieldByName('Configuration')?.Dirty === true;
|
|
59
|
+
if (shouldValidateConfiguration) {
|
|
60
|
+
const graphErrors = ValidateContentSourceTypeGraphOverlayConfig(this.Configuration);
|
|
61
|
+
if (graphErrors.length > 0) {
|
|
62
|
+
result.Errors.push(...graphErrors);
|
|
63
|
+
result.Success = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
MJContentSourceTypeEntityServer = __decorate([
|
|
70
|
+
RegisterClass(BaseEntity, 'MJ: Content Source Types')
|
|
71
|
+
], MJContentSourceTypeEntityServer);
|
|
72
|
+
export { MJContentSourceTypeEntityServer };
|
|
73
|
+
//# sourceMappingURL=MJContentSourceTypeEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJContentSourceTypeEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJContentSourceTypeEntityServer.server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;AAEH,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,+BAA+B,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEtE,yGAAyG;AACzG,MAAM,CAAC,MAAM,uCAAuC,GAChD,wKAAwK,CAAC;AAE7K;;;;GAIG;AACH,MAAM,UAAU,2CAA2C,CACvD,aAAwC;IAExC,IAAI,aAAa,IAAI,IAAI,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,OAAO,EAAE,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAA0B,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,OAAO;YACH,IAAI,mBAAmB,CACnB,eAAe,EACf,4CAA4C,EAC5C,aAAa,EACb,mBAAmB,CAAC,OAAO,CAC9B;SACJ,CAAC;IACN,CAAC;IAED,MAAM,MAAM,GAA0B,EAAE,CAAC;IACzC,MAAM,eAAe,GAAG,cAAc,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK,SAAS,CAAC;IACzF,IAAI,eAAe,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CACP,IAAI,mBAAmB,CACnB,eAAe,EACf,uCAAuC,EACvC,aAAa,EACb,mBAAmB,CAAC,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BAA+B,CAc3C"}
|
|
@@ -10,5 +10,11 @@ import { MJDashboardEntityExtended } from "@memberjunction/core-entities";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class MJDashboardEntityServer extends MJDashboardEntityExtended {
|
|
12
12
|
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* D55: records the fingerprint of this dashboard when it is Approved with none on record (see
|
|
15
|
+
* `RecordMissingApprovedFingerprintAsync`). Writes the row directly, without the approval rules in
|
|
16
|
+
* {@link Save}, which keep every client-sent fingerprint out.
|
|
17
|
+
*/
|
|
18
|
+
RecordMissingApprovedFingerprintAsync(): Promise<boolean>;
|
|
13
19
|
}
|
|
14
20
|
//# sourceMappingURL=MJDashboardEntityServer.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJDashboardEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"MJDashboardEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoC,yBAAyB,EAA0B,MAAM,+BAA+B,CAAC;AAUpI;;;;;;;GAOG;AACH,qBACa,uBAAwB,SAAQ,yBAAyB;IAC5C,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCzE;;;;OAIG;IACU,qCAAqC,IAAI,OAAO,CAAC,OAAO,CAAC;CAGzE"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { BaseEntity } from "@memberjunction/core";
|
|
8
8
|
import { RegisterClass } from "@memberjunction/global";
|
|
9
9
|
import { ComputeDashboardFingerprintAsync, MJDashboardEntityExtended } from "@memberjunction/core-entities";
|
|
10
|
-
import { ApplyApprovalRulesAsync, ApprovalRefusalResult } from "./approvalStamp.js";
|
|
10
|
+
import { ApplyApprovalRulesAsync, ApprovalRefusalResult, RecordMissingApprovedFingerprintAsync } from "./approvalStamp.js";
|
|
11
11
|
/**
|
|
12
12
|
* Server-side `MJ: Dashboards` entity.
|
|
13
13
|
*
|
|
@@ -20,7 +20,21 @@ let MJDashboardEntityServer = class MJDashboardEntityServer extends MJDashboardE
|
|
|
20
20
|
async Save(options) {
|
|
21
21
|
try {
|
|
22
22
|
// Nothing in this save derives the definition, so the fingerprint is stamped now and written with the row.
|
|
23
|
-
|
|
23
|
+
const approving = !options?.ReplayOnly &&
|
|
24
|
+
await ApplyApprovalRulesAsync(this, 'ApprovalStatus', this.ApprovalStatus, undefined, {
|
|
25
|
+
StoredFields: ['Type', 'UIConfigDetails', 'Code', 'DriverClass'],
|
|
26
|
+
HasDefinitionChange: (stored) => this.Type !== stored.Type ||
|
|
27
|
+
(this.UIConfigDetails ?? '') !== (stored.UIConfigDetails ?? '') ||
|
|
28
|
+
(this.Code ?? '') !== (stored.Code ?? '') ||
|
|
29
|
+
(this.DriverClass ?? '') !== (stored.DriverClass ?? ''),
|
|
30
|
+
ComputeStoredFingerprint: (stored) => ComputeDashboardFingerprintAsync({
|
|
31
|
+
Type: stored.Type ?? 'Config',
|
|
32
|
+
UIConfigDetails: stored.UIConfigDetails ?? '',
|
|
33
|
+
Code: stored.Code ?? null,
|
|
34
|
+
DriverClass: stored.DriverClass ?? null,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
if (approving) {
|
|
24
38
|
this.ApprovedFingerprint = await ComputeDashboardFingerprintAsync(this);
|
|
25
39
|
}
|
|
26
40
|
}
|
|
@@ -30,6 +44,14 @@ let MJDashboardEntityServer = class MJDashboardEntityServer extends MJDashboardE
|
|
|
30
44
|
}
|
|
31
45
|
return super.Save(options);
|
|
32
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* D55: records the fingerprint of this dashboard when it is Approved with none on record (see
|
|
49
|
+
* `RecordMissingApprovedFingerprintAsync`). Writes the row directly, without the approval rules in
|
|
50
|
+
* {@link Save}, which keep every client-sent fingerprint out.
|
|
51
|
+
*/
|
|
52
|
+
async RecordMissingApprovedFingerprintAsync() {
|
|
53
|
+
return RecordMissingApprovedFingerprintAsync(this, 'ApprovalStatus', () => ComputeDashboardFingerprintAsync(this), (writeOptions) => super.Save(writeOptions));
|
|
54
|
+
}
|
|
33
55
|
};
|
|
34
56
|
MJDashboardEntityServer = __decorate([
|
|
35
57
|
RegisterClass(BaseEntity, 'MJ: Dashboards')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJDashboardEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"MJDashboardEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJDashboardEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAA0B,MAAM,+BAA+B,CAAC;AACpI,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,qCAAqC,EAA0B,MAAM,iBAAiB,CAAC;AAShJ;;;;;;;GAOG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,yBAAyB;IAClD,KAAK,CAAC,IAAI,CAAC,OAA2B;QAClD,IAAI,CAAC;YACD,2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AC;IAC/B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,qCAAqC;QAC9C,OAAO,qCAAqC,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,gCAAgC,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACnK,CAAC;CACJ,CAAA;AA7CY,uBAAuB;IADnC,aAAa,CAAC,UAAU,EAAE,gBAAgB,CAAC;GAC/B,uBAAuB,CA6CnC"}
|
|
@@ -1,10 +1,102 @@
|
|
|
1
|
-
import { AuthorizationInfo, EntityDeleteOptions, EntitySaveOptions, UserInfo, ValidationErrorInfo, ValidationResult } from '@memberjunction/core';
|
|
1
|
+
import { AuthorizationInfo, CompositeKey, EntityDeleteOptions, EntitySaveOptions, FieldValueCollection, IMetadataProvider, UserInfo, ValidationErrorInfo, ValidationResult } from '@memberjunction/core';
|
|
2
2
|
import { MJGraphConceptEntity } from '@memberjunction/core-entities';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Process-wide global store key for the post-save concept vector sync hook registered by
|
|
5
|
+
* `@memberjunction/content-pipeline` (finding 121). Stored in `GetGlobalObjectStore()` so
|
|
6
|
+
* `@memberjunction/core-entities-server` and `@memberjunction/content-pipeline` stay decoupled.
|
|
6
7
|
*/
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const GRAPH_CONCEPT_VECTOR_SYNC_HOOK_KEY = "___MJ_GRAPH_CONCEPT_VECTOR_SYNC_HOOK__";
|
|
9
|
+
/**
|
|
10
|
+
* Process-wide global store key for the post-delete / deprecation concept vector cleanup hook
|
|
11
|
+
* registered by `@memberjunction/content-pipeline` (finding 121).
|
|
12
|
+
*/
|
|
13
|
+
export declare const GRAPH_CONCEPT_VECTOR_DELETE_HOOK_KEY = "___MJ_GRAPH_CONCEPT_VECTOR_DELETE_HOOK__";
|
|
14
|
+
/**
|
|
15
|
+
* Process-wide global store key backing the `AsyncLocalStorage` token used to suppress the
|
|
16
|
+
* post-save vector sync hook during pipeline-managed writes (`EntityGraphOverlayStore.UpsertConcept`),
|
|
17
|
+
* preventing double-embedding (finding 142).
|
|
18
|
+
*/
|
|
19
|
+
export declare const GRAPH_CONCEPT_VECTOR_SYNC_SUPPRESS_STORE_KEY = "___MJ_GRAPH_CONCEPT_VECTOR_SYNC_SUPPRESS_ALS__";
|
|
20
|
+
/**
|
|
21
|
+
* Fields on `MJ: Graph Concepts` whose modification alters the rendered embedding text and
|
|
22
|
+
* therefore triggers post-save vector synchronization (finding 142). Status-only transitions
|
|
23
|
+
* (e.g., `Proposed` -> `Approved`) are deliberately excluded so approval does ZERO embedding.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CONCEPT_VECTOR_SYNC_FIELDS: readonly ["Name", "ConceptTypeID", "Synonyms", "Description", "Specification"];
|
|
26
|
+
/** Post-save hook contract invoked after `MJGraphConceptEntityServer.Save()` succeeds. */
|
|
27
|
+
export type GraphConceptVectorSyncHandler = (concept: MJGraphConceptEntity, contextUser: UserInfo, provider: IMetadataProvider) => Promise<void>;
|
|
28
|
+
/** Post-delete / deprecation hook contract invoked to remove a concept's vector and ERD row. */
|
|
29
|
+
export type GraphConceptVectorDeleteHandler = (conceptID: string, graphID: string, contextUser: UserInfo, provider: IMetadataProvider) => Promise<void>;
|
|
30
|
+
/** Registers (or clears with `null`) the post-save concept vector sync handler. */
|
|
31
|
+
export declare function RegisterGraphConceptVectorSyncHandler(handler: GraphConceptVectorSyncHandler | null): void;
|
|
32
|
+
/** Returns the currently registered post-save concept vector sync handler, if any. */
|
|
33
|
+
export declare function GetGraphConceptVectorSyncHandler(): GraphConceptVectorSyncHandler | null;
|
|
34
|
+
/** Registers (or clears with `null`) the post-delete / deprecation concept vector cleanup handler. */
|
|
35
|
+
export declare function RegisterGraphConceptVectorDeleteHandler(handler: GraphConceptVectorDeleteHandler | null): void;
|
|
36
|
+
/** Returns the currently registered post-delete / deprecation concept vector cleanup handler, if any. */
|
|
37
|
+
export declare function GetGraphConceptVectorDeleteHandler(): GraphConceptVectorDeleteHandler | null;
|
|
38
|
+
/**
|
|
39
|
+
* Executes `work` with the `MJGraphConceptEntityServer.Save()` post-save vector sync hook
|
|
40
|
+
* suppressed on this async execution context (finding 142 — eliminates double-embedding when
|
|
41
|
+
* `GraphStage` persists concepts and syncs their precomputed vectors directly).
|
|
42
|
+
*/
|
|
43
|
+
export declare function RunWithSuppressedGraphConceptVectorSync<T>(work: () => Promise<T>): Promise<T>;
|
|
44
|
+
/** Returns `true` when the current async execution context is suppressing post-save concept vector sync. */
|
|
45
|
+
export declare function IsGraphConceptVectorSyncSuppressed(): boolean;
|
|
46
|
+
/** Clears cached D58 graph-building-enabled answers (for one `graphID` or all graphs, e.g. in tests). */
|
|
47
|
+
export declare function InvalidateGraphBuildingEnabledCache(graphID?: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Server-owned D42 approval stamp columns on `MJ: Graph Concepts`.
|
|
50
|
+
* These are governed fields maintained exclusively by the server and refused when supplied or modified by a client.
|
|
51
|
+
*/
|
|
52
|
+
export declare const CONCEPT_APPROVAL_STAMP_FIELDS: readonly ["ApprovalMode", "ApprovedByUserID", "ApprovedAt"];
|
|
53
|
+
export type ConceptApprovalStampField = (typeof CONCEPT_APPROVAL_STAMP_FIELDS)[number];
|
|
54
|
+
/**
|
|
55
|
+
* Columns exempt from field-edit governance on an existing `Approved`, `Deprecated`, or
|
|
56
|
+
* `Provisional` `MJ: Graph Concepts` row: only `Status` (governed by status transition rules)
|
|
57
|
+
* and `__mj*` system audit columns (plus read-only/virtual/primary-key metadata fields).
|
|
58
|
+
*
|
|
59
|
+
* Every other business column — including D42 approval stamp columns and any newly added schema column —
|
|
60
|
+
* is governed by default.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CONCEPT_UNGOVERNED_EXCLUSIONS: readonly ["Status"];
|
|
63
|
+
/**
|
|
64
|
+
* Returns `true` when `fieldName` is a governed business column on `MJ: Graph Concepts`.
|
|
65
|
+
* Only columns in {@link CONCEPT_UNGOVERNED_EXCLUSIONS} and `__mj*` system audit columns are exempt;
|
|
66
|
+
* every other column is governed.
|
|
67
|
+
*/
|
|
68
|
+
export declare function IsGovernedConceptFieldName(fieldName: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Minimal field-state projection inspected by {@link HasGovernedConceptFieldChanges}.
|
|
71
|
+
*/
|
|
72
|
+
export interface ConceptFieldStateView {
|
|
73
|
+
readonly Name: string;
|
|
74
|
+
readonly Dirty: boolean;
|
|
75
|
+
readonly IsPrimaryKey?: boolean;
|
|
76
|
+
readonly ReadOnly?: boolean;
|
|
77
|
+
readonly EntityFieldInfo?: {
|
|
78
|
+
readonly IsVirtual?: boolean;
|
|
79
|
+
} | null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Minimal entity surface inspected by {@link HasGovernedConceptFieldChanges}.
|
|
83
|
+
*/
|
|
84
|
+
export interface GovernedConceptFieldTarget {
|
|
85
|
+
readonly IsSaved: boolean;
|
|
86
|
+
readonly Fields: ReadonlyArray<ConceptFieldStateView>;
|
|
87
|
+
readonly TransactionGroup?: {
|
|
88
|
+
readonly Variables: ReadonlyArray<{
|
|
89
|
+
readonly EntityObject: object;
|
|
90
|
+
readonly Type: string;
|
|
91
|
+
readonly FieldName: string;
|
|
92
|
+
}>;
|
|
93
|
+
} | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* True when an update to an existing concept dirties any updatable non-`Status`, non-`__mj*`
|
|
97
|
+
* column, or targets one via a `'Use'` transaction variable.
|
|
98
|
+
*/
|
|
99
|
+
export declare function HasGovernedConceptFieldChanges(target: GovernedConceptFieldTarget): boolean;
|
|
8
100
|
/**
|
|
9
101
|
* Inputs to {@link EvaluateGraphConceptApproval}: what is being saved on `MJ: Graph Concepts`,
|
|
10
102
|
* prior stored state, caller, and the authorizations held by the caller's provider.
|
|
@@ -16,7 +108,7 @@ export interface GraphConceptApprovalInput {
|
|
|
16
108
|
readonly PreviousStatus: MJGraphConceptEntity['Status'] | null | undefined;
|
|
17
109
|
/** The `Status` being saved. */
|
|
18
110
|
readonly NextStatus: MJGraphConceptEntity['Status'] | null | undefined;
|
|
19
|
-
/** `true` when an update dirties any
|
|
111
|
+
/** `true` when an update dirties any governed (non-`Status`, non-`__mj*`) business column. */
|
|
20
112
|
readonly GovernedFieldsChanged: boolean;
|
|
21
113
|
/** `true` when `'Status'` or `'ID'` is targeted by a `'Use'` transaction variable (applied after `ValidateAsync`). */
|
|
22
114
|
readonly StatusOrIdSetByVariable?: boolean;
|
|
@@ -33,9 +125,12 @@ export interface GraphConceptApprovalInput {
|
|
|
33
125
|
* authorize:
|
|
34
126
|
* - binding `'Status'` or `'ID'` via a `'Use'` transaction variable (applied after `ValidateAsync` runs);
|
|
35
127
|
* - creating a concept whose `Status` does not start `Draft` or `Proposed` (null/undefined uses the
|
|
36
|
-
* database column default `'Draft'`, so those stay ungated; `'
|
|
37
|
-
*
|
|
38
|
-
* -
|
|
128
|
+
* database column default `'Draft'`, so those stay ungated; `'Provisional'`, `'Approved'`, and
|
|
129
|
+
* `'Deprecated'` require it);
|
|
130
|
+
* - changing `Status` into or out of `'Provisional'`, `'Approved'`, or `'Deprecated'` (only
|
|
131
|
+
* `Draft <-> Proposed` stays ungated);
|
|
132
|
+
* - editing any governed field on a concept whose status is `'Provisional'`, `'Approved'`, or
|
|
133
|
+
* `'Deprecated'`.
|
|
39
134
|
*
|
|
40
135
|
* Fails closed when `IsSaved` is `true` and `PreviousStatus` is unknown.
|
|
41
136
|
*/
|
|
@@ -51,42 +146,99 @@ export declare function IsPipelinePolicyApprovedConceptCreate(input: GraphConcep
|
|
|
51
146
|
* governed concepts (see {@link GraphConceptSaveNeedsApproval}).
|
|
52
147
|
*/
|
|
53
148
|
export declare function EvaluateGraphConceptApproval(input: GraphConceptApprovalInput): ValidationErrorInfo | null;
|
|
149
|
+
/**
|
|
150
|
+
* Pipeline evidence-retraction context supplied to {@link GraphConceptDeleteRefusal}.
|
|
151
|
+
*/
|
|
152
|
+
export interface GraphConceptPipelineRetractionContext {
|
|
153
|
+
readonly InScope: boolean;
|
|
154
|
+
readonly Origin: MJGraphConceptEntity['Origin'] | null | undefined;
|
|
155
|
+
}
|
|
54
156
|
/**
|
|
55
157
|
* Refusal message for deleting an `MJ: Graph Concepts` row whose stored `Status` is `storedStatus`,
|
|
56
|
-
* or `null` when allowed.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
158
|
+
* or `null` when allowed.
|
|
159
|
+
*
|
|
160
|
+
* - `'Draft'` and `'Proposed'` concepts may be deleted without `Graph: Approve Edges`.
|
|
161
|
+
* - Pipeline-originated (`Origin === 'Inferred'`) concepts whose stored status is not `'Deprecated'`,
|
|
162
|
+
* not `'Rejected'`, and not unknown (`null`/`undefined`) may be deleted without `Graph: Approve Edges`
|
|
163
|
+
* only inside {@link GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION} (`pipelineRetraction.InScope === true`).
|
|
164
|
+
* - `'Deprecated'` and `'Rejected'` tombstones (D68) and all curated (`'Declared'`) or unknown-status /
|
|
165
|
+
* unknown-origin concepts require `Graph: Approve Edges` (keeping `'Deprecated'` and `'Rejected'`
|
|
166
|
+
* tombstones intact so rejected concepts remain suppressed across re-runs).
|
|
59
167
|
*/
|
|
60
|
-
export declare function GraphConceptDeleteRefusal(storedStatus: MJGraphConceptEntity['Status'] | null | undefined, user: UserInfo | undefined, authorizations: AuthorizationInfo[] | undefined): string | null;
|
|
168
|
+
export declare function GraphConceptDeleteRefusal(storedStatus: MJGraphConceptEntity['Status'] | null | undefined, user: UserInfo | undefined, authorizations: AuthorizationInfo[] | undefined, pipelineRetraction?: GraphConceptPipelineRetractionContext): string | null;
|
|
61
169
|
/**
|
|
62
170
|
* True while the current async call chain is inside {@link GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION}
|
|
63
171
|
* scoped to `'MJ: Graph Concepts'` for `user`. Client CRUD boundaries mask every outer scope.
|
|
64
172
|
*/
|
|
65
173
|
export declare function IsInGraphConceptPipelineApprovalScope(user: UserInfo | undefined): boolean;
|
|
66
174
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
175
|
+
* True while the current async call chain is inside {@link GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION}
|
|
176
|
+
* scoped to `'MJ: Graph Concepts'` for `user`. Client CRUD boundaries mask every outer scope.
|
|
177
|
+
*/
|
|
178
|
+
export declare function IsInGraphConceptPipelineRetractionScope(user: UserInfo | undefined): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Server-side `MJ: Graph Concepts` entity enforcing Workstream 5a & D18/D19 governance:
|
|
181
|
+
* - Creating an `Approved`, `Deprecated`, or `Provisional` concept, transitioning into/out of
|
|
182
|
+
* those statuses, editing any non-`Status`, non-`__mj*` business column on an `Approved`,
|
|
183
|
+
* `Deprecated`, or `Provisional` concept, or deleting a governed concept requires
|
|
184
|
+
* `Graph: Approve Edges` ({@link EvaluateGraphConceptApproval}, {@link GraphConceptDeleteRefusal});
|
|
72
185
|
* - The Content Pipeline `Graph` stage (`EntityGraphOverlayStore.UpsertConcept`) is permitted to
|
|
73
186
|
* create new policy-approved concepts inside {@link GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION}
|
|
74
187
|
* ({@link IsPipelinePolicyApprovedConceptCreate}), while never editing or deprecating existing
|
|
75
|
-
* governed concepts
|
|
188
|
+
* governed concepts;
|
|
189
|
+
* - The Content Pipeline evidence retractor (`GraphEvidenceRetractor`) is permitted to delete an
|
|
190
|
+
* `Inferred` (non-`Deprecated`) concept inside {@link GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION},
|
|
191
|
+
* while curated (`Declared`) `Approved`/`Provisional`/`Deprecated` concepts remain protected.
|
|
76
192
|
*/
|
|
77
193
|
export declare class MJGraphConceptEntityServer extends MJGraphConceptEntity {
|
|
194
|
+
private _serverStampedApproval;
|
|
78
195
|
get DefaultSkipAsyncValidation(): boolean;
|
|
196
|
+
Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
|
|
197
|
+
InnerLoad(compositeKey: CompositeKey, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
|
|
198
|
+
NewRecord(newValues?: FieldValueCollection): boolean;
|
|
79
199
|
ValidateAsync(): Promise<ValidationResult>;
|
|
80
|
-
/** Enforces the same governance gate when `ReplayOnly` or `SkipAsyncValidation` would skip `ValidateAsync`. */
|
|
200
|
+
/** Enforces the same governance gate and D42 stamp lifecycle when `ReplayOnly` or `SkipAsyncValidation` would skip `ValidateAsync`. */
|
|
81
201
|
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
202
|
+
private hasVectorSyncRelevantChanges;
|
|
203
|
+
private invokeVectorSyncHook;
|
|
204
|
+
private invokeVectorDeleteHook;
|
|
205
|
+
/**
|
|
206
|
+
* Evaluates whether this concept record may be deleted in the current caller and operation
|
|
207
|
+
* scope without mutating or deleting anything. Saved records read persisted `Status` and
|
|
208
|
+
* `Origin` (`OldValue`) and never trust in-memory mutations.
|
|
209
|
+
*/
|
|
210
|
+
CheckDeleteRefusal(): string | null;
|
|
82
211
|
/**
|
|
83
|
-
*
|
|
84
|
-
* `
|
|
85
|
-
|
|
212
|
+
* Async variant of {@link CheckDeleteRefusal} that also evaluates per-graph `Approve` and `Use`
|
|
213
|
+
* permissions via `MJ: Graph Permissions` (D3 / 5b).
|
|
214
|
+
*/
|
|
215
|
+
CheckDeleteRefusalAsync(): Promise<string | null>;
|
|
216
|
+
/**
|
|
217
|
+
* Refuses deleting an `Approved`, `Deprecated`, `Provisional`, or unknown/unloaded stored-status
|
|
218
|
+
* concept without `Graph: Approve Edges` or per-graph `Approve` permission, except an `Inferred`
|
|
219
|
+
* non-`Deprecated` concept deleted inside {@link GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION}.
|
|
220
|
+
* Saved records read stored `Status`, `Origin`, and `GraphID` (`OldValue`) and never fall back
|
|
221
|
+
* to in-memory property values.
|
|
86
222
|
*/
|
|
87
223
|
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
88
|
-
private
|
|
224
|
+
private affectedGraphIds;
|
|
225
|
+
private storedGraphId;
|
|
226
|
+
private evaluateApprovalErrorAsync;
|
|
227
|
+
private evaluateUseAccessErrorAsync;
|
|
89
228
|
private refuseOperation;
|
|
90
229
|
private previousStatus;
|
|
230
|
+
private evaluateClientApprovalStampError;
|
|
231
|
+
private matchesLastServerStamp;
|
|
232
|
+
private clientStampError;
|
|
233
|
+
/**
|
|
234
|
+
* Applies D42 approval stamp lifecycle rules after validation passes:
|
|
235
|
+
* - Entering `Approved` or `Provisional` (or editing governed fields on one as a person):
|
|
236
|
+
* stamps `ApprovalMode = 'Policy'` (pipeline policy create) or `'Person'` (authorized human)
|
|
237
|
+
* along with `ApprovedByUserID` (null when non-human) and `ApprovedAt`.
|
|
238
|
+
* - Leaving `Approved` or `Provisional` (e.g. `Draft`, `Proposed`, `Deprecated`):
|
|
239
|
+
* clears all three columns to `null`.
|
|
240
|
+
*/
|
|
241
|
+
private applyServerApprovalStamp;
|
|
242
|
+
private previousOrigin;
|
|
91
243
|
}
|
|
92
244
|
//# sourceMappingURL=MJGraphConceptEntityServer.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJGraphConceptEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJGraphConceptEntityServer.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MJGraphConceptEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJGraphConceptEntityServer.server.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iBAAiB,EAGjB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAIjB,QAAQ,EACR,mBAAmB,EAEnB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;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