@memberjunction/react-runtime 6.1.3 → 6.1.5

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.
@@ -19101,7 +19101,7 @@ function reportUnhandledError(err) {
19101
19101
 
19102
19102
  /***/ },
19103
19103
 
19104
- /***/ 954
19104
+ /***/ 839
19105
19105
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19106
19106
 
19107
19107
  "use strict";
@@ -19114,6 +19114,7 @@ __webpack_require__.d(__webpack_exports__, {
19114
19114
  oLK: () => (/* reexport */ BaseInfo),
19115
19115
  s5U: () => (/* reexport */ BaseRemotableOperation),
19116
19116
  BT8: () => (/* reexport */ CompositeKey),
19117
+ ik_: () => (/* reexport */ EntityEventRowIsFree),
19117
19118
  $S8: () => (/* reexport */ EntityFieldTSType),
19118
19119
  $FE: () => (/* reexport */ EntityPermissionType),
19119
19120
  Ic6: () => (/* reexport */ GetProductionStatus),
@@ -19133,6 +19134,8 @@ __webpack_require__.d(__webpack_exports__, {
19133
19134
  cpK: () => (/* reexport */ ProviderType),
19134
19135
  ecJ: () => (/* reexport */ ReadableFieldsTransportKey),
19135
19136
  imK: () => (/* reexport */ RegisterForStartup),
19137
+ ncE: () => (/* reexport */ ResolveEntityEventKey),
19138
+ sf4: () => (/* reexport */ ResolveEntityEventRow),
19136
19139
  E_K: () => (/* reexport */ RunQuery),
19137
19140
  JjF: () => (/* reexport */ RunView),
19138
19141
  YEN: () => (/* binding */ SetProvider),
@@ -19149,7 +19152,7 @@ __webpack_require__.d(__webpack_exports__, {
19149
19152
  IaG: () => (/* reexport */ getGraphQLTypeNameBase)
19150
19153
  });
19151
19154
 
19152
- // UNUSED EXPORTS: AUTH_PROVIDER_TYPES, AfterKeyNotSupportedError, AllMetadata, AllMetadataArrays, ApplicationEntityInfo, ApplicationInfo, ApplicationSettingInfo, ApplyFormChromeRules, AuditLogTypeInfo, AuthorizationEvaluator, AuthorizationInfo, AuthorizationRoleInfo, AuthorizationRoleType, BaseEnginePropertyConfig, BaseEngineRegistry, BaseEntityAIActionParams, BaseEntityEvent, BaseEntitySaveQueue, COMPANION_PAYLOAD_KEY, CacheCategory, ClearAllDataHooks, CodeNameFromString, CoerceImageSrc, CoerceRawImageBase64ToDataUri, ColumnDescriptor, CommonStopWords, CompositeFilter, ComputeRRF, Concurrent, ConsoleColor, ContributionInclusionFromRules, DEFAULT_AUTO_LEFT_NAV_AT, DEFAULT_MAX_INLINE_IMAGE_BYTES, DEFAULT_PRIMARY_RELATED_BUDGET, DataObjectParams, DataObjectRelatedEntityParam, DataSnapshot, DataTable, DatabaseProviderBase, EmbeddedGeoVirtualNames, EmbeddedRecord, EncodeNewRecordValuesForURL, EntityCompanion, EntityDeleteOptions, EntityDependency, EntityDocumentTypeInfo, EntityField, EntityFieldExtendedTypes, EntityFieldGraphQLType, EntityFieldInfo, EntityFieldPermissionInfo, EntityFieldRules, EntityFieldValueInfo, EntityFieldValueListType, EntityHasMapCoordinates, EntityInfo, EntityMergeOptions, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo, EntityPermissionEffect, EntityPermissionInfo, EntityRecordNameInput, EntityRecordNameResult, EntityRelationshipInfo, EntitySaveOptions, EntitySavePlan, EntitySettingInfo, EntitySubtypeResolver, EntityUserPermissionInfo, ExecuteEntitySavePlan, ExplorerNavigationItem, ExternalDataSourceReadRouter, ExtractActualDefaultValue, FieldPermissionAccess, FieldSecurityDenialMessage, FieldSecurityError, FieldSecurityWriteDenialMessage, FieldValueCollection, FormatByteSize, FormatConsoleMessage, FormatFileMessage, FormatFilterField, FormatValue, GeneratedFormSectionType, GetDataHooks, GetEntityNameFromSchemaAndViewString, GridColumnDescriptor, HasNativeLatLngFields, IsCompositeFilter, IsInlineImageDataUri, IsKeysetPaginationOrderableType, IsMaterializedDataSource, IsNewEntityRecordUrlId, IsPermittedImageFieldValue, IsRestrictingFieldRule, IsSimpleFilter, IsValidCssColor, KEYSET_PAGINATION_ORDERABLE_PK_TYPES, KeyValuePair, LibraryInfo, ListEmbeddedGeoSpecs, LoadOnStartup, LoadRelatedRecordsBatched, LocalCacheManager, LogDebug, MJColumnDescriptor, MJ_CORE_SCHEMA, MaxInlineImageBytes, MaxStoredImageChars, MetadataFromSimpleObject, MetadataFromSimpleObjectWithoutUser, MetadataInfo, NEW_ENTITY_RECORD_URL_ID, NEW_RECORD_VALUES_QUERY_PARAM, NativeLatitudeField, NativeLongitudeField, NormalizeImageHref, NormalizeToTables, PLATFORM_SCHEMA_NAME, ParseCssHexColor, ParseEntityConfiguration, ParseEntityFieldConfiguration, ParseEntityRelationshipConfiguration, ParsePlatformVariants, PermissionConstrainedError, PotentialDuplicate, PotentialDuplicateRequest, PotentialDuplicateResponse, PotentialDuplicateResult, PrettyPrintJson, ProjectRecordChangePayloadJSON, ProjectRowsToFields, QueryCache, QueryCategoryInfo, QueryDependencyInfo, QueryEntityInfo, QueryExecutionSpec, QueryFieldInfo, QueryInfo, QueryParameterInfo, QueryPermissionInfo, QueryResultEnricherBase, QuerySQLInfo, RELATED_ROLE_SCORE, RUN_QUERY_SQL_FILTERS, RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS, ReadRelationshipInclusion, ReadRelationshipJoinFields, ReadRelationshipSortKey, RecordChange, RecordChangeEntityIDField, RecordChangeFieldSecurityProjector, RecordChangeJSONPayloadFields, RecordChangePayloadFields, RecordChangeProsePayloadField, RecordChangeStatus, RecordChangesEntityName, RecordDependency, RecordMergeDetailResult, RecordMergeRequest, RecordMergeResult, RecordUrlMatchesTab, RegisterDataHook, RelatedRecordCollection, ResolveFormLayout, ResolveMapLatitudeField, ResolveMapLongitudeField, ResolvePlatformVariant, ResolveRelatedFormRoles, ResolveStartupMode, ResourceUrlsEquivalent, RoleInfo, RowLevelSecurityFilterInfo, RunInEntityTransaction, RunMaybeSerial, RunQuerySQLFilterManager, RunViewParams, SAVE_ENTITY_GRAPH_OPERATION_KEY, SQLDialectInfo, SQLFullType, SQLMaxLength, STARTUP_MODE_ENV_VAR, SaveEntityGraphOperation, ScoreRelatedFormRole, SetProductionStatus, SetVerboseLogging, SeverityType, ShouldJoinRecordGeoCodes, StripContainingParens, StripSingleQuotes, StripStopWords, StripUnicodePrefix, TelemetryLevelValue, TelemetryManager, TotalAvailableRowCount, TotalRowCount, TransactionPreprocessingItem, TransactionVariable, TryParseJsonText, TypeScriptTypeFromSQLType, TypeScriptTypeFromSQLTypeWithNullableOption, UpdateCurrentConsoleLine, UpdateCurrentConsoleProgress, WellKnownUserSource, dispatchRemoteOperationInProcess, distinctSchemaNames, entitiesInSchemas, getAnsiColorCode, getRunQuerySQLFilter, getRunQuerySQLFilterNames, getSchemaPrefix, groupEntitiesBySchema, isAIParams, isBatchRunQueryParams, isBatchRunViewParams, isCacheParams, isEngineParams, isNetworkParams, isSingleRunQueryParams, isSingleRunViewParams, resolveQueryResultEnricher, sanitizeGraphQLName, summarizeEntitiesForContext
19155
+ // UNUSED EXPORTS: AUTH_PROVIDER_TYPES, AfterKeyNotSupportedError, AllMetadata, AllMetadataArrays, ApplicationEntityInfo, ApplicationInfo, ApplicationSettingInfo, ApplyFormChromeRules, AuditLogTypeInfo, AuthorizationEvaluator, AuthorizationInfo, AuthorizationRoleInfo, AuthorizationRoleType, BaseEnginePropertyConfig, BaseEngineRegistry, BaseEntityAIActionParams, BaseEntityEvent, BaseEntitySaveQueue, COMPANION_PAYLOAD_KEY, CacheCategory, ClearAllDataHooks, CodeNameFromString, CoerceImageSrc, CoerceRawImageBase64ToDataUri, ColumnDescriptor, CommonStopWords, CompositeFilter, ComputeRRF, Concurrent, ConsoleColor, ContributionInclusionFromRules, DEFAULT_AUTO_LEFT_NAV_AT, DEFAULT_MAX_INLINE_IMAGE_BYTES, DEFAULT_PRIMARY_RELATED_BUDGET, DataObjectParams, DataObjectRelatedEntityParam, DataSnapshot, DataTable, DatabaseProviderBase, EmbeddedGeoVirtualNames, EmbeddedRecord, EncodeNewRecordValuesForURL, EntityCompanion, EntityDeleteOptions, EntityDependency, EntityDocumentTypeInfo, EntityField, EntityFieldExtendedTypes, EntityFieldGraphQLType, EntityFieldInfo, EntityFieldPermissionInfo, EntityFieldRules, EntityFieldValueInfo, EntityFieldValueListType, EntityHasMapCoordinates, EntityInfo, EntityMergeOptions, EntityOrganicKeyInfo, EntityOrganicKeyRelatedEntityInfo, EntityPermissionEffect, EntityPermissionInfo, EntityRecordNameInput, EntityRecordNameResult, EntityRelationshipInfo, EntitySaveOptions, EntitySavePlan, EntitySettingInfo, EntitySubtypeResolver, EntityUserPermissionInfo, ExecuteEntitySavePlan, ExplorerNavigationItem, ExternalDataSourceReadRouter, ExtractActualDefaultValue, FieldPermissionAccess, FieldSecurityDenialMessage, FieldSecurityError, FieldSecurityWriteDenialMessage, FieldValueCollection, FormatByteSize, FormatConsoleMessage, FormatDateOnly, FormatFileMessage, FormatFilterField, FormatValue, GeneratedFormSectionType, GetDataHooks, GetEntityNameFromSchemaAndViewString, GridColumnDescriptor, HasNativeLatLngFields, IsCompositeFilter, IsDateOnlySQLType, IsInlineImageDataUri, IsKeysetPaginationOrderableType, IsMaterializedDataSource, IsNewEntityRecordUrlId, IsPermittedImageFieldValue, IsRestrictingFieldRule, IsSimpleFilter, IsValidCssColor, KEYSET_PAGINATION_ORDERABLE_PK_TYPES, KeyValuePair, LibraryInfo, ListEmbeddedGeoSpecs, LoadOnStartup, LoadRelatedRecordsBatched, LocalCacheManager, LogDebug, MJColumnDescriptor, MJ_CORE_SCHEMA, MaxInlineImageBytes, MaxStoredImageChars, MetadataFromSimpleObject, MetadataFromSimpleObjectWithoutUser, MetadataInfo, NEW_ENTITY_RECORD_URL_ID, NEW_RECORD_VALUES_QUERY_PARAM, NativeLatitudeField, NativeLongitudeField, NormalizeImageHref, NormalizeToTables, PLATFORM_SCHEMA_NAME, ParseCssHexColor, ParseEntityConfiguration, ParseEntityFieldConfiguration, ParseEntityRelationshipConfiguration, ParsePlatformVariants, PermissionConstrainedError, PotentialDuplicate, PotentialDuplicateRequest, PotentialDuplicateResponse, PotentialDuplicateResult, PrettyPrintJson, ProjectRecordChangePayloadJSON, ProjectRowsToFields, QueryCache, QueryCategoryInfo, QueryDependencyInfo, QueryEntityInfo, QueryExecutionSpec, QueryFieldInfo, QueryInfo, QueryParameterInfo, QueryPermissionInfo, QueryResultEnricherBase, QuerySQLInfo, RELATED_ROLE_SCORE, RUN_QUERY_SQL_FILTERS, RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS, ReadRelationshipInclusion, ReadRelationshipJoinFields, ReadRelationshipSortKey, RecordChange, RecordChangeEntityIDField, RecordChangeFieldSecurityProjector, RecordChangeJSONPayloadFields, RecordChangePayloadFields, RecordChangeProsePayloadField, RecordChangeStatus, RecordChangesEntityName, RecordDependency, RecordMergeDetailResult, RecordMergeRequest, RecordMergeResult, RecordUrlMatchesTab, RegisterDataHook, RelatedRecordCollection, ResolveFormLayout, ResolveMapLatitudeField, ResolveMapLongitudeField, ResolvePlatformVariant, ResolveRelatedFormRoles, ResolveStartupMode, ResourceUrlsEquivalent, RoleInfo, RowLevelSecurityFilterInfo, RunInEntityTransaction, RunMaybeSerial, RunQuerySQLFilterManager, RunViewParams, SAVE_ENTITY_GRAPH_OPERATION_KEY, SQLDialectInfo, SQLFullType, SQLMaxLength, STARTUP_MODE_ENV_VAR, SaveEntityGraphOperation, ScoreRelatedFormRole, SetProductionStatus, SetVerboseLogging, SeverityType, ShouldJoinRecordGeoCodes, StripContainingParens, StripSingleQuotes, StripStopWords, StripUnicodePrefix, TelemetryLevelValue, TelemetryManager, TotalAvailableRowCount, TotalRowCount, TransactionPreprocessingItem, TransactionVariable, TryParseJsonText, TypeScriptTypeFromSQLType, TypeScriptTypeFromSQLTypeWithNullableOption, UpdateCurrentConsoleLine, UpdateCurrentConsoleProgress, WellKnownUserSource, dispatchRemoteOperationInProcess, distinctSchemaNames, entitiesInSchemas, getAnsiColorCode, getRunQuerySQLFilter, getRunQuerySQLFilterNames, getSchemaPrefix, groupEntitiesBySchema, isAIParams, isBatchRunQueryParams, isBatchRunViewParams, isCacheParams, isEngineParams, isNetworkParams, isSingleRunQueryParams, isSingleRunViewParams, resolveQueryResultEnricher, sanitizeGraphQLName, summarizeEntitiesForContext
19153
19156
 
19154
19157
  // EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 25 modules
19155
19158
  var dist = __webpack_require__(401);
@@ -20126,6 +20129,11 @@ function formatTypeString(mapped, length, precision, scale) {
20126
20129
  }
20127
20130
  return mapped.typeName;
20128
20131
  }
20132
+ /**
20133
+ * SQL Server functions caller-supplied SQL may not call: the rowset functions that reach other
20134
+ * servers, databases or files, and the functions that read trace, audit and extended-event files.
20135
+ */
20136
+ var SQL_SERVER_CALLER_SQL_FORBIDDEN_FUNCTIONS = ['openrowset', 'openquery', 'opendatasource', 'fn_get_audit_file', 'fn_xe_file_target_read_file', 'fn_trace_gettable'];
20129
20137
  /**
20130
20138
  * SQL Server dialect implementation.
20131
20139
  * Uses [bracket] quoting, TOP for pagination, BIT for booleans, T-SQL functions.
@@ -20150,12 +20158,13 @@ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
20150
20158
  }, {
20151
20159
  key: "QuoteIdentifier",
20152
20160
  value: function QuoteIdentifier(name) {
20153
- return "[".concat(name, "]");
20161
+ // Double any embedded `]` so the name cannot end early and the rest of it read as SQL.
20162
+ return "[".concat(name.replace(/]/g, ']]'), "]");
20154
20163
  }
20155
20164
  }, {
20156
20165
  key: "QuoteSchema",
20157
20166
  value: function QuoteSchema(schema, object) {
20158
- return "[".concat(schema, "].[").concat(object, "]");
20167
+ return "".concat(this.QuoteIdentifier(schema), ".").concat(this.QuoteIdentifier(object));
20159
20168
  }
20160
20169
  /**
20161
20170
  * SQL Server identifiers are case-insensitive by default, so a bare
@@ -20496,6 +20505,51 @@ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
20496
20505
  get: function get() {
20497
20506
  return '(SELECT NULL)';
20498
20507
  }
20508
+ }, {
20509
+ key: "SelectListPagingOrderBy",
20510
+ get: function get() {
20511
+ return '1';
20512
+ }
20513
+ }, {
20514
+ key: "PagingRequiresOrderBy",
20515
+ get: function get() {
20516
+ return true;
20517
+ }
20518
+ }, {
20519
+ key: "SupportsEscapeStringLiterals",
20520
+ get: function get() {
20521
+ return false;
20522
+ }
20523
+ }, {
20524
+ key: "SupportsDollarQuotedStrings",
20525
+ get: function get() {
20526
+ return false;
20527
+ }
20528
+ }, {
20529
+ key: "QueryHintKeyword",
20530
+ get: function get() {
20531
+ return 'OPTION';
20532
+ }
20533
+ }, {
20534
+ key: "CallerSQLForbiddenFunctions",
20535
+ get: function get() {
20536
+ return SQL_SERVER_CALLER_SQL_FORBIDDEN_FUNCTIONS;
20537
+ }
20538
+ }, {
20539
+ key: "StringLiteralPrefix",
20540
+ value: function StringLiteralPrefix(text) {
20541
+ return /[^\x00-\x7F]/.test(text) ? 'N' : '';
20542
+ }
20543
+ }, {
20544
+ key: "EscapeLikePattern",
20545
+ value: function EscapeLikePattern(text) {
20546
+ return text.replace(/\[/g, '[[]').replace(/%/g, '[%]').replace(/_/g, '[_]');
20547
+ }
20548
+ }, {
20549
+ key: "BooleanParameterValue",
20550
+ value: function BooleanParameterValue(value) {
20551
+ return value ? 1 : 0;
20552
+ }
20499
20553
  // ─── Data Types ──────────────────────────────────────────────────
20500
20554
  }, {
20501
20555
  key: "TypeMap",
@@ -21103,6 +21157,14 @@ function postgresqlDialect_formatTypeString(mapped, length, precision, scale) {
21103
21157
  }
21104
21158
  return mapped.typeName;
21105
21159
  }
21160
+ /**
21161
+ * PostgreSQL functions caller-supplied SQL may not call: the XML exporters that run SQL given as a
21162
+ * string (`query_to_xml`, `cursor_to_xml`, `table_to_xml`, `schema_to_xml`, `database_to_xml` and
21163
+ * their schema variants), the text-search functions that do the same (`ts_stat`, `ts_rewrite`),
21164
+ * `dblink`, the server-file readers, large objects, and the administrative
21165
+ * functions a read-only transaction does not stop.
21166
+ */
21167
+ var POSTGRESQL_CALLER_SQL_FORBIDDEN_FUNCTIONS = ['query_to_xml*', 'cursor_to_xml*', 'table_to_xml*', 'schema_to_xml*', 'database_to_xml*', 'ts_stat', 'ts_rewrite', 'dblink*', 'pg_read_file', 'pg_read_binary_file', 'pg_ls_*', 'pg_stat_file', 'pg_file_*', 'lo_*', 'pg_terminate_backend', 'pg_cancel_backend', 'pg_reload_conf', 'pg_rotate_logfile', 'pg_promote', 'pg_switch_wal', 'pg_create_restore_point', 'pg_log_backend_memory_contexts'];
21106
21168
  /**
21107
21169
  * PostgreSQL dialect implementation.
21108
21170
  * Uses "double-quote" identifiers, LIMIT/OFFSET pagination, native BOOLEAN, PL/pgSQL functions.
@@ -21548,6 +21610,51 @@ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
21548
21610
  get: function get() {
21549
21611
  return '1';
21550
21612
  }
21613
+ }, {
21614
+ key: "SelectListPagingOrderBy",
21615
+ get: function get() {
21616
+ return null;
21617
+ }
21618
+ }, {
21619
+ key: "PagingRequiresOrderBy",
21620
+ get: function get() {
21621
+ return false;
21622
+ }
21623
+ }, {
21624
+ key: "SupportsEscapeStringLiterals",
21625
+ get: function get() {
21626
+ return true;
21627
+ }
21628
+ }, {
21629
+ key: "SupportsDollarQuotedStrings",
21630
+ get: function get() {
21631
+ return true;
21632
+ }
21633
+ }, {
21634
+ key: "QueryHintKeyword",
21635
+ get: function get() {
21636
+ return null;
21637
+ }
21638
+ }, {
21639
+ key: "CallerSQLForbiddenFunctions",
21640
+ get: function get() {
21641
+ return POSTGRESQL_CALLER_SQL_FORBIDDEN_FUNCTIONS;
21642
+ }
21643
+ }, {
21644
+ key: "StringLiteralPrefix",
21645
+ value: function StringLiteralPrefix(_text) {
21646
+ return '';
21647
+ }
21648
+ }, {
21649
+ key: "EscapeLikePattern",
21650
+ value: function EscapeLikePattern(text) {
21651
+ return text.replace(/\\/g, '\\\\').replace(/%/g, '\\%').replace(/_/g, '\\_');
21652
+ }
21653
+ }, {
21654
+ key: "BooleanParameterValue",
21655
+ value: function BooleanParameterValue(value) {
21656
+ return value;
21657
+ }
21551
21658
  // ─── Data Types ──────────────────────────────────────────────────
21552
21659
  }, {
21553
21660
  key: "TypeMap",
@@ -21827,7 +21934,9 @@ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
21827
21934
  }(SQLDialect);
21828
21935
  _PostgreSQLDialect = PostgreSQLDialect;
21829
21936
  _PostgreSQLDialect._BooleanTypeNames = ['bool', 'boolean'];
21830
- _PostgreSQLDialect._StringTypeNames = ['text', 'varchar', 'char', 'character', 'character varying', 'bpchar', 'citext', 'name'];
21937
+ // `tsvector` / `tsquery` (full-text search, e.g. CodeGen's `__mj_fts_vector`) serialize as
21938
+ // text. Without them here they fall through to Int and break GraphQL serialization.
21939
+ _PostgreSQLDialect._StringTypeNames = ['text', 'varchar', 'char', 'character', 'character varying', 'bpchar', 'citext', 'name', 'tsvector', 'tsquery'];
21831
21940
  /**
21832
21941
  * PG fixed-width / space-padded char types. `character` (without `varying`)
21833
21942
  * and `bpchar` are the formal/internal names; `char` is the short alias.
@@ -22312,11 +22421,6 @@ var pgDialect = new PostgreSQLDialect();
22312
22421
  * is also an MJ column name (`NAME`, `TEXT`, `VALUES`, `LENGTH`, …) is safe to include:
22313
22422
  * the mixed-case column form still quotes.
22314
22423
  */
22315
- /**
22316
- * Known tokenization limitations (comments containing an apostrophe, and `E'...'` escape
22317
- * strings) are tracked as **MJ #3775** — pre-existing, unchanged by the consolidation, and now
22318
- * fixable in one place rather than two.
22319
- */
22320
22424
  /**
22321
22425
  * NOT the only identifier quoter in MJ, and deliberately so.
22322
22426
  *
@@ -23112,10 +23216,48 @@ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try {
23112
23216
  function util_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = util_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; } } }; }
23113
23217
  function util_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return util_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) ? util_arrayLikeToArray(r, a) : void 0; } }
23114
23218
  function util_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; }
23219
+ function util_typeof(o) { "@babel/helpers - typeof"; return util_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; }, util_typeof(o); }
23115
23220
  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); }
23116
23221
  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); }); }; }
23222
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23223
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23224
+ function _defineProperty(e, r, t) { return (r = util_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23225
+ function util_toPropertyKey(t) { var i = util_toPrimitive(t, "string"); return "symbol" == util_typeof(i) ? i : i + ""; }
23226
+ function util_toPrimitive(t, r) { if ("object" != util_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != util_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23117
23227
 
23118
23228
 
23229
+ /**
23230
+ * Whether a SQL type is the date-only `date` type: a calendar day with no time and no zone, as
23231
+ * opposed to any of the timestamp types, which name an instant. The distinction decides which
23232
+ * zone a value may be rendered in, and getting it wrong moves the day (see FormatDateOnly).
23233
+ * The same spelling covers SQL Server and PostgreSQL.
23234
+ */
23235
+ function IsDateOnlySQLType(sqlType) {
23236
+ return (sqlType !== null && sqlType !== void 0 ? sqlType : '').trim().toLowerCase() === 'date';
23237
+ }
23238
+ /**
23239
+ * Formats a date-only value as the calendar day it stores, in the reader's locale format.
23240
+ *
23241
+ * A `date` column arrives as a Date at UTC midnight. Passing that through a local-time formatter
23242
+ * subtracts the reader's offset and lands on the previous day for everyone west of Greenwich: a
23243
+ * stored 2026-11-20 renders as 11/19/2026 in America/New_York, and 2026-01-01 as 12/31/2025, the
23244
+ * wrong year. Pinning the zone to UTC rather than switching to toISOString() keeps the reader's
23245
+ * locale format (a US reader still sees 11/20/2026, a UK reader 20/11/2026) and changes only the
23246
+ * zone the day is computed in. Any `options` the caller passes are honoured except the zone.
23247
+ *
23248
+ * @param value A Date, an epoch number, or a date string; an unparseable value is returned as-is
23249
+ * @param options Intl date options (month/day/year styles, dateStyle, weekday); timeZone is always UTC
23250
+ * @param locale Locale for the format; defaults to the runtime's locale
23251
+ */
23252
+ function FormatDateOnly(value, options, locale) {
23253
+ var date = value instanceof Date ? value : new Date(value);
23254
+ if (isNaN(date.getTime())) {
23255
+ return String(value);
23256
+ }
23257
+ return date.toLocaleDateString(locale, _objectSpread(_objectSpread({}, options), {}, {
23258
+ timeZone: 'UTC'
23259
+ }));
23260
+ }
23119
23261
  /**
23120
23262
  * Returns the TypeScript type that corresponds to the SQL type passed in.
23121
23263
  *
@@ -23187,6 +23329,9 @@ function FormatValueInternal(sqlType, value) {
23187
23329
  maximumFractionDigits: decimals
23188
23330
  }).format(value);
23189
23331
  }
23332
+ if (IsDateOnlySQLType(sqlType)) {
23333
+ return FormatDateOnly(value);
23334
+ }
23190
23335
  if (IsDateSQLType(sqlType) || IsIntervalSQLType(sqlType)) {
23191
23336
  return new Intl.DateTimeFormat().format(new Date(value));
23192
23337
  }
@@ -27126,9 +27271,9 @@ _Metadata = Metadata;
27126
27271
  _Metadata._globalProviderKey = 'MJ_MetadataProvider';
27127
27272
  ;// ../../MJCore/dist/generic/entityConfiguration.js
27128
27273
  /* unused harmony import specifier */ var SafeJSONParse;
27129
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27130
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27131
- function _defineProperty(e, r, t) { return (r = entityConfiguration_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
27274
+ function entityConfiguration_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27275
+ function entityConfiguration_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? entityConfiguration_ownKeys(Object(t), !0).forEach(function (r) { entityConfiguration_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : entityConfiguration_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27276
+ function entityConfiguration_defineProperty(e, r, t) { return (r = entityConfiguration_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
27132
27277
  function entityConfiguration_toPropertyKey(t) { var i = entityConfiguration_toPrimitive(t, "string"); return "symbol" == entityConfiguration_typeof(i) ? i : i + ""; }
27133
27278
  function entityConfiguration_toPrimitive(t, r) { if ("object" != entityConfiguration_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != entityConfiguration_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
27134
27279
  function entityConfiguration_toConsumableArray(r) { return entityConfiguration_arrayWithoutHoles(r) || entityConfiguration_iterableToArray(r) || entityConfiguration_unsupportedIterableToArray(r) || entityConfiguration_nonIterableSpread(); }
@@ -27463,7 +27608,7 @@ function applyRelationshipRule(assignment, rule) {
27463
27608
  var role = inclusion === 'Primary' ? 'Primary' : 'Detail';
27464
27609
  var reason = inclusion === 'Primary' ? 'install-primary' : inclusion === 'More' ? 'install-more' : 'install-none';
27465
27610
  var join = rule.JoinFields && rule.JoinFields.length > 0 ? rule.JoinFields : assignment.JoinFields;
27466
- return _objectSpread(_objectSpread({}, assignment), {}, {
27611
+ return entityConfiguration_objectSpread(entityConfiguration_objectSpread({}, assignment), {}, {
27467
27612
  Role: role,
27468
27613
  Inclusion: inclusion,
27469
27614
  Reason: reason,
@@ -45637,6 +45782,10 @@ _RunQuery = RunQuery;
45637
45782
  _RunQuery._globalProviderKey = 'MJ_RunQueryProvider';
45638
45783
  ;// ../../MJCore/dist/generic/telemetryManager.js
45639
45784
  var _TelemetryManager;
45785
+ function telemetryManager_slicedToArray(r, e) { return telemetryManager_arrayWithHoles(r) || telemetryManager_iterableToArrayLimit(r, e) || telemetryManager_unsupportedIterableToArray(r, e) || telemetryManager_nonIterableRest(); }
45786
+ function telemetryManager_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45787
+ function telemetryManager_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
45788
+ function telemetryManager_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
45640
45789
  function telemetryManager_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = telemetryManager_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; } } }; }
45641
45790
  function telemetryManager_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
45642
45791
  function telemetryManager_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? telemetryManager_ownKeys(Object(t), !0).forEach(function (r) { telemetryManager_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : telemetryManager_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -45996,6 +46145,7 @@ var DEFAULT_SETTINGS = {
45996
46145
  autoTrim: {
45997
46146
  enabled: true,
45998
46147
  maxEvents: 10000,
46148
+ maxInsights: 1000,
45999
46149
  maxAgeMs: 30 * 60 * 1000 // 30 minutes
46000
46150
  },
46001
46151
  duplicateDetection: {
@@ -46007,6 +46157,12 @@ var DEFAULT_SETTINGS = {
46007
46157
  dedupeWindowMs: 30000 // 30 seconds
46008
46158
  }
46009
46159
  };
46160
+ /**
46161
+ * How often the O(n) map sweeps in `trimIfNeeded` are allowed to run. `trimIfNeeded` is called on
46162
+ * every recorded event; walking `_patterns` and `_insightDedupeWindow` that often would make
46163
+ * telemetry cost scale with its own history.
46164
+ */
46165
+ var DEEP_TRIM_INTERVAL_MS = 60000;
46010
46166
  // ============================================================================
46011
46167
  // TELEMETRY MANAGER
46012
46168
  // ============================================================================
@@ -46031,6 +46187,12 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
46031
46187
  _this2._analyzers = [];
46032
46188
  _this2._insights = [];
46033
46189
  _this2._insightDedupeWindow = new Map();
46190
+ /**
46191
+ * When the two map sweeps in {@link trimIfNeeded} last ran. They are O(n) over their maps,
46192
+ * while `trimIfNeeded` itself runs on every recorded event, so they are throttled rather than
46193
+ * paid per event.
46194
+ */
46195
+ _this2._lastDeepTrimAt = 0;
46034
46196
  _this2._settings = _this2.loadSettings();
46035
46197
  _this2.registerBuiltInAnalyzers();
46036
46198
  return _this2;
@@ -46809,6 +46971,7 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
46809
46971
  }, {
46810
46972
  key: "trimIfNeeded",
46811
46973
  value: function trimIfNeeded() {
46974
+ var _this$_settings$autoT2;
46812
46975
  if (!this._settings.autoTrim.enabled) return;
46813
46976
  var _this$_settings$autoT = this._settings.autoTrim,
46814
46977
  maxEvents = _this$_settings$autoT.maxEvents,
@@ -46824,6 +46987,56 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
46824
46987
  if (maxEvents && this._events.length > maxEvents) {
46825
46988
  this._events = this._events.slice(-maxEvents);
46826
46989
  }
46990
+ // Three collections derived from `_events` need bounding on the same schedule: `_insights`
46991
+ // gains an entry per emitted warning, `_patterns` one per distinct fingerprint — and every
46992
+ // new filter combination is a distinct fingerprint — and `_insightDedupeWindow` one per
46993
+ // dedupe key. Unbounded, they retain for the life of the process.
46994
+ var maxInsights = (_this$_settings$autoT2 = this._settings.autoTrim.maxInsights) !== null && _this$_settings$autoT2 !== void 0 ? _this$_settings$autoT2 : 1000;
46995
+ if (maxInsights && this._insights.length > maxInsights) {
46996
+ this._insights = this._insights.slice(-maxInsights);
46997
+ }
46998
+ // The sweeps below walk whole maps, so they are throttled rather than run per event. Both
46999
+ // collections are bounded by time rather than count: an entry that stops recurring should age
47000
+ // out, while one that keeps recurring is live data a count cap would evict for nothing.
47001
+ if (now - this._lastDeepTrimAt > DEEP_TRIM_INTERVAL_MS) {
47002
+ var _this$_settings$analy, _this$_settings$analy2;
47003
+ this._lastDeepTrimAt = now;
47004
+ if (maxAgeMs) {
47005
+ var _iterator2 = telemetryManager_createForOfIteratorHelper(this._patterns),
47006
+ _step2;
47007
+ try {
47008
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
47009
+ var _step2$value = telemetryManager_slicedToArray(_step2.value, 2),
47010
+ fingerprint = _step2$value[0],
47011
+ pattern = _step2$value[1];
47012
+ if (now - pattern.lastSeen > maxAgeMs) {
47013
+ this._patterns.delete(fingerprint);
47014
+ }
47015
+ }
47016
+ } catch (err) {
47017
+ _iterator2.e(err);
47018
+ } finally {
47019
+ _iterator2.f();
47020
+ }
47021
+ }
47022
+ var dedupeWindowMs = (_this$_settings$analy = (_this$_settings$analy2 = this._settings.analyzers) === null || _this$_settings$analy2 === void 0 ? void 0 : _this$_settings$analy2.dedupeWindowMs) !== null && _this$_settings$analy !== void 0 ? _this$_settings$analy : 30000;
47023
+ var _iterator3 = telemetryManager_createForOfIteratorHelper(this._insightDedupeWindow),
47024
+ _step3;
47025
+ try {
47026
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
47027
+ var _step3$value = telemetryManager_slicedToArray(_step3.value, 2),
47028
+ key = _step3$value[0],
47029
+ seenAt = _step3$value[1];
47030
+ if (now - seenAt > dedupeWindowMs) {
47031
+ this._insightDedupeWindow.delete(key);
47032
+ }
47033
+ }
47034
+ } catch (err) {
47035
+ _iterator3.e(err);
47036
+ } finally {
47037
+ _iterator3.f();
47038
+ }
47039
+ }
46827
47040
  }
46828
47041
  }, {
46829
47042
  key: "loadSettings",
@@ -46932,18 +47145,18 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
46932
47145
  totalMs: 0
46933
47146
  }
46934
47147
  };
46935
- var _iterator2 = telemetryManager_createForOfIteratorHelper(this._events),
46936
- _step2;
47148
+ var _iterator4 = telemetryManager_createForOfIteratorHelper(this._events),
47149
+ _step4;
46937
47150
  try {
46938
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
46939
- var event = _step2.value;
47151
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
47152
+ var event = _step4.value;
46940
47153
  byCategory[event.category].events++;
46941
47154
  byCategory[event.category].totalMs += event.elapsedMs || 0;
46942
47155
  }
46943
47156
  } catch (err) {
46944
- _iterator2.e(err);
47157
+ _iterator4.e(err);
46945
47158
  } finally {
46946
- _iterator2.f();
47159
+ _iterator4.f();
46947
47160
  }
46948
47161
  var byCategoryWithAvg = {};
46949
47162
  for (var _i = 0, _Object$keys = Object.keys(byCategory); _i < _Object$keys.length; _i++) {
@@ -54406,6 +54619,8 @@ var ProviderBase = /*#__PURE__*/function () {
54406
54619
  this._metadataMemberRefreshTimer = null;
54407
54620
  this._clientFingerprintMemo = new WeakMap();
54408
54621
  this._cachedVisibleExplorerNavigationItems = null;
54622
+ /** Guard for {@link logMetadataSnapshotDisabledOnce}. */
54623
+ this._metadataSnapshotSkipLogged = false;
54409
54624
  }
54410
54625
  /**
54411
54626
  * Whether this provider can execute a multi-record unit of work atomically, in-process.
@@ -61436,6 +61651,13 @@ var ProviderBase = /*#__PURE__*/function () {
61436
61651
  }
61437
61652
  return _context61.a(2);
61438
61653
  case 1:
61654
+ if (this.MetadataSnapshotPersistenceEnabled) {
61655
+ _context61.n = 2;
61656
+ break;
61657
+ }
61658
+ this.logMetadataSnapshotDisabledOnce();
61659
+ return _context61.a(2);
61660
+ case 2:
61439
61661
  overallStart = Date.now(); // The metadata snapshot uses three keys (timestamps, format, AllMetadata).
61440
61662
  // Pull them in a single batched read — saves two IDB transaction round-trips
61441
61663
  // on warm boot. The values are still strings (string storage is intentional
@@ -61445,9 +61667,9 @@ var ProviderBase = /*#__PURE__*/function () {
61445
61667
  dataKey = this.LocalStoragePrefix + ProviderBase.localStorageAllMetadataKey;
61446
61668
  membershipKey = this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey;
61447
61669
  readStart = Date.now();
61448
- _context61.n = 2;
61670
+ _context61.n = 3;
61449
61671
  return ls.GetItems([tsKey, fmtKey, dataKey, membershipKey]);
61450
- case 2:
61672
+ case 3:
61451
61673
  all = _context61.v;
61452
61674
  readMs = Date.now() - readStart;
61453
61675
  tsRaw = (_all$get = all.get(tsKey)) !== null && _all$get !== void 0 ? _all$get : null;
@@ -61471,15 +61693,15 @@ var ProviderBase = /*#__PURE__*/function () {
61471
61693
  }
61472
61694
  }
61473
61695
  if (raw) {
61474
- _context61.n = 3;
61696
+ _context61.n = 4;
61475
61697
  break;
61476
61698
  }
61477
61699
  return _context61.a(2);
61478
- case 3:
61700
+ case 4:
61479
61701
  // Decompress if stored in compressed format, otherwise parse directly
61480
61702
  parseStart = Date.now();
61481
61703
  if (!(format === 'gzip' && typeof raw === 'string')) {
61482
- _context61.n = 5;
61704
+ _context61.n = 6;
61483
61705
  break;
61484
61706
  }
61485
61707
  // Compressed path: base64 → binary → gzip decompress → JSON parse
@@ -61487,24 +61709,24 @@ var ProviderBase = /*#__PURE__*/function () {
61487
61709
  blob = new Blob([binary]);
61488
61710
  ds = new DecompressionStream('gzip');
61489
61711
  decompressedStream = blob.stream().pipeThrough(ds);
61490
- _context61.n = 4;
61712
+ _context61.n = 5;
61491
61713
  return new Response(decompressedStream).text();
61492
- case 4:
61714
+ case 5:
61493
61715
  jsonString = _context61.v;
61494
61716
  temp = JSON.parse(jsonString);
61495
- _context61.n = 6;
61717
+ _context61.n = 7;
61496
61718
  break;
61497
- case 5:
61719
+ case 6:
61498
61720
  // Legacy uncompressed path
61499
61721
  temp = typeof raw === 'string' ? JSON.parse(raw) : raw;
61500
- case 6:
61722
+ case 7:
61501
61723
  parseMs = Date.now() - parseStart;
61502
61724
  if (temp) {
61503
- _context61.n = 7;
61725
+ _context61.n = 8;
61504
61726
  break;
61505
61727
  }
61506
61728
  return _context61.a(2);
61507
- case 7:
61729
+ case 8:
61508
61730
  // Reconstruct typed metadata objects from the parsed JSON
61509
61731
  deserializeStart = Date.now();
61510
61732
  metadata = MetadataFromSimpleObject(temp, this);
@@ -61519,16 +61741,16 @@ var ProviderBase = /*#__PURE__*/function () {
61519
61741
  } else {
61520
61742
  LogError('[Metadata Cache] MetadataFromSimpleObject returned undefined — cache deserialization failed. Check console for per-item errors above.');
61521
61743
  }
61522
- _context61.n = 9;
61744
+ _context61.n = 10;
61523
61745
  break;
61524
- case 8:
61525
- _context61.p = 8;
61746
+ case 9:
61747
+ _context61.p = 9;
61526
61748
  _t21 = _context61.v;
61527
61749
  LogError("[Metadata Cache] LoadLocalMetadataFromStorage failed: ".concat(_t21 instanceof Error ? _t21.message : String(_t21)));
61528
- case 9:
61750
+ case 10:
61529
61751
  return _context61.a(2);
61530
61752
  }
61531
- }, _callee58, this, [[0, 8]]);
61753
+ }, _callee58, this, [[0, 9]]);
61532
61754
  }));
61533
61755
  function LoadLocalMetadataFromStorage() {
61534
61756
  return _LoadLocalMetadataFromStorage.apply(this, arguments);
@@ -61546,6 +61768,47 @@ var ProviderBase = /*#__PURE__*/function () {
61546
61768
  function get() {
61547
61769
  return "";
61548
61770
  }
61771
+ /**
61772
+ * Whether anything could read the metadata snapshot back, and therefore whether saving it is
61773
+ * worth the cost.
61774
+ *
61775
+ * The snapshot lets a cold process start from a cached copy of the metadata instead of querying
61776
+ * for it, which only works if the store outlives the writer. Where it does not, both halves of
61777
+ * the round trip are pure cost: the save serializes, gzips and base64-encodes the entire
61778
+ * metadata graph, and the load parses it and rebuilds every `EntityInfo` and `EntityFieldInfo`
61779
+ * from a copy of objects the heap already holds. On a large tenant that is expensive enough to
61780
+ * exhaust the heap.
61781
+ *
61782
+ * A provider that does not declare {@link ILocalStorageProvider.SupportsCrossProcessPersistence}
61783
+ * is treated as persistent, which fails in the safer direction.
61784
+ */
61785
+ }, {
61786
+ key: "MetadataSnapshotPersistenceEnabled",
61787
+ get: function get() {
61788
+ var ls = this.LocalStorageProvider;
61789
+ if (!ls) {
61790
+ return false;
61791
+ }
61792
+ return ls.SupportsCrossProcessPersistence !== false;
61793
+ }
61794
+ /**
61795
+ * Explains the skip once per process. The refresh path runs every 30 seconds on a busy server,
61796
+ * so logging per call would bury the one line that matters.
61797
+ */
61798
+ }, {
61799
+ key: "logMetadataSnapshotDisabledOnce",
61800
+ value: function logMetadataSnapshotDisabledOnce() {
61801
+ var _this$LocalStoragePro, _this$LocalStoragePro2;
61802
+ if (this._metadataSnapshotSkipLogged) {
61803
+ return;
61804
+ }
61805
+ this._metadataSnapshotSkipLogged = true;
61806
+ var name = (_this$LocalStoragePro = (_this$LocalStoragePro2 = this.LocalStorageProvider) === null || _this$LocalStoragePro2 === void 0 || (_this$LocalStoragePro2 = _this$LocalStoragePro2.constructor) === null || _this$LocalStoragePro2 === void 0 ? void 0 : _this$LocalStoragePro2.name) !== null && _this$LocalStoragePro !== void 0 ? _this$LocalStoragePro : 'the local storage provider';
61807
+ LogStatusEx({
61808
+ message: "[Metadata Cache] Snapshot persistence disabled: ".concat(name, " is in-process only, so a saved snapshot could never be read back. Skipping the metadata snapshot save and load."),
61809
+ verboseOnly: false
61810
+ });
61811
+ }
61549
61812
  /**
61550
61813
  * Saves current metadata to local storage for caching.
61551
61814
  * Serializes both timestamps and full metadata collections.
@@ -61566,6 +61829,13 @@ var ProviderBase = /*#__PURE__*/function () {
61566
61829
  }
61567
61830
  return _context62.a(2);
61568
61831
  case 1:
61832
+ if (this.MetadataSnapshotPersistenceEnabled) {
61833
+ _context62.n = 2;
61834
+ break;
61835
+ }
61836
+ this.logMetadataSnapshotDisabledOnce();
61837
+ return _context62.a(2);
61838
+ case 2:
61569
61839
  start = Date.now(); // Serialize the AllMetadata object FIRST. If this throws (or the payload write below
61570
61840
  // fails), nothing else has been written yet, so the previously stored timestamps still
61571
61841
  // describe the previously stored payload and LocalMetadataObsolete() will report
@@ -61573,31 +61843,31 @@ var ProviderBase = /*#__PURE__*/function () {
61573
61843
  // before the payload left the cache claiming freshness with no payload behind it, and
61574
61844
  // that state was never retried.
61575
61845
  jsonString = JSON.stringify(this._localMetadata);
61576
- _context62.n = 2;
61846
+ _context62.n = 3;
61577
61847
  return this.writeMetadataSnapshot(ls, jsonString);
61578
- case 2:
61848
+ case 3:
61579
61849
  snapshot = _context62.v;
61580
61850
  if (!((_this$_metadataDatase2 = this._metadataDatasetEntityNames) !== null && _this$_metadataDatase2 !== void 0 && _this$_metadataDatase2.size)) {
61581
- _context62.n = 3;
61851
+ _context62.n = 4;
61582
61852
  break;
61583
61853
  }
61584
- _context62.n = 3;
61585
- return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey, JSON.stringify(providerBase_toConsumableArray(this._metadataDatasetEntityNames)));
61586
- case 3:
61587
61854
  _context62.n = 4;
61588
- return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageTimestampsKey, JSON.stringify(this._latestLocalMetadataTimestamps));
61855
+ return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey, JSON.stringify(providerBase_toConsumableArray(this._metadataDatasetEntityNames)));
61589
61856
  case 4:
61857
+ _context62.n = 5;
61858
+ return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageTimestampsKey, JSON.stringify(this._latestLocalMetadataTimestamps));
61859
+ case 5:
61590
61860
  this.logMetadataSaveComplete(Date.now() - start, jsonString.length, snapshot);
61591
- _context62.n = 6;
61861
+ _context62.n = 7;
61592
61862
  break;
61593
- case 5:
61594
- _context62.p = 5;
61863
+ case 6:
61864
+ _context62.p = 6;
61595
61865
  _t22 = _context62.v;
61596
61866
  LogError("[Metadata Cache] SaveLocalMetadataToStorage failed: ".concat(_t22 instanceof Error ? _t22.message : String(_t22)));
61597
- case 6:
61867
+ case 7:
61598
61868
  return _context62.a(2);
61599
61869
  }
61600
- }, _callee59, this, [[0, 5]]);
61870
+ }, _callee59, this, [[0, 6]]);
61601
61871
  }));
