@decaf-ts/for-fabric 0.1.0 → 0.1.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.
Files changed (55) hide show
  1. package/dist/for-fabric.cjs +1 -1
  2. package/dist/for-fabric.cjs.map +1 -1
  3. package/dist/for-fabric.js +1 -1
  4. package/dist/for-fabric.js.map +1 -1
  5. package/lib/client/FabricClientAdapter.cjs +49 -33
  6. package/lib/client/FabricClientAdapter.d.ts +7 -6
  7. package/lib/client/FabricClientAdapter.js.map +1 -1
  8. package/lib/client/FabricClientRepository.cjs +32 -2
  9. package/lib/client/FabricClientRepository.d.ts +6 -0
  10. package/lib/client/FabricClientRepository.js.map +1 -1
  11. package/lib/contracts/ContractAdapter.cjs +1 -1
  12. package/lib/contracts/ContractAdapter.js.map +1 -1
  13. package/lib/contracts/private-data.cjs +1 -1
  14. package/lib/contracts/private-data.d.ts +1 -1
  15. package/lib/contracts/private-data.js.map +1 -1
  16. package/lib/esm/client/FabricClientAdapter.d.ts +7 -6
  17. package/lib/esm/client/FabricClientAdapter.js +49 -33
  18. package/lib/esm/client/FabricClientAdapter.js.map +1 -1
  19. package/lib/esm/client/FabricClientRepository.d.ts +6 -0
  20. package/lib/esm/client/FabricClientRepository.js +32 -2
  21. package/lib/esm/client/FabricClientRepository.js.map +1 -1
  22. package/lib/esm/contracts/ContractAdapter.js +1 -1
  23. package/lib/esm/contracts/ContractAdapter.js.map +1 -1
  24. package/lib/esm/contracts/private-data.d.ts +1 -1
  25. package/lib/esm/contracts/private-data.js +1 -1
  26. package/lib/esm/contracts/private-data.js.map +1 -1
  27. package/lib/esm/shared/index.d.ts +1 -0
  28. package/lib/esm/shared/index.js +1 -0
  29. package/lib/esm/shared/index.js.map +1 -1
  30. package/lib/esm/shared/overrides/Model.d.ts +14 -0
  31. package/lib/esm/shared/overrides/Model.js +1 -18
  32. package/lib/esm/shared/overrides/Model.js.map +1 -1
  33. package/lib/esm/shared/overrides/index.d.ts +2 -0
  34. package/lib/esm/shared/overrides/index.js +2 -3
  35. package/lib/esm/shared/overrides/index.js.map +1 -1
  36. package/lib/esm/shared/overrides/overrides.d.ts +1 -0
  37. package/lib/esm/shared/overrides/overrides.js +57 -84
  38. package/lib/esm/shared/overrides/overrides.js.map +1 -1
  39. package/lib/esm/version.d.ts +1 -1
  40. package/lib/esm/version.js +1 -1
  41. package/lib/shared/index.cjs +7 -6
  42. package/lib/shared/index.d.ts +1 -0
  43. package/lib/shared/index.js.map +1 -1
  44. package/lib/shared/overrides/Model.cjs +1 -17
  45. package/lib/shared/overrides/Model.d.ts +14 -0
  46. package/lib/shared/overrides/Model.js.map +1 -1
  47. package/lib/shared/overrides/index.cjs +17 -2
  48. package/lib/shared/overrides/index.d.ts +2 -0
  49. package/lib/shared/overrides/index.js.map +1 -1
  50. package/lib/shared/overrides/overrides.cjs +58 -83
  51. package/lib/shared/overrides/overrides.d.ts +1 -0
  52. package/lib/shared/overrides/overrides.js.map +1 -1
  53. package/lib/version.cjs +1 -1
  54. package/lib/version.d.ts +1 -1
  55. package/package.json +3 -1
@@ -4,6 +4,7 @@
4
4
  * @namespace shared
5
5
  * @memberOf module:for-fabric
6
6
  */
7
+ export * from "./overrides/index.js";
7
8
  export * from "./events.js";
8
9
  export * from "./utils.js";
9
10
  export * from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4BAAyB;AACzB,2BAAwB;AACxB,2BAAwB;AACxB,8CAAmC;AACnC,iCAAwB;AACxB,gCAA6B;AAC7B,+BAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qCAA4B;AAC5B,4BAAyB;AACzB,2BAAwB;AACxB,2BAAwB;AACxB,8CAAmC;AACnC,iCAAwB;AACxB,gCAA6B;AAC7B,+BAA4B"}
