@decaf-ts/for-fabric 0.1.23 → 0.1.24
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/dist/for-fabric.cjs +1 -1
- package/dist/for-fabric.cjs.map +1 -1
- package/dist/for-fabric.js +1 -1
- package/dist/for-fabric.js.map +1 -1
- package/lib/client/FabricClientAdapter.cjs +19 -0
- package/lib/client/FabricClientAdapter.d.ts +2 -2
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/client/FabricClientRepository.cjs +1 -1
- package/lib/client/FabricClientRepository.js.map +1 -1
- package/lib/client/fabric-fs.d.ts +1 -1
- package/lib/contract/Address.cjs +73 -0
- package/lib/contract/Address.d.ts +13 -0
- package/lib/contract/Address.js.map +1 -0
- package/lib/contract/AddressContract.cjs +34 -0
- package/lib/contract/AddressContract.d.ts +5 -0
- package/lib/contract/AddressContract.js.map +1 -0
- package/lib/contract/index.cjs +6 -1
- package/lib/contract/index.js.map +1 -1
- package/lib/esm/client/FabricClientAdapter.d.ts +2 -2
- package/lib/esm/client/FabricClientAdapter.js +19 -0
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientRepository.js +1 -1
- package/lib/esm/client/FabricClientRepository.js.map +1 -1
- package/lib/esm/client/fabric-fs.d.ts +1 -1
- package/lib/esm/contract/Address.d.ts +13 -0
- package/lib/esm/contract/Address.js +70 -0
- package/lib/esm/contract/Address.js.map +1 -0
- package/lib/esm/contract/AddressContract.d.ts +5 -0
- package/lib/esm/contract/AddressContract.js +31 -0
- package/lib/esm/contract/AddressContract.js.map +1 -0
- package/lib/esm/contract/index.js +6 -1
- package/lib/esm/contract/index.js.map +1 -1
- package/lib/esm/shared/decorators.d.ts +1 -1
- package/lib/esm/shared/decorators.js +1 -1
- package/lib/esm/shared/errors.d.ts +3 -0
- package/lib/esm/shared/errors.js +5 -0
- package/lib/esm/shared/errors.js.map +1 -1
- package/lib/esm/shared/utils.d.ts +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/shared/decorators.cjs +2 -2
- package/lib/shared/decorators.d.ts +1 -1
- package/lib/shared/errors.cjs +7 -1
- package/lib/shared/errors.d.ts +3 -0
- package/lib/shared/errors.js.map +1 -1
- package/lib/shared/utils.d.ts +1 -1
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/esm/shared/errors.js
CHANGED
|
@@ -134,4 +134,9 @@ export class MissingPKCSS11Lib extends InternalError {
|
|
|
134
134
|
super(msg, MissingPKCSS11Lib.name, 500);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
export class EndorsementError extends InternalError {
|
|
138
|
+
constructor(message) {
|
|
139
|
+
super(message, EndorsementError.name, 500);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
137
142
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,kFAAkF;AAClF;;;;;;;;;GASG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC9C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAa,SAAQ,aAAa;IAC7C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa;IAC/C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,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AuB;QACjC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -43,7 +43,7 @@ export declare class CoreUtils {
|
|
|
43
43
|
* @param {string|Buffer} contentOrPath - Path to a file on disk or an already-loaded Buffer
|
|
44
44
|
* @return {Promise<string|Uint8Array|Buffer>} The file content as a Buffer/string depending on reader
|
|
45
45
|
*/
|
|
46
|
-
static readFile(contentOrPath: string | Buffer): Promise<
|
|
46
|
+
static readFile(contentOrPath: string | Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
47
47
|
/**
|
|
48
48
|
* @description Create a Fabric CA User object with enrollment
|
|
49
49
|
* @summary Constructs a fabric-common User, sets a crypto suite, imports the provided private key, and sets enrollment with certificate and MSP ID.
|
package/lib/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.23";
|
|
2
2
|
export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
|
package/lib/esm/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ImplicitPrivateCollection = void 0;
|
|
4
4
|
exports.Owner = Owner;
|
|
5
5
|
exports.ownedByOnCreate = ownedByOnCreate;
|
|
6
|
-
exports.
|
|
6
|
+
exports.ownedBy = ownedBy;
|
|
7
7
|
exports.getFabricModelKey = getFabricModelKey;
|
|
8
8
|
exports.segregatedDataOnCreate = segregatedDataOnCreate;
|
|
9
9
|
exports.segregatedDataOnRead = segregatedDataOnRead;
|
|
@@ -68,7 +68,7 @@ async function ownedByOnCreate(context, data, key, model) {
|
|
|
68
68
|
};
|
|
69
69
|
setOwnedByKeyValue(model, key, owner);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ownedBy() {
|
|
72
72
|
const key = getFabricModelKey(constants_1.FabricModelKeys.OWNEDBY);
|
|
73
73
|
function ownedBy() {
|
|
74
74
|
return function (obj, attribute) {
|
|
@@ -19,7 +19,7 @@ import { FabricFlags } from "./types";
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function Owner(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
21
21
|
export declare function ownedByOnCreate<M extends Model<boolean>, R extends Repo<M>, V>(this: R, context: Context<any>, data: V, key: keyof M, model: M): Promise<void>;
|
|
22
|
-
export declare function
|
|
22
|
+
export declare function ownedBy(): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
23
23
|
export declare function getFabricModelKey(key: string): string;
|
|
24
24
|
export type CollectionResolver = <M extends Model>(model: M) => string;
|
|
25
25
|
export declare const ImplicitPrivateCollection: CollectionResolver;
|
package/lib/shared/errors.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MissingPKCSS11Lib = exports.NotInitializedError = exports.UnauthorizedPrivateDataAccess = exports.MissingContextError = exports.RegistrationError = exports.AllowanceError = exports.BalanceError = exports.OverflowError = void 0;
|
|
3
|
+
exports.EndorsementError = exports.MissingPKCSS11Lib = exports.NotInitializedError = exports.UnauthorizedPrivateDataAccess = exports.MissingContextError = exports.RegistrationError = exports.AllowanceError = exports.BalanceError = exports.OverflowError = void 0;
|
|
4
4
|
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
5
5
|
const core_1 = require("@decaf-ts/core");
|
|
6
6
|
// import { MISSING_PRIVATE_DATA_ERROR_MESSAGE } from "../contracts/private-data";
|
|
@@ -145,4 +145,10 @@ class MissingPKCSS11Lib extends db_decorators_1.InternalError {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
exports.MissingPKCSS11Lib = MissingPKCSS11Lib;
|
|
148
|
+
class EndorsementError extends db_decorators_1.InternalError {
|
|
149
|
+
constructor(message) {
|
|
150
|
+
super(message, EndorsementError.name, 500);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.EndorsementError = EndorsementError;
|
|
148
154
|
//# sourceMappingURL=errors.js.map
|
package/lib/shared/errors.d.ts
CHANGED
|
@@ -117,3 +117,6 @@ export declare class NotInitializedError extends BaseError {
|
|
|
117
117
|
export declare class MissingPKCSS11Lib extends InternalError {
|
|
118
118
|
constructor(msg: string | Error);
|
|
119
119
|
}
|
|
120
|
+
export declare class EndorsementError extends InternalError {
|
|
121
|
+
constructor(message: string | Error);
|
|
122
|
+
}
|
package/lib/shared/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":";;;AAAA,2DAAmE;AACnE,yCAAoD;AACpD,kFAAkF;AAClF;;;;;;;;;GASG;AACH,MAAa,aAAc,SAAQ,6BAAa;IAC9C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF;AAJD,sCAIC;AAED;;;;;;;;;GASG;AACH,MAAa,YAAa,SAAQ,6BAAa;IAC7C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAJD,oCAIC;AAED;;;;;;;;;GASG;AACH,MAAa,cAAe,SAAQ,6BAAa;IAC/C,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AAJD,wCAIC;AAED;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,yBAAkB;IACvD,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAJD,8CAIC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,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or an already-loaded Buffer
|
|
44
44
|
* @return {Promise<string|Uint8Array|Buffer>} The file content as a Buffer/string depending on reader
|
|
45
45
|
*/
|
|
46
|
-
static readFile(contentOrPath: string | Buffer): Promise<
|
|
46
|
+
static readFile(contentOrPath: string | Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
47
47
|
/**
|
|
48
48
|
* @description Create a Fabric CA User object with enrollment
|
|
49
49
|
* @summary Constructs a fabric-common User, sets a crypto suite, imports the provided private key, and sets enrollment with certificate and MSP ID.
|
package/lib/version.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PACKAGE_NAME = exports.VERSION = void 0;
|
|
4
4
|
const decoration_1 = require("@decaf-ts/decoration");
|
|
5
|
-
exports.VERSION = "0.1.
|
|
5
|
+
exports.VERSION = "0.1.23";
|
|
6
6
|
exports.PACKAGE_NAME = "@decaf-ts/for-fabric";
|
|
7
7
|
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
8
8
|
//# sourceMappingURL=version.js.map
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.23";
|
|
2
2
|
export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
|