From 16e988cc6a82772b4580934e536f4133e6f0feb9 Mon Sep 17 00:00:00 2001 From: EdwinBetanc0urt Date: Wed, 22 Jan 2020 17:18:16 -0400 Subject: [PATCH] feat: Add data client API implementation for Chat Entry and Record Chat. (#251) --- package.json | 2 +- src/api/ADempiere/data.js | 52 ++++++++++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index f9cbdbb6..8ae1b3e0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@adempiere/grpc-access-client": "^1.1.8", - "@adempiere/grpc-data-client": "^1.9.1", + "@adempiere/grpc-data-client": "^1.9.2", "@adempiere/grpc-dictionary-client": "^1.3.5", "@adempiere/grpc-enrollment-client": "^1.0.7", "autoprefixer": "^9.5.1", diff --git a/src/api/ADempiere/data.js b/src/api/ADempiere/data.js index 0c9a094a..4cc38ac8 100644 --- a/src/api/ADempiere/data.js +++ b/src/api/ADempiere/data.js @@ -27,7 +27,7 @@ export function convertValueFromGRPC(grpcValue) { * @param {array} parameters.attributesList */ export function createEntity({ tableName, attributesList }) { - return Instance.call(this).createEntity({ + return Instance.call(this).requestCreateEntity({ tableName, attributesList }) @@ -41,7 +41,7 @@ export function createEntity({ tableName, attributesList }) { * @param {array} attributesList */ export function updateEntity({ tableName, recordId, recordUuid, attributesList }) { - return Instance.call(this).updateEntity({ + return Instance.call(this).requestUpdateEntity({ tableName, recordId, recordUuid, @@ -56,7 +56,7 @@ export function updateEntity({ tableName, recordId, recordUuid, attributesList } * @param {string} recordUuid */ export function deleteEntity({ tableName, recordId, recordUuid }) { - return Instance.call(this).deleteEntity({ + return Instance.call(this).requestDeleteEntity({ tableName, recordId, recordUuid @@ -64,7 +64,7 @@ export function deleteEntity({ tableName, recordId, recordUuid }) { } export function getEntity({ tableName, recordId, recordUuid }) { - return Instance.call(this).requestEntity({ + return Instance.call(this).requestGetEntity({ tableName, recordId, recordUuid @@ -89,7 +89,7 @@ export function getEntitiesList({ nextPageToken: pageToken, pageSize }) { - return Instance.call(this).requestEntitiesList({ + return Instance.call(this).requestListEntities({ tableName, query, whereClause, @@ -111,7 +111,7 @@ export function rollbackEntity({ recordId, eventType }) { - return Instance.call(this).rollbackEntityRequest({ + return Instance.call(this).requestRollbackEntity({ tableName, recordId, eventTypeExecuted: eventType @@ -253,7 +253,7 @@ export function getReferencesList({ windowUuid, tableName, recordId, recordUuid, * @returns {Map} Entity */ export function runCallOutRequest({ windowUuid, windowNo, tabUuid, tableName, columnName, value, oldValue, callout, attributesList = [] }) { - return Instance.call(this).runCalloutRequest({ + return Instance.call(this).requestRunCallout({ windowUuid, windowNo, tabUuid, @@ -271,11 +271,11 @@ export function getDefaultValueFromServer(query) { } export function getContextInfoValueFromServer({ uuid, query }) { - return Instance.call(this).getContextInfoValue({ uuid, query }) + return Instance.call(this).requestGetContextInfoValue({ uuid, query }) } export function getPrivateAccessFromServer({ tableName, recordId, userUuid }) { - return Instance.call(this).getPrivateAccess({ + return Instance.call(this).requestGetPrivateAccess({ tableName, recordId, userUuid @@ -283,7 +283,7 @@ export function getPrivateAccessFromServer({ tableName, recordId, userUuid }) { } export function lockPrivateAccessFromServer({ tableName, recordId, userUuid }) { - return Instance.call(this).lockPrivateAccess({ + return Instance.call(this).requestLockPrivateAccess({ tableName, recordId, userUuid @@ -291,7 +291,7 @@ export function lockPrivateAccessFromServer({ tableName, recordId, userUuid }) { } export function unlockPrivateAccessFromServer({ tableName, recordId, userUuid }) { - return Instance.call(this).unlockPrivateAccess({ + return Instance.call(this).requestUnlockPrivateAccess({ tableName, recordId, userUuid @@ -386,7 +386,7 @@ export function getReportOutput({ reportName, reportType }) { - return Instance.call(this).getReportOutput({ + return Instance.call(this).requestGetReportOutput({ parametersList, tableName, printFormatUuid, @@ -424,3 +424,31 @@ export function requestListWorkflowsLogs({ pageSize }) } + +/** + * @param {string} tableName + * @param {integer} recordId + * @param {string} pageToken + * @param {string} pageSize + */ +export function requestListRecordChats({ tableName, recordId, pageToken, pageSize }) { + return Instance.call(this).requestListRecordChats({ + tableName, + recordId, + pageToken, + pageSize + }) +} + +/** + * @param {string} uuid + * @param {string} pageToken + * @param {string} pageSize + */ +export function requestListChatEntries({ uuid, pageToken, pageSize }) { + return Instance.call(this).requestListChatEntries({ + uuid, + pageToken, + pageSize + }) +}