@memberjunction/core-entities-server 2.112.0 → 2.113.1
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 +4 -4
- package/dist/custom/AIAgentExampleEntity.server.d.ts +18 -0
- package/dist/custom/AIAgentExampleEntity.server.d.ts.map +1 -0
- package/dist/custom/AIAgentExampleEntity.server.js +61 -0
- package/dist/custom/AIAgentExampleEntity.server.js.map +1 -0
- package/dist/custom/AIAgentNoteEntity.server.d.ts +18 -0
- package/dist/custom/AIAgentNoteEntity.server.d.ts.map +1 -0
- package/dist/custom/AIAgentNoteEntity.server.js +62 -0
- package/dist/custom/AIAgentNoteEntity.server.js.map +1 -0
- package/dist/custom/AIPromptEntityExtended.server.d.ts +2 -2
- package/dist/custom/AIPromptEntityExtended.server.d.ts.map +1 -1
- package/dist/custom/AIPromptEntityExtended.server.js +32 -31
- package/dist/custom/AIPromptEntityExtended.server.js.map +1 -1
- package/dist/custom/AIPromptRunEntity.server.d.ts +2 -2
- package/dist/custom/AIPromptRunEntity.server.d.ts.map +1 -1
- package/dist/custom/AIPromptRunEntity.server.js +15 -14
- package/dist/custom/AIPromptRunEntity.server.js.map +1 -1
- package/dist/custom/ActionEntity.server.d.ts +2 -2
- package/dist/custom/ActionEntity.server.d.ts.map +1 -1
- package/dist/custom/ActionEntity.server.js +46 -45
- package/dist/custom/ActionEntity.server.js.map +1 -1
- package/dist/custom/ArtifactVersionExtended.server.d.ts +2 -2
- package/dist/custom/ArtifactVersionExtended.server.d.ts.map +1 -1
- package/dist/custom/ArtifactVersionExtended.server.js +15 -16
- package/dist/custom/ArtifactVersionExtended.server.js.map +1 -1
- package/dist/custom/ComponentEntity.server.d.ts +2 -2
- package/dist/custom/ComponentEntity.server.d.ts.map +1 -1
- package/dist/custom/ComponentEntity.server.js +9 -9
- package/dist/custom/ComponentEntity.server.js.map +1 -1
- package/dist/custom/DuplicateRunEntity.server.d.ts +1 -1
- package/dist/custom/DuplicateRunEntity.server.d.ts.map +1 -1
- package/dist/custom/DuplicateRunEntity.server.js +3 -3
- package/dist/custom/DuplicateRunEntity.server.js.map +1 -1
- package/dist/custom/QueryEntity.server.d.ts +2 -2
- package/dist/custom/QueryEntity.server.d.ts.map +1 -1
- package/dist/custom/QueryEntity.server.js +72 -65
- package/dist/custom/QueryEntity.server.js.map +1 -1
- package/dist/custom/TemplateContentEntity.server.d.ts +2 -2
- package/dist/custom/TemplateContentEntity.server.d.ts.map +1 -1
- package/dist/custom/TemplateContentEntity.server.js +23 -20
- package/dist/custom/TemplateContentEntity.server.js.map +1 -1
- package/dist/custom/reportEntity.server.d.ts +1 -1
- package/dist/custom/reportEntity.server.d.ts.map +1 -1
- package/dist/custom/reportEntity.server.js +6 -6
- package/dist/custom/reportEntity.server.js.map +1 -1
- package/dist/custom/userViewEntity.server.d.ts +1 -1
- package/dist/custom/userViewEntity.server.d.ts.map +1 -1
- package/dist/custom/userViewEntity.server.js +34 -36
- package/dist/custom/userViewEntity.server.js.map +1 -1
- package/dist/custom/util.d.ts +1 -1
- package/dist/custom/util.d.ts.map +1 -1
- package/dist/custom/util.js +1 -1
- package/dist/custom/util.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
|
@@ -7,15 +7,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.LoadTemplateContentEntityServerSubClass = exports.TemplateContentEntityExtended = void 0;
|
|
10
|
-
const
|
|
10
|
+
const core_1 = require("@memberjunction/core");
|
|
11
11
|
const core_entities_1 = require("@memberjunction/core-entities");
|
|
12
|
-
const
|
|
12
|
+
const global_1 = require("@memberjunction/global");
|
|
13
13
|
const aiengine_1 = require("@memberjunction/aiengine");
|
|
14
14
|
const ai_prompts_1 = require("@memberjunction/ai-prompts");
|
|
15
15
|
const ai_core_plus_1 = require("@memberjunction/ai-core-plus");
|
|
16
16
|
let TemplateContentEntityExtended = class TemplateContentEntityExtended extends core_entities_1.TemplateContentEntity {
|
|
17
17
|
async Save(options) {
|
|
18
|
-
const provider =
|
|
18
|
+
const provider = core_1.Metadata.Provider;
|
|
19
19
|
// Start a database transaction
|
|
20
20
|
await provider.BeginTransaction();
|
|
21
21
|
try {
|
|
@@ -39,19 +39,20 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
39
39
|
catch (e) {
|
|
40
40
|
// Rollback on any error
|
|
41
41
|
await provider.RollbackTransaction();
|
|
42
|
-
(0,
|
|
42
|
+
(0, core_1.LogError)('Failed to save template content and extract parameters:', e);
|
|
43
43
|
throw e;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
async extractAndSyncParameters() {
|
|
47
47
|
try {
|
|
48
|
-
if (this.Template ===
|
|
48
|
+
if (this.Template === "Template Parameter Extraction") {
|
|
49
49
|
return; // Skip extraction for this special case - this is ourselves!
|
|
50
50
|
}
|
|
51
51
|
// Ensure AIEngine is configured
|
|
52
52
|
await aiengine_1.AIEngine.Instance.Config(false, this.ContextCurrentUser);
|
|
53
53
|
// Find the Template Parameter Extraction prompt
|
|
54
|
-
const aiPrompt = aiengine_1.AIEngine.Instance.Prompts.find(
|
|
54
|
+
const aiPrompt = aiengine_1.AIEngine.Instance.Prompts.find(p => p.Name === 'Template Parameter Extraction' &&
|
|
55
|
+
p.Category === 'MJ: System');
|
|
55
56
|
if (!aiPrompt) {
|
|
56
57
|
// prompt not configured, non-fatl, just warn and return
|
|
57
58
|
console.warn('AI prompt for Template Parameter Extraction not found. Skipping parameter extraction.');
|
|
@@ -59,7 +60,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
59
60
|
}
|
|
60
61
|
// Prepare prompt data
|
|
61
62
|
const promptData = {
|
|
62
|
-
templateText: this.TemplateText
|
|
63
|
+
templateText: this.TemplateText
|
|
63
64
|
};
|
|
64
65
|
// Execute the prompt using AIPromptRunner
|
|
65
66
|
const promptRunner = new ai_prompts_1.AIPromptRunner();
|
|
@@ -69,14 +70,14 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
69
70
|
params.contextUser = this.ContextCurrentUser;
|
|
70
71
|
const result = await promptRunner.ExecutePrompt(params);
|
|
71
72
|
if (!result.success || !result.result) {
|
|
72
|
-
(0,
|
|
73
|
+
(0, core_1.LogError)('Failed to extract template parameters:', result.errorMessage);
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
76
|
// Process the extracted parameters
|
|
76
77
|
await this.syncTemplateParameters(result.result.parameters);
|
|
77
78
|
}
|
|
78
79
|
catch (e) {
|
|
79
|
-
(0,
|
|
80
|
+
(0, core_1.LogError)('Error extracting template parameters:', e);
|
|
80
81
|
// Don't throw here - we don't want to fail the save if parameter extraction fails
|
|
81
82
|
// The user can still manually manage parameters if needed
|
|
82
83
|
}
|
|
@@ -90,7 +91,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
90
91
|
const existingParamsResult = await rv.RunView({
|
|
91
92
|
EntityName: 'Template Params',
|
|
92
93
|
ExtraFilter: `TemplateID='${this.TemplateID}'`,
|
|
93
|
-
ResultType: 'entity_object'
|
|
94
|
+
ResultType: 'entity_object'
|
|
94
95
|
}, this.ContextCurrentUser);
|
|
95
96
|
if (!existingParamsResult.Success) {
|
|
96
97
|
throw new Error(`Failed to load existing template parameters: ${existingParamsResult.ErrorMessage}`);
|
|
@@ -100,20 +101,22 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
100
101
|
const templateContentsResult = await rv.RunView({
|
|
101
102
|
EntityName: 'Template Contents',
|
|
102
103
|
ExtraFilter: `TemplateID='${this.TemplateID}'`,
|
|
103
|
-
ResultType: 'simple'
|
|
104
|
+
ResultType: 'simple'
|
|
104
105
|
}, this.ContextCurrentUser);
|
|
105
|
-
const isMultipleContents = templateContentsResult.Success &&
|
|
106
|
+
const isMultipleContents = templateContentsResult.Success &&
|
|
107
|
+
templateContentsResult.Results &&
|
|
108
|
+
templateContentsResult.Results.length > 1;
|
|
106
109
|
// For single template content, all params have TemplateContentID = NULL
|
|
107
110
|
// For multiple contents, we need to be more careful about global vs content-specific params
|
|
108
111
|
const templateContentID = isMultipleContents ? this.ID : null;
|
|
109
112
|
// Filter existing params relevant to this content
|
|
110
|
-
const relevantExistingParams = existingParams.filter(
|
|
113
|
+
const relevantExistingParams = existingParams.filter(p => isMultipleContents ? p.TemplateContentID === this.ID : p.TemplateContentID == null);
|
|
111
114
|
// Convert extracted param names to lowercase for comparison
|
|
112
|
-
const extractedParamNames = extractedParams.map(
|
|
115
|
+
const extractedParamNames = extractedParams.map(p => p.name.toLowerCase());
|
|
113
116
|
// Find parameters to add, update, or remove
|
|
114
|
-
const paramsToAdd = extractedParams.filter(
|
|
115
|
-
const paramsToUpdate = relevantExistingParams.filter(
|
|
116
|
-
const paramsToRemove = relevantExistingParams.filter(
|
|
117
|
+
const paramsToAdd = extractedParams.filter(p => !relevantExistingParams.some(ep => ep.Name.toLowerCase() === p.name.toLowerCase()));
|
|
118
|
+
const paramsToUpdate = relevantExistingParams.filter(ep => extractedParams.some(p => p.name.toLowerCase() === ep.Name.toLowerCase()));
|
|
119
|
+
const paramsToRemove = relevantExistingParams.filter(ep => !extractedParamNames.includes(ep.Name.toLowerCase()));
|
|
117
120
|
// Prepare all save/delete operations
|
|
118
121
|
const promises = [];
|
|
119
122
|
// Add new parameters
|
|
@@ -130,7 +133,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
130
133
|
}
|
|
131
134
|
// Update existing parameters if properties changed
|
|
132
135
|
for (const existingParam of paramsToUpdate) {
|
|
133
|
-
const extractedParam = extractedParams.find(
|
|
136
|
+
const extractedParam = extractedParams.find(p => p.name.toLowerCase() === existingParam.Name.toLowerCase());
|
|
134
137
|
if (extractedParam) {
|
|
135
138
|
let hasChanges = false;
|
|
136
139
|
// Check each property for changes
|
|
@@ -168,14 +171,14 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
|
|
|
168
171
|
// For now, we're handling content-specific params only
|
|
169
172
|
}
|
|
170
173
|
catch (e) {
|
|
171
|
-
(0,
|
|
174
|
+
(0, core_1.LogError)('Failed to sync template parameters:', e);
|
|
172
175
|
throw e; // Re-throw since we're in a transaction
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
178
|
};
|
|
176
179
|
exports.TemplateContentEntityExtended = TemplateContentEntityExtended;
|
|
177
180
|
exports.TemplateContentEntityExtended = TemplateContentEntityExtended = __decorate([
|
|
178
|
-
(0,
|
|
181
|
+
(0, global_1.RegisterClass)(core_1.BaseEntity, 'Template Contents')
|
|
179
182
|
], TemplateContentEntityExtended);
|
|
180
183
|
function LoadTemplateContentEntityServerSubClass() { }
|
|
181
184
|
exports.LoadTemplateContentEntityServerSubClass = LoadTemplateContentEntityServerSubClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateContentEntity.server.js","sourceRoot":"","sources":["../../src/custom/TemplateContentEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"TemplateContentEntity.server.js","sourceRoot":"","sources":["../../src/custom/TemplateContentEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAqH;AACrH,iEAA2G;AAC3G,mDAAuD;AACvD,uDAAoD;AAEpD,2DAA4D;AAC5D,+DAA8D;AAgBvD,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,qCAAqB;IAC3D,KAAK,CAAC,IAAI,CAAC,OAA2B;QAC3C,MAAM,QAAQ,GAAG,eAAQ,CAAC,QAAiC,CAAC;QAE5D,+BAA+B;QAC/B,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAElC,IAAI,CAAC;YACD,+DAA+D;YAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,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AE,CAAC;gBACzC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;YAC1C,CAAC;YAED,qCAAqC;YACrC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,+BAA+B;YAChE,CAAC;YAED,+EAA+E;YAC/E,qFAAqF;YACrF,uDAAuD;QAE3D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAA,eAAQ,EAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;YACnD,MAAM,CAAC,CAAC,CAAC,wCAAwC;QACrD,CAAC;IACL,CAAC;CACJ,CAAA;AA7MY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAa,EAAC,iBAAU,EAAE,mBAAmB,CAAC;GAClC,6BAA6B,CA6MzC;AAED,SAAgB,uCAAuC,KAAI,CAAC;AAA5D,0FAA4D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReportEntity } from
|
|
1
|
+
import { ReportEntity } from "@memberjunction/core-entities";
|
|
2
2
|
export declare class ReportEntity_Server extends ReportEntity {
|
|
3
3
|
/**
|
|
4
4
|
* The server side Report Entity sub-class has a simple logic that will create a snapshot of the report when it is first created and each time it is modified, but only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/reportEntity.server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA6C,MAAM,+BAA+B,CAAC;AAGxG,qBACa,mBAAoB,SAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"reportEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/reportEntity.server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA6C,MAAM,+BAA+B,CAAC;AAGxG,qBACa,mBAAoB,SAAQ,YAAY;IACjD;;;;OAIG;IACU,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAoHxC;AAED,wBAAgB,8BAA8B,SAAK"}
|
|
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.LoadReportEntityServerSubClass = exports.ReportEntity_Server = void 0;
|
|
10
|
+
const core_1 = require("@memberjunction/core");
|
|
10
11
|
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const global_2 = require("@memberjunction/global");
|
|
12
12
|
const core_entities_1 = require("@memberjunction/core-entities");
|
|
13
13
|
let ReportEntity_Server = class ReportEntity_Server extends core_entities_1.ReportEntity {
|
|
14
14
|
/**
|
|
@@ -19,9 +19,9 @@ let ReportEntity_Server = class ReportEntity_Server extends core_entities_1.Repo
|
|
|
19
19
|
async Save() {
|
|
20
20
|
try {
|
|
21
21
|
// first let's get the actual parsed object for the Configuration field
|
|
22
|
-
const config = this.Configuration && this.Configuration.length > 0 ? (0,
|
|
22
|
+
const config = this.Configuration && this.Configuration.length > 0 ? (0, global_1.SafeJSONParse)(this.Configuration) : null;
|
|
23
23
|
const oldTextConfig = this.GetFieldByName('Configuration')?.OldValue;
|
|
24
|
-
const oldConfig = oldTextConfig && oldTextConfig.length > 0 ? (0,
|
|
24
|
+
const oldConfig = oldTextConfig && oldTextConfig.length > 0 ? (0, global_1.SafeJSONParse)(oldTextConfig) : null;
|
|
25
25
|
if ((config && oldConfig) || (config && !this.IsSaved)) {
|
|
26
26
|
let createSnapshot = false;
|
|
27
27
|
let createReportVersion = false;
|
|
@@ -91,7 +91,7 @@ let ReportEntity_Server = class ReportEntity_Server extends core_entities_1.Repo
|
|
|
91
91
|
reportVersion.Description = this.Description; // copy current description to the new version
|
|
92
92
|
reportVersion.VersionNumber = newVersionNumber;
|
|
93
93
|
reportVersion.Configuration = JSON.stringify(this.Configuration);
|
|
94
|
-
success = success &&
|
|
94
|
+
success = success && await reportVersion.Save();
|
|
95
95
|
if (!success) {
|
|
96
96
|
console.error('ReportEntity_Server.Save(): Error saving report version\n' + reportVersion.LatestResult.Message);
|
|
97
97
|
}
|
|
@@ -102,7 +102,7 @@ let ReportEntity_Server = class ReportEntity_Server extends core_entities_1.Repo
|
|
|
102
102
|
snapshot.UserID = this.ContextCurrentUser.ID;
|
|
103
103
|
// in the snapshot entity the ResultSet column is the Configuration column from the Report entity
|
|
104
104
|
snapshot.ResultSet = JSON.stringify(this.Configuration);
|
|
105
|
-
success = success &&
|
|
105
|
+
success = success && await snapshot.Save();
|
|
106
106
|
}
|
|
107
107
|
return success;
|
|
108
108
|
}
|
|
@@ -123,7 +123,7 @@ let ReportEntity_Server = class ReportEntity_Server extends core_entities_1.Repo
|
|
|
123
123
|
};
|
|
124
124
|
exports.ReportEntity_Server = ReportEntity_Server;
|
|
125
125
|
exports.ReportEntity_Server = ReportEntity_Server = __decorate([
|
|
126
|
-
(0,
|
|
126
|
+
(0, global_1.RegisterClass)(core_1.BaseEntity, 'Reports')
|
|
127
127
|
], ReportEntity_Server);
|
|
128
128
|
function LoadReportEntityServerSubClass() { }
|
|
129
129
|
exports.LoadReportEntityServerSubClass = LoadReportEntityServerSubClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportEntity.server.js","sourceRoot":"","sources":["../../src/custom/reportEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"reportEntity.server.js","sourceRoot":"","sources":["../../src/custom/reportEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAwF;AACxF,mDAAsE;AACtE,iEAAwG;AAIjG,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;IACjD;;;;OAIG;IACI,KAAK,CAAC,IAAI;QACb,IAAI,CAAC;YACD,uEAAuE;YACvE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GA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kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBAC7G,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC;wBAC5B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;wBAC7C,iGAAiG;wBACjG,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;wBACxD,OAAO,GAAG,OAAO,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC/C,CAAC;oBAED,OAAO,OAAO,CAAC;gBACnB,CAAC;qBACI,CAAC;oBACF,OAAO,UAAU,CAAC;gBACtB,CAAC;YACL,CAAC;iBACI,CAAC;gBACF,gFAAgF;gBAChF,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;YACxB,CAAC;QACL,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ,CAAA;AA1HY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAa,EAAC,iBAAU,EAAE,SAAS,CAAC;GACxB,mBAAmB,CA0H/B;AAED,SAAgB,8BAA8B,KAAI,CAAC;AAAnD,wEAAmD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityInfo } from
|
|
1
|
+
import { EntityInfo } from "@memberjunction/core";
|
|
2
2
|
import { AIModelEntityExtended, UserViewEntityExtended } from '@memberjunction/core-entities';
|
|
3
3
|
export declare class UserViewEntity_Server extends UserViewEntityExtended {
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userViewEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/userViewEntity.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAyC,MAAM,
|
|
1
|
+
{"version":3,"file":"userViewEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/userViewEntity.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAyC,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAiB,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAI5G,qBACa,qBAAsB,SAAQ,sBAAsB;IAC7D;;OAEG;IACH,cAAuB,sBAAsB,IAAI,OAAO,CAEvD;IAED;;;OAGG;IACH,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAED;;;OAGG;cACa,UAAU,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAS5D;;;;OAIG;IACU,8BAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAC,CAAC;IAuErI,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAqH3D;AAGD,wBAAgB,gCAAgC,SAE/C"}
|
|
@@ -8,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.LoadUserViewEntityServerSubClass = exports.UserViewEntity_Server = void 0;
|
|
10
10
|
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const
|
|
11
|
+
const core_1 = require("@memberjunction/core");
|
|
12
12
|
const core_entities_1 = require("@memberjunction/core-entities");
|
|
13
13
|
const ai_1 = require("@memberjunction/ai");
|
|
14
14
|
const aiengine_1 = require("@memberjunction/aiengine");
|
|
@@ -32,7 +32,8 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
32
32
|
*/
|
|
33
33
|
async GetAIModel() {
|
|
34
34
|
await aiengine_1.AIEngine.Instance.Config(false, this.ContextCurrentUser); // most of the time this is already loaded, but just in case it isn't we will load it here
|
|
35
|
-
const models = aiengine_1.AIEngine.Instance.Models.filter(
|
|
35
|
+
const models = aiengine_1.AIEngine.Instance.Models.filter(m => m.AIModelType.trim().toLowerCase() === 'llm' &&
|
|
36
|
+
m.Vendor.trim().toLowerCase() === this.AIVendorName.trim().toLowerCase());
|
|
36
37
|
// next, sort the models by the PowerRank field so that the highest power rank model is the first array element
|
|
37
38
|
models.sort((a, b) => b.PowerRank - a.PowerRank); // highest power rank first
|
|
38
39
|
return models[0];
|
|
@@ -51,7 +52,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
51
52
|
messages: [
|
|
52
53
|
{
|
|
53
54
|
role: 'system',
|
|
54
|
-
content: this.GenerateSysPrompt(entityInfo)
|
|
55
|
+
content: this.GenerateSysPrompt(entityInfo)
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
role: 'user',
|
|
@@ -79,13 +80,13 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
79
80
|
ret = parsed.whereClause;
|
|
80
81
|
return {
|
|
81
82
|
whereClause: ret,
|
|
82
|
-
userExplanation: parsed.userExplanationMessage
|
|
83
|
+
userExplanation: parsed.userExplanationMessage
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
else if (parsed.whereClause !== undefined && parsed.whereClause !== null) {
|
|
86
87
|
return {
|
|
87
88
|
whereClause: '', // empty string is valid, it means no where clause
|
|
88
|
-
userExplanation: parsed.userExplanationMessage
|
|
89
|
+
userExplanation: parsed.userExplanationMessage
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
@@ -94,7 +95,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
catch (e) {
|
|
97
|
-
(0,
|
|
98
|
+
(0, core_1.LogError)(e);
|
|
98
99
|
throw new Error('Error parsing JSON response from AI: ' + llmResponse);
|
|
99
100
|
}
|
|
100
101
|
}
|
|
@@ -105,7 +106,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
105
106
|
throw new Error('No result returned from AI');
|
|
106
107
|
}
|
|
107
108
|
catch (e) {
|
|
108
|
-
(0,
|
|
109
|
+
(0, core_1.LogError)(e);
|
|
109
110
|
throw e;
|
|
110
111
|
}
|
|
111
112
|
}
|
|
@@ -113,11 +114,11 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
|
|
|
113
114
|
const processedViews = [entityInfo.BaseView];
|
|
114
115
|
// Use the entity's provider instead of creating new Metadata instance
|
|
115
116
|
const md = this.ProviderToUse;
|
|
116
|
-
const listsEntity = md.Entities.find(
|
|
117
|
-
const listDetailsEntity = md.Entities.find(
|
|
117
|
+
const listsEntity = md.Entities.find(e => e.Name === "Lists");
|
|
118
|
+
const listDetailsEntity = md.Entities.find(e => e.Name === "List Details");
|
|
118
119
|
const gptSysPrompt = `You are an expert in SQL and Microsoft SQL Server.
|
|
119
120
|
You will be provided a user prompt representing how they want to filter the data.
|
|
120
|
-
You may *NOT* use JOINS, only sub-queries for related tables.
|
|
121
|
+
You may *NOT* use JOINS, only sub-queries for related tables.
|
|
121
122
|
|
|
122
123
|
I am a bot and can only understand JSON. Your response must be parsable into this type:
|
|
123
124
|
const returnType = {
|
|
@@ -126,33 +127,32 @@ const returnType = {
|
|
|
126
127
|
userExplanationMessage: string
|
|
127
128
|
};
|
|
128
129
|
|
|
129
|
-
In MemberJunction, we have a concept called "Entities" and these are metadata constructs that wrap SQL tables and views. The entity that we are currently
|
|
130
|
-
building a filter for is called "${entityInfo.Name}" and has an ID of "${entityInfo.ID}"
|
|
130
|
+
In MemberJunction, we have a concept called "Entities" and these are metadata constructs that wrap SQL tables and views. The entity that we are currently
|
|
131
|
+
building a filter for is called "${entityInfo.Name}" and has an ID of "${entityInfo.ID}"
|
|
131
132
|
|
|
132
133
|
You won't be using this Entity name or ID in your SQL, unless you need to use it for List filtering (more on that below).
|
|
133
134
|
|
|
134
135
|
The view that the user is querying is called ${entityInfo.BaseView} and has these fields:
|
|
135
|
-
${entityInfo.Fields.map(
|
|
136
|
+
${entityInfo.Fields.map(f => {
|
|
136
137
|
let ret = `${f.Name} (${f.Type})`;
|
|
137
138
|
if (f.RelatedEntity) {
|
|
138
139
|
ret += ` (fkey to ${f.RelatedEntityBaseView})`;
|
|
139
140
|
}
|
|
140
141
|
return ret;
|
|
141
142
|
}).join(',')}`;
|
|
142
|
-
const fkeyFields = entityInfo.Fields.filter(
|
|
143
|
-
const fkeyBaseViewsDistinct = fkeyFields.map(
|
|
143
|
+
const fkeyFields = entityInfo.Fields.filter(f => f.RelatedEntity && f.RelatedEntity.length > 0);
|
|
144
|
+
const fkeyBaseViewsDistinct = fkeyFields.map(f => f.RelatedEntityBaseView).filter((v, i, a) => a.indexOf(v) === i);
|
|
144
145
|
const relationships = `
|
|
145
146
|
In addition, ${entityInfo.BaseView} has links to other views, as shown here, you can use these views in sub-queries to achieve the request from the user.
|
|
146
147
|
If there are multiple filters related to a single related view, attempt to combine them into a single sub-query for efficiency.
|
|
147
148
|
${
|
|
148
149
|
// this part returns a list of all the related views and the fields that are related to the current view via fkeys in the current view
|
|
149
|
-
fkeyBaseViewsDistinct
|
|
150
|
-
.map((v) => {
|
|
150
|
+
fkeyBaseViewsDistinct.map(v => {
|
|
151
151
|
if (processedViews.indexOf(v) === -1) {
|
|
152
|
-
const e = md.Entities.find(
|
|
152
|
+
const e = md.Entities.find(e => e.BaseView === v);
|
|
153
153
|
if (e) {
|
|
154
154
|
processedViews.push(v); // already processed this view now, so we won't repeat it
|
|
155
|
-
return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map(
|
|
155
|
+
return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map(ef => {
|
|
156
156
|
return ef.Name + ' (' + ef.Type + ')';
|
|
157
157
|
}).join(',')}`;
|
|
158
158
|
}
|
|
@@ -161,16 +161,15 @@ ${
|
|
|
161
161
|
}
|
|
162
162
|
else
|
|
163
163
|
return ''; // already did this at some point
|
|
164
|
-
})
|
|
165
|
-
.join('\n')}
|
|
164
|
+
}).join('\n')}
|
|
166
165
|
${
|
|
167
166
|
// this part returns a list of all the related views and the fields that are related to the current view fkeys in THOSE views
|
|
168
|
-
entityInfo.RelatedEntities.map(
|
|
169
|
-
const e = md.Entities.find(
|
|
167
|
+
entityInfo.RelatedEntities.map(r => {
|
|
168
|
+
const e = md.Entities.find(e => e.Name === r.RelatedEntity);
|
|
170
169
|
if (e) {
|
|
171
170
|
if (processedViews.indexOf(e.BaseView) === -1) {
|
|
172
171
|
processedViews.push(e.BaseView); // note that we are processing this view now, so we won't repeat it
|
|
173
|
-
return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map(
|
|
172
|
+
return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map(ef => {
|
|
174
173
|
let ret = `${ef.Name} (${ef.Type})`;
|
|
175
174
|
if (ef.RelatedEntity) {
|
|
176
175
|
ret += ` (fkey to ${ef.RelatedEntityBaseView})`;
|
|
@@ -185,14 +184,14 @@ ${
|
|
|
185
184
|
return '';
|
|
186
185
|
}).join('\n')}
|
|
187
186
|
|
|
188
|
-
<IMPORTANT - LISTS FEATURE>
|
|
189
|
-
In addition to the above related views, a user may talk about "Lists" in their request. A List is a static set of records modeled in our database with the ${listsEntity.SchemaName}.vwLists view and
|
|
187
|
+
<IMPORTANT - LISTS FEATURE>
|
|
188
|
+
In addition to the above related views, a user may talk about "Lists" in their request. A List is a static set of records modeled in our database with the ${listsEntity.SchemaName}.vwLists view and
|
|
190
189
|
the ${listsEntity.SchemaName}.vwListDetails view. ${listsEntity.SchemaName}.vwLists contains the list "header" information with these columns:
|
|
191
|
-
${listsEntity.Fields.map(
|
|
190
|
+
${listsEntity.Fields.map(f => {
|
|
192
191
|
return f.Name + ' (' + f.SQLFullType + ')';
|
|
193
192
|
}).join(', ')}
|
|
194
193
|
The vwListDetails view contains the list "detail" information with these columns which is basically the records that are part of the list. ${listsEntity.SchemaName}.vwListDetails contains these columns:
|
|
195
|
-
${listDetailsEntity.Fields.map(
|
|
194
|
+
${listDetailsEntity.Fields.map(f => {
|
|
196
195
|
return f.Name + ' (' + f.SQLFullType + ')';
|
|
197
196
|
}).join(', ')}.
|
|
198
197
|
|
|
@@ -200,7 +199,7 @@ If a user is asking to use a list in creating a view, you need to use a sub-quer
|
|
|
200
199
|
|
|
201
200
|
ID IN (SELECT RecordID FROM ${listsEntity.SchemaName}.vwListDetails WHERE ListID='My List ID')
|
|
202
201
|
|
|
203
|
-
In this example we're assuming the user has asked us to filter to include only records that are part of the list with the ID of 'My List ID'. In reality the prompt you will have will have a UUID/GUID type ID not a text string like this.
|
|
202
|
+
In this example we're assuming the user has asked us to filter to include only records that are part of the list with the ID of 'My List ID'. In reality the prompt you will have will have a UUID/GUID type ID not a text string like this.
|
|
204
203
|
You can use any fields at the detail level filter the records and of course combine this type of list-oriented sub-query with other filters as appropriate to satisfy the user's request.
|
|
205
204
|
|
|
206
205
|
It is also possible that a user will provide ONLY the name of the list they want to filter on. If they provide the List ID, use it with a query like the above. However, if ONLY a List name is provided, you can do as follows: use this style of query with a join to the vwLists view (the list "header") to filter on the name
|
|
@@ -216,21 +215,20 @@ The user might reference other "views" in their request. In the user's terminolo
|
|
|
216
215
|
records from another view. Unlike Lists, which are STATIC sets of records, User Views are dynamic and can change based on the underlying data. So, what we need to do is use a sub-query that pulls in the SQL for the other view
|
|
217
216
|
The user will be referring to the other view by name, so what you need to do when generating SQL for this scenario is to simply embed a sub-query along the lines of this example, updated of course in the context of the user's request and the rest of any filters you are building:
|
|
218
217
|
ID IN ({%UserView "ViewID"%}) -- this is for filtering the primary key using other User Views for this entity: "${entityInfo.Name}"
|
|
219
|
-
AccountID IN ({%UserView "ViewID"%}) -- this is an example where the foreign key relationship for the AccountID field in this entity (${entityInfo.Name}) links to another entity hypothetically called "Accounts" and we want to use an Accounts view for filtering in some way
|
|
218
|
+
AccountID IN ({%UserView "ViewID"%}) -- this is an example where the foreign key relationship for the AccountID field in this entity (${entityInfo.Name}) links to another entity hypothetically called "Accounts" and we want to use an Accounts view for filtering in some way
|
|
220
219
|
By including this sub-query in your generated WHERE clause, it will give me what I need to dynamically replace the {%UserView "View Name"%} with the actual SQL for the view that the user is referring to. Since that actual SQL
|
|
221
220
|
can change over time, I don't want to embed it directly here but rather have it templatized and each time it is run, I will pre-process the SQL to replace the template with the actual SQL for the view.
|
|
222
221
|
</IMPORTANT - OTHER VIEWS>
|
|
223
222
|
`;
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
`
|
|
227
|
-
**** REMEMBER **** I am a BOT, do not return anything other than JSON to me or I will choke on your response!`);
|
|
223
|
+
return gptSysPrompt + (processedViews.length > 1 /*we always have 1 from the entity base view*/ ? relationships : '') + `
|
|
224
|
+
**** REMEMBER **** I am a BOT, do not return anything other than JSON to me or I will choke on your response!`;
|
|
228
225
|
}
|
|
229
226
|
};
|
|
230
227
|
exports.UserViewEntity_Server = UserViewEntity_Server;
|
|
231
228
|
exports.UserViewEntity_Server = UserViewEntity_Server = __decorate([
|
|
232
|
-
(0, global_1.RegisterClass)(
|
|
229
|
+
(0, global_1.RegisterClass)(core_1.BaseEntity, 'User Views')
|
|
233
230
|
], UserViewEntity_Server);
|
|
234
|
-
function LoadUserViewEntityServerSubClass() {
|
|
231
|
+
function LoadUserViewEntityServerSubClass() {
|
|
232
|
+
}
|
|
235
233
|
exports.LoadUserViewEntityServerSubClass = LoadUserViewEntityServerSubClass;
|
|
236
234
|
//# sourceMappingURL=userViewEntity.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userViewEntity.server.js","sourceRoot":"","sources":["../../src/custom/userViewEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAA4E;AAC5E
|
|
1
|
+
{"version":3,"file":"userViewEntity.server.js","sourceRoot":"","sources":["../../src/custom/userViewEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAA4E;AAC5E,+CAAqG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":"","sources":["../../src/custom/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/custom/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAYlH"}
|
package/dist/custom/util.js
CHANGED
package/dist/custom/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/custom/util.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAGpD;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAAC,MAAkB,EAAE,WAAmB;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/custom/util.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAGpD;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAAC,MAAkB,EAAE,WAAmB;IAC9E,MAAM,mBAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACjE,MAAM,CAAC,GAAG,MAAM,mBAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAE9D,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACrF,CAAC;IAED,OAAO;QACH,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;QACvB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE;KACtB,CAAA;AACL,CAAC;AAZD,oDAYC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './custom/userViewEntity.server';
|
|
|
8
8
|
export * from './custom/ActionEntity.server';
|
|
9
9
|
export * from './custom/ComponentEntity.server';
|
|
10
10
|
export * from './custom/ArtifactVersionExtended.server';
|
|
11
|
+
export * from './custom/AIAgentNoteEntity.server';
|
|
12
|
+
export * from './custom/AIAgentExampleEntity.server';
|
|
11
13
|
export * from './custom/util';
|
|
12
14
|
export declare function LoadCoreEntitiesServerSubClasses(): void;
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,eAAe,CAAC;AAG9B,wBAAgB,gCAAgC,IAAI,IAAI,CAYvD"}
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,8 @@ const reportEntity_server_1 = require("./custom/reportEntity.server");
|
|
|
25
25
|
const TemplateContentEntity_server_1 = require("./custom/TemplateContentEntity.server");
|
|
26
26
|
const userViewEntity_server_1 = require("./custom/userViewEntity.server");
|
|
27
27
|
const ArtifactVersionExtended_server_1 = require("./custom/ArtifactVersionExtended.server");
|
|
28
|
+
const AIAgentNoteEntity_server_1 = require("./custom/AIAgentNoteEntity.server");
|
|
29
|
+
const AIAgentExampleEntity_server_1 = require("./custom/AIAgentExampleEntity.server");
|
|
28
30
|
(0, ai_provider_bundle_1.LoadAIProviders)(); // Ensure all AI providers are loaded
|
|
29
31
|
__exportStar(require("./custom/AIPromptEntityExtended.server"), exports);
|
|
30
32
|
__exportStar(require("./custom/AIPromptRunEntity.server"), exports);
|
|
@@ -36,6 +38,8 @@ __exportStar(require("./custom/userViewEntity.server"), exports);
|
|
|
36
38
|
__exportStar(require("./custom/ActionEntity.server"), exports);
|
|
37
39
|
__exportStar(require("./custom/ComponentEntity.server"), exports);
|
|
38
40
|
__exportStar(require("./custom/ArtifactVersionExtended.server"), exports);
|
|
41
|
+
__exportStar(require("./custom/AIAgentNoteEntity.server"), exports);
|
|
42
|
+
__exportStar(require("./custom/AIAgentExampleEntity.server"), exports);
|
|
39
43
|
__exportStar(require("./custom/util"), exports);
|
|
40
44
|
// Call the stub functions to ensure that the custom subclasses are not tree shaken out.
|
|
41
45
|
function LoadCoreEntitiesServerSubClasses() {
|
|
@@ -48,6 +52,8 @@ function LoadCoreEntitiesServerSubClasses() {
|
|
|
48
52
|
(0, userViewEntity_server_1.LoadUserViewEntityServerSubClass)();
|
|
49
53
|
(0, ActionEntity_server_1.LoadActionEntityServer)();
|
|
50
54
|
(0, ArtifactVersionExtended_server_1.LoadArtifactVersionExtendedServerSubClass)();
|
|
55
|
+
(0, AIAgentNoteEntity_server_1.LoadAIAgentNoteEntityServerSubClass)();
|
|
56
|
+
(0, AIAgentExampleEntity_server_1.LoadAIAgentExampleEntityServerSubClass)();
|
|
51
57
|
}
|
|
52
58
|
exports.LoadCoreEntitiesServerSubClasses = LoadCoreEntitiesServerSubClasses;
|
|
53
59
|
LoadCoreEntitiesServerSubClasses();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2EAAqE;AACrE,sEAAsE;AACtE,0FAAkG;AAClG,gFAAwF;AACxF,kFAA0F;AAC1F,oEAA4E;AAC5E,sEAA8E;AAC9E,wFAAgG;AAChG,0EAAkF;AAClF,4FAAoG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2EAAqE;AACrE,sEAAsE;AACtE,0FAAkG;AAClG,gFAAwF;AACxF,kFAA0F;AAC1F,oEAA4E;AAC5E,sEAA8E;AAC9E,wFAAgG;AAChG,0EAAkF;AAClF,4FAAoG;AACpG,gFAAwF;AACxF,sFAA8F;AAE9F,IAAA,oCAAe,GAAE,CAAC,CAAC,qCAAqC;AAExD,yEAAuD;AACvD,oEAAkD;AAClD,qEAAmD;AACnD,8DAA4C;AAC5C,+DAA6C;AAC7C,wEAAsD;AACtD,iEAA+C;AAC/C,+DAA6C;AAC7C,kEAAgD;AAChD,0EAAwD;AACxD,oEAAkD;AAClD,uEAAqD;AACrD,gDAA8B;AAE9B,wFAAwF;AACxF,SAAgB,gCAAgC;IAC5C,IAAA,wEAAwC,GAAE,CAAC;IAC3C,IAAA,8DAAmC,GAAE,CAAC;IACtC,IAAA,gEAAoC,GAAE,CAAC;IACvC,IAAA,kDAA6B,GAAE,CAAC;IAChC,IAAA,oDAA8B,GAAE,CAAC;IACjC,IAAA,sEAAuC,GAAE,CAAC;IAC1C,IAAA,wDAAgC,GAAE,CAAC;IACnC,IAAA,4CAAsB,GAAE,CAAC;IACzB,IAAA,0EAAyC,GAAE,CAAC;IAC5C,IAAA,8DAAmC,GAAE,CAAC;IACtC,IAAA,oEAAsC,GAAE,CAAC;AAC7C,CAAC;AAZD,4EAYC;AACD,gCAAgC,EAAE,CAAC"}
|