@@ -0,0 +1,14 @@
1
+ import { SegregatedModel } from "../types";
2
+ import { Constructor } from "@decaf-ts/decoration";
3
+ declare module "@decaf-ts/decorator-validation" {
4
+ interface Model {
5
+ isPrivate<M extends Model>(this: M): boolean;
6
+ isShared<M extends Model>(this: M): boolean;
7
+ segregate<M extends Model>(this: M): SegregatedModel<M>;
8
+ }
9
+ namespace Model {
10
+ function isPrivate<M extends Model>(model: Constructor<M>): boolean;
11
+ function isShared<M extends Model>(model: Constructor<M>): boolean;
12
+ function segregate<M extends Model>(model: M): SegregatedModel<M>;
13
+ }
14
+ }
@@ -1,19 +1,2 @@
1
- "use strict";
2
- // import { SegregatedModel } from "../types";
3
- // import { Constructor } from "@decaf-ts/decoration";
4
- //
5
- // declare module "@decaf-ts/decorator-validation" {
6
- // export interface Model {
7
- // isPrivate<M extends Model>(this: M): boolean;
8
- // isShared<M extends Model>(this: M): boolean;
9
- // segregate<M extends Model>(this: M): SegregatedModel<M>;
10
- // }
11
- //
12
- // // eslint-disable-next-line @typescript-eslint/no-namespace
13
- // export namespace Model {
14
- // function isPrivate<M extends Model>(model: Constructor<M>): boolean;
15
- // function isShared<M extends Model>(model: Constructor<M>): boolean;
16
- // function segregate<M extends Model>(model: M): SegregatedModel<M>;
17
- // }
18
- // }
1
+ export {};
19
2
  //# sourceMappingURL=Model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../../../src/shared/overrides/Model.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,sDAAsD;AACtD,EAAE;AACF,oDAAoD;AACpD,6BAA6B;AAC7B,oDAAoD;AACpD,mDAAmD;AACnD,+DAA+D;AAC/D,MAAM;AACN,EAAE;AACF,gEAAgE;AAChE,6BAA6B;AAC7B,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,MAAM;AACN,IAAI"}
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../../../src/shared/overrides/Model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./Model";
2
+ export * from "./overrides";
@@ -1,4 +1,3 @@
1
- "use strict";
2
- // export * from "./Model";
3
- // export * from "./overrides";
1
+ export * from "./Model.js";
2
+ export * from "./overrides.js";
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/overrides/index.ts"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,+BAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/overrides/index.ts"],"names":[],"mappings":"AAAA,2BAAwB;AACxB,+BAA4B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,89 +1,62 @@
1
- "use strict";
2
- // import { Model } from "@decaf-ts/decorator-validation";
3
- // // import { validateCompare } from "../model/validation";
4
- // import { Constructor, Metadata } from "@decaf-ts/decoration";
5
- // // import { DBKeys } from "../model/constants";
6
- // // import { SerializationError } from "../repository/errors";
7
- // import { FabricModelKeys } from "../constants";
8
- // import { SegregatedModel } from "../types";
1
+ import { Model } from "@decaf-ts/decorator-validation";
2
+ // import { validateCompare } from "../model/validation";
3
+ import { Metadata } from "@decaf-ts/decoration";
4
+ // import { DBKeys } from "../model/constants";
5
+ // import { SerializationError } from "../repository/errors";
6
+ import { FabricModelKeys } from "./../constants.js";
7
+ Model.prototype.isShared = function isShared() {
8
+ return Model.isShared(this.constructor);
9
+ };
10
+ Model.prototype.isPrivate = function isPrivate() {
11
+ return Model.isPrivate(this.constructor);
12
+ };
13
+ Model.prototype.segregate = function segregate() {
14
+ return Model.segregate(this);
15
+ };
9
16
  //
10
- // Model.prototype.isShared = function isShared<M extends Model>(
11
- // this: M
12
- // ): boolean {
13
- // return Model.isShared(this.constructor as Constructor<M>);
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
17
+ // (Model as any).toTransient = function toTransient<M extends Model>(model: M) {
18
+ // if (!Metadata.isTransient(model)) return { model: model };
19
+ // const decoratedProperties = Metadata.validatableProperties(
20
+ // model.constructor as any
78
21
  // );
79
- // }.bind(Model);
80
22
  //
81
- // (Metadata as any).isShared = function isShared<M extends Model>(
82
- // model: M | Constructor<M>
83
- // ): boolean {
84
- // return !!Metadata.get(
85
- // typeof model !== "function" ? (model.constructor as any) : model,
86
- // FabricModelKeys.SHARED
23
+ // const transientProps = Metadata.get(
24
+ // model.constructor as any,
25
+ // DBKeys.TRANSIENT
87
26
  // );
88
- // }.bind(Metadata);
27
+ //
28
+ // const result = {
29
+ // model: {} as Record<string, any>,
30
+ // transient: {} as Record<string, any>,
31
+ // };
32
+ // for (const key of decoratedProperties) {
33
+ // const isTransient = Object.keys(transientProps).includes(key);
34
+ // if (isTransient) {
35
+ // result.transient = result.transient || {};
36
+ // try {
37
+ // result.transient[key] = model[key as keyof M];
38
+ // } catch (e: unknown) {
39
+ // throw new SerializationError(
40
+ // `Failed to serialize transient property ${key}: ${e}`
41
+ // );
42
+ // }
43
+ // } else {
44
+ // result.model = result.model || {};
45
+ // result.model[key] = (model as Record<string, any>)[key];
46
+ // }
47
+ // }
48
+ //
49
+ // result.model = Model.build(result.model, model.constructor.name);
50
+ // return result as { model: M; transient?: Record<string, any> };
51
+ // };
52
+ const seg = Model.segregate;
53
+ Model.segregate = function segregate(model) {
54
+ return seg.call(Model, model);
55
+ }.bind(Model);
56
+ Model.isPrivate = function isPrivate(model) {
57
+ return !!Metadata.get(typeof model !== "function" ? model.constructor : model, FabricModelKeys.PRIVATE);
58
+ }.bind(Model);
59
+ Metadata.isShared = function isShared(model) {
60
+ return !!Metadata.get(typeof model !== "function" ? model.constructor : model, FabricModelKeys.SHARED);
61
+ }.bind(Metadata);
89
62
  //# sourceMappingURL=overrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,4DAA4D;AAC5D,gEAAgE;AAChE,kDAAkD;AAClD,gEAAgE;AAChE,kDAAkD;AAClD,8CAA8C;AAC9C,EAAE;AACF,iEAAiE;AACjE,YAAY;AACZ,eAAe;AACf,+DAA+D;AAC/D,KAAK;AACL,EAAE;AACF,mEAAmE;AACnE,YAAY;AACZ,eAAe;AACf,gEAAgE;AAChE,KAAK;AACL,EAAE;AACF,mEAAmE;AACnE,YAAY;AACZ,0BAA0B;AAC1B,wCAAwC;AACxC,KAAK;AACL,EAAE;AACF,KAAK;AACL,oFAAoF;AACpF,kEAAkE;AAClE,mEAAmE;AACnE,kCAAkC;AAClC,UAAU;AACV,KAAK;AACL,4CAA4C;AAC5C,mCAAmC;AACnC,0BAA0B;AAC1B,UAAU;AACV,KAAK;AACL,wBAAwB;AACxB,2CAA2C;AAC3C,+CAA+C;AAC/C,UAAU;AACV,gDAAgD;AAChD,wEAAwE;AACxE,4BAA4B;AAC5B,sDAAsD;AACtD,iBAAiB;AACjB,4DAA4D;AAC5D,kCAAkC;AAClC,2CAA2C;AAC3C,qEAAqE;AACrE,gBAAgB;AAChB,aAAa;AACb,kBAAkB;AAClB,8CAA8C;AAC9C,oEAAoE;AACpE,WAAW;AACX,SAAS;AACT,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,QAAQ;AACR,EAAE;AACF,kEAAkE;AAClE,kEAAkE;AAClE,aAAa;AACb,0BAA0B;AAC1B,wCAAwC;AACxC,iBAAiB;AACjB,EAAE;AACF,kEAAkE;AAClE,8BAA8B;AAC9B,eAAe;AACf,2BAA2B;AAC3B,wEAAwE;AACxE,8BAA8B;AAC9B,OAAO;AACP,iBAAiB;AACjB,EAAE;AACF,mEAAmE;AACnE,8BAA8B;AAC9B,eAAe;AACf,2BAA2B;AAC3B,wEAAwE;AACxE,6BAA6B;AAC7B,OAAO;AACP,oBAAoB"}
