@memberjunction/core-entities-server 2.111.0 → 2.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/custom/AIPromptEntityExtended.server.d.ts +2 -2
  3. package/dist/custom/AIPromptEntityExtended.server.d.ts.map +1 -1
  4. package/dist/custom/AIPromptEntityExtended.server.js +31 -32
  5. package/dist/custom/AIPromptEntityExtended.server.js.map +1 -1
  6. package/dist/custom/AIPromptRunEntity.server.d.ts +2 -2
  7. package/dist/custom/AIPromptRunEntity.server.d.ts.map +1 -1
  8. package/dist/custom/AIPromptRunEntity.server.js +14 -15
  9. package/dist/custom/AIPromptRunEntity.server.js.map +1 -1
  10. package/dist/custom/ActionEntity.server.d.ts +2 -2
  11. package/dist/custom/ActionEntity.server.d.ts.map +1 -1
  12. package/dist/custom/ActionEntity.server.js +45 -46
  13. package/dist/custom/ActionEntity.server.js.map +1 -1
  14. package/dist/custom/ArtifactVersionExtended.server.d.ts +2 -2
  15. package/dist/custom/ArtifactVersionExtended.server.d.ts.map +1 -1
  16. package/dist/custom/ArtifactVersionExtended.server.js +16 -15
  17. package/dist/custom/ArtifactVersionExtended.server.js.map +1 -1
  18. package/dist/custom/ComponentEntity.server.d.ts +2 -2
  19. package/dist/custom/ComponentEntity.server.d.ts.map +1 -1
  20. package/dist/custom/ComponentEntity.server.js +9 -9
  21. package/dist/custom/ComponentEntity.server.js.map +1 -1
  22. package/dist/custom/DuplicateRunEntity.server.d.ts +1 -1
  23. package/dist/custom/DuplicateRunEntity.server.d.ts.map +1 -1
  24. package/dist/custom/DuplicateRunEntity.server.js +3 -3
  25. package/dist/custom/DuplicateRunEntity.server.js.map +1 -1
  26. package/dist/custom/QueryEntity.server.d.ts +2 -2
  27. package/dist/custom/QueryEntity.server.d.ts.map +1 -1
  28. package/dist/custom/QueryEntity.server.js +64 -71
  29. package/dist/custom/QueryEntity.server.js.map +1 -1
  30. package/dist/custom/TemplateContentEntity.server.d.ts +2 -2
  31. package/dist/custom/TemplateContentEntity.server.d.ts.map +1 -1
  32. package/dist/custom/TemplateContentEntity.server.js +20 -23
  33. package/dist/custom/TemplateContentEntity.server.js.map +1 -1
  34. package/dist/custom/reportEntity.server.d.ts +1 -1
  35. package/dist/custom/reportEntity.server.d.ts.map +1 -1
  36. package/dist/custom/reportEntity.server.js +6 -6
  37. package/dist/custom/reportEntity.server.js.map +1 -1
  38. package/dist/custom/userViewEntity.server.d.ts +1 -1
  39. package/dist/custom/userViewEntity.server.d.ts.map +1 -1
  40. package/dist/custom/userViewEntity.server.js +36 -34
  41. package/dist/custom/userViewEntity.server.js.map +1 -1
  42. package/dist/custom/util.d.ts +1 -1
  43. package/dist/custom/util.d.ts.map +1 -1
  44. package/dist/custom/util.js +1 -1
  45. package/dist/custom/util.js.map +1 -1
  46. package/package.json +10 -11
@@ -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 core_1 = require("@memberjunction/core");
11
- const core_entities_1 = require("@memberjunction/core-entities");
12
10
  const global_1 = require("@memberjunction/global");
11
+ const core_entities_1 = require("@memberjunction/core-entities");
12
+ const global_2 = 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 = core_1.Metadata.Provider;
18
+ const provider = global_1.Metadata.Provider;
19
19
  // Start a database transaction
20
20
  await provider.BeginTransaction();
21
21
  try {
@@ -39,20 +39,19 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
39
39
  catch (e) {
40
40
  // Rollback on any error
41
41
  await provider.RollbackTransaction();
42
- (0, core_1.LogError)('Failed to save template content and extract parameters:', e);
42
+ (0, global_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 === "Template Parameter Extraction") {
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(p => p.Name === 'Template Parameter Extraction' &&
55
- p.Category === 'MJ: System');
54
+ const aiPrompt = aiengine_1.AIEngine.Instance.Prompts.find((p) => p.Name === 'Template Parameter Extraction' && p.Category === 'MJ: System');
56
55
  if (!aiPrompt) {
57
56
  // prompt not configured, non-fatl, just warn and return
58
57
  console.warn('AI prompt for Template Parameter Extraction not found. Skipping parameter extraction.');
@@ -60,7 +59,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
60
59
  }
61
60
  // Prepare prompt data
62
61
  const promptData = {
63
- templateText: this.TemplateText
62
+ templateText: this.TemplateText,
64
63
  };
65
64
  // Execute the prompt using AIPromptRunner
66
65
  const promptRunner = new ai_prompts_1.AIPromptRunner();
@@ -70,14 +69,14 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
70
69
  params.contextUser = this.ContextCurrentUser;
71
70
  const result = await promptRunner.ExecutePrompt(params);
72
71
  if (!result.success || !result.result) {
73
- (0, core_1.LogError)('Failed to extract template parameters:', result.errorMessage);
72
+ (0, global_1.LogError)('Failed to extract template parameters:', result.errorMessage);
74
73
  return;
75
74
  }
76
75
  // Process the extracted parameters
77
76
  await this.syncTemplateParameters(result.result.parameters);
78
77
  }
79
78
  catch (e) {
80
- (0, core_1.LogError)('Error extracting template parameters:', e);
79
+ (0, global_1.LogError)('Error extracting template parameters:', e);
81
80
  // Don't throw here - we don't want to fail the save if parameter extraction fails
82
81
  // The user can still manually manage parameters if needed
83
82
  }
@@ -91,7 +90,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
91
90
  const existingParamsResult = await rv.RunView({
92
91
  EntityName: 'Template Params',
93
92
  ExtraFilter: `TemplateID='${this.TemplateID}'`,
94
- ResultType: 'entity_object'
93
+ ResultType: 'entity_object',
95
94
  }, this.ContextCurrentUser);
96
95
  if (!existingParamsResult.Success) {
97
96
  throw new Error(`Failed to load existing template parameters: ${existingParamsResult.ErrorMessage}`);
@@ -101,22 +100,20 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
101
100
  const templateContentsResult = await rv.RunView({
102
101
  EntityName: 'Template Contents',
103
102
  ExtraFilter: `TemplateID='${this.TemplateID}'`,
104
- ResultType: 'simple'
103
+ ResultType: 'simple',
105
104
  }, this.ContextCurrentUser);
106
- const isMultipleContents = templateContentsResult.Success &&
107
- templateContentsResult.Results &&
108
- templateContentsResult.Results.length > 1;
105
+ const isMultipleContents = templateContentsResult.Success && templateContentsResult.Results && templateContentsResult.Results.length > 1;
109
106
  // For single template content, all params have TemplateContentID = NULL
110
107
  // For multiple contents, we need to be more careful about global vs content-specific params
111
108
  const templateContentID = isMultipleContents ? this.ID : null;
112
109
  // Filter existing params relevant to this content
113
- const relevantExistingParams = existingParams.filter(p => isMultipleContents ? p.TemplateContentID === this.ID : p.TemplateContentID == null);
110
+ const relevantExistingParams = existingParams.filter((p) => isMultipleContents ? p.TemplateContentID === this.ID : p.TemplateContentID == null);
114
111
  // Convert extracted param names to lowercase for comparison
115
- const extractedParamNames = extractedParams.map(p => p.name.toLowerCase());
112
+ const extractedParamNames = extractedParams.map((p) => p.name.toLowerCase());
116
113
  // Find parameters to add, update, or remove
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()));
114
+ const paramsToAdd = extractedParams.filter((p) => !relevantExistingParams.some((ep) => ep.Name.toLowerCase() === p.name.toLowerCase()));
115
+ const paramsToUpdate = relevantExistingParams.filter((ep) => extractedParams.some((p) => p.name.toLowerCase() === ep.Name.toLowerCase()));
116
+ const paramsToRemove = relevantExistingParams.filter((ep) => !extractedParamNames.includes(ep.Name.toLowerCase()));
120
117
  // Prepare all save/delete operations
121
118
  const promises = [];
122
119
  // Add new parameters
@@ -133,7 +130,7 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
133
130
  }
