@venizia/ignis-kernel 0.4.8-5 → 0.4.8-7

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 (69) hide show
  1. package/dist/esm/base/applications/common/types/application.d.ts +3 -4
  2. package/dist/esm/base/applications/common/types/application.js.map +1 -1
  3. package/dist/esm/base/applications/rest.d.ts +13 -7
  4. package/dist/esm/base/applications/rest.js +52 -7
  5. package/dist/esm/base/applications/rest.js.map +1 -1
  6. package/dist/esm/base/applications/router-factory.d.ts +27 -0
  7. package/dist/esm/base/applications/router-factory.js +28 -0
  8. package/dist/esm/base/applications/router-factory.js.map +1 -0
  9. package/dist/esm/base/auth/authenticate/common/types/jwt.d.ts +6 -4
  10. package/dist/esm/base/auth/authenticate/common/types/jwt.js.map +1 -1
  11. package/dist/esm/base/auth/authenticate/common/types/service.d.ts +1 -1
  12. package/dist/esm/base/auth/authenticate/common/types/service.js.map +1 -1
  13. package/dist/esm/base/controllers/factory/controller.js +5 -2
  14. package/dist/esm/base/controllers/factory/controller.js.map +1 -1
  15. package/dist/esm/base/controllers/factory/crud/readable.js +2 -1
  16. package/dist/esm/base/controllers/factory/crud/readable.js.map +1 -1
  17. package/dist/esm/base/controllers/factory/definition.d.ts +3 -3
  18. package/dist/esm/base/controllers/factory/definition.js +3 -3
  19. package/dist/esm/base/controllers/factory/definition.js.map +1 -1
  20. package/dist/esm/base/controllers/rest/abstract.js +5 -0
  21. package/dist/esm/base/controllers/rest/abstract.js.map +1 -1
  22. package/dist/esm/base/datasources/abstract.d.ts +69 -2
  23. package/dist/esm/base/datasources/abstract.js +186 -1
  24. package/dist/esm/base/datasources/abstract.js.map +1 -1
  25. package/dist/esm/base/datasources/common/types.d.ts +60 -1
  26. package/dist/esm/base/datasources/common/types.js +14 -0
  27. package/dist/esm/base/datasources/common/types.js.map +1 -1
  28. package/dist/esm/base/datasources/opening-handles.d.ts +8 -0
  29. package/dist/esm/base/datasources/opening-handles.js +8 -0
  30. package/dist/esm/base/datasources/opening-handles.js.map +1 -0
  31. package/dist/esm/base/metadata/persistents.js +20 -1
  32. package/dist/esm/base/metadata/persistents.js.map +1 -1
  33. package/dist/esm/base/middlewares/app-error/app-error.middleware.js +12 -1
  34. package/dist/esm/base/middlewares/app-error/app-error.middleware.js.map +1 -1
  35. package/dist/esm/base/middlewares/app-error/common/types.d.ts +10 -8
  36. package/dist/esm/base/middlewares/app-error/common/types.js.map +1 -1
  37. package/dist/esm/base/middlewares/app-error/database.handler.js +14 -14
  38. package/dist/esm/base/middlewares/app-error/database.handler.js.map +1 -1
  39. package/dist/esm/base/middlewares/app-error/index.d.ts +2 -0
  40. package/dist/esm/base/middlewares/app-error/index.js +1 -0
  41. package/dist/esm/base/middlewares/app-error/index.js.map +1 -1
  42. package/dist/esm/base/middlewares/app-error/postgres-errors.d.ts +20 -0
  43. package/dist/esm/base/middlewares/app-error/postgres-errors.js +74 -0
  44. package/dist/esm/base/middlewares/app-error/postgres-errors.js.map +1 -0
  45. package/dist/esm/base/models/base.d.ts +0 -2
  46. package/dist/esm/base/models/base.js +0 -4
  47. package/dist/esm/base/models/base.js.map +1 -1
  48. package/dist/esm/base/models/common/constants.d.ts +9 -0
  49. package/dist/esm/base/models/common/constants.js +15 -0
  50. package/dist/esm/base/models/common/constants.js.map +1 -1
  51. package/dist/esm/base/repositories/common/request-filter-guard.d.ts +52 -2
  52. package/dist/esm/base/repositories/common/request-filter-guard.js +110 -25
  53. package/dist/esm/base/repositories/common/request-filter-guard.js.map +1 -1
  54. package/dist/esm/base/repositories/core/abstract.js +1 -1
  55. package/dist/esm/base/repositories/core/abstract.js.map +1 -1
  56. package/dist/esm/common/statuses/common.d.ts +8 -1
  57. package/dist/esm/common/statuses/common.js +24 -8
  58. package/dist/esm/common/statuses/common.js.map +1 -1
  59. package/dist/esm/helpers/inversion/common/types/model.d.ts +12 -2
  60. package/dist/esm/helpers/inversion/common/types/model.js.map +1 -1
  61. package/dist/esm/helpers/inversion/common/types/persistence.d.ts +3 -1
  62. package/dist/esm/helpers/inversion/common/types/persistence.js.map +1 -1
  63. package/dist/esm/repository.d.ts +3 -1
  64. package/dist/esm/repository.js +3 -1
  65. package/dist/esm/repository.js.map +1 -1
  66. package/dist/esm/statuses.d.ts +8 -0
  67. package/dist/esm/statuses.js +8 -0
  68. package/dist/esm/statuses.js.map +1 -0
  69. package/package.json +9 -5
