@memberjunction/graphql-dataprovider 2.98.0 → 2.99.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 +24 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +22 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1422,9 +1422,9 @@ interface RunViewSystemUserInput {
|
|
|
1422
1422
|
*/
|
|
1423
1423
|
interface RunViewSystemUserResultRow {
|
|
1424
1424
|
/**
|
|
1425
|
-
*
|
|
1425
|
+
* Primary key fields and values for the record
|
|
1426
1426
|
*/
|
|
1427
|
-
|
|
1427
|
+
PrimaryKey: KeyValuePair[];
|
|
1428
1428
|
/**
|
|
1429
1429
|
* ID of the entity type this record belongs to
|
|
1430
1430
|
*/
|
package/dist/index.d.mts
CHANGED
|
@@ -1422,9 +1422,9 @@ interface RunViewSystemUserInput {
|
|
|
1422
1422
|
*/
|
|
1423
1423
|
interface RunViewSystemUserResultRow {
|
|
1424
1424
|
/**
|
|
1425
|
-
*
|
|
1425
|
+
* Primary key fields and values for the record
|
|
1426
1426
|
*/
|
|
1427
|
-
|
|
1427
|
+
PrimaryKey: KeyValuePair[];
|
|
1428
1428
|
/**
|
|
1429
1429
|
* ID of the entity type this record belongs to
|
|
1430
1430
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0});import{gql as m,GraphQLClient as ce}from"graphql-request";import{gql as Be}from"graphql-request";import{TransactionGroupBase as De,TransactionResult as Ie,LogError as d,ProviderConfigDataBase as we,ProviderBase as he,UserInfo as de,ProviderType as Ee,BaseEntityResult as ye,EntityFieldTSType as h,TransactionItem as me,UserRoleInfo as Pe,SetProvider as $e}from"@memberjunction/core";import{ViewInfo as ge}from"@memberjunction/core-entities";import{openDB as Ne}from"@tempfix/idb";import{Observable as fe}from"rxjs";import{createClient as Se}from"graphql-ws";import{v4 as ve}from"uuid";import{SafeJSONParse as $,MJGlobal as Ce,MJEventType as Ve}from"@memberjunction/global";const
|
|
1
|
+
var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0});import{gql as m,GraphQLClient as ce}from"graphql-request";import{gql as Be}from"graphql-request";import{TransactionGroupBase as De,TransactionResult as Ie,LogError as d,ProviderConfigDataBase as we,ProviderBase as he,UserInfo as de,ProviderType as Ee,BaseEntityResult as ye,EntityFieldTSType as h,TransactionItem as me,UserRoleInfo as Pe,SetProvider as $e}from"@memberjunction/core";import{ViewInfo as ge}from"@memberjunction/core-entities";import{openDB as Ne}from"@tempfix/idb";import{Observable as fe}from"rxjs";import{createClient as Se}from"graphql-ws";import{v4 as ve}from"uuid";import{SafeJSONParse as $,MJGlobal as Ce,MJEventType as Ve}from"@memberjunction/global";const k=class k{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}};p(k,"FieldMapper");let P=k;const J=class J extends De{constructor(e){super(),this._provider=e}async HandleSubmit(){const e=m`
|
|
2
2
|
mutation ExecuteTransactionGroup($group: TransactionInputType!) {
|
|
3
3
|
ExecuteTransactionGroup(group: $group) {
|
|
4
4
|
Success
|
|
@@ -186,7 +186,10 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
186
186
|
query RunViewsQuery ($input: [RunViewGenericInput!]!) {
|
|
187
187
|
RunViews(input: $input) {
|
|
188
188
|
Results {
|
|
189
|
-
|
|
189
|
+
PrimaryKey {
|
|
190
|
+
FieldName
|
|
191
|
+
Value
|
|
192
|
+
}
|
|
190
193
|
EntityID
|
|
191
194
|
Data
|
|
192
195
|
}
|
|
@@ -401,7 +404,10 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
401
404
|
}`,{data:e});return r&&r.SyncRolesAndUsers?r.SyncRolesAndUsers:{Success:!1}}catch(t){return d(`GraphQLSystemUserClient::SyncRolesAndUsers - Error syncing roles and users - ${t}`),{Success:!1}}}async RunViewByName(e){try{const r=await this.Client.request(`query RunViewByNameSystemUser($input: RunViewByNameInput!) {
|
|
402
405
|
RunViewByNameSystemUser(input: $input) {
|
|
403
406
|
Results {
|
|
404
|
-
|
|
407
|
+
PrimaryKey {
|
|
408
|
+
FieldName
|
|
409
|
+
Value
|
|
410
|
+
}
|
|
405
411
|
EntityID
|
|
406
412
|
Data
|
|
407
413
|
}
|
|
@@ -415,7 +421,10 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
415
421
|
}`,{input:e});return r&&r.RunViewByNameSystemUser?r.RunViewByNameSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by name"}}catch(t){return d(`GraphQLSystemUserClient::RunViewByNameSystemUser - Error running view by name - ${t}`),{Results:[],Success:!1,ErrorMessage:t.toString()}}}async RunViewByID(e){try{const r=await this.Client.request(`query RunViewByIDSystemUser($input: RunViewByIDInput!) {
|
|
416
422
|
RunViewByIDSystemUser(input: $input) {
|
|
417
423
|
Results {
|
|
418
|
-
|
|
424
|
+
PrimaryKey {
|
|
425
|
+
FieldName
|
|
426
|
+
Value
|
|
427
|
+
}
|
|
419
428
|
EntityID
|
|
420
429
|
Data
|
|
421
430
|
}
|
|
@@ -429,7 +438,10 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
429
438
|
}`,{input:e});return r&&r.RunViewByIDSystemUser?r.RunViewByIDSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute view by ID"}}catch(t){return d(`GraphQLSystemUserClient::RunViewByIDSystemUser - Error running view by ID - ${t}`),{Results:[],Success:!1,ErrorMessage:t.toString()}}}async RunDynamicView(e){try{const r=await this.Client.request(`query RunDynamicViewSystemUser($input: RunDynamicViewInput!) {
|
|
430
439
|
RunDynamicViewSystemUser(input: $input) {
|
|
431
440
|
Results {
|
|
432
|
-
|
|
441
|
+
PrimaryKey {
|
|
442
|
+
FieldName
|
|
443
|
+
Value
|
|
444
|
+
}
|
|
433
445
|
EntityID
|
|
434
446
|
Data
|
|
435
447
|
}
|
|
@@ -443,7 +455,10 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
443
455
|
}`,{input:e});return r&&r.RunDynamicViewSystemUser?r.RunDynamicViewSystemUser:{Results:[],Success:!1,ErrorMessage:"Failed to execute dynamic view"}}catch(t){return d(`GraphQLSystemUserClient::RunDynamicViewSystemUser - Error running dynamic view - ${t}`),{Results:[],Success:!1,ErrorMessage:t.toString()}}}async RunViews(e){try{const r=await this.Client.request(`query RunViewsSystemUser($input: [RunViewGenericInput!]!) {
|
|
444
456
|
RunViewsSystemUser(input: $input) {
|
|
445
457
|
Results {
|
|
446
|
-
|
|
458
|
+
PrimaryKey {
|
|
459
|
+
FieldName
|
|
460
|
+
Value
|
|
461
|
+
}
|
|
447
462
|
EntityID
|
|
448
463
|
Data
|
|
449
464
|
}
|
|
@@ -704,5 +719,5 @@ var Re=Object.defineProperty;var p=(I,e)=>Re(I,"name",{value:e,configurable:!0})
|
|
|
704
719
|
ResultData
|
|
705
720
|
}
|
|
706
721
|
}
|
|
707
|
-
`;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){d(`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 d(`Error running entity action: ${t}`),{Success:!1,Message:`Error: ${t.message}`,RunParams:null,LogEntry:null}}};p(le,"GraphQLActionClient");let
|
|
722
|
+
`;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){d(`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 d(`Error running entity action: ${t}`),{Success:!1,Message:`Error: ${t.message}`,RunParams:null,LogEntry:null}}};p(le,"GraphQLActionClient");let K=le;export{G as ActionItemInput,A as ActionItemOutput,P as FieldMapper,q as GetDataOutput,v as GraphQLAIClient,K as GraphQLActionClient,C as GraphQLDataProvider,V as GraphQLProviderConfigData,L as GraphQLSystemUserClient,N as GraphQLTransactionGroup,F as RoleInput,Q as RolesAndUsersInput,_ as SimpleRemoteEntity,B as SimpleRemoteEntityField,O as SimpleRemoteEntityOutput,pe as SyncDataAction,b as SyncDataResult,T as SyncRolesAndUsersResult,M as UserInput,Be as gql,Ue as setupGraphQLClient};
|
|
708
723
|
//# sourceMappingURL=index.mjs.map
|