134
131
  // Update existing parameters if properties changed
135
132
  for (const existingParam of paramsToUpdate) {
136
- const extractedParam = extractedParams.find(p => p.name.toLowerCase() === existingParam.Name.toLowerCase());
133
+ const extractedParam = extractedParams.find((p) => p.name.toLowerCase() === existingParam.Name.toLowerCase());
137
134
  if (extractedParam) {
138
135
  let hasChanges = false;
139
136
  // Check each property for changes
@@ -171,14 +168,14 @@ let TemplateContentEntityExtended = class TemplateContentEntityExtended extends
171
168
  // For now, we're handling content-specific params only
172
169
  }
173
170
  catch (e) {
174
- (0, core_1.LogError)('Failed to sync template parameters:', e);
171
+ (0, global_1.LogError)('Failed to sync template parameters:', e);
175
172
  throw e; // Re-throw since we're in a transaction
176
173
  }
177
174
  }
178
175
  };
179
176
  exports.TemplateContentEntityExtended = TemplateContentEntityExtended;
180
177
  exports.TemplateContentEntityExtended = TemplateContentEntityExtended = __decorate([
181
- (0, global_1.RegisterClass)(core_1.BaseEntity, 'Template Contents')
178
+ (0, global_2.RegisterClass)(global_1.BaseEntity, 'Template Contents')
182
179
  ], TemplateContentEntityExtended);
183
180
  function LoadTemplateContentEntityServerSubClass() { }
184
181
  exports.LoadTemplateContentEntityServerSubClass = LoadTemplateContentEntityServerSubClass;
@@ -1 +1 @@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AK,cAAc,CAAC,YAAY,EAAE,CAAC;wBAC7D,aAAa,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC;wBACzD,UAAU,GAAG,IAAI,CAAC;oBACtB,CAAC;oBACD,IAAI,aAAa,CAAC,WAAW,KAAK,cAAc,CAAC,WAAW,EAAE,CAAC;wBAC3D,aAAa,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;wBACvD,UAAU,GAAG,IAAI,CAAC;oBACtB,CAAC;oBAED,IAAI,UAAU,EAAE,CAAC;wBACb,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;oBACxC,CAAC;gBACL,CAAC;YACL,CAAC;YAED,uDAAuD;YACvD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,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
+ {"version":3,"file":"TemplateContentEntity.server.js","sourceRoot":"","sources":["../../src/custom/TemplateContentEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuH;AACvH,iEAA2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,CAAC;wBACzD,UAAU,GAAG,IAAI,CAAC;oBACpB,CAAC;oBACD,IAAI,aAAa,CAAC,WAAW,KAAK,cAAc,CAAC,WAAW,EAAE,CAAC;wBAC7D,aAAa,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;wBACvD,UAAU,GAAG,IAAI,CAAC;oBACpB,CAAC;oBAED,IAAI,UAAU,EAAE,CAAC;wBACf,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;oBACtC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,uDAAuD;YACvD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;gBAC3C,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;YACxC,CAAC;YAED,qCAAqC;YACrC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,+BAA+B;YAC9D,CAAC;YAED,+EAA+E;YAC/E,qFAAqF;YACrF,uDAAuD;QACzD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAA,iBAAQ,EAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;YACnD,MAAM,CAAC,CAAC,CAAC,wCAAwC;QACnD,CAAC;IACH,CAAC;CACF,CAAA;AA3MY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAa,EAAC,mBAAU,EAAE,mBAAmB,CAAC;GAClC,6BAA6B,CA2MzC;AAED,SAAgB,uCAAuC,KAAI,CAAC;AAA5D,0FAA4D"}
@@ -1,4 +1,4 @@
1
- import { ReportEntity } from "@memberjunction/core-entities";
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;IACjD;;;;OAIG;IACU,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAoHxC;AAED,wBAAgB,8BAA8B,SAAK"}
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;IACnD;;;;OAIG;IACU,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAoHtC;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");
11
10
  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, global_1.SafeJSONParse)(this.Configuration) : null;
