@memberjunction/graphql-dataprovider 2.117.0 → 2.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +79 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +173 -1
- package/dist/index.d.mts +173 -1
- package/dist/index.mjs +99 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Re=Object.defineProperty;var f=(D,e)=>Re(D,"name",{value:e,configurable:!0});var R,m=require("graphql-request"),u=require("@memberjunction/core"),me=require("@memberjunction/core-entities"),Ie=require("@tempfix/idb"),ge=require("rxjs"),pe=require("graphql-ws"),De=require("uuid"),w=require("@memberjunction/global");const J=class J{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(([r,s])=>[s,r]));for(const r in e)r in t&&(e[t[r]]=e[r],delete e[r]);return e}};f(J,"FieldMapper");let $=J;const j=class j extends u.TransactionGroupBase{constructor(e){super(),this._provider=e}async HandleSubmit(){const e=m.gql`
|
|
2
2
|
mutation ExecuteTransactionGroup($group: TransactionInputType!) {
|
|
3
3
|
ExecuteTransactionGroup(group: $group) {
|
|
4
4
|
Success
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
ResultsJSON
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
`,t=[];for(const a of this.PendingTransactions)t.push({EntityName:a.BaseEntity.EntityInfo.Name,EntityObjectJSON:await a.BaseEntity.GetDataObjectJSON(),OperationType:a.OperationType});const r={group:{Items:t,Variables:this.Variables.map(a=>({Name:a.Name,ItemIndex:this.MapVariableEntityObjectToPosition(a),FieldName:a.FieldName,Type:a.Type}))}},s=await this._provider.ExecuteGQL(e,r);if(s&&s.ExecuteTransactionGroup){const a=s.ExecuteTransactionGroup,
|
|
9
|
+
`,t=[];for(const a of this.PendingTransactions)t.push({EntityName:a.BaseEntity.EntityInfo.Name,EntityObjectJSON:await a.BaseEntity.GetDataObjectJSON(),OperationType:a.OperationType});const r={group:{Items:t,Variables:this.Variables.map(a=>({Name:a.Name,ItemIndex:this.MapVariableEntityObjectToPosition(a),FieldName:a.FieldName,Type:a.Type}))}},s=await this._provider.ExecuteGQL(e,r);if(s&&s.ExecuteTransactionGroup){const a=s.ExecuteTransactionGroup,o=[];for(let n=0;n<this.PendingTransactions.length;n++){const i=a.ResultsJSON[n],l=w.SafeJSONParse(i),p=this.PendingTransactions[n];o.push(new u.TransactionResult(p,l,l!==null))}return o}else throw new Error("Failed to execute transaction group")}};f(j,"GraphQLTransactionGroup");let v=j;const z=class z{constructor(e){this._dataProvider=e}async RunAIPrompt(e){try{const t=m.gql`
|
|
10
10
|
mutation RunAIPrompt(
|
|
11
11
|
$promptId: String!,
|
|
12
12
|
$data: String,
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
chatResult
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
`,r=this.preparePromptVariables(e),s=await this._dataProvider.ExecuteGQL(t,r);return this.processPromptResult(s)}catch(t){return this.handlePromptError(t)}}preparePromptVariables(e){const t={promptId:e.promptId};return e.data!==void 0&&(t.data=typeof e.data=="object"?JSON.stringify(e.data):e.data),e.templateData!==void 0&&(t.templateData=typeof e.templateData=="object"?JSON.stringify(e.templateData):e.templateData),e.messages!==void 0&&(t.messages=JSON.stringify(e.messages)),e.overrideModelId!==void 0&&(t.overrideModelId=e.overrideModelId),e.overrideVendorId!==void 0&&(t.overrideVendorId=e.overrideVendorId),e.configurationId!==void 0&&(t.configurationId=e.configurationId),e.skipValidation!==void 0&&(t.skipValidation=e.skipValidation),e.responseFormat!==void 0&&(t.responseFormat=e.responseFormat),e.temperature!==void 0&&(t.temperature=e.temperature),e.topP!==void 0&&(t.topP=e.topP),e.topK!==void 0&&(t.topK=e.topK),e.minP!==void 0&&(t.minP=e.minP),e.frequencyPenalty!==void 0&&(t.frequencyPenalty=e.frequencyPenalty),e.presencePenalty!==void 0&&(t.presencePenalty=e.presencePenalty),e.seed!==void 0&&(t.seed=e.seed),e.stopSequences!==void 0&&(t.stopSequences=e.stopSequences),e.includeLogProbs!==void 0&&(t.includeLogProbs=e.includeLogProbs),e.topLogProbs!==void 0&&(t.topLogProbs=e.topLogProbs),e.rerunFromPromptRunID!==void 0&&(t.rerunFromPromptRunID=e.rerunFromPromptRunID),e.systemPromptOverride!==void 0&&(t.systemPromptOverride=e.systemPromptOverride),t}processPromptResult(e){if(!e?.RunAIPrompt)throw new Error("Invalid response from server");const t=e.RunAIPrompt;let r,s,a;try{t.parsedResult&&(r=JSON.parse(t.parsedResult))}catch{r=t.parsedResult}try{t.validationResult&&(s=JSON.parse(t.validationResult))}catch{s=t.validationResult}try{t.chatResult&&(a=JSON.parse(t.chatResult))}catch{a=t.chatResult}return{success:t.success,output:t.output,parsedResult:r,error:t.error,executionTimeMs:t.executionTimeMs,tokensUsed:t.tokensUsed,promptRunId:t.promptRunId,rawResult:t.rawResult,validationResult:s,chatResult:a}}handlePromptError(e){const t=e;return u.LogError(`Error running AI prompt: ${t}`),{success:!1,error:t.message||"Unknown error occurred"}}async RunAIAgent(e,t,r){let s;try{e.onProgress&&(s=this._dataProvider.PushStatusUpdates(this._dataProvider.sessionId).subscribe(
|
|
68
|
+
`,r=this.preparePromptVariables(e),s=await this._dataProvider.ExecuteGQL(t,r);return this.processPromptResult(s)}catch(t){return this.handlePromptError(t)}}preparePromptVariables(e){const t={promptId:e.promptId};return e.data!==void 0&&(t.data=typeof e.data=="object"?JSON.stringify(e.data):e.data),e.templateData!==void 0&&(t.templateData=typeof e.templateData=="object"?JSON.stringify(e.templateData):e.templateData),e.messages!==void 0&&(t.messages=JSON.stringify(e.messages)),e.overrideModelId!==void 0&&(t.overrideModelId=e.overrideModelId),e.overrideVendorId!==void 0&&(t.overrideVendorId=e.overrideVendorId),e.configurationId!==void 0&&(t.configurationId=e.configurationId),e.skipValidation!==void 0&&(t.skipValidation=e.skipValidation),e.responseFormat!==void 0&&(t.responseFormat=e.responseFormat),e.temperature!==void 0&&(t.temperature=e.temperature),e.topP!==void 0&&(t.topP=e.topP),e.topK!==void 0&&(t.topK=e.topK),e.minP!==void 0&&(t.minP=e.minP),e.frequencyPenalty!==void 0&&(t.frequencyPenalty=e.frequencyPenalty),e.presencePenalty!==void 0&&(t.presencePenalty=e.presencePenalty),e.seed!==void 0&&(t.seed=e.seed),e.stopSequences!==void 0&&(t.stopSequences=e.stopSequences),e.includeLogProbs!==void 0&&(t.includeLogProbs=e.includeLogProbs),e.topLogProbs!==void 0&&(t.topLogProbs=e.topLogProbs),e.rerunFromPromptRunID!==void 0&&(t.rerunFromPromptRunID=e.rerunFromPromptRunID),e.systemPromptOverride!==void 0&&(t.systemPromptOverride=e.systemPromptOverride),t}processPromptResult(e){if(!e?.RunAIPrompt)throw new Error("Invalid response from server");const t=e.RunAIPrompt;let r,s,a;try{t.parsedResult&&(r=JSON.parse(t.parsedResult))}catch{r=t.parsedResult}try{t.validationResult&&(s=JSON.parse(t.validationResult))}catch{s=t.validationResult}try{t.chatResult&&(a=JSON.parse(t.chatResult))}catch{a=t.chatResult}return{success:t.success,output:t.output,parsedResult:r,error:t.error,executionTimeMs:t.executionTimeMs,tokensUsed:t.tokensUsed,promptRunId:t.promptRunId,rawResult:t.rawResult,validationResult:s,chatResult:a}}handlePromptError(e){const t=e;return u.LogError(`Error running AI prompt: ${t}`),{success:!1,error:t.message||"Unknown error occurred"}}async RunAIAgent(e,t,r){let s;try{e.onProgress&&(s=this._dataProvider.PushStatusUpdates(this._dataProvider.sessionId).subscribe(i=>{try{u.LogStatusEx({message:"[GraphQLAIClient] Received statusUpdate message",verboseOnly:!0,additionalArgs:[i]});const l=JSON.parse(i);if(u.LogStatusEx({message:"[GraphQLAIClient] Parsed message",verboseOnly:!0,additionalArgs:[l]}),l.resolver==="RunAIAgentResolver"&&l.type==="ExecutionProgress"&&l.status==="ok"&&l.data?.progress){u.LogStatusEx({message:"[GraphQLAIClient] Forwarding progress to callback",verboseOnly:!0,additionalArgs:[l.data.progress]});const p={...l.data.progress,metadata:{...l.data.progress.metadata||{},agentRunId:l.data.agentRunId}};e.onProgress(p)}else u.LogStatusEx({message:"[GraphQLAIClient] Message does not match filter criteria",verboseOnly:!0,additionalArgs:[{resolver:l.resolver,type:l.type,status:l.status,hasProgress:!!l.data?.progress}]})}catch(l){console.error("[GraphQLAIClient] Failed to parse progress message:",l,"Raw message:",i)}}));const a=m.gql`
|
|
69
69
|
mutation RunAIAgent(
|
|
70
70
|
$agentId: String!,
|
|
71
71
|
$messages: String!,
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
result
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,
|
|
107
|
+
`,o=this.prepareAgentVariables(e,t,r),n=await this._dataProvider.ExecuteGQL(a,o);return this.processAgentResult(n.RunAIAgent?.result)}catch(a){return this.handleAgentError(a)}finally{s&&s.unsubscribe()}}prepareAgentVariables(e,t,r){const s={agentId:e.agent.ID,messages:JSON.stringify(e.conversationMessages),sessionId:this._dataProvider.sessionId};return e.data!==void 0&&(s.data=typeof e.data=="object"?JSON.stringify(e.data):e.data),e.payload!==void 0&&(s.payload=typeof e.payload=="object"?JSON.stringify(e.payload):e.payload),e.lastRunId!==void 0&&(s.lastRunId=e.lastRunId),e.autoPopulateLastRunPayload!==void 0&&(s.autoPopulateLastRunPayload=e.autoPopulateLastRunPayload),e.configurationId!==void 0&&(s.configurationId=e.configurationId),e.conversationDetailId!==void 0&&(s.conversationDetailId=e.conversationDetailId,s.createArtifacts=!0,s.createNotification=!0),t!==void 0&&(s.sourceArtifactId=t),r!==void 0&&(s.sourceArtifactVersionId=r),s}processAgentResult(e){return w.SafeJSONParse(e)}handleAgentError(e){const t=e;return u.LogError(`Error running AI agent: ${t}`),{success:!1,agentRun:void 0}}async ExecuteSimplePrompt(e){try{const t=m.gql`
|
|
108
108
|
mutation ExecuteSimplePrompt(
|
|
109
109
|
$systemPrompt: String!,
|
|
110
110
|
$messages: String,
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
executionTimeMs
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
`,r={systemPrompt:e.systemPrompt};e.messages&&e.messages.length>0&&(r.messages=JSON.stringify(e.messages)),e.preferredModels&&(r.preferredModels=e.preferredModels),e.modelPower&&(r.modelPower=e.modelPower),e.responseFormat&&(r.responseFormat=e.responseFormat);const s=await this._dataProvider.ExecuteGQL(t,r);if(!s?.ExecuteSimplePrompt)throw new Error("Invalid response from server");const a=s.ExecuteSimplePrompt;let
|
|
130
|
+
`,r={systemPrompt:e.systemPrompt};e.messages&&e.messages.length>0&&(r.messages=JSON.stringify(e.messages)),e.preferredModels&&(r.preferredModels=e.preferredModels),e.modelPower&&(r.modelPower=e.modelPower),e.responseFormat&&(r.responseFormat=e.responseFormat);const s=await this._dataProvider.ExecuteGQL(t,r);if(!s?.ExecuteSimplePrompt)throw new Error("Invalid response from server");const a=s.ExecuteSimplePrompt;let o;if(a.resultObject)try{o=JSON.parse(a.resultObject)}catch{o=a.resultObject}return{success:a.success,result:a.result,resultObject:o,modelName:a.modelName,error:a.error,executionTimeMs:a.executionTimeMs}}catch(t){const r=t;return u.LogError(`Error executing simple prompt: ${r}`),{success:!1,modelName:"Unknown",error:r.message||"Unknown error occurred"}}}async EmbedText(e){try{const t=m.gql`
|
|
131
131
|
mutation EmbedText(
|
|
132
132
|
$textToEmbed: [String!]!,
|
|
133
133
|
$modelSize: String!
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
error
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`,s={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this._dataProvider.ExecuteGQL(t,s);if(!a?.EmbedText)throw new Error("Invalid response from server");const
|
|
145
|
+
`,s={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this._dataProvider.ExecuteGQL(t,s);if(!a?.EmbedText)throw new Error("Invalid response from server");const o=a.EmbedText;return{embeddings:Array.isArray(e.textToEmbed)?o.embeddings:o.embeddings[0],modelName:o.modelName,vectorDimensions:o.vectorDimensions,error:o.error}}catch(t){const r=t;return u.LogError(`Error generating embeddings: ${r}`),{embeddings:Array.isArray(e.textToEmbed)?[]:[],modelName:"Unknown",vectorDimensions:0,error:r.message||"Unknown error occurred"}}}};f(z,"GraphQLAIClient");let N=z;const W=class W extends u.ProviderConfigDataBase{get Token(){return this.Data.Token}set Token(e){this.Data.Token=e}get MJAPIKey(){return this.Data.MJAPIKey}set MJAPIKey(e){this.Data.MJAPIKey=e}get URL(){return this.Data.URL}get WSURL(){return this.Data.WSURL}get RefreshTokenFunction(){return this.Data.RefreshFunction}constructor(e,t,r,s,a,o,n,i){super({Token:e,URL:t,WSURL:r,MJAPIKey:i,RefreshTokenFunction:s},a,o,n)}};f(W,"GraphQLProviderConfigData");let C=W;const fe=(R=class extends u.ProviderBase{constructor(){super(),this._innerCurrentUserQueryString=`CurrentUser {
|
|
146
146
|
${this.userInfoString()}
|
|
147
147
|
UserRoles_UserIDArray {
|
|
148
148
|
${this.userRoleInfoString()}
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
}
|
|
151
151
|
`,this._currentUserQuery=m.gql`query CurrentUserAndRoles {
|
|
152
152
|
${this._innerCurrentUserQueryString}
|
|
153
|
-
}`,this._wsClient=null,this._pushStatusRequests=[],
|
|
153
|
+
}`,this._wsClient=null,this._pushStatusRequests=[],R._instance||(R._instance=this)}static get Instance(){return R._instance}get ConfigData(){return this._configData}sanitizeGraphQLName(e){if(!e||e.length===0)return"";let t=e.replace(/[^A-Za-z0-9_]/g,"");return t.startsWith("__")&&(t=t.substring(2)),t=t.replace(/_/g,""),t.length===0||/^[0-9]/.test(t)?"_"+t:t}getGraphQLTypeNameBase(e){const t=e.SchemaName.trim().toLowerCase()===R.MJ_CORE_SCHEMA.trim().toLowerCase()?"MJ":this.sanitizeGraphQLName(e.SchemaName),r=this.sanitizeGraphQLName(e.BaseTable);return`${t}${r}`}get AI(){return this._aiClient||(this._aiClient=new N(this)),this._aiClient}get DatabaseConnection(){throw new Error("DatabaseConnection not implemented for the GraphQLDataProvider")}get InstanceConnectionString(){return this._configData.URL}GenerateUUID(){return De.v4()}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 r?(this._configData=e,this._sessionId=await this.GetPreferredUUID(s),this._client=this.CreateNewGraphQLClient(e.URL,e.Token,this._sessionId,e.MJAPIKey),await this.SaveStoredSessionID(this._sessionId)):(R.Instance._configData=e,R.Instance._sessionId===void 0&&(R.Instance._sessionId=await this.GetPreferredUUID(s)),R.Instance._client||(R.Instance._client=this.CreateNewGraphQLClient(e.URL,e.Token,R.Instance._sessionId,e.MJAPIKey)),await R.Instance.SaveStoredSessionID(R.Instance._sessionId)),super.Config(e)}catch(a){throw u.LogError(a),a}}get sessionId(){return this._sessionId}get AllowRefresh(){return!0}async GetCurrentUser(){const e=await this.ExecuteGQL(this._currentUserQuery,null);if(e){const t=this.ConvertBackToMJFields(e.CurrentUser),r=t.UserRoles_UserIDArray.map(s=>this.ConvertBackToMJFields(s));return t.UserRoles_UserIDArray=r,new u.UserInfo(this,{...t,UserRoles:r})}}async RunReport(e,t){const r=m.gql`
|
|
154
154
|
query GetReportDataQuery ($ReportID: String!) {
|
|
155
155
|
GetReportData(ReportID: $ReportID) {
|
|
156
156
|
Success
|
|
@@ -159,19 +159,19 @@
|
|
|
159
159
|
ExecutionTime
|
|
160
160
|
ErrorMessage
|
|
161
161
|
}
|
|
162
|
-
}`,s=await this.ExecuteGQL(r,{ReportID:e.ReportID});if(s&&s.GetReportData)return{ReportID:e.ReportID,Success:s.GetReportData.Success,Results:JSON.parse(s.GetReportData.Results),RowCount:s.GetReportData.RowCount,ExecutionTime:s.GetReportData.ExecutionTime,ErrorMessage:s.GetReportData.ErrorMessage}}async RunQuery(e,t){if(e.QueryID)return this.RunQueryByID(e.QueryID,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow);if(e.QueryName)return this.RunQueryByName(e.QueryName,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow);throw new Error("No QueryID or QueryName provided to RunQuery")}async RunQueryByID(e,t,r,s,a,n
|
|
162
|
+
}`,s=await this.ExecuteGQL(r,{ReportID:e.ReportID});if(s&&s.GetReportData)return{ReportID:e.ReportID,Success:s.GetReportData.Success,Results:JSON.parse(s.GetReportData.Results),RowCount:s.GetReportData.RowCount,ExecutionTime:s.GetReportData.ExecutionTime,ErrorMessage:s.GetReportData.ErrorMessage}}async RunQuery(e,t){if(e.QueryID)return this.RunQueryByID(e.QueryID,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow);if(e.QueryName)return this.RunQueryByName(e.QueryName,e.CategoryID,e.CategoryPath,t,e.Parameters,e.MaxRows,e.StartRow);throw new Error("No QueryID or QueryName provided to RunQuery")}async RunQueryByID(e,t,r,s,a,o,n){const i=m.gql`
|
|
163
163
|
query GetQueryDataQuery($QueryID: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {
|
|
164
164
|
GetQueryData(QueryID: $QueryID, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {
|
|
165
165
|
${this.QueryReturnFieldList}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
`,l={QueryID:e};t!==void 0&&(l.CategoryID=t),r!==void 0&&(l.CategoryPath=r),a!==void 0&&(l.Parameters=a),
|
|
168
|
+
`,l={QueryID:e};t!==void 0&&(l.CategoryID=t),r!==void 0&&(l.CategoryPath=r),a!==void 0&&(l.Parameters=a),o!==void 0&&(l.MaxRows=o),n!==void 0&&(l.StartRow=n);const p=await this.ExecuteGQL(i,l);if(p&&p.GetQueryData)return this.TransformQueryPayload(p.GetQueryData)}async RunQueryByName(e,t,r,s,a,o,n){const i=m.gql`
|
|
169
169
|
query GetQueryDataByNameQuery($QueryName: String!, $CategoryID: String, $CategoryPath: String, $Parameters: JSONObject, $MaxRows: Int, $StartRow: Int) {
|
|
170
170
|
GetQueryDataByName(QueryName: $QueryName, CategoryID: $CategoryID, CategoryPath: $CategoryPath, Parameters: $Parameters, MaxRows: $MaxRows, StartRow: $StartRow) {
|
|
171
171
|
${this.QueryReturnFieldList}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
`,l={QueryName:e};t!==void 0&&(l.CategoryID=t),r!==void 0&&(l.CategoryPath=r),a!==void 0&&(l.Parameters=a),
|
|
174
|
+
`,l={QueryName:e};t!==void 0&&(l.CategoryID=t),r!==void 0&&(l.CategoryPath=r),a!==void 0&&(l.Parameters=a),o!==void 0&&(l.MaxRows=o),n!==void 0&&(l.StartRow=n);const p=await this.ExecuteGQL(i,l);if(p&&p.GetQueryDataByName)return this.TransformQueryPayload(p.GetQueryDataByName)}get QueryReturnFieldList(){return`
|
|
175
175
|
Success
|
|
176
176
|
QueryID
|
|
177
177
|
QueryName
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
TotalRowCount
|
|
181
181
|
ExecutionTime
|
|
182
182
|
ErrorMessage
|
|
183
|
-
AppliedParameters`}TransformQueryPayload(e){try{return{QueryID:e.QueryID,QueryName:e.QueryName,Success:e.Success,Results:JSON.parse(e.Results),RowCount:e.RowCount,TotalRowCount:e.TotalRowCount,ExecutionTime:e.ExecutionTime,ErrorMessage:e.ErrorMessage,AppliedParameters:e.AppliedParameters?JSON.parse(e.AppliedParameters):void 0}}catch(t){return u.LogError(`Error transforming query payload: ${t}`),null}}async RunView(e,t){await this.PreProcessRunView(e,t);try{let r="",s="";if(e){const a={};let n
|
|
183
|
+
AppliedParameters`}TransformQueryPayload(e){try{return{QueryID:e.QueryID,QueryName:e.QueryName,Success:e.Success,Results:JSON.parse(e.Results),RowCount:e.RowCount,TotalRowCount:e.TotalRowCount,ExecutionTime:e.ExecutionTime,ErrorMessage:e.ErrorMessage,AppliedParameters:e.AppliedParameters?JSON.parse(e.AppliedParameters):void 0}}catch(t){return u.LogError(`Error transforming query payload: ${t}`),null}}async RunView(e,t){await this.PreProcessRunView(e,t);try{let r="",s="";if(e){const a={};let o,n;if(e.ViewEntity)n=e.ViewEntity,o=n.Entity;else{const{entityName:c,v:d}=await this.getEntityNameAndUserView(e,t);n=d,o=c}const i=this.Entities.find(c=>c.Name===o);if(!i)throw new Error(`Entity ${o} not found in metadata`);let l=!1;const p=this.getGraphQLTypeNameBase(i);e.ViewID?(r=`Run${p}ViewByID`,s="RunViewByIDInput",a.ViewID=e.ViewID):e.ViewName?(r=`Run${p}ViewByName`,s="RunViewByNameInput",a.ViewName=e.ViewName):(l=!0,r=`Run${p}DynamicView`,s="RunDynamicViewInput",a.EntityName=e.EntityName),a.ExtraFilter=e.ExtraFilter?e.ExtraFilter:"",a.OrderBy=e.OrderBy?e.OrderBy:"",a.UserSearchString=e.UserSearchString?e.UserSearchString:"",a.Fields=e.Fields,a.IgnoreMaxRows=e.IgnoreMaxRows?e.IgnoreMaxRows:!1,e.MaxRows!==void 0&&(a.MaxRows=e.MaxRows),e.StartRow!==void 0&&(a.StartRow=e.StartRow),a.ForceAuditLog=e.ForceAuditLog?e.ForceAuditLog:!1,a.ResultType=e.ResultType?e.ResultType:"simple",e.AuditLogDescription&&e.AuditLogDescription.length>0&&(a.AuditLogDescription=e.AuditLogDescription),l||(a.ExcludeUserViewRunID=e.ExcludeUserViewRunID?e.ExcludeUserViewRunID:"",a.ExcludeDataFromAllPriorViewRuns=e.ExcludeDataFromAllPriorViewRuns?e.ExcludeDataFromAllPriorViewRuns:!1,a.OverrideExcludeFilter=e.OverrideExcludeFilter?e.OverrideExcludeFilter:"",a.SaveViewResults=e.SaveViewResults?e.SaveViewResults:!1);const g=this.getViewRunTimeFieldList(i,n,e,l),I=m.gql`
|
|
184
184
|
query RunViewQuery ($input: ${s}!) {
|
|
185
185
|
${r}(input: $input) {
|
|
186
186
|
Results {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
Success
|
|
195
195
|
ErrorMessage
|
|
196
196
|
}
|
|
197
|
-
}`,y=await this.ExecuteGQL(I,{input:a});if(y&&y[r]){const c=y[r].Results;if(c&&c.length>0){const
|
|
197
|
+
}`,y=await this.ExecuteGQL(I,{input:a});if(y&&y[r]){const c=y[r].Results;if(c&&c.length>0){const h=i.Fields.filter(S=>S.CodeName!==S.Name&&S.CodeName!==void 0);c.forEach(S=>{this.ConvertBackToMJFields(S),h.forEach(E=>{S[E.Name]=S[E.CodeName]})})}const d=y[r];return await this.PostProcessRunView(d,e,t),d}}else throw"No parameters passed to RunView";return null}catch(r){throw u.LogError(r),r}}async RunViews(e,t){await this.PreProcessRunViews(e,t);try{let r=[],s=[],a=[];for(const i of e){let l="",p="";const g={};let I=null,y=null;if(i.ViewEntity)y=i.ViewEntity,I=y.Get("Entity");else{const{entityName:S,v:E}=await this.getEntityNameAndUserView(i,t);y=E,I=S}const c=this.Entities.find(S=>S.Name===I);if(!c)throw new Error(`Entity ${I} not found in metadata`);s.push(c);let d=!1;const h=this.getGraphQLTypeNameBase(c);i.ViewID?(l=`Run${h}ViewByID`,p="RunViewByIDInput",g.ViewID=i.ViewID):i.ViewName?(l=`Run${h}ViewByName`,p="RunViewByNameInput",g.ViewName=i.ViewName):(d=!0,l=`Run${h}DynamicView`,p="RunDynamicViewInput",g.EntityName=i.EntityName),g.ExtraFilter=i.ExtraFilter||"",g.OrderBy=i.OrderBy||"",g.UserSearchString=i.UserSearchString||"",g.Fields=i.Fields,g.IgnoreMaxRows=i.IgnoreMaxRows||!1,i.MaxRows!==void 0&&(g.MaxRows=i.MaxRows),i.StartRow!==void 0&&(g.StartRow=i.StartRow),g.ForceAuditLog=i.ForceAuditLog||!1,g.ResultType=i.ResultType||"simple",i.AuditLogDescription&&i.AuditLogDescription.length>0&&(g.AuditLogDescription=i.AuditLogDescription),d||(g.ExcludeUserViewRunID=i.ExcludeUserViewRunID||"",g.ExcludeDataFromAllPriorViewRuns=i.ExcludeDataFromAllPriorViewRuns||!1,g.OverrideExcludeFilter=i.OverrideExcludeFilter||"",g.SaveViewResults=i.SaveViewResults||!1),r.push(g),a.push(...this.getViewRunTimeFieldList(c,y,i,d))}const o=m.gql`
|
|
198
198
|
query RunViewsQuery ($input: [RunViewGenericInput!]!) {
|
|
199
199
|
RunViews(input: $input) {
|
|
200
200
|
Results {
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
Success
|
|
213
213
|
ErrorMessage
|
|
214
214
|
}
|
|
215
|
-
}`,
|
|
215
|
+
}`,n=await this.ExecuteGQL(o,{input:r});if(n&&n.RunViews){const i=n.RunViews;for(const[l,p]of i.entries())p.Results=p.Results.map(g=>{let I=JSON.parse(g.Data);return this.ConvertBackToMJFields(I),I});return await this.PostProcessRunViews(i,e,t),i}return null}catch(r){throw u.LogError(r),r}}async getEntityNameAndUserView(e,t){let r,s;if(e.EntityName)r=e.EntityName;else if(e.ViewID)s=await me.ViewInfo.GetViewEntity(e.ViewID,t),r=s.Entity;else if(e.ViewName)s=await me.ViewInfo.GetViewEntityByName(e.ViewName,t),r=s.Entity;else throw new Error("No EntityName, ViewID or ViewName passed to RunView");return{entityName:r,v:s}}getViewRunTimeFieldList(e,t,r,s){const a=[],o=new $;if(r.Fields){for(const n of e.PrimaryKeys)r.Fields.find(i=>i.trim().toLowerCase()===n.Name.toLowerCase())===void 0&&a.push(n.Name);r.Fields.forEach(n=>{a.push(o.MapFieldName(n))})}else if(s)e.Fields.forEach(n=>{n.IsBinaryFieldType||a.push(o.MapFieldName(n.CodeName))});else{for(const n of e.PrimaryKeys)a.find(i=>i.trim().toLowerCase()===n.Name.toLowerCase())===void 0&&a.push(n.Name);t.Columns.forEach(n=>{n.hidden===!1&&!a.find(i=>i.trim().toLowerCase()===n.EntityField?.Name.trim().toLowerCase())&&n.EntityField&&a.push(o.MapFieldName(n.EntityField.CodeName))})}return a}get ProviderType(){return u.ProviderType.Network}async GetRecordChanges(e,t){try{const r={EntityName:"Record Changes",ExtraFilter:`RecordID = '${t.Values()}' AND Entity = '${e}'`},s=await this.RunView(r);return s?s.Results.sort((a,o)=>a.ChangedAt>o.ChangedAt?-1:1):null}catch(r){throw u.LogError(r),r}}async GetRecordDependencies(e,t){try{const r=m.gql`query GetRecordDependenciesQuery ($entityName: String!, $CompositeKey: CompositeKeyInputType!) {
|
|
216
216
|
GetRecordDependencies(entityName: $entityName, CompositeKey: $CompositeKey) {
|
|
217
217
|
EntityName
|
|
218
218
|
RelatedEntityName
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
}`;let s={EntityID:e.EntityID,EntityDocumentID:e.EntityDocumentID,ListID:e.ListID,ProbabilityScore:e.ProbabilityScore,Options:e.Options,RecordIDs:e.RecordIDs.map(
|
|
249
|
+
}`;let s={EntityID:e.EntityID,EntityDocumentID:e.EntityDocumentID,ListID:e.ListID,ProbabilityScore:e.ProbabilityScore,Options:e.Options,RecordIDs:e.RecordIDs.map(o=>o.Copy())};const a=await this.ExecuteGQL(r,{params:s});if(a&&a.GetRecordDuplicates)return a.GetRecordDuplicates}async MergeRecords(e,t,r){const s=this.Entities.find(a=>a.Name.trim().toLowerCase()===e.EntityName.trim().toLowerCase());if(!s||!s.AllowRecordMerge)throw new Error(`Entity ${e.EntityName} does not allow record merging, check the AllowRecordMerge property in the entity metadata`);try{const a=m.gql`mutation MergeRecordsMutation ($request: RecordMergeRequest!) {
|
|
250
250
|
MergeRecords(request: $request) {
|
|
251
251
|
Success
|
|
252
252
|
OverallStatus
|
|
@@ -263,32 +263,32 @@
|
|
|
263
263
|
Message
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
}`,
|
|
266
|
+
}`,o={EntityName:e.EntityName,SurvivingRecordCompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(e.SurvivingRecordCompositeKey.KeyValuePairs)},FieldMap:e.FieldMap?.map(i=>({FieldName:i.FieldName,Value:i.Value.toString()})),RecordsToMerge:e.RecordsToMerge.map(i=>i.Copy())};return(await this.ExecuteGQL(a,{request:o}))?.MergeRecords}catch(a){return u.LogError(a),{Success:!1,OverallStatus:a&&a.message?a.message:a,RecordStatus:[],RecordMergeLogID:"",Request:e}}}async Save(e,t,r){const s=new u.BaseEntityResult;try{e.RegisterTransactionPreprocessing();const a={input:{}},o=e.IsSaved?"Update":"Create";s.StartedAt=new Date,s.Type=e.IsSaved?"update":"create",s.OriginalValues=e.Fields.map(y=>({FieldName:y.CodeName,Value:y.Value})),e.ResultHistory.push(s);const n=this.getGraphQLTypeNameBase(e.EntityInfo),i=`${o}${n}`,l=e.Fields.filter(y=>!y.ReadOnly||y.IsPrimaryKey&&e.IsSaved),p=new $,g=` ${i}(input: $input) {
|
|
267
267
|
${e.Fields.map(y=>p.MapFieldName(y.CodeName)).join(`
|
|
268
268
|
`)}
|
|
269
|
-
}`,I=m.gql`mutation ${
|
|
269
|
+
}`,I=m.gql`mutation ${o}${n} ($input: ${i}Input!) {
|
|
270
270
|
${g}
|
|
271
271
|
}
|
|
272
|
-
`;for(let y=0;y<l.length;y++){const c=l[y];let d=c.Value;if(d)switch(c.EntityFieldInfo.TSType){case u.EntityFieldTSType.Date:d=d.getTime();break;case u.EntityFieldTSType.Boolean:typeof d!="boolean"&&(d=parseInt(d)!==0);break;case u.EntityFieldTSType.Number:if(typeof d!="number"){const
|
|
273
|
-
${l}(${
|
|
272
|
+
`;for(let y=0;y<l.length;y++){const c=l[y];let d=c.Value;if(d)switch(c.EntityFieldInfo.TSType){case u.EntityFieldTSType.Date:d=d.getTime();break;case u.EntityFieldTSType.Boolean:typeof d!="boolean"&&(d=parseInt(d)!==0);break;case u.EntityFieldTSType.Number:if(typeof d!="number"){const h=Number(d);isNaN(h)||(d=h)}break}d===null&&c.EntityFieldInfo.AllowsNull===!1&&(c.EntityFieldInfo.DefaultValue!==null?d=c.EntityFieldInfo.DefaultValue:c.FieldType===u.EntityFieldTSType.Number||c.FieldType===u.EntityFieldTSType.Boolean?d=0:d=""),a.input[c.CodeName]=d}if(o.trim().toLowerCase()==="update"&&r.SkipOldValuesCheck===!1){const y=[];e.Fields.forEach(c=>{let d=null;c.OldValue!==null&&c.OldValue!==void 0&&(c.EntityFieldInfo.TSType===u.EntityFieldTSType.Date?d=c.OldValue.getTime().toString():c.EntityFieldInfo.TSType===u.EntityFieldTSType.Boolean?d=c.OldValue===!0?"1":"0":typeof c.OldValue!="string"?d=c.OldValue.toString():d=c.OldValue),y.push({Key:c.CodeName,Value:d})}),a.input.OldValues___=y}if(e.TransactionGroup){const y=[{varName:"input",inputType:i+"Input!"}];return e.RaiseReadyForTransaction(),e.TransactionGroup.AddTransaction(new u.TransactionItem(e,s.Type==="create"?"Create":"Update",g,a,{mutationName:i,mutationInputTypes:y},(c,d)=>{s.EndedAt=new Date,d&&c?(s.Success=!0,s.NewValues=this.ConvertBackToMJFields(c)):(s.Success=!1,s.Message="Transaction failed")})),!0}else{const y=await this.ExecuteGQL(I,a);if(y&&y[i])return s.Success=!0,s.EndedAt=new Date,s.NewValues=this.ConvertBackToMJFields(y[i]),s.NewValues;throw new Error(`Save failed for ${e.EntityInfo.ClassName}`)}}catch(a){return s.Success=!1,s.EndedAt=new Date,s.Message=a.response?.errors?.length>0?a.response.errors[0].message:a.message,u.LogError(a),null}}async Load(e,t,r=null,s){try{const a={};let o="",n="";for(let y=0;y<t.KeyValuePairs.length;y++){const c=e.Fields.find(S=>S.Name.trim().toLowerCase()===t.KeyValuePairs[y].FieldName.trim().toLowerCase()).EntityFieldInfo,d=t.GetValueByIndex(y),h=c.GraphQLType;if(n.length>0&&(n+=", "),n+=`$${c.CodeName}: ${h}!`,o.length>0&&(o+=", "),o+=`${c.CodeName}: $${c.CodeName}`,c.TSType===u.EntityFieldTSType.Number){if(isNaN(t.GetValueByIndex(y)))throw new Error(`Primary Key value ${d} (${c.Name}) is not a valid number`);a[c.CodeName]=parseInt(d)}else a[c.CodeName]=d}const i=r&&r.length>0?this.getRelatedEntityString(e.EntityInfo,r):"",l=this.getGraphQLTypeNameBase(e.EntityInfo),p=new $,g=m.gql`query Single${l}${i.length>0?"Full":""} (${n}) {
|
|
273
|
+
${l}(${o}) {
|
|
274
274
|
${e.Fields.filter(y=>!y.EntityFieldInfo.IsBinaryFieldType).map(y=>y.EntityFieldInfo.Name.trim().toLowerCase().startsWith("__mj_")?y.CodeName.replace("__mj_","_mj__"):y.CodeName).join(`
|
|
275
275
|
`)}
|
|
276
|
-
${
|
|
276
|
+
${i}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
`,I=await this.ExecuteGQL(g,a);return I&&I[l]?this.ConvertBackToMJFields(I[l]):null}catch(a){return u.LogError(a),null}}ConvertBackToMJFields(e){return new $().ReverseMapFields(e),e}getRelatedEntityString(e,t){let r="";for(let s=0;s<e.RelatedEntities.length;s++)if(t.indexOf(e.RelatedEntities[s].RelatedEntity)>=0){const a=e.RelatedEntities[s],
|
|
280
|
-
${
|
|
281
|
-
${
|
|
279
|
+
`,I=await this.ExecuteGQL(g,a);return I&&I[l]?this.ConvertBackToMJFields(I[l]):null}catch(a){return u.LogError(a),null}}ConvertBackToMJFields(e){return new $().ReverseMapFields(e),e}getRelatedEntityString(e,t){let r="";for(let s=0;s<e.RelatedEntities.length;s++)if(t.indexOf(e.RelatedEntities[s].RelatedEntity)>=0){const a=e.RelatedEntities[s],o=this.Entities.find(i=>i.ID===a.RelatedEntityID);let n="";a.Type.toLowerCase().trim()==="many to many"?n=`${a.RelatedEntityCodeName}_${a.JoinEntityJoinField.replace(/\s/g,"")}`:n=`${a.RelatedEntityCodeName}_${a.RelatedEntityJoinField.replace(/\s/g,"")}`,r+=`
|
|
280
|
+
${n} {
|
|
281
|
+
${o.Fields.map(i=>i.CodeName).join(`
|
|
282
282
|
`)}
|
|
283
283
|
}
|
|
284
|
-
`}return r}async Delete(e,t,r){const s=new u.BaseEntityResult;try{e.RegisterTransactionPreprocessing(),s.StartedAt=new Date,s.Type="delete",s.OriginalValues=e.Fields.map(c=>({FieldName:c.CodeName,Value:c.Value})),e.ResultHistory.push(s);const a={},
|
|
285
|
-
`),l+=`${d.CodeName}`}
|
|
284
|
+
`}return r}async Delete(e,t,r){const s=new u.BaseEntityResult;try{e.RegisterTransactionPreprocessing(),s.StartedAt=new Date,s.Type="delete",s.OriginalValues=e.Fields.map(c=>({FieldName:c.CodeName,Value:c.Value})),e.ResultHistory.push(s);const a={},o=[];let n="",i="",l="";for(let c of e.PrimaryKey.KeyValuePairs){const d=e.Fields.find(h=>h.Name.trim().toLowerCase()===c.FieldName.trim().toLowerCase());a[d.CodeName]=d.Value,o.push({varName:d.CodeName,inputType:d.EntityFieldInfo.GraphQLType+"!"}),n.length>0&&(n+=", "),n+=`${d.CodeName}: $${d.CodeName}`,i.length>0&&(i+=", "),i+=`$${d.CodeName}: ${d.EntityFieldInfo.GraphQLType}!`,l.length>0&&(l+=`
|
|
285
|
+
`),l+=`${d.CodeName}`}o.push({varName:"options___",inputType:"DeleteOptionsInput!"}),a.options___=t||{SkipEntityAIActions:!1,SkipEntityActions:!1};const g="Delete"+this.getGraphQLTypeNameBase(e.EntityInfo),I=m.gql`${g}(${n}, options___: $options___) {
|
|
286
286
|
${l}
|
|
287
287
|
}
|
|
288
|
-
`,y=m.gql`mutation ${g} (${
|
|
288
|
+
`,y=m.gql`mutation ${g} (${i}, $options___: DeleteOptionsInput!) {
|
|
289
289
|
${I}
|
|
290
290
|
}
|
|
291
|
-
`;if(e.TransactionGroup)return e.RaiseReadyForTransaction(),e.TransactionGroup.AddTransaction(new u.TransactionItem(e,"Delete",I,a,{mutationName:g,mutationInputTypes:
|
|
291
|
+
`;if(e.TransactionGroup)return e.RaiseReadyForTransaction(),e.TransactionGroup.AddTransaction(new u.TransactionItem(e,"Delete",I,a,{mutationName:g,mutationInputTypes:o},(c,d)=>{if(s.EndedAt=new Date,d&&c){let h=!0;for(const S of e.PrimaryKey.KeyValuePairs)S.Value!==c[S.FieldName]&&(h=!1);h?s.Success=!0:(s.Success=!1,s.Message="Transaction failed to commit")}else s.Success=!1,s.Message="Transaction failed to commit"})),!0;{const c=await this.ExecuteGQL(y,a);if(c&&c[g]){const d=c[g];for(let h of e.PrimaryKey.KeyValuePairs){let S=d[h.FieldName],E=h.Value;if(typeof E=="number"&&(E=E.toString()),typeof S=="number"&&(S=S.toString()),E!==S)throw new Error(`Primary key value mismatch in server Delete response. Field: ${h.FieldName}, Original: ${E}, Returned: ${S}`)}return s.Success=!0,s.EndedAt=new Date,!0}else throw new Error(`Delete failed for ${e.EntityInfo.Name}: ${e.PrimaryKey.ToString()} `)}}catch(a){return s.EndedAt=new Date,s.Success=!1,s.Message=a.response?.errors?.length>0?a.response.errors[0].message:a.message,u.LogError(a),!1}}async GetDatasetByName(e,t){const r=m.gql`query GetDatasetByName($DatasetName: String!, $ItemFilters: [DatasetItemFilterTypeGQL!]) {
|
|
292
292
|
GetDatasetByName(DatasetName: $DatasetName, ItemFilters: $ItemFilters) {
|
|
293
293
|
DatasetID
|
|
294
294
|
DatasetName
|
|
@@ -306,16 +306,16 @@
|
|
|
306
306
|
LatestUpdateDate
|
|
307
307
|
EntityUpdateDates
|
|
308
308
|
}
|
|
309
|
-
}`,s=await this.ExecuteGQL(r,{DatasetName:e,ItemFilters:t});return s&&s.GetDatasetStatusByName&&s.GetDatasetStatusByName.Success?{DatasetID:s.GetDatasetStatusByName.DatasetID,DatasetName:s.GetDatasetStatusByName.DatasetName,Success:s.GetDatasetStatusByName.Success,Status:s.GetDatasetStatusByName.Status,LatestUpdateDate:new Date(s.GetDatasetStatusByName.LatestUpdateDate),EntityUpdateDates:JSON.parse(s.GetDatasetStatusByName.EntityUpdateDates)}:{DatasetID:"",DatasetName:e,Success:!1,Status:"Unknown",LatestUpdateDate:null,EntityUpdateDates:null}}async CreateTransactionGroup(){return new
|
|
309
|
+
}`,s=await this.ExecuteGQL(r,{DatasetName:e,ItemFilters:t});return s&&s.GetDatasetStatusByName&&s.GetDatasetStatusByName.Success?{DatasetID:s.GetDatasetStatusByName.DatasetID,DatasetName:s.GetDatasetStatusByName.DatasetName,Success:s.GetDatasetStatusByName.Success,Status:s.GetDatasetStatusByName.Status,LatestUpdateDate:new Date(s.GetDatasetStatusByName.LatestUpdateDate),EntityUpdateDates:JSON.parse(s.GetDatasetStatusByName.EntityUpdateDates)}:{DatasetID:"",DatasetName:e,Success:!1,Status:"Unknown",LatestUpdateDate:null,EntityUpdateDates:null}}async CreateTransactionGroup(){return new v(this)}async GetRecordFavoriteStatus(e,t,r){if(!r.Validate().IsValid)return!1;const a=this.Entities.find(i=>i.Name===t);if(!a)throw new Error(`Entity ${t} not found in metadata`);const o=m.gql`query GetRecordFavoriteStatus($params: UserFavoriteSearchParams!) {
|
|
310
310
|
GetRecordFavoriteStatus(params: $params) {
|
|
311
311
|
Success
|
|
312
312
|
IsFavorite
|
|
313
313
|
}
|
|
314
|
-
}`,
|
|
314
|
+
}`,n=await this.ExecuteGQL(o,{params:{UserID:e,EntityID:a.ID,CompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(r.KeyValuePairs)}}});if(n&&n.GetRecordFavoriteStatus&&n.GetRecordFavoriteStatus.Success)return n.GetRecordFavoriteStatus.IsFavorite}async SetRecordFavoriteStatus(e,t,r,s,a){const o=this.Entities.find(l=>l.Name===t);if(!o)throw new Error(`Entity ${t} not found in metadata`);const n=m.gql`mutation SetRecordFavoriteStatus($params: UserFavoriteSetParams!) {
|
|
315
315
|
SetRecordFavoriteStatus(params: $params){
|
|
316
316
|
Success
|
|
317
317
|
}
|
|
318
|
-
}`,
|
|
318
|
+
}`,i=await this.ExecuteGQL(n,{params:{UserID:e,EntityID:o.ID,CompositeKey:{KeyValuePairs:this.ensureKeyValuePairValueIsString(r.KeyValuePairs)},IsFavorite:s}});if(i&&i.SetRecordFavoriteStatus!==null)return i.SetRecordFavoriteStatus.Success}async GetEntityRecordName(e,t){if(!e||!t||t.KeyValuePairs?.length===0)return null;const r=m.gql`query GetEntityRecordNameQuery ($EntityName: String!, $CompositeKey: CompositeKeyInputType!) {
|
|
319
319
|
GetEntityRecordName(EntityName: $EntityName, CompositeKey: $CompositeKey) {
|
|
320
320
|
Success
|
|
321
321
|
Status
|
|
@@ -346,23 +346,23 @@
|
|
|
346
346
|
ErrorMessage
|
|
347
347
|
Result
|
|
348
348
|
}
|
|
349
|
-
}`,r=await this.ExecuteGQL(t,{DataContextItemID:e});if(r&&r.GetDataContextItemData){if(r.GetDataContextItemData.Success)return JSON.parse(r.GetDataContextItemData.Result);throw new Error(r.GetDataContextItemData.ErrorMessage)}else throw new Error("GraphQL query failed")}catch(t){throw u.LogError(t),t}}static async ExecuteGQL(e,t,r=!0){return
|
|
349
|
+
}`,r=await this.ExecuteGQL(t,{DataContextItemID:e});if(r&&r.GetDataContextItemData){if(r.GetDataContextItemData.Success)return JSON.parse(r.GetDataContextItemData.Result);throw new Error(r.GetDataContextItemData.ErrorMessage)}else throw new Error("GraphQL query failed")}catch(t){throw u.LogError(t),t}}static async ExecuteGQL(e,t,r=!0){return R.Instance.ExecuteGQL(e,t,r)}async ExecuteGQL(e,t,r=!0){try{return await this._client.request(e,t)}catch(s){if(s&&s.response&&s.response.errors?.length>0)if(s.response.errors[0]?.extensions?.code?.toUpperCase().trim()==="JWT_EXPIRED"){if(r)return await this.RefreshToken(),await this.ExecuteGQL(e,t,!1);throw u.LogError("JWT_EXPIRED and refreshTokenIfNeeded is false"),s}else throw s;else throw u.LogError(s),s}}async RefreshToken(){if(this._configData.Data.RefreshTokenFunction){const e=await this._configData.Data.RefreshTokenFunction();if(e)this._configData.Token=e,this._client=this.CreateNewGraphQLClient(this._configData.URL,this._configData.Token,this._sessionId,this._configData.MJAPIKey);else throw new Error("Refresh token function returned null or undefined token")}else throw new Error("No refresh token function provided")}static async RefreshToken(){return R.Instance.RefreshToken()}CreateNewGraphQLClient(e,t,r,s){const a={"x-session-id":r};return t&&(a.authorization="Bearer "+t),s&&(a["x-mj-api-key"]=s),new m.GraphQLClient(e,{headers:a})}userInfoString(){return this.infoString(new u.UserInfo(null,null))}userRoleInfoString(){return this.infoString(new u.UserRoleInfo(null))}infoString(e){let t="";const r=Object.keys(e);for(const s of r)s.startsWith("__mj_")?t+=s.replace("__mj_","_mj__")+`
|
|
350
350
|
`:s.startsWith("_")||(t+=s+`
|
|
351
|
-
`);return t}get LocalStorageProvider(){return this._localStorageProvider||(this._localStorageProvider=new
|
|
351
|
+
`);return t}get LocalStorageProvider(){return this._localStorageProvider||(this._localStorageProvider=new T),this._localStorageProvider}get Metadata(){return this}subscribe(e,t){return this._wsClient||(this._wsClient=pe.createClient({url:this.ConfigData.WSURL,connectionParams:{Authorization:"Bearer "+this.ConfigData.Token}})),new ge.Observable(r=>{const s=this._wsClient.subscribe({query:e,variables:t},{next:a=>{r.next(a.data)},error:a=>{r.error(a)},complete:()=>{r.complete()}});return()=>{s()}})}PushStatusUpdates(e=null){e||(e=this.sessionId),this._wsClient||(this._wsClient=pe.createClient({url:this.ConfigData.WSURL,connectionParams:{Authorization:"Bearer "+this.ConfigData.Token}}));const t=this._pushStatusRequests.find(a=>a.sessionId===e);if(t)return t.observable;const r=m.gql`subscription StatusUpdates($sessionId: String!) {
|
|
352
352
|
statusUpdates(sessionId: $sessionId) {
|
|
353
353
|
date
|
|
354
354
|
message
|
|
355
355
|
sessionId
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
`,s=new
|
|
358
|
+
`,s=new ge.Observable(a=>{const o=this._wsClient.subscribe({query:r,variables:{sessionId:e}},{next:n=>a.next(n.data.statusUpdates.message),error:n=>a.error(n),complete:()=>a.complete()});return()=>{o()}});return this._pushStatusRequests.push({sessionId:e,observable:s}),s}},f(R,"_GraphQLDataProvider"),R);fe.MJ_CORE_SCHEMA="__mj";let Se=fe;const H=class H{constructor(){this._localStorage={}}async GetItem(e){return new Promise(t=>{this._localStorage.hasOwnProperty(e)?t(this._localStorage[e]):t(null)})}async SetItem(e,t){return new Promise(r=>{this._localStorage[e]=t,r()})}async Remove(e){return new Promise(t=>{this._localStorage.hasOwnProperty(e)&&delete this._localStorage[e],t()})}};f(H,"BrowserStorageProviderBase");let L=H;const Ee="MJ_Metadata",P="Metadata_KVPairs",X=class X extends L{constructor(){super(),this.dbPromise=Ie.openDB(Ee,1,{upgrade(e){e.objectStoreNames.contains(P)||e.createObjectStore(P)}})}async setItem(e,t){const s=(await this.dbPromise).transaction(P,"readwrite");await s.objectStore(P).put(t,e),await s.done}async getItem(e){return await(await this.dbPromise).transaction(P).objectStore(P).get(e)}async remove(e){const r=(await this.dbPromise).transaction(P,"readwrite");await r.objectStore(P).delete(e),await r.done}};f(X,"BrowserIndexedDBStorageProvider");let T=X;async function we(D){const e=new Se;return u.SetProvider(e),await e.Config(D),w.MJGlobal.Instance.RaiseEvent({event:w.MJEventType.LoggedIn,eventCode:null,component:this,args:null}),e}f(we,"setupGraphQLClient");const Z=class Z{};f(Z,"SyncRolesAndUsersResult");let V=Z;const Y=class Y{};f(Y,"RoleInput");let b=Y;const ee=class ee{};f(ee,"UserInput");let x=ee;const te=class te{};f(te,"RolesAndUsersInput");let Q=te;var he=(D=>(D.Create="Create",D.Update="Update",D.CreateOrUpdate="CreateOrUpdate",D.Delete="Delete",D.DeleteWithFilter="DeleteWithFilter",D))(he||{});const re=class re{};f(re,"ActionItemInput");let G=re;const se=class se{constructor(){this.Results=[]}};f(se,"SyncDataResult");let F=se;const ae=class ae{};f(ae,"ActionItemOutput");let U=ae;const ne=class ne{get Client(){return this._client}constructor(e,t,r,s){const a={"x-session-id":r};this._sessionId=r,t&&(a.authorization="Bearer "+t),s&&(a["x-mj-api-key"]=s),this._client=new m.GraphQLClient(e,{headers:a})}async GetData(e,t){try{const s=await this.Client.request(`query GetData($input: GetDataInputType!) {
|
|
359
359
|
GetData(input: $input) {
|
|
360
360
|
Success
|
|
361
361
|
ErrorMessages
|
|
362
362
|
Queries
|
|
363
363
|
Results
|
|
364
364
|
}
|
|
365
|
-
}`,{input:{Queries:e,Token:t}});return s&&s.GetData?{Success:s.GetData.Success,Results:s.GetData.Results.map(a=>a?w.SafeJSONParse(a):null),ErrorMessages:s.GetData.ErrorMessages,Queries:s.GetData.Queries}:{Success:!1,Results:[],ErrorMessages:s.GetData?.ErrorMessages??["Unknown error"],Queries:s.GetData?.Queries??e}}catch(r){let s=r instanceof Error?r.message:String(r);const a=s.match(/Error: ([^:]+)\./);if(a&&(s=a[1]+"."),u.IsVerboseLoggingEnabled()){const
|
|
365
|
+
}`,{input:{Queries:e,Token:t}});return s&&s.GetData?{Success:s.GetData.Success,Results:s.GetData.Results.map(a=>a?w.SafeJSONParse(a):null),ErrorMessages:s.GetData.ErrorMessages,Queries:s.GetData.Queries}:{Success:!1,Results:[],ErrorMessages:s.GetData?.ErrorMessages??["Unknown error"],Queries:s.GetData?.Queries??e}}catch(r){let s=r instanceof Error?r.message:String(r);const a=s.match(/Error: ([^:]+)\./);if(a&&(s=a[1]+"."),u.IsVerboseLoggingEnabled()){const o=`GraphQLSystemUserClient::GetData - Error getting data - ${r}`;u.LogError(o)}return{Success:!1,Results:[],ErrorMessages:[s],Queries:e}}}async GetAllRemoteEntities(){try{const t=await this.Client.request(`query GetAllEntities {
|
|
366
366
|
GetAllEntities {
|
|
367
367
|
Success
|
|
368
368
|
ErrorMessage
|
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
executionTimeMs
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
`,r={systemPrompt:e.systemPrompt};e.messages&&e.messages.length>0&&(r.messages=JSON.stringify(e.messages)),e.preferredModels&&(r.preferredModels=e.preferredModels),e.modelPower&&(r.modelPower=e.modelPower),e.responseFormat&&(r.responseFormat=e.responseFormat);const s=await this.Client.request(t,r);if(!s?.ExecuteSimplePromptSystemUser)return{success:!1,modelName:"Unknown",error:"Failed to execute simple prompt as system user"};const a=s.ExecuteSimplePromptSystemUser;let
|
|
702
|
+
`,r={systemPrompt:e.systemPrompt};e.messages&&e.messages.length>0&&(r.messages=JSON.stringify(e.messages)),e.preferredModels&&(r.preferredModels=e.preferredModels),e.modelPower&&(r.modelPower=e.modelPower),e.responseFormat&&(r.responseFormat=e.responseFormat);const s=await this.Client.request(t,r);if(!s?.ExecuteSimplePromptSystemUser)return{success:!1,modelName:"Unknown",error:"Failed to execute simple prompt as system user"};const a=s.ExecuteSimplePromptSystemUser;let o;if(a.resultObject)try{o=JSON.parse(a.resultObject)}catch{o=a.resultObject}return{success:a.success,result:a.result,resultObject:o,modelName:a.modelName,error:a.error,executionTimeMs:a.executionTimeMs}}catch(t){return u.LogError(`GraphQLSystemUserClient::ExecuteSimplePrompt - Error executing simple prompt - ${t}`),{success:!1,modelName:"Unknown",error:t.toString()}}}async EmbedText(e){try{const t=m.gql`
|
|
703
703
|
query EmbedTextSystemUser(
|
|
704
704
|
$textToEmbed: [String!]!,
|
|
705
705
|
$modelSize: String!
|
|
@@ -714,7 +714,7 @@
|
|
|
714
714
|
error
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
`,s={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this.Client.request(t,s);if(!a?.EmbedTextSystemUser)return{embeddings:Array.isArray(e.textToEmbed)?[]:[],modelName:"Unknown",vectorDimensions:0,error:"Failed to generate embeddings as system user"};const
|
|
717
|
+
`,s={textToEmbed:Array.isArray(e.textToEmbed)?e.textToEmbed:[e.textToEmbed],modelSize:e.modelSize},a=await this.Client.request(t,s);if(!a?.EmbedTextSystemUser)return{embeddings:Array.isArray(e.textToEmbed)?[]:[],modelName:"Unknown",vectorDimensions:0,error:"Failed to generate embeddings as system user"};const o=a.EmbedTextSystemUser;return{embeddings:Array.isArray(e.textToEmbed)?o.embeddings:o.embeddings[0],modelName:o.modelName,vectorDimensions:o.vectorDimensions,error:o.error}}catch(t){return u.LogError(`GraphQLSystemUserClient::EmbedText - Error generating embeddings - ${t}`),{embeddings:Array.isArray(e.textToEmbed)?[]:[],modelName:"Unknown",vectorDimensions:0,error:t.toString()}}}};f(ne,"GraphQLSystemUserClient");let M=ne;const oe=class oe{};f(oe,"GetDataOutput");let A=oe;const ie=class ie{};f(ie,"SimpleRemoteEntityOutput");let q=ie;const ue=class ue{};f(ue,"SimpleRemoteEntity");let O=ue;const le=class le{};f(le,"SimpleRemoteEntityField");let _=le;const ce=class ce{constructor(e){this._dataProvider=e}async RunAction(e,t,r=!1){try{const s=this.serializeActionParameters(t),a=this.createActionVariables(e,s,r),o=await this.executeActionMutation(a);return this.processActionResult(o,t)}catch(s){return this.handleActionError(s,t)}}serializeActionParameters(e){if(e)return e.map(t=>{let r=t.Value;return r!=null&&typeof r=="object"&&(r=JSON.stringify(r)),{...t,Value:r}})}createActionVariables(e,t,r=!1){return{input:{ActionID:e,Params:t,SkipActionLog:r}}}async executeActionMutation(e){const t=m.gql`
|
|
718
718
|
mutation RunAction($input: RunActionInput!) {
|
|
719
719
|
RunAction(input: $input) {
|
|
720
720
|
Success
|
|
@@ -731,7 +731,47 @@
|
|
|
731
731
|
ResultData
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
`;return await this._dataProvider.ExecuteGQL(t,{input:e})}processEntityActionResult(e){if(!e?.RunEntityAction)throw new Error("Invalid response from server");let t={};try{e.RunEntityAction.ResultData&&(t=JSON.parse(e.RunEntityAction.ResultData))}catch(r){u.LogError(`Failed to parse entity action result data: ${r}`)}return{Success:e.RunEntityAction.Success,Message:e.RunEntityAction.Message,RunParams:null,LogEntry:null,...t}}handleEntityActionError(e){const t=e;return u.LogError(`Error running entity action: ${t}`),{Success:!1,Message:`Error: ${t.message}`,RunParams:null,LogEntry:null}}};f(
|
|
734
|
+
`;return await this._dataProvider.ExecuteGQL(t,{input:e})}processEntityActionResult(e){if(!e?.RunEntityAction)throw new Error("Invalid response from server");let t={};try{e.RunEntityAction.ResultData&&(t=JSON.parse(e.RunEntityAction.ResultData))}catch(r){u.LogError(`Failed to parse entity action result data: ${r}`)}return{Success:e.RunEntityAction.Success,Message:e.RunEntityAction.Message,RunParams:null,LogEntry:null,...t}}handleEntityActionError(e){const t=e;return u.LogError(`Error running entity action: ${t}`),{Success:!1,Message:`Error: ${t.message}`,RunParams:null,LogEntry:null}}};f(ce,"GraphQLActionClient");let B=ce;const de=class de{constructor(e){this._dataProvider=e}async RunTest(e){let t;try{e.onProgress&&(t=this._dataProvider.PushStatusUpdates(this._dataProvider.sessionId).subscribe(o=>{try{const n=JSON.parse(o);n.resolver==="RunTestResolver"&&n.type==="TestExecutionProgress"&&n.status==="ok"&&n.data?.progress&&e.onProgress(n.data.progress)}catch(n){console.error("[GraphQLTestingClient] Failed to parse progress message:",n)}}));const r=m.gql`
|
|
735
|
+
mutation RunTest(
|
|
736
|
+
$testId: String!,
|
|
737
|
+
$verbose: Boolean,
|
|
738
|
+
$environment: String
|
|
739
|
+
) {
|
|
740
|
+
RunTest(
|
|
741
|
+
testId: $testId,
|
|
742
|
+
verbose: $verbose,
|
|
743
|
+
environment: $environment
|
|
744
|
+
) {
|
|
745
|
+
success
|
|
746
|
+
errorMessage
|
|
747
|
+
executionTimeMs
|
|
748
|
+
result
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
`,s={testId:e.testId,verbose:e.verbose,environment:e.environment},a=await this._dataProvider.ExecuteGQL(r,s);return this.processTestResult(a.RunTest)}catch(r){return this.handleError(r,"RunTest")}finally{t&&t.unsubscribe()}}async RunTestSuite(e){let t;try{e.onProgress&&(t=this._dataProvider.PushStatusUpdates(this._dataProvider.sessionId).subscribe(o=>{try{const n=JSON.parse(o);n.resolver==="RunTestResolver"&&n.type==="TestExecutionProgress"&&n.status==="ok"&&n.data?.progress&&e.onProgress(n.data.progress)}catch(n){console.error("[GraphQLTestingClient] Failed to parse progress message:",n)}}));const r=m.gql`
|
|
752
|
+
mutation RunTestSuite(
|
|
753
|
+
$suiteId: String!,
|
|
754
|
+
$verbose: Boolean,
|
|
755
|
+
$environment: String,
|
|
756
|
+
$parallel: Boolean
|
|
757
|
+
) {
|
|
758
|
+
RunTestSuite(
|
|
759
|
+
suiteId: $suiteId,
|
|
760
|
+
verbose: $verbose,
|
|
761
|
+
environment: $environment,
|
|
762
|
+
parallel: $parallel
|
|
763
|
+
) {
|
|
764
|
+
success
|
|
765
|
+
errorMessage
|
|
766
|
+
executionTimeMs
|
|
767
|
+
result
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
`,s={suiteId:e.suiteId,verbose:e.verbose,environment:e.environment,parallel:e.parallel},a=await this._dataProvider.ExecuteGQL(r,s);return this.processSuiteResult(a.RunTestSuite)}catch(r){return this.handleError(r,"RunTestSuite")}finally{t&&t.unsubscribe()}}async IsTestRunning(e){try{const t=m.gql`
|
|
771
|
+
query IsTestRunning($testId: String!) {
|
|
772
|
+
IsTestRunning(testId: $testId)
|
|
773
|
+
}
|
|
774
|
+
`;return(await this._dataProvider.ExecuteGQL(t,{testId:e})).IsTestRunning}catch(t){return u.LogError(`Error checking test running status: ${t.message}`),!1}}processTestResult(e){if(!e)throw new Error("Invalid response from server");let t;try{t=w.SafeJSONParse(e.result)}catch{t=e.result}return{success:e.success,errorMessage:e.errorMessage,executionTimeMs:e.executionTimeMs,result:t}}processSuiteResult(e){if(!e)throw new Error("Invalid response from server");let t;try{t=w.SafeJSONParse(e.result)}catch{t=e.result}return{success:e.success,errorMessage:e.errorMessage,executionTimeMs:e.executionTimeMs,result:t}}handleError(e,t){const r=e.message;return u.LogError(`${t} failed: ${r}`),{success:!1,errorMessage:r,result:null}}};f(de,"GraphQLTestingClient");let k=de;const ye=class ye{constructor(e){this._dataProvider=e}async GetRegistryComponent(e){try{const t=m.gql`
|
|
735
775
|
query GetRegistryComponent(
|
|
736
776
|
$registryName: String!,
|
|
737
777
|
$namespace: String!,
|
|
@@ -752,7 +792,7 @@
|
|
|
752
792
|
specification
|
|
753
793
|
}
|
|
754
794
|
}
|
|
755
|
-
`,r={registryName:e.registryName,namespace:e.namespace,name:e.name};e.version!==void 0&&(r.version=e.version),e.hash!==void 0&&(r.hash=e.hash);const s=await this._dataProvider.ExecuteGQL(t,r);if(s&&s.GetRegistryComponent){const a=s.GetRegistryComponent;if(a.notModified&&!a.specification)return null;if(a.specification){if(typeof a.specification=="object")return a.specification;try{return JSON.parse(a.specification)}catch(
|
|
795
|
+
`,r={registryName:e.registryName,namespace:e.namespace,name:e.name};e.version!==void 0&&(r.version=e.version),e.hash!==void 0&&(r.hash=e.hash);const s=await this._dataProvider.ExecuteGQL(t,r);if(s&&s.GetRegistryComponent){const a=s.GetRegistryComponent;if(a.notModified&&!a.specification)return null;if(a.specification){if(typeof a.specification=="object")return a.specification;try{return JSON.parse(a.specification)}catch(o){return u.LogError(`Failed to parse component specification: ${o}`),null}}return null}return null}catch(t){throw u.LogError(t),new Error(`Failed to get registry component: ${t instanceof Error?t.message:"Unknown error"}`)}}async GetRegistryComponentWithHash(e){try{const t=m.gql`
|
|
756
796
|
query GetRegistryComponent(
|
|
757
797
|
$registryName: String!,
|
|
758
798
|
$namespace: String!,
|
|
@@ -773,7 +813,7 @@
|
|
|
773
813
|
specification
|
|
774
814
|
}
|
|
775
815
|
}
|
|
776
|
-
`,r={registryName:e.registryName,namespace:e.namespace,name:e.name};e.version!==void 0&&(r.version=e.version),e.hash!==void 0&&(r.hash=e.hash);const s=await this._dataProvider.ExecuteGQL(t,r);if(s&&s.GetRegistryComponent){const a=s.GetRegistryComponent;let
|
|
816
|
+
`,r={registryName:e.registryName,namespace:e.namespace,name:e.name};e.version!==void 0&&(r.version=e.version),e.hash!==void 0&&(r.hash=e.hash);const s=await this._dataProvider.ExecuteGQL(t,r);if(s&&s.GetRegistryComponent){const a=s.GetRegistryComponent;let o;if(a.specification)try{o=JSON.parse(a.specification)}catch(n){u.LogError(`Failed to parse component specification in GetRegistryComponentWithHash: ${n}`),o=void 0}return{specification:o,hash:a.hash,notModified:a.notModified,message:a.message}}return{specification:void 0,hash:"",notModified:!1,message:"Component not found"}}catch(t){throw u.LogError(t),new Error(`Failed to get registry component with hash: ${t instanceof Error?t.message:"Unknown error"}`)}}async SearchRegistryComponents(e){try{const t=m.gql`
|
|
777
817
|
query SearchRegistryComponents($params: SearchRegistryComponentsInput!) {
|
|
778
818
|
SearchRegistryComponents(params: $params) {
|
|
779
819
|
components
|
|
@@ -815,5 +855,5 @@
|
|
|
815
855
|
error
|
|
816
856
|
}
|
|
817
857
|
}
|
|
818
|
-
`,r=await this._dataProvider.ExecuteGQL(t,{feedback:e});return r&&r.SendComponentFeedback?r.SendComponentFeedback:{success:!1,error:"No response from server"}}catch(t){return u.LogError(t),{success:!1,error:t instanceof Error?t.message:"Unknown error"}}}};f(
|
|
858
|
+
`,r=await this._dataProvider.ExecuteGQL(t,{feedback:e});return r&&r.SendComponentFeedback?r.SendComponentFeedback:{success:!1,error:"No response from server"}}catch(t){return u.LogError(t),{success:!1,error:t instanceof Error?t.message:"Unknown error"}}}};f(ye,"GraphQLComponentRegistryClient");let K=ye;Object.defineProperty(exports,"gql",{enumerable:!0,get:function(){return m.gql}}),exports.ActionItemInput=G,exports.ActionItemOutput=U,exports.FieldMapper=$,exports.GetDataOutput=A,exports.GraphQLAIClient=N,exports.GraphQLActionClient=B,exports.GraphQLComponentRegistryClient=K,exports.GraphQLDataProvider=Se,exports.GraphQLProviderConfigData=C,exports.GraphQLSystemUserClient=M,exports.GraphQLTestingClient=k,exports.GraphQLTransactionGroup=v,exports.RoleInput=b,exports.RolesAndUsersInput=Q,exports.SimpleRemoteEntity=O,exports.SimpleRemoteEntityField=_,exports.SimpleRemoteEntityOutput=q,exports.SyncDataAction=he,exports.SyncDataResult=F,exports.SyncRolesAndUsersResult=V,exports.UserInput=x,exports.setupGraphQLClient=we;
|
|
819
859
|
//# sourceMappingURL=index.cjs.map
|