@memberjunction/core-entities-server 6.3.0-edge.1 → 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/AgentChannelConversationDriver.server.d.ts +87 -0
- package/dist/custom/AgentChannelConversationDriver.server.d.ts.map +1 -0
- package/dist/custom/AgentChannelConversationDriver.server.js +216 -0
- package/dist/custom/AgentChannelConversationDriver.server.js.map +1 -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/AudienceNamedPersonAgentRequestService.d.ts +25 -0
- package/dist/custom/AudienceNamedPersonAgentRequestService.d.ts.map +1 -0
- package/dist/custom/AudienceNamedPersonAgentRequestService.js +304 -0
- package/dist/custom/AudienceNamedPersonAgentRequestService.js.map +1 -0
- package/dist/custom/ConversationDetailWritePermissionProvider.d.ts +113 -0
- package/dist/custom/ConversationDetailWritePermissionProvider.d.ts.map +1 -0
- package/dist/custom/ConversationDetailWritePermissionProvider.js +200 -0
- package/dist/custom/ConversationDetailWritePermissionProvider.js.map +1 -0
- package/dist/custom/ConversationReadSecurityHook.d.ts +61 -0
- package/dist/custom/ConversationReadSecurityHook.d.ts.map +1 -0
- package/dist/custom/ConversationReadSecurityHook.js +587 -0
- package/dist/custom/ConversationReadSecurityHook.js.map +1 -0
- 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 +185 -33
- package/dist/custom/MJAIAgentEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentEntityServer.server.js +2232 -42
- 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 +23 -0
- package/dist/custom/MJAIAgentPersonaEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJAIAgentPersonaEntityServer.server.js +95 -0
- package/dist/custom/MJAIAgentPersonaEntityServer.server.js.map +1 -0
- 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/MJAIAgentUserPolicyEntityServer.server.d.ts +24 -13
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js +167 -24
- package/dist/custom/MJAIAgentUserPolicyEntityServer.server.js.map +1 -1
- 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/MJConversationDetailEntityServer.server.d.ts +27 -2
- package/dist/custom/MJConversationDetailEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJConversationDetailEntityServer.server.js +300 -4
- package/dist/custom/MJConversationDetailEntityServer.server.js.map +1 -1
- package/dist/custom/MJConversationEntityServer.server.d.ts +5 -26
- package/dist/custom/MJConversationEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJConversationEntityServer.server.js +236 -8
- package/dist/custom/MJConversationEntityServer.server.js.map +1 -1
- 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 +244 -0
- package/dist/custom/MJGraphConceptEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphConceptEntityServer.server.js +746 -0
- package/dist/custom/MJGraphConceptEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +52 -11
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJGraphEdgeEntityServer.server.js +269 -37
- 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/MJMLModelPublishRecordEntityServer.server.d.ts +31 -0
- package/dist/custom/MJMLModelPublishRecordEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLModelPublishRecordEntityServer.server.js +68 -0
- package/dist/custom/MJMLModelPublishRecordEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLModelScoringBindingEntityServer.server.d.ts +78 -0
- package/dist/custom/MJMLModelScoringBindingEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLModelScoringBindingEntityServer.server.js +273 -0
- package/dist/custom/MJMLModelScoringBindingEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLOutputBindingEntityServer.server.d.ts +18 -0
- package/dist/custom/MJMLOutputBindingEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJMLOutputBindingEntityServer.server.js +61 -0
- package/dist/custom/MJMLOutputBindingEntityServer.server.js.map +1 -0
- package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts +3 -3
- package/dist/custom/MJMLPredictionUnitEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJMLPredictionUnitEntityServer.server.js +4 -4
- package/dist/custom/MJMLPredictionUnitEntityServer.server.js.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.d.ts +81 -0
- package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.js +194 -4
- 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 +36 -1
- package/dist/custom/MJQuerySQLEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQuerySQLEntityServer.server.js +138 -7
- package/dist/custom/MJQuerySQLEntityServer.server.js.map +1 -1
- package/dist/custom/MJResourcePermissionEntityServer.server.d.ts +28 -0
- package/dist/custom/MJResourcePermissionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJResourcePermissionEntityServer.server.js +206 -0
- package/dist/custom/MJResourcePermissionEntityServer.server.js.map +1 -0
- 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/MJUserRoutineEntityServer.server.d.ts +23 -0
- package/dist/custom/MJUserRoutineEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserRoutineEntityServer.server.js +320 -3
- package/dist/custom/MJUserRoutineEntityServer.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 +86 -6
- package/dist/custom/approvalStamp.d.ts.map +1 -1
- package/dist/custom/approvalStamp.js +119 -15
- 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 +26 -0
- package/dist/custom/graph/GraphFindPathServerOperation.d.ts.map +1 -0
- package/dist/custom/graph/GraphFindPathServerOperation.js +117 -0
- package/dist/custom/graph/GraphFindPathServerOperation.js.map +1 -0
- package/dist/custom/graph/index.d.ts +2 -0
- package/dist/custom/graph/index.d.ts.map +1 -0
- package/dist/custom/graph/index.js +2 -0
- package/dist/custom/graph/index.js.map +1 -0
- 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 +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJListEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJListEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EACnB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MJListEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJListEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EACnB,iBAAiB,EAMjB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAWrE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,kBAAmB,SAAQ,oBAAoB;IACxC,QAAQ,IAAI,gBAAgB;IActB,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAuBnD,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB7E,OAAO,KAAK,SAAS,GAEpB;IAED,kHAAkH;IAClH,OAAO,CAAC,gBAAgB;YAQV,sBAAsB;IAYpC,wEAAwE;YAC1D,oBAAoB;YAQpB,SAAS;IAQvB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;CASxB"}
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { BaseEntity, BaseEntityResult, LogError, ValidationErrorInfo, ValidationErrorType, } from '@memberjunction/core';
|
|
7
|
+
import { BaseEntity, BaseEntityResult, LocalCacheManager, LogError, ValidationErrorInfo, ValidationErrorType, } from '@memberjunction/core';
|
|
8
8
|
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
9
9
|
import { MJListEntityExtended } from '@memberjunction/core-entities';
|
|
10
10
|
import { ListOperations } from '@memberjunction/lists';
|
|
@@ -20,7 +20,8 @@ const ROUTINE_FIELDS = ['AutoRefresh', 'Name', 'UserID', 'SourceViewID', 'Source
|
|
|
20
20
|
* Integration role. The rule lives once in {@link MJListEntityExtended.UserCanDelete} and is shared
|
|
21
21
|
* with the UI. The `EntityPermission` migration grants the UI role entity-wide Delete on Lists, and
|
|
22
22
|
* this override narrows it to owner-or-privileged, since entity permissions can't express row-level
|
|
23
|
-
* ownership. The list's
|
|
23
|
+
* ownership. The database deletes the list's members with the list, so the cached List Details
|
|
24
|
+
* results are cleared after the delete. The list's refresh routine is deleted after the list.
|
|
24
25
|
*
|
|
25
26
|
* **Source and refresh.** Only the list's owner may link it to a source query or view, or turn on
|
|
26
27
|
* Refresh automatically. Linking an existing list to a new source fills it from that source right
|
|
@@ -71,6 +72,8 @@ let MJListEntityServer = class MJListEntityServer extends MJListEntityExtended {
|
|
|
71
72
|
const routineID = this.RefreshRoutineID;
|
|
72
73
|
if (!(await super.Delete(options)))
|
|
73
74
|
return false;
|
|
75
|
+
// The database removes the list's members with the list, with no entity events for them.
|
|
76
|
+
await this.runSafely('member cache clear', () => LocalCacheManager.Instance.InvalidateEntityCaches('MJ: List Details', this.ProviderToUse));
|
|
74
77
|
// The list's foreign key points at the routine, so the routine goes after the list.
|
|
75
78
|
if (routineID) {
|
|
76
79
|
await this.runSafely('routine delete', () => this.routine().DeleteAsync(routineID));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJListEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJListEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,UAAU,EACV,gBAAgB,EAIhB,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,sGAAsG;AACtG,MAAM,sBAAsB,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,qBAAqB,CAAU,CAAC;AAEjG,qDAAqD;AACrD,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,CAAU,CAAC;AAEnG
|
|
1
|
+
{"version":3,"file":"MJListEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJListEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,UAAU,EACV,gBAAgB,EAIhB,iBAAiB,EACjB,QAAQ,EACR,mBAAmB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kB,CAAC,CAAC;IAC/G,CAAC;IAEO,aAAa,CAAC,MAAyB;QAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC,CAAC;IACtE,CAAC;IAEO,aAAa,CAAC,IAAyB,EAAE,OAAe;QAC5D,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,MAAM,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AApHY,kBAAkB;IAD9B,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC;GAC1B,kBAAkB,CAoH9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type EntityDeleteOptions, type EntitySaveOptions, type ValidationResult } from '@memberjunction/core';
|
|
2
|
+
import { MJMLModelPublishRecordEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/**
|
|
4
|
+
* `MJ: ML Model Publish Records` (PR 4 §5.1, D-029): the ledger of sign-offs, applied publishes and refused publish
|
|
5
|
+
* attempts. Rows are immutable once saved: `Validate()` refuses any change to a saved row, and a `ReplayOnly` save of a
|
|
6
|
+
* saved row (which skips `Validate()`) is refused in `Save()`, so neither write path can rewrite the audit trail. The
|
|
7
|
+
* one exception is `spDeleteEntityWithCoreDependencies`, which clears `SignOffID`, `ReplacesModelID` and
|
|
8
|
+
* `TrainingRunID` on surviving rows when the row they name is deleted with its entity (D4-73); it runs in SQL and never
|
|
9
|
+
* reaches this class.
|
|
10
|
+
*
|
|
11
|
+
* The ledger is also append-only for creates and deletes (review item 1 of PR #6517): the Predictive Studio Engine's
|
|
12
|
+
* `PredictiveStudioPublishRecordGuard` (`PreSave` and `PreDelete` hooks, registered in every process that loads the
|
|
13
|
+
* Engine, MJAPI among them) refuses a new row its writer did not authorise and any delete. A `ReplayOnly` delete skips
|
|
14
|
+
* `PreDelete` hooks yet still deletes the row, so this class refuses it.
|
|
15
|
+
*/
|
|
16
|
+
export declare class MJMLModelPublishRecordEntityServer extends MJMLModelPublishRecordEntity {
|
|
17
|
+
/** The refusal of a change to a saved publish record, naming the changed fields; null for a new row or no change. Pure. */
|
|
18
|
+
static GetPublishRecordUpdateProblem(isSaved: boolean, dirtyFields: readonly string[]): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The generated field validation, plus the ledger rule: a saved record with any changed field is refused, naming the
|
|
21
|
+
* fields (a new record, and a saved one with no change, pass).
|
|
22
|
+
*/
|
|
23
|
+
Validate(): ValidationResult;
|
|
24
|
+
/** A `ReplayOnly` save of a saved record is refused: it skips {@link Validate}, which refuses the update, but still writes. */
|
|
25
|
+
Save(options?: EntitySaveOptions): Promise<boolean>;
|
|
26
|
+
/** The refusal of a `ReplayOnly` delete; null for any other delete (the Engine's `PreDelete` hook decides those). Pure. */
|
|
27
|
+
static GetReplayOnlyDeleteProblem(options: EntityDeleteOptions | undefined): string | null;
|
|
28
|
+
/** A `ReplayOnly` delete is refused ({@link GetReplayOnlyDeleteProblem}); any other delete goes to the base. */
|
|
29
|
+
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=MJMLModelPublishRecordEntityServer.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLModelPublishRecordEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLModelPublishRecordEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE3H,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAI7E;;;;;;;;;;;;GAYG;AACH,qBACa,kCAAmC,SAAQ,4BAA4B;IAClF,2HAA2H;WAC7G,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI;IAK5G;;;OAGG;IACa,QAAQ,IAAI,gBAAgB;IAQ5C,+HAA+H;IACzG,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzE,2HAA2H;WAC7G,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI;IAKjG,gHAAgH;IAC1F,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAM9E"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 MJMLModelPublishRecordEntityServer_1;
|
|
8
|
+
import { BaseEntity } from '@memberjunction/core';
|
|
9
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
10
|
+
import { MJMLModelPublishRecordEntity } from '@memberjunction/core-entities';
|
|
11
|
+
import { FormScopeRefusalResult } from './FormScopeGuard.js';
|
|
12
|
+
import { VersionedRowGuard } from './MJMLPredictionUnitEntityServer.server.js';
|
|
13
|
+
/**
|
|
14
|
+
* `MJ: ML Model Publish Records` (PR 4 §5.1, D-029): the ledger of sign-offs, applied publishes and refused publish
|
|
15
|
+
* attempts. Rows are immutable once saved: `Validate()` refuses any change to a saved row, and a `ReplayOnly` save of a
|
|
16
|
+
* saved row (which skips `Validate()`) is refused in `Save()`, so neither write path can rewrite the audit trail. The
|
|
17
|
+
* one exception is `spDeleteEntityWithCoreDependencies`, which clears `SignOffID`, `ReplacesModelID` and
|
|
18
|
+
* `TrainingRunID` on surviving rows when the row they name is deleted with its entity (D4-73); it runs in SQL and never
|
|
19
|
+
* reaches this class.
|
|
20
|
+
*
|
|
21
|
+
* The ledger is also append-only for creates and deletes (review item 1 of PR #6517): the Predictive Studio Engine's
|
|
22
|
+
* `PredictiveStudioPublishRecordGuard` (`PreSave` and `PreDelete` hooks, registered in every process that loads the
|
|
23
|
+
* Engine, MJAPI among them) refuses a new row its writer did not authorise and any delete. A `ReplayOnly` delete skips
|
|
24
|
+
* `PreDelete` hooks yet still deletes the row, so this class refuses it.
|
|
25
|
+
*/
|
|
26
|
+
let MJMLModelPublishRecordEntityServer = MJMLModelPublishRecordEntityServer_1 = class MJMLModelPublishRecordEntityServer extends MJMLModelPublishRecordEntity {
|
|
27
|
+
/** The refusal of a change to a saved publish record, naming the changed fields; null for a new row or no change. Pure. */
|
|
28
|
+
static GetPublishRecordUpdateProblem(isSaved, dirtyFields) {
|
|
29
|
+
if (!isSaved || dirtyFields.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
return `MJ: ML Model Publish Records rows are immutable once saved (publish records are immutable): ${dirtyFields.join(', ')} cannot be changed. Write a new record instead.`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The generated field validation, plus the ledger rule: a saved record with any changed field is refused, naming the
|
|
35
|
+
* fields (a new record, and a saved one with no change, pass).
|
|
36
|
+
*/
|
|
37
|
+
Validate() {
|
|
38
|
+
const result = super.Validate();
|
|
39
|
+
const dirty = this.Fields.filter((f) => f.Dirty).map((f) => f.Name);
|
|
40
|
+
const problem = MJMLModelPublishRecordEntityServer_1.GetPublishRecordUpdateProblem(this.IsSaved, dirty);
|
|
41
|
+
if (problem !== null)
|
|
42
|
+
VersionedRowGuard.Fail(result, dirty[0], problem);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
/** A `ReplayOnly` save of a saved record is refused: it skips {@link Validate}, which refuses the update, but still writes. */
|
|
46
|
+
async Save(options) {
|
|
47
|
+
return VersionedRowGuard.SaveRefusingSavedRowReplay(this, options, () => super.Save(options));
|
|
48
|
+
}
|
|
49
|
+
/** The refusal of a `ReplayOnly` delete; null for any other delete (the Engine's `PreDelete` hook decides those). Pure. */
|
|
50
|
+
static GetReplayOnlyDeleteProblem(options) {
|
|
51
|
+
if (options?.ReplayOnly !== true)
|
|
52
|
+
return null;
|
|
53
|
+
return 'MJ: ML Model Publish Records rows are append-only: a ReplayOnly delete is refused, because ReplayOnly skips the PreDelete hooks that refuse a delete but still deletes the row.';
|
|
54
|
+
}
|
|
55
|
+
/** A `ReplayOnly` delete is refused ({@link GetReplayOnlyDeleteProblem}); any other delete goes to the base. */
|
|
56
|
+
async Delete(options) {
|
|
57
|
+
const problem = MJMLModelPublishRecordEntityServer_1.GetReplayOnlyDeleteProblem(options);
|
|
58
|
+
if (problem === null)
|
|
59
|
+
return super.Delete(options);
|
|
60
|
+
this.RegisterResultHistoryEntry(FormScopeRefusalResult('delete', problem));
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
MJMLModelPublishRecordEntityServer = MJMLModelPublishRecordEntityServer_1 = __decorate([
|
|
65
|
+
RegisterClass(BaseEntity, 'MJ: ML Model Publish Records')
|
|
66
|
+
], MJMLModelPublishRecordEntityServer);
|
|
67
|
+
export { MJMLModelPublishRecordEntityServer };
|
|
68
|
+
//# sourceMappingURL=MJMLModelPublishRecordEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLModelPublishRecordEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLModelPublishRecordEntityServer.server.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAA2E,MAAM,sBAAsB,CAAC;AAC3H,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E;;;;;;;;;;;;GAYG;AAEI,IAAM,kCAAkC,0CAAxC,MAAM,kCAAmC,SAAQ,4BAA4B;IAClF,2HAA2H;IACpH,MAAM,CAAC,6BAA6B,CAAC,OAAgB,EAAE,WAA8B;QAC1F,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtD,OAAO,+FAA+F,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,iDAAiD,CAAC;IAChL,CAAC;IAED;;;OAGG;IACa,QAAQ;QACtB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpE,MAAM,OAAO,GAAG,oCAAkC,CAAC,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtG,IAAI,OAAO,KAAK,IAAI;YAAE,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,+HAA+H;IAC/G,KAAK,CAAC,IAAI,CAAC,OAA2B;QACpD,OAAO,iBAAiB,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,2HAA2H;IACpH,MAAM,CAAC,0BAA0B,CAAC,OAAwC;QAC/E,IAAI,OAAO,EAAE,UAAU,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC9C,OAAO,iLAAiL,CAAC;IAC3L,CAAC;IAED,gHAAgH;IAChG,KAAK,CAAC,MAAM,CAAC,OAA6B;QACxD,MAAM,OAAO,GAAG,oCAAkC,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACvF,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AArCY,kCAAkC;IAD9C,aAAa,CAAC,UAAU,EAAE,8BAA8B,CAAC;GAC7C,kCAAkC,CAqC9C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type EntityDeleteOptions, type ValidationResult } from '@memberjunction/core';
|
|
2
|
+
import { MJMLModelScoringBindingEntity, type MJMLModelEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/** A parsed `TargetColumnSource`: the member of the scored result it names, and the class for `$.Probabilities.<class>`. */
|
|
4
|
+
export type CopySourceRef = {
|
|
5
|
+
readonly Member: 'Value' | 'Class' | 'AdverseProbability';
|
|
6
|
+
} | {
|
|
7
|
+
readonly Member: 'Probabilities';
|
|
8
|
+
readonly ClassName: string;
|
|
9
|
+
};
|
|
10
|
+
/** What the copy-source check knows of the pipeline's model output: classification or not, and the class order when known. */
|
|
11
|
+
interface OutputKind {
|
|
12
|
+
readonly IsClassification: boolean;
|
|
13
|
+
readonly ClassOrder: readonly string[] | null;
|
|
14
|
+
/** Where the kind was read from, for the refusal text. */
|
|
15
|
+
readonly From: string;
|
|
16
|
+
}
|
|
17
|
+
/** The model columns the copy-source check reads. */
|
|
18
|
+
type PublishedModelRow = Pick<MJMLModelEntity, 'ID' | 'OutputSemantics' | 'ProblemType'>;
|
|
19
|
+
/**
|
|
20
|
+
* `MJ: ML Model Scoring Bindings`: a binding defines one prediction feature of a target entity, scored with its training
|
|
21
|
+
* pipeline's Published model. A save is refused, one structured error per rule, when the pipeline, feature name, target
|
|
22
|
+
* entity or view authorization is missing; when the feature name is already used on the target entity by another binding
|
|
23
|
+
* or by a Feature Pipeline's output (the long-format Feature Value key would mix them); when the target column is not an
|
|
24
|
+
* updatable field of the target entity; and when the column has no copy source, or a source that does not parse or that
|
|
25
|
+
* the pipeline's model output cannot give; and when the target entity is not the entity the pipeline's models score
|
|
26
|
+
* (its Prediction Unit's row entity, else its target entity: D4-168), since every scoring run of such a binding would
|
|
27
|
+
* be refused `scope-entity-mismatch`. A delete is refused unless the binding is withdrawn and no Feature Value names
|
|
28
|
+
* it. Every read goes through the entity's own provider.
|
|
29
|
+
*/
|
|
30
|
+
export declare class MJMLModelScoringBindingEntityServer extends MJMLModelScoringBindingEntity {
|
|
31
|
+
/** The base checks, then the binding's own rules. */
|
|
32
|
+
ValidateAsync(): Promise<ValidationResult>;
|
|
33
|
+
/** Refused with "Withdraw the binding first" unless the binding is withdrawn and no Feature Value row names it. */
|
|
34
|
+
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Parses a `TargetColumnSource`: `$.Value`, `$.Class`, `$.AdverseProbability` or `$.Probabilities.<class>`. Pure.
|
|
37
|
+
*
|
|
38
|
+
* @returns the reference, or null when the text is none of those
|
|
39
|
+
*/
|
|
40
|
+
static ParseCopySource(text: string): CopySourceRef | null;
|
|
41
|
+
/**
|
|
42
|
+
* The problem with copying `ref` from a model whose output is `kind`, or null when the output gives it. Pure.
|
|
43
|
+
*/
|
|
44
|
+
static CopySourceProblem(ref: CopySourceRef, kind: OutputKind): string | null;
|
|
45
|
+
/** One error per required field the base checks did not already name. */
|
|
46
|
+
private checkRequired;
|
|
47
|
+
/** The feature name is unique on the target entity among bindings and is not a Feature Pipeline output there. */
|
|
48
|
+
private checkFeatureName;
|
|
49
|
+
/**
|
|
50
|
+
* The target entity is the entity the pipeline's models score: the row entity of its Prediction Unit when it names
|
|
51
|
+
* one, else its `TargetEntityID` (D4-168). Compared by entity ID.
|
|
52
|
+
*/
|
|
53
|
+
private checkScoringEntity;
|
|
54
|
+
/** The entity `pipeline`'s models score; null when it cannot be told, the reason recorded on `result`. */
|
|
55
|
+
private static scoringEntity;
|
|
56
|
+
/**
|
|
57
|
+
* The output names a Feature Pipeline's spec declares (`Outputs[].Name`); none for a configuration that does not parse.
|
|
58
|
+
* Pure.
|
|
59
|
+
*/
|
|
60
|
+
static OutputNames(configuration: string | null): string[];
|
|
61
|
+
/** The target column is an existing, updatable field of the target entity. */
|
|
62
|
+
private checkTargetColumn;
|
|
63
|
+
/** A target column has a copy source that parses and that the pipeline's model output can give. */
|
|
64
|
+
private checkCopySource;
|
|
65
|
+
/**
|
|
66
|
+
* What the pipeline's model output is: from its newest Published model's `OutputSemantics` (or its `ProblemType` when
|
|
67
|
+
* it has none), else from the pipeline's `ProblemType`. Null when it could not be read, the reason on `result`.
|
|
68
|
+
*/
|
|
69
|
+
private readOutputKind;
|
|
70
|
+
/** A Published model's output kind: its semantics' task when they parse, else its `ProblemType`. Pure. */
|
|
71
|
+
static ModelOutputKind(model: PublishedModelRow): OutputKind;
|
|
72
|
+
/** Why the binding may not be deleted now, or null when it may. */
|
|
73
|
+
private deleteRefusal;
|
|
74
|
+
/** Every row of `entityName` matching `filter`, as plain rows; a failed read is returned as its error. */
|
|
75
|
+
private static readRows;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=MJMLModelScoringBindingEntityServer.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLModelScoringBindingEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLModelScoringBindingEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,mBAAmB,EAA0D,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpK,OAAO,EACL,6BAA6B,EAA6B,KAAK,eAAe,EAC/E,MAAM,+BAA+B,CAAC;AAQvC,4HAA4H;AAC5H,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,oBAAoB,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,8HAA8H;AAC9H,UAAU,UAAU;IAClB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9C,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qDAAqD;AACrD,KAAK,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,iBAAiB,GAAG,aAAa,CAAC,CAAC;AAsBzF;;;;;;;;;;GAUG;AACH,qBACa,mCAAoC,SAAQ,6BAA6B;IACpF,qDAAqD;IAC/B,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAkBhE,mHAAmH;IAC7F,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7E;;;;OAIG;WACW,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAUjE;;OAEG;WACW,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAUpF,yEAAyE;IACzE,OAAO,CAAC,aAAa;IASrB,iHAAiH;YACnG,gBAAgB;IAmB9B;;;OAGG;YACW,kBAAkB;IAehC,0GAA0G;mBACrF,aAAa;IAwBlC;;;OAGG;WACW,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE;IAOjE,8EAA8E;IAC9E,OAAO,CAAC,iBAAiB;IAczB,mGAAmG;YACrF,eAAe;IAiB7B;;;OAGG;YACW,cAAc;IAkB5B,0GAA0G;WAC5F,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU;IAUnE,mEAAmE;YACrD,aAAa;IAa3B,0GAA0G;mBACrF,QAAQ;CAI9B"}
|
|
@@ -0,0 +1,273 @@
|
|
|
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 MJMLModelScoringBindingEntityServer_1;
|
|
8
|
+
import { BaseEntity, RunView } from '@memberjunction/core';
|
|
9
|
+
import { EscapeSQLString, RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
10
|
+
import { MJMLModelScoringBindingEntity, } from '@memberjunction/core-entities';
|
|
11
|
+
import { JsonParse, PredictionUnit, RegistrySchemas, TaskTypeRules } from '@memberjunction/predictive-studio-core';
|
|
12
|
+
import { FormScopeRefusalResult } from './FormScopeGuard.js';
|
|
13
|
+
import { VersionedRowGuard } from './MJMLPredictionUnitEntityServer.server.js';
|
|
14
|
+
/** The binding columns a save must carry. */
|
|
15
|
+
const REQUIRED_FIELDS = ['MLTrainingPipelineID', 'FeatureName', 'TargetEntityID', 'ViewAuthorizationID'];
|
|
16
|
+
/** The Prediction Unit columns the scoring-entity check parses. */
|
|
17
|
+
const PREDICTION_UNIT_FIELDS = [
|
|
18
|
+
'ID', 'LineageRootID', 'Version', 'Name', 'UnitRows', 'LabelRule', 'LabelWindowDays', 'LabelGapDays', 'TaskType', 'LabelVersion',
|
|
19
|
+
'Censoring', 'ChangeHistoryPolicy', 'GroupKey', 'TemporalSpec', 'DecisionSpec', 'IncumbentHeuristic', 'AuthoredBy',
|
|
20
|
+
];
|
|
21
|
+
/** The Record Process work type a Feature Pipeline runs as (its `Configuration` is the pipeline's spec). */
|
|
22
|
+
const FEATURE_PIPELINE_WORK_TYPE = 'Infer';
|
|
23
|
+
/**
|
|
24
|
+
* `MJ: ML Model Scoring Bindings`: a binding defines one prediction feature of a target entity, scored with its training
|
|
25
|
+
* pipeline's Published model. A save is refused, one structured error per rule, when the pipeline, feature name, target
|
|
26
|
+
* entity or view authorization is missing; when the feature name is already used on the target entity by another binding
|
|
27
|
+
* or by a Feature Pipeline's output (the long-format Feature Value key would mix them); when the target column is not an
|
|
28
|
+
* updatable field of the target entity; and when the column has no copy source, or a source that does not parse or that
|
|
29
|
+
* the pipeline's model output cannot give; and when the target entity is not the entity the pipeline's models score
|
|
30
|
+
* (its Prediction Unit's row entity, else its target entity: D4-168), since every scoring run of such a binding would
|
|
31
|
+
* be refused `scope-entity-mismatch`. A delete is refused unless the binding is withdrawn and no Feature Value names
|
|
32
|
+
* it. Every read goes through the entity's own provider.
|
|
33
|
+
*/
|
|
34
|
+
let MJMLModelScoringBindingEntityServer = MJMLModelScoringBindingEntityServer_1 = class MJMLModelScoringBindingEntityServer extends MJMLModelScoringBindingEntity {
|
|
35
|
+
/** The base checks, then the binding's own rules. */
|
|
36
|
+
async ValidateAsync() {
|
|
37
|
+
const result = await super.ValidateAsync();
|
|
38
|
+
this.checkRequired(result);
|
|
39
|
+
const provider = this.ProviderToUse;
|
|
40
|
+
if (!VersionedRowGuard.IsMetadataProvider(provider)) {
|
|
41
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', "the entity's provider is not a metadata provider, so the binding's pipeline and target entity cannot be read");
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
if (this.TargetEntityID && this.FeatureName)
|
|
45
|
+
await this.checkFeatureName(result, provider);
|
|
46
|
+
if (this.TargetEntityID && this.MLTrainingPipelineID)
|
|
47
|
+
await this.checkScoringEntity(result, provider);
|
|
48
|
+
const target = this.TargetEntityID ? provider.Entities.find((e) => UUIDsEqual(e.ID, this.TargetEntityID)) : undefined;
|
|
49
|
+
if (this.TargetColumn) {
|
|
50
|
+
this.checkTargetColumn(result, target);
|
|
51
|
+
await this.checkCopySource(result, provider);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
/** Refused with "Withdraw the binding first" unless the binding is withdrawn and no Feature Value row names it. */
|
|
56
|
+
async Delete(options) {
|
|
57
|
+
const refusal = await this.deleteRefusal();
|
|
58
|
+
if (refusal !== null) {
|
|
59
|
+
this.RegisterResultHistoryEntry(FormScopeRefusalResult('delete', refusal));
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return super.Delete(options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Parses a `TargetColumnSource`: `$.Value`, `$.Class`, `$.AdverseProbability` or `$.Probabilities.<class>`. Pure.
|
|
66
|
+
*
|
|
67
|
+
* @returns the reference, or null when the text is none of those
|
|
68
|
+
*/
|
|
69
|
+
static ParseCopySource(text) {
|
|
70
|
+
const t = text.trim();
|
|
71
|
+
if (t === '$.Value')
|
|
72
|
+
return { Member: 'Value' };
|
|
73
|
+
if (t === '$.Class')
|
|
74
|
+
return { Member: 'Class' };
|
|
75
|
+
if (t === '$.AdverseProbability')
|
|
76
|
+
return { Member: 'AdverseProbability' };
|
|
77
|
+
const prefix = '$.Probabilities.';
|
|
78
|
+
if (t.startsWith(prefix) && t.length > prefix.length)
|
|
79
|
+
return { Member: 'Probabilities', ClassName: t.substring(prefix.length) };
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The problem with copying `ref` from a model whose output is `kind`, or null when the output gives it. Pure.
|
|
84
|
+
*/
|
|
85
|
+
static CopySourceProblem(ref, kind) {
|
|
86
|
+
if (ref.Member === 'Value') {
|
|
87
|
+
return kind.IsClassification ? `$.Value is a regression output; ${kind.From} is a classification, use $.Class, $.AdverseProbability or $.Probabilities.<class>` : null;
|
|
88
|
+
}
|
|
89
|
+
if (!kind.IsClassification)
|
|
90
|
+
return `$.${ref.Member} is a classification output; ${kind.From} is a regression, use $.Value`;
|
|
91
|
+
if (ref.Member !== 'Probabilities')
|
|
92
|
+
return null;
|
|
93
|
+
if (kind.ClassOrder === null)
|
|
94
|
+
return `$.Probabilities.${ref.ClassName} cannot be checked: ${kind.From} states no class order`;
|
|
95
|
+
return kind.ClassOrder.includes(ref.ClassName) ? null : `"${ref.ClassName}" is not a class of ${kind.From} (classes: ${kind.ClassOrder.join(', ')})`;
|
|
96
|
+
}
|
|
97
|
+
/** One error per required field the base checks did not already name. */
|
|
98
|
+
checkRequired(result) {
|
|
99
|
+
for (const field of REQUIRED_FIELDS) {
|
|
100
|
+
const value = this[field];
|
|
101
|
+
if (value !== null && value !== undefined && String(value).trim().length > 0)
|
|
102
|
+
continue;
|
|
103
|
+
if (result.Errors.some((e) => e.Source === field))
|
|
104
|
+
continue;
|
|
105
|
+
VersionedRowGuard.Fail(result, field, `${field} is required: a scoring binding names its training pipeline, feature name, target entity and view authorization`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** The feature name is unique on the target entity among bindings and is not a Feature Pipeline output there. */
|
|
109
|
+
async checkFeatureName(result, provider) {
|
|
110
|
+
const entityFilter = `TargetEntityID='${EscapeSQLString(this.TargetEntityID || '')}' AND FeatureName='${EscapeSQLString(this.FeatureName)}'`;
|
|
111
|
+
const selfFilter = this.IsSaved ? ` AND ID<>'${EscapeSQLString(this.ID)}'` : ''; // pk-filter-ok: MJ: ML Model Scoring Bindings is an MJ core entity keyed by ID
|
|
112
|
+
const other = await VersionedRowGuard.ReadOneRow(provider, 'MJ: ML Model Scoring Bindings', entityFilter + selfFilter, this.ActiveUser, ['ID']);
|
|
113
|
+
if (other.Error !== null) {
|
|
114
|
+
VersionedRowGuard.Fail(result, 'FeatureName', `Reading the target entity's other scoring bindings failed: ${other.Error}`);
|
|
115
|
+
}
|
|
116
|
+
else if (other.Row !== null) {
|
|
117
|
+
VersionedRowGuard.Fail(result, 'FeatureName', `Feature name "${this.FeatureName}" is already used by scoring binding ${other.Row.ID} on the same target entity`);
|
|
118
|
+
}
|
|
119
|
+
const pipelines = await MJMLModelScoringBindingEntityServer_1.readRows(provider, 'MJ: Record Processes', `EntityID='${EscapeSQLString(this.TargetEntityID || '')}' AND WorkType='${FEATURE_PIPELINE_WORK_TYPE}'`, this.ActiveUser, ['ID', 'Name', 'Configuration']);
|
|
120
|
+
if (pipelines.Error !== null) {
|
|
121
|
+
VersionedRowGuard.Fail(result, 'FeatureName', `Reading the target entity's Feature Pipelines failed: ${pipelines.Error}`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const clash = pipelines.Rows.find((p) => MJMLModelScoringBindingEntityServer_1.OutputNames(p.Configuration).some((n) => n.toLowerCase() === this.FeatureName.toLowerCase()));
|
|
125
|
+
if (clash)
|
|
126
|
+
VersionedRowGuard.Fail(result, 'FeatureName', `Feature name "${this.FeatureName}" is an output of Feature Pipeline "${clash.Name}" on the same target entity`);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The target entity is the entity the pipeline's models score: the row entity of its Prediction Unit when it names
|
|
130
|
+
* one, else its `TargetEntityID` (D4-168). Compared by entity ID.
|
|
131
|
+
*/
|
|
132
|
+
async checkScoringEntity(result, provider) {
|
|
133
|
+
const pipeline = await VersionedRowGuard.ReadOneRow(provider, 'MJ: ML Training Pipelines', `ID='${EscapeSQLString(this.MLTrainingPipelineID)}'`, // pk-filter-ok: MJ: ML Training Pipelines is an MJ core entity keyed by ID
|
|
134
|
+
this.ActiveUser, ['ID', 'Name', 'TargetEntityID', 'PredictionUnitID']);
|
|
135
|
+
if (pipeline.Error !== null || pipeline.Row === null) {
|
|
136
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', pipeline.Error !== null ? `Reading ML Training Pipeline ${this.MLTrainingPipelineID} failed: ${pipeline.Error}` : `ML Training Pipeline ${this.MLTrainingPipelineID} does not exist`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const label = `${pipeline.Row.Name} (${pipeline.Row.ID})`;
|
|
140
|
+
const scoring = await MJMLModelScoringBindingEntityServer_1.scoringEntity(result, provider, pipeline.Row, label, this.ActiveUser);
|
|
141
|
+
if (scoring === null || UUIDsEqual(scoring.ID, this.TargetEntityID))
|
|
142
|
+
return;
|
|
143
|
+
const target = provider.Entities.find((e) => UUIDsEqual(e.ID, this.TargetEntityID))?.Name || this.TargetEntityID;
|
|
144
|
+
VersionedRowGuard.Fail(result, 'TargetEntityID', `${target} is not the entity pipeline ${label}'s models score (${scoring.Name}): every scoring run of this binding would be refused scope-entity-mismatch`);
|
|
145
|
+
}
|
|
146
|
+
/** The entity `pipeline`'s models score; null when it cannot be told, the reason recorded on `result`. */
|
|
147
|
+
static async scoringEntity(result, provider, pipeline, label, user) {
|
|
148
|
+
if (!pipeline.PredictionUnitID) {
|
|
149
|
+
const entity = provider.Entities.find((e) => UUIDsEqual(e.ID, pipeline.TargetEntityID));
|
|
150
|
+
return { ID: pipeline.TargetEntityID, Name: entity?.Name || pipeline.TargetEntityID };
|
|
151
|
+
}
|
|
152
|
+
const unit = await VersionedRowGuard.ReadOneRow(provider, 'MJ: ML Prediction Units', `ID='${EscapeSQLString(pipeline.PredictionUnitID)}'`, user, PREDICTION_UNIT_FIELDS); // pk-filter-ok: MJ: ML Prediction Units is an MJ core entity keyed by ID
|
|
153
|
+
if (unit.Error !== null || unit.Row === null) {
|
|
154
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', unit.Error !== null ? `Reading Prediction Unit ${pipeline.PredictionUnitID} of pipeline ${label} failed: ${unit.Error}` : `Prediction Unit ${pipeline.PredictionUnitID} of pipeline ${label} does not exist`);
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const parsed = PredictionUnit.ParsePredictionUnitRow(unit.Row);
|
|
158
|
+
if (parsed.Ok === false) {
|
|
159
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', `Prediction Unit ${pipeline.PredictionUnitID} of pipeline ${label} does not parse: ${parsed.Errors.join('; ')}`);
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const name = PredictionUnit.UnitRowEntityName(parsed.Value.rows);
|
|
163
|
+
const entity = provider.EntityByName(name);
|
|
164
|
+
if (!entity) {
|
|
165
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', `The row entity ${name} of Prediction Unit ${pipeline.PredictionUnitID} (pipeline ${label}) is not in the provider's metadata`);
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return { ID: entity.ID, Name: entity.Name };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The output names a Feature Pipeline's spec declares (`Outputs[].Name`); none for a configuration that does not parse.
|
|
172
|
+
* Pure.
|
|
173
|
+
*/
|
|
174
|
+
static OutputNames(configuration) {
|
|
175
|
+
const json = JsonParse.ParseJsonText(configuration, 'Configuration');
|
|
176
|
+
if (json.Ok === false || !JsonParse.IsJsonObject(json.Value))
|
|
177
|
+
return [];
|
|
178
|
+
const outputs = JsonParse.JsonArrayField(json.Value, 'Outputs') || [];
|
|
179
|
+
return outputs.flatMap((o) => (JsonParse.IsJsonObject(o) ? [JsonParse.JsonString(o, 'Name')] : [])).filter((n) => n !== null);
|
|
180
|
+
}
|
|
181
|
+
/** The target column is an existing, updatable field of the target entity. */
|
|
182
|
+
checkTargetColumn(result, target) {
|
|
183
|
+
if (!target) {
|
|
184
|
+
if (this.TargetEntityID)
|
|
185
|
+
VersionedRowGuard.Fail(result, 'TargetEntityID', `Target entity ${this.TargetEntityID} is not in the provider's metadata`);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const column = this.TargetColumn || '';
|
|
189
|
+
const field = target.Fields.find((f) => f.Name.toLowerCase() === column.toLowerCase());
|
|
190
|
+
if (!field) {
|
|
191
|
+
VersionedRowGuard.Fail(result, 'TargetColumn', `Target column "${column}" is not a field of ${target.Name}`);
|
|
192
|
+
}
|
|
193
|
+
else if (field.IsPrimaryKey || field.IsVirtual || field.ReadOnly || !field.AllowUpdateAPI) {
|
|
194
|
+
VersionedRowGuard.Fail(result, 'TargetColumn', `Target column "${column}" of ${target.Name} is not an updatable field`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/** A target column has a copy source that parses and that the pipeline's model output can give. */
|
|
198
|
+
async checkCopySource(result, provider) {
|
|
199
|
+
if (!this.TargetColumnSource || this.TargetColumnSource.trim().length === 0) {
|
|
200
|
+
VersionedRowGuard.Fail(result, 'TargetColumnSource', 'TargetColumnSource is required when TargetColumn is set: it names the scored value the column receives');
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const ref = MJMLModelScoringBindingEntityServer_1.ParseCopySource(this.TargetColumnSource);
|
|
204
|
+
if (ref === null) {
|
|
205
|
+
VersionedRowGuard.Fail(result, 'TargetColumnSource', `TargetColumnSource "${this.TargetColumnSource}" is not one of $.Value, $.Class, $.AdverseProbability or $.Probabilities.<class>`);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (!this.MLTrainingPipelineID)
|
|
209
|
+
return;
|
|
210
|
+
const kind = await this.readOutputKind(result, provider);
|
|
211
|
+
if (kind === null)
|
|
212
|
+
return;
|
|
213
|
+
const problem = MJMLModelScoringBindingEntityServer_1.CopySourceProblem(ref, kind);
|
|
214
|
+
if (problem !== null)
|
|
215
|
+
VersionedRowGuard.Fail(result, 'TargetColumnSource', problem);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* What the pipeline's model output is: from its newest Published model's `OutputSemantics` (or its `ProblemType` when
|
|
219
|
+
* it has none), else from the pipeline's `ProblemType`. Null when it could not be read, the reason on `result`.
|
|
220
|
+
*/
|
|
221
|
+
async readOutputKind(result, provider) {
|
|
222
|
+
const pipelineId = EscapeSQLString(this.MLTrainingPipelineID);
|
|
223
|
+
const published = await MJMLModelScoringBindingEntityServer_1.readRows(provider, 'MJ: ML Models', `PipelineID='${pipelineId}' AND Status='Published'`, this.ActiveUser, ['ID', 'OutputSemantics', 'ProblemType'], 'Version DESC');
|
|
224
|
+
if (published.Error !== null) {
|
|
225
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', `Reading the pipeline's Published model failed: ${published.Error}`);
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
const model = published.Rows[0];
|
|
229
|
+
if (model)
|
|
230
|
+
return MJMLModelScoringBindingEntityServer_1.ModelOutputKind(model);
|
|
231
|
+
const pipeline = await VersionedRowGuard.ReadOneRow(provider, 'MJ: ML Training Pipelines', `ID='${pipelineId}'`, this.ActiveUser, ['ID', 'ProblemType']); // pk-filter-ok: MJ: ML Training Pipelines is an MJ core entity keyed by ID
|
|
232
|
+
if (pipeline.Error !== null || pipeline.Row === null) {
|
|
233
|
+
VersionedRowGuard.Fail(result, 'MLTrainingPipelineID', pipeline.Error !== null ? `Reading ML Training Pipeline ${this.MLTrainingPipelineID} failed: ${pipeline.Error}` : `ML Training Pipeline ${this.MLTrainingPipelineID} does not exist`);
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
return { IsClassification: pipeline.Row.ProblemType === 'classification', ClassOrder: null, From: `ML Training Pipeline ${pipeline.Row.ID}` };
|
|
237
|
+
}
|
|
238
|
+
/** A Published model's output kind: its semantics' task when they parse, else its `ProblemType`. Pure. */
|
|
239
|
+
static ModelOutputKind(model) {
|
|
240
|
+
const from = `the Published ML Model ${model.ID}`;
|
|
241
|
+
const semantics = RegistrySchemas.ParseOutputSemantics(model.OutputSemantics);
|
|
242
|
+
if (semantics.Ok === false)
|
|
243
|
+
return { IsClassification: model.ProblemType === 'classification', ClassOrder: null, From: from };
|
|
244
|
+
const task = semantics.Value.task;
|
|
245
|
+
return TaskTypeRules.IsClassificationTask(task)
|
|
246
|
+
? { IsClassification: true, ClassOrder: [...task.classOrder], From: from }
|
|
247
|
+
: { IsClassification: false, ClassOrder: null, From: from };
|
|
248
|
+
}
|
|
249
|
+
/** Why the binding may not be deleted now, or null when it may. */
|
|
250
|
+
async deleteRefusal() {
|
|
251
|
+
if (this.Status !== 'Withdrawn') {
|
|
252
|
+
return 'Withdraw the binding first: an active scoring binding is withdrawn (its column copies cleared) before it is deleted';
|
|
253
|
+
}
|
|
254
|
+
const provider = this.ProviderToUse;
|
|
255
|
+
if (!VersionedRowGuard.IsMetadataProvider(provider)) {
|
|
256
|
+
return "Withdraw the binding first: the entity's provider is not a metadata provider, so the binding's Feature Values cannot be counted";
|
|
257
|
+
}
|
|
258
|
+
const rows = await VersionedRowGuard.ReadOneRow(provider, 'MJ: Feature Values', `MLModelScoringBindingID='${EscapeSQLString(this.ID)}'`, this.ActiveUser, ['ID']);
|
|
259
|
+
if (rows.Error !== null)
|
|
260
|
+
return `Withdraw the binding first: reading the binding's Feature Values failed: ${rows.Error}`;
|
|
261
|
+
return rows.Row === null ? null : 'Withdraw the binding first and delete its Feature Values: Feature Value rows still name this binding';
|
|
262
|
+
}
|
|
263
|
+
/** Every row of `entityName` matching `filter`, as plain rows; a failed read is returned as its error. */
|
|
264
|
+
static async readRows(provider, entityName, filter, user, fields, orderBy) {
|
|
265
|
+
const r = await RunView.FromMetadataProvider(provider).RunView({ EntityName: entityName, ExtraFilter: filter, Fields: [...fields], ...(orderBy ? { OrderBy: orderBy } : {}), ResultType: 'simple' }, user);
|
|
266
|
+
return r.Success ? { Rows: r.Results, Error: null } : { Rows: [], Error: r.ErrorMessage || 'unknown error' };
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
MJMLModelScoringBindingEntityServer = MJMLModelScoringBindingEntityServer_1 = __decorate([
|
|
270
|
+
RegisterClass(BaseEntity, 'MJ: ML Model Scoring Bindings')
|
|
271
|
+
], MJMLModelScoringBindingEntityServer);
|
|
272
|
+
export { MJMLModelScoringBindingEntityServer };
|
|
273
|
+
//# sourceMappingURL=MJMLModelScoringBindingEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLModelScoringBindingEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLModelScoringBindingEntityServer.server.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAA2G,MAAM,sBAAsB,CAAC;AACpK,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EACL,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAA6C,MAAM,wCAAwC,CAAC;AAC9J,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,6CAA6C;AAC7C,MAAM,eAAe,GAAG,CAAC,sBAAsB,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,CAAU,CAAC;AAqBlH,mEAAmE;AACnE,MAAM,sBAAsB,GAAsD;IAChF,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc;IA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|
1
|
+
import { type ValidationResult } from '@memberjunction/core';
|
|
2
|
+
import { MJMLOutputBindingEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/**
|
|
4
|
+
* `MJ: ML Output Bindings` (PR 4 §5.1, S9.5): how one surface shows a model's output. A save whose row breaks the
|
|
5
|
+
* model's `OutputSemantics` is refused: `ValidateAsync()` reads the model through the entity's own provider and checks
|
|
6
|
+
* THIS row alone with `SemanticsRules.CheckRow` (the lifecycle gate's pre-publication check covers the whole set of a
|
|
7
|
+
* model's rows), each mismatch on the field at fault. The rule is Core's; this class only calls it.
|
|
8
|
+
*/
|
|
9
|
+
export declare class MJMLOutputBindingEntityServer extends MJMLOutputBindingEntity {
|
|
10
|
+
/**
|
|
11
|
+
* The base checks, then this row's surface against the model's semantics. A provider that is not a metadata
|
|
12
|
+
* provider, a model that is missing or unreadable, and semantics that do not parse are each refused on `ModelID`.
|
|
13
|
+
*/
|
|
14
|
+
ValidateAsync(): Promise<ValidationResult>;
|
|
15
|
+
/** The model's parsed semantics; null when they could not be had, the reason recorded on `result` against `ModelID`. */
|
|
16
|
+
private readSemantics;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=MJMLOutputBindingEntityServer.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLOutputBindingEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLOutputBindingEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEjG,OAAO,EAAE,uBAAuB,EAAwB,MAAM,+BAA+B,CAAC;AAO9F;;;;;GAKG;AACH,qBACa,6BAA8B,SAAQ,uBAAuB;IACxE;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAahE,wHAAwH;YAC1G,aAAa;CAkB5B"}
|