@decaf-ts/for-fabric 0.1.0 → 0.1.2
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 +49 -33
- package/lib/client/FabricClientAdapter.d.ts +7 -6
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/client/FabricClientRepository.cjs +32 -2
- package/lib/client/FabricClientRepository.d.ts +6 -0
- package/lib/client/FabricClientRepository.js.map +1 -1
- package/lib/client/logging.cjs +2 -0
- package/lib/client/logging.js.map +1 -1
- package/lib/contract/Product.cjs +2 -2
- package/lib/contract/Product.d.ts +1 -1
- package/lib/contracts/ContractAdapter.cjs +1 -1
- package/lib/contracts/ContractAdapter.js.map +1 -1
- package/lib/contracts/logging.cjs +2 -0
- package/lib/contracts/logging.js.map +1 -1
- package/lib/contracts/private-data.cjs +1 -1
- package/lib/contracts/private-data.d.ts +1 -1
- package/lib/contracts/private-data.js.map +1 -1
- package/lib/esm/client/FabricClientAdapter.d.ts +7 -6
- package/lib/esm/client/FabricClientAdapter.js +49 -33
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientRepository.d.ts +6 -0
- package/lib/esm/client/FabricClientRepository.js +32 -2
- package/lib/esm/client/FabricClientRepository.js.map +1 -1
- package/lib/esm/client/logging.js +2 -0
- package/lib/esm/client/logging.js.map +1 -1
- package/lib/esm/contract/Product.d.ts +1 -1
- package/lib/esm/contract/Product.js +2 -2
- package/lib/esm/contracts/ContractAdapter.js +1 -1
- package/lib/esm/contracts/ContractAdapter.js.map +1 -1
- package/lib/esm/contracts/logging.js +2 -0
- package/lib/esm/contracts/logging.js.map +1 -1
- package/lib/esm/contracts/private-data.d.ts +1 -1
- package/lib/esm/contracts/private-data.js +1 -1
- package/lib/esm/contracts/private-data.js.map +1 -1
- package/lib/esm/shared/index.d.ts +1 -0
- package/lib/esm/shared/index.js +1 -0
- package/lib/esm/shared/index.js.map +1 -1
- package/lib/esm/shared/overrides/Model.d.ts +14 -0
- package/lib/esm/shared/overrides/Model.js +1 -18
- package/lib/esm/shared/overrides/Model.js.map +1 -1
- package/lib/esm/shared/overrides/index.d.ts +2 -0
- package/lib/esm/shared/overrides/index.js +2 -3
- package/lib/esm/shared/overrides/index.js.map +1 -1
- package/lib/esm/shared/overrides/overrides.d.ts +1 -0
- package/lib/esm/shared/overrides/overrides.js +57 -84
- package/lib/esm/shared/overrides/overrides.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/shared/index.cjs +7 -6
- package/lib/shared/index.d.ts +1 -0
- package/lib/shared/index.js.map +1 -1
- package/lib/shared/overrides/Model.cjs +1 -17
- package/lib/shared/overrides/Model.d.ts +14 -0
- package/lib/shared/overrides/Model.js.map +1 -1
- package/lib/shared/overrides/index.cjs +17 -2
- package/lib/shared/overrides/index.d.ts +2 -0
- package/lib/shared/overrides/index.js.map +1 -1
- package/lib/shared/overrides/overrides.cjs +58 -83
- package/lib/shared/overrides/overrides.d.ts +1 -0
- package/lib/shared/overrides/overrides.js.map +1 -1
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +3 -1
|
@@ -1,89 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// import {
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
// import {
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
4
|
+
// import { validateCompare } from "../model/validation";
|
|
5
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
6
|
+
// import { DBKeys } from "../model/constants";
|
|
7
|
+
// import { SerializationError } from "../repository/errors";
|
|
8
|
+
const constants_1 = require("./../constants.cjs");
|
|
9
|
+
decorator_validation_1.Model.prototype.isShared = function isShared() {
|
|
10
|
+
return decorator_validation_1.Model.isShared(this.constructor);
|
|
11
|
+
};
|
|
12
|
+
decorator_validation_1.Model.prototype.isPrivate = function isPrivate() {
|
|
13
|
+
return decorator_validation_1.Model.isPrivate(this.constructor);
|
|
14
|
+
};
|
|
15
|
+
decorator_validation_1.Model.prototype.segregate = function segregate() {
|
|
16
|
+
return decorator_validation_1.Model.segregate(this);
|
|
17
|
+
};
|
|
9
18
|
//
|
|
10
|
-
// Model.
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// };
|
|
15
|
-
//
|
|
16
|
-
// Model.prototype.isPrivate = function isPrivate<M extends Model>(
|
|
17
|
-
// this: M
|
|
18
|
-
// ): boolean {
|
|
19
|
-
// return Model.isPrivate(this.constructor as Constructor<M>);
|
|
20
|
-
// };
|
|
21
|
-
//
|
|
22
|
-
// Model.prototype.segregate = function segregate<M extends Model>(
|
|
23
|
-
// this: M
|
|
24
|
-
// ): SegregatedModel<M> {
|
|
25
|
-
// throw new Error("not implemented");
|
|
26
|
-
// };
|
|
27
|
-
//
|
|
28
|
-
// //
|
|
29
|
-
// // (Model as any).toTransient = function toTransient<M extends Model>(model: M) {
|
|
30
|
-
// // if (!Metadata.isTransient(model)) return { model: model };
|
|
31
|
-
// // const decoratedProperties = Metadata.validatableProperties(
|
|
32
|
-
// // model.constructor as any
|
|
33
|
-
// // );
|
|
34
|
-
// //
|
|
35
|
-
// // const transientProps = Metadata.get(
|
|
36
|
-
// // model.constructor as any,
|
|
37
|
-
// // DBKeys.TRANSIENT
|
|
38
|
-
// // );
|
|
39
|
-
// //
|
|
40
|
-
// // const result = {
|
|
41
|
-
// // model: {} as Record<string, any>,
|
|
42
|
-
// // transient: {} as Record<string, any>,
|
|
43
|
-
// // };
|
|
44
|
-
// // for (const key of decoratedProperties) {
|
|
45
|
-
// // const isTransient = Object.keys(transientProps).includes(key);
|
|
46
|
-
// // if (isTransient) {
|
|
47
|
-
// // result.transient = result.transient || {};
|
|
48
|
-
// // try {
|
|
49
|
-
// // result.transient[key] = model[key as keyof M];
|
|
50
|
-
// // } catch (e: unknown) {
|
|
51
|
-
// // throw new SerializationError(
|
|
52
|
-
// // `Failed to serialize transient property ${key}: ${e}`
|
|
53
|
-
// // );
|
|
54
|
-
// // }
|
|
55
|
-
// // } else {
|
|
56
|
-
// // result.model = result.model || {};
|
|
57
|
-
// // result.model[key] = (model as Record<string, any>)[key];
|
|
58
|
-
// // }
|
|
59
|
-
// // }
|
|
60
|
-
// //
|
|
61
|
-
// // result.model = Model.build(result.model, model.constructor.name);
|
|
62
|
-
// // return result as { model: M; transient?: Record<string, any> };
|
|
63
|
-
// // };
|
|
64
|
-
//
|
|
65
|
-
// (Model as any).segregate = function segregate<M extends Model>(
|
|
66
|
-
// // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
|
-
// model: M
|
|
68
|
-
// ): SegregatedModel<M> {
|
|
69
|
-
// throw new Error("not implemented");
|
|
70
|
-
// }.bind(Model);
|
|
71
|
-
//
|
|
72
|
-
// (Model as any).isPrivate = function isPrivate<M extends Model>(
|
|
73
|
-
// model: M | Constructor<M>
|
|
74
|
-
// ): boolean {
|
|
75
|
-
// return !!Metadata.get(
|
|
76
|
-
// typeof model !== "function" ? (model.constructor as any) : model,
|
|
77
|
-
// FabricModelKeys.PRIVATE
|
|
19
|
+
// (Model as any).toTransient = function toTransient<M extends Model>(model: M) {
|
|
20
|
+
// if (!Metadata.isTransient(model)) return { model: model };
|
|
21
|
+
// const decoratedProperties = Metadata.validatableProperties(
|
|
22
|
+
// model.constructor as any
|
|
78
23
|
// );
|
|
79
|
-
// }.bind(Model);
|
|
80
24
|
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
// return !!Metadata.get(
|
|
85
|
-
// typeof model !== "function" ? (model.constructor as any) : model,
|
|
86
|
-
// FabricModelKeys.SHARED
|
|
25
|
+
// const transientProps = Metadata.get(
|
|
26
|
+
// model.constructor as any,
|
|
27
|
+
// DBKeys.TRANSIENT
|
|
87
28
|
// );
|
|
88
|
-
//
|
|
29
|
+
//
|
|
30
|
+
// const result = {
|
|
31
|
+
// model: {} as Record<string, any>,
|
|
32
|
+
// transient: {} as Record<string, any>,
|
|
33
|
+
// };
|
|
34
|
+
// for (const key of decoratedProperties) {
|
|
35
|
+
// const isTransient = Object.keys(transientProps).includes(key);
|
|
36
|
+
// if (isTransient) {
|
|
37
|
+
// result.transient = result.transient || {};
|
|
38
|
+
// try {
|
|
39
|
+
// result.transient[key] = model[key as keyof M];
|
|
40
|
+
// } catch (e: unknown) {
|
|
41
|
+
// throw new SerializationError(
|
|
42
|
+
// `Failed to serialize transient property ${key}: ${e}`
|
|
43
|
+
// );
|
|
44
|
+
// }
|
|
45
|
+
// } else {
|
|
46
|
+
// result.model = result.model || {};
|
|
47
|
+
// result.model[key] = (model as Record<string, any>)[key];
|
|
48
|
+
// }
|
|
49
|
+
// }
|
|
50
|
+
//
|
|
51
|
+
// result.model = Model.build(result.model, model.constructor.name);
|
|
52
|
+
// return result as { model: M; transient?: Record<string, any> };
|
|
53
|
+
// };
|
|
54
|
+
const seg = decorator_validation_1.Model.segregate;
|
|
55
|
+
decorator_validation_1.Model.segregate = function segregate(model) {
|
|
56
|
+
return seg.call(decorator_validation_1.Model, model);
|
|
57
|
+
}.bind(decorator_validation_1.Model);
|
|
58
|
+
decorator_validation_1.Model.isPrivate = function isPrivate(model) {
|
|
59
|
+
return !!decoration_1.Metadata.get(typeof model !== "function" ? model.constructor : model, constants_1.FabricModelKeys.PRIVATE);
|
|
60
|
+
}.bind(decorator_validation_1.Model);
|
|
61
|
+
decoration_1.Metadata.isShared = function isShared(model) {
|
|
62
|
+
return !!decoration_1.Metadata.get(typeof model !== "function" ? model.constructor : model, constants_1.FabricModelKeys.SHARED);
|
|
63
|
+
}.bind(decoration_1.Metadata);
|
|
89
64
|
//# sourceMappingURL=overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":";;AAAA,yEAAuD;AACvD,yDAAyD;AACzD,qDAA6D;AAC7D,+CAA+C;AAC/C,6DAA6D;AAC7D,kDAA+C;AAG/C,4BAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,SAAS,QAAQ;IAG1C,OAAO,4BAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAA6B,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,4BAAK,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,SAAS;IAG5C,OAAO,4BAAK,CAAC,SAAS,CAAC,IAAI,CAAC,WAA6B,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,4BAAK,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,SAAS;IAG5C,OAAO,4BAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,EAAE;AACF,iFAAiF;AACjF,+DAA+D;AAC/D,gEAAgE;AAChE,+BAA+B;AAC/B,OAAO;AACP,EAAE;AACF,yCAAyC;AACzC,gCAAgC;AAChC,uBAAuB;AACvB,OAAO;AACP,EAAE;AACF,qBAAqB;AACrB,wCAAwC;AACxC,4CAA4C;AAC5C,OAAO;AACP,6CAA6C;AAC7C,qEAAqE;AACrE,yBAAyB;AACzB,mDAAmD;AACnD,cAAc;AACd,yDAAyD;AACzD,+BAA+B;AAC/B,wCAAwC;AACxC,kEAAkE;AAClE,aAAa;AACb,UAAU;AACV,eAAe;AACf,2CAA2C;AAC3C,iEAAiE;AACjE,QAAQ;AACR,MAAM;AACN,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,KAAK;AAEL,MAAM,GAAG,GAAG,4BAAK,CAAC,SAAS,CAAC;AAE3B,4BAAa,CAAC,SAAS,GAAG,SAAS,SAAS,CAC3C,KAAQ;IAER,OAAO,GAAG,CAAC,IAAI,CAAC,4BAAK,EAAE,KAAK,CAAuB,CAAC;AACtD,CAAC,CAAC,IAAI,CAAC,4BAAK,CAAC,CAAC;AAEb,4BAAa,CAAC,SAAS,GAAG,SAAS,SAAS,CAC3C,KAAyB;IAEzB,OAAO,CAAC,CAAC,qBAAQ,CAAC,GAAG,CACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAK,CAAC,WAAmB,CAAC,CAAC,CAAC,KAAK,EAChE,2BAAe,CAAC,OAAO,CACxB,CAAC;AACJ,CAAC,CAAC,IAAI,CAAC,4BAAK,CAAC,CAAC;AAEb,qBAAgB,CAAC,QAAQ,GAAG,SAAS,QAAQ,CAC5C,KAAyB;IAEzB,OAAO,CAAC,CAAC,qBAAQ,CAAC,GAAG,CACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAK,CAAC,WAAmB,CAAC,CAAC,CAAC,KAAK,EAChE,2BAAe,CAAC,MAAM,CACvB,CAAC;AACJ,CAAC,CAAC,IAAI,CAAC,qBAAQ,CAAC,CAAC"}
|
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.
|
|
5
|
+
exports.VERSION = "0.1.1";
|
|
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
|
+
export declare const VERSION = "0.1.1";
|
|
2
2
|
export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/for-fabric",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "template for ts projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
"docs": "npx rimraf ./docs && mkdir docs && npx build-scripts --docs",
|
|
68
68
|
"infrastructure:up": "docker compose -f ./docker/infrastructure/docker-compose.yaml up -d",
|
|
69
69
|
"infrastructure:down": "docker compose -f ./docker/infrastructure/docker-compose.yaml down --rmi local -v",
|
|
70
|
+
"infrastructure-hsm:up": "docker compose -f ./docker/infrastructure/docker-compose-hsm.yaml up -d",
|
|
71
|
+
"infrastructure-hsm:down": "docker compose -f ./docker/infrastructure/docker-compose-hsm.yaml down --rmi local -v",
|
|
70
72
|
"publish-docs": "docker run -it --rm --user $(id -u):$(id -g) -v \"$(pwd)/workdocs/confluence:/content\" -e ATLASSIAN_API_TOKEN=$(cat .confluence-token) ghcr.io/markdown-confluence/publish:latest",
|
|
71
73
|
"copy-storage": "sudo cp -R docker/infrastructure/storage docker/docker-data/ && sudo chmod -R 755 docker/docker-data",
|
|
72
74
|
"repo:init": "codex exec \"$(cat ./.codex/prompts/repo-setup.md)\nbase_path is `./`, initialize the repository\" -s workspace-write",
|