@adempiere/grpc-api
Advanced tools
Comparing version 4.6.2 to 4.6.3
@@ -282,9 +282,2 @@ /************************************************************************************* | ||
return undefined; | ||
}, | ||
convertResourceFromGRPC(resourceToConvert) { | ||
if (!resourceToConvert) { | ||
return undefined; | ||
} | ||
return resourceToConvert.getData(); | ||
} | ||
@@ -291,0 +284,0 @@ |
{ | ||
"name": "@adempiere/grpc-api", | ||
"version": "4.6.2", | ||
"version": "4.6.3", | ||
"description": "ADempiere Web write in Javascript for a node service", | ||
@@ -5,0 +5,0 @@ "author": "Yamel Senih", |
@@ -144,2 +144,24 @@ // GENERATED CODE -- DO NOT EDIT! | ||
function serialize_file_management_SetAttachmentDescriptionRequest(arg) { | ||
if (!(arg instanceof proto_file_management_pb.SetAttachmentDescriptionRequest)) { | ||
throw new Error('Expected argument of type file_management.SetAttachmentDescriptionRequest'); | ||
} | ||
return Buffer.from(arg.serializeBinary()); | ||
} | ||
function deserialize_file_management_SetAttachmentDescriptionRequest(buffer_arg) { | ||
return proto_file_management_pb.SetAttachmentDescriptionRequest.deserializeBinary(new Uint8Array(buffer_arg)); | ||
} | ||
function serialize_file_management_SetResourceReferenceDescriptionRequest(arg) { | ||
if (!(arg instanceof proto_file_management_pb.SetResourceReferenceDescriptionRequest)) { | ||
throw new Error('Expected argument of type file_management.SetResourceReferenceDescriptionRequest'); | ||
} | ||
return Buffer.from(arg.serializeBinary()); | ||
} | ||
function deserialize_file_management_SetResourceReferenceDescriptionRequest(buffer_arg) { | ||
return proto_file_management_pb.SetResourceReferenceDescriptionRequest.deserializeBinary(new Uint8Array(buffer_arg)); | ||
} | ||
function serialize_file_management_SetResourceReferenceRequest(arg) { | ||
@@ -159,4 +181,15 @@ if (!(arg instanceof proto_file_management_pb.SetResourceReferenceRequest)) { | ||
var FileManagementService = exports.FileManagementService = { | ||
// Service for get a resource from resource uuid | ||
getResource: { | ||
// Resource/File | ||
loadResource: { | ||
path: '/file_management.FileManagement/LoadResource', | ||
requestStream: true, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.LoadResourceRequest, | ||
responseType: proto_file_management_pb.ResourceReference, | ||
requestSerialize: serialize_file_management_LoadResourceRequest, | ||
requestDeserialize: deserialize_file_management_LoadResourceRequest, | ||
responseSerialize: serialize_file_management_ResourceReference, | ||
responseDeserialize: deserialize_file_management_ResourceReference, | ||
}, | ||
getResource: { | ||
path: '/file_management.FileManagement/GetResource', | ||
@@ -172,28 +205,26 @@ requestStream: false, | ||
}, | ||
// Service for set a resource with resource uuid | ||
loadResource: { | ||
path: '/file_management.FileManagement/LoadResource', | ||
requestStream: true, | ||
// Attachment | ||
setAttachmentDescription: { | ||
path: '/file_management.FileManagement/SetAttachmentDescription', | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.LoadResourceRequest, | ||
responseType: proto_file_management_pb.ResourceReference, | ||
requestSerialize: serialize_file_management_LoadResourceRequest, | ||
requestDeserialize: deserialize_file_management_LoadResourceRequest, | ||
responseSerialize: serialize_file_management_ResourceReference, | ||
responseDeserialize: deserialize_file_management_ResourceReference, | ||
requestType: proto_file_management_pb.SetAttachmentDescriptionRequest, | ||
responseType: proto_file_management_pb.Attachment, | ||
requestSerialize: serialize_file_management_SetAttachmentDescriptionRequest, | ||
requestDeserialize: deserialize_file_management_SetAttachmentDescriptionRequest, | ||
responseSerialize: serialize_file_management_Attachment, | ||
responseDeserialize: deserialize_file_management_Attachment, | ||
}, | ||
// Service for get a resource reference from image, attachment or archive | ||
getResourceReference: { | ||
path: '/file_management.FileManagement/GetResourceReference', | ||
existsAttachment: { | ||
path: '/file_management.FileManagement/ExistsAttachment', | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.GetResourceReferenceRequest, | ||
responseType: proto_file_management_pb.ResourceReference, | ||
requestSerialize: serialize_file_management_GetResourceReferenceRequest, | ||
requestDeserialize: deserialize_file_management_GetResourceReferenceRequest, | ||
responseSerialize: serialize_file_management_ResourceReference, | ||
responseDeserialize: deserialize_file_management_ResourceReference, | ||
requestType: proto_file_management_pb.ExistsAttachmentRequest, | ||
responseType: proto_file_management_pb.ExistsAttachmentResponse, | ||
requestSerialize: serialize_file_management_ExistsAttachmentRequest, | ||
requestDeserialize: deserialize_file_management_ExistsAttachmentRequest, | ||
responseSerialize: serialize_file_management_ExistsAttachmentResponse, | ||
responseDeserialize: deserialize_file_management_ExistsAttachmentResponse, | ||
}, | ||
// Service for get a attachment from table and record uuid | ||
getAttachment: { | ||
getAttachment: { | ||
path: '/file_management.FileManagement/GetAttachment', | ||
@@ -209,3 +240,3 @@ requestStream: false, | ||
}, | ||
// Service for set a resource reference from image, attachment or archive | ||
// Resource Reference | ||
setResourceReference: { | ||
@@ -222,4 +253,25 @@ path: '/file_management.FileManagement/SetResourceReference', | ||
}, | ||
// Delete resource reference | ||
deleteResourceReference: { | ||
setResourceReferenceDescription: { | ||
path: '/file_management.FileManagement/SetResourceReferenceDescription', | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.SetResourceReferenceDescriptionRequest, | ||
responseType: proto_file_management_pb.ResourceReference, | ||
requestSerialize: serialize_file_management_SetResourceReferenceDescriptionRequest, | ||
requestDeserialize: deserialize_file_management_SetResourceReferenceDescriptionRequest, | ||
responseSerialize: serialize_file_management_ResourceReference, | ||
responseDeserialize: deserialize_file_management_ResourceReference, | ||
}, | ||
getResourceReference: { | ||
path: '/file_management.FileManagement/GetResourceReference', | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.GetResourceReferenceRequest, | ||
responseType: proto_file_management_pb.ResourceReference, | ||
requestSerialize: serialize_file_management_GetResourceReferenceRequest, | ||
requestDeserialize: deserialize_file_management_GetResourceReferenceRequest, | ||
responseSerialize: serialize_file_management_ResourceReference, | ||
responseDeserialize: deserialize_file_management_ResourceReference, | ||
}, | ||
deleteResourceReference: { | ||
path: '/file_management.FileManagement/DeleteResourceReference', | ||
@@ -235,16 +287,4 @@ requestStream: false, | ||
}, | ||
// Exists Attachment on Record | ||
existsAttachment: { | ||
path: '/file_management.FileManagement/ExistsAttachment', | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: proto_file_management_pb.ExistsAttachmentRequest, | ||
responseType: proto_file_management_pb.ExistsAttachmentResponse, | ||
requestSerialize: serialize_file_management_ExistsAttachmentRequest, | ||
requestDeserialize: deserialize_file_management_ExistsAttachmentRequest, | ||
responseSerialize: serialize_file_management_ExistsAttachmentResponse, | ||
responseDeserialize: deserialize_file_management_ExistsAttachmentResponse, | ||
}, | ||
}; | ||
exports.FileManagementClient = grpc.makeGenericClientConstructor(FileManagementService); |
@@ -62,2 +62,37 @@ /************************************************************************************* | ||
/** | ||
* Set Attachment Description | ||
* @param {string} tableName | ||
* @param {number} recordId | ||
* @param {string} recordUuid | ||
* @param {string} token | ||
*/ | ||
setAttachmentDescription({ | ||
token, | ||
// DSL | ||
id, | ||
uuid, | ||
textMessage | ||
}, callback) { | ||
const { SetAttachmentDescriptionRequest } = this.stubFile; | ||
const request = new SetAttachmentDescriptionRequest(); | ||
request.setId( | ||
getValidInteger(id) | ||
); | ||
request.setUuid(uuid); | ||
request.setTextMessage(textMessage); | ||
const metadata = getMetadata({ | ||
token | ||
}); | ||
this.getFileManagementService().setAttachmentDescription( | ||
request, | ||
metadata, | ||
callback | ||
); | ||
} | ||
/** | ||
* Exists Attachment On Record | ||
@@ -211,5 +246,6 @@ * @param {string} tableName | ||
recordUuid, | ||
textMessage, | ||
fileName, | ||
fileSize | ||
fileSize, | ||
description, | ||
textMessage | ||
}, callback) { | ||
@@ -224,6 +260,8 @@ const { SetResourceReferenceRequest } = this.stubFile; | ||
request.setRecordUuid(recordUuid); | ||
request.setTextMessage(textMessage); | ||
request.setFileName(fileName); | ||
request.setFileSize(fileSize); | ||
request.setDescription(description); | ||
request.setTextMessage(textMessage); | ||
const metadata = getMetadata({ | ||
@@ -240,2 +278,33 @@ token | ||
setResourceReferenceDescription({ | ||
token, | ||
id, | ||
uuid, | ||
fileName, | ||
description, | ||
textMessage | ||
}, callback) { | ||
const { SetResourceReferenceDescriptionRequest } = this.stubFile; | ||
const request = new SetResourceReferenceDescriptionRequest(); | ||
request.setId( | ||
getValidInteger(id) | ||
); | ||
request.setUuid(uuid); | ||
request.setFileName(fileName); | ||
request.setDescription(description); | ||
request.setTextMessage(textMessage); | ||
const metadata = getMetadata({ | ||
token | ||
}); | ||
this.getFileManagementService().setResourceReferenceDescription( | ||
request, | ||
metadata, | ||
callback | ||
); | ||
} | ||
/** | ||
@@ -242,0 +311,0 @@ * Get Resource information |
@@ -269,3 +269,3 @@ /************************************************************************************* | ||
description: resourceReferenceToConvert.getDescription(), | ||
text_msg: resourceReferenceToConvert.getTextMsg(), | ||
text_message: resourceReferenceToConvert.getTextMessage(), | ||
content_type: resourceReferenceToConvert.getContentType() | ||
@@ -275,20 +275,2 @@ }; | ||
function getAttachmentFromGRPC(attachmentToConvert) { | ||
if (!attachmentToConvert) { | ||
return undefined; | ||
} | ||
return { | ||
id: attachmentToConvert.getId(), | ||
uuid: attachmentToConvert.getUuid(), | ||
attachment_uuid: attachmentToConvert.getUuid(), // TODO: Remove when add support to uuid attribute | ||
title: attachmentToConvert.getTitle(), | ||
text_msg: attachmentToConvert.getTextMsg(), | ||
resource_references_list: attachmentToConvert.getResourceReferencesList().map(itemResourceReference => { | ||
return getResourceReferenceFromGRPC( | ||
itemResourceReference | ||
); | ||
}) | ||
}; | ||
} | ||
module.exports = { | ||
@@ -304,3 +286,2 @@ getBooleanValueFromGRPC, | ||
getRecordReferenceInfoFromGRPC, | ||
getAttachmentFromGRPC, | ||
getResourceReferenceFromGRPC, | ||
@@ -307,0 +288,0 @@ getOperator, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6755763
191512