Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 56] = [
const VERSIONED_REQUESTS: [&str; 57] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
"GetDocumentHistoryRequest",
"GetDocumentsRequest",
"GetIdentitiesByPublicKeyHashesRequest",
"GetIdentitiesRequest",
Expand Down Expand Up @@ -161,10 +162,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// - "GetIdentityByNonUniquePublicKeyHashResponse"
//
// "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
const VERSIONED_RESPONSES: [&str; 54] = [
const VERSIONED_RESPONSES: [&str; 55] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
"GetDocumentHistoryResponse",
"GetDocumentsResponse",
"GetIdentitiesByPublicKeyHashesResponse",
"GetIdentitiesResponse",
Expand Down
1,531 changes: 1,531 additions & 0 deletions packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const {
GetDataContractResponse: PBJSGetDataContractResponse,
GetDataContractHistoryRequest: PBJSGetDataContractHistoryRequest,
GetDataContractHistoryResponse: PBJSGetDataContractHistoryResponse,
GetDocumentHistoryRequest: PBJSGetDocumentHistoryRequest,
GetDocumentHistoryResponse: PBJSGetDocumentHistoryResponse,
GetDocumentsRequest: PBJSGetDocumentsRequest,
GetDocumentsResponse: PBJSGetDocumentsResponse,
GetIdentityByPublicKeyHashRequest: PBJSGetIdentityByPublicKeyHashRequest,
Expand Down Expand Up @@ -75,6 +77,7 @@ const {
GetIdentitiesContractKeysResponse: ProtocGetIdentitiesContractKeysResponse,
GetDataContractResponse: ProtocGetDataContractResponse,
GetDataContractHistoryResponse: ProtocGetDataContractHistoryResponse,
GetDocumentHistoryResponse: ProtocGetDocumentHistoryResponse,
GetDocumentsResponse: ProtocGetDocumentsResponse,
GetIdentityByPublicKeyHashResponse: ProtocGetIdentityByPublicKeyHashResponse,
WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
Expand Down Expand Up @@ -134,6 +137,10 @@ class PlatformPromiseClient {
this.client.getDataContractHistory.bind(this.client),
);

this.client.getDocumentHistory = promisify(
this.client.getDocumentHistory.bind(this.client),
);

this.client.getDocuments = promisify(
this.client.getDocuments.bind(this.client),
);
Expand Down Expand Up @@ -349,6 +356,38 @@ class PlatformPromiseClient {
);
}

/**
*
* @param {!GetDocumentHistoryRequest} getDocumentHistoryRequest
* @param {?Object<string, string>} metadata
* @param {CallOptions} [options={}]
* @returns {Promise<!GetDocumentHistoryResponse>}
*/
getDocumentHistory(getDocumentHistoryRequest, metadata = {}, options = {}) {
if (!isObject(metadata)) {
throw new Error('metadata must be an object');
}

return this.client.getDocumentHistory(
getDocumentHistoryRequest,
convertObjectToMetadata(metadata),
{
interceptors: [
jsonToProtobufInterceptorFactory(
jsonToProtobufFactory(
ProtocGetDocumentHistoryResponse,
PBJSGetDocumentHistoryResponse,
),
protobufToJsonFactory(
PBJSGetDocumentHistoryRequest,
),
),
],
...options,
},
);
}

/**
*
* @param {!GetDocumentsRequest} getDocumentsRequest
Expand Down
1,531 changes: 1,531 additions & 0 deletions packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js

Large diffs are not rendered by default.

Loading
Loading