@memberjunction/react-runtime 6.1.4 → 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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +15 -0
- package/dist/324.runtime.umd.js +2 -2
- package/dist/runtime.umd.js +451 -198
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @memberjunction/react-runtime@6.1.
|
|
2
|
+
> @memberjunction/react-runtime@6.1.5 build /home/runner/work/MJ/MJ/packages/React/runtime
|
|
3
3
|
> npm run build:node && npm run build:umd
|
|
4
4
|
|
|
5
5
|
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
@@ -7,7 +7,7 @@ npm warn Unknown env config "npm-globalconfig". This will stop working in the ne
|
|
|
7
7
|
npm warn Unknown env config "link-workspace-packages". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
8
8
|
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
9
9
|
|
|
10
|
-
> @memberjunction/react-runtime@6.1.
|
|
10
|
+
> @memberjunction/react-runtime@6.1.5 build:node
|
|
11
11
|
> tsc && tsc-alias -f
|
|
12
12
|
|
|
13
13
|
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
@@ -15,14 +15,14 @@ npm warn Unknown env config "npm-globalconfig". This will stop working in the ne
|
|
|
15
15
|
npm warn Unknown env config "link-workspace-packages". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
16
16
|
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
|
17
17
|
|
|
18
|
-
> @memberjunction/react-runtime@6.1.
|
|
18
|
+
> @memberjunction/react-runtime@6.1.5 build:umd
|
|
19
19
|
> webpack --config webpack.umd.config.cjs
|
|
20
20
|
|
|
21
|
-
Browserslist: browsers data (caniuse-lite) is
|
|
21
|
+
Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
|
|
22
22
|
npx update-browserslist-db@latest
|
|
23
23
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
24
24
|
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/MJ/MJ/packages/MJCoreEntities/dist/generated/entities/__mj.js as it exceeds the max of 500KB.
|
|
25
|
-
asset [1m[33mruntime.umd.js[39m[22m [1m[33m10.
|
|
25
|
+
asset [1m[33mruntime.umd.js[39m[22m [1m[33m10.2 MiB[39m[22m [1m[33m[compared for emit][39m[22m [1m[33m[big][39m[22m (name: main)
|
|
26
26
|
asset [1m[32m324.runtime.umd.js[39m[22m 225 KiB [1m[33m[compared for emit][39m[22m
|
|
27
27
|
asset [1m[32m456.runtime.umd.js[39m[22m 184 KiB [1m[33m[compared for emit][39m[22m (id hint: vendors)
|
|
28
28
|
orphan modules 10.1 MiB [1m[33m[orphan][39m[22m 602 modules
|
|
@@ -32,11 +32,11 @@ cacheable modules 10.3 MiB
|
|
|
32
32
|
modules by path [1m../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/[39m[22m 30.4 KiB 16 modules
|
|
33
33
|
modules by path [1m../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/...(truncated)[39m[22m 12.7 KiB 2 modules
|
|
34
34
|
+ 7 modules
|
|
35
|
-
modules by path [1m../../MJCoreEntities/dist/[39m[22m 5.
|
|
35
|
+
modules by path [1m../../MJCoreEntities/dist/[39m[22m 5.78 MiB
|
|
36
36
|
[1m../../MJCoreEntities/dist/index.js + 69 modules[39m[22m 5.76 MiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
37
37
|
[1m../../MJCoreEntities/dist/engines/UserViewEngine.js[39m[22m 19.6 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
38
38
|
[1m./dist/index.js + 29 modules[39m[22m 445 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
39
|
-
[1m../../MJCore/dist/index.js + 106 modules[39m[22m 2.
|
|
39
|
+
[1m../../MJCore/dist/index.js + 106 modules[39m[22m 2.53 MiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
40
40
|
[1m../../MJGlobal/dist/index.js + 25 modules[39m[22m 585 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
41
41
|
[1m../../GraphQLDataProvider/dist/index.mjs[39m[22m 201 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
42
|
-
webpack 5.105.0 compiled [1m[32msuccessfully[39m[22m in
|
|
42
|
+
webpack 5.105.0 compiled [1m[32msuccessfully[39m[22m in 64997 ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @memberjunction/react-runtime
|
|
2
2
|
|
|
3
|
+
## 6.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [3910bd5]
|
|
8
|
+
- Updated dependencies [13d92ac]
|
|
9
|
+
- Updated dependencies [ad65a01]
|
|
10
|
+
- Updated dependencies [c3d7e50]
|
|
11
|
+
- Updated dependencies [ec5f382]
|
|
12
|
+
- @memberjunction/core@6.1.5
|
|
13
|
+
- @memberjunction/core-entities@6.1.5
|
|
14
|
+
- @memberjunction/graphql-dataprovider@6.1.5
|
|
15
|
+
- @memberjunction/interactive-component-types@6.1.5
|
|
16
|
+
- @memberjunction/global@6.1.5
|
|
17
|
+
|
|
3
18
|
## 6.1.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/324.runtime.umd.js
CHANGED
|
@@ -366,7 +366,7 @@ var ye=Object.defineProperty;var l=(d,e)=>ye(d,"name",{value:e,configurable:!0})
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
`,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="6.1.
|
|
369
|
+
`,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="6.1.5",$="default";class ne{static{l(this,"BrowserStorageProviderBase")}constructor(){this._storage=new Map}get SharesReferences(){return!0}get SupportsCrossProcessPersistence(){return!1}getCategoryMap(e){const t=e||$;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||$).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||$);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||$).set(e,t)}async Remove(e,t){this.getCategoryMap(t||$).delete(e)}async ClearCategory(e){const t=e||$;this._storage.delete(t)}async GetCategoryKeys(e){const t=this._storage.get(e||$);return t?Array.from(t.keys()):[]}}const Te="MJ_Metadata",Le=0;function Fe(){try{const d=F.split("."),e=parseInt(d[0],10),t=parseInt(d[1],10);if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error(`Could not parse major.minor from version "${F}"`);return e*1e3+t+Le}catch(d){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:d,message:"Failed to derive IDB version from PACKAGE_VERSION; using fallback 99999"}),99999}}l(Fe,"computeIdbVersion");const Ge=Fe(),ae=["mj:default","mj:Metadata","mj:RunViewCache","mj:RunQueryCache","mj:DatasetCache"];class oe extends ne{static{l(this,"BrowserIndexedDBStorageProvider")}constructor(){super(),this._dbReady=!1,this.dbPromise=(0,_tempfix_idb__WEBPACK_IMPORTED_MODULE_10__/* .openDB */ .P2)(Te,Ge,{upgrade:l((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 ae)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:l((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 SharesReferences(){return!1}get SupportsCrossProcessPersistence(){return!0}get IsReady(){return this._dbReady}isKnownCategory(e){const t=`mj:${e}`;return ae.includes(t)}getStoreName(e){const t=e||$;return this.isKnownCategory(t)?`mj:${t}`:"mj:default"}getStoreKey(e,t){const r=t||$;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(R=>this.getStoreKey(R,t)),o=s.transaction(n,"readonly"),m=o.objectStore(n),u=i.map(R=>m.get(R)),g=await Promise.all(u);await o.done;for(let R=0;R<a.length;R++){const S=g[R];r.set(a[R],S===void 0?null:S)}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||$,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 m of o)typeof m=="string"&&m.startsWith(n)&&await i.delete(m);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||$,s=this.getStoreName(e),i=await t.transaction(s,"readonly").objectStore(s).getAllKeys();if(this.isKnownCategory(r))return i.map(m=>String(m));const o=`[${r}]:`;return i.map(m=>String(m)).filter(m=>m.startsWith(o)).map(m=>m.slice(o.length))}catch(t){return (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogErrorEx */ .Q1A)({error:t,message:t?.message}),[]}}}class V extends Error{static{l(this,"SafeGraphQLError")}constructor(e){super(e.message),this.name=e.name,this.response={status:e.status,errors:e.errors},this.request={query:e.query},this.Code=e.code,this.VariableShape=e.variableShape,this.stack=e.stackFrames?`${e.name}: ${e.message}
|
|
370
370
|
${e.stackFrames}`:this.stack}}function ie(d){return d instanceof V?d:new V(O(d))}l(ie,"ToSafeGraphQLError");const Ue=3,Qe=25;function k(d,e=0){if(d===null)return"null";if(d===void 0)return"undefined";if(Array.isArray(d))return d.length===0?"array(empty)":`array(${d.length} \xD7 ${_e(k(d[0],e+1))})`;if(typeof d=="object"){if(e>=Ue)return"object(\u2026)";const t=Object.keys(d);if(t.length>Qe)return`object(${t.length} keys)`;const r={};for(const s of t)r[s]=k(d[s],e+1);return r}return typeof d=="string"?d.length===0?"string(empty)":"string":typeof d}l(k,"describeShape");function _e(d){return typeof d=="string"?d:"object"}l(_e,"typeOf");function Ve(d){const e=d.indexOf(`
|
|
371
371
|
at `);return e===-1?"":d.slice(e+1)}l(Ve,"stripStackHeader");function ke(d,e){const t=d?.[0]?.message;return typeof t=="string"&&t.length>0?t:`GraphQL Error (Code: ${String(e??"unknown")})`}l(ke,"deriveMessage");function Oe(d){if(Array.isArray(d))return d.map(e=>{const t=e??{};return{message:typeof t.message=="string"?t.message:void 0,path:Array.isArray(t.path)?t.path:void 0,extensions:t.extensions&&typeof t.extensions=="object"?t.extensions:void 0}})}l(Oe,"extractErrors");function O(d,e=!1){if(!d||typeof d!="object")return{name:typeof d,message:"Non-object value thrown; contents withheld",variables:"[REDACTED]"};const t=d,r=typeof t.response?.status=="number"?t.response.status:void 0,s=Oe(t.response?.errors),n=s?.[0]?.extensions?.code;return{name:typeof t.name=="string"?t.name:"Error",message:ke(s,r),status:r,errors:s,code:typeof n=="string"?n:void 0,query:typeof t.request?.query=="string"?t.request.query:void 0,stackFrames:typeof t.stack=="string"?Ve(t.stack):void 0,variables:e?t.request?.variables:"[REDACTED]",variableShape:t.request?.variables===void 0?void 0:k(t.request.variables)}}l(O,"SanitizeGraphQLError");const M=new A,qe=(0,graphql_request__WEBPACK_IMPORTED_MODULE_0__/* .gql */ .J1)`subscription RemoteOperationProgress($channelId: ID!) {
|
|
372
372
|
RemoteOperationProgress(channelId: $channelId) {
|
|
@@ -382,7 +382,7 @@ ${e.stackFrames}`:this.stack}}function ie(d){return d instanceof V?d:new V(O(d))
|
|
|
382
382
|
`,this._currentUserQuery=(0,graphql_request__WEBPACK_IMPORTED_MODULE_0__/* .gql */ .J1)`query CurrentUserAndRoles {
|
|
383
383
|
${this._innerCurrentUserQueryString}
|
|
384
384
|
CurrentUserTenantContext
|
|
385
|
-
}`,this._wsClient=null,this._wsClientCreatedAt=null,this._socketStateSubject=new rxjs__WEBPACK_IMPORTED_MODULE_6__/* .BehaviorSubject */ .t("unknown"),this._isDisposingSocketIntentionally=!1,this._pushStatusSubjects=new Map,this._activeSubscriptionCount=0,this.WS_CLIENT_MAX_AGE_MS=1800*1e3,this.SUBSCRIPTION_CLEANUP_INTERVAL_MS=300*1e3,this.SUBSCRIPTION_IDLE_TIMEOUT_MS=600*1e3,this._subscriptionCleanupTimer=null,this._isCleaningUp=!1,this._taskGraphFrameStreams=new Map,this._cacheInvalidationSubscription=null;const e=(0,_memberjunction_global__WEBPACK_IMPORTED_MODULE_2__/* .GetGlobalObjectStore */ .Ip)();if(e&&e[f._globalStoreKey])return e[f._globalStoreKey];e&&(e[f._globalStoreKey]=this)}static{this.VerboseCacheInvalidationLogging=!1}static{this._globalStoreKey="___SINGLETON__GraphQLDataProvider"}static get Instance(){const e=(0,_memberjunction_global__WEBPACK_IMPORTED_MODULE_2__/* .GetGlobalObjectStore */ .Ip)();return e?e[f._globalStoreKey]:void 0}get ConfigData(){return this._configData}get AI(){return this._aiClient||(this._aiClient=new se(this)),this._aiClient}get DatabaseConnection(){throw new Error("DatabaseConnection not implemented for the GraphQLDataProvider")}async InternalExecuteQueryFromSpec(e,t){throw new Error("ExecuteQueryFromSpec is not supported by this provider.")}get InstanceConnectionString(){return this._configData.URL}GenerateUUID(){return (0,uuid__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)()}get LocalStoragePrefix(){if(this._configData===void 0||this._configData.URL===void 0)throw new Error("GraphQLDataProvider: ConfigData is not set. Please call Config() first.");return this._configData.URL.replace(/[^a-zA-Z0-9]/g,"_")+"."}async GetStoredSessionID(){try{const e=this.LocalStorageProvider;if(e){const t=this.LocalStoragePrefix+"sessionId";return await e.GetItem(t)}return null}catch(e){return console.error("Error retrieving session ID from local storage:",e),null}}async SaveStoredSessionID(e){try{const t=this.LocalStorageProvider;if(t){const r=this.LocalStoragePrefix+"sessionId";await t.SetItem(r,e)}}catch{}}async GetPreferredUUID(e){const t=await this.GetStoredSessionID();return e||!t?this.GenerateUUID():t}async Config(e,t,r,s){try{return this._configData=e,r?(this._sessionId=await this.GetPreferredUUID(s),this._client=this.CreateNewGraphQLClient(e.URL,e.Token,this._sessionId,e.MJAPIKey,e.UserAPIKey),await this.SaveStoredSessionID(this._sessionId)):(f.Instance._configData=e,f.Instance._sessionId===void 0&&(f.Instance._sessionId=await this.GetPreferredUUID(s)),f.Instance._client||(f.Instance._client=this.CreateNewGraphQLClient(e.URL,e.Token,f.Instance._sessionId,e.MJAPIKey,e.UserAPIKey)),await f.Instance.SaveStoredSessionID(f.Instance._sessionId),this._sessionId=f.Instance._sessionId,this._client=f.Instance._client),super.Config(e)}catch(n){throw (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogError */ .ZI8)(n),n}}get sessionId(){return this._sessionId}get AllowRefresh(){return!0}SetDynamicHeader(e,t){this._dynamicHeaders.set(e,t),this._client&&this._client.setHeader(e,t),f.Instance&&f.Instance!==this&&f.Instance._configData===this._configData&&(f.Instance._dynamicHeaders.set(e,t),f.Instance._client&&f.Instance._client.setHeader(e,t))}RemoveDynamicHeader(e){this._dynamicHeaders.delete(e),this._client&&this._client.setHeader(e,""),f.Instance&&f.Instance!==this&&f.Instance._configData===this._configData&&(f.Instance._dynamicHeaders.delete(e),f.Instance._client&&f.Instance._client.setHeader(e,""))}GetDynamicHeaders(){return this._dynamicHeaders}async GetCurrentUser(){const e=await this.ExecuteGQL(this._currentUserQuery,null);if(e){const t=this.ConvertBackToMJFields(e.CurrentUser),{Roles:r,...s}=t,n=(r??[]).map(i=>this.ConvertBackToMJFields(i)),a=new _memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .UserInfo */ .oqB(this,{...s,UserRoles:n});return e.CurrentUserTenantContext&&typeof e.CurrentUserTenantContext=="object"&&(a.TenantContext=e.CurrentUserTenantContext),a}}async InternalRunQuery(e,t){if(e.SQL)return this.RunAdhocQuery(e.SQL,e.MaxRows,
|
|
385
|
+
}`,this._wsClient=null,this._wsClientCreatedAt=null,this._socketStateSubject=new rxjs__WEBPACK_IMPORTED_MODULE_6__/* .BehaviorSubject */ .t("unknown"),this._isDisposingSocketIntentionally=!1,this._pushStatusSubjects=new Map,this._activeSubscriptionCount=0,this.WS_CLIENT_MAX_AGE_MS=1800*1e3,this.SUBSCRIPTION_CLEANUP_INTERVAL_MS=300*1e3,this.SUBSCRIPTION_IDLE_TIMEOUT_MS=600*1e3,this._subscriptionCleanupTimer=null,this._isCleaningUp=!1,this._taskGraphFrameStreams=new Map,this._cacheInvalidationSubscription=null;const e=(0,_memberjunction_global__WEBPACK_IMPORTED_MODULE_2__/* .GetGlobalObjectStore */ .Ip)();if(e&&e[f._globalStoreKey])return e[f._globalStoreKey];e&&(e[f._globalStoreKey]=this)}static{this.VerboseCacheInvalidationLogging=!1}static{this._globalStoreKey="___SINGLETON__GraphQLDataProvider"}static get Instance(){const e=(0,_memberjunction_global__WEBPACK_IMPORTED_MODULE_2__/* .GetGlobalObjectStore */ .Ip)();return e?e[f._globalStoreKey]:void 0}get ConfigData(){return this._configData}get AI(){return this._aiClient||(this._aiClient=new se(this)),this._aiClient}get DatabaseConnection(){throw new Error("DatabaseConnection not implemented for the GraphQLDataProvider")}async InternalExecuteQueryFromSpec(e,t){throw new Error("ExecuteQueryFromSpec is not supported by this provider.")}get InstanceConnectionString(){return this._configData.URL}GenerateUUID(){return (0,uuid__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)()}get LocalStoragePrefix(){if(this._configData===void 0||this._configData.URL===void 0)throw new Error("GraphQLDataProvider: ConfigData is not set. Please call Config() first.");return this._configData.URL.replace(/[^a-zA-Z0-9]/g,"_")+"."}async GetStoredSessionID(){try{const e=this.LocalStorageProvider;if(e){const t=this.LocalStoragePrefix+"sessionId";return await e.GetItem(t)}return null}catch(e){return console.error("Error retrieving session ID from local storage:",e),null}}async SaveStoredSessionID(e){try{const t=this.LocalStorageProvider;if(t){const r=this.LocalStoragePrefix+"sessionId";await t.SetItem(r,e)}}catch{}}async GetPreferredUUID(e){const t=await this.GetStoredSessionID();return e||!t?this.GenerateUUID():t}async Config(e,t,r,s){try{return this._configData=e,r?(this._sessionId=await this.GetPreferredUUID(s),this._client=this.CreateNewGraphQLClient(e.URL,e.Token,this._sessionId,e.MJAPIKey,e.UserAPIKey),await this.SaveStoredSessionID(this._sessionId)):(f.Instance._configData=e,f.Instance._sessionId===void 0&&(f.Instance._sessionId=await this.GetPreferredUUID(s)),f.Instance._client||(f.Instance._client=this.CreateNewGraphQLClient(e.URL,e.Token,f.Instance._sessionId,e.MJAPIKey,e.UserAPIKey)),await f.Instance.SaveStoredSessionID(f.Instance._sessionId),this._sessionId=f.Instance._sessionId,this._client=f.Instance._client),super.Config(e)}catch(n){throw (0,_memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .LogError */ .ZI8)(n),n}}get sessionId(){return this._sessionId}get AllowRefresh(){return!0}SetDynamicHeader(e,t){this._dynamicHeaders.set(e,t),this._client&&this._client.setHeader(e,t),f.Instance&&f.Instance!==this&&f.Instance._configData===this._configData&&(f.Instance._dynamicHeaders.set(e,t),f.Instance._client&&f.Instance._client.setHeader(e,t))}RemoveDynamicHeader(e){this._dynamicHeaders.delete(e),this._client&&this._client.setHeader(e,""),f.Instance&&f.Instance!==this&&f.Instance._configData===this._configData&&(f.Instance._dynamicHeaders.delete(e),f.Instance._client&&f.Instance._client.setHeader(e,""))}GetDynamicHeaders(){return this._dynamicHeaders}async GetCurrentUser(){const e=await this.ExecuteGQL(this._currentUserQuery,null);if(e){const t=this.ConvertBackToMJFields(e.CurrentUser),{Roles:r,...s}=t,n=(r??[]).map(i=>this.ConvertBackToMJFields(i)),a=new _memberjunction_core__WEBPACK_IMPORTED_MODULE_1__/* .UserInfo */ .oqB(this,{...s,UserRoles:n});return e.CurrentUserTenantContext&&typeof e.CurrentUserTenantContext=="object"&&(a.TenantContext=e.CurrentUserTenantContext),a}}async InternalRunQuery(e,t){if(e.SQL)return this.RunAdhocQuery(e.SQL,e.MaxRows,e.TimeoutSeconds,e.StartRow);if(e.QueryID)return this.RunQueryByID(e.QueryID,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow,e.Enrichment,e.DataSource);if(e.QueryName)return this.RunQueryByName(e.QueryName,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow,e.Enrichment,e.DataSource);throw new Error("No SQL, QueryID, or QueryName provided to RunQuery")}async RunAdhocQuery(e,t,r,s){const n=(0,graphql_request__WEBPACK_IMPORTED_MODULE_0__/* .gql */ .J1)`
|
|
386
386
|
query ExecuteAdhocQuery($input: AdhocQueryInput!) {
|
|
387
387
|
ExecuteAdhocQuery(input: $input) {
|
|
388
388
|
${this.QueryReturnFieldList}
|
package/dist/runtime.umd.js
CHANGED
|
@@ -19152,7 +19152,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
19152
19152
|
IaG: () => (/* reexport */ getGraphQLTypeNameBase)
|
|
19153
19153
|
});
|
|
19154
19154
|
|
|
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, 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
|
|
19156
19156
|
|
|
19157
19157
|
// EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 25 modules
|
|
19158
19158
|
var dist = __webpack_require__(401);
|
|
@@ -20129,6 +20129,11 @@ function formatTypeString(mapped, length, precision, scale) {
|
|
|
20129
20129
|
}
|
|
20130
20130
|
return mapped.typeName;
|
|
20131
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'];
|
|
20132
20137
|
/**
|
|
20133
20138
|
* SQL Server dialect implementation.
|
|
20134
20139
|
* Uses [bracket] quoting, TOP for pagination, BIT for booleans, T-SQL functions.
|
|
@@ -20153,12 +20158,13 @@ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
|
|
|
20153
20158
|
}, {
|
|
20154
20159
|
key: "QuoteIdentifier",
|
|
20155
20160
|
value: function QuoteIdentifier(name) {
|
|
20156
|
-
|
|
20161
|
+
// Double any embedded `]` so the name cannot end early and the rest of it read as SQL.
|
|
20162
|
+
return "[".concat(name.replace(/]/g, ']]'), "]");
|
|
20157
20163
|
}
|
|
20158
20164
|
}, {
|
|
20159
20165
|
key: "QuoteSchema",
|
|
20160
20166
|
value: function QuoteSchema(schema, object) {
|
|
20161
|
-
return "
|
|
20167
|
+
return "".concat(this.QuoteIdentifier(schema), ".").concat(this.QuoteIdentifier(object));
|
|
20162
20168
|
}
|
|
20163
20169
|
/**
|
|
20164
20170
|
* SQL Server identifiers are case-insensitive by default, so a bare
|
|
@@ -20499,6 +20505,51 @@ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
|
|
|
20499
20505
|
get: function get() {
|
|
20500
20506
|
return '(SELECT NULL)';
|
|
20501
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
|
+
}
|
|
20502
20553
|
// ─── Data Types ──────────────────────────────────────────────────
|
|
20503
20554
|
}, {
|
|
20504
20555
|
key: "TypeMap",
|
|
@@ -21106,6 +21157,14 @@ function postgresqlDialect_formatTypeString(mapped, length, precision, scale) {
|
|
|
21106
21157
|
}
|
|
21107
21158
|
return mapped.typeName;
|
|
21108
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'];
|
|
21109
21168
|
/**
|
|
21110
21169
|
* PostgreSQL dialect implementation.
|
|
21111
21170
|
* Uses "double-quote" identifiers, LIMIT/OFFSET pagination, native BOOLEAN, PL/pgSQL functions.
|
|
@@ -21551,6 +21610,51 @@ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
|
|
|
21551
21610
|
get: function get() {
|
|
21552
21611
|
return '1';
|
|
21553
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
|
+
}
|
|
21554
21658
|
// ─── Data Types ──────────────────────────────────────────────────
|
|
21555
21659
|
}, {
|
|
21556
21660
|
key: "TypeMap",
|
|
@@ -21830,7 +21934,9 @@ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
|
|
|
21830
21934
|
}(SQLDialect);
|
|
21831
21935
|
_PostgreSQLDialect = PostgreSQLDialect;
|
|
21832
21936
|
_PostgreSQLDialect._BooleanTypeNames = ['bool', 'boolean'];
|
|
21833
|
-
|
|
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'];
|
|
21834
21940
|
/**
|
|
21835
21941
|
* PG fixed-width / space-padded char types. `character` (without `varying`)
|
|
21836
21942
|
* and `bpchar` are the formal/internal names; `char` is the short alias.
|
|
@@ -22315,11 +22421,6 @@ var pgDialect = new PostgreSQLDialect();
|
|
|
22315
22421
|
* is also an MJ column name (`NAME`, `TEXT`, `VALUES`, `LENGTH`, …) is safe to include:
|
|
22316
22422
|
* the mixed-case column form still quotes.
|
|
22317
22423
|
*/
|
|
22318
|
-
/**
|
|
22319
|
-
* Known tokenization limitations (comments containing an apostrophe, and `E'...'` escape
|
|
22320
|
-
* strings) are tracked as **MJ #3775** — pre-existing, unchanged by the consolidation, and now
|
|
22321
|
-
* fixable in one place rather than two.
|
|
22322
|
-
*/
|
|
22323
22424
|
/**
|
|
22324
22425
|
* NOT the only identifier quoter in MJ, and deliberately so.
|
|
22325
22426
|
*
|
|
@@ -23115,10 +23216,48 @@ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try {
|
|
|
23115
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; } } }; }
|
|
23116
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; } }
|
|
23117
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); }
|
|
23118
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); }
|
|
23119
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); }
|
|
23120
23227
|
|
|
23121
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
|
+
}
|
|
23122
23261
|
/**
|
|
23123
23262
|
* Returns the TypeScript type that corresponds to the SQL type passed in.
|
|
23124
23263
|
*
|
|
@@ -23190,6 +23329,9 @@ function FormatValueInternal(sqlType, value) {
|
|
|
23190
23329
|
maximumFractionDigits: decimals
|
|
23191
23330
|
}).format(value);
|
|
23192
23331
|
}
|
|
23332
|
+
if (IsDateOnlySQLType(sqlType)) {
|
|
23333
|
+
return FormatDateOnly(value);
|
|
23334
|
+
}
|
|
23193
23335
|
if (IsDateSQLType(sqlType) || IsIntervalSQLType(sqlType)) {
|
|
23194
23336
|
return new Intl.DateTimeFormat().format(new Date(value));
|
|
23195
23337
|
}
|
|
@@ -27129,9 +27271,9 @@ _Metadata = Metadata;
|
|
|
27129
27271
|
_Metadata._globalProviderKey = 'MJ_MetadataProvider';
|
|
27130
27272
|
;// ../../MJCore/dist/generic/entityConfiguration.js
|
|
27131
27273
|
/* unused harmony import specifier */ var SafeJSONParse;
|
|
27132
|
-
function
|
|
27133
|
-
function
|
|
27134
|
-
function
|
|
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; }
|
|
27135
27277
|
function entityConfiguration_toPropertyKey(t) { var i = entityConfiguration_toPrimitive(t, "string"); return "symbol" == entityConfiguration_typeof(i) ? i : i + ""; }
|
|
27136
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); }
|
|
27137
27279
|
function entityConfiguration_toConsumableArray(r) { return entityConfiguration_arrayWithoutHoles(r) || entityConfiguration_iterableToArray(r) || entityConfiguration_unsupportedIterableToArray(r) || entityConfiguration_nonIterableSpread(); }
|
|
@@ -27466,7 +27608,7 @@ function applyRelationshipRule(assignment, rule) {
|
|
|
27466
27608
|
var role = inclusion === 'Primary' ? 'Primary' : 'Detail';
|
|
27467
27609
|
var reason = inclusion === 'Primary' ? 'install-primary' : inclusion === 'More' ? 'install-more' : 'install-none';
|
|
27468
27610
|
var join = rule.JoinFields && rule.JoinFields.length > 0 ? rule.JoinFields : assignment.JoinFields;
|
|
27469
|
-
return
|
|
27611
|
+
return entityConfiguration_objectSpread(entityConfiguration_objectSpread({}, assignment), {}, {
|
|
27470
27612
|
Role: role,
|
|
27471
27613
|
Inclusion: inclusion,
|
|
27472
27614
|
Reason: reason,
|
|
@@ -45640,6 +45782,10 @@ _RunQuery = RunQuery;
|
|
|
45640
45782
|
_RunQuery._globalProviderKey = 'MJ_RunQueryProvider';
|
|
45641
45783
|
;// ../../MJCore/dist/generic/telemetryManager.js
|
|
45642
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; }
|
|
45643
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; } } }; }
|
|
45644
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; }
|
|
45645
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; }
|
|
@@ -45999,6 +46145,7 @@ var DEFAULT_SETTINGS = {
|
|
|
45999
46145
|
autoTrim: {
|
|
46000
46146
|
enabled: true,
|
|
46001
46147
|
maxEvents: 10000,
|
|
46148
|
+
maxInsights: 1000,
|
|
46002
46149
|
maxAgeMs: 30 * 60 * 1000 // 30 minutes
|
|
46003
46150
|
},
|
|
46004
46151
|
duplicateDetection: {
|
|
@@ -46010,6 +46157,12 @@ var DEFAULT_SETTINGS = {
|
|
|
46010
46157
|
dedupeWindowMs: 30000 // 30 seconds
|
|
46011
46158
|
}
|
|
46012
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;
|
|
46013
46166
|
// ============================================================================
|
|
46014
46167
|
// TELEMETRY MANAGER
|
|
46015
46168
|
// ============================================================================
|
|
@@ -46034,6 +46187,12 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
46034
46187
|
_this2._analyzers = [];
|
|
46035
46188
|
_this2._insights = [];
|
|
46036
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;
|
|
46037
46196
|
_this2._settings = _this2.loadSettings();
|
|
46038
46197
|
_this2.registerBuiltInAnalyzers();
|
|
46039
46198
|
return _this2;
|
|
@@ -46812,6 +46971,7 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
46812
46971
|
}, {
|
|
46813
46972
|
key: "trimIfNeeded",
|
|
46814
46973
|
value: function trimIfNeeded() {
|
|
46974
|
+
var _this$_settings$autoT2;
|
|
46815
46975
|
if (!this._settings.autoTrim.enabled) return;
|
|
46816
46976
|
var _this$_settings$autoT = this._settings.autoTrim,
|
|
46817
46977
|
maxEvents = _this$_settings$autoT.maxEvents,
|
|
@@ -46827,6 +46987,56 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
46827
46987
|
if (maxEvents && this._events.length > maxEvents) {
|
|
46828
46988
|
this._events = this._events.slice(-maxEvents);
|
|
46829
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
|
+
}
|
|
46830
47040
|
}
|
|
46831
47041
|
}, {
|
|
46832
47042
|
key: "loadSettings",
|
|
@@ -46935,18 +47145,18 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
46935
47145
|
totalMs: 0
|
|
46936
47146
|
}
|
|
46937
47147
|
};
|
|
46938
|
-
var
|
|
46939
|
-
|
|
47148
|
+
var _iterator4 = telemetryManager_createForOfIteratorHelper(this._events),
|
|
47149
|
+
_step4;
|
|
46940
47150
|
try {
|
|
46941
|
-
for (
|
|
46942
|
-
var event =
|
|
47151
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
47152
|
+
var event = _step4.value;
|
|
46943
47153
|
byCategory[event.category].events++;
|
|
46944
47154
|
byCategory[event.category].totalMs += event.elapsedMs || 0;
|
|
46945
47155
|
}
|
|
46946
47156
|
} catch (err) {
|
|
46947
|
-
|
|
47157
|
+
_iterator4.e(err);
|
|
46948
47158
|
} finally {
|
|
46949
|
-
|
|
47159
|
+
_iterator4.f();
|
|
46950
47160
|
}
|
|
46951
47161
|
var byCategoryWithAvg = {};
|
|
46952
47162
|
for (var _i = 0, _Object$keys = Object.keys(byCategory); _i < _Object$keys.length; _i++) {
|
|
@@ -54409,6 +54619,8 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
54409
54619
|
this._metadataMemberRefreshTimer = null;
|
|
54410
54620
|
this._clientFingerprintMemo = new WeakMap();
|
|
54411
54621
|
this._cachedVisibleExplorerNavigationItems = null;
|
|
54622
|
+
/** Guard for {@link logMetadataSnapshotDisabledOnce}. */
|
|
54623
|
+
this._metadataSnapshotSkipLogged = false;
|
|
54412
54624
|
}
|
|
54413
54625
|
/**
|
|
54414
54626
|
* Whether this provider can execute a multi-record unit of work atomically, in-process.
|
|
@@ -61439,6 +61651,13 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61439
61651
|
}
|
|
61440
61652
|
return _context61.a(2);
|
|
61441
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:
|
|
61442
61661
|
overallStart = Date.now(); // The metadata snapshot uses three keys (timestamps, format, AllMetadata).
|
|
61443
61662
|
// Pull them in a single batched read — saves two IDB transaction round-trips
|
|
61444
61663
|
// on warm boot. The values are still strings (string storage is intentional
|
|
@@ -61448,9 +61667,9 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61448
61667
|
dataKey = this.LocalStoragePrefix + ProviderBase.localStorageAllMetadataKey;
|
|
61449
61668
|
membershipKey = this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey;
|
|
61450
61669
|
readStart = Date.now();
|
|
61451
|
-
_context61.n =
|
|
61670
|
+
_context61.n = 3;
|
|
61452
61671
|
return ls.GetItems([tsKey, fmtKey, dataKey, membershipKey]);
|
|
61453
|
-
case
|
|
61672
|
+
case 3:
|
|
61454
61673
|
all = _context61.v;
|
|
61455
61674
|
readMs = Date.now() - readStart;
|
|
61456
61675
|
tsRaw = (_all$get = all.get(tsKey)) !== null && _all$get !== void 0 ? _all$get : null;
|
|
@@ -61474,15 +61693,15 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61474
61693
|
}
|
|
61475
61694
|
}
|
|
61476
61695
|
if (raw) {
|
|
61477
|
-
_context61.n =
|
|
61696
|
+
_context61.n = 4;
|
|
61478
61697
|
break;
|
|
61479
61698
|
}
|
|
61480
61699
|
return _context61.a(2);
|
|
61481
|
-
case
|
|
61700
|
+
case 4:
|
|
61482
61701
|
// Decompress if stored in compressed format, otherwise parse directly
|
|
61483
61702
|
parseStart = Date.now();
|
|
61484
61703
|
if (!(format === 'gzip' && typeof raw === 'string')) {
|
|
61485
|
-
_context61.n =
|
|
61704
|
+
_context61.n = 6;
|
|
61486
61705
|
break;
|
|
61487
61706
|
}
|
|
61488
61707
|
// Compressed path: base64 → binary → gzip decompress → JSON parse
|
|
@@ -61490,24 +61709,24 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61490
61709
|
blob = new Blob([binary]);
|
|
61491
61710
|
ds = new DecompressionStream('gzip');
|
|
61492
61711
|
decompressedStream = blob.stream().pipeThrough(ds);
|
|
61493
|
-
_context61.n =
|
|
61712
|
+
_context61.n = 5;
|
|
61494
61713
|
return new Response(decompressedStream).text();
|
|
61495
|
-
case
|
|
61714
|
+
case 5:
|
|
61496
61715
|
jsonString = _context61.v;
|
|
61497
61716
|
temp = JSON.parse(jsonString);
|
|
61498
|
-
_context61.n =
|
|
61717
|
+
_context61.n = 7;
|
|
61499
61718
|
break;
|
|
61500
|
-
case
|
|
61719
|
+
case 6:
|
|
61501
61720
|
// Legacy uncompressed path
|
|
61502
61721
|
temp = typeof raw === 'string' ? JSON.parse(raw) : raw;
|
|
61503
|
-
case
|
|
61722
|
+
case 7:
|
|
61504
61723
|
parseMs = Date.now() - parseStart;
|
|
61505
61724
|
if (temp) {
|
|
61506
|
-
_context61.n =
|
|
61725
|
+
_context61.n = 8;
|
|
61507
61726
|
break;
|
|
61508
61727
|
}
|
|
61509
61728
|
return _context61.a(2);
|
|
61510
|
-
case
|
|
61729
|
+
case 8:
|
|
61511
61730
|
// Reconstruct typed metadata objects from the parsed JSON
|
|
61512
61731
|
deserializeStart = Date.now();
|
|
61513
61732
|
metadata = MetadataFromSimpleObject(temp, this);
|
|
@@ -61522,16 +61741,16 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61522
61741
|
} else {
|
|
61523
61742
|
LogError('[Metadata Cache] MetadataFromSimpleObject returned undefined — cache deserialization failed. Check console for per-item errors above.');
|
|
61524
61743
|
}
|
|
61525
|
-
_context61.n =
|
|
61744
|
+
_context61.n = 10;
|
|
61526
61745
|
break;
|
|
61527
|
-
case
|
|
61528
|
-
_context61.p =
|
|
61746
|
+
case 9:
|
|
61747
|
+
_context61.p = 9;
|
|
61529
61748
|
_t21 = _context61.v;
|
|
61530
61749
|
LogError("[Metadata Cache] LoadLocalMetadataFromStorage failed: ".concat(_t21 instanceof Error ? _t21.message : String(_t21)));
|
|
61531
|
-
case
|
|
61750
|
+
case 10:
|
|
61532
61751
|
return _context61.a(2);
|
|
61533
61752
|
}
|
|
61534
|
-
}, _callee58, this, [[0,
|
|
61753
|
+
}, _callee58, this, [[0, 9]]);
|
|
61535
61754
|
}));
|
|
61536
61755
|
function LoadLocalMetadataFromStorage() {
|
|
61537
61756
|
return _LoadLocalMetadataFromStorage.apply(this, arguments);
|
|
@@ -61549,6 +61768,47 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61549
61768
|
function get() {
|
|
61550
61769
|
return "";
|
|
61551
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
|
+
}
|
|
61552
61812
|
/**
|
|
61553
61813
|
* Saves current metadata to local storage for caching.
|
|
61554
61814
|
* Serializes both timestamps and full metadata collections.
|
|
@@ -61569,6 +61829,13 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61569
61829
|
}
|
|
61570
61830
|
return _context62.a(2);
|
|
61571
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:
|
|
61572
61839
|
start = Date.now(); // Serialize the AllMetadata object FIRST. If this throws (or the payload write below
|
|
61573
61840
|
// fails), nothing else has been written yet, so the previously stored timestamps still
|
|
61574
61841
|
// describe the previously stored payload and LocalMetadataObsolete() will report
|
|
@@ -61576,31 +61843,31 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61576
61843
|
// before the payload left the cache claiming freshness with no payload behind it, and
|
|
61577
61844
|
// that state was never retried.
|
|
61578
61845
|
jsonString = JSON.stringify(this._localMetadata);
|
|
61579
|
-
_context62.n =
|
|
61846
|
+
_context62.n = 3;
|
|
61580
61847
|
return this.writeMetadataSnapshot(ls, jsonString);
|
|
61581
|
-
case
|
|
61848
|
+
case 3:
|
|
61582
61849
|
snapshot = _context62.v;
|
|
61583
61850
|
if (!((_this$_metadataDatase2 = this._metadataDatasetEntityNames) !== null && _this$_metadataDatase2 !== void 0 && _this$_metadataDatase2.size)) {
|
|
61584
|
-
_context62.n =
|
|
61851
|
+
_context62.n = 4;
|
|
61585
61852
|
break;
|
|
61586
61853
|
}
|
|
61587
|
-
_context62.n = 3;
|
|
61588
|
-
return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey, JSON.stringify(providerBase_toConsumableArray(this._metadataDatasetEntityNames)));
|
|
61589
|
-
case 3:
|
|
61590
61854
|
_context62.n = 4;
|
|
61591
|
-
return ls.SetItem(this.LocalStoragePrefix + ProviderBase.
|
|
61855
|
+
return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageDatasetMembershipKey, JSON.stringify(providerBase_toConsumableArray(this._metadataDatasetEntityNames)));
|
|
61592
61856
|
case 4:
|
|
61857
|
+
_context62.n = 5;
|
|
61858
|
+
return ls.SetItem(this.LocalStoragePrefix + ProviderBase.localStorageTimestampsKey, JSON.stringify(this._latestLocalMetadataTimestamps));
|
|
61859
|
+
case 5:
|
|
61593
61860
|
this.logMetadataSaveComplete(Date.now() - start, jsonString.length, snapshot);
|
|
61594
|
-
_context62.n =
|
|
61861
|
+
_context62.n = 7;
|
|
61595
61862
|
break;
|
|
61596
|
-
case
|
|
61597
|
-
_context62.p =
|
|
61863
|
+
case 6:
|
|
61864
|
+
_context62.p = 6;
|
|
61598
61865
|
_t22 = _context62.v;
|
|
61599
61866
|
LogError("[Metadata Cache] SaveLocalMetadataToStorage failed: ".concat(_t22 instanceof Error ? _t22.message : String(_t22)));
|
|
61600
|
-
case
|
|
61867
|
+
case 7:
|
|
61601
61868
|
return _context62.a(2);
|
|
61602
61869
|
}
|
|
61603
|
-
}, _callee59, this, [[0,
|
|
61870
|
+
}, _callee59, this, [[0, 6]]);
|
|
61604
61871
|
}));
|
|
61605
61872
|
function SaveLocalMetadataToStorage() {
|
|
61606
61873
|
return _SaveLocalMetadataToStorage.apply(this, arguments);
|
|
@@ -61870,6 +62137,18 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61870
62137
|
* Used for compressed metadata storage/retrieval.
|
|
61871
62138
|
*/
|
|
61872
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
|
+
}
|
|
61873
62152
|
var binaryString = atob(base64);
|
|
61874
62153
|
var bytes = new Uint8Array(binaryString.length);
|
|
61875
62154
|
for (var i = 0; i < binaryString.length; i++) {
|
|
@@ -61884,6 +62163,11 @@ var ProviderBase = /*#__PURE__*/function () {
|
|
|
61884
62163
|
}, {
|
|
61885
62164
|
key: "arrayBufferToBase64",
|
|
61886
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
|
+
}
|
|
61887
62171
|
var bytes = new Uint8Array(buffer);
|
|
61888
62172
|
var binary = '';
|
|
61889
62173
|
for (var i = 0; i < bytes.byteLength; i++) {
|
|
@@ -66889,7 +67173,12 @@ function getRunQuerySQLFilterNames() {
|
|
|
66889
67173
|
}
|
|
66890
67174
|
;// ../../MJCore/dist/generic/runQuerySQLFilterImplementations.js
|
|
66891
67175
|
/* unused harmony import specifier */ var BaseSingleton;
|
|
67176
|
+
/* unused harmony import specifier */ var runQuerySQLFilterImplementations_GetDialect;
|
|
66892
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; }
|
|
66893
67182
|
function runQuerySQLFilterImplementations_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
66894
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); } }
|
|
66895
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; }
|
|
@@ -66900,14 +67189,14 @@ function runQuerySQLFilterImplementations_isNativeReflectConstruct() { try { var
|
|
|
66900
67189
|
function runQuerySQLFilterImplementations_getPrototypeOf(t) { return runQuerySQLFilterImplementations_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, runQuerySQLFilterImplementations_getPrototypeOf(t); }
|
|
66901
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); }
|
|
66902
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; }
|
|
66903
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; }
|
|
66904
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; }
|
|
66905
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; }
|
|
66906
67198
|
function runQuerySQLFilterImplementations_toPropertyKey(t) { var i = runQuerySQLFilterImplementations_toPrimitive(t, "string"); return "symbol" == runQuerySQLFilterImplementations_typeof(i) ? i : i + ""; }
|
|
66907
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); }
|
|
66908
|
-
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; } } }; }
|
|
66909
|
-
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; } }
|
|
66910
|
-
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; }
|
|
66911
67200
|
/**
|
|
66912
67201
|
* @fileoverview SQL Filter Implementations for RunQuery
|
|
66913
67202
|
*
|
|
@@ -66918,6 +67207,7 @@ function runQuerySQLFilterImplementations_arrayLikeToArray(r, a) { (null == a ||
|
|
|
66918
67207
|
*/
|
|
66919
67208
|
|
|
66920
67209
|
|
|
67210
|
+
|
|
66921
67211
|
/**
|
|
66922
67212
|
* Dangerous SQL keywords that should be blocked in expressions
|
|
66923
67213
|
*/
|
|
@@ -66972,14 +67262,15 @@ var ALLOWED_SQL_KEYWORDS = [
|
|
|
66972
67262
|
'AND', 'OR', 'NOT', 'IS', 'NULL', 'LIKE',
|
|
66973
67263
|
// Comparison operators (as words)
|
|
66974
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);
|
|
66975
67269
|
/**
|
|
66976
|
-
* SQL Filter implementation functions
|
|
67270
|
+
* SQL Filter implementation functions. The filters whose output depends on the database come
|
|
67271
|
+
* from {@link dialectFilterImplementations}.
|
|
66977
67272
|
*/
|
|
66978
|
-
var FILTER_IMPLEMENTATIONS = {
|
|
66979
|
-
sqlString: function sqlString(value) {
|
|
66980
|
-
if (value === null || value === undefined) return 'NULL';
|
|
66981
|
-
return "'".concat(String(value).replace(/'/g, "''"), "'");
|
|
66982
|
-
},
|
|
67273
|
+
var FILTER_IMPLEMENTATIONS = runQuerySQLFilterImplementations_objectSpread(runQuerySQLFilterImplementations_objectSpread({}, dialectFilterImplementations(DEFAULT_FILTER_DIALECT)), {}, {
|
|
66983
67274
|
sqlNumber: function sqlNumber(value) {
|
|
66984
67275
|
var num = Number(value);
|
|
66985
67276
|
if (isNaN(num)) throw new Error("Invalid number: ".concat(value));
|
|
@@ -66991,51 +67282,6 @@ var FILTER_IMPLEMENTATIONS = {
|
|
|
66991
67282
|
if (isNaN(date.getTime())) throw new Error("Invalid date: ".concat(value));
|
|
66992
67283
|
return "'".concat(date.toISOString(), "'");
|
|
66993
67284
|
},
|
|
66994
|
-
sqlBoolean: function sqlBoolean(value) {
|
|
66995
|
-
// Default SQL Server behavior; overridden by platform-aware version in RunQuerySQLFilterManager
|
|
66996
|
-
return value ? '1' : '0';
|
|
66997
|
-
},
|
|
66998
|
-
sqlIdentifier: function sqlIdentifier(value) {
|
|
66999
|
-
if (!value) throw new Error('Identifier cannot be empty');
|
|
67000
|
-
var identifier = String(value);
|
|
67001
|
-
// Basic SQL injection prevention for identifiers
|
|
67002
|
-
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier)) {
|
|
67003
|
-
throw new Error("Invalid SQL identifier: ".concat(identifier));
|
|
67004
|
-
}
|
|
67005
|
-
// Default SQL Server behavior; overridden by platform-aware version in RunQuerySQLFilterManager
|
|
67006
|
-
return "[".concat(identifier, "]");
|
|
67007
|
-
},
|
|
67008
|
-
sqlIn: function sqlIn(values) {
|
|
67009
|
-
if (!Array.isArray(values) || values.length === 0) {
|
|
67010
|
-
return '(NULL)'; // This will match nothing
|
|
67011
|
-
}
|
|
67012
|
-
var escaped = values.map(function (v) {
|
|
67013
|
-
if (typeof v === 'string') {
|
|
67014
|
-
return "'".concat(v.replace(/'/g, "''"), "'");
|
|
67015
|
-
} else if (typeof v === 'number') {
|
|
67016
|
-
return v;
|
|
67017
|
-
} else if (v === null || v === undefined) {
|
|
67018
|
-
return 'NULL';
|
|
67019
|
-
}
|
|
67020
|
-
return "'".concat(String(v).replace(/'/g, "''"), "'");
|
|
67021
|
-
});
|
|
67022
|
-
return "(".concat(escaped.join(', '), ")");
|
|
67023
|
-
},
|
|
67024
|
-
sqlLikeContains: function sqlLikeContains(value) {
|
|
67025
|
-
if (value === null || value === undefined) return 'NULL';
|
|
67026
|
-
var stripped = stripBoundaryWildcards(String(value), 'both');
|
|
67027
|
-
return "'%".concat(escapeLikeValue(stripped, 'sqlserver'), "%'");
|
|
67028
|
-
},
|
|
67029
|
-
sqlLikeBegins: function sqlLikeBegins(value) {
|
|
67030
|
-
if (value === null || value === undefined) return 'NULL';
|
|
67031
|
-
var stripped = stripBoundaryWildcards(String(value), 'trailing');
|
|
67032
|
-
return "'".concat(escapeLikeValue(stripped, 'sqlserver'), "%'");
|
|
67033
|
-
},
|
|
67034
|
-
sqlLikeEnds: function sqlLikeEnds(value) {
|
|
67035
|
-
if (value === null || value === undefined) return 'NULL';
|
|
67036
|
-
var stripped = stripBoundaryWildcards(String(value), 'leading');
|
|
67037
|
-
return "'%".concat(escapeLikeValue(stripped, 'sqlserver'), "'");
|
|
67038
|
-
},
|
|
67039
67285
|
sqlNoKeywordsExpression: function sqlNoKeywordsExpression(value) {
|
|
67040
67286
|
if (!value) {
|
|
67041
67287
|
throw new Error('SQL expression cannot be empty');
|
|
@@ -67091,7 +67337,7 @@ var FILTER_IMPLEMENTATIONS = {
|
|
|
67091
67337
|
// Return the original expression (preserving case)
|
|
67092
67338
|
return expression;
|
|
67093
67339
|
}
|
|
67094
|
-
};
|
|
67340
|
+
});
|
|
67095
67341
|
/**
|
|
67096
67342
|
* Complete SQL filters with implementations attached.
|
|
67097
67343
|
* This is the array that should be used by the QueryParameterProcessor.
|
|
@@ -67102,32 +67348,44 @@ var RUN_QUERY_SQL_FILTERS_WITH_IMPLEMENTATIONS = RUN_QUERY_SQL_FILTERS.map(funct
|
|
|
67102
67348
|
});
|
|
67103
67349
|
});
|
|
67104
67350
|
/**
|
|
67105
|
-
*
|
|
67106
|
-
*
|
|
67107
|
-
|
|
67108
|
-
function createPlatformSqlBoolean(platform) {
|
|
67109
|
-
return function (value) {
|
|
67110
|
-
if (platform === 'postgresql') {
|
|
67111
|
-
return value ? 'true' : 'false';
|
|
67112
|
-
}
|
|
67113
|
-
return value ? '1' : '0';
|
|
67114
|
-
};
|
|
67115
|
-
}
|
|
67116
|
-
/**
|
|
67117
|
-
* Creates a platform-aware sqlIdentifier filter implementation.
|
|
67118
|
-
* 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.
|
|
67119
67354
|
*/
|
|
67120
|
-
function
|
|
67121
|
-
return
|
|
67122
|
-
|
|
67123
|
-
|
|
67124
|
-
|
|
67125
|
-
|
|
67126
|
-
|
|
67127
|
-
|
|
67128
|
-
|
|
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);
|
|
67129
67388
|
}
|
|
67130
|
-
return "[".concat(identifier, "]");
|
|
67131
67389
|
};
|
|
67132
67390
|
}
|
|
67133
67391
|
/**
|
|
@@ -67149,40 +67407,23 @@ function stripBoundaryWildcards(value, side) {
|
|
|
67149
67407
|
}
|
|
67150
67408
|
}
|
|
67151
67409
|
/**
|
|
67152
|
-
*
|
|
67153
|
-
*
|
|
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.
|
|
67154
67414
|
*/
|
|
67155
|
-
function
|
|
67156
|
-
|
|
67157
|
-
|
|
67158
|
-
|
|
67159
|
-
|
|
67160
|
-
|
|
67161
|
-
|
|
67162
|
-
/**
|
|
67163
|
-
* Creates platform-aware sqlLike filter implementations.
|
|
67164
|
-
* SQL Server escapes with [%]/[_], PostgreSQL escapes with \%/\_.
|
|
67165
|
-
*/
|
|
67166
|
-
function createPlatformSqlLikeContains(platform) {
|
|
67167
|
-
return function (value) {
|
|
67168
|
-
if (value === null || value === undefined) return 'NULL';
|
|
67169
|
-
var stripped = stripBoundaryWildcards(String(value), 'both');
|
|
67170
|
-
return "'%".concat(escapeLikeValue(stripped, platform), "%'");
|
|
67171
|
-
};
|
|
67172
|
-
}
|
|
67173
|
-
function createPlatformSqlLikeBegins(platform) {
|
|
67174
|
-
return function (value) {
|
|
67175
|
-
if (value === null || value === undefined) return 'NULL';
|
|
67176
|
-
var stripped = stripBoundaryWildcards(String(value), 'trailing');
|
|
67177
|
-
return "'".concat(escapeLikeValue(stripped, platform), "%'");
|
|
67178
|
-
};
|
|
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, "'");
|
|
67179
67422
|
}
|
|
67180
|
-
|
|
67181
|
-
|
|
67182
|
-
|
|
67183
|
-
|
|
67184
|
-
return "'%".concat(escapeLikeValue(stripped, platform), "'");
|
|
67185
|
-
};
|
|
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), "'");
|
|
67186
67427
|
}
|
|
67187
67428
|
/**
|
|
67188
67429
|
* Singleton class for managing RunQuery SQL filters with implementations.
|
|
@@ -67200,7 +67441,7 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
|
|
|
67200
67441
|
runQuerySQLFilterImplementations_classCallCheck(this, RunQuerySQLFilterManager);
|
|
67201
67442
|
_this = runQuerySQLFilterImplementations_callSuper(this, RunQuerySQLFilterManager);
|
|
67202
67443
|
_this._filters = new Map();
|
|
67203
|
-
_this._platform =
|
|
67444
|
+
_this._platform = DEFAULT_FILTER_PLATFORM;
|
|
67204
67445
|
_this.initializeFilters();
|
|
67205
67446
|
return _this;
|
|
67206
67447
|
}
|
|
@@ -67222,30 +67463,19 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
|
|
|
67222
67463
|
this.applyPlatformOverrides();
|
|
67223
67464
|
}
|
|
67224
67465
|
/**
|
|
67225
|
-
*
|
|
67466
|
+
* Installs the dialect-sensitive filters for the current platform's dialect.
|
|
67226
67467
|
*/
|
|
67227
67468
|
}, {
|
|
67228
67469
|
key: "applyPlatformOverrides",
|
|
67229
67470
|
value: function applyPlatformOverrides() {
|
|
67230
|
-
var
|
|
67231
|
-
|
|
67232
|
-
|
|
67233
|
-
|
|
67234
|
-
|
|
67235
|
-
|
|
67236
|
-
|
|
67237
|
-
|
|
67238
|
-
var likeContainsFilter = this._filters.get('sqlLikeContains');
|
|
67239
|
-
if (likeContainsFilter) {
|
|
67240
|
-
likeContainsFilter.implementation = createPlatformSqlLikeContains(this._platform);
|
|
67241
|
-
}
|
|
67242
|
-
var likeBeginsFilter = this._filters.get('sqlLikeBegins');
|
|
67243
|
-
if (likeBeginsFilter) {
|
|
67244
|
-
likeBeginsFilter.implementation = createPlatformSqlLikeBegins(this._platform);
|
|
67245
|
-
}
|
|
67246
|
-
var likeEndsFilter = this._filters.get('sqlLikeEnds');
|
|
67247
|
-
if (likeEndsFilter) {
|
|
67248
|
-
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
|
+
}
|
|
67249
67479
|
}
|
|
67250
67480
|
}
|
|
67251
67481
|
/**
|
|
@@ -67260,6 +67490,15 @@ var RunQuerySQLFilterManager = /*#__PURE__*/(/* unused pure expression or super
|
|
|
67260
67490
|
function get() {
|
|
67261
67491
|
return this._platform;
|
|
67262
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
|
+
}
|
|
67263
67502
|
/**
|
|
67264
67503
|
* Sets the database platform, updating platform-sensitive filters accordingly.
|
|
67265
67504
|
* Call this during provider initialization to match the active database platform.
|
|
@@ -72439,6 +72678,11 @@ var InMemoryLocalStorageProvider = /*#__PURE__*/function () {
|
|
|
72439
72678
|
* {@link ILocalStorageProvider.SharesReferences}.
|
|
72440
72679
|
*/
|
|
72441
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;
|
|
72442
72686
|
}
|
|
72443
72687
|
return InMemoryLocalStorageProvider_createClass(InMemoryLocalStorageProvider, [{
|
|
72444
72688
|
key: "getCategoryMap",
|
|
@@ -123214,7 +123458,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123214
123458
|
while (1) switch (_context.n) {
|
|
123215
123459
|
case 0:
|
|
123216
123460
|
_context.n = 1;
|
|
123217
|
-
return this.currentUserMayWrite();
|
|
123461
|
+
return this.currentUserMayWrite('save');
|
|
123218
123462
|
case 1:
|
|
123219
123463
|
if (_context.v) {
|
|
123220
123464
|
_context.n = 2;
|
|
@@ -123239,7 +123483,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123239
123483
|
while (1) switch (_context2.n) {
|
|
123240
123484
|
case 0:
|
|
123241
123485
|
_context2.n = 1;
|
|
123242
|
-
return this.currentUserMayWrite();
|
|
123486
|
+
return this.currentUserMayWrite('delete');
|
|
123243
123487
|
case 1:
|
|
123244
123488
|
if (_context2.v) {
|
|
123245
123489
|
_context2.n = 2;
|
|
@@ -123259,12 +123503,13 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123259
123503
|
}, {
|
|
123260
123504
|
key: "currentUserMayWrite",
|
|
123261
123505
|
value: function () {
|
|
123262
|
-
var _currentUserMayWrite = MJConversationDetailEntityExtended_asyncToGenerator(/*#__PURE__*/MJConversationDetailEntityExtended_regenerator().m(function _callee3() {
|
|
123506
|
+
var _currentUserMayWrite = MJConversationDetailEntityExtended_asyncToGenerator(/*#__PURE__*/MJConversationDetailEntityExtended_regenerator().m(function _callee3(operation) {
|
|
123263
123507
|
var _this = this;
|
|
123264
|
-
var provider, user, conversation, loaded, isOwner, engine, grant, _t;
|
|
123508
|
+
var resultType, provider, user, conversation, loaded, isOwner, engine, grant, message, _t;
|
|
123265
123509
|
return MJConversationDetailEntityExtended_regenerator().w(function (_context3) {
|
|
123266
123510
|
while (1) switch (_context3.p = _context3.n) {
|
|
123267
123511
|
case 0:
|
|
123512
|
+
resultType = operation === 'delete' ? 'delete' : this.IsSaved ? 'update' : 'create';
|
|
123268
123513
|
provider = this.ProviderToUse;
|
|
123269
123514
|
if (!((provider === null || provider === void 0 ? void 0 : provider.ProviderType) !== 'Database')) {
|
|
123270
123515
|
_context3.n = 1;
|
|
@@ -123305,7 +123550,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123305
123550
|
_context3.n = 7;
|
|
123306
123551
|
break;
|
|
123307
123552
|
}
|
|
123308
|
-
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);
|
|
123309
123554
|
return _context3.a(2, false);
|
|
123310
123555
|
case 7:
|
|
123311
123556
|
engine = ResourcePermissionEngine.GetProviderInstance(provider, ResourcePermissionEngine);
|
|
@@ -123319,7 +123564,7 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123319
123564
|
_context3.n = 9;
|
|
123320
123565
|
break;
|
|
123321
123566
|
}
|
|
123322
|
-
this.RecordDenied('You do not have access to this conversation.');
|
|
123567
|
+
this.RecordDenied('You do not have access to this conversation.', resultType);
|
|
123323
123568
|
return _context3.a(2, false);
|
|
123324
123569
|
case 9:
|
|
123325
123570
|
if (!(grant.PermissionLevel === 'Edit' || grant.PermissionLevel === 'Owner')) {
|
|
@@ -123329,19 +123574,20 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123329
123574
|
return _context3.a(2, true);
|
|
123330
123575
|
case 10:
|
|
123331
123576
|
// Only View — block writes.
|
|
123332
|
-
this.RecordDenied('You have view-only access to this conversation.');
|
|
123577
|
+
this.RecordDenied('You have view-only access to this conversation.', resultType);
|
|
123333
123578
|
return _context3.a(2, false);
|
|
123334
123579
|
case 11:
|
|
123335
123580
|
_context3.p = 11;
|
|
123336
123581
|
_t = _context3.v;
|
|
123337
|
-
|
|
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));
|
|
123338
123584
|
// Fail closed — safer to deny than silently allow a compromised write.
|
|
123339
|
-
this.RecordDenied('Unable to verify conversation permissions.');
|
|
123585
|
+
this.RecordDenied('Unable to verify conversation permissions.', resultType);
|
|
123340
123586
|
return _context3.a(2, false);
|
|
123341
123587
|
}
|
|
123342
123588
|
}, _callee3, this, [[2, 11]]);
|
|
123343
123589
|
}));
|
|
123344
|
-
function currentUserMayWrite() {
|
|
123590
|
+
function currentUserMayWrite(_x3) {
|
|
123345
123591
|
return _currentUserMayWrite.apply(this, arguments);
|
|
123346
123592
|
}
|
|
123347
123593
|
return currentUserMayWrite;
|
|
@@ -123369,17 +123615,24 @@ var MJConversationDetailEntityExtended = /*#__PURE__*/function (_MJConversationD
|
|
|
123369
123615
|
return matches;
|
|
123370
123616
|
}
|
|
123371
123617
|
/**
|
|
123372
|
-
*
|
|
123373
|
-
* see
|
|
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`.
|
|
123374
123625
|
*/
|
|
123375
123626
|
}, {
|
|
123376
123627
|
key: "RecordDenied",
|
|
123377
|
-
value: function RecordDenied(message) {
|
|
123378
|
-
var result =
|
|
123379
|
-
|
|
123380
|
-
|
|
123381
|
-
|
|
123382
|
-
|
|
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);
|
|
123383
123636
|
}
|
|
123384
123637
|
}]);
|
|
123385
123638
|
}(MJConversationDetailEntity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/react-runtime",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
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",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/MemberJunction/MJ#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memberjunction/core": "6.1.
|
|
23
|
-
"@memberjunction/global": "6.1.
|
|
24
|
-
"@memberjunction/interactive-component-types": "6.1.
|
|
25
|
-
"@memberjunction/core-entities": "6.1.
|
|
26
|
-
"@memberjunction/graphql-dataprovider": "6.1.
|
|
22
|
+
"@memberjunction/core": "6.1.5",
|
|
23
|
+
"@memberjunction/global": "6.1.5",
|
|
24
|
+
"@memberjunction/interactive-component-types": "6.1.5",
|
|
25
|
+
"@memberjunction/core-entities": "6.1.5",
|
|
26
|
+
"@memberjunction/graphql-dataprovider": "6.1.5",
|
|
27
27
|
"@babel/standalone": "^7.29.1",
|
|
28
28
|
"rxjs": "^7.8.2"
|
|
29
29
|
},
|