22
+ const config = this.Configuration && this.Configuration.length > 0 ? (0, global_2.SafeJSONParse)(this.Configuration) : null;
23
23
  const oldTextConfig = this.GetFieldByName('Configuration')?.OldValue;
24
- const oldConfig = oldTextConfig && oldTextConfig.length > 0 ? (0, global_1.SafeJSONParse)(oldTextConfig) : null;
24
+ const oldConfig = oldTextConfig && oldTextConfig.length > 0 ? (0, global_2.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 && await reportVersion.Save();
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 && await snapshot.Save();
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, global_1.RegisterClass)(core_1.BaseEntity, 'Reports')
126
+ (0, global_2.RegisterClass)(global_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,+CAAwF;AACxF,mDAAsE;AACtE,iEAAwG;AAIjG,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;IACjD;;;;OAIG;IACI,KA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AClH,CAAC;oBACH,CAAC;oBAED,IAAI,cAAc,EAAE,CAAC;wBACnB,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,eAAe,CAAuB,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,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;oBAED,OAAO,OAAO,CAAC;gBACjB,CAAC;qBAAM,CAAC;oBACN,OAAO,UAAU,CAAC;gBACpB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,gFAAgF;gBAChF,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAA;AA1HY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAa,EAAC,mBAAU,EAAE,SAAS,CAAC;GACxB,mBAAmB,CA0H/B;AAED,SAAgB,8BAA8B,KAAI,CAAC;AAAnD,wEAAmD"}
@@ -1,4 +1,4 @@
1
- import { EntityInfo } from "@memberjunction/core";
1
+ import { EntityInfo } from '@memberjunction/global';
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,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"}
1
+ {"version":3,"file":"userViewEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/userViewEntity.server.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAyC,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAiB,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAI7G,qBACa,qBAAsB,SAAQ,sBAAsB;IAC/D;;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;IAU5D;;;;OAIG;IACU,8BAA8B,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IA4DrD,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAmHzD;AAED,wBAAgB,gCAAgC,SAAK"}
@@ -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 core_1 = require("@memberjunction/core");
11
+ const global_2 = require("@memberjunction/global");
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,8 +32,7 @@ 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(m => m.AIModelType.trim().toLowerCase() === 'llm' &&
36
- m.Vendor.trim().toLowerCase() === this.AIVendorName.trim().toLowerCase());
35
+ const models = aiengine_1.AIEngine.Instance.Models.filter((m) => m.AIModelType.trim().toLowerCase() === 'llm' && m.Vendor.trim().toLowerCase() === this.AIVendorName.trim().toLowerCase());
37
36
  // next, sort the models by the PowerRank field so that the highest power rank model is the first array element
38
37
  models.sort((a, b) => b.PowerRank - a.PowerRank); // highest power rank first
39
38
  return models[0];
@@ -52,7 +51,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
52
51
  messages: [
53
52
  {
54
53
  role: 'system',
55
- content: this.GenerateSysPrompt(entityInfo)
54
+ content: this.GenerateSysPrompt(entityInfo),
56
55
  },
57
56
  {
58
57
  role: 'user',
@@ -80,13 +79,13 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
80
79
  ret = parsed.whereClause;
81
80
  return {
82
81
  whereClause: ret,
83
- userExplanation: parsed.userExplanationMessage
82
+ userExplanation: parsed.userExplanationMessage,
84
83
  };
85
84
  }
86
85
  else if (parsed.whereClause !== undefined && parsed.whereClause !== null) {
87
86
  return {
88
87
  whereClause: '', // empty string is valid, it means no where clause
89
- userExplanation: parsed.userExplanationMessage
88
+ userExplanation: parsed.userExplanationMessage,
90
89
  };
91
90
  }
92
91
  else {
@@ -95,7 +94,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
95
94
  }
96
95
  }
97
96
  catch (e) {
98
- (0, core_1.LogError)(e);
97
+ (0, global_2.LogError)(e);
99
98
  throw new Error('Error parsing JSON response from AI: ' + llmResponse);
100
99
  }
101
100
  }
