@venizia/ignis-docs 0.0.6-3 → 0.0.7-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 (113) hide show
  1. package/README.md +125 -388
  2. package/dist/mcp-server/common/config.d.ts +0 -21
  3. package/dist/mcp-server/common/config.d.ts.map +1 -1
  4. package/dist/mcp-server/common/config.js +1 -36
  5. package/dist/mcp-server/common/config.js.map +1 -1
  6. package/dist/mcp-server/helpers/docs.helper.d.ts +0 -24
  7. package/dist/mcp-server/helpers/docs.helper.d.ts.map +1 -1
  8. package/dist/mcp-server/helpers/docs.helper.js +0 -25
  9. package/dist/mcp-server/helpers/docs.helper.js.map +1 -1
  10. package/dist/mcp-server/helpers/github.helper.d.ts +0 -13
  11. package/dist/mcp-server/helpers/github.helper.d.ts.map +1 -1
  12. package/dist/mcp-server/helpers/github.helper.js +3 -20
  13. package/dist/mcp-server/helpers/github.helper.js.map +1 -1
  14. package/dist/mcp-server/index.js +0 -20
  15. package/dist/mcp-server/index.js.map +1 -1
  16. package/dist/mcp-server/tools/base.tool.d.ts +2 -79
  17. package/dist/mcp-server/tools/base.tool.d.ts.map +1 -1
  18. package/dist/mcp-server/tools/base.tool.js +1 -38
  19. package/dist/mcp-server/tools/base.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/docs/get-document-content.tool.js +0 -9
  22. package/dist/mcp-server/tools/docs/get-document-content.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/docs/get-document-metadata.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/docs/get-document-metadata.tool.js +0 -9
  25. package/dist/mcp-server/tools/docs/get-document-metadata.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts +0 -6
  27. package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/docs/get-package-overview.tool.js +1 -24
  29. package/dist/mcp-server/tools/docs/get-package-overview.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/docs/list-categories.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/docs/list-categories.tool.js +0 -9
  32. package/dist/mcp-server/tools/docs/list-categories.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/docs/list-documents.tool.d.ts.map +1 -1
  34. package/dist/mcp-server/tools/docs/list-documents.tool.js +0 -9
  35. package/dist/mcp-server/tools/docs/list-documents.tool.js.map +1 -1
  36. package/dist/mcp-server/tools/docs/search-documents.tool.d.ts.map +1 -1
  37. package/dist/mcp-server/tools/docs/search-documents.tool.js +0 -9
  38. package/dist/mcp-server/tools/docs/search-documents.tool.js.map +1 -1
  39. package/dist/mcp-server/tools/github/list-project-files.tool.d.ts.map +1 -1
  40. package/dist/mcp-server/tools/github/list-project-files.tool.js +0 -9
  41. package/dist/mcp-server/tools/github/list-project-files.tool.js.map +1 -1
  42. package/dist/mcp-server/tools/github/search-code.tool.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/github/search-code.tool.js +1 -13
  44. package/dist/mcp-server/tools/github/search-code.tool.js.map +1 -1
  45. package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts +0 -4
  46. package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/github/verify-dependencies.tool.js +1 -18
  48. package/dist/mcp-server/tools/github/verify-dependencies.tool.js.map +1 -1
  49. package/dist/mcp-server/tools/github/view-source-file.tool.d.ts.map +1 -1
  50. package/dist/mcp-server/tools/github/view-source-file.tool.js +0 -9
  51. package/dist/mcp-server/tools/github/view-source-file.tool.js.map +1 -1
  52. package/dist/mcp-server/tools/index.d.ts.map +1 -1
  53. package/dist/mcp-server/tools/index.js +0 -2
  54. package/dist/mcp-server/tools/index.js.map +1 -1
  55. package/package.json +1 -1
  56. package/wiki/best-practices/api-usage-examples.md +7 -5
  57. package/wiki/best-practices/code-style-standards/advanced-patterns.md +1 -1
  58. package/wiki/best-practices/code-style-standards/constants-configuration.md +1 -1
  59. package/wiki/best-practices/code-style-standards/control-flow.md +1 -1
  60. package/wiki/best-practices/code-style-standards/function-patterns.md +1 -1
  61. package/wiki/best-practices/common-pitfalls.md +1 -1
  62. package/wiki/best-practices/data-modeling.md +33 -1
  63. package/wiki/best-practices/error-handling.md +7 -4
  64. package/wiki/best-practices/performance-optimization.md +1 -1
  65. package/wiki/best-practices/security-guidelines.md +5 -4
  66. package/wiki/guides/core-concepts/components-guide.md +1 -1
  67. package/wiki/guides/core-concepts/controllers.md +14 -8
  68. package/wiki/guides/core-concepts/persistent/models.md +32 -0
  69. package/wiki/guides/core-concepts/services.md +2 -1
  70. package/wiki/guides/get-started/5-minute-quickstart.md +1 -1
  71. package/wiki/guides/tutorials/building-a-crud-api.md +2 -1
  72. package/wiki/guides/tutorials/complete-installation.md +2 -2
  73. package/wiki/guides/tutorials/ecommerce-api.md +3 -3
  74. package/wiki/guides/tutorials/realtime-chat.md +7 -6
  75. package/wiki/index.md +2 -1
  76. package/wiki/references/base/application.md +28 -0
  77. package/wiki/references/base/components.md +2 -1
  78. package/wiki/references/base/controllers.md +31 -4
  79. package/wiki/references/base/datasources.md +6 -2
  80. package/wiki/references/base/dependency-injection.md +31 -0
  81. package/wiki/references/base/filter-system/fields-order-pagination.md +8 -1
  82. package/wiki/references/base/middlewares.md +2 -1
  83. package/wiki/references/base/models.md +144 -2
  84. package/wiki/references/base/repositories/advanced.md +2 -2
  85. package/wiki/references/base/repositories/index.md +24 -1
  86. package/wiki/references/base/repositories/soft-deletable.md +213 -0
  87. package/wiki/references/base/services.md +2 -1
  88. package/wiki/references/components/authentication/api.md +525 -205
  89. package/wiki/references/components/authentication/errors.md +502 -105
  90. package/wiki/references/components/authentication/index.md +388 -75
  91. package/wiki/references/components/authentication/usage.md +575 -247
  92. package/wiki/references/components/authorization/usage.md +62 -0
  93. package/wiki/references/components/health-check.md +2 -1
  94. package/wiki/references/components/socket-io/index.md +9 -4
  95. package/wiki/references/components/socket-io/usage.md +1 -1
  96. package/wiki/references/components/static-asset/index.md +3 -5
  97. package/wiki/references/components/swagger.md +2 -1
  98. package/wiki/references/configuration/environment-variables.md +2 -1
  99. package/wiki/references/configuration/index.md +40 -1
  100. package/wiki/references/helpers/error/index.md +1 -1
  101. package/wiki/references/helpers/inversion/index.md +1 -1
  102. package/wiki/references/helpers/redis/index.md +2 -9
  103. package/wiki/references/quick-reference.md +3 -5
  104. package/wiki/references/utilities/crypto.md +2 -2
  105. package/wiki/references/utilities/date.md +5 -5
  106. package/wiki/references/utilities/index.md +3 -11
  107. package/wiki/references/utilities/jsx.md +4 -2
  108. package/wiki/references/utilities/module.md +1 -1
  109. package/wiki/references/utilities/parse.md +24 -4
  110. package/wiki/references/utilities/performance.md +2 -2
  111. package/wiki/references/utilities/promise.md +4 -4
  112. package/wiki/references/utilities/request.md +2 -2
  113. package/wiki/references/utilities/schema.md +17 -8
