@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.
Files changed (171) hide show
  1. package/README.md +13 -0
  2. package/dist/custom/ArtifactSecurityHookHelpers.d.ts.map +1 -1
  3. package/dist/custom/ArtifactSecurityHookHelpers.js +50 -0
  4. package/dist/custom/ArtifactSecurityHookHelpers.js.map +1 -1
  5. package/dist/custom/GraphConceptReadSecurityHook.d.ts +75 -0
  6. package/dist/custom/GraphConceptReadSecurityHook.d.ts.map +1 -0
  7. package/dist/custom/GraphConceptReadSecurityHook.js +574 -0
  8. package/dist/custom/GraphConceptReadSecurityHook.js.map +1 -0
  9. package/dist/custom/GraphRecordChangesReadSecurityHook.d.ts +45 -0
  10. package/dist/custom/GraphRecordChangesReadSecurityHook.d.ts.map +1 -0
  11. package/dist/custom/GraphRecordChangesReadSecurityHook.js +744 -0
  12. package/dist/custom/GraphRecordChangesReadSecurityHook.js.map +1 -0
  13. package/dist/custom/MJAIAgentActionEntityServer.server.d.ts +13 -0
  14. package/dist/custom/MJAIAgentActionEntityServer.server.d.ts.map +1 -0
  15. package/dist/custom/MJAIAgentActionEntityServer.server.js +52 -0
  16. package/dist/custom/MJAIAgentActionEntityServer.server.js.map +1 -0
  17. package/dist/custom/MJAIAgentCategoryEntityServer.server.d.ts +30 -0
  18. package/dist/custom/MJAIAgentCategoryEntityServer.server.d.ts.map +1 -0
  19. package/dist/custom/MJAIAgentCategoryEntityServer.server.js +127 -0
  20. package/dist/custom/MJAIAgentCategoryEntityServer.server.js.map +1 -0
  21. package/dist/custom/MJAIAgentClientToolEntityServer.server.d.ts +12 -0
  22. package/dist/custom/MJAIAgentClientToolEntityServer.server.d.ts.map +1 -0
  23. package/dist/custom/MJAIAgentClientToolEntityServer.server.js +46 -0
  24. package/dist/custom/MJAIAgentClientToolEntityServer.server.js.map +1 -0
  25. package/dist/custom/MJAIAgentEntityServer.server.d.ts +113 -7
  26. package/dist/custom/MJAIAgentEntityServer.server.d.ts.map +1 -1
  27. package/dist/custom/MJAIAgentEntityServer.server.js +1946 -96
  28. package/dist/custom/MJAIAgentEntityServer.server.js.map +1 -1
  29. package/dist/custom/MJAIAgentModalityEntityServer.server.d.ts +13 -0
  30. package/dist/custom/MJAIAgentModalityEntityServer.server.d.ts.map +1 -0
  31. package/dist/custom/MJAIAgentModalityEntityServer.server.js +52 -0
  32. package/dist/custom/MJAIAgentModalityEntityServer.server.js.map +1 -0
  33. package/dist/custom/MJAIAgentNoteEntityServer.server.d.ts +64 -8
  34. package/dist/custom/MJAIAgentNoteEntityServer.server.d.ts.map +1 -1
  35. package/dist/custom/MJAIAgentNoteEntityServer.server.js +263 -9
  36. package/dist/custom/MJAIAgentNoteEntityServer.server.js.map +1 -1
  37. package/dist/custom/MJAIAgentPersonaEntityServer.server.d.ts +2 -2
  38. package/dist/custom/MJAIAgentPersonaEntityServer.server.d.ts.map +1 -1
  39. package/dist/custom/MJAIAgentPersonaEntityServer.server.js +10 -8
  40. package/dist/custom/MJAIAgentPersonaEntityServer.server.js.map +1 -1
  41. package/dist/custom/MJAIAgentRelationshipEntityServer.server.d.ts +5 -2
  42. package/dist/custom/MJAIAgentRelationshipEntityServer.server.d.ts.map +1 -1
  43. package/dist/custom/MJAIAgentRelationshipEntityServer.server.js +25 -2
  44. package/dist/custom/MJAIAgentRelationshipEntityServer.server.js.map +1 -1
  45. package/dist/custom/MJAIAgentSkillEntityServer.server.d.ts +12 -0
  46. package/dist/custom/MJAIAgentSkillEntityServer.server.d.ts.map +1 -0
  47. package/dist/custom/MJAIAgentSkillEntityServer.server.js +46 -0
  48. package/dist/custom/MJAIAgentSkillEntityServer.server.js.map +1 -0
  49. package/dist/custom/MJAIAgentStepTypeEntityServer.server.d.ts +28 -0
  50. package/dist/custom/MJAIAgentStepTypeEntityServer.server.d.ts.map +1 -0
  51. package/dist/custom/MJAIAgentStepTypeEntityServer.server.js +117 -0
  52. package/dist/custom/MJAIAgentStepTypeEntityServer.server.js.map +1 -0
  53. package/dist/custom/MJAIAgentTypeEntityServer.server.d.ts +34 -0
  54. package/dist/custom/MJAIAgentTypeEntityServer.server.d.ts.map +1 -0
  55. package/dist/custom/MJAIAgentTypeEntityServer.server.js +231 -0
  56. package/dist/custom/MJAIAgentTypeEntityServer.server.js.map +1 -0
  57. package/dist/custom/MJActionEntityServer.server.d.ts +37 -0
  58. package/dist/custom/MJActionEntityServer.server.d.ts.map +1 -1
  59. package/dist/custom/MJActionEntityServer.server.js +208 -3
  60. package/dist/custom/MJActionEntityServer.server.js.map +1 -1
  61. package/dist/custom/MJComponentEntityServer.server.d.ts +6 -0
  62. package/dist/custom/MJComponentEntityServer.server.d.ts.map +1 -1
  63. package/dist/custom/MJComponentEntityServer.server.js +20 -2
  64. package/dist/custom/MJComponentEntityServer.server.js.map +1 -1
  65. package/dist/custom/MJContentSourceEntityServer.server.d.ts +28 -0
  66. package/dist/custom/MJContentSourceEntityServer.server.d.ts.map +1 -0
  67. package/dist/custom/MJContentSourceEntityServer.server.js +73 -0
  68. package/dist/custom/MJContentSourceEntityServer.server.js.map +1 -0
  69. package/dist/custom/MJContentSourceTypeEntityServer.server.d.ts +25 -0
  70. package/dist/custom/MJContentSourceTypeEntityServer.server.d.ts.map +1 -0
  71. package/dist/custom/MJContentSourceTypeEntityServer.server.js +73 -0
  72. package/dist/custom/MJContentSourceTypeEntityServer.server.js.map +1 -0
  73. package/dist/custom/MJDashboardEntityServer.server.d.ts +6 -0
  74. package/dist/custom/MJDashboardEntityServer.server.d.ts.map +1 -1
  75. package/dist/custom/MJDashboardEntityServer.server.js +24 -2
  76. package/dist/custom/MJDashboardEntityServer.server.js.map +1 -1
  77. package/dist/custom/MJGraphConceptEntityServer.server.d.ts +175 -23
  78. package/dist/custom/MJGraphConceptEntityServer.server.d.ts.map +1 -1
  79. package/dist/custom/MJGraphConceptEntityServer.server.js +584 -41
  80. package/dist/custom/MJGraphConceptEntityServer.server.js.map +1 -1
  81. package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +38 -11
  82. package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -1
  83. package/dist/custom/MJGraphEdgeEntityServer.server.js +249 -39
  84. package/dist/custom/MJGraphEdgeEntityServer.server.js.map +1 -1
  85. package/dist/custom/MJGraphEntityServer.server.d.ts +58 -0
  86. package/dist/custom/MJGraphEntityServer.server.d.ts.map +1 -0
  87. package/dist/custom/MJGraphEntityServer.server.js +357 -0
  88. package/dist/custom/MJGraphEntityServer.server.js.map +1 -0
  89. package/dist/custom/MJGraphLinkEntityServer.server.d.ts +98 -0
  90. package/dist/custom/MJGraphLinkEntityServer.server.d.ts.map +1 -0
  91. package/dist/custom/MJGraphLinkEntityServer.server.js +375 -0
  92. package/dist/custom/MJGraphLinkEntityServer.server.js.map +1 -0
  93. package/dist/custom/MJGraphPermissionEntityServer.server.d.ts +29 -0
  94. package/dist/custom/MJGraphPermissionEntityServer.server.d.ts.map +1 -0
  95. package/dist/custom/MJGraphPermissionEntityServer.server.js +141 -0
  96. package/dist/custom/MJGraphPermissionEntityServer.server.js.map +1 -0
  97. package/dist/custom/MJListDetailEntityServer.server.d.ts +4 -4
  98. package/dist/custom/MJListDetailEntityServer.server.js +4 -4
  99. package/dist/custom/MJListEntityServer.server.d.ts +2 -1
  100. package/dist/custom/MJListEntityServer.server.d.ts.map +1 -1
  101. package/dist/custom/MJListEntityServer.server.js +5 -2
  102. package/dist/custom/MJListEntityServer.server.js.map +1 -1
  103. package/dist/custom/MJQueryEntityServer.server.d.ts +51 -3
  104. package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
  105. package/dist/custom/MJQueryEntityServer.server.js +142 -28
  106. package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
  107. package/dist/custom/MJQueryParameterEntityServer.server.d.ts +37 -0
  108. package/dist/custom/MJQueryParameterEntityServer.server.d.ts.map +1 -0
  109. package/dist/custom/MJQueryParameterEntityServer.server.js +160 -0
  110. package/dist/custom/MJQueryParameterEntityServer.server.js.map +1 -0
  111. package/dist/custom/MJQuerySQLEntityServer.server.d.ts +23 -0
  112. package/dist/custom/MJQuerySQLEntityServer.server.d.ts.map +1 -1
  113. package/dist/custom/MJQuerySQLEntityServer.server.js +106 -9
  114. package/dist/custom/MJQuerySQLEntityServer.server.js.map +1 -1
  115. package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.d.ts +1 -1
  116. package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.d.ts.map +1 -1
  117. package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.js +8 -5
  118. package/dist/custom/MJRowLevelSecurityFilterEntityServer.server.js.map +1 -1
  119. package/dist/custom/MJUserRoleEntityServer.server.d.ts.map +1 -1
  120. package/dist/custom/MJUserRoleEntityServer.server.js +9 -0
  121. package/dist/custom/MJUserRoleEntityServer.server.js.map +1 -1
  122. package/dist/custom/MJUserViewEntityServer.server.d.ts +9 -0
  123. package/dist/custom/MJUserViewEntityServer.server.d.ts.map +1 -1
  124. package/dist/custom/MJUserViewEntityServer.server.js +59 -3
  125. package/dist/custom/MJUserViewEntityServer.server.js.map +1 -1
  126. package/dist/custom/agentRelationalGrantGuard.d.ts +73 -0
  127. package/dist/custom/agentRelationalGrantGuard.d.ts.map +1 -0
  128. package/dist/custom/agentRelationalGrantGuard.js +375 -0
  129. package/dist/custom/agentRelationalGrantGuard.js.map +1 -0
  130. package/dist/custom/approvalStamp.d.ts +68 -4
  131. package/dist/custom/approvalStamp.d.ts.map +1 -1
  132. package/dist/custom/approvalStamp.js +107 -13
  133. package/dist/custom/approvalStamp.js.map +1 -1
  134. package/dist/custom/canon/CanonFingerprintRecorderServer.d.ts +20 -0
  135. package/dist/custom/canon/CanonFingerprintRecorderServer.d.ts.map +1 -0
  136. package/dist/custom/canon/CanonFingerprintRecorderServer.js +148 -0
  137. package/dist/custom/canon/CanonFingerprintRecorderServer.js.map +1 -0
  138. package/dist/custom/canon/index.d.ts +2 -0
  139. package/dist/custom/canon/index.d.ts.map +1 -0
  140. package/dist/custom/canon/index.js +2 -0
  141. package/dist/custom/canon/index.js.map +1 -0
  142. package/dist/custom/graph/GraphFindPathServerOperation.d.ts +7 -5
  143. package/dist/custom/graph/GraphFindPathServerOperation.d.ts.map +1 -1
  144. package/dist/custom/graph/GraphFindPathServerOperation.js +41 -12
  145. package/dist/custom/graph/GraphFindPathServerOperation.js.map +1 -1
  146. package/dist/custom/graphPermissionGuard.d.ts +69 -0
  147. package/dist/custom/graphPermissionGuard.d.ts.map +1 -0
  148. package/dist/custom/graphPermissionGuard.js +229 -0
  149. package/dist/custom/graphPermissionGuard.js.map +1 -0
  150. package/dist/custom/graphRlsCacheInvalidation.d.ts +38 -0
  151. package/dist/custom/graphRlsCacheInvalidation.d.ts.map +1 -0
  152. package/dist/custom/graphRlsCacheInvalidation.js +111 -0
  153. package/dist/custom/graphRlsCacheInvalidation.js.map +1 -0
  154. package/dist/custom/queryParentFingerprint.d.ts +36 -0
  155. package/dist/custom/queryParentFingerprint.d.ts.map +1 -0
  156. package/dist/custom/queryParentFingerprint.js +159 -0
  157. package/dist/custom/queryParentFingerprint.js.map +1 -0
  158. package/dist/custom/queryParentSaveChain.d.ts +5 -0
  159. package/dist/custom/queryParentSaveChain.d.ts.map +1 -0
  160. package/dist/custom/queryParentSaveChain.js +25 -0
  161. package/dist/custom/queryParentSaveChain.js.map +1 -0
  162. package/dist/custom/seededMetadataPush.d.ts +7 -0
  163. package/dist/custom/seededMetadataPush.d.ts.map +1 -0
  164. package/dist/custom/seededMetadataPush.js +23 -0
  165. package/dist/custom/seededMetadataPush.js.map +1 -0
  166. package/dist/index.d.ts +19 -0
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js +19 -0
  169. package/dist/index.js.map +1 -1
  170. package/dist/tsconfig.tsbuildinfo +1 -1
  171. 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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D,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAG,+BAA+B,CAAC,IAAI,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACpB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,CAAC,IAAI,CACP,IAAI,mBAAmB,CACnB,eAAe,EACf,GAAG,OAAO,gFAAgF,EAC1F,aAAa,EACb,mBAAmB,CAAC,OAAO,CAC9B,CACJ,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;GAIG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,yBAAyB;IAC1D,QAAQ;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,2BAA2B,GAC7B,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;QAC1E,IAAI,2BAA2B,EAAE,CAAC;YAC9B,MAAM,WAAW,GAAG,2CAA2C,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACpF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;gBACnC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;YAC3B,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAdY,+BAA+B;IAD3C,aAAa,CAAC,UAAU,EAAE,0BAA0B,CAAC;GACzC,+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,EAAE,MAAM,+BAA+B,CAAC;AAG5G;;;;;;;GAOG;AACH,qBACa,uBAAwB,SAAQ,yBAAyB;IAC5C,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAY5E"}
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
- if (!options?.ReplayOnly && await ApplyApprovalRulesAsync(this, 'ApprovalStatus', this.ApprovalStatus)) {
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,EAAE,MAAM,+BAA+B,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEjF;;;;;;;GAOG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,yBAAyB;IAClD,KAAK,CAAC,IAAI,CAAC,OAA2B;QAClD,IAAI,CAAC;YACD,2GAA2G;YAC3G,IAAI,CAAC,OAAO,EAAE,UAAU,IAAI,MAAM,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;gBACrG,IAAI,CAAC,mBAAmB,GAAG,MAAM,gCAAgC,CAAC,IAAI,CAAC,CAAC;YAC5E,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAChE,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACJ,CAAA;AAbY,uBAAuB;IADnC,aAAa,CAAC,UAAU,EAAE,gBAAgB,CAAC;GAC/B,uBAAuB,CAanC"}
1
+ {"version":3,"file":"MJDashboardEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/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MAAM,CAAC,IAAI,IAAI,IAAI;wBACzB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI;qBAC1C,CAAC;iBACT,CACJ,CAAC;YACN,IAAI,SAAS,EAAE,CAAC;gBACZ,IAAI,CAAC,mBAAmB,GAAG,MAAM,gCAAgC,CAAC,IAAI,CAAC,CAAC;YAC5E,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAChE,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;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
- * Columns whose change on an `Approved` or `Deprecated` `MJ: Graph Concepts` row alters governed
5
- * canon definition, classification, authority, synonyms, hierarchy, or owning graph.
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 CONCEPT_GOVERNED_FIELDS: readonly ["GraphID", "ParentID", "Name", "ConceptTypeID", "AuthorityTierID", "Description", "Specification", "Synonyms"];
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 column listed in {@link CONCEPT_GOVERNED_FIELDS}. */
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; `'Approved'` and `'Deprecated'` require it);
37
- * - changing `Status` into or out of `'Approved'` or `'Deprecated'` (only `Draft <-> Proposed` stays ungated);
38
- * - editing any governed field on a concept whose status is `'Approved'` or `'Deprecated'`.
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. Only `'Draft'` and `'Proposed'` concepts may be deleted without
57
- * `Graph: Approve Edges` (keeping `'Deprecated'` tombstones intact so rejected names remain
58
- * skipped by proposers).
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
- * Server-side `MJ: Graph Concepts` entity enforcing Workstream 5a governance:
68
- * - Creating an `Approved` or `Deprecated` concept, approving/deprecating a concept, editing a
69
- * governed field on an `Approved`/`Deprecated` concept, or deleting an `Approved`/`Deprecated`
70
- * concept requires `Graph: Approve Edges` ({@link EvaluateGraphConceptApproval},
71
- * {@link GraphConceptDeleteRefusal});
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
- * Refuses deleting an `Approved`, `Deprecated`, or unknown/unloaded stored-status concept without
84
- * `Graph: Approve Edges`. Saved records read stored `Status` (`OldValue`) and never fall back to
85
- * in-memory `Status`.
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 evaluateApprovalError;
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":"AAAA,OAAO,EACH,iBAAiB,EAGjB,mBAAmB,EACnB,iBAAiB,EAEjB,QAAQ,EACR,mBAAmB,EAEnB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAGH,oBAAoB,EACvB,MAAM,+BAA+B,CAAC;AAMvC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,0HAS1B,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3E,gCAAgC;IAChC,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACvE,0FAA0F;IAC1F,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,sHAAsH;IACtH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;CAC7C;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAevF;AAED;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAE/F;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,yBAAyB,GAAG,mBAAmB,GAAG,IAAI,CAezG;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACrC,YAAY,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/D,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,cAAc,EAAE,iBAAiB,EAAE,GAAG,SAAS,GAChD,MAAM,GAAG,IAAI,CAUf;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAKzF;AAED;;;;;;;;;;GAUG;AACH,qBACa,0BAA2B,SAAQ,oBAAoB;IAChE,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAEqB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAchE,+GAA+G;IACzF,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzE;;;;OAIG;IACmB,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW7E,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,cAAc;CAUzB"}
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;AAQ9B,OAAO,EAMH,oBAAoB,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