@decaf-ts/for-fabric 0.14.1 → 0.15.1
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/cjs/client/FabricClientAdapter.cjs +11 -6
- package/lib/cjs/client/FabricClientAdapter.cjs.map +1 -1
- package/lib/cjs/client/FabricClientStatement.cjs +1 -22
- package/lib/cjs/client/FabricClientStatement.cjs.map +1 -1
- package/lib/cjs/shared/constants.cjs +1 -0
- package/lib/cjs/shared/constants.cjs.map +1 -1
- package/lib/cjs/shared/decorators.cjs +7 -0
- package/lib/cjs/shared/decorators.cjs.map +1 -1
- package/lib/cjs/shared/overrides/overrides.cjs +18 -6
- package/lib/cjs/shared/overrides/overrides.cjs.map +1 -1
- package/lib/cjs/version.cjs +3 -3
- package/lib/esm/client/FabricClientAdapter.js +12 -7
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientStatement.js +1 -22
- package/lib/esm/client/FabricClientStatement.js.map +1 -1
- package/lib/esm/shared/constants.js +1 -0
- package/lib/esm/shared/constants.js.map +1 -1
- package/lib/esm/shared/decorators.js +6 -0
- package/lib/esm/shared/decorators.js.map +1 -1
- package/lib/esm/shared/overrides/overrides.js +18 -6
- package/lib/esm/shared/overrides/overrides.js.map +1 -1
- package/lib/esm/version.js +3 -3
- package/lib/types/shared/constants.d.cts +1 -0
- package/lib/types/shared/constants.d.mts +1 -0
- package/lib/types/shared/decorators.d.cts +8 -5
- package/lib/types/shared/decorators.d.mts +8 -5
- package/lib/types/shared/overrides/Model.d.cts +3 -1
- package/lib/types/shared/overrides/Model.d.mts +3 -1
- package/lib/types/version.d.cts +3 -3
- package/lib/types/version.d.mts +3 -3
- package/package.json +1 -1
|
@@ -89,7 +89,7 @@ Model.collectionsFor = function collectionsFor(model) {
|
|
|
89
89
|
sharedCols: sharedMeta?.collections || [],
|
|
90
90
|
};
|
|
91
91
|
}.bind(Model);
|
|
92
|
-
Model.chaincodeOf = function chaincodeOf(model, ...args) {
|
|
92
|
+
Model.chaincodeOf = function chaincodeOf(model, config, ...args) {
|
|
93
93
|
const m = Metadata.get(model, FabricModelKeys.CHAINCODE);
|
|
94
94
|
if (!m || !m.resolver)
|
|
95
95
|
return undefined;
|
|
@@ -98,9 +98,9 @@ Model.chaincodeOf = function chaincodeOf(model, ...args) {
|
|
|
98
98
|
const ctx = args.pop();
|
|
99
99
|
if (!ctx || !(ctx instanceof Context))
|
|
100
100
|
throw new InternalError(`No context provided for chaincode resolution`);
|
|
101
|
-
return m.resolver(model, ...args, ctx);
|
|
101
|
+
return m.resolver(model, config, ...args, ctx);
|
|
102
102
|
}.bind(Model);
|
|
103
|
-
Model.contractOf = function contractOf(model, ...args) {
|
|
103
|
+
Model.contractOf = function contractOf(model, config, ...args) {
|
|
104
104
|
const m = Metadata.get(model, FabricModelKeys.CONTRACT);
|
|
105
105
|
if (!m || !m.resolver)
|
|
106
106
|
return undefined;
|
|
@@ -109,9 +109,9 @@ Model.contractOf = function contractOf(model, ...args) {
|
|
|
109
109
|
const ctx = args.pop();
|
|
110
110
|
if (!ctx || !(ctx instanceof Context))
|
|
111
111
|
throw new InternalError(`No context provided for chaincode resolution`);
|
|
112
|
-
return m.resolver(model, ...args, ctx);
|
|
112
|
+
return m.resolver(model, config, ...args, ctx);
|
|
113
113
|
}.bind(Model);
|
|
114
|
-
Model.channelOf = function channelOf(model, ...args) {
|
|
114
|
+
Model.channelOf = function channelOf(model, config, ...args) {
|
|
115
115
|
const m = Metadata.get(model, FabricModelKeys.CHANNEL);
|
|
116
116
|
if (!m || !m.resolver)
|
|
117
117
|
return undefined;
|
|
@@ -120,6 +120,18 @@ Model.channelOf = function channelOf(model, ...args) {
|
|
|
120
120
|
const ctx = args.pop();
|
|
121
121
|
if (!ctx || !(ctx instanceof Context))
|
|
122
122
|
throw new InternalError(`No context provided for chaincode resolution`);
|
|
123
|
-
return m.resolver(model, ...args, ctx);
|
|
123
|
+
return m.resolver(model, config, ...args, ctx);
|
|
124
|
+
}.bind(Model);
|
|
125
|
+
Model.submissionOf = function submissionOf(model, config, ...args) {
|
|
126
|
+
const constr = typeof model === "function" ? model : model.constructor;
|
|
127
|
+
const m = Metadata.get(constr, FabricModelKeys.SUBMISSION);
|
|
128
|
+
if (!m || !m.resolver)
|
|
129
|
+
return undefined;
|
|
130
|
+
if (typeof m.resolver === "string")
|
|
131
|
+
return m.resolver;
|
|
132
|
+
const ctx = args.pop();
|
|
133
|
+
if (!ctx || !(ctx instanceof Context))
|
|
134
|
+
throw new InternalError(`No context provided for submission resolution`);
|
|
135
|
+
return m.resolver(constr, config, ...args, ctx);
|
|
124
136
|
}.bind(Model);
|
|
125
137
|
//# sourceMappingURL=overrides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,0BAAqB;AAE/C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMhE,OAAO,EAAE,OAAO,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,0BAAqB;AAE/C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMhE,OAAO,EAAE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CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxC,IAAI,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,QAAQ,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,YAAY,OAAO,CAAC;QACnC,MAAM,IAAI,aAAa,CAAC,+CAA+C,CAAC,CAAC;IAC3E,OAAO,CAAC,CAAC,QAAQ,CAAC,MAA4B,EAAE,MAAM,EAAE,GAAI,IAAc,EAAE,GAAG,CAAC,CAAC;AACnF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC"}
|
package/lib/esm/version.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Metadata } from "@decaf-ts/decoration";
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.15.0";
|
|
3
3
|
/**
|
|
4
4
|
* @description Represents the current commit hash of the module build.
|
|
5
5
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
6
6
|
* the placeholder with the actual commit hash at publish time.
|
|
7
7
|
* @const COMMIT
|
|
8
8
|
*/
|
|
9
|
-
export const COMMIT = "
|
|
9
|
+
export const COMMIT = "d14e354";
|
|
10
10
|
/**
|
|
11
11
|
* @description Represents the full version string of the module.
|
|
12
12
|
* @summary Stores the semver version and commit hash for the package.
|
|
13
13
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
14
14
|
* @const FULL_VERSION
|
|
15
15
|
*/
|
|
16
|
-
export const FULL_VERSION = "0.
|
|
16
|
+
export const FULL_VERSION = "0.15.0-d14e354";
|
|
17
17
|
export const PACKAGE_NAME = "@decaf-ts/for-fabric";
|
|
18
18
|
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
|
19
19
|
//# sourceMappingURL=version.js.map
|
|
@@ -2,14 +2,16 @@ import { Repo, Context, Repository, ContextOf, ContextualArgs } from "@decaf-ts/
|
|
|
2
2
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
3
3
|
import { ClientIdentity } from "fabric-shim-api";
|
|
4
4
|
import { Constructor } from "@decaf-ts/decoration";
|
|
5
|
-
import { FabricFlags } from "./types.d.cts";
|
|
5
|
+
import { FabricFlags, PeerConfig } from "./types.d.cts";
|
|
6
6
|
import { FabricContractFlags } from "../contracts/types.d.cts";
|
|
7
7
|
import "../shared/overrides";
|
|
8
8
|
import { type FabricContractContext } from "../contracts/ContractContext.d.cts";
|
|
9
|
-
export type ResolverFunction<T> = (model: Constructor<Model<any>>, ...args: ContextualArgs<any>) => Promise<T> | T;
|
|
10
|
-
export declare const DefaultContractResolver: (model: Constructor<Model<any>>, ...args: ContextualArgs<any>) => string;
|
|
11
|
-
export type
|
|
12
|
-
|
|
9
|
+
export type ResolverFunction<T> = (model: Constructor<Model<any>>, config: PeerConfig, ...args: ContextualArgs<any>) => Promise<T> | T;
|
|
10
|
+
export declare const DefaultContractResolver: (model: Constructor<Model<any>>, _config?: PeerConfig, ...args: ContextualArgs<any>) => string;
|
|
11
|
+
export type SubmissionMode = "legacy" | "gateway";
|
|
12
|
+
export type SubmissionResolverFunction = ResolverFunction<SubmissionMode>;
|
|
13
|
+
export type ChaincodeMetadata<T = string> = {
|
|
14
|
+
resolver: string | ResolverFunction<T>;
|
|
13
15
|
};
|
|
14
16
|
export declare function contract(resolver: any): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
15
17
|
export declare function chaincode(resolver: any): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
@@ -87,3 +89,4 @@ export declare function segregatedDataOnUpdate<M extends Model>(this: Repository
|
|
|
87
89
|
export declare function segregatedDataOnDelete<M extends Model, R extends Repository<M, any>, V extends SegregatedDataMetadata>(this: R, context: ContextOf<R>, data: V | V[], key: (keyof M)[], model: M): Promise<void>;
|
|
88
90
|
export declare function privateData(collection?: string | CollectionResolver): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
89
91
|
export declare function sharedData(collection: string | CollectionResolver): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
92
|
+
export declare function submission(resolver?: SubmissionMode | SubmissionResolverFunction): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
@@ -2,14 +2,16 @@ import { Repo, Context, Repository, ContextOf, ContextualArgs } from "@decaf-ts/
|
|
|
2
2
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
3
3
|
import { ClientIdentity } from "fabric-shim-api";
|
|
4
4
|
import { Constructor } from "@decaf-ts/decoration";
|
|
5
|
-
import { FabricFlags } from "./types.d.mts";
|
|
5
|
+
import { FabricFlags, PeerConfig } from "./types.d.mts";
|
|
6
6
|
import { FabricContractFlags } from "../contracts/types.d.mts";
|
|
7
7
|
import "../shared/overrides";
|
|
8
8
|
import { type FabricContractContext } from "../contracts/ContractContext.d.mts";
|
|
9
|
-
export type ResolverFunction<T> = (model: Constructor<Model<any>>, ...args: ContextualArgs<any>) => Promise<T> | T;
|
|
10
|
-
export declare const DefaultContractResolver: (model: Constructor<Model<any>>, ...args: ContextualArgs<any>) => string;
|
|
11
|
-
export type
|
|
12
|
-
|
|
9
|
+
export type ResolverFunction<T> = (model: Constructor<Model<any>>, config: PeerConfig, ...args: ContextualArgs<any>) => Promise<T> | T;
|
|
10
|
+
export declare const DefaultContractResolver: (model: Constructor<Model<any>>, _config?: PeerConfig, ...args: ContextualArgs<any>) => string;
|
|
11
|
+
export type SubmissionMode = "legacy" | "gateway";
|
|
12
|
+
export type SubmissionResolverFunction = ResolverFunction<SubmissionMode>;
|
|
13
|
+
export type ChaincodeMetadata<T = string> = {
|
|
14
|
+
resolver: string | ResolverFunction<T>;
|
|
13
15
|
};
|
|
14
16
|
export declare function contract(resolver: any): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
15
17
|
export declare function chaincode(resolver: any): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
@@ -87,3 +89,4 @@ export declare function segregatedDataOnUpdate<M extends Model>(this: Repository
|
|
|
87
89
|
export declare function segregatedDataOnDelete<M extends Model, R extends Repository<M, any>, V extends SegregatedDataMetadata>(this: R, context: ContextOf<R>, data: V | V[], key: (keyof M)[], model: M): Promise<void>;
|
|
88
90
|
export declare function privateData(collection?: string | CollectionResolver): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
89
91
|
export declare function sharedData(collection: string | CollectionResolver): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
92
|
+
export declare function submission(resolver?: SubmissionMode | SubmissionResolverFunction): (model: any, prop?: any, descriptor?: PropertyDescriptor | number) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SegregatedModel } from "../types.d.cts";
|
|
2
2
|
import { Constructor } from "@decaf-ts/decoration";
|
|
3
3
|
import "@decaf-ts/decorator-validation";
|
|
4
|
-
import { CollectionResolver, MirrorMetadata } from "../decorators.d.cts";
|
|
4
|
+
import { CollectionResolver, MirrorMetadata, type SubmissionMode } from "../decorators.d.cts";
|
|
5
5
|
import { ContextualArgs } from "@decaf-ts/core";
|
|
6
|
+
import type { PeerConfig } from "../types.d.cts";
|
|
6
7
|
declare module "@decaf-ts/decorator-validation" {
|
|
7
8
|
interface Model {
|
|
8
9
|
isPrivate<M extends Model>(this: M): boolean;
|
|
@@ -22,5 +23,6 @@ declare module "@decaf-ts/decorator-validation" {
|
|
|
22
23
|
function chaincodeOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
23
24
|
function contractOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
24
25
|
function channelOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
26
|
+
function submissionOf<M extends Model>(model: Constructor<M>, config: PeerConfig, ...args: ContextualArgs<any>): SubmissionMode | undefined | Promise<SubmissionMode | undefined>;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SegregatedModel } from "../types.d.mts";
|
|
2
2
|
import { Constructor } from "@decaf-ts/decoration";
|
|
3
3
|
import "@decaf-ts/decorator-validation";
|
|
4
|
-
import { CollectionResolver, MirrorMetadata } from "../decorators.d.mts";
|
|
4
|
+
import { CollectionResolver, MirrorMetadata, type SubmissionMode } from "../decorators.d.mts";
|
|
5
5
|
import { ContextualArgs } from "@decaf-ts/core";
|
|
6
|
+
import type { PeerConfig } from "../types.d.mts";
|
|
6
7
|
declare module "@decaf-ts/decorator-validation" {
|
|
7
8
|
interface Model {
|
|
8
9
|
isPrivate<M extends Model>(this: M): boolean;
|
|
@@ -22,5 +23,6 @@ declare module "@decaf-ts/decorator-validation" {
|
|
|
22
23
|
function chaincodeOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
23
24
|
function contractOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
24
25
|
function channelOf<M extends Model>(model: Constructor<M>, ...args: ContextualArgs<any>): string | undefined | Promise<string | undefined>;
|
|
26
|
+
function submissionOf<M extends Model>(model: Constructor<M>, config: PeerConfig, ...args: ContextualArgs<any>): SubmissionMode | undefined | Promise<SubmissionMode | undefined>;
|
|
25
27
|
}
|
|
26
28
|
}
|
package/lib/types/version.d.cts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.15.0";
|
|
2
2
|
/**
|
|
3
3
|
* @description Represents the current commit hash of the module build.
|
|
4
4
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
5
5
|
* the placeholder with the actual commit hash at publish time.
|
|
6
6
|
* @const COMMIT
|
|
7
7
|
*/
|
|
8
|
-
export declare const COMMIT = "
|
|
8
|
+
export declare const COMMIT = "d14e354";
|
|
9
9
|
/**
|
|
10
10
|
* @description Represents the full version string of the module.
|
|
11
11
|
* @summary Stores the semver version and commit hash for the package.
|
|
12
12
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
13
13
|
* @const FULL_VERSION
|
|
14
14
|
*/
|
|
15
|
-
export declare const FULL_VERSION = "0.
|
|
15
|
+
export declare const FULL_VERSION = "0.15.0-d14e354";
|
|
16
16
|
export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
|
package/lib/types/version.d.mts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.15.0";
|
|
2
2
|
/**
|
|
3
3
|
* @description Represents the current commit hash of the module build.
|
|
4
4
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
5
5
|
* the placeholder with the actual commit hash at publish time.
|
|
6
6
|
* @const COMMIT
|
|
7
7
|
*/
|
|
8
|
-
export declare const COMMIT = "
|
|
8
|
+
export declare const COMMIT = "d14e354";
|
|
9
9
|
/**
|
|
10
10
|
* @description Represents the full version string of the module.
|
|
11
11
|
* @summary Stores the semver version and commit hash for the package.
|
|
12
12
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
13
13
|
* @const FULL_VERSION
|
|
14
14
|
*/
|
|
15
|
-
export declare const FULL_VERSION = "0.
|
|
15
|
+
export declare const FULL_VERSION = "0.15.0-d14e354";
|
|
16
16
|
export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
|