@@ -1 +1 @@
1
- {"version":3,"file":"view-source-file.tool.js","sourceRoot":"","sources":["../../../../mcp-server/tools/github/view-source-file.tool.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,6BAAwB;AACxB,4CAAwC;AACxC,kDAAoD;AAEpD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;CAiBxB,CAAC;AAEF,MAAM,qBAAqB,GAAG;;;;;;;;;;;;CAY7B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;CAC5D,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,OA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AAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,IAAA,kBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,gDA+BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../mcp-server/tools/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAG5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../mcp-server/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
@@ -14,9 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // Base class
18
17
  __exportStar(require("./base.tool"), exports);
19
- // Tool classes
20
18
  __exportStar(require("./docs"), exports);
21
19
  __exportStar(require("./github"), exports);
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../mcp-server/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,aAAa;AACb,8CAA4B;AAE5B,eAAe;AACf,yCAAuB;AACvB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../mcp-server/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-docs",
3
- "version": "0.0.6-3",
3
+ "version": "0.0.7-1",
4
4
  "description": "Interactive documentation site and MCP (Model Context Protocol) server for the Ignis Framework. Includes a VitePress-powered documentation site with guides, API references, and best practices. Ships an MCP server (CLI: ignis-docs-mcp) with 11 tools for AI assistants to search docs, browse source code, verify dependencies, and access real-time framework knowledge. Built with Mastra MCP SDK and Fuse.js fuzzy search.",
5
5
  "keywords": [
6
6
  "ai",
@@ -11,7 +11,8 @@ Use `@get`, `@post` decorators with `as const` route configs for full type safet
11
11
  **`src/controllers/test/definitions.ts`**
12
12
  ```typescript
13
13
  import { z } from '@hono/zod-openapi';
14
- import { Authentication, HTTP, jsonContent, jsonResponse } from '@venizia/ignis';
14
+ import { Authentication, jsonContent, jsonResponse } from '@venizia/ignis';
15
+ import { HTTP } from '@venizia/ignis-helpers';
15
16
 
16
17
  // Define route configs as const for type inference
17
18
  export const RouteConfigs = {
@@ -52,8 +53,8 @@ import {
52
53
  get,
53
54
  post,
54
55
  TRouteContext,
55
- HTTP,
56
56
  } from '@venizia/ignis';
57
+ import { HTTP } from '@venizia/ignis-helpers';
57
58
  import { RouteConfigs } from './definitions';
58
59
 
59
60
  @controller({ path: '/test' })
@@ -90,7 +91,8 @@ You can also define routes manually within the controller's `binding()` method u
90
91
 
91
92
  **`src/controllers/test/controller.ts`**
92
93
  ```typescript
93
- import { BaseController, controller, HTTP, ValueOrPromise } from '@venizia/ignis';
94
+ import { BaseController, controller, ValueOrPromise } from '@venizia/ignis';
95
+ import { HTTP } from '@venizia/ignis-helpers';
94
96
  import { RouteConfigs } from './definitions';
95
97
 
96
98
  @controller({ path: '/test' })
@@ -301,7 +303,7 @@ server.use('/api/*', rateLimiter({ maxRequests: 100 }));
301
303
  ### Middleware with Logging
302
304
 
303
305
  ```typescript
304
- import { BaseHelper } from '@venizia/ignis';
306
+ import { BaseHelper } from '@venizia/ignis-helpers';
305
307
  import { createMiddleware } from 'hono/factory';
306
308
 
307
309
  export const requestLogger = (): MiddlewareHandler => {
@@ -496,7 +498,7 @@ Use `getError()` to throw structured errors that are automatically formatted by
496
498
  ### Throwing Errors
497
499
 
498
500
  ```typescript
499
- import { getError, HTTP } from '@venizia/ignis';
501
+ import { getError, HTTP } from '@venizia/ignis-helpers';
500
502
 
501
503
  // Basic error
502
504
  throw getError({ message: 'Something went wrong' });
@@ -7,7 +7,7 @@ Advanced TypeScript patterns used throughout the Ignis framework.
7
7
  Create reusable class extensions without deep inheritance:
8
8
 
9
9
  ```typescript
10
- import { TMixinTarget } from '@venizia/ignis';
10
+ import { TMixinTarget } from '@venizia/ignis-helpers';
11
11
 
12
12
  export const LoggableMixin = <BaseClass extends TMixinTarget<Base>>(
13
13
  baseClass: BaseClass,
@@ -210,7 +210,7 @@ export class EnvironmentKeys {
210
210
 
211
211
  **Usage:**
212
212
  ```typescript
213
- import { applicationEnvironment } from '@venizia/ignis';
213
+ import { applicationEnvironment } from '@venizia/ignis-helpers';
214
214
  import { EnvironmentKeys } from '@/common/environments';
215
215
 
216
216
  // Correct usage
@@ -123,7 +123,7 @@ Use the `getError` helper and `HTTP` constants to throw consistent, formatted ex
123
123
  ### Basic Error
124
124
 
125
125
  ```typescript
126
- import { getError, HTTP } from '@venizia/ignis';
126
+ import { getError, HTTP } from '@venizia/ignis-helpers';
127
127
 
128
128
  if (!record) {
129
129
  throw getError({
@@ -125,7 +125,7 @@ async syncData() {
125
125
  **With the helper utility:**
126
126
 
127
127
  ```typescript
128
- import { executeWithPerformanceMeasure } from '@venizia/ignis';
128
+ import { executeWithPerformanceMeasure } from '@venizia/ignis-helpers';
129
129
 
130
130
  await executeWithPerformanceMeasure({
131
131
  logger: this.logger.for('syncData'),
@@ -66,7 +66,7 @@ export class Application extends BaseApplication {
66
66
 
67
67
  - **Bad:**
68
68
  ```typescript
69
- import { ApplicationError, getError } from '@venizia/ignis';
69
+ import { ApplicationError, getError } from '@venizia/ignis-helpers';
70
70
 
71
71
  // In a Controller
72
72
  async createUser(c: Context) {
@@ -375,7 +375,39 @@ export class User extends BaseEntity<typeof User.schema> {
375
375
 
376
376
  > **Reference:** See [Hidden Properties](../references/base/models.md#hidden-properties) for complete documentation.
377
377
 
378
- ## 6. Database Migrations
378
+ ## 6. Authorization Settings
379
+
380
+ Declare your model's authorization principal in `@model` settings to make the model the single source of truth for permission subjects:
381
+
382
+ ```typescript
383
+ @model({
384
+ type: 'entity',
385
+ settings: {
386
+ authorize: { principal: 'user' },
387
+ hiddenProperties: ['password'],
388
+ },
389
+ })
390
+ export class User extends BaseEntity<typeof User.schema> {
391
+ static override schema = pgTable('User', {
392
+ ...generateIdColumnDefs({ id: { dataType: 'string' } }),
393
+ email: text('email').notNull(),
394
+ password: text('password'),
395
+ });
396
+ }
397
+
398
+ // User.AUTHORIZATION_SUBJECT === 'user' (auto-populated)
399
+ ```
400
+
401
+ **Key points:**
402
+
403
+ - `AUTHORIZATION_SUBJECT` is auto-set from `authorize.principal` by the `@model` decorator
404
+ - Use `Model.AUTHORIZATION_SUBJECT` in route configs instead of hardcoded strings
405
+ - Explicit `static AUTHORIZATION_SUBJECT = '...'` on the class takes precedence
406
+ - The `authorize` settings are extensible via index signature for custom metadata
407
+
408
+ > **Reference:** See [Model-Based Resource References](../references/components/authorization/usage#model-based-resource-references) for full authorization integration.
409
+
410
+ ## 7. Database Migrations
379
411
 
380
412
  Drizzle Kit handles schema migrations. Follow these best practices for safe migrations.
381
413
 
@@ -16,7 +16,7 @@ Comprehensive guide to handling errors gracefully in Ignis applications.
16
16
  Ignis provides `getError` for creating consistent, structured errors.
17
17
 
18
18
  ```typescript
19
- import { getError, HTTP } from '@venizia/ignis';
19
+ import { getError, HTTP } from '@venizia/ignis-helpers';
20
20
 
21
21
  // Basic error
22
22
  throw getError({
@@ -68,7 +68,8 @@ Database constraint violations (unique, foreign key, not null, check) are automa
68
68
  ### Service Layer Errors
69
69
 
70
70
  ```typescript
71
- import { BaseService, getError, HTTP } from '@venizia/ignis';
71
+ import { BaseService } from '@venizia/ignis';
72
+ import { getError, HTTP } from '@venizia/ignis-helpers';
72
73
 
73
74
  export class UserService extends BaseService {
74
75
  async createUser(data: TCreateUserRequest): Promise<TUser> {
@@ -160,7 +161,8 @@ Database constraint violations (unique, foreign key, not null, check) are **auto
160
161
  You don't need to wrap repository calls in try-catch for constraint errors. If you need custom error messages, you can still handle them explicitly:
161
162
 
162
163
  ```typescript
163
- import { BaseRepository, getError, HTTP } from '@venizia/ignis';
164
+ import { BaseRepository } from '@venizia/ignis';
165
+ import { getError, HTTP } from '@venizia/ignis-helpers';
164
166
 
165
167
  export class UserRepository extends BaseRepository<typeof User.schema> {
166
168
  async createWithCustomError(data: TCreateUser): Promise<TCreateResult<TUser>> {
@@ -185,7 +187,8 @@ export class UserRepository extends BaseRepository<typeof User.schema> {
185
187
  Ignis includes a built-in error handler. Customize behavior in your application:
186
188
 
187
189
  ```typescript
188
- import { BaseApplication, ApplicationError } from '@venizia/ignis';
190
+ import { BaseApplication } from '@venizia/ignis';
191
+ import { ApplicationError } from '@venizia/ignis-helpers';
189
192
 
190
193
  export class Application extends BaseApplication {
191
194
  override setupMiddlewares(): void {
@@ -7,7 +7,7 @@ Optimize your Ignis application for speed and scalability.
7
7
  Identify bottlenecks before optimizing:
8
8
 
9
9
  ```typescript
10
- import { executeWithPerformanceMeasure } from '@venizia/ignis';
10
+ import { executeWithPerformanceMeasure } from '@venizia/ignis-helpers';
11
11
 
12
12
  await executeWithPerformanceMeasure({
13
13
  logger: this.logger,
@@ -72,7 +72,8 @@ const SecureRoute = {
72
72
 
73
73
  **Access user in protected routes:**
74
74
  ```typescript
75
- import { Authentication, IJWTTokenPayload, ApplicationError, getError } from '@venizia/ignis';
75
+ import { Authentication, IJWTTokenPayload } from '@venizia/ignis';
76
+ import { ApplicationError, getError } from '@venizia/ignis-helpers';
76
77
 
77
78
  const user = c.get(Authentication.CURRENT_USER) as IJWTTokenPayload;
78
79
  if (!user.roles.includes('admin')) {
@@ -132,7 +133,7 @@ When handling file uploads, prevent **path traversal attacks** and ensure safe f
132
133
  **Solution:** Use `sanitizeFilename()` to strip dangerous patterns:
133
134
 
134
135
  ```typescript
135
- import { sanitizeFilename } from '@venizia/ignis';
136
+ import { sanitizeFilename } from '@venizia/ignis-helpers';
136
137
 
137
138
  // ❌ DANGEROUS - User-controlled filename
138
139
  const unsafeFilename = req.body.filename; // Could be "../../../etc/passwd"
@@ -154,7 +155,7 @@ fs.writeFileSync(`./uploads/${safeFilename}`, data);
154
155
  Use `createContentDispositionHeader()` for secure download responses:
155
156
 
156
157
  ```typescript
157
- import { createContentDispositionHeader, sanitizeFilename } from '@venizia/ignis';
158
+ import { createContentDispositionHeader, sanitizeFilename } from '@venizia/ignis-helpers';
158
159
 
159
160
  async downloadFile(c: Context) {
160
161
  const filename = sanitizeFilename(c.req.param('filename'));
@@ -177,7 +178,7 @@ async downloadFile(c: Context) {
177
178
  Use `parseMultipartBody()` for safe file uploads with automatic sanitization:
178
179
 
179
180
  ```typescript
180
- import { parseMultipartBody } from '@venizia/ignis';
181
+ import { parseMultipartBody } from '@venizia/ignis-helpers';
181
182
 
182
183
  async uploadFile(c: Context) {
183
184
  const files = await parseMultipartBody({
@@ -133,11 +133,11 @@ import {
133
133
  controller,
134
134
  post,
135
135
  inject,
136
- HTTP,
137
136
  jsonContent,
138
137
  jsonResponse,
139
138
  TRouteContext,
140
139
  } from '@venizia/ignis';
140
+ import { HTTP } from '@venizia/ignis-helpers';
141
141
  import { z } from '@hono/zod-openapi';
142
142
  import { NotificationService } from '../services';
143
143
 
@@ -9,7 +9,8 @@ Controllers handle HTTP requests and return responses - they're your API endpoin
9
9
  Extend `BaseController` and use decorators to define routes:
10
10
 
11
11
  ```typescript
12
- import { BaseController, controller, get, jsonResponse, z, HTTP } from '@venizia/ignis';
12
+ import { BaseController, controller, get, jsonResponse, z } from '@venizia/ignis';
13
+ import { HTTP } from '@venizia/ignis-helpers';
13
14
  import { Context } from 'hono';
14
15
 
15
16
  @controller({ path: '/users' })
@@ -70,7 +71,8 @@ The `opts` object contains a `configs` property that defines the route's path, r
70
71
  For optimal organization and type safety, define your route configurations in a constant with `as const`. This allows TypeScript to precisely infer the types for your request data and expected responses within your handler methods.
71
72
 
72
73
  ```typescript
73
- import { BaseController, controller, get, post, HTTP, jsonContent, jsonResponse, TRouteContext } from '@venizia/ignis';
74
+ import { BaseController, controller, get, post, jsonContent, jsonResponse, TRouteContext } from '@venizia/ignis';
75
+ import { HTTP } from '@venizia/ignis-helpers';
74
76
  import { z } from '@hono/zod-openapi';
75
77
 
76
78
  // Define route configs as const for type inference
@@ -161,7 +163,8 @@ When using this method, you will override the `binding()` method in your control
161
163
  Use this method for defining a single API endpoint with all its configurations and handler. It also benefits from type inference when used with `TRouteContext`.
162
164
 
163
165
  ```typescript
164
- import { Authentication, HTTP, jsonResponse, z, TRouteContext } from '@venizia/ignis';
166
+ import { Authentication, jsonResponse, z, TRouteContext } from '@venizia/ignis';
167
+ import { HTTP } from '@venizia/ignis-helpers';
165
168
 
166
169
  // ... inside the binding() method
167
170
 
@@ -188,7 +191,8 @@ this.defineRoute({
188
191
  This method offers a fluent API for defining routes, similar to `defineRoute`, but structured for chaining. It also benefits from `TRouteContext` for type safety.
189
192
 
190
193
  ```typescript
191
- import { jsonResponse, z, TRouteContext, HTTP } from '@venizia/ignis';
194
+ import { jsonResponse, z, TRouteContext } from '@venizia/ignis';
195
+ import { HTTP } from '@venizia/ignis-helpers';
192
196
 
193
197
  // ... inside the binding() method
194
198
 
@@ -309,7 +313,7 @@ this.defineJSXRoute({
309
313
 
310
314
  ```typescript
311
315
  // src/views/pages/home.page.tsx
312
- import type { FC } from '@venizia/ignis';
316
+ import type { FC } from '@venizia/ignis-helpers';
313
317
  import { MainLayout } from '../layouts/main.layout';
314
318
 
315
319
  interface HomePageProps {
@@ -330,7 +334,7 @@ export const HomePage: FC<HomePageProps> = ({ user }) => {
330
334
 
331
335
  ```typescript
332
336
  // src/views/layouts/main.layout.tsx
333
- import type { FC, PropsWithChildren } from '@venizia/ignis';
337
+ import type { FC, PropsWithChildren } from '@venizia/ignis-helpers';
334
338
 
335
339
  interface MainLayoutProps {
336
340
  title: string;
@@ -369,7 +373,8 @@ When you define Zod schemas in your route's `request` configuration (whether wit
369
373
 
370
374
  ```typescript
371
375
  import { z } from '@hono/zod-openapi';
372
- import { jsonContent, put, HTTP } from '@venizia/ignis';
376
+ import { jsonContent, put } from '@venizia/ignis';
377
+ import { HTTP } from '@venizia/ignis-helpers';
373
378
 
374
379
  // ... inside a controller class
375
380
 
@@ -406,7 +411,8 @@ Using `c.req.valid()` is the recommended way to access request data as it ensure
406
411
 
407
412
  ```typescript
408
413
  import { z } from '@hono/zod-openapi';
409
- import { jsonContent, put, TRouteContext, HTTP } from '@venizia/ignis';
414
+ import { jsonContent, put, TRouteContext } from '@venizia/ignis';
415
+ import { HTTP } from '@venizia/ignis-helpers';
410
416
 
411
417
  // ... inside a controller class
412
418
 
@@ -208,6 +208,38 @@ const [fullUser] = await connector
208
208
  For complete hidden properties documentation, see the [Models Reference](../../../references/base/models.md#hidden-properties).
209
209
  :::
210
210
 
211
+ ## Authorization Settings
212
+
213
+ Declare your model's authorization principal directly in `@model` settings. The decorator auto-populates `AUTHORIZATION_SUBJECT` for type-safe references in route configs:
214
+
215
+ ```typescript
216
+ import { BaseEntity, generateIdColumnDefs, model, AuthorizationActions } from '@venizia/ignis';
217
+ import { pgTable, text } from 'drizzle-orm/pg-core';
218
+
219
+ @model({
220
+ type: 'entity',
221
+ settings: {
222
+ authorize: { principal: 'article' },
223
+ },
224
+ })
225
+ export class Article extends BaseEntity<typeof Article.schema> {
226
+ static override schema = pgTable('Article', {
227
+ ...generateIdColumnDefs({ id: { dataType: 'string' } }),
228
+ title: text('title').notNull(),
229
+ });
230
+ }
231
+
232
+ // Use in route configs — no hardcoded strings
233
+ authorize: {
234
+ action: AuthorizationActions.READ,
235
+ resource: Article.AUTHORIZATION_SUBJECT, // 'article'
236
+ }
237
+ ```
238
+
239
+ :::tip
240
+ For full authorization integration details, see the [Authorization Usage Reference](../../../references/components/authorization/usage#model-based-resource-references).
241
+ :::
242
+
211
243
  ## Model Template
212
244
 
213
245
  ```typescript
@@ -18,7 +18,8 @@ Services contain the core business logic of your application. They orchestrate t
18
18
  To create a service, you extend the `BaseService` class and inject the repositories or other services it depends on.
19
19
 
20
20
  ```typescript
21
- import { BaseService, inject, getError } from '@venizia/ignis';
21
+ import { BaseService, inject } from '@venizia/ignis';
22
+ import { getError } from '@venizia/ignis-helpers';
22
23
  import { ConfigurationRepository } from '../repositories';
23
24
  import { UserRepository } from '../repositories';
24
25
  import { LoggingService } from './logging.service'; // Example of another service
@@ -84,11 +84,11 @@ import {
84
84
  BaseController,
85
85
  controller,
86
86
  get,
87
- HTTP,
88
87
  IApplicationInfo,
89
88
  jsonContent,
90
89
  SwaggerComponent,
91
90
  } from "@venizia/ignis";
91
+ import { HTTP } from "@venizia/ignis-helpers";
92
92
  import { Context } from "hono";
93
93
  import appInfo from "./../package.json";
94
94
 
@@ -647,7 +647,8 @@ For complex validation or business rules, create a Service layer:
647
647
 
648
648
  ```typescript
649
649
  // src/services/todo.service.ts
650
- import { BaseService, inject, getError } from '@venizia/ignis';
650
+ import { BaseService, inject } from '@venizia/ignis';
651
+ import { getError } from '@venizia/ignis-helpers';
651
652
  import { TodoRepository } from '@/repositories/todo.repository';
652
653
 
653
654
  export class TodoService extends BaseService {
@@ -259,9 +259,9 @@ import {
259
259
  BaseController,
260
260
  controller,
261
261
  api,
262
- HTTP,
263
262
  jsonContent,
264
263
  } from '@venizia/ignis';
264
+ import { HTTP } from '@venizia/ignis-helpers';
265
265
  import { z } from '@hono/zod-openapi';
266
266
  import { Context } from 'hono';
267
267
 
@@ -326,7 +326,7 @@ Create `src/index.ts` - this starts your application:
326
326
 
327
327
  ```typescript
328
328
  import { Application, appConfigs } from './application';
329
- import { LoggerFactory } from '@venizia/ignis';
329
+ import { LoggerFactory } from '@venizia/ignis-helpers';
330
330
 
331
331
  const logger = LoggerFactory.getLogger(['main']);
332
332
 
@@ -922,10 +922,10 @@ import {
922
922
  controller,
923
923
  get,
924
924
  inject,
925
- HTTP,
926
925
  jsonContent,
927
926
  TRouteContext,
928
927
  } from '@venizia/ignis';
928
+ import { HTTP } from '@venizia/ignis-helpers';
929
929
  import { ProductService } from '../services/product.service';
930
930
 
931
931
  // Define route configs with PascalCase type and SCREAMING_SNAKE_CASE keys
@@ -1013,10 +1013,10 @@ import {
1013
1013
  put,
1014
1014
  del,
1015
1015
  inject,
1016
- HTTP,
1017
1016
  jsonContent,
1018
1017
  TRouteContext,
1019
1018
  } from '@venizia/ignis';
1019
+ import { HTTP } from '@venizia/ignis-helpers';
1020
1020
  import { CartService } from '../services/cart.service';
1021
1021
 
1022
1022
  const CartRoutes = {
@@ -1150,10 +1150,10 @@ import {
1150
1150
  get,
1151
1151
  post,
1152
1152
  inject,
1153
- HTTP,
1154
1153
  jsonContent,
1155
1154
  TRouteContext,
1156
1155
  } from '@venizia/ignis';
1156
+ import { HTTP } from '@venizia/ignis-helpers';
1157
1157
  import { OrderService } from '../services/order.service';
1158
1158
 
1159
1159
  const OrderRoutes = {
@@ -448,11 +448,10 @@ import {
448
448
  CoreBindings,
449
449
  inject,
450
450
  SocketIOBindingKeys,
451
- SocketIOServerHelper,
452
451
  BindingKeys,
453
452
  BindingNamespaces,
454
453
  } from '@venizia/ignis';
455
- import { ISocketIOClient, getError } from '@venizia/ignis-helpers';
454
+ import { ISocketIOClient, getError, SocketIOServerHelper } from '@venizia/ignis-helpers';
456
455
  import { Socket } from 'socket.io';
457
456
  import { MessageRepository } from '../repositories/message.repository';
458
457
  import { RoomRepository } from '../repositories/room.repository';
@@ -938,19 +937,21 @@ The application binds Redis, authentication, and the client connected handler vi
938
937
  ```typescript
939
938
  // src/application.ts
940
939
  import {
941
- applicationEnvironment,
942
940
  BaseApplication,
943
941
  BindingKeys,
944
942
  BindingNamespaces,
945
943
  IApplicationConfigs,
946
944
  IApplicationInfo,
947
- ISocketIOServerBaseOptions,
948
- RedisHelper,
949
945
  SocketIOBindingKeys,
950
946
  SocketIOComponent,
951
- SocketIOServerHelper,
952
947
  ValueOrPromise,
953
948
  } from '@venizia/ignis';
949
+ import {
950
+ applicationEnvironment,
951
+ type ISocketIOServerBaseOptions,
952
+ RedisHelper,
953
+ SocketIOServerHelper,
954
+ } from '@venizia/ignis-helpers';
954
955
  import { ChatService } from './services/chat.service';
955
956
  import { ChatController } from './controllers/chat.controller';
956
957
  import { UserRepository } from './repositories/user.repository';
package/wiki/index.md CHANGED
@@ -64,7 +64,8 @@ bun add -d typescript @types/bun
64
64
  ```
65
65
 
66
66
  ```typescript
67
- import { BaseApplication, BaseController, controller, get, HTTP, jsonContent, SwaggerComponent } from '@venizia/ignis';
67
+ import { BaseApplication, BaseController, controller, get, jsonContent, SwaggerComponent } from '@venizia/ignis';
68
+ import { HTTP } from '@venizia/ignis-helpers';
68
69
  import { z } from '@hono/zod-openapi';
69
70
 
70
71
  // 1. Define your controller
@@ -49,6 +49,34 @@ Extends `AbstractApplication` with concrete lifecycle implementations and resour
49
49
  | `repository(MyRepository, opts?)`| `repositories.MyRepository` (default) or custom key via `opts.binding` |
50
50
  | `dataSource(MyDataSource, opts?)`| `datasources.MyDataSource` (default) or custom key via `opts.binding` |
51
51
 
52
+ > [!TIP]
53
+ > All registration methods accept an optional `opts.binding` parameter to override the default namespace-based key:
54
+ > ```typescript
55
+ > this.controller(UserController, {
56
+ > binding: { namespace: 'controllers', key: 'CustomUserController' },
57
+ > });
58
+ > ```
59
+
60
+ ### registerDynamicBindings
61
+
62
+ Protected method for handling late-registration and circular dependency patterns. Iterates bindings in a namespace, configuring each instance and re-fetching to pick up dynamically added bindings.
63
+
64
+ ```typescript
65
+ protected async registerDynamicBindings<T extends IConfigurable>(opts: {
66
+ namespace: TBindingNamespace;
67
+ onBeforeConfigure?: (opts: { binding: Binding<T> }) => Promise<void>;
68
+ onAfterConfigure?: (opts: { binding: Binding<T>; instance: T }) => Promise<void>;
69
+ }): Promise<void>
70
+ ```
71
+
72
+ | Parameter | Type | Description |
73
+ |-----------|------|-------------|
74
+ | `namespace` | `TBindingNamespace` | Binding namespace to scan (e.g., `'components'`, `'controllers'`) |
75
+ | `onBeforeConfigure` | callback | Called before each binding's `configure()` — use for validation |
76
+ | `onAfterConfigure` | callback | Called after `configure()` — use for route mounting, post-setup |
77
+
78
+ The method tracks already-configured bindings to prevent duplicates and re-fetches after each configuration to handle bindings registered during the configure phase.
79
+
52
80
  ### `initialize()` Method Flow
53
81
 
54
82
  Startup sequence executed by the `initialize()` method:
@@ -306,7 +306,8 @@ export class HealthCheckComponent extends BaseComponent {
306
306
 
307
307
  ```typescript
308
308
  // src/components/auth/authenticate/component.ts
309
- import { BaseApplication, BaseComponent, inject, CoreBindings, Binding, ValueOrPromise, getError } from '@venizia/ignis';
309
+ import { BaseApplication, BaseComponent, inject, CoreBindings, Binding, ValueOrPromise } from '@venizia/ignis';
310
+ import { getError } from '@venizia/ignis-helpers';
310
311
  import { AuthenticateBindingKeys, IAuthenticateOptions, IBasicTokenServiceOptions, IJWTTokenServiceOptions } from './common';
311
312
  import { BasicTokenService, JWTTokenService } from './services';
312
313
  import { defineAuthController } from './controllers';