61602
61872
  function SaveLocalMetadataToStorage() {
61603
61873
  return _SaveLocalMetadataToStorage.apply(this, arguments);
@@ -61867,6 +62137,18 @@ var ProviderBase = /*#__PURE__*/function () {
61867
62137
  * Used for compressed metadata storage/retrieval.
61868
62138
  */
61869
62139
  function base64ToArrayBuffer(base64) {
62140
+ // Node decodes natively; the atob path below allocates an intermediate string and fills the
62141
+ // array a byte at a time.
62142
+ if (typeof Buffer !== 'undefined') {
62143
+ var buf = Buffer.from(base64, 'base64');
62144
+ // Copy into an exact-size buffer: `buf.buffer` is a view into a shared pool, usually
62145
+ // larger than the payload, so returning it directly would carry unrelated bytes and a
62146
+ // wrong byteLength. It is also typed ArrayBufferLike and will not assign to the
62147
+ // declared return type.
62148
+ var exact = new ArrayBuffer(buf.byteLength);
62149
+ new Uint8Array(exact).set(buf);
62150
+ return exact;
62151
+ }
61870
62152
  var binaryString = atob(base64);
61871
62153
  var bytes = new Uint8Array(binaryString.length);
61872
62154
  for (var i = 0; i < binaryString.length; i++) {
@@ -61881,6 +62163,11 @@ var ProviderBase = /*#__PURE__*/function () {
61881
62163
  }, {
61882
62164
  key: "arrayBufferToBase64",
61883
62165
  value: function arrayBufferToBase64(buffer) {
62166
+ // Node encodes natively. The loop below concatenates one character per byte, building a rope
62167
+ // the size of the payload that then has to be flattened.
62168
+ if (typeof Buffer !== 'undefined') {
62169
+ return Buffer.from(buffer).toString('base64');
62170
+ }
61884
62171
  var bytes = new Uint8Array(buffer);
61885
62172
  var binary = '';
61886
62173
  for (var i = 0; i < bytes.byteLength; i++) {
@@ -65360,6 +65647,154 @@ function resolveQueryResultEnricher(key) {
65360
65647
  }
65361
65648
  return factory.CreateInstance(QueryResultEnricherBase, key);
65362
65649
  }
65650
+ ;// ../../MJCore/dist/generic/remoteEventRow.js
65651
+ function remoteEventRow_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 remoteEventRow_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]())) : (remoteEventRow_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, remoteEventRow_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, remoteEventRow_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), remoteEventRow_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", remoteEventRow_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), remoteEventRow_regeneratorDefine2(u), remoteEventRow_regeneratorDefine2(u, o, "Generator"), remoteEventRow_regeneratorDefine2(u, n, function () { return this; }), remoteEventRow_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (remoteEventRow_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
65652
+ function remoteEventRow_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } remoteEventRow_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { remoteEventRow_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)); }, remoteEventRow_regeneratorDefine2(e, r, n, t); }
65653
+ function remoteEventRow_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); }
65654
+ function remoteEventRow_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { remoteEventRow_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { remoteEventRow_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
65655
+
65656
+
65657
+ /**
65658
+ * The row behind an entity event, however it has to be obtained.
65659
+ *
65660
+ * Three sources, in order:
65661
+ * 1. **Local event** — `event.baseEntity` is the live instance; its fields are already in hand.
65662
+ * 2. **Remote event carrying `recordData`** — the entity is on the broadcast allowlist; parse it.
65663
+ * 3. **Remote event without `recordData`** — re-read the one record by primary key through
65664
+ * `provider`, as `contextUser`. This is the access-controlled path, and it is the only one
65665
+ * that can supply fields the primary key does not carry (a detail's `ConversationID`, say).
65666
+ *
65667
+ * @returns the row's fields, or `null` when there is no key to read by, the read is refused, or
65668
+ * the record no longer exists. Callers should treat `null` as "not mine / nothing to do"
65669
+ * rather than as a failure — a refused read is the expected outcome for a session that
65670
+ * may not see the record.
65671
+ */
65672
+ function ResolveEntityEventRow(_x, _x2, _x3) {
65673
+ return _ResolveEntityEventRow.apply(this, arguments);
65674
+ }
65675
+ /**
65676
+ * Can this event's row be obtained WITHOUT a provider round-trip?
65677
+ *
65678
+ * True for a local event — the row IS the live entity — and for a remote event whose payload
65679
+ * already carries `recordData`, because the entity is on the server's broadcast allowlist.
65680
+ *
65681
+ * Callers that skip hydration to avoid a read must ask this FIRST. A free row is never worth
65682
+ * skipping, and skipping one is indistinguishable, downstream, from a row that could not be read:
65683
+ * the handler receives `null` and reads every field as `undefined`. Whether a handler *would* use
65684
+ * the row and whether obtaining it *costs* anything are two different questions, and only the
65685
+ * second justifies skipping.
65686
+ */
65687
+ function _ResolveEntityEventRow() {
65688
+ _ResolveEntityEventRow = remoteEventRow_asyncToGenerator(/*#__PURE__*/remoteEventRow_regenerator().m(function _callee(event, provider, contextUser) {
65689
+ var payload, _t;
65690
+ return remoteEventRow_regenerator().w(function (_context) {
65691
+ while (1) switch (_context.p = _context.n) {
65692
+ case 0:
65693
+ if (!event.baseEntity) {
65694
+ _context.n = 1;
65695
+ break;
65696
+ }
65697
+ return _context.a(2, event.baseEntity.GetAll());
65698
+ case 1:
65699
+ payload = event.payload;
65700
+ if (!(payload !== null && payload !== void 0 && payload.recordData)) {
65701
+ _context.n = 4;
65702
+ break;
65703
+ }
65704
+ _context.p = 2;
65705
+ return _context.a(2, JSON.parse(payload.recordData));
65706
+ case 3:
65707
+ _context.p = 3;
65708
+ _t = _context.v;
65709
+ case 4:
65710
+ _context.n = 5;
65711
+ return reReadByPrimaryKey(event, payload, provider, contextUser);
65712
+ case 5:
65713
+ return _context.a(2, _context.v);
65714
+ }
65715
+ }, _callee, null, [[2, 3]]);
65716
+ }));
65717
+ return _ResolveEntityEventRow.apply(this, arguments);
65718
+ }
65719
+ function EntityEventRowIsFree(event) {
65720
+ if (event.baseEntity) {
65721
+ return true;
65722
+ }
65723
+ var payload = event.payload;
65724
+ return !!(payload !== null && payload !== void 0 && payload.recordData);
65725
+ }
65726
+ /**
65727
+ * The identity of the record an event refers to, without needing the row.
65728
+ *
65729
+ * Available whatever the broadcast allowlist says — the primary key is never withheld, because it
65730
+ * discloses nothing a client cannot already derive and it is what every consumer needs to know
65731
+ * *which* record changed. Prefer this over reading an id out of the row.
65732
+ */
65733
+ function ResolveEntityEventKey(event) {
65734
+ if (event.baseEntity) {
65735
+ var _event$baseEntity$Pri;
65736
+ return (_event$baseEntity$Pri = event.baseEntity.PrimaryKey) !== null && _event$baseEntity$Pri !== void 0 ? _event$baseEntity$Pri : null;
65737
+ }
65738
+ var payload = event.payload;
65739
+ return parseKey(payload === null || payload === void 0 ? void 0 : payload.primaryKeyValues);
65740
+ }
65741
+ /** Re-read one record by key. Never throws — a consumer's event handler must not die on it. */
65742
+ function reReadByPrimaryKey(_x4, _x5, _x6, _x7) {
65743
+ return _reReadByPrimaryKey.apply(this, arguments);
65744
+ }
65745
+ /**
65746
+ * Rebuild the key from the published `primaryKeyValues`.
65747
+ *
65748
+ * `FromKeyValuePairs` rather than `FromID`: the entity here is whatever the event names, so a
65749
+ * composite key has to survive. See `.claude/rules/data-access.md` on not assuming a single
65750
+ * `ID` column for an arbitrary entity.
65751
+ */
65752
+ function _reReadByPrimaryKey() {
65753
+ _reReadByPrimaryKey = remoteEventRow_asyncToGenerator(/*#__PURE__*/remoteEventRow_regenerator().m(function _callee2(event, payload, provider, contextUser) {
65754
+ var entityName, p, key, record, _t2;
65755
+ return remoteEventRow_regenerator().w(function (_context2) {
65756
+ while (1) switch (_context2.p = _context2.n) {
65757
+ case 0:
65758
+ entityName = event.entityName; // `event.provider` is populated for remote-invalidate specifically because `baseEntity` is
65759
+ // null there and listeners have nothing else to read through.
65760
+ p = provider !== null && provider !== void 0 ? provider : event.provider;
65761
+ key = parseKey(payload === null || payload === void 0 ? void 0 : payload.primaryKeyValues);
65762
+ if (!(!entityName || !p || !key)) {
65763
+ _context2.n = 1;
65764
+ break;
65765
+ }
65766
+ return _context2.a(2, null);
65767
+ case 1:
65768
+ _context2.p = 1;
65769
+ _context2.n = 2;
65770
+ return p.GetEntityObject(entityName, key, contextUser);
65771
+ case 2:
65772
+ record = _context2.v;
65773
+ return _context2.a(2, record !== null && record !== void 0 && record.IsSaved ? record.GetAll() : null);
65774
+ case 3:
65775
+ _context2.p = 3;
65776
+ _t2 = _context2.v;
65777
+ LogError("ResolveEntityEventRow: could not re-read ".concat(entityName, " by key: ").concat(_t2 instanceof Error ? _t2.message : String(_t2)));
65778
+ return _context2.a(2, null);
65779
+ }
65780
+ }, _callee2, null, [[1, 3]]);
65781
+ }));
65782
+ return _reReadByPrimaryKey.apply(this, arguments);
65783
+ }
65784
+ function parseKey(primaryKeyValues) {
65785
+ if (!primaryKeyValues) {
65786
+ return null;
65787
+ }
65788
+ try {
65789
+ var pairs = JSON.parse(primaryKeyValues);
65790
+ if (!Array.isArray(pairs) || pairs.length === 0) {
65791
+ return null;
65792
+ }
65793
+ return CompositeKey.FromKeyValuePairs(pairs);
65794
+ } catch (_unused) {
65795
+ return null;
65796
+ }
65797
+ }
65363
65798
  ;// ../../MJCore/dist/generic/entityTransactionScope.js
65364
65799
  /* unused harmony import specifier */ var entityTransactionScope_LogError;
65365
65800
  function entityTransactionScope_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 entityTransactionScope_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]())) : (entityTransactionScope_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, entityTransactionScope_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, entityTransactionScope_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), entityTransactionScope_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", entityTransactionScope_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), entityTransactionScope_regeneratorDefine2(u), entityTransactionScope_regeneratorDefine2(u, o, "Generator"), entityTransactionScope_regeneratorDefine2(u, n, function () { return this; }), entityTransactionScope_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (entityTransactionScope_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
