@venizia/ignis-docs 0.0.7 → 0.0.8-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-server/common/paths.d.ts +4 -2
- package/dist/mcp-server/common/paths.d.ts.map +1 -1
- package/dist/mcp-server/common/paths.js +8 -6
- package/dist/mcp-server/common/paths.js.map +1 -1
- package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts +1 -1
- package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/docs/get-document-content.tool.js +7 -7
- package/dist/mcp-server/tools/docs/get-document-metadata.tool.js +3 -3
- package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts +1 -1
- package/dist/mcp-server/tools/docs/get-package-overview.tool.js +1 -1
- package/package.json +1 -1
- package/wiki/best-practices/api-usage-examples.md +9 -9
- package/wiki/best-practices/architectural-patterns.md +19 -3
- package/wiki/best-practices/architecture-decisions.md +6 -6
- package/wiki/best-practices/code-style-standards/advanced-patterns.md +1 -1
- package/wiki/best-practices/code-style-standards/control-flow.md +1 -1
- package/wiki/best-practices/code-style-standards/function-patterns.md +2 -2
- package/wiki/best-practices/code-style-standards/index.md +2 -2
- package/wiki/best-practices/code-style-standards/naming-conventions.md +1 -1
- package/wiki/best-practices/code-style-standards/route-definitions.md +4 -4
- package/wiki/best-practices/data-modeling.md +1 -1
- package/wiki/best-practices/deployment-strategies.md +1 -1
- package/wiki/best-practices/error-handling.md +2 -2
- package/wiki/best-practices/performance-optimization.md +3 -3
- package/wiki/best-practices/security-guidelines.md +2 -2
- package/wiki/best-practices/troubleshooting-tips.md +1 -1
- package/wiki/{references → extensions}/components/authentication/api.md +12 -20
- package/wiki/{references → extensions}/components/authentication/errors.md +1 -1
- package/wiki/{references → extensions}/components/authentication/index.md +5 -8
- package/wiki/{references → extensions}/components/authentication/usage.md +20 -36
- package/wiki/{references → extensions}/components/authorization/api.md +62 -13
- package/wiki/{references → extensions}/components/authorization/errors.md +12 -7
- package/wiki/{references → extensions}/components/authorization/index.md +93 -6
- package/wiki/{references → extensions}/components/authorization/usage.md +42 -4
- package/wiki/{references → extensions}/components/health-check.md +5 -4
- package/wiki/{references → extensions}/components/index.md +2 -0
- package/wiki/{references → extensions}/components/mail/index.md +1 -1
- package/wiki/{references → extensions}/components/request-tracker.md +1 -1
- package/wiki/{references → extensions}/components/socket-io/api.md +2 -2
- package/wiki/{references → extensions}/components/socket-io/errors.md +2 -0
- package/wiki/{references → extensions}/components/socket-io/index.md +24 -20
- package/wiki/{references → extensions}/components/socket-io/usage.md +2 -2
- package/wiki/{references → extensions}/components/static-asset/api.md +14 -15
- package/wiki/{references → extensions}/components/static-asset/errors.md +3 -1
- package/wiki/{references → extensions}/components/static-asset/index.md +158 -89
- package/wiki/{references → extensions}/components/static-asset/usage.md +8 -5
- package/wiki/{references → extensions}/components/swagger.md +3 -3
- package/wiki/{references → extensions}/components/template/index.md +4 -4
- package/wiki/{references → extensions}/components/template/setup-page.md +1 -1
- package/wiki/{references → extensions}/components/template/single-page.md +1 -1
- package/wiki/{references → extensions}/components/websocket/api.md +7 -6
- package/wiki/{references → extensions}/components/websocket/errors.md +17 -3
- package/wiki/{references → extensions}/components/websocket/index.md +17 -11
- package/wiki/{references → extensions}/components/websocket/usage.md +2 -2
- package/wiki/{references → extensions}/helpers/crypto/index.md +1 -1
- package/wiki/{references → extensions}/helpers/env/index.md +9 -5
- package/wiki/{references → extensions}/helpers/error/index.md +2 -7
- package/wiki/{references → extensions}/helpers/index.md +18 -6
- package/wiki/{references → extensions}/helpers/kafka/admin.md +13 -1
- package/wiki/{references → extensions}/helpers/kafka/consumer.md +28 -28
- package/wiki/{references → extensions}/helpers/kafka/examples.md +19 -19
- package/wiki/{references → extensions}/helpers/kafka/index.md +51 -48
- package/wiki/{references → extensions}/helpers/kafka/producer.md +18 -18
- package/wiki/{references → extensions}/helpers/kafka/schema-registry.md +25 -25
- package/wiki/{references → extensions}/helpers/logger/index.md +2 -2
- package/wiki/{references → extensions}/helpers/queue/index.md +400 -4
- package/wiki/{references → extensions}/helpers/storage/api.md +170 -10
- package/wiki/{references → extensions}/helpers/storage/index.md +44 -8
- package/wiki/{references → extensions}/helpers/template/index.md +1 -1
- package/wiki/{references → extensions}/helpers/testing/index.md +4 -4
- package/wiki/{references → extensions}/helpers/types/index.md +63 -16
- package/wiki/{references → extensions}/helpers/websocket/index.md +1 -1
- package/wiki/extensions/index.md +48 -0
- package/wiki/guides/core-concepts/application/bootstrapping.md +55 -37
- package/wiki/guides/core-concepts/application/index.md +95 -35
- package/wiki/guides/core-concepts/components-guide.md +23 -19
- package/wiki/guides/core-concepts/components.md +34 -10
- package/wiki/guides/core-concepts/dependency-injection.md +99 -34
- package/wiki/guides/core-concepts/grpc-controllers.md +295 -0
- package/wiki/guides/core-concepts/persistent/datasources.md +27 -8
- package/wiki/guides/core-concepts/persistent/models.md +43 -1
- package/wiki/guides/core-concepts/persistent/repositories.md +75 -8
- package/wiki/guides/core-concepts/persistent/transactions.md +38 -8
- package/wiki/guides/core-concepts/{controllers.md → rest-controllers.md} +30 -33
- package/wiki/guides/core-concepts/services.md +19 -5
- package/wiki/guides/get-started/5-minute-quickstart.md +6 -7
- package/wiki/guides/get-started/philosophy.md +1 -1
- package/wiki/guides/index.md +2 -2
- package/wiki/guides/reference/glossary.md +7 -7
- package/wiki/guides/reference/mcp-docs-server.md +1 -1
- package/wiki/guides/tutorials/building-a-crud-api.md +2 -2
- package/wiki/guides/tutorials/complete-installation.md +17 -14
- package/wiki/guides/tutorials/ecommerce-api.md +18 -18
- package/wiki/guides/tutorials/realtime-chat.md +8 -8
- package/wiki/guides/tutorials/testing.md +2 -2
- package/wiki/index.md +4 -3
- package/wiki/references/base/application.md +341 -21
- package/wiki/references/base/bootstrapping.md +43 -13
- package/wiki/references/base/components.md +259 -8
- package/wiki/references/base/controllers.md +556 -253
- package/wiki/references/base/datasources.md +159 -79
- package/wiki/references/base/dependency-injection.md +299 -48
- package/wiki/references/base/filter-system/application-usage.md +18 -2
- package/wiki/references/base/filter-system/array-operators.md +14 -6
- package/wiki/references/base/filter-system/comparison-operators.md +9 -3
- package/wiki/references/base/filter-system/default-filter.md +28 -3
- package/wiki/references/base/filter-system/fields-order-pagination.md +17 -13
- package/wiki/references/base/filter-system/index.md +169 -11
- package/wiki/references/base/filter-system/json-filtering.md +51 -18
- package/wiki/references/base/filter-system/list-operators.md +4 -3
- package/wiki/references/base/filter-system/logical-operators.md +7 -2
- package/wiki/references/base/filter-system/null-operators.md +50 -0
- package/wiki/references/base/filter-system/quick-reference.md +82 -243
- package/wiki/references/base/filter-system/range-operators.md +7 -1
- package/wiki/references/base/filter-system/tips.md +34 -7
- package/wiki/references/base/filter-system/use-cases.md +6 -5
- package/wiki/references/base/grpc-controllers.md +984 -0
- package/wiki/references/base/index.md +32 -24
- package/wiki/references/base/middleware.md +347 -0
- package/wiki/references/base/models.md +390 -46
- package/wiki/references/base/providers.md +14 -14
- package/wiki/references/base/repositories/advanced.md +84 -69
- package/wiki/references/base/repositories/index.md +447 -12
- package/wiki/references/base/repositories/mixins.md +103 -98
- package/wiki/references/base/repositories/relations.md +129 -45
- package/wiki/references/base/repositories/soft-deletable.md +104 -23
- package/wiki/references/base/services.md +94 -14
- package/wiki/references/index.md +12 -10
- package/wiki/references/quick-reference.md +98 -65
- package/wiki/references/utilities/crypto.md +21 -4
- package/wiki/references/utilities/date.md +25 -7
- package/wiki/references/utilities/index.md +26 -24
- package/wiki/references/utilities/jsx.md +54 -54
- package/wiki/references/utilities/module.md +8 -6
- package/wiki/references/utilities/parse.md +16 -9
- package/wiki/references/utilities/performance.md +22 -7
- package/wiki/references/utilities/promise.md +19 -16
- package/wiki/references/utilities/request.md +48 -26
- package/wiki/references/utilities/schema.md +69 -6
- package/wiki/references/utilities/statuses.md +131 -140
- /package/wiki/{references → extensions}/components/mail/api.md +0 -0
- /package/wiki/{references → extensions}/components/mail/errors.md +0 -0
- /package/wiki/{references → extensions}/components/mail/usage.md +0 -0
- /package/wiki/{references → extensions}/components/template/api-page.md +0 -0
- /package/wiki/{references → extensions}/components/template/errors-page.md +0 -0
- /package/wiki/{references → extensions}/components/template/usage-page.md +0 -0
- /package/wiki/{references → extensions}/helpers/cron/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/inversion/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/network/api.md +0 -0
- /package/wiki/{references → extensions}/helpers/network/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/redis/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/socket-io/api.md +0 -0
- /package/wiki/{references → extensions}/helpers/socket-io/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/template/single-page.md +0 -0
- /package/wiki/{references → extensions}/helpers/uid/index.md +0 -0
- /package/wiki/{references → extensions}/helpers/websocket/api.md +0 -0
- /package/wiki/{references → extensions}/helpers/worker-thread/index.md +0 -0
- /package/wiki/{references → extensions}/src-details/mcp-server.md +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export declare class Paths {
|
|
2
2
|
static readonly WIKI: string;
|
|
3
|
+
static readonly GUIDES: string;
|
|
3
4
|
static readonly GET_STARTED: string;
|
|
4
|
-
static readonly BEST_PRACTICES: string;
|
|
5
5
|
static readonly CORE_CONCEPTS: string;
|
|
6
|
+
static readonly BEST_PRACTICES: string;
|
|
6
7
|
static readonly REFERENCES: string;
|
|
7
8
|
static readonly BASE: string;
|
|
9
|
+
static readonly UTILITIES: string;
|
|
10
|
+
static readonly EXTENSIONS: string;
|
|
8
11
|
static readonly COMPONENTS: string;
|
|
9
12
|
static readonly HELPERS: string;
|
|
10
13
|
static readonly SOURCE_DETAILS: string;
|
|
11
|
-
static readonly UTILITIES: string;
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../mcp-server/common/paths.ts"],"names":[],"mappings":"AAOA,qBAAa,KAAK;IAChB,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAgC;IAEpD,MAAM,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../mcp-server/common/paths.ts"],"names":[],"mappings":"AAOA,qBAAa,KAAK;IAChB,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAgC;IAEpD,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAkC;IACxD,MAAM,CAAC,QAAQ,CAAC,WAAW,SAAyC;IACpE,MAAM,CAAC,QAAQ,CAAC,aAAa,SAA2C;IACxE,MAAM,CAAC,QAAQ,CAAC,cAAc,SAA0C;IAExE,MAAM,CAAC,QAAQ,CAAC,UAAU,SAAsC;IAChE,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAsC;IAC1D,MAAM,CAAC,QAAQ,CAAC,SAAS,SAA2C;IAEpE,MAAM,CAAC,QAAQ,CAAC,UAAU,SAAsC;IAChE,MAAM,CAAC,QAAQ,CAAC,UAAU,SAA4C;IACtE,MAAM,CAAC,QAAQ,CAAC,OAAO,SAAyC;IAChE,MAAM,CAAC,QAAQ,CAAC,cAAc,SAA6C;CAC5E"}
|
|
@@ -11,15 +11,17 @@ const MCP_ROOT = __dirname;
|
|
|
11
11
|
const DOCS_ROOT = node_path_1.default.resolve(MCP_ROOT, '..', '..', '..');
|
|
12
12
|
class Paths {
|
|
13
13
|
static { this.WIKI = node_path_1.default.join(DOCS_ROOT, 'wiki'); }
|
|
14
|
-
static { this.
|
|
15
|
-
static { this.
|
|
16
|
-
static { this.CORE_CONCEPTS = node_path_1.default.join(this.
|
|
14
|
+
static { this.GUIDES = node_path_1.default.join(this.WIKI, 'guides'); }
|
|
15
|
+
static { this.GET_STARTED = node_path_1.default.join(this.GUIDES, 'get-started'); }
|
|
16
|
+
static { this.CORE_CONCEPTS = node_path_1.default.join(this.GUIDES, 'core-concepts'); }
|
|
17
|
+
static { this.BEST_PRACTICES = node_path_1.default.join(this.WIKI, 'best-practices'); }
|
|
17
18
|
static { this.REFERENCES = node_path_1.default.join(this.WIKI, 'references'); }
|
|
18
19
|
static { this.BASE = node_path_1.default.join(this.REFERENCES, 'base'); }
|
|
19
|
-
static { this.COMPONENTS = node_path_1.default.join(this.REFERENCES, 'components'); }
|
|
20
|
-
static { this.HELPERS = node_path_1.default.join(this.REFERENCES, 'helpers'); }
|
|
21
|
-
static { this.SOURCE_DETAILS = node_path_1.default.join(this.REFERENCES, 'src-details'); }
|
|
22
20
|
static { this.UTILITIES = node_path_1.default.join(this.REFERENCES, 'utilities'); }
|
|
21
|
+
static { this.EXTENSIONS = node_path_1.default.join(this.WIKI, 'extensions'); }
|
|
22
|
+
static { this.COMPONENTS = node_path_1.default.join(this.EXTENSIONS, 'components'); }
|
|
23
|
+
static { this.HELPERS = node_path_1.default.join(this.EXTENSIONS, 'helpers'); }
|
|
24
|
+
static { this.SOURCE_DETAILS = node_path_1.default.join(this.EXTENSIONS, 'src-details'); }
|
|
23
25
|
}
|
|
24
26
|
exports.Paths = Paths;
|
|
25
27
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../mcp-server/common/paths.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,qDAAqD;AACrD,6EAA6E;AAC7E,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE3D,MAAa,KAAK;aACA,SAAI,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aAEpC,
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../mcp-server/common/paths.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,qDAAqD;AACrD,6EAA6E;AAC7E,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE3D,MAAa,KAAK;aACA,SAAI,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aAEpC,WAAM,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;aACxC,gBAAW,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;aACpD,kBAAa,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;aACxD,mBAAc,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;aAExD,eAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;aAChD,SAAI,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;aAC1C,cAAS,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;aAEpD,eAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;aAChD,eAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;aACtD,YAAO,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;aAChD,mBAAc,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;;AAf7E,sBAgBC"}
|
|
@@ -10,7 +10,7 @@ declare const OutputSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare class GetDocContentTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
12
12
|
readonly id = "getDocumentContent";
|
|
13
|
-
readonly description = "\nRetrieves the complete markdown content of a specific Ignis Framework documentation file.\n\nPURPOSE:\nUse this tool to fetch the full text of a documentation page when you need detailed information\nbeyond what search snippets provide. This is your primary tool for reading documentation content.\n\nWHEN TO USE:\n- After searchDocs returns relevant results and you need full content\n- When user asks for detailed explanation of a specific topic\n- To read code examples, API references, or configuration guides\n- When you need to quote or reference specific documentation sections\n\nWHEN NOT TO USE:\n- Don't use this for discovery - use searchDocs or listDocs first\n- Don't fetch multiple documents blindly - review search results first\n\nDOCUMENT ID FORMAT:\nThe 'id' parameter is the relative file path from the wiki root:\n- \"get-started/quickstart.md\" - Quickstart guide\n- \"
|
|
13
|
+
readonly description = "\nRetrieves the complete markdown content of a specific Ignis Framework documentation file.\n\nPURPOSE:\nUse this tool to fetch the full text of a documentation page when you need detailed information\nbeyond what search snippets provide. This is your primary tool for reading documentation content.\n\nWHEN TO USE:\n- After searchDocs returns relevant results and you need full content\n- When user asks for detailed explanation of a specific topic\n- To read code examples, API references, or configuration guides\n- When you need to quote or reference specific documentation sections\n\nWHEN NOT TO USE:\n- Don't use this for discovery - use searchDocs or listDocs first\n- Don't fetch multiple documents blindly - review search results first\n\nDOCUMENT ID FORMAT:\nThe 'id' parameter is the relative file path from the wiki root:\n- \"guides/get-started/5-minute-quickstart.md\" - Quickstart guide\n- \"extensions/helpers/redis/index.md\" - Redis helper reference\n- \"references/base/dependency-injection.md\" - DI reference\n\nHOW TO GET VALID IDs:\n1. Use searchDocs to find documents by keyword\n2. Use listDocs to browse all available documents\n3. Use listCategories + listDocs(category) for structured browsing\n\nOUTPUT:\nReturns full markdown content suitable for:\n- Answering user questions with accurate information\n- Extracting code examples\n- Understanding API usage patterns\n- Providing step-by-step guidance\n";
|
|
14
14
|
readonly inputSchema: z.ZodObject<{
|
|
15
15
|
id: z.ZodString;
|
|
16
16
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-document-content.tool.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/get-document-content.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA6ExC,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;iBAOhB,CAAC;AAEH,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACtF,QAAQ,CAAC,EAAE,wBAAwB;IACnC,QAAQ,CAAC,WAAW
|
|
1
|
+
{"version":3,"file":"get-document-content.tool.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/get-document-content.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA6ExC,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;iBAOhB,CAAC;AAEH,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACtF,QAAQ,CAAC,EAAE,wBAAwB;IACnC,QAAQ,CAAC,WAAW,+5CAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;sBAAgB;IAE/B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAUvF,OAAO;;;;;;;CASR"}
|
|
@@ -24,9 +24,9 @@ WHEN NOT TO USE:
|
|
|
24
24
|
|
|
25
25
|
DOCUMENT ID FORMAT:
|
|
26
26
|
The 'id' parameter is the relative file path from the wiki root:
|
|
27
|
-
- "get-started/quickstart.md" - Quickstart guide
|
|
28
|
-
- "
|
|
29
|
-
- "
|
|
27
|
+
- "guides/get-started/5-minute-quickstart.md" - Quickstart guide
|
|
28
|
+
- "extensions/helpers/redis/index.md" - Redis helper reference
|
|
29
|
+
- "references/base/dependency-injection.md" - DI reference
|
|
30
30
|
|
|
31
31
|
HOW TO GET VALID IDs:
|
|
32
32
|
1. Use searchDocs to find documents by keyword
|
|
@@ -46,10 +46,10 @@ Unique document identifier - the relative file path from the wiki root directory
|
|
|
46
46
|
FORMAT: "<category>/<subcategory>/<filename>.md"
|
|
47
47
|
|
|
48
48
|
EXAMPLES:
|
|
49
|
-
- "get-started/quickstart.md"
|
|
50
|
-
- "
|
|
51
|
-
- "
|
|
52
|
-
- "
|
|
49
|
+
- "guides/get-started/5-minute-quickstart.md"
|
|
50
|
+
- "references/base/dependency-injection.md"
|
|
51
|
+
- "extensions/helpers/redis/index.md"
|
|
52
|
+
- "extensions/components/authentication/index.md"
|
|
53
53
|
|
|
54
54
|
HOW TO OBTAIN:
|
|
55
55
|
- From searchDocs results (the 'id' field)
|
|
@@ -52,9 +52,9 @@ Unique document identifier - the relative file path from the wiki root directory
|
|
|
52
52
|
FORMAT: "<category>/<subcategory>/<filename>.md"
|
|
53
53
|
|
|
54
54
|
EXAMPLES:
|
|
55
|
-
- "get-started/quickstart.md"
|
|
56
|
-
- "
|
|
57
|
-
- "
|
|
55
|
+
- "guides/get-started/5-minute-quickstart.md"
|
|
56
|
+
- "extensions/helpers/redis/index.md"
|
|
57
|
+
- "references/base/dependency-injection.md"
|
|
58
58
|
|
|
59
59
|
HOW TO OBTAIN:
|
|
60
60
|
- From searchDocs results (the 'id' field)
|
|
@@ -18,7 +18,7 @@ declare const OutputSchema: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
export declare class GetPackageOverviewTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
20
20
|
readonly id = "getPackageOverview";
|
|
21
|
-
readonly description = "\nReturns an overview of Ignis packages from the source details documentation.\n\nPURPOSE:\nProvides AI agents with comprehensive understanding of the Ignis monorepo structure,\npackage purposes, main exports, and directory layouts. This is essential for helping\nusers understand which package to use for specific features.\n\nWHEN TO USE:\n- When user asks \"what packages does Ignis have?\"\n- When user needs to understand project structure\n- When user asks which package provides a specific feature\n- Before helping user implement a feature (to know where code should go)\n- When user asks about imports or package dependencies\n\nWHEN NOT TO USE:\n- For specific API documentation (use getDocContent with references/ docs)\n- For code examples (use searchCode or getDocContent)\n- For troubleshooting (use searchDocs)\n\nOUTPUT:\nReturns package name, description, main directories, and key components.\nThe content comes from wiki/
|
|
21
|
+
readonly description = "\nReturns an overview of Ignis packages from the source details documentation.\n\nPURPOSE:\nProvides AI agents with comprehensive understanding of the Ignis monorepo structure,\npackage purposes, main exports, and directory layouts. This is essential for helping\nusers understand which package to use for specific features.\n\nWHEN TO USE:\n- When user asks \"what packages does Ignis have?\"\n- When user needs to understand project structure\n- When user asks which package provides a specific feature\n- Before helping user implement a feature (to know where code should go)\n- When user asks about imports or package dependencies\n\nWHEN NOT TO USE:\n- For specific API documentation (use getDocContent with references/ docs)\n- For code examples (use searchCode or getDocContent)\n- For troubleshooting (use searchDocs)\n\nOUTPUT:\nReturns package name, description, main directories, and key components.\nThe content comes from wiki/extensions/src-details/ documentation.\n";
|
|
22
22
|
readonly inputSchema: z.ZodObject<{
|
|
23
23
|
packageName: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, z.core.$strip>;
|
|
@@ -35,7 +35,7 @@ WHEN NOT TO USE:
|
|
|
35
35
|
|
|
36
36
|
OUTPUT:
|
|
37
37
|
Returns package name, description, main directories, and key components.
|
|
38
|
-
The content comes from wiki/
|
|
38
|
+
The content comes from wiki/extensions/src-details/ documentation.
|
|
39
39
|
`;
|
|
40
40
|
const PACKAGE_NAME_DESCRIPTION = `
|
|
41
41
|
Optional: Name of specific package to get details for.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-docs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-0",
|
|
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",
|
|
@@ -48,7 +48,7 @@ Then, use the decorators in your controller class.
|
|
|
48
48
|
**`src/controllers/test/controller.ts`**
|
|
49
49
|
```typescript
|
|
50
50
|
import {
|
|
51
|
-
|
|
51
|
+
BaseRestController,
|
|
52
52
|
controller,
|
|
53
53
|
get,
|
|
54
54
|
post,
|
|
@@ -57,8 +57,8 @@ import {
|
|
|
57
57
|
import { HTTP } from '@venizia/ignis-helpers';
|
|
58
58
|
import { RouteConfigs } from './definitions';
|
|
59
59
|
|
|
60
|
-
@controller({ path: '/test' })
|
|
61
|
-
export class TestController extends
|
|
60
|
+
@controller({ path: '/test' }) // transport defaults to 'rest'
|
|
61
|
+
export class TestController extends BaseRestController {
|
|
62
62
|
// ...
|
|
63
63
|
|
|
64
64
|
@get({ configs: RouteConfigs.GET_TEST })
|
|
@@ -91,12 +91,12 @@ You can also define routes manually within the controller's `binding()` method u
|
|
|
91
91
|
|
|
92
92
|
**`src/controllers/test/controller.ts`**
|
|
93
93
|
```typescript
|
|
94
|
-
import {
|
|
94
|
+
import { BaseRestController, controller, ValueOrPromise } from '@venizia/ignis';
|
|
95
95
|
import { HTTP } from '@venizia/ignis-helpers';
|
|
96
96
|
import { RouteConfigs } from './definitions';
|
|
97
97
|
|
|
98
98
|
@controller({ path: '/test' })
|
|
99
|
-
export class TestController extends
|
|
99
|
+
export class TestController extends BaseRestController {
|
|
100
100
|
// ...
|
|
101
101
|
override binding(): ValueOrPromise<void> {
|
|
102
102
|
// Using 'defineRoute'
|
|
@@ -236,10 +236,10 @@ Ignis supports server-side rendering using Hono's JSX middleware. This is useful
|
|
|
236
236
|
Use `defineJSXRoute` in your controller and `htmlResponse` for documentation.
|
|
237
237
|
|
|
238
238
|
```typescript
|
|
239
|
-
import {
|
|
239
|
+
import { BaseRestController, controller, htmlResponse } from '@venizia/ignis';
|
|
240
240
|
|
|
241
241
|
@controller({ path: '/pages' })
|
|
242
|
-
export class PageController extends
|
|
242
|
+
export class PageController extends BaseRestController {
|
|
243
243
|
|
|
244
244
|
override binding(): void {
|
|
245
245
|
this.defineJSXRoute({
|
|
@@ -330,7 +330,7 @@ Apply middleware to specific routes in your controller:
|
|
|
330
330
|
|
|
331
331
|
```typescript
|
|
332
332
|
@controller({ path: '/admin' })
|
|
333
|
-
export class AdminController extends
|
|
333
|
+
export class AdminController extends BaseRestController {
|
|
334
334
|
constructor() {
|
|
335
335
|
super({ scope: AdminController.name, path: '/admin' });
|
|
336
336
|
}
|
|
@@ -412,7 +412,7 @@ export class UserService extends BaseService {
|
|
|
412
412
|
|
|
413
413
|
```typescript
|
|
414
414
|
@controller({ path: '/users' })
|
|
415
|
-
export class UserController extends
|
|
415
|
+
export class UserController extends BaseRestController {
|
|
416
416
|
constructor(
|
|
417
417
|
@inject({
|
|
418
418
|
key: BindingKeys.build({
|
|
@@ -10,7 +10,7 @@ Each layer has a single responsibility. Ignis supports **two architectural appro
|
|
|
10
10
|
graph TD
|
|
11
11
|
Client[Client/API Consumer]
|
|
12
12
|
|
|
13
|
-
Client -->|HTTP Request| Controller[Controllers]
|
|
13
|
+
Client -->|HTTP/gRPC Request| Controller[Controllers]
|
|
14
14
|
|
|
15
15
|
Controller -->|Simple CRUD| Repo[Repositories]
|
|
16
16
|
Controller -->|Complex Logic| Service[Services]
|
|
@@ -27,7 +27,7 @@ graph TD
|
|
|
27
27
|
|
|
28
28
|
| Layer | Responsibility | Example |
|
|
29
29
|
|-------|---------------|---------|
|
|
30
|
-
| **Controllers** | Handle HTTP - parse requests, validate, format responses | `ConfigurationController` (
|
|
30
|
+
| **Controllers** | Handle HTTP/gRPC - parse requests, validate, format responses | `ConfigurationController` (REST), `GreeterController` (gRPC) |
|
|
31
31
|
| **Services** | Business logic - orchestrate operations | `AuthenticationService` (auth logic) |
|
|
32
32
|
| **Repositories** | Data access - CRUD operations | `ConfigurationRepository` (extends `DefaultCRUDRepository`) |
|
|
33
33
|
| **DataSources** | Database connections | `PostgresDataSource` (connects to PostgreSQL) |
|
|
@@ -79,7 +79,7 @@ Classes declare dependencies in their constructor - the framework automatically
|
|
|
79
79
|
- Easy to test (mock dependencies)
|
|
80
80
|
- Easy to swap implementations
|
|
81
81
|
|
|
82
|
-
**Example:**
|
|
82
|
+
**Example (REST controller):**
|
|
83
83
|
```typescript
|
|
84
84
|
@controller({ path: BASE_PATH })
|
|
85
85
|
export class ConfigurationController extends _Controller {
|
|
@@ -99,6 +99,22 @@ export class ConfigurationController extends _Controller {
|
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
**Controller Transports:**
|
|
103
|
+
|
|
104
|
+
The `@controller` decorator supports a `transport` field to distinguish between REST and gRPC controllers:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// REST controller (default - transport can be omitted)
|
|
108
|
+
@controller({ path: '/users' })
|
|
109
|
+
export class UserController extends BaseRestController { ... }
|
|
110
|
+
|
|
111
|
+
// gRPC controller (transport is required)
|
|
112
|
+
@controller({ path: '/greeter', transport: 'grpc', service: GreeterService })
|
|
113
|
+
export class GreeterController extends BaseGrpcController { ... }
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
REST controllers extend `BaseRestController`, while gRPC controllers extend `BaseGrpcController`. The application must enable the appropriate transport(s) in its configuration.
|
|
117
|
+
|
|
102
118
|
## 3. Component-Based Modularity
|
|
103
119
|
|
|
104
120
|
Components bundle a group of related, reusable, and pluggable features into self-contained modules. A single component can encapsulate multiple providers, services, controllers, and repositories, essentially functioning as a mini-application that can be easily "plugged in" to any Ignis project.
|
|
@@ -21,9 +21,9 @@ This guide helps you make informed architectural decisions when building applica
|
|
|
21
21
|
```typescript
|
|
22
22
|
// Simple CRUD with no business logic
|
|
23
23
|
@controller({ path: '/items' })
|
|
24
|
-
export class ItemController extends
|
|
24
|
+
export class ItemController extends BaseRestController {
|
|
25
25
|
constructor(
|
|
26
|
-
@inject('repositories.ItemRepository')
|
|
26
|
+
@inject({ key: 'repositories.ItemRepository' })
|
|
27
27
|
private itemRepo: ItemRepository,
|
|
28
28
|
) {
|
|
29
29
|
super({ scope: 'ItemController', path: '/items' });
|
|
@@ -48,9 +48,9 @@ export class ItemController extends BaseController {
|
|
|
48
48
|
```typescript
|
|
49
49
|
// Complex business logic needs a service
|
|
50
50
|
@controller({ path: '/orders' })
|
|
51
|
-
export class OrderController extends
|
|
51
|
+
export class OrderController extends BaseRestController {
|
|
52
52
|
constructor(
|
|
53
|
-
@inject('services.OrderService')
|
|
53
|
+
@inject({ key: 'services.OrderService' })
|
|
54
54
|
private orderService: OrderService,
|
|
55
55
|
) {
|
|
56
56
|
super({ scope: 'OrderController', path: '/orders' });
|
|
@@ -125,7 +125,7 @@ export class NotificationComponent extends BaseComponent {
|
|
|
125
125
|
```typescript
|
|
126
126
|
// Inline: Simple, one-off, no need for abstraction
|
|
127
127
|
@controller({ path: '/health' })
|
|
128
|
-
export class HealthController extends
|
|
128
|
+
export class HealthController extends BaseRestController {
|
|
129
129
|
@get({ configs: { path: '/' } })
|
|
130
130
|
healthCheck(c: Context) {
|
|
131
131
|
return c.json({ status: 'ok', timestamp: new Date() });
|
|
@@ -209,7 +209,7 @@ export class OrderRepository extends BaseRepository<Order> {
|
|
|
209
209
|
|
|
210
210
|
```typescript
|
|
211
211
|
@controller({ path: '/users' })
|
|
212
|
-
export class UserController extends
|
|
212
|
+
export class UserController extends BaseRestController {
|
|
213
213
|
@post({ configs: { path: '/' } })
|
|
214
214
|
async createUser(c: Context) {
|
|
215
215
|
try {
|
|
@@ -65,7 +65,7 @@ class ControllerFactory {
|
|
|
65
65
|
static defineCrudController<Schema extends TTableSchemaWithId>(
|
|
66
66
|
opts: ICrudControllerOptions<Schema>,
|
|
67
67
|
) {
|
|
68
|
-
return class extends
|
|
68
|
+
return class extends BaseRestController {
|
|
69
69
|
constructor(repository: AbstractRepository<Schema>) {
|
|
70
70
|
super({ scope: opts.controller.name });
|
|
71
71
|
this.repository = repository;
|
|
@@ -241,5 +241,5 @@ import { QueryBuilder } from '../query';
|
|
|
241
241
|
## See Also
|
|
242
242
|
|
|
243
243
|
- [Error Handling](../error-handling) - Comprehensive error patterns
|
|
244
|
-
- [Logging Reference](../../
|
|
244
|
+
- [Logging Reference](../../extensions/helpers/logger/) - Logger API
|
|
245
245
|
- [Function Patterns](./function-patterns) - Method organization
|
|
@@ -100,9 +100,9 @@ export class JWTTokenService extends BaseService {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export class UserController extends
|
|
103
|
+
export class UserController extends BaseRestController {
|
|
104
104
|
constructor() {
|
|
105
|
-
super({ scope: UserController.name });
|
|
105
|
+
super({ scope: UserController.name, path: '/users' });
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
```
|
|
@@ -53,9 +53,9 @@ interface IUserService { }
|
|
|
53
53
|
type TUserRequest = { };
|
|
54
54
|
|
|
55
55
|
// Classes use PascalCase with suffix
|
|
56
|
-
class UserController extends
|
|
56
|
+
class UserController extends BaseRestController { }
|
|
57
57
|
class UserService extends BaseService { }
|
|
58
|
-
class UserRepository extends
|
|
58
|
+
class UserRepository extends DefaultCRUDRepository { }
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### File Structure
|
|
@@ -121,7 +121,7 @@ export class SocketIOBindingKeys {
|
|
|
121
121
|
Use underscore prefix (`_`) for private and protected class fields to distinguish them from public fields and method parameters.
|
|
122
122
|
|
|
123
123
|
```typescript
|
|
124
|
-
class MyRepository extends
|
|
124
|
+
class MyRepository extends DefaultCRUDRepository {
|
|
125
125
|
// Private fields with underscore prefix
|
|
126
126
|
private _dataSource: IDataSource;
|
|
127
127
|
private _entity: BaseEntity;
|
|
@@ -41,7 +41,7 @@ export const RouteConfigs = {
|
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
43
|
@controller({ path: '/users' })
|
|
44
|
-
export class UserController extends
|
|
44
|
+
export class UserController extends BaseRestController {
|
|
45
45
|
|
|
46
46
|
@api({ configs: RouteConfigs.GET_USERS })
|
|
47
47
|
list(context: TRouteContext) {
|
|
@@ -60,7 +60,7 @@ export class UserController extends BaseController {
|
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
62
|
@controller({ path: '/health' })
|
|
63
|
-
export class HealthCheckController extends
|
|
63
|
+
export class HealthCheckController extends BaseRestController {
|
|
64
64
|
constructor() {
|
|
65
65
|
super({ scope: HealthCheckController.name });
|
|
66
66
|
|
|
@@ -75,7 +75,7 @@ export class HealthCheckController extends BaseController {
|
|
|
75
75
|
|
|
76
76
|
```typescript
|
|
77
77
|
@controller({ path: '/health' })
|
|
78
|
-
export class HealthCheckController extends
|
|
78
|
+
export class HealthCheckController extends BaseRestController {
|
|
79
79
|
constructor() {
|
|
80
80
|
super({ scope: HealthCheckController.name });
|
|
81
81
|
|
|
@@ -147,4 +147,4 @@ export const RouteConfigs = {
|
|
|
147
147
|
|
|
148
148
|
- [API Usage Examples](../api-usage-examples) - Full API patterns
|
|
149
149
|
- [Controllers Reference](../../references/base/controllers) - Controller API
|
|
150
|
-
- [Swagger Component](../../
|
|
150
|
+
- [Swagger Component](../../extensions/components/swagger) - OpenAPI setup
|
|
@@ -405,7 +405,7 @@ export class User extends BaseEntity<typeof User.schema> {
|
|
|
405
405
|
- Explicit `static AUTHORIZATION_SUBJECT = '...'` on the class takes precedence
|
|
406
406
|
- The `authorize` settings are extensible via index signature for custom metadata
|
|
407
407
|
|
|
408
|
-
> **Reference:** See [Model-Based Resource References](../
|
|
408
|
+
> **Reference:** See [Model-Based Resource References](../extensions/components/authorization/usage#model-based-resource-references) for full authorization integration.
|
|
409
409
|
|
|
410
410
|
## 7. Database Migrations
|
|
411
411
|
|
|
@@ -668,7 +668,7 @@ Add Prometheus metrics endpoint:
|
|
|
668
668
|
```typescript
|
|
669
669
|
// src/controllers/metrics.controller.ts
|
|
670
670
|
@controller({ path: '/metrics' })
|
|
671
|
-
export class MetricsController extends
|
|
671
|
+
export class MetricsController extends BaseRestController {
|
|
672
672
|
@get({ configs: { path: '/' } })
|
|
673
673
|
getMetrics(c: Context) {
|
|
674
674
|
return c.text(`
|
|
@@ -119,10 +119,10 @@ export class UserService extends BaseService {
|
|
|
119
119
|
Controllers should delegate to services and let the global error handler catch exceptions:
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
|
-
import {
|
|
122
|
+
import { BaseRestController, controller, get, post } from '@venizia/ignis';
|
|
123
123
|
|
|
124
124
|
@controller({ path: '/users' })
|
|
125
|
-
export class UserController extends
|
|
125
|
+
export class UserController extends BaseRestController {
|
|
126
126
|
|
|
127
127
|
@post({ configs: RouteConfigs.CREATE_USER })
|
|
128
128
|
async createUser(c: TRouteContext) {
|
|
@@ -32,7 +32,7 @@ Prevent blocking the event loop with Worker Threads:
|
|
|
32
32
|
- Large file/data processing
|
|
33
33
|
- Any synchronous task > 5ms
|
|
34
34
|
|
|
35
|
-
> **Deep Dive:** See [Worker Thread Helper](../
|
|
35
|
+
> **Deep Dive:** See [Worker Thread Helper](../extensions/helpers/worker-thread/) for implementation guide.
|
|
36
36
|
|
|
37
37
|
## 3. Optimize Database Queries
|
|
38
38
|
|
|
@@ -127,7 +127,7 @@ Reduce database load with caching:
|
|
|
127
127
|
|
|
128
128
|
| Cache Type | Use Case | Implementation |
|
|
129
129
|
|-----------|----------|----------------|
|
|
130
|
-
| **Redis** | Distributed cache, session storage | [Redis Helper](../
|
|
130
|
+
| **Redis** | Distributed cache, session storage | [Redis Helper](../extensions/helpers/redis/) |
|
|
131
131
|
| **In-Memory** | Single-process cache | `MemoryStorageHelper` |
|
|
132
132
|
|
|
133
133
|
**Example:**
|
|
@@ -390,7 +390,7 @@ logger.log('info', MSG_ORDER_FILLED);
|
|
|
390
390
|
- Use background flushing to avoid I/O blocking
|
|
391
391
|
- HfLogger uses a lock-free ring buffer (64K entries, 16MB)
|
|
392
392
|
|
|
393
|
-
> **Deep Dive:** See [Logger Helper](../
|
|
393
|
+
> **Deep Dive:** See [Logger Helper](../extensions/helpers/logger/) for complete HfLogger API.
|
|
394
394
|
|
|
395
395
|
## Performance Checklist
|
|
396
396
|
|
|
@@ -68,7 +68,7 @@ const SecureRoute = {
|
|
|
68
68
|
};
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
> **Deep Dive:** See [Authentication Component](../
|
|
71
|
+
> **Deep Dive:** See [Authentication Component](../extensions/components/authentication/) for full setup guide.
|
|
72
72
|
|
|
73
73
|
**Access user in protected routes:**
|
|
74
74
|
```typescript
|
|
@@ -463,6 +463,6 @@ Before deploying to production, verify:
|
|
|
463
463
|
|
|
464
464
|
## See Also
|
|
465
465
|
|
|
466
|
-
- [Authentication Component](../
|
|
466
|
+
- [Authentication Component](../extensions/components/authentication/) - JWT setup and configuration
|
|
467
467
|
- [Common Pitfalls](./common-pitfalls) - Security-related mistakes to avoid
|
|
468
468
|
- [Deployment Strategies](./deployment-strategies) - Secure deployment practices
|
|
@@ -118,7 +118,7 @@ cat .env | grep APP_ENV
|
|
|
118
118
|
- Use `try-catch` blocks to catch and log errors
|
|
119
119
|
- Check database queries with Drizzle's logging: `{ logger: true }`
|
|
120
120
|
|
|
121
|
-
> **Deep Dive:** See [Logger Helper](../
|
|
121
|
+
> **Deep Dive:** See [Logger Helper](../extensions/helpers/logger/) for advanced logging configuration.
|
|
122
122
|
|
|
123
123
|
## 6. Request ID Tracking
|
|
124
124
|
|
|
@@ -179,7 +179,7 @@ export const authenticate = (opts: { strategies: string[]; mode?: TAuthMode }) =
|
|
|
179
179
|
This is the primary export for creating auth middleware. It creates an `AuthenticationProvider` instance and calls `.value()` to get the middleware factory. The provider uses `AuthenticationStrategyRegistry.getInstance()` internally to resolve strategies.
|
|
180
180
|
|
|
181
181
|
> [!NOTE]
|
|
182
|
-
> In `all` mode,
|
|
182
|
+
> In `all` mode, the **first** strategy's user payload is used as the identity source — all strategies must succeed but the first one wins for identity. If every strategy passes but the first user payload has no `userId`, the middleware throws a `401` with message `"Failed to identify authenticated user!"`. The `any` mode **discards errors** from each failing strategy (logs at debug level) and only throws after all strategies are exhausted.
|
|
183
183
|
|
|
184
184
|
## Service Class Hierarchy
|
|
185
185
|
|
|
@@ -531,7 +531,7 @@ Serves the JWKS endpoint (default path `/certs`). This endpoint is **intentional
|
|
|
531
531
|
**File:** `packages/core/src/components/auth/authenticate/controllers/jwks/controller.ts`
|
|
532
532
|
|
|
533
533
|
```typescript
|
|
534
|
-
class JWKSController extends
|
|
534
|
+
class JWKSController extends BaseRestController {
|
|
535
535
|
constructor(
|
|
536
536
|
@inject({
|
|
537
537
|
key: BindingKeys.build({
|
|
@@ -646,43 +646,35 @@ type TPermissionCommonColumns = {
|
|
|
646
646
|
code: NotNull<PgTextBuilderInitial<...>>;
|
|
647
647
|
name: NotNull<PgTextBuilderInitial<...>>;
|
|
648
648
|
subject: NotNull<PgTextBuilderInitial<...>>;
|
|
649
|
-
pType: NotNull<PgTextBuilderInitial<...>>;
|
|
650
649
|
action: NotNull<PgTextBuilderInitial<...>>;
|
|
651
650
|
scope: NotNull<PgTextBuilderInitial<...>>;
|
|
652
651
|
};
|
|
653
652
|
```
|
|
654
653
|
|
|
655
|
-
###
|
|
654
|
+
### Policy Definition Types
|
|
656
655
|
|
|
657
656
|
```typescript
|
|
658
|
-
type
|
|
657
|
+
type TPolicyDefinitionOptions = {
|
|
659
658
|
idType?: 'string' | 'number';
|
|
660
659
|
};
|
|
661
660
|
|
|
662
|
-
type
|
|
663
|
-
|
|
661
|
+
type TPolicyDefinitionCommonColumns = {
|
|
662
|
+
variant: ReturnType<typeof text>;
|
|
663
|
+
subjectType: ReturnType<typeof text>;
|
|
664
|
+
targetType: ReturnType<typeof text>;
|
|
665
|
+
action: ReturnType<typeof text>;
|
|
666
|
+
effect: ReturnType<typeof text>;
|
|
667
|
+
domain: ReturnType<typeof text>;
|
|
664
668
|
};
|
|
665
669
|
```
|
|
666
670
|
|
|
667
|
-
### User Role Types
|
|
668
|
-
|
|
669
|
-
```typescript
|
|
670
|
-
type TUserRoleOptions = {
|
|
671
|
-
idType?: 'string' | 'number';
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
type TUserRoleCommonColumns = ReturnType<
|
|
675
|
-
typeof generatePrincipalColumnDefs<'principal', 'string' | 'number'>
|
|
676
|
-
>;
|
|
677
|
-
```
|
|
678
|
-
|
|
679
671
|
## Controller Factory
|
|
680
672
|
|
|
681
673
|
The `defineAuthController()` function dynamically creates a controller class at runtime using decorator composition:
|
|
682
674
|
|
|
683
675
|
**How it works:**
|
|
684
676
|
|
|
685
|
-
1. **Class creation:** A new class is created dynamically with `class AuthController extends
|
|
677
|
+
1. **Class creation:** A new class is created dynamically with `class AuthController extends BaseRestController {}` inside the factory closure
|
|
686
678
|
2. **Decorator application:** The `@controller({ path: restPath })` decorator is applied to set the base path. The controller is created with `isStrict: true`
|
|
687
679
|
3. **Service injection:** The auth service is injected via `inject({ key: serviceKey })(AuthController, undefined, 0)` after class definition -- this programmatically applies `@inject` to constructor parameter 0
|
|
688
680
|
- Service key is provided via `controllerOpts.serviceKey` (required)
|
|
@@ -209,7 +209,7 @@ The middleware that executes strategies in the configured mode.
|
|
|
209
209
|
| Error Message | Status | Method | When |
|
|
210
210
|
|---------------|--------|--------|------|
|
|
211
211
|
| <code v-pre>Authentication failed. Tried strategies: {{strategies}}</code> | 401 | `executeAnyMode` | All strategies failed in `'any'` mode — each strategy threw during `authenticate()` |
|
|
212
|
-
| `Failed to identify authenticated user!` | 401 | `executeAllMode` | All strategies succeeded in `'all'` mode but the
|
|
212
|
+
| `Failed to identify authenticated user!` | 401 | `executeAllMode` | All strategies succeeded in `'all'` mode but the first strategy's `authUser.userId` is falsy |
|
|
213
213
|
| <code v-pre>Invalid authentication mode | mode: {{mode}}</code> | 500 | `createAuthenticateMiddleware` | `mode` is not `'any'` or `'all'` |
|
|
214
214
|
|
|
215
215
|
---
|
|
@@ -178,17 +178,14 @@ import {
|
|
|
178
178
|
extraUserColumns,
|
|
179
179
|
extraRoleColumns,
|
|
180
180
|
extraPermissionColumns,
|
|
181
|
-
|
|
182
|
-
extraUserRoleColumns,
|
|
181
|
+
extraPolicyDefinitionColumns,
|
|
183
182
|
} from '@venizia/ignis';
|
|
184
183
|
|
|
185
184
|
import type {
|
|
186
185
|
TPermissionOptions,
|
|
187
186
|
TPermissionCommonColumns,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
TUserRoleOptions,
|
|
191
|
-
TUserRoleCommonColumns,
|
|
187
|
+
TPolicyDefinitionOptions,
|
|
188
|
+
TPolicyDefinitionCommonColumns,
|
|
192
189
|
} from '@venizia/ignis';
|
|
193
190
|
```
|
|
194
191
|
|
|
@@ -866,13 +863,13 @@ type TAuthMode = TConstValue<typeof AuthenticationModes>;
|
|
|
866
863
|
|
|
867
864
|
- **Guides:**
|
|
868
865
|
- [Components Overview](/guides/core-concepts/components) -- Component system basics
|
|
869
|
-
- [Controllers](/guides/core-concepts/controllers) -- Protecting routes with auth
|
|
866
|
+
- [REST Controllers](/guides/core-concepts/rest-controllers) | [gRPC Controllers](/guides/core-concepts/grpc-controllers) -- Protecting routes with auth
|
|
870
867
|
|
|
871
868
|
- **Components:**
|
|
872
869
|
- [All Components](../index) -- Built-in components list
|
|
873
870
|
|
|
874
871
|
- **Helpers:**
|
|
875
|
-
- [Crypto Helper](/
|
|
872
|
+
- [Crypto Helper](/extensions/helpers/crypto/) -- Password hashing utilities
|
|
876
873
|
|
|
877
874
|
- **References:**
|
|
878
875
|
- [Middlewares](/references/base/middlewares) -- Custom authentication middleware
|