1
+ {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/shared/overrides/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,yDAAyD;AACzD,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,+CAA+C;AAC/C,6DAA6D;AAC7D,OAAO,EAAE,eAAe,EAAE,0BAAqB;AAG/C,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,SAAS,QAAQ;IAG1C,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAA6B,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,SAAS;IAG5C,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,WAA6B,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,SAAS;IAG5C,OAAO,KAAK,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,KAAK,CAAC,SAAS,CAAC;AAE3B,KAAa,CAAC,SAAS,GAAG,SAAS,SAAS,CAC3C,KAAQ;IAER,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAuB,CAAC;AACtD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEb,KAAa,CAAC,SAAS,GAAG,SAAS,SAAS,CAC3C,KAAyB;IAEzB,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAK,CAAC,WAAmB,CAAC,CAAC,CAAC,KAAK,EAChE,eAAe,CAAC,OAAO,CACxB,CAAC;AACJ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEb,QAAgB,CAAC,QAAQ,GAAG,SAAS,QAAQ,CAC5C,KAAyB;IAEzB,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAK,CAAC,WAAmB,CAAC,CAAC,CAAC,KAAK,EAChE,eAAe,CAAC,MAAM,CACvB,CAAC;AACJ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.28";
1
+ export declare const VERSION = "0.1.0";
2
2
  export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
@@ -1,5 +1,5 @@
1
1
  import { Metadata } from "@decaf-ts/decoration";
2
- export const VERSION = "0.0.28";
2
+ export const VERSION = "0.1.0";
3
3
  export const PACKAGE_NAME = "@decaf-ts/for-fabric";
4
4
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
5
5
  //# sourceMappingURL=version.js.map
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * @description Hyperledger Fabric Shared Module for Decaf-ts
4
- * @summary This module provides common logic to the client and contract sides of Hyperledger Fabric
5
- * @namespace shared
6
- * @memberOf module:for-fabric
7
- */
8
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -20,6 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
15
  };
22
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @description Hyperledger Fabric Shared Module for Decaf-ts
19
+ * @summary This module provides common logic to the client and contract sides of Hyperledger Fabric
20
+ * @namespace shared
21
+ * @memberOf module:for-fabric
22
+ */
23
+ __exportStar(require("./overrides/index.cjs"), exports);
23
24
  __exportStar(require("./events.cjs"), exports);
24
25
  __exportStar(require("./utils.cjs"), exports);
25
26
  __exportStar(require("./types.cjs"), exports);
@@ -4,6 +4,7 @@
4
4
  * @namespace shared
5
5
  * @memberOf module:for-fabric
6
6
  */
7
+ export * from "./overrides";
7
8
  export * from "./events";
8
9
  export * from "./utils";
9
10
  export * from "./types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,+CAAyB;AACzB,8CAAwB;AACxB,8CAAwB;AACxB,iEAAmC;AACnC,oDAAwB;AACxB,mDAA6B;AAC7B,kDAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,wDAA4B;AAC5B,+CAAyB;AACzB,8CAAwB;AACxB,8CAAwB;AACxB,iEAAmC;AACnC,oDAAwB;AACxB,mDAA6B;AAC7B,kDAA4B"}
@@ -1,19 +1,3 @@
1
1
  "use strict";
2
- // import { SegregatedModel } from "../types";
3
- // import { Constructor } from "@decaf-ts/decoration";
4
- //
5
- // declare module "@decaf-ts/decorator-validation" {
6
- // export interface Model {
7
- // isPrivate<M extends Model>(this: M): boolean;
8
- // isShared<M extends Model>(this: M): boolean;
9
- // segregate<M extends Model>(this: M): SegregatedModel<M>;
10
- // }
11
- //
12
- // // eslint-disable-next-line @typescript-eslint/no-namespace
13
- // export namespace Model {
14
- // function isPrivate<M extends Model>(model: Constructor<M>): boolean;
15
- // function isShared<M extends Model>(model: Constructor<M>): boolean;
16
- // function segregate<M extends Model>(model: M): SegregatedModel<M>;
17
- // }
18
- // }
2
+ Object.defineProperty(exports, "__esModule", { value: true });
19
3
  //# sourceMappingURL=Model.js.map
