@memberjunction/core-entities-server 2.54.0 → 2.56.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.
@@ -0,0 +1,58 @@
1
+ import { EntitySaveOptions } from "@memberjunction/core";
2
+ import { AIPromptRunEntity } from "@memberjunction/core-entities";
3
+ /**
4
+ * Server-side subclass for AIPromptRunEntity that automatically calculates costs
5
+ * when a prompt run is completed or errors out. The cost calculation is based on
6
+ * the active pricing configuration for the model and vendor used in the run.
7
+ */
8
+ export declare class AIPromptRunEntityServer extends AIPromptRunEntity {
9
+ /**
10
+ * Override Save to calculate costs when status changes to Complete or Error
11
+ */
12
+ Save(options?: EntitySaveOptions): Promise<boolean>;
13
+ /**
14
+ * Determines if we should calculate costs for this run
15
+ * @returns true if costs should be calculated
16
+ */
17
+ protected ShouldCalculateCost(): boolean;
18
+ /**
19
+ * Calculates the cost for this prompt run based on token usage and active pricing
20
+ */
21
+ protected CalculateAndSetCost(): Promise<void>;
22
+ /**
23
+ * Triggers cost rollup calculation on the parent prompt run
24
+ */
25
+ protected TriggerParentCostRollup(): Promise<void>;
26
+ /**
27
+ * Recalculates the descendant cost for this prompt run by summing all child total costs.
28
+ * This method queries all direct children and sums their TotalCost values to determine
29
+ * this run's DescendantCost. The TotalCost is automatically updated via the setter.
30
+ */
31
+ RecalculateTotalCost(): Promise<void>;
32
+ /**
33
+ * Override setter for DescendantCost to automatically update TotalCost whenever it changes.
34
+ * This ensures TotalCost always reflects the sum of Cost + DescendantCost.
35
+ * @param value The new descendant cost value
36
+ */
37
+ set DescendantCost(value: number);
38
+ get DescendantCost(): number;
39
+ /**
40
+ * Override setter for Cost to automatically update TotalCost whenever it changes.
41
+ * This ensures TotalCost always reflects the sum of Cost + DescendantCost.
42
+ * @param value The new cost value for this run
43
+ */
44
+ set Cost(value: number);
45
+ get Cost(): number;
46
+ /**
47
+ * Updates the TotalCost field by summing Cost and DescendantCost.
48
+ * This method is called automatically by the Cost and DescendantCost setters
49
+ * to maintain consistency. Handles null values by treating them as zero.
50
+ * @protected
51
+ */
52
+ protected UpdateTotalCost(): void;
53
+ }
54
+ /**
55
+ * This function is used to ensure the class is loaded and registered
56
+ */
57
+ export declare function LoadAIPromptRunEntityServerSubClass(): void;
58
+ //# sourceMappingURL=AIPromptRunEntity.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIPromptRunEntity.server.d.ts","sourceRoot":"","sources":["../../src/custom/AIPromptRunEntity.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA+B,MAAM,sBAAsB,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAuB,MAAM,+BAA+B,CAAC;AAGvF;;;;GAIG;AACH,qBACa,uBAAwB,SAAQ,iBAAiB;IAE1D;;OAEG;IACY,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IA6BlE;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,OAAO;IAkCxC;;OAEG;cACa,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6DpD;;OAEG;cACa,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBxD;;;;OAIG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BlD;;;;OAIG;IACH,IAAW,cAAc,CAAC,KAAK,EAAE,MAAM,EAGtC;IAED,IAAW,cAAc,IAAI,MAAM,CAElC;IAED;;;;OAIG;IACH,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,EAG5B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;IACD;;;;;OAKG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;CAKpC;AAED;;GAEG;AACH,wBAAgB,mCAAmC,SAAK"}
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.LoadAIPromptRunEntityServerSubClass = exports.AIPromptRunEntityServer = void 0;
10
+ const core_1 = require("@memberjunction/core");
11
+ const global_1 = require("@memberjunction/global");
12
+ const core_entities_1 = require("@memberjunction/core-entities");
13
+ const ai_engine_base_1 = require("@memberjunction/ai-engine-base");
14
+ /**
15
+ * Server-side subclass for AIPromptRunEntity that automatically calculates costs
16
+ * when a prompt run is completed or errors out. The cost calculation is based on
17
+ * the active pricing configuration for the model and vendor used in the run.
18
+ */
19
+ let AIPromptRunEntityServer = class AIPromptRunEntityServer extends core_entities_1.AIPromptRunEntity {
20
+ /**
21
+ * Override Save to calculate costs when status changes to Complete or Error
22
+ */
23
+ async Save(options) {
24
+ try {
25
+ // Check if we need to calculate costs
26
+ const shouldCalculateCost = this.ShouldCalculateCost();
27
+ if (shouldCalculateCost) {
28
+ await this.CalculateAndSetCost();
29
+ }
30
+ // always update our TotalCost in case cost or descendant cost changed
31
+ this.UpdateTotalCost();
32
+ // Now save the entity with the calculated costs
33
+ const result = await super.Save(options);
34
+ // If save was successful and this is a child prompt run with costs, trigger parent rollup
35
+ // only do it if we have just calculated costs
36
+ if (result && shouldCalculateCost && this.ParentID && this.Cost != null) {
37
+ await this.TriggerParentCostRollup();
38
+ }
39
+ return result;
40
+ }
41
+ catch (err) {
42
+ (0, core_1.LogError)(`Error in AIPromptRunEntityServer.Save: ${err}`);
43
+ throw err;
44
+ }
45
+ }
46
+ /**
47
+ * Determines if we should calculate costs for this run
48
+ * @returns true if costs should be calculated
49
+ */
50
+ ShouldCalculateCost() {
51
+ // Only calculate if we have a CompletedAt timestamp
52
+ if (!this.CompletedAt) {
53
+ return false;
54
+ }
55
+ // Check if CompletedAt was just set (either new record or just changed)
56
+ // For existing records, check if any fields have changed
57
+ const f = this.Fields.find(f => f.Name === 'CompletedAt');
58
+ const completedAtChanged = !this.IsSaved || f.Dirty;
59
+ if (!completedAtChanged) {
60
+ return false;
61
+ }
62
+ // Don't recalculate if cost is already set
63
+ if (this.Cost != null && this.Cost > 0) {
64
+ return false;
65
+ }
66
+ // Must have token usage to calculate (at least one token field > 0)
67
+ if (!this.TokensPrompt || !this.TokensCompletion ||
68
+ (this.TokensPrompt <= 0 && this.TokensCompletion <= 0)) {
69
+ return false;
70
+ }
71
+ // Must have model and vendor information
72
+ if (!this.ModelID || !this.VendorID) {
73
+ return false;
74
+ }
75
+ return true;
76
+ }
77
+ /**
78
+ * Calculates the cost for this prompt run based on token usage and active pricing
79
+ */
80
+ async CalculateAndSetCost() {
81
+ try {
82
+ // Ensure AI metadata is loaded
83
+ await ai_engine_base_1.AIEngineBase.Instance.Config(false, this.ContextCurrentUser);
84
+ // Get the active cost configuration
85
+ const activeCost = ai_engine_base_1.AIEngineBase.Instance.GetActiveModelCost(this.ModelID, this.VendorID, 'Realtime' // For now, assume all prompt runs are realtime
86
+ );
87
+ if (!activeCost) {
88
+ (0, core_1.LogError)(`No active cost configuration found for Model: ${this.ModelID}, Vendor: ${this.VendorID}`);
89
+ return;
90
+ }
91
+ // Get the price unit type to understand the normalization
92
+ const priceUnitType = ai_engine_base_1.AIEngineBase.Instance.ModelPriceUnitTypes.find(put => put.ID === activeCost.UnitTypeID);
93
+ if (!priceUnitType) {
94
+ (0, core_1.LogError)(`Price unit type not found: ${activeCost.UnitTypeID}`);
95
+ return;
96
+ }
97
+ // Calculate costs using the driver class
98
+ const priceCalculator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(ai_engine_base_1.BasePriceUnitType, priceUnitType.DriverClass);
99
+ if (!priceCalculator) {
100
+ (0, core_1.LogError)(`Failed to create price calculator for driver class: ${priceUnitType.DriverClass}`);
101
+ return;
102
+ }
103
+ const normalizedCost = priceCalculator.CalculateNormalizedCost(activeCost, this.TokensPrompt, this.TokensCompletion);
104
+ // Set the cost fields
105
+ this.Cost = normalizedCost;
106
+ this.CostCurrency = activeCost.Currency;
107
+ // Update total cost (for leaf nodes, total = cost)
108
+ if (!this.ParentID) {
109
+ // This is a root prompt run, so total cost = cost
110
+ this.TotalCost = normalizedCost;
111
+ }
112
+ // For child nodes, TotalCost will be calculated during rollup
113
+ }
114
+ catch (err) {
115
+ (0, core_1.LogError)(`Error calculating cost for AIPromptRun ${this.ID}: ${err}`);
116
+ // Don't throw - we don't want to prevent saving just because cost calc failed
117
+ }
118
+ }
119
+ /**
120
+ * Triggers cost rollup calculation on the parent prompt run
121
+ */
122
+ async TriggerParentCostRollup() {
123
+ try {
124
+ // Load the parent prompt run
125
+ const md = new core_1.Metadata();
126
+ const parent = await md.GetEntityObject('MJ: AI Prompt Runs', this.ContextCurrentUser);
127
+ if (await parent.Load(this.ParentID)) {
128
+ // Recalculate the parent's total cost
129
+ await parent.RecalculateTotalCost();
130
+ await parent.Save();
131
+ }
132
+ }
133
+ catch (err) {
134
+ (0, core_1.LogError)(`Error triggering parent cost rollup: ${err}`);
135
+ }
136
+ }
137
+ /**
138
+ * Recalculates the descendant cost for this prompt run by summing all child total costs.
139
+ * This method queries all direct children and sums their TotalCost values to determine
140
+ * this run's DescendantCost. The TotalCost is automatically updated via the setter.
141
+ */
142
+ async RecalculateTotalCost() {
143
+ try {
144
+ // Initialize descendant cost to zero
145
+ let descendantCost = 0;
146
+ // Get all child runs
147
+ const rv = new core_1.RunView();
148
+ const childRuns = await rv.RunView({
149
+ EntityName: 'MJ: AI Prompt Runs',
150
+ ExtraFilter: `ParentID = '${this.ID}'`,
151
+ ResultType: 'simple'
152
+ }, this.ContextCurrentUser);
153
+ if (childRuns.Success && childRuns.Results) {
154
+ // Sum up all child total costs
155
+ for (const child of childRuns.Results) {
156
+ if (child.TotalCost != null) {
157
+ descendantCost += Number(child.TotalCost);
158
+ }
159
+ }
160
+ }
161
+ // Update our descendant cost
162
+ this.DescendantCost = descendantCost;
163
+ }
164
+ catch (err) {
165
+ (0, core_1.LogError)(`Error recalculating total cost for prompt run ${this.ID}: ${err}`);
166
+ }
167
+ }
168
+ /**
169
+ * Override setter for DescendantCost to automatically update TotalCost whenever it changes.
170
+ * This ensures TotalCost always reflects the sum of Cost + DescendantCost.
171
+ * @param value The new descendant cost value
172
+ */
173
+ set DescendantCost(value) {
174
+ super.DescendantCost = value; // call the base class setter
175
+ this.UpdateTotalCost(); // update total cost
176
+ }
177
+ // need both getters and setters to ensure consistency
178
+ get DescendantCost() {
179
+ return super.DescendantCost; // call the base class getter
180
+ }
181
+ /**
182
+ * Override setter for Cost to automatically update TotalCost whenever it changes.
183
+ * This ensures TotalCost always reflects the sum of Cost + DescendantCost.
184
+ * @param value The new cost value for this run
185
+ */
186
+ set Cost(value) {
187
+ super.Cost = value; // call the base class setter
188
+ this.UpdateTotalCost(); // update total cost
189
+ }
190
+ // need both getters and setters to ensure consistency
191
+ get Cost() {
192
+ return super.Cost; // call the base class getter
193
+ }
194
+ /**
195
+ * Updates the TotalCost field by summing Cost and DescendantCost.
196
+ * This method is called automatically by the Cost and DescendantCost setters
197
+ * to maintain consistency. Handles null values by treating them as zero.
198
+ * @protected
199
+ */
200
+ UpdateTotalCost() {
201
+ const descendantCost = this.DescendantCost || 0;
202
+ const cost = this.Cost || 0;
203
+ this.TotalCost = descendantCost + cost; // update total cost
204
+ }
205
+ };
206
+ exports.AIPromptRunEntityServer = AIPromptRunEntityServer;
207
+ exports.AIPromptRunEntityServer = AIPromptRunEntityServer = __decorate([
208
+ (0, global_1.RegisterClass)(core_1.BaseEntity, "MJ: AI Prompt Runs")
209
+ ], AIPromptRunEntityServer);
210
+ /**
211
+ * This function is used to ensure the class is loaded and registered
212
+ */
213
+ function LoadAIPromptRunEntityServerSubClass() { }
214
+ exports.LoadAIPromptRunEntityServerSubClass = LoadAIPromptRunEntityServerSubClass;
215
+ //# sourceMappingURL=AIPromptRunEntity.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIPromptRunEntity.server.js","sourceRoot":"","sources":["../../src/custom/AIPromptRunEntity.server.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAkG;AAClG,mDAAiE;AACjE,iEAAuF;AACvF,mEAAiF;AAEjF;;;;GAIG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,iCAAiB;IAE1D;;OAEG;IACM,KAAK,CAAC,IAAI,CAAC,OAA2B;QAC3C,IAAI,CAAC;YACD,sCAAsC;YACtC,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAEvD,IAAI,mBAAmB,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACrC,CAAC;YAED,sEAAsE;YACtE,IAAI,CAAC,eAAe,EAAE,CAAC;YAEvB,gDAAgD;YAChD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEzC,0FAA0F;YAC1F,8CAA8C;YAC9C,IAAI,MAAM,IAAI,mBAAmB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;gBACtE,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACzC,CAAC;YAED,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;YACT,IAAA,eAAQ,EAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;YAC1D,MAAM,GAAG,CAAC;QACd,CAAC;IACL,CAAC;IAED;;;OAGG;IACO,mBAAmB;QACzB,oDAAoD;QACpD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,wEAAwE;QACxE,yDAAyD;QAC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G,EAAE,CAAC;YACX,IAAA,eAAQ,EAAC,iDAAiD,IAAI,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC,CAAC;QACjF,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,IAAW,cAAc,CAAC,KAAa;QACnC,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,6BAA6B;QAC3D,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,oBAAoB;IAChD,CAAC;IACD,sDAAsD;IACtD,IAAW,cAAc;QACrB,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,6BAA6B;IAC9D,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI,CAAC,KAAa;QACzB,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,6BAA6B;QACjD,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,oBAAoB;IAChD,CAAC;IACD,sDAAsD;IACtD,IAAW,IAAI;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,6BAA6B;IACpD,CAAC;IACD;;;;;OAKG;IACO,eAAe;QACrB,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC,oBAAoB;IAChE,CAAC;CACJ,CAAA;AAtOY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,sBAAa,EAAC,iBAAU,EAAE,oBAAoB,CAAC;GACnC,uBAAuB,CAsOnC;AAED;;GAEG;AACH,SAAgB,mCAAmC,KAAI,CAAC;AAAxD,kFAAwD"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './custom/AIPromptEntityExtended.server';
2
+ export * from './custom/AIPromptRunEntity.server';
2
3
  export * from './custom/DuplicateRunEntity.server';
3
4
  export * from './custom/reportEntity.server';
4
5
  export * from './custom/TemplateContentEntity.server';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAG/C,wBAAgB,gCAAgC,IAAI,IAAI,CAMvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAG/C,wBAAgB,gCAAgC,IAAI,IAAI,CAOvD"}
package/dist/index.js CHANGED
@@ -16,11 +16,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.LoadCoreEntitiesServerSubClasses = void 0;
18
18
  const AIPromptEntityExtended_server_1 = require("./custom/AIPromptEntityExtended.server");
19
+ const AIPromptRunEntity_server_1 = require("./custom/AIPromptRunEntity.server");
19
20
  const DuplicateRunEntity_server_1 = require("./custom/DuplicateRunEntity.server");
20
21
  const reportEntity_server_1 = require("./custom/reportEntity.server");
21
22
  const TemplateContentEntity_server_1 = require("./custom/TemplateContentEntity.server");
22
23
  const userViewEntity_server_1 = require("./custom/userViewEntity.server");
23
24
  __exportStar(require("./custom/AIPromptEntityExtended.server"), exports);
25
+ __exportStar(require("./custom/AIPromptRunEntity.server"), exports);
24
26
  __exportStar(require("./custom/DuplicateRunEntity.server"), exports);
25
27
  __exportStar(require("./custom/reportEntity.server"), exports);
