@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.
Files changed (67) 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/client/logging.cjs +2 -0
  12. package/lib/client/logging.js.map +1 -1
  13. package/lib/contract/Product.cjs +2 -2
  14. package/lib/contract/Product.d.ts +1 -1
  15. package/lib/contracts/ContractAdapter.cjs +1 -1
  16. package/lib/contracts/ContractAdapter.js.map +1 -1
  17. package/lib/contracts/logging.cjs +2 -0
  18. package/lib/contracts/logging.js.map +1 -1
  19. package/lib/contracts/private-data.cjs +1 -1
  20. package/lib/contracts/private-data.d.ts +1 -1
  21. package/lib/contracts/private-data.js.map +1 -1
  22. package/lib/esm/client/FabricClientAdapter.d.ts +7 -6
  23. package/lib/esm/client/FabricClientAdapter.js +49 -33
  24. package/lib/esm/client/FabricClientAdapter.js.map +1 -1
  25. package/lib/esm/client/FabricClientRepository.d.ts +6 -0
  26. package/lib/esm/client/FabricClientRepository.js +32 -2
  27. package/lib/esm/client/FabricClientRepository.js.map +1 -1
  28. package/lib/esm/client/logging.js +2 -0
  29. package/lib/esm/client/logging.js.map +1 -1
  30. package/lib/esm/contract/Product.d.ts +1 -1
  31. package/lib/esm/contract/Product.js +2 -2
  32. package/lib/esm/contracts/ContractAdapter.js +1 -1
  33. package/lib/esm/contracts/ContractAdapter.js.map +1 -1
  34. package/lib/esm/contracts/logging.js +2 -0
  35. package/lib/esm/contracts/logging.js.map +1 -1
  36. package/lib/esm/contracts/private-data.d.ts +1 -1
  37. package/lib/esm/contracts/private-data.js +1 -1
  38. package/lib/esm/contracts/private-data.js.map +1 -1
  39. package/lib/esm/shared/index.d.ts +1 -0
  40. package/lib/esm/shared/index.js +1 -0
  41. package/lib/esm/shared/index.js.map +1 -1
  42. package/lib/esm/shared/overrides/Model.d.ts +14 -0
  43. package/lib/esm/shared/overrides/Model.js +1 -18
  44. package/lib/esm/shared/overrides/Model.js.map +1 -1
  45. package/lib/esm/shared/overrides/index.d.ts +2 -0
  46. package/lib/esm/shared/overrides/index.js +2 -3
  47. package/lib/esm/shared/overrides/index.js.map +1 -1
  48. package/lib/esm/shared/overrides/overrides.d.ts +1 -0
  49. package/lib/esm/shared/overrides/overrides.js +57 -84
  50. package/lib/esm/shared/overrides/overrides.js.map +1 -1
  51. package/lib/esm/version.d.ts +1 -1
  52. package/lib/esm/version.js +1 -1
  53. package/lib/shared/index.cjs +7 -6
  54. package/lib/shared/index.d.ts +1 -0
  55. package/lib/shared/index.js.map +1 -1
  56. package/lib/shared/overrides/Model.cjs +1 -17
  57. package/lib/shared/overrides/Model.d.ts +14 -0
  58. package/lib/shared/overrides/Model.js.map +1 -1
  59. package/lib/shared/overrides/index.cjs +17 -2
  60. package/lib/shared/overrides/index.d.ts +2 -0
  61. package/lib/shared/overrides/index.js.map +1 -1
  62. package/lib/shared/overrides/overrides.cjs +58 -83
  63. package/lib/shared/overrides/overrides.d.ts +1 -0
  64. package/lib/shared/overrides/overrides.js.map +1 -1
  65. package/lib/version.cjs +1 -1
  66. package/lib/version.d.ts +1 -1
  67. package/package.json +3 -1
@@ -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;A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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.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.0.28";
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.0",
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",