@memberjunction/react-runtime 5.20.0 → 5.22.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.
- package/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +24 -0
- package/dist/324.runtime.umd.js +35 -18
- package/dist/runtime.umd.js +1153 -605
- package/package.json +6 -6
package/dist/runtime.umd.js
CHANGED
|
@@ -19082,7 +19082,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
19082
19082
|
I: () => (/* reexport */ getGraphQLTypeNameBase)
|
|
19083
19083
|
});
|
|
19084
19084
|
|
|
19085
|
-
// UNUSED EXPORTS: AUTH_PROVIDER_TYPES, AllMetadata, AllMetadataArrays, ApplicationEntityInfo, ApplicationInfo, ApplicationSettingInfo, AuditLogTypeInfo, AuthorizationEvaluator, AuthorizationInfo, AuthorizationRoleInfo, AuthorizationRoleType, BaseEnginePropertyConfig, BaseEngineRegistry, BaseEntityAIActionParams, BaseEntityEvent, CacheCategory, ClearAllDataHooks, CodeNameFromString, CommonStopWords, Concurrent, ConsoleColor, DataObjectParams, DataObjectRelatedEntityParam, DatabaseProviderBase, EntityDeleteOptions, EntityDependency, EntityDocumentTypeInfo, EntityField, EntityFieldGraphQLType, EntityFieldInfo, EntityFieldValueInfo, EntityFieldValueListType, EntityInfo, EntityMergeOptions, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo, EntityPermissionInfo, EntityRecordNameInput, EntityRecordNameResult, EntityRelationshipInfo, EntitySaveOptions, EntitySettingInfo, EntityUserPermissionInfo, ExplorerNavigationItem, ExtractActualDefaultValue, FieldValueCollection, FormatConsoleMessage, FormatFileMessage, FormatValue, GeneratedFormSectionType, GetDataHooks, GetEntityNameFromSchemaAndViewString, KeyValuePair, LibraryInfo, LoadOnStartup, LocalCacheManager, LogDebug, LogStatusEx, MJ_CORE_SCHEMA, MetadataFromSimpleObject, MetadataFromSimpleObjectWithoutUser, MetadataInfo, ParsePlatformVariants, PotentialDuplicate, PotentialDuplicateRequest, PotentialDuplicateResponse, PotentialDuplicateResult, QueryCache, QueryCacheManager, QueryCategoryInfo, QueryDependencyInfo, QueryEntityInfo, QueryExecutionSpec, QueryFieldInfo, QueryInfo, QueryParameterInfo, QueryPermissionInfo, QuerySQLInfo, RUN_QUERY_SQL_FILTERS, RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS, RecordChange, RecordChangeStatus, RecordDependency, RecordMergeDetailResult, RecordMergeRequest, RecordMergeResult, RegisterDataHook, ResolvePlatformVariant, RoleInfo, RowLevelSecurityFilterInfo, RunQuery, RunQuerySQLFilterManager, RunReport, RunViewParams, SQLDialectInfo, SQLFullType, SQLMaxLength, SetProductionStatus, SetVerboseLogging, SeverityType, StripContainingParens, StripSingleQuotes, StripStopWords, StripUnicodePrefix, TelemetryLevelValue, TelemetryManager, TransactionPreprocessingItem, TransactionVariable, TypeScriptTypeFromSQLType, TypeScriptTypeFromSQLTypeWithNullableOption, UpdateCurrentConsoleLine, UpdateCurrentConsoleProgress, getAnsiColorCode, getRunQuerySQLFilter, getRunQuerySQLFilterNames, getSchemaPrefix, isAIParams, isBatchRunQueryParams, isBatchRunViewParams, isCacheParams, isEngineParams, isNetworkParams, isSingleRunQueryParams, isSingleRunViewParams, sanitizeGraphQLName
|
|
19085
|
+
// UNUSED EXPORTS: AUTH_PROVIDER_TYPES, AllMetadata, AllMetadataArrays, ApplicationEntityInfo, ApplicationInfo, ApplicationSettingInfo, AuditLogTypeInfo, AuthorizationEvaluator, AuthorizationInfo, AuthorizationRoleInfo, AuthorizationRoleType, BaseEnginePropertyConfig, BaseEngineRegistry, BaseEntityAIActionParams, BaseEntityEvent, CacheCategory, ClearAllDataHooks, CodeNameFromString, CommonStopWords, ComputeRRF, Concurrent, ConsoleColor, DataObjectParams, DataObjectRelatedEntityParam, DatabaseProviderBase, EntityDeleteOptions, EntityDependency, EntityDocumentTypeInfo, EntityField, EntityFieldGraphQLType, EntityFieldInfo, EntityFieldValueInfo, EntityFieldValueListType, EntityInfo, EntityMergeOptions, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo, EntityPermissionInfo, EntityRecordNameInput, EntityRecordNameResult, EntityRelationshipInfo, EntitySaveOptions, EntitySettingInfo, EntityUserPermissionInfo, ExplorerNavigationItem, ExtractActualDefaultValue, FieldValueCollection, FormatConsoleMessage, FormatFileMessage, FormatValue, GeneratedFormSectionType, GetDataHooks, GetEntityNameFromSchemaAndViewString, KeyValuePair, LibraryInfo, LoadOnStartup, LocalCacheManager, LogDebug, LogStatusEx, MJ_CORE_SCHEMA, MetadataFromSimpleObject, MetadataFromSimpleObjectWithoutUser, MetadataInfo, ParsePlatformVariants, PotentialDuplicate, PotentialDuplicateRequest, PotentialDuplicateResponse, PotentialDuplicateResult, QueryCache, QueryCacheManager, QueryCategoryInfo, QueryDependencyInfo, QueryEntityInfo, QueryExecutionSpec, QueryFieldInfo, QueryInfo, QueryParameterInfo, QueryPermissionInfo, QuerySQLInfo, RUN_QUERY_SQL_FILTERS, RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS, RecordChange, RecordChangeStatus, RecordDependency, RecordMergeDetailResult, RecordMergeRequest, RecordMergeResult, RegisterDataHook, ResolvePlatformVariant, RoleInfo, RowLevelSecurityFilterInfo, RunQuery, RunQuerySQLFilterManager, RunReport, RunViewParams, SQLDialectInfo, SQLFullType, SQLMaxLength, SetProductionStatus, SetVerboseLogging, SeverityType, StripContainingParens, StripSingleQuotes, StripStopWords, StripUnicodePrefix, TelemetryLevelValue, TelemetryManager, TransactionPreprocessingItem, TransactionVariable, TransformSimpleObjectToEntityObject, TypeScriptTypeFromSQLType, TypeScriptTypeFromSQLTypeWithNullableOption, UpdateCurrentConsoleLine, UpdateCurrentConsoleProgress, getAnsiColorCode, getRunQuerySQLFilter, getRunQuerySQLFilterNames, getSchemaPrefix, isAIParams, isBatchRunQueryParams, isBatchRunViewParams, isCacheParams, isEngineParams, isNetworkParams, isSingleRunQueryParams, isSingleRunViewParams, sanitizeGraphQLName
|
|
19086
19086
|
|
|
19087
19087
|
// EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 16 modules
|
|
19088
19088
|
var dist = __webpack_require__(300);
|
|
@@ -19542,6 +19542,10 @@ function UpdateCurrentConsoleProgress(message, current, total) {
|
|
|
19542
19542
|
UpdateCurrentConsoleLine("".concat(message, " ").concat(current, " of ").concat(total, " (").concat((current / total * 100).toFixed(1), "%)"), color);
|
|
19543
19543
|
}
|
|
19544
19544
|
;// ../../MJCore/dist/generic/util.js
|
|
19545
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
19546
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
19547
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
19548
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19545
19549
|
|
|
19546
19550
|
/**
|
|
19547
19551
|
* Returns the TypeScript type that corresponds to the SQL type passed in
|
|
@@ -19851,6 +19855,97 @@ function StripContainingParens(value) {
|
|
|
19851
19855
|
}
|
|
19852
19856
|
return value;
|
|
19853
19857
|
}
|
|
19858
|
+
/**
|
|
19859
|
+
* Converts an array of plain JavaScript objects into fully-hydrated `BaseEntity`
|
|
19860
|
+
* subclass instances, using `Promise.all` for parallel creation.
|
|
19861
|
+
*
|
|
19862
|
+
* This is the canonical way to batch-convert raw data (e.g. from a custom stored
|
|
19863
|
+
* procedure, RunQuery result, or any non-RunView data source) into typed entity
|
|
19864
|
+
* objects that support `.Save()`, `.Load()`, dirty-tracking, and all other
|
|
19865
|
+
* `BaseEntity` capabilities.
|
|
19866
|
+
*
|
|
19867
|
+
* Items that are already `BaseEntity` instances (detected via `instanceof` or
|
|
19868
|
+
* duck-typing the `.Save()` method) are returned as-is, making this function
|
|
19869
|
+
* safe to call on mixed arrays.
|
|
19870
|
+
*
|
|
19871
|
+
* **Performance note:** All entity creations run in parallel via `Promise.all`.
|
|
19872
|
+
* For large arrays (500+ items), consider chunking to avoid memory pressure.
|
|
19873
|
+
*
|
|
19874
|
+
* @param md - The metadata provider used to create entity instances. On the client
|
|
19875
|
+
* side this is typically `new Metadata()`; on the server side it is the active
|
|
19876
|
+
* `IMetadataProvider` (e.g. `Metadata.Provider`).
|
|
19877
|
+
* @param entityName - The MemberJunction entity name, e.g. `'MJ: Conversation Details'`.
|
|
19878
|
+
* Must match a registered entity exactly (case-insensitive, trimmed).
|
|
19879
|
+
* @param items - Plain objects whose keys map to entity field names. Each object is
|
|
19880
|
+
* passed to `entity.LoadFromData()` which populates the entity without marking
|
|
19881
|
+
* fields as dirty (i.e. the entity starts in a "clean" / not-new state).
|
|
19882
|
+
* @param contextUser - Optional user context for server-side operations. Required on
|
|
19883
|
+
* the server where multiple users are served concurrently; can be omitted on the
|
|
19884
|
+
* client where user context is already established.
|
|
19885
|
+
* @returns A parallel-resolved array of typed entity objects in the same order as
|
|
19886
|
+
* the input `items` array.
|
|
19887
|
+
*
|
|
19888
|
+
* @example
|
|
19889
|
+
* ```typescript
|
|
19890
|
+
* import { Metadata, TransformSimpleObjectToEntityObject } from '@memberjunction/core';
|
|
19891
|
+
*
|
|
19892
|
+
* const md = new Metadata();
|
|
19893
|
+
* const rawRows = queryResult.Results as SomeRawType[];
|
|
19894
|
+
* const entities = await TransformSimpleObjectToEntityObject<MyEntity>(
|
|
19895
|
+
* md, 'My Entity Name', rawRows, contextUser
|
|
19896
|
+
* );
|
|
19897
|
+
* // entities is MyEntity[] — fully usable with .Save(), .Load(), etc.
|
|
19898
|
+
* ```
|
|
19899
|
+
*/
|
|
19900
|
+
function util_TransformSimpleObjectToEntityObject(_x, _x2, _x3, _x4) {
|
|
19901
|
+
return _TransformSimpleObjectToEntityObject.apply(this, arguments);
|
|
19902
|
+
}
|
|
19903
|
+
function _TransformSimpleObjectToEntityObject() {
|
|
19904
|
+
_TransformSimpleObjectToEntityObject = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(md, entityName, items, contextUser) {
|
|
19905
|
+
var entityPromises;
|
|
19906
|
+
return _regenerator().w(function (_context2) {
|
|
19907
|
+
while (1) switch (_context2.n) {
|
|
19908
|
+
case 0:
|
|
19909
|
+
// we need to transform each of the items in the result set into a BaseEntity-derived object
|
|
19910
|
+
// Create entities and load data in parallel for better performance
|
|
19911
|
+
entityPromises = items.map(/*#__PURE__*/function () {
|
|
19912
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(item) {
|
|
19913
|
+
var entity;
|
|
19914
|
+
return _regenerator().w(function (_context) {
|
|
19915
|
+
while (1) switch (_context.n) {
|
|
19916
|
+
case 0:
|
|
19917
|
+
if (!(typeof item.Save === 'function')) {
|
|
19918
|
+
_context.n = 1;
|
|
19919
|
+
break;
|
|
19920
|
+
}
|
|
19921
|
+
return _context.a(2, item);
|
|
19922
|
+
case 1:
|
|
19923
|
+
_context.n = 2;
|
|
19924
|
+
return md.GetEntityObject(entityName, contextUser);
|
|
19925
|
+
case 2:
|
|
19926
|
+
entity = _context.v;
|
|
19927
|
+
_context.n = 3;
|
|
19928
|
+
return entity.LoadFromData(item);
|
|
19929
|
+
case 3:
|
|
19930
|
+
return _context.a(2, entity);
|
|
19931
|
+
case 4:
|
|
19932
|
+
return _context.a(2);
|
|
19933
|
+
}
|
|
19934
|
+
}, _callee);
|
|
19935
|
+
}));
|
|
19936
|
+
return function (_x5) {
|
|
19937
|
+
return _ref.apply(this, arguments);
|
|
19938
|
+
};
|
|
19939
|
+
}());
|
|
19940
|
+
_context2.n = 1;
|
|
19941
|
+
return Promise.all(entityPromises);
|
|
19942
|
+
case 1:
|
|
19943
|
+
return _context2.a(2, _context2.v);
|
|
19944
|
+
}
|
|
19945
|
+
}, _callee2);
|
|
19946
|
+
}));
|
|
19947
|
+
return _TransformSimpleObjectToEntityObject.apply(this, arguments);
|
|
19948
|
+
}
|
|
19854
19949
|
;// ../../MJCore/dist/generic/baseInfo.js
|
|
19855
19950
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
19856
19951
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -21094,10 +21189,10 @@ var CompositeKey = /*#__PURE__*/function (_FieldValueCollection2) {
|
|
|
21094
21189
|
;// ../../MJCore/dist/views/runView.js
|
|
21095
21190
|
var _RunView;
|
|
21096
21191
|
function runView_typeof(o) { "@babel/helpers - typeof"; return runView_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, runView_typeof(o); }
|
|
21097
|
-
function
|
|
21098
|
-
function
|
|
21099
|
-
function
|
|
21100
|
-
function
|
|
21192
|
+
function runView_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return runView_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (runView_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, runView_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, runView_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), runView_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", runView_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), runView_regeneratorDefine2(u), runView_regeneratorDefine2(u, o, "Generator"), runView_regeneratorDefine2(u, n, function () { return this; }), runView_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (runView_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
21193
|
+
function runView_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } runView_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { runView_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, runView_regeneratorDefine2(e, r, n, t); }
|
|
21194
|
+
function runView_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
21195
|
+
function runView_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { runView_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { runView_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
21101
21196
|
function runView_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21102
21197
|
function runView_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, runView_toPropertyKey(o.key), o); } }
|
|
21103
21198
|
function runView_createClass(e, r, t) { return r && runView_defineProperties(e.prototype, r), t && runView_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -21238,8 +21333,8 @@ var RunView = /*#__PURE__*/function () {
|
|
|
21238
21333
|
}, {
|
|
21239
21334
|
key: "RunView",
|
|
21240
21335
|
value: (function () {
|
|
21241
|
-
var _RunView2 =
|
|
21242
|
-
return
|
|
21336
|
+
var _RunView2 = runView_asyncToGenerator(/*#__PURE__*/runView_regenerator().m(function _callee(params, contextUser) {
|
|
21337
|
+
return runView_regenerator().w(function (_context) {
|
|
21243
21338
|
while (1) switch (_context.n) {
|
|
21244
21339
|
case 0:
|
|
21245
21340
|
return _context.a(2, this.ProviderToUse.RunView(params, contextUser));
|
|
@@ -21261,8 +21356,8 @@ var RunView = /*#__PURE__*/function () {
|
|
|
21261
21356
|
}, {
|
|
21262
21357
|
key: "RunViews",
|
|
21263
21358
|
value: (function () {
|
|
21264
|
-
var _RunViews =
|
|
21265
|
-
return
|
|
21359
|
+
var _RunViews = runView_asyncToGenerator(/*#__PURE__*/runView_regenerator().m(function _callee2(params, contextUser) {
|
|
21360
|
+
return runView_regenerator().w(function (_context2) {
|
|
21266
21361
|
while (1) switch (_context2.n) {
|
|
21267
21362
|
case 0:
|
|
21268
21363
|
return _context2.a(2, this.ProviderToUse.RunViews(params, contextUser));
|
|
@@ -21297,7 +21392,7 @@ var RunView = /*#__PURE__*/function () {
|
|
|
21297
21392
|
}, {
|
|
21298
21393
|
key: "GetEntityNameFromRunViewParams",
|
|
21299
21394
|
value: (function () {
|
|
21300
|
-
var _GetEntityNameFromRunViewParams =
|
|
21395
|
+
var _GetEntityNameFromRunViewParams = runView_asyncToGenerator(/*#__PURE__*/runView_regenerator().m(function _callee3(params) {
|
|
21301
21396
|
var provider,
|
|
21302
21397
|
p,
|
|
21303
21398
|
entityID,
|
|
@@ -21305,7 +21400,7 @@ var RunView = /*#__PURE__*/function () {
|
|
|
21305
21400
|
rv,
|
|
21306
21401
|
result,
|
|
21307
21402
|
_args3 = arguments;
|
|
21308
|
-
return
|
|
21403
|
+
return runView_regenerator().w(function (_context3) {
|
|
21309
21404
|
while (1) switch (_context3.n) {
|
|
21310
21405
|
case 0:
|
|
21311
21406
|
provider = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
|
|
@@ -22273,6 +22368,67 @@ var Metadata = /*#__PURE__*/function () {
|
|
|
22273
22368
|
get: function get() {
|
|
22274
22369
|
return Metadata.Provider.ConfigData;
|
|
22275
22370
|
}
|
|
22371
|
+
/**
|
|
22372
|
+
* Performs a full-text search across all entities with FullTextSearchEnabled=true.
|
|
22373
|
+
* Uses the database-native full-text search capabilities through the provider stack.
|
|
22374
|
+
*
|
|
22375
|
+
* @param params Search parameters — SearchText is required, EntityNames and MaxRowsPerEntity are optional
|
|
22376
|
+
* @param contextUser Optional user context for permissions
|
|
22377
|
+
* @returns Search results with title, snippet, and relevance score per match
|
|
22378
|
+
*
|
|
22379
|
+
* @example
|
|
22380
|
+
* ```typescript
|
|
22381
|
+
* const md = new Metadata();
|
|
22382
|
+
* const results = await md.FullTextSearch({
|
|
22383
|
+
* SearchText: 'claude',
|
|
22384
|
+
* MaxRowsPerEntity: 5
|
|
22385
|
+
* });
|
|
22386
|
+
* // results.Results contains matches across all FTS-enabled entities
|
|
22387
|
+
* ```
|
|
22388
|
+
*
|
|
22389
|
+
* @example
|
|
22390
|
+
* ```typescript
|
|
22391
|
+
* // Search only specific entities
|
|
22392
|
+
* const results = await md.FullTextSearch({
|
|
22393
|
+
* SearchText: 'quarterly report',
|
|
22394
|
+
* EntityNames: ['MJ: AI Models', 'MJ: AI Prompts'],
|
|
22395
|
+
* MaxRowsPerEntity: 10
|
|
22396
|
+
* }, contextUser);
|
|
22397
|
+
* ```
|
|
22398
|
+
*
|
|
22399
|
+
* @see /packages/MJCore/docs/FULL_TEXT_SEARCH_GUIDE.md
|
|
22400
|
+
*/
|
|
22401
|
+
}, {
|
|
22402
|
+
key: "FullTextSearch",
|
|
22403
|
+
value: (function () {
|
|
22404
|
+
var _FullTextSearch = metadata_asyncToGenerator(/*#__PURE__*/metadata_regenerator().m(function _callee21(params, contextUser) {
|
|
22405
|
+
var provider;
|
|
22406
|
+
return metadata_regenerator().w(function (_context21) {
|
|
22407
|
+
while (1) switch (_context21.n) {
|
|
22408
|
+
case 0:
|
|
22409
|
+
provider = Metadata.Provider;
|
|
22410
|
+
if (provider.FullTextSearch) {
|
|
22411
|
+
_context21.n = 1;
|
|
22412
|
+
break;
|
|
22413
|
+
}
|
|
22414
|
+
return _context21.a(2, {
|
|
22415
|
+
Success: false,
|
|
22416
|
+
ErrorMessage: 'Provider does not support FullTextSearch',
|
|
22417
|
+
Results: [],
|
|
22418
|
+
TotalCount: 0,
|
|
22419
|
+
EntitiesSearched: 0,
|
|
22420
|
+
ElapsedMs: 0
|
|
22421
|
+
});
|
|
22422
|
+
case 1:
|
|
22423
|
+
return _context21.a(2, provider.FullTextSearch(params, contextUser));
|
|
22424
|
+
}
|
|
22425
|
+
}, _callee21);
|
|
22426
|
+
}));
|
|
22427
|
+
function FullTextSearch(_x49, _x50) {
|
|
22428
|
+
return _FullTextSearch.apply(this, arguments);
|
|
22429
|
+
}
|
|
22430
|
+
return FullTextSearch;
|
|
22431
|
+
}())
|
|
22276
22432
|
}], [{
|
|
22277
22433
|
key: "Provider",
|
|
22278
22434
|
get:
|
|
@@ -24694,8 +24850,7 @@ var PotentialDuplicate = /*#__PURE__*/(/* unused pure expression or super */ nul
|
|
|
24694
24850
|
}(interfaces_CompositeKey)));
|
|
24695
24851
|
/**
|
|
24696
24852
|
* Request parameters for finding potential duplicate records.
|
|
24697
|
-
* Supports
|
|
24698
|
-
* Can use either a pre-defined list or entity document for duplicate detection.
|
|
24853
|
+
* Supports list-based batch detection and single-record checks.
|
|
24699
24854
|
*/
|
|
24700
24855
|
var PotentialDuplicateRequest = /*#__PURE__*/(/* unused pure expression or super */ null && (interfaces_createClass(function PotentialDuplicateRequest() {
|
|
24701
24856
|
interfaces_classCallCheck(this, PotentialDuplicateRequest);
|
|
@@ -31031,6 +31186,10 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
31031
31186
|
events: 0,
|
|
31032
31187
|
totalMs: 0
|
|
31033
31188
|
},
|
|
31189
|
+
Coalesce: {
|
|
31190
|
+
events: 0,
|
|
31191
|
+
totalMs: 0
|
|
31192
|
+
},
|
|
31034
31193
|
Custom: {
|
|
31035
31194
|
events: 0,
|
|
31036
31195
|
totalMs: 0
|
|
@@ -33383,7 +33542,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33383
33542
|
}, {
|
|
33384
33543
|
key: "SetRunViewResult",
|
|
33385
33544
|
value: (function () {
|
|
33386
|
-
var _SetRunViewResult = localCacheManager_asyncToGenerator(/*#__PURE__*/localCacheManager_regenerator().m(function _callee1(fingerprint, params, results, maxUpdatedAt, aggregateResults) {
|
|
33545
|
+
var _SetRunViewResult = localCacheManager_asyncToGenerator(/*#__PURE__*/localCacheManager_regenerator().m(function _callee1(fingerprint, params, results, maxUpdatedAt, aggregateResults, totalRowCount) {
|
|
33387
33546
|
var data, value, sizeBytes, _params$Aggregates$le, _params$Aggregates, _t16;
|
|
33388
33547
|
return localCacheManager_regenerator().w(function (_context1) {
|
|
33389
33548
|
while (1) switch (_context1.p = _context1.n) {
|
|
@@ -33394,7 +33553,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33394
33553
|
}
|
|
33395
33554
|
return _context1.a(2);
|
|
33396
33555
|
case 1:
|
|
33397
|
-
// Persist results, maxUpdatedAt,
|
|
33556
|
+
// Persist results, maxUpdatedAt, aggregateResults, and totalRowCount
|
|
33398
33557
|
data = {
|
|
33399
33558
|
results: results,
|
|
33400
33559
|
maxUpdatedAt: maxUpdatedAt
|
|
@@ -33402,6 +33561,9 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33402
33561
|
if (aggregateResults && aggregateResults.length > 0) {
|
|
33403
33562
|
data.aggregateResults = aggregateResults;
|
|
33404
33563
|
}
|
|
33564
|
+
if (totalRowCount !== undefined) {
|
|
33565
|
+
data.totalRowCount = totalRowCount;
|
|
33566
|
+
}
|
|
33405
33567
|
value = JSON.stringify(data);
|
|
33406
33568
|
sizeBytes = this.estimateSize(value); // Check if we need to evict entries
|
|
33407
33569
|
_context1.n = 2;
|
|
@@ -33445,7 +33607,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33445
33607
|
}
|
|
33446
33608
|
}, _callee1, this, [[2, 4]]);
|
|
33447
33609
|
}));
|
|
33448
|
-
function SetRunViewResult(_x25, _x26, _x27, _x28, _x29) {
|
|
33610
|
+
function SetRunViewResult(_x25, _x26, _x27, _x28, _x29, _x30) {
|
|
33449
33611
|
return _SetRunViewResult.apply(this, arguments);
|
|
33450
33612
|
}
|
|
33451
33613
|
return SetRunViewResult;
|
|
@@ -33485,11 +33647,12 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33485
33647
|
this.recordAccess(fingerprint);
|
|
33486
33648
|
this._stats.hits++;
|
|
33487
33649
|
parsed = JSON.parse(value);
|
|
33488
|
-
results = parsed.results || [];
|
|
33650
|
+
results = parsed.results || [];
|
|
33489
33651
|
result = {
|
|
33490
33652
|
results: results,
|
|
33491
33653
|
maxUpdatedAt: parsed.maxUpdatedAt,
|
|
33492
|
-
rowCount: results.length
|
|
33654
|
+
rowCount: results.length,
|
|
33655
|
+
totalRowCount: parsed.totalRowCount
|
|
33493
33656
|
}; // Include aggregate results if they were cached
|
|
33494
33657
|
if (parsed.aggregateResults) {
|
|
33495
33658
|
result.aggregateResults = parsed.aggregateResults;
|
|
@@ -33508,7 +33671,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33508
33671
|
}
|
|
33509
33672
|
}, _callee10, this, [[1, 4]]);
|
|
33510
33673
|
}));
|
|
33511
|
-
function GetRunViewResult(
|
|
33674
|
+
function GetRunViewResult(_x31) {
|
|
33512
33675
|
return _GetRunViewResult.apply(this, arguments);
|
|
33513
33676
|
}
|
|
33514
33677
|
return GetRunViewResult;
|
|
@@ -33555,7 +33718,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33555
33718
|
}
|
|
33556
33719
|
}, _callee11, this, [[2, 4]]);
|
|
33557
33720
|
}));
|
|
33558
|
-
function InvalidateRunViewResult(
|
|
33721
|
+
function InvalidateRunViewResult(_x32) {
|
|
33559
33722
|
return _InvalidateRunViewResult.apply(this, arguments);
|
|
33560
33723
|
}
|
|
33561
33724
|
return InvalidateRunViewResult;
|
|
@@ -33586,7 +33749,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33586
33749
|
key: "ApplyDifferentialUpdate",
|
|
33587
33750
|
value: (function () {
|
|
33588
33751
|
var _ApplyDifferentialUpdate = localCacheManager_asyncToGenerator(/*#__PURE__*/localCacheManager_regenerator().m(function _callee12(fingerprint, params, updatedRows, deletedRecordIDs, primaryKeyFieldName, newMaxUpdatedAt, _serverRowCount, aggregateResults) {
|
|
33589
|
-
var cached, pkFieldNames, resultMap, _iterator1, _step1, row, rowObj, rowKey, _iterator10, _step10, deletedID, _iterator11, _step11, _row, _rowObj, _rowKey, mergedResults, result, _t19;
|
|
33752
|
+
var cached, pkFieldNames, resultMap, _iterator1, _step1, row, rowObj, rowKey, _iterator10, _step10, deletedID, _iterator11, _step11, _row, _rowObj, _rowKey, mergedResults, mergedTotalRowCount, result, _t19;
|
|
33590
33753
|
return localCacheManager_regenerator().w(function (_context12) {
|
|
33591
33754
|
while (1) switch (_context12.p = _context12.n) {
|
|
33592
33755
|
case 0:
|
|
@@ -33652,16 +33815,19 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33652
33815
|
} finally {
|
|
33653
33816
|
_iterator11.f();
|
|
33654
33817
|
}
|
|
33655
|
-
mergedResults = Array.from(resultMap.values()); //
|
|
33818
|
+
mergedResults = Array.from(resultMap.values()); // For differential updates, the merged result count IS the new total
|
|
33819
|
+
// (differential applies to full-dataset caches, not paginated ones)
|
|
33820
|
+
mergedTotalRowCount = mergedResults.length; // Store the updated cache with optional aggregate results
|
|
33656
33821
|
// Note: If aggregateResults not provided, cached aggregates are cleared (they'd be stale)
|
|
33657
33822
|
_context12.n = 4;
|
|
33658
|
-
return this.SetRunViewResult(fingerprint, params, mergedResults, newMaxUpdatedAt, aggregateResults);
|
|
33823
|
+
return this.SetRunViewResult(fingerprint, params, mergedResults, newMaxUpdatedAt, aggregateResults, mergedTotalRowCount);
|
|
33659
33824
|
case 4:
|
|
33660
33825
|
// Return with rowCount derived from merged results and aggregates if provided
|
|
33661
33826
|
result = {
|
|
33662
33827
|
results: mergedResults,
|
|
33663
33828
|
maxUpdatedAt: newMaxUpdatedAt,
|
|
33664
|
-
rowCount: mergedResults.length
|
|
33829
|
+
rowCount: mergedResults.length,
|
|
33830
|
+
totalRowCount: mergedTotalRowCount
|
|
33665
33831
|
};
|
|
33666
33832
|
if (aggregateResults) {
|
|
33667
33833
|
result.aggregateResults = aggregateResults;
|
|
@@ -33675,7 +33841,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33675
33841
|
}
|
|
33676
33842
|
}, _callee12, this, [[1, 5]]);
|
|
33677
33843
|
}));
|
|
33678
|
-
function ApplyDifferentialUpdate(
|
|
33844
|
+
function ApplyDifferentialUpdate(_x33, _x34, _x35, _x36, _x37, _x38, _x39, _x40) {
|
|
33679
33845
|
return _ApplyDifferentialUpdate.apply(this, arguments);
|
|
33680
33846
|
}
|
|
33681
33847
|
return ApplyDifferentialUpdate;
|
|
@@ -33752,7 +33918,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33752
33918
|
}
|
|
33753
33919
|
}, _callee13, this, [[1, 5]]);
|
|
33754
33920
|
}));
|
|
33755
|
-
function UpsertSingleEntity(
|
|
33921
|
+
function UpsertSingleEntity(_x41, _x42, _x43, _x44) {
|
|
33756
33922
|
return _UpsertSingleEntity.apply(this, arguments);
|
|
33757
33923
|
}
|
|
33758
33924
|
return UpsertSingleEntity;
|
|
@@ -33830,7 +33996,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33830
33996
|
}
|
|
33831
33997
|
}, _callee14, this, [[1, 6]]);
|
|
33832
33998
|
}));
|
|
33833
|
-
function RemoveSingleEntity(
|
|
33999
|
+
function RemoveSingleEntity(_x45, _x46, _x47) {
|
|
33834
34000
|
return _RemoveSingleEntity.apply(this, arguments);
|
|
33835
34001
|
}
|
|
33836
34002
|
return RemoveSingleEntity;
|
|
@@ -33869,7 +34035,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33869
34035
|
}
|
|
33870
34036
|
}, _callee15, this);
|
|
33871
34037
|
}));
|
|
33872
|
-
function storeCachedResults(
|
|
34038
|
+
function storeCachedResults(_x48, _x49, _x50) {
|
|
33873
34039
|
return _storeCachedResults.apply(this, arguments);
|
|
33874
34040
|
}
|
|
33875
34041
|
return storeCachedResults;
|
|
@@ -33948,7 +34114,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
33948
34114
|
}
|
|
33949
34115
|
}, _callee16, this, [[3, 5]]);
|
|
33950
34116
|
}));
|
|
33951
|
-
function InvalidateEntityCaches(
|
|
34117
|
+
function InvalidateEntityCaches(_x51) {
|
|
33952
34118
|
return _InvalidateEntityCaches.apply(this, arguments);
|
|
33953
34119
|
}
|
|
33954
34120
|
return InvalidateEntityCaches;
|
|
@@ -34050,7 +34216,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34050
34216
|
}
|
|
34051
34217
|
}, _callee17, this, [[3, 5]]);
|
|
34052
34218
|
}));
|
|
34053
|
-
function SetRunQueryResult(
|
|
34219
|
+
function SetRunQueryResult(_x52, _x53, _x54, _x55, _x56, _x57, _x58) {
|
|
34054
34220
|
return _SetRunQueryResult.apply(this, arguments);
|
|
34055
34221
|
}
|
|
34056
34222
|
return SetRunQueryResult;
|
|
@@ -34119,7 +34285,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34119
34285
|
}
|
|
34120
34286
|
}, _callee18, this, [[3, 6]]);
|
|
34121
34287
|
}));
|
|
34122
|
-
function GetRunQueryResult(
|
|
34288
|
+
function GetRunQueryResult(_x59) {
|
|
34123
34289
|
return _GetRunQueryResult.apply(this, arguments);
|
|
34124
34290
|
}
|
|
34125
34291
|
return GetRunQueryResult;
|
|
@@ -34160,7 +34326,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34160
34326
|
}
|
|
34161
34327
|
}, _callee19, this, [[1, 3]]);
|
|
34162
34328
|
}));
|
|
34163
|
-
function InvalidateRunQueryResult(
|
|
34329
|
+
function InvalidateRunQueryResult(_x60) {
|
|
34164
34330
|
return _InvalidateRunQueryResult.apply(this, arguments);
|
|
34165
34331
|
}
|
|
34166
34332
|
return InvalidateRunQueryResult;
|
|
@@ -34231,7 +34397,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34231
34397
|
}
|
|
34232
34398
|
}, _callee20, this, [[3, 5]]);
|
|
34233
34399
|
}));
|
|
34234
|
-
function InvalidateQueryCaches(
|
|
34400
|
+
function InvalidateQueryCaches(_x61) {
|
|
34235
34401
|
return _InvalidateQueryCaches.apply(this, arguments);
|
|
34236
34402
|
}
|
|
34237
34403
|
return InvalidateQueryCaches;
|
|
@@ -34269,7 +34435,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34269
34435
|
}
|
|
34270
34436
|
}, _callee21, this);
|
|
34271
34437
|
}));
|
|
34272
|
-
function GetRunQueryCacheStatus(
|
|
34438
|
+
function GetRunQueryCacheStatus(_x62) {
|
|
34273
34439
|
return _GetRunQueryCacheStatus.apply(this, arguments);
|
|
34274
34440
|
}
|
|
34275
34441
|
return GetRunQueryCacheStatus;
|
|
@@ -34429,7 +34595,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34429
34595
|
}
|
|
34430
34596
|
}, _callee22, this, [[4, 7], [2, 10, 11, 12]]);
|
|
34431
34597
|
}));
|
|
34432
|
-
function ClearByType(
|
|
34598
|
+
function ClearByType(_x63) {
|
|
34433
34599
|
return _ClearByType.apply(this, arguments);
|
|
34434
34600
|
}
|
|
34435
34601
|
return ClearByType;
|
|
@@ -34745,7 +34911,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34745
34911
|
}
|
|
34746
34912
|
}, _callee26, this);
|
|
34747
34913
|
}));
|
|
34748
|
-
function evictIfNeeded(
|
|
34914
|
+
function evictIfNeeded(_x64) {
|
|
34749
34915
|
return _evictIfNeeded.apply(this, arguments);
|
|
34750
34916
|
}
|
|
34751
34917
|
return evictIfNeeded;
|
|
@@ -34874,7 +35040,7 @@ var LocalCacheManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
34874
35040
|
}
|
|
34875
35041
|
}, _callee27, this, [[15, 18], [6, 11, 12, 13]]);
|
|
34876
35042
|
}));
|
|
34877
|
-
function evict(
|
|
35043
|
+
function evict(_x65, _x66) {
|
|
34878
35044
|
return _evict.apply(this, arguments);
|
|
34879
35045
|
}
|
|
34880
35046
|
return evict;
|
|
@@ -36451,6 +36617,7 @@ function providerBase_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a
|
|
|
36451
36617
|
|
|
36452
36618
|
|
|
36453
36619
|
|
|
36620
|
+
|
|
36454
36621
|
/**
|
|
36455
36622
|
* Creates a new instance of AllMetadata from a simple object.
|
|
36456
36623
|
* Handles deserialization and proper instantiation of all metadata classes.
|
|
@@ -37152,7 +37319,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37152
37319
|
key: "flushCoalesceQueue",
|
|
37153
37320
|
value: (function () {
|
|
37154
37321
|
var _flushCoalesceQueue = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee7() {
|
|
37155
|
-
var queue, entry, results, allParams, boundaries, contextUser, _iterator3, _step3, _entry2, entityNames, allResults, i, _boundaries$i, start, count, callerResults, _iterator4, _step4, _entry, _t, _t2;
|
|
37322
|
+
var queue, entry, results, allParams, boundaries, contextUser, _iterator3, _step3, _entry2, entityNames, eventId, allResults, i, _boundaries$i, start, count, callerResults, _iterator4, _step4, _entry, _t, _t2;
|
|
37156
37323
|
return providerBase_regenerator().w(function (_context7) {
|
|
37157
37324
|
while (1) switch (_context7.p = _context7.n) {
|
|
37158
37325
|
case 0:
|
|
@@ -37206,10 +37373,12 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37206
37373
|
}
|
|
37207
37374
|
entityNames = allParams.map(function (p) {
|
|
37208
37375
|
return p.EntityName || p.ViewName || '?';
|
|
37209
|
-
})
|
|
37210
|
-
|
|
37211
|
-
|
|
37212
|
-
|
|
37376
|
+
});
|
|
37377
|
+
eventId = TelemetryManager.Instance.StartEvent('Coalesce', 'ProviderBase.flushCoalesceQueue', {
|
|
37378
|
+
CallerCount: queue.length,
|
|
37379
|
+
TotalEntityCount: allParams.length,
|
|
37380
|
+
Entities: entityNames,
|
|
37381
|
+
CallerBoundaries: [].concat(boundaries)
|
|
37213
37382
|
});
|
|
37214
37383
|
_context7.p = 7;
|
|
37215
37384
|
_context7.n = 8;
|
|
@@ -37222,11 +37391,16 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37222
37391
|
callerResults = allResults.slice(start, start + count);
|
|
37223
37392
|
queue[i].resolve(callerResults);
|
|
37224
37393
|
}
|
|
37394
|
+
TelemetryManager.Instance.EndEvent(eventId);
|
|
37225
37395
|
_context7.n = 10;
|
|
37226
37396
|
break;
|
|
37227
37397
|
case 9:
|
|
37228
37398
|
_context7.p = 9;
|
|
37229
37399
|
_t2 = _context7.v;
|
|
37400
|
+
TelemetryManager.Instance.EndEvent(eventId, {
|
|
37401
|
+
success: false,
|
|
37402
|
+
error: String(_t2)
|
|
37403
|
+
});
|
|
37230
37404
|
// If the mega-batch fails, reject all callers
|
|
37231
37405
|
_iterator4 = providerBase_createForOfIteratorHelper(queue);
|
|
37232
37406
|
try {
|
|
@@ -37253,42 +37427,213 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37253
37427
|
* Runs RunViews without coalescing (used internally after coalescing merge).
|
|
37254
37428
|
* This goes through dedup + linger + the full pipeline.
|
|
37255
37429
|
*/
|
|
37430
|
+
/**
|
|
37431
|
+
* Performs a full-text search across all entities that have FullTextSearchEnabled=true.
|
|
37432
|
+
* Uses the existing RunView + UserSearchString infrastructure which routes through
|
|
37433
|
+
* the database-native FTS capabilities (SQL Server FREETEXT functions, PostgreSQL tsvector).
|
|
37434
|
+
*
|
|
37435
|
+
* This is the default implementation that works across all database providers. Each provider's
|
|
37436
|
+
* createViewUserSearchSQL() method handles the platform-specific SQL generation.
|
|
37437
|
+
*
|
|
37438
|
+
* @see /packages/MJCore/docs/FULL_TEXT_SEARCH_GUIDE.md for comprehensive documentation
|
|
37439
|
+
*/
|
|
37256
37440
|
)
|
|
37257
37441
|
}, {
|
|
37258
|
-
key: "
|
|
37442
|
+
key: "FullTextSearch",
|
|
37259
37443
|
value: (function () {
|
|
37260
|
-
var
|
|
37444
|
+
var _FullTextSearch = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee8(params, contextUser) {
|
|
37445
|
+
var startTime, _params$MaxRowsPerEnt, md, maxRows, ftsEntities, viewParams, viewResults, allResults, i, result, entity, titleField, snippetField, j, _record, _entity$FirstPrimaryK, _entity$FirstPrimaryK2, _record$titleField, _record$snippetField, record, msg, _t3;
|
|
37446
|
+
return providerBase_regenerator().w(function (_context8) {
|
|
37447
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
37448
|
+
case 0:
|
|
37449
|
+
startTime = Date.now();
|
|
37450
|
+
_context8.p = 1;
|
|
37451
|
+
md = new Metadata();
|
|
37452
|
+
maxRows = (_params$MaxRowsPerEnt = params.MaxRowsPerEntity) !== null && _params$MaxRowsPerEnt !== void 0 ? _params$MaxRowsPerEnt : 10; // Get all FTS-enabled entities
|
|
37453
|
+
ftsEntities = this.resolveFTSEntities(md, params.EntityNames);
|
|
37454
|
+
if (!(ftsEntities.length === 0)) {
|
|
37455
|
+
_context8.n = 2;
|
|
37456
|
+
break;
|
|
37457
|
+
}
|
|
37458
|
+
return _context8.a(2, {
|
|
37459
|
+
Success: true,
|
|
37460
|
+
Results: [],
|
|
37461
|
+
TotalCount: 0,
|
|
37462
|
+
EntitiesSearched: 0,
|
|
37463
|
+
ElapsedMs: Date.now() - startTime
|
|
37464
|
+
});
|
|
37465
|
+
case 2:
|
|
37466
|
+
// Build RunView params for each FTS entity
|
|
37467
|
+
viewParams = ftsEntities.map(function (entity) {
|
|
37468
|
+
return {
|
|
37469
|
+
EntityName: entity.Name,
|
|
37470
|
+
UserSearchString: params.SearchText,
|
|
37471
|
+
MaxRows: maxRows,
|
|
37472
|
+
ResultType: 'simple'
|
|
37473
|
+
};
|
|
37474
|
+
}); // Execute all searches in parallel via RunViews
|
|
37475
|
+
_context8.n = 3;
|
|
37476
|
+
return this.RunViews(viewParams, contextUser);
|
|
37477
|
+
case 3:
|
|
37478
|
+
viewResults = _context8.v;
|
|
37479
|
+
// Convert results to FullTextSearchResultItems
|
|
37480
|
+
allResults = [];
|
|
37481
|
+
i = 0;
|
|
37482
|
+
case 4:
|
|
37483
|
+
if (!(i < viewResults.length)) {
|
|
37484
|
+
_context8.n = 7;
|
|
37485
|
+
break;
|
|
37486
|
+
}
|
|
37487
|
+
result = viewResults[i];
|
|
37488
|
+
entity = ftsEntities[i];
|
|
37489
|
+
if (result.Success) {
|
|
37490
|
+
_context8.n = 5;
|
|
37491
|
+
break;
|
|
37492
|
+
}
|
|
37493
|
+
return _context8.a(3, 6);
|
|
37494
|
+
case 5:
|
|
37495
|
+
titleField = this.findBestField(entity, ['Name', 'Title', 'Subject', 'Label']);
|
|
37496
|
+
snippetField = this.findBestField(entity, ['Description', 'Summary', 'Body', 'Content', 'Text', 'Notes']);
|
|
37497
|
+
for (j = 0; j < result.Results.length; j++) {
|
|
37498
|
+
record = result.Results[j];
|
|
37499
|
+
allResults.push({
|
|
37500
|
+
EntityName: entity.Name,
|
|
37501
|
+
RecordID: String((_record = record[(_entity$FirstPrimaryK = (_entity$FirstPrimaryK2 = entity.FirstPrimaryKey) === null || _entity$FirstPrimaryK2 === void 0 ? void 0 : _entity$FirstPrimaryK2.Name) !== null && _entity$FirstPrimaryK !== void 0 ? _entity$FirstPrimaryK : 'ID']) !== null && _record !== void 0 ? _record : ''),
|
|
37502
|
+
Title: String((_record$titleField = record[titleField]) !== null && _record$titleField !== void 0 ? _record$titleField : 'Untitled'),
|
|
37503
|
+
Snippet: String((_record$snippetField = record[snippetField]) !== null && _record$snippetField !== void 0 ? _record$snippetField : '').substring(0, 200),
|
|
37504
|
+
Score: 1.0 / (j + 1) // Rank-based scoring for RRF compatibility
|
|
37505
|
+
});
|
|
37506
|
+
}
|
|
37507
|
+
case 6:
|
|
37508
|
+
i++;
|
|
37509
|
+
_context8.n = 4;
|
|
37510
|
+
break;
|
|
37511
|
+
case 7:
|
|
37512
|
+
// Sort by score descending
|
|
37513
|
+
allResults.sort(function (a, b) {
|
|
37514
|
+
return b.Score - a.Score;
|
|
37515
|
+
});
|
|
37516
|
+
return _context8.a(2, {
|
|
37517
|
+
Success: true,
|
|
37518
|
+
Results: allResults,
|
|
37519
|
+
TotalCount: allResults.length,
|
|
37520
|
+
EntitiesSearched: ftsEntities.length,
|
|
37521
|
+
ElapsedMs: Date.now() - startTime
|
|
37522
|
+
});
|
|
37523
|
+
case 8:
|
|
37524
|
+
_context8.p = 8;
|
|
37525
|
+
_t3 = _context8.v;
|
|
37526
|
+
msg = _t3 instanceof Error ? _t3.message : String(_t3);
|
|
37527
|
+
LogError("FullTextSearch failed: ".concat(msg));
|
|
37528
|
+
return _context8.a(2, {
|
|
37529
|
+
Success: false,
|
|
37530
|
+
ErrorMessage: msg,
|
|
37531
|
+
Results: [],
|
|
37532
|
+
TotalCount: 0,
|
|
37533
|
+
EntitiesSearched: 0,
|
|
37534
|
+
ElapsedMs: Date.now() - startTime
|
|
37535
|
+
});
|
|
37536
|
+
}
|
|
37537
|
+
}, _callee8, this, [[1, 8]]);
|
|
37538
|
+
}));
|
|
37539
|
+
function FullTextSearch(_x13, _x14) {
|
|
37540
|
+
return _FullTextSearch.apply(this, arguments);
|
|
37541
|
+
}
|
|
37542
|
+
return FullTextSearch;
|
|
37543
|
+
}()
|
|
37544
|
+
/**
|
|
37545
|
+
* Resolve which entities to search. Filters to only FTS-enabled entities.
|
|
37546
|
+
* If entityNames provided, intersects with the FTS-enabled set.
|
|
37547
|
+
*/
|
|
37548
|
+
)
|
|
37549
|
+
}, {
|
|
37550
|
+
key: "resolveFTSEntities",
|
|
37551
|
+
value: function resolveFTSEntities(md, entityNames) {
|
|
37552
|
+
var allEntities = md.Entities.filter(function (e) {
|
|
37553
|
+
return e.FullTextSearchEnabled;
|
|
37554
|
+
});
|
|
37555
|
+
if (!entityNames || entityNames.length === 0) {
|
|
37556
|
+
return allEntities;
|
|
37557
|
+
}
|
|
37558
|
+
// Intersect requested names with FTS-enabled entities only
|
|
37559
|
+
var nameSet = new Set(entityNames.map(function (n) {
|
|
37560
|
+
return n.toLowerCase();
|
|
37561
|
+
}));
|
|
37562
|
+
return allEntities.filter(function (e) {
|
|
37563
|
+
return nameSet.has(e.Name.toLowerCase());
|
|
37564
|
+
});
|
|
37565
|
+
}
|
|
37566
|
+
/**
|
|
37567
|
+
* Find the best display field from an entity by checking preferred field names.
|
|
37568
|
+
* Returns the first match or falls back to the first text field.
|
|
37569
|
+
*/
|
|
37570
|
+
}, {
|
|
37571
|
+
key: "findBestField",
|
|
37572
|
+
value: function findBestField(entity, preferredNames) {
|
|
37573
|
+
var _ref, _textField$Name, _entity$FirstPrimaryK3;
|
|
37574
|
+
var _iterator5 = providerBase_createForOfIteratorHelper(preferredNames),
|
|
37575
|
+
_step5;
|
|
37576
|
+
try {
|
|
37577
|
+
var _loop2 = function _loop2() {
|
|
37578
|
+
var name = _step5.value;
|
|
37579
|
+
var field = entity.Fields.find(function (f) {
|
|
37580
|
+
return f.Name === name;
|
|
37581
|
+
});
|
|
37582
|
+
if (field) return {
|
|
37583
|
+
v: field.Name
|
|
37584
|
+
};
|
|
37585
|
+
},
|
|
37586
|
+
_ret;
|
|
37587
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
37588
|
+
_ret = _loop2();
|
|
37589
|
+
if (_ret) return _ret.v;
|
|
37590
|
+
}
|
|
37591
|
+
// Fallback to first text field
|
|
37592
|
+
} catch (err) {
|
|
37593
|
+
_iterator5.e(err);
|
|
37594
|
+
} finally {
|
|
37595
|
+
_iterator5.f();
|
|
37596
|
+
}
|
|
37597
|
+
var textField = entity.Fields.find(function (f) {
|
|
37598
|
+
return f.Type.toLowerCase().includes('varchar') || f.Type.toLowerCase().includes('text');
|
|
37599
|
+
});
|
|
37600
|
+
return (_ref = (_textField$Name = textField === null || textField === void 0 ? void 0 : textField.Name) !== null && _textField$Name !== void 0 ? _textField$Name : (_entity$FirstPrimaryK3 = entity.FirstPrimaryKey) === null || _entity$FirstPrimaryK3 === void 0 ? void 0 : _entity$FirstPrimaryK3.Name) !== null && _ref !== void 0 ? _ref : 'ID';
|
|
37601
|
+
}
|
|
37602
|
+
}, {
|
|
37603
|
+
key: "RunViewsUncoalesced",
|
|
37604
|
+
value: function () {
|
|
37605
|
+
var _RunViewsUncoalesced = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee9(params, contextUser) {
|
|
37261
37606
|
var _this3 = this;
|
|
37262
37607
|
var key, existing, age, _results3, promise, results;
|
|
37263
|
-
return providerBase_regenerator().w(function (
|
|
37264
|
-
while (1) switch (
|
|
37608
|
+
return providerBase_regenerator().w(function (_context9) {
|
|
37609
|
+
while (1) switch (_context9.n) {
|
|
37265
37610
|
case 0:
|
|
37266
37611
|
key = this.GenerateDedupKey(params, contextUser);
|
|
37267
37612
|
existing = this._inflightViews.get(key); // ── Linger hit ──
|
|
37268
37613
|
if (!(existing !== null && existing !== void 0 && existing.resolvedResults && existing.resolvedAt)) {
|
|
37269
|
-
|
|
37614
|
+
_context9.n = 2;
|
|
37270
37615
|
break;
|
|
37271
37616
|
}
|
|
37272
37617
|
age = Date.now() - existing.resolvedAt;
|
|
37273
37618
|
if (!(age < ProviderBase.DedupLingerMs)) {
|
|
37274
|
-
|
|
37619
|
+
_context9.n = 1;
|
|
37275
37620
|
break;
|
|
37276
37621
|
}
|
|
37277
|
-
return
|
|
37622
|
+
return _context9.a(2, existing.resolvedResults.map(function (r) {
|
|
37278
37623
|
return _this3.ShallowCopyResult(r);
|
|
37279
37624
|
}));
|
|
37280
37625
|
case 1:
|
|
37281
37626
|
this._inflightViews.delete(key);
|
|
37282
37627
|
case 2:
|
|
37283
37628
|
if (!(existing && !existing.resolvedResults)) {
|
|
37284
|
-
|
|
37629
|
+
_context9.n = 4;
|
|
37285
37630
|
break;
|
|
37286
37631
|
}
|
|
37287
|
-
|
|
37632
|
+
_context9.n = 3;
|
|
37288
37633
|
return existing.promise;
|
|
37289
37634
|
case 3:
|
|
37290
|
-
_results3 =
|
|
37291
|
-
return
|
|
37635
|
+
_results3 = _context9.v;
|
|
37636
|
+
return _context9.a(2, _results3.map(function (r) {
|
|
37292
37637
|
return _this3.ShallowCopyResult(r);
|
|
37293
37638
|
}));
|
|
37294
37639
|
case 4:
|
|
@@ -37317,17 +37662,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37317
37662
|
this._inflightViews.set(key, {
|
|
37318
37663
|
promise: promise
|
|
37319
37664
|
});
|
|
37320
|
-
|
|
37665
|
+
_context9.n = 5;
|
|
37321
37666
|
return promise;
|
|
37322
37667
|
case 5:
|
|
37323
|
-
results =
|
|
37324
|
-
return
|
|
37668
|
+
results = _context9.v;
|
|
37669
|
+
return _context9.a(2, results.map(function (r) {
|
|
37325
37670
|
return _this3.ShallowCopyResult(r);
|
|
37326
37671
|
}));
|
|
37327
37672
|
}
|
|
37328
|
-
},
|
|
37673
|
+
}, _callee9, this);
|
|
37329
37674
|
}));
|
|
37330
|
-
function RunViewsUncoalesced(
|
|
37675
|
+
function RunViewsUncoalesced(_x15, _x16) {
|
|
37331
37676
|
return _RunViewsUncoalesced.apply(this, arguments);
|
|
37332
37677
|
}
|
|
37333
37678
|
return RunViewsUncoalesced;
|
|
@@ -37338,7 +37683,6 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37338
37683
|
* affect result identity (Fields, UserSearchString, ViewID, ViewName,
|
|
37339
37684
|
* contextUser).
|
|
37340
37685
|
*/
|
|
37341
|
-
)
|
|
37342
37686
|
}, {
|
|
37343
37687
|
key: "GenerateDedupKey",
|
|
37344
37688
|
value: function GenerateDedupKey(params, contextUser) {
|
|
@@ -37386,17 +37730,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37386
37730
|
}, {
|
|
37387
37731
|
key: "RunQuery",
|
|
37388
37732
|
value: (function () {
|
|
37389
|
-
var _RunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37733
|
+
var _RunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee0(params, contextUser) {
|
|
37390
37734
|
var preResult, _preResult$cachedResu5, _preResult$cachedResu6, result;
|
|
37391
|
-
return providerBase_regenerator().w(function (
|
|
37392
|
-
while (1) switch (
|
|
37735
|
+
return providerBase_regenerator().w(function (_context0) {
|
|
37736
|
+
while (1) switch (_context0.n) {
|
|
37393
37737
|
case 0:
|
|
37394
|
-
|
|
37738
|
+
_context0.n = 1;
|
|
37395
37739
|
return this.PreRunQuery(params, contextUser);
|
|
37396
37740
|
case 1:
|
|
37397
|
-
preResult =
|
|
37741
|
+
preResult = _context0.v;
|
|
37398
37742
|
if (!preResult.cachedResult) {
|
|
37399
|
-
|
|
37743
|
+
_context0.n = 2;
|
|
37400
37744
|
break;
|
|
37401
37745
|
}
|
|
37402
37746
|
TelemetryManager.Instance.EndEvent(preResult.telemetryEventId, {
|
|
@@ -37404,20 +37748,20 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37404
37748
|
cacheStatus: preResult.cacheStatus,
|
|
37405
37749
|
resultCount: (_preResult$cachedResu5 = (_preResult$cachedResu6 = preResult.cachedResult.Results) === null || _preResult$cachedResu6 === void 0 ? void 0 : _preResult$cachedResu6.length) !== null && _preResult$cachedResu5 !== void 0 ? _preResult$cachedResu5 : 0
|
|
37406
37750
|
});
|
|
37407
|
-
return
|
|
37751
|
+
return _context0.a(2, preResult.cachedResult);
|
|
37408
37752
|
case 2:
|
|
37409
|
-
|
|
37753
|
+
_context0.n = 3;
|
|
37410
37754
|
return this.InternalRunQuery(params, contextUser);
|
|
37411
37755
|
case 3:
|
|
37412
|
-
result =
|
|
37413
|
-
|
|
37756
|
+
result = _context0.v;
|
|
37757
|
+
_context0.n = 4;
|
|
37414
37758
|
return this.PostRunQuery(result, params, preResult, contextUser);
|
|
37415
37759
|
case 4:
|
|
37416
|
-
return
|
|
37760
|
+
return _context0.a(2, result);
|
|
37417
37761
|
}
|
|
37418
|
-
},
|
|
37762
|
+
}, _callee0, this);
|
|
37419
37763
|
}));
|
|
37420
|
-
function RunQuery(
|
|
37764
|
+
function RunQuery(_x17, _x18) {
|
|
37421
37765
|
return _RunQuery.apply(this, arguments);
|
|
37422
37766
|
}
|
|
37423
37767
|
return RunQuery;
|
|
@@ -37434,15 +37778,15 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37434
37778
|
}, {
|
|
37435
37779
|
key: "ExecuteQueryFromSpec",
|
|
37436
37780
|
value: (function () {
|
|
37437
|
-
var _ExecuteQueryFromSpec = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37438
|
-
return providerBase_regenerator().w(function (
|
|
37439
|
-
while (1) switch (
|
|
37781
|
+
var _ExecuteQueryFromSpec = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee1(spec, contextUser) {
|
|
37782
|
+
return providerBase_regenerator().w(function (_context1) {
|
|
37783
|
+
while (1) switch (_context1.n) {
|
|
37440
37784
|
case 0:
|
|
37441
|
-
return
|
|
37785
|
+
return _context1.a(2, this.InternalExecuteQueryFromSpec(spec, contextUser));
|
|
37442
37786
|
}
|
|
37443
|
-
},
|
|
37787
|
+
}, _callee1, this);
|
|
37444
37788
|
}));
|
|
37445
|
-
function ExecuteQueryFromSpec(
|
|
37789
|
+
function ExecuteQueryFromSpec(_x19, _x20) {
|
|
37446
37790
|
return _ExecuteQueryFromSpec.apply(this, arguments);
|
|
37447
37791
|
}
|
|
37448
37792
|
return ExecuteQueryFromSpec;
|
|
@@ -37458,17 +37802,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37458
37802
|
}, {
|
|
37459
37803
|
key: "RunQueries",
|
|
37460
37804
|
value: (function () {
|
|
37461
|
-
var _RunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37805
|
+
var _RunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee10(params, contextUser) {
|
|
37462
37806
|
var preResult, totalResults, results, finalResults;
|
|
37463
|
-
return providerBase_regenerator().w(function (
|
|
37464
|
-
while (1) switch (
|
|
37807
|
+
return providerBase_regenerator().w(function (_context10) {
|
|
37808
|
+
while (1) switch (_context10.n) {
|
|
37465
37809
|
case 0:
|
|
37466
|
-
|
|
37810
|
+
_context10.n = 1;
|
|
37467
37811
|
return this.PreRunQueries(params, contextUser);
|
|
37468
37812
|
case 1:
|
|
37469
|
-
preResult =
|
|
37813
|
+
preResult = _context10.v;
|
|
37470
37814
|
if (!(preResult.allCached && preResult.cachedResults)) {
|
|
37471
|
-
|
|
37815
|
+
_context10.n = 2;
|
|
37472
37816
|
break;
|
|
37473
37817
|
}
|
|
37474
37818
|
totalResults = preResult.cachedResults.reduce(function (sum, r) {
|
|
@@ -37481,22 +37825,22 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37481
37825
|
batchSize: params.length,
|
|
37482
37826
|
totalResultCount: totalResults
|
|
37483
37827
|
});
|
|
37484
|
-
return
|
|
37828
|
+
return _context10.a(2, preResult.cachedResults);
|
|
37485
37829
|
case 2:
|
|
37486
|
-
|
|
37830
|
+
_context10.n = 3;
|
|
37487
37831
|
return this.InternalRunQueries(preResult.uncachedParams || params, contextUser);
|
|
37488
37832
|
case 3:
|
|
37489
|
-
results =
|
|
37833
|
+
results = _context10.v;
|
|
37490
37834
|
// Merge cached and fresh results if needed
|
|
37491
37835
|
finalResults = preResult.cachedResults ? this.mergeQueryCachedAndFreshResults(preResult, results) : results; // Post-processing for batch
|
|
37492
|
-
|
|
37836
|
+
_context10.n = 4;
|
|
37493
37837
|
return this.PostRunQueries(finalResults, params, preResult, contextUser);
|
|
37494
37838
|
case 4:
|
|
37495
|
-
return
|
|
37839
|
+
return _context10.a(2, finalResults);
|
|
37496
37840
|
}
|
|
37497
|
-
},
|
|
37841
|
+
}, _callee10, this);
|
|
37498
37842
|
}));
|
|
37499
|
-
function RunQueries(
|
|
37843
|
+
function RunQueries(_x21, _x22) {
|
|
37500
37844
|
return _RunQueries.apply(this, arguments);
|
|
37501
37845
|
}
|
|
37502
37846
|
return RunQueries;
|
|
@@ -37512,29 +37856,29 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37512
37856
|
}, {
|
|
37513
37857
|
key: "EntityStatusCheck",
|
|
37514
37858
|
value: (function () {
|
|
37515
|
-
var _EntityStatusCheck = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37859
|
+
var _EntityStatusCheck = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee11(params, callerName) {
|
|
37516
37860
|
var entityName, entity;
|
|
37517
|
-
return providerBase_regenerator().w(function (
|
|
37518
|
-
while (1) switch (
|
|
37861
|
+
return providerBase_regenerator().w(function (_context11) {
|
|
37862
|
+
while (1) switch (_context11.n) {
|
|
37519
37863
|
case 0:
|
|
37520
|
-
|
|
37864
|
+
_context11.n = 1;
|
|
37521
37865
|
return RunView.GetEntityNameFromRunViewParams(params, this);
|
|
37522
37866
|
case 1:
|
|
37523
|
-
entityName =
|
|
37867
|
+
entityName = _context11.v;
|
|
37524
37868
|
entity = entityName ? this.EntityByName(entityName) : undefined;
|
|
37525
37869
|
if (entity) {
|
|
37526
|
-
|
|
37870
|
+
_context11.n = 2;
|
|
37527
37871
|
break;
|
|
37528
37872
|
}
|
|
37529
37873
|
throw new Error("Entity ".concat(entityName, " not found in metadata"));
|
|
37530
37874
|
case 2:
|
|
37531
37875
|
EntityInfo.AssertEntityActiveStatus(entity, callerName);
|
|
37532
37876
|
case 3:
|
|
37533
|
-
return
|
|
37877
|
+
return _context11.a(2);
|
|
37534
37878
|
}
|
|
37535
|
-
},
|
|
37879
|
+
}, _callee11, this);
|
|
37536
37880
|
}));
|
|
37537
|
-
function EntityStatusCheck(
|
|
37881
|
+
function EntityStatusCheck(_x23, _x24) {
|
|
37538
37882
|
return _EntityStatusCheck.apply(this, arguments);
|
|
37539
37883
|
}
|
|
37540
37884
|
return EntityStatusCheck;
|
|
@@ -37616,20 +37960,20 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37616
37960
|
}, {
|
|
37617
37961
|
key: "PreRunView",
|
|
37618
37962
|
value: function () {
|
|
37619
|
-
var _PreRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37620
|
-
var preViewStart, telemetryStart, telemetryEventId, telemetryTime, entityCheckStart, entityCheckTime, entityLookupStart, entity, entityLookupTime, cacheCheckStart, cacheStatus, cachedResult, fingerprint, cached, cacheCheckTime, totalPreTime;
|
|
37621
|
-
return providerBase_regenerator().w(function (
|
|
37622
|
-
while (1) switch (
|
|
37963
|
+
var _PreRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee12(params, contextUser) {
|
|
37964
|
+
var preViewStart, telemetryStart, telemetryEventId, telemetryTime, entityCheckStart, entityCheckTime, entityLookupStart, entity, entityLookupTime, cacheCheckStart, cacheStatus, cachedResult, fingerprint, cached, _cached$totalRowCount, cacheCheckTime, totalPreTime;
|
|
37965
|
+
return providerBase_regenerator().w(function (_context12) {
|
|
37966
|
+
while (1) switch (_context12.n) {
|
|
37623
37967
|
case 0:
|
|
37624
37968
|
preViewStart = performance.now(); // Resolve any PlatformSQL values to plain strings for the active platform
|
|
37625
37969
|
this.ResolvePlatformSQLInParams(params);
|
|
37626
37970
|
// Run registered PreRunView hooks (e.g., tenant filter injection)
|
|
37627
37971
|
// Hooks run after PlatformSQL resolution so they see plain-string filters,
|
|
37628
37972
|
// and before cache fingerprinting so injected filters affect the cache key.
|
|
37629
|
-
|
|
37973
|
+
_context12.n = 1;
|
|
37630
37974
|
return this.RunPreRunViewHooks(params, contextUser);
|
|
37631
37975
|
case 1:
|
|
37632
|
-
params =
|
|
37976
|
+
params = _context12.v;
|
|
37633
37977
|
// Start telemetry tracking
|
|
37634
37978
|
telemetryStart = performance.now(); // After ResolvePlatformSQLInParams, ExtraFilter/OrderBy are guaranteed to be strings
|
|
37635
37979
|
telemetryEventId = TelemetryManager.Instance.StartEvent('RunView', 'ProviderBase.RunView', {
|
|
@@ -37646,18 +37990,18 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37646
37990
|
}, contextUser === null || contextUser === void 0 ? void 0 : contextUser.ID);
|
|
37647
37991
|
telemetryTime = performance.now() - telemetryStart; // Entity status check
|
|
37648
37992
|
entityCheckStart = performance.now();
|
|
37649
|
-
|
|
37993
|
+
_context12.n = 2;
|
|
37650
37994
|
return this.EntityStatusCheck(params, 'PreRunView');
|
|
37651
37995
|
case 2:
|
|
37652
37996
|
entityCheckTime = performance.now() - entityCheckStart; // Handle entity_object result type - need all fields
|
|
37653
37997
|
entityLookupStart = performance.now();
|
|
37654
37998
|
if (!(params.ResultType === 'entity_object')) {
|
|
37655
|
-
|
|
37999
|
+
_context12.n = 4;
|
|
37656
38000
|
break;
|
|
37657
38001
|
}
|
|
37658
38002
|
entity = this.EntityByName(params.EntityName);
|
|
37659
38003
|
if (entity) {
|
|
37660
|
-
|
|
38004
|
+
_context12.n = 3;
|
|
37661
38005
|
break;
|
|
37662
38006
|
}
|
|
37663
38007
|
throw new Error("Entity ".concat(params.EntityName, " not found in metadata"));
|
|
@@ -37670,21 +38014,21 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37670
38014
|
cacheCheckStart = performance.now();
|
|
37671
38015
|
cacheStatus = 'disabled';
|
|
37672
38016
|
if (!((params.CacheLocal || this.TrustLocalCacheCompletely) && LocalCacheManager.Instance.IsInitialized)) {
|
|
37673
|
-
|
|
38017
|
+
_context12.n = 6;
|
|
37674
38018
|
break;
|
|
37675
38019
|
}
|
|
37676
38020
|
fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(params, this.InstanceConnectionString);
|
|
37677
|
-
|
|
38021
|
+
_context12.n = 5;
|
|
37678
38022
|
return LocalCacheManager.Instance.GetRunViewResult(fingerprint);
|
|
37679
38023
|
case 5:
|
|
37680
|
-
cached =
|
|
38024
|
+
cached = _context12.v;
|
|
37681
38025
|
if (cached) {
|
|
37682
38026
|
// Reconstruct RunViewResult from cached data
|
|
37683
38027
|
cachedResult = {
|
|
37684
38028
|
Success: true,
|
|
37685
38029
|
Results: cached.results,
|
|
37686
38030
|
RowCount: cached.results.length,
|
|
37687
|
-
TotalRowCount: cached.results.length,
|
|
38031
|
+
TotalRowCount: (_cached$totalRowCount = cached.totalRowCount) !== null && _cached$totalRowCount !== void 0 ? _cached$totalRowCount : cached.results.length,
|
|
37688
38032
|
ExecutionTime: 0,
|
|
37689
38033
|
// Cached, no execution time
|
|
37690
38034
|
ErrorMessage: '',
|
|
@@ -37707,16 +38051,16 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37707
38051
|
if (totalPreTime > 50) {
|
|
37708
38052
|
LogStatus("[PERF-PRE] PreRunView ".concat(params.EntityName, ": ").concat(totalPreTime.toFixed(1), "ms (telemetry=").concat(telemetryTime.toFixed(1), "ms, entityCheck=").concat(entityCheckTime.toFixed(1), "ms, entityLookup=").concat(entityLookupTime.toFixed(1), "ms, cache=").concat(cacheCheckTime.toFixed(1), "ms)"));
|
|
37709
38053
|
}
|
|
37710
|
-
return
|
|
38054
|
+
return _context12.a(2, {
|
|
37711
38055
|
telemetryEventId: telemetryEventId,
|
|
37712
38056
|
cacheStatus: cacheStatus,
|
|
37713
38057
|
cachedResult: cachedResult,
|
|
37714
38058
|
fingerprint: fingerprint
|
|
37715
38059
|
});
|
|
37716
38060
|
}
|
|
37717
|
-
},
|
|
38061
|
+
}, _callee12, this);
|
|
37718
38062
|
}));
|
|
37719
|
-
function PreRunView(
|
|
38063
|
+
function PreRunView(_x25, _x26) {
|
|
37720
38064
|
return _PreRunView.apply(this, arguments);
|
|
37721
38065
|
}
|
|
37722
38066
|
return PreRunView;
|
|
@@ -37731,37 +38075,37 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37731
38075
|
}, {
|
|
37732
38076
|
key: "PreRunViews",
|
|
37733
38077
|
value: (function () {
|
|
37734
|
-
var _PreRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
37735
|
-
var
|
|
37736
|
-
return providerBase_regenerator().w(function (
|
|
37737
|
-
while (1) switch (
|
|
38078
|
+
var _PreRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee13(params, contextUser) {
|
|
38079
|
+
var _iterator6, _step6, p, i, fromEngine, telemetryEventId, useFastStartup, allHaveCachedData, _iterator7, _step7, param, fp, cached, entityNames, useSmartCacheCheck, _useSmartCacheCheck, cacheStatusMap, uncachedParams, cachedResults, allCached, _i2, _param, entity, fingerprint, _cached, _cached$totalRowCount2, cachedViewResult, hasCacheHits, _t4;
|
|
38080
|
+
return providerBase_regenerator().w(function (_context13) {
|
|
38081
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
37738
38082
|
case 0:
|
|
37739
38083
|
// Resolve any PlatformSQL values to plain strings for the active platform
|
|
37740
|
-
|
|
38084
|
+
_iterator6 = providerBase_createForOfIteratorHelper(params);
|
|
37741
38085
|
try {
|
|
37742
|
-
for (
|
|
37743
|
-
p =
|
|
38086
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
38087
|
+
p = _step6.value;
|
|
37744
38088
|
this.ResolvePlatformSQLInParams(p);
|
|
37745
38089
|
}
|
|
37746
38090
|
// Run registered PreRunView hooks on each param in the batch
|
|
37747
38091
|
} catch (err) {
|
|
37748
|
-
|
|
38092
|
+
_iterator6.e(err);
|
|
37749
38093
|
} finally {
|
|
37750
|
-
|
|
38094
|
+
_iterator6.f();
|
|
37751
38095
|
}
|
|
37752
38096
|
i = 0;
|
|
37753
38097
|
case 1:
|
|
37754
38098
|
if (!(i < params.length)) {
|
|
37755
|
-
|
|
38099
|
+
_context13.n = 4;
|
|
37756
38100
|
break;
|
|
37757
38101
|
}
|
|
37758
|
-
|
|
38102
|
+
_context13.n = 2;
|
|
37759
38103
|
return this.RunPreRunViewHooks(params[i], contextUser);
|
|
37760
38104
|
case 2:
|
|
37761
|
-
params[i] =
|
|
38105
|
+
params[i] = _context13.v;
|
|
37762
38106
|
case 3:
|
|
37763
38107
|
i++;
|
|
37764
|
-
|
|
38108
|
+
_context13.n = 1;
|
|
37765
38109
|
break;
|
|
37766
38110
|
case 4:
|
|
37767
38111
|
// Start telemetry tracking for batch operation
|
|
@@ -37778,7 +38122,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37778
38122
|
// Server-side providers trust the cache completely and fall through to
|
|
37779
38123
|
// the traditional flow which returns cached data immediately on hit.
|
|
37780
38124
|
if (this.TrustLocalCacheCompletely) {
|
|
37781
|
-
|
|
38125
|
+
_context13.n = 16;
|
|
37782
38126
|
break;
|
|
37783
38127
|
}
|
|
37784
38128
|
// FastStartupMode: on the first engine load after a page refresh, trust
|
|
@@ -37790,52 +38134,52 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37790
38134
|
return p.CacheLocal;
|
|
37791
38135
|
});
|
|
37792
38136
|
if (!useFastStartup) {
|
|
37793
|
-
|
|
38137
|
+
_context13.n = 15;
|
|
37794
38138
|
break;
|
|
37795
38139
|
}
|
|
37796
38140
|
// Check if we actually have cached data for ALL params
|
|
37797
38141
|
allHaveCachedData = true;
|
|
37798
|
-
|
|
37799
|
-
|
|
37800
|
-
|
|
38142
|
+
_iterator7 = providerBase_createForOfIteratorHelper(params);
|
|
38143
|
+
_context13.p = 5;
|
|
38144
|
+
_iterator7.s();
|
|
37801
38145
|
case 6:
|
|
37802
|
-
if ((
|
|
37803
|
-
|
|
38146
|
+
if ((_step7 = _iterator7.n()).done) {
|
|
38147
|
+
_context13.n = 9;
|
|
37804
38148
|
break;
|
|
37805
38149
|
}
|
|
37806
|
-
param =
|
|
38150
|
+
param = _step7.value;
|
|
37807
38151
|
if (!param.CacheLocal) {
|
|
37808
|
-
|
|
38152
|
+
_context13.n = 8;
|
|
37809
38153
|
break;
|
|
37810
38154
|
}
|
|
37811
38155
|
fp = LocalCacheManager.Instance.GenerateRunViewFingerprint(param, this.InstanceConnectionString);
|
|
37812
|
-
|
|
38156
|
+
_context13.n = 7;
|
|
37813
38157
|
return LocalCacheManager.Instance.GetRunViewResult(fp);
|
|
37814
38158
|
case 7:
|
|
37815
|
-
cached =
|
|
38159
|
+
cached = _context13.v;
|
|
37816
38160
|
if (cached) {
|
|
37817
|
-
|
|
38161
|
+
_context13.n = 8;
|
|
37818
38162
|
break;
|
|
37819
38163
|
}
|
|
37820
38164
|
allHaveCachedData = false;
|
|
37821
|
-
return
|
|
38165
|
+
return _context13.a(3, 9);
|
|
37822
38166
|
case 8:
|
|
37823
|
-
|
|
38167
|
+
_context13.n = 6;
|
|
37824
38168
|
break;
|
|
37825
38169
|
case 9:
|
|
37826
|
-
|
|
38170
|
+
_context13.n = 11;
|
|
37827
38171
|
break;
|
|
37828
38172
|
case 10:
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
|
|
38173
|
+
_context13.p = 10;
|
|
38174
|
+
_t4 = _context13.v;
|
|
38175
|
+
_iterator7.e(_t4);
|
|
37832
38176
|
case 11:
|
|
37833
|
-
|
|
37834
|
-
|
|
37835
|
-
return
|
|
38177
|
+
_context13.p = 11;
|
|
38178
|
+
_iterator7.f();
|
|
38179
|
+
return _context13.f(11);
|
|
37836
38180
|
case 12:
|
|
37837
38181
|
if (!allHaveCachedData) {
|
|
37838
|
-
|
|
38182
|
+
_context13.n = 13;
|
|
37839
38183
|
break;
|
|
37840
38184
|
}
|
|
37841
38185
|
// Mark fast startup as consumed — subsequent loads will validate normally
|
|
@@ -37848,7 +38192,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37848
38192
|
verboseOnly: false
|
|
37849
38193
|
});
|
|
37850
38194
|
// Fall through to the traditional flow below which will return cached data
|
|
37851
|
-
|
|
38195
|
+
_context13.n = 14;
|
|
37852
38196
|
break;
|
|
37853
38197
|
case 13:
|
|
37854
38198
|
// Not all params have cached data — use normal smart cache check
|
|
@@ -37857,26 +38201,26 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37857
38201
|
return p.CacheLocal;
|
|
37858
38202
|
});
|
|
37859
38203
|
if (!useSmartCacheCheck) {
|
|
37860
|
-
|
|
38204
|
+
_context13.n = 14;
|
|
37861
38205
|
break;
|
|
37862
38206
|
}
|
|
37863
|
-
return
|
|
38207
|
+
return _context13.a(2, this.prepareSmartCacheCheckParams(params, telemetryEventId, contextUser));
|
|
37864
38208
|
case 14:
|
|
37865
|
-
|
|
38209
|
+
_context13.n = 16;
|
|
37866
38210
|
break;
|
|
37867
38211
|
case 15:
|
|
37868
38212
|
if (useFastStartup) {
|
|
37869
|
-
|
|
38213
|
+
_context13.n = 16;
|
|
37870
38214
|
break;
|
|
37871
38215
|
}
|
|
37872
38216
|
_useSmartCacheCheck = params.some(function (p) {
|
|
37873
38217
|
return p.CacheLocal;
|
|
37874
38218
|
});
|
|
37875
38219
|
if (!(_useSmartCacheCheck && LocalCacheManager.Instance.IsInitialized)) {
|
|
37876
|
-
|
|
38220
|
+
_context13.n = 16;
|
|
37877
38221
|
break;
|
|
37878
38222
|
}
|
|
37879
|
-
return
|
|
38223
|
+
return _context13.a(2, this.prepareSmartCacheCheckParams(params, telemetryEventId, contextUser));
|
|
37880
38224
|
case 16:
|
|
37881
38225
|
// Traditional caching flow
|
|
37882
38226
|
cacheStatusMap = new Map();
|
|
@@ -37886,20 +38230,20 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37886
38230
|
_i2 = 0;
|
|
37887
38231
|
case 17:
|
|
37888
38232
|
if (!(_i2 < params.length)) {
|
|
37889
|
-
|
|
38233
|
+
_context13.n = 27;
|
|
37890
38234
|
break;
|
|
37891
38235
|
}
|
|
37892
38236
|
_param = params[_i2]; // Entity status check
|
|
37893
|
-
|
|
38237
|
+
_context13.n = 18;
|
|
37894
38238
|
return this.EntityStatusCheck(_param, 'PreRunViews');
|
|
37895
38239
|
case 18:
|
|
37896
38240
|
if (!(_param.ResultType === 'entity_object')) {
|
|
37897
|
-
|
|
38241
|
+
_context13.n = 20;
|
|
37898
38242
|
break;
|
|
37899
38243
|
}
|
|
37900
38244
|
entity = this.EntityByName(_param.EntityName);
|
|
37901
38245
|
if (entity) {
|
|
37902
|
-
|
|
38246
|
+
_context13.n = 19;
|
|
37903
38247
|
break;
|
|
37904
38248
|
}
|
|
37905
38249
|
throw new Error("Entity ".concat(_param.EntityName, " not found in metadata"));
|
|
@@ -37909,29 +38253,29 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37909
38253
|
});
|
|
37910
38254
|
case 20:
|
|
37911
38255
|
if (!((_param.CacheLocal || this.TrustLocalCacheCompletely) && LocalCacheManager.Instance.IsInitialized)) {
|
|
37912
|
-
|
|
38256
|
+
_context13.n = 24;
|
|
37913
38257
|
break;
|
|
37914
38258
|
}
|
|
37915
38259
|
fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(_param, this.InstanceConnectionString);
|
|
37916
|
-
|
|
38260
|
+
_context13.n = 21;
|
|
37917
38261
|
return LocalCacheManager.Instance.GetRunViewResult(fingerprint);
|
|
37918
38262
|
case 21:
|
|
37919
|
-
_cached =
|
|
38263
|
+
_cached = _context13.v;
|
|
37920
38264
|
if (!_cached) {
|
|
37921
|
-
|
|
38265
|
+
_context13.n = 23;
|
|
37922
38266
|
break;
|
|
37923
38267
|
}
|
|
37924
38268
|
cachedViewResult = {
|
|
37925
38269
|
Success: true,
|
|
37926
38270
|
Results: _cached.results,
|
|
37927
38271
|
RowCount: _cached.results.length,
|
|
37928
|
-
TotalRowCount: _cached.results.length,
|
|
38272
|
+
TotalRowCount: (_cached$totalRowCount2 = _cached.totalRowCount) !== null && _cached$totalRowCount2 !== void 0 ? _cached$totalRowCount2 : _cached.results.length,
|
|
37929
38273
|
ExecutionTime: 0,
|
|
37930
38274
|
ErrorMessage: '',
|
|
37931
38275
|
UserViewRunID: '',
|
|
37932
38276
|
AggregateResults: _cached.aggregateResults // Include cached aggregate results
|
|
37933
38277
|
}; // if needed this will transform each result into an entity object
|
|
37934
|
-
|
|
38278
|
+
_context13.n = 22;
|
|
37935
38279
|
return this.TransformSimpleObjectToEntityObject(_param, cachedViewResult, contextUser);
|
|
37936
38280
|
case 22:
|
|
37937
38281
|
if (!_param.CacheLocal && this.TrustLocalCacheCompletely) {
|
|
@@ -37949,7 +38293,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37949
38293
|
result: cachedViewResult
|
|
37950
38294
|
});
|
|
37951
38295
|
cachedResults.push(cachedViewResult);
|
|
37952
|
-
return
|
|
38296
|
+
return _context13.a(3, 26);
|
|
37953
38297
|
case 23:
|
|
37954
38298
|
LogStatusEx({
|
|
37955
38299
|
message: " \uD83D\uDD0D [Cache MISS] \"".concat(_param.EntityName || _param.ViewName || 'unknown', "\" \u2014 will query database"),
|
|
@@ -37958,7 +38302,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37958
38302
|
cacheStatusMap.set(_i2, {
|
|
37959
38303
|
status: 'miss'
|
|
37960
38304
|
});
|
|
37961
|
-
|
|
38305
|
+
_context13.n = 25;
|
|
37962
38306
|
break;
|
|
37963
38307
|
case 24:
|
|
37964
38308
|
cacheStatusMap.set(_i2, {
|
|
@@ -37970,13 +38314,13 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37970
38314
|
cachedResults.push(null); // Placeholder for uncached
|
|
37971
38315
|
case 26:
|
|
37972
38316
|
_i2++;
|
|
37973
|
-
|
|
38317
|
+
_context13.n = 17;
|
|
37974
38318
|
break;
|
|
37975
38319
|
case 27:
|
|
37976
38320
|
hasCacheHits = cacheStatusMap.size > 0 && providerBase_toConsumableArray(cacheStatusMap.values()).some(function (v) {
|
|
37977
38321
|
return v.status === 'hit';
|
|
37978
38322
|
});
|
|
37979
|
-
return
|
|
38323
|
+
return _context13.a(2, {
|
|
37980
38324
|
telemetryEventId: telemetryEventId,
|
|
37981
38325
|
allCached: allCached,
|
|
37982
38326
|
cachedResults: allCached ? cachedResults.filter(function (r) {
|
|
@@ -37986,9 +38330,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
37986
38330
|
cacheStatusMap: cacheStatusMap
|
|
37987
38331
|
});
|
|
37988
38332
|
}
|
|
37989
|
-
},
|
|
38333
|
+
}, _callee13, this, [[5, 10, 11, 12]]);
|
|
37990
38334
|
}));
|
|
37991
|
-
function PreRunViews(
|
|
38335
|
+
function PreRunViews(_x27, _x28) {
|
|
37992
38336
|
return _PreRunViews.apply(this, arguments);
|
|
37993
38337
|
}
|
|
37994
38338
|
return PreRunViews;
|
|
@@ -38002,31 +38346,31 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38002
38346
|
}, {
|
|
38003
38347
|
key: "prepareSmartCacheCheckParams",
|
|
38004
38348
|
value: (function () {
|
|
38005
|
-
var _prepareSmartCacheCheckParams = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38006
|
-
var smartCacheCheckParams,
|
|
38007
|
-
return providerBase_regenerator().w(function (
|
|
38008
|
-
while (1) switch (
|
|
38349
|
+
var _prepareSmartCacheCheckParams = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee14(params, telemetryEventId, contextUser) {
|
|
38350
|
+
var smartCacheCheckParams, _iterator8, _step8, param, entity, cacheStatus, fingerprint, cached, _t5;
|
|
38351
|
+
return providerBase_regenerator().w(function (_context14) {
|
|
38352
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
38009
38353
|
case 0:
|
|
38010
38354
|
smartCacheCheckParams = [];
|
|
38011
|
-
|
|
38012
|
-
|
|
38013
|
-
|
|
38355
|
+
_iterator8 = providerBase_createForOfIteratorHelper(params);
|
|
38356
|
+
_context14.p = 1;
|
|
38357
|
+
_iterator8.s();
|
|
38014
38358
|
case 2:
|
|
38015
|
-
if ((
|
|
38016
|
-
|
|
38359
|
+
if ((_step8 = _iterator8.n()).done) {
|
|
38360
|
+
_context14.n = 9;
|
|
38017
38361
|
break;
|
|
38018
38362
|
}
|
|
38019
|
-
param =
|
|
38020
|
-
|
|
38363
|
+
param = _step8.value;
|
|
38364
|
+
_context14.n = 3;
|
|
38021
38365
|
return this.EntityStatusCheck(param, 'PreRunViews');
|
|
38022
38366
|
case 3:
|
|
38023
38367
|
if (!(param.ResultType === 'entity_object')) {
|
|
38024
|
-
|
|
38368
|
+
_context14.n = 5;
|
|
38025
38369
|
break;
|
|
38026
38370
|
}
|
|
38027
38371
|
entity = this.EntityByName(param.EntityName);
|
|
38028
38372
|
if (entity) {
|
|
38029
|
-
|
|
38373
|
+
_context14.n = 4;
|
|
38030
38374
|
break;
|
|
38031
38375
|
}
|
|
38032
38376
|
throw new Error("Entity ".concat(param.EntityName, " not found in metadata"));
|
|
@@ -38038,14 +38382,14 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38038
38382
|
// Build the cache check param with optional cache status
|
|
38039
38383
|
cacheStatus = void 0;
|
|
38040
38384
|
if (!(param.CacheLocal && LocalCacheManager.Instance.IsInitialized)) {
|
|
38041
|
-
|
|
38385
|
+
_context14.n = 7;
|
|
38042
38386
|
break;
|
|
38043
38387
|
}
|
|
38044
38388
|
fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(param, this.InstanceConnectionString);
|
|
38045
|
-
|
|
38389
|
+
_context14.n = 6;
|
|
38046
38390
|
return LocalCacheManager.Instance.GetRunViewResult(fingerprint);
|
|
38047
38391
|
case 6:
|
|
38048
|
-
cached =
|
|
38392
|
+
cached = _context14.v;
|
|
38049
38393
|
if (cached) {
|
|
38050
38394
|
cacheStatus = {
|
|
38051
38395
|
maxUpdatedAt: cached.maxUpdatedAt,
|
|
@@ -38058,21 +38402,21 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38058
38402
|
cacheStatus: cacheStatus
|
|
38059
38403
|
});
|
|
38060
38404
|
case 8:
|
|
38061
|
-
|
|
38405
|
+
_context14.n = 2;
|
|
38062
38406
|
break;
|
|
38063
38407
|
case 9:
|
|
38064
|
-
|
|
38408
|
+
_context14.n = 11;
|
|
38065
38409
|
break;
|
|
38066
38410
|
case 10:
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38411
|
+
_context14.p = 10;
|
|
38412
|
+
_t5 = _context14.v;
|
|
38413
|
+
_iterator8.e(_t5);
|
|
38070
38414
|
case 11:
|
|
38071
|
-
|
|
38072
|
-
|
|
38073
|
-
return
|
|
38415
|
+
_context14.p = 11;
|
|
38416
|
+
_iterator8.f();
|
|
38417
|
+
return _context14.f(11);
|
|
38074
38418
|
case 12:
|
|
38075
|
-
return
|
|
38419
|
+
return _context14.a(2, {
|
|
38076
38420
|
telemetryEventId: telemetryEventId,
|
|
38077
38421
|
allCached: false,
|
|
38078
38422
|
// Don't return cached directly - let server validate
|
|
@@ -38081,9 +38425,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38081
38425
|
cacheStatusMap: new Map()
|
|
38082
38426
|
});
|
|
38083
38427
|
}
|
|
38084
|
-
},
|
|
38428
|
+
}, _callee14, this, [[1, 10, 11, 12]]);
|
|
38085
38429
|
}));
|
|
38086
|
-
function prepareSmartCacheCheckParams(
|
|
38430
|
+
function prepareSmartCacheCheckParams(_x29, _x30, _x31) {
|
|
38087
38431
|
return _prepareSmartCacheCheckParams.apply(this, arguments);
|
|
38088
38432
|
}
|
|
38089
38433
|
return prepareSmartCacheCheckParams;
|
|
@@ -38100,20 +38444,20 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38100
38444
|
}, {
|
|
38101
38445
|
key: "executeSmartCacheCheck",
|
|
38102
38446
|
value: (function () {
|
|
38103
|
-
var _executeSmartCacheCheck = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38447
|
+
var _executeSmartCacheCheck = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee15(params, preResult, contextUser) {
|
|
38104
38448
|
var _this5 = this;
|
|
38105
|
-
var provider, response, processingPromises, processedResults, cacheHits, cacheMisses,
|
|
38106
|
-
return providerBase_regenerator().w(function (
|
|
38107
|
-
while (1) switch (
|
|
38449
|
+
var provider, response, processingPromises, processedResults, cacheHits, cacheMisses, _iterator9, _step9, result;
|
|
38450
|
+
return providerBase_regenerator().w(function (_context15) {
|
|
38451
|
+
while (1) switch (_context15.n) {
|
|
38108
38452
|
case 0:
|
|
38109
38453
|
// Cast to access RunViewsWithCacheCheck method
|
|
38110
38454
|
provider = this; // Execute the smart cache check
|
|
38111
|
-
|
|
38455
|
+
_context15.n = 1;
|
|
38112
38456
|
return provider.RunViewsWithCacheCheck(preResult.smartCacheCheckParams, contextUser);
|
|
38113
38457
|
case 1:
|
|
38114
|
-
response =
|
|
38458
|
+
response = _context15.v;
|
|
38115
38459
|
if (response.success) {
|
|
38116
|
-
|
|
38460
|
+
_context15.n = 2;
|
|
38117
38461
|
break;
|
|
38118
38462
|
}
|
|
38119
38463
|
// If the smart cache check failed, log and return empty results
|
|
@@ -38123,7 +38467,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38123
38467
|
success: false,
|
|
38124
38468
|
errorMessage: response.errorMessage
|
|
38125
38469
|
});
|
|
38126
|
-
return
|
|
38470
|
+
return _context15.a(2, params.map(function () {
|
|
38127
38471
|
return {
|
|
38128
38472
|
Success: false,
|
|
38129
38473
|
Results: [],
|
|
@@ -38139,25 +38483,25 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38139
38483
|
processingPromises = params.map(function (param, i) {
|
|
38140
38484
|
return _this5.processSingleSmartCacheResult(param, i, response.results, contextUser);
|
|
38141
38485
|
});
|
|
38142
|
-
|
|
38486
|
+
_context15.n = 3;
|
|
38143
38487
|
return Promise.all(processingPromises);
|
|
38144
38488
|
case 3:
|
|
38145
|
-
processedResults =
|
|
38489
|
+
processedResults = _context15.v;
|
|
38146
38490
|
// Aggregate telemetry stats
|
|
38147
38491
|
cacheHits = 0;
|
|
38148
38492
|
cacheMisses = 0;
|
|
38149
|
-
|
|
38493
|
+
_iterator9 = providerBase_createForOfIteratorHelper(processedResults);
|
|
38150
38494
|
try {
|
|
38151
|
-
for (
|
|
38152
|
-
result =
|
|
38495
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
38496
|
+
result = _step9.value;
|
|
38153
38497
|
if (result.cacheHit) cacheHits++;
|
|
38154
38498
|
if (result.cacheMiss) cacheMisses++;
|
|
38155
38499
|
}
|
|
38156
38500
|
// End telemetry
|
|
38157
38501
|
} catch (err) {
|
|
38158
|
-
|
|
38502
|
+
_iterator9.e(err);
|
|
38159
38503
|
} finally {
|
|
38160
|
-
|
|
38504
|
+
_iterator9.f();
|
|
38161
38505
|
}
|
|
38162
38506
|
TelemetryManager.Instance.EndEvent(preResult.telemetryEventId, {
|
|
38163
38507
|
smartCacheCheck: true,
|
|
@@ -38166,13 +38510,13 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38166
38510
|
cacheMisses: cacheMisses,
|
|
38167
38511
|
batchSize: params.length
|
|
38168
38512
|
});
|
|
38169
|
-
return
|
|
38513
|
+
return _context15.a(2, processedResults.map(function (r) {
|
|
38170
38514
|
return r.result;
|
|
38171
38515
|
}));
|
|
38172
38516
|
}
|
|
38173
|
-
},
|
|
38517
|
+
}, _callee15, this);
|
|
38174
38518
|
}));
|
|
38175
|
-
function executeSmartCacheCheck(
|
|
38519
|
+
function executeSmartCacheCheck(_x32, _x33, _x34) {
|
|
38176
38520
|
return _executeSmartCacheCheck.apply(this, arguments);
|
|
38177
38521
|
}
|
|
38178
38522
|
return executeSmartCacheCheck;
|
|
@@ -38185,19 +38529,19 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38185
38529
|
}, {
|
|
38186
38530
|
key: "processSingleSmartCacheResult",
|
|
38187
38531
|
value: (function () {
|
|
38188
|
-
var _processSingleSmartCacheResult = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38189
|
-
var checkResult, fingerprint, cached, cachedResult, _entity$
|
|
38190
|
-
return providerBase_regenerator().w(function (
|
|
38191
|
-
while (1) switch (
|
|
38532
|
+
var _processSingleSmartCacheResult = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee16(param, index, serverResults, contextUser) {
|
|
38533
|
+
var checkResult, fingerprint, cached, _cached$totalRowCount3, cachedResult, _entity$FirstPrimaryK4, _fingerprint, entity, primaryKeyFieldName, merged, _merged$totalRowCount, mergedResult, staleResults, freshResult, _fingerprint2;
|
|
38534
|
+
return providerBase_regenerator().w(function (_context16) {
|
|
38535
|
+
while (1) switch (_context16.n) {
|
|
38192
38536
|
case 0:
|
|
38193
38537
|
checkResult = serverResults.find(function (r) {
|
|
38194
38538
|
return r.viewIndex === index;
|
|
38195
38539
|
});
|
|
38196
38540
|
if (checkResult) {
|
|
38197
|
-
|
|
38541
|
+
_context16.n = 1;
|
|
38198
38542
|
break;
|
|
38199
38543
|
}
|
|
38200
|
-
return
|
|
38544
|
+
return _context16.a(2, {
|
|
38201
38545
|
result: {
|
|
38202
38546
|
Success: false,
|
|
38203
38547
|
Results: [],
|
|
@@ -38212,39 +38556,39 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38212
38556
|
});
|
|
38213
38557
|
case 1:
|
|
38214
38558
|
if (!(checkResult.status === 'current')) {
|
|
38215
|
-
|
|
38559
|
+
_context16.n = 6;
|
|
38216
38560
|
break;
|
|
38217
38561
|
}
|
|
38218
38562
|
// Cache is current - use cached data
|
|
38219
38563
|
fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(param, this.InstanceConnectionString);
|
|
38220
|
-
|
|
38564
|
+
_context16.n = 2;
|
|
38221
38565
|
return LocalCacheManager.Instance.GetRunViewResult(fingerprint);
|
|
38222
38566
|
case 2:
|
|
38223
|
-
cached =
|
|
38567
|
+
cached = _context16.v;
|
|
38224
38568
|
if (!cached) {
|
|
38225
|
-
|
|
38569
|
+
_context16.n = 4;
|
|
38226
38570
|
break;
|
|
38227
38571
|
}
|
|
38228
38572
|
cachedResult = {
|
|
38229
38573
|
Success: true,
|
|
38230
38574
|
Results: cached.results,
|
|
38231
38575
|
RowCount: cached.rowCount,
|
|
38232
|
-
TotalRowCount: cached.rowCount,
|
|
38576
|
+
TotalRowCount: (_cached$totalRowCount3 = cached.totalRowCount) !== null && _cached$totalRowCount3 !== void 0 ? _cached$totalRowCount3 : cached.rowCount,
|
|
38233
38577
|
ExecutionTime: 0,
|
|
38234
38578
|
ErrorMessage: '',
|
|
38235
38579
|
UserViewRunID: '',
|
|
38236
38580
|
AggregateResults: cached.aggregateResults // Include cached aggregate results
|
|
38237
38581
|
}; // Transform to entity objects if needed
|
|
38238
|
-
|
|
38582
|
+
_context16.n = 3;
|
|
38239
38583
|
return this.TransformSimpleObjectToEntityObject(param, cachedResult, contextUser);
|
|
38240
38584
|
case 3:
|
|
38241
|
-
return
|
|
38585
|
+
return _context16.a(2, {
|
|
38242
38586
|
result: cachedResult,
|
|
38243
38587
|
cacheHit: true,
|
|
38244
38588
|
cacheMiss: false
|
|
38245
38589
|
});
|
|
38246
38590
|
case 4:
|
|
38247
|
-
return
|
|
38591
|
+
return _context16.a(2, {
|
|
38248
38592
|
result: {
|
|
38249
38593
|
Success: false,
|
|
38250
38594
|
Results: [],
|
|
@@ -38258,45 +38602,45 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38258
38602
|
cacheMiss: false
|
|
38259
38603
|
});
|
|
38260
38604
|
case 5:
|
|
38261
|
-
|
|
38605
|
+
_context16.n = 13;
|
|
38262
38606
|
break;
|
|
38263
38607
|
case 6:
|
|
38264
38608
|
if (!(checkResult.status === 'differential')) {
|
|
38265
|
-
|
|
38609
|
+
_context16.n = 10;
|
|
38266
38610
|
break;
|
|
38267
38611
|
}
|
|
38268
38612
|
// Cache is stale but we have differential data - merge with cached data
|
|
38269
38613
|
_fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(param, this.InstanceConnectionString); // Get entity info for primary key field name
|
|
38270
38614
|
entity = this.EntityByName(param.EntityName);
|
|
38271
|
-
primaryKeyFieldName = (entity === null || entity === void 0 || (_entity$
|
|
38615
|
+
primaryKeyFieldName = (entity === null || entity === void 0 || (_entity$FirstPrimaryK4 = entity.FirstPrimaryKey) === null || _entity$FirstPrimaryK4 === void 0 ? void 0 : _entity$FirstPrimaryK4.Name) || 'ID'; // Apply differential update to cache
|
|
38272
38616
|
if (!(param.CacheLocal && checkResult.differentialData && LocalCacheManager.Instance.IsInitialized)) {
|
|
38273
|
-
|
|
38617
|
+
_context16.n = 9;
|
|
38274
38618
|
break;
|
|
38275
38619
|
}
|
|
38276
|
-
|
|
38620
|
+
_context16.n = 7;
|
|
38277
38621
|
return LocalCacheManager.Instance.ApplyDifferentialUpdate(_fingerprint, param, checkResult.differentialData.updatedRows, checkResult.differentialData.deletedRecordIDs, primaryKeyFieldName, checkResult.maxUpdatedAt || new Date().toISOString(), checkResult.rowCount || 0, checkResult.aggregateResults // Pass fresh aggregate results (can't be differentially computed)
|
|
38278
38622
|
);
|
|
38279
38623
|
case 7:
|
|
38280
|
-
merged =
|
|
38624
|
+
merged = _context16.v;
|
|
38281
38625
|
if (!merged) {
|
|
38282
|
-
|
|
38626
|
+
_context16.n = 9;
|
|
38283
38627
|
break;
|
|
38284
38628
|
}
|
|
38285
38629
|
mergedResult = {
|
|
38286
38630
|
Success: true,
|
|
38287
38631
|
Results: merged.results,
|
|
38288
38632
|
RowCount: merged.rowCount,
|
|
38289
|
-
TotalRowCount: merged.rowCount,
|
|
38633
|
+
TotalRowCount: (_merged$totalRowCount = merged.totalRowCount) !== null && _merged$totalRowCount !== void 0 ? _merged$totalRowCount : merged.rowCount,
|
|
38290
38634
|
ExecutionTime: 0,
|
|
38291
38635
|
ErrorMessage: '',
|
|
38292
38636
|
UserViewRunID: '',
|
|
38293
38637
|
// Include aggregate results - either fresh from server or from merged cache
|
|
38294
38638
|
AggregateResults: checkResult.aggregateResults || merged.aggregateResults
|
|
38295
38639
|
}; // Transform to entity objects if needed
|
|
38296
|
-
|
|
38640
|
+
_context16.n = 8;
|
|
38297
38641
|
return this.TransformSimpleObjectToEntityObject(param, mergedResult, contextUser);
|
|
38298
38642
|
case 8:
|
|
38299
|
-
return
|
|
38643
|
+
return _context16.a(2, {
|
|
38300
38644
|
result: mergedResult,
|
|
38301
38645
|
cacheHit: true,
|
|
38302
38646
|
cacheMiss: false
|
|
@@ -38305,15 +38649,16 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38305
38649
|
throw new Error("Differential cache merge failed for entity '".concat(param.EntityName, "'. ") + "Cache fingerprint may be invalid or cache data corrupted. " + "Consider clearing the local cache and retrying.");
|
|
38306
38650
|
case 10:
|
|
38307
38651
|
if (!(checkResult.status === 'stale')) {
|
|
38308
|
-
|
|
38652
|
+
_context16.n = 12;
|
|
38309
38653
|
break;
|
|
38310
38654
|
}
|
|
38311
38655
|
// Cache is stale - use fresh data and update cache (entity doesn't support differential)
|
|
38656
|
+
staleResults = checkResult.results || [];
|
|
38312
38657
|
freshResult = {
|
|
38313
38658
|
Success: true,
|
|
38314
|
-
Results:
|
|
38315
|
-
RowCount:
|
|
38316
|
-
TotalRowCount: checkResult.rowCount ||
|
|
38659
|
+
Results: staleResults,
|
|
38660
|
+
RowCount: staleResults.length,
|
|
38661
|
+
TotalRowCount: checkResult.rowCount || staleResults.length,
|
|
38317
38662
|
ExecutionTime: 0,
|
|
38318
38663
|
ErrorMessage: '',
|
|
38319
38664
|
UserViewRunID: '',
|
|
@@ -38322,22 +38667,23 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38322
38667
|
if (param.CacheLocal && checkResult.maxUpdatedAt && LocalCacheManager.Instance.IsInitialized) {
|
|
38323
38668
|
_fingerprint2 = LocalCacheManager.Instance.GenerateRunViewFingerprint(param, this.InstanceConnectionString); // Note: We don't await here to avoid blocking the response
|
|
38324
38669
|
// Cache update happens in background
|
|
38325
|
-
LocalCacheManager.Instance.SetRunViewResult(_fingerprint2, param, checkResult.results || [], checkResult.maxUpdatedAt, checkResult.aggregateResults
|
|
38326
|
-
|
|
38670
|
+
LocalCacheManager.Instance.SetRunViewResult(_fingerprint2, param, checkResult.results || [], checkResult.maxUpdatedAt, checkResult.aggregateResults,
|
|
38671
|
+
// Include aggregate results in cache
|
|
38672
|
+
checkResult.rowCount).catch(function (e) {
|
|
38327
38673
|
return LogError("Failed to update cache: ".concat(e));
|
|
38328
38674
|
});
|
|
38329
38675
|
}
|
|
38330
38676
|
// Transform to entity objects if needed
|
|
38331
|
-
|
|
38677
|
+
_context16.n = 11;
|
|
38332
38678
|
return this.TransformSimpleObjectToEntityObject(param, freshResult, contextUser);
|
|
38333
38679
|
case 11:
|
|
38334
|
-
return
|
|
38680
|
+
return _context16.a(2, {
|
|
38335
38681
|
result: freshResult,
|
|
38336
38682
|
cacheHit: false,
|
|
38337
38683
|
cacheMiss: true
|
|
38338
38684
|
});
|
|
38339
38685
|
case 12:
|
|
38340
|
-
return
|
|
38686
|
+
return _context16.a(2, {
|
|
38341
38687
|
result: {
|
|
38342
38688
|
Success: false,
|
|
38343
38689
|
Results: [],
|
|
@@ -38351,11 +38697,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38351
38697
|
cacheMiss: false
|
|
38352
38698
|
});
|
|
38353
38699
|
case 13:
|
|
38354
|
-
return
|
|
38700
|
+
return _context16.a(2);
|
|
38355
38701
|
}
|
|
38356
|
-
},
|
|
38702
|
+
}, _callee16, this);
|
|
38357
38703
|
}));
|
|
38358
|
-
function processSingleSmartCacheResult(
|
|
38704
|
+
function processSingleSmartCacheResult(_x35, _x36, _x37, _x38) {
|
|
38359
38705
|
return _processSingleSmartCacheResult.apply(this, arguments);
|
|
38360
38706
|
}
|
|
38361
38707
|
return processSingleSmartCacheResult;
|
|
@@ -38371,10 +38717,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38371
38717
|
}, {
|
|
38372
38718
|
key: "PreRunQuery",
|
|
38373
38719
|
value: (function () {
|
|
38374
|
-
var _PreRunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38720
|
+
var _PreRunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee17(params, contextUser) {
|
|
38375
38721
|
var telemetryEventId;
|
|
38376
|
-
return providerBase_regenerator().w(function (
|
|
38377
|
-
while (1) switch (
|
|
38722
|
+
return providerBase_regenerator().w(function (_context17) {
|
|
38723
|
+
while (1) switch (_context17.n) {
|
|
38378
38724
|
case 0:
|
|
38379
38725
|
// Start telemetry tracking
|
|
38380
38726
|
telemetryEventId = TelemetryManager.Instance.StartEvent('RunQuery', 'ProviderBase.RunQuery', {
|
|
@@ -38387,7 +38733,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38387
38733
|
HasParameters: params.Parameters ? Object.keys(params.Parameters).length > 0 : false
|
|
38388
38734
|
}, contextUser === null || contextUser === void 0 ? void 0 : contextUser.ID); // Query caching is handled internally by the provider's query cache mechanism
|
|
38389
38735
|
// We just return the telemetry info here - actual cache check happens in InternalRunQuery
|
|
38390
|
-
return
|
|
38736
|
+
return _context17.a(2, {
|
|
38391
38737
|
telemetryEventId: telemetryEventId,
|
|
38392
38738
|
cacheStatus: 'disabled',
|
|
38393
38739
|
// Query caching is handled differently
|
|
@@ -38395,9 +38741,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38395
38741
|
fingerprint: undefined
|
|
38396
38742
|
});
|
|
38397
38743
|
}
|
|
38398
|
-
},
|
|
38744
|
+
}, _callee17);
|
|
38399
38745
|
}));
|
|
38400
|
-
function PreRunQuery(
|
|
38746
|
+
function PreRunQuery(_x39, _x40) {
|
|
38401
38747
|
return _PreRunQuery.apply(this, arguments);
|
|
38402
38748
|
}
|
|
38403
38749
|
return PreRunQuery;
|
|
@@ -38413,10 +38759,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38413
38759
|
}, {
|
|
38414
38760
|
key: "PreRunQueries",
|
|
38415
38761
|
value: (function () {
|
|
38416
|
-
var _PreRunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38762
|
+
var _PreRunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee18(params, contextUser) {
|
|
38417
38763
|
var telemetryEventId;
|
|
38418
|
-
return providerBase_regenerator().w(function (
|
|
38419
|
-
while (1) switch (
|
|
38764
|
+
return providerBase_regenerator().w(function (_context18) {
|
|
38765
|
+
while (1) switch (_context18.n) {
|
|
38420
38766
|
case 0:
|
|
38421
38767
|
// Start telemetry tracking for batch operation
|
|
38422
38768
|
telemetryEventId = TelemetryManager.Instance.StartEvent('RunQuery', 'ProviderBase.RunQueries', {
|
|
@@ -38425,7 +38771,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38425
38771
|
return p.QueryName || p.QueryID;
|
|
38426
38772
|
}).filter(Boolean)
|
|
38427
38773
|
}, contextUser === null || contextUser === void 0 ? void 0 : contextUser.ID); // Query caching is handled internally by each query execution
|
|
38428
|
-
return
|
|
38774
|
+
return _context18.a(2, {
|
|
38429
38775
|
telemetryEventId: telemetryEventId,
|
|
38430
38776
|
allCached: false,
|
|
38431
38777
|
cachedResults: undefined,
|
|
@@ -38433,9 +38779,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38433
38779
|
cacheStatusMap: undefined
|
|
38434
38780
|
});
|
|
38435
38781
|
}
|
|
38436
|
-
},
|
|
38782
|
+
}, _callee18);
|
|
38437
38783
|
}));
|
|
38438
|
-
function PreRunQueries(
|
|
38784
|
+
function PreRunQueries(_x41, _x42) {
|
|
38439
38785
|
return _PreRunQueries.apply(this, arguments);
|
|
38440
38786
|
}
|
|
38441
38787
|
return PreRunQueries;
|
|
@@ -38454,24 +38800,24 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38454
38800
|
}, {
|
|
38455
38801
|
key: "PostRunView",
|
|
38456
38802
|
value: function () {
|
|
38457
|
-
var _PostRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38803
|
+
var _PostRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee19(result, params, preResult, contextUser) {
|
|
38458
38804
|
var maxUpdatedAt, fingerprint, _maxUpdatedAt, _result$Results$lengt, _result$Results;
|
|
38459
|
-
return providerBase_regenerator().w(function (
|
|
38460
|
-
while (1) switch (
|
|
38805
|
+
return providerBase_regenerator().w(function (_context19) {
|
|
38806
|
+
while (1) switch (_context19.n) {
|
|
38461
38807
|
case 0:
|
|
38462
38808
|
if (!(params.CacheLocal && result.Success && preResult.fingerprint && LocalCacheManager.Instance.IsInitialized)) {
|
|
38463
|
-
|
|
38809
|
+
_context19.n = 2;
|
|
38464
38810
|
break;
|
|
38465
38811
|
}
|
|
38466
38812
|
maxUpdatedAt = this.extractMaxUpdatedAt(result.Results);
|
|
38467
|
-
|
|
38468
|
-
return LocalCacheManager.Instance.SetRunViewResult(preResult.fingerprint, params, result.Results, maxUpdatedAt, result.AggregateResults);
|
|
38813
|
+
_context19.n = 1;
|
|
38814
|
+
return LocalCacheManager.Instance.SetRunViewResult(preResult.fingerprint, params, result.Results, maxUpdatedAt, result.AggregateResults, result.TotalRowCount);
|
|
38469
38815
|
case 1:
|
|
38470
|
-
|
|
38816
|
+
_context19.n = 4;
|
|
38471
38817
|
break;
|
|
38472
38818
|
case 2:
|
|
38473
38819
|
if (!this.shouldAutoCache(params, result)) {
|
|
38474
|
-
|
|
38820
|
+
_context19.n = 4;
|
|
38475
38821
|
break;
|
|
38476
38822
|
}
|
|
38477
38823
|
// Server-side auto-cache: small, unfiltered, unsorted results are
|
|
@@ -38479,21 +38825,21 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38479
38825
|
// safe for in-place upsert on entity changes (no filter to evaluate).
|
|
38480
38826
|
fingerprint = preResult.fingerprint || LocalCacheManager.Instance.GenerateRunViewFingerprint(params, this.InstanceConnectionString);
|
|
38481
38827
|
_maxUpdatedAt = this.extractMaxUpdatedAt(result.Results);
|
|
38482
|
-
|
|
38483
|
-
return LocalCacheManager.Instance.SetRunViewResult(fingerprint, params, result.Results, _maxUpdatedAt, result.AggregateResults);
|
|
38828
|
+
_context19.n = 3;
|
|
38829
|
+
return LocalCacheManager.Instance.SetRunViewResult(fingerprint, params, result.Results, _maxUpdatedAt, result.AggregateResults, result.TotalRowCount);
|
|
38484
38830
|
case 3:
|
|
38485
38831
|
LogStatusEx({
|
|
38486
38832
|
message: " \uD83D\uDCE6 [Auto-Cache] RunView \"".concat(params.EntityName || params.ViewName || 'unknown', "\" \u2014 ").concat(result.Results.length, " rows auto-cached (small + unfiltered)"),
|
|
38487
38833
|
verboseOnly: true
|
|
38488
38834
|
});
|
|
38489
38835
|
case 4:
|
|
38490
|
-
|
|
38836
|
+
_context19.n = 5;
|
|
38491
38837
|
return this.TransformSimpleObjectToEntityObject(params, result, contextUser);
|
|
38492
38838
|
case 5:
|
|
38493
|
-
|
|
38839
|
+
_context19.n = 6;
|
|
38494
38840
|
return this.RunPostRunViewHooks(params, result, contextUser);
|
|
38495
38841
|
case 6:
|
|
38496
|
-
result =
|
|
38842
|
+
result = _context19.v;
|
|
38497
38843
|
// Register OnDataChanged callback if provided and we have a fingerprint
|
|
38498
38844
|
if (params.OnDataChanged && preResult.fingerprint) {
|
|
38499
38845
|
result.Unsubscribe = LocalCacheManager.Instance.RegisterChangeCallback(preResult.fingerprint, params.OnDataChanged);
|
|
@@ -38508,11 +38854,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38508
38854
|
});
|
|
38509
38855
|
}
|
|
38510
38856
|
case 7:
|
|
38511
|
-
return
|
|
38857
|
+
return _context19.a(2);
|
|
38512
38858
|
}
|
|
38513
|
-
},
|
|
38859
|
+
}, _callee19, this);
|
|
38514
38860
|
}));
|
|
38515
|
-
function PostRunView(
|
|
38861
|
+
function PostRunView(_x43, _x44, _x45, _x46) {
|
|
38516
38862
|
return _PostRunView.apply(this, arguments);
|
|
38517
38863
|
}
|
|
38518
38864
|
return PostRunView;
|
|
@@ -38528,10 +38874,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38528
38874
|
}, {
|
|
38529
38875
|
key: "PostRunViews",
|
|
38530
38876
|
value: (function () {
|
|
38531
|
-
var _PostRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38877
|
+
var _PostRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee20(results, params, preResult, contextUser) {
|
|
38532
38878
|
var cachePromises, i, _preResult$cacheStatu, cacheInfo, fingerprint, maxUpdatedAt, _maxUpdatedAt2, transformPromises, _i3, _preResult$cacheStatu2, _cacheInfo, _i4, totalResults, cachedCount;
|
|
38533
|
-
return providerBase_regenerator().w(function (
|
|
38534
|
-
while (1) switch (
|
|
38879
|
+
return providerBase_regenerator().w(function (_context20) {
|
|
38880
|
+
while (1) switch (_context20.n) {
|
|
38535
38881
|
case 0:
|
|
38536
38882
|
// Store in local cache BEFORE entity transformation — the cache needs
|
|
38537
38883
|
// plain JSON-serializable objects. BaseEntity objects contain RxJS Subjects
|
|
@@ -38540,25 +38886,25 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38540
38886
|
i = 0;
|
|
38541
38887
|
case 1:
|
|
38542
38888
|
if (!(i < results.length)) {
|
|
38543
|
-
|
|
38889
|
+
_context20.n = 4;
|
|
38544
38890
|
break;
|
|
38545
38891
|
}
|
|
38546
38892
|
// Skip results that came from cache hits — they're already cached and
|
|
38547
38893
|
// already transformed to entity objects (would break JSON.stringify).
|
|
38548
38894
|
cacheInfo = (_preResult$cacheStatu = preResult.cacheStatusMap) === null || _preResult$cacheStatu === void 0 ? void 0 : _preResult$cacheStatu.get(i);
|
|
38549
38895
|
if (!((cacheInfo === null || cacheInfo === void 0 ? void 0 : cacheInfo.status) === 'hit')) {
|
|
38550
|
-
|
|
38896
|
+
_context20.n = 2;
|
|
38551
38897
|
break;
|
|
38552
38898
|
}
|
|
38553
|
-
return
|
|
38899
|
+
return _context20.a(3, 3);
|
|
38554
38900
|
case 2:
|
|
38555
38901
|
fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(params[i], this.InstanceConnectionString);
|
|
38556
38902
|
if (params[i].CacheLocal && results[i].Success && LocalCacheManager.Instance.IsInitialized) {
|
|
38557
38903
|
maxUpdatedAt = this.extractMaxUpdatedAt(results[i].Results);
|
|
38558
|
-
cachePromises.push(LocalCacheManager.Instance.SetRunViewResult(fingerprint, params[i], results[i].Results, maxUpdatedAt, results[i].AggregateResults));
|
|
38904
|
+
cachePromises.push(LocalCacheManager.Instance.SetRunViewResult(fingerprint, params[i], results[i].Results, maxUpdatedAt, results[i].AggregateResults, results[i].TotalRowCount));
|
|
38559
38905
|
} else if (this.shouldAutoCache(params[i], results[i])) {
|
|
38560
38906
|
_maxUpdatedAt2 = this.extractMaxUpdatedAt(results[i].Results);
|
|
38561
|
-
cachePromises.push(LocalCacheManager.Instance.SetRunViewResult(fingerprint, params[i], results[i].Results, _maxUpdatedAt2, results[i].AggregateResults));
|
|
38907
|
+
cachePromises.push(LocalCacheManager.Instance.SetRunViewResult(fingerprint, params[i], results[i].Results, _maxUpdatedAt2, results[i].AggregateResults, results[i].TotalRowCount));
|
|
38562
38908
|
LogStatusEx({
|
|
38563
38909
|
message: " \uD83D\uDCE6 [Auto-Cache] RunViews \"".concat(params[i].EntityName || params[i].ViewName || 'unknown', "\" \u2014 ").concat(results[i].Results.length, " rows auto-cached (small + unfiltered)"),
|
|
38564
38910
|
verboseOnly: true
|
|
@@ -38570,10 +38916,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38570
38916
|
}
|
|
38571
38917
|
case 3:
|
|
38572
38918
|
i++;
|
|
38573
|
-
|
|
38919
|
+
_context20.n = 1;
|
|
38574
38920
|
break;
|
|
38575
38921
|
case 4:
|
|
38576
|
-
|
|
38922
|
+
_context20.n = 5;
|
|
38577
38923
|
return Promise.all(cachePromises);
|
|
38578
38924
|
case 5:
|
|
38579
38925
|
// Transform results to entity objects AFTER caching plain objects.
|
|
@@ -38582,38 +38928,38 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38582
38928
|
_i3 = 0;
|
|
38583
38929
|
case 6:
|
|
38584
38930
|
if (!(_i3 < results.length)) {
|
|
38585
|
-
|
|
38931
|
+
_context20.n = 9;
|
|
38586
38932
|
break;
|
|
38587
38933
|
}
|
|
38588
38934
|
_cacheInfo = (_preResult$cacheStatu2 = preResult.cacheStatusMap) === null || _preResult$cacheStatu2 === void 0 ? void 0 : _preResult$cacheStatu2.get(_i3);
|
|
38589
38935
|
if (!((_cacheInfo === null || _cacheInfo === void 0 ? void 0 : _cacheInfo.status) === 'hit')) {
|
|
38590
|
-
|
|
38936
|
+
_context20.n = 7;
|
|
38591
38937
|
break;
|
|
38592
38938
|
}
|
|
38593
|
-
return
|
|
38939
|
+
return _context20.a(3, 8);
|
|
38594
38940
|
case 7:
|
|
38595
38941
|
transformPromises.push(this.TransformSimpleObjectToEntityObject(params[_i3], results[_i3], contextUser));
|
|
38596
38942
|
case 8:
|
|
38597
38943
|
_i3++;
|
|
38598
|
-
|
|
38944
|
+
_context20.n = 6;
|
|
38599
38945
|
break;
|
|
38600
38946
|
case 9:
|
|
38601
|
-
|
|
38947
|
+
_context20.n = 10;
|
|
38602
38948
|
return Promise.all(transformPromises);
|
|
38603
38949
|
case 10:
|
|
38604
38950
|
_i4 = 0;
|
|
38605
38951
|
case 11:
|
|
38606
38952
|
if (!(_i4 < results.length)) {
|
|
38607
|
-
|
|
38953
|
+
_context20.n = 14;
|
|
38608
38954
|
break;
|
|
38609
38955
|
}
|
|
38610
|
-
|
|
38956
|
+
_context20.n = 12;
|
|
38611
38957
|
return this.RunPostRunViewHooks(params[_i4], results[_i4], contextUser);
|
|
38612
38958
|
case 12:
|
|
38613
|
-
results[_i4] =
|
|
38959
|
+
results[_i4] = _context20.v;
|
|
38614
38960
|
case 13:
|
|
38615
38961
|
_i4++;
|
|
38616
|
-
|
|
38962
|
+
_context20.n = 11;
|
|
38617
38963
|
break;
|
|
38618
38964
|
case 14:
|
|
38619
38965
|
// End telemetry tracking with batch info
|
|
@@ -38635,11 +38981,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38635
38981
|
});
|
|
38636
38982
|
}
|
|
38637
38983
|
case 15:
|
|
38638
|
-
return
|
|
38984
|
+
return _context20.a(2);
|
|
38639
38985
|
}
|
|
38640
|
-
},
|
|
38986
|
+
}, _callee20, this);
|
|
38641
38987
|
}));
|
|
38642
|
-
function PostRunViews(
|
|
38988
|
+
function PostRunViews(_x47, _x48, _x49, _x50) {
|
|
38643
38989
|
return _PostRunViews.apply(this, arguments);
|
|
38644
38990
|
}
|
|
38645
38991
|
return PostRunViews;
|
|
@@ -38652,45 +38998,45 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38652
38998
|
}, {
|
|
38653
38999
|
key: "RunPreRunViewHooks",
|
|
38654
39000
|
value: (function () {
|
|
38655
|
-
var _RunPreRunViewHooks = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38656
|
-
var hooks,
|
|
38657
|
-
return providerBase_regenerator().w(function (
|
|
38658
|
-
while (1) switch (
|
|
39001
|
+
var _RunPreRunViewHooks = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee21(params, contextUser) {
|
|
39002
|
+
var hooks, _iterator0, _step0, hook, _t6;
|
|
39003
|
+
return providerBase_regenerator().w(function (_context21) {
|
|
39004
|
+
while (1) switch (_context21.p = _context21.n) {
|
|
38659
39005
|
case 0:
|
|
38660
39006
|
hooks = GetDataHooks('PreRunView');
|
|
38661
|
-
|
|
38662
|
-
|
|
38663
|
-
|
|
39007
|
+
_iterator0 = providerBase_createForOfIteratorHelper(hooks);
|
|
39008
|
+
_context21.p = 1;
|
|
39009
|
+
_iterator0.s();
|
|
38664
39010
|
case 2:
|
|
38665
|
-
if ((
|
|
38666
|
-
|
|
39011
|
+
if ((_step0 = _iterator0.n()).done) {
|
|
39012
|
+
_context21.n = 5;
|
|
38667
39013
|
break;
|
|
38668
39014
|
}
|
|
38669
|
-
hook =
|
|
38670
|
-
|
|
39015
|
+
hook = _step0.value;
|
|
39016
|
+
_context21.n = 3;
|
|
38671
39017
|
return hook(params, contextUser);
|
|
38672
39018
|
case 3:
|
|
38673
|
-
params =
|
|
39019
|
+
params = _context21.v;
|
|
38674
39020
|
case 4:
|
|
38675
|
-
|
|
39021
|
+
_context21.n = 2;
|
|
38676
39022
|
break;
|
|
38677
39023
|
case 5:
|
|
38678
|
-
|
|
39024
|
+
_context21.n = 7;
|
|
38679
39025
|
break;
|
|
38680
39026
|
case 6:
|
|
38681
|
-
|
|
38682
|
-
|
|
38683
|
-
|
|
39027
|
+
_context21.p = 6;
|
|
39028
|
+
_t6 = _context21.v;
|
|
39029
|
+
_iterator0.e(_t6);
|
|
38684
39030
|
case 7:
|
|
38685
|
-
|
|
38686
|
-
|
|
38687
|
-
return
|
|
39031
|
+
_context21.p = 7;
|
|
39032
|
+
_iterator0.f();
|
|
39033
|
+
return _context21.f(7);
|
|
38688
39034
|
case 8:
|
|
38689
|
-
return
|
|
39035
|
+
return _context21.a(2, params);
|
|
38690
39036
|
}
|
|
38691
|
-
},
|
|
39037
|
+
}, _callee21, null, [[1, 6, 7, 8]]);
|
|
38692
39038
|
}));
|
|
38693
|
-
function RunPreRunViewHooks(
|
|
39039
|
+
function RunPreRunViewHooks(_x51, _x52) {
|
|
38694
39040
|
return _RunPreRunViewHooks.apply(this, arguments);
|
|
38695
39041
|
}
|
|
38696
39042
|
return RunPreRunViewHooks;
|
|
@@ -38703,45 +39049,45 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38703
39049
|
}, {
|
|
38704
39050
|
key: "RunPostRunViewHooks",
|
|
38705
39051
|
value: (function () {
|
|
38706
|
-
var _RunPostRunViewHooks = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
38707
|
-
var hooks,
|
|
38708
|
-
return providerBase_regenerator().w(function (
|
|
38709
|
-
while (1) switch (
|
|
39052
|
+
var _RunPostRunViewHooks = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee22(params, result, contextUser) {
|
|
39053
|
+
var hooks, _iterator1, _step1, hook, _t7;
|
|
39054
|
+
return providerBase_regenerator().w(function (_context22) {
|
|
39055
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
38710
39056
|
case 0:
|
|
38711
39057
|
hooks = GetDataHooks('PostRunView');
|
|
38712
|
-
|
|
38713
|
-
|
|
38714
|
-
|
|
39058
|
+
_iterator1 = providerBase_createForOfIteratorHelper(hooks);
|
|
39059
|
+
_context22.p = 1;
|
|
39060
|
+
_iterator1.s();
|
|
38715
39061
|
case 2:
|
|
38716
|
-
if ((
|
|
38717
|
-
|
|
39062
|
+
if ((_step1 = _iterator1.n()).done) {
|
|
39063
|
+
_context22.n = 5;
|
|
38718
39064
|
break;
|
|
38719
39065
|
}
|
|
38720
|
-
hook =
|
|
38721
|
-
|
|
39066
|
+
hook = _step1.value;
|
|
39067
|
+
_context22.n = 3;
|
|
38722
39068
|
return hook(params, result, contextUser);
|
|
38723
39069
|
case 3:
|
|
38724
|
-
result =
|
|
39070
|
+
result = _context22.v;
|
|
38725
39071
|
case 4:
|
|
38726
|
-
|
|
39072
|
+
_context22.n = 2;
|
|
38727
39073
|
break;
|
|
38728
39074
|
case 5:
|
|
38729
|
-
|
|
39075
|
+
_context22.n = 7;
|
|
38730
39076
|
break;
|
|
38731
39077
|
case 6:
|
|
38732
|
-
|
|
38733
|
-
|
|
38734
|
-
|
|
39078
|
+
_context22.p = 6;
|
|
39079
|
+
_t7 = _context22.v;
|
|
39080
|
+
_iterator1.e(_t7);
|
|
38735
39081
|
case 7:
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
return
|
|
39082
|
+
_context22.p = 7;
|
|
39083
|
+
_iterator1.f();
|
|
39084
|
+
return _context22.f(7);
|
|
38739
39085
|
case 8:
|
|
38740
|
-
return
|
|
39086
|
+
return _context22.a(2, result);
|
|
38741
39087
|
}
|
|
38742
|
-
},
|
|
39088
|
+
}, _callee22, null, [[1, 6, 7, 8]]);
|
|
38743
39089
|
}));
|
|
38744
|
-
function RunPostRunViewHooks(
|
|
39090
|
+
function RunPostRunViewHooks(_x53, _x54, _x55) {
|
|
38745
39091
|
return _RunPostRunViewHooks.apply(this, arguments);
|
|
38746
39092
|
}
|
|
38747
39093
|
return RunPostRunViewHooks;
|
|
@@ -38758,10 +39104,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38758
39104
|
}, {
|
|
38759
39105
|
key: "PostRunQuery",
|
|
38760
39106
|
value: (function () {
|
|
38761
|
-
var _PostRunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39107
|
+
var _PostRunQuery = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee23(result, params, preResult, contextUser) {
|
|
38762
39108
|
var _result$Results$lengt2, _result$Results2;
|
|
38763
|
-
return providerBase_regenerator().w(function (
|
|
38764
|
-
while (1) switch (
|
|
39109
|
+
return providerBase_regenerator().w(function (_context23) {
|
|
39110
|
+
while (1) switch (_context23.n) {
|
|
38765
39111
|
case 0:
|
|
38766
39112
|
// Query caching is handled internally by the provider
|
|
38767
39113
|
// End telemetry tracking with cache miss info
|
|
@@ -38774,11 +39120,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38774
39120
|
});
|
|
38775
39121
|
}
|
|
38776
39122
|
case 1:
|
|
38777
|
-
return
|
|
39123
|
+
return _context23.a(2);
|
|
38778
39124
|
}
|
|
38779
|
-
},
|
|
39125
|
+
}, _callee23);
|
|
38780
39126
|
}));
|
|
38781
|
-
function PostRunQuery(
|
|
39127
|
+
function PostRunQuery(_x56, _x57, _x58, _x59) {
|
|
38782
39128
|
return _PostRunQuery.apply(this, arguments);
|
|
38783
39129
|
}
|
|
38784
39130
|
return PostRunQuery;
|
|
@@ -38795,10 +39141,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38795
39141
|
}, {
|
|
38796
39142
|
key: "PostRunQueries",
|
|
38797
39143
|
value: (function () {
|
|
38798
|
-
var _PostRunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39144
|
+
var _PostRunQueries = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee24(results, params, preResult, contextUser) {
|
|
38799
39145
|
var totalResults, cachedCount;
|
|
38800
|
-
return providerBase_regenerator().w(function (
|
|
38801
|
-
while (1) switch (
|
|
39146
|
+
return providerBase_regenerator().w(function (_context24) {
|
|
39147
|
+
while (1) switch (_context24.n) {
|
|
38802
39148
|
case 0:
|
|
38803
39149
|
// Query caching is handled internally by each query execution
|
|
38804
39150
|
// End telemetry tracking with batch info
|
|
@@ -38820,11 +39166,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38820
39166
|
});
|
|
38821
39167
|
}
|
|
38822
39168
|
case 1:
|
|
38823
|
-
return
|
|
39169
|
+
return _context24.a(2);
|
|
38824
39170
|
}
|
|
38825
|
-
},
|
|
39171
|
+
}, _callee24);
|
|
38826
39172
|
}));
|
|
38827
|
-
function PostRunQueries(
|
|
39173
|
+
function PostRunQueries(_x60, _x61, _x62, _x63) {
|
|
38828
39174
|
return _PostRunQueries.apply(this, arguments);
|
|
38829
39175
|
}
|
|
38830
39176
|
return PostRunQueries;
|
|
@@ -38874,11 +39220,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38874
39220
|
key: "extractMaxUpdatedAt",
|
|
38875
39221
|
value: function extractMaxUpdatedAt(results) {
|
|
38876
39222
|
var maxDate = null;
|
|
38877
|
-
var
|
|
38878
|
-
|
|
39223
|
+
var _iterator10 = providerBase_createForOfIteratorHelper(results),
|
|
39224
|
+
_step10;
|
|
38879
39225
|
try {
|
|
38880
|
-
for (
|
|
38881
|
-
var item =
|
|
39226
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
39227
|
+
var item = _step10.value;
|
|
38882
39228
|
if (item && providerBase_typeof(item) === 'object') {
|
|
38883
39229
|
var record = item;
|
|
38884
39230
|
// Check for __mj_UpdatedAt field (standard MJ timestamp field)
|
|
@@ -38892,9 +39238,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38892
39238
|
}
|
|
38893
39239
|
}
|
|
38894
39240
|
} catch (err) {
|
|
38895
|
-
|
|
39241
|
+
_iterator10.e(err);
|
|
38896
39242
|
} finally {
|
|
38897
|
-
|
|
39243
|
+
_iterator10.f();
|
|
38898
39244
|
}
|
|
38899
39245
|
return maxDate ? maxDate.toISOString() : new Date().toISOString();
|
|
38900
39246
|
}
|
|
@@ -38955,10 +39301,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38955
39301
|
}, {
|
|
38956
39302
|
key: "PreProcessRunView",
|
|
38957
39303
|
value: function () {
|
|
38958
|
-
var _PreProcessRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39304
|
+
var _PreProcessRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee25(params, contextUser) {
|
|
38959
39305
|
var eventId, entity;
|
|
38960
|
-
return providerBase_regenerator().w(function (
|
|
38961
|
-
while (1) switch (
|
|
39306
|
+
return providerBase_regenerator().w(function (_context25) {
|
|
39307
|
+
while (1) switch (_context25.n) {
|
|
38962
39308
|
case 0:
|
|
38963
39309
|
// Start telemetry tracking
|
|
38964
39310
|
// Resolve PlatformSQL values before telemetry
|
|
@@ -38975,17 +39321,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38975
39321
|
_fromEngine: params._fromEngine
|
|
38976
39322
|
}, contextUser === null || contextUser === void 0 ? void 0 : contextUser.ID); // Store on params object for retrieval in PostProcessRunView
|
|
38977
39323
|
params._telemetryEventId = eventId;
|
|
38978
|
-
|
|
39324
|
+
_context25.n = 1;
|
|
38979
39325
|
return this.EntityStatusCheck(params, 'PreProcessRunView');
|
|
38980
39326
|
case 1:
|
|
38981
39327
|
if (!(params.ResultType === 'entity_object')) {
|
|
38982
|
-
|
|
39328
|
+
_context25.n = 3;
|
|
38983
39329
|
break;
|
|
38984
39330
|
}
|
|
38985
39331
|
// we need to get the entity definition and then get all the fields for it
|
|
38986
39332
|
entity = this.EntityByName(params.EntityName);
|
|
38987
39333
|
if (entity) {
|
|
38988
|
-
|
|
39334
|
+
_context25.n = 2;
|
|
38989
39335
|
break;
|
|
38990
39336
|
}
|
|
38991
39337
|
throw new Error("Entity ".concat(params.EntityName, " not found in metadata"));
|
|
@@ -38994,11 +39340,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
38994
39340
|
return f.Name;
|
|
38995
39341
|
}); // just override whatever was passed in with all the fields - or if nothing was passed in, we set it. For loading the entity object, we need ALL the fields.
|
|
38996
39342
|
case 3:
|
|
38997
|
-
return
|
|
39343
|
+
return _context25.a(2);
|
|
38998
39344
|
}
|
|
38999
|
-
},
|
|
39345
|
+
}, _callee25, this);
|
|
39000
39346
|
}));
|
|
39001
|
-
function PreProcessRunView(
|
|
39347
|
+
function PreProcessRunView(_x64, _x65) {
|
|
39002
39348
|
return _PreProcessRunView.apply(this, arguments);
|
|
39003
39349
|
}
|
|
39004
39350
|
return PreProcessRunView;
|
|
@@ -39012,12 +39358,12 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39012
39358
|
}, {
|
|
39013
39359
|
key: "PostProcessRunView",
|
|
39014
39360
|
value: (function () {
|
|
39015
|
-
var _PostProcessRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39361
|
+
var _PostProcessRunView = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee26(result, params, contextUser) {
|
|
39016
39362
|
var eventId;
|
|
39017
|
-
return providerBase_regenerator().w(function (
|
|
39018
|
-
while (1) switch (
|
|
39363
|
+
return providerBase_regenerator().w(function (_context26) {
|
|
39364
|
+
while (1) switch (_context26.n) {
|
|
39019
39365
|
case 0:
|
|
39020
|
-
|
|
39366
|
+
_context26.n = 1;
|
|
39021
39367
|
return this.TransformSimpleObjectToEntityObject(params, result, contextUser);
|
|
39022
39368
|
case 1:
|
|
39023
39369
|
// End telemetry tracking
|
|
@@ -39027,11 +39373,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39027
39373
|
delete params._telemetryEventId;
|
|
39028
39374
|
}
|
|
39029
39375
|
case 2:
|
|
39030
|
-
return
|
|
39376
|
+
return _context26.a(2);
|
|
39031
39377
|
}
|
|
39032
|
-
},
|
|
39378
|
+
}, _callee26, this);
|
|
39033
39379
|
}));
|
|
39034
|
-
function PostProcessRunView(
|
|
39380
|
+
function PostProcessRunView(_x66, _x67, _x68) {
|
|
39035
39381
|
return _PostProcessRunView.apply(this, arguments);
|
|
39036
39382
|
}
|
|
39037
39383
|
return PostProcessRunView;
|
|
@@ -39047,10 +39393,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39047
39393
|
}, {
|
|
39048
39394
|
key: "PreProcessRunViews",
|
|
39049
39395
|
value: (function () {
|
|
39050
|
-
var _PreProcessRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39051
|
-
var fromEngine, eventId,
|
|
39052
|
-
return providerBase_regenerator().w(function (
|
|
39053
|
-
while (1) switch (
|
|
39396
|
+
var _PreProcessRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee27(params, contextUser) {
|
|
39397
|
+
var fromEngine, eventId, _iterator11, _step11, param, entity, _t8;
|
|
39398
|
+
return providerBase_regenerator().w(function (_context27) {
|
|
39399
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
39054
39400
|
case 0:
|
|
39055
39401
|
// Start telemetry tracking for batch operation
|
|
39056
39402
|
fromEngine = params.some(function (p) {
|
|
@@ -39067,29 +39413,29 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39067
39413
|
params[0]._telemetryBatchEventId = eventId;
|
|
39068
39414
|
}
|
|
39069
39415
|
if (!(params && params.length > 0)) {
|
|
39070
|
-
|
|
39416
|
+
_context27.n = 8;
|
|
39071
39417
|
break;
|
|
39072
39418
|
}
|
|
39073
|
-
|
|
39074
|
-
|
|
39075
|
-
|
|
39419
|
+
_iterator11 = providerBase_createForOfIteratorHelper(params);
|
|
39420
|
+
_context27.p = 1;
|
|
39421
|
+
_iterator11.s();
|
|
39076
39422
|
case 2:
|
|
39077
|
-
if ((
|
|
39078
|
-
|
|
39423
|
+
if ((_step11 = _iterator11.n()).done) {
|
|
39424
|
+
_context27.n = 5;
|
|
39079
39425
|
break;
|
|
39080
39426
|
}
|
|
39081
|
-
param =
|
|
39427
|
+
param = _step11.value;
|
|
39082
39428
|
this.EntityStatusCheck(param, 'PreProcessRunViews');
|
|
39083
39429
|
// FIRST, if the resultType is entity_object, we need to run the view with ALL fields in the entity
|
|
39084
39430
|
// so that we can get the data to populate the entity object with.
|
|
39085
39431
|
if (!(param.ResultType === 'entity_object')) {
|
|
39086
|
-
|
|
39432
|
+
_context27.n = 4;
|
|
39087
39433
|
break;
|
|
39088
39434
|
}
|
|
39089
39435
|
// we need to get the entity definition and then get all the fields for it
|
|
39090
39436
|
entity = this.EntityByName(param.EntityName);
|
|
39091
39437
|
if (entity) {
|
|
39092
|
-
|
|
39438
|
+
_context27.n = 3;
|
|
39093
39439
|
break;
|
|
39094
39440
|
}
|
|
39095
39441
|
throw new Error("Entity ".concat(param.EntityName, " not found in metadata"));
|
|
@@ -39098,25 +39444,25 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39098
39444
|
return f.Name;
|
|
39099
39445
|
}); // just override whatever was passed in with all the fields - or if nothing was passed in, we set it. For loading the entity object, we need ALL the fields.
|
|
39100
39446
|
case 4:
|
|
39101
|
-
|
|
39447
|
+
_context27.n = 2;
|
|
39102
39448
|
break;
|
|
39103
39449
|
case 5:
|
|
39104
|
-
|
|
39450
|
+
_context27.n = 7;
|
|
39105
39451
|
break;
|
|
39106
39452
|
case 6:
|
|
39107
|
-
|
|
39108
|
-
|
|
39109
|
-
|
|
39453
|
+
_context27.p = 6;
|
|
39454
|
+
_t8 = _context27.v;
|
|
39455
|
+
_iterator11.e(_t8);
|
|
39110
39456
|
case 7:
|
|
39111
|
-
|
|
39112
|
-
|
|
39113
|
-
return
|
|
39457
|
+
_context27.p = 7;
|
|
39458
|
+
_iterator11.f();
|
|
39459
|
+
return _context27.f(7);
|
|
39114
39460
|
case 8:
|
|
39115
|
-
return
|
|
39461
|
+
return _context27.a(2);
|
|
39116
39462
|
}
|
|
39117
|
-
},
|
|
39463
|
+
}, _callee27, this, [[1, 6, 7, 8]]);
|
|
39118
39464
|
}));
|
|
39119
|
-
function PreProcessRunViews(
|
|
39465
|
+
function PreProcessRunViews(_x69, _x70) {
|
|
39120
39466
|
return _PreProcessRunViews.apply(this, arguments);
|
|
39121
39467
|
}
|
|
39122
39468
|
return PreProcessRunViews;
|
|
@@ -39133,13 +39479,13 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39133
39479
|
}, {
|
|
39134
39480
|
key: "PostProcessRunViews",
|
|
39135
39481
|
value: (function () {
|
|
39136
|
-
var _PostProcessRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function
|
|
39482
|
+
var _PostProcessRunViews = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee28(results, params, contextUser) {
|
|
39137
39483
|
var promises, i, eventId;
|
|
39138
|
-
return providerBase_regenerator().w(function (
|
|
39139
|
-
while (1) switch (
|
|
39484
|
+
return providerBase_regenerator().w(function (_context28) {
|
|
39485
|
+
while (1) switch (_context28.n) {
|
|
39140
39486
|
case 0:
|
|
39141
39487
|
if (!(params && params.length > 0)) {
|
|
39142
|
-
|
|
39488
|
+
_context28.n = 2;
|
|
39143
39489
|
break;
|
|
39144
39490
|
}
|
|
39145
39491
|
promises = [];
|
|
@@ -39147,7 +39493,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39147
39493
|
promises.push(this.TransformSimpleObjectToEntityObject(params[i], results[i], contextUser));
|
|
39148
39494
|
}
|
|
39149
39495
|
// await the promises for all transformations
|
|
39150
|
-
|
|
39496
|
+
_context28.n = 1;
|
|
39151
39497
|
return Promise.all(promises);
|
|
39152
39498
|
case 1:
|
|
39153
39499
|
// End telemetry tracking for batch operation
|
|
@@ -39157,11 +39503,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39157
39503
|
delete params[0]._telemetryBatchEventId;
|
|
39158
39504
|
}
|
|
39159
39505
|
case 2:
|
|
39160
|
-
return
|
|
39506
|
+
return _context28.a(2);
|
|
39161
39507
|
}
|
|
39162
|
-
},
|
|
39508
|
+
}, _callee28, this);
|
|
39163
39509
|
}));
|
|
39164
|
-
function PostProcessRunViews(
|
|
39510
|
+
function PostProcessRunViews(_x71, _x72, _x73) {
|
|
39165
39511
|
return _PostProcessRunViews.apply(this, arguments);
|
|
39166
39512
|
}
|
|
39167
39513
|
return PostProcessRunViews;
|
|
@@ -39176,10 +39522,8 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39176
39522
|
}, {
|
|
39177
39523
|
key: "TransformSimpleObjectToEntityObject",
|
|
39178
39524
|
value: (function () {
|
|
39179
|
-
var
|
|
39180
|
-
var _result$Results4
|
|
39181
|
-
_this6 = this;
|
|
39182
|
-
var entityPromises;
|
|
39525
|
+
var _TransformSimpleObjectToEntityObject2 = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee29(param, result, contextUser) {
|
|
39526
|
+
var _result$Results4;
|
|
39183
39527
|
return providerBase_regenerator().w(function (_context29) {
|
|
39184
39528
|
while (1) switch (_context29.n) {
|
|
39185
39529
|
case 0:
|
|
@@ -39187,48 +39531,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39187
39531
|
_context29.n = 2;
|
|
39188
39532
|
break;
|
|
39189
39533
|
}
|
|
39190
|
-
// we need to transform each of the items in the result set into a BaseEntity-derived object
|
|
39191
|
-
// Create entities and load data in parallel for better performance
|
|
39192
|
-
entityPromises = result.Results.map(/*#__PURE__*/function () {
|
|
39193
|
-
var _ref = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee28(item) {
|
|
39194
|
-
var entity;
|
|
39195
|
-
return providerBase_regenerator().w(function (_context28) {
|
|
39196
|
-
while (1) switch (_context28.n) {
|
|
39197
|
-
case 0:
|
|
39198
|
-
if (!(item instanceof BaseEntity || typeof item.Save === 'function')) {
|
|
39199
|
-
_context28.n = 1;
|
|
39200
|
-
break;
|
|
39201
|
-
}
|
|
39202
|
-
return _context28.a(2, item);
|
|
39203
|
-
case 1:
|
|
39204
|
-
_context28.n = 2;
|
|
39205
|
-
return _this6.GetEntityObject(param.EntityName, contextUser);
|
|
39206
|
-
case 2:
|
|
39207
|
-
entity = _context28.v;
|
|
39208
|
-
_context28.n = 3;
|
|
39209
|
-
return entity.LoadFromData(item);
|
|
39210
|
-
case 3:
|
|
39211
|
-
return _context28.a(2, entity);
|
|
39212
|
-
case 4:
|
|
39213
|
-
return _context28.a(2);
|
|
39214
|
-
}
|
|
39215
|
-
}, _callee28);
|
|
39216
|
-
}));
|
|
39217
|
-
return function (_x75) {
|
|
39218
|
-
return _ref.apply(this, arguments);
|
|
39219
|
-
};
|
|
39220
|
-
}());
|
|
39221
39534
|
_context29.n = 1;
|
|
39222
|
-
return
|
|
39535
|
+
return util_TransformSimpleObjectToEntityObject(this, param.EntityName, result.Results, contextUser);
|
|
39223
39536
|
case 1:
|
|
39224
39537
|
result.Results = _context29.v;
|
|
39225
39538
|
case 2:
|
|
39226
39539
|
return _context29.a(2);
|
|
39227
39540
|
}
|
|
39228
|
-
}, _callee29);
|
|
39541
|
+
}, _callee29, this);
|
|
39229
39542
|
}));
|
|
39230
|
-
function TransformSimpleObjectToEntityObject(
|
|
39231
|
-
return
|
|
39543
|
+
function TransformSimpleObjectToEntityObject(_x74, _x75, _x76) {
|
|
39544
|
+
return _TransformSimpleObjectToEntityObject2.apply(this, arguments);
|
|
39232
39545
|
}
|
|
39233
39546
|
return TransformSimpleObjectToEntityObject;
|
|
39234
39547
|
}()
|
|
@@ -39252,7 +39565,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39252
39565
|
value: (function () {
|
|
39253
39566
|
var _Config = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee30(data, providerToUse) {
|
|
39254
39567
|
var _this$_localMetadata;
|
|
39255
|
-
var storageProvider, hardRefresh, _this$_localMetadata2, start, res, end,
|
|
39568
|
+
var storageProvider, hardRefresh, _this$_localMetadata2, start, res, end, _t9;
|
|
39256
39569
|
return providerBase_regenerator().w(function (_context30) {
|
|
39257
39570
|
while (1) switch (_context30.n) {
|
|
39258
39571
|
case 0:
|
|
@@ -39305,17 +39618,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39305
39618
|
this.backgroundValidateAndRefresh(providerToUse);
|
|
39306
39619
|
return _context30.a(2, true);
|
|
39307
39620
|
case 4:
|
|
39308
|
-
|
|
39309
|
-
if (
|
|
39621
|
+
_t9 = hardRefresh;
|
|
39622
|
+
if (_t9) {
|
|
39310
39623
|
_context30.n = 6;
|
|
39311
39624
|
break;
|
|
39312
39625
|
}
|
|
39313
39626
|
_context30.n = 5;
|
|
39314
39627
|
return this.CheckToSeeIfRefreshNeeded(providerToUse);
|
|
39315
39628
|
case 5:
|
|
39316
|
-
|
|
39629
|
+
_t9 = _context30.v;
|
|
39317
39630
|
case 6:
|
|
39318
|
-
if (!
|
|
39631
|
+
if (!_t9) {
|
|
39319
39632
|
_context30.n = 10;
|
|
39320
39633
|
break;
|
|
39321
39634
|
}
|
|
@@ -39358,7 +39671,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39358
39671
|
}
|
|
39359
39672
|
}, _callee30, this);
|
|
39360
39673
|
}));
|
|
39361
|
-
function Config(
|
|
39674
|
+
function Config(_x77, _x78) {
|
|
39362
39675
|
return _Config.apply(this, arguments);
|
|
39363
39676
|
}
|
|
39364
39677
|
return Config;
|
|
@@ -39374,7 +39687,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39374
39687
|
key: "backgroundValidateAndRefresh",
|
|
39375
39688
|
value: (function () {
|
|
39376
39689
|
var _backgroundValidateAndRefresh = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee31(providerToUse) {
|
|
39377
|
-
var needsRefresh, start, res, elapsed,
|
|
39690
|
+
var needsRefresh, start, res, elapsed, _t0;
|
|
39378
39691
|
return providerBase_regenerator().w(function (_context31) {
|
|
39379
39692
|
while (1) switch (_context31.p = _context31.n) {
|
|
39380
39693
|
case 0:
|
|
@@ -39423,15 +39736,15 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39423
39736
|
break;
|
|
39424
39737
|
case 7:
|
|
39425
39738
|
_context31.p = 7;
|
|
39426
|
-
|
|
39427
|
-
LogError("[Fast-Start] Background validation failed: ".concat(
|
|
39739
|
+
_t0 = _context31.v;
|
|
39740
|
+
LogError("[Fast-Start] Background validation failed: ".concat(_t0));
|
|
39428
39741
|
// Not critical — app continues with cached metadata
|
|
39429
39742
|
case 8:
|
|
39430
39743
|
return _context31.a(2);
|
|
39431
39744
|
}
|
|
39432
39745
|
}, _callee31, this, [[0, 7]]);
|
|
39433
39746
|
}));
|
|
39434
|
-
function backgroundValidateAndRefresh(
|
|
39747
|
+
function backgroundValidateAndRefresh(_x79) {
|
|
39435
39748
|
return _backgroundValidateAndRefresh.apply(this, arguments);
|
|
39436
39749
|
}
|
|
39437
39750
|
return backgroundValidateAndRefresh;
|
|
@@ -39520,8 +39833,8 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39520
39833
|
*/
|
|
39521
39834
|
function () {
|
|
39522
39835
|
var _GetAllMetadata = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee32(providerToUse, forceRefresh) {
|
|
39523
|
-
var
|
|
39524
|
-
var d, simpleMetadata,
|
|
39836
|
+
var _this6 = this;
|
|
39837
|
+
var d, simpleMetadata, _iterator12, _step12, r, returnMetadata, _t1;
|
|
39525
39838
|
return providerBase_regenerator().w(function (_context32) {
|
|
39526
39839
|
while (1) switch (_context32.p = _context32.n) {
|
|
39527
39840
|
case 0:
|
|
@@ -39539,17 +39852,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39539
39852
|
case 2:
|
|
39540
39853
|
// got the results, let's build our response in the format we need
|
|
39541
39854
|
simpleMetadata = {};
|
|
39542
|
-
|
|
39855
|
+
_iterator12 = providerBase_createForOfIteratorHelper(d.Results);
|
|
39543
39856
|
try {
|
|
39544
|
-
for (
|
|
39545
|
-
r =
|
|
39857
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
39858
|
+
r = _step12.value;
|
|
39546
39859
|
simpleMetadata[r.Code] = r.Results;
|
|
39547
39860
|
}
|
|
39548
39861
|
// Post Process Entities because there's some special handling of the sub-objects
|
|
39549
39862
|
} catch (err) {
|
|
39550
|
-
|
|
39863
|
+
_iterator12.e(err);
|
|
39551
39864
|
} finally {
|
|
39552
|
-
|
|
39865
|
+
_iterator12.f();
|
|
39553
39866
|
}
|
|
39554
39867
|
simpleMetadata.AllEntities = this.PostProcessEntityMetadata(simpleMetadata.Entities, simpleMetadata.EntityFields, simpleMetadata.EntityFieldValues, simpleMetadata.EntityPermissions, simpleMetadata.EntityRelationships, simpleMetadata.EntitySettings, simpleMetadata.EntityOrganicKeys, simpleMetadata.EntityOrganicKeyRelatedEntities);
|
|
39555
39868
|
// Post Process the Applications, because we want to handle the sub-objects properly.
|
|
@@ -39560,7 +39873,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39560
39873
|
a.ApplicationSettings = simpleMetadata.ApplicationSettings.filter(function (as) {
|
|
39561
39874
|
return (0,dist/* UUIDsEqual */.jd)(as.ApplicationID, a.ID);
|
|
39562
39875
|
});
|
|
39563
|
-
return new ApplicationInfo(a,
|
|
39876
|
+
return new ApplicationInfo(a, _this6);
|
|
39564
39877
|
});
|
|
39565
39878
|
// now we need to construct our return type. The way the return type works, which is an instance of AllMetadata, we have to
|
|
39566
39879
|
// construst each item so it contains an array of the correct type. This is because the AllMetadata class has an array of each type of metadata
|
|
@@ -39579,14 +39892,14 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39579
39892
|
break;
|
|
39580
39893
|
case 6:
|
|
39581
39894
|
_context32.p = 6;
|
|
39582
|
-
|
|
39583
|
-
LogError(
|
|
39895
|
+
_t1 = _context32.v;
|
|
39896
|
+
LogError(_t1);
|
|
39584
39897
|
case 7:
|
|
39585
39898
|
return _context32.a(2);
|
|
39586
39899
|
}
|
|
39587
39900
|
}, _callee32, this, [[0, 6]]);
|
|
39588
39901
|
}));
|
|
39589
|
-
function GetAllMetadata(
|
|
39902
|
+
function GetAllMetadata(_x80, _x81) {
|
|
39590
39903
|
return _GetAllMetadata.apply(this, arguments);
|
|
39591
39904
|
}
|
|
39592
39905
|
return GetAllMetadata;
|
|
@@ -39613,50 +39926,50 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39613
39926
|
return a.Name.localeCompare(b.Name);
|
|
39614
39927
|
});
|
|
39615
39928
|
if (fieldValues && fieldValues.length > 0) {
|
|
39616
|
-
var
|
|
39617
|
-
|
|
39929
|
+
var _iterator13 = providerBase_createForOfIteratorHelper(fields),
|
|
39930
|
+
_step13;
|
|
39618
39931
|
try {
|
|
39619
|
-
var
|
|
39620
|
-
var f =
|
|
39932
|
+
var _loop3 = function _loop3() {
|
|
39933
|
+
var f = _step13.value;
|
|
39621
39934
|
// populate the field values for each field, if we have them
|
|
39622
39935
|
f.EntityFieldValues = fieldValues.filter(function (fv) {
|
|
39623
39936
|
return (0,dist/* UUIDsEqual */.jd)(fv.EntityFieldID, f.ID);
|
|
39624
39937
|
});
|
|
39625
39938
|
};
|
|
39626
|
-
for (
|
|
39627
|
-
|
|
39939
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
39940
|
+
_loop3();
|
|
39628
39941
|
}
|
|
39629
39942
|
} catch (err) {
|
|
39630
|
-
|
|
39943
|
+
_iterator13.e(err);
|
|
39631
39944
|
} finally {
|
|
39632
|
-
|
|
39945
|
+
_iterator13.f();
|
|
39633
39946
|
}
|
|
39634
39947
|
}
|
|
39635
39948
|
// Link organic key related entities to their parent organic keys
|
|
39636
39949
|
if (organicKeys && organicKeyRelatedEntities && organicKeyRelatedEntities.length > 0) {
|
|
39637
|
-
var
|
|
39638
|
-
|
|
39950
|
+
var _iterator14 = providerBase_createForOfIteratorHelper(organicKeys),
|
|
39951
|
+
_step14;
|
|
39639
39952
|
try {
|
|
39640
|
-
var
|
|
39641
|
-
var ok =
|
|
39953
|
+
var _loop4 = function _loop4() {
|
|
39954
|
+
var ok = _step14.value;
|
|
39642
39955
|
ok.EntityOrganicKeyRelatedEntities = organicKeyRelatedEntities.filter(function (okre) {
|
|
39643
39956
|
return (0,dist/* UUIDsEqual */.jd)(okre.EntityOrganicKeyID, ok.ID);
|
|
39644
39957
|
});
|
|
39645
39958
|
};
|
|
39646
|
-
for (
|
|
39647
|
-
|
|
39959
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
39960
|
+
_loop4();
|
|
39648
39961
|
}
|
|
39649
39962
|
} catch (err) {
|
|
39650
|
-
|
|
39963
|
+
_iterator14.e(err);
|
|
39651
39964
|
} finally {
|
|
39652
|
-
|
|
39965
|
+
_iterator14.f();
|
|
39653
39966
|
}
|
|
39654
39967
|
}
|
|
39655
|
-
var
|
|
39656
|
-
|
|
39968
|
+
var _iterator15 = providerBase_createForOfIteratorHelper(sortedEntities),
|
|
39969
|
+
_step15;
|
|
39657
39970
|
try {
|
|
39658
|
-
var
|
|
39659
|
-
var e =
|
|
39971
|
+
var _loop5 = function _loop5() {
|
|
39972
|
+
var e = _step15.value;
|
|
39660
39973
|
e.EntityFields = fields.filter(function (f) {
|
|
39661
39974
|
return (0,dist/* UUIDsEqual */.jd)(f.EntityID, e.ID);
|
|
39662
39975
|
}).sort(function (a, b) {
|
|
@@ -39679,17 +39992,17 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39679
39992
|
}
|
|
39680
39993
|
result.push(new EntityInfo(e));
|
|
39681
39994
|
};
|
|
39682
|
-
for (
|
|
39683
|
-
|
|
39995
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
39996
|
+
_loop5();
|
|
39684
39997
|
}
|
|
39685
39998
|
// Check for schema name collision: if both 'MJ' and 'MJCustom' schemas exist,
|
|
39686
39999
|
// the class name prefix for 'MJ' is 'MJCustom' which would collide with the
|
|
39687
40000
|
// 'MJCustom' schema's natural prefix. This is an extremely unlikely scenario but
|
|
39688
40001
|
// would cause silent class name collisions that are very hard to debug.
|
|
39689
40002
|
} catch (err) {
|
|
39690
|
-
|
|
40003
|
+
_iterator15.e(err);
|
|
39691
40004
|
} finally {
|
|
39692
|
-
|
|
40005
|
+
_iterator15.f();
|
|
39693
40006
|
}
|
|
39694
40007
|
var distinctSchemas = new Set(result.map(function (e) {
|
|
39695
40008
|
var _e$SchemaName;
|
|
@@ -39938,7 +40251,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39938
40251
|
}
|
|
39939
40252
|
}, _callee33, this);
|
|
39940
40253
|
}));
|
|
39941
|
-
function Refresh(
|
|
40254
|
+
function Refresh(_x82) {
|
|
39942
40255
|
return _Refresh.apply(this, arguments);
|
|
39943
40256
|
}
|
|
39944
40257
|
return Refresh;
|
|
@@ -39985,7 +40298,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
39985
40298
|
}
|
|
39986
40299
|
}, _callee34, this);
|
|
39987
40300
|
}));
|
|
39988
|
-
function CheckToSeeIfRefreshNeeded(
|
|
40301
|
+
function CheckToSeeIfRefreshNeeded(_x83) {
|
|
39989
40302
|
return _CheckToSeeIfRefreshNeeded.apply(this, arguments);
|
|
39990
40303
|
}
|
|
39991
40304
|
return CheckToSeeIfRefreshNeeded;
|
|
@@ -40018,7 +40331,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40018
40331
|
}
|
|
40019
40332
|
}, _callee35, this);
|
|
40020
40333
|
}));
|
|
40021
|
-
function RefreshIfNeeded(
|
|
40334
|
+
function RefreshIfNeeded(_x84) {
|
|
40022
40335
|
return _RefreshIfNeeded.apply(this, arguments);
|
|
40023
40336
|
}
|
|
40024
40337
|
return RefreshIfNeeded;
|
|
@@ -40027,7 +40340,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40027
40340
|
key: "GetEntityObject",
|
|
40028
40341
|
value: function () {
|
|
40029
40342
|
var _GetEntityObject = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee36(entityName, loadKeyOrContextUser, contextUser) {
|
|
40030
|
-
var actualLoadKey, actualContextUser, entity, newObject, loadResult,
|
|
40343
|
+
var actualLoadKey, actualContextUser, entity, newObject, loadResult, _t10, _t11;
|
|
40031
40344
|
return providerBase_regenerator().w(function (_context36) {
|
|
40032
40345
|
while (1) switch (_context36.p = _context36.n) {
|
|
40033
40346
|
case 0:
|
|
@@ -40085,8 +40398,8 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40085
40398
|
return _context36.a(2, newObject);
|
|
40086
40399
|
case 8:
|
|
40087
40400
|
_context36.p = 8;
|
|
40088
|
-
|
|
40089
|
-
LogError(
|
|
40401
|
+
_t10 = _context36.v;
|
|
40402
|
+
LogError(_t10);
|
|
40090
40403
|
throw new Error("Entity ".concat(entityName, " could not be instantiated via MJGlobal Class Factory. Make sure you have registered the class reference with MJGlobal.Instance.ClassFactory.Register(). ALSO, make sure you call LoadGeneratedEntities() from the GeneratedEntities project within your project as tree-shaking sometimes removes subclasses and could be causing this error!"));
|
|
40091
40404
|
case 9:
|
|
40092
40405
|
throw new Error("Entity ".concat(entityName, " not found in metadata"));
|
|
@@ -40095,15 +40408,15 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40095
40408
|
break;
|
|
40096
40409
|
case 11:
|
|
40097
40410
|
_context36.p = 11;
|
|
40098
|
-
|
|
40099
|
-
LogError(
|
|
40411
|
+
_t11 = _context36.v;
|
|
40412
|
+
LogError(_t11);
|
|
40100
40413
|
return _context36.a(2, null);
|
|
40101
40414
|
case 12:
|
|
40102
40415
|
return _context36.a(2);
|
|
40103
40416
|
}
|
|
40104
40417
|
}, _callee36, this, [[1, 8], [0, 11]]);
|
|
40105
40418
|
}));
|
|
40106
|
-
function GetEntityObject(
|
|
40419
|
+
function GetEntityObject(_x85, _x86, _x87) {
|
|
40107
40420
|
return _GetEntityObject.apply(this, arguments);
|
|
40108
40421
|
}
|
|
40109
40422
|
return GetEntityObject;
|
|
@@ -40117,21 +40430,21 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40117
40430
|
key: "GetEntityDependencies",
|
|
40118
40431
|
value: (function () {
|
|
40119
40432
|
var _GetEntityDependencies = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee37(entityName) {
|
|
40120
|
-
var eName, result,
|
|
40433
|
+
var eName, result, _iterator16, _step16, _loop6, _t12, _t13;
|
|
40121
40434
|
return providerBase_regenerator().w(function (_context38) {
|
|
40122
40435
|
while (1) switch (_context38.p = _context38.n) {
|
|
40123
40436
|
case 0:
|
|
40124
40437
|
_context38.p = 0;
|
|
40125
40438
|
eName = entityName.trim().toLowerCase();
|
|
40126
40439
|
result = [];
|
|
40127
|
-
|
|
40440
|
+
_iterator16 = providerBase_createForOfIteratorHelper(this.Entities);
|
|
40128
40441
|
_context38.p = 1;
|
|
40129
|
-
|
|
40442
|
+
_loop6 = /*#__PURE__*/providerBase_regenerator().m(function _loop6() {
|
|
40130
40443
|
var re, relatedFields;
|
|
40131
40444
|
return providerBase_regenerator().w(function (_context37) {
|
|
40132
40445
|
while (1) switch (_context37.n) {
|
|
40133
40446
|
case 0:
|
|
40134
|
-
re =
|
|
40447
|
+
re = _step16.value;
|
|
40135
40448
|
relatedFields = re.Fields.filter(function (f) {
|
|
40136
40449
|
var _f$RelatedEntity;
|
|
40137
40450
|
return ((_f$RelatedEntity = f.RelatedEntity) === null || _f$RelatedEntity === void 0 ? void 0 : _f$RelatedEntity.trim().toLowerCase()) === eName;
|
|
@@ -40146,15 +40459,15 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40146
40459
|
case 1:
|
|
40147
40460
|
return _context37.a(2);
|
|
40148
40461
|
}
|
|
40149
|
-
},
|
|
40462
|
+
}, _loop6);
|
|
40150
40463
|
});
|
|
40151
|
-
|
|
40464
|
+
_iterator16.s();
|
|
40152
40465
|
case 2:
|
|
40153
|
-
if ((
|
|
40466
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
40154
40467
|
_context38.n = 4;
|
|
40155
40468
|
break;
|
|
40156
40469
|
}
|
|
40157
|
-
return _context38.d(providerBase_regeneratorValues(
|
|
40470
|
+
return _context38.d(providerBase_regeneratorValues(_loop6()), 3);
|
|
40158
40471
|
case 3:
|
|
40159
40472
|
_context38.n = 2;
|
|
40160
40473
|
break;
|
|
@@ -40163,25 +40476,25 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40163
40476
|
break;
|
|
40164
40477
|
case 5:
|
|
40165
40478
|
_context38.p = 5;
|
|
40166
|
-
|
|
40167
|
-
|
|
40479
|
+
_t12 = _context38.v;
|
|
40480
|
+
_iterator16.e(_t12);
|
|
40168
40481
|
case 6:
|
|
40169
40482
|
_context38.p = 6;
|
|
40170
|
-
|
|
40483
|
+
_iterator16.f();
|
|
40171
40484
|
return _context38.f(6);
|
|
40172
40485
|
case 7:
|
|
40173
40486
|
return _context38.a(2, result);
|
|
40174
40487
|
case 8:
|
|
40175
40488
|
_context38.p = 8;
|
|
40176
|
-
|
|
40177
|
-
LogError(
|
|
40178
|
-
throw
|
|
40489
|
+
_t13 = _context38.v;
|
|
40490
|
+
LogError(_t13);
|
|
40491
|
+
throw _t13;
|
|
40179
40492
|
case 9:
|
|
40180
40493
|
return _context38.a(2);
|
|
40181
40494
|
}
|
|
40182
40495
|
}, _callee37, this, [[1, 5, 6, 7], [0, 8]]);
|
|
40183
40496
|
}));
|
|
40184
|
-
function GetEntityDependencies(
|
|
40497
|
+
function GetEntityDependencies(_x88) {
|
|
40185
40498
|
return _GetEntityDependencies.apply(this, arguments);
|
|
40186
40499
|
}
|
|
40187
40500
|
return GetEntityDependencies;
|
|
@@ -40252,7 +40565,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40252
40565
|
}
|
|
40253
40566
|
}, _callee38, this);
|
|
40254
40567
|
}));
|
|
40255
|
-
function GetAndCacheDatasetByName(
|
|
40568
|
+
function GetAndCacheDatasetByName(_x89, _x90, _x91, _x92) {
|
|
40256
40569
|
return _GetAndCacheDatasetByName.apply(this, arguments);
|
|
40257
40570
|
}
|
|
40258
40571
|
return GetAndCacheDatasetByName;
|
|
@@ -40293,7 +40606,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40293
40606
|
}
|
|
40294
40607
|
}, _callee39, this);
|
|
40295
40608
|
}));
|
|
40296
|
-
function GetLocalDatasetTimestamp(
|
|
40609
|
+
function GetLocalDatasetTimestamp(_x93, _x94) {
|
|
40297
40610
|
return _GetLocalDatasetTimestamp.apply(this, arguments);
|
|
40298
40611
|
}
|
|
40299
40612
|
return GetLocalDatasetTimestamp;
|
|
@@ -40309,7 +40622,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40309
40622
|
key: "IsDatasetCacheUpToDate",
|
|
40310
40623
|
value: (function () {
|
|
40311
40624
|
var _IsDatasetCacheUpToDate = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee40(datasetName, itemFilters) {
|
|
40312
|
-
var localDate, status, serverTimestamp, localDataset,
|
|
40625
|
+
var localDate, status, serverTimestamp, localDataset, _iterator17, _step17, _loop7, _ret2, _t14;
|
|
40313
40626
|
return providerBase_regenerator().w(function (_context42) {
|
|
40314
40627
|
while (1) switch (_context42.p = _context42.n) {
|
|
40315
40628
|
case 0:
|
|
@@ -40338,14 +40651,14 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40338
40651
|
return this.GetCachedDataset(datasetName, itemFilters);
|
|
40339
40652
|
case 3:
|
|
40340
40653
|
localDataset = _context42.v;
|
|
40341
|
-
|
|
40654
|
+
_iterator17 = providerBase_createForOfIteratorHelper(status.EntityUpdateDates);
|
|
40342
40655
|
_context42.p = 4;
|
|
40343
|
-
|
|
40656
|
+
_loop7 = /*#__PURE__*/providerBase_regenerator().m(function _loop7() {
|
|
40344
40657
|
var eu, localEntity;
|
|
40345
40658
|
return providerBase_regenerator().w(function (_context41) {
|
|
40346
40659
|
while (1) switch (_context41.n) {
|
|
40347
40660
|
case 0:
|
|
40348
|
-
eu =
|
|
40661
|
+
eu = _step17.value;
|
|
40349
40662
|
localEntity = localDataset.Results.find(function (e) {
|
|
40350
40663
|
return (0,dist/* UUIDsEqual */.jd)(e.EntityID, eu.EntityID);
|
|
40351
40664
|
});
|
|
@@ -40359,22 +40672,22 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40359
40672
|
case 1:
|
|
40360
40673
|
return _context41.a(2);
|
|
40361
40674
|
}
|
|
40362
|
-
},
|
|
40675
|
+
}, _loop7);
|
|
40363
40676
|
});
|
|
40364
|
-
|
|
40677
|
+
_iterator17.s();
|
|
40365
40678
|
case 5:
|
|
40366
|
-
if ((
|
|
40679
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
40367
40680
|
_context42.n = 8;
|
|
40368
40681
|
break;
|
|
40369
40682
|
}
|
|
40370
|
-
return _context42.d(providerBase_regeneratorValues(
|
|
40683
|
+
return _context42.d(providerBase_regeneratorValues(_loop7()), 6);
|
|
40371
40684
|
case 6:
|
|
40372
|
-
|
|
40373
|
-
if (!
|
|
40685
|
+
_ret2 = _context42.v;
|
|
40686
|
+
if (!_ret2) {
|
|
40374
40687
|
_context42.n = 7;
|
|
40375
40688
|
break;
|
|
40376
40689
|
}
|
|
40377
|
-
return _context42.a(2,
|
|
40690
|
+
return _context42.a(2, _ret2.v);
|
|
40378
40691
|
case 7:
|
|
40379
40692
|
_context42.n = 5;
|
|
40380
40693
|
break;
|
|
@@ -40383,11 +40696,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40383
40696
|
break;
|
|
40384
40697
|
case 9:
|
|
40385
40698
|
_context42.p = 9;
|
|
40386
|
-
|
|
40387
|
-
|
|
40699
|
+
_t14 = _context42.v;
|
|
40700
|
+
_iterator17.e(_t14);
|
|
40388
40701
|
case 10:
|
|
40389
40702
|
_context42.p = 10;
|
|
40390
|
-
|
|
40703
|
+
_iterator17.f();
|
|
40391
40704
|
return _context42.f(10);
|
|
40392
40705
|
case 11:
|
|
40393
40706
|
return _context42.a(2, true);
|
|
@@ -40408,7 +40721,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40408
40721
|
}
|
|
40409
40722
|
}, _callee40, this, [[4, 9, 10, 11]]);
|
|
40410
40723
|
}));
|
|
40411
|
-
function IsDatasetCacheUpToDate(
|
|
40724
|
+
function IsDatasetCacheUpToDate(_x95, _x96) {
|
|
40412
40725
|
return _IsDatasetCacheUpToDate.apply(this, arguments);
|
|
40413
40726
|
}
|
|
40414
40727
|
return IsDatasetCacheUpToDate;
|
|
@@ -40449,7 +40762,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40449
40762
|
}
|
|
40450
40763
|
}, _callee41, this);
|
|
40451
40764
|
}));
|
|
40452
|
-
function GetCachedDataset(
|
|
40765
|
+
function GetCachedDataset(_x97, _x98) {
|
|
40453
40766
|
return _GetCachedDataset.apply(this, arguments);
|
|
40454
40767
|
}
|
|
40455
40768
|
return GetCachedDataset;
|
|
@@ -40488,7 +40801,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40488
40801
|
}
|
|
40489
40802
|
}, _callee42, this);
|
|
40490
40803
|
}));
|
|
40491
|
-
function CacheDataset(
|
|
40804
|
+
function CacheDataset(_x99, _x100, _x101) {
|
|
40492
40805
|
return _CacheDataset.apply(this, arguments);
|
|
40493
40806
|
}
|
|
40494
40807
|
return CacheDataset;
|
|
@@ -40524,7 +40837,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40524
40837
|
}
|
|
40525
40838
|
}, _callee43, this);
|
|
40526
40839
|
}));
|
|
40527
|
-
function IsDatasetCached(
|
|
40840
|
+
function IsDatasetCached(_x102, _x103) {
|
|
40528
40841
|
return _IsDatasetCached.apply(this, arguments);
|
|
40529
40842
|
}
|
|
40530
40843
|
return IsDatasetCached;
|
|
@@ -40586,7 +40899,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40586
40899
|
}
|
|
40587
40900
|
}, _callee44, this);
|
|
40588
40901
|
}));
|
|
40589
|
-
function ClearDatasetCache(
|
|
40902
|
+
function ClearDatasetCache(_x104, _x105) {
|
|
40590
40903
|
return _ClearDatasetCache.apply(this, arguments);
|
|
40591
40904
|
}
|
|
40592
40905
|
return ClearDatasetCache;
|
|
@@ -40654,7 +40967,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40654
40967
|
}
|
|
40655
40968
|
}, _callee45, this);
|
|
40656
40969
|
}));
|
|
40657
|
-
function GetLatestMetadataUpdates(
|
|
40970
|
+
function GetLatestMetadataUpdates(_x106) {
|
|
40658
40971
|
return _GetLatestMetadataUpdates.apply(this, arguments);
|
|
40659
40972
|
}
|
|
40660
40973
|
return GetLatestMetadataUpdates;
|
|
@@ -40690,7 +41003,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40690
41003
|
}
|
|
40691
41004
|
}, _callee46, this);
|
|
40692
41005
|
}));
|
|
40693
|
-
function RefreshRemoteMetadataTimestamps(
|
|
41006
|
+
function RefreshRemoteMetadataTimestamps(_x107) {
|
|
40694
41007
|
return _RefreshRemoteMetadataTimestamps.apply(this, arguments);
|
|
40695
41008
|
}
|
|
40696
41009
|
return RefreshRemoteMetadataTimestamps;
|
|
@@ -40708,7 +41021,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40708
41021
|
var mdLocal = this.LatestLocalMetadata;
|
|
40709
41022
|
var mdRemote = this.LatestRemoteMetadata;
|
|
40710
41023
|
if (!mdLocal || !mdRemote || !mdLocal.length || !mdRemote.length || mdLocal.length === 0 || mdRemote.length === 0) return true;
|
|
40711
|
-
var
|
|
41024
|
+
var _loop8 = function _loop8(i) {
|
|
40712
41025
|
var bProcess = true;
|
|
40713
41026
|
if (type && type.length > 0) bProcess = mdRemote[i].Type.toLowerCase().trim() === type.trim().toLowerCase();
|
|
40714
41027
|
if (bProcess) {
|
|
@@ -40748,10 +41061,10 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40748
41061
|
}
|
|
40749
41062
|
}
|
|
40750
41063
|
},
|
|
40751
|
-
|
|
41064
|
+
_ret3;
|
|
40752
41065
|
for (var i = 0; i < mdRemote.length; ++i) {
|
|
40753
|
-
|
|
40754
|
-
if (
|
|
41066
|
+
_ret3 = _loop8(i);
|
|
41067
|
+
if (_ret3) return _ret3.v;
|
|
40755
41068
|
}
|
|
40756
41069
|
// if we get here, we're not obsolete!!
|
|
40757
41070
|
return false;
|
|
@@ -40778,18 +41091,18 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40778
41091
|
this._entityMapByName.clear();
|
|
40779
41092
|
this._entityMapByID.clear();
|
|
40780
41093
|
if (entities) {
|
|
40781
|
-
var
|
|
40782
|
-
|
|
41094
|
+
var _iterator18 = providerBase_createForOfIteratorHelper(entities),
|
|
41095
|
+
_step18;
|
|
40783
41096
|
try {
|
|
40784
|
-
for (
|
|
40785
|
-
var e =
|
|
41097
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
|
41098
|
+
var e = _step18.value;
|
|
40786
41099
|
this._entityMapByName.set(e.Name.trim().toLowerCase(), e);
|
|
40787
41100
|
this._entityMapByID.set((0,dist/* NormalizeUUID */.Xw)(e.ID), e);
|
|
40788
41101
|
}
|
|
40789
41102
|
} catch (err) {
|
|
40790
|
-
|
|
41103
|
+
_iterator18.e(err);
|
|
40791
41104
|
} finally {
|
|
40792
|
-
|
|
41105
|
+
_iterator18.f();
|
|
40793
41106
|
}
|
|
40794
41107
|
}
|
|
40795
41108
|
}
|
|
@@ -40811,7 +41124,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40811
41124
|
key: "LoadLocalMetadataFromStorage",
|
|
40812
41125
|
value: (function () {
|
|
40813
41126
|
var _LoadLocalMetadataFromStorage = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee47() {
|
|
40814
|
-
var ls, temp, metadata,
|
|
41127
|
+
var ls, temp, metadata, _t15, _t16, _t17;
|
|
40815
41128
|
return providerBase_regenerator().w(function (_context49) {
|
|
40816
41129
|
while (1) switch (_context49.p = _context49.n) {
|
|
40817
41130
|
case 0:
|
|
@@ -40821,16 +41134,16 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40821
41134
|
_context49.n = 3;
|
|
40822
41135
|
break;
|
|
40823
41136
|
}
|
|
40824
|
-
|
|
41137
|
+
_t15 = JSON;
|
|
40825
41138
|
_context49.n = 1;
|
|
40826
41139
|
return ls.GetItem(this.LocalStoragePrefix + ProviderBase.localStorageTimestampsKey);
|
|
40827
41140
|
case 1:
|
|
40828
|
-
this._latestLocalMetadataTimestamps =
|
|
40829
|
-
|
|
41141
|
+
this._latestLocalMetadataTimestamps = _t15.parse.call(_t15, _context49.v);
|
|
41142
|
+
_t16 = JSON;
|
|
40830
41143
|
_context49.n = 2;
|
|
40831
41144
|
return ls.GetItem(this.LocalStoragePrefix + ProviderBase.localStorageAllMetadataKey);
|
|
40832
41145
|
case 2:
|
|
40833
|
-
temp =
|
|
41146
|
+
temp = _t16.parse.call(_t16, _context49.v);
|
|
40834
41147
|
// we now have a simple object for all the metadata
|
|
40835
41148
|
if (temp) {
|
|
40836
41149
|
// we have local metadata
|
|
@@ -40842,7 +41155,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40842
41155
|
break;
|
|
40843
41156
|
case 4:
|
|
40844
41157
|
_context49.p = 4;
|
|
40845
|
-
|
|
41158
|
+
_t17 = _context49.v;
|
|
40846
41159
|
case 5:
|
|
40847
41160
|
return _context49.a(2);
|
|
40848
41161
|
}
|
|
@@ -40872,7 +41185,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40872
41185
|
key: "SaveLocalMetadataToStorage",
|
|
40873
41186
|
value: (function () {
|
|
40874
41187
|
var _SaveLocalMetadataToStorage = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee48() {
|
|
40875
|
-
var ls,
|
|
41188
|
+
var ls, _t18;
|
|
40876
41189
|
return providerBase_regenerator().w(function (_context50) {
|
|
40877
41190
|
while (1) switch (_context50.p = _context50.n) {
|
|
40878
41191
|
case 0:
|
|
@@ -40892,9 +41205,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40892
41205
|
break;
|
|
40893
41206
|
case 3:
|
|
40894
41207
|
_context50.p = 3;
|
|
40895
|
-
|
|
41208
|
+
_t18 = _context50.v;
|
|
40896
41209
|
// some enviroments don't support local storage
|
|
40897
|
-
LogError(
|
|
41210
|
+
LogError(_t18);
|
|
40898
41211
|
case 4:
|
|
40899
41212
|
return _context50.a(2);
|
|
40900
41213
|
}
|
|
@@ -40914,7 +41227,7 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40914
41227
|
key: "RemoveLocalMetadataFromStorage",
|
|
40915
41228
|
value: (function () {
|
|
40916
41229
|
var _RemoveLocalMetadataFromStorage = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee49() {
|
|
40917
|
-
var ls, i,
|
|
41230
|
+
var ls, i, _t19;
|
|
40918
41231
|
return providerBase_regenerator().w(function (_context51) {
|
|
40919
41232
|
while (1) switch (_context51.p = _context51.n) {
|
|
40920
41233
|
case 0:
|
|
@@ -40937,9 +41250,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
40937
41250
|
break;
|
|
40938
41251
|
case 4:
|
|
40939
41252
|
_context51.p = 4;
|
|
40940
|
-
|
|
41253
|
+
_t19 = _context51.v;
|
|
40941
41254
|
// some enviroments don't support local storage
|
|
40942
|
-
LogError(
|
|
41255
|
+
LogError(_t19);
|
|
40943
41256
|
case 5:
|
|
40944
41257
|
return _context51.a(2);
|
|
40945
41258
|
}
|
|
@@ -42713,7 +43026,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
42713
43026
|
key: "OnExternalCacheChange",
|
|
42714
43027
|
value: (function () {
|
|
42715
43028
|
var _OnExternalCacheChange = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee17(config, event) {
|
|
42716
|
-
var parsed, _t11;
|
|
43029
|
+
var parsed, _parsed$totalRowCount, _t11;
|
|
42717
43030
|
return baseEngine_regenerator().w(function (_context17) {
|
|
42718
43031
|
while (1) switch (_context17.p = _context17.n) {
|
|
42719
43032
|
case 0:
|
|
@@ -42731,7 +43044,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
42731
43044
|
Success: true,
|
|
42732
43045
|
Results: parsed.results,
|
|
42733
43046
|
RowCount: parsed.results.length,
|
|
42734
|
-
TotalRowCount: parsed.results.length,
|
|
43047
|
+
TotalRowCount: (_parsed$totalRowCount = parsed.totalRowCount) !== null && _parsed$totalRowCount !== void 0 ? _parsed$totalRowCount : parsed.results.length,
|
|
42735
43048
|
ExecutionTime: 0,
|
|
42736
43049
|
ErrorMessage: '',
|
|
42737
43050
|
UserViewRunID: ''
|
|
@@ -48326,6 +48639,7 @@ _InMemoryLocalStorageProvider.DEFAULT_CATEGORY = 'default';
|
|
|
48326
48639
|
|
|
48327
48640
|
|
|
48328
48641
|
|
|
48642
|
+
|
|
48329
48643
|
|
|
48330
48644
|
|
|
48331
48645
|
function SetProvider(provider) {
|
|
@@ -53239,7 +53553,7 @@ function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, F
|
|
|
53239
53553
|
* zod schema definition for the entity MJ: AI Prompt Types
|
|
53240
53554
|
*/var MJAIPromptTypeSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(255)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()")});/**
|
|
53241
53555
|
* zod schema definition for the entity MJ: AI Prompts
|
|
53242
|
-
*/var MJAIPromptSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(255)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),TemplateID:z.string().describe("\n * * Field Name: TemplateID\n * * Display Name: Template\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)\n * * Description: Reference to the template used for the prompt."),CategoryID:z.string().nullable().describe("\n * * Field Name: CategoryID\n * * Display Name: Category\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompt Categories (vwAIPromptCategories.ID)\n * * Description: Reference to the category the prompt belongs to."),TypeID:z.string().describe("\n * * Field Name: TypeID\n * * Display Name: Type\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompt Types (vwAIPromptTypes.ID)\n * * Description: Reference to the type of the prompt."),Status:z.union([z.literal('Active'),z.literal('Disabled'),z.literal('Pending')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(50)\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Disabled\n * * Pending"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),ResponseFormat:z.union([z.literal('Any'),z.literal('JSON'),z.literal('Markdown'),z.literal('ModelSpecific'),z.literal('Text')]).describe("\n * * Field Name: ResponseFormat\n * * Display Name: Response Format\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Any\n * * Value List Type: List\n * * Possible Values \n * * Any\n * * JSON\n * * Markdown\n * * ModelSpecific\n * * Text\n * * Description: Specifies the expected response format for the AI model. Options include Any, Text, Markdown, JSON, and ModelSpecific. Defaults to Any if not specified."),ModelSpecificResponseFormat:z.string().nullable().describe("\n * * Field Name: ModelSpecificResponseFormat\n * * Display Name: Model Specific Response Format\n * * SQL Data Type: nvarchar(MAX)\n * * Description: A JSON-formatted string containing model-specific response format instructions. This will be parsed and provided as a JSON object to the model."),AIModelTypeID:z.string().nullable().describe("\n * * Field Name: AIModelTypeID\n * * Display Name: AI Model Type\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Model Types (vwAIModelTypes.ID)\n * * Description: References the type of AI model this prompt is designed for (LLM, Image, Audio, etc.)."),MinPowerRank:z.number().nullable().describe("\n * * Field Name: MinPowerRank\n * * Display Name: Minimum Power Rank\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: The minimum power rank required for models to be considered for this prompt."),SelectionStrategy:z.union([z.literal('ByPower'),z.literal('Default'),z.literal('Specific')]).describe("\n * * Field Name: SelectionStrategy\n * * Display Name: Selection Strategy\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Default\n * * Value List Type: List\n * * Possible Values \n * * ByPower\n * * Default\n * * Specific\n * * Description: Determines how models are selected for this prompt (Default, Specific, ByPower)."),PowerPreference:z.union([z.literal('Balanced'),z.literal('Highest'),z.literal('Lowest')]).describe("\n * * Field Name: PowerPreference\n * * Display Name: Power Preference\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Highest\n * * Value List Type: List\n * * Possible Values \n * * Balanced\n * * Highest\n * * Lowest\n * * Description: When using ByPower selection strategy, determines whether to prefer highest, lowest, or balanced power models."),ParallelizationMode:z.union([z.literal('ConfigParam'),z.literal('ModelSpecific'),z.literal('None'),z.literal('StaticCount')]).describe("\n * * Field Name: ParallelizationMode\n * * Display Name: Parallelization Mode\n * * SQL Data Type: nvarchar(20)\n * * Default Value: None\n * * Value List Type: List\n * * Possible Values \n * * ConfigParam\n * * ModelSpecific\n * * None\n * * StaticCount\n * * Description: Controls parallelization: None (no parallelization), StaticCount (use AIPrompt.ParallelCount for total runs), ConfigParam (use config param specified in ParallelConfigParam for total runs), or ModelSpecific (check each AIPromptModel's individual settings)."),ParallelCount:z.number().nullable().describe("\n * * Field Name: ParallelCount\n * * Display Name: Parallel Count\n * * SQL Data Type: int\n * * Description: When ParallelizationMode is StaticCount, specifies the number of parallel executions."),ParallelConfigParam:z.string().nullable().describe("\n * * Field Name: ParallelConfigParam\n * * Display Name: Parallel Config Parameter\n * * SQL Data Type: nvarchar(100)\n * * Description: When ParallelizationMode is ConfigParam, specifies the name of the configuration parameter that contains the parallel count."),OutputType:z.union([z.literal('boolean'),z.literal('date'),z.literal('number'),z.literal('object'),z.literal('string')]).describe("\n * * Field Name: OutputType\n * * Display Name: Output Type\n * * SQL Data Type: nvarchar(50)\n * * Default Value: string\n * * Value List Type: List\n * * Possible Values \n * * boolean\n * * date\n * * number\n * * object\n * * string\n * * Description: The expected data type of the prompt output: string, number, boolean, date, or object."),OutputExample:z.string().nullable().describe("\n * * Field Name: OutputExample\n * * Display Name: Output Example\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON example output when OutputType is \"object\", used for validating structured outputs."),ValidationBehavior:z.union([z.literal('None'),z.literal('Strict'),z.literal('Warn')]).describe("\n * * Field Name: ValidationBehavior\n * * Display Name: Validation Behavior\n * * SQL Data Type: nvarchar(50)\n * * Default Value: Warn\n * * Value List Type: List\n * * Possible Values \n * * None\n * * Strict\n * * Warn\n * * Description: Determines how validation failures are handled: Strict (fail), Warn (log warning), or None (ignore)."),MaxRetries:z.number().describe("\n * * Field Name: MaxRetries\n * * Display Name: Max Retries\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: Maximum number of retry attempts for API failures."),RetryDelayMS:z.number().describe("\n * * Field Name: RetryDelayMS\n * * Display Name: Retry Delay (ms)\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: Delay between retry attempts in milliseconds."),RetryStrategy:z.union([z.literal('Exponential'),z.literal('Fixed'),z.literal('Linear')]).describe("\n * * Field Name: RetryStrategy\n * * Display Name: Retry Strategy\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Fixed\n * * Value List Type: List\n * * Possible Values \n * * Exponential\n * * Fixed\n * * Linear\n * * Description: Strategy for calculating retry delays: Fixed (same delay each time), Exponential (doubling delay), or Linear (linearly increasing delay)."),ResultSelectorPromptID:z.string().nullable().describe("\n * * Field Name: ResultSelectorPromptID\n * * Display Name: Result Selector Prompt\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)\n * * Description: References another prompt that selects the best result from multiple parallel executions."),EnableCaching:z.boolean().describe("\n * * Field Name: EnableCaching\n * * Display Name: Enable Caching\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, results from this prompt will be cached for potential reuse."),CacheTTLSeconds:z.number().nullable().describe("\n * * Field Name: CacheTTLSeconds\n * * Display Name: Cache TTL (Seconds)\n * * SQL Data Type: int\n * * Description: Time-to-live in seconds for cached results. NULL means results never expire."),CacheMatchType:z.union([z.literal('Exact'),z.literal('Vector')]).describe("\n * * Field Name: CacheMatchType\n * * Display Name: Cache Match Type\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Exact\n * * Value List Type: List\n * * Possible Values \n * * Exact\n * * Vector\n * * Description: Method for matching cached results: Exact (string matching) or Vector (embedding similarity)."),CacheSimilarityThreshold:z.number().nullable().describe("\n * * Field Name: CacheSimilarityThreshold\n * * Display Name: Cache Similarity Threshold\n * * SQL Data Type: float(53)\n * * Description: Threshold (0-1) for vector similarity matching. Higher values require closer matches."),CacheMustMatchModel:z.boolean().describe("\n * * Field Name: CacheMustMatchModel\n * * Display Name: Cache Must Match Model\n * * SQL Data Type: bit\n * * Default Value: 1\n * * Description: When true, the AI model must match for a cache hit. When false, results from any model can be used."),CacheMustMatchVendor:z.boolean().describe("\n * * Field Name: CacheMustMatchVendor\n * * Display Name: Cache Must Match Vendor\n * * SQL Data Type: bit\n * * Default Value: 1\n * * Description: When true, the vendor must match for a cache hit. When false, results from any vendor can be used."),CacheMustMatchAgent:z.boolean().describe("\n * * Field Name: CacheMustMatchAgent\n * * Display Name: Cache Must Match Agent\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, the agent context must match for a cache hit. When false, agent-specific and non-agent results can be used interchangeably."),CacheMustMatchConfig:z.boolean().describe("\n * * Field Name: CacheMustMatchConfig\n * * Display Name: Cache Must Match Configuration\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, the configuration must match for a cache hit. When false, results from any configuration can be used."),PromptRole:z.union([z.literal('Assistant'),z.literal('System'),z.literal('SystemOrUser'),z.literal('User')]).describe("\n * * Field Name: PromptRole\n * * Display Name: Prompt Role\n * * SQL Data Type: nvarchar(20)\n * * Default Value: System\n * * Value List Type: List\n * * Possible Values \n * * Assistant\n * * System\n * * SystemOrUser\n * * User\n * * Description: Determines how the prompt is used in conversation: System (always first message), User (positioned by PromptPosition), Assistant (positioned by PromptPosition), or SystemOrUser (try system first, fallback to user last if system slot taken)"),PromptPosition:z.union([z.literal('First'),z.literal('Last')]).describe("\n * * Field Name: PromptPosition\n * * Display Name: Prompt Position\n * * SQL Data Type: nvarchar(20)\n * * Default Value: First\n * * Value List Type: List\n * * Possible Values \n * * First\n * * Last\n * * Description: Controls message placement for User and Assistant role prompts: First (beginning of conversation) or Last (end of conversation). Not used for System role prompts which are always first"),Temperature:z.number().nullable().describe("\n * * Field Name: Temperature\n * * Display Name: Temperature\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default temperature setting for this prompt. Controls randomness in the output. 0 = more focused and deterministic, 2 = more random and creative. Can be overridden at runtime."),TopP:z.number().nullable().describe("\n * * Field Name: TopP\n * * Display Name: Top P\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default TopP (nucleus sampling) for this prompt. Only consider tokens with cumulative probability up to this value. 1 = consider all tokens. Can be overridden at runtime."),TopK:z.number().nullable().describe("\n * * Field Name: TopK\n * * Display Name: Top K\n * * SQL Data Type: int\n * * Description: Default TopK sampling for this prompt. Only sample from the top K tokens. Lower values reduce randomness. Can be overridden at runtime."),MinP:z.number().nullable().describe("\n * * Field Name: MinP\n * * Display Name: Min P\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default MinP (minimum probability) for this prompt. Tokens with probability below this threshold are filtered out. Can be overridden at runtime."),FrequencyPenalty:z.number().nullable().describe("\n * * Field Name: FrequencyPenalty\n * * Display Name: Frequency Penalty\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default frequency penalty for this prompt. Penalizes tokens based on their frequency in the text. Positive values decrease likelihood of repetition. Can be overridden at runtime."),PresencePenalty:z.number().nullable().describe("\n * * Field Name: PresencePenalty\n * * Display Name: Presence Penalty\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default presence penalty for this prompt. Penalizes tokens that have appeared in the text. Positive values increase topic diversity. Can be overridden at runtime."),Seed:z.number().nullable().describe("\n * * Field Name: Seed\n * * Display Name: Seed\n * * SQL Data Type: int\n * * Description: Default random seed for this prompt. Used for deterministic generation. Same seed produces same output. Can be overridden at runtime."),StopSequences:z.string().nullable().describe("\n * * Field Name: StopSequences\n * * Display Name: Stop Sequences\n * * SQL Data Type: nvarchar(1000)\n * * Description: Default stop sequences for this prompt. Comma-delimited list of sequences that will stop generation when encountered. Can be overridden at runtime."),IncludeLogProbs:z.boolean().nullable().describe("\n * * Field Name: IncludeLogProbs\n * * Display Name: Include Log Probabilities\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: Default setting for including log probabilities in the response. Can be overridden at runtime."),TopLogProbs:z.number().nullable().describe("\n * * Field Name: TopLogProbs\n * * Display Name: Top Log Probabilities\n * * SQL Data Type: int\n * * Description: Default number of top log probabilities to include when IncludeLogProbs is true. Can be overridden at runtime."),FailoverStrategy:z.union([z.literal('NextBestModel'),z.literal('NextBestModel'),z.literal('None'),z.literal('None'),z.literal('PowerRank'),z.literal('PowerRank'),z.literal('SameModelDifferentVendor'),z.literal('SameModelDifferentVendor')]).describe("\n * * Field Name: FailoverStrategy\n * * Display Name: Failover Strategy\n * * SQL Data Type: nvarchar(50)\n * * Default Value: SameModelDifferentVendor\n * * Value List Type: List\n * * Possible Values \n * * NextBestModel\n * * NextBestModel\n * * None\n * * None\n * * PowerRank\n * * PowerRank\n * * SameModelDifferentVendor\n * * SameModelDifferentVendor\n * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None"),FailoverMaxAttempts:z.number().nullable().describe("\n * * Field Name: FailoverMaxAttempts\n * * Display Name: Failover Max Attempts\n * * SQL Data Type: int\n * * Default Value: 3\n * * Description: Maximum number of failover attempts before giving up"),FailoverDelaySeconds:z.number().nullable().describe("\n * * Field Name: FailoverDelaySeconds\n * * Display Name: Failover Delay (seconds)\n * * SQL Data Type: int\n * * Default Value: 5\n * * Description: Initial delay in seconds between failover attempts"),FailoverModelStrategy:z.union([z.literal('PreferDifferentModel'),z.literal('PreferDifferentModel'),z.literal('PreferSameModel'),z.literal('PreferSameModel'),z.literal('RequireSameModel'),z.literal('RequireSameModel')]).describe("\n * * Field Name: FailoverModelStrategy\n * * Display Name: Failover Model Strategy\n * * SQL Data Type: nvarchar(50)\n * * Default Value: PreferSameModel\n * * Value List Type: List\n * * Possible Values \n * * PreferDifferentModel\n * * PreferDifferentModel\n * * PreferSameModel\n * * PreferSameModel\n * * RequireSameModel\n * * RequireSameModel\n * * Description: Strategy for selecting failover models. Options: PreferSameModel, PreferDifferentModel, RequireSameModel"),FailoverErrorScope:z.union([z.literal('All'),z.literal('All'),z.literal('NetworkOnly'),z.literal('NetworkOnly'),z.literal('RateLimitOnly'),z.literal('RateLimitOnly'),z.literal('ServiceErrorOnly'),z.literal('ServiceErrorOnly')]).describe("\n * * Field Name: FailoverErrorScope\n * * Display Name: Failover Error Scope\n * * SQL Data Type: nvarchar(50)\n * * Default Value: All\n * * Value List Type: List\n * * Possible Values \n * * All\n * * All\n * * NetworkOnly\n * * NetworkOnly\n * * RateLimitOnly\n * * RateLimitOnly\n * * ServiceErrorOnly\n * * ServiceErrorOnly\n * * Description: Types of errors that should trigger failover. Options: All, NetworkOnly, RateLimitOnly, ServiceErrorOnly"),EffortLevel:z.number().nullable().describe("\n * * Field Name: EffortLevel\n * * Display Name: Effort Level\n * * SQL Data Type: int\n * * Description: Effort level for this specific prompt (1-100, where 1=minimal effort, 100=maximum effort). Higher values request more thorough reasoning and analysis. Can be overridden by agent DefaultPromptEffortLevel or runtime parameters."),AssistantPrefill:z.string().nullable().describe("\n * * Field Name: AssistantPrefill\n * * Display Name: Assistant Prefill\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Optional text to prefill the assistant response. The model will continue generating from where this text ends. Used with StopSequences for structured output extraction (e.g., prefill with ```json to get raw JSON). Only effective with providers that support prefill natively; see PrefillFallbackMode for non-supporting providers."),PrefillFallbackMode:z.union([z.literal('Ignore'),z.literal('None'),z.literal('SystemInstruction')]).describe("\n * * Field Name: PrefillFallbackMode\n * * Display Name: Prefill Fallback Mode\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Ignore\n * * Value List Type: List\n * * Possible Values \n * * Ignore\n * * None\n * * SystemInstruction\n * * Description: Controls behavior when the selected provider does not support native assistant prefill. Ignore = silently skip prefill, SystemInstruction = inject a system message instructing the model to start its response with the prefill text (uses fallback text from AI Model Vendor or AI Model Type), None = no fallback (prefill only works with supported providers)."),Template:z.string().describe("\n * * Field Name: Template\n * * Display Name: Template Text\n * * SQL Data Type: nvarchar(255)"),Category:z.string().nullable().describe("\n * * Field Name: Category\n * * Display Name: Category Name\n * * SQL Data Type: nvarchar(255)"),Type:z.string().describe("\n * * Field Name: Type\n * * Display Name: Type Name\n * * SQL Data Type: nvarchar(255)"),AIModelType:z.string().nullable().describe("\n * * Field Name: AIModelType\n * * Display Name: AI Model Type Name\n * * SQL Data Type: nvarchar(50)"),ResultSelectorPrompt:z.string().nullable().describe("\n * * Field Name: ResultSelectorPrompt\n * * Display Name: Result Selector Prompt Name\n * * SQL Data Type: nvarchar(255)"),RootResultSelectorPromptID:z.string().nullable().describe("\n * * Field Name: RootResultSelectorPromptID\n * * Display Name: Root Result Selector Prompt\n * * SQL Data Type: uniqueidentifier")});/**
|
|
53556
|
+
*/var MJAIPromptSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(255)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),TemplateID:z.string().describe("\n * * Field Name: TemplateID\n * * Display Name: Template\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)\n * * Description: Reference to the template used for the prompt."),CategoryID:z.string().nullable().describe("\n * * Field Name: CategoryID\n * * Display Name: Category\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompt Categories (vwAIPromptCategories.ID)\n * * Description: Reference to the category the prompt belongs to."),TypeID:z.string().describe("\n * * Field Name: TypeID\n * * Display Name: Type\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompt Types (vwAIPromptTypes.ID)\n * * Description: Reference to the type of the prompt."),Status:z.union([z.literal('Active'),z.literal('Disabled'),z.literal('Pending')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(50)\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Disabled\n * * Pending"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),ResponseFormat:z.union([z.literal('Any'),z.literal('JSON'),z.literal('Markdown'),z.literal('ModelSpecific'),z.literal('Text')]).describe("\n * * Field Name: ResponseFormat\n * * Display Name: Response Format\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Any\n * * Value List Type: List\n * * Possible Values \n * * Any\n * * JSON\n * * Markdown\n * * ModelSpecific\n * * Text\n * * Description: Specifies the expected response format for the AI model. Options include Any, Text, Markdown, JSON, and ModelSpecific. Defaults to Any if not specified."),ModelSpecificResponseFormat:z.string().nullable().describe("\n * * Field Name: ModelSpecificResponseFormat\n * * Display Name: Model Specific Response Format\n * * SQL Data Type: nvarchar(MAX)\n * * Description: A JSON-formatted string containing model-specific response format instructions. This will be parsed and provided as a JSON object to the model."),AIModelTypeID:z.string().nullable().describe("\n * * Field Name: AIModelTypeID\n * * Display Name: AI Model Type\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Model Types (vwAIModelTypes.ID)\n * * Description: References the type of AI model this prompt is designed for (LLM, Image, Audio, etc.)."),MinPowerRank:z.number().nullable().describe("\n * * Field Name: MinPowerRank\n * * Display Name: Minimum Power Rank\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: The minimum power rank required for models to be considered for this prompt."),SelectionStrategy:z.union([z.literal('ByPower'),z.literal('Default'),z.literal('Specific')]).describe("\n * * Field Name: SelectionStrategy\n * * Display Name: Selection Strategy\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Default\n * * Value List Type: List\n * * Possible Values \n * * ByPower\n * * Default\n * * Specific\n * * Description: Determines how models are selected for this prompt (Default, Specific, ByPower)."),PowerPreference:z.union([z.literal('Balanced'),z.literal('Highest'),z.literal('Lowest')]).describe("\n * * Field Name: PowerPreference\n * * Display Name: Power Preference\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Highest\n * * Value List Type: List\n * * Possible Values \n * * Balanced\n * * Highest\n * * Lowest\n * * Description: When using ByPower selection strategy, determines whether to prefer highest, lowest, or balanced power models."),ParallelizationMode:z.union([z.literal('ConfigParam'),z.literal('ModelSpecific'),z.literal('None'),z.literal('StaticCount')]).describe("\n * * Field Name: ParallelizationMode\n * * Display Name: Parallelization Mode\n * * SQL Data Type: nvarchar(20)\n * * Default Value: None\n * * Value List Type: List\n * * Possible Values \n * * ConfigParam\n * * ModelSpecific\n * * None\n * * StaticCount\n * * Description: Controls parallelization: None (no parallelization), StaticCount (use AIPrompt.ParallelCount for total runs), ConfigParam (use config param specified in ParallelConfigParam for total runs), or ModelSpecific (check each AIPromptModel's individual settings)."),ParallelCount:z.number().nullable().describe("\n * * Field Name: ParallelCount\n * * Display Name: Parallel Count\n * * SQL Data Type: int\n * * Description: When ParallelizationMode is StaticCount, specifies the number of parallel executions."),ParallelConfigParam:z.string().nullable().describe("\n * * Field Name: ParallelConfigParam\n * * Display Name: Parallel Config Parameter\n * * SQL Data Type: nvarchar(100)\n * * Description: When ParallelizationMode is ConfigParam, specifies the name of the configuration parameter that contains the parallel count."),OutputType:z.union([z.literal('boolean'),z.literal('date'),z.literal('number'),z.literal('object'),z.literal('string')]).describe("\n * * Field Name: OutputType\n * * Display Name: Output Type\n * * SQL Data Type: nvarchar(50)\n * * Default Value: string\n * * Value List Type: List\n * * Possible Values \n * * boolean\n * * date\n * * number\n * * object\n * * string\n * * Description: The expected data type of the prompt output: string, number, boolean, date, or object."),OutputExample:z.string().nullable().describe("\n * * Field Name: OutputExample\n * * Display Name: Output Example\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON example output when OutputType is \"object\", used for validating structured outputs."),ValidationBehavior:z.union([z.literal('None'),z.literal('Strict'),z.literal('Warn')]).describe("\n * * Field Name: ValidationBehavior\n * * Display Name: Validation Behavior\n * * SQL Data Type: nvarchar(50)\n * * Default Value: Warn\n * * Value List Type: List\n * * Possible Values \n * * None\n * * Strict\n * * Warn\n * * Description: Determines how validation failures are handled: Strict (fail), Warn (log warning), or None (ignore)."),MaxRetries:z.number().describe("\n * * Field Name: MaxRetries\n * * Display Name: Max Retries\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: Maximum number of retry attempts for API failures."),RetryDelayMS:z.number().describe("\n * * Field Name: RetryDelayMS\n * * Display Name: Retry Delay (ms)\n * * SQL Data Type: int\n * * Default Value: 0\n * * Description: Delay between retry attempts in milliseconds."),RetryStrategy:z.union([z.literal('Exponential'),z.literal('Fixed'),z.literal('Linear')]).describe("\n * * Field Name: RetryStrategy\n * * Display Name: Retry Strategy\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Fixed\n * * Value List Type: List\n * * Possible Values \n * * Exponential\n * * Fixed\n * * Linear\n * * Description: Strategy for calculating retry delays: Fixed (same delay each time), Exponential (doubling delay), or Linear (linearly increasing delay)."),ResultSelectorPromptID:z.string().nullable().describe("\n * * Field Name: ResultSelectorPromptID\n * * Display Name: Result Selector Prompt\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)\n * * Description: References another prompt that selects the best result from multiple parallel executions."),EnableCaching:z.boolean().describe("\n * * Field Name: EnableCaching\n * * Display Name: Enable Caching\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, results from this prompt will be cached for potential reuse."),CacheTTLSeconds:z.number().nullable().describe("\n * * Field Name: CacheTTLSeconds\n * * Display Name: Cache TTL (Seconds)\n * * SQL Data Type: int\n * * Description: Time-to-live in seconds for cached results. NULL means results never expire."),CacheMatchType:z.union([z.literal('Exact'),z.literal('Vector')]).describe("\n * * Field Name: CacheMatchType\n * * Display Name: Cache Match Type\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Exact\n * * Value List Type: List\n * * Possible Values \n * * Exact\n * * Vector\n * * Description: Method for matching cached results: Exact (string matching) or Vector (embedding similarity)."),CacheSimilarityThreshold:z.number().nullable().describe("\n * * Field Name: CacheSimilarityThreshold\n * * Display Name: Cache Similarity Threshold\n * * SQL Data Type: float(53)\n * * Description: Threshold (0-1) for vector similarity matching. Higher values require closer matches."),CacheMustMatchModel:z.boolean().describe("\n * * Field Name: CacheMustMatchModel\n * * Display Name: Cache Must Match Model\n * * SQL Data Type: bit\n * * Default Value: 1\n * * Description: When true, the AI model must match for a cache hit. When false, results from any model can be used."),CacheMustMatchVendor:z.boolean().describe("\n * * Field Name: CacheMustMatchVendor\n * * Display Name: Cache Must Match Vendor\n * * SQL Data Type: bit\n * * Default Value: 1\n * * Description: When true, the vendor must match for a cache hit. When false, results from any vendor can be used."),CacheMustMatchAgent:z.boolean().describe("\n * * Field Name: CacheMustMatchAgent\n * * Display Name: Cache Must Match Agent\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, the agent context must match for a cache hit. When false, agent-specific and non-agent results can be used interchangeably."),CacheMustMatchConfig:z.boolean().describe("\n * * Field Name: CacheMustMatchConfig\n * * Display Name: Cache Must Match Config\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: When true, the configuration must match for a cache hit. When false, results from any configuration can be used."),PromptRole:z.union([z.literal('Assistant'),z.literal('System'),z.literal('SystemOrUser'),z.literal('User')]).describe("\n * * Field Name: PromptRole\n * * Display Name: Prompt Role\n * * SQL Data Type: nvarchar(20)\n * * Default Value: System\n * * Value List Type: List\n * * Possible Values \n * * Assistant\n * * System\n * * SystemOrUser\n * * User\n * * Description: Determines how the prompt is used in conversation: System (always first message), User (positioned by PromptPosition), Assistant (positioned by PromptPosition), or SystemOrUser (try system first, fallback to user last if system slot taken)"),PromptPosition:z.union([z.literal('First'),z.literal('Last')]).describe("\n * * Field Name: PromptPosition\n * * Display Name: Prompt Position\n * * SQL Data Type: nvarchar(20)\n * * Default Value: First\n * * Value List Type: List\n * * Possible Values \n * * First\n * * Last\n * * Description: Controls message placement for User and Assistant role prompts: First (beginning of conversation) or Last (end of conversation). Not used for System role prompts which are always first"),Temperature:z.number().nullable().describe("\n * * Field Name: Temperature\n * * Display Name: Temperature\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default temperature setting for this prompt. Controls randomness in the output. 0 = more focused and deterministic, 2 = more random and creative. Can be overridden at runtime."),TopP:z.number().nullable().describe("\n * * Field Name: TopP\n * * Display Name: Top P\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default TopP (nucleus sampling) for this prompt. Only consider tokens with cumulative probability up to this value. 1 = consider all tokens. Can be overridden at runtime."),TopK:z.number().nullable().describe("\n * * Field Name: TopK\n * * Display Name: Top K\n * * SQL Data Type: int\n * * Description: Default TopK sampling for this prompt. Only sample from the top K tokens. Lower values reduce randomness. Can be overridden at runtime."),MinP:z.number().nullable().describe("\n * * Field Name: MinP\n * * Display Name: Min P\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default MinP (minimum probability) for this prompt. Tokens with probability below this threshold are filtered out. Can be overridden at runtime."),FrequencyPenalty:z.number().nullable().describe("\n * * Field Name: FrequencyPenalty\n * * Display Name: Frequency Penalty\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default frequency penalty for this prompt. Penalizes tokens based on their frequency in the text. Positive values decrease likelihood of repetition. Can be overridden at runtime."),PresencePenalty:z.number().nullable().describe("\n * * Field Name: PresencePenalty\n * * Display Name: Presence Penalty\n * * SQL Data Type: decimal(3, 2)\n * * Description: Default presence penalty for this prompt. Penalizes tokens that have appeared in the text. Positive values increase topic diversity. Can be overridden at runtime."),Seed:z.number().nullable().describe("\n * * Field Name: Seed\n * * Display Name: Seed\n * * SQL Data Type: int\n * * Description: Default random seed for this prompt. Used for deterministic generation. Same seed produces same output. Can be overridden at runtime."),StopSequences:z.string().nullable().describe("\n * * Field Name: StopSequences\n * * Display Name: Stop Sequences\n * * SQL Data Type: nvarchar(1000)\n * * Description: Default stop sequences for this prompt. Comma-delimited list of sequences that will stop generation when encountered. Can be overridden at runtime."),IncludeLogProbs:z.boolean().nullable().describe("\n * * Field Name: IncludeLogProbs\n * * Display Name: Include Log Probabilities\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: Default setting for including log probabilities in the response. Can be overridden at runtime."),TopLogProbs:z.number().nullable().describe("\n * * Field Name: TopLogProbs\n * * Display Name: Top Log Probabilities\n * * SQL Data Type: int\n * * Description: Default number of top log probabilities to include when IncludeLogProbs is true. Can be overridden at runtime."),FailoverStrategy:z.union([z.literal('NextBestModel'),z.literal('NextBestModel'),z.literal('None'),z.literal('None'),z.literal('PowerRank'),z.literal('PowerRank'),z.literal('SameModelDifferentVendor'),z.literal('SameModelDifferentVendor')]).describe("\n * * Field Name: FailoverStrategy\n * * Display Name: Failover Strategy\n * * SQL Data Type: nvarchar(50)\n * * Default Value: SameModelDifferentVendor\n * * Value List Type: List\n * * Possible Values \n * * NextBestModel\n * * NextBestModel\n * * None\n * * None\n * * PowerRank\n * * PowerRank\n * * SameModelDifferentVendor\n * * SameModelDifferentVendor\n * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None"),FailoverMaxAttempts:z.number().nullable().describe("\n * * Field Name: FailoverMaxAttempts\n * * Display Name: Failover Max Attempts\n * * SQL Data Type: int\n * * Default Value: 3\n * * Description: Maximum number of failover attempts before giving up"),FailoverDelaySeconds:z.number().nullable().describe("\n * * Field Name: FailoverDelaySeconds\n * * Display Name: Failover Delay (Seconds)\n * * SQL Data Type: int\n * * Default Value: 5\n * * Description: Initial delay in seconds between failover attempts"),FailoverModelStrategy:z.union([z.literal('PreferDifferentModel'),z.literal('PreferDifferentModel'),z.literal('PreferSameModel'),z.literal('PreferSameModel'),z.literal('RequireSameModel'),z.literal('RequireSameModel')]).describe("\n * * Field Name: FailoverModelStrategy\n * * Display Name: Failover Model Strategy\n * * SQL Data Type: nvarchar(50)\n * * Default Value: PreferSameModel\n * * Value List Type: List\n * * Possible Values \n * * PreferDifferentModel\n * * PreferDifferentModel\n * * PreferSameModel\n * * PreferSameModel\n * * RequireSameModel\n * * RequireSameModel\n * * Description: Strategy for selecting failover models. Options: PreferSameModel, PreferDifferentModel, RequireSameModel"),FailoverErrorScope:z.union([z.literal('All'),z.literal('All'),z.literal('NetworkOnly'),z.literal('NetworkOnly'),z.literal('RateLimitOnly'),z.literal('RateLimitOnly'),z.literal('ServiceErrorOnly'),z.literal('ServiceErrorOnly')]).describe("\n * * Field Name: FailoverErrorScope\n * * Display Name: Failover Error Scope\n * * SQL Data Type: nvarchar(50)\n * * Default Value: All\n * * Value List Type: List\n * * Possible Values \n * * All\n * * All\n * * NetworkOnly\n * * NetworkOnly\n * * RateLimitOnly\n * * RateLimitOnly\n * * ServiceErrorOnly\n * * ServiceErrorOnly\n * * Description: Types of errors that should trigger failover. Options: All, NetworkOnly, RateLimitOnly, ServiceErrorOnly"),EffortLevel:z.number().nullable().describe("\n * * Field Name: EffortLevel\n * * Display Name: Effort Level\n * * SQL Data Type: int\n * * Description: Effort level for this specific prompt (1-100, where 1=minimal effort, 100=maximum effort). Higher values request more thorough reasoning and analysis. Can be overridden by agent DefaultPromptEffortLevel or runtime parameters."),AssistantPrefill:z.string().nullable().describe("\n * * Field Name: AssistantPrefill\n * * Display Name: Assistant Prefill\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Optional text to prefill the assistant response. The model will continue generating from where this text ends. Used with StopSequences for structured output extraction (e.g., prefill with ```json to get raw JSON). Only effective with providers that support prefill natively; see PrefillFallbackMode for non-supporting providers."),PrefillFallbackMode:z.union([z.literal('Ignore'),z.literal('None'),z.literal('SystemInstruction')]).describe("\n * * Field Name: PrefillFallbackMode\n * * Display Name: Prefill Fallback Mode\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Ignore\n * * Value List Type: List\n * * Possible Values \n * * Ignore\n * * None\n * * SystemInstruction\n * * Description: Controls behavior when the selected provider does not support native assistant prefill. Ignore = silently skip prefill, SystemInstruction = inject a system message instructing the model to start its response with the prefill text (uses fallback text from AI Model Vendor or AI Model Type), None = no fallback (prefill only works with supported providers)."),RequireSpecificModels:z.boolean().describe("\n * * Field Name: RequireSpecificModels\n * * Display Name: Require Specific Models\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: Only applies when SelectionStrategy is Specific. When 0 (default), if none of the explicitly configured AIPromptModel entries have valid API credentials the system automatically falls back to Default/ByPower model selection across all active models matching the prompt AIModelTypeID. When 1, the system will hard-fail with an error instead of falling back, ensuring only the explicitly configured models are ever used."),Template:z.string().describe("\n * * Field Name: Template\n * * Display Name: Template Text\n * * SQL Data Type: nvarchar(255)"),Category:z.string().nullable().describe("\n * * Field Name: Category\n * * Display Name: Category Name\n * * SQL Data Type: nvarchar(255)"),Type:z.string().describe("\n * * Field Name: Type\n * * Display Name: Type Name\n * * SQL Data Type: nvarchar(255)"),AIModelType:z.string().nullable().describe("\n * * Field Name: AIModelType\n * * Display Name: AI Model Type Name\n * * SQL Data Type: nvarchar(50)"),ResultSelectorPrompt:z.string().nullable().describe("\n * * Field Name: ResultSelectorPrompt\n * * Display Name: Result Selector Prompt Name\n * * SQL Data Type: nvarchar(255)"),RootResultSelectorPromptID:z.string().nullable().describe("\n * * Field Name: RootResultSelectorPromptID\n * * Display Name: Root Result Selector Prompt\n * * SQL Data Type: uniqueidentifier")});/**
|
|
53243
53557
|
* zod schema definition for the entity MJ: AI Result Cache
|
|
53244
53558
|
*/var MJAIResultCacheSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),AIPromptID:z.string().describe("\n * * Field Name: AIPromptID\n * * Display Name: AI Prompt\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)\n * * Description: Reference to the AI prompt this result corresponds to."),AIModelID:z.string().describe("\n * * Field Name: AIModelID\n * * Display Name: AI Model\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)\n * * Description: Reference to the AI model that generated this result."),RunAt:z.date().describe("\n * * Field Name: RunAt\n * * Display Name: Run At\n * * SQL Data Type: datetimeoffset\n * * Description: Timestamp of when this result was generated."),PromptText:z.string().describe("\n * * Field Name: PromptText\n * * Display Name: Prompt Text\n * * SQL Data Type: nvarchar(MAX)\n * * Description: The prompt text used to generate this result."),ResultText:z.string().nullable().describe("\n * * Field Name: ResultText\n * * Display Name: Result Text\n * * SQL Data Type: nvarchar(MAX)\n * * Description: The text of the result generated by the AI model."),Status:z.union([z.literal('Active'),z.literal('Expired')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(50)\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Expired\n * * Description: The status of this result, indicating whether it is currently active or expired."),ExpiredOn:z.date().nullable().describe("\n * * Field Name: ExpiredOn\n * * Display Name: Expired On\n * * SQL Data Type: datetimeoffset\n * * Description: Timestamp of when this result was marked as expired."),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),VendorID:z.string().nullable().describe("\n * * Field Name: VendorID\n * * Display Name: Vendor\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Vendors (vwAIVendors.ID)\n * * Description: The vendor that provided this result."),AgentID:z.string().nullable().describe("\n * * Field Name: AgentID\n * * Display Name: Agent\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Agents (vwAIAgents.ID)\n * * Description: The agent that initiated the request, if any."),ConfigurationID:z.string().nullable().describe("\n * * Field Name: ConfigurationID\n * * Display Name: Configuration\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Configurations (vwAIConfigurations.ID)\n * * Description: The configuration used for this execution."),PromptEmbedding:z.number().nullable().describe("\n * * Field Name: PromptEmbedding\n * * Display Name: Prompt Embedding\n * * SQL Data Type: varbinary\n * * Description: Vector representation of the prompt for similarity matching."),PromptRunID:z.string().nullable().describe("\n * * Field Name: PromptRunID\n * * Display Name: Prompt Run\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Prompt Runs (vwAIPromptRuns.ID)\n * * Description: Reference to the AIPromptRun that created this cache entry."),AIPrompt:z.string().describe("\n * * Field Name: AIPrompt\n * * Display Name: AI Prompt\n * * SQL Data Type: nvarchar(255)"),AIModel:z.string().describe("\n * * Field Name: AIModel\n * * Display Name: AI Model\n * * SQL Data Type: nvarchar(50)"),Vendor:z.string().nullable().describe("\n * * Field Name: Vendor\n * * Display Name: Vendor\n * * SQL Data Type: nvarchar(50)"),Agent:z.string().nullable().describe("\n * * Field Name: Agent\n * * Display Name: Agent\n * * SQL Data Type: nvarchar(255)"),Configuration:z.string().nullable().describe("\n * * Field Name: Configuration\n * * Display Name: Configuration\n * * SQL Data Type: nvarchar(100)"),PromptRun:z.string().nullable().describe("\n * * Field Name: PromptRun\n * * Display Name: Prompt Run\n * * SQL Data Type: nvarchar(255)")});/**
|
|
53245
53559
|
* zod schema definition for the entity MJ: AI Vendor Type Definitions
|
|
@@ -53445,7 +53759,7 @@ function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, F
|
|
|
53445
53759
|
* zod schema definition for the entity MJ: Entity Document Types
|
|
53446
53760
|
*/var MJEntityDocumentTypeSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(100)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: __mj _Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: __mj _Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()")});/**
|
|
53447
53761
|
* zod schema definition for the entity MJ: Entity Documents
|
|
53448
|
-
*/var MJEntityDocumentSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(250)"),TypeID:z.string().describe("\n * * Field Name: TypeID\n * * Display Name: Type
|
|
53762
|
+
*/var MJEntityDocumentSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(250)"),TypeID:z.string().describe("\n * * Field Name: TypeID\n * * Display Name: Type\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Entity Document Types (vwEntityDocumentTypes.ID)"),EntityID:z.string().describe("\n * * Field Name: EntityID\n * * Display Name: Entity\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)"),VectorDatabaseID:z.string().describe("\n * * Field Name: VectorDatabaseID\n * * Display Name: Vector Database\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Vector Databases (vwVectorDatabases.ID)"),Status:z.union([z.literal('Active'),z.literal('Inactive')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(15)\n * * Default Value: Active\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Inactive"),TemplateID:z.string().describe("\n * * Field Name: TemplateID\n * * Display Name: Template\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)"),AIModelID:z.string().describe("\n * * Field Name: AIModelID\n * * Display Name: AI Model\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)"),PotentialMatchThreshold:z.number().describe("\n * * Field Name: PotentialMatchThreshold\n * * Display Name: Potential Match Threshold\n * * SQL Data Type: numeric(12, 11)\n * * Default Value: 1\n * * Description: Value between 0 and 1 that determines what is considered a potential matching record. Value must be <= AbsoluteMatchThreshold. This is primarily used for duplicate detection but can be used for other applications as well where matching is relevant."),AbsoluteMatchThreshold:z.number().describe("\n * * Field Name: AbsoluteMatchThreshold\n * * Display Name: Absolute Match Threshold\n * * SQL Data Type: numeric(12, 11)\n * * Default Value: 1\n * * Description: Value between 0 and 1 that determines what is considered an absolute matching record. Value must be >= PotentialMatchThreshold. This is primarily used for duplicate detection but can be used for other applications as well where matching is relevant."),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),VectorIndexID:z.string().nullable().describe("\n * * Field Name: VectorIndexID\n * * Display Name: Vector Index\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Vector Indexes (vwVectorIndexes.ID)\n * * Description: Optional foreign key to the specific Vector Index where this entity document's embeddings should be stored. When specified, the vectorization pipeline will upsert vectors directly to this index rather than auto-creating or looking up an index based on VectorDatabaseID + AIModelID. This enables explicit control over which Pinecone/Weaviate/etc. index is used per entity document, supporting multi-index architectures and shared indexes across entity types."),Configuration:z.string().nullable().describe("\n * * Field Name: Configuration\n * * Display Name: Configuration\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON configuration settings for this entity document. Controls vector metadata field inclusion (which fields get stored in the vector index for search result display), large field truncation limits, and future settings like sync scheduling and threshold overrides. NULL means use system defaults."),Type:z.string().describe("\n * * Field Name: Type\n * * Display Name: Type Name\n * * SQL Data Type: nvarchar(100)"),Entity:z.string().describe("\n * * Field Name: Entity\n * * Display Name: Entity Name\n * * SQL Data Type: nvarchar(255)"),VectorDatabase:z.string().describe("\n * * Field Name: VectorDatabase\n * * Display Name: Vector Database Name\n * * SQL Data Type: nvarchar(100)"),Template:z.string().describe("\n * * Field Name: Template\n * * Display Name: Template Name\n * * SQL Data Type: nvarchar(255)"),AIModel:z.string().describe("\n * * Field Name: AIModel\n * * Display Name: AI Model Name\n * * SQL Data Type: nvarchar(50)"),VectorIndex:z.string().nullable().describe("\n * * Field Name: VectorIndex\n * * Display Name: Vector Index Name\n * * SQL Data Type: nvarchar(255)")});/**
|
|
53449
53763
|
* zod schema definition for the entity MJ: Entity Field Values
|
|
53450
53764
|
*/var MJEntityFieldValueSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),EntityFieldID:z.string().describe("\n * * Field Name: EntityFieldID\n * * Display Name: Entity Field ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Entity Fields (vwEntityFields.ID)"),Sequence:z.number().describe("\n * * Field Name: Sequence\n * * Display Name: Sequence\n * * SQL Data Type: int\n * * Description: Display order for this value in dropdown lists and UI elements."),Value:z.string().describe("\n * * Field Name: Value\n * * Display Name: Value\n * * SQL Data Type: nvarchar(255)\n * * Description: The actual value stored in the database for this option."),Code:z.string().nullable().describe("\n * * Field Name: Code\n * * Display Name: Code\n * * SQL Data Type: nvarchar(50)\n * * Description: Optional code identifier for this value, useful for programmatic access. If not specified, same as Value"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: __mj _Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: __mj _Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),EntityField:z.string().describe("\n * * Field Name: EntityField\n * * Display Name: Entity Field\n * * SQL Data Type: nvarchar(255)"),Entity:z.string().describe("\n * * Field Name: Entity\n * * Display Name: Entity\n * * SQL Data Type: nvarchar(255)"),EntityID:z.string().describe("\n * * Field Name: EntityID\n * * Display Name: Entity ID\n * * SQL Data Type: uniqueidentifier")});/**
|
|
53451
53765
|
* zod schema definition for the entity MJ: Entity Fields
|
|
@@ -53689,9 +54003,9 @@ function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, F
|
|
|
53689
54003
|
* zod schema definition for the entity MJ: Users
|
|
53690
54004
|
*/var MJUserSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * SQL Data Type: nvarchar(100)"),FirstName:z.string().nullable().describe("\n * * Field Name: FirstName\n * * Display Name: First Name\n * * SQL Data Type: nvarchar(50)\n * * Description: User's first name or given name."),LastName:z.string().nullable().describe("\n * * Field Name: LastName\n * * Display Name: Last Name\n * * SQL Data Type: nvarchar(50)\n * * Description: User's last name or surname."),Title:z.string().nullable().describe("\n * * Field Name: Title\n * * Display Name: Title\n * * SQL Data Type: nvarchar(50)\n * * Description: User's professional title or salutation."),Email:z.string().describe("\n * * Field Name: Email\n * * SQL Data Type: nvarchar(100)\n * * Description: Unique email address for the user. This field must be unique across all users in the system."),Type:z.union([z.literal('Owner'),z.literal('User')]).describe("\n * * Field Name: Type\n * * SQL Data Type: nchar(15)\n * * Value List Type: List\n * * Possible Values \n * * Owner\n * * User\n * * Description: User account type (User, Guest, System, API)."),IsActive:z.boolean().describe("\n * * Field Name: IsActive\n * * Display Name: Is Active\n * * SQL Data Type: bit\n * * Default Value: 0\n * * Description: Whether this user account is currently active and can log in."),LinkedRecordType:z.string().describe("\n * * Field Name: LinkedRecordType\n * * Display Name: Linked Record Type\n * * SQL Data Type: nchar(10)\n * * Default Value: None\n * * Description: Type of record this user is linked to (None, Employee, Contact, etc.)."),LinkedEntityID:z.string().nullable().describe("\n * * Field Name: LinkedEntityID\n * * Display Name: Linked Entity ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)"),LinkedEntityRecordID:z.string().nullable().describe("\n * * Field Name: LinkedEntityRecordID\n * * Display Name: Linked Entity Record ID\n * * SQL Data Type: nvarchar(450)\n * * Description: ID of the specific record this user is linked to."),EmployeeID:z.string().nullable().describe("\n * * Field Name: EmployeeID\n * * Display Name: Employee\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Employees (vwEmployees.ID)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: __mj _Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: __mj _Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),UserImageURL:z.string().nullable().describe("\n * * Field Name: UserImageURL\n * * Display Name: User Image URL\n * * SQL Data Type: nvarchar(MAX)\n * * Description: User avatar image. Can be a Base64 encoded data URI (e.g., \"data:image/png;base64,...\") or a URL to an image file. Preferred over UserImageIconClass when present. Recommended for small thumbnail images only to maintain performance."),UserImageIconClass:z.string().nullable().describe("\n * * Field Name: UserImageIconClass\n * * Display Name: User Image Icon Class\n * * SQL Data Type: nvarchar(100)\n * * Description: Font Awesome icon class for user avatar (e.g., \"fa-solid fa-user-astronaut\"). Used as fallback when UserImageURL is not provided. Example classes: \"fa-solid fa-user\", \"fa-regular fa-circle-user\", \"fa-solid fa-user-tie\"."),FirstLast:z.string().nullable().describe("\n * * Field Name: FirstLast\n * * Display Name: First Last\n * * SQL Data Type: nvarchar(101)"),EmployeeFirstLast:z.string().nullable().describe("\n * * Field Name: EmployeeFirstLast\n * * Display Name: Employee First Last\n * * SQL Data Type: nvarchar(81)"),EmployeeEmail:z.string().nullable().describe("\n * * Field Name: EmployeeEmail\n * * Display Name: Employee Email\n * * SQL Data Type: nvarchar(100)"),EmployeeTitle:z.string().nullable().describe("\n * * Field Name: EmployeeTitle\n * * Display Name: Employee Title\n * * SQL Data Type: nvarchar(50)"),EmployeeSupervisor:z.string().nullable().describe("\n * * Field Name: EmployeeSupervisor\n * * Display Name: Employee Supervisor\n * * SQL Data Type: nvarchar(81)"),EmployeeSupervisorEmail:z.string().nullable().describe("\n * * Field Name: EmployeeSupervisorEmail\n * * Display Name: Employee Supervisor Email\n * * SQL Data Type: nvarchar(100)")});/**
|
|
53691
54005
|
* zod schema definition for the entity MJ: Vector Databases
|
|
53692
|
-
*/var MJVectorDatabaseSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(100)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),DefaultURL:z.string().nullable().describe("\n * * Field Name: DefaultURL\n * * Display Name: Default URL\n * * SQL Data Type: nvarchar(255)\n * * Description: Field DefaultURL for entity Vector Databases."),ClassKey:z.string().nullable().describe("\n * * Field Name: ClassKey\n * * Display Name: Class Key\n * * SQL Data Type: nvarchar(100)\n * * Description: Field ClassKey for entity Vector Databases."),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()")});/**
|
|
54006
|
+
*/var MJVectorDatabaseSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(100)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),DefaultURL:z.string().nullable().describe("\n * * Field Name: DefaultURL\n * * Display Name: Default URL\n * * SQL Data Type: nvarchar(255)\n * * Description: Field DefaultURL for entity Vector Databases."),ClassKey:z.string().nullable().describe("\n * * Field Name: ClassKey\n * * Display Name: Class Key\n * * SQL Data Type: nvarchar(100)\n * * Description: Field ClassKey for entity Vector Databases."),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),Configuration:z.string().nullable().describe("\n * * Field Name: Configuration\n * * Display Name: Configuration\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON configuration settings for this vector database provider. Stores provider-specific connection settings like custom host URLs, authentication configuration, timeouts, retry policies, and batch size limits. NULL means use defaults from environment variables or provider defaults.")});/**
|
|
53693
54007
|
* zod schema definition for the entity MJ: Vector Indexes
|
|
53694
|
-
*/var MJVectorIndexSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(255)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),VectorDatabaseID:z.string().describe("\n * * Field Name: VectorDatabaseID\n * * Display Name: Vector Database
|
|
54008
|
+
*/var MJVectorIndexSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(255)"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)"),VectorDatabaseID:z.string().describe("\n * * Field Name: VectorDatabaseID\n * * Display Name: Vector Database\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Vector Databases (vwVectorDatabases.ID)"),EmbeddingModelID:z.string().describe("\n * * Field Name: EmbeddingModelID\n * * Display Name: Embedding Model\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),ExternalID:z.string().nullable().describe("\n * * Field Name: ExternalID\n * * Display Name: External ID\n * * SQL Data Type: nvarchar(500)\n * * Description: The provider's native identifier for this index. For Pinecone this is the index name; for other providers it may be a separate UUID or identifier. Used for syncing operations between MJ metadata and the remote vector database."),Dimensions:z.number().nullable().describe("\n * * Field Name: Dimensions\n * * Display Name: Dimensions\n * * SQL Data Type: int\n * * Description: The number of dimensions for vectors stored in this index. Determined by the embedding model (e.g., 1536 for text-embedding-3-small, 768 for all-mpnet-base-v2). Set automatically when the index is created via the vector database provider."),Metric:z.string().nullable().describe("\n * * Field Name: Metric\n * * Display Name: Distance Metric\n * * SQL Data Type: nvarchar(50)\n * * Description: The distance metric used for similarity calculations in this index. Common values: cosine (default, measures angular similarity), euclidean (L2 distance), dotproduct (inner product). Must match what the vector database provider was configured with."),ProviderConfig:z.string().nullable().describe("\n * * Field Name: ProviderConfig\n * * Display Name: Provider Configuration\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON object containing provider-specific configuration for this index. For Pinecone serverless: {\"cloud\":\"aws\",\"region\":\"us-east-1\"}. For pod-based: {\"environment\":\"us-east1-gcp\",\"podType\":\"p1.x1\",\"replicas\":1}. Stored as a flexible JSON bag to support any provider without schema changes."),VectorDatabase:z.string().describe("\n * * Field Name: VectorDatabase\n * * Display Name: Vector Database Name\n * * SQL Data Type: nvarchar(100)"),EmbeddingModel:z.string().describe("\n * * Field Name: EmbeddingModel\n * * Display Name: Embedding Model Name\n * * SQL Data Type: nvarchar(50)")});/**
|
|
53695
54009
|
* zod schema definition for the entity MJ: Version Installations
|
|
53696
54010
|
*/var MJVersionInstallationSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()"),MajorVersion:z.number().describe("\n * * Field Name: MajorVersion\n * * Display Name: Major Version\n * * SQL Data Type: int\n * * Description: Major version number installed."),MinorVersion:z.number().describe("\n * * Field Name: MinorVersion\n * * Display Name: Minor Version\n * * SQL Data Type: int\n * * Description: Minor version number installed."),PatchVersion:z.number().describe("\n * * Field Name: PatchVersion\n * * Display Name: Patch Version\n * * SQL Data Type: int\n * * Description: Patch version number installed."),Type:z.union([z.literal('New'),z.literal('Upgrade')]).nullable().describe("\n * * Field Name: Type\n * * Display Name: Installation Type\n * * SQL Data Type: nvarchar(20)\n * * Default Value: System\n * * Value List Type: List\n * * Possible Values \n * * New\n * * Upgrade\n * * Description: What type of installation was applied"),InstalledAt:z.date().describe("\n * * Field Name: InstalledAt\n * * Display Name: Installed At\n * * SQL Data Type: datetimeoffset\n * * Description: Timestamp when this version was installed."),Status:z.union([z.literal('Complete'),z.literal('Failed'),z.literal('In Progress'),z.literal('Pending')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Pending\n * * Value List Type: List\n * * Possible Values \n * * Complete\n * * Failed\n * * In Progress\n * * Pending\n * * Description: Pending, Complete, Failed"),InstallLog:z.string().nullable().describe("\n * * Field Name: InstallLog\n * * Display Name: Install Log\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Any logging that was saved from the installation process"),Comments:z.string().nullable().describe("\n * * Field Name: Comments\n * * Display Name: Comments\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Optional, comments the administrator wants to save for each installed version"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),CompleteVersion:z.string().nullable().describe("\n * * Field Name: CompleteVersion\n * * Display Name: Complete Version\n * * SQL Data Type: nvarchar(302)")});/**
|
|
53697
54011
|
* zod schema definition for the entity MJ: Version Label Items
|
|
@@ -60748,7 +61062,7 @@ provider=dist/* Metadata */.OS.Provider;_context61.p=1;_context61.n=2;return pro
|
|
|
60748
61062
|
* * Description: When true, the agent context must match for a cache hit. When false, agent-specific and non-agent results can be used interchangeably.
|
|
60749
61063
|
*/},{key:"CacheMustMatchAgent",get:function get(){return this.Get('CacheMustMatchAgent');},set:function set(value){this.Set('CacheMustMatchAgent',value);}/**
|
|
60750
61064
|
* * Field Name: CacheMustMatchConfig
|
|
60751
|
-
* * Display Name: Cache Must Match
|
|
61065
|
+
* * Display Name: Cache Must Match Config
|
|
60752
61066
|
* * SQL Data Type: bit
|
|
60753
61067
|
* * Default Value: 0
|
|
60754
61068
|
* * Description: When true, the configuration must match for a cache hit. When false, results from any configuration can be used.
|
|
@@ -60849,7 +61163,7 @@ provider=dist/* Metadata */.OS.Provider;_context61.p=1;_context61.n=2;return pro
|
|
|
60849
61163
|
* * Description: Maximum number of failover attempts before giving up
|
|
60850
61164
|
*/},{key:"FailoverMaxAttempts",get:function get(){return this.Get('FailoverMaxAttempts');},set:function set(value){this.Set('FailoverMaxAttempts',value);}/**
|
|
60851
61165
|
* * Field Name: FailoverDelaySeconds
|
|
60852
|
-
* * Display Name: Failover Delay (
|
|
61166
|
+
* * Display Name: Failover Delay (Seconds)
|
|
60853
61167
|
* * SQL Data Type: int
|
|
60854
61168
|
* * Default Value: 5
|
|
60855
61169
|
* * Description: Initial delay in seconds between failover attempts
|
|
@@ -60905,6 +61219,12 @@ provider=dist/* Metadata */.OS.Provider;_context61.p=1;_context61.n=2;return pro
|
|
|
60905
61219
|
* * SystemInstruction
|
|
60906
61220
|
* * Description: Controls behavior when the selected provider does not support native assistant prefill. Ignore = silently skip prefill, SystemInstruction = inject a system message instructing the model to start its response with the prefill text (uses fallback text from AI Model Vendor or AI Model Type), None = no fallback (prefill only works with supported providers).
|
|
60907
61221
|
*/},{key:"PrefillFallbackMode",get:function get(){return this.Get('PrefillFallbackMode');},set:function set(value){this.Set('PrefillFallbackMode',value);}/**
|
|
61222
|
+
* * Field Name: RequireSpecificModels
|
|
61223
|
+
* * Display Name: Require Specific Models
|
|
61224
|
+
* * SQL Data Type: bit
|
|
61225
|
+
* * Default Value: 0
|
|
61226
|
+
* * Description: Only applies when SelectionStrategy is Specific. When 0 (default), if none of the explicitly configured AIPromptModel entries have valid API credentials the system automatically falls back to Default/ByPower model selection across all active models matching the prompt AIModelTypeID. When 1, the system will hard-fail with an error instead of falling back, ensuring only the explicitly configured models are ever used.
|
|
61227
|
+
*/},{key:"RequireSpecificModels",get:function get(){return this.Get('RequireSpecificModels');},set:function set(value){this.Set('RequireSpecificModels',value);}/**
|
|
60908
61228
|
* * Field Name: Template
|
|
60909
61229
|
* * Display Name: Template Text
|
|
60910
61230
|
* * SQL Data Type: nvarchar(255)
|
|
@@ -69635,17 +69955,17 @@ provider=dist/* Metadata */.OS.Provider;_context130.p=1;_context130.n=2;return p
|
|
|
69635
69955
|
* * SQL Data Type: nvarchar(250)
|
|
69636
69956
|
*/},{key:"Name",get:function get(){return this.Get('Name');},set:function set(value){this.Set('Name',value);}/**
|
|
69637
69957
|
* * Field Name: TypeID
|
|
69638
|
-
* * Display Name: Type
|
|
69958
|
+
* * Display Name: Type
|
|
69639
69959
|
* * SQL Data Type: uniqueidentifier
|
|
69640
69960
|
* * Related Entity/Foreign Key: MJ: Entity Document Types (vwEntityDocumentTypes.ID)
|
|
69641
69961
|
*/},{key:"TypeID",get:function get(){return this.Get('TypeID');},set:function set(value){this.Set('TypeID',value);}/**
|
|
69642
69962
|
* * Field Name: EntityID
|
|
69643
|
-
* * Display Name: Entity
|
|
69963
|
+
* * Display Name: Entity
|
|
69644
69964
|
* * SQL Data Type: uniqueidentifier
|
|
69645
69965
|
* * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
|
|
69646
69966
|
*/},{key:"EntityID",get:function get(){return this.Get('EntityID');},set:function set(value){this.Set('EntityID',value);}/**
|
|
69647
69967
|
* * Field Name: VectorDatabaseID
|
|
69648
|
-
* * Display Name: Vector Database
|
|
69968
|
+
* * Display Name: Vector Database
|
|
69649
69969
|
* * SQL Data Type: uniqueidentifier
|
|
69650
69970
|
* * Related Entity/Foreign Key: MJ: Vector Databases (vwVectorDatabases.ID)
|
|
69651
69971
|
*/},{key:"VectorDatabaseID",get:function get(){return this.Get('VectorDatabaseID');},set:function set(value){this.Set('VectorDatabaseID',value);}/**
|
|
@@ -69659,12 +69979,12 @@ provider=dist/* Metadata */.OS.Provider;_context130.p=1;_context130.n=2;return p
|
|
|
69659
69979
|
* * Inactive
|
|
69660
69980
|
*/},{key:"Status",get:function get(){return this.Get('Status');},set:function set(value){this.Set('Status',value);}/**
|
|
69661
69981
|
* * Field Name: TemplateID
|
|
69662
|
-
* * Display Name: Template
|
|
69982
|
+
* * Display Name: Template
|
|
69663
69983
|
* * SQL Data Type: uniqueidentifier
|
|
69664
69984
|
* * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)
|
|
69665
69985
|
*/},{key:"TemplateID",get:function get(){return this.Get('TemplateID');},set:function set(value){this.Set('TemplateID',value);}/**
|
|
69666
69986
|
* * Field Name: AIModelID
|
|
69667
|
-
* * Display Name:
|
|
69987
|
+
* * Display Name: AI Model
|
|
69668
69988
|
* * SQL Data Type: uniqueidentifier
|
|
69669
69989
|
* * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)
|
|
69670
69990
|
*/},{key:"AIModelID",get:function get(){return this.Get('AIModelID');},set:function set(value){this.Set('AIModelID',value);}/**
|
|
@@ -69681,35 +70001,50 @@ provider=dist/* Metadata */.OS.Provider;_context130.p=1;_context130.n=2;return p
|
|
|
69681
70001
|
* * Description: Value between 0 and 1 that determines what is considered an absolute matching record. Value must be >= PotentialMatchThreshold. This is primarily used for duplicate detection but can be used for other applications as well where matching is relevant.
|
|
69682
70002
|
*/},{key:"AbsoluteMatchThreshold",get:function get(){return this.Get('AbsoluteMatchThreshold');},set:function set(value){this.Set('AbsoluteMatchThreshold',value);}/**
|
|
69683
70003
|
* * Field Name: __mj_CreatedAt
|
|
69684
|
-
* * Display Name:
|
|
70004
|
+
* * Display Name: Created At
|
|
69685
70005
|
* * SQL Data Type: datetimeoffset
|
|
69686
70006
|
* * Default Value: getutcdate()
|
|
69687
70007
|
*/},{key:"__mj_CreatedAt",get:function get(){return this.Get('__mj_CreatedAt');}/**
|
|
69688
70008
|
* * Field Name: __mj_UpdatedAt
|
|
69689
|
-
* * Display Name:
|
|
70009
|
+
* * Display Name: Updated At
|
|
69690
70010
|
* * SQL Data Type: datetimeoffset
|
|
69691
70011
|
* * Default Value: getutcdate()
|
|
69692
70012
|
*/},{key:"__mj_UpdatedAt",get:function get(){return this.Get('__mj_UpdatedAt');}/**
|
|
70013
|
+
* * Field Name: VectorIndexID
|
|
70014
|
+
* * Display Name: Vector Index
|
|
70015
|
+
* * SQL Data Type: uniqueidentifier
|
|
70016
|
+
* * Related Entity/Foreign Key: MJ: Vector Indexes (vwVectorIndexes.ID)
|
|
70017
|
+
* * Description: Optional foreign key to the specific Vector Index where this entity document's embeddings should be stored. When specified, the vectorization pipeline will upsert vectors directly to this index rather than auto-creating or looking up an index based on VectorDatabaseID + AIModelID. This enables explicit control over which Pinecone/Weaviate/etc. index is used per entity document, supporting multi-index architectures and shared indexes across entity types.
|
|
70018
|
+
*/},{key:"VectorIndexID",get:function get(){return this.Get('VectorIndexID');},set:function set(value){this.Set('VectorIndexID',value);}/**
|
|
70019
|
+
* * Field Name: Configuration
|
|
70020
|
+
* * Display Name: Configuration
|
|
70021
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
70022
|
+
* * Description: JSON configuration settings for this entity document. Controls vector metadata field inclusion (which fields get stored in the vector index for search result display), large field truncation limits, and future settings like sync scheduling and threshold overrides. NULL means use system defaults.
|
|
70023
|
+
*/},{key:"Configuration",get:function get(){return this.Get('Configuration');},set:function set(value){this.Set('Configuration',value);}/**
|
|
69693
70024
|
* * Field Name: Type
|
|
69694
|
-
* * Display Name: Type
|
|
70025
|
+
* * Display Name: Type Name
|
|
69695
70026
|
* * SQL Data Type: nvarchar(100)
|
|
69696
70027
|
*/},{key:"Type",get:function get(){return this.Get('Type');}/**
|
|
69697
70028
|
* * Field Name: Entity
|
|
69698
|
-
* * Display Name: Entity
|
|
70029
|
+
* * Display Name: Entity Name
|
|
69699
70030
|
* * SQL Data Type: nvarchar(255)
|
|
69700
70031
|
*/},{key:"Entity",get:function get(){return this.Get('Entity');}/**
|
|
69701
70032
|
* * Field Name: VectorDatabase
|
|
69702
|
-
* * Display Name: Vector Database
|
|
70033
|
+
* * Display Name: Vector Database Name
|
|
69703
70034
|
* * SQL Data Type: nvarchar(100)
|
|
69704
70035
|
*/},{key:"VectorDatabase",get:function get(){return this.Get('VectorDatabase');}/**
|
|
69705
70036
|
* * Field Name: Template
|
|
69706
|
-
* * Display Name: Template
|
|
70037
|
+
* * Display Name: Template Name
|
|
69707
70038
|
* * SQL Data Type: nvarchar(255)
|
|
69708
70039
|
*/},{key:"Template",get:function get(){return this.Get('Template');}/**
|
|
69709
70040
|
* * Field Name: AIModel
|
|
69710
|
-
* * Display Name:
|
|
70041
|
+
* * Display Name: AI Model Name
|
|
69711
70042
|
* * SQL Data Type: nvarchar(50)
|
|
69712
|
-
*/},{key:"AIModel",get:function get(){return this.Get('AIModel');}
|
|
70043
|
+
*/},{key:"AIModel",get:function get(){return this.Get('AIModel');}/**
|
|
70044
|
+
* * Field Name: VectorIndex
|
|
70045
|
+
* * Display Name: Vector Index Name
|
|
70046
|
+
* * SQL Data Type: nvarchar(255)
|
|
70047
|
+
*/},{key:"VectorIndex",get:function get(){return this.Get('VectorIndex');}}]);}(dist/* BaseEntity */.HC);MJEntityDocumentEntity=__decorate([(0,MJGlobal_dist/* RegisterClass */.Y5)(dist/* BaseEntity */.HC,'MJ: Entity Documents')],MJEntityDocumentEntity);/**
|
|
69713
70048
|
* MJ: Entity Field Values - strongly typed entity sub-class
|
|
69714
70049
|
* * Schema: __mj
|
|
69715
70050
|
* * Base Table: EntityFieldValue
|
|
@@ -80826,7 +81161,12 @@ if(this.RepeatCount!=null&&this.RepeatCount<=0){result.Errors.push(new dist/* Va
|
|
|
80826
81161
|
* * Display Name: Updated At
|
|
80827
81162
|
* * SQL Data Type: datetimeoffset
|
|
80828
81163
|
* * Default Value: getutcdate()
|
|
80829
|
-
*/},{key:"__mj_UpdatedAt",get:function get(){return this.Get('__mj_UpdatedAt');}
|
|
81164
|
+
*/},{key:"__mj_UpdatedAt",get:function get(){return this.Get('__mj_UpdatedAt');}/**
|
|
81165
|
+
* * Field Name: Configuration
|
|
81166
|
+
* * Display Name: Configuration
|
|
81167
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
81168
|
+
* * Description: JSON configuration settings for this vector database provider. Stores provider-specific connection settings like custom host URLs, authentication configuration, timeouts, retry policies, and batch size limits. NULL means use defaults from environment variables or provider defaults.
|
|
81169
|
+
*/},{key:"Configuration",get:function get(){return this.Get('Configuration');},set:function set(value){this.Set('Configuration',value);}}]);}(dist/* BaseEntity */.HC);MJVectorDatabaseEntity=__decorate([(0,MJGlobal_dist/* RegisterClass */.Y5)(dist/* BaseEntity */.HC,'MJ: Vector Databases')],MJVectorDatabaseEntity);/**
|
|
80830
81170
|
* MJ: Vector Indexes - strongly typed entity sub-class
|
|
80831
81171
|
* * Schema: __mj
|
|
80832
81172
|
* * Base Table: VectorIndex
|
|
@@ -80861,12 +81201,12 @@ if(this.RepeatCount!=null&&this.RepeatCount<=0){result.Errors.push(new dist/* Va
|
|
|
80861
81201
|
* * SQL Data Type: nvarchar(MAX)
|
|
80862
81202
|
*/},{key:"Description",get:function get(){return this.Get('Description');},set:function set(value){this.Set('Description',value);}/**
|
|
80863
81203
|
* * Field Name: VectorDatabaseID
|
|
80864
|
-
* * Display Name: Vector Database
|
|
81204
|
+
* * Display Name: Vector Database
|
|
80865
81205
|
* * SQL Data Type: uniqueidentifier
|
|
80866
81206
|
* * Related Entity/Foreign Key: MJ: Vector Databases (vwVectorDatabases.ID)
|
|
80867
81207
|
*/},{key:"VectorDatabaseID",get:function get(){return this.Get('VectorDatabaseID');},set:function set(value){this.Set('VectorDatabaseID',value);}/**
|
|
80868
81208
|
* * Field Name: EmbeddingModelID
|
|
80869
|
-
* * Display Name: Embedding Model
|
|
81209
|
+
* * Display Name: Embedding Model
|
|
80870
81210
|
* * SQL Data Type: uniqueidentifier
|
|
80871
81211
|
* * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)
|
|
80872
81212
|
*/},{key:"EmbeddingModelID",get:function get(){return this.Get('EmbeddingModelID');},set:function set(value){this.Set('EmbeddingModelID',value);}/**
|
|
@@ -80880,12 +81220,32 @@ if(this.RepeatCount!=null&&this.RepeatCount<=0){result.Errors.push(new dist/* Va
|
|
|
80880
81220
|
* * SQL Data Type: datetimeoffset
|
|
80881
81221
|
* * Default Value: getutcdate()
|
|
80882
81222
|
*/},{key:"__mj_UpdatedAt",get:function get(){return this.Get('__mj_UpdatedAt');}/**
|
|
81223
|
+
* * Field Name: ExternalID
|
|
81224
|
+
* * Display Name: External ID
|
|
81225
|
+
* * SQL Data Type: nvarchar(500)
|
|
81226
|
+
* * Description: The provider's native identifier for this index. For Pinecone this is the index name; for other providers it may be a separate UUID or identifier. Used for syncing operations between MJ metadata and the remote vector database.
|
|
81227
|
+
*/},{key:"ExternalID",get:function get(){return this.Get('ExternalID');},set:function set(value){this.Set('ExternalID',value);}/**
|
|
81228
|
+
* * Field Name: Dimensions
|
|
81229
|
+
* * Display Name: Dimensions
|
|
81230
|
+
* * SQL Data Type: int
|
|
81231
|
+
* * Description: The number of dimensions for vectors stored in this index. Determined by the embedding model (e.g., 1536 for text-embedding-3-small, 768 for all-mpnet-base-v2). Set automatically when the index is created via the vector database provider.
|
|
81232
|
+
*/},{key:"Dimensions",get:function get(){return this.Get('Dimensions');},set:function set(value){this.Set('Dimensions',value);}/**
|
|
81233
|
+
* * Field Name: Metric
|
|
81234
|
+
* * Display Name: Distance Metric
|
|
81235
|
+
* * SQL Data Type: nvarchar(50)
|
|
81236
|
+
* * Description: The distance metric used for similarity calculations in this index. Common values: cosine (default, measures angular similarity), euclidean (L2 distance), dotproduct (inner product). Must match what the vector database provider was configured with.
|
|
81237
|
+
*/},{key:"Metric",get:function get(){return this.Get('Metric');},set:function set(value){this.Set('Metric',value);}/**
|
|
81238
|
+
* * Field Name: ProviderConfig
|
|
81239
|
+
* * Display Name: Provider Configuration
|
|
81240
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
81241
|
+
* * Description: JSON object containing provider-specific configuration for this index. For Pinecone serverless: {"cloud":"aws","region":"us-east-1"}. For pod-based: {"environment":"us-east1-gcp","podType":"p1.x1","replicas":1}. Stored as a flexible JSON bag to support any provider without schema changes.
|
|
81242
|
+
*/},{key:"ProviderConfig",get:function get(){return this.Get('ProviderConfig');},set:function set(value){this.Set('ProviderConfig',value);}/**
|
|
80883
81243
|
* * Field Name: VectorDatabase
|
|
80884
|
-
* * Display Name: Vector Database
|
|
81244
|
+
* * Display Name: Vector Database Name
|
|
80885
81245
|
* * SQL Data Type: nvarchar(100)
|
|
80886
81246
|
*/},{key:"VectorDatabase",get:function get(){return this.Get('VectorDatabase');}/**
|
|
80887
81247
|
* * Field Name: EmbeddingModel
|
|
80888
|
-
* * Display Name: Embedding Model
|
|
81248
|
+
* * Display Name: Embedding Model Name
|
|
80889
81249
|
* * SQL Data Type: nvarchar(50)
|
|
80890
81250
|
*/},{key:"EmbeddingModel",get:function get(){return this.Get('EmbeddingModel');}}]);}(dist/* BaseEntity */.HC);MJVectorIndexEntity=__decorate([(0,MJGlobal_dist/* RegisterClass */.Y5)(dist/* BaseEntity */.HC,'MJ: Vector Indexes')],MJVectorIndexEntity);/**
|
|
80891
81251
|
* MJ: Version Installations - strongly typed entity sub-class
|
|
@@ -91593,6 +91953,13 @@ function ClassFactory_typeof(o) { "@babel/helpers - typeof"; return ClassFactory
|
|
|
91593
91953
|
function ClassFactory_construct(t, e, r) { if (ClassFactory_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && ClassFactory_setPrototypeOf(p, r.prototype), p; }
|
|
91594
91954
|
function ClassFactory_setPrototypeOf(t, e) { return ClassFactory_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, ClassFactory_setPrototypeOf(t, e); }
|
|
91595
91955
|
function ClassFactory_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (ClassFactory_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
91956
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
91957
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
91958
|
+
function ClassFactory_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = ClassFactory_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
91959
|
+
function ClassFactory_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return ClassFactory_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ClassFactory_arrayLikeToArray(r, a) : void 0; } }
|
|
91960
|
+
function ClassFactory_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
91961
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
91962
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
91596
91963
|
function ClassFactory_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ClassFactory_toPropertyKey(o.key), o); } }
|
|
91597
91964
|
function ClassFactory_createClass(e, r, t) { return r && ClassFactory_defineProperties(e.prototype, r), t && ClassFactory_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
91598
91965
|
function ClassFactory_toPropertyKey(t) { var i = ClassFactory_toPrimitive(t, "string"); return "symbol" == ClassFactory_typeof(i) ? i : i + ""; }
|
|
@@ -91623,17 +91990,198 @@ var ClassFactory = /*#__PURE__*/function () {
|
|
|
91623
91990
|
function ClassFactory() {
|
|
91624
91991
|
ClassFactory_classCallCheck(this, ClassFactory);
|
|
91625
91992
|
this._registrations = [];
|
|
91993
|
+
/**
|
|
91994
|
+
* Registered lazy loader callbacks. When `GetRegistrationAsync` or `CreateInstanceAsync`
|
|
91995
|
+
* cannot find a registration synchronously, these loaders are called in order until one
|
|
91996
|
+
* succeeds (returns `true`). This allows multiple consumers/layers to register their own
|
|
91997
|
+
* lazy loading strategies (e.g., Angular chunk loading, server-side dynamic imports).
|
|
91998
|
+
*
|
|
91999
|
+
* Each loader receives the base class name and key, and should return `true` if it
|
|
92000
|
+
* successfully loaded the module containing the requested class registration.
|
|
92001
|
+
*/
|
|
92002
|
+
this._lazyLoaders = [];
|
|
91626
92003
|
}
|
|
91627
92004
|
/**
|
|
91628
|
-
*
|
|
91629
|
-
*
|
|
91630
|
-
*
|
|
91631
|
-
*
|
|
91632
|
-
* @param
|
|
91633
|
-
*
|
|
91634
|
-
* @param autoRegisterWithRootClass If true, will automatically register the subclass with the root class of the baseClass hierarchy. This ensures proper priority ordering when multiple subclasses are registered in a hierarchy. Defaults to false to preserve the original registration contract where classes are stored under the baseClass you specify.
|
|
92005
|
+
* Registers a lazy loader callback that will be called when a class registration cannot
|
|
92006
|
+
* be found synchronously. Multiple loaders can be registered and will be called in order
|
|
92007
|
+
* until one succeeds.
|
|
92008
|
+
*
|
|
92009
|
+
* @param loader A function that receives (baseClassName, key) and returns a Promise<boolean>
|
|
92010
|
+
* indicating whether it successfully loaded the module containing the registration.
|
|
91635
92011
|
*/
|
|
91636
92012
|
return ClassFactory_createClass(ClassFactory, [{
|
|
92013
|
+
key: "RegisterLazyLoader",
|
|
92014
|
+
value: function RegisterLazyLoader(loader) {
|
|
92015
|
+
this._lazyLoaders.push(loader);
|
|
92016
|
+
}
|
|
92017
|
+
/**
|
|
92018
|
+
* Attempts to lazy-load a missing registration by calling registered lazy loaders in order.
|
|
92019
|
+
* Returns true if any loader successfully loaded the requested class.
|
|
92020
|
+
*/
|
|
92021
|
+
}, {
|
|
92022
|
+
key: "tryLazyLoad",
|
|
92023
|
+
value: (function () {
|
|
92024
|
+
var _tryLazyLoad = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(baseClass, key) {
|
|
92025
|
+
var baseClassName, _iterator, _step, loader, loaded, _t;
|
|
92026
|
+
return _regenerator().w(function (_context) {
|
|
92027
|
+
while (1) switch (_context.p = _context.n) {
|
|
92028
|
+
case 0:
|
|
92029
|
+
baseClassName = baseClass.name;
|
|
92030
|
+
_iterator = ClassFactory_createForOfIteratorHelper(this._lazyLoaders);
|
|
92031
|
+
_context.p = 1;
|
|
92032
|
+
_iterator.s();
|
|
92033
|
+
case 2:
|
|
92034
|
+
if ((_step = _iterator.n()).done) {
|
|
92035
|
+
_context.n = 5;
|
|
92036
|
+
break;
|
|
92037
|
+
}
|
|
92038
|
+
loader = _step.value;
|
|
92039
|
+
_context.n = 3;
|
|
92040
|
+
return loader(baseClassName, key);
|
|
92041
|
+
case 3:
|
|
92042
|
+
loaded = _context.v;
|
|
92043
|
+
if (!loaded) {
|
|
92044
|
+
_context.n = 4;
|
|
92045
|
+
break;
|
|
92046
|
+
}
|
|
92047
|
+
return _context.a(2, true);
|
|
92048
|
+
case 4:
|
|
92049
|
+
_context.n = 2;
|
|
92050
|
+
break;
|
|
92051
|
+
case 5:
|
|
92052
|
+
_context.n = 7;
|
|
92053
|
+
break;
|
|
92054
|
+
case 6:
|
|
92055
|
+
_context.p = 6;
|
|
92056
|
+
_t = _context.v;
|
|
92057
|
+
_iterator.e(_t);
|
|
92058
|
+
case 7:
|
|
92059
|
+
_context.p = 7;
|
|
92060
|
+
_iterator.f();
|
|
92061
|
+
return _context.f(7);
|
|
92062
|
+
case 8:
|
|
92063
|
+
return _context.a(2, false);
|
|
92064
|
+
}
|
|
92065
|
+
}, _callee, this, [[1, 6, 7, 8]]);
|
|
92066
|
+
}));
|
|
92067
|
+
function tryLazyLoad(_x, _x2) {
|
|
92068
|
+
return _tryLazyLoad.apply(this, arguments);
|
|
92069
|
+
}
|
|
92070
|
+
return tryLazyLoad;
|
|
92071
|
+
}()
|
|
92072
|
+
/**
|
|
92073
|
+
* Async version of GetRegistration that supports lazy loading. If no registration is found
|
|
92074
|
+
* synchronously and lazy loaders are registered, attempts to load the missing module before
|
|
92075
|
+
* retrying the lookup.
|
|
92076
|
+
*
|
|
92077
|
+
* @param baseClass The base class to look up
|
|
92078
|
+
* @param key Optional key to differentiate registrations
|
|
92079
|
+
* @returns The matching ClassRegistration, or null if not found even after lazy loading
|
|
92080
|
+
*/
|
|
92081
|
+
)
|
|
92082
|
+
}, {
|
|
92083
|
+
key: "GetRegistrationAsync",
|
|
92084
|
+
value: (function () {
|
|
92085
|
+
var _GetRegistrationAsync = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(baseClass, key) {
|
|
92086
|
+
var reg, loaded;
|
|
92087
|
+
return _regenerator().w(function (_context2) {
|
|
92088
|
+
while (1) switch (_context2.n) {
|
|
92089
|
+
case 0:
|
|
92090
|
+
reg = this.GetRegistration(baseClass, key);
|
|
92091
|
+
if (!(!reg && key && this._lazyLoaders.length > 0)) {
|
|
92092
|
+
_context2.n = 2;
|
|
92093
|
+
break;
|
|
92094
|
+
}
|
|
92095
|
+
_context2.n = 1;
|
|
92096
|
+
return this.tryLazyLoad(baseClass, key);
|
|
92097
|
+
case 1:
|
|
92098
|
+
loaded = _context2.v;
|
|
92099
|
+
if (loaded) {
|
|
92100
|
+
reg = this.GetRegistration(baseClass, key);
|
|
92101
|
+
}
|
|
92102
|
+
case 2:
|
|
92103
|
+
return _context2.a(2, reg);
|
|
92104
|
+
}
|
|
92105
|
+
}, _callee2, this);
|
|
92106
|
+
}));
|
|
92107
|
+
function GetRegistrationAsync(_x3, _x4) {
|
|
92108
|
+
return _GetRegistrationAsync.apply(this, arguments);
|
|
92109
|
+
}
|
|
92110
|
+
return GetRegistrationAsync;
|
|
92111
|
+
}()
|
|
92112
|
+
/**
|
|
92113
|
+
* Async version of CreateInstance that supports lazy loading. If no registration is found
|
|
92114
|
+
* synchronously and lazy loaders are registered, attempts to load the missing module before
|
|
92115
|
+
* retrying and creating the instance.
|
|
92116
|
+
*
|
|
92117
|
+
* Falls back to instantiating the base class directly if no registration is found even
|
|
92118
|
+
* after lazy loading (same behavior as the sync CreateInstance).
|
|
92119
|
+
*/
|
|
92120
|
+
)
|
|
92121
|
+
}, {
|
|
92122
|
+
key: "CreateInstanceAsync",
|
|
92123
|
+
value: (function () {
|
|
92124
|
+
var _CreateInstanceAsync = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(baseClass) {
|
|
92125
|
+
var key,
|
|
92126
|
+
reg,
|
|
92127
|
+
_len,
|
|
92128
|
+
params,
|
|
92129
|
+
_key,
|
|
92130
|
+
SubClassConstructor,
|
|
92131
|
+
BaseClassConstructor,
|
|
92132
|
+
_args3 = arguments;
|
|
92133
|
+
return _regenerator().w(function (_context3) {
|
|
92134
|
+
while (1) switch (_context3.n) {
|
|
92135
|
+
case 0:
|
|
92136
|
+
key = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
|
|
92137
|
+
if (baseClass) {
|
|
92138
|
+
_context3.n = 1;
|
|
92139
|
+
break;
|
|
92140
|
+
}
|
|
92141
|
+
return _context3.a(2, null);
|
|
92142
|
+
case 1:
|
|
92143
|
+
_context3.n = 2;
|
|
92144
|
+
return this.GetRegistrationAsync(baseClass, key);
|
|
92145
|
+
case 2:
|
|
92146
|
+
reg = _context3.v;
|
|
92147
|
+
for (_len = _args3.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
92148
|
+
params[_key - 2] = _args3[_key];
|
|
92149
|
+
}
|
|
92150
|
+
if (!reg) {
|
|
92151
|
+
_context3.n = 4;
|
|
92152
|
+
break;
|
|
92153
|
+
}
|
|
92154
|
+
SubClassConstructor = reg.SubClass;
|
|
92155
|
+
if (!(params !== undefined)) {
|
|
92156
|
+
_context3.n = 3;
|
|
92157
|
+
break;
|
|
92158
|
+
}
|
|
92159
|
+
return _context3.a(2, ClassFactory_construct(SubClassConstructor, params));
|
|
92160
|
+
case 3:
|
|
92161
|
+
return _context3.a(2, new SubClassConstructor());
|
|
92162
|
+
case 4:
|
|
92163
|
+
// Fallback to base class (same as sync CreateInstance)
|
|
92164
|
+
BaseClassConstructor = baseClass;
|
|
92165
|
+
return _context3.a(2, ClassFactory_construct(BaseClassConstructor, params));
|
|
92166
|
+
}
|
|
92167
|
+
}, _callee3, this);
|
|
92168
|
+
}));
|
|
92169
|
+
function CreateInstanceAsync(_x5) {
|
|
92170
|
+
return _CreateInstanceAsync.apply(this, arguments);
|
|
92171
|
+
}
|
|
92172
|
+
return CreateInstanceAsync;
|
|
92173
|
+
}()
|
|
92174
|
+
/**
|
|
92175
|
+
* Use this method or the @RegisterClass decorator to register a sub-class for a given base class.
|
|
92176
|
+
* @param baseClass A reference to the base class you are registering a sub-class for
|
|
92177
|
+
* @param subClass A reference to the sub-class you are registering
|
|
92178
|
+
* @param key A key can be used to differentiate registrations for the same base class/sub-class combination. For example, in the case of BaseEntity and Entity object subclasses we'll have a LOT of entries and we want to get the highest priority registered sub-class for a specific key. In that case, the key is the entity name, but the key can be any value you want to use to differentiate registrations.
|
|
92179
|
+
* @param priority Higher priority registrations will be used over lower priority registrations. If there are multiple registrations for a given base class/sub-class/key combination, the one with the highest priority will be used. If there are multiple registrations with the same priority, the last one registered will be used. Finally, if you do NOT provide this setting, the order of registrations will increment the priority automatically so dependency injection will typically care care of this. That is, in order for Class B, a subclass of Class A, to be registered properly, Class A code has to already have been loaded and therefore Class A's RegisterClass decorator was run. In that scenario, if neither Class A or B has a priority setting, Class A would be 1 and Class B would be 2 automatically. For this reason, you only need to explicitly set priority if you want to do something atypical as this mechanism normally will solve for setting the priority correctly based on the furthest descendant class that is registered.
|
|
92180
|
+
* @param skipNullKeyWarning If true, will not print a warning if the key is null or undefined. This is useful for cases where you know that the key is not needed and you don't want to see the warning in the console.
|
|
92181
|
+
* @param autoRegisterWithRootClass If true, will automatically register the subclass with the root class of the baseClass hierarchy. This ensures proper priority ordering when multiple subclasses are registered in a hierarchy. Defaults to false to preserve the original registration contract where classes are stored under the baseClass you specify.
|
|
92182
|
+
*/
|
|
92183
|
+
)
|
|
92184
|
+
}, {
|
|
91637
92185
|
key: "Register",
|
|
91638
92186
|
value: function Register(baseClass, subClass) {
|
|
91639
92187
|
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
@@ -91696,8 +92244,8 @@ var ClassFactory = /*#__PURE__*/function () {
|
|
|
91696
92244
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
91697
92245
|
if (baseClass) {
|
|
91698
92246
|
var reg = this.GetRegistration(baseClass, key);
|
|
91699
|
-
for (var
|
|
91700
|
-
params[
|
|
92247
|
+
for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
92248
|
+
params[_key2 - 2] = arguments[_key2];
|
|
91701
92249
|
}
|
|
91702
92250
|
if (reg) {
|
|
91703
92251
|
var SubClassConstructor = reg.SubClass;
|