@@ -0,0 +1,14 @@
1
+ import { SegregatedModel } from "../types";
2
+ import { Constructor } from "@decaf-ts/decoration";
3
+ declare module "@decaf-ts/decorator-validation" {
4
+ interface Model {
5
+ isPrivate<M extends Model>(this: M): boolean;
6
+ isShared<M extends Model>(this: M): boolean;
7
+ segregate<M extends Model>(this: M): SegregatedModel<M>;
8
+ }
9
+ namespace Model {
10
+ function isPrivate<M extends Model>(model: Constructor<M>): boolean;
11
+ function isShared<M extends Model>(model: Constructor<M>): boolean;
12
+ function segregate<M extends Model>(model: M): SegregatedModel<M>;
13
+ }
14
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../../src/shared/overrides/Model.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,sDAAsD;AACtD,EAAE;AACF,oDAAoD;AACpD,6BAA6B;AAC7B,oDAAoD;AACpD,mDAAmD;AACnD,+DAA+D;AAC/D,MAAM;AACN,EAAE;AACF,gEAAgE;AAChE,6BAA6B;AAC7B,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,MAAM;AACN,IAAI"}
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../../src/shared/overrides/Model.ts"],"names":[],"mappings":""}
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
- // export * from "./Model";
3
- // export * from "./overrides";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Model.cjs"), exports);
18
+ __exportStar(require("./overrides.cjs"), exports);
4
19
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export * from "./Model";
2
+ export * from "./overrides";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/overrides/index.ts"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,+BAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/overrides/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,kDAA4B"}
@@ -1,89 +1,64 @@
1
1
  "use strict";
2
- // import { Model } from "@decaf-ts/decorator-validation";
3
- // // import { validateCompare } from "../model/validation";
4
- // import { Constructor, Metadata } from "@decaf-ts/decoration";
5
- // // import { DBKeys } from "../model/constants";
6
- // // import { SerializationError } from "../repository/errors";
7
- // import { FabricModelKeys } from "../constants";
8
- // import { SegregatedModel } from "../types";
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.prototype.isShared = function isShared<M extends Model>(
11
- // this: M
12
- // ): boolean {
13
- // return Model.isShared(this.constructor as Constructor<M>);
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
- // (Metadata as any).isShared = function isShared<M extends Model>(
82
- // model: M | Constructor<M>
83
- // ): boolean {
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
- // }.bind(Metadata);
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":";AAAA,0DAA0D;AAC1D,4DAA4D;AAC5D,gEAAgE;AAChE,kDAAkD;AAClD,gEAAgE;AAChE,kDAAkD;AAClD,8CAA8C;AAC9C,EAAE;AACF,iEAAiE;AACjE,YAAY;AACZ,eAAe;AACf,+DAA+D;AAC/D,KAAK;AACL,EAAE;AACF,mEAAmE;AACnE,YAAY;AACZ,eAAe;AACf,gEAAgE;AAChE,KAAK;AACL,EAAE;AACF,mEAAmE;AACnE,YAAY;AACZ,0BAA0B;AAC1B,wCAAwC;AACxC,KAAK;AACL,EAAE;AACF,KAAK;AACL,oFAAoF;AACpF,kEAAkE;AAClE,mEAAmE;AACnE,kCAAkC;AAClC,UAAU;AACV,KAAK;AACL,4CAA4C;AAC5C,mCAAmC;AACnC,0BAA0B;AAC1B,UAAU;AACV,KAAK;AACL,wBAAwB;AACxB,2CAA2C;AAC3C,+CAA+C;AAC/C,UAAU;AACV,gDAAgD;AAChD,wEAAwE;AACxE,4BAA4B;AAC5B,sDAAsD;AACtD,iBAAiB;AACjB,4DAA4D;AAC5D,kCAAkC;AAClC,2CAA2C;AAC3C,qEAAqE;AACrE,gBAAgB;AAChB,aAAa;AACb,kBAAkB;AAClB,8CAA8C;AAC9C,oEAAoE;AACpE,WAAW;AACX,SAAS;AACT,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,QAAQ;AACR,EAAE;AACF,kEAAkE;AAClE,kEAAkE;AAClE,aAAa;AACb,0BAA0B;AAC1B,wCAAwC;AACxC,iBAAiB;AACjB,EAAE;AACF,kEAAkE;AAClE,8BAA8B;AAC9B,eAAe;AACf,2BAA2B;AAC3B,wEAAwE;AACxE,8BAA8B;AAC9B,OAAO;AACP,iBAAiB;AACjB,EAAE;AACF,mEAAmE;AACnE,8BAA8B;AAC9B,eAAe;AACf,2BAA2B;AAC3B,wEAAwE;AACxE,6BAA6B;AAC7B,OAAO;AACP,oBAAoB"}
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.0.28";
5
+ exports.VERSION = "0.1.0";
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.0.28";
1
+ export declare const VERSION = "0.1.0";
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.0",
3
+ "version": "0.1.1",
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",