@decaf-ts/for-fabric 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/version.cjs +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/client/FabricClientAdapter.d.cts +3 -3
- package/lib/types/client/FabricClientAdapter.d.mts +3 -3
- package/lib/types/client/FabricClientDispatch.d.cts +2 -2
- package/lib/types/client/FabricClientDispatch.d.mts +2 -2
- package/lib/types/client/FabricClientPaginator.d.cts +1 -1
- package/lib/types/client/FabricClientPaginator.d.mts +1 -1
- package/lib/types/client/FabricClientRepository.d.cts +1 -1
- package/lib/types/client/FabricClientRepository.d.mts +1 -1
- package/lib/types/client/FabricClientStatement.d.cts +2 -2
- package/lib/types/client/FabricClientStatement.d.mts +2 -2
- package/lib/types/client/collections/index.d.cts +1 -1
- package/lib/types/client/collections/index.d.mts +1 -1
- package/lib/types/client/constants.d.cts +1 -1
- package/lib/types/client/constants.d.mts +1 -1
- package/lib/types/client/erc20/FabricERC20ClientRepository.d.cts +3 -3
- package/lib/types/client/erc20/FabricERC20ClientRepository.d.mts +3 -3
- package/lib/types/client/erc20/index.d.cts +1 -1
- package/lib/types/client/erc20/index.d.mts +1 -1
- package/lib/types/client/ids/index.d.cts +1 -1
- package/lib/types/client/ids/index.d.mts +1 -1
- package/lib/types/client/index.d.cts +14 -14
- package/lib/types/client/index.d.mts +14 -14
- package/lib/types/client/indexes/index.d.cts +1 -1
- package/lib/types/client/indexes/index.d.mts +1 -1
- package/lib/types/client/services/FabricEnrollmentService.d.cts +4 -4
- package/lib/types/client/services/FabricEnrollmentService.d.mts +4 -4
- package/lib/types/client/services/FabricIdentityService.d.cts +5 -5
- package/lib/types/client/services/FabricIdentityService.d.mts +5 -5
- package/lib/types/client/services/RegistrationRequestBuilder.d.cts +1 -1
- package/lib/types/client/services/RegistrationRequestBuilder.d.mts +1 -1
- package/lib/types/client/services/index.d.cts +4 -4
- package/lib/types/client/services/index.d.mts +4 -4
- package/lib/types/client/types.d.cts +1 -1
- package/lib/types/client/types.d.mts +1 -1
- package/lib/types/client/utils.d.cts +1 -1
- package/lib/types/client/utils.d.mts +1 -1
- package/lib/types/contract/AddressContract.d.cts +2 -2
- package/lib/types/contract/AddressContract.d.mts +2 -2
- package/lib/types/contract/AuditContract.d.cts +2 -2
- package/lib/types/contract/AuditContract.d.mts +2 -2
- package/lib/types/contract/BatchContract.d.cts +2 -2
- package/lib/types/contract/BatchContract.d.mts +2 -2
- package/lib/types/contract/MarketContract.d.cts +2 -2
- package/lib/types/contract/MarketContract.d.mts +2 -2
- package/lib/types/contract/OtherAuditContract.d.cts +2 -2
- package/lib/types/contract/OtherAuditContract.d.mts +2 -2
- package/lib/types/contract/OtherBatchContract.d.cts +2 -2
- package/lib/types/contract/OtherBatchContract.d.mts +2 -2
- package/lib/types/contract/OtherMarketContract.d.cts +2 -2
- package/lib/types/contract/OtherMarketContract.d.mts +2 -2
- package/lib/types/contract/OtherProductContract.d.cts +2 -2
- package/lib/types/contract/OtherProductContract.d.mts +2 -2
- package/lib/types/contract/OtherProductImageContract.d.cts +2 -2
- package/lib/types/contract/OtherProductImageContract.d.mts +2 -2
- package/lib/types/contract/OtherProductSharedContract.d.cts +2 -2
- package/lib/types/contract/OtherProductSharedContract.d.mts +2 -2
- package/lib/types/contract/OtherProductStrengthContract.d.cts +2 -2
- package/lib/types/contract/OtherProductStrengthContract.d.mts +2 -2
- package/lib/types/contract/Product.d.cts +1 -1
- package/lib/types/contract/Product.d.mts +1 -1
- package/lib/types/contract/ProductContract.d.cts +2 -2
- package/lib/types/contract/ProductContract.d.mts +2 -2
- package/lib/types/contract/ProductStrengthContract.d.cts +2 -2
- package/lib/types/contract/ProductStrengthContract.d.mts +2 -2
- package/lib/types/contract/SegregatedPrivateDocumentContract.d.cts +2 -2
- package/lib/types/contract/SegregatedPrivateDocumentContract.d.mts +2 -2
- package/lib/types/contract/SegregatedSharedDocumentContract.d.cts +2 -2
- package/lib/types/contract/SegregatedSharedDocumentContract.d.mts +2 -2
- package/lib/types/contract/UserContract.d.cts +2 -2
- package/lib/types/contract/UserContract.d.mts +2 -2
- package/lib/types/contract/models/Audit.d.cts +2 -2
- package/lib/types/contract/models/Audit.d.mts +2 -2
- package/lib/types/contract/models/BaseIdentifiedModel.d.cts +1 -1
- package/lib/types/contract/models/BaseIdentifiedModel.d.mts +1 -1
- package/lib/types/contract/models/Batch.d.cts +1 -1
- package/lib/types/contract/models/Batch.d.mts +1 -1
- package/lib/types/contract/models/GtinOwner.d.cts +1 -1
- package/lib/types/contract/models/GtinOwner.d.mts +1 -1
- package/lib/types/contract/models/Leaflet.d.cts +1 -1
- package/lib/types/contract/models/Leaflet.d.mts +1 -1
- package/lib/types/contract/models/LeafletFile.d.cts +1 -1
- package/lib/types/contract/models/LeafletFile.d.mts +1 -1
- package/lib/types/contract/models/Market.d.cts +1 -1
- package/lib/types/contract/models/Market.d.mts +1 -1
- package/lib/types/contract/models/OtherAudit.d.cts +2 -2
- package/lib/types/contract/models/OtherAudit.d.mts +2 -2
- package/lib/types/contract/models/OtherBatchShared.d.cts +1 -1
- package/lib/types/contract/models/OtherBatchShared.d.mts +1 -1
- package/lib/types/contract/models/OtherLeaflet.d.cts +2 -2
- package/lib/types/contract/models/OtherLeaflet.d.mts +2 -2
- package/lib/types/contract/models/OtherLeafletFile.d.cts +1 -1
- package/lib/types/contract/models/OtherLeafletFile.d.mts +1 -1
- package/lib/types/contract/models/OtherMarket.d.cts +1 -1
- package/lib/types/contract/models/OtherMarket.d.mts +1 -1
- package/lib/types/contract/models/OtherProduct.d.cts +1 -1
- package/lib/types/contract/models/OtherProduct.d.mts +1 -1
- package/lib/types/contract/models/OtherProductImage.d.cts +1 -1
- package/lib/types/contract/models/OtherProductImage.d.mts +1 -1
- package/lib/types/contract/models/OtherProductShared.d.cts +4 -4
- package/lib/types/contract/models/OtherProductShared.d.mts +4 -4
- package/lib/types/contract/models/OtherProductStrength.d.cts +1 -1
- package/lib/types/contract/models/OtherProductStrength.d.mts +1 -1
- package/lib/types/contract/models/Product.d.cts +3 -3
- package/lib/types/contract/models/Product.d.mts +3 -3
- package/lib/types/contract/models/ProductStrength.d.cts +1 -1
- package/lib/types/contract/models/ProductStrength.d.mts +1 -1
- package/lib/types/contract/models/SegregatedDocument.d.cts +1 -1
- package/lib/types/contract/models/SegregatedDocument.d.mts +1 -1
- package/lib/types/contract/models/decorators-private.d.cts +2 -2
- package/lib/types/contract/models/decorators-private.d.mts +2 -2
- package/lib/types/contract/models/decorators.d.cts +2 -2
- package/lib/types/contract/models/decorators.d.mts +2 -2
- package/lib/types/contract/models/history-dec.d.cts +1 -1
- package/lib/types/contract/models/history-dec.d.mts +1 -1
- package/lib/types/contracts/ContractAdapter.d.cts +5 -5
- package/lib/types/contracts/ContractAdapter.d.mts +5 -5
- package/lib/types/contracts/ContractContext.d.cts +1 -1
- package/lib/types/contracts/ContractContext.d.mts +1 -1
- package/lib/types/contracts/FabricContractDispatch.d.cts +2 -2
- package/lib/types/contracts/FabricContractDispatch.d.mts +2 -2
- package/lib/types/contracts/FabricContractPaginator.d.cts +1 -1
- package/lib/types/contracts/FabricContractPaginator.d.mts +1 -1
- package/lib/types/contracts/FabricContractRepository.d.cts +3 -3
- package/lib/types/contracts/FabricContractRepository.d.mts +3 -3
- package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.cts +1 -1
- package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.mts +1 -1
- package/lib/types/contracts/FabricContractStatement.d.cts +1 -1
- package/lib/types/contracts/FabricContractStatement.d.mts +1 -1
- package/lib/types/contracts/MigrationContract.d.cts +3 -3
- package/lib/types/contracts/MigrationContract.d.mts +3 -3
- package/lib/types/contracts/auth/index.d.cts +1 -1
- package/lib/types/contracts/auth/index.d.mts +1 -1
- package/lib/types/contracts/crud/crud-contract.d.cts +5 -5
- package/lib/types/contracts/crud/crud-contract.d.mts +5 -5
- package/lib/types/contracts/crud/index.d.cts +2 -2
- package/lib/types/contracts/crud/index.d.mts +2 -2
- package/lib/types/contracts/crud/serialized-crud-contract.d.cts +1 -1
- package/lib/types/contracts/crud/serialized-crud-contract.d.mts +1 -1
- package/lib/types/contracts/erc20/erc20contract.d.cts +3 -3
- package/lib/types/contracts/erc20/erc20contract.d.mts +3 -3
- package/lib/types/contracts/erc20/index.d.cts +1 -1
- package/lib/types/contracts/erc20/index.d.mts +1 -1
- package/lib/types/contracts/index.d.cts +13 -13
- package/lib/types/contracts/index.d.mts +13 -13
- package/lib/types/contracts/types.d.cts +1 -1
- package/lib/types/contracts/types.d.mts +1 -1
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/lib/types/shared/decorators.d.cts +3 -3
- package/lib/types/shared/decorators.d.mts +3 -3
- package/lib/types/shared/erc20/index.d.cts +1 -1
- package/lib/types/shared/erc20/index.d.mts +1 -1
- package/lib/types/shared/index.d.cts +14 -14
- package/lib/types/shared/index.d.mts +14 -14
- package/lib/types/shared/interfaces/index.d.cts +1 -1
- package/lib/types/shared/interfaces/index.d.mts +1 -1
- package/lib/types/shared/model/FabricIdentifiedBaseModel.d.cts +1 -1
- package/lib/types/shared/model/FabricIdentifiedBaseModel.d.mts +1 -1
- package/lib/types/shared/model/Identity.d.cts +2 -2
- package/lib/types/shared/model/Identity.d.mts +2 -2
- package/lib/types/shared/model/index.d.cts +4 -4
- package/lib/types/shared/model/index.d.mts +4 -4
- package/lib/types/shared/overrides/Model.d.cts +2 -2
- package/lib/types/shared/overrides/Model.d.mts +2 -2
- package/lib/types/shared/overrides/index.d.cts +2 -2
- package/lib/types/shared/overrides/index.d.mts +2 -2
- package/lib/types/version.d.cts +1 -1
- package/lib/types/version.d.mts +1 -1
- package/package.json +1 -1
- package/lib/types/bin/cli.d.ts +0 -1
- package/lib/types/cli-module.d.ts +0 -3
- package/lib/types/cli-utils.d.ts +0 -21
- package/lib/types/client/FabricClientAdapter.d.ts +0 -404
- package/lib/types/client/FabricClientDispatch.d.ts +0 -133
- package/lib/types/client/FabricClientPaginator.d.ts +0 -12
- package/lib/types/client/FabricClientRepository.d.ts +0 -71
- package/lib/types/client/FabricClientStatement.d.ts +0 -64
- package/lib/types/client/collections/generation.d.ts +0 -46
- package/lib/types/client/collections/index.d.ts +0 -1
- package/lib/types/client/constants.d.ts +0 -2
- package/lib/types/client/crypto.d.ts +0 -107
- package/lib/types/client/erc20/FabricERC20ClientRepository.d.ts +0 -254
- package/lib/types/client/erc20/index.d.ts +0 -1
- package/lib/types/client/fabric-fs.d.ts +0 -92
- package/lib/types/client/fabric-hsm.d.ts +0 -24
- package/lib/types/client/ids/id-extraction.d.ts +0 -4
- package/lib/types/client/ids/index.d.ts +0 -1
- package/lib/types/client/index.d.ts +0 -23
- package/lib/types/client/indexes/generation.d.ts +0 -10
- package/lib/types/client/indexes/index.d.ts +0 -1
- package/lib/types/client/logging.d.ts +0 -60
- package/lib/types/client/services/FabricEnrollmentService.d.ts +0 -176
- package/lib/types/client/services/FabricIdentityService.d.ts +0 -98
- package/lib/types/client/services/RegistrationRequestBuilder.d.ts +0 -19
- package/lib/types/client/services/constants.d.ts +0 -15
- package/lib/types/client/services/index.d.ts +0 -4
- package/lib/types/client/types.d.ts +0 -20
- package/lib/types/client/utils.d.ts +0 -71
- package/lib/types/contract/Address.d.ts +0 -13
- package/lib/types/contract/AddressContract.d.ts +0 -5
- package/lib/types/contract/AuditContract.d.ts +0 -5
- package/lib/types/contract/BatchContract.d.ts +0 -5
- package/lib/types/contract/MarketContract.d.ts +0 -5
- package/lib/types/contract/OtherAuditContract.d.ts +0 -5
- package/lib/types/contract/OtherBatchContract.d.ts +0 -5
- package/lib/types/contract/OtherMarketContract.d.ts +0 -5
- package/lib/types/contract/OtherProductContract.d.ts +0 -5
- package/lib/types/contract/OtherProductImageContract.d.ts +0 -5
- package/lib/types/contract/OtherProductSharedContract.d.ts +0 -5
- package/lib/types/contract/OtherProductStrengthContract.d.ts +0 -5
- package/lib/types/contract/Product.d.ts +0 -7
- package/lib/types/contract/ProductContract.d.ts +0 -5
- package/lib/types/contract/ProductStrengthContract.d.ts +0 -5
- package/lib/types/contract/SegregatedPrivateDocumentContract.d.ts +0 -5
- package/lib/types/contract/SegregatedSharedDocumentContract.d.ts +0 -5
- package/lib/types/contract/User.d.ts +0 -7
- package/lib/types/contract/UserContract.d.ts +0 -5
- package/lib/types/contract/index.d.ts +0 -2
- package/lib/types/contract/logging-context.d.ts +0 -8
- package/lib/types/contract/models/Audit.d.ts +0 -13
- package/lib/types/contract/models/BaseIdentifiedModel.d.ts +0 -7
- package/lib/types/contract/models/BaseModel.d.ts +0 -7
- package/lib/types/contract/models/Batch.d.ts +0 -18
- package/lib/types/contract/models/GtinOwner.d.ts +0 -8
- package/lib/types/contract/models/History.d.ts +0 -9
- package/lib/types/contract/models/Leaflet.d.ts +0 -12
- package/lib/types/contract/models/LeafletFile.d.ts +0 -9
- package/lib/types/contract/models/Market.d.ts +0 -12
- package/lib/types/contract/models/OtherAudit.d.ts +0 -15
- package/lib/types/contract/models/OtherBatchShared.d.ts +0 -18
- package/lib/types/contract/models/OtherLeaflet.d.ts +0 -16
- package/lib/types/contract/models/OtherLeafletFile.d.ts +0 -10
- package/lib/types/contract/models/OtherMarket.d.ts +0 -13
- package/lib/types/contract/models/OtherProduct.d.ts +0 -12
- package/lib/types/contract/models/OtherProductImage.d.ts +0 -9
- package/lib/types/contract/models/OtherProductShared.d.ts +0 -18
- package/lib/types/contract/models/OtherProductStrength.d.ts +0 -12
- package/lib/types/contract/models/Product.d.ts +0 -15
- package/lib/types/contract/models/ProductStrength.d.ts +0 -11
- package/lib/types/contract/models/SegregatedDocument.d.ts +0 -18
- package/lib/types/contract/models/constants.d.ts +0 -24
- package/lib/types/contract/models/decorators-private.d.ts +0 -16
- package/lib/types/contract/models/decorators.d.ts +0 -28
- package/lib/types/contract/models/gtin.d.ts +0 -8
- package/lib/types/contract/models/history-dec.d.ts +0 -6
- package/lib/types/contracts/ContractAdapter.d.ts +0 -287
- package/lib/types/contracts/ContractContext.d.ts +0 -89
- package/lib/types/contracts/FabricContractDispatch.d.ts +0 -7
- package/lib/types/contracts/FabricContractPaginator.d.ts +0 -105
- package/lib/types/contracts/FabricContractRepository.d.ts +0 -119
- package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.ts +0 -62
- package/lib/types/contracts/FabricContractSequence.d.ts +0 -87
- package/lib/types/contracts/FabricContractStatement.d.ts +0 -36
- package/lib/types/contracts/MigrationContract.d.ts +0 -22
- package/lib/types/contracts/PrivateSequence.d.ts +0 -15
- package/lib/types/contracts/auth/decorators.d.ts +0 -6
- package/lib/types/contracts/auth/index.d.ts +0 -1
- package/lib/types/contracts/crud/crud-contract.d.ts +0 -199
- package/lib/types/contracts/crud/index.d.ts +0 -2
- package/lib/types/contracts/crud/serialized-crud-contract.d.ts +0 -42
- package/lib/types/contracts/erc20/erc20contract.d.ts +0 -152
- package/lib/types/contracts/erc20/index.d.ts +0 -2
- package/lib/types/contracts/erc20/models.d.ts +0 -114
- package/lib/types/contracts/index.d.ts +0 -20
- package/lib/types/contracts/logging.d.ts +0 -54
- package/lib/types/contracts/overrides.d.ts +0 -1
- package/lib/types/contracts/types.d.ts +0 -38
- package/lib/types/contracts/uuid.d.ts +0 -2
- package/lib/types/index.d.ts +0 -8
- package/lib/types/shared/ClientSerializer.d.ts +0 -52
- package/lib/types/shared/DeterministicSerializer.d.ts +0 -47
- package/lib/types/shared/SimpleDeterministicSerializer.d.ts +0 -7
- package/lib/types/shared/constants.d.ts +0 -35
- package/lib/types/shared/decorators.d.ts +0 -81
- package/lib/types/shared/erc20/erc20-constants.d.ts +0 -25
- package/lib/types/shared/erc20/index.d.ts +0 -1
- package/lib/types/shared/errors.d.ts +0 -140
- package/lib/types/shared/events.d.ts +0 -37
- package/lib/types/shared/fabric-types.d.ts +0 -32
- package/lib/types/shared/index.d.ts +0 -21
- package/lib/types/shared/interfaces/Checkable.d.ts +0 -23
- package/lib/types/shared/interfaces/index.d.ts +0 -1
- package/lib/types/shared/math.d.ts +0 -34
- package/lib/types/shared/model/FabricBaseModel.d.ts +0 -7
- package/lib/types/shared/model/FabricIdentifiedBaseModel.d.ts +0 -7
- package/lib/types/shared/model/Identity.d.ts +0 -42
- package/lib/types/shared/model/IdentityCredentials.d.ts +0 -41
- package/lib/types/shared/model/index.d.ts +0 -4
- package/lib/types/shared/overrides/Model.d.ts +0 -22
- package/lib/types/shared/overrides/index.d.ts +0 -2
- package/lib/types/shared/overrides/overrides.d.ts +0 -1
- package/lib/types/shared/types.d.ts +0 -125
- package/lib/types/version.d.ts +0 -2
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare class HSMSignerFactoryCustom {
|
|
2
|
-
#private;
|
|
3
|
-
constructor(library: string);
|
|
4
|
-
private findHSMPKCS11Lib;
|
|
5
|
-
dispose(): void;
|
|
6
|
-
private sanitizeOptions;
|
|
7
|
-
private assertNotEmpty;
|
|
8
|
-
private findSlotForLabel;
|
|
9
|
-
private login;
|
|
10
|
-
private findObjectInHSM;
|
|
11
|
-
newSigner(hsmSignerOptions: HSMConfig): {
|
|
12
|
-
signer: (digest: any) => Promise<Uint8Array<ArrayBufferLike>>;
|
|
13
|
-
close: () => void;
|
|
14
|
-
};
|
|
15
|
-
private assertDefined;
|
|
16
|
-
private getUncompressedPointOnCurve;
|
|
17
|
-
getSKIFromCertificatePath(certPath: string): Buffer<ArrayBufferLike>;
|
|
18
|
-
getSKIFromCertificate(cert: string | NonSharedBuffer): Buffer;
|
|
19
|
-
}
|
|
20
|
-
export interface HSMConfig {
|
|
21
|
-
label: string;
|
|
22
|
-
identifier: Buffer<ArrayBufferLike>;
|
|
23
|
-
pin: string;
|
|
24
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Model } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
3
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
4
|
-
export declare function extractIds<M extends Model>(clazz: Constructor<M>, models: M | M[] | Record<string, any> | Record<string, any>[], ids: PrimaryKeyType | PrimaryKeyType[]): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./id-extraction";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Hyperledger Fabric Client Module for Decaf-ts
|
|
3
|
-
* @summary This module provides client-side utilities and adapters to interact with Hyperledger Fabric networks using Decaf-ts. It exposes the Fabric client adapter, event dispatch utilities, and filesystem helpers for loading identities and keys.
|
|
4
|
-
* @module client
|
|
5
|
-
* @memberOf module:for-fabric
|
|
6
|
-
* @example
|
|
7
|
-
* // Create a client adapter and submit a transaction
|
|
8
|
-
* // See also: {@link module:for-fabric~FabricClientAdapter} and {@link module:for-fabric~FabricClientDispatch}
|
|
9
|
-
*/
|
|
10
|
-
export * from "./collections";
|
|
11
|
-
export * from "./erc20";
|
|
12
|
-
export * from "./ids";
|
|
13
|
-
export * from "./indexes";
|
|
14
|
-
export * from "./services";
|
|
15
|
-
export * from "./constants";
|
|
16
|
-
export * from "./crypto";
|
|
17
|
-
export * from "./services";
|
|
18
|
-
export * from "./FabricClientDispatch";
|
|
19
|
-
export * from "./fabric-fs";
|
|
20
|
-
export * from "./FabricClientAdapter";
|
|
21
|
-
export * from "./FabricClientRepository";
|
|
22
|
-
export * from "../shared/types";
|
|
23
|
-
export * from "./utils";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
-
import { CreateIndexRequest, CouchDBDesignDoc } from "@decaf-ts/for-couchdb";
|
|
3
|
-
import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
4
|
-
export type Index = CreateIndexRequest;
|
|
5
|
-
export declare function generateModelIndexes<M extends Model>(m: Constructor<M>): Index[];
|
|
6
|
-
export declare function generateModelDesignDocs<M extends Model>(m: Constructor<M>, accum?: Record<string, CouchDBDesignDoc>): CouchDBDesignDoc[];
|
|
7
|
-
export declare function readModelFile(file: any): ModelConstructor<any>[];
|
|
8
|
-
export declare function readModelFolders(...folders: string[]): Promise<ModelConstructor<any>[]>;
|
|
9
|
-
export declare function writeIndexes(indexes: Index[], p?: string, collection?: string): void;
|
|
10
|
-
export declare function writeDesignDocs(designDocs: CouchDBDesignDoc[], p?: string, collection?: string): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./generation";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Logger, LogLevel, MiniLogger, StringLike } from "@decaf-ts/logging";
|
|
2
|
-
import { LoggingConfig } from "@decaf-ts/logging";
|
|
3
|
-
/**
|
|
4
|
-
* @description Logger implementation tailored for Hyperledger Fabric clients.
|
|
5
|
-
* @summary Adapts the decaf-ts MiniLogger to route messages through a per-context Fabric logger, honoring configured log levels and formatting.
|
|
6
|
-
* @param {string} context - The logging context name used to scope the logger instance.
|
|
7
|
-
* @param {Partial<LoggingConfig> | undefined} conf - Optional logging configuration to override defaults for this context.
|
|
8
|
-
* @class FabricLogger
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // In a Fabric client/service
|
|
12
|
-
* const logger = new FabricLogger('MyFabricService', { level: 'info' });
|
|
13
|
-
* logger.info('Processing transaction');
|
|
14
|
-
* logger.debug('Transaction details', { txId: '123' });
|
|
15
|
-
* logger.error('Something went wrong');
|
|
16
|
-
* ```
|
|
17
|
-
* @mermaid
|
|
18
|
-
* sequenceDiagram
|
|
19
|
-
* autonumber
|
|
20
|
-
* participant C as Caller
|
|
21
|
-
* participant FL as FabricLogger
|
|
22
|
-
* participant ML as MiniLogger (delegate)
|
|
23
|
-
* C->>FL: info('Processing transaction')
|
|
24
|
-
* FL->>FL: createLog(level,msg,stack)
|
|
25
|
-
* FL->>ML: info(log)
|
|
26
|
-
* C->>FL: error(new Error('x'))
|
|
27
|
-
* FL->>FL: createLog(level,msg,stack)
|
|
28
|
-
* FL->>ML: error(log)
|
|
29
|
-
*/
|
|
30
|
-
export declare class FabricLogger extends MiniLogger {
|
|
31
|
-
/**
|
|
32
|
-
* @description The underlying Fabric logger instance
|
|
33
|
-
*/
|
|
34
|
-
protected logger: Logger;
|
|
35
|
-
constructor(context: string, conf: Partial<LoggingConfig> | undefined);
|
|
36
|
-
/**
|
|
37
|
-
* @description Logs a message at the specified level.
|
|
38
|
-
* @summary Overrides the base MiniLogger.log to forward to the internal Fabric-aware logger, enforcing configured thresholds.
|
|
39
|
-
* @param {LogLevel} level - The log level to use for this message.
|
|
40
|
-
* @param {StringLike | Error} msg - The message or error to log.
|
|
41
|
-
* @param {string} [stack] - Optional stack trace string for errors.
|
|
42
|
-
* @return {void}
|
|
43
|
-
* @mermaid
|
|
44
|
-
* sequenceDiagram
|
|
45
|
-
* autonumber
|
|
46
|
-
* participant C as Caller
|
|
47
|
-
* participant FL as FabricLogger
|
|
48
|
-
* participant ML as MiniLogger (delegate)
|
|
49
|
-
* C->>FL: log(level, msg, stack?)
|
|
50
|
-
* FL->>FL: check configured level
|
|
51
|
-
* alt below threshold
|
|
52
|
-
* FL-->>C: return
|
|
53
|
-
* else above threshold
|
|
54
|
-
* FL->>FL: createLog(level, msg, stack)
|
|
55
|
-
* FL->>ML: method.call(logger, log)
|
|
56
|
-
* ML-->>FL: void
|
|
57
|
-
* end
|
|
58
|
-
*/
|
|
59
|
-
protected log(level: LogLevel, msg: StringLike | Error, stack?: Error): void;
|
|
60
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import FabricCAServices from "fabric-ca-client";
|
|
2
|
-
import { IEnrollResponse } from "fabric-ca-client";
|
|
3
|
-
import { User } from "fabric-common";
|
|
4
|
-
import { CAConfig, Credentials } from "../../shared/types";
|
|
5
|
-
import { Identity } from "../../shared/model/Identity";
|
|
6
|
-
import { AuthorizationError } from "@decaf-ts/core";
|
|
7
|
-
import { ConflictError } from "@decaf-ts/db-decorators";
|
|
8
|
-
import { CA_ROLE } from "./constants";
|
|
9
|
-
import { CertificateResponse, FabricIdentity, GetCertificatesRequest } from "../../shared/fabric-types";
|
|
10
|
-
import { LoggedClass } from "@decaf-ts/logging";
|
|
11
|
-
/**
|
|
12
|
-
* @description Hyperledger Fabric CA identity types.
|
|
13
|
-
* @summary Enumerates the supported identity types recognized by Fabric CA for registration and identity management.
|
|
14
|
-
* @enum {string}
|
|
15
|
-
* @readonly
|
|
16
|
-
* @memberOf module:for-fabric.client
|
|
17
|
-
*/
|
|
18
|
-
export declare enum HFCAIdentityType {
|
|
19
|
-
PEER = "peer",
|
|
20
|
-
ORDERER = "orderer",
|
|
21
|
-
CLIENT = "client",
|
|
22
|
-
USER = "user",
|
|
23
|
-
ADMIN = "admin"
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @description Key/value attribute used during CA registration.
|
|
27
|
-
* @summary Represents an attribute entry that can be attached to a Fabric CA identity during registration, optionally marking it for inclusion in ecert.
|
|
28
|
-
* @interface IKeyValueAttribute
|
|
29
|
-
* @template T
|
|
30
|
-
* @param {string} name - Attribute name.
|
|
31
|
-
* @param {string} value - Attribute value.
|
|
32
|
-
* @param {boolean} [ecert] - Whether the attribute should be included in the enrollment certificate (ECert).
|
|
33
|
-
* @memberOf module:for-fabric.client
|
|
34
|
-
*/
|
|
35
|
-
export interface IKeyValueAttribute {
|
|
36
|
-
name: string;
|
|
37
|
-
value: string;
|
|
38
|
-
ecert?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @description Standard Fabric CA identity attribute keys.
|
|
42
|
-
* @summary Enumerates well-known Fabric CA attribute keys that can be assigned to identities for delegations and permissions.
|
|
43
|
-
* @enum {string}
|
|
44
|
-
* @readonly
|
|
45
|
-
* @memberOf module:for-fabric.client
|
|
46
|
-
*/
|
|
47
|
-
export declare enum HFCAIdentityAttributes {
|
|
48
|
-
HFREGISTRARROLES = "hf.Registrar.Roles",
|
|
49
|
-
HFREGISTRARDELEGATEROLES = "hf.Registrar.DelegateRoles",
|
|
50
|
-
HFREGISTRARATTRIBUTES = "hf.Registrar.Attributes",
|
|
51
|
-
HFINTERMEDIATECA = "hf.IntermediateCA",
|
|
52
|
-
HFREVOKER = "hf.Revoker",
|
|
53
|
-
HFAFFILIATIONMGR = "hf.AffiliationMgr",
|
|
54
|
-
HFGENCRL = "hf.GenCRL"
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @description Service wrapper for interacting with a Fabric CA.
|
|
58
|
-
* @summary Provides high-level operations for managing identities against a Hyperledger Fabric Certificate Authority, including registration, enrollment, revocation, and administrative queries. Encapsulates lower-level Fabric CA client calls with consistent logging and error mapping.
|
|
59
|
-
* @param {CAConfig} caConfig - Connection and TLS configuration for the target CA.
|
|
60
|
-
* @class FabricEnrollmentService
|
|
61
|
-
* @example
|
|
62
|
-
* // Register and enroll a new user
|
|
63
|
-
* const svc = new FabricEnrollmentService({
|
|
64
|
-
* url: 'https://localhost:7054',
|
|
65
|
-
* caName: 'Org1CA',
|
|
66
|
-
* tls: { trustedRoots: ['/path/to/ca.pem'], verify: false },
|
|
67
|
-
* caCert: '/path/to/admin/certDir',
|
|
68
|
-
* caKey: '/path/to/admin/keyDir'
|
|
69
|
-
* });
|
|
70
|
-
* await svc.register({ userName: 'alice', password: 's3cr3t' }, false, 'org1.department1', CA_ROLE.USER);
|
|
71
|
-
* const id = await svc.enroll('alice', 's3cr3t');
|
|
72
|
-
* @mermaid
|
|
73
|
-
* sequenceDiagram
|
|
74
|
-
* autonumber
|
|
75
|
-
* participant App
|
|
76
|
-
* participant Svc as FabricEnrollmentService
|
|
77
|
-
* participant CA as Fabric CA
|
|
78
|
-
* App->>Svc: register(credentials, ...)
|
|
79
|
-
* Svc->>CA: register(request, adminUser)
|
|
80
|
-
* CA-->>Svc: enrollmentSecret
|
|
81
|
-
* Svc-->>App: secret
|
|
82
|
-
* App->>Svc: enroll(enrollmentId, secret)
|
|
83
|
-
* Svc->>CA: enroll({enrollmentID, secret})
|
|
84
|
-
* CA-->>Svc: certificates
|
|
85
|
-
* Svc-->>App: Identity
|
|
86
|
-
*/
|
|
87
|
-
export declare class FabricEnrollmentService extends LoggedClass {
|
|
88
|
-
private caConfig;
|
|
89
|
-
private ca?;
|
|
90
|
-
private certificateService?;
|
|
91
|
-
private affiliationService?;
|
|
92
|
-
private identityService?;
|
|
93
|
-
private client?;
|
|
94
|
-
private user?;
|
|
95
|
-
constructor(caConfig: CAConfig);
|
|
96
|
-
protected User(): Promise<User>;
|
|
97
|
-
protected CA(): Promise<FabricCAServices>;
|
|
98
|
-
protected Client(): Promise<{
|
|
99
|
-
newCertificateService: any;
|
|
100
|
-
}>;
|
|
101
|
-
protected Certificate(): Promise<any>;
|
|
102
|
-
protected Affiliations(): Promise<FabricCAServices.AffiliationService>;
|
|
103
|
-
protected Identities(): Promise<FabricCAServices.IdentityService>;
|
|
104
|
-
/**
|
|
105
|
-
* @description Retrieve certificates from the CA.
|
|
106
|
-
* @summary Calls the CA certificate service to list certificates, optionally mapping to PEM strings only.
|
|
107
|
-
* @param {GetCertificatesRequest} [request] - Optional filter request for certificate lookup.
|
|
108
|
-
* @param {boolean} [doMap=true] - When true, returns array of PEM strings; otherwise returns full response object.
|
|
109
|
-
* @return {Promise<string[] | CertificateResponse>} Array of PEM strings or the full certificate response.
|
|
110
|
-
*/
|
|
111
|
-
getCertificates(request?: GetCertificatesRequest, doMap?: boolean): Promise<string[] | CertificateResponse>;
|
|
112
|
-
/**
|
|
113
|
-
* @description List identities registered in the CA.
|
|
114
|
-
* @summary Queries the CA identity service to fetch all identities and returns the list as FabricIdentity objects.
|
|
115
|
-
* @return {Promise<FabricIdentity[]>} The list of identities registered in the CA.
|
|
116
|
-
*/
|
|
117
|
-
getIdentities(): Promise<FabricIdentity[]>;
|
|
118
|
-
protected parseError(e: Error): AuthorizationError | ConflictError;
|
|
119
|
-
/**
|
|
120
|
-
* @description Retrieve affiliations from the CA.
|
|
121
|
-
* @summary Queries the CA for the list of affiliations available under the configured CA.
|
|
122
|
-
* @return {string} The affiliations result payload.
|
|
123
|
-
*/
|
|
124
|
-
getAffiliations(): Promise<any>;
|
|
125
|
-
/**
|
|
126
|
-
* @description Read identity details from the CA by enrollment ID.
|
|
127
|
-
* @summary Retrieves and validates a single identity, throwing NotFoundError when missing.
|
|
128
|
-
* @param {string} enrollmentId - Enrollment ID to lookup.
|
|
129
|
-
* @return {Promise<FabricIdentity>} The identity details stored in the CA.
|
|
130
|
-
*/
|
|
131
|
-
read(enrollmentId: string): Promise<FabricIdentity>;
|
|
132
|
-
/**
|
|
133
|
-
* @description Register a new identity with the CA.
|
|
134
|
-
* @summary Submits a registration request for a new enrollment ID, returning the enrollment secret upon success.
|
|
135
|
-
* @param {Credentials} model - Credentials containing userName and password for the new identity.
|
|
136
|
-
* @param {boolean} [isSuperUser=false] - Whether to register the identity as a super user.
|
|
137
|
-
* @param {string} [affiliation=""] - Affiliation string (e.g., org1.department1).
|
|
138
|
-
* @param {CA_ROLE | string} [userRole] - Role to assign to the identity.
|
|
139
|
-
* @param {IKeyValueAttribute} [attrs] - Optional attributes to attach to the identity.
|
|
140
|
-
* @param {number} [maxEnrollments] - Maximum number of enrollments allowed for the identity.
|
|
141
|
-
* @return {Promise<string>} The enrollment secret for the registered identity.
|
|
142
|
-
*/
|
|
143
|
-
register(model: Credentials, isSuperUser?: boolean, affiliation?: string, userRole?: CA_ROLE | string, attrs?: IKeyValueAttribute, maxEnrollments?: number): Promise<string>;
|
|
144
|
-
protected static identityFromEnrollment(enrollment: IEnrollResponse, mspId: string): Identity;
|
|
145
|
-
/**
|
|
146
|
-
* @description Enroll an identity with the CA using a registration secret.
|
|
147
|
-
* @summary Exchanges the enrollment ID and secret for certificates, returning a constructed Identity model.
|
|
148
|
-
* @param {string} enrollmentId - Enrollment ID to enroll.
|
|
149
|
-
* @param {string} registration - Enrollment secret returned at registration time.
|
|
150
|
-
* @return {Promise<Identity>} The enrolled identity object with credentials.
|
|
151
|
-
*/
|
|
152
|
-
enroll(enrollmentId: string, registration: string): Promise<Identity>;
|
|
153
|
-
/**
|
|
154
|
-
* @description Register and enroll a new identity in one step.
|
|
155
|
-
* @summary Registers a new enrollment ID with the CA and immediately exchanges the secret to enroll, returning the created Identity.
|
|
156
|
-
* @param {Credentials} model - Credentials for the new identity containing userName and password.
|
|
157
|
-
* @param {boolean} [isSuperUser=false] - Whether to register the identity as a super user.
|
|
158
|
-
* @param {string} [affiliation=""] - Affiliation string (e.g., org1.department1).
|
|
159
|
-
* @param {CA_ROLE | string} [userRole] - Role to assign to the identity.
|
|
160
|
-
* @param {IKeyValueAttribute} [attrs] - Optional attributes to attach to the identity.
|
|
161
|
-
* @param {number} [maxEnrollments] - Maximum number of enrollments allowed for the identity.
|
|
162
|
-
* @return {Promise<Identity>} The enrolled identity.
|
|
163
|
-
*/
|
|
164
|
-
registerAndEnroll(model: Credentials, isSuperUser?: boolean, affiliation?: string, userRole?: CA_ROLE | string, attrs?: IKeyValueAttribute, maxEnrollments?: number): Promise<Identity>;
|
|
165
|
-
/**
|
|
166
|
-
* Revokes the enrollment of an identity with the specified enrollment ID.
|
|
167
|
-
*
|
|
168
|
-
* @param enrollmentId - The enrollment ID of the identity to be revoked.
|
|
169
|
-
*
|
|
170
|
-
* @returns A Promise that resolves to the result of the revocation operation.
|
|
171
|
-
*
|
|
172
|
-
* @throws {NotFoundError} If the enrollment with the specified ID does not exist.
|
|
173
|
-
* @throws {InternalError} If there is an error during the revocation process.
|
|
174
|
-
*/
|
|
175
|
-
revoke(enrollmentId: string): Promise<FabricCAServices.IServiceResponse>;
|
|
176
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { AuthorizationError, ClientBasedService, Context, MaybeContextualArg } from "@decaf-ts/core";
|
|
2
|
-
import FabricCAServices, { AffiliationService, IdentityService, IEnrollResponse, IIdentityRequest, IRevokeRequest, IServiceResponse } from "fabric-ca-client";
|
|
3
|
-
import { CAConfig, Credentials } from "../../shared/types";
|
|
4
|
-
import { ConflictError } from "@decaf-ts/db-decorators";
|
|
5
|
-
import { CertificateResponse, FabricIdentity, GetCertificatesRequest } from "../../shared/fabric-types";
|
|
6
|
-
import { User } from "fabric-common";
|
|
7
|
-
import { CA_ROLE } from "./constants";
|
|
8
|
-
import { IKeyValueAttribute } from "./FabricEnrollmentService";
|
|
9
|
-
import { Identity } from "../../shared/index";
|
|
10
|
-
export declare class FabricIdentityService extends ClientBasedService<FabricCAServices, CAConfig> {
|
|
11
|
-
protected _user: User;
|
|
12
|
-
constructor();
|
|
13
|
-
protected get rootClient(): {
|
|
14
|
-
newCertificateService: any;
|
|
15
|
-
};
|
|
16
|
-
protected get user(): User;
|
|
17
|
-
protected get certificates(): any;
|
|
18
|
-
protected get affiliations(): AffiliationService;
|
|
19
|
-
protected get identities(): IdentityService;
|
|
20
|
-
protected getUser(cfg: CAConfig, ctx: Context): Promise<User>;
|
|
21
|
-
initialize(...args: MaybeContextualArg<any>): Promise<{
|
|
22
|
-
config: CAConfig;
|
|
23
|
-
client: FabricCAServices;
|
|
24
|
-
}>;
|
|
25
|
-
getCertificates(...args: MaybeContextualArg<any>): Promise<string[]>;
|
|
26
|
-
getCertificates(request: GetCertificatesRequest, ...args: MaybeContextualArg<any>): Promise<string[]>;
|
|
27
|
-
getCertificates<MAP extends boolean>(doMap: MAP, ...args: MaybeContextualArg<any>): Promise<MAP extends false ? CertificateResponse : string[]>;
|
|
28
|
-
getCertificates<MAP extends boolean>(request: GetCertificatesRequest, doMap: MAP, ...args: MaybeContextualArg<any>): Promise<MAP extends false ? CertificateResponse : string[]>;
|
|
29
|
-
getIdentities(ctx: Context): Promise<FabricIdentity[]>;
|
|
30
|
-
/**
|
|
31
|
-
* @description Retrieve affiliations from the CA.
|
|
32
|
-
* @summary Queries the CA for the list of affiliations available under the configured CA.
|
|
33
|
-
* @return {string} The affiliations result payload.
|
|
34
|
-
*/
|
|
35
|
-
getAffiliations(ctx: Context): Promise<any>;
|
|
36
|
-
protected parseError(e: Error): AuthorizationError | ConflictError;
|
|
37
|
-
/**
|
|
38
|
-
* @description Read identity details from the CA by enrollment ID.
|
|
39
|
-
* @summary Retrieves and validates a single identity, throwing NotFoundError when missing.
|
|
40
|
-
* @param {string} enrollmentId - Enrollment ID to lookup.
|
|
41
|
-
* @return {Promise<FabricIdentity>} The identity details stored in the CA.
|
|
42
|
-
*/
|
|
43
|
-
read(enrollmentId: string, ...args: MaybeContextualArg<any>): Promise<FabricIdentity>;
|
|
44
|
-
/**
|
|
45
|
-
* @description Register a new identity with the CA.
|
|
46
|
-
* @summary Submits a registration request for a new enrollment ID, returning the enrollment secret upon success.
|
|
47
|
-
* @param {Credentials} model - Credentials containing userName and password for the new identity.
|
|
48
|
-
* @param {boolean} [isSuperUser=false] - Whether to register the identity as a super user.
|
|
49
|
-
* @param {string} [affiliation=""] - Affiliation string (e.g., org1.department1).
|
|
50
|
-
* @param {CA_ROLE | string} [userRole] - Role to assign to the identity.
|
|
51
|
-
* @param {IKeyValueAttribute} [attrs] - Optional attributes to attach to the identity.
|
|
52
|
-
* @param {number} [maxEnrollments] - Maximum number of enrollments allowed for the identity.
|
|
53
|
-
* @return {Promise<string>} The enrollment secret for the registered identity.
|
|
54
|
-
*/
|
|
55
|
-
register(model: Credentials, isSuperUser?: boolean, affiliation?: string, userRole?: CA_ROLE | string, attrs?: IKeyValueAttribute, maxEnrollments?: number, ...args: MaybeContextualArg<any>): Promise<string>;
|
|
56
|
-
protected static identityFromEnrollment(enrollment: IEnrollResponse, mspId: string, ctx: Context): Identity;
|
|
57
|
-
/**
|
|
58
|
-
* @description Enroll an identity with the CA using a registration secret.
|
|
59
|
-
* @summary Exchanges the enrollment ID and secret for certificates, returning a constructed Identity model.
|
|
60
|
-
* @param {string} enrollmentId - Enrollment ID to enroll.
|
|
61
|
-
* @param {string} registration - Enrollment secret returned at registration time.
|
|
62
|
-
* @return {Promise<Identity>} The enrolled identity object with credentials.
|
|
63
|
-
*/
|
|
64
|
-
enroll(enrollmentId: string, registration: string, ...args: MaybeContextualArg<any>): Promise<Identity>;
|
|
65
|
-
/**
|
|
66
|
-
* @description Register and enroll a new identity in one step.
|
|
67
|
-
* @summary Registers a new enrollment ID with the CA and immediately exchanges the secret to enroll, returning the created Identity.
|
|
68
|
-
* @param {Credentials} model - Credentials for the new identity containing userName and password.
|
|
69
|
-
* @param {boolean} [isSuperUser=false] - Whether to register the identity as a super user.
|
|
70
|
-
* @param {string} [affiliation=""] - Affiliation string (e.g., org1.department1).
|
|
71
|
-
* @param {CA_ROLE | string} [userRole] - Role to assign to the identity.
|
|
72
|
-
* @param {IKeyValueAttribute} [attrs] - Optional attributes to attach to the identity.
|
|
73
|
-
* @param {number} [maxEnrollments] - Maximum number of enrollments allowed for the identity.
|
|
74
|
-
* @return {Promise<Identity>} The enrolled identity.
|
|
75
|
-
*/
|
|
76
|
-
registerAndEnroll(model: Credentials, isSuperUser?: boolean, affiliation?: string, userRole?: CA_ROLE | string, attrs?: IKeyValueAttribute, maxEnrollments?: number, ...args: MaybeContextualArg<any>): Promise<Identity>;
|
|
77
|
-
/**
|
|
78
|
-
* @description Re-enroll an existing identity using its current enrollment.
|
|
79
|
-
* @summary Renews the enrollment certificate by calling the CA reenroll.
|
|
80
|
-
* @param {User} currentUser - Already enrolled user, must have a signing identity.
|
|
81
|
-
* @return {Promise<Identity>} The renewed identity object with new credentials.
|
|
82
|
-
*/
|
|
83
|
-
updateIdentity(enrollmentId: string, identity: {
|
|
84
|
-
certificate: string;
|
|
85
|
-
privateKey: string;
|
|
86
|
-
}, identityRequest: IIdentityRequest, ...args: MaybeContextualArg<any>): Promise<Identity>;
|
|
87
|
-
/**
|
|
88
|
-
* Revokes the enrollment of an identity with the specified enrollment ID.
|
|
89
|
-
*
|
|
90
|
-
* @param enrollmentId - The enrollment ID of the identity to be revoked.
|
|
91
|
-
*
|
|
92
|
-
* @returns A Promise that resolves to the result of the revocation operation.
|
|
93
|
-
*
|
|
94
|
-
* @throws {NotFoundError} If the enrollment with the specified ID does not exist.
|
|
95
|
-
* @throws {InternalError} If there is an error during the revocation process.
|
|
96
|
-
*/
|
|
97
|
-
revoke(enrollmentId: string, revokeOptions: Omit<IRevokeRequest, "enrollmentID">, ...args: MaybeContextualArg<any>): Promise<IServiceResponse>;
|
|
98
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IRegisterRequest, IKeyValueAttribute } from "fabric-ca-client";
|
|
2
|
-
import { CA_ROLE } from "./constants";
|
|
3
|
-
import { Model } from "@decaf-ts/decorator-validation";
|
|
4
|
-
export declare class RegistrationRequestBuilder extends Model {
|
|
5
|
-
affiliation: string;
|
|
6
|
-
attrs?: IKeyValueAttribute[];
|
|
7
|
-
enrollmentID: string;
|
|
8
|
-
enrollmentSecret: string;
|
|
9
|
-
maxEnrollments?: number;
|
|
10
|
-
role: string;
|
|
11
|
-
build(): IRegisterRequest;
|
|
12
|
-
setAffiliation(value: string): this;
|
|
13
|
-
addAttr(attr: IKeyValueAttribute): this;
|
|
14
|
-
setAttrs(value: IKeyValueAttribute[]): this;
|
|
15
|
-
setEnrollmentID(value: string): this;
|
|
16
|
-
setEnrollmentSecret(value: string): this;
|
|
17
|
-
setMaxEnrollments(value: number): this;
|
|
18
|
-
setRole(value: CA_ROLE | string): this;
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Certificate Authority role types used during enrollment and registration.
|
|
3
|
-
* @summary Enumerates the standard Hyperledger Fabric CA roles that can be assigned to identities when registering with the CA service.
|
|
4
|
-
* @enum {string}
|
|
5
|
-
* @readonly
|
|
6
|
-
* @memberOf module:for-fabric.client
|
|
7
|
-
*/
|
|
8
|
-
export declare enum CA_ROLE {
|
|
9
|
-
/** Administrator role with elevated privileges for managing identities and affiliations */
|
|
10
|
-
ADMIN = "admin",
|
|
11
|
-
/** Standard user role for application clients interacting with the network */
|
|
12
|
-
USER = "user",
|
|
13
|
-
/** Client role typically used for SDK-based interactions and service accounts */
|
|
14
|
-
CLIENT = "client"
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FabricFlags } from "../shared/index";
|
|
2
|
-
export type FabricClientFlags = FabricFlags & {
|
|
3
|
-
evaluateTimeout: number;
|
|
4
|
-
endorseTimeout: number;
|
|
5
|
-
submitTimeout: number;
|
|
6
|
-
commitTimeout: number;
|
|
7
|
-
endorsingOrgs?: string[];
|
|
8
|
-
keyCertOrDirectoryPath?: string | Buffer;
|
|
9
|
-
certCertOrDirectoryPath?: string | Buffer;
|
|
10
|
-
chaincodeName?: string;
|
|
11
|
-
contractName?: string;
|
|
12
|
-
sizeLimit?: number;
|
|
13
|
-
mspId?: string;
|
|
14
|
-
channel?: string;
|
|
15
|
-
legacy?: boolean;
|
|
16
|
-
allowGatewayOverride?: boolean;
|
|
17
|
-
allowManualEndorsingOrgs: boolean;
|
|
18
|
-
encryptTransient?: false | string | (() => string);
|
|
19
|
-
syntheticEvents?: boolean;
|
|
20
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Identity, Signer } from "@hyperledger/fabric-gateway";
|
|
2
|
-
import { CryptoSetting, ICryptoSuite, User } from "fabric-common";
|
|
3
|
-
import { HSMOptions } from "../shared/types";
|
|
4
|
-
/**
|
|
5
|
-
* @description Core utilities for interacting with files, crypto identities, and Fabric SDK helpers
|
|
6
|
-
* @summary Provides static helper methods to read credentials and keys from disk or raw content, construct Fabric gateway Identities and Signers, and perform common filesystem operations used by the Fabric client tooling.
|
|
7
|
-
* @class CoreUtils
|
|
8
|
-
* @example
|
|
9
|
-
* // Read an identity and signer from directories
|
|
10
|
-
* const identity = await CoreUtils.getIdentity('Org1MSP', '/msp/signcerts');
|
|
11
|
-
* const signer = await CoreUtils.getSigner('/msp/keystore');
|
|
12
|
-
* // Build a CA user
|
|
13
|
-
* const user = await CoreUtils.getCAUser('appUser', pemKey, pemCert, 'Org1MSP');
|
|
14
|
-
*/
|
|
15
|
-
export declare class CoreUtils {
|
|
16
|
-
private static logger;
|
|
17
|
-
private static cryptoSuite;
|
|
18
|
-
private constructor();
|
|
19
|
-
/**
|
|
20
|
-
* @description Resolve file content from a path or return provided raw content
|
|
21
|
-
* @summary If the input is a Uint8Array or PEM content, returns it as-is; otherwise uses a provided async fileReader to load the content from disk.
|
|
22
|
-
* @param {string|Uint8Array} contentOrPath - Either a raw content buffer/string or a filesystem path
|
|
23
|
-
* @param {function(string): Promise<string|Uint8Array|Buffer>} fileReader - Async function to read file content when a path is provided
|
|
24
|
-
* @return {Promise<string|Uint8Array|Buffer>} The content to be used downstream
|
|
25
|
-
*/
|
|
26
|
-
private static contentOfLoadFile;
|
|
27
|
-
/**
|
|
28
|
-
* @description Read file content from a path or return provided Buffer
|
|
29
|
-
* @summary Convenience wrapper that loads a file using fs.promises when a path string is provided; otherwise returns the given Buffer directly.
|
|
30
|
-
* @param {string|Buffer} contentOrPath - Path to a file on disk or an already-loaded Buffer
|
|
31
|
-
* @return {Promise<string|Uint8Array|Buffer>} The file content as a Buffer/string depending on reader
|
|
32
|
-
*/
|
|
33
|
-
static readFile(contentOrPath: string | Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
34
|
-
/**
|
|
35
|
-
* @description Create a Fabric CA User object with enrollment
|
|
36
|
-
* @summary Constructs a fabric-common User, sets a crypto suite, imports the provided private key, and sets enrollment with certificate and MSP ID.
|
|
37
|
-
* @param {string} userName - The user name for the CA user
|
|
38
|
-
* @param {string} privateKey - PEM-encoded private key
|
|
39
|
-
* @param {string} certificate - PEM-encoded X.509 certificate
|
|
40
|
-
* @param {string} mspId - Membership Service Provider identifier
|
|
41
|
-
* @return {Promise<User>} The enrolled Fabric User instance
|
|
42
|
-
*/
|
|
43
|
-
static getCAUser(userName: string, privateKey: string | undefined, certificate: string, mspId: string, options?: {
|
|
44
|
-
hsm?: HSMOptions;
|
|
45
|
-
}): Promise<User>;
|
|
46
|
-
static getCryptoSuite(options?: CryptoSetting): ICryptoSuite;
|
|
47
|
-
private static getSoftwareEnrollmentKey;
|
|
48
|
-
private static getHSMEnrollmentKey;
|
|
49
|
-
static getCertificateSKI(certificate: string): Promise<Buffer>;
|
|
50
|
-
/**
|
|
51
|
-
* @description Build a Fabric Gateway Identity from an MSP ID and certificate
|
|
52
|
-
* @summary Reads a certificate from a directory path or accepts raw content and returns an Identity object suitable for the Fabric Gateway.
|
|
53
|
-
* @param {string} mspId - Membership Service Provider ID
|
|
54
|
-
* @param {string} certDirectoryPath - Path to a directory containing the certificate file, or PEM content
|
|
55
|
-
* @return {Promise<Identity>} The identity containing mspId and certificate credentials
|
|
56
|
-
*/
|
|
57
|
-
static getIdentity(mspId: string, certDirectoryPath: string): Promise<Identity>;
|
|
58
|
-
static getFirstDirFileName(dirPath: string): Promise<string>;
|
|
59
|
-
static getFirstDirFileNameContent(dirPath: string): Promise<string>;
|
|
60
|
-
static getFileContent(filePath: string): Promise<string>;
|
|
61
|
-
static getSigner(keyDirectoryPath: string): Promise<Signer>;
|
|
62
|
-
private static extractPrivateKey;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Extracts the certificate Serial Number and the AKI (Authority Key Identifier)
|
|
66
|
-
* in the format Fabric CA expects (plain hex, no colons).
|
|
67
|
-
*/
|
|
68
|
-
export declare function getAkiAndSerialFromCert(cert: string): {
|
|
69
|
-
aki: string;
|
|
70
|
-
serial: string;
|
|
71
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Model, type ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
-
export declare class Address extends Model {
|
|
3
|
-
id: number;
|
|
4
|
-
city: string;
|
|
5
|
-
street: string;
|
|
6
|
-
number: number;
|
|
7
|
-
createdAt: Date;
|
|
8
|
-
updatedAt: Date;
|
|
9
|
-
createdBy: string;
|
|
10
|
-
updatedBy: string;
|
|
11
|
-
msp: string;
|
|
12
|
-
constructor(arg?: ModelArg<Address>);
|
|
13
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SerializedCrudContract } from "../contracts/crud/serialized-crud-contract";
|
|
2
|
-
import { OtherProductImage } from "./models/OtherProductImage";
|
|
3
|
-
export declare class OtherProductImageContract extends SerializedCrudContract<OtherProductImage> {
|
|
4
|
-
constructor();
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SerializedCrudContract } from "../contracts/crud/serialized-crud-contract";
|
|
2
|
-
import { OtherProductShared } from "./models/OtherProductShared";
|
|
3
|
-
export declare class OtherProductSharedContract extends SerializedCrudContract<OtherProductShared> {
|
|
4
|
-
constructor();
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SerializedCrudContract } from "../contracts/crud/serialized-crud-contract";
|
|
2
|
-
import { OtherProductStrength } from "./models/OtherProductStrength";
|
|
3
|
-
export declare class OtherProductStrengthContract extends SerializedCrudContract<OtherProductStrength> {
|
|
4
|
-
constructor();
|
|
5
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { FabricIdentifiedBaseModel } from "../shared/model/FabricIdentifiedBaseModel";
|
|
3
|
-
export declare class Product extends FabricIdentifiedBaseModel {
|
|
4
|
-
productCode: number;
|
|
5
|
-
inventedName: string;
|
|
6
|
-
constructor(args?: ModelArg<Product>);
|
|
7
|
-
}
|