@@ -106,7 +105,7 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
106
105
  throw new Error('No result returned from AI');
107
106
  }
108
107
  catch (e) {
109
- (0, core_1.LogError)(e);
108
+ (0, global_2.LogError)(e);
110
109
  throw e;
111
110
  }
112
111
  }
@@ -114,11 +113,11 @@ let UserViewEntity_Server = class UserViewEntity_Server extends core_entities_1.
114
113
  const processedViews = [entityInfo.BaseView];
115
114
  // Use the entity's provider instead of creating new Metadata instance
116
115
  const md = this.ProviderToUse;
117
- const listsEntity = md.Entities.find(e => e.Name === "Lists");
118
- const listDetailsEntity = md.Entities.find(e => e.Name === "List Details");
116
+ const listsEntity = md.Entities.find((e) => e.Name === 'Lists');
117
+ const listDetailsEntity = md.Entities.find((e) => e.Name === 'List Details');
119
118
  const gptSysPrompt = `You are an expert in SQL and Microsoft SQL Server.
120
119
  You will be provided a user prompt representing how they want to filter the data.
121
- You may *NOT* use JOINS, only sub-queries for related tables.
120
+ You may *NOT* use JOINS, only sub-queries for related tables.
122
121
 
123
122
  I am a bot and can only understand JSON. Your response must be parsable into this type:
124
123
  const returnType = {
@@ -127,32 +126,33 @@ const returnType = {
127
126
  userExplanationMessage: string
128
127
  };
129
128
 
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}"
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}"
132
131
 
133
132
  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).
134
133
 
135
134
  The view that the user is querying is called ${entityInfo.BaseView} and has these fields:
136
- ${entityInfo.Fields.map(f => {
135
+ ${entityInfo.Fields.map((f) => {
137
136
  let ret = `${f.Name} (${f.Type})`;
138
137
  if (f.RelatedEntity) {
139
138
  ret += ` (fkey to ${f.RelatedEntityBaseView})`;
140
139
  }
141
140
  return ret;
142
141
  }).join(',')}`;
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);
142
+ const fkeyFields = entityInfo.Fields.filter((f) => f.RelatedEntity && f.RelatedEntity.length > 0);
143
+ const fkeyBaseViewsDistinct = fkeyFields.map((f) => f.RelatedEntityBaseView).filter((v, i, a) => a.indexOf(v) === i);
145
144
  const relationships = `
146
145
  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.
147
146
  If there are multiple filters related to a single related view, attempt to combine them into a single sub-query for efficiency.
148
147
  ${
149
148
  // 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
150
- fkeyBaseViewsDistinct.map(v => {
149
+ fkeyBaseViewsDistinct
150
+ .map((v) => {
151
151
  if (processedViews.indexOf(v) === -1) {
152
- const e = md.Entities.find(e => e.BaseView === v);
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(ef => {
155
+ return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map((ef) => {
156
156
  return ef.Name + ' (' + ef.Type + ')';
157
157
  }).join(',')}`;