26
28
  __exportStar(require("./custom/TemplateContentEntity.server"), exports);
@@ -28,6 +30,7 @@ __exportStar(require("./custom/userViewEntity.server"), exports);
28
30
  // Call the stub functions to ensure that the custom subclasses are not tree shaken out.
29
31
  function LoadCoreEntitiesServerSubClasses() {
30
32
  (0, AIPromptEntityExtended_server_1.LoadAIPromptEntityExtendedServerSubClass)();
33
+ (0, AIPromptRunEntity_server_1.LoadAIPromptRunEntityServerSubClass)();
31
34
  (0, DuplicateRunEntity_server_1.LoadDuplicateRunEntityServerSubClass)();
32
35
  (0, reportEntity_server_1.LoadReportEntityServerSubClass)();
33
36
  (0, TemplateContentEntity_server_1.LoadTemplateContentEntityServerSubClass)();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0FAAkG;AAClG,kFAA0F;AAC1F,sEAA8E;AAC9E,wFAAgG;AAChG,0EAAkF;AAElF,yEAAuD;AACvD,qEAAmD;AACnD,+DAA6C;AAC7C,wEAAsD;AACtD,iEAA+C;AAE/C,wFAAwF;AACxF,SAAgB,gCAAgC;IAC5C,IAAA,wEAAwC,GAAE,CAAC;IAC3C,IAAA,gEAAoC,GAAE,CAAC;IACvC,IAAA,oDAA8B,GAAE,CAAC;IACjC,IAAA,sEAAuC,GAAE,CAAC;IAC1C,IAAA,wDAAgC,GAAE,CAAC;AACvC,CAAC;AAND,4EAMC;AACD,gCAAgC,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0FAAkG;AAClG,gFAAwF;AACxF,kFAA0F;AAC1F,sEAA8E;AAC9E,wFAAgG;AAChG,0EAAkF;AAElF,yEAAuD;AACvD,oEAAkD;AAClD,qEAAmD;AACnD,+DAA6C;AAC7C,wEAAsD;AACtD,iEAA+C;AAE/C,wFAAwF;AACxF,SAAgB,gCAAgC;IAC5C,IAAA,wEAAwC,GAAE,CAAC;IAC3C,IAAA,8DAAmC,GAAE,CAAC;IACtC,IAAA,gEAAoC,GAAE,CAAC;IACvC,IAAA,oDAA8B,GAAE,CAAC;IACjC,IAAA,sEAAuC,GAAE,CAAC;IAC1C,IAAA,wDAAgC,GAAE,CAAC;AACvC,CAAC;AAPD,4EAOC;AACD,gCAAgC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/core-entities-server",
3
- "version": "2.54.0",
3
+ "version": "2.56.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,13 +19,13 @@
19
19
  "typescript": "^5.4.5"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/core": "2.54.0",
23
- "@memberjunction/global": "2.54.0",
24
- "@memberjunction/core-entities": "2.54.0",
25
- "@memberjunction/ai-vector-dupe": "2.54.0",
26
- "@memberjunction/skip-types": "2.54.0",
27
- "@memberjunction/aiengine": "2.54.0",
28
- "@memberjunction/sqlserver-dataprovider": "2.54.0",
22
+ "@memberjunction/core": "2.56.0",
23
+ "@memberjunction/global": "2.56.0",
24
+ "@memberjunction/core-entities": "2.56.0",
25
+ "@memberjunction/ai-vector-dupe": "2.56.0",
26
+ "@memberjunction/skip-types": "2.56.0",
27
+ "@memberjunction/aiengine": "2.56.0",
28
+ "@memberjunction/sqlserver-dataprovider": "2.56.0",
29
29
  "zod": "^3.23.8"
30
30
  }
31
31
  }