@memberjunction/react-runtime 5.46.0 → 5.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
1
 
2
- > @memberjunction/react-runtime@5.46.0 build
2
+ > @memberjunction/react-runtime@5.48.0 build
3
3
  > npm run build:node && npm run build:umd
4
4
 
5
5
 
6
- > @memberjunction/react-runtime@5.46.0 build:node
6
+ > @memberjunction/react-runtime@5.48.0 build:node
7
7
  > tsc && tsc-alias -f
8
8
 
9
9
 
10
- > @memberjunction/react-runtime@5.46.0 build:umd
10
+ > @memberjunction/react-runtime@5.48.0 build:umd
11
11
  > webpack --config webpack.umd.config.cjs
12
12
 
13
13
  Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
14
14
  npx update-browserslist-db@latest
15
15
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
16
16
  [BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/MJ/MJ/packages/MJCoreEntities/dist/generated/entity_subclasses.js as it exceeds the max of 500KB.
17
- asset runtime.umd.js 8.56 MiB [compared for emit] [big] (name: main)
17
+ asset runtime.umd.js 8.57 MiB [compared for emit] [big] (name: main)
18
18
  asset 324.runtime.umd.js 216 KiB [compared for emit]
19
19
  asset 490.runtime.umd.js 182 KiB [compared for emit] (id hint: vendors)
20
20
  orphan modules 8.57 MiB [orphan] 558 modules
21
21
  runtime modules 6.94 KiB 10 modules
22
- cacheable modules 8.71 MiB
22
+ cacheable modules 8.72 MiB
23
23
  modules by path ../../../node_modules/ 781 KiB
24
24
  modules by path ../../../node_modules/rxjs/dist/esm5/internal/ 30.4 KiB 16 modules
25
25
  modules by path ../../../node_modules/debug/src/*.js 12.7 KiB 2 modules
@@ -28,7 +28,7 @@ cacheable modules 8.71 MiB
28
28
  ../../MJCoreEntities/dist/index.js + 59 modules 5.3 MiB [built] [code generated]
29
29
  ../../MJCoreEntities/dist/engines/UserViewEngine.js 19.6 KiB [built] [code generated]
30
30
  ./dist/index.js + 28 modules 432 KiB [built] [code generated]
31
- ../../MJCore/dist/index.js + 88 modules 1.73 MiB [built] [code generated]
31
+ ../../MJCore/dist/index.js + 88 modules 1.74 MiB [built] [code generated]
32
32
  ../../MJGlobal/dist/index.js + 22 modules 293 KiB [built] [code generated]
33
33
  ../../GraphQLDataProvider/dist/index.mjs 192 KiB [built] [code generated]
34
- webpack 5.105.0 compiled successfully in 73090 ms
34
+ webpack 5.105.0 compiled successfully in 81946 ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @memberjunction/react-runtime
2
2
 
3
+ ## 5.48.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [09e1b4b]
8
+ - Updated dependencies [f613d0d]
9
+ - @memberjunction/core@5.48.0
10
+ - @memberjunction/core-entities@5.48.0
11
+ - @memberjunction/graphql-dataprovider@5.48.0
12
+ - @memberjunction/interactive-component-types@5.48.0
13
+ - @memberjunction/global@5.48.0
14
+
15
+ ## 5.47.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [b216f2b]
20
+ - @memberjunction/core@5.47.0
21
+ - @memberjunction/graphql-dataprovider@5.47.0
22
+ - @memberjunction/interactive-component-types@5.47.0
23
+ - @memberjunction/core-entities@5.47.0
24
+ - @memberjunction/global@5.47.0
25
+
3
26
  ## 5.46.0
4
27
 
5
28
  ### Patch Changes
@@ -361,7 +361,7 @@ var se=Object.defineProperty;var d=(g,e)=>se(g,"name",{value:e,configurable:!0})
361
361
  }
362
362
  }
363
363
  }
364
- `,r={entityDocumentID:e.entityDocumentID};e.maxRecords!==void 0&&(r.maxRecords=e.maxRecords),e.filter!==void 0&&(r.filter=e.filter);const s=await this._dataProvider.ExecuteGQL(t,r);if(!s?.FetchEntityVectors)throw new Error("Invalid response from server");return s.FetchEntityVectors}catch(t){const r=t;return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogError */ .ZI8)("GraphQLAIClient.FetchEntityVectors failed",void 0,r),{Success:!1,Results:[],TotalCount:0,ElapsedMs:0,ErrorMessage:r.message||"Unknown error"}}}}const F="5.46.0",w="default";class X{static{d(this,"BrowserStorageProviderBase")}constructor(){this._storage=new Map}getCategoryMap(e){const t=e||w;let r=this._storage.get(t);return r||(r=new Map,this._storage.set(t,r)),r}async GetItem(e,t){const s=this.getCategoryMap(t||w).get(e);return s===void 0?null:s}async GetItems(e,t){const r=new Map;if(e.length===0)return r;const s=this.getCategoryMap(t||w);for(const n of new Set(e)){const a=s.get(n);r.set(n,a===void 0?null:a)}return r}async SetItem(e,t,r){this.getCategoryMap(r||w).set(e,t)}async Remove(e,t){this.getCategoryMap(t||w).delete(e)}async ClearCategory(e){const t=e||w;this._storage.delete(t)}async GetCategoryKeys(e){const t=this._storage.get(e||w);return t?Array.from(t.keys()):[]}}const $e="MJ_Metadata",Pe=0;function Me(){try{const g=F.split("."),e=parseInt(g[0],10),t=parseInt(g[1],10);if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error(`Could not parse major.minor from version "${F}"`);return e*1e3+t+Pe}catch(g){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:g,message:"Failed to derive IDB version from PACKAGE_VERSION; using fallback 99999"}),99999}}d(Me,"computeIdbVersion");const Ae=Me(),Y=["mj:default","mj:Metadata","mj:RunViewCache","mj:RunQueryCache","mj:DatasetCache"];class Z extends X{static{d(this,"BrowserIndexedDBStorageProvider")}constructor(){super(),this._dbReady=!1,this.dbPromise=(0,_tempfix_idb__WEBPACK_IMPORTED_MODULE_10__/* .openDB */ .P2)($e,Ae,{upgrade:d((e,t,r)=>{try{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)(`[IDBCache] Upgrading IndexedDB schema v${t} \u2192 v${r} (package ${F}). Dropping all stores; caches will repopulate on first use.`);for(const s of Array.from(e.objectStoreNames))e.deleteObjectStore(s);for(const s of Y)e.objectStoreNames.contains(s)||e.createObjectStore(s)}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message})}},"upgrade"),blocked:d((e,t)=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)(`[IDBCache] Upgrade from v${e} to v${t} blocked by another tab. Close other tabs to allow the upgrade to proceed.`)},"blocked")}),this.dbPromise.then(e=>{this._dbReady=!0,e.onversionchange=()=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)("[IDBCache] DB schema upgraded in another tab \u2014 closing local connection."),e.close(),this._dbReady=!1}}).catch(e=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:e,message:"IndexedDB initialization failed: "+e?.message})})}get IsReady(){return this._dbReady}isKnownCategory(e){const t=`mj:${e}`;return Y.includes(t)}getStoreName(e){const t=e||w;return this.isKnownCategory(t)?`mj:${t}`:"mj:default"}getStoreKey(e,t){const r=t||w;return this.isKnownCategory(r)?e:`[${r}]:${e}`}async SetItem(e,t,r){try{const s=await this.dbPromise,n=this.getStoreName(r),a=this.getStoreKey(e,r),i=s.transaction(n,"readwrite");await i.objectStore(n).put(t,a),await i.done}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message})}}async GetItem(e,t){try{const r=await this.dbPromise,s=this.getStoreName(t),n=this.getStoreKey(e,t),a=await r.transaction(s).objectStore(s).get(n);return a===void 0?null:a}catch(r){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:r,message:r?.message}),null}}async GetItems(e,t){const r=new Map;if(e.length===0)return r;try{const s=await this.dbPromise,n=this.getStoreName(t),a=Array.from(new Set(e)),i=a.map(f=>this.getStoreKey(f,t)),o=s.transaction(n,"readonly"),y=o.objectStore(n),u=i.map(f=>y.get(f)),h=await Promise.all(u);await o.done;for(let f=0;f<a.length;f++){const m=h[f];r.set(a[f],m===void 0?null:m)}return r}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message});for(const n of new Set(e))r.set(n,null);return r}}async Remove(e,t){try{const r=await this.dbPromise,s=this.getStoreName(t),n=this.getStoreKey(e,t),a=r.transaction(s,"readwrite");await a.objectStore(s).delete(n),await a.done}catch(r){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:r,message:r?.message})}}async ClearCategory(e){try{const t=await this.dbPromise,r=e||w,s=this.getStoreName(e);if(this.isKnownCategory(r)){const n=t.transaction(s,"readwrite");await n.objectStore(s).clear(),await n.done}else{const n=`[${r}]:`,a=t.transaction("mj:default","readwrite"),i=a.objectStore("mj:default"),o=await i.getAllKeys();for(const y of o)typeof y=="string"&&y.startsWith(n)&&await i.delete(y);await a.done}}catch(t){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:t,message:t?.message})}}async GetCategoryKeys(e){try{const t=await this.dbPromise,r=e||w,s=this.getStoreName(e),i=await t.transaction(s,"readonly").objectStore(s).getAllKeys();if(this.isKnownCategory(r))return i.map(y=>String(y));const o=`[${r}]:`;return i.map(y=>String(y)).filter(y=>y.startsWith(o)).map(y=>y.slice(o.length))}catch(t){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:t,message:t?.message}),[]}}}const b=new M,Ne=(0,graphql_request__WEBPACK_IMPORTED_MODULE_0__/* .gql */ .J1)`subscription RemoteOperationProgress($channelId: ID!) {
364
+ `,r={entityDocumentID:e.entityDocumentID};e.maxRecords!==void 0&&(r.maxRecords=e.maxRecords),e.filter!==void 0&&(r.filter=e.filter);const s=await this._dataProvider.ExecuteGQL(t,r);if(!s?.FetchEntityVectors)throw new Error("Invalid response from server");return s.FetchEntityVectors}catch(t){const r=t;return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogError */ .ZI8)("GraphQLAIClient.FetchEntityVectors failed",void 0,r),{Success:!1,Results:[],TotalCount:0,ElapsedMs:0,ErrorMessage:r.message||"Unknown error"}}}}const F="5.48.0",w="default";class X{static{d(this,"BrowserStorageProviderBase")}constructor(){this._storage=new Map}getCategoryMap(e){const t=e||w;let r=this._storage.get(t);return r||(r=new Map,this._storage.set(t,r)),r}async GetItem(e,t){const s=this.getCategoryMap(t||w).get(e);return s===void 0?null:s}async GetItems(e,t){const r=new Map;if(e.length===0)return r;const s=this.getCategoryMap(t||w);for(const n of new Set(e)){const a=s.get(n);r.set(n,a===void 0?null:a)}return r}async SetItem(e,t,r){this.getCategoryMap(r||w).set(e,t)}async Remove(e,t){this.getCategoryMap(t||w).delete(e)}async ClearCategory(e){const t=e||w;this._storage.delete(t)}async GetCategoryKeys(e){const t=this._storage.get(e||w);return t?Array.from(t.keys()):[]}}const $e="MJ_Metadata",Pe=0;function Me(){try{const g=F.split("."),e=parseInt(g[0],10),t=parseInt(g[1],10);if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error(`Could not parse major.minor from version "${F}"`);return e*1e3+t+Pe}catch(g){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:g,message:"Failed to derive IDB version from PACKAGE_VERSION; using fallback 99999"}),99999}}d(Me,"computeIdbVersion");const Ae=Me(),Y=["mj:default","mj:Metadata","mj:RunViewCache","mj:RunQueryCache","mj:DatasetCache"];class Z extends X{static{d(this,"BrowserIndexedDBStorageProvider")}constructor(){super(),this._dbReady=!1,this.dbPromise=(0,_tempfix_idb__WEBPACK_IMPORTED_MODULE_10__/* .openDB */ .P2)($e,Ae,{upgrade:d((e,t,r)=>{try{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)(`[IDBCache] Upgrading IndexedDB schema v${t} \u2192 v${r} (package ${F}). Dropping all stores; caches will repopulate on first use.`);for(const s of Array.from(e.objectStoreNames))e.deleteObjectStore(s);for(const s of Y)e.objectStoreNames.contains(s)||e.createObjectStore(s)}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message})}},"upgrade"),blocked:d((e,t)=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)(`[IDBCache] Upgrade from v${e} to v${t} blocked by another tab. Close other tabs to allow the upgrade to proceed.`)},"blocked")}),this.dbPromise.then(e=>{this._dbReady=!0,e.onversionchange=()=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogStatus */ .b09)("[IDBCache] DB schema upgraded in another tab \u2014 closing local connection."),e.close(),this._dbReady=!1}}).catch(e=>{(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:e,message:"IndexedDB initialization failed: "+e?.message})})}get IsReady(){return this._dbReady}isKnownCategory(e){const t=`mj:${e}`;return Y.includes(t)}getStoreName(e){const t=e||w;return this.isKnownCategory(t)?`mj:${t}`:"mj:default"}getStoreKey(e,t){const r=t||w;return this.isKnownCategory(r)?e:`[${r}]:${e}`}async SetItem(e,t,r){try{const s=await this.dbPromise,n=this.getStoreName(r),a=this.getStoreKey(e,r),i=s.transaction(n,"readwrite");await i.objectStore(n).put(t,a),await i.done}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message})}}async GetItem(e,t){try{const r=await this.dbPromise,s=this.getStoreName(t),n=this.getStoreKey(e,t),a=await r.transaction(s).objectStore(s).get(n);return a===void 0?null:a}catch(r){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:r,message:r?.message}),null}}async GetItems(e,t){const r=new Map;if(e.length===0)return r;try{const s=await this.dbPromise,n=this.getStoreName(t),a=Array.from(new Set(e)),i=a.map(f=>this.getStoreKey(f,t)),o=s.transaction(n,"readonly"),y=o.objectStore(n),u=i.map(f=>y.get(f)),h=await Promise.all(u);await o.done;for(let f=0;f<a.length;f++){const m=h[f];r.set(a[f],m===void 0?null:m)}return r}catch(s){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:s,message:s?.message});for(const n of new Set(e))r.set(n,null);return r}}async Remove(e,t){try{const r=await this.dbPromise,s=this.getStoreName(t),n=this.getStoreKey(e,t),a=r.transaction(s,"readwrite");await a.objectStore(s).delete(n),await a.done}catch(r){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:r,message:r?.message})}}async ClearCategory(e){try{const t=await this.dbPromise,r=e||w,s=this.getStoreName(e);if(this.isKnownCategory(r)){const n=t.transaction(s,"readwrite");await n.objectStore(s).clear(),await n.done}else{const n=`[${r}]:`,a=t.transaction("mj:default","readwrite"),i=a.objectStore("mj:default"),o=await i.getAllKeys();for(const y of o)typeof y=="string"&&y.startsWith(n)&&await i.delete(y);await a.done}}catch(t){(0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:t,message:t?.message})}}async GetCategoryKeys(e){try{const t=await this.dbPromise,r=e||w,s=this.getStoreName(e),i=await t.transaction(s,"readonly").objectStore(s).getAllKeys();if(this.isKnownCategory(r))return i.map(y=>String(y));const o=`[${r}]:`;return i.map(y=>String(y)).filter(y=>y.startsWith(o)).map(y=>y.slice(o.length))}catch(t){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:t,message:t?.message}),[]}}}const b=new M,Ne=(0,graphql_request__WEBPACK_IMPORTED_MODULE_0__/* .gql */ .J1)`subscription RemoteOperationProgress($channelId: ID!) {
365
365
  RemoteOperationProgress(channelId: $channelId) {
366
366
  ChannelId
367
367
  ProgressJSON
@@ -20629,6 +20629,29 @@ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
20629
20629
  objectExists: "SELECT OBJECT_ID(@objectName) AS object_id"
20630
20630
  };
20631
20631
  }
20632
+ /**
20633
+ * SQL Server FK-graph query for cascade planning — reads the `sys.foreign_keys` catalog.
20634
+ * Returns one row per FK column with `childNullable` (from `sys.columns.is_nullable`) and
20635
+ * `colCount` (columns in the constraint, for composite exclusion). Both parent + child are
20636
+ * filtered to `schema`. Schema is embedded as a literal (no bind params) so it runs via
20637
+ * `ExecuteSQL(sql)`.
20638
+ */
20639
+ }, {
20640
+ key: "ForeignKeyGraphSQL",
20641
+ value: function ForeignKeyGraphSQL(schema) {
20642
+ var s = this.QuoteStringLiteral(schema);
20643
+ // Disabled FKs (fk.is_disabled = 1) are intentionally NOT filtered: a disabled FK can't block
20644
+ // the Entity delete, so including it only yields an extra, conservative-safe child clear.
20645
+ // ORDER BY fk.name makes edge order — and therefore statement + dry-run order — deterministic.
20646
+ return 'SELECT rt.name AS parentTable, rc.name AS parentRefCol, pt.name AS childTable, ' + 'pc.name AS childCol, pc.is_nullable AS childNullable, fk.name AS fkName, ' + '(SELECT COUNT(*) FROM sys.foreign_key_columns x WHERE x.constraint_object_id = fk.object_id) AS colCount ' + 'FROM sys.foreign_keys fk ' + 'JOIN sys.foreign_key_columns fkc ON fkc.constraint_object_id = fk.object_id ' + 'JOIN sys.objects rt ON rt.object_id = fk.referenced_object_id ' + 'JOIN sys.schemas rs ON rs.schema_id = rt.schema_id ' + 'JOIN sys.columns rc ON rc.object_id = fk.referenced_object_id AND rc.column_id = fkc.referenced_column_id ' + 'JOIN sys.objects pt ON pt.object_id = fk.parent_object_id ' + 'JOIN sys.schemas ps ON ps.schema_id = pt.schema_id ' + 'JOIN sys.columns pc ON pc.object_id = fk.parent_object_id AND pc.column_id = fkc.parent_column_id ' + "WHERE rs.name = ".concat(s, " AND ps.name = ").concat(s, " ") + 'ORDER BY fk.name';
20647
+ }
20648
+ }, {
20649
+ key: "AtomicBatchScript",
20650
+ value: function AtomicBatchScript(statements) {
20651
+ if (!statements || !statements.length) return '';
20652
+ var body = statements.join(';\n');
20653
+ return "SET QUOTED_IDENTIFIER ON;\nSET ANSI_NULLS ON;\nSET XACT_ABORT ON;\nBEGIN TRANSACTION;\n".concat(body, ";\nCOMMIT TRANSACTION;");
20654
+ }
20632
20655
  // ─── IIF ─────────────────────────────────────────────────────────
20633
20656
  }, {
20634
20657
  key: "IIF",
@@ -21617,6 +21640,37 @@ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
21617
21640
  objectExists: "\n SELECT EXISTS (\n SELECT 1 FROM pg_catalog.pg_class c\n JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid\n WHERE n.nspname = $1 AND c.relname = $2\n ) AS exists"
21618
21641
  };
21619
21642
  }
21643
+ /**
21644
+ * PostgreSQL FK-graph query for cascade planning — reads `pg_catalog.pg_constraint`
21645
+ * (`contype = 'f'`). Returns one row per FK column (via `unnest(conkey, confkey)`, which
21646
+ * preserves column pairing/order), with `childNullable` (`NOT attnotnull`) and `colCount`
21647
+ * (`array_length(conkey, 1)`, for composite exclusion). Column aliases and semantics MATCH
21648
+ * the SQL Server variant so a single caller parses both. `relname`/`attname` preserve the
21649
+ * quoted mixed-case identifiers MJ creates on PG, so they feed straight into QuoteIdentifier.
21650
+ * Both parent + child are filtered to `schema`; the schema is embedded as a literal.
21651
+ */
21652
+ }, {
21653
+ key: "ForeignKeyGraphSQL",
21654
+ value: function ForeignKeyGraphSQL(schema) {
21655
+ var s = this.QuoteStringLiteral(schema);
21656
+ // NOTE: deliberately avoids `unnest(...) WITH ORDINALITY` / `LATERAL`. This query is executed
21657
+ // through PostgreSQLDataProvider.ExecuteSQL, whose autoQuoteIdentifiers tokenizer quotes the
21658
+ // bare uppercase word `ORDINALITY` (not in its keyword set) → `WITH "ORDINALITY"` → a syntax
21659
+ // error. Using `= any(con.conkey)` (all-lowercase, autoQuote-safe) resolves the FK column via
21660
+ // array membership instead. For SINGLE-column FKs (the only ones the planner keeps, colCount=1)
21661
+ // this yields exactly one correctly-paired row; composite FKs (colCount>1) produce a cross
21662
+ // product of rows that the caller skips wholesale by fkName — so the mispairing is irrelevant.
21663
+ return 'SELECT pt.relname AS "parentTable", pa.attname AS "parentRefCol", ct.relname AS "childTable", ' + 'ca.attname AS "childCol", (NOT ca.attnotnull) AS "childNullable", con.conname AS "fkName", ' + 'array_length(con.conkey, 1) AS "colCount" ' + 'FROM pg_catalog.pg_constraint con ' + 'JOIN pg_catalog.pg_class ct ON ct.oid = con.conrelid ' + 'JOIN pg_catalog.pg_namespace cn ON cn.oid = ct.relnamespace ' + 'JOIN pg_catalog.pg_class pt ON pt.oid = con.confrelid ' + 'JOIN pg_catalog.pg_namespace pn ON pn.oid = pt.relnamespace ' + 'JOIN pg_catalog.pg_attribute ca ON ca.attrelid = con.conrelid AND ca.attnum = any(con.conkey) ' + 'JOIN pg_catalog.pg_attribute pa ON pa.attrelid = con.confrelid AND pa.attnum = any(con.confkey) ' + "WHERE con.contype = 'f' AND cn.nspname = ".concat(s, " AND pn.nspname = ").concat(s, " ") + 'ORDER BY con.conname';
21664
+ }
21665
+ }, {
21666
+ key: "AtomicBatchScript",
21667
+ value: function AtomicBatchScript(statements) {
21668
+ if (!statements || !statements.length) return '';
21669
+ var body = statements.join(';\n');
21670
+ // No session pragmas (QUOTED_IDENTIFIER/ANSI_NULLS are SQL-Server concepts) and PostgreSQL
21671
+ // already aborts the whole transaction on any error, so plain BEGIN … COMMIT is all-or-nothing.
21672
+ return "BEGIN;\n".concat(body, ";\nCOMMIT;");
21673
+ }
21620
21674
  // ─── IIF ─────────────────────────────────────────────────────────
21621
21675
  }, {
21622
21676
  key: "IIF",
@@ -31864,18 +31918,37 @@ var BaseEntity = /*#__PURE__*/function () {
31864
31918
  var success = _ref.success,
31865
31919
  results = _ref.results,
31866
31920
  error = _ref.error;
31867
- if (success && results) {
31868
- var transItem = results.find(function (r) {
31869
- return r.Transaction.BaseEntity === _this8;
31870
- });
31871
- if (transItem) {
31872
- _this8.finalizeSave(transItem.Result, saveSubType); // we get the resulting data from the transaction result, not data above as that will be blank when in a TG
31873
- } else {
31874
- // should never get here, but if we do, we need to throw an error
31875
- throw new Error('Transaction group did not return a result for the entity object');
31876
- }
31921
+ var transItem = success && results ? results.find(function (r) {
31922
+ return r.Transaction.BaseEntity === _this8;
31923
+ }) : undefined;
31924
+ if (transItem) {
31925
+ _this8.finalizeSave(transItem.Result, saveSubType); // we get the resulting data from the transaction result, not data above as that will be blank when in a TG
31877
31926
  } else {
31878
- throw error; // push this to the catch block below and that will add to the result history
31927
+ // The transaction group failed / rolled back, OR (should never happen) reported success
31928
+ // without a result for this entity. Either way, RECORD the failure on ResultHistory rather
31929
+ // than throwing. This handler runs ASYNCHRONOUSLY — after Save() has already returned true and
31930
+ // its enclosing try/catch has unwound — so a throw here has no catch to reach: rxjs routes a
31931
+ // throwing next-handler to reportUnhandledError, which re-throws it on a fresh tick, producing
31932
+ // an uncaughtException that exits the whole host process (MJServer only guards
31933
+ // unhandledRejection). The transaction has already rolled back and Submit() returns false; the
31934
+ // caller's error handling still runs. Mirrors the Delete() transaction-group-failure path below.
31935
+ var err = error !== null && error !== void 0 ? error : success ? new Error('Transaction group did not return a result for the entity object') : undefined;
31936
+ if (currentResultCount === _this8.ResultHistory.length) {
31937
+ var _err$message;
31938
+ // no new result was recorded elsewhere, so add one here (mirrors Save()'s own catch block)
31939
+ newResult.Success = false;
31940
+ newResult.Type = saveSubType !== null && saveSubType !== void 0 ? saveSubType : _this8.IsSaved ? 'update' : 'create';
31941
+ newResult.Message = (_err$message = err === null || err === void 0 ? void 0 : err.message) !== null && _err$message !== void 0 ? _err$message : err != null ? String(err) : 'Transaction group failed';
31942
+ newResult.Errors = (err === null || err === void 0 ? void 0 : err.Errors) || [];
31943
+ newResult.OriginalValues = _this8.Fields.map(function (f) {
31944
+ return {
31945
+ FieldName: f.CodeName,
31946
+ Value: f.OldValue
31947
+ };
31948
+ });
31949
+ newResult.EndedAt = new Date();
31950
+ _this8.RegisterResultHistoryEntry(newResult);
31951
+ }
31879
31952
  }
31880
31953
  });
31881
31954
  return _context11.a(2, true);
@@ -32898,19 +32971,30 @@ var BaseEntity = /*#__PURE__*/function () {
32898
32971
  // wipe out the current data to flush out the DIRTY flags by calling NewRecord()
32899
32972
  _this0.NewRecord(); // will trigger a new record event here too
32900
32973
  } else {
32901
- // transaction failed, so we need to add a new result to the history here
32902
- newResult.Success = false;
32903
- newResult.Type = 'delete';
32904
- newResult.Message = error && error.message ? error.message : error;
32905
- newResult.Errors = error.Errors || [];
32906
- newResult.OriginalValues = _this0.Fields.map(function (f) {
32907
- return {
32908
- FieldName: f.CodeName,
32909
- Value: f.OldValue
32910
- };
32911
- });
32912
- newResult.EndedAt = new Date();
32913
- _this0.RegisterResultHistoryEntry(newResult);
32974
+ // Transaction group failed / rolled back. RECORD the failure instead of
32975
+ // letting this async handler throw — exactly like the Save() subscriber above.
32976
+ // `error` may be UNDEFINED: the GraphQL-client transaction group signals
32977
+ // failure by RETURNING failed result items (no thrown error), so the old
32978
+ // `error.Errors` was a TypeError, which rxjs re-throws on a fresh tick as an
32979
+ // uncaughtException that exits the host process. Treat `error` as
32980
+ // possibly-absent, and guard on currentResultCount so a provider that already
32981
+ // recorded the failure (real providers do, before the notification fires)
32982
+ // isn't double-recorded.
32983
+ if (currentResultCount === _this0.ResultHistory.length) {
32984
+ var _error$message;
32985
+ newResult.Success = false;
32986
+ newResult.Type = 'delete';
32987
+ newResult.Message = (_error$message = error === null || error === void 0 ? void 0 : error.message) !== null && _error$message !== void 0 ? _error$message : error != null ? String(error) : 'Transaction group failed';
32988
+ newResult.Errors = (error === null || error === void 0 ? void 0 : error.Errors) || [];
32989
+ newResult.OriginalValues = _this0.Fields.map(function (f) {
32990
+ return {
32991
+ FieldName: f.CodeName,
32992
+ Value: f.OldValue
32993
+ };
32994
+ });
32995
+ newResult.EndedAt = new Date();
32996
+ _this0.RegisterResultHistoryEntry(newResult);
32997
+ }
32914
32998
  }
32915
32999
  });
32916
33000
  }
@@ -42102,7 +42186,13 @@ var ProviderBase = /*#__PURE__*/function () {
42102
42186
  this._localMetadata = new AllMetadata();
42103
42187
  this._entityMapByName = new Map();
42104
42188
  this._entityMapByID = new Map();
42105
- this._entityRecordNameCache = new Map();
42189
+ // Bounded LRU (unlike its siblings above, this cache holds one entry per distinct
42190
+ // *record* touched via Load()/Save()/LoadFromData() — not per entity definition — so
42191
+ // it can't be reset on metadata refresh; it needs its own eviction policy.
42192
+ this._entityRecordNameCache = new dist/* MJLruCache */.HE({
42193
+ maxSize: 10000,
42194
+ ttlMs: 60 * 60 * 1000
42195
+ });
42106
42196
  this._refresh = false;
42107
42197
  this._lastRefreshCheckAt = 0;
42108
42198
  /**
@@ -42268,7 +42358,7 @@ var ProviderBase = /*#__PURE__*/function () {
42268
42358
  return providerBase_regenerator().w(function (_context) {
42269
42359
  while (1) switch (_context.n) {
42270
42360
  case 0:
42271
- cachedEntry = this._entityRecordNameCache.get(this.getCacheKey(entityName, compositeKey));
42361
+ cachedEntry = this._entityRecordNameCache.Get(this.getCacheKey(entityName, compositeKey));
42272
42362
  if (!(!cachedEntry && loadIfNeeded)) {
42273
42363
  _context.n = 2;
42274
42364
  break;
@@ -42298,7 +42388,7 @@ var ProviderBase = /*#__PURE__*/function () {
42298
42388
  }, {
42299
42389
  key: "SetCachedRecordName",
42300
42390
  value: function SetCachedRecordName(entityName, compositeKey, recordName) {
42301
- this._entityRecordNameCache.set(this.getCacheKey(entityName, compositeKey), recordName);
42391
+ this._entityRecordNameCache.Set(this.getCacheKey(entityName, compositeKey), recordName);
42302
42392
  }
42303
42393
  /**
42304
42394
  * Gets the display name for a single entity record with caching.
@@ -42327,7 +42417,7 @@ var ProviderBase = /*#__PURE__*/function () {
42327
42417
  _context2.n = 1;
42328
42418
  break;
42329
42419
  }
42330
- cached = this._entityRecordNameCache.get(cacheKey);
42420
+ cached = this._entityRecordNameCache.Get(cacheKey);
42331
42421
  if (!(cached !== undefined)) {
42332
42422
  _context2.n = 1;
42333
42423
  break;
@@ -42339,7 +42429,7 @@ var ProviderBase = /*#__PURE__*/function () {
42339
42429
  case 2:
42340
42430
  name = _context2.v;
42341
42431
  if (name) {
42342
- this._entityRecordNameCache.set(cacheKey, name);
42432
+ this._entityRecordNameCache.Set(cacheKey, name);
42343
42433
  }
42344
42434
  return _context2.a(2, name);
42345
42435
  }
@@ -42397,7 +42487,7 @@ var ProviderBase = /*#__PURE__*/function () {
42397
42487
  for (i = 0; i < info.length; i++) {
42398
42488
  item = info[i];
42399
42489
  cacheKey = this.getCacheKey(item.EntityName, item.CompositeKey);
42400
- cached = this._entityRecordNameCache.get(cacheKey);
42490
+ cached = this._entityRecordNameCache.Get(cacheKey);
42401
42491
  if (cached !== undefined) {
42402
42492
  // Cache hit
42403
42493
  results[i] = {
@@ -42430,7 +42520,7 @@ var ProviderBase = /*#__PURE__*/function () {
42430
42520
  // Cache successful results
42431
42521
  if (result.Success && result.RecordName) {
42432
42522
  _cacheKey = this.getCacheKey(result.EntityName, result.CompositeKey);
42433
- this._entityRecordNameCache.set(_cacheKey, result.RecordName);
42523
+ this._entityRecordNameCache.Set(_cacheKey, result.RecordName);
42434
42524
  }
42435
42525
  }
42436
42526
  case 2:
@@ -42447,7 +42537,7 @@ var ProviderBase = /*#__PURE__*/function () {
42447
42537
  _result = _step5.value;
42448
42538
  if (_result.Success && _result.RecordName) {
42449
42539
  _cacheKey2 = this.getCacheKey(_result.EntityName, _result.CompositeKey);
42450
- this._entityRecordNameCache.set(_cacheKey2, _result.RecordName);
42540
+ this._entityRecordNameCache.Set(_cacheKey2, _result.RecordName);
42451
42541
  }
42452
42542
  }
42453
42543
  } catch (err) {
@@ -43151,19 +43241,10 @@ var ProviderBase = /*#__PURE__*/function () {
43151
43241
  var _iterator0 = providerBase_createForOfIteratorHelper(preferredNames),
43152
43242
  _step0;
43153
43243
  try {
43154
- var _loop = function _loop() {
43155
- var name = _step0.value;
43156
- var field = entity.Fields.find(function (f) {
43157
- return f.Name === name;
43158
- });
43159
- if (field) return {
43160
- v: field.Name
43161
- };
43162
- },
43163
- _ret;
43164
43244
  for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
43165
- _ret = _loop();
43166
- if (_ret) return _ret.v;
43245
+ var name = _step0.value;
43246
+ var field = entity.FieldByName(name);
43247
+ if (field) return field.Name;
43167
43248
  }
43168
43249
  // Fallback to first text field
43169
43250
  } catch (err) {
@@ -46995,7 +47076,7 @@ var ProviderBase = /*#__PURE__*/function () {
46995
47076
  key: "GetEntityDependencies",
46996
47077
  value: (function () {
46997
47078
  var _GetEntityDependencies = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee44(entityName) {
46998
- var eName, result, _iterator26, _step26, _loop2, _t16, _t17;
47079
+ var eName, result, _iterator26, _step26, _loop, _t16, _t17;
46999
47080
  return providerBase_regenerator().w(function (_context45) {
47000
47081
  while (1) switch (_context45.p = _context45.n) {
47001
47082
  case 0:
@@ -47004,7 +47085,7 @@ var ProviderBase = /*#__PURE__*/function () {
47004
47085
  result = [];
47005
47086
  _iterator26 = providerBase_createForOfIteratorHelper(this.Entities);
47006
47087
  _context45.p = 1;
47007
- _loop2 = /*#__PURE__*/providerBase_regenerator().m(function _loop2() {
47088
+ _loop = /*#__PURE__*/providerBase_regenerator().m(function _loop() {
47008
47089
  var re, relatedFields;
47009
47090
  return providerBase_regenerator().w(function (_context44) {
47010
47091
  while (1) switch (_context44.n) {
@@ -47024,7 +47105,7 @@ var ProviderBase = /*#__PURE__*/function () {
47024
47105
  case 1:
47025
47106
  return _context44.a(2);
47026
47107
  }
47027
- }, _loop2);
47108
+ }, _loop);
47028
47109
  });
47029
47110
  _iterator26.s();
47030
47111
  case 2:
@@ -47032,7 +47113,7 @@ var ProviderBase = /*#__PURE__*/function () {
47032
47113
  _context45.n = 4;
47033
47114
  break;
47034
47115
  }
47035
- return _context45.d(providerBase_regeneratorValues(_loop2()), 3);
47116
+ return _context45.d(providerBase_regeneratorValues(_loop()), 3);
47036
47117
  case 3:
47037
47118
  _context45.n = 2;
47038
47119
  break;
@@ -47075,7 +47156,7 @@ var ProviderBase = /*#__PURE__*/function () {
47075
47156
  key: "GetAndCacheDatasetByName",
47076
47157
  value: (function () {
47077
47158
  var _GetAndCacheDatasetByName = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee45(datasetName, itemFilters, contextUser, providerToUse) {
47078
- var ls, key, dateKey, cachedDataset, cachedDateStr, both, rawData, rawDate, localDate, status, allCountsMatch, _iterator27, _step27, _loop3, dataset, _t18;
47159
+ var ls, key, dateKey, cachedDataset, cachedDateStr, both, rawData, rawDate, localDate, status, allCountsMatch, _iterator27, _step27, _loop2, dataset, _t18;
47079
47160
  return providerBase_regenerator().w(function (_context47) {
47080
47161
  while (1) switch (_context47.p = _context47.n) {
47081
47162
  case 0:
@@ -47122,7 +47203,7 @@ var ProviderBase = /*#__PURE__*/function () {
47122
47203
  allCountsMatch = true;
47123
47204
  _iterator27 = providerBase_createForOfIteratorHelper(status.EntityUpdateDates);
47124
47205
  _context47.p = 4;
47125
- _loop3 = /*#__PURE__*/providerBase_regenerator().m(function _loop3() {
47206
+ _loop2 = /*#__PURE__*/providerBase_regenerator().m(function _loop2() {
47126
47207
  var eu, localEntity;
47127
47208
  return providerBase_regenerator().w(function (_context46) {
47128
47209
  while (1) switch (_context46.n) {
@@ -47140,7 +47221,7 @@ var ProviderBase = /*#__PURE__*/function () {
47140
47221
  case 1:
47141
47222
  return _context46.a(2);
47142
47223
  }
47143
- }, _loop3);
47224
+ }, _loop2);
47144
47225
  });
47145
47226
  _iterator27.s();
47146
47227
  case 5:
@@ -47148,7 +47229,7 @@ var ProviderBase = /*#__PURE__*/function () {
47148
47229
  _context47.n = 8;
47149
47230
  break;
47150
47231
  }
47151
- return _context47.d(providerBase_regeneratorValues(_loop3()), 6);
47232
+ return _context47.d(providerBase_regeneratorValues(_loop2()), 6);
47152
47233
  case 6:
47153
47234
  if (!_context47.v) {
47154
47235
  _context47.n = 7;
@@ -47244,7 +47325,7 @@ var ProviderBase = /*#__PURE__*/function () {
47244
47325
  key: "IsDatasetCacheUpToDate",
47245
47326
  value: (function () {
47246
47327
  var _IsDatasetCacheUpToDate = providerBase_asyncToGenerator(/*#__PURE__*/providerBase_regenerator().m(function _callee47(datasetName, itemFilters) {
47247
- var localDate, status, serverTimestamp, localDataset, _iterator28, _step28, _loop4, _ret2, _t19;
47328
+ var localDate, status, serverTimestamp, localDataset, _iterator28, _step28, _loop3, _ret, _t19;
47248
47329
  return providerBase_regenerator().w(function (_context50) {
47249
47330
  while (1) switch (_context50.p = _context50.n) {
47250
47331
  case 0:
@@ -47275,7 +47356,7 @@ var ProviderBase = /*#__PURE__*/function () {
47275
47356
  localDataset = _context50.v;
47276
47357
  _iterator28 = providerBase_createForOfIteratorHelper(status.EntityUpdateDates);
47277
47358
  _context50.p = 4;
47278
- _loop4 = /*#__PURE__*/providerBase_regenerator().m(function _loop4() {
47359
+ _loop3 = /*#__PURE__*/providerBase_regenerator().m(function _loop3() {
47279
47360
  var eu, localEntity;
47280
47361
  return providerBase_regenerator().w(function (_context49) {
47281
47362
  while (1) switch (_context49.n) {
@@ -47294,7 +47375,7 @@ var ProviderBase = /*#__PURE__*/function () {
47294
47375
  case 1:
47295
47376
  return _context49.a(2);
47296
47377
  }
47297
- }, _loop4);
47378
+ }, _loop3);
47298
47379
  });
47299
47380
  _iterator28.s();
47300
47381
  case 5:
@@ -47302,14 +47383,14 @@ var ProviderBase = /*#__PURE__*/function () {
47302
47383
  _context50.n = 8;
47303
47384
  break;
47304
47385
  }
47305
- return _context50.d(providerBase_regeneratorValues(_loop4()), 6);
47386
+ return _context50.d(providerBase_regeneratorValues(_loop3()), 6);
47306
47387
  case 6:
47307
- _ret2 = _context50.v;
47308
- if (!_ret2) {
47388
+ _ret = _context50.v;
47389
+ if (!_ret) {
47309
47390
  _context50.n = 7;
47310
47391
  break;
47311
47392
  }
47312
- return _context50.a(2, _ret2.v);
47393
+ return _context50.a(2, _ret.v);
47313
47394
  case 7:
47314
47395
  _context50.n = 5;
47315
47396
  break;
@@ -47643,7 +47724,7 @@ var ProviderBase = /*#__PURE__*/function () {
47643
47724
  var mdLocal = this.LatestLocalMetadata;
47644
47725
  var mdRemote = this.LatestRemoteMetadata;
47645
47726
  if (!mdLocal || !mdRemote || !mdLocal.length || !mdRemote.length || mdLocal.length === 0 || mdRemote.length === 0) return true;
47646
- var _loop5 = function _loop5(i) {
47727
+ var _loop4 = function _loop4(i) {
47647
47728
  var bProcess = true;
47648
47729
  if (type && type.length > 0) bProcess = mdRemote[i].Type.toLowerCase().trim() === type.trim().toLowerCase();
47649
47730
  if (bProcess) {
@@ -47683,10 +47764,10 @@ var ProviderBase = /*#__PURE__*/function () {
47683
47764
  }
47684
47765
  }
47685
47766
  },
47686
- _ret3;
47767
+ _ret2;
47687
47768
  for (var i = 0; i < mdRemote.length; ++i) {
47688
- _ret3 = _loop5(i);
47689
- if (_ret3) return _ret3.v;
47769
+ _ret2 = _loop4(i);
47770
+ if (_ret2) return _ret2.v;
47690
47771
  }
47691
47772
  // if we get here, we're not obsolete!!
47692
47773
  return false;
@@ -111346,8 +111427,32 @@ var UserInfoEngine = /*#__PURE__*/function (_BaseEngine) {
111346
111427
  return setting.Save();
111347
111428
  case 5:
111348
111429
  saved = _context2.v;
111430
+ if (!(!saved && setting.IsSaved)) {
111431
+ _context2.n = 8;
111432
+ break;
111433
+ }
111434
+ // The cached entity's underlying row no longer exists (deleted from another
111435
+ // session/device, or out-of-band) — the UPDATE matched nothing. Recover by
111436
+ // recreating the setting instead of failing the write.
111437
+ console.warn("UserInfoEngine.SetSetting: update for '".concat(settingKey, "' matched no row \u2014 recreating"));
111438
+ this._UserSettings = this._UserSettings.filter(function (s) {
111439
+ return !(0,MJGlobal_dist/* UUIDsEqual */.jd)(s.ID, setting.ID);
111440
+ });
111441
+ _context2.n = 6;
111442
+ return md.GetEntityObject('MJ: User Settings', contextUser);
111443
+ case 6:
111444
+ setting = _context2.v;
111445
+ setting.NewRecord();
111446
+ setting.UserID = userId;
111447
+ setting.Setting = settingKey;
111448
+ setting.Value = value;
111449
+ _context2.n = 7;
111450
+ return setting.Save();
111451
+ case 7:
111452
+ saved = _context2.v;
111453
+ case 8:
111349
111454
  if (!saved) {
111350
- _context2.n = 6;
111455
+ _context2.n = 9;
111351
111456
  break;
111352
111457
  }
111353
111458
  // If it was a new record, add to cache
@@ -111357,21 +111462,21 @@ var UserInfoEngine = /*#__PURE__*/function (_BaseEngine) {
111357
111462
  this._UserSettings.push(setting);
111358
111463
  }
111359
111464
  return _context2.a(2, true);
111360
- case 6:
111361
- console.error('UserInfoEngine.SetSetting: Failed to save:', (_setting$LatestResult = setting.LatestResult) === null || _setting$LatestResult === void 0 ? void 0 : _setting$LatestResult.Message);
111465
+ case 9:
111466
+ console.error('UserInfoEngine.SetSetting: Failed to save:', (_setting$LatestResult = setting.LatestResult) === null || _setting$LatestResult === void 0 ? void 0 : _setting$LatestResult.CompleteMessage);
111362
111467
  return _context2.a(2, false);
111363
- case 7:
111364
- _context2.n = 9;
111468
+ case 10:
111469
+ _context2.n = 12;
111365
111470
  break;
111366
- case 8:
111367
- _context2.p = 8;
111471
+ case 11:
111472
+ _context2.p = 11;
111368
111473
  _t = _context2.v;
111369
111474
  console.error('UserInfoEngine.SetSetting: Error:', _t instanceof Error ? _t.message : String(_t));
111370
111475
  return _context2.a(2, false);
111371
- case 9:
111476
+ case 12:
111372
111477
  return _context2.a(2);
111373
111478
  }
111374
- }, _callee2, this, [[1, 8]]);
111479
+ }, _callee2, this, [[1, 11]]);
111375
111480
  }));
111376
111481
  function SetSetting(_x4, _x5, _x6) {
111377
111482
  return _SetSetting.apply(this, arguments);
@@ -122135,6 +122240,7 @@ __webpack_require__.d(__webpack_exports__, {
122135
122240
  Ip: () => (/* reexport */ util_GetGlobalObjectStore),
122136
122241
  UK: () => (/* reexport */ MJEventType),
122137
122242
  rt: () => (/* reexport */ MJGlobal),
122243
+ HE: () => (/* reexport */ MJLruCache),
122138
122244
  Xw: () => (/* reexport */ NormalizeUUID),
122139
122245
  Y5: () => (/* reexport */ RegisterClass),
122140
122246
  rH: () => (/* reexport */ SQLExpressionValidator),
@@ -122147,7 +122253,7 @@ __webpack_require__.d(__webpack_exports__, {
122147
122253
  gZ: () => (/* reexport */ uuidv4)
122148
122254
  });
122149
122255
 
122150
- // UNUSED EXPORTS: ALLOWED_SQL_FUNCTIONS, BuildCronExpression, CRON_DAY_NAMES, ClassFactory, ClassRegistration, CleanJSON, CleanJavaScript, ConvertMarkdownStringToHtmlList, CopyScalarsAndArrays, DANGEROUS_SQL_KEYWORDS, DEFAULT_RICH_TEXT_SCAN_LENGTH, DeepDiffer, DefaultCronSchedule, DeprecationWarningManager, DescribeCronExpression, DiffChangeType, ENCRYPTED_SENTINEL, EscapeHTML, FULL_QUERY_ALLOWED_KEYWORDS, FieldRulesEvaluator, FieldTransformEngine, FormatTimeOfDay, GetClassInheritance, GetClassName, GetFieldTransform, GetFullClassHierarchy, GetRootClass, GetSuperclass, HighlightSearchMatches, InvokeManualResize, IsClassConstructor, IsDescendantClassOf, IsEncryptedSentinel, IsOnlyTimezoneShift, IsPlausibleCronExpression, IsRootClass, IsSubclassOf, IsValidUUID, IsValueEncrypted, JSONValidator, KeyedSerialTaskQueue, MJEvent, MJGlobalProperty, MJLruCache, ObjectCache, ObjectCacheEntry, Ordinal, ParseCronExpression, ParseJSONRecursive, RegisterClassEx, RegisterFieldTransform, SafeExpressionEvaluator, ShutdownRegistry, ToJSONSafe, adjustCasing, compareStringsByLine, convertCamelCaseToHaveSpaces, createDisplayName, defaultExpressionEvaluator, detectRichTextFormat, ensureRegExp, ensureRegExps, generatePluralName, getIrregularPlural, getValueAtPath, matchesAllPatterns, matchesAnyPattern, parsePattern, parsePatterns, replaceAllSpaces, resolveMappingRef, resolveValueMapping, stripTrailingChars, stripWhitespace
122256
+ // UNUSED EXPORTS: ALLOWED_SQL_FUNCTIONS, BuildCronExpression, CRON_DAY_NAMES, ClassFactory, ClassRegistration, CleanJSON, CleanJavaScript, ConvertMarkdownStringToHtmlList, CopyScalarsAndArrays, DANGEROUS_SQL_KEYWORDS, DEFAULT_RICH_TEXT_SCAN_LENGTH, DeepDiffer, DefaultCronSchedule, DeprecationWarningManager, DescribeCronExpression, DiffChangeType, ENCRYPTED_SENTINEL, EscapeHTML, FULL_QUERY_ALLOWED_KEYWORDS, FieldRulesEvaluator, FieldTransformEngine, FormatTimeOfDay, GetClassInheritance, GetClassName, GetFieldTransform, GetFullClassHierarchy, GetRootClass, GetSuperclass, HighlightSearchMatches, InvokeManualResize, IsClassConstructor, IsDescendantClassOf, IsEncryptedSentinel, IsOnlyTimezoneShift, IsPlausibleCronExpression, IsRootClass, IsSubclassOf, IsValidUUID, IsValueEncrypted, JSONValidator, KeyedSerialTaskQueue, MJEvent, MJGlobalProperty, ObjectCache, ObjectCacheEntry, Ordinal, ParseCronExpression, ParseJSONRecursive, RegisterClassEx, RegisterFieldTransform, SafeExpressionEvaluator, ShutdownRegistry, ToJSONSafe, adjustCasing, compareStringsByLine, convertCamelCaseToHaveSpaces, createDisplayName, defaultExpressionEvaluator, detectRichTextFormat, ensureRegExp, ensureRegExps, generatePluralName, getIrregularPlural, getValueAtPath, matchesAllPatterns, matchesAnyPattern, parsePattern, parsePatterns, replaceAllSpaces, resolveMappingRef, resolveValueMapping, stripTrailingChars, stripWhitespace
122151
122257
 
122152
122258
  ;// ../../MJGlobal/dist/interface.js
122153
122259
  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); }
@@ -123514,6 +123620,217 @@ function recursiveReplaceString(str, options, depth, path) {
123514
123620
  // If we get here, return the original string
123515
123621
  return str;
123516
123622
  }
123623
+ ;// ../../MJGlobal/dist/MJLruCache.js
123624
+ function MJLruCache_typeof(o) { "@babel/helpers - typeof"; return MJLruCache_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; }, MJLruCache_typeof(o); }
123625
+ function MJLruCache_slicedToArray(r, e) { return MJLruCache_arrayWithHoles(r) || MJLruCache_iterableToArrayLimit(r, e) || MJLruCache_unsupportedIterableToArray(r, e) || MJLruCache_nonIterableRest(); }
123626
+ function MJLruCache_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."); }
123627
+ function MJLruCache_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; } }
123628
+ function MJLruCache_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
123629
+ function MJLruCache_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = MJLruCache_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; } } }; }
123630
+ function MJLruCache_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return MJLruCache_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) ? MJLruCache_arrayLikeToArray(r, a) : void 0; } }
123631
+ function MJLruCache_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; }
123632
+ function MJLruCache_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
123633
+ function MJLruCache_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, MJLruCache_toPropertyKey(o.key), o); } }
123634
+ function MJLruCache_createClass(e, r, t) { return r && MJLruCache_defineProperties(e.prototype, r), t && MJLruCache_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
123635
+ function MJLruCache_toPropertyKey(t) { var i = MJLruCache_toPrimitive(t, "string"); return "symbol" == MJLruCache_typeof(i) ? i : i + ""; }
123636
+ function MJLruCache_toPrimitive(t, r) { if ("object" != MJLruCache_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != MJLruCache_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
123637
+ /**
123638
+ * Bounded LRU cache with optional TTL — designed to replace the unbounded `Map`
123639
+ * fields that proliferate across MJ singletons (per-credential SDK client caches,
123640
+ * issuer caches, script caches, etc.). Built on `Map`'s preserved insertion order:
123641
+ * touching an entry deletes-and-reinserts to move it to the end, so eviction is
123642
+ * trivially the first key.
123643
+ *
123644
+ * - `Get` returns `undefined` for missing or expired entries and lazily evicts
123645
+ * expired ones (firing `onEvict` once).
123646
+ * - `Set` updates an existing entry in place (resetting recency + TTL) or evicts
123647
+ * the least-recently-used when `size === maxSize`.
123648
+ * - `onEvict` is called for **every** removal — overflow, expiry, explicit delete,
123649
+ * or `Clear()` — so callers can release SDK clients, sockets, etc.
123650
+ *
123651
+ * Thread-safety: same single-threaded JS guarantees as `Map`. Not safe across
123652
+ * worker threads — pin one cache per worker.
123653
+ *
123654
+ * NOTE: this is intentionally minimal. We don't expose `keys()`/`values()`
123655
+ * iterators because LRU semantics interact poorly with iteration order — callers
123656
+ * who need those should use `Map` directly.
123657
+ */
123658
+ var MJLruCache = /*#__PURE__*/function () {
123659
+ function MJLruCache() {
123660
+ var _options$maxSize;
123661
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
123662
+ MJLruCache_classCallCheck(this, MJLruCache);
123663
+ this._map = new Map();
123664
+ var maxSize = (_options$maxSize = options.maxSize) !== null && _options$maxSize !== void 0 ? _options$maxSize : 1000;
123665
+ if (!Number.isFinite(maxSize) || maxSize < 1) {
123666
+ throw new Error("MJLruCache: maxSize must be a positive integer (got ".concat(maxSize, ")"));
123667
+ }
123668
+ this._maxSize = Math.floor(maxSize);
123669
+ this._ttlMs = options.ttlMs && options.ttlMs > 0 ? options.ttlMs : 0;
123670
+ this._onEvict = options.onEvict;
123671
+ }
123672
+ /**
123673
+ * Configured maximum entry count. Read-only after construction.
123674
+ */
123675
+ return MJLruCache_createClass(MJLruCache, [{
123676
+ key: "MaxSize",
123677
+ get: function get() {
123678
+ return this._maxSize;
123679
+ }
123680
+ /**
123681
+ * Current entry count (including any expired entries that haven't been
123682
+ * lazily evicted yet — call `Prune()` to force eviction first).
123683
+ */
123684
+ }, {
123685
+ key: "Size",
123686
+ get: function get() {
123687
+ return this._map.size;
123688
+ }
123689
+ /**
123690
+ * Look up a value, refreshing its recency. Returns `undefined` if the key is
123691
+ * absent or the entry has expired. Expired entries are evicted lazily on the
123692
+ * miss (firing `onEvict` with reason `'ttl'`).
123693
+ */
123694
+ }, {
123695
+ key: "Get",
123696
+ value: function Get(key) {
123697
+ var entry = this._map.get(key);
123698
+ if (!entry) {
123699
+ return undefined;
123700
+ }
123701
+ if (entry.expiresAt <= Date.now()) {
123702
+ var _this$_onEvict;
123703
+ this._map.delete(key);
123704
+ (_this$_onEvict = this._onEvict) === null || _this$_onEvict === void 0 || _this$_onEvict.call(this, key, entry.value, 'ttl');
123705
+ return undefined;
123706
+ }
123707
+ // Refresh recency — Map preserves insertion order, so delete + re-insert
123708
+ // moves to the back.
123709
+ this._map.delete(key);
123710
+ this._map.set(key, entry);
123711
+ return entry.value;
123712
+ }
123713
+ /**
123714
+ * Whether the key is present and unexpired. Does **not** refresh recency.
123715
+ */
123716
+ }, {
123717
+ key: "Has",
123718
+ value: function Has(key) {
123719
+ var entry = this._map.get(key);
123720
+ if (!entry) return false;
123721
+ if (entry.expiresAt <= Date.now()) {
123722
+ var _this$_onEvict2;
123723
+ this._map.delete(key);
123724
+ (_this$_onEvict2 = this._onEvict) === null || _this$_onEvict2 === void 0 || _this$_onEvict2.call(this, key, entry.value, 'ttl');
123725
+ return false;
123726
+ }
123727
+ return true;
123728
+ }
123729
+ /**
123730
+ * Insert or replace an entry. If replacing, the old value is evicted with
123731
+ * reason `'delete'` so SDK-client style resources can be cleaned up. If
123732
+ * inserting and the cache is full, the LRU entry is evicted with reason
123733
+ * `'lru'`.
123734
+ */
123735
+ }, {
123736
+ key: "Set",
123737
+ value: function Set(key, value) {
123738
+ var expiresAt = this._ttlMs > 0 ? Date.now() + this._ttlMs : Number.POSITIVE_INFINITY;
123739
+ var existing = this._map.get(key);
123740
+ if (existing) {
123741
+ var _this$_onEvict3;
123742
+ this._map.delete(key);
123743
+ (_this$_onEvict3 = this._onEvict) === null || _this$_onEvict3 === void 0 || _this$_onEvict3.call(this, key, existing.value, 'delete');
123744
+ } else if (this._map.size >= this._maxSize) {
123745
+ // Evict the LRU (first) entry to make room.
123746
+ var oldestKey = this._map.keys().next().value;
123747
+ if (oldestKey !== undefined) {
123748
+ var _this$_onEvict4;
123749
+ var old = this._map.get(oldestKey);
123750
+ this._map.delete(oldestKey);
123751
+ (_this$_onEvict4 = this._onEvict) === null || _this$_onEvict4 === void 0 || _this$_onEvict4.call(this, oldestKey, old.value, 'lru');
123752
+ }
123753
+ }
123754
+ this._map.set(key, {
123755
+ value: value,
123756
+ expiresAt: expiresAt
123757
+ });
123758
+ }
123759
+ /**
123760
+ * Remove a key. Returns true if removed. Fires `onEvict` with reason
123761
+ * `'delete'`.
123762
+ */
123763
+ }, {
123764
+ key: "Delete",
123765
+ value: function Delete(key) {
123766
+ var _this$_onEvict5;
123767
+ var entry = this._map.get(key);
123768
+ if (!entry) return false;
123769
+ this._map.delete(key);
123770
+ (_this$_onEvict5 = this._onEvict) === null || _this$_onEvict5 === void 0 || _this$_onEvict5.call(this, key, entry.value, 'delete');
123771
+ return true;
123772
+ }
123773
+ /**
123774
+ * Remove every entry, firing `onEvict` for each with reason `'clear'`.
123775
+ */
123776
+ }, {
123777
+ key: "Clear",
123778
+ value: function Clear() {
123779
+ if (!this._onEvict) {
123780
+ this._map.clear();
123781
+ return;
123782
+ }
123783
+ var _iterator = MJLruCache_createForOfIteratorHelper(this._map),
123784
+ _step;
123785
+ try {
123786
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
123787
+ var _step$value = MJLruCache_slicedToArray(_step.value, 2),
123788
+ key = _step$value[0],
123789
+ entry = _step$value[1];
123790
+ this._onEvict(key, entry.value, 'clear');
123791
+ }
123792
+ } catch (err) {
123793
+ _iterator.e(err);
123794
+ } finally {
123795
+ _iterator.f();
123796
+ }
123797
+ this._map.clear();
123798
+ }
123799
+ /**
123800
+ * Eagerly evict all expired entries. Useful from a periodic timer when
123801
+ * lazy eviction (only on `Get`/`Has`) isn't sufficient — for example, when
123802
+ * entries hold expensive resources you want released even if no one reads
123803
+ * them again.
123804
+ */
123805
+ }, {
123806
+ key: "Prune",
123807
+ value: function Prune() {
123808
+ if (this._ttlMs <= 0) return 0;
123809
+ var now = Date.now();
123810
+ var count = 0;
123811
+ var _iterator2 = MJLruCache_createForOfIteratorHelper(this._map),
123812
+ _step2;
123813
+ try {
123814
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
123815
+ var _step2$value = MJLruCache_slicedToArray(_step2.value, 2),
123816
+ key = _step2$value[0],
123817
+ entry = _step2$value[1];
123818
+ if (entry.expiresAt <= now) {
123819
+ var _this$_onEvict6;
123820
+ this._map.delete(key);
123821
+ (_this$_onEvict6 = this._onEvict) === null || _this$_onEvict6 === void 0 || _this$_onEvict6.call(this, key, entry.value, 'ttl');
123822
+ count++;
123823
+ }
123824
+ }
123825
+ } catch (err) {
123826
+ _iterator2.e(err);
123827
+ } finally {
123828
+ _iterator2.f();
123829
+ }
123830
+ return count;
123831
+ }
123832
+ }]);
123833
+ }();
123517
123834
  ;// ../../MJGlobal/dist/BaseSingleton.js
123518
123835
  function BaseSingleton_typeof(o) { "@babel/helpers - typeof"; return BaseSingleton_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; }, BaseSingleton_typeof(o); }
123519
123836
  var _BaseSingleton;
@@ -124725,217 +125042,6 @@ var JSONValidator = /*#__PURE__*/(/* unused pure expression or super */ null &&
124725
125042
  }
124726
125043
  }]);
124727
125044
  }()));
124728
- ;// ../../MJGlobal/dist/MJLruCache.js
124729
- function MJLruCache_typeof(o) { "@babel/helpers - typeof"; return MJLruCache_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; }, MJLruCache_typeof(o); }
124730
- function MJLruCache_slicedToArray(r, e) { return MJLruCache_arrayWithHoles(r) || MJLruCache_iterableToArrayLimit(r, e) || MJLruCache_unsupportedIterableToArray(r, e) || MJLruCache_nonIterableRest(); }
124731
- function MJLruCache_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."); }
124732
- function MJLruCache_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; } }
124733
- function MJLruCache_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
124734
- function MJLruCache_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = MJLruCache_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; } } }; }
124735
- function MJLruCache_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return MJLruCache_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) ? MJLruCache_arrayLikeToArray(r, a) : void 0; } }
124736
- function MJLruCache_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; }
124737
- function MJLruCache_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
124738
- function MJLruCache_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, MJLruCache_toPropertyKey(o.key), o); } }
124739
- function MJLruCache_createClass(e, r, t) { return r && MJLruCache_defineProperties(e.prototype, r), t && MJLruCache_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
124740
- function MJLruCache_toPropertyKey(t) { var i = MJLruCache_toPrimitive(t, "string"); return "symbol" == MJLruCache_typeof(i) ? i : i + ""; }
124741
- function MJLruCache_toPrimitive(t, r) { if ("object" != MJLruCache_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != MJLruCache_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
124742
- /**
124743
- * Bounded LRU cache with optional TTL — designed to replace the unbounded `Map`
124744
- * fields that proliferate across MJ singletons (per-credential SDK client caches,
124745
- * issuer caches, script caches, etc.). Built on `Map`'s preserved insertion order:
124746
- * touching an entry deletes-and-reinserts to move it to the end, so eviction is
124747
- * trivially the first key.
124748
- *
124749
- * - `Get` returns `undefined` for missing or expired entries and lazily evicts
124750
- * expired ones (firing `onEvict` once).
124751
- * - `Set` updates an existing entry in place (resetting recency + TTL) or evicts
124752
- * the least-recently-used when `size === maxSize`.
124753
- * - `onEvict` is called for **every** removal — overflow, expiry, explicit delete,
124754
- * or `Clear()` — so callers can release SDK clients, sockets, etc.
124755
- *
124756
- * Thread-safety: same single-threaded JS guarantees as `Map`. Not safe across
124757
- * worker threads — pin one cache per worker.
124758
- *
124759
- * NOTE: this is intentionally minimal. We don't expose `keys()`/`values()`
124760
- * iterators because LRU semantics interact poorly with iteration order — callers
124761
- * who need those should use `Map` directly.
124762
- */
124763
- var MJLruCache = /*#__PURE__*/function () {
124764
- function MJLruCache() {
124765
- var _options$maxSize;
124766
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
124767
- MJLruCache_classCallCheck(this, MJLruCache);
124768
- this._map = new Map();
124769
- var maxSize = (_options$maxSize = options.maxSize) !== null && _options$maxSize !== void 0 ? _options$maxSize : 1000;
124770
- if (!Number.isFinite(maxSize) || maxSize < 1) {
124771
- throw new Error("MJLruCache: maxSize must be a positive integer (got ".concat(maxSize, ")"));
124772
- }
124773
- this._maxSize = Math.floor(maxSize);
124774
- this._ttlMs = options.ttlMs && options.ttlMs > 0 ? options.ttlMs : 0;
124775
- this._onEvict = options.onEvict;
124776
- }
124777
- /**
124778
- * Configured maximum entry count. Read-only after construction.
124779
- */
124780
- return MJLruCache_createClass(MJLruCache, [{
124781
- key: "MaxSize",
124782
- get: function get() {
124783
- return this._maxSize;
124784
- }
124785
- /**
124786
- * Current entry count (including any expired entries that haven't been
124787
- * lazily evicted yet — call `Prune()` to force eviction first).
124788
- */
124789
- }, {
124790
- key: "Size",
124791
- get: function get() {
124792
- return this._map.size;
124793
- }
124794
- /**
124795
- * Look up a value, refreshing its recency. Returns `undefined` if the key is
124796
- * absent or the entry has expired. Expired entries are evicted lazily on the
124797
- * miss (firing `onEvict` with reason `'ttl'`).
124798
- */
124799
- }, {
124800
- key: "Get",
124801
- value: function Get(key) {
124802
- var entry = this._map.get(key);
124803
- if (!entry) {
124804
- return undefined;
124805
- }
124806
- if (entry.expiresAt <= Date.now()) {
124807
- var _this$_onEvict;
124808
- this._map.delete(key);
124809
- (_this$_onEvict = this._onEvict) === null || _this$_onEvict === void 0 || _this$_onEvict.call(this, key, entry.value, 'ttl');
124810
- return undefined;
124811
- }
124812
- // Refresh recency — Map preserves insertion order, so delete + re-insert
124813
- // moves to the back.
124814
- this._map.delete(key);
124815
- this._map.set(key, entry);
124816
- return entry.value;
124817
- }
124818
- /**
124819
- * Whether the key is present and unexpired. Does **not** refresh recency.
124820
- */
124821
- }, {
124822
- key: "Has",
124823
- value: function Has(key) {
124824
- var entry = this._map.get(key);
124825
- if (!entry) return false;
124826
- if (entry.expiresAt <= Date.now()) {
124827
- var _this$_onEvict2;
124828
- this._map.delete(key);
124829
- (_this$_onEvict2 = this._onEvict) === null || _this$_onEvict2 === void 0 || _this$_onEvict2.call(this, key, entry.value, 'ttl');
124830
- return false;
124831
- }
124832
- return true;
124833
- }
124834
- /**
124835
- * Insert or replace an entry. If replacing, the old value is evicted with
124836
- * reason `'delete'` so SDK-client style resources can be cleaned up. If
124837
- * inserting and the cache is full, the LRU entry is evicted with reason
124838
- * `'lru'`.
124839
- */
124840
- }, {
124841
- key: "Set",
124842
- value: function Set(key, value) {
124843
- var expiresAt = this._ttlMs > 0 ? Date.now() + this._ttlMs : Number.POSITIVE_INFINITY;
124844
- var existing = this._map.get(key);
124845
- if (existing) {
124846
- var _this$_onEvict3;
124847
- this._map.delete(key);
124848
- (_this$_onEvict3 = this._onEvict) === null || _this$_onEvict3 === void 0 || _this$_onEvict3.call(this, key, existing.value, 'delete');
124849
- } else if (this._map.size >= this._maxSize) {
124850
- // Evict the LRU (first) entry to make room.
124851
- var oldestKey = this._map.keys().next().value;
124852
- if (oldestKey !== undefined) {
124853
- var _this$_onEvict4;
124854
- var old = this._map.get(oldestKey);
124855
- this._map.delete(oldestKey);
124856
- (_this$_onEvict4 = this._onEvict) === null || _this$_onEvict4 === void 0 || _this$_onEvict4.call(this, oldestKey, old.value, 'lru');
124857
- }
124858
- }
124859
- this._map.set(key, {
124860
- value: value,
124861
- expiresAt: expiresAt
124862
- });
124863
- }
124864
- /**
124865
- * Remove a key. Returns true if removed. Fires `onEvict` with reason
124866
- * `'delete'`.
124867
- */
124868
- }, {
124869
- key: "Delete",
124870
- value: function Delete(key) {
124871
- var _this$_onEvict5;
124872
- var entry = this._map.get(key);
124873
- if (!entry) return false;
124874
- this._map.delete(key);
124875
- (_this$_onEvict5 = this._onEvict) === null || _this$_onEvict5 === void 0 || _this$_onEvict5.call(this, key, entry.value, 'delete');
124876
- return true;
124877
- }
124878
- /**
124879
- * Remove every entry, firing `onEvict` for each with reason `'clear'`.
124880
- */
124881
- }, {
124882
- key: "Clear",
124883
- value: function Clear() {
124884
- if (!this._onEvict) {
124885
- this._map.clear();
124886
- return;
124887
- }
124888
- var _iterator = MJLruCache_createForOfIteratorHelper(this._map),
124889
- _step;
124890
- try {
124891
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
124892
- var _step$value = MJLruCache_slicedToArray(_step.value, 2),
124893
- key = _step$value[0],
124894
- entry = _step$value[1];
124895
- this._onEvict(key, entry.value, 'clear');
124896
- }
124897
- } catch (err) {
124898
- _iterator.e(err);
124899
- } finally {
124900
- _iterator.f();
124901
- }
124902
- this._map.clear();
124903
- }
124904
- /**
124905
- * Eagerly evict all expired entries. Useful from a periodic timer when
124906
- * lazy eviction (only on `Get`/`Has`) isn't sufficient — for example, when
124907
- * entries hold expensive resources you want released even if no one reads
124908
- * them again.
124909
- */
124910
- }, {
124911
- key: "Prune",
124912
- value: function Prune() {
124913
- if (this._ttlMs <= 0) return 0;
124914
- var now = Date.now();
124915
- var count = 0;
124916
- var _iterator2 = MJLruCache_createForOfIteratorHelper(this._map),
124917
- _step2;
124918
- try {
124919
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
124920
- var _step2$value = MJLruCache_slicedToArray(_step2.value, 2),
124921
- key = _step2$value[0],
124922
- entry = _step2$value[1];
124923
- if (entry.expiresAt <= now) {
124924
- var _this$_onEvict6;
124925
- this._map.delete(key);
124926
- (_this$_onEvict6 = this._onEvict) === null || _this$_onEvict6 === void 0 || _this$_onEvict6.call(this, key, entry.value, 'ttl');
124927
- count++;
124928
- }
124929
- }
124930
- } catch (err) {
124931
- _iterator2.e(err);
124932
- } finally {
124933
- _iterator2.f();
124934
- }
124935
- return count;
124936
- }
124937
- }]);
124938
- }();
124939
125045
  ;// ../../MJGlobal/dist/SafeExpressionEvaluator.js
124940
125046
  var _SafeExpressionEvaluator;
124941
125047
  function SafeExpressionEvaluator_typeof(o) { "@babel/helpers - typeof"; return SafeExpressionEvaluator_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; }, SafeExpressionEvaluator_typeof(o); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/react-runtime",
3
- "version": "5.46.0",
3
+ "version": "5.48.0",
4
4
  "description": "Platform-agnostic React component runtime for MemberJunction. Provides core compilation, registry, and execution capabilities for React components in any JavaScript environment.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,11 +29,11 @@
29
29
  },
30
30
  "homepage": "https://github.com/MemberJunction/MJ#readme",
31
31
  "dependencies": {
32
- "@memberjunction/core": "5.46.0",
33
- "@memberjunction/global": "5.46.0",
34
- "@memberjunction/interactive-component-types": "5.46.0",
35
- "@memberjunction/core-entities": "5.46.0",
36
- "@memberjunction/graphql-dataprovider": "5.46.0",
32
+ "@memberjunction/core": "5.48.0",
33
+ "@memberjunction/global": "5.48.0",
34
+ "@memberjunction/interactive-component-types": "5.48.0",
35
+ "@memberjunction/core-entities": "5.48.0",
36
+ "@memberjunction/graphql-dataprovider": "5.48.0",
37
37
  "@babel/standalone": "^7.29.1",
38
38
  "rxjs": "^7.8.2"
39
39
  },