@@ -1,4 +1,6 @@
1
- /** Application statuses categorized by lifecycle phase (initial, pending, active, completed, inactive, failed). */
1
+ /** The shape of a status code: a phase digit 0-5, two digits, then the name. */
2
+ const STATUS_CODE = /^[0-5]\d{2}_[A-Z0-9_]+$/;
3
+ /** Application statuses categorized by lifecycle phase: the leading digit of a code is its phase (0 initial, 1 pending, 2 active, 3 completed, 4 inactive, 5 failed). */
2
4
  export class Statuses {
3
5
  // 0xx - Initial
4
6
  static { this.UNKNOWN = '000_UNKNOWN'; }
@@ -9,6 +11,8 @@ export class Statuses {
9
11
  static { this.SCHEDULED = '102_SCHEDULED'; }
10
12
  static { this.PENDING = '103_PENDING'; }
11
13
  static { this.IN_REVIEW = '104_IN_REVIEW'; }
14
+ static { this.OPEN = '105_OPEN'; }
15
+ static { this.SUBMITTED = '106_SUBMITTED'; }
12
16
  // 2xx - Active/Running (in progress)
13
17
  static { this.ENABLED = '200_ENABLED'; }
14
18
  static { this.ACTIVATED = '201_ACTIVATED'; }
@@ -16,6 +20,9 @@ export class Statuses {
16
20
  static { this.PROCESSING = '203_PROCESSING'; }
17
21
  static { this.SENT = '204_SENT'; }
18
22
  static { this.RECEIVED = '205_RECEIVED'; }
23
+ static { this.READY = '206_READY'; }
24
+ static { this.PUBLISHED = '207_PUBLISHED'; }
25
+ static { this.ISSUED = '208_ISSUED'; }
19
26
  // 3xx - Completed (positive terminal)
20
27
  static { this.PARTIAL = '300_PARTIAL'; }
21
28
  static { this.APPROVED = '301_APPROVED'; }
@@ -23,6 +30,7 @@ export class Statuses {
23
30
  static { this.COMPLETED = '303_COMPLETED'; }
24
31
  static { this.SETTLED = '304_SETTLED'; }
25
32
  static { this.CONFIRMED = '305_CONFIRMED'; }
33
+ static { this.RESOLVED = '306_RESOLVED'; }
26
34
  // 4xx - Inactive (negative, reversible)
27
35
  static { this.DISABLED = '400_DISABLED'; }
28
36
  static { this.DEACTIVATED = '401_DEACTIVATED'; }
@@ -42,6 +50,7 @@ export class Statuses {
42
50
  static { this.CANCELLED = '505_CANCELLED'; }
43
51
  static { this.DELETED = '506_DELETED'; }
44
52
  static { this.REJECTED = '507_REJECTED'; }
53
+ static { this.VOIDED = '508_VOIDED'; }
45
54
  static { this.INITIAL_SCHEME_SET = new Set([this.UNKNOWN, this.DRAFT]); }
46
55
  static { this.PENDING_SCHEME_SET = new Set([
47
56
  this.NEW,
@@ -49,6 +58,8 @@ export class Statuses {
49
58
  this.SCHEDULED,
50
59
  this.PENDING,
51
60
  this.IN_REVIEW,
61
+ this.OPEN,
62
+ this.SUBMITTED,
52
63
  ]); }
53
64
  static { this.ACTIVE_SCHEME_SET = new Set([
54
65
  this.ENABLED,
@@ -57,6 +68,9 @@ export class Statuses {
57
68
  this.PROCESSING,
58
69
  this.SENT,
59
70
  this.RECEIVED,
71
+ this.READY,
72
+ this.PUBLISHED,
73
+ this.ISSUED,
60
74
  ]); }
61
75
  static { this.COMPLETED_SCHEME_SET = new Set([
62
76
  this.COMPLETED,
@@ -65,6 +79,7 @@ export class Statuses {
65
79
  this.SETTLED,
66
80
  this.APPROVED,
67
81
  this.CONFIRMED,
82
+ this.RESOLVED,
68
83
  ]); }
69
84
  static { this.INACTIVE_SCHEME_SET = new Set([
70
85
  this.DISABLED,
@@ -86,6 +101,7 @@ export class Statuses {
86
101
  this.CANCELLED,
87
102
  this.DELETED,
88
103
  this.REJECTED,
104
+ this.VOIDED,
89
105
  ]); }
90
106
  static { this.SCHEME_SET = new Set([
91
107
  ...this.INITIAL_SCHEME_SET,
@@ -96,25 +112,25 @@ export class Statuses {
96
112
  ...this.FAILED_SCHEME_SET,
97
113
  ]); }
98
114
  static isInitial(status) {
99
- return this.INITIAL_SCHEME_SET.has(status);
115
+ return status.startsWith('0');
100
116
  }
101
117
  static isPending(status) {
102
- return this.PENDING_SCHEME_SET.has(status);
118
+ return status.startsWith('1');
103
119
  }
104
120
  static isActive(status) {
105
- return this.ACTIVE_SCHEME_SET.has(status);
121
+ return status.startsWith('2');
106
122
  }
107
123
  static isCompleted(status) {
108
- return this.COMPLETED_SCHEME_SET.has(status);
124
+ return status.startsWith('3');
109
125
  }
110
126
  static isInactive(status) {
111
- return this.INACTIVE_SCHEME_SET.has(status);
127
+ return status.startsWith('4');
112
128
  }
113
129
  static isFailed(status) {
114
- return this.FAILED_SCHEME_SET.has(status);
130
+ return status.startsWith('5');
115
131
  }
116
132
  static isValid(status) {
117
- return this.SCHEME_SET.has(status);
133
+ return STATUS_CODE.test(status);
118
134
  }
119
135
  }
120
136
  /** Common reusable entity statuses. */
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/common/statuses/common.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,OAAO,QAAQ;IACnB,gBAAgB;aACA,YAAO,GAAG,aAAa,CAAC;aACxB,UAAK,GAAG,WAAW,CAAC;IAEpC,mDAAmD;aACnC,QAAG,GAAG,SAAS,CAAC;aAChB,WAAM,GAAG,YAAY,CAAC;aACtB,cAAS,GAAG,eAAe,CAAC;aAC5B,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;IAE5C,qCAAqC;aACrB,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;aAC5B,YAAO,GAAG,aAAa,CAAC;aACxB,eAAU,GAAG,gBAAgB,CAAC;aAC9B,SAAI,GAAG,UAAU,CAAC;aAClB,aAAQ,GAAG,cAAc,CAAC;IAE1C,sCAAsC;aACtB,YAAO,GAAG,aAAa,CAAC;aACxB,aAAQ,GAAG,cAAc,CAAC;aAC1B,YAA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AC5C,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAAc;QAC/B,OAAO,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,MAAc;QAC5B,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;;AAGH,uCAAuC;AACvC,MAAM,OAAO,cAAc;aACT,YAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;aAC3B,cAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;aAC/B,gBAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;aACnC,YAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;aAC3B,aAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;aAE7B,eAAU,GAAG,IAAI,GAAG,CAAC;QACnC,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,SAAS;QACd,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,QAAQ;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC","sourcesContent":["/** Application statuses categorized by lifecycle phase (initial, pending, active, completed, inactive, failed). */\nexport class Statuses {\n // 0xx - Initial\n static readonly UNKNOWN = '000_UNKNOWN';\n static readonly DRAFT = '001_DRAFT';\n\n // 1xx - Pending/Waiting (awaiting action/decision)\n static readonly NEW = '100_NEW';\n static readonly QUEUED = '101_QUEUED';\n static readonly SCHEDULED = '102_SCHEDULED';\n static readonly PENDING = '103_PENDING';\n static readonly IN_REVIEW = '104_IN_REVIEW';\n\n // 2xx - Active/Running (in progress)\n static readonly ENABLED = '200_ENABLED';\n static readonly ACTIVATED = '201_ACTIVATED';\n static readonly RUNNING = '202_RUNNING';\n static readonly PROCESSING = '203_PROCESSING';\n static readonly SENT = '204_SENT';\n static readonly RECEIVED = '205_RECEIVED';\n\n // 3xx - Completed (positive terminal)\n static readonly PARTIAL = '300_PARTIAL';\n static readonly APPROVED = '301_APPROVED';\n static readonly SUCCESS = '302_SUCCESS';\n static readonly COMPLETED = '303_COMPLETED';\n static readonly SETTLED = '304_SETTLED';\n static readonly CONFIRMED = '305_CONFIRMED';\n\n // 4xx - Inactive (negative, reversible)\n static readonly DISABLED = '400_DISABLED';\n static readonly DEACTIVATED = '401_DEACTIVATED';\n static readonly SUSPENDED = '402_SUSPENDED';\n static readonly BLOCKED = '403_BLOCKED';\n static readonly CLOSED = '404_CLOSED';\n static readonly ARCHIVED = '405_ARCHIVED';\n static readonly PAUSED = '406_PAUSED';\n static readonly REVOKED = '407_REVOKED';\n static readonly REFUNDED = '408_REFUNDED';\n\n // 5xx - Failed/Error (negative terminal, final)\n static readonly FAIL = '500_FAIL';\n static readonly EXPIRED = '501_EXPIRED';\n static readonly TIMEOUT = '502_TIMEOUT';\n static readonly SKIPPED = '503_SKIPPED';\n static readonly ABORTED = '504_ABORTED';\n static readonly CANCELLED = '505_CANCELLED';\n static readonly DELETED = '506_DELETED';\n static readonly REJECTED = '507_REJECTED';\n\n static readonly INITIAL_SCHEME_SET = new Set([this.UNKNOWN, this.DRAFT]);\n\n static readonly PENDING_SCHEME_SET = new Set([\n this.NEW,\n this.QUEUED,\n this.SCHEDULED,\n this.PENDING,\n this.IN_REVIEW,\n ]);\n\n static readonly ACTIVE_SCHEME_SET = new Set([\n this.ENABLED,\n this.ACTIVATED,\n this.RUNNING,\n this.PROCESSING,\n this.SENT,\n this.RECEIVED,\n ]);\n\n static readonly COMPLETED_SCHEME_SET = new Set([\n this.COMPLETED,\n this.SUCCESS,\n this.PARTIAL,\n this.SETTLED,\n this.APPROVED,\n this.CONFIRMED,\n ]);\n\n static readonly INACTIVE_SCHEME_SET = new Set([\n this.DISABLED,\n this.DEACTIVATED,\n this.SUSPENDED,\n this.BLOCKED,\n this.CLOSED,\n this.ARCHIVED,\n this.PAUSED,\n this.REVOKED,\n this.REFUNDED,\n ]);\n\n static readonly FAILED_SCHEME_SET = new Set([\n this.FAIL,\n this.EXPIRED,\n this.TIMEOUT,\n this.SKIPPED,\n this.ABORTED,\n this.CANCELLED,\n this.DELETED,\n this.REJECTED,\n ]);\n\n static readonly SCHEME_SET = new Set([\n ...this.INITIAL_SCHEME_SET,\n ...this.PENDING_SCHEME_SET,\n ...this.ACTIVE_SCHEME_SET,\n ...this.COMPLETED_SCHEME_SET,\n ...this.INACTIVE_SCHEME_SET,\n ...this.FAILED_SCHEME_SET,\n ]);\n\n static isInitial(status: string): boolean {\n return this.INITIAL_SCHEME_SET.has(status);\n }\n\n static isPending(status: string): boolean {\n return this.PENDING_SCHEME_SET.has(status);\n }\n\n static isActive(status: string): boolean {\n return this.ACTIVE_SCHEME_SET.has(status);\n }\n\n static isCompleted(status: string): boolean {\n return this.COMPLETED_SCHEME_SET.has(status);\n }\n\n static isInactive(status: string): boolean {\n return this.INACTIVE_SCHEME_SET.has(status);\n }\n\n static isFailed(status: string): boolean {\n return this.FAILED_SCHEME_SET.has(status);\n }\n\n static isValid(status: string): boolean {\n return this.SCHEME_SET.has(status);\n }\n}\n\n/** Common reusable entity statuses. */\nexport class CommonStatuses {\n static readonly UNKNOWN = Statuses.UNKNOWN;\n static readonly ACTIVATED = Statuses.ACTIVATED;\n static readonly DEACTIVATED = Statuses.DEACTIVATED;\n static readonly BLOCKED = Statuses.BLOCKED;\n static readonly ARCHIVED = Statuses.ARCHIVED;\n\n static readonly SCHEME_SET = new Set([\n this.UNKNOWN,\n this.ACTIVATED,\n this.DEACTIVATED,\n this.BLOCKED,\n this.ARCHIVED,\n ]);\n\n static isValid(scheme: string): boolean {\n return this.SCHEME_SET.has(scheme);\n }\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/common/statuses/common.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAE9C,yKAAyK;AACzK,MAAM,OAAO,QAAQ;IACnB,gBAAgB;aACA,YAAO,GAAG,aAAa,CAAC;aACxB,UAAK,GAAG,WAAW,CAAC;IAEpC,mDAAmD;aACnC,QAAG,GAAG,SAAS,CAAC;aAChB,WAAM,GAAG,YAAY,CAAC;aACtB,cAAS,GAAG,eAAe,CAAC;aAC5B,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;aAC5B,SAAI,GAAG,UAAU,CAAC;aAClB,cAAS,GAAG,eAAe,CAAC;IAE5C,qCAAqC;aACrB,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;aAC5B,YAAO,GAAG,aAAa,CAAC;aACxB,eAAU,GAAG,gBAAgB,CAAC;aAC9B,SAAI,GAAG,UAAU,CAAC;aAClB,aAAQ,GAAG,cAAc,CAAC;aAC1B,UAAK,GAAG,WAAW,CAAC;aACpB,cAAS,GAAG,eAAe,CAAC;aAC5B,WAAM,GAAG,YAAY,CAAC;IAEtC,sCAAsC;aACtB,YAAO,GAAG,aAAa,CAAC;aACxB,aAAQ,GAAG,cAAc,CAAC;aAC1B,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;aAC5B,YAAO,GAAG,aAAa,CAAC;aACxB,cAAS,GAAG,eAAe,CAAC;aAC5B,aAAQ,GAAG,cAAc,CAAC;IAE1C,wCAAwC;aACxB,aAAQ,GAAG,cAAc,CAAC;aAC1B,gBAAW,GAAG,iBAAiB,CAAC;aAChC,cAAS,GAAG,eAAe,CAA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AAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,MAAc;QAC5B,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,MAAc;QAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;;AAGH,uCAAuC;AACvC,MAAM,OAAO,cAAc;aACT,YAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;aAC3B,cAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;aAC/B,gBAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;aACnC,YAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;aAC3B,aAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;aAE7B,eAAU,GAAG,IAAI,GAAG,CAAC;QACnC,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,SAAS;QACd,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,QAAQ;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC","sourcesContent":["/** The shape of a status code: a phase digit 0-5, two digits, then the name. */\nconst STATUS_CODE = /^[0-5]\\d{2}_[A-Z0-9_]+$/;\n\n/** Application statuses categorized by lifecycle phase: the leading digit of a code is its phase (0 initial, 1 pending, 2 active, 3 completed, 4 inactive, 5 failed). */\nexport class Statuses {\n // 0xx - Initial\n static readonly UNKNOWN = '000_UNKNOWN';\n static readonly DRAFT = '001_DRAFT';\n\n // 1xx - Pending/Waiting (awaiting action/decision)\n static readonly NEW = '100_NEW';\n static readonly QUEUED = '101_QUEUED';\n static readonly SCHEDULED = '102_SCHEDULED';\n static readonly PENDING = '103_PENDING';\n static readonly IN_REVIEW = '104_IN_REVIEW';\n static readonly OPEN = '105_OPEN';\n static readonly SUBMITTED = '106_SUBMITTED';\n\n // 2xx - Active/Running (in progress)\n static readonly ENABLED = '200_ENABLED';\n static readonly ACTIVATED = '201_ACTIVATED';\n static readonly RUNNING = '202_RUNNING';\n static readonly PROCESSING = '203_PROCESSING';\n static readonly SENT = '204_SENT';\n static readonly RECEIVED = '205_RECEIVED';\n static readonly READY = '206_READY';\n static readonly PUBLISHED = '207_PUBLISHED';\n static readonly ISSUED = '208_ISSUED';\n\n // 3xx - Completed (positive terminal)\n static readonly PARTIAL = '300_PARTIAL';\n static readonly APPROVED = '301_APPROVED';\n static readonly SUCCESS = '302_SUCCESS';\n static readonly COMPLETED = '303_COMPLETED';\n static readonly SETTLED = '304_SETTLED';\n static readonly CONFIRMED = '305_CONFIRMED';\n static readonly RESOLVED = '306_RESOLVED';\n\n // 4xx - Inactive (negative, reversible)\n static readonly DISABLED = '400_DISABLED';\n static readonly DEACTIVATED = '401_DEACTIVATED';\n static readonly SUSPENDED = '402_SUSPENDED';\n static readonly BLOCKED = '403_BLOCKED';\n static readonly CLOSED = '404_CLOSED';\n static readonly ARCHIVED = '405_ARCHIVED';\n static readonly PAUSED = '406_PAUSED';\n static readonly REVOKED = '407_REVOKED';\n static readonly REFUNDED = '408_REFUNDED';\n\n // 5xx - Failed/Error (negative terminal, final)\n static readonly FAIL = '500_FAIL';\n static readonly EXPIRED = '501_EXPIRED';\n static readonly TIMEOUT = '502_TIMEOUT';\n static readonly SKIPPED = '503_SKIPPED';\n static readonly ABORTED = '504_ABORTED';\n static readonly CANCELLED = '505_CANCELLED';\n static readonly DELETED = '506_DELETED';\n static readonly REJECTED = '507_REJECTED';\n static readonly VOIDED = '508_VOIDED';\n\n static readonly INITIAL_SCHEME_SET = new Set([this.UNKNOWN, this.DRAFT]);\n\n static readonly PENDING_SCHEME_SET = new Set([\n this.NEW,\n this.QUEUED,\n this.SCHEDULED,\n this.PENDING,\n this.IN_REVIEW,\n this.OPEN,\n this.SUBMITTED,\n ]);\n\n static readonly ACTIVE_SCHEME_SET = new Set([\n this.ENABLED,\n this.ACTIVATED,\n this.RUNNING,\n this.PROCESSING,\n this.SENT,\n this.RECEIVED,\n this.READY,\n this.PUBLISHED,\n this.ISSUED,\n ]);\n\n static readonly COMPLETED_SCHEME_SET = new Set([\n this.COMPLETED,\n this.SUCCESS,\n this.PARTIAL,\n this.SETTLED,\n this.APPROVED,\n this.CONFIRMED,\n this.RESOLVED,\n ]);\n\n static readonly INACTIVE_SCHEME_SET = new Set([\n this.DISABLED,\n this.DEACTIVATED,\n this.SUSPENDED,\n this.BLOCKED,\n this.CLOSED,\n this.ARCHIVED,\n this.PAUSED,\n this.REVOKED,\n this.REFUNDED,\n ]);\n\n static readonly FAILED_SCHEME_SET = new Set([\n this.FAIL,\n this.EXPIRED,\n this.TIMEOUT,\n this.SKIPPED,\n this.ABORTED,\n this.CANCELLED,\n this.DELETED,\n this.REJECTED,\n this.VOIDED,\n ]);\n\n static readonly SCHEME_SET = new Set([\n ...this.INITIAL_SCHEME_SET,\n ...this.PENDING_SCHEME_SET,\n ...this.ACTIVE_SCHEME_SET,\n ...this.COMPLETED_SCHEME_SET,\n ...this.INACTIVE_SCHEME_SET,\n ...this.FAILED_SCHEME_SET,\n ]);\n\n static isInitial(status: string): boolean {\n return status.startsWith('0');\n }\n\n static isPending(status: string): boolean {\n return status.startsWith('1');\n }\n\n static isActive(status: string): boolean {\n return status.startsWith('2');\n }\n\n static isCompleted(status: string): boolean {\n return status.startsWith('3');\n }\n\n static isInactive(status: string): boolean {\n return status.startsWith('4');\n }\n\n static isFailed(status: string): boolean {\n return status.startsWith('5');\n }\n\n static isValid(status: string): boolean {\n return STATUS_CODE.test(status);\n }\n}\n\n/** Common reusable entity statuses. */\nexport class CommonStatuses {\n static readonly UNKNOWN = Statuses.UNKNOWN;\n static readonly ACTIVATED = Statuses.ACTIVATED;\n static readonly DEACTIVATED = Statuses.DEACTIVATED;\n static readonly BLOCKED = Statuses.BLOCKED;\n static readonly ARCHIVED = Statuses.ARCHIVED;\n\n static readonly SCHEME_SET = new Set([\n this.UNKNOWN,\n this.ACTIVATED,\n this.DEACTIVATED,\n this.BLOCKED,\n this.ARCHIVED,\n ]);\n\n static isValid(scheme: string): boolean {\n return this.SCHEME_SET.has(scheme);\n }\n}\n"]}
@@ -165,10 +165,20 @@ export interface IModelQuerySettings {
165
165
  max?: number;
166
166
  };
167
167
  }
168
+ /** Property groups of `@model` settings. */
169
+ export interface IModelProperties {
170
+ /** Properties excluded from all query results at SQL level. */
171
+ hidden?: string[];
172
+ /**
173
+ * Properties the server fills on every write, which a generated create or update body leaves out.
174
+ *
175
+ * @default AuditFields.SCHEME_SET
176
+ */
177
+ stamped?: ReadonlyArray<string> | ReadonlySet<string>;
178
+ }
168
179
  /** Per-model settings passed to `@model` as `settings`. */
169
180
  export interface IModelSettings {
170
- /** Properties excluded from all query results at SQL level. */
171
- hiddenProperties?: string[];
181
+ properties?: IModelProperties;
172
182
  /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */
173
183
  query?: IModelQuerySettings;
174
184
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"","sourcesContent":["import type { AbstractEntity, TModelType } from '@/base/models';\nimport type {\n ScopeFilters,\n ScopeThrough,\n TFilter,\n TScopeFilterMissingBehavior,\n TScopeOperation,\n TScopeWriteGuard,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\n/** The `authorize` settings of a model. */\nexport interface IModelAuthorizeSettings {\n /** The authorization principal name (resource/subject) for this model. */\n principal: string;\n /** Extensible - consumers can add any extra authorization metadata. */\n [extra: string | symbol]: any;\n}\n\n/** What a restricted caller may write to the scope columns (`@model` settings.access.write). */\nexport interface IModelAccessWriteSettings {\n /**\n * What a create, createAll or an update payload that names a scope column does when its value\n * disagrees with the resolved scope. `reject` refuses the write and writes nothing - for\n * `createAll` not even the valid rows. `assign` also fills a scope column that is ABSENT from a\n * created row, when the scope is a single equality; a value that is present and disagrees is\n * still refused.\n *\n * The scope's columns and allowed values are read from the resolved `where` (equality, `eq`, `inq`\n * and arrays, `and`, and an `or` over one column). Any other shape cannot be checked, and the write\n * is refused with its own message - never skipped. `ScopeFilters.UNRESTRICTED` bypasses the guard\n * too, which is the deliberate way to write across scopes (system scope, an admin role).\n *\n * Not checked: an update that does not name the scope column (the row was already selected through\n * the scoped `where`), and raw statements that bypass the repository.\n *\n * @default 'reject'\n */\n mode?: TScopeWriteGuard;\n\n /**\n * `true` lets a restricted caller write `null` to a scope column, or leave it out on create: the\n * row has no owner and is shared. Without it, `null` is refused like any other value\n * outside the scope, even when the resolved scope has a `null` branch (that branch lets the caller\n * READ shared rows, a separate permission). Reads are scoped as before.\n *\n * @default false\n */\n sharedRows?: boolean;\n}\n\n/**\n * Row access for `@model` settings.access - resolved per query, so it can depend on the current\n * request (tenant, org, membership). Framework-internal escape hatches aside, nothing short of\n * removing this setting from the model turns scoping off.\n *\n * @example\n * ```typescript\n * import { model, ScopeWriteGuards } from '@venizia/ignis';\n * import { ModelFactory } from '@venizia/ignis-connectors/postgres';\n * import { pgTable, serial, text } from 'drizzle-orm/pg-core';\n *\n * const productTable = pgTable('Product', { id: serial('id').primaryKey(), merchantId: text('merchant_id') });\n *\n * export @model({ settings: { access: {\n * resolve: () => ({ merchantId: 'm-1' }),\n * write: { mode: ScopeWriteGuards.ASSIGN },\n * } } })\n * class Product extends ModelFactory.defineEntity({ table: productTable }) {}\n * ```\n */\nexport interface IModelAccessSettings {\n /** A model declares a resolver or a `through`, never both. */\n through?: never;\n\n /**\n * Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an\n * internal operator, a caller the application has decided sees everything); or null/undefined\n * when this caller's scope cannot be determined at all.\n *\n * Receives `{ operation }`: the one concrete operation the call performs (`ScopeOperations.READ`,\n * `CREATE`, `UPDATE` or `DELETE`, never a group), so one function can answer a wide scope for a\n * read and a narrow one for a write. A read, and an included relation, pass `READ`; a create passes\n * `CREATE`; an update passes `UPDATE` for the payload check and for choosing the rows to update; a\n * delete, a soft delete included, passes `DELETE` for both; a restore passes `UPDATE`. A read with a\n * row `lock` passes `READ`. A resolver that takes no argument keeps working. An `or` over different\n * columns is still refused on a write, so return the narrow scope for a write operation.\n */\n resolve: (context: {\n operation: TScopeOperation;\n }) => TNullable<TWhere> | typeof ScopeFilters.UNRESTRICTED;\n\n /**\n * What `applyScopeFilter` does when `resolve()` returns null/undefined - no request context, no\n * tenant, a background job. With `deny`, an unresolved scope matches zero rows, never\n * every row. `allow` is an explicit, reviewed opt-out for migrations and background jobs, declared\n * per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.\n *\n * @default 'deny'\n */\n onMissing?: TScopeFilterMissingBehavior;\n\n /**\n * The property names the write guard checks. Optional: with none declared the guard checks every\n * column the resolved scope constrains. When declared, each name must exist on the model (checked\n * at boot), and a resolved scope that constrains any other column is refused as unverifiable.\n */\n columns?: string[];\n\n /** What a restricted caller may write to the scope columns. See {@link IModelAccessWriteSettings}. */\n write?: IModelAccessWriteSettings;\n}\n\n/**\n * Row access for a child model that has no scope columns of its own: it inherits the scope of the parent a `one`\n * relation points at. A parent that resolves no scope always denies the child: `onMissing` is not offered here, because\n * `'allow'` would show the child's rows of every tenant while the parent shows none.\n *\n * @example\n * ```typescript\n * import { model, ScopeThrough } from '@venizia/ignis';\n * import { ModelFactory, one } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', {\n * id: serial('id').primaryKey(),\n * productId: integer('product_id').references(() => productTable.id),\n * });\n * const VariantBase = ModelFactory.defineEntity({ table: variantTable, relations: () => ({ product: one(productTable) }) });\n * export @model({ settings: { access: { through: ScopeThrough.of({ entity: VariantBase, relation: 'product' }) } } })\n * class Variant extends VariantBase {}\n * ```\n *\n * @example\n * ```typescript\n * // A hand-written entity declares the same relation by hand.\n * import { ScopeThrough } from '@venizia/ignis';\n * import { BaseEntity, one, RelationDeclarations } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', { id: serial('id').primaryKey(), productId: integer('product_id').references(() => productTable.id) });\n * const relations = { product: one(productTable) };\n * class VariantBase extends BaseEntity<typeof variantTable> {\n * static override schema = variantTable;\n * static readonly relationDefinitions = relations;\n * static override relations = () => RelationDeclarations.toRelationConfigs({ relations });\n * }\n * const through = ScopeThrough.of({ entity: VariantBase, relation: 'product' });\n * ```\n */\nexport interface IModelAccessThroughSettings {\n through: ScopeThrough;\n onMissing?: never;\n resolve?: never;\n columns?: never;\n write?: never;\n}\n\n/** The two shapes of `@model` settings.access: a resolver, or a `through`. */\nexport type TModelAccessSettings = IModelAccessSettings | IModelAccessThroughSettings;\n\n/** What a query runs with when it names nothing (`@model` settings.query). */\nexport interface IModelQuerySettings {\n /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */\n filter?: TFilter;\n\n limit?: {\n /**\n * Row limit when a query omits `limit`. Must be a positive integer.\n *\n * @default DEFAULT_LIMIT\n */\n default?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer.\n *\n * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so\n * that reaching it means the caller is doing something unusual, and raising it is how a model\n * says so deliberately.\n *\n * @default DEFAULT_MAX_LIMIT\n */\n max?: number;\n };\n}\n\n/** Per-model settings passed to `@model` as `settings`. */\nexport interface IModelSettings {\n /** Properties excluded from all query results at SQL level. */\n hiddenProperties?: string[];\n\n /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */\n query?: IModelQuerySettings;\n\n /**\n * Row access: the scope ANDed into every read and write whose scope is expressible as a filter\n * clause, NOT removable by `shouldSkipDefaultFilter`, and the guard that holds writes to it.\n * Ownership resolved per row or through a polymorphic reference is NOT expressible here - that\n * check is still the application's to perform.\n *\n * Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads\n * this setting, so mirroring a scoped entity into a search index needs its own query-time scope.\n */\n access?: TModelAccessSettings;\n\n /** Authorization settings for this model (principal name, etc.). */\n authorize?: IModelAuthorizeSettings;\n}\n\n/** Whether tooling that reads the model registry should migrate this model (`@model({ migration })`). */\nexport interface IModelMigrationSettings {\n /**\n * `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself.\n *\n * @default true\n */\n use?: boolean;\n}\n\n/** Metadata accepted by `@model`. */\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n /**\n * `ModelTypes.ENTITY` is the only value.\n *\n * @default ModelTypes.ENTITY\n */\n type?: TModelType;\n tableName?: string;\n\n /** Migration marker for consumer tooling that reads the public registry. */\n migration?: IModelMigrationSettings;\n\n settings?: IModelSettings;\n}\n\n/** Static members an entity class carries: its `schema` and its `relations` (value or resolver). */\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\n/** A model class together with its entity statics. */\nexport type TModelClass<Model extends AbstractEntity = AbstractEntity> = TClass<Model> &\n IEntityStatics;\n\n/** Decorator target for model classes (supports both strongly typed and ClassDecorator patterns). */\nexport type TDecoratorModelTarget<Model extends AbstractEntity = AbstractEntity> =\n | TModelClass<Model>\n | (Function & IEntityStatics);\n\n/** One model as stored in the metadata registry: class, metadata and schema, with lazily resolved relations. */\nexport interface IModelRegistryEntry<Model extends AbstractEntity = AbstractEntity> {\n target: TValueOrResolver<TClass<Model>>;\n metadata: IModelMetadata;\n schema: unknown;\n\n /** Lazy resolver to avoid circular deps. Resolved when DataSource builds schema. */\n relationsResolver?: TValueOrResolver<Array<unknown>>;\n\n /** Cache populated on first buildSchema() call. */\n _builtRelations?: unknown;\n}\n"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"","sourcesContent":["import type { AbstractEntity, TModelType } from '@/base/models';\nimport type {\n ScopeFilters,\n ScopeThrough,\n TFilter,\n TScopeFilterMissingBehavior,\n TScopeOperation,\n TScopeWriteGuard,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\n/** The `authorize` settings of a model. */\nexport interface IModelAuthorizeSettings {\n /** The authorization principal name (resource/subject) for this model. */\n principal: string;\n /** Extensible - consumers can add any extra authorization metadata. */\n [extra: string | symbol]: any;\n}\n\n/** What a restricted caller may write to the scope columns (`@model` settings.access.write). */\nexport interface IModelAccessWriteSettings {\n /**\n * What a create, createAll or an update payload that names a scope column does when its value\n * disagrees with the resolved scope. `reject` refuses the write and writes nothing - for\n * `createAll` not even the valid rows. `assign` also fills a scope column that is ABSENT from a\n * created row, when the scope is a single equality; a value that is present and disagrees is\n * still refused.\n *\n * The scope's columns and allowed values are read from the resolved `where` (equality, `eq`, `inq`\n * and arrays, `and`, and an `or` over one column). Any other shape cannot be checked, and the write\n * is refused with its own message - never skipped. `ScopeFilters.UNRESTRICTED` bypasses the guard\n * too, which is the deliberate way to write across scopes (system scope, an admin role).\n *\n * Not checked: an update that does not name the scope column (the row was already selected through\n * the scoped `where`), and raw statements that bypass the repository.\n *\n * @default 'reject'\n */\n mode?: TScopeWriteGuard;\n\n /**\n * `true` lets a restricted caller write `null` to a scope column, or leave it out on create: the\n * row has no owner and is shared. Without it, `null` is refused like any other value\n * outside the scope, even when the resolved scope has a `null` branch (that branch lets the caller\n * READ shared rows, a separate permission). Reads are scoped as before.\n *\n * @default false\n */\n sharedRows?: boolean;\n}\n\n/**\n * Row access for `@model` settings.access - resolved per query, so it can depend on the current\n * request (tenant, org, membership). Framework-internal escape hatches aside, nothing short of\n * removing this setting from the model turns scoping off.\n *\n * @example\n * ```typescript\n * import { model, ScopeWriteGuards } from '@venizia/ignis';\n * import { ModelFactory } from '@venizia/ignis-connectors/postgres';\n * import { pgTable, serial, text } from 'drizzle-orm/pg-core';\n *\n * const productTable = pgTable('Product', { id: serial('id').primaryKey(), merchantId: text('merchant_id') });\n *\n * export @model({ settings: { access: {\n * resolve: () => ({ merchantId: 'm-1' }),\n * write: { mode: ScopeWriteGuards.ASSIGN },\n * } } })\n * class Product extends ModelFactory.defineEntity({ table: productTable }) {}\n * ```\n */\nexport interface IModelAccessSettings {\n /** A model declares a resolver or a `through`, never both. */\n through?: never;\n\n /**\n * Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an\n * internal operator, a caller the application has decided sees everything); or null/undefined\n * when this caller's scope cannot be determined at all.\n *\n * Receives `{ operation }`: the one concrete operation the call performs (`ScopeOperations.READ`,\n * `CREATE`, `UPDATE` or `DELETE`, never a group), so one function can answer a wide scope for a\n * read and a narrow one for a write. A read, and an included relation, pass `READ`; a create passes\n * `CREATE`; an update passes `UPDATE` for the payload check and for choosing the rows to update; a\n * delete, a soft delete included, passes `DELETE` for both; a restore passes `UPDATE`. A read with a\n * row `lock` passes `READ`. A resolver that takes no argument keeps working. An `or` over different\n * columns is still refused on a write, so return the narrow scope for a write operation.\n */\n resolve: (context: {\n operation: TScopeOperation;\n }) => TNullable<TWhere> | typeof ScopeFilters.UNRESTRICTED;\n\n /**\n * What `applyScopeFilter` does when `resolve()` returns null/undefined - no request context, no\n * tenant, a background job. With `deny`, an unresolved scope matches zero rows, never\n * every row. `allow` is an explicit, reviewed opt-out for migrations and background jobs, declared\n * per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.\n *\n * @default 'deny'\n */\n onMissing?: TScopeFilterMissingBehavior;\n\n /**\n * The property names the write guard checks. Optional: with none declared the guard checks every\n * column the resolved scope constrains. When declared, each name must exist on the model (checked\n * at boot), and a resolved scope that constrains any other column is refused as unverifiable.\n */\n columns?: string[];\n\n /** What a restricted caller may write to the scope columns. See {@link IModelAccessWriteSettings}. */\n write?: IModelAccessWriteSettings;\n}\n\n/**\n * Row access for a child model that has no scope columns of its own: it inherits the scope of the parent a `one`\n * relation points at. A parent that resolves no scope always denies the child: `onMissing` is not offered here, because\n * `'allow'` would show the child's rows of every tenant while the parent shows none.\n *\n * @example\n * ```typescript\n * import { model, ScopeThrough } from '@venizia/ignis';\n * import { ModelFactory, one } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', {\n * id: serial('id').primaryKey(),\n * productId: integer('product_id').references(() => productTable.id),\n * });\n * const VariantBase = ModelFactory.defineEntity({ table: variantTable, relations: () => ({ product: one(productTable) }) });\n * export @model({ settings: { access: { through: ScopeThrough.of({ entity: VariantBase, relation: 'product' }) } } })\n * class Variant extends VariantBase {}\n * ```\n *\n * @example\n * ```typescript\n * // A hand-written entity declares the same relation by hand.\n * import { ScopeThrough } from '@venizia/ignis';\n * import { BaseEntity, one, RelationDeclarations } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', { id: serial('id').primaryKey(), productId: integer('product_id').references(() => productTable.id) });\n * const relations = { product: one(productTable) };\n * class VariantBase extends BaseEntity<typeof variantTable> {\n * static override schema = variantTable;\n * static readonly relationDefinitions = relations;\n * static override relations = () => RelationDeclarations.toRelationConfigs({ relations });\n * }\n * const through = ScopeThrough.of({ entity: VariantBase, relation: 'product' });\n * ```\n */\nexport interface IModelAccessThroughSettings {\n through: ScopeThrough;\n onMissing?: never;\n resolve?: never;\n columns?: never;\n write?: never;\n}\n\n/** The two shapes of `@model` settings.access: a resolver, or a `through`. */\nexport type TModelAccessSettings = IModelAccessSettings | IModelAccessThroughSettings;\n\n/** What a query runs with when it names nothing (`@model` settings.query). */\nexport interface IModelQuerySettings {\n /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */\n filter?: TFilter;\n\n limit?: {\n /**\n * Row limit when a query omits `limit`. Must be a positive integer.\n *\n * @default DEFAULT_LIMIT\n */\n default?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer.\n *\n * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so\n * that reaching it means the caller is doing something unusual, and raising it is how a model\n * says so deliberately.\n *\n * @default DEFAULT_MAX_LIMIT\n */\n max?: number;\n };\n}\n\n/** Property groups of `@model` settings. */\nexport interface IModelProperties {\n /** Properties excluded from all query results at SQL level. */\n hidden?: string[];\n\n /**\n * Properties the server fills on every write, which a generated create or update body leaves out.\n *\n * @default AuditFields.SCHEME_SET\n */\n stamped?: ReadonlyArray<string> | ReadonlySet<string>;\n}\n\n/** Per-model settings passed to `@model` as `settings`. */\nexport interface IModelSettings {\n properties?: IModelProperties;\n\n /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */\n query?: IModelQuerySettings;\n\n /**\n * Row access: the scope ANDed into every read and write whose scope is expressible as a filter\n * clause, NOT removable by `shouldSkipDefaultFilter`, and the guard that holds writes to it.\n * Ownership resolved per row or through a polymorphic reference is NOT expressible here - that\n * check is still the application's to perform.\n *\n * Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads\n * this setting, so mirroring a scoped entity into a search index needs its own query-time scope.\n */\n access?: TModelAccessSettings;\n\n /** Authorization settings for this model (principal name, etc.). */\n authorize?: IModelAuthorizeSettings;\n}\n\n/** Whether tooling that reads the model registry should migrate this model (`@model({ migration })`). */\nexport interface IModelMigrationSettings {\n /**\n * `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself.\n *\n * @default true\n */\n use?: boolean;\n}\n\n/** Metadata accepted by `@model`. */\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n /**\n * `ModelTypes.ENTITY` is the only value.\n *\n * @default ModelTypes.ENTITY\n */\n type?: TModelType;\n tableName?: string;\n\n /** Migration marker for consumer tooling that reads the public registry. */\n migration?: IModelMigrationSettings;\n\n settings?: IModelSettings;\n}\n\n/** Static members an entity class carries: its `schema` and its `relations` (value or resolver). */\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\n/** A model class together with its entity statics. */\nexport type TModelClass<Model extends AbstractEntity = AbstractEntity> = TClass<Model> &\n IEntityStatics;\n\n/** Decorator target for model classes (supports both strongly typed and ClassDecorator patterns). */\nexport type TDecoratorModelTarget<Model extends AbstractEntity = AbstractEntity> =\n | TModelClass<Model>\n | (Function & IEntityStatics);\n\n/** One model as stored in the metadata registry: class, metadata and schema, with lazily resolved relations. */\nexport interface IModelRegistryEntry<Model extends AbstractEntity = AbstractEntity> {\n target: TValueOrResolver<TClass<Model>>;\n metadata: IModelMetadata;\n schema: unknown;\n\n /** Lazy resolver to avoid circular deps. Resolved when DataSource builds schema. */\n relationsResolver?: TValueOrResolver<Array<unknown>>;\n\n /** Cache populated on first buildSchema() call. */\n _builtRelations?: unknown;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IDataSource, TDataSourceDriverClass } from '../../../../base/datasources/index.js';
1
+ import type { IDataSource, IDataSourceOpenOptions, TDataSourceDriverClass } from '../../../../base/datasources/index.js';
2
2
  import type { AbstractEntity } from '../../../../base/models/index.js';
3
3
  import type { IRepository, RepositoryTypes, TRepositoryOperationScope, TRepositoryType } from '../../../../base/repositories/index.js';
4
4
  import type { TClass, TValueOrResolver } from '@venizia/ignis-helpers/common';
@@ -6,6 +6,8 @@ import type { IArtifactRegistrationOptions, TDecoratorTarget } from './artifact.
6
6
  /** Metadata accepted by `@datasource`. */
7
7
  export interface IDataSourceMetadata extends IArtifactRegistrationOptions {
8
8
  driver?: TDataSourceDriverClass;
9
+ /** When the datasource opens. `{ on: 'first-use' }` leaves it closed at start and opens it at the first call that needs it. */
10
+ open?: IDataSourceOpenOptions;
9
11
  /**
10
12
  * `false` stops model schema discovery for the datasource.
11
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/persistence.ts"],"names":[],"mappings":"","sourcesContent":["import type { IDataSource, TDataSourceDriverClass } from '@/base/datasources';\nimport type { AbstractEntity } from '@/base/models';\nimport type {\n IRepository,\n RepositoryTypes,\n TRepositoryOperationScope,\n TRepositoryType,\n} from '@/base/repositories';\nimport type { TClass, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions, TDecoratorTarget } from './artifact';\n\n/** Metadata accepted by `@datasource`. */\nexport interface IDataSourceMetadata extends IArtifactRegistrationOptions {\n driver?: TDataSourceDriverClass;\n /**\n * `false` stops model schema discovery for the datasource.\n *\n * @default true\n */\n autoDiscovery?: boolean;\n}\n\n/** Members every repository type shares. */\nexport interface IRepositoryMetadataBase<\n DataSource extends IDataSource = IDataSource,\n> extends IArtifactRegistrationOptions {\n dataSource: string | TValueOrResolver<TClass<DataSource>>;\n operationScope?: TRepositoryOperationScope;\n}\n\n/** `RepositoryTypes.MODEL` - a model this application declares. */\nexport interface IRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> extends IRepositoryMetadataBase<DataSource> {\n /** @default RepositoryTypes.MODEL */\n type?: typeof RepositoryTypes.MODEL;\n model: TValueOrResolver<TClass<Model>>;\n}\n\n/** `RepositoryTypes.REMOTE` - data behind another service's API: a datasource and no model. */\nexport interface IRemoteRepositoryMetadata<\n DataSource extends IDataSource = IDataSource,\n> extends IRepositoryMetadataBase<DataSource> {\n type: typeof RepositoryTypes.REMOTE;\n model?: never;\n}\n\n/** What `@repository` accepts, discriminated on `type`. */\nexport type TRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> = IRepositoryMetadata<Model, DataSource> | IRemoteRepositoryMetadata<DataSource>;\n\n/** Resolved repository metadata after lazy evaluation. */\nexport interface IResolvedRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> {\n type?: TRepositoryType;\n model?: TClass<Model>;\n dataSource?: string | TClass<DataSource>;\n operationScope?: TRepositoryOperationScope;\n}\n\n/** Links a model to the repository and datasource that serve it, each given as a value or a resolver. */\nexport interface IRepositoryBinding<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> {\n model: TValueOrResolver<TClass<Model>>;\n repository: TValueOrResolver<TDecoratorTarget<IRepository>>;\n dataSource: TValueOrResolver<string | TDecoratorTarget<DataSource>>;\n}\n"]}
1
+ {"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/persistence.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n IDataSource,\n IDataSourceOpenOptions,\n TDataSourceDriverClass,\n} from '@/base/datasources';\nimport type { AbstractEntity } from '@/base/models';\nimport type {\n IRepository,\n RepositoryTypes,\n TRepositoryOperationScope,\n TRepositoryType,\n} from '@/base/repositories';\nimport type { TClass, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions, TDecoratorTarget } from './artifact';\n\n/** Metadata accepted by `@datasource`. */\nexport interface IDataSourceMetadata extends IArtifactRegistrationOptions {\n driver?: TDataSourceDriverClass;\n\n /** When the datasource opens. `{ on: 'first-use' }` leaves it closed at start and opens it at the first call that needs it. */\n open?: IDataSourceOpenOptions;\n\n /**\n * `false` stops model schema discovery for the datasource.\n *\n * @default true\n */\n autoDiscovery?: boolean;\n}\n\n/** Members every repository type shares. */\nexport interface IRepositoryMetadataBase<\n DataSource extends IDataSource = IDataSource,\n> extends IArtifactRegistrationOptions {\n dataSource: string | TValueOrResolver<TClass<DataSource>>;\n operationScope?: TRepositoryOperationScope;\n}\n\n/** `RepositoryTypes.MODEL` - a model this application declares. */\nexport interface IRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> extends IRepositoryMetadataBase<DataSource> {\n /** @default RepositoryTypes.MODEL */\n type?: typeof RepositoryTypes.MODEL;\n model: TValueOrResolver<TClass<Model>>;\n}\n\n/** `RepositoryTypes.REMOTE` - data behind another service's API: a datasource and no model. */\nexport interface IRemoteRepositoryMetadata<\n DataSource extends IDataSource = IDataSource,\n> extends IRepositoryMetadataBase<DataSource> {\n type: typeof RepositoryTypes.REMOTE;\n model?: never;\n}\n\n/** What `@repository` accepts, discriminated on `type`. */\nexport type TRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> = IRepositoryMetadata<Model, DataSource> | IRemoteRepositoryMetadata<DataSource>;\n\n/** Resolved repository metadata after lazy evaluation. */\nexport interface IResolvedRepositoryMetadata<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> {\n type?: TRepositoryType;\n model?: TClass<Model>;\n dataSource?: string | TClass<DataSource>;\n operationScope?: TRepositoryOperationScope;\n}\n\n/** Links a model to the repository and datasource that serve it, each given as a value or a resolver. */\nexport interface IRepositoryBinding<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n> {\n model: TValueOrResolver<TClass<Model>>;\n repository: TValueOrResolver<TDecoratorTarget<IRepository>>;\n dataSource: TValueOrResolver<string | TDecoratorTarget<DataSource>>;\n}\n"]}
@@ -26,7 +26,9 @@ export { NotSupportedUtility } from './utilities/not-supported.utility.js';
26
26
  export type { TCount, TDataRange, TDataWithRange } from './base/repositories/common/types/results.js';
27
27
  export type { IDataSource } from './base/datasources/common/types.js';
28
28
  export { AbstractEntity } from './base/models/base.js';
29
- export { SchemaTypes } from './base/models/common/constants.js';
29
+ export { AuditFields, SchemaTypes } from './base/models/common/constants.js';
30
30
  export type { TIdSchemaType, TSchemaType } from './base/models/common/index.js';
31
31
  export type { TByIdFilter, TFields, TFilter, TInclusion, TRow, TSelectedRow, TWhere, } from '@venizia/ignis-filter';
32
+ export { RequestFilterParts } from './base/repositories/common/request-filter-guard.js';
33
+ export type { IRequestFilterJudge, IRequestFilterShape, TRequestFilterPart, TRequestFilterPiece, } from './base/repositories/common/request-filter-guard.js';
32
34
  //# sourceMappingURL=repository.d.ts.map
@@ -27,5 +27,7 @@ export { NotSupportedUtility } from './utilities/not-supported.utility.js';
27
27
  // `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.
28
28
  // Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.
29
29
  export { AbstractEntity } from './base/models/base.js';
30
- export { SchemaTypes } from './base/models/common/constants.js';
30
+ export { AuditFields, SchemaTypes } from './base/models/common/constants.js';
31
+ // What a repository on any transport needs to refuse a request filter that names a hidden property.
32
+ export { RequestFilterParts } from './base/repositories/common/request-filter-guard.js';
31
33
  //# sourceMappingURL=repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,gGAAgG;AAChG,yCAAyC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,mGAAmG;AACnG,mEAAmE;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAKxE,mGAAmG;AACnG,qFAAqF;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["/**\n * The persistence contract, and nothing about how a row is served or validated.\n *\n * A repository talks to a datasource. `AbstractDataSource` is engine-neutral - its only required\n * member is `configure()` - so \"an HTTP request to another server\" is a datasource in the same sense\n * Drizzle-over-Postgres is one: same role, different transport. This entry exists so a consumer can\n * implement that without taking the OpenAPI layer, which `base/repositories` reaches through\n * `query-schemas` and `result-schemas`.\n *\n * Both halves already speak `@venizia/ignis-filter`, so a consumer on another transport shares the\n * query vocabulary rather than translating into one.\n *\n * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport { AbstractRepository } from '@/base/repositories/core/abstract';\nexport { AbstractDataSource } from '@/base/datasources/abstract';\n\nexport type {\n ICreatableRepository,\n ICrudRepository,\n IDeletableRepository,\n IPersistableRepository,\n IReadableRepository,\n IRepository,\n IUpdatableRepository,\n} from '@/base/repositories/common/types/contracts';\n\nexport { DataRangeUtility } from '@/base/repositories/common/types/results';\n\n// How a client reads what an IGNIS server answers - shared by the http connector and any client\n// that reads the same server without it.\nexport { HttpResponseReader } from '@/base/repositories/common/response-reader';\nexport { HttpExtraRequest } from '@/base/repositories/common/extra-request';\nexport type { TExtraRequest, TExtraResult } from '@/base/repositories/common/extra-request';\n\n// What a repository on any transport raises and bounds itself by - the constants, the error codes,\n// and the helper an engine that lacks an operation throws through.\nexport {\n DEFAULT_LIMIT,\n DEFAULT_MAX_LIMIT,\n RepositoryOperationScopes,\n RepositoryTypes,\n} from '@/base/repositories/common/constants';\nexport type { TRepositoryType } from '@/base/repositories/common/constants';\nexport { CoreErrorCodes, SearchErrorCodes } from '@/common/error-codes';\nexport { NotSupportedUtility } from '@/utilities/not-supported.utility';\nexport type { TCount, TDataRange, TDataWithRange } from '@/base/repositories/common/types/results';\n\nexport type { IDataSource } from '@/base/datasources/common/types';\n\n// `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.\n// Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.\nexport { AbstractEntity } from '@/base/models/base';\nexport { SchemaTypes } from '@/base/models/common/constants';\nexport type { TIdSchemaType, TSchemaType } from '@/base/models/common';\n\n// The query vocabulary both transports share.\nexport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TSelectedRow,\n TWhere,\n} from '@venizia/ignis-filter';\n"]}
1
+ {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,gGAAgG;AAChG,yCAAyC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,mGAAmG;AACnG,mEAAmE;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAKxE,mGAAmG;AACnG,qFAAqF;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAc1E,oGAAoG;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC","sourcesContent":["/**\n * The persistence contract, and nothing about how a row is served or validated.\n *\n * A repository talks to a datasource. `AbstractDataSource` is engine-neutral - its only required\n * member is `configure()` - so \"an HTTP request to another server\" is a datasource in the same sense\n * Drizzle-over-Postgres is one: same role, different transport. This entry exists so a consumer can\n * implement that without taking the OpenAPI layer, which `base/repositories` reaches through\n * `query-schemas` and `result-schemas`.\n *\n * Both halves already speak `@venizia/ignis-filter`, so a consumer on another transport shares the\n * query vocabulary rather than translating into one.\n *\n * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport { AbstractRepository } from '@/base/repositories/core/abstract';\nexport { AbstractDataSource } from '@/base/datasources/abstract';\n\nexport type {\n ICreatableRepository,\n ICrudRepository,\n IDeletableRepository,\n IPersistableRepository,\n IReadableRepository,\n IRepository,\n IUpdatableRepository,\n} from '@/base/repositories/common/types/contracts';\n\nexport { DataRangeUtility } from '@/base/repositories/common/types/results';\n\n// How a client reads what an IGNIS server answers - shared by the http connector and any client\n// that reads the same server without it.\nexport { HttpResponseReader } from '@/base/repositories/common/response-reader';\nexport { HttpExtraRequest } from '@/base/repositories/common/extra-request';\nexport type { TExtraRequest, TExtraResult } from '@/base/repositories/common/extra-request';\n\n// What a repository on any transport raises and bounds itself by - the constants, the error codes,\n// and the helper an engine that lacks an operation throws through.\nexport {\n DEFAULT_LIMIT,\n DEFAULT_MAX_LIMIT,\n RepositoryOperationScopes,\n RepositoryTypes,\n} from '@/base/repositories/common/constants';\nexport type { TRepositoryType } from '@/base/repositories/common/constants';\nexport { CoreErrorCodes, SearchErrorCodes } from '@/common/error-codes';\nexport { NotSupportedUtility } from '@/utilities/not-supported.utility';\nexport type { TCount, TDataRange, TDataWithRange } from '@/base/repositories/common/types/results';\n\nexport type { IDataSource } from '@/base/datasources/common/types';\n\n// `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.\n// Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.\nexport { AbstractEntity } from '@/base/models/base';\nexport { AuditFields, SchemaTypes } from '@/base/models/common/constants';\nexport type { TIdSchemaType, TSchemaType } from '@/base/models/common';\n\n// The query vocabulary both transports share.\nexport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TSelectedRow,\n TWhere,\n} from '@venizia/ignis-filter';\n\n// What a repository on any transport needs to refuse a request filter that names a hidden property.\nexport { RequestFilterParts } from '@/base/repositories/common/request-filter-guard';\nexport type {\n IRequestFilterJudge,\n IRequestFilterShape,\n TRequestFilterPart,\n TRequestFilterPiece,\n} from '@/base/repositories/common/request-filter-guard';\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The status codes, and nothing else: `Statuses` and `CommonStatuses` import nothing, so a browser bundle
3
+ * that needs a status constant takes this entry instead of the server kernel.
4
+ *
5
+ * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.
6
+ */
7
+ export { CommonStatuses, Statuses } from './common/statuses/common.js';
8
+ //# sourceMappingURL=statuses.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The status codes, and nothing else: `Statuses` and `CommonStatuses` import nothing, so a browser bundle
3
+ * that needs a status constant takes this entry instead of the server kernel.
4
+ *
5
+ * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.
6
+ */
7
+ export { CommonStatuses, Statuses } from './common/statuses/common.js';
8
+ //# sourceMappingURL=statuses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statuses.js","sourceRoot":"","sources":["../../src/statuses.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * The status codes, and nothing else: `Statuses` and `CommonStatuses` import nothing, so a browser bundle\n * that needs a status constant takes this entry instead of the server kernel.\n *\n * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport { CommonStatuses, Statuses } from '@/common/statuses/common';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-kernel",
3
- "version": "0.4.8-5",
3
+ "version": "0.4.8-7",
4
4
  "description": "Browser-pure kernel of the IGNIS framework: dependency injection, lifecycle, REST controllers, repository and datasource abstractions, and the authentication and authorization seams. No node builtin and no server-only peer, so the same kernel serves a Bun server and a browser Worker.",
5
5
  "keywords": [
6
6
  "authentication",
@@ -60,6 +60,10 @@
60
60
  "types": "./dist/esm/repository.d.ts",
61
61
  "default": "./dist/esm/repository.js"
62
62
  },
63
+ "./statuses": {
64
+ "types": "./dist/esm/statuses.d.ts",
65
+ "default": "./dist/esm/statuses.js"
66
+ },
63
67
  "./package.json": "./package.json"
64
68
  },
65
69
  "publishConfig": {
@@ -69,14 +73,14 @@
69
73
  "force-update": "sh ../../scripts/build/force-update.sh"
70
74
  },
71
75
  "dependencies": {
72
- "@venizia/ignis-filter": "0.4.7-3",
73
- "@venizia/ignis-helpers": "0.4.8-5",
74
- "@venizia/ignis-inversion": "0.4.7-2",
76
+ "@venizia/ignis-filter": "0.4.7-4",
77
+ "@venizia/ignis-helpers": "0.4.8-7",
78
+ "@venizia/ignis-inversion": "0.4.7-3",
75
79
  "reflect-metadata": "^0.2.2"
76
80
  },
77
81
  "devDependencies": {
78
82
  "@types/bun": "^1.4.3",
79
- "@venizia/dev-configs": "0.4.8-2",
83
+ "@venizia/dev-configs": "0.4.8-4",
80
84
  "casbin": "^5.51.1",
81
85
  "eslint": "^10.13.0",
82
86
  "oxlint": "1.89.0",