@@ -66738,7 +67173,12 @@ function getRunQuerySQLFilterNames() {
66738
67173
  }
66739
67174
  ;// ../../MJCore/dist/generic/runQuerySQLFilterImplementations.js
66740
67175
  /* unused harmony import specifier */ var BaseSingleton;
67176
+ /* unused harmony import specifier */ var runQuerySQLFilterImplementations_GetDialect;
66741
67177
  function runQuerySQLFilterImplementations_typeof(o) { "@babel/helpers - typeof"; return runQuerySQLFilterImplementations_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; }, runQuerySQLFilterImplementations_typeof(o); }
67178
+ function runQuerySQLFilterImplementations_slicedToArray(r, e) { return runQuerySQLFilterImplementations_arrayWithHoles(r) || runQuerySQLFilterImplementations_iterableToArrayLimit(r, e) || runQuerySQLFilterImplementations_unsupportedIterableToArray(r, e) || runQuerySQLFilterImplementations_nonIterableRest(); }
67179
+ function runQuerySQLFilterImplementations_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
67180
+ function runQuerySQLFilterImplementations_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
67181
+ function runQuerySQLFilterImplementations_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
66742
67182
  function runQuerySQLFilterImplementations_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
66743
67183
  function runQuerySQLFilterImplementations_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, runQuerySQLFilterImplementations_toPropertyKey(o.key), o); } }