158
158
  }
@@ -161,15 +161,16 @@ ${
161
161
  }
162
162
  else
163
163
  return ''; // already did this at some point
164
- }).join('\n')}
164
+ })
165
+ .join('\n')}
165
166
  ${
166
167
  // this part returns a list of all the related views and the fields that are related to the current view fkeys in THOSE views
167
- entityInfo.RelatedEntities.map(r => {
168
- const e = md.Entities.find(e => e.Name === r.RelatedEntity);
168
+ entityInfo.RelatedEntities.map((r) => {
169
+ const e = md.Entities.find((e) => e.Name === r.RelatedEntity);
169
170
  if (e) {
170
171
  if (processedViews.indexOf(e.BaseView) === -1) {
171
172
  processedViews.push(e.BaseView); // note that we are processing this view now, so we won't repeat it
172
- return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map(ef => {
173
+ return `* ${e.SchemaName}.${e.BaseView}: ${e.Fields.map((ef) => {
173
174
  let ret = `${ef.Name} (${ef.Type})`;
174
175
  if (ef.RelatedEntity) {
175
176
  ret += ` (fkey to ${ef.RelatedEntityBaseView})`;
@@ -184,14 +185,14 @@ ${
184
185
  return '';
185
186
  }).join('\n')}
186
187
 
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
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
189
190
  the ${listsEntity.SchemaName}.vwListDetails view. ${listsEntity.SchemaName}.vwLists contains the list "header" information with these columns:
190
- ${listsEntity.Fields.map(f => {
191
+ ${listsEntity.Fields.map((f) => {
191
192
  return f.Name + ' (' + f.SQLFullType + ')';
192
193
  }).join(', ')}
193
194
  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:
194
- ${listDetailsEntity.Fields.map(f => {
195
+ ${listDetailsEntity.Fields.map((f) => {
195
196
  return f.Name + ' (' + f.SQLFullType + ')';
196
197
  }).join(', ')}.
197
198
 
@@ -199,7 +200,7 @@ If a user is asking to use a list in creating a view, you need to use a sub-quer
199
200
 
200
201
  ID IN (SELECT RecordID FROM ${listsEntity.SchemaName}.vwListDetails WHERE ListID='My List ID')
201
202
 
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.
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.
203
204
  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.
204
205
 
205
206
  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
@@ -215,20 +216,21 @@ The user might reference other "views" in their request. In the user's terminolo
215
216
  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
216
217
  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:
217
218
  ID IN ({%UserView "ViewID"%}) -- this is for filtering the primary key using other User Views for this entity: "${entityInfo.Name}"
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
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
219
220
  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
220
221
  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.
221
222
  </IMPORTANT - OTHER VIEWS>
222
223
  `;
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!`;
224
+ return (gptSysPrompt +
225
+ (processedViews.length > 1 /*we always have 1 from the entity base view*/ ? relationships : '') +
226
+ `
227
+ **** REMEMBER **** I am a BOT, do not return anything other than JSON to me or I will choke on your response!`);
225
228
  }
226
229
  };
227
230
  exports.UserViewEntity_Server = UserViewEntity_Server;
228
231
  exports.UserViewEntity_Server = UserViewEntity_Server = __decorate([
229
- (0, global_1.RegisterClass)(core_1.BaseEntity, 'User Views')
232
+ (0, global_1.RegisterClass)(global_2.BaseEntity, 'User Views')
230
233
  ], UserViewEntity_Server);
231
- function LoadUserViewEntityServerSubClass() {
232
- }
234
+ function LoadUserViewEntityServerSubClass() { }
233
235
  exports.LoadUserViewEntityServerSubClass = LoadUserViewEntityServerSubClass;
234
236
  //# 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,+CAAqG;AACrG,iEAA4G;AAC5G,2CAAsE;AACtE,uDAAoD;AAG7C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,sCAAsB;IAC7D;;OAEG;IACH,IAAuB,sBAAsB;QACzC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,IAAc,YAAY;QACtB,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,UAAU;QACtB,MAAM,mBAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,0FAA0F;QAC1J,MAAM,MAAM,GAAG,mBAAQ,CAAC,QA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AAI,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,GAAG,GAAG,CAAC;QAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;6IACgI,WAAW,CAAC,UAAU;EACjK,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACnC,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,GAAG,GAAG,CAAC;QAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;8BAIiB,WAAW,CAAC,UAAU;;;;;;;;iCAQnB,WAAW,CAAC,UAAU,gCAAgC,WAAW,CAAC,UAAU;;;;;;;;;sHASS,UAAU,CAAC,IAAI;4IACO,UAAU,CAAC,IAAI;;;;CAI1J,CAAC;QAEE,OAAO,CACL,YAAY;YACZ,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/F;sHACgH,CACjH,CAAC;IACJ,CAAC;CACF,CAAA;AArNY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAa,EAAC,mBAAU,EAAE,YAAY,CAAC;GAC3B,qBAAqB,CAqNjC;AAED,SAAgB,gCAAgC,KAAI,CAAC;AAArD,4EAAqD"}
@@ -1,4 +1,4 @@
1
- import { BaseEntity, SimpleEmbeddingResult } from "@memberjunction/core";
1
+ import { BaseEntity, SimpleEmbeddingResult } from '@memberjunction/global';
2
2
  /**
3
3
  * Helper Method for BaseEntity sub-classes to call for embeddings
4
4
  * @param entity
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/custom/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAYlH"}
@@ -16,7 +16,7 @@ async function EmbedTextLocalHelper(entity, textToEmbed) {
16
16
  }
17
17
  return {
18
18
  vector: e.result.vector,
19
- modelID: e.model.ID
19
+ modelID: e.model.ID,
20
20
  };
21
21
  }
22
22
  exports.EmbedTextLocalHelper = EmbedTextLocalHelper;
@@ -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;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"}
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;IAChF,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;QACxC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;QACvB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE;KACpB,CAAC;AACJ,CAAC;AAZD,oDAYC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/core-entities-server",
3
- "version": "2.111.0",
3
+ "version": "2.112.0",
4
4
  "description": "Entity subclasses for the metadata layer of MemberJunction that are only used on server side applications like MJAPI, distributed as part of each release of MemberJunction",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,16 +19,15 @@
19
19
  "typescript": "^5.4.5"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/ai-provider-bundle": "2.111.0",
23
- "@memberjunction/core": "2.111.0",
24
- "@memberjunction/global": "2.111.0",
25
- "@memberjunction/core-entities": "2.111.0",
26
- "@memberjunction/ai-vector-dupe": "2.111.0",
27
- "@memberjunction/ai-core-plus": "2.111.0",
28
- "@memberjunction/ai-prompts": "2.111.0",
29
- "@memberjunction/skip-types": "2.111.0",
30
- "@memberjunction/aiengine": "2.111.0",
31
- "@memberjunction/sqlserver-dataprovider": "2.111.0",
22
+ "@memberjunction/ai-provider-bundle": "2.112.0",
23
+ "@memberjunction/global": "2.112.0",
24
+ "@memberjunction/core-entities": "2.112.0",
25
+ "@memberjunction/ai-vector-dupe": "2.112.0",
26
+ "@memberjunction/ai-core-plus": "2.112.0",
27
+ "@memberjunction/ai-prompts": "2.112.0",
28
+ "@memberjunction/skip-types": "2.112.0",
29
+ "@memberjunction/aiengine": "2.112.0",
30
+ "@memberjunction/sqlserver-dataprovider": "2.112.0",
32
31
  "zod": "^3.23.8"
33
32
  },
34
33
  "repository": {