@venizia/ignis-docs 0.0.3 → 0.0.4-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/README.md +1 -1
- package/package.json +4 -2
- package/wiki/best-practices/api-usage-examples.md +591 -0
- package/wiki/best-practices/architectural-patterns.md +415 -0
- package/wiki/best-practices/architecture-decisions.md +488 -0
- package/wiki/{get-started/best-practices → best-practices}/code-style-standards.md +406 -17
- package/wiki/{get-started/best-practices → best-practices}/common-pitfalls.md +109 -4
- package/wiki/{get-started/best-practices → best-practices}/contribution-workflow.md +34 -7
- package/wiki/best-practices/data-modeling.md +376 -0
- package/wiki/best-practices/deployment-strategies.md +698 -0
- package/wiki/best-practices/index.md +27 -0
- package/wiki/best-practices/performance-optimization.md +196 -0
- package/wiki/best-practices/security-guidelines.md +218 -0
- package/wiki/{get-started/best-practices → best-practices}/troubleshooting-tips.md +97 -1
- package/wiki/changelogs/2025-12-16-initial-architecture.md +1 -1
- package/wiki/changelogs/2025-12-16-model-repo-datasource-refactor.md +1 -1
- package/wiki/changelogs/2025-12-17-refactor.md +1 -1
- package/wiki/changelogs/2025-12-18-performance-optimizations.md +5 -5
- package/wiki/changelogs/2025-12-18-repository-validation-security.md +13 -7
- package/wiki/changelogs/2025-12-26-nested-relations-and-generics.md +2 -2
- package/wiki/changelogs/2025-12-29-dynamic-binding-registration.md +104 -0
- package/wiki/changelogs/2025-12-29-snowflake-uid-helper.md +100 -0
- package/wiki/changelogs/2025-12-30-repository-enhancements.md +214 -0
- package/wiki/changelogs/2025-12-31-json-path-filtering-array-operators.md +214 -0
- package/wiki/changelogs/2025-12-31-string-id-custom-generator.md +137 -0
- package/wiki/changelogs/2026-01-02-default-filter-and-repository-mixins.md +418 -0
- package/wiki/changelogs/index.md +6 -0
- package/wiki/changelogs/planned-schema-migrator.md +0 -8
- package/wiki/{get-started/core-concepts → guides/core-concepts/application}/bootstrapping.md +18 -5
- package/wiki/{get-started/core-concepts/application.md → guides/core-concepts/application/index.md} +47 -104
- package/wiki/guides/core-concepts/components-guide.md +509 -0
- package/wiki/{get-started → guides}/core-concepts/components.md +24 -17
- package/wiki/{get-started → guides}/core-concepts/controllers.md +30 -13
- package/wiki/{get-started → guides}/core-concepts/dependency-injection.md +97 -0
- package/wiki/guides/core-concepts/persistent/datasources.md +179 -0
- package/wiki/guides/core-concepts/persistent/index.md +119 -0
- package/wiki/guides/core-concepts/persistent/models.md +241 -0
- package/wiki/guides/core-concepts/persistent/repositories.md +219 -0
- package/wiki/guides/core-concepts/persistent/transactions.md +170 -0
- package/wiki/{get-started → guides}/core-concepts/services.md +26 -3
- package/wiki/{get-started → guides/get-started}/5-minute-quickstart.md +59 -14
- package/wiki/guides/get-started/philosophy.md +682 -0
- package/wiki/guides/get-started/setup.md +157 -0
- package/wiki/guides/index.md +89 -0
- package/wiki/guides/reference/glossary.md +243 -0
- package/wiki/{get-started → guides/reference}/mcp-docs-server.md +0 -10
- package/wiki/{get-started → guides/tutorials}/building-a-crud-api.md +134 -132
- package/wiki/{get-started/quickstart.md → guides/tutorials/complete-installation.md} +107 -71
- package/wiki/guides/tutorials/ecommerce-api.md +1399 -0
- package/wiki/guides/tutorials/realtime-chat.md +1261 -0
- package/wiki/guides/tutorials/testing.md +723 -0
- package/wiki/index.md +176 -37
- package/wiki/references/base/application.md +27 -0
- package/wiki/references/base/bootstrapping.md +30 -26
- package/wiki/references/base/components.md +24 -7
- package/wiki/references/base/controllers.md +51 -20
- package/wiki/references/base/datasources.md +30 -0
- package/wiki/references/base/dependency-injection.md +39 -3
- package/wiki/references/base/filter-system/application-usage.md +224 -0
- package/wiki/references/base/filter-system/array-operators.md +132 -0
- package/wiki/references/base/filter-system/comparison-operators.md +109 -0
- package/wiki/references/base/filter-system/default-filter.md +428 -0
- package/wiki/references/base/filter-system/fields-order-pagination.md +155 -0
- package/wiki/references/base/filter-system/index.md +127 -0
- package/wiki/references/base/filter-system/json-filtering.md +197 -0
- package/wiki/references/base/filter-system/list-operators.md +71 -0
- package/wiki/references/base/filter-system/logical-operators.md +156 -0
- package/wiki/references/base/filter-system/null-operators.md +58 -0
- package/wiki/references/base/filter-system/pattern-matching.md +108 -0
- package/wiki/references/base/filter-system/quick-reference.md +431 -0
- package/wiki/references/base/filter-system/range-operators.md +63 -0
- package/wiki/references/base/filter-system/tips.md +190 -0
- package/wiki/references/base/filter-system/use-cases.md +452 -0
- package/wiki/references/base/index.md +90 -0
- package/wiki/references/base/middlewares.md +602 -0
- package/wiki/references/base/models.md +215 -23
- package/wiki/references/base/providers.md +732 -0
- package/wiki/references/base/repositories/advanced.md +555 -0
- package/wiki/references/base/repositories/index.md +228 -0
- package/wiki/references/base/repositories/mixins.md +331 -0
- package/wiki/references/base/repositories/relations.md +486 -0
- package/wiki/references/base/repositories.md +40 -635
- package/wiki/references/base/services.md +28 -4
- package/wiki/references/components/authentication.md +22 -2
- package/wiki/references/components/health-check.md +12 -0
- package/wiki/references/components/index.md +23 -0
- package/wiki/references/components/mail.md +687 -0
- package/wiki/references/components/request-tracker.md +16 -0
- package/wiki/references/components/socket-io.md +18 -0
- package/wiki/references/components/static-asset.md +14 -26
- package/wiki/references/components/swagger.md +17 -0
- package/wiki/references/configuration/environment-variables.md +427 -0
- package/wiki/references/configuration/index.md +73 -0
- package/wiki/references/helpers/cron.md +14 -0
- package/wiki/references/helpers/crypto.md +15 -0
- package/wiki/references/helpers/env.md +16 -0
- package/wiki/references/helpers/error.md +17 -0
- package/wiki/references/helpers/index.md +14 -0
- package/wiki/references/helpers/inversion.md +24 -4
- package/wiki/references/helpers/logger.md +19 -0
- package/wiki/references/helpers/network.md +11 -0
- package/wiki/references/helpers/queue.md +19 -0
- package/wiki/references/helpers/redis.md +21 -0
- package/wiki/references/helpers/socket-io.md +24 -5
- package/wiki/references/helpers/storage.md +18 -10
- package/wiki/references/helpers/testing.md +18 -0
- package/wiki/references/helpers/types.md +16 -0
- package/wiki/references/helpers/uid.md +167 -0
- package/wiki/references/helpers/worker-thread.md +16 -0
- package/wiki/references/index.md +177 -0
- package/wiki/references/quick-reference.md +634 -0
- package/wiki/references/src-details/boot.md +3 -3
- package/wiki/references/src-details/dev-configs.md +0 -4
- package/wiki/references/src-details/docs.md +2 -2
- package/wiki/references/src-details/index.md +86 -0
- package/wiki/references/src-details/inversion.md +1 -6
- package/wiki/references/src-details/mcp-server.md +3 -15
- package/wiki/references/utilities/index.md +86 -10
- package/wiki/references/utilities/jsx.md +577 -0
- package/wiki/references/utilities/request.md +0 -2
- package/wiki/references/utilities/statuses.md +740 -0
- package/wiki/get-started/best-practices/api-usage-examples.md +0 -266
- package/wiki/get-started/best-practices/architectural-patterns.md +0 -170
- package/wiki/get-started/best-practices/data-modeling.md +0 -177
- package/wiki/get-started/best-practices/deployment-strategies.md +0 -121
- package/wiki/get-started/best-practices/performance-optimization.md +0 -97
- package/wiki/get-started/best-practices/security-guidelines.md +0 -99
- package/wiki/get-started/core-concepts/persistent.md +0 -539
- package/wiki/get-started/index.md +0 -65
- package/wiki/get-started/philosophy.md +0 -296
- package/wiki/get-started/prerequisites.md +0 -113
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Framework Internals
|
|
2
|
+
|
|
3
|
+
Deep dive into Ignis package structure and source code organization.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
| Package | npm | Purpose |
|
|
8
|
+
|---------|-----|---------|
|
|
9
|
+
| `@venizia/ignis` | Core | Main framework with controllers, repositories, components |
|
|
10
|
+
| `@venizia/ignis-boot` | Boot | Auto-discovery and bootstrapping utilities |
|
|
11
|
+
| `@venizia/ignis-helpers` | Helpers | Reusable utilities (logger, crypto, redis, etc.) |
|
|
12
|
+
| `@venizia/ignis-inversion` | Inversion | Standalone dependency injection container |
|
|
13
|
+
| `@venizia/dev-configs` | Dev Configs | TypeScript, ESLint, Prettier configurations |
|
|
14
|
+
| `@venizia/ignis-docs` | Docs | Documentation site and MCP server |
|
|
15
|
+
|
|
16
|
+
## Monorepo Structure
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
ignis/
|
|
20
|
+
├── packages/
|
|
21
|
+
│ ├── core/ → @venizia/ignis (main framework)
|
|
22
|
+
│ ├── boot/ → @venizia/ignis-boot (auto-discovery)
|
|
23
|
+
│ ├── helpers/ → @venizia/ignis-helpers (utilities)
|
|
24
|
+
│ ├── inversion/ → @venizia/ignis-inversion (DI container)
|
|
25
|
+
│ ├── dev-configs/ → @venizia/dev-configs (linting/formatting)
|
|
26
|
+
│ └── docs/ → @venizia/ignis-docs (documentation)
|
|
27
|
+
├── examples/ → Example applications
|
|
28
|
+
└── scripts/ → Build and maintenance scripts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Package Dependencies
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────────────┐
|
|
35
|
+
│ @venizia/ignis │
|
|
36
|
+
│ (Core Framework) │
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
39
|
+
│ │ base/ │ │ components/ │ │ utilities/ │ │
|
|
40
|
+
│ │ (Controllers,│ │ (Auth, Swagger,│ │ (Crypto, │ │
|
|
41
|
+
│ │ Repos, etc.)│ │ HealthCheck) │ │ Date, etc.) │ │
|
|
42
|
+
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
|
43
|
+
└────────────────────────┬────────────────────────────────┘
|
|
44
|
+
│ depends on
|
|
45
|
+
┌───────────────┼───────────────┐
|
|
46
|
+
▼ ▼ ▼
|
|
47
|
+
┌────────────────┐ ┌────────────┐ ┌────────────────┐
|
|
48
|
+
│ @vez/ignis-boot│ │@vez/ignis- │ │ @vez/ignis- │
|
|
49
|
+
│ (Auto-Discovery)│ │ helpers │ │ inversion │
|
|
50
|
+
│ │ │ (Logger, │ │ (DI Container) │
|
|
51
|
+
│ │ │ Redis,etc)│ │ │
|
|
52
|
+
└────────────────┘ └─────┬──────┘ └────────────────┘
|
|
53
|
+
│ depends on
|
|
54
|
+
▼
|
|
55
|
+
┌─────────────────────┐
|
|
56
|
+
│ @vez/ignis-inversion│
|
|
57
|
+
│ (Standalone DI) │
|
|
58
|
+
└─────────────────────┘
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## What's in This Section
|
|
62
|
+
|
|
63
|
+
### Core Package
|
|
64
|
+
- [Core (@venizia/ignis)](./core.md) - Main framework with base classes, components, and utilities
|
|
65
|
+
|
|
66
|
+
### Supporting Packages
|
|
67
|
+
- [Boot (@venizia/ignis-boot)](./boot.md) - Automatic artifact discovery and registration
|
|
68
|
+
- [Helpers (@venizia/ignis-helpers)](./helpers.md) - Reusable helper classes (logger, crypto, redis, etc.)
|
|
69
|
+
- [Inversion (@venizia/ignis-inversion)](./inversion.md) - Standalone dependency injection container
|
|
70
|
+
|
|
71
|
+
### Development Tools
|
|
72
|
+
- [Dev Configs (@venizia/dev-configs)](./dev-configs.md) - Shared TypeScript, ESLint, Prettier configs
|
|
73
|
+
- [Documentation (@venizia/ignis-docs)](./docs.md) - VitePress site and wiki structure
|
|
74
|
+
- [MCP Docs Server](./mcp-server.md) - Model Context Protocol server for AI-assisted development
|
|
75
|
+
|
|
76
|
+
## Package Purposes
|
|
77
|
+
|
|
78
|
+
| Package | When to Use |
|
|
79
|
+
|---------|-------------|
|
|
80
|
+
| **@venizia/ignis** | Building Ignis applications (always needed) |
|
|
81
|
+
| **@venizia/ignis-boot** | Auto-discovery of controllers, services, repositories |
|
|
82
|
+
| **@venizia/ignis-helpers** | Standalone utilities without full framework |
|
|
83
|
+
| **@venizia/ignis-inversion** | DI container without framework dependencies |
|
|
84
|
+
| **@venizia/dev-configs** | Consistent dev tooling across projects |
|
|
85
|
+
|
|
86
|
+
> **Related:** [Core Concepts Guide](../../guides/core-concepts/application/) | [Base Abstractions Reference](../base/)
|
|
@@ -176,7 +176,6 @@ const key = BindingKeys.build({ namespace: 'services', key: 'UserService' });
|
|
|
176
176
|
| `IPropertyMetadata` | Property injection metadata |
|
|
177
177
|
| `IInjectMetadata` | Constructor injection metadata |
|
|
178
178
|
|
|
179
|
-
---
|
|
180
179
|
|
|
181
180
|
## Injection Metadata
|
|
182
181
|
|
|
@@ -200,7 +199,6 @@ interface IInjectMetadata {
|
|
|
200
199
|
}
|
|
201
200
|
```
|
|
202
201
|
|
|
203
|
-
---
|
|
204
202
|
|
|
205
203
|
## Project Structure
|
|
206
204
|
|
|
@@ -226,7 +224,6 @@ packages/inversion/
|
|
|
226
224
|
└── dist/ # Built output
|
|
227
225
|
```
|
|
228
226
|
|
|
229
|
-
---
|
|
230
227
|
|
|
231
228
|
## Usage Examples
|
|
232
229
|
|
|
@@ -307,7 +304,6 @@ if (cache) {
|
|
|
307
304
|
}
|
|
308
305
|
```
|
|
309
306
|
|
|
310
|
-
---
|
|
311
307
|
|
|
312
308
|
## Integration with Framework
|
|
313
309
|
|
|
@@ -327,7 +323,6 @@ import { Container, Binding } from '@venizia/ignis-inversion';
|
|
|
327
323
|
import { Container, inject, service } from '@venizia/ignis';
|
|
328
324
|
```
|
|
329
325
|
|
|
330
|
-
---
|
|
331
326
|
|
|
332
327
|
## Building the Package
|
|
333
328
|
|
|
@@ -342,4 +337,4 @@ bun run clean
|
|
|
342
337
|
|
|
343
338
|
# Rebuild (clean + build)
|
|
344
339
|
bun run rebuild
|
|
345
|
-
```
|
|
340
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP Docs Server: Deep Dive
|
|
2
2
|
|
|
3
|
-
This document provides a detailed look into the architecture, features, and internal workings of the Ignis Documentation MCP Server. For a guide on how to use the server, see the [MCP Docs Server Quickstart](/
|
|
3
|
+
This document provides a detailed look into the architecture, features, and internal workings of the Ignis Documentation MCP Server. For a guide on how to use the server, see the [MCP Docs Server Quickstart](/guides/reference/mcp-docs-server).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -109,7 +109,6 @@ sequenceDiagram
|
|
|
109
109
|
MCP-->>AI: JSON results
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
---
|
|
113
112
|
|
|
114
113
|
## Tools Reference
|
|
115
114
|
|
|
@@ -156,7 +155,6 @@ Retrieves high-level information about specific framework packages.
|
|
|
156
155
|
- **Input:** `{ packageName?: string }`
|
|
157
156
|
- **Returns:** Package description, version, and purpose.
|
|
158
157
|
|
|
159
|
-
---
|
|
160
158
|
|
|
161
159
|
### 2. Code & Project Tools
|
|
162
160
|
|
|
@@ -189,7 +187,6 @@ Checks the `package.json` of a specific package or the root project.
|
|
|
189
187
|
- **Input:** `{ package?: string }`
|
|
190
188
|
- **Returns:** List of dependencies and their versions.
|
|
191
189
|
|
|
192
|
-
---
|
|
193
190
|
|
|
194
191
|
## Resources
|
|
195
192
|
|
|
@@ -205,14 +202,13 @@ The server exposes documentation as MCP resources for direct access:
|
|
|
205
202
|
|
|
206
203
|
```json
|
|
207
204
|
{
|
|
208
|
-
"uri": "ignis://docs/
|
|
205
|
+
"uri": "ignis://docs/guides/intro.md",
|
|
209
206
|
"name": "Introduction",
|
|
210
207
|
"description": "Getting Started - 450 words",
|
|
211
208
|
"mimeType": "text/markdown"
|
|
212
209
|
}
|
|
213
210
|
```
|
|
214
211
|
|
|
215
|
-
---
|
|
216
212
|
|
|
217
213
|
## Search Configuration
|
|
218
214
|
|
|
@@ -243,7 +239,6 @@ pie
|
|
|
243
239
|
|
|
244
240
|
**Why this matters:** When you search for "dependency injection", documents with that phrase in the title will rank higher than those with it only in the content.
|
|
245
241
|
|
|
246
|
-
---
|
|
247
242
|
|
|
248
243
|
## Project Structure
|
|
249
244
|
|
|
@@ -292,7 +287,6 @@ mcp-server/
|
|
|
292
287
|
| `common/logger.ts` | Structured logging | `Logger` class |
|
|
293
288
|
| `common/paths.ts` | Path resolution | `Paths` object |
|
|
294
289
|
|
|
295
|
-
---
|
|
296
290
|
|
|
297
291
|
## Performance Characteristics
|
|
298
292
|
|
|
@@ -330,7 +324,6 @@ graph LR
|
|
|
330
324
|
- Memory usage is constant after first load
|
|
331
325
|
- No disk I/O after initialization
|
|
332
326
|
|
|
333
|
-
---
|
|
334
327
|
|
|
335
328
|
## Error Handling
|
|
336
329
|
|
|
@@ -369,7 +362,6 @@ All tools return consistent error responses:
|
|
|
369
362
|
DEBUG=1 ignis-docs-mcp
|
|
370
363
|
```
|
|
371
364
|
|
|
372
|
-
---
|
|
373
365
|
|
|
374
366
|
## Development Guide
|
|
375
367
|
|
|
@@ -526,7 +518,6 @@ export class MCPConfigs {
|
|
|
526
518
|
| `title weight` | Less title importance | More title importance |
|
|
527
519
|
| `snippetLength` | Shorter previews | Longer previews |
|
|
528
520
|
|
|
529
|
-
---
|
|
530
521
|
|
|
531
522
|
## Best Practices
|
|
532
523
|
|
|
@@ -540,7 +531,7 @@ export class MCPConfigs {
|
|
|
540
531
|
|
|
541
532
|
### For Developers
|
|
542
533
|
|
|
543
|
-
1. **Document IDs**: Always use relative paths from wiki root (e.g., "
|
|
534
|
+
1. **Document IDs**: Always use relative paths from wiki root (e.g., "guides/intro.md")
|
|
544
535
|
2. **Frontmatter**: Ensure all markdown files have `title` and `category` in frontmatter
|
|
545
536
|
3. **Search Queries**: Use descriptive queries for better results (minimum 2 characters)
|
|
546
537
|
4. **Result Limits**: Adjust limit parameter based on needs (default: 10, max: 50)
|
|
@@ -574,7 +565,6 @@ export class MCPConfigs {
|
|
|
574
565
|
3. getDocContent("references/api.md") → Fetch full content
|
|
575
566
|
```
|
|
576
567
|
|
|
577
|
-
---
|
|
578
568
|
|
|
579
569
|
## Debugging
|
|
580
570
|
|
|
@@ -608,7 +598,6 @@ DEBUG=docs:cache ignis-docs-mcp
|
|
|
608
598
|
| Check search | Use searchDocs tool | "Found N matches in Xms" |
|
|
609
599
|
| Inspect cache | Check memory usage | ~5-10MB after first load |
|
|
610
600
|
|
|
611
|
-
---
|
|
612
601
|
|
|
613
602
|
## Roadmap
|
|
614
603
|
|
|
@@ -628,7 +617,6 @@ Want to add features or fix bugs? See the main Ignis repository:
|
|
|
628
617
|
- **Issues**: Report bugs or request features
|
|
629
618
|
- **Pull Requests**: Submit improvements
|
|
630
619
|
|
|
631
|
-
---
|
|
632
620
|
|
|
633
621
|
## FAQ
|
|
634
622
|
|
|
@@ -1,12 +1,88 @@
|
|
|
1
1
|
# Utilities
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
Pure, standalone functions providing common, reusable logic for the Ignis framework. All utilities are stateless and easy to use.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
| Utility | Purpose | Key Functions |
|
|
8
|
+
|---------|---------|---------------|
|
|
9
|
+
| **Crypto** | Cryptographic operations | `hash()`, `compare()`, `encrypt()`, `decrypt()` |
|
|
10
|
+
| **Date** | Date/time manipulation | `format()`, `parse()`, `diff()`, `add()` |
|
|
11
|
+
| **JSX** | HTML/JSX responses | `htmlContent()`, `htmlResponse()` |
|
|
12
|
+
| **Module** | Module detection | `isInstalled()`, `resolve()` |
|
|
13
|
+
| **Parse** | Data type conversion | `toBoolean()`, `toNumber()`, `toArray()` |
|
|
14
|
+
| **Performance** | Execution timing | `measure()`, `measureAsync()` |
|
|
15
|
+
| **Promise** | Promise helpers | `delay()`, `timeout()`, `retry()` |
|
|
16
|
+
| **Request** | HTTP utilities | `parseMultipart()`, `contentDisposition()` |
|
|
17
|
+
| **Schema** | Zod schema helpers | `jsonContent()`, `jsonResponse()` |
|
|
18
|
+
| **Statuses** | Status code constants | `Statuses`, `UserStatuses`, `CommonStatuses` |
|
|
19
|
+
|
|
20
|
+
## What's in This Section
|
|
21
|
+
|
|
22
|
+
### Data Processing
|
|
23
|
+
|
|
24
|
+
- [**Crypto**](./crypto.md) - Simple, stateless cryptographic functions for hashing, comparison, and encryption/decryption operations
|
|
25
|
+
- [**Parse**](./parse.md) - Functions for parsing and converting data types safely with proper type inference
|
|
26
|
+
- [**Schema**](./schema.md) - Helpers for creating and validating Zod schemas, especially for OpenAPI request/response validation
|
|
27
|
+
- [**Statuses**](./statuses.md) - Standardized status code constants for entity lifecycle management
|
|
28
|
+
|
|
29
|
+
### Time & Performance
|
|
30
|
+
|
|
31
|
+
- [**Date**](./date.md) - Date and time manipulation functions built on `dayjs` with timezone support
|
|
32
|
+
- [**Performance**](./performance.md) - Utilities for measuring code execution time and performance profiling
|
|
33
|
+
|
|
34
|
+
### Async & HTTP
|
|
35
|
+
|
|
36
|
+
- [**JSX**](./jsx.md) - HTML and JSX response utilities for server-side rendering and OpenAPI documentation
|
|
37
|
+
- [**Promise**](./promise.md) - Helper functions for working with Promises including retry, timeout, and delay
|
|
38
|
+
- [**Request**](./request.md) - HTTP request utilities for parsing multipart form data and creating secure Content-Disposition headers
|
|
39
|
+
|
|
40
|
+
### Runtime
|
|
41
|
+
|
|
42
|
+
- [**Module**](./module.md) - Utility for checking if a Node.js module is installed at runtime
|
|
43
|
+
|
|
44
|
+
## Usage Pattern
|
|
45
|
+
|
|
46
|
+
All utilities are imported from `@venizia/ignis`:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import {
|
|
50
|
+
hash,
|
|
51
|
+
compare,
|
|
52
|
+
formatDate,
|
|
53
|
+
toBoolean,
|
|
54
|
+
jsonContent,
|
|
55
|
+
jsonResponse,
|
|
56
|
+
htmlResponse,
|
|
57
|
+
Statuses,
|
|
58
|
+
} from '@venizia/ignis';
|
|
59
|
+
|
|
60
|
+
// Crypto
|
|
61
|
+
const hashed = await hash({ value: 'password123' });
|
|
62
|
+
const isMatch = await compare({ value: 'password123', hashed });
|
|
63
|
+
|
|
64
|
+
// Date
|
|
65
|
+
const formatted = formatDate({ date: new Date(), format: 'YYYY-MM-DD' });
|
|
66
|
+
|
|
67
|
+
// Parse
|
|
68
|
+
const boolValue = toBoolean('true'); // true
|
|
69
|
+
|
|
70
|
+
// Schema (for OpenAPI JSON routes)
|
|
71
|
+
const responseSchema = jsonResponse({
|
|
72
|
+
description: 'User data',
|
|
73
|
+
schema: z.object({ id: z.string(), name: z.string() }),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// JSX (for HTML routes)
|
|
77
|
+
const htmlResponseSchema = htmlResponse({
|
|
78
|
+
description: 'Dashboard page',
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Statuses
|
|
82
|
+
const order = { status: Statuses.COMPLETED };
|
|
83
|
+
if (Statuses.isCompleted(order.status)) {
|
|
84
|
+
console.log('Order is complete');
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
> **Related:** [Helpers Reference](../helpers/) | [Core Concepts Guide](../../guides/core-concepts/application/)
|