66744
67184
  function runQuerySQLFilterImplementations_createClass(e, r, t) { return r && runQuerySQLFilterImplementations_defineProperties(e.prototype, r), t && runQuerySQLFilterImplementations_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -66749,14 +67189,14 @@ function runQuerySQLFilterImplementations_isNativeReflectConstruct() { try { var
66749
67189
  function runQuerySQLFilterImplementations_getPrototypeOf(t) { return runQuerySQLFilterImplementations_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, runQuerySQLFilterImplementations_getPrototypeOf(t); }
66750
67190
  function runQuerySQLFilterImplementations_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && runQuerySQLFilterImplementations_setPrototypeOf(t, e); }
66751
67191
  function runQuerySQLFilterImplementations_setPrototypeOf(t, e) { return runQuerySQLFilterImplementations_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, runQuerySQLFilterImplementations_setPrototypeOf(t, e); }
67192
+ function runQuerySQLFilterImplementations_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = runQuerySQLFilterImplementations_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; } } }; }
67193
+ function runQuerySQLFilterImplementations_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return runQuerySQLFilterImplementations_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) ? runQuerySQLFilterImplementations_arrayLikeToArray(r, a) : void 0; } }
67194
+ function runQuerySQLFilterImplementations_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; }
66752
67195
  function runQuerySQLFilterImplementations_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
66753
67196
  function runQuerySQLFilterImplementations_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? runQuerySQLFilterImplementations_ownKeys(Object(t), !0).forEach(function (r) { runQuerySQLFilterImplementations_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : runQuerySQLFilterImplementations_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
66754
67197
  function runQuerySQLFilterImplementations_defineProperty(e, r, t) { return (r = runQuerySQLFilterImplementations_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
66755
67198
  function runQuerySQLFilterImplementations_toPropertyKey(t) { var i = runQuerySQLFilterImplementations_toPrimitive(t, "string"); return "symbol" == runQuerySQLFilterImplementations_typeof(i) ? i : i + ""; }
66756
67199
  function runQuerySQLFilterImplementations_toPrimitive(t, r) { if ("object" != runQuerySQLFilterImplementations_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != runQuerySQLFilterImplementations_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
66757
- function runQuerySQLFilterImplementations_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = runQuerySQLFilterImplementations_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; } } }; }
66758
- function runQuerySQLFilterImplementations_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return runQuerySQLFilterImplementations_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) ? runQuerySQLFilterImplementations_arrayLikeToArray(r, a) : void 0; } }
66759
- function runQuerySQLFilterImplementations_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; }
66760
67200
  /**
66761
67201
  * @fileoverview SQL Filter Implementations for RunQuery
66762
67202
  *
@@ -66767,6 +67207,7 @@ function runQuerySQLFilterImplementations_arrayLikeToArray(r, a) { (null == a ||
66767
67207
  */
66768
67208
 
66769
67209
 
67210
+
66770
67211
  /**
66771
67212
  * Dangerous SQL keywords that should be blocked in expressions
66772
67213
  */
@@ -66821,14 +67262,15 @@ var ALLOWED_SQL_KEYWORDS = [
66821
67262
  'AND', 'OR', 'NOT', 'IS', 'NULL', 'LIKE',
66822
67263
  // Comparison operators (as words)
66823
67264
  'BETWEEN', 'IN'];
67265
+ /** The platform filters render for until {@link RunQuerySQLFilterManager.SetPlatform} is called. */
67266
+ var DEFAULT_FILTER_PLATFORM = 'sqlserver';
67267
+ /** The dialect of {@link DEFAULT_FILTER_PLATFORM}, which the exported default implementations use. */
67268
+ var DEFAULT_FILTER_DIALECT = GetDialect(DEFAULT_FILTER_PLATFORM);
66824
67269
  /**
66825
- * SQL Filter implementation functions
67270
+ * SQL Filter implementation functions. The filters whose output depends on the database come
67271
+ * from {@link dialectFilterImplementations}.
66826
67272
  */
