@memberjunction/react-runtime 4.2.0 → 4.3.1
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 +11 -11
- package/CHANGELOG.md +22 -0
- package/dist/324.runtime.umd.js +5 -5
- package/dist/runtime.umd.js +1 -1
- package/package.json +11 -9
- package/src/__tests__/cache-manager.test.ts +162 -0
- package/src/__tests__/component-error-analyzer.test.ts +116 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +8 -0
- package/{webpack.umd.config.js → webpack.umd.config.cjs} +4 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
|
|
2
|
-
> @memberjunction/react-runtime@4.
|
|
2
|
+
> @memberjunction/react-runtime@4.3.1 build
|
|
3
3
|
> npm run build:node && npm run build:umd
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @memberjunction/react-runtime@4.
|
|
6
|
+
> @memberjunction/react-runtime@4.3.1 build:node
|
|
7
7
|
> tsc
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @memberjunction/react-runtime@4.
|
|
11
|
-
> webpack --config webpack.umd.config.
|
|
10
|
+
> @memberjunction/react-runtime@4.3.1 build:umd
|
|
11
|
+
> webpack --config webpack.umd.config.cjs
|
|
12
12
|
|
|
13
13
|
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/MJ/MJ/packages/MJCoreEntities/dist/generated/entity_subclasses.js as it exceeds the max of 500KB.
|
|
14
|
-
asset [1m[33mruntime.umd.js[39m[22m [1m[33m2.
|
|
15
|
-
asset [1m[32m324.runtime.umd.js[39m[22m
|
|
14
|
+
asset [1m[33mruntime.umd.js[39m[22m [1m[33m2.21 MiB[39m[22m [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m [1m[33m[big][39m[22m (name: main) 1 related asset
|
|
15
|
+
asset [1m[32m324.runtime.umd.js[39m[22m 112 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m
|
|
16
16
|
asset [1m[32m490.runtime.umd.js[39m[22m 61.7 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m (id hint: vendors)
|
|
17
|
-
orphan modules 5.
|
|
17
|
+
orphan modules 5.38 MiB [1m[33m[orphan][39m[22m 485 modules
|
|
18
18
|
runtime modules 6.94 KiB 10 modules
|
|
19
|
-
cacheable modules 5.
|
|
19
|
+
cacheable modules 5.49 MiB
|
|
20
20
|
modules by path [1m../../../node_modules/[39m[22m 780 KiB
|
|
21
21
|
modules by path [1m../../../node_modules/rxjs/dist/esm5/internal/[39m[22m 29.1 KiB 14 modules
|
|
22
22
|
modules by path [1m../../../node_modules/debug/src/*.js[39m[22m 12.7 KiB 2 modules
|
|
@@ -25,7 +25,7 @@ cacheable modules 5.48 MiB
|
|
|
25
25
|
[1m../../MJCoreEntities/dist/index.js + 22 modules[39m[22m 3.07 MiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
26
26
|
[1m../../MJCoreEntities/dist/engines/UserViewEngine.js[39m[22m 18.7 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
27
27
|
[1m./dist/index.js + 27 modules[39m[22m 420 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
28
|
-
[1m../../MJCore/dist/index.js + 71 modules[39m[22m
|
|
29
|
-
[1m../../GraphQLDataProvider/dist/index.mjs[39m[22m
|
|
28
|
+
[1m../../MJCore/dist/index.js + 71 modules[39m[22m 972 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
29
|
+
[1m../../GraphQLDataProvider/dist/index.mjs[39m[22m 112 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
30
30
|
[1m../../MJGlobal/dist/index.js + 15 modules[39m[22m 180 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
31
|
-
webpack 5.105.0 compiled [1m[32msuccessfully[39m[22m in
|
|
31
|
+
webpack 5.105.0 compiled [1m[32msuccessfully[39m[22m in 127191 ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @memberjunction/react-runtime
|
|
2
2
|
|
|
3
|
+
## 4.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @memberjunction/graphql-dataprovider@4.3.1
|
|
8
|
+
- @memberjunction/interactive-component-types@4.3.1
|
|
9
|
+
- @memberjunction/core@4.3.1
|
|
10
|
+
- @memberjunction/core-entities@4.3.1
|
|
11
|
+
- @memberjunction/global@4.3.1
|
|
12
|
+
|
|
13
|
+
## 4.3.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 7b39671: Fix LocalEmbeddings retry logging with cleaner user-friendly output and resolve ESM compatibility issues for React packages after MJ 4.0 upgrade
|
|
18
|
+
- Updated dependencies [564e1af]
|
|
19
|
+
- @memberjunction/graphql-dataprovider@4.3.0
|
|
20
|
+
- @memberjunction/core@4.3.0
|
|
21
|
+
- @memberjunction/core-entities@4.3.0
|
|
22
|
+
- @memberjunction/interactive-component-types@4.3.0
|
|
23
|
+
- @memberjunction/global@4.3.0
|
|
24
|
+
|
|
3
25
|
## 4.2.0
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/324.runtime.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkMJReactRuntime=this.webpackChunkMJReactRuntime||[]).push([[324],{324(e,t,r){r.r(t),r.d(t,{ActionItemInput:()=>M,ActionItemOutput:()=>L,BrowserIndexedDBStorageProvider:()=>E,BrowserStorageProviderBase:()=>R,FieldMapper:()=>g,GetDataOutput:()=>T,GraphQLAIClient:()=>I,GraphQLActionClient:()=>
|
|
1
|
+
"use strict";(this.webpackChunkMJReactRuntime=this.webpackChunkMJReactRuntime||[]).push([[324],{324(e,t,r){r.r(t),r.d(t,{ActionItemInput:()=>M,ActionItemOutput:()=>L,BrowserIndexedDBStorageProvider:()=>E,BrowserStorageProviderBase:()=>R,FieldMapper:()=>g,GetDataOutput:()=>T,GraphQLAIClient:()=>I,GraphQLActionClient:()=>_,GraphQLComponentRegistryClient:()=>j,GraphQLDataProvider:()=>f,GraphQLEncryptionClient:()=>O,GraphQLFileStorageClient:()=>k,GraphQLProviderConfigData:()=>P,GraphQLSystemUserClient:()=>Q,GraphQLTestingClient:()=>K,GraphQLTransactionGroup:()=>h,GraphQLVersionHistoryClient:()=>J,RoleInput:()=>v,RolesAndUsersInput:()=>N,SimpleRemoteEntity:()=>V,SimpleRemoteEntityField:()=>F,SimpleRemoteEntityOutput:()=>U,SyncDataAction:()=>x,SyncDataResult:()=>G,SyncRolesAndUsersResult:()=>$,UserInput:()=>A,gql:()=>s.J1,setupGraphQLClient:()=>C});var s=r(215),a=r(454),n=r(928),o=r(600),i=r(49),u=r(226),c=r(497),l=r(718),d=r(897),m=r(196),p=Object.defineProperty,y=(e,t)=>p(e,"name",{value:t,configurable:!0});class g{static{y(this,"FieldMapper")}constructor(){this._fieldMap={__mj_CreatedAt:"_mj__CreatedAt",__mj_UpdatedAt:"_mj__UpdatedAt",__mj_DeletedAt:"_mj__DeletedAt"}}MapFields(e){if(e)for(const t in e)t in this._fieldMap&&(e[this._fieldMap[t]]=e[t],delete e[t]);return e}MapFieldName(e){return this._fieldMap[e]??e}ReverseMapFieldName(e){return Object.entries(this._fieldMap).find(([t,r])=>r===e)?.[0]??e}ReverseMapFields(e){const t=Object.fromEntries(Object.entries(this._fieldMap).map(([e,t])=>[t,e]));for(const r in e)r in t&&(e[t[r]]=e[r],delete e[r]);return e}}class h extends a.VH{static{y(this,"GraphQLTransactionGroup")}constructor(e){super(),this._provider=e}async HandleSubmit(){const e=s.J1`
|
|
2
2
|
mutation ExecuteTransactionGroup($group: TransactionInputType!) {
|
|
3
3
|
ExecuteTransactionGroup(group: $group) {
|
|
4
4
|
Success
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
}`,r={EntityName:e.EntityName,SurvivingRecordCompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(e.SurvivingRecordCompositeKey.KeyValuePairs)},FieldMap:e.FieldMap?.map(e=>({FieldName:e.FieldName,Value:e.Value.toString()})),RecordsToMerge:e.RecordsToMerge.map(e=>e.Copy())};return(await this.ExecuteGQL(t,{request:r}))?.MergeRecords}catch(t){return(0,a.ZI)(t),{Success:!1,OverallStatus:t&&t.message?t.message:t,RecordStatus:[],RecordMergeLogID:"",Request:e}}}async Save(e,t,r){if(r?.IsParentEntitySave){const t=new a.KV;return t.StartedAt=new Date,t.EndedAt=new Date,t.Type=e.IsSaved?"update":"create",t.Success=!0,t.NewValues=e.GetAll(),e.ResultHistory.push(t),t.NewValues}const n=new a.KV;try{e.RegisterTransactionPreprocessing();const t={input:{}},o=e.IsSaved?"Update":"Create";n.StartedAt=new Date,n.Type=e.IsSaved?"update":"create",n.OriginalValues=e.Fields.map(e=>({FieldName:e.CodeName,Value:e.Value})),e.ResultHistory.push(n);const i=(0,a.I)(e.EntityInfo),u=`${o}${i}`,c=e.Fields.filter(t=>!t.ReadOnly||t.IsPrimaryKey&&e.IsSaved),l=new g,d=` ${u}(input: $input) {\n ${e.Fields.map(e=>l.MapFieldName(e.CodeName)).join("\n ")}\n }`,m=s.J1`mutation ${o}${i} ($input: ${u}Input!) {
|
|
343
343
|
${d}
|
|
344
344
|
}
|
|
345
|
-
`;for(let
|
|
345
|
+
`;for(let r=0;r<c.length;r++){const s=c[r];let n=e.Get(s.Name);if(n)switch(s.EntityFieldInfo.TSType){case a.$S.Date:n=n.getTime();break;case a.$S.Boolean:"boolean"!=typeof n&&(n=0!==parseInt(n));break;case a.$S.Number:if("number"!=typeof n){const e=Number(n);isNaN(e)||(n=e)}}null===n&&!1===s.EntityFieldInfo.AllowsNull&&(n=null!==s.EntityFieldInfo.DefaultValue?s.EntityFieldInfo.DefaultValue:s.FieldType===a.$S.Number||s.FieldType===a.$S.Boolean?0:""),t.input[s.CodeName]=n}if("update"===o.trim().toLowerCase()&&!1===r.SkipOldValuesCheck){const r=[];e.Fields.forEach(e=>{let t=null;null!==e.OldValue&&void 0!==e.OldValue&&(t=e.EntityFieldInfo.TSType===a.$S.Date?e.OldValue.getTime().toString():e.EntityFieldInfo.TSType===a.$S.Boolean?!0===e.OldValue?"1":"0":"string"!=typeof e.OldValue?e.OldValue.toString():e.OldValue),r.push({Key:e.CodeName,Value:t})}),t.input.OldValues___=r}if(e.TransactionGroup){const r=[{varName:"input",inputType:u+"Input!"}];return e.RaiseReadyForTransaction(),e.TransactionGroup.AddTransaction(new a.U1(e,"create"===n.Type?"Create":"Update",d,t,{mutationName:u,mutationInputTypes:r},(e,t)=>{n.EndedAt=new Date,t&&e?(n.Success=!0,n.NewValues=this.ConvertBackToMJFields(e)):(n.Success=!1,n.Message="Transaction failed")})),!0}{const r=await this.ExecuteGQL(m,t);if(r&&r[u])return n.Success=!0,n.EndedAt=new Date,n.NewValues=this.ConvertBackToMJFields(r[u]),n.NewValues;throw new Error(`Save failed for ${e.EntityInfo.ClassName}`)}}catch(e){return n.Success=!1,n.EndedAt=new Date,n.Message=e.response?.errors?.length>0?e.response.errors[0].message:e.message,(0,a.ZI)(e),null}}async Load(e,t,r=null,n){try{const n={};let o="",i="";for(let r=0;r<t.KeyValuePairs.length;r++){const s=e.Fields.find(e=>e.Name.trim().toLowerCase()===t.KeyValuePairs[r].FieldName.trim().toLowerCase()).EntityFieldInfo,u=t.GetValueByIndex(r),c=s.GraphQLType;if(i.length>0&&(i+=", "),i+=`$${s.CodeName}: ${c}!`,o.length>0&&(o+=", "),o+=`${s.CodeName}: $${s.CodeName}`,s.TSType===a.$S.Number){if(isNaN(t.GetValueByIndex(r)))throw new Error(`Primary Key value ${u} (${s.Name}) is not a valid number`);n[s.CodeName]=parseInt(u)}else n[s.CodeName]=u}const u=r&&r.length>0?this.getRelatedEntityString(e.EntityInfo,r):"",c=(0,a.I)(e.EntityInfo),l=(new g,s.J1`query Single${c}${u.length>0?"Full":""} (${i}) {
|
|
346
346
|
${c}(${o}) {
|
|
347
347
|
${e.Fields.filter(e=>!e.EntityFieldInfo.IsBinaryFieldType).map(e=>e.EntityFieldInfo.Name.trim().toLowerCase().startsWith("__mj_")?e.CodeName.replace("__mj_","_mj__"):e.CodeName).join("\n ")}
|
|
348
348
|
${u}
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
EntityName
|
|
401
401
|
RecordName
|
|
402
402
|
}
|
|
403
|
-
}`,r=await this.ExecuteGQL(t,{info:e.map(e=>({EntityName:e.EntityName,CompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(e.CompositeKey.KeyValuePairs)}}))});return r&&r.GetEntityRecordNames?r.GetEntityRecordNames:void 0}async GetDataContextData(e){try{const t=s.J1`query GetDataContextData ($DataContextID: String!) {
|
|
403
|
+
}`,r=await this.ExecuteGQL(t,{info:e.map(e=>({EntityName:e.EntityName,CompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(e.CompositeKey.KeyValuePairs)}}))});return r&&r.GetEntityRecordNames?r.GetEntityRecordNames.map(e=>({...e,CompositeKey:new a.BT(e.CompositeKey.KeyValuePairs)})):void 0}async GetDataContextData(e){try{const t=s.J1`query GetDataContextData ($DataContextID: String!) {
|
|
404
404
|
GetDataContextData(DataContextID: $DataContextID) {
|
|
405
405
|
Success
|
|
406
406
|
ErrorMessages
|
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
sessionId
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
`,n=new i.B,c=this.getOrCreateWSClient(),l=new u.yU;return l.add(new o.c(t=>{const r=c.subscribe({query:a,variables:{sessionId:e}},{next:y(r=>{const s=this._pushStatusSubjects.get(e);s&&(s.lastEmissionAt=Date.now()),t.next(r.data.statusUpdates.message)},"next"),error:y(async e=>{const r=e;if("JWT_EXPIRED"===r?.extensions?.code||r?.message?.includes("token has expired")||r?.message?.includes("JWT_EXPIRED")){console.log("[GraphQLDataProvider] PushStatusUpdates JWT token expired, refreshing and reconnecting...");try{await this.RefreshToken(),this.disposeWSClient(),t.complete()}catch(e){console.error("[GraphQLDataProvider] Failed to refresh token for PushStatusUpdates:",e),t.error(e)}}else t.error(e)},"error"),complete:y(()=>{t.complete()},"complete")});return this._activeSubscriptionCount++,()=>{this._activeSubscriptionCount--,r()}}).subscribe({next:y(e=>n.next(e),"next"),error:y(t=>{n.error(t),this._pushStatusSubjects.delete(e)},"error"),complete:y(()=>{n.complete(),this._pushStatusSubjects.delete(e)},"complete")})),this._pushStatusSubjects.set(e,{subject:n,subscription:l,createdAt:t,lastRequestedAt:t,lastEmissionAt:t,activeSubscribers:0}),new o.c(t=>{const r=this._pushStatusSubjects.get(e);r&&r.activeSubscribers++;const s=n.subscribe(t);return()=>{const t=this._pushStatusSubjects.get(e);t&&t.activeSubscribers>0&&t.activeSubscribers--,s.unsubscribe()}})}disposeWebSocketResources(){this._subscriptionCleanupTimer&&(clearInterval(this._subscriptionCleanupTimer),this._subscriptionCleanupTimer=null),this.completeAllSubjects(),this._activeSubscriptionCount=0,this.disposeWSClient()}}async function C(e){const t=new f;return(0,a.YE)(t),await t.Config(e),await a.jF.Instance.Startup(),d.rt.Instance.RaiseEvent({event:d.UK.LoggedIn,eventCode:null,component:this,args:null}),t}y(C,"setupGraphQLClient");class ${static{y(this,"SyncRolesAndUsersResult")}}class v{static{y(this,"RoleInput")}}class A{static{y(this,"UserInput")}}class N{static{y(this,"RolesAndUsersInput")}}var b,x=((b=x||{}).Create="Create",b.Update="Update",b.CreateOrUpdate="CreateOrUpdate",b.Delete="Delete",b.DeleteWithFilter="DeleteWithFilter",b);class M{static{y(this,"ActionItemInput")}}class G{static{y(this,"SyncDataResult")}constructor(){this.Results=[]}}class L{static{y(this,"ActionItemOutput")}}class Q{static{y(this,"GraphQLSystemUserClient")}get Client(){return this._client}constructor(e,t,r,a){const n={"x-session-id":r};this._sessionId=r,t&&(n.authorization="Bearer "+t),a&&(n["x-mj-api-key"]=a),this._client=new s.l4(e,{headers:n})}async GetData(e,t){try{const r=await this.Client.request("query GetData($input: GetDataInputType!) {\n GetData(input: $input) {\n Success\n ErrorMessages\n Queries\n Results\n }\n }",{input:{Queries:e,Token:t}});return r&&r.GetData?{Success:r.GetData.Success,Results:r.GetData.Results.map(e=>e?(0,d.NG)(e):null),ErrorMessages:r.GetData.ErrorMessages,Queries:r.GetData.Queries}:{Success:!1,Results:[],ErrorMessages:r.GetData?.ErrorMessages??["Unknown error"],Queries:r.GetData?.Queries??e}}catch(t){let r=t instanceof Error?t.message:String(t);const s=r.match(/Error: ([^:]+)\./);if(s&&(r=s[1]+"."),(0,a.l9)()){const e=`GraphQLSystemUserClient::GetData - Error getting data - ${t}`;(0,a.ZI)(e)}return{Success:!1,Results:[],ErrorMessages:[r],Queries:e}}}async GetAllRemoteEntities(){try{const e=await this.Client.request("query GetAllEntities {\n GetAllEntities {\n Success\n ErrorMessage\n Results {\n ID\n Name\n Description\n SchemaName\n BaseView\n BaseTable\n CodeName\n ClassName\n Fields {\n ID\n Name\n Description\n Type\n AllowsNull\n MaxLength\n }\n }\n }\n }");return e&&e.GetAllEntities?e.GetAllEntities:{Success:!1,Results:[],ErrorMessage:e.GetAllEntities?.ErrorMessage??"Unknown error"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::GetAllRemoteEntities - Error getting remote entities - ${e}`),{Success:!1,Results:[],ErrorMessage:e}}}async SyncData(e){try{const t=await this.Client.request("mutation SyncData($items: [ActionItemInputType!]!) {\n SyncData(items: $items) {\n Success\n Results {\n Success\n ErrorMessage\n EntityName\n Type\n PrimaryKey {\n KeyValuePairs {\n FieldName\n Value \n }\n }\n AlternateKey {\n KeyValuePairs {\n FieldName\n Value \n }\n }\n DeleteFilter\n RecordJSON\n }\n }\n }",{items:e});return t&&t.SyncData?t.SyncData:{Success:!1,Results:[]}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::SyncData - Error syncing data - ${e}`),{Success:!1,Results:[]}}}async SyncRolesAndUsers(e){try{const t=await this.Client.request("mutation SyncRolesAndUsers($data: RolesAndUsersInputType!) {\n SyncRolesAndUsers(data: $data) {\n Success\n }\n }",{data:e});return t&&t.SyncRolesAndUsers?t.SyncRolesAndUsers:{Success:!1}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::SyncRolesAndUsers - Error syncing roles and users - ${e}`),{Success:!1}}}async RunViewByName(e){try{const t=await this.Client.request("query RunViewByNameSystemUser($input: RunViewByNameInput!) {\n RunViewByNameSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewByNameSystemUser?t.RunViewByNameSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by name"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewByNameSystemUser - Error running view by name - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunViewByID(e){try{const t=await this.Client.request("query RunViewByIDSystemUser($input: RunViewByIDInput!) {\n RunViewByIDSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewByIDSystemUser?t.RunViewByIDSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by ID"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewByIDSystemUser - Error running view by ID - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunDynamicView(e){try{const t=await this.Client.request("query RunDynamicViewSystemUser($input: RunDynamicViewInput!) {\n RunDynamicViewSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunDynamicViewSystemUser?t.RunDynamicViewSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute dynamic view"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunDynamicViewSystemUser - Error running dynamic view - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunViews(e){try{const t=await this.Client.request("query RunViewsSystemUser($input: [RunViewGenericInput!]!) {\n RunViewsSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewsSystemUser?t.RunViewsSystemUser:[]}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewsSystemUser - Error running views - ${e}`),[]}}async GetQueryData(e){try{if(void 0!==e.Parameters&&Array.isArray(e.Parameters))throw new Error("Parameters must be a JSON object, not an array. Use {} for empty parameters instead of [].");const t="query GetQueryDataSystemUser($QueryID: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {\n GetQueryDataSystemUser(QueryID: $QueryID, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {\n QueryID\n QueryName\n Success\n Results\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n AppliedParameters\n }\n }",r={QueryID:e.QueryID};void 0!==e.CategoryID&&(r.CategoryID=e.CategoryID),void 0!==e.CategoryPath&&(r.CategoryPath=e.CategoryPath),void 0!==e.Parameters&&(r.Parameters=e.Parameters),void 0!==e.MaxRows&&(r.MaxRows=e.MaxRows),void 0!==e.StartRow&&(r.StartRow=e.StartRow);const s=await this.Client.request(t,r);return s&&s.GetQueryDataSystemUser?{...s.GetQueryDataSystemUser,Results:s.GetQueryDataSystemUser.Results?(0,d.NG)(s.GetQueryDataSystemUser.Results):null}:{QueryID:e.QueryID,QueryName:"",Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:"Query execution failed"}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::GetQueryDataSystemUser - Error executing query - ${t}`),{QueryID:e.QueryID,QueryName:"",Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:t.toString()}}}async GetQueryDataByName(e){try{if(void 0!==e.Parameters&&Array.isArray(e.Parameters))throw new Error("Parameters must be a JSON object, not an array. Use {} for empty parameters instead of [].");const t="query GetQueryDataByNameSystemUser($QueryName: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {\n GetQueryDataByNameSystemUser(QueryName: $QueryName, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {\n QueryID\n QueryName\n Success\n Results\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n AppliedParameters\n }\n }",r={QueryName:e.QueryName};void 0!==e.CategoryID&&(r.CategoryID=e.CategoryID),void 0!==e.CategoryPath&&(r.CategoryPath=e.CategoryPath),void 0!==e.Parameters&&(r.Parameters=e.Parameters),void 0!==e.MaxRows&&(r.MaxRows=e.MaxRows),void 0!==e.StartRow&&(r.StartRow=e.StartRow);const s=await this.Client.request(t,r);return s&&s.GetQueryDataByNameSystemUser?{...s.GetQueryDataByNameSystemUser,Results:s.GetQueryDataByNameSystemUser.Results?(0,d.NG)(s.GetQueryDataByNameSystemUser.Results):null}:{QueryID:"",QueryName:e.QueryName,Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:"Query execution failed"}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::GetQueryDataByNameSystemUser - Error executing query - ${t}`),{QueryID:"",QueryName:e.QueryName,Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:t.toString()}}}async CreateQuery(e){try{const t=await this.Client.request("mutation CreateQuerySystemUser($input: CreateQuerySystemUserInput!) {\n CreateQuerySystemUser(input: $input) {\n Success\n ErrorMessage\n ID\n Name\n Description\n CategoryID\n Category\n SQL\n Status\n QualityRank\n EmbeddingVector\n EmbeddingModelID\n EmbeddingModelName\n Fields {\n ID\n QueryID\n Name\n Description\n Sequence\n SQLBaseType\n SQLFullType\n SourceEntityID\n SourceEntity\n SourceFieldName\n IsComputed\n ComputationDescription\n IsSummary\n SummaryDescription\n }\n Parameters {\n ID\n QueryID\n Name\n Description\n Type\n IsRequired\n DefaultValue\n SampleValue\n ValidationFilters\n }\n Entities {\n ID\n QueryID\n EntityID\n Entity\n }\n Permissions {\n ID\n QueryID\n RoleID\n Role\n }\n }\n }",{input:e});return t&&t.CreateQuerySystemUser?t.CreateQuerySystemUser:{Success:!1,ErrorMessage:"Failed to create query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::CreateQuery - Error creating query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async UpdateQuery(e){try{const t=await this.Client.request("mutation UpdateQuerySystemUser($input: UpdateQuerySystemUserInput!) {\n UpdateQuerySystemUser(input: $input) {\n Success\n ErrorMessage\n ID\n Name\n Description\n CategoryID\n Category\n SQL\n Status\n QualityRank\n EmbeddingVector\n EmbeddingModelID\n EmbeddingModelName\n Fields {\n ID\n QueryID\n Name\n Description\n Sequence\n SQLBaseType\n SQLFullType\n SourceEntityID\n SourceEntity\n SourceFieldName\n IsComputed\n ComputationDescription\n IsSummary\n SummaryDescription\n }\n Parameters {\n ID\n QueryID\n Name\n Description\n Type\n IsRequired\n DefaultValue\n SampleValue\n ValidationFilters\n }\n Entities {\n ID\n QueryID\n EntityID\n Entity\n }\n Permissions {\n ID\n QueryID\n RoleID\n Role\n }\n }\n }",{input:e});return t&&t.UpdateQuerySystemUser?t.UpdateQuerySystemUser:{Success:!1,ErrorMessage:"Failed to update query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::UpdateQuery - Error updating query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async DeleteQuery(e,t){try{if(!e||""===e.trim())return(0,a.ZI)("GraphQLSystemUserClient::DeleteQuery - Invalid query ID: ID cannot be null or empty"),{Success:!1,ErrorMessage:"Invalid query ID: ID cannot be null or empty"};const r="mutation DeleteQuerySystemResolver($ID: String!, $options: DeleteOptionsInput) {\n DeleteQuerySystemResolver(ID: $ID, options: $options) {\n Success\n ErrorMessage\n ID\n Name\n }\n }",s={ID:e};void 0!==t&&(s.options=t);const n=await this.Client.request(r,s);return n&&n.DeleteQuerySystemResolver?n.DeleteQuerySystemResolver:{Success:!1,ErrorMessage:"Failed to delete query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::DeleteQuery - Error deleting query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async RunAIPrompt(e){try{const t=s.J1`
|
|
422
|
+
`,n=new i.B,c=this.getOrCreateWSClient(),l=new u.yU;return l.add(new o.c(t=>{const r=c.subscribe({query:a,variables:{sessionId:e}},{next:y(r=>{const s=this._pushStatusSubjects.get(e);s&&(s.lastEmissionAt=Date.now()),t.next(r.data.statusUpdates.message)},"next"),error:y(async e=>{const r=e;if("JWT_EXPIRED"===r?.extensions?.code||r?.message?.includes("token has expired")||r?.message?.includes("JWT_EXPIRED")){console.log("[GraphQLDataProvider] PushStatusUpdates JWT token expired, refreshing and reconnecting...");try{await this.RefreshToken(),this.disposeWSClient(),t.complete()}catch(e){console.error("[GraphQLDataProvider] Failed to refresh token for PushStatusUpdates:",e),t.error(e)}}else t.error(e)},"error"),complete:y(()=>{t.complete()},"complete")});return this._activeSubscriptionCount++,()=>{this._activeSubscriptionCount--,r()}}).subscribe({next:y(e=>n.next(e),"next"),error:y(t=>{n.error(t),this._pushStatusSubjects.delete(e)},"error"),complete:y(()=>{n.complete(),this._pushStatusSubjects.delete(e)},"complete")})),this._pushStatusSubjects.set(e,{subject:n,subscription:l,createdAt:t,lastRequestedAt:t,lastEmissionAt:t,activeSubscribers:0}),new o.c(t=>{const r=this._pushStatusSubjects.get(e);r&&r.activeSubscribers++;const s=n.subscribe(t);return()=>{const t=this._pushStatusSubjects.get(e);t&&t.activeSubscribers>0&&t.activeSubscribers--,s.unsubscribe()}})}disposeWebSocketResources(){this._subscriptionCleanupTimer&&(clearInterval(this._subscriptionCleanupTimer),this._subscriptionCleanupTimer=null),this.completeAllSubjects(),this._activeSubscriptionCount=0,this.disposeWSClient()}async FindISAChildEntity(e,t,r){if(!e.IsParentType)return null;try{const r=await this.ExecuteGQL("query FindISAChildEntity($EntityName: String!, $RecordID: String!) {\n FindISAChildEntity(EntityName: $EntityName, RecordID: $RecordID) {\n Success\n ChildEntityName\n ErrorMessage\n }\n }",{EntityName:e.Name,RecordID:t});return r?.FindISAChildEntity?.Success&&r.FindISAChildEntity.ChildEntityName?{ChildEntityName:r.FindISAChildEntity.ChildEntityName}:null}catch(t){return(0,a.ZI)(`FindISAChildEntity failed for ${e.Name}: ${t}`),null}}}async function C(e){const t=new f;return(0,a.YE)(t),await t.Config(e),await a.jF.Instance.Startup(),d.rt.Instance.RaiseEvent({event:d.UK.LoggedIn,eventCode:null,component:this,args:null}),t}y(C,"setupGraphQLClient");class ${static{y(this,"SyncRolesAndUsersResult")}}class v{static{y(this,"RoleInput")}}class A{static{y(this,"UserInput")}}class N{static{y(this,"RolesAndUsersInput")}}var b,x=((b=x||{}).Create="Create",b.Update="Update",b.CreateOrUpdate="CreateOrUpdate",b.Delete="Delete",b.DeleteWithFilter="DeleteWithFilter",b);class M{static{y(this,"ActionItemInput")}}class G{static{y(this,"SyncDataResult")}constructor(){this.Results=[]}}class L{static{y(this,"ActionItemOutput")}}class Q{static{y(this,"GraphQLSystemUserClient")}get Client(){return this._client}constructor(e,t,r,a){const n={"x-session-id":r};this._sessionId=r,t&&(n.authorization="Bearer "+t),a&&(n["x-mj-api-key"]=a),this._client=new s.l4(e,{headers:n})}async GetData(e,t){try{const r=await this.Client.request("query GetData($input: GetDataInputType!) {\n GetData(input: $input) {\n Success\n ErrorMessages\n Queries\n Results\n }\n }",{input:{Queries:e,Token:t}});return r&&r.GetData?{Success:r.GetData.Success,Results:r.GetData.Results.map(e=>e?(0,d.NG)(e):null),ErrorMessages:r.GetData.ErrorMessages,Queries:r.GetData.Queries}:{Success:!1,Results:[],ErrorMessages:r.GetData?.ErrorMessages??["Unknown error"],Queries:r.GetData?.Queries??e}}catch(t){let r=t instanceof Error?t.message:String(t);const s=r.match(/Error: ([^:]+)\./);if(s&&(r=s[1]+"."),(0,a.l9)()){const e=`GraphQLSystemUserClient::GetData - Error getting data - ${t}`;(0,a.ZI)(e)}return{Success:!1,Results:[],ErrorMessages:[r],Queries:e}}}async GetAllRemoteEntities(){try{const e=await this.Client.request("query GetAllEntities {\n GetAllEntities {\n Success\n ErrorMessage\n Results {\n ID\n Name\n Description\n SchemaName\n BaseView\n BaseTable\n CodeName\n ClassName\n Fields {\n ID\n Name\n Description\n Type\n AllowsNull\n MaxLength\n }\n }\n }\n }");return e&&e.GetAllEntities?e.GetAllEntities:{Success:!1,Results:[],ErrorMessage:e.GetAllEntities?.ErrorMessage??"Unknown error"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::GetAllRemoteEntities - Error getting remote entities - ${e}`),{Success:!1,Results:[],ErrorMessage:e}}}async SyncData(e){try{const t=await this.Client.request("mutation SyncData($items: [ActionItemInputType!]!) {\n SyncData(items: $items) {\n Success\n Results {\n Success\n ErrorMessage\n EntityName\n Type\n PrimaryKey {\n KeyValuePairs {\n FieldName\n Value \n }\n }\n AlternateKey {\n KeyValuePairs {\n FieldName\n Value \n }\n }\n DeleteFilter\n RecordJSON\n }\n }\n }",{items:e});return t&&t.SyncData?t.SyncData:{Success:!1,Results:[]}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::SyncData - Error syncing data - ${e}`),{Success:!1,Results:[]}}}async SyncRolesAndUsers(e){try{const t=await this.Client.request("mutation SyncRolesAndUsers($data: RolesAndUsersInputType!) {\n SyncRolesAndUsers(data: $data) {\n Success\n }\n }",{data:e});return t&&t.SyncRolesAndUsers?t.SyncRolesAndUsers:{Success:!1}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::SyncRolesAndUsers - Error syncing roles and users - ${e}`),{Success:!1}}}async RunViewByName(e){try{const t=await this.Client.request("query RunViewByNameSystemUser($input: RunViewByNameInput!) {\n RunViewByNameSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewByNameSystemUser?t.RunViewByNameSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by name"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewByNameSystemUser - Error running view by name - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunViewByID(e){try{const t=await this.Client.request("query RunViewByIDSystemUser($input: RunViewByIDInput!) {\n RunViewByIDSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewByIDSystemUser?t.RunViewByIDSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by ID"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewByIDSystemUser - Error running view by ID - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunDynamicView(e){try{const t=await this.Client.request("query RunDynamicViewSystemUser($input: RunDynamicViewInput!) {\n RunDynamicViewSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunDynamicViewSystemUser?t.RunDynamicViewSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute dynamic view"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunDynamicViewSystemUser - Error running dynamic view - ${e}`),{Results:[],Success:!1,ErrorMessage:e.toString()}}}async RunViews(e){try{const t=await this.Client.request("query RunViewsSystemUser($input: [RunViewGenericInput!]!) {\n RunViewsSystemUser(input: $input) {\n Results {\n PrimaryKey {\n FieldName\n Value\n }\n EntityID\n Data\n }\n UserViewRunID\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n Success\n }\n }",{input:e});return t&&t.RunViewsSystemUser?t.RunViewsSystemUser:[]}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::RunViewsSystemUser - Error running views - ${e}`),[]}}async GetQueryData(e){try{if(void 0!==e.Parameters&&Array.isArray(e.Parameters))throw new Error("Parameters must be a JSON object, not an array. Use {} for empty parameters instead of [].");const t="query GetQueryDataSystemUser($QueryID: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {\n GetQueryDataSystemUser(QueryID: $QueryID, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {\n QueryID\n QueryName\n Success\n Results\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n AppliedParameters\n }\n }",r={QueryID:e.QueryID};void 0!==e.CategoryID&&(r.CategoryID=e.CategoryID),void 0!==e.CategoryPath&&(r.CategoryPath=e.CategoryPath),void 0!==e.Parameters&&(r.Parameters=e.Parameters),void 0!==e.MaxRows&&(r.MaxRows=e.MaxRows),void 0!==e.StartRow&&(r.StartRow=e.StartRow);const s=await this.Client.request(t,r);return s&&s.GetQueryDataSystemUser?{...s.GetQueryDataSystemUser,Results:s.GetQueryDataSystemUser.Results?(0,d.NG)(s.GetQueryDataSystemUser.Results):null}:{QueryID:e.QueryID,QueryName:"",Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:"Query execution failed"}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::GetQueryDataSystemUser - Error executing query - ${t}`),{QueryID:e.QueryID,QueryName:"",Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:t.toString()}}}async GetQueryDataByName(e){try{if(void 0!==e.Parameters&&Array.isArray(e.Parameters))throw new Error("Parameters must be a JSON object, not an array. Use {} for empty parameters instead of [].");const t="query GetQueryDataByNameSystemUser($QueryName: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {\n GetQueryDataByNameSystemUser(QueryName: $QueryName, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {\n QueryID\n QueryName\n Success\n Results\n RowCount\n TotalRowCount\n ExecutionTime\n ErrorMessage\n AppliedParameters\n }\n }",r={QueryName:e.QueryName};void 0!==e.CategoryID&&(r.CategoryID=e.CategoryID),void 0!==e.CategoryPath&&(r.CategoryPath=e.CategoryPath),void 0!==e.Parameters&&(r.Parameters=e.Parameters),void 0!==e.MaxRows&&(r.MaxRows=e.MaxRows),void 0!==e.StartRow&&(r.StartRow=e.StartRow);const s=await this.Client.request(t,r);return s&&s.GetQueryDataByNameSystemUser?{...s.GetQueryDataByNameSystemUser,Results:s.GetQueryDataByNameSystemUser.Results?(0,d.NG)(s.GetQueryDataByNameSystemUser.Results):null}:{QueryID:"",QueryName:e.QueryName,Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:"Query execution failed"}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::GetQueryDataByNameSystemUser - Error executing query - ${t}`),{QueryID:"",QueryName:e.QueryName,Success:!1,Results:null,RowCount:0,TotalRowCount:0,ExecutionTime:0,ErrorMessage:t.toString()}}}async CreateQuery(e){try{const t=await this.Client.request("mutation CreateQuerySystemUser($input: CreateQuerySystemUserInput!) {\n CreateQuerySystemUser(input: $input) {\n Success\n ErrorMessage\n ID\n Name\n Description\n CategoryID\n Category\n SQL\n Status\n QualityRank\n EmbeddingVector\n EmbeddingModelID\n EmbeddingModelName\n Fields {\n ID\n QueryID\n Name\n Description\n Sequence\n SQLBaseType\n SQLFullType\n SourceEntityID\n SourceEntity\n SourceFieldName\n IsComputed\n ComputationDescription\n IsSummary\n SummaryDescription\n }\n Parameters {\n ID\n QueryID\n Name\n Description\n Type\n IsRequired\n DefaultValue\n SampleValue\n ValidationFilters\n }\n Entities {\n ID\n QueryID\n EntityID\n Entity\n }\n Permissions {\n ID\n QueryID\n RoleID\n Role\n }\n }\n }",{input:e});return t&&t.CreateQuerySystemUser?t.CreateQuerySystemUser:{Success:!1,ErrorMessage:"Failed to create query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::CreateQuery - Error creating query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async UpdateQuery(e){try{const t=await this.Client.request("mutation UpdateQuerySystemUser($input: UpdateQuerySystemUserInput!) {\n UpdateQuerySystemUser(input: $input) {\n Success\n ErrorMessage\n ID\n Name\n Description\n CategoryID\n Category\n SQL\n Status\n QualityRank\n EmbeddingVector\n EmbeddingModelID\n EmbeddingModelName\n Fields {\n ID\n QueryID\n Name\n Description\n Sequence\n SQLBaseType\n SQLFullType\n SourceEntityID\n SourceEntity\n SourceFieldName\n IsComputed\n ComputationDescription\n IsSummary\n SummaryDescription\n }\n Parameters {\n ID\n QueryID\n Name\n Description\n Type\n IsRequired\n DefaultValue\n SampleValue\n ValidationFilters\n }\n Entities {\n ID\n QueryID\n EntityID\n Entity\n }\n Permissions {\n ID\n QueryID\n RoleID\n Role\n }\n }\n }",{input:e});return t&&t.UpdateQuerySystemUser?t.UpdateQuerySystemUser:{Success:!1,ErrorMessage:"Failed to update query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::UpdateQuery - Error updating query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async DeleteQuery(e,t){try{if(!e||""===e.trim())return(0,a.ZI)("GraphQLSystemUserClient::DeleteQuery - Invalid query ID: ID cannot be null or empty"),{Success:!1,ErrorMessage:"Invalid query ID: ID cannot be null or empty"};const r="mutation DeleteQuerySystemResolver($ID: String!, $options: DeleteOptionsInput) {\n DeleteQuerySystemResolver(ID: $ID, options: $options) {\n Success\n ErrorMessage\n ID\n Name\n }\n }",s={ID:e};void 0!==t&&(s.options=t);const n=await this.Client.request(r,s);return n&&n.DeleteQuerySystemResolver?n.DeleteQuerySystemResolver:{Success:!1,ErrorMessage:"Failed to delete query"}}catch(e){return(0,a.ZI)(`GraphQLSystemUserClient::DeleteQuery - Error deleting query - ${e}`),{Success:!1,ErrorMessage:e.toString()}}}async RunAIPrompt(e){try{const t=s.J1`
|
|
423
423
|
query RunAIPromptSystemUser(
|
|
424
424
|
$promptId: String!,
|
|
425
425
|
$data: String,
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
error
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
`,r={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this.Client.request(t,r);if(!a?.EmbedTextSystemUser)return{embeddings:(Array.isArray(e.textToEmbed),[]),modelName:"Unknown",vectorDimensions:0,error:"Failed to generate embeddings as system user"};const n=a.EmbedTextSystemUser;return{embeddings:Array.isArray(e.textToEmbed)?n.embeddings:n.embeddings[0],modelName:n.modelName,vectorDimensions:n.vectorDimensions,error:n.error}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::EmbedText - Error generating embeddings - ${t}`),{embeddings:(Array.isArray(e.textToEmbed),[]),modelName:"Unknown",vectorDimensions:0,error:t.toString()}}}}class T{static{y(this,"GetDataOutput")}}class U{static{y(this,"SimpleRemoteEntityOutput")}}class V{static{y(this,"SimpleRemoteEntity")}}class
|
|
546
|
+
`,r={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this.Client.request(t,r);if(!a?.EmbedTextSystemUser)return{embeddings:(Array.isArray(e.textToEmbed),[]),modelName:"Unknown",vectorDimensions:0,error:"Failed to generate embeddings as system user"};const n=a.EmbedTextSystemUser;return{embeddings:Array.isArray(e.textToEmbed)?n.embeddings:n.embeddings[0],modelName:n.modelName,vectorDimensions:n.vectorDimensions,error:n.error}}catch(t){return(0,a.ZI)(`GraphQLSystemUserClient::EmbedText - Error generating embeddings - ${t}`),{embeddings:(Array.isArray(e.textToEmbed),[]),modelName:"Unknown",vectorDimensions:0,error:t.toString()}}}}class T{static{y(this,"GetDataOutput")}}class U{static{y(this,"SimpleRemoteEntityOutput")}}class V{static{y(this,"SimpleRemoteEntity")}}class F{static{y(this,"SimpleRemoteEntityField")}}class _{static{y(this,"GraphQLActionClient")}constructor(e){this._dataProvider=e}async RunAction(e,t,r=!1){try{const s=this.serializeActionParameters(t),a=this.createActionVariables(e,s,r),n=await this.executeActionMutation(a);return this.processActionResult(n,t)}catch(e){return this.handleActionError(e,t)}}serializeActionParameters(e){if(e)return e.map(e=>{let t=e.Value;return null!=t&&"object"==typeof t&&(t=JSON.stringify(t)),{...e,Value:t}})}createActionVariables(e,t,r=!1){return{input:{ActionID:e,Params:t,SkipActionLog:r}}}async executeActionMutation(e){const t=s.J1`
|
|
547
547
|
mutation RunAction($input: RunActionInput!) {
|
|
548
548
|
RunAction(input: $input) {
|
|
549
549
|
Success
|