From 583e902551ad2866944b94bd4248fdcd32edd5f9 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Mon, 2 Dec 2019 08:26:30 +0000 Subject: [PATCH] [FABN-1407] Add PDC and EP types (#38) Add typings for a private data collection configuration and endorsmeent policy to ChaincodeInstantiateUpgradeRequest. Signed-off-by: Simon Stone Change-Id: I32f1789dbb96fecc88d03fcd841356d21fcb89e9 --- fabric-client/types/index.d.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/fabric-client/types/index.d.ts b/fabric-client/types/index.d.ts index 76c204a79d..5bb6b93162 100644 --- a/fabric-client/types/index.d.ts +++ b/fabric-client/types/index.d.ts @@ -568,17 +568,35 @@ declare namespace Client { // tslint:disable-line:no-namespace export type ChaincodeInstallRequestv1 = ChaincodePackageInstallRequest | ChaincodePathInstallRequest; + export interface CollectionConfig { + name: string; + policy: { + identities: any[]; + policy: any; + }; + requiredPeerCount: number; + maxPeerCount: number; + blockToLive?: number; + memberOnlyRead?: boolean; + } + + export type CollectionsConfig = CollectionConfig[]; + + export interface EndorsementPolicy { + identities: any[]; + policy: any; + } export interface ChaincodeInstantiateUpgradeRequest { targets?: Peer[] | string[]; chaincodeType?: ChaincodeType; chaincodeId: string; chaincodeVersion: string; txId: TransactionId; - 'collections-config'?: string; + 'collections-config'?: string | CollectionsConfig; transientMap?: TransientMap; fcn?: string; args?: string[]; - 'endorsement-policy'?: any; + 'endorsement-policy'?: EndorsementPolicy; } export interface ChaincodeInvokeRequest {