@memberjunction/core-entities-server 6.3.0-edge.0 → 6.3.0-edge.2
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/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/AnchoredConversationReadSecurityHook.d.ts +1 -0
- package/dist/custom/AnchoredConversationReadSecurityHook.d.ts.map +1 -1
- package/dist/custom/AnchoredConversationReadSecurityHook.js +23 -10
- package/dist/custom/AnchoredConversationReadSecurityHook.js.map +1 -1
- package/dist/custom/ArtifactSecurityHookHelpers.d.ts +223 -0
- package/dist/custom/ArtifactSecurityHookHelpers.d.ts.map +1 -0
- package/dist/custom/ArtifactSecurityHookHelpers.js +1402 -0
- package/dist/custom/ArtifactSecurityHookHelpers.js.map +1 -0
- 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/MJAIAgentEntityServer.server.d.ts +80 -34
- package/dist/custom/MJAIAgentEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJAIAgentEntityServer.server.js +383 -43
- package/dist/custom/MJAIAgentEntityServer.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 +93 -0
- package/dist/custom/MJAIAgentPersonaEntityServer.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/MJAIBridgeAgentIdentityEntityServer.server.js +2 -2
- package/dist/custom/MJAIBridgeAgentIdentityEntityServer.server.js.map +1 -1
- package/dist/custom/MJArtifactEntityServer.server.d.ts +38 -0
- package/dist/custom/MJArtifactEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJArtifactEntityServer.server.js +436 -0
- package/dist/custom/MJArtifactEntityServer.server.js.map +1 -0
- package/dist/custom/MJArtifactGuestShareLinkEntityServer.server.d.ts +32 -0
- package/dist/custom/MJArtifactGuestShareLinkEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJArtifactGuestShareLinkEntityServer.server.js +434 -0
- package/dist/custom/MJArtifactGuestShareLinkEntityServer.server.js.map +1 -0
- package/dist/custom/MJArtifactPermissionEntityServer.server.d.ts +18 -0
- package/dist/custom/MJArtifactPermissionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJArtifactPermissionEntityServer.server.js +194 -0
- package/dist/custom/MJArtifactPermissionEntityServer.server.js.map +1 -0
- package/dist/custom/MJArtifactVersionAttributeEntityServer.server.d.ts +22 -0
- package/dist/custom/MJArtifactVersionAttributeEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJArtifactVersionAttributeEntityServer.server.js +312 -0
- package/dist/custom/MJArtifactVersionAttributeEntityServer.server.js.map +1 -0
- package/dist/custom/MJArtifactVersionEntityServer.server.d.ts +76 -12
- package/dist/custom/MJArtifactVersionEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJArtifactVersionEntityServer.server.js +934 -55
- package/dist/custom/MJArtifactVersionEntityServer.server.js.map +1 -1
- package/dist/custom/MJArtifactWorkingStateEntityServer.server.d.ts +42 -0
- package/dist/custom/MJArtifactWorkingStateEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJArtifactWorkingStateEntityServer.server.js +547 -0
- package/dist/custom/MJArtifactWorkingStateEntityServer.server.js.map +1 -0
- package/dist/custom/MJCollectionArtifactEntityServer.server.d.ts +36 -0
- package/dist/custom/MJCollectionArtifactEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJCollectionArtifactEntityServer.server.js +533 -0
- package/dist/custom/MJCollectionArtifactEntityServer.server.js.map +1 -0
- package/dist/custom/MJCollectionEntityServer.server.d.ts +23 -0
- package/dist/custom/MJCollectionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJCollectionEntityServer.server.js +555 -0
- package/dist/custom/MJCollectionEntityServer.server.js.map +1 -0
- package/dist/custom/MJCollectionPermissionEntityServer.server.d.ts +18 -0
- package/dist/custom/MJCollectionPermissionEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJCollectionPermissionEntityServer.server.js +196 -0
- package/dist/custom/MJCollectionPermissionEntityServer.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 +6 -20
- package/dist/custom/MJConversationEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJConversationEntityServer.server.js +293 -16
- package/dist/custom/MJConversationEntityServer.server.js.map +1 -1
- package/dist/custom/MJEntityEntityServer.server.d.ts +9 -0
- package/dist/custom/MJEntityEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJEntityEntityServer.server.js +31 -2
- package/dist/custom/MJEntityEntityServer.server.js.map +1 -1
- package/dist/custom/MJGraphConceptEntityServer.server.d.ts +92 -0
- package/dist/custom/MJGraphConceptEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJGraphConceptEntityServer.server.js +203 -0
- package/dist/custom/MJGraphConceptEntityServer.server.js.map +1 -0
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts +16 -2
- package/dist/custom/MJGraphEdgeEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJGraphEdgeEntityServer.server.js +26 -4
- package/dist/custom/MJGraphEdgeEntityServer.server.js.map +1 -1
- package/dist/custom/MJListEntityServer.server.d.ts +26 -10
- package/dist/custom/MJListEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJListEntityServer.server.js +118 -20
- 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/MJProjectEntityServer.server.d.ts +28 -2
- package/dist/custom/MJProjectEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJProjectEntityServer.server.js +115 -2
- package/dist/custom/MJProjectEntityServer.server.js.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.d.ts +41 -4
- package/dist/custom/MJQueryEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQueryEntityServer.server.js +99 -14
- package/dist/custom/MJQueryEntityServer.server.js.map +1 -1
- package/dist/custom/MJQuerySQLEntityServer.server.d.ts +13 -1
- package/dist/custom/MJQuerySQLEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJQuerySQLEntityServer.server.js +37 -3
- 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/MJScheduledJobEntityServer.server.d.ts +27 -0
- package/dist/custom/MJScheduledJobEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJScheduledJobEntityServer.server.js +56 -0
- package/dist/custom/MJScheduledJobEntityServer.server.js.map +1 -0
- package/dist/custom/MJScopedNotificationConfigEntityServer.server.d.ts +15 -0
- package/dist/custom/MJScopedNotificationConfigEntityServer.server.d.ts.map +1 -0
- package/dist/custom/MJScopedNotificationConfigEntityServer.server.js +48 -0
- package/dist/custom/MJScopedNotificationConfigEntityServer.server.js.map +1 -0
- package/dist/custom/MJTagEntityServer.server.d.ts +11 -1
- package/dist/custom/MJTagEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJTagEntityServer.server.js +28 -3
- package/dist/custom/MJTagEntityServer.server.js.map +1 -1
- package/dist/custom/MJUserEntityServer.server.d.ts +2 -1
- package/dist/custom/MJUserEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserEntityServer.server.js +2 -1
- package/dist/custom/MJUserEntityServer.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 +8 -2
- package/dist/custom/MJUserViewEntityServer.server.d.ts.map +1 -1
- package/dist/custom/MJUserViewEntityServer.server.js +25 -12
- package/dist/custom/MJUserViewEntityServer.server.js.map +1 -1
- package/dist/custom/RestrictedFieldCommentClassifier.d.ts +9 -3
- package/dist/custom/RestrictedFieldCommentClassifier.d.ts.map +1 -1
- package/dist/custom/RestrictedFieldCommentClassifier.js +91 -15
- package/dist/custom/RestrictedFieldCommentClassifier.js.map +1 -1
- package/dist/custom/RestrictedFieldDecision.d.ts +121 -0
- package/dist/custom/RestrictedFieldDecision.d.ts.map +1 -0
- package/dist/custom/RestrictedFieldDecision.js +168 -0
- package/dist/custom/RestrictedFieldDecision.js.map +1 -0
- package/dist/custom/SpreadsheetWorkerEntry.d.ts +25 -0
- package/dist/custom/SpreadsheetWorkerEntry.d.ts.map +1 -0
- package/dist/custom/SpreadsheetWorkerEntry.js +37 -0
- package/dist/custom/SpreadsheetWorkerEntry.js.map +1 -0
- package/dist/custom/SpreadsheetWorkerRunner.d.ts +45 -0
- package/dist/custom/SpreadsheetWorkerRunner.d.ts.map +1 -0
- package/dist/custom/SpreadsheetWorkerRunner.js +243 -0
- package/dist/custom/SpreadsheetWorkerRunner.js.map +1 -0
- package/dist/custom/approvalStamp.d.ts +19 -3
- package/dist/custom/approvalStamp.d.ts.map +1 -1
- package/dist/custom/approvalStamp.js +13 -3
- package/dist/custom/approvalStamp.js.map +1 -1
- package/dist/custom/fieldPermissionDelta.d.ts +15 -1
- package/dist/custom/fieldPermissionDelta.d.ts.map +1 -1
- package/dist/custom/fieldPermissionDelta.js +28 -7
- package/dist/custom/fieldPermissionDelta.js.map +1 -1
- package/dist/custom/fieldPermissionReconciler.d.ts +4 -1
- package/dist/custom/fieldPermissionReconciler.d.ts.map +1 -1
- package/dist/custom/fieldPermissionReconciler.js +4 -2
- package/dist/custom/fieldPermissionReconciler.js.map +1 -1
- package/dist/custom/graph/GraphFindPathServerOperation.d.ts +24 -0
- package/dist/custom/graph/GraphFindPathServerOperation.d.ts.map +1 -0
- package/dist/custom/graph/GraphFindPathServerOperation.js +88 -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/list-refresh/ListRefreshRoutine.d.ts +40 -0
- package/dist/custom/list-refresh/ListRefreshRoutine.d.ts.map +1 -0
- package/dist/custom/list-refresh/ListRefreshRoutine.js +114 -0
- package/dist/custom/list-refresh/ListRefreshRoutine.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +31 -30
|
@@ -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,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C;QACjN,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,YAAY,IAAI,eAAe,EAAE,CAAC;IAC/G,CAAC;CACF,CAAA;AApOY,mCAAmC;IAD/C,aAAa,CAAC,UAAU,EAAE,+BAA+B,CAAC;GAC9C,mCAAmC,CAoO/C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 } from '@memberjunction/core';
|
|
8
|
+
import { EscapeSQLString, RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { MJMLOutputBindingEntity } from '@memberjunction/core-entities';
|
|
10
|
+
import { RegistrySchemas, SemanticsRules } from '@memberjunction/predictive-studio-core';
|
|
11
|
+
import { VersionedRowGuard } from './MJMLPredictionUnitEntityServer.server.js';
|
|
12
|
+
/**
|
|
13
|
+
* `MJ: ML Output Bindings` (PR 4 §5.1, S9.5): how one surface shows a model's output. A save whose row breaks the
|
|
14
|
+
* model's `OutputSemantics` is refused: `ValidateAsync()` reads the model through the entity's own provider and checks
|
|
15
|
+
* THIS row alone with `SemanticsRules.CheckRow` (the lifecycle gate's pre-publication check covers the whole set of a
|
|
16
|
+
* model's rows), each mismatch on the field at fault. The rule is Core's; this class only calls it.
|
|
17
|
+
*/
|
|
18
|
+
let MJMLOutputBindingEntityServer = class MJMLOutputBindingEntityServer extends MJMLOutputBindingEntity {
|
|
19
|
+
/**
|
|
20
|
+
* The base checks, then this row's surface against the model's semantics. A provider that is not a metadata
|
|
21
|
+
* provider, a model that is missing or unreadable, and semantics that do not parse are each refused on `ModelID`.
|
|
22
|
+
*/
|
|
23
|
+
async ValidateAsync() {
|
|
24
|
+
const result = await super.ValidateAsync();
|
|
25
|
+
const provider = this.ProviderToUse;
|
|
26
|
+
if (!VersionedRowGuard.IsMetadataProvider(provider)) {
|
|
27
|
+
VersionedRowGuard.Fail(result, 'ModelID', "the entity's provider is not a metadata provider, so ML Model's OutputSemantics cannot be read to check the binding");
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
const semantics = await this.readSemantics(result, provider);
|
|
31
|
+
if (semantics === null)
|
|
32
|
+
return result;
|
|
33
|
+
for (const m of SemanticsRules.CheckRow(semantics, this))
|
|
34
|
+
VersionedRowGuard.Fail(result, m.Field, m.Message);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
/** The model's parsed semantics; null when they could not be had, the reason recorded on `result` against `ModelID`. */
|
|
38
|
+
async readSemantics(result, provider) {
|
|
39
|
+
const filter = `ID='${EscapeSQLString(this.ModelID)}'`; // pk-filter-ok: MJ: ML Models is an MJ core entity keyed by ID
|
|
40
|
+
const read = await VersionedRowGuard.ReadOneRow(provider, 'MJ: ML Models', filter, this.ActiveUser, ['ID', 'OutputSemantics']);
|
|
41
|
+
if (read.Error !== null) {
|
|
42
|
+
VersionedRowGuard.Fail(result, 'ModelID', `Reading ML Model ${this.ModelID} failed: ${read.Error}`);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (read.Row === null) {
|
|
46
|
+
VersionedRowGuard.Fail(result, 'ModelID', `ML Model ${this.ModelID} does not exist, so the binding cannot be checked against its semantics`);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const parsed = RegistrySchemas.ParseOutputSemantics(read.Row.OutputSemantics);
|
|
50
|
+
if (parsed.Ok === false) {
|
|
51
|
+
VersionedRowGuard.Fail(result, 'ModelID', `ML Model ${this.ModelID}'s OutputSemantics does not parse: ${parsed.Errors.join('; ')}`);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return parsed.Value;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
MJMLOutputBindingEntityServer = __decorate([
|
|
58
|
+
RegisterClass(BaseEntity, 'MJ: ML Output Bindings')
|
|
59
|
+
], MJMLOutputBindingEntityServer);
|
|
60
|
+
export { MJMLOutputBindingEntityServer };
|
|
61
|
+
//# sourceMappingURL=MJMLOutputBindingEntityServer.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJMLOutputBindingEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLOutputBindingEntityServer.server.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAiD,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAwB,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,cAAc,EAAwB,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAK5E;;;;;GAKG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,uBAAuB;IACxE;;;OAGG;IACa,KAAK,CAAC,aAAa;QACjC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;QACpC,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpD,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,qHAAqH,CAAC,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M,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YACxB,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,IAAI,CAAC,OAAO,sCAAsC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpI,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;CACF,CAAA;AArCY,6BAA6B;IADzC,aAAa,CAAC,UAAU,EAAE,wBAAwB,CAAC;GACvC,6BAA6B,CAqCzC"}
|
|
@@ -72,10 +72,10 @@ export declare class VersionedRowGuard {
|
|
|
72
72
|
/** Records a failure on `field` and marks the result failed. */
|
|
73
73
|
static Fail(result: ValidationResult, field: string, message: string): void;
|
|
74
74
|
/**
|
|
75
|
-
* The first row of `entityName` matching `filter`, as a plain row (nothing is mutated)
|
|
76
|
-
* its error, so it is never reported as an absent row.
|
|
75
|
+
* The first row of `entityName` matching `filter`, as a plain row (nothing is mutated); only `fields` when given. A
|
|
76
|
+
* failed read is returned as its error, so it is never reported as an absent row.
|
|
77
77
|
*/
|
|
78
|
-
static ReadOneRow<TRow>(provider: IMetadataProvider, entityName: string, filter: string, user: UserInfo | undefined): Promise<RowRead<TRow>>;
|
|
78
|
+
static ReadOneRow<TRow>(provider: IMetadataProvider, entityName: string, filter: string, user: UserInfo | undefined, fields?: readonly (keyof TRow & string)[]): Promise<RowRead<TRow>>;
|
|
79
79
|
/** Version `version` of a lineage, read with {@link ReadOneRow}. */
|
|
80
80
|
static LoadVersion<TRow>(provider: IMetadataProvider, entityName: string, lineageRootID: string, version: number, user: UserInfo | undefined): Promise<RowRead<TRow>>;
|
|
81
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJMLPredictionUnitEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJMLPredictionUnitEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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AAG,IAAI,GAAG,SAAS,CAAC;IAoB3E;;;OAGG;WACW,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,gBAAgB;CAUvK;AAED;;;;GAIG;AACH,qBACa,8BAA+B,SAAQ,wBAAwB;IAC1E,2FAA2F;WAC7E,4BAA4B,CAAC,GAAG,EAAE,wBAAwB,GAAG,SAAS,MAAM,EAAE;IAK5F,uHAAuH;WACzG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM;IAI9E,+HAA+H;IACzG,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzD,QAAQ,IAAI,gBAAgB;IAI5C,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAED;;;OAGG;IACmB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAkBhE,0GAA0G;IAC1G,OAAO,CAAC,qBAAqB;IAQ7B;;;OAGG;YACW,iBAAiB;CAahC"}
|
|
@@ -80,11 +80,11 @@ export class VersionedRowGuard {
|
|
|
80
80
|
result.Errors.push(new ValidationErrorInfo(field, message, null, ValidationErrorType.Failure));
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* The first row of `entityName` matching `filter`, as a plain row (nothing is mutated)
|
|
84
|
-
* its error, so it is never reported as an absent row.
|
|
83
|
+
* The first row of `entityName` matching `filter`, as a plain row (nothing is mutated); only `fields` when given. A
|
|
84
|
+
* failed read is returned as its error, so it is never reported as an absent row.
|
|
85
85
|
*/
|
|
86
|
-
static async ReadOneRow(provider, entityName, filter, user) {
|
|
87
|
-
const r = await RunView.FromMetadataProvider(provider).RunView({ EntityName: entityName, ExtraFilter: filter, ResultType: 'simple' }, user);
|
|
86
|
+
static async ReadOneRow(provider, entityName, filter, user, fields) {
|
|
87
|
+
const r = await RunView.FromMetadataProvider(provider).RunView({ EntityName: entityName, ExtraFilter: filter, ...(fields ? { Fields: [...fields] } : {}), ResultType: 'simple' }, user);
|
|
88
88
|
return r.Success ? { Row: r.Results[0] || null, Error: null } : { Row: null, Error: r.ErrorMessage || 'unknown error' };
|
|
89
89
|
}
|
|
90
90
|
/** Version `version` of a lineage, read with {@link ReadOneRow}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJMLPredictionUnitEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLPredictionUnitEntityServer.server.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAkH,MAAM,sBAAsB,CAAC;AAClP,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAyE,MAAM,wCAAwC,CAAC;AAwB/I;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IAC5B;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,UAAkB,EAAE,OAAgB,EAAE,WAA8B,EAAE,UAAmB;QAClI,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtD,OAAO,UAAU;YACf,CAAC,CAAC,GAAG,UAAU,iCAAiC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sGAAsG;YAC5K,CAAC,CAAC,GAAG,UAAU,mCAAmC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,6DAA6D,CAAC;IAC1I,CAAC;IAED,gFAAgF;IACzE,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QACzD,OAAO,GAAG,UAAU,gKAAgK,CAAC;IACvL,C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BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;IACjG,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAO,QAA2B,EAAE,UAAkB,EAAE,MAAc,EAAE,IAA0B;
|
|
1
|
+
{"version":3,"file":"MJMLPredictionUnitEntityServer.server.js","sourceRoot":"","sources":["../../src/custom/MJMLPredictionUnitEntityServer.server.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAkH,MAAM,sBAAsB,CAAC;AAClP,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAyE,MAAM,wCAAwC,CAAC;AAwB/I;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IAC5B;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,UAAkB,EAAE,OAAgB,EAAE,WAA8B,EAAE,UAAmB;QAClI,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtD,OAAO,UAAU;YACf,CAAC,CAAC,GAAG,UAAU,iCAAiC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sGAAsG;YAC5K,CAAC,CAAC,GAAG,UAAU,mCAAmC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,6DAA6D,CAAC;IAC1I,CAAC;IAED,gFAAgF;IACzE,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QACzD,OAAO,GAAG,UAAU,gKAAgK,CAAC;IACvL,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,MAAkB,EAAE,OAAsC,EAAE,IAA4B;QACrI,IAAI,CAAC,MAAM,CAAC,OAAO,IAA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C3D,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,OAAO,GAAG,cAAc,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3E,MAAM,QAAQ,GAAG,gCAA8B,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACzG,IAAI,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YACnC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,wBAAwB,QAAQ,4BAA4B,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,iBAAiB,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC;QACxL,CAAC;IACH,CAAC;CACF,CAAA;AA1EY,8BAA8B;IAD1C,aAAa,CAAC,UAAU,EAAE,yBAAyB,CAAC;GACxC,8BAA8B,CA0E1C"}
|
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
import { ValidationResult } from '@memberjunction/core';
|
|
1
|
+
import { EntityDeleteOptions, ValidationResult } from '@memberjunction/core';
|
|
2
2
|
import { MJProjectEntityExtended } from '@memberjunction/core-entities';
|
|
3
3
|
/**
|
|
4
4
|
* Server-side `MJ: Projects` (conversation folder) entity.
|
|
5
5
|
*
|
|
6
6
|
* Keeps a folder's owner and place in its owner's hands: see {@link checkFolderOwnerOnlyChange}. Uses the
|
|
7
7
|
* synchronous `Validate()` so the rule runs on every save, like `MJConversationEntityServer`. `ValidateAsync()`
|
|
8
|
-
* refuses a parent that would make the folder its own ancestor.
|
|
8
|
+
* refuses a parent that would make the folder its own ancestor. `Delete()` empties the folder first, for a caller
|
|
9
|
+
* who may delete it but cannot reach everything inside it: see {@link Delete}.
|
|
9
10
|
*/
|
|
10
11
|
export declare class MJProjectEntityServer extends MJProjectEntityExtended {
|
|
11
12
|
Validate(): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Deletes the folder after moving what it holds out of it, in one transaction.
|
|
15
|
+
*
|
|
16
|
+
* `Project.ParentID` and `Conversation.ProjectID` are RESTRICT foreign keys, so a folder that still holds a
|
|
17
|
+
* subfolder or a conversation cannot be deleted. The client (`ConversationEngine.DeleteProject`) moves the rows
|
|
18
|
+
* it can change first, but a user whose folder writes are row-filtered (the UI role: own folders only) cannot
|
|
19
|
+
* change another user's subfolder or conversation inside their Shared folder, so the delete would fail on the
|
|
20
|
+
* foreign key. When the caller may delete this folder (the Delete permission and its row-level filter both
|
|
21
|
+
* pass), its direct subfolders move up to its parent and its conversations leave it, written as the system user,
|
|
22
|
+
* in the same transaction as the delete. A caller who may not delete it gets the provider's refusal as before,
|
|
23
|
+
* with nothing moved. A delete that already runs in a transaction group is left to that group.
|
|
24
|
+
*/
|
|
25
|
+
Delete(options?: EntityDeleteOptions): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* True when the caller holds Delete on folders and this folder passes their Delete row-level filter. Checked
|
|
28
|
+
* here, before anything moves, because the provider checks only the folder itself and only after the before-delete
|
|
29
|
+
* hooks. Reads as the system user, with the caller's own filter as the condition.
|
|
30
|
+
*/
|
|
31
|
+
private callerMayDelete;
|
|
32
|
+
/** The IDs of the folder's direct subfolders and conversations, read as the system user; a message on failure. */
|
|
33
|
+
private readContents;
|
|
34
|
+
/** Queues the moves and this delete in one transaction group and submits it. */
|
|
35
|
+
private deleteWithContentsMoved;
|
|
36
|
+
/** Records a refused delete so the caller reads the reason from `LatestResult`. */
|
|
37
|
+
private refuseDelete;
|
|
12
38
|
ValidateAsync(): Promise<ValidationResult>;
|
|
13
39
|
/**
|
|
14
40
|
* Refuses a `ParentID` that makes the folder its own ancestor. The sidebar builds the tree from the top, so a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MJProjectEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJProjectEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MJProjectEntityServer.server.d.ts","sourceRoot":"","sources":["../../src/custom/MJProjectEntityServer.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EAOnB,gBAAgB,EAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAA2D,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAIjI;;;;;;;GAOG;AACH,qBACa,qBAAsB,SAAQ,uBAAuB;IAC9C,QAAQ,IAAI,gBAAgB;IAU5C;;;;;;;;;;;OAWG;IACmB,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB7E;;;;OAIG;YACW,eAAe;IAe7B,kHAAkH;YACpG,YAAY;IAmB1B,gFAAgF;YAClE,uBAAuB;IA0CrC,mFAAmF;IACnF,OAAO,CAAC,YAAY;IAWE,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAUhE;;;;;OAKG;YACW,gBAAgB;CA6BjC"}
|