66827
- var FILTER_IMPLEMENTATIONS = {
66828
- sqlString: function sqlString(value) {
66829
- if (value === null || value === undefined) return 'NULL';
66830
- return "'".concat(String(value).replace(/'/g, "''"), "'");
66831
- },
67273
+ var FILTER_IMPLEMENTATIONS = runQuerySQLFilterImplementations_objectSpread(runQuerySQLFilterImplementations_objectSpread({}, dialectFilterImplementations(DEFAULT_FILTER_DIALECT)), {}, {
66832
67274
  sqlNumber: function sqlNumber(value) {
66833
67275
  var num = Number(value);
66834
67276
  if (isNaN(num)) throw new Error("Invalid number: ".concat(value));
@@ -66840,51 +67282,6 @@ var FILTER_IMPLEMENTATIONS = {
66840
67282
  if (isNaN(date.getTime())) throw new Error("Invalid date: ".concat(value));
66841
67283
  return "'".concat(date.toISOString(), "'");
66842
67284
  },
66843
- sqlBoolean: function sqlBoolean(value) {
66844
- // Default SQL Server behavior; overridden by platform-aware version in RunQuerySQLFilterManager
66845
- return value ? '1' : '0';
66846
- },
66847
- sqlIdentifier: function sqlIdentifier(value) {
66848
- if (!value) throw new Error('Identifier cannot be empty');
66849
- var identifier = String(value);
66850
- // Basic SQL injection prevention for identifiers
66851
- if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier)) {
66852
- throw new Error("Invalid SQL identifier: ".concat(identifier));
66853
- }
66854
- // Default SQL Server behavior; overridden by platform-aware version in RunQuerySQLFilterManager
66855
- return "[".concat(identifier, "]");
66856
- },
66857
- sqlIn: function sqlIn(values) {
66858
- if (!Array.isArray(values) || values.length === 0) {
66859
- return '(NULL)'; // This will match nothing
66860
- }
66861
- var escaped = values.map(function (v) {
66862
- if (typeof v === 'string') {
66863
- return "'".concat(v.replace(/'/g, "''"), "'");
66864
- } else if (typeof v === 'number') {
66865
- return v;
66866
- } else if (v === null || v === undefined) {
66867
- return 'NULL';
66868
- }
66869
- return "'".concat(String(v).replace(/'/g, "''"), "'");
66870
- });
66871
- return "(".concat(escaped.join(', '), ")");
66872
- },
66873
- sqlLikeContains: function sqlLikeContains(value) {
66874
- if (value === null || value === undefined) return 'NULL';
66875
- var stripped = stripBoundaryWildcards(String(value), 'both');
66876
- return "'%".concat(escapeLikeValue(stripped, 'sqlserver'), "%'");
66877
- },
66878
- sqlLikeBegins: function sqlLikeBegins(value) {
66879
- if (value === null || value === undefined) return 'NULL';
66880
- var stripped = stripBoundaryWildcards(String(value), 'trailing');
66881
- return "'".concat(escapeLikeValue(stripped, 'sqlserver'), "%'");
66882
- },
66883
- sqlLikeEnds: function sqlLikeEnds(value) {
66884
- if (value === null || value === undefined) return 'NULL';
66885
- var stripped = stripBoundaryWildcards(String(value), 'leading');
66886
- return "'%".concat(escapeLikeValue(stripped, 'sqlserver'), "'");
66887
- },
66888
67285
  sqlNoKeywordsExpression: function sqlNoKeywordsExpression(value) {
66889
67286
  if (!value) {
66890
67287
  throw new Error('SQL expression cannot be empty');
@@ -66940,7 +67337,7 @@ var FILTER_IMPLEMENTATIONS = {
66940
67337
  // Return the original expression (preserving case)
66941
67338
  return expression;
66942
67339
  }
66943
- };
67340
+ });
66944
67341
  /**
66945
67342
  * Complete SQL filters with implementations attached.
66946
67343
  * This is the array that should be used by the QueryParameterProcessor.
@@ -66951,32 +67348,44 @@ var RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS = RUN_QUERY_SQL_FILTERS.map(funct
66951
67348
  });
66952
67349
  });
66953
67350
  /**
66954
- * Creates a platform-aware sqlBoolean filter implementation.
66955
- * SQL Server uses 1/0, PostgreSQL uses true/false.
66956
- */
66957
- function createPlatformSqlBoolean(platform) {
66958
- return function (value) {
66959
- if (platform === 'postgresql') {
66960
- return value ? 'true' : 'false';
66961
- }
66962
- return value ? '1' : '0';
66963
- };
66964
- }
66965
- /**
66966
- * Creates a platform-aware sqlIdentifier filter implementation.
66967
- * SQL Server uses [brackets], PostgreSQL uses "double quotes".
67351
+ * The filters whose output depends on the database, rendered for one dialect: string and IN-list
67352
+ * literals, booleans, identifiers and the three LIKE filters. Every platform difference comes
67353
+ * from the dialect, so a new platform needs no change here.
66968
67354
  */
66969
- function createPlatformSqlIdentifier(platform) {
66970
- return function (value) {
66971
- if (!value) throw new Error('Identifier cannot be empty');
66972
- var identifier = String(value);
66973
- if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier)) {
66974
- throw new Error("Invalid SQL identifier: ".concat(identifier));
66975
- }
66976
- if (platform === 'postgresql') {
66977
- return "\"".concat(identifier, "\"");
67355
+ function dialectFilterImplementations(dialect) {
67356
+ return {
67357
+ sqlString: function sqlString(value) {
67358
+ return value === null || value === undefined ? 'NULL' : textLiteral(value, dialect);
67359
+ },
67360
+ sqlIn: function sqlIn(values) {
67361
+ if (!Array.isArray(values) || values.length === 0) {
67362
+ return '(NULL)'; // matches nothing
67363
+ }
67364
+ var items = values.map(function (v) {
67365
+ return typeof v === 'number' ? String(v) : v === null || v === undefined ? 'NULL' : textLiteral(v, dialect);
67366
+ });
67367
+ return "(".concat(items.join(', '), ")");
67368
+ },
67369
+ sqlBoolean: function sqlBoolean(value) {
67370
+ return dialect.BooleanLiteral(Boolean(value));
67371
+ },
67372
+ sqlIdentifier: function sqlIdentifier(value) {
67373
+ if (!value) throw new Error('Identifier cannot be empty');
67374
+ var identifier = String(value);
67375
+ if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier)) {
67376
+ throw new Error("Invalid SQL identifier: ".concat(identifier));
67377
+ }
67378
+ return dialect.QuoteIdentifier(identifier);
67379
+ },
67380
+ sqlLikeContains: function sqlLikeContains(value) {
67381
+ return likeLiteral(value, 'both', dialect);
67382
+ },
67383
+ sqlLikeBegins: function sqlLikeBegins(value) {
67384
+ return likeLiteral(value, 'trailing', dialect);
67385
+ },
67386
+ sqlLikeEnds: function sqlLikeEnds(value) {
67387
+ return likeLiteral(value, 'leading', dialect);
66978
67388
  }
66979
- return "[".concat(identifier, "]");
66980
67389
  };
66981
67390
  }
66982
67391
  /**
@@ -66998,40 +67407,23 @@ function stripBoundaryWildcards(value, side) {
66998
67407
  }
66999
67408
  }
67000
67409
  /**
67001
- * Escapes literal % and _ characters inside a LIKE value in a platform-aware way.
67002
- * SQL Server uses bracket escaping [%] [_]; PostgreSQL uses backslash escaping \% \_.
67003
- */
67004
- function escapeLikeValue(value, platform) {
67005
- var escaped = value.replace(/'/g, "''");
67006
- if (platform === 'postgresql') {
67007
- return escaped.replace(/%/g, '\\%').replace(/_/g, '\\_');
67008
- }
67009
- return escaped.replace(/%/g, '[%]').replace(/_/g, '[_]');
67010
- }
67011
- /**
67012
- * Creates platform-aware sqlLike filter implementations.
67013
- * SQL Server escapes with [%]/[_], PostgreSQL escapes with \%/\_.
67410
+ * A LIKE pattern literal that matches `value` literally, with `%` added on the open side(s):
67411
+ * `both` for contains, `trailing` for begins-with, `leading` for ends-with. User-supplied `%` on
67412
+ * those sides is dropped first, and every other character LIKE treats specially is escaped by
67413
+ * the dialect.
67014
67414
  */
67015
- function createPlatformSqlLikeContains(platform) {
67016
- return function (value) {
67017
- if (value === null || value === undefined) return 'NULL';
67018
- var stripped = stripBoundaryWildcards(String(value), 'both');
67019
- return "'%".concat(escapeLikeValue(stripped, platform), "%'");
67020
- };
67415
+ function likeLiteral(value, wildcardSide, dialect) {
67416
+ if (value === null || value === undefined) return 'NULL';
67417
+ var stripped = stripBoundaryWildcards(String(value), wildcardSide);
67418
+ var pattern = dialect.EscapeLikePattern(stripped.replace(/'/g, "''"));
67419
+ var before = wildcardSide === 'trailing' ? '' : '%';
67420
+ var after = wildcardSide === 'leading' ? '' : '%';
67421
+ return "".concat(dialect.StringLiteralPrefix(stripped), "'").concat(before).concat(pattern).concat(after, "'");
67021
67422
  }
67022
- function createPlatformSqlLikeBegins(platform) {
67023
- return function (value) {
67024
- if (value === null || value === undefined) return 'NULL';
67025
- var stripped = stripBoundaryWildcards(String(value), 'trailing');
67026
- return "'".concat(escapeLikeValue(stripped, platform), "%'");
67027
- };
67028
- }
67029
- function createPlatformSqlLikeEnds(platform) {
67030
- return function (value) {
67031
- if (value === null || value === undefined) return 'NULL';
67032
- var stripped = stripBoundaryWildcards(String(value), 'leading');
67033
- return "'%".concat(escapeLikeValue(stripped, platform), "'");
67034
- };
67423
+ /** A string literal for `value` with the dialect's prefix, quotes escaped. */
67424
+ function textLiteral(value, dialect) {
67425
+ var text = String(value);
67426
+ return "".concat(dialect.StringLiteralPrefix(text), "'").concat((0,dist/* EscapeSQLString */.z0)(text), "'");
67035
67427
  }
67036
67428
  /**
67037
67429
  * Singleton class for managing RunQuery SQL filters with implementations.
@@ -67049,7 +67441,7 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
67049
67441
  runQuerySQLFilterImplementations_classCallCheck(this, RunQuerySQLFilterManager);
67050
67442
  _this = runQuerySQLFilterImplementations_callSuper(this, RunQuerySQLFilterManager);
67051
67443
  _this._filters = new Map();
67052
- _this._platform = 'sqlserver';
67444
+ _this._platform = DEFAULT_FILTER_PLATFORM;
67053
67445
  _this.initializeFilters();
67054
67446
  return _this;
67055
67447
  }
@@ -67071,30 +67463,19 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
67071
67463
  this.applyPlatformOverrides();
67072
67464
  }
67073
67465
  /**
67074
- * Applies platform-specific overrides for sqlBoolean and sqlIdentifier filters.
67466
+ * Installs the dialect-sensitive filters for the current platform's dialect.
67075
67467
  */
67076
67468
  }, {
67077
67469
  key: "applyPlatformOverrides",
67078
67470
  value: function applyPlatformOverrides() {
67079
- var boolFilter = this._filters.get('sqlBoolean');
67080
- if (boolFilter) {
67081
- boolFilter.implementation = createPlatformSqlBoolean(this._platform);
67082
- }
67083
- var idFilter = this._filters.get('sqlIdentifier');
67084
- if (idFilter) {
67085
- idFilter.implementation = createPlatformSqlIdentifier(this._platform);
67086
- }
67087
- var likeContainsFilter = this._filters.get('sqlLikeContains');
67088
- if (likeContainsFilter) {
67089
- likeContainsFilter.implementation = createPlatformSqlLikeContains(this._platform);
67090
- }
67091
- var likeBeginsFilter = this._filters.get('sqlLikeBegins');
67092
- if (likeBeginsFilter) {
67093
- likeBeginsFilter.implementation = createPlatformSqlLikeBegins(this._platform);
67094
- }
67095
- var likeEndsFilter = this._filters.get('sqlLikeEnds');
67096
- if (likeEndsFilter) {
67097
- likeEndsFilter.implementation = createPlatformSqlLikeEnds(this._platform);
67471
+ for (var _i2 = 0, _Object$entries = Object.entries(dialectFilterImplementations(runQuerySQLFilterImplementations_GetDialect(this._platform))); _i2 < _Object$entries.length; _i2++) {
67472
+ var _Object$entries$_i = runQuerySQLFilterImplementations_slicedToArray(_Object$entries[_i2], 2),
67473
+ name = _Object$entries$_i[0],
67474
+ implementation = _Object$entries$_i[1];
67475
+ var filter = this._filters.get(name);
67476
+ if (filter) {
67477
+ filter.implementation = implementation;
67478
+ }
67098
67479
  }
67099
67480
  }
67100
67481
  /**
@@ -67109,6 +67490,15 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
67109
67490
  function get() {
67110
67491
  return this._platform;
67111
67492
  }
67493
+ /**
67494
+ * The SQL dialect of the current platform, for callers that render values the way these
67495
+ * filters do (for example the value bound for a boolean parameter).
67496
+ */
67497
+ }, {
67498
+ key: "Dialect",
67499
+ get: function get() {
67500
+ return runQuerySQLFilterImplementations_GetDialect(this._platform);
67501
+ }
67112
67502
  /**
67113
67503
  * Sets the database platform, updating platform-sensitive filters accordingly.
67114
67504
  * Call this during provider initialization to match the active database platform.
@@ -72288,6 +72678,11 @@ var InMemoryLocalStorageProvider = /*#__PURE__*/function () {
72288
72678
  * {@link ILocalStorageProvider.SharesReferences}.
72289
72679
  */
72290
72680
  this.SharesReferences = true;
72681
+ /**
72682
+ * `false` — a `Map` on the heap. Nothing written here survives the process, so there is never
72683
+ * a second reader; see {@link ILocalStorageProvider.SupportsCrossProcessPersistence}.
72684
+ */
72685
+ this.SupportsCrossProcessPersistence = false;
72291
72686
  }
72292
72687
  return InMemoryLocalStorageProvider_createClass(InMemoryLocalStorageProvider, [{
72293
72688
  key: "getCategoryMap",
@@ -72827,6 +73222,7 @@ var PermissionDeniedError = /*#__PURE__*/function (_Error) {
72827
73222
 
72828
73223
 
72829
73224
 
73225
+
72830
73226
 
72831
73227
 
72832
73228
  function SetProvider(provider) {
@@ -72846,7 +73242,7 @@ __webpack_require__.r(__webpack_exports__);
72846
73242
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
72847
73243
  /* harmony export */ UserViewEngine: () => (/* binding */ UserViewEngine)
72848
73244
  /* harmony export */ });
72849
- /* harmony import */ var _memberjunction_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(954);
73245
+ /* harmony import */ var _memberjunction_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(839);
72850
73246
  /* harmony import */ var _memberjunction_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(401);
72851
73247
  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); }
72852
73248
  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 }; })(); }
@@ -73214,8 +73610,8 @@ __webpack_require__.d(__webpack_exports__, {
73214
73610
 
73215
73611
  // UNUSED EXPORTS: AIAgentPermissionProvider, AISkillExportMarkdownOperation, AISkillImportMarkdownOperation, AISkillPermissionProvider, AccessControlRuleProvider, ApplicationRolePermissionProvider, ApplicationSettingEngine, ArtifactExtractor, ArtifactMetadataEngine, ArtifactPermissionProvider, AuditLogTypeEngine, AuthorizationCheckOperation, AuthorizationCheckServerOperation, BaseIdentityClaimDriver, BuildUnregisteredMimeError, CollectionPermissionProvider, ConversationEngine, ConversationWindowFields, CreateShareNotification, DEFAULT_AGGREGATE_DISPLAY, DashboardEngine, DashboardPermissionProvider, DecideInlineStorage, EncryptionEngineBase, EntityPermissionProvider, EntityPermissionType, EntitySaveOptions, EvaluateAuthorizationChecks, ExtractBase64FromDataUrl, FileStorageEngineBase, FindArtifactTypeConflicts, FindMatchingAuthorization, GeoDataEngine, INJECTABLE_NOTE_STATUSES, IdentityClaimEngine, InjectableNoteStatusSQLList, InstanceConfigEngine, InteractiveFormsEngine, IsInjectableNoteStatus, IsTextyMime, KnowledgeHubMetadataEngine, LoadAuthorizationCheckOperation, LoadMJAccessControlRuleEntityExtended, LoadMJArtifactPermissionEntityExtended, LoadMJCollectionPermissionEntityExtended, LoadMJConversationDetailEntityExtended, LoadMJDashboardPermissionEntityExtended, LoadPermissionEntityExtensions, LoadPermissionProviders, MCPEngine, MJAIActionEntity, MJAIActionSchema, MJAIAgentActionEntity, MJAIAgentActionSchema, MJAIAgentArtifactTypeEntity, MJAIAgentArtifactTypeSchema, MJAIAgentCategoryEntity, MJAIAgentCategorySchema, MJAIAgentChannelEntity, MJAIAgentChannelSchema, MJAIAgentClientToolEntity, MJAIAgentClientToolSchema, MJAIAgentCoAgentEntity, MJAIAgentCoAgentSchema, MJAIAgentConfigurationEntity, MJAIAgentConfigurationSchema, MJAIAgentCredentialEntity, MJAIAgentCredentialSchema, MJAIAgentDataSourceEntity, MJAIAgentDataSourceSchema, MJAIAgentEntity, MJAIAgentExampleEntity, MJAIAgentExampleSchema, MJAIAgentHarnessEntity, MJAIAgentHarnessSchema, MJAIAgentLearningCycleEntity, MJAIAgentLearningCycleSchema, MJAIAgentModalityEntity, MJAIAgentModalitySchema, MJAIAgentModelEntity, MJAIAgentModelSchema, MJAIAgentNoteEntity, MJAIAgentNoteSchema, MJAIAgentNoteTypeEntity, MJAIAgentNoteTypeSchema, MJAIAgentPermissionEntity, MJAIAgentPermissionSchema, MJAIAgentPersonaEntity, MJAIAgentPersonaSchema, MJAIAgentPromptEntity, MJAIAgentPromptSchema, MJAIAgentRelationshipEntity, MJAIAgentRelationshipSchema, MJAIAgentRequestEntity, MJAIAgentRequestSchema, MJAIAgentRequestTypeEntity, MJAIAgentRequestTypeSchema, MJAIAgentRunEntity, MJAIAgentRunMediaEntity, MJAIAgentRunMediaSchema, MJAIAgentRunSchema, MJAIAgentRunStepEntity, MJAIAgentRunStepSchema, MJAIAgentSchema, MJAIAgentSearchScopeEntity, MJAIAgentSearchScopeSchema, MJAIAgentSessionBridgeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeParticipantSchema, MJAIAgentSessionBridgeSchema, MJAIAgentSessionChannelEntity, MJAIAgentSessionChannelSchema, MJAIAgentSessionEntity, MJAIAgentSessionSchema, MJAIAgentSkillEntity, MJAIAgentSkillSchema, MJAIAgentStepEntity, MJAIAgentStepPathEntity, MJAIAgentStepPathSchema, MJAIAgentStepSchema, MJAIAgentTypeEntity, MJAIAgentTypeSchema, MJAIArchitectureEntity, MJAIArchitectureSchema, MJAIBridgeAgentIdentityEntity, MJAIBridgeAgentIdentitySchema, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderChannelSchema, MJAIBridgeProviderEntity, MJAIBridgeProviderSchema, MJAIClientToolDefinitionEntity, MJAIClientToolDefinitionSchema, MJAIConfigurationEntity, MJAIConfigurationParamEntity, MJAIConfigurationParamSchema, MJAIConfigurationSchema, MJAICredentialBindingEntity, MJAICredentialBindingSchema, MJAIModalityEntity, MJAIModalitySchema, MJAIModelActionEntity, MJAIModelActionSchema, MJAIModelArchitectureEntity, MJAIModelArchitectureSchema, MJAIModelCostEntity, MJAIModelCostSchema, MJAIModelEntity, MJAIModelModalityEntity, MJAIModelModalitySchema, MJAIModelPersonaEntity, MJAIModelPersonaSchema, MJAIModelPriceTypeEntity, MJAIModelPriceTypeSchema, MJAIModelPriceUnitTypeEntity, MJAIModelPriceUnitTypeSchema, MJAIModelSchema, MJAIModelTypeEntity, MJAIModelTypeSchema, MJAIModelVendorEntity, MJAIModelVendorSchema, MJAIPersonaEntity, MJAIPersonaSchema, MJAIPersonaVendorEntity, MJAIPersonaVendorSchema, MJAIPromptCategoryEntity, MJAIPromptCategorySchema, MJAIPromptEntity, MJAIPromptModelEntity, MJAIPromptModelSchema, MJAIPromptRunEntity, MJAIPromptRunMediaEntity, MJAIPromptRunMediaSchema, MJAIPromptRunSchema, MJAIPromptSchema, MJAIPromptTypeEntity, MJAIPromptTypeSchema, MJAIRemoteBrowserProviderEntity, MJAIRemoteBrowserProviderSchema, MJAIResultCacheEntity, MJAIResultCacheSchema, MJAISkillActionEntity, MJAISkillActionSchema, MJAISkillEntity, MJAISkillPermissionEntity, MJAISkillPermissionSchema, MJAISkillSchema, MJAISkillSearchScopeEntity, MJAISkillSearchScopeSchema, MJAISkillSubAgentEntity, MJAISkillSubAgentSchema, MJAIUsageTypeEntity, MJAIUsageTypeSchema, MJAIVendorEntity, MJAIVendorSchema, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeDefinitionSchema, MJAIVendorTypeEntity, MJAIVendorTypeSchema, MJAPIApplicationEntity, MJAPIApplicationSchema, MJAPIApplicationScopeEntity, MJAPIApplicationScopeSchema, MJAPIKeyApplicationEntity, MJAPIKeyApplicationSchema, MJAPIKeyEntity, MJAPIKeySchema, MJAPIKeyScopeEntity, MJAPIKeyScopeSchema, MJAPIKeyUsageLogEntity, MJAPIKeyUsageLogSchema, MJAPIScopeEntity, MJAPIScopeSchema, MJAccessControlRuleEntity, MJAccessControlRuleEntityExtended, MJAccessControlRuleSchema, MJActionAuthorizationEntity, MJActionAuthorizationSchema, MJActionCategoryEntity, MJActionCategorySchema, MJActionContextEntity, MJActionContextSchema, MJActionContextTypeEntity, MJActionContextTypeSchema, MJActionEntity, MJActionExecutionLogEntity, MJActionExecutionLogSchema, MJActionFilterEntity, MJActionFilterSchema, MJActionLibraryEntity, MJActionLibrarySchema, MJActionParamEntity, MJActionParamSchema, MJActionResultCodeEntity, MJActionResultCodeSchema, MJActionSchema, MJApplicationEntity, MJApplicationEntityEntity, MJApplicationEntitySchema, MJApplicationRoleEntity, MJApplicationRoleSchema, MJApplicationSchema, MJApplicationSettingEntity, MJApplicationSettingSchema, MJArchiveConfigurationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntitySchema, MJArchiveConfigurationSchema, MJArchiveRunDetailEntity, MJArchiveRunDetailSchema, MJArchiveRunEntity, MJArchiveRunSchema, MJArtifactEntity, MJArtifactPermissionEntity, MJArtifactPermissionEntityExtended, MJArtifactPermissionSchema, MJArtifactSchema, MJArtifactTypeEntity, MJArtifactTypeSchema, MJArtifactUseEntity, MJArtifactUseSchema, MJArtifactVersionAttributeEntity, MJArtifactVersionAttributeSchema, MJArtifactVersionEntity, MJArtifactVersionSchema, MJAuditLogEntity, MJAuditLogSchema, MJAuditLogTypeEntity, MJAuditLogTypeSchema, MJAuthenticationProviderEntity, MJAuthenticationProviderSchema, MJAuthorizationEntity, MJAuthorizationRoleEntity, MJAuthorizationRoleSchema, MJAuthorizationSchema, MJClusterAnalysisClusterEntity, MJClusterAnalysisClusterSchema, MJClusterAnalysisEntity, MJClusterAnalysisSchema, MJCollectionArtifactEntity, MJCollectionArtifactSchema, MJCollectionEntity, MJCollectionPermissionEntity, MJCollectionPermissionEntityExtended, MJCollectionPermissionSchema, MJCollectionSchema, MJCommunicationBaseMessageTypeEntity, MJCommunicationBaseMessageTypeSchema, MJCommunicationLogEntity, MJCommunicationLogSchema, MJCommunicationProviderEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderMessageTypeSchema, MJCommunicationProviderSchema, MJCommunicationRunEntity, MJCommunicationRunSchema, MJCompanyEntity, MJCompanyIntegrationEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationEntityMapSchema, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationFieldMapSchema, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRecordMapSchema, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunAPILogSchema, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunDetailSchema, MJCompanyIntegrationRunEntity, MJCompanyIntegrationRunSchema, MJCompanyIntegrationSchema, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationSyncWatermarkSchema, MJCompanySchema, MJComponentDependencyEntity, MJComponentDependencySchema, MJComponentEntity, MJComponentEntityExtended, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentLibraryLinkSchema, MJComponentLibrarySchema, MJComponentRegistryEntity, MJComponentRegistrySchema, MJComponentSchema, MJContentFileTypeEntity, MJContentFileTypeSchema, MJContentItemAttributeEntity, MJContentItemAttributeSchema, MJContentItemChunkEntity, MJContentItemChunkSchema, MJContentItemDuplicateEntity, MJContentItemDuplicateSchema, MJContentItemEntity, MJContentItemSchema, MJContentItemTagEntity, MJContentItemTagSchema, MJContentProcessRunDetailEntity, MJContentProcessRunDetailSchema, MJContentProcessRunEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunPromptRunSchema, MJContentProcessRunSchema, MJContentSourceEntity, MJContentSourceParamEntity, MJContentSourceParamSchema, MJContentSourceSchema, MJContentSourceTypeEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeParamSchema, MJContentSourceTypeSchema, MJContentTypeAttributeEntity, MJContentTypeAttributeSchema, MJContentTypeEntity, MJContentTypeSchema, MJConversationArtifactEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactPermissionSchema, MJConversationArtifactSchema, MJConversationArtifactVersionEntity, MJConversationArtifactVersionSchema, MJConversationCompactionRunEntity, MJConversationCompactionRunSchema, MJConversationDetailArtifactEntity, MJConversationDetailArtifactSchema, MJConversationDetailAttachmentEntity, MJConversationDetailAttachmentSchema, MJConversationDetailEntity, MJConversationDetailEntityExtended, MJConversationDetailRatingEntity, MJConversationDetailRatingSchema, MJConversationDetailSchema, MJConversationEntity, MJConversationSchema, MJConversationSkillEntity, MJConversationSkillSchema, MJConversationWidgetInstanceEntity, MJConversationWidgetInstanceSchema, MJCountryEntity, MJCountrySchema, MJCredentialCategoryEntity, MJCredentialCategorySchema, MJCredentialEntity, MJCredentialSchema, MJCredentialTypeEntity, MJCredentialTypeSchema, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryLinkSchema, MJDashboardCategoryPermissionEntity, MJDashboardCategoryPermissionSchema, MJDashboardCategorySchema, MJDashboardEntity, MJDashboardEntityExtended, MJDashboardPartTypeEntity, MJDashboardPartTypeSchema, MJDashboardPermissionEntity, MJDashboardPermissionEntityExtended, MJDashboardPermissionSchema, MJDashboardSchema, MJDashboardUserPreferenceEntity, MJDashboardUserPreferenceSchema, MJDashboardUserStateEntity, MJDashboardUserStateSchema, MJDataContextEntity, MJDataContextItemEntity, MJDataContextItemSchema, MJDataContextSchema, MJDatasetEntity, MJDatasetItemEntity, MJDatasetItemSchema, MJDatasetSchema, MJDuplicateRunDetailEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailMatchSchema, MJDuplicateRunDetailSchema, MJDuplicateRunEntity, MJDuplicateRunSchema, MJEmployeeCompanyIntegrationEntity, MJEmployeeCompanyIntegrationSchema, MJEmployeeEntity, MJEmployeeRoleEntity, MJEmployeeRoleSchema, MJEmployeeSchema, MJEmployeeSkillEntity, MJEmployeeSkillSchema, MJEncryptionAlgorithmEntity, MJEncryptionAlgorithmSchema, MJEncryptionKeyEntity, MJEncryptionKeySchema, MJEncryptionKeySourceEntity, MJEncryptionKeySourceSchema, MJEntityAIActionEntity, MJEntityAIActionSchema, MJEntityActionEntity, MJEntityActionFilterEntity, MJEntityActionFilterSchema, MJEntityActionInvocationEntity, MJEntityActionInvocationSchema, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationTypeSchema, MJEntityActionParamEntity, MJEntityActionParamSchema, MJEntityActionSchema, MJEntityCommunicationFieldEntity, MJEntityCommunicationFieldSchema, MJEntityCommunicationMessageTypeEntity, MJEntityCommunicationMessageTypeSchema, MJEntityDocumentEntity, MJEntityDocumentRunEntity, MJEntityDocumentRunSchema, MJEntityDocumentSchema, MJEntityDocumentSettingEntity, MJEntityDocumentSettingSchema, MJEntityDocumentTypeEntity, MJEntityDocumentTypeSchema, MJEntityEntity, MJEntityEntityExtended, MJEntityFieldEntity, MJEntityFieldEntityExtended, MJEntityFieldPermissionEntity, MJEntityFieldPermissionSchema, MJEntityFieldSchema, MJEntityFieldValueEntity, MJEntityFieldValueSchema, MJEntityFormOverrideEntity, MJEntityFormOverrideSchema, MJEntityOrganicKeyEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyRelatedEntitySchema, MJEntityOrganicKeySchema, MJEntityPermissionEntity, MJEntityPermissionSchema, MJEntityRecordDocumentEntity, MJEntityRecordDocumentSchema, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipDisplayComponentSchema, MJEntityRelationshipEntity, MJEntityRelationshipSchema, MJEntitySchema, MJEntitySettingEntity, MJEntitySettingSchema, MJEnvironmentEntity, MJEnvironmentEntityExtended, MJEnvironmentSchema, MJErrorLogEntity, MJErrorLogSchema, MJExperimentEntity, MJExperimentSchema, MJExperimentSessionEntity, MJExperimentSessionIterationEntity, MJExperimentSessionIterationSchema, MJExperimentSessionSchema, MJExplorerNavigationItemEntity, MJExplorerNavigationItemSchema, MJExternalDataSourceEntity, MJExternalDataSourceSchema, MJExternalDataSourceTypeEntity, MJExternalDataSourceTypeSchema, MJFileCategoryEntity, MJFileCategorySchema, MJFileEntity, MJFileEntityRecordLinkEntity, MJFileEntityRecordLinkSchema, MJFileSchema, MJFileStorageAccountEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountPermissionSchema, MJFileStorageAccountSchema, MJFileStorageProviderEntity, MJFileStorageProviderSchema, MJFormChromeRuleEntity, MJFormChromeRuleSchema, MJGeneratedCodeCategoryEntity, MJGeneratedCodeCategorySchema, MJGeneratedCodeEntity, MJGeneratedCodeSchema, MJIdentityClaimEntity, MJIdentityClaimSchema, MJIdentityClaimTypeEntity, MJIdentityClaimTypeSchema, MJInstanceConfigurationEntity, MJInstanceConfigurationSchema, MJIntegrationEntity, MJIntegrationObjectEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectFieldSchema, MJIntegrationObjectSchema, MJIntegrationSchema, MJIntegrationSourceTypeEntity, MJIntegrationSourceTypeSchema, MJIntegrationURLFormatEntity, MJIntegrationURLFormatSchema, MJKnowledgeHubSavedSearchEntity, MJKnowledgeHubSavedSearchSchema, MJLibraryEntity, MJLibraryItemEntity, MJLibraryItemSchema, MJLibrarySchema, MJListCategoryEntity, MJListCategorySchema, MJListDetailEntity, MJListDetailEntityExtended, MJListDetailSchema, MJListEntity, MJListEntityExtended, MJListInvitationEntity, MJListInvitationSchema, MJListSchema, MJListShareEntity, MJListShareSchema, MJMCPServerConnectionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionPermissionSchema, MJMCPServerConnectionSchema, MJMCPServerConnectionToolEntity, MJMCPServerConnectionToolSchema, MJMCPServerEntity, MJMCPServerSchema, MJMCPServerToolEntity, MJMCPServerToolSchema, MJMCPToolExecutionLogEntity, MJMCPToolExecutionLogSchema, MJMCPToolFavoriteEntity, MJMCPToolFavoriteSchema, MJMLAlgorithmEntity, MJMLAlgorithmSchema, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseRankingSchema, MJMLAlgorithmUseCaseSchema, MJMLModelEntity, MJMLModelSchema, MJMLModelScoringBindingEntity, MJMLModelScoringBindingSchema, MJMLTrainingPipelineEntity, MJMLTrainingPipelineSchema, MJMLTrainingRunEntity, MJMLTrainingRunSchema, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedDomainSchema, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteAllowedPathSchema, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteApplicationSchema, MJMagicLinkInviteEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteRoleSchema, MJMagicLinkInviteSchema, MJMagicLinkRedemptionEntity, MJMagicLinkRedemptionSchema, MJMaterializedResultEntity, MJMaterializedResultQueryEntity, MJMaterializedResultQuerySchema, MJMaterializedResultSchema, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthServerMetadataCacheSchema, MJOAuthAuthorizationStateEntity, MJOAuthAuthorizationStateSchema, MJOAuthClientRegistrationEntity, MJOAuthClientRegistrationSchema, MJOAuthTokenEntity, MJOAuthTokenSchema, MJOpenAppDependencyEntity, MJOpenAppDependencySchema, MJOpenAppEntity, MJOpenAppInstallHistoryEntity, MJOpenAppInstallHistorySchema, MJOpenAppSchema, MJOutputDeliveryTypeEntity, MJOutputDeliveryTypeSchema, MJOutputFormatTypeEntity, MJOutputFormatTypeSchema, MJPermissionDomainEntity, MJPermissionDomainSchema, MJProcessRunDetailEntity, MJProcessRunDetailSchema, MJProcessRunEntity, MJProcessRunSchema, MJProjectEntity, MJProjectSchema, MJPublicLinkEntity, MJPublicLinkSchema, MJQueryCategoryEntity, MJQueryCategorySchema, MJQueryDependencyEntity, MJQueryDependencySchema, MJQueryEntity, MJQueryEntityEntity, MJQueryEntityExtended, MJQueryEntitySchema, MJQueryFieldEntity, MJQueryFieldSchema, MJQueryParameterEntity, MJQueryParameterSchema, MJQueryPermissionEntity, MJQueryPermissionSchema, MJQuerySQLEntity, MJQuerySQLSchema, MJQuerySchema, MJQueueEntity, MJQueueSchema, MJQueueTaskEntity, MJQueueTaskSchema, MJQueueTypeEntity, MJQueueTypeSchema, MJRSUPendingWorkEntity, MJRSUPendingWorkSchema, MJRecommendationEntity, MJRecommendationItemEntity, MJRecommendationItemSchema, MJRecommendationProviderEntity, MJRecommendationProviderSchema, MJRecommendationRunEntity, MJRecommendationRunSchema, MJRecommendationSchema, MJRecordChangeEntity, MJRecordChangeReplayRunEntity, MJRecordChangeReplayRunSchema, MJRecordChangeSchema, MJRecordGeoCodeEntity, MJRecordGeoCodeSchema, MJRecordLinkEntity, MJRecordLinkSchema, MJRecordMergeDeletionLogEntity, MJRecordMergeDeletionLogSchema, MJRecordMergeLogEntity, MJRecordMergeLogSchema, MJRecordProcessCategoryEntity, MJRecordProcessCategorySchema, MJRecordProcessEntity, MJRecordProcessSchema, MJRecordProcessWatermarkEntity, MJRecordProcessWatermarkSchema, MJRemoteOperationCategoryEntity, MJRemoteOperationCategorySchema, MJRemoteOperationEntity, MJRemoteOperationSchema, MJResourceLinkEntity, MJResourceLinkSchema, MJResourcePermissionEntity, MJResourcePermissionEntityExtended, MJResourcePermissionSchema, MJResourceTypeEntity, MJResourceTypeSchema, MJRoleEntity, MJRoleSchema, MJRowLevelSecurityFilterEntity, MJRowLevelSecurityFilterSchema, MJSQLDialectEntity, MJSQLDialectSchema, MJScheduledJobEntity, MJScheduledJobRunEntity, MJScheduledJobRunSchema, MJScheduledJobSchema, MJScheduledJobTypeEntity, MJScheduledJobTypeSchema, MJSchemaInfoEntity, MJSchemaInfoSchema, MJScopedPromptConfigEntity, MJScopedPromptConfigSchema, MJScopedPromptPartEntity, MJScopedPromptPartSchema, MJSearchExecutionLogEntity, MJSearchExecutionLogSchema, MJSearchProviderEntity, MJSearchProviderSchema, MJSearchScopeEntity, MJSearchScopeEntityEntity, MJSearchScopeEntitySchema, MJSearchScopeExternalIndexEntity, MJSearchScopeExternalIndexSchema, MJSearchScopePermissionEntity, MJSearchScopePermissionSchema, MJSearchScopeProviderEntity, MJSearchScopeProviderSchema, MJSearchScopeSchema, MJSearchScopeStorageAccountEntity, MJSearchScopeStorageAccountSchema, MJSearchScopeTestQueryEntity, MJSearchScopeTestQuerySchema, MJSignatureAccountEntity, MJSignatureAccountSchema, MJSignatureProviderEntity, MJSignatureProviderSchema, MJSignatureRequestDocumentEntity, MJSignatureRequestDocumentSchema, MJSignatureRequestEntity, MJSignatureRequestLogEntity, MJSignatureRequestLogSchema, MJSignatureRequestRecipientEntity, MJSignatureRequestRecipientSchema, MJSignatureRequestSchema, MJSkillEntity, MJSkillSchema, MJStateProvinceEntity, MJStateProvinceSchema, MJTagAuditLogEntity, MJTagAuditLogSchema, MJTagCoOccurrenceEntity, MJTagCoOccurrenceSchema, MJTagEntity, MJTagSchema, MJTagScopeEntity, MJTagScopeSchema, MJTagSuggestionEntity, MJTagSuggestionSchema, MJTagSynonymEntity, MJTagSynonymSchema, MJTaggedItemEntity, MJTaggedItemSchema, MJTaskDependencyEntity, MJTaskDependencySchema, MJTaskEntity, MJTaskSchema, MJTaskTypeEntity, MJTaskTypeSchema, MJTemplateCategoryEntity, MJTemplateCategorySchema, MJTemplateContentEntity, MJTemplateContentSchema, MJTemplateContentTypeEntity, MJTemplateContentTypeSchema, MJTemplateEntity, MJTemplateEntityExtended, MJTemplateParamEntity, MJTemplateParamSchema, MJTemplateSchema, MJTestEntity, MJTestRubricEntity, MJTestRubricSchema, MJTestRunEntity, MJTestRunFeedbackEntity, MJTestRunFeedbackSchema, MJTestRunOutputEntity, MJTestRunOutputSchema, MJTestRunOutputTypeEntity, MJTestRunOutputTypeSchema, MJTestRunSchema, MJTestSchema, MJTestSuiteEntity, MJTestSuiteRunEntity, MJTestSuiteRunSchema, MJTestSuiteSchema, MJTestSuiteTestEntity, MJTestSuiteTestSchema, MJTestTypeEntity, MJTestTypeSchema, MJThemeEntity, MJThemeSchema, MJUserApplicationEntity, MJUserApplicationEntityEntity, MJUserApplicationEntitySchema, MJUserApplicationSchema, MJUserEntity, MJUserFavoriteEntity, MJUserFavoriteSchema, MJUserNotificationEntity, MJUserNotificationPreferenceEntity, MJUserNotificationPreferenceSchema, MJUserNotificationSchema, MJUserNotificationTypeEntity, MJUserNotificationTypeSchema, MJUserRecordLogEntity, MJUserRecordLogSchema, MJUserRoleEntity, MJUserRoleSchema, MJUserRoutineEntity, MJUserRoutineRecipientEntity, MJUserRoutineRecipientSchema, MJUserRoutineRunEntity, MJUserRoutineRunSchema, MJUserRoutineSchema, MJUserSchema, MJUserSettingEntity, MJUserSettingSchema, MJUserViewCategoryEntity, MJUserViewCategorySchema, MJUserViewEntity, MJUserViewEntityExtended, MJUserViewRunDetailEntity, MJUserViewRunDetailSchema, MJUserViewRunEntity, MJUserViewRunSchema, MJUserViewSchema, MJVectorDatabaseEntity, MJVectorDatabaseSchema, MJVectorIndexEntity, MJVectorIndexSchema, MJVersionInstallationEntity, MJVersionInstallationSchema, MJVersionLabelEntity, MJVersionLabelItemEntity, MJVersionLabelItemSchema, MJVersionLabelRestoreEntity, MJVersionLabelRestoreSchema, MJVersionLabelSchema, MJViewTypeEntity, MJViewTypeSchema, MJWorkspaceEntity, MJWorkspaceItemEntity, MJWorkspaceItemSchema, MJWorkspaceSchema, PERMISSION_DOMAIN_ICONS, PERMISSION_DOMAIN_ICON_FALLBACK, PermissionEngine, PredictiveStudioControlExperimentSessionOperation, PredictiveStudioCreateScoringProcessOperation, PredictiveStudioPromoteModelOperation, PredictiveStudioRunFeaturePipelineOperation, PredictiveStudioScoreRecordSetOperation, PredictiveStudioStartExperimentSessionOperation, PredictiveStudioTrainModelOperation, QueryEngine, QueryPermissionProvider, ReadOnlyExternalBaseEntity, RecordComparisonCompareOperation, RecordProcessCancelRunOperation, RecordProcessGetRunStatusOperation, RecordProcessPauseRunOperation, RecordProcessResumeRunOperation, RecordProcessRunNowOperation, RegisterShareNotificationHandler, RemoteOperationEngineBase, ResolveArtifactTypeByMime, ResourceData, ResourcePermissionEngine, ResourcePermissionProvider, ResourceTypeEngine, SearchEngineBase, TaskGraphCancelOperation, TaskGraphForceCompleteTaskOperation, TaskGraphGetStatusOperation, TaskGraphOverrideEdgeOperation, TaskGraphPauseOperation, TaskGraphResumeOperation, TaskGraphRetryTaskOperation, TaskGraphSetBreakpointsOperation, TaskGraphSkipTaskOperation, TaskGraphStepOperation, TaskGraphSubmitOperation, TaskGraphUpdateTaskInputOperation, TemplateRunOperation, TypeTablesCache, UserInfoEngine, UserRoutineEngine, UserViewEngine, ViewColumnInfo, ViewFilterInfo, ViewFilterLogicInfo, ViewGridState, ViewSortDirectionInfo, ViewSortInfo, WorkflowDraftOperation, WorkflowSaveOperation, WorkflowValidateOperation, assertCallerMayCreateShare, buildActionsSummary, checkShareManagePermission, dispatchShareNotificationAfterSave, loadModule, parseConversationDetailComplete
73216
73612
 
73217
- // EXTERNAL MODULE: ../../MJCore/dist/index.js + 105 modules
73218
- var dist = __webpack_require__(954);
73613
+ // EXTERNAL MODULE: ../../MJCore/dist/index.js + 106 modules
73614
+ var dist = __webpack_require__(839);
73219
73615
  // EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 25 modules
73220
73616
  var MJGlobal_dist = __webpack_require__(401);
73221
73617
  ;// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
@@ -123062,7 +123458,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123062
123458
  while (1) switch (_context.n) {
123063
123459
  case 0:
123064
123460
  _context.n = 1;
123065
- return this.currentUserMayWrite();
123461
+ return this.currentUserMayWrite('save');
123066
123462
  case 1:
123067
123463
  if (_context.v) {
123068
123464
  _context.n = 2;
@@ -123087,7 +123483,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123087
123483
  while (1) switch (_context2.n) {
123088
123484
  case 0:
123089
123485
  _context2.n = 1;
123090
- return this.currentUserMayWrite();
123486
+ return this.currentUserMayWrite('delete');
123091
123487
  case 1:
123092
123488
  if (_context2.v) {
123093
123489
  _context2.n = 2;
@@ -123107,12 +123503,13 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123107
123503
  }, {
123108
123504
  key: "currentUserMayWrite",
123109
123505
  value: function () {
123110
- var _currentUserMayWrite = MJConversationDetailEntityExtended_asyncToGenerator(/*#__PURE__*/MJConversationDetailEntityExtended_regenerator().m(function _callee3() {
123506
+ var _currentUserMayWrite = MJConversationDetailEntityExtended_asyncToGenerator(/*#__PURE__*/MJConversationDetailEntityExtended_regenerator().m(function _callee3(operation) {
123111
123507
  var _this = this;
123112
- var provider, user, conversation, loaded, isOwner, engine, grant, _t;
123508
+ var resultType, provider, user, conversation, loaded, isOwner, engine, grant, message, _t;
123113
123509
  return MJConversationDetailEntityExtended_regenerator().w(function (_context3) {
123114
123510
  while (1) switch (_context3.p = _context3.n) {
123115
123511
  case 0:
123512
+ resultType = operation === 'delete' ? 'delete' : this.IsSaved ? 'update' : 'create';
123116
123513
  provider = this.ProviderToUse;
123117
123514
  if (!((provider === null || provider === void 0 ? void 0 : provider.ProviderType) !== 'Database')) {
123118
123515
  _context3.n = 1;
@@ -123153,7 +123550,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123153
123550
  _context3.n = 7;
123154
123551
  break;
123155
123552
  }
123156
- this.RecordDenied('Only the conversation owner can set or change the rating and feedback on this message.');
123553
+ this.RecordDenied('Only the conversation owner can set or change the rating and feedback on this message.', resultType);
123157
123554
  return _context3.a(2, false);
123158
123555
  case 7:
123159
123556
  engine = ResourcePermissionEngine.GetProviderInstance(provider, ResourcePermissionEngine);
@@ -123167,7 +123564,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123167
123564
  _context3.n = 9;
123168
123565
  break;
123169
123566
  }
123170
- this.RecordDenied('You do not have access to this conversation.');
123567
+ this.RecordDenied('You do not have access to this conversation.', resultType);
123171
123568
  return _context3.a(2, false);
123172
123569
  case 9:
123173
123570
  if (!(grant.PermissionLevel === 'Edit' || grant.PermissionLevel === 'Owner')) {
@@ -123177,19 +123574,20 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123177
123574
  return _context3.a(2, true);
123178
123575
  case 10:
123179
123576
  // Only View — block writes.
123180
- this.RecordDenied('You have view-only access to this conversation.');
123577
+ this.RecordDenied('You have view-only access to this conversation.', resultType);
123181
123578
  return _context3.a(2, false);
123182
123579
  case 11:
123183
123580
  _context3.p = 11;
123184
123581
  _t = _context3.v;
123185
- (0,dist/* LogError */.ZI8)("MJConversationDetailEntityExtended.currentUserMayWrite failed: ".concat(_t instanceof Error ? _t.message : String(_t)));
123582
+ message = _t instanceof Error ? _t.message : String(_t);
123583
+ (0,dist/* LogError */.ZI8)("MJConversationDetailEntityExtended.currentUserMayWrite failed " + "(".concat(operation, " on conversation ").concat(this.ConversationID, ", user ").concat(user.ID, "): ").concat(message));
123186
123584
  // Fail closed — safer to deny than silently allow a compromised write.
123187
- this.RecordDenied('Unable to verify conversation permissions.');
123585
+ this.RecordDenied('Unable to verify conversation permissions.', resultType);
123188
123586
  return _context3.a(2, false);
123189
123587
  }
123190
123588
  }, _callee3, this, [[2, 11]]);
123191
123589
  }));
123192
- function currentUserMayWrite() {
123590
+ function currentUserMayWrite(_x3) {
123193
123591
  return _currentUserMayWrite.apply(this, arguments);
123194
123592
  }
123195
123593
  return currentUserMayWrite;
@@ -123217,17 +123615,24 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
123217
123615
  return matches;
123218
123616
  }
123219
123617
  /**
123220
- * Populate `LatestResult.Message` so callers that inspect the save result
123221
- * see why the write was refused rather than a generic failure.
123618
+ * Records WHY the write was refused as a NEW `ResultHistory` entry, so callers that read
123619
+ * `LatestResult.CompleteMessage` see the reason (issue #4791).
123620
+ *
123621
+ * It must be a new entry, not an edit of `LatestResult`: on a brand-new record there IS no
123622
+ * `LatestResult` yet (nothing has been saved), so editing it silently dropped the denial and
123623
+ * every caller logged "unknown error". Appending also leaves an earlier successful save's
123624
+ * entry untouched. Mirrors `ReadOnlyExternalBaseEntity.rejectMutation`.
123222
123625
  */
123223
123626
  }, {
123224
123627
  key: "RecordDenied",
123225
- value: function RecordDenied(message) {
123226
- var result = this.LatestResult;
123227
- if (result) {
123228
- result.Success = false;
123229
- result.Message = message;
123230
- }
123628
+ value: function RecordDenied(message, type) {
123629
+ var result = new dist/* BaseEntityResult */.KVj();
123630
+ result.Success = false;
123631
+ result.Type = type;
123632
+ result.Message = message;
123633
+ result.StartedAt = new Date();
123634
+ result.EndedAt = new Date();
123635
+ this.RegisterResultHistoryEntry(result);
123231
123636
  }
123232
123637
  }]);
123233
123638
  }(MJConversationDetailEntity);
@@ -127289,7 +127694,7 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127289
127694
  value: function () {
127290
127695
  var _HandleIndividualBaseEntityEvent = conversations_asyncToGenerator(/*#__PURE__*/conversations_regenerator().m(function _callee29(event) {
127291
127696
  var _event$baseEntity, _event$payload;
127292
- var entityName, normalizedName, effectiveType;
127697
+ var entityName, normalizedName, effectiveType, handled, row, _t11;
127293
127698
  return conversations_regenerator().w(function (_context29) {
127294
127699
  while (1) switch (_context29.n) {
127295
127700
  case 0:
@@ -127312,39 +127717,54 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127312
127717
  case 3:
127313
127718
  normalizedName = entityName.toLowerCase().trim(); // For remote-invalidate events, resolve the action to save/delete for our handlers
127314
127719
  effectiveType = event.type === 'remote-invalidate' ? ((_event$payload = event.payload) === null || _event$payload === void 0 ? void 0 : _event$payload.action) || 'save' : event.type;
127315
- if (!(normalizedName === 'mj: conversations')) {
127316
- _context29.n = 4;
127720
+ handled = normalizedName === 'mj: conversations' || normalizedName === 'mj: conversation details' || normalizedName === 'mj: projects' || normalizedName === 'mj: ai agent runs' || normalizedName === 'mj: conversation detail artifacts' || normalizedName === 'mj: conversation detail ratings';
127721
+ if (!handled) {
127722
+ _context29.n = 11;
127317
127723
  break;
127318
127724
  }
127319
- return _context29.a(2, this.handleConversationEntityEvent(event, effectiveType));
127320
- case 4:
127321
- if (!(normalizedName === 'mj: conversation details')) {
127725
+ if (!this.eventNeedsRow(event, normalizedName, effectiveType)) {
127322
127726
  _context29.n = 5;
127323
127727
  break;
127324
127728
  }
127325
- return _context29.a(2, this.handleConversationDetailEntityEvent(event, effectiveType));
127729
+ _context29.n = 4;
127730
+ return (0,dist/* ResolveEntityEventRow */.sf4)(event, this.ProviderToUse, this.ContextUser);
127731
+ case 4:
127732
+ _t11 = _context29.v;
127733
+ _context29.n = 6;
127734
+ break;
127326
127735
  case 5:
127327
- if (!(normalizedName === 'mj: projects')) {
127328
- _context29.n = 6;
127329
- break;
127330
- }
127331
- return _context29.a(2, this.handleProjectEntityEvent(event, effectiveType));
127736
+ _t11 = null;
127332
127737
  case 6:
127333
- if (!(normalizedName === 'mj: ai agent runs')) {
127738
+ row = _t11;
127739
+ if (!(normalizedName === 'mj: conversations')) {
127334
127740
  _context29.n = 7;
127335
127741
  break;
127336
127742
  }
127337
- return _context29.a(2, this.handleAgentRunEntityEvent(event, effectiveType));
127743
+ return _context29.a(2, this.handleConversationEntityEvent(event, effectiveType, row));
127338
127744
  case 7:
127339
- if (!(normalizedName === 'mj: conversation detail artifacts' || normalizedName === 'mj: conversation detail ratings')) {
127745
+ if (!(normalizedName === 'mj: conversation details')) {
127340
127746
  _context29.n = 8;
127341
127747
  break;
127342
127748
  }
127343
- return _context29.a(2, this.handlePeripheralJunctionEntityEvent(event));
127749
+ return _context29.a(2, this.handleConversationDetailEntityEvent(event, effectiveType, row));
127344
127750
  case 8:
127345
- _context29.n = 9;
127346
- return conversations_superPropGet(ConversationEngine, "HandleIndividualBaseEntityEvent", this, 3)([event]);
127751
+ if (!(normalizedName === 'mj: projects')) {
127752
+ _context29.n = 9;
127753
+ break;
127754
+ }
127755
+ return _context29.a(2, this.handleProjectEntityEvent(event, effectiveType, row));
127347
127756
  case 9:
127757
+ if (!(normalizedName === 'mj: ai agent runs')) {
127758
+ _context29.n = 10;
127759
+ break;
127760
+ }
127761
+ return _context29.a(2, this.handleAgentRunEntityEvent(event, effectiveType, row));
127762
+ case 10:
127763
+ return _context29.a(2, this.handlePeripheralJunctionEntityEvent(event, row));
127764
+ case 11:
127765
+ _context29.n = 12;
127766
+ return conversations_superPropGet(ConversationEngine, "HandleIndividualBaseEntityEvent", this, 3)([event]);
127767
+ case 12:
127348
127768
  return _context29.a(2, _context29.v);
127349
127769
  }
127350
127770
  }, _callee29, this);
@@ -127355,28 +127775,101 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127355
127775
  return HandleIndividualBaseEntityEvent;
127356
127776
  }()
127357
127777
  /**
127358
- * Extracts record data from a BaseEntityEvent.
127359
- * For local events: uses baseEntity directly.
127360
- * For remote-invalidate events: parses recordData JSON from the payload.
127361
- * Returns null if no data is available.
127778
+ * Will anything below actually use the row, or does the primary key suffice?
127779
+ *
127780
+ * Asked BEFORE hydrating, because for a remote event whose entity is not on the server's
127781
+ * broadcast allowlist, hydrating costs a read through the provider. This dispatcher runs in
127782
+ * every connected browser, for every save of these entities anywhere in the system — and
127783
+ * conversation details are the hottest write path in the product, so an unconditional read
127784
+ * here is one round trip per connected client per message, nearly all of them refused for a
127785
+ * session with no claim to the record.
127786
+ *
127787
+ * Every `false` below is a case where the handler already returns early without touching the
127788
+ * row, so skipping the read changes nothing a caller can observe.
127362
127789
  */
127363
127790
  }, {
127364
- key: "extractRecordData",
127365
- value: function extractRecordData(event) {
127366
- // Local event — entity is available directly
127367
- if (event.baseEntity) {
127368
- return event.baseEntity.GetAll();
127791
+ key: "eventNeedsRow",
127792
+ value: function eventNeedsRow(event, normalizedName, effectiveType) {
127793
+ // A row that costs nothing is never worth skipping. Free for a local event (the row IS the
127794
+ // live entity) and for a remote event whose payload already carries `recordData`, because
127795
+ // the entity is on the server's broadcast allowlist.
127796
+ //
127797
+ // This has to come first, and the per-entity reasoning below has to be read as being about
127798
+ // THE READ. Applying it to a free row is what dropped a remote project save: the save
127799
+ // branch uses EnvironmentID and IsArchived off the row, and with the row nulled it read
127800
+ // them as undefined/false, concluded the project was outside the loaded environment, and
127801
+ // filtered it out of the list — for exactly the sessions displaying it.
127802
+ if ((0,dist/* EntityEventRowIsFree */.ik_)(event)) {
127803
+ return true;
127369
127804
  }
127370
- // Remote event — parse from payload
127371
- var payload = event.payload;
127372
- if (payload !== null && payload !== void 0 && payload.recordData) {
127373
- try {
127374
- return JSON.parse(payload.recordData);
127375
- } catch (_unused) {
127376
- return null;
127805
+ // Projects: a DELETE needs only the id. A SAVE genuinely uses the row — `EnvironmentID` and
127806
+ // `IsArchived` are what decide whether the project stays in the list — so it has to be
127807
+ // hydrated whenever we hold the project.
127808
+ //
127809
+ // The earlier reasoning here ("a save that got this far has nothing to merge regardless")
127810
+ // was true of the MERGE and false of the branch beside it: without the row, `EnvironmentID`
127811
+ // reads as absent, `inLoadedEnvironment` comes out false for any session that has loaded an
127812
+ // environment, and the save REMOVES the project instead. That is precisely the cross-client
127813
+ // case this change exists to serve, so it is gated like conversations are: when we do not
127814
+ // hold the project the remote path does nothing anyway (the append branch below requires
127815
+ // `event.baseEntity`), and the row would be fetched only to be discarded.
127816
+ if (normalizedName === 'mj: projects') {
127817
+ if (effectiveType !== 'save') {
127818
+ return false;
127377
127819
  }
127820
+ var id = this.eventRecordID(event, null);
127821
+ return !!id && this._projects$.value.some(function (p) {
127822
+ return (0,MJGlobal_dist/* UUIDsEqual */.jd)(p.ID, id);
127823
+ });
127378
127824
  }
127379
- return null;
127825
+ if (normalizedName === 'mj: conversations') {
127826
+ // A delete needs only the id. A save merges fields onto a conversation we already
127827
+ // hold — and when we do not hold it, the remote branch of the handler does nothing,
127828
+ // so the row would be fetched only to be discarded.
127829
+ if (effectiveType !== 'save') {
127830
+ return false;
127831
+ }
127832
+ var _id = this.eventRecordID(event, null);
127833
+ return !!_id && !!this.GetConversation(_id);
127834
+ }
127835
+ // Details, agent runs and the junction entities all resolve through the detail cache and
127836
+ // return early when the conversation they name is not in it.
127837
+ //
127838
+ // A remote DELETE can never be served: the record is gone, so the re-read comes back null
127839
+ // and every one of those handlers early-returns on the missing foreign key. The round trip
127840
+ // could not change an outcome, so it is not made. (That these handlers cannot act on a
127841
+ // remote delete at all is a pre-existing gap — deletes never carried `recordData` at either
127842
+ // publish site — and is not what this method is for.) Local deletes are unaffected: the
127843
+ // free-row check above already returned true for them.
127844
+ if (effectiveType === 'delete') {
127845
+ return false;
127846
+ }
127847
+ // With the cache empty — any session that has not opened a conversation — none of them can
127848
+ // do anything, whatever the row says. (A non-empty cache still needs the read:
127849
+ // ConversationID is a foreign key, so the primary key cannot tell us whether this detail
127850
+ // belongs to a conversation we hold.)
127851
+ return this._detailCache.size > 0;
127852
+ }
127853
+ /**
127854
+ * This record's id, from the primary key the event always carries.
127855
+ *
127856
+ * Prefers the key over the row: the key is broadcast unconditionally, whereas the row is only
127857
+ * present for allowlisted entities or after a re-read. Falls back to the row's `ID` so a
127858
+ * single-column entity still resolves if the key is ever absent.
127859
+ */
127860
+ }, {
127861
+ key: "eventRecordID",
127862
+ value: function eventRecordID(event, data) {
127863
+ var _key$KeyValuePairs;
127864
+ var key = (0,dist/* ResolveEntityEventKey */.ncE)(event);
127865
+ var fromKey = key === null || key === void 0 || (_key$KeyValuePairs = key.KeyValuePairs) === null || _key$KeyValuePairs === void 0 || (_key$KeyValuePairs = _key$KeyValuePairs.find(function (kv) {
127866
+ var _kv$FieldName;
127867
+ return ((_kv$FieldName = kv.FieldName) === null || _kv$FieldName === void 0 ? void 0 : _kv$FieldName.toLowerCase()) === 'id';
127868
+ })) === null || _key$KeyValuePairs === void 0 ? void 0 : _key$KeyValuePairs.Value;
127869
+ if (fromKey != null && String(fromKey).length > 0) {
127870
+ return String(fromKey);
127871
+ }
127872
+ return data === null || data === void 0 ? void 0 : data['ID'];
127380
127873
  }
127381
127874
  /**
127382
127875
  * Safely merges data onto a target object that may or may not be a BaseEntity.
@@ -127398,11 +127891,19 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127398
127891
  */
127399
127892
  }, {
127400
127893
  key: "handleConversationEntityEvent",
127401
- value: function handleConversationEntityEvent(event, action) {
127402
- var data = this.extractRecordData(event);
127403
- var id = data === null || data === void 0 ? void 0 : data['ID'];
127894
+ value: function handleConversationEntityEvent(event, action, data) {
127895
+ // Identity comes from the primary key, which is broadcast unconditionally — a delete needs
127896
+ // nothing else, so it no longer depends on the row being available.
127897
+ var id = this.eventRecordID(event, data);
127404
127898
  if (!id) return true;
127405
127899
  if (action === 'save') {
127900
+ // Same reasoning as handleProjectEntityEvent: the row can be null even when
127901
+ // `eventNeedsRow` said yes, because the re-read can be refused, find the record gone,
127902
+ // or simply fail — all of which `ResolveEntityEventRow` reports as null rather than
127903
+ // throwing. `mergeDataOntoRecord` would hand that null to `BaseEntity.SetMany`, which
127904
+ // throws, and nothing above this frame catches it. A conversation we cannot re-read
127905
+ // stays as it was; the next `LoadConversations` corrects it.
127906
+ if (!data) return true;
127406
127907
  var existing = this.GetConversation(id);
127407
127908
  if (existing) {
127408
127909
  this.mergeDataOntoRecord(existing, data);
@@ -127435,10 +127936,11 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127435
127936
  */
127436
127937
  }, {
127437
127938
  key: "handleConversationDetailEntityEvent",
127438
- value: function handleConversationDetailEntityEvent(event, action) {
127939
+ value: function handleConversationDetailEntityEvent(event, action, data) {
127439
127940
  var entity = event.baseEntity;
127440
- var data = this.extractRecordData(event);
127441
- var id = data === null || data === void 0 ? void 0 : data['ID'];
127941
+ var id = this.eventRecordID(event, data);
127942
+ // ConversationID is a foreign key, so the primary key cannot supply it — this is the field
127943
+ // the dispatcher's re-read exists to obtain.
127442
127944
  var conversationId = data === null || data === void 0 ? void 0 : data['ConversationID'];
127443
127945
  if (!id || !conversationId) return true;
127444
127946
  var key = (0,MJGlobal_dist/* NormalizeUUID */.Xw)(conversationId);
@@ -127480,9 +127982,8 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127480
127982
  */
127481
127983
  }, {
127482
127984
  key: "handleProjectEntityEvent",
127483
- value: function handleProjectEntityEvent(event, action) {
127484
- var data = this.extractRecordData(event);
127485
- var id = data === null || data === void 0 ? void 0 : data['ID'];
127985
+ value: function handleProjectEntityEvent(event, action, data) {
127986
+ var id = this.eventRecordID(event, data);
127486
127987
  if (!id) return true;
127487
127988
  var current = this._projects$.value;
127488
127989
  var existingIdx = current.findIndex(function (p) {
@@ -127496,9 +127997,32 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127496
127997
  }
127497
127998
  return true;
127498
127999
  }
127499
- // save — only track projects in the loaded environment; drop archived ones
127500
- var environmentId = data === null || data === void 0 ? void 0 : data['EnvironmentID'];
127501
- var isArchived = (data === null || data === void 0 ? void 0 : data['IsArchived']) === true;
128000
+ // WITHOUT THE ROW WE KNOW NOTHING, and must not guess. Every field below would read as
128001
+ // absent: `IsArchived` becomes false, which is harmless, but `EnvironmentID` becomes
128002
+ // undefined — and "no environment" is indistinguishable from "moved to another one", so the
128003
+ // branch that DROPS the project is the one that runs. Leaving it untouched is the only
128004
+ // honest response to a row we do not have.
128005
+ //
128006
+ // `eventNeedsRow` is supposed to guarantee this never happens for a project we hold, but
128007
+ // that contract is enforced by a comment and `strictNullChecks` is off in this package, so
128008
+ // the guarantee is restated here where the damage would be done. Hydration can also simply
128009
+ // fail: `ResolveEntityEventRow` returns null rather than throwing.
128010
+ //
128011
+ // KEEPING IT IS DELIBERATE EVEN WHEN THE ROW WAS WITHHELD ON PURPOSE. A null can mean the
128012
+ // re-read was refused — the viewer may no longer read this project — or that it failed.
128013
+ // The two are indistinguishable here, and they want opposite responses, so this takes the
128014
+ // one whose wrong case is recoverable: a stale row in a sidebar is corrected by the next
128015
+ // `LoadProjects`, whereas a project deleted from the UI on a transient read failure is
128016
+ // gone until the user reloads and cannot be told why.
128017
+ if (!data) {
128018
+ return true;
128019
+ }
128020
+ // save — only track projects in the loaded environment; drop archived ones.
128021
+ // No `?.` past the guard above: `data` is non-null here, and optional chaining would say
128022
+ // otherwise. It is also what let `mergeDataOntoRecord(…, data)` accept a nullable argument
128023
+ // without complaint, since `strictNullChecks` is off in this package.
128024
+ var environmentId = data['EnvironmentID'];
128025
+ var isArchived = data['IsArchived'] === true;
127502
128026
  var inLoadedEnvironment = !this._lastProjectsEnvironmentId || environmentId != null && (0,MJGlobal_dist/* UUIDsEqual */.jd)(environmentId, this._lastProjectsEnvironmentId);
127503
128027
  if (existingIdx >= 0) {
127504
128028
  if (isArchived || !inLoadedEnvironment) {
@@ -127521,9 +128045,9 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127521
128045
  */
127522
128046
  }, {
127523
128047
  key: "handleAgentRunEntityEvent",
127524
- value: function handleAgentRunEntityEvent(event, action) {
127525
- var data = this.extractRecordData(event);
127526
- var id = data === null || data === void 0 ? void 0 : data['ID'];
128048
+ value: function handleAgentRunEntityEvent(event, action, data) {
128049
+ var id = this.eventRecordID(event, data);
128050
+ // Foreign key, not part of this row's primary key — supplied by the dispatcher's re-read.
127527
128051
  var detailId = data === null || data === void 0 ? void 0 : data['ConversationDetailID'];
127528
128052
  if (!id || !detailId) return true;
127529
128053
  // Find which conversation cache entry contains this detail ID
@@ -127572,8 +128096,9 @@ var ConversationEngine = /*#__PURE__*/function (_BaseEngine) {
127572
128096
  */
127573
128097
  }, {
127574
128098
  key: "handlePeripheralJunctionEntityEvent",
127575
- value: function handlePeripheralJunctionEntityEvent(event) {
127576
- var data = this.extractRecordData(event);
128099
+ value: function handlePeripheralJunctionEntityEvent(event, data) {
128100
+ // The junction's own primary key is not useful here; what matters is which detail it hangs
128101
+ // off, which is a foreign key and therefore only available from the row.
127577
128102
  var detailId = data === null || data === void 0 ? void 0 : data['ConversationDetailID'];
127578
128103
  if (!detailId) return true;
127579
128104
  var _iterator14 = conversations_createForOfIteratorHelper(this._detailCache),
@@ -159810,8 +160335,8 @@ var ComponentRegistry = /*#__PURE__*/function () {
159810
160335
  }
159811
160336
  }]);
159812
160337
  }();
159813
- // EXTERNAL MODULE: ../../MJCore/dist/index.js + 105 modules
159814
- var dist = __webpack_require__(954);
160338
+ // EXTERNAL MODULE: ../../MJCore/dist/index.js + 106 modules
160339
+ var dist = __webpack_require__(839);
159815
160340
  // EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 25 modules
159816
160341
  var MJGlobal_dist = __webpack_require__(401);
159817
160342
  // EXTERNAL MODULE: ../../MJCoreEntities/dist/index.js + 69 modules