@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.
Files changed (96) hide show
  1. package/README.md +19 -0
  2. package/dist/custom/AnchoredConversationReadSecurityHook.d.ts +0 -14
  3. package/dist/custom/AnchoredConversationReadSecurityHook.d.ts.map +1 -1
  4. package/dist/custom/AnchoredConversationReadSecurityHook.js +27 -2
  5. package/dist/custom/AnchoredConversationReadSecurityHook.js.map +1 -1
  6. package/dist/custom/ConversationAndCommentDrivers.d.ts +82 -0
  7. package/dist/custom/ConversationAndCommentDrivers.d.ts.map +1 -0
  8. package/dist/custom/ConversationAndCommentDrivers.js +543 -0
  9. package/dist/custom/ConversationAndCommentDrivers.js.map +1 -0
  10. package/dist/custom/FieldSuggestionRecordChangeHook.d.ts +17 -0
  11. package/dist/custom/FieldSuggestionRecordChangeHook.d.ts.map +1 -0
  12. package/dist/custom/FieldSuggestionRecordChangeHook.js +142 -0
  13. package/dist/custom/FieldSuggestionRecordChangeHook.js.map +1 -0
  14. package/dist/custom/MJAIAgentUserPolicyEntityServer.server.d.ts +11 -0
  15. package/dist/custom/MJAIAgentUserPolicyEntityServer.server.d.ts.map +1 -1
  16. package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js +41 -0
  17. package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js.map +1 -1
  18. package/dist/custom/MJAIPromptRunEntityServer.server.d.ts +21 -0
  19. package/dist/custom/MJAIPromptRunEntityServer.server.d.ts.map +1 -1
  20. package/dist/custom/MJAIPromptRunEntityServer.server.js +76 -5
  21. package/dist/custom/MJAIPromptRunEntityServer.server.js.map +1 -1
  22. package/dist/custom/MJCommentEntityServer.server.d.ts +19 -0
  23. package/dist/custom/MJCommentEntityServer.server.d.ts.map +1 -0
  24. package/dist/custom/MJCommentEntityServer.server.js +137 -0
  25. package/dist/custom/MJCommentEntityServer.server.js.map +1 -0
  26. package/dist/custom/MJConversationEntityServer.server.d.ts.map +1 -1
  27. package/dist/custom/MJConversationEntityServer.server.js +16 -1
  28. package/dist/custom/MJConversationEntityServer.server.js.map +1 -1
  29. package/dist/custom/MJFieldSuggestionEntityServer.server.d.ts +29 -0
  30. package/dist/custom/MJFieldSuggestionEntityServer.server.d.ts.map +1 -0
  31. package/dist/custom/MJFieldSuggestionEntityServer.server.js +249 -0
  32. package/dist/custom/MJFieldSuggestionEntityServer.server.js.map +1 -0
  33. package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +197 -0
  34. package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -0
  35. package/dist/custom/MJGraphEdgeEntityServer.server.js +459 -0
  36. package/dist/custom/MJGraphEdgeEntityServer.server.js.map +1 -0
  37. package/dist/custom/MJGraphEdgeProviderEntityServer.server.d.ts +22 -0
  38. package/dist/custom/MJGraphEdgeProviderEntityServer.server.d.ts.map +1 -0
  39. package/dist/custom/MJGraphEdgeProviderEntityServer.server.js +85 -0
  40. package/dist/custom/MJGraphEdgeProviderEntityServer.server.js.map +1 -0
  41. package/dist/custom/MJGraphEdgeTypeEntityServer.server.d.ts +21 -0
  42. package/dist/custom/MJGraphEdgeTypeEntityServer.server.d.ts.map +1 -0
  43. package/dist/custom/MJGraphEdgeTypeEntityServer.server.js +88 -0
  44. package/dist/custom/MJGraphEdgeTypeEntityServer.server.js.map +1 -0
  45. package/dist/custom/MJMLEvaluationProtocolEntityServer.server.d.ts +39 -0
  46. package/dist/custom/MJMLEvaluationProtocolEntityServer.server.d.ts.map +1 -0
  47. package/dist/custom/MJMLEvaluationProtocolEntityServer.server.js +124 -0
  48. package/dist/custom/MJMLEvaluationProtocolEntityServer.server.js.map +1 -0
  49. package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts +124 -0
  50. package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts.map +1 -0
  51. package/dist/custom/MJMLPredictionUnitEntityServer.server.js +214 -0
  52. package/dist/custom/MJMLPredictionUnitEntityServer.server.js.map +1 -0
  53. package/dist/custom/MJMLTrainingPipelineEntityServer.server.d.ts +101 -1
  54. package/dist/custom/MJMLTrainingPipelineEntityServer.server.d.ts.map +1 -1
  55. package/dist/custom/MJMLTrainingPipelineEntityServer.server.js +266 -12
  56. package/dist/custom/MJMLTrainingPipelineEntityServer.server.js.map +1 -1
  57. package/dist/custom/MJMLTrainingSnapshotEntityServer.server.d.ts +14 -0
  58. package/dist/custom/MJMLTrainingSnapshotEntityServer.server.d.ts.map +1 -0
  59. package/dist/custom/MJMLTrainingSnapshotEntityServer.server.js +42 -0
  60. package/dist/custom/MJMLTrainingSnapshotEntityServer.server.js.map +1 -0
  61. package/dist/custom/MJQueryEntityServer.server.d.ts +2 -2
  62. package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
  63. package/dist/custom/MJQueryEntityServer.server.js +7 -5
  64. package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
  65. package/dist/custom/MJTaskDependencyEntityServer.server.d.ts +24 -0
  66. package/dist/custom/MJTaskDependencyEntityServer.server.d.ts.map +1 -0
  67. package/dist/custom/MJTaskDependencyEntityServer.server.js +75 -0
  68. package/dist/custom/MJTaskDependencyEntityServer.server.js.map +1 -0
  69. package/dist/custom/MJTaskEntityServer.server.d.ts +148 -0
  70. package/dist/custom/MJTaskEntityServer.server.d.ts.map +1 -0
  71. package/dist/custom/MJTaskEntityServer.server.js +413 -0
  72. package/dist/custom/MJTaskEntityServer.server.js.map +1 -0
  73. package/dist/custom/query-extraction/childRowWriter.d.ts +2 -2
  74. package/dist/custom/query-extraction/childRowWriter.d.ts.map +1 -1
  75. package/dist/custom/query-extraction/childRowWriter.js +7 -2
  76. package/dist/custom/query-extraction/childRowWriter.js.map +1 -1
  77. package/dist/custom/query-extraction/describeFacts.d.ts +2 -0
  78. package/dist/custom/query-extraction/describeFacts.d.ts.map +1 -1
  79. package/dist/custom/query-extraction/describeFacts.js +17 -10
  80. package/dist/custom/query-extraction/describeFacts.js.map +1 -1
  81. package/dist/custom/query-extraction/descriptionPass.d.ts.map +1 -1
  82. package/dist/custom/query-extraction/descriptionPass.js +4 -1
  83. package/dist/custom/query-extraction/descriptionPass.js.map +1 -1
  84. package/dist/custom/query-extraction/extractQuery.js +5 -3
  85. package/dist/custom/query-extraction/extractQuery.js.map +1 -1
  86. package/dist/custom/query-extraction/extractionTypes.d.ts +5 -0
  87. package/dist/custom/query-extraction/extractionTypes.d.ts.map +1 -1
  88. package/dist/custom/sessionConfigGuard.d.ts +7 -0
  89. package/dist/custom/sessionConfigGuard.d.ts.map +1 -1
  90. package/dist/custom/sessionConfigGuard.js +13 -1
  91. package/dist/custom/sessionConfigGuard.js.map +1 -1
  92. package/dist/index.d.ts +12 -0
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +12 -0
  95. package/dist/index.js.map +1 -1
  96. package/package.json +30 -30
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJGraphEdgeEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJGraphEdgeEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEH,UAAU,EACV,gBAAgB,EAGhB,OAAO,EAEP,2BAA2B,EAE3B,mBAAmB,EACnB,mBAAmB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EACH,2BAA2B,EAC3B,kBAAkB,EAClB,sCAAsC,EACtC,WAAW,EACX,mBAAmB,EACnB,iBAAiB,GAGpB,MAAM,+BAA+B,CAAC;AAEvC,oFAAoF;AACpF,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD,6HAA6H;AAC7H,MAAM,CAAC,MAAM,iCAAiC,GAAG,sBAAsB,CAAC;AAExE,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAyBlD;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CAC/C,cAAsB,EACtB,cAA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CAAC,CAC/H,CAAC;IACN,CAAC;IAEO,IAAI,CAAC,MAAwB,EAAE,KAA0B;QAC7D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,eAAe,CAAC,UAAqC;QACzD,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IACtF,CAAC;CACJ,CAAA;AArLY,uBAAuB;IADnC,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC;GAChC,uBAAuB,CAqLnC"}
@@ -0,0 +1,22 @@
1
+ import { ValidationErrorInfo, ValidationResult } from '@memberjunction/core';
2
+ import { MJGraphEdgeProviderEntity } from '@memberjunction/core-entities';
3
+ /**
4
+ * Pure invariant check for `MJGraphEdgeProviderEntity.DriverClass`:
5
+ * must be non-blank and registered on `MJGlobal.Instance.ClassFactory` under `BaseGraphEdgeProvider`.
6
+ */
7
+ export declare function ValidateGraphEdgeProviderDriverClass(driverClass: string | null | undefined, isDriverRegistered?: (driverKey: string) => boolean): ValidationErrorInfo | null;
8
+ /**
9
+ * Pure invariant check for `MJGraphEdgeProviderEntity.Configuration`:
10
+ * when present and non-empty, must be a valid JSON object.
11
+ */
12
+ export declare function ValidateGraphEdgeProviderConfigurationJson(rawConfiguration: string | null | undefined): ValidationErrorInfo | null;
13
+ /**
14
+ * Server-side `MJ: Graph Edge Providers` entity enforcing that:
15
+ * 1. `DriverClass` is registered in `ClassFactory` under `BaseGraphEdgeProvider`
16
+ * 2. `Configuration` (when non-empty) parses as a valid JSON object
17
+ */
18
+ export declare class MJGraphEdgeProviderEntityServer extends MJGraphEdgeProviderEntity {
19
+ get DefaultSkipAsyncValidation(): boolean;
20
+ ValidateAsync(): Promise<ValidationResult>;
21
+ }
22
+ //# sourceMappingURL=MJGraphEdgeProviderEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJGraphEdgeProviderEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJGraphEdgeProviderEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAuB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE9G,OAAO,EAAyB,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAEjG;;;GAGG;AACH,wBAAgB,oCAAoC,CAChD,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,kBAAkB,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OACiD,GAC7F,mBAAmB,GAAG,IAAI,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,0CAA0C,CACtD,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC5C,mBAAmB,GAAG,IAAI,CAyB5B;AAED;;;;GAIG;AACH,qBACa,+BAAgC,SAAQ,yBAAyB;IAC1E,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAEqB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;CA0BnE"}
@@ -0,0 +1,85 @@
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, ValidationErrorInfo, ValidationErrorType } from '@memberjunction/core';
8
+ import { MJGlobal, RegisterClass } from '@memberjunction/global';
9
+ import { BaseGraphEdgeProvider, MJGraphEdgeProviderEntity } from '@memberjunction/core-entities';
10
+ /**
11
+ * Pure invariant check for `MJGraphEdgeProviderEntity.DriverClass`:
12
+ * must be non-blank and registered on `MJGlobal.Instance.ClassFactory` under `BaseGraphEdgeProvider`.
13
+ */
14
+ export function ValidateGraphEdgeProviderDriverClass(driverClass, isDriverRegistered = (driverKey) => MJGlobal.Instance.ClassFactory.GetRegistration(BaseGraphEdgeProvider, driverKey) != null) {
15
+ if (driverClass == null) {
16
+ return null;
17
+ }
18
+ const trimmed = driverClass.trim();
19
+ if (trimmed.length === 0) {
20
+ return new ValidationErrorInfo('DriverClass', 'DriverClass cannot be blank — it must name a registered BaseGraphEdgeProvider subclass.', driverClass, ValidationErrorType.Failure);
21
+ }
22
+ if (!isDriverRegistered(trimmed)) {
23
+ return new ValidationErrorInfo('DriverClass', `DriverClass "${trimmed}" is not registered under BaseGraphEdgeProvider in ClassFactory.`, driverClass, ValidationErrorType.Failure);
24
+ }
25
+ return null;
26
+ }
27
+ /**
28
+ * Pure invariant check for `MJGraphEdgeProviderEntity.Configuration`:
29
+ * when present and non-empty, must be a valid JSON object.
30
+ */
31
+ export function ValidateGraphEdgeProviderConfigurationJson(rawConfiguration) {
32
+ if (rawConfiguration == null || rawConfiguration.trim().length === 0) {
33
+ return null;
34
+ }
35
+ let parsed;
36
+ try {
37
+ parsed = JSON.parse(rawConfiguration);
38
+ }
39
+ catch {
40
+ return new ValidationErrorInfo('Configuration', 'Configuration is not valid JSON.', rawConfiguration, ValidationErrorType.Failure);
41
+ }
42
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
43
+ const kind = parsed === null ? 'null' : Array.isArray(parsed) ? 'array' : typeof parsed;
44
+ return new ValidationErrorInfo('Configuration', `Configuration must be a JSON object (got ${kind}).`, rawConfiguration, ValidationErrorType.Failure);
45
+ }
46
+ return null;
47
+ }
48
+ /**
49
+ * Server-side `MJ: Graph Edge Providers` entity enforcing that:
50
+ * 1. `DriverClass` is registered in `ClassFactory` under `BaseGraphEdgeProvider`
51
+ * 2. `Configuration` (when non-empty) parses as a valid JSON object
52
+ */
53
+ let MJGraphEdgeProviderEntityServer = class MJGraphEdgeProviderEntityServer extends MJGraphEdgeProviderEntity {
54
+ get DefaultSkipAsyncValidation() {
55
+ return false;
56
+ }
57
+ async ValidateAsync() {
58
+ const result = await super.ValidateAsync();
59
+ if (!result.Success) {
60
+ return result;
61
+ }
62
+ const driverDirty = this.GetFieldByName('DriverClass')?.Dirty ?? false;
63
+ if (!this.IsSaved || driverDirty) {
64
+ const driverError = ValidateGraphEdgeProviderDriverClass(this.DriverClass);
65
+ if (driverError) {
66
+ result.Errors.push(driverError);
67
+ result.Success = false;
68
+ }
69
+ }
70
+ const configDirty = this.GetFieldByName('Configuration')?.Dirty ?? false;
71
+ if (!this.IsSaved || configDirty) {
72
+ const configError = ValidateGraphEdgeProviderConfigurationJson(this.Configuration);
73
+ if (configError) {
74
+ result.Errors.push(configError);
75
+ result.Success = false;
76
+ }
77
+ }
78
+ return result;
79
+ }
80
+ };
81
+ MJGraphEdgeProviderEntityServer = __decorate([
82
+ RegisterClass(BaseEntity, 'MJ: Graph Edge Providers')
83
+ ], MJGraphEdgeProviderEntityServer);
84
+ export { MJGraphEdgeProviderEntityServer };
85
+ //# sourceMappingURL=MJGraphEdgeProviderEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJGraphEdgeProviderEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJGraphEdgeProviderEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAoB,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,+B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,WAAW,GAAG,0CAA0C,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACnF,IAAI,WAAW,EAAE,CAAC;gBACd,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAChC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;YAC3B,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA/BY,+BAA+B;IAD3C,aAAa,CAAC,UAAU,EAAE,0BAA0B,CAAC;GACzC,+BAA+B,CA+B3C"}
@@ -0,0 +1,21 @@
1
+ import { ValidationErrorInfo, ValidationResult } from '@memberjunction/core';
2
+ import { MJGraphEdgeTypeEntity } from '@memberjunction/core-entities';
3
+ /**
4
+ * Pure invariant check for `MJ: Graph Edge Types` `(GraphID, Name)` uniqueness,
5
+ * including global (`GraphID === null`) edge types.
6
+ */
7
+ export declare function ValidateGraphEdgeTypeUniqueness(candidate: {
8
+ readonly ID: string | null | undefined;
9
+ readonly GraphID: string | null | undefined;
10
+ readonly Name: string | null | undefined;
11
+ }, existingEdgeTypes: readonly Pick<MJGraphEdgeTypeEntity, 'ID' | 'GraphID' | 'Name'>[]): ValidationErrorInfo | null;
12
+ /**
13
+ * Server-side `MJ: Graph Edge Types` entity enforcing `(GraphID, Name)` uniqueness
14
+ * across both graph-scoped and global (`GraphID === null`) edge types.
15
+ */
16
+ export declare class MJGraphEdgeTypeEntityServer extends MJGraphEdgeTypeEntity {
17
+ get DefaultSkipAsyncValidation(): boolean;
18
+ ValidateAsync(): Promise<ValidationResult>;
19
+ private fail;
20
+ }
21
+ //# sourceMappingURL=MJGraphEdgeTypeEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJGraphEdgeTypeEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJGraphEdgeTypeEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,mBAAmB,EAEnB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoC,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAExG;;;GAGG;AACH,wBAAgB,+BAA+B,CAC3C,SAAS,EAAE;IACP,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,EACD,iBAAiB,EAAE,SAAS,IAAI,CAAC,qBAAqB,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,EAAE,GACrF,mBAAmB,GAAG,IAAI,CA8B5B;AAED;;;GAGG;AACH,qBACa,2BAA4B,SAAQ,qBAAqB;IAClE,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAEqB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAwChE,OAAO,CAAC,IAAI;CAKf"}
@@ -0,0 +1,88 @@
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, ValidationErrorInfo, ValidationErrorType, } from '@memberjunction/core';
8
+ import { NormalizeUUID, RegisterClass } from '@memberjunction/global';
9
+ import { GraphEngine, IsGraphDataProvider, MJGraphEdgeTypeEntity } from '@memberjunction/core-entities';
10
+ /**
11
+ * Pure invariant check for `MJ: Graph Edge Types` `(GraphID, Name)` uniqueness,
12
+ * including global (`GraphID === null`) edge types.
13
+ */
14
+ export function ValidateGraphEdgeTypeUniqueness(candidate, existingEdgeTypes) {
15
+ const trimmedName = candidate.Name?.trim();
16
+ if (!trimmedName) {
17
+ return null;
18
+ }
19
+ const candidateIdNorm = candidate.ID ? NormalizeUUID(candidate.ID) : '';
20
+ const candidateGraphNorm = candidate.GraphID ? NormalizeUUID(candidate.GraphID) : null;
21
+ const candidateNameLower = trimmedName.toLowerCase();
22
+ for (const existing of existingEdgeTypes) {
23
+ if (candidateIdNorm && existing.ID && NormalizeUUID(existing.ID) === candidateIdNorm) {
24
+ continue;
25
+ }
26
+ const existingGraphNorm = existing.GraphID ? NormalizeUUID(existing.GraphID) : null;
27
+ if (existingGraphNorm !== candidateGraphNorm) {
28
+ continue;
29
+ }
30
+ if ((existing.Name ?? '').trim().toLowerCase() === candidateNameLower) {
31
+ const scopeDesc = candidateGraphNorm ? `graph "${candidate.GraphID}"` : 'global edge types (GraphID = NULL)';
32
+ return new ValidationErrorInfo('Name', `An edge type named "${trimmedName}" already exists in ${scopeDesc}.`, candidate.Name, ValidationErrorType.Failure);
33
+ }
34
+ }
35
+ return null;
36
+ }
37
+ /**
38
+ * Server-side `MJ: Graph Edge Types` entity enforcing `(GraphID, Name)` uniqueness
39
+ * across both graph-scoped and global (`GraphID === null`) edge types.
40
+ */
41
+ let MJGraphEdgeTypeEntityServer = class MJGraphEdgeTypeEntityServer extends MJGraphEdgeTypeEntity {
42
+ get DefaultSkipAsyncValidation() {
43
+ return false;
44
+ }
45
+ async ValidateAsync() {
46
+ const result = await super.ValidateAsync();
47
+ if (!result.Success) {
48
+ return result;
49
+ }
50
+ // Uniqueness is judged against GraphEngine's cached edge types, so they must be loaded. Config is a
51
+ // no-op once loaded, and on a server BaseEngine loads it as the system user (never this caller's
52
+ // scope). A load failure is an error: an empty cache would pass every duplicate.
53
+ const provider = this.ProviderToUse;
54
+ if (!IsGraphDataProvider(provider)) {
55
+ return this.fail(result, 'Graph edge types can only be validated against a metadata provider.');
56
+ }
57
+ try {
58
+ await GraphEngine.Instance.Config(false, this.ContextCurrentUser, provider);
59
+ }
60
+ catch (err) {
61
+ const msg = err instanceof Error ? err.message : String(err);
62
+ return this.fail(result, `Graph metadata could not be loaded to validate this edge type: ${msg}`);
63
+ }
64
+ if (!GraphEngine.Instance.Loaded) {
65
+ return this.fail(result, 'Graph metadata could not be loaded to validate this edge type.');
66
+ }
67
+ const dupError = ValidateGraphEdgeTypeUniqueness({
68
+ ID: this.ID,
69
+ GraphID: this.GraphID,
70
+ Name: this.Name,
71
+ }, GraphEngine.Instance.EdgeTypes);
72
+ if (dupError) {
73
+ result.Errors.push(dupError);
74
+ result.Success = false;
75
+ }
76
+ return result;
77
+ }
78
+ fail(result, message) {
79
+ result.Errors.push(new ValidationErrorInfo('Name', message, this.Name, ValidationErrorType.Failure));
80
+ result.Success = false;
81
+ return result;
82
+ }
83
+ };
84
+ MJGraphEdgeTypeEntityServer = __decorate([
85
+ RegisterClass(BaseEntity, 'MJ: Graph Edge Types')
86
+ ], MJGraphEdgeTypeEntityServer);
87
+ export { MJGraphEdgeTypeEntityServer };
88
+ //# sourceMappingURL=MJGraphEdgeTypeEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJGraphEdgeTypeEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJGraphEdgeTypeEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAExG;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC3C,SAIC,EACD,iBAAoF;IAEpF,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAI,CAAC,WAAW,EA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,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QAC3B,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,IAAI,CAAC,MAAwB,EAAE,OAAe;QAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;QACrG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAlDY,2BAA2B;IADvC,aAAa,CAAC,UAAU,EAAE,sBAAsB,CAAC;GACrC,2BAA2B,CAkDvC"}
@@ -0,0 +1,39 @@
1
+ import { type EntitySaveOptions, type IMetadataProvider, type ValidationResult } from '@memberjunction/core';
2
+ import { MJMLEvaluationProtocolEntity } from '@memberjunction/core-entities';
3
+ import { type Actor, type EvaluationProtocolColumns } from '@memberjunction/predictive-studio-core';
4
+ import { type RowRead } from './MJMLPredictionUnitEntityServer.server.js';
5
+ /**
6
+ * `MJ: ML Evaluation Protocols`: immutable versions plus the protocol's own shape checks. On insert, the protocol rules
7
+ * that do not need a Prediction Unit are checked against the previous version of the lineage: a dummy baseline is
8
+ * declared, and the guard fields change only when the author may change them under the previous version's
9
+ * `GuardFieldsEditableBy` (never an agent tool call; under `human-only`, only a user). A version authored by a user
10
+ * names the user who saves it: the guard-field rule trusts `AuthoredBy`, so a version may not claim another user (or
11
+ * a user when no user saves it). "The user who saves it" is the user the save is attributed to, `ActiveUser` (see
12
+ * {@link VersionedRowGuard}), which also reads the previous version. The rules that need a unit run where a pipeline
13
+ * binds a unit and a protocol.
14
+ */
15
+ export declare class MJMLEvaluationProtocolEntityServer extends MJMLEvaluationProtocolEntity {
16
+ /** A version-1 row is its own lineage root; the server assigns it on create. A `ReplayOnly` save of a saved row is refused. */
17
+ Save(options?: EntitySaveOptions): Promise<boolean>;
18
+ Validate(): ValidationResult;
19
+ /** False: the rules that read the previous version run in {@link ValidateAsync} on every save. */
20
+ get DefaultSkipAsyncValidation(): boolean;
21
+ /**
22
+ * The protocol rules that need the previous version, on insert only (a saved version is never updated, so there is
23
+ * nothing to re-check on an update; the synchronous guard refuses it).
24
+ */
25
+ ValidateAsync(): Promise<ValidationResult>;
26
+ /**
27
+ * Why a version's author cannot be accepted: it names a user other than the one saving it (or names a user when no
28
+ * user saves it). Null for any other author, and for the saving user. Pure.
29
+ *
30
+ * @param author the version's `AuthoredBy`
31
+ * @param savingUserId the ID of the user saving the version, or null when none is known
32
+ */
33
+ static GetHumanAuthorProblem(author: Actor, savingUserId: string | null): string | null;
34
+ /** The column a protocol refusal is reported on. */
35
+ private static refusalField;
36
+ /** One version of this row's lineage as a plain row (nothing is mutated), read as the saving user, or the read error. */
37
+ protected LoadVersion(provider: IMetadataProvider, version: number): Promise<RowRead<EvaluationProtocolColumns>>;
38
+ }
39
+ //# sourceMappingURL=MJMLEvaluationProtocolEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJMLEvaluationProtocolEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLEvaluationProtocolEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpI,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAA+C,KAAK,KAAK,EAAE,KAAK,yBAAyB,EAAqD,MAAM,wCAAwC,CAAC;AACpM,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAE1F;;;;;;;;;GASG;AACH,qBACa,kCAAmC,SAAQ,4BAA4B;IAClF,+HAA+H;IACzG,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzD,QAAQ,IAAI,gBAAgB;IAI5C,kGAAkG;IAClG,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAED;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IA8BhE;;;;;;OAMG;WACW,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI;IAK9F,oDAAoD;IACpD,OAAO,CAAC,MAAM,CAAC,YAAY;IAgC3B,yHAAyH;cACzG,WAAW,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAGvH"}
@@ -0,0 +1,124 @@
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
+ var MJMLEvaluationProtocolEntityServer_1;
8
+ import { BaseEntity, LogStatus } from '@memberjunction/core';
9
+ import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
10
+ import { MJMLEvaluationProtocolEntity } from '@memberjunction/core-entities';
11
+ import { EvaluationProtocol, EvaluationProtocolRules } from '@memberjunction/predictive-studio-core';
12
+ import { VersionedRowGuard } from './MJMLPredictionUnitEntityServer.server.js';
13
+ /**
14
+ * `MJ: ML Evaluation Protocols`: immutable versions plus the protocol's own shape checks. On insert, the protocol rules
15
+ * that do not need a Prediction Unit are checked against the previous version of the lineage: a dummy baseline is
16
+ * declared, and the guard fields change only when the author may change them under the previous version's
17
+ * `GuardFieldsEditableBy` (never an agent tool call; under `human-only`, only a user). A version authored by a user
18
+ * names the user who saves it: the guard-field rule trusts `AuthoredBy`, so a version may not claim another user (or
19
+ * a user when no user saves it). "The user who saves it" is the user the save is attributed to, `ActiveUser` (see
20
+ * {@link VersionedRowGuard}), which also reads the previous version. The rules that need a unit run where a pipeline
21
+ * binds a unit and a protocol.
22
+ */
23
+ let MJMLEvaluationProtocolEntityServer = MJMLEvaluationProtocolEntityServer_1 = class MJMLEvaluationProtocolEntityServer extends MJMLEvaluationProtocolEntity {
24
+ /** A version-1 row is its own lineage root; the server assigns it on create. A `ReplayOnly` save of a saved row is refused. */
25
+ async Save(options) {
26
+ VersionedRowGuard.AdoptOwnLineageRoot(this);
27
+ return VersionedRowGuard.SaveRefusingSavedRowReplay(this, options, () => super.Save(options));
28
+ }
29
+ Validate() {
30
+ return VersionedRowGuard.AddProblems(this, super.Validate(), 'Version', 'Version', () => EvaluationProtocol.GetEvaluationProtocolShapeProblems(this));
31
+ }
32
+ /** False: the rules that read the previous version run in {@link ValidateAsync} on every save. */
33
+ get DefaultSkipAsyncValidation() {
34
+ return false;
35
+ }
36
+ /**
37
+ * The protocol rules that need the previous version, on insert only (a saved version is never updated, so there is
38
+ * nothing to re-check on an update; the synchronous guard refuses it).
39
+ */
40
+ async ValidateAsync() {
41
+ const result = await super.ValidateAsync();
42
+ if (!result.Success || this.IsSaved)
43
+ return result;
44
+ const provider = this.ProviderToUse;
45
+ if (!VersionedRowGuard.IsMetadataProvider(provider)) {
46
+ LogStatus(`MJMLEvaluationProtocolEntityServer: the provider is not a metadata provider, so the protocol rules were skipped for "${this.Name}" v${this.Version}`);
47
+ return result;
48
+ }
49
+ const parsed = EvaluationProtocol.ParseEvaluationProtocolRow(this);
50
+ if (parsed.Ok === false) {
51
+ VersionedRowGuard.Fail(result, 'Version', `Evaluation Protocol does not parse: ${parsed.Errors.join('; ')}`);
52
+ return result;
53
+ }
54
+ const impersonation = MJMLEvaluationProtocolEntityServer_1.GetHumanAuthorProblem(parsed.Value.authoredBy, this.ActiveUser?.ID || null);
55
+ if (impersonation !== null) {
56
+ VersionedRowGuard.Fail(result, 'AuthoredBy', impersonation);
57
+ return result;
58
+ }
59
+ const previous = await VersionedRowGuard.PreviousVersion(result, {
60
+ Label: 'Evaluation Protocol', LineageRootID: this.LineageRootID, Version: this.Version,
61
+ Load: (version) => this.LoadVersion(provider, version),
62
+ Parse: (row) => EvaluationProtocol.ParseEvaluationProtocolRow(row),
63
+ });
64
+ if (previous === undefined)
65
+ return result;
66
+ for (const r of EvaluationProtocolRules.ValidateEvaluationProtocol({ Protocol: parsed.Value, Previous: previous === null ? null : previous.Spec, AuthoredBy: parsed.Value.authoredBy })) {
67
+ VersionedRowGuard.Fail(result, MJMLEvaluationProtocolEntityServer_1.refusalField(r), EvaluationProtocolRules.DescribeProtocolRefusal(r));
68
+ }
69
+ return result;
70
+ }
71
+ /**
72
+ * Why a version's author cannot be accepted: it names a user other than the one saving it (or names a user when no
73
+ * user saves it). Null for any other author, and for the saving user. Pure.
74
+ *
75
+ * @param author the version's `AuthoredBy`
76
+ * @param savingUserId the ID of the user saving the version, or null when none is known
77
+ */
78
+ static GetHumanAuthorProblem(author, savingUserId) {
79
+ if (author.kind !== 'human' || (savingUserId !== null && UUIDsEqual(author.userId, savingUserId)))
80
+ return null;
81
+ return `AuthoredBy names the user ${author.userId}, but the version is saved by ${savingUserId === null ? 'no user' : 'another user'}; a version is authored by a user only when that user saves it.`;
82
+ }
83
+ /** The column a protocol refusal is reported on. */
84
+ static refusalField(r) {
85
+ switch (r.Kind) {
86
+ case 'holdout-kind-mismatch':
87
+ case 'horizon-mismatch':
88
+ case 'lag-inside-horizon':
89
+ case 'rolling-window-inside-horizon':
90
+ case 'new-entity-group-key-mismatch':
91
+ case 'forecast-multiple-series':
92
+ return 'Holdout';
93
+ case 'inner-gap-below-horizon':
94
+ case 'group-key-mismatch':
95
+ case 'inner-validation-ungrouped':
96
+ return 'InnerValidation';
97
+ case 'primary-score-family-mismatch':
98
+ return 'PrimaryScore';
99
+ case 'calibration-not-applicable-for-probability-task':
100
+ return 'Calibration';
101
+ case 'no-dummy-baseline':
102
+ case 'forecast-no-seasonal-naive':
103
+ return 'Baselines';
104
+ case 'forecast-prediction-intervals':
105
+ return 'PredictionIntervals';
106
+ case 'forecast-slices':
107
+ return 'Slices';
108
+ case 'forecast-interval-method':
109
+ case 'intervals-not-clustered':
110
+ return 'Intervals';
111
+ case 'guard-field-edited-by-disallowed-author':
112
+ return 'AuthoredBy';
113
+ }
114
+ }
115
+ /** One version of this row's lineage as a plain row (nothing is mutated), read as the saving user, or the read error. */
116
+ async LoadVersion(provider, version) {
117
+ return VersionedRowGuard.LoadVersion(provider, 'MJ: ML Evaluation Protocols', this.LineageRootID, version, this.ActiveUser);
118
+ }
119
+ };
120
+ MJMLEvaluationProtocolEntityServer = MJMLEvaluationProtocolEntityServer_1 = __decorate([
121
+ RegisterClass(BaseEntity, 'MJ: ML Evaluation Protocols')
122
+ ], MJMLEvaluationProtocolEntityServer);
123
+ export { MJMLEvaluationProtocolEntityServer };
124
+ //# sourceMappingURL=MJMLEvaluationProtocolEntityServer.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJMLEvaluationProtocolEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLEvaluationProtocolEntityServer.server.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAyE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAiG,MAAM,wCAAwC,CAAC;AACpM,OAAO,EAAE,iBAAiB,EAAgB,MAAM,yCAAyC,CAAC;AAE1F;;;;;;;;;GASG;AAEI,IAAM,kCAAkC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AAiB,CAAC,WAAW,CAA4B,QAAQ,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACzJ,CAAC;CACF,CAAA;AAnGY,kCAAkC;IAD9C,aAAa,CAAC,UAAU,EAAE,6BAA6B,CAAC;GAC5C,kCAAkC,CAmG9C"}
@@ -0,0 +1,124 @@
1
+ import { BaseEntity, type EntitySaveOptions, type IEntityDataProvider, type IMetadataProvider, type UserInfo, type ValidationResult } from '@memberjunction/core';
2
+ import { MJMLPredictionUnitEntity } from '@memberjunction/core-entities';
3
+ import { type ParseResult } from '@memberjunction/predictive-studio-core';
4
+ /** One row read as a plain object: the row (null when absent), or why the read failed. */
5
+ export interface RowRead<TRow> {
6
+ /** The row's columns; null when it is absent or the read failed. */
7
+ readonly Row: TRow | null;
8
+ /** Why the read failed; null when it succeeded. */
9
+ readonly Error: string | null;
10
+ }
11
+ /** What {@link VersionedRowGuard.PreviousVersion} reads: the lineage, the version being saved, and how to load and parse a version. */
12
+ export interface PreviousVersionArgs<TRow extends {
13
+ readonly ID: string;
14
+ }, TSpec> {
15
+ /** The entity's display name in messages (`Prediction Unit`, `Evaluation Protocol`). */
16
+ readonly Label: string;
17
+ /** The lineage whose version n−1 is read. */
18
+ readonly LineageRootID: string;
19
+ /** The version being saved; its predecessor is read. */
20
+ readonly Version: number;
21
+ /** Reads one version of the lineage as a plain row. */
22
+ readonly Load: (version: number) => Promise<RowRead<TRow>>;
23
+ /** Parses a row into its spec. */
24
+ readonly Parse: (row: TRow) => ParseResult<TSpec>;
25
+ }
26
+ /**
27
+ * The immutable-version guard shared by the unit, protocol and snapshot subclasses: one implementation of
28
+ * "a saved version is never updated", so the three entities cannot drift apart. It holds on both write paths: an
29
+ * ordinary save is refused in `Validate()` ({@link AddProblems}), and a `ReplayOnly` save, which skips `Validate()`,
30
+ * in `Save()` ({@link SaveRefusingSavedRowReplay}). A delete is not refused: the integration rigs and the plan's probes
31
+ * delete the rows they create, and the foreign keys keep a version that anything references.
32
+ *
33
+ * **Which user.** The unit, protocol and pipeline subclasses judge authorship and read other rows as `ActiveUser`: the
34
+ * user the save is attributed to (`ContextCurrentUser`, else the provider's `CurrentUser`), which `BaseEntity.Save()`
35
+ * checks permissions for and hands the provider's write. The coding standard's "use `BaseEntity.ContextCurrentUser`
36
+ * rather than tracking the current user" is about not keeping a user of one's own; `ActiveUser` is that same
37
+ * BaseEntity resolution, finished. `ContextCurrentUser` alone is only an explicitly set user: an entity created without
38
+ * one is written as the provider's user, and reading `ContextCurrentUser` would judge, and read as, no user instead.
39
+ */
40
+ export declare class VersionedRowGuard {
41
+ /**
42
+ * The refusal for a write to a saved row; null for a new row or a saved row with no change. A row of a versioned
43
+ * lineage (it has a `LineageRootID`) is told to save the next version; a row with no lineage (a Training Snapshot) to
44
+ * write a new row. Pure.
45
+ */
46
+ static GetVersionedRowUpdateProblem(entityName: string, isSaved: boolean, dirtyFields: readonly string[], hasLineage: boolean): string | null;
47
+ /** The refusal for a `ReplayOnly` save of a saved row of `entityName`. Pure. */
48
+ static GetReplayOnlyUpdateProblem(entityName: string): string;
49
+ /**
50
+ * Runs `save` (the subclass's base save) unless this is a `ReplayOnly` save of a saved row, which is refused with
51
+ * {@link GetReplayOnlyUpdateProblem} recorded on the result history (so `LatestResult.CompleteMessage` carries it).
52
+ * `ReplayOnly` skips `Validate()` but still writes, and it writes even when no field is dirty (values loaded with
53
+ * `LoadFromData` are not dirty), so the option itself is refused on a saved row rather than its dirty fields judged.
54
+ * A `ReplayOnly` insert goes through, as it does for every entity.
55
+ */
56
+ static SaveRefusingSavedRowReplay(entity: BaseEntity, options: EntitySaveOptions | undefined, save: () => Promise<boolean>): Promise<boolean>;
57
+ /**
58
+ * A version-1 row is its own lineage root: on create the server assigns `LineageRootID = ID`, because a client
59
+ * cannot choose the ID it will be given. Any other row is left as it is.
60
+ */
61
+ static AdoptOwnLineageRoot(row: {
62
+ readonly IsSaved: boolean;
63
+ readonly Version: number;
64
+ readonly ID: string;
65
+ LineageRootID: string;
66
+ }): void;
67
+ /**
68
+ * Every MJ data provider is also a metadata provider; a test double may not be. Narrows without a cast so the
69
+ * Predictive Studio server subclasses can use metadata lookups only when the provider supports them.
70
+ */
71
+ static IsMetadataProvider(p: IEntityDataProvider | null | undefined): p is IEntityDataProvider & IMetadataProvider;
72
+ /** Records a failure on `field` and marks the result failed. */
73
+ static Fail(result: ValidationResult, field: string, message: string): void;
74
+ /**
75
+ * The first row of `entityName` matching `filter`, as a plain row (nothing is mutated). A failed read is returned as
76
+ * its error, so it is never reported as an absent row.
77
+ */
78
+ static ReadOneRow<TRow>(provider: IMetadataProvider, entityName: string, filter: string, user: UserInfo | undefined): Promise<RowRead<TRow>>;
79
+ /** Version `version` of a lineage, read with {@link ReadOneRow}. */
80
+ static LoadVersion<TRow>(provider: IMetadataProvider, entityName: string, lineageRootID: string, version: number, user: UserInfo | undefined): Promise<RowRead<TRow>>;
81
+ /**
82
+ * Version `n - 1` of a lineage with its parsed form: null for version 1; undefined when it could not be read, is
83
+ * absent (versions are consecutive) or does not parse, each recorded on `result` against `Version`.
84
+ */
85
+ static PreviousVersion<TRow extends {
86
+ readonly ID: string;
87
+ }, TSpec>(result: ValidationResult, a: PreviousVersionArgs<TRow, TSpec>): Promise<{
88
+ readonly Row: TRow;
89
+ readonly Spec: TSpec;
90
+ } | null | undefined>;
91
+ /**
92
+ * Adds the update refusal (on `updateField`) or, for a new row, the row's own problems (on `rowField`) to `result`.
93
+ * `rowProblems` runs only when the write is not an update of a saved version.
94
+ */
95
+ static AddProblems(entity: BaseEntity, result: ValidationResult, updateField: string, rowField: string, rowProblems: () => readonly string[]): ValidationResult;
96
+ }
97
+ /**
98
+ * `MJ: ML Prediction Units`: a version row is written once and never updated, and must parse. On insert, every entity
99
+ * and field the unit names must exist, versions of a lineage must be consecutive, and LabelVersion must move exactly
100
+ * when the outcome definition changed from the previous version.
101
+ */
102
+ export declare class MJMLPredictionUnitEntityServer extends MJMLPredictionUnitEntity {
103
+ /** Shape problems of a unit row (all JSON columns parse; cross-field rules hold). Pure. */
104
+ static GetPredictionUnitRowProblems(row: MJMLPredictionUnitEntity): readonly string[];
105
+ /** The LabelVersion a new version must carry: the previous one, plus one when the outcome definition changed. Pure. */
106
+ static ExpectedLabelVersion(previous: number, changed: boolean): number;
107
+ /** A version-1 row is its own lineage root; the server assigns it on create. A `ReplayOnly` save of a saved row is refused. */
108
+ Save(options?: EntitySaveOptions): Promise<boolean>;
109
+ Validate(): ValidationResult;
110
+ get DefaultSkipAsyncValidation(): boolean;
111
+ /**
112
+ * The checks that need metadata or other rows, on insert only (a saved version is never updated, so there is
113
+ * nothing to re-check on an update; the synchronous guard refuses it).
114
+ */
115
+ ValidateAsync(): Promise<ValidationResult>;
116
+ /** Every entity the unit names must be registered, and every field it names must exist on that entity. */
117
+ private checkReferencedFields;
118
+ /**
119
+ * Version `n` follows version `n - 1` of the same lineage, and its LabelVersion is the previous one plus one exactly
120
+ * when the outcome definition (rule, window, gap, task) changed. Nothing to check for version 1.
121
+ */
122
+ private checkLabelVersion;
123
+ }
124
+ //# sourceMappingURL=MJMLPredictionUnitEntityServer.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MJMLPredictionUnitEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLPredictionUnitEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkF,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAElP,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAkB,KAAK,WAAW,EAAuD,MAAM,wCAAwC,CAAC;AAE/I,0FAA0F;AAC1F,MAAM,WAAW,OAAO,CAAC,IAAI;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAA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