Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adempiere/grpc-api

Package Overview
Dependencies
Maintainers
4
Versions
405
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adempiere/grpc-api - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

175

index.js

@@ -754,3 +754,178 @@ /*************************************************************************************

}
// List Print Formats
listPrintFormats({
token,
tableName,
reportViewUuid,
processUuid,
pageSize,
pageToken,
language
}, callback) {
const { ListPrintFormatsRequest } = require('./src/grpc/proto/business_pb.js')
const request = new ListPrintFormatsRequest()
request.setTableName(tableName)
request.setReportViewUuid(reportViewUuid)
request.setProcessUuid(processUuid)
request.setPageSize(pageSize)
request.setPageToken(pageToken)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().listPrintFormats(request, callback)
}
// List Report Views
listReportViews({
token,
tableName,
processUuid,
pageSize,
pageToken,
language
}, callback) {
const { ListReportViewsRequest } = require('./src/grpc/proto/business_pb.js')
const request = new ListReportViewsRequest()
request.setTableName(tableName)
request.setProcessUuid(processUuid)
request.setPageSize(pageSize)
request.setPageToken(pageToken)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().listReportViews(request, callback)
}
// Unlock Private Access
unlockPrivateAccess({
token,
tableName,
id,
uuid,
language
}, callback) {
const { UnlockPrivateAccessRequest } = require('./src/grpc/proto/business_pb.js')
const request = new UnlockPrivateAccessRequest()
request.setTableName(tableName)
request.setId(id)
request.setUuid(uuid)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().unlockPrivateAccess(request, callback)
}
// Lock Private Access
lockPrivateAccess({
token,
tableName,
id,
uuid,
language
}, callback) {
const { LockPrivateAccessRequest } = require('./src/grpc/proto/business_pb.js')
const request = new LockPrivateAccessRequest()
request.setTableName(tableName)
request.setId(id)
request.setUuid(uuid)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().lockPrivateAccess(request, callback)
}
// Get Private Access
getPrivateAccess({
token,
tableName,
id,
uuid,
language
}, callback) {
const { GetPrivateAccessRequest } = require('./src/grpc/proto/business_pb.js')
const request = new GetPrivateAccessRequest()
request.setTableName(tableName)
request.setId(id)
request.setUuid(uuid)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().getPrivateAccess(request, callback)
}
// Get Context Information Value
getContextInfoValue({
token,
query,
uuid,
id,
language
}, callback) {
const { GetContextInfoValueRequest } = require('./src/grpc/proto/business_pb.js')
const request = new GetContextInfoValueRequest()
request.setQuery(query)
request.setUuid(uuid)
request.setId(id)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().getContextInfoValue(request, callback)
}
// List references of record
listReferences({
token,
tableName,
windowUuid,
id,
uuid,
pageSize,
pageToken,
language
}, callback) {
const { ListReferencesRequest } = require('./src/grpc/proto/business_pb.js')
const request = new ListReferencesRequest()
request.setTableName(tableName)
request.setUuid(uuid)
request.setId(id)
request.setWindowUuid(windowUuid)
request.setPageSize(pageSize)
request.setPageToken(pageToken)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().listReferences(request, callback)
}
// List Browser Items
listBrowserItems({
token,
uuid,
parameters,
tableName,
// DSL
filters,
// Custom Query
query,
whereClause,
orderByClause,
limit,
pageSize,
pageToken,
language
}, callback) {
const { ListBrowserItemsRequest } = require('./src/grpc/proto/business_pb.js')
const request = new ListBrowserItemsRequest()
const { convertCriteriaToGRPC } = require('./lib/convertValues.js');
request.setCriteria(convertCriteriaToGRPC({
tableName,
filters,
query,
whereClause,
orderByClause,
limit
}))
// selections
if(parameters) {
parameters.forEach(parameter => {
request.addParameters(convertParameterToGRPC({
columnName: parameter.key,
value: parameter.value
}))
})
}
request.setUuid(uuid)
request.setPageSize(pageSize)
request.setPageToken(pageToken)
request.setClientRequest(this.createClientRequest(token, language))
this.getUIService().listBrowserItems(request, callback)
}
}
module.exports = Api;

83

lib/convertBaseDataType.js

@@ -207,11 +207,11 @@ /*************************************************************************************

convertRecordReferenceInfoFromGRPC(recordReferenceInfoToConvert) {
if (recordReferenceInfoToConvert) {
convertRecordReferenceInfoFromGRPC(referenceInfo) {
if (referenceInfo) {
return {
uuid: recordReferenceInfoToConvert.getUuid(),
windowUuid: recordReferenceInfoToConvert.getWindowuuid(),
displayName: recordReferenceInfoToConvert.getDisplayName(),
tableName: recordReferenceInfoToConvert.getTableName(),
whereClause: recordReferenceInfoToConvert.getWhereClause(),
recordCount: recordReferenceInfoToConvert.getRecordCount()
uuid: referenceInfo.getUuid(),
window_uuid: referenceInfo.getWindowUuid(),
display_name: referenceInfo.getDisplayName(),
table_name: referenceInfo.getTableName(),
where_clause: referenceInfo.getWhereClause(),
record_count: referenceInfo.getRecordCount()
};

@@ -244,21 +244,46 @@ }

convertEntityFromGRPC({ entityToConvert, formatToConvert = 'array' }) {
if (entityToConvert) {
const { convertValuesMapFromGRPC } = require('./convertValues.js');
// convertEntityFromGRPC({ entityToConvert, formatToConvert = 'array' }) {
// if (entityToConvert) {
// const { convertValuesMapFromGRPC } = require('./convertValues.js');
//
// return {
// id: entityToConvert.getId(),
// uuid: entityToConvert.getUuid(),
// tableName: entityToConvert.getTableName(),
// values: convertValuesMapFromGRPC({
// mapToConvert: entityToConvert.getValuesMap(),
// returnType: formatToConvert,
// keyName: 'columnName',
// valueName: 'value'
// })
// };
// }
// return undefined;
// },
return {
id: entityToConvert.getId(),
uuid: entityToConvert.getUuid(),
tableName: entityToConvert.getTableName(),
values: convertValuesMapFromGRPC({
mapToConvert: entityToConvert.getValuesMap(),
returnType: formatToConvert,
keyName: 'columnName',
valueName: 'value'
})
};
// Convert Entity
convertEntityFromGRPC (entity) {
if (!entity) {
return undefined
}
return undefined;
return {
id: entity.getId(),
uuid: entity.getUuid(),
table_name: entity.getTableName(),
attributes: convertBaseDataType.convertAttributes(entity.getValuesMap())
}
},
// get Context
convertAttributes (context) {
let values = []
context.forEach((value, key) => {
values.push({
key: key,
value: convertBaseDataType.convertValueFromGRPC(value)
})
})
return values
},
convertProcessLogFromGRPC(processLogToConvert) {

@@ -394,9 +419,9 @@ if (processLogToConvert) {

convertReportViewFromGRPC(reportViewToConvert) {
if (reportViewToConvert) {
convertReportViewFromGRPC(reportView) {
if (reportView) {
return {
reportViewUuid: reportViewToConvert.getUuid(),
name: reportViewToConvert.getName(),
description: reportViewToConvert.getDescription(),
tableName: reportViewToConvert.getTableName()
report_view_uuid: reportView.getUuid(),
name: reportView.getName(),
description: reportView.getDescription(),
table_name: reportView.getTableName()
};

@@ -403,0 +428,0 @@ }

@@ -35,8 +35,8 @@ /*************************************************************************************

convertPrivateAccessFromGRPC(privateAccessToConvert) {
if (privateAccessToConvert) {
convertPrivateAccessFromGRPC(privateAccess) {
if (privateAccess) {
return {
tableName: privateAccessToConvert.getTablename(),
recordId: privateAccessToConvert.getRecordid(),
userUuid: privateAccessToConvert.getUseruuid()
table_name: privateAccess.getTableName(),
id: privateAccess.getId(),
uuid: privateAccess.getUuid()
};

@@ -43,0 +43,0 @@ }

@@ -140,2 +140,294 @@ /*************************************************************************************

});
},
/**
* Get all event type or get key value type from value
* @param {number} value
* @param {string} key
* @returns {number|string|object}
INSERT = 0;
UPDATE = 1;
DELETE = 2;
*/
getRollbackEntityRequest_EventType({ key, value }) {
const { RollbackEntityRequest } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { EventType } = RollbackEntityRequest;
return convertEnums.getValueOrKey({
list: EventType,
key,
value
});
},
/**
* Get all confidential type or get key value type from value
* @param {number} value
* @param {string} key
PUBLIC: 0,
PARTER: 1,
INTERNAL: 2,
*/
getRecordChat_ConfidentialType({ key, value }) {
const { RecordChat } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ConfidentialType } = RecordChat;
return convertEnums.getValueOrKey({
list: ConfidentialType,
key,
value
});
},
/**
* Get all moderation type or get key value type from value
* @param {number} value
* @param {string} key
NOT_MODERATED: 0,
BEFORE_PUBLISHING: 1,
AFTER_PUBLISHING: 2,
*/
getRecordChat_ModerationType({ key, value }) {
const { RecordChat } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ModerationType } = RecordChat;
return convertEnums.getValueOrKey({
list: ModerationType,
key,
value
});
},
/**
* Get all confidential type or get key value type from value
* @param {number} value
* @param {string} key
PUBLIC = 0;
PARTER = 1;
INTERNAL = 2;
*/
getChatEntry_ConfidentialType({ key, value }) {
const { ChatEntry } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ConfidentialType } = ChatEntry;
return convertEnums.getValueOrKey({
list: ConfidentialType,
key,
value
});
},
/**
* Get all moderation status or get key value type from value
* @param {number} value
* @param {string} key
NOT_DISPLAYED = 0;
PUBLISHED = 1;
SUSPICIUS = 2;
TO_BE_REVIEWED = 3;
*/
getChatEntry_ModeratorStatus({ key, value }) {
const { ChatEntry } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ModeratorStatus } = ChatEntry;
return convertEnums.getValueOrKey({
list: ModeratorStatus,
key,
value
});
},
/**
* Get all chat entry type or get key value type from value
* @param {number} value
* @param {string} key
NOTE_FLAT = 0;
FORUM_THREADED = 1;
WIKI = 2;
*/
getChatEntry_ChatEntryType({ key, value }) {
const { ChatEntry } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ChatEntryType } = ChatEntry;
return convertEnums.getValueOrKey({
list: ChatEntryType,
key,
value
});
},
/**
* Get all workflow state or get key value type from value
* @param {number} value
* @param {string} key
RUNNING: 0,
COMPLETED: 1,
ABORTED: 2,
TERMINATED: 3,
SUSPENDED: 4,
NOT_STARTED: 5,
*/
getWorkflowProcess_WorkflowState({ key, value }) {
const { WorkflowProcess } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { WorkflowState } = WorkflowProcess;
return convertEnums.getValueOrKey({
list: WorkflowState,
key,
value
});
},
/**
* Get all workflow priority or get key value type from value
* @param {number} value
* @param {string} key
URGENT: 0,
HIGH: 1,
MEDIUM: 2,
LOW: 3,
MINOR: 4,
*/
getWorkflowProcess_WorkflowPriority({ key, value }) {
const { WorkflowProcess } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { Priority } = WorkflowProcess;
return convertEnums.getValueOrKey({
list: Priority,
key,
value
});
},
/**
* Get all workflow event type or get key value type from value
* @param {number} value
* @param {string} key
PROCESS_CREATED = 0;
PROCESS_COMPLETED = 1;
STATE_CHANGED = 2;
*/
getWorkflowEvent_EventType({ key, value }) {
const { WorkflowEvent } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { EventType } = WorkflowEvent;
return convertEnums.getValueOrKey({
list: EventType,
key,
value
});
},
/**
* Get all workflow definition publush status or get key value type from value
* @param {number} value
* @param {string} key
RELEASED = 0;
TEST = 1;
UNDER_REVISION = 2;
VOID = 3;
*/
getWorkflowDefinition_PublishStatus({key, value }) {
const { WorkflowDefinition } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { PublishStatus } = WorkflowDefinition;
return convertEnums.getValueOrKey({
list: PublishStatus,
key,
value
});
},
/**
* Get all workflow definition duration unit or get key value type from value
* @param {number} value
* @param {string} key
DAY = 0;
HOUR = 1;
MINUTE = 2;
MONTH = 3;
SECOND = 4;
YEAR = 5;
*/
getWorkflowDefinition_DurationUnit({ key, value }) {
const { WorkflowDefinition } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { DurationUnit } = WorkflowDefinition;
return convertEnums.getValueOrKey({
list: DurationUnit,
key,
value
});
},
/**
* Get all workflow node action or get key value type from value
* @param {number} value
* @param {string} key
USER_CHOICE = 0;
DOCUMENT_ACTION = 1;
SUB_WORKFLOW = 2;
EMAIL = 3;
APPS_PROCESS = 4;
SMART_VIEW = 5;
APPS_REPORT = 6;
SMART_BROWSE = 7;
APPS_TASK = 8;
SET_VARIABLE = 9;
USER_WINDOW = 10;
USER_FORM = 11;
WAIT_SLEEP = 12;
*/
getWorkflowNode_Action({ value, key }) {
const { WorkflowNode } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { Action } = WorkflowNode;
return convertEnums.getValueOrKey({
list: Action,
key,
value
});
},
/**
* Get all workflow condition, condition type action or get key value type from value
* @param {number} value
* @param {string} key
AND = 0;
OR = 1;
*/
getWorkflowCondition_ConditionType({ key, value }) {
const { WorkflowCondition } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { ConditionType } = WorkflowCondition;
return convertEnums.getValueOrKey({
list: ConditionType,
key,
value
});
},
/**
* Get all workflow condition, condition type action or get key value type from value
* @param {number} value
* @param {string} key
EQUAL = 0;
NOT_EQUAL = 1;
LIKE = 2;
GREATER = 4;
GREATER_EQUAL = 5;
LESS = 6;
LESS_EQUAL = 7;
BETWEEN = 8;
SQL = 9;
*/
getWorkflowCondition_Operation({ value, key }) {
const { WorkflowCondition } = require('@adempiere/grpc-api/src/grpc/proto/business_pb.js');
const { Operation } = WorkflowCondition;
return convertEnums.getValueOrKey({
list: Operation,
key,
value
});
}

@@ -142,0 +434,0 @@

{
"name": "@adempiere/grpc-api",
"version": "1.1.2",
"version": "1.1.3",
"description": "ADempiere Web Store write in Javascript for a node service",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc