@venizia/ignis-docs 0.2.0 → 0.2.1-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 (174) hide show
  1. package/README.md +14 -14
  2. package/content/best-practices/api-usage-examples.md +39 -19
  3. package/content/best-practices/architectural-patterns.md +24 -13
  4. package/content/best-practices/architecture-decisions.md +29 -16
  5. package/content/best-practices/code-style-standards/advanced-patterns.md +43 -31
  6. package/content/best-practices/code-style-standards/constants-configuration.md +19 -4
  7. package/content/best-practices/code-style-standards/control-flow.md +33 -1
  8. package/content/best-practices/code-style-standards/documentation.md +28 -8
  9. package/content/best-practices/code-style-standards/function-patterns.md +15 -4
  10. package/content/best-practices/code-style-standards/index.md +7 -2
  11. package/content/best-practices/code-style-standards/naming-conventions.md +27 -3
  12. package/content/best-practices/code-style-standards/route-definitions.md +9 -5
  13. package/content/best-practices/code-style-standards/tooling.md +14 -1
  14. package/content/best-practices/code-style-standards/type-safety.md +39 -6
  15. package/content/best-practices/common-pitfalls.md +59 -35
  16. package/content/best-practices/contribution-workflow.md +8 -4
  17. package/content/best-practices/data-modeling.md +78 -62
  18. package/content/best-practices/deployment-strategies.md +56 -19
  19. package/content/best-practices/error-handling.md +247 -153
  20. package/content/best-practices/index.md +6 -0
  21. package/content/best-practices/performance-optimization.md +26 -13
  22. package/content/best-practices/security-guidelines.md +35 -9
  23. package/content/best-practices/testing-strategies.md +7 -2
  24. package/content/best-practices/troubleshooting-tips.md +27 -17
  25. package/content/extensions/components/api-reference.md +109 -323
  26. package/content/extensions/components/authentication/api.md +489 -602
  27. package/content/extensions/components/authentication/errors.md +135 -498
  28. package/content/extensions/components/authentication/index.md +89 -801
  29. package/content/extensions/components/authentication/usage.md +231 -955
  30. package/content/extensions/components/authorization/api.md +991 -644
  31. package/content/extensions/components/authorization/errors.md +204 -208
  32. package/content/extensions/components/authorization/getting-started.md +227 -0
  33. package/content/extensions/components/authorization/index.md +88 -795
  34. package/content/extensions/components/authorization/usage.md +219 -528
  35. package/content/extensions/components/health-check.md +77 -243
  36. package/content/extensions/components/index.md +24 -90
  37. package/content/extensions/components/mail/api.md +553 -285
  38. package/content/extensions/components/mail/errors.md +76 -62
  39. package/content/extensions/components/mail/index.md +111 -463
  40. package/content/extensions/components/mail/usage.md +139 -173
  41. package/content/extensions/components/request-tracker.md +70 -173
  42. package/content/extensions/components/socket-io/api.md +462 -785
  43. package/content/extensions/components/socket-io/errors.md +49 -51
  44. package/content/extensions/components/socket-io/index.md +69 -372
  45. package/content/extensions/components/socket-io/usage.md +212 -105
  46. package/content/extensions/components/static-asset/api.md +461 -141
  47. package/content/extensions/components/static-asset/errors.md +121 -53
  48. package/content/extensions/components/static-asset/index.md +84 -606
  49. package/content/extensions/components/static-asset/usage.md +184 -299
  50. package/content/extensions/components/template/index.md +3 -3
  51. package/content/extensions/components/websocket/api.md +311 -404
  52. package/content/extensions/components/websocket/errors.md +47 -56
  53. package/content/extensions/components/websocket/index.md +75 -407
  54. package/content/extensions/components/websocket/usage.md +120 -338
  55. package/content/extensions/helpers/cron/index.md +52 -160
  56. package/content/extensions/helpers/crypto/index.md +67 -480
  57. package/content/extensions/helpers/crypto/reference.md +528 -0
  58. package/content/extensions/helpers/env/index.md +64 -178
  59. package/content/extensions/helpers/error/index.md +286 -196
  60. package/content/extensions/helpers/index.md +61 -47
  61. package/content/extensions/helpers/inversion/index.md +76 -550
  62. package/content/extensions/helpers/inversion/reference.md +530 -0
  63. package/content/extensions/helpers/kafka/admin.md +23 -3
  64. package/content/extensions/helpers/kafka/compile-binary.md +83 -52
  65. package/content/extensions/helpers/kafka/consumer.md +65 -28
  66. package/content/extensions/helpers/kafka/examples.md +46 -253
  67. package/content/extensions/helpers/kafka/index.md +55 -617
  68. package/content/extensions/helpers/kafka/producer.md +156 -22
  69. package/content/extensions/helpers/kafka/schema-registry.md +59 -79
  70. package/content/extensions/helpers/logger/hf-logger.md +220 -0
  71. package/content/extensions/helpers/logger/index.md +78 -552
  72. package/content/extensions/helpers/logger/pino.md +105 -0
  73. package/content/extensions/helpers/logger/reference.md +937 -0
  74. package/content/extensions/helpers/network/api.md +276 -195
  75. package/content/extensions/helpers/network/index.md +87 -524
  76. package/content/extensions/helpers/queue/index.md +80 -897
  77. package/content/extensions/helpers/queue/reference.md +494 -0
  78. package/content/extensions/helpers/redis/index.md +86 -640
  79. package/content/extensions/helpers/redis/reference.md +784 -0
  80. package/content/extensions/helpers/secrets/index.md +136 -0
  81. package/content/extensions/helpers/socket-io/api.md +325 -204
  82. package/content/extensions/helpers/socket-io/index.md +79 -429
  83. package/content/extensions/helpers/storage/api.md +584 -464
  84. package/content/extensions/helpers/storage/index.md +80 -573
  85. package/content/extensions/helpers/types/index.md +75 -495
  86. package/content/extensions/helpers/types/reference.md +689 -0
  87. package/content/extensions/helpers/uid/index.md +176 -189
  88. package/content/extensions/helpers/websocket/api.md +366 -214
  89. package/content/extensions/helpers/websocket/index.md +68 -503
  90. package/content/extensions/helpers/worker-thread/index.md +62 -396
  91. package/content/extensions/helpers/worker-thread/reference.md +428 -0
  92. package/content/extensions/index.md +38 -39
  93. package/content/extensions/src-details/mcp-server.md +96 -548
  94. package/content/guides/core-concepts/persistent/datasources.md +2 -2
  95. package/content/guides/core-concepts/persistent/index.md +5 -1
  96. package/content/guides/core-concepts/persistent/models.md +1 -1
  97. package/content/guides/core-concepts/persistent/pglite.md +218 -0
  98. package/content/guides/core-concepts/persistent/postgres-drivers.md +21 -15
  99. package/content/guides/core-concepts/persistent/search-meilisearch.md +22 -12
  100. package/content/guides/core-concepts/persistent/search-typesense.md +28 -16
  101. package/content/guides/core-concepts/persistent/sqlite.md +296 -0
  102. package/content/guides/core-concepts/persistent/transactions.md +12 -11
  103. package/content/guides/core-concepts/secrets-vault.md +177 -0
  104. package/content/guides/core-concepts/services.md +1 -1
  105. package/content/guides/get-started/5-minute-quickstart.md +59 -206
  106. package/content/guides/get-started/philosophy.md +135 -670
  107. package/content/guides/get-started/setup.md +53 -74
  108. package/content/guides/migrations/redis-helpers-migration.md +5 -4
  109. package/content/guides/migrations/scoped-rbac-migration.md +5 -5
  110. package/content/guides/migrations/unified-connectors-migration.md +8 -7
  111. package/content/guides/tutorials/ecommerce-api.md +3 -8
  112. package/content/guides/tutorials/realtime-chat.md +1 -1
  113. package/content/references/base/application.md +64 -22
  114. package/content/references/base/components.md +3 -3
  115. package/content/references/base/connectors.md +79 -136
  116. package/content/references/base/controllers.md +12 -12
  117. package/content/references/base/datasources-reference.md +600 -0
  118. package/content/references/base/datasources.md +84 -444
  119. package/content/references/base/dependency-injection.md +25 -46
  120. package/content/references/base/filter-system/application-usage.md +95 -123
  121. package/content/references/base/filter-system/array-operators.md +33 -43
  122. package/content/references/base/filter-system/comparison-operators.md +55 -63
  123. package/content/references/base/filter-system/default-filter.md +144 -350
  124. package/content/references/base/filter-system/fields-order-pagination.md +116 -148
  125. package/content/references/base/filter-system/index.md +114 -253
  126. package/content/references/base/filter-system/json-filtering.md +52 -181
  127. package/content/references/base/filter-system/list-operators.md +28 -44
  128. package/content/references/base/filter-system/logical-operators.md +69 -114
  129. package/content/references/base/filter-system/null-operators.md +41 -98
  130. package/content/references/base/filter-system/pattern-matching.md +48 -51
  131. package/content/references/base/filter-system/quick-reference.md +93 -196
  132. package/content/references/base/filter-system/range-operators.md +22 -38
  133. package/content/references/base/filter-system/tips.md +70 -133
  134. package/content/references/base/filter-system/use-cases.md +173 -232
  135. package/content/references/base/grpc-controllers.md +53 -17
  136. package/content/references/base/index.md +5 -3
  137. package/content/references/base/middlewares.md +43 -28
  138. package/content/references/base/models-reference.md +886 -0
  139. package/content/references/base/models.md +81 -1452
  140. package/content/references/base/providers.md +8 -8
  141. package/content/references/base/repositories/advanced.md +281 -419
  142. package/content/references/base/repositories/index.md +84 -644
  143. package/content/references/base/repositories/mixins.md +25 -21
  144. package/content/references/base/repositories/relations.md +194 -375
  145. package/content/references/base/repositories/soft-deletable.md +67 -55
  146. package/content/references/base/secrets.md +267 -0
  147. package/content/references/base/services.md +8 -6
  148. package/content/references/configuration/environment-variables.md +73 -21
  149. package/content/references/configuration/index.md +51 -31
  150. package/content/references/index.md +1 -1
  151. package/content/references/quick-reference.md +3 -16
  152. package/content/references/utilities/crypto.md +35 -76
  153. package/content/references/utilities/date.md +33 -73
  154. package/content/references/utilities/duration.md +85 -0
  155. package/content/references/utilities/index.md +6 -2
  156. package/content/references/utilities/jsx-reference.md +298 -0
  157. package/content/references/utilities/jsx.md +82 -525
  158. package/content/references/utilities/module.md +81 -61
  159. package/content/references/utilities/parse.md +34 -64
  160. package/content/references/utilities/performance.md +33 -58
  161. package/content/references/utilities/promise.md +28 -62
  162. package/content/references/utilities/request.md +58 -218
  163. package/content/references/utilities/retry.md +139 -0
  164. package/content/references/utilities/schema.md +43 -137
  165. package/content/references/utilities/statuses-reference.md +361 -0
  166. package/content/references/utilities/statuses.md +63 -667
  167. package/dist/mcp-server/index.js +0 -0
  168. package/dist/mcp-server/tools/github/list-project-files.tool.d.ts +1 -1
  169. package/dist/mcp-server/tools/github/list-project-files.tool.d.ts.map +1 -1
  170. package/dist/mcp-server/tools/github/list-project-files.tool.js +3 -3
  171. package/dist/mcp-server/tools/github/search-code.tool.js +1 -1
  172. package/dist/mcp-server/tools/github/verify-dependencies.tool.js +1 -1
  173. package/dist/mcp-server/tools/github/view-source-file.tool.js +1 -1
  174. package/package.json +24 -23
@@ -1,562 +1,142 @@
1
- # Types
2
-
3
- Shared utility types, resolver functions, and constants exported from `@venizia/ignis-helpers`.
4
-
5
- ## Quick Reference
6
-
7
- | Item | Value |
8
- |------|-------|
9
- | **Package** | `@venizia/ignis-helpers` |
10
- | **Module** | Common types and constants |
11
- | **Source** | `packages/helpers/src/common/types.ts` (types + resolvers), `packages/helpers/src/common/constants/` (constants) |
12
- | **Runtimes** | Both |
13
-
14
- #### Import Paths
15
-
16
- ```typescript
17
- // Types
18
- import type {
19
- TNullable,
20
- AnyType,
21
- AnyObject,
22
- TOptions,
23
- ValueOrPromise,
24
- ValueOf,
25
- ValueOptional,
26
- ValueOptionalExcept,
27
- TPrettify,
28
- TConstructor,
29
- TAbstractConstructor,
30
- TClass,
31
- TAbstractClass,
32
- TMixinTarget,
33
- TAbstractMixinTarget,
34
- TResolver,
35
- TAsyncResolver,
36
- TValueOrResolver,
37
- TValueOrAsyncResolver,
38
- TStringConstValue,
39
- TNumberConstValue,
40
- TConstValue,
41
- TFieldMappingDataType,
42
- IFieldMapping,
43
- TFieldMappingNames,
44
- TObjectFromFieldMappings,
45
- TInjectionGetter,
46
- IConfigurable,
47
- } from '@venizia/ignis-helpers';
48
-
49
- // Resolver functions
50
- import { resolveValue, resolveValueAsync, resolveClass } from '@venizia/ignis-helpers';
51
-
52
- // Constants
53
- import { Defaults, RuntimeModules, DataTypes, HTTP, GRPC, MimeTypes } from '@venizia/ignis-helpers';
54
-
55
- // Derived constant types
56
- import type { TRuntimeModule, TMimeTypes, THttpMethod, THttpResultCode, TGrpcMethod, TGrpcResultCode } from '@venizia/ignis-helpers';
57
-
58
- // JSX types (re-exported from hono/jsx)
59
- import type { Child, FC, PropsWithChildren } from '@venizia/ignis-helpers';
60
- ```
61
-
62
- ## Usage
63
-
64
- ### General Purpose Types
65
-
66
- ```typescript
67
- type AnyType = any;
68
- type AnyObject = Record<string | symbol | number, any>;
69
- ```
70
-
71
- Escape hatches for general-purpose typing. `AnyObject` is a loosely-typed record for objects whose shape is not known at compile time.
72
-
73
- ```typescript
74
- type TOptions<T extends object = {}> = T;
75
- ```
76
-
77
- Semantic wrapper for options objects. Used across the framework to signal that a parameter follows the options-object pattern.
78
-
79
- ### Nullable and Promise Types
80
-
81
- ```typescript
82
- type TNullable<T> = T | undefined | null;
83
- ```
84
-
85
- Makes a type nullable -- the value can be `T`, `undefined`, or `null`.
86
-
87
- ```typescript
88
- type ValueOrPromise<T> = T | Promise<T>;
89
- ```
90
-
91
- A value that may or may not be wrapped in a `Promise`. Used throughout the framework for methods that support both sync and async implementations.
92
-
93
- ### Class and Constructor Types
1
+ ---
2
+ title: Types
3
+ description: Shared utility types, resolver functions, and constant classes exported from @venizia/ignis-helpers
4
+ difficulty: beginner
5
+ ---
94
6
 
95
- ```typescript
96
- type TConstructor<T> = new (...args: any[]) => T;
97
- type TAbstractConstructor<T> = abstract new (...args: any[]) => T;
98
- ```
7
+ # Types
99
8
 
100
- Types representing concrete and abstract class constructors.
9
+ `@venizia/ignis-helpers` exports the utility types, lazy-value resolvers, and constant classes (`HTTP`, `GRPC`, `RuntimeModules`, ...) that the rest of the IGNIS stack builds on.
101
10
 
102
- ```typescript
103
- type TClass<T> = TConstructor<T> & { [property: string]: any };
104
- type TAbstractClass<T> = TAbstractConstructor<T> & { [property: string]: any };
105
- ```
11
+ ## In one example
106
12
 
107
- Class types that include static properties. `TClass` is the most commonly used -- it represents a concrete class with both a constructor and arbitrary static members.
13
+ `TValueOrResolver` plus `resolveValue` is the core pattern for an option that can be given eagerly or lazily.
108
14
 
109
15
  ```typescript
110
- type TMixinTarget<T> = TConstructor<{ [P in keyof T]: T[P] }>;
111
- type TAbstractMixinTarget<T> = TAbstractConstructor<{ [P in keyof T]: T[P] }>;
112
- ```
16
+ import { TValueOrResolver, resolveValue } from '@venizia/ignis-helpers';
113
17
 
114
- Types for mixin pattern targets. Used when defining mixins that extend a base class while preserving its type:
115
-
116
- ```typescript
117
- function MyMixin<T extends TMixinTarget<BaseClass>>(Base: T) {
118
- return class extends Base {
119
- // additional methods
120
- };
18
+ function configure(opts: { timeout: TValueOrResolver<number> }) {
19
+ const timeout = resolveValue(opts.timeout);
20
+ // works whether opts.timeout is 5000 or () => 5000
121
21
  }
122
- ```
123
-
124
- ### Object Utility Types
125
-
126
- ```typescript
127
- type ValueOf<T> = T[keyof T];
128
- ```
129
-
130
- Extracts the union of all value types from an object type.
131
-
132
- ```typescript
133
- type ValueOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
134
- ```
135
-
136
- Makes specific keys optional while keeping all others required.
137
22
 
138
- ```typescript
139
- type ValueOptionalExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>;
140
- ```
141
-
142
- The inverse -- makes everything optional except the specified keys.
143
-
144
- ```typescript
145
- type TPrettify<T> = { [K in keyof T]: T[K] } & {};
146
- ```
147
-
148
- Flattens intersection types for better IDE display. Useful when combining multiple types with `&` produces hard-to-read hover tooltips.
149
-
150
- ### Const Value Extraction Types
151
-
152
- ```typescript
153
- type TStringConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string>;
154
- type TNumberConstValue<T extends TClass<any>> = Extract<ValueOf<T>, number>;
155
- type TConstValue<T extends TClass<any>> = Extract<ValueOf<T>, string | number>;
156
- ```
157
-
158
- Extract constant value types from a class. These are used to derive union types from constant classes:
159
-
160
- ```typescript
161
- // TRuntimeModule = 'node' | 'bun'
162
- type TRuntimeModule = TConstValue<typeof RuntimeModules>;
163
-
164
- // TMimeTypes = 'unknown' | 'image' | 'video' | 'text'
165
- type TMimeTypes = TConstValue<typeof MimeTypes>;
23
+ configure({ timeout: 5000 });
24
+ configure({ timeout: () => 5000 });
166
25
  ```
167
26
 
168
- ### Value Resolution Types and Functions
169
-
170
- Types and helper functions for lazy/deferred value resolution -- a core pattern in the framework's DI and configuration systems.
27
+ ## How it works
171
28
 
172
- #### Types
29
+ - **Escape hatches, not the norm.** `AnyType` and `AnyObject` exist for the rare case a shape truly cannot be known at compile time. The framework prefers types derived from definitions, like `typeof X.schema`, everywhere else.
173
30
 
174
- ```typescript
175
- type TResolver<T> = (...args: any[]) => T;
176
- type TAsyncResolver<T> = (...args: any[]) => T | Promise<T>;
177
- ```
178
-
179
- Function types that resolve to a value. `TAsyncResolver` supports both sync and async functions.
180
-
181
- ```typescript
182
- type TValueOrResolver<T> = T | TResolver<T>;
183
- type TValueOrAsyncResolver<T> = T | TAsyncResolver<T>;
184
- ```
31
+ | Type | Is |
32
+ |---|---|
33
+ | `AnyType` | `any` |
34
+ | `AnyObject` | `Record<string \| symbol \| number, any>` |
185
35
 
186
- Union types allowing either a direct value or a resolver function. Used in configuration APIs where values can be provided eagerly or lazily.
36
+ - **Nullable and async are explicit.** `TNullable<T>` and `ValueOrPromise<T>` appear on most framework method signatures. One declared type covers both the sync and the async implementation.
187
37
 
188
- #### resolveValue
38
+ | Type | Shape |
39
+ |---|---|
40
+ | `TNullable<T>` | `T \| undefined \| null` |
41
+ | `ValueOrPromise<T>` | `T \| Promise<T>` |
189
42
 
190
- ```typescript
191
- const resolveValue: <T>(valueOrResolver: TValueOrResolver<T>) => T;
192
- ```
43
+ - **Resolvers defer construction.** `TResolver`/`TAsyncResolver` and their `TValueOrResolver`/`TValueOrAsyncResolver` unions let a config option be given eagerly or lazily. `resolveValue`/`resolveValueAsync` collapse either shape to a value.
44
+ - **Class constructors pass through untouched.** `isClass()` detects them, so the resolver never invokes a class as if it were a function. It's re-exported from `@venizia/ignis-inversion` into `helpers`.
45
+ - **Const classes replace string unions.** A class of `static readonly` fields, for example `HTTP` or `RuntimeModules`, is a value namespace. `TConstValue<typeof X>` derives its own union type from those fields - one declaration, no duplicated string literals.
193
46
 
194
- Synchronously resolves a lazy value:
195
- - **Direct values** -- returned as-is
196
- - **Class constructors** -- returned as-is (not invoked)
197
- - **Resolver functions** -- invoked and result returned
47
+ ## Common tasks
198
48
 
199
- Class constructors are detected via `isClass()` (a source-level class-syntax check), which lives in `@venizia/ignis-inversion` and is re-exported by `helpers`; they are never called as resolver functions. `isClassConstructor` does not exist.
49
+ ### Type an options object with a sync-or-async callback
200
50
 
201
- #### resolveValueAsync
51
+ `ValueOrPromise<T>` is the standard shape for a callback that may or may not be async.
202
52
 
203
53
  ```typescript
204
- const resolveValueAsync: <T>(valueOrResolver: TValueOrAsyncResolver<T>) => Promise<T>;
205
- ```
206
-
207
- Async version of `resolveValue`. Same behavior, but awaits the result if the resolver returns a `Promise`.
54
+ import { ValueOrPromise } from '@venizia/ignis-helpers';
208
55
 
209
- #### resolveClass
210
-
211
- ```typescript
212
- const resolveClass: <T>(
213
- ref: TClass<T> | TResolver<TClass<T>> | string,
214
- ) => TClass<T> | string;
56
+ function connect(opts: { host: string; onReady?: () => ValueOrPromise<void> }) {}
215
57
  ```
216
58
 
217
- Resolves lazy class references. Handles three cases:
218
- - **String binding keys** -- returned as-is (for DI key lookups)
219
- - **Class constructors** -- returned as-is
220
- - **Resolver functions** -- invoked and result returned
59
+ ### Detect the current runtime
221
60
 
222
- #### Resolution Example
61
+ `RuntimeModules.detect()` returns `'bun'` when `typeof Bun !== 'undefined'`, `'node'` otherwise.
223
62
 
224
63
  ```typescript
225
- import { TValueOrAsyncResolver, resolveValueAsync } from '@venizia/ignis-helpers';
64
+ import { RuntimeModules } from '@venizia/ignis-helpers';
226
65
 
227
- interface DatabaseConfig {
228
- host: string;
229
- port: number;
66
+ if (RuntimeModules.isBun()) {
67
+ // Bun-specific path
230
68
  }
231
-
232
- type ConfigOption = TValueOrAsyncResolver<DatabaseConfig>;
233
-
234
- // Direct value
235
- const config1: ConfigOption = { host: 'localhost', port: 5432 };
236
-
237
- // Sync resolver
238
- const config2: ConfigOption = () => ({ host: 'localhost', port: 5432 });
239
-
240
- // Async resolver
241
- const config3: ConfigOption = async () => {
242
- const config = await fetchConfigFromVault();
243
- return config;
244
- };
245
-
246
- // Resolve any of the above uniformly
247
- const resolved = await resolveValueAsync(config3);
248
- ```
249
-
250
- ### Field Mapping Types
251
-
252
- Types for declarative field-to-type mappings, used for configuration-driven data transformation.
253
-
254
- ```typescript
255
- type TFieldMappingDataType = 'string' | 'number' | 'strings' | 'numbers' | 'boolean';
256
69
  ```
257
70
 
258
- Supported data types for field mappings.
259
-
260
- ```typescript
261
- interface IFieldMapping {
262
- name: string;
263
- type: TFieldMappingDataType;
264
- default?: string | number | Array<string> | Array<number> | boolean;
265
- }
266
- ```
71
+ ### Derive a union type from a constant class
267
72
 
268
- Defines a single field with its name, type, and optional default value.
73
+ `TConstValue<typeof X>` extracts the union of a const class's static values, so the type never drifts from the values.
269
74
 
270
75
  ```typescript
271
- type TFieldMappingNames<T extends Array<IFieldMapping>> = Extract<
272
- T[number],
273
- { type: Exclude<T[number]['type'], undefined> }
274
- >['name'];
275
- ```
76
+ import { TConstValue, RuntimeModules } from '@venizia/ignis-helpers';
276
77
 
277
- Extracts the union of field names from a field mapping array type.
278
-
279
- ```typescript
280
- type TObjectFromFieldMappings<
281
- T extends readonly {
282
- name: string;
283
- type: string;
284
- [extra: string | symbol]: any;
285
- }[],
286
- > = {
287
- [K in T[number]['name']]: /* mapped to the declared type */
288
- };
78
+ type TRuntimeModule = TConstValue<typeof RuntimeModules>; // 'node' | 'bun'
289
79
  ```
290
80
 
291
- Constructs a typed object from a field mapping array, where each key maps to its declared runtime type: `'string'` becomes `string`, `'number'` becomes `number`, `'strings'` becomes `string[]`, `'numbers'` becomes `number[]`, and `'boolean'` becomes `boolean`.
81
+ ### Resolve a value that may be eager or lazy, sync or async
292
82
 
293
- ### DI and Lifecycle Types
83
+ `resolveValueAsync` accepts a direct value, a sync resolver, or an async resolver, and always returns a `Promise`.
294
84
 
295
85
  ```typescript
296
- type TInjectionGetter = <T>(opts: { key: string | symbol }) => T;
297
- ```
86
+ import { TValueOrAsyncResolver, resolveValueAsync } from '@venizia/ignis-helpers';
298
87
 
299
- Function type for retrieving values from the IoC container by binding key.
88
+ type ConfigOption = TValueOrAsyncResolver<{ host: string }>;
300
89
 
301
- ```typescript
302
- interface IConfigurable<Options extends object = any, Result = any> {
303
- configure(opts?: Options): ValueOrPromise<Result>;
304
- }
90
+ const fromEnv: ConfigOption = async () => ({ host: process.env.DB_HOST! });
91
+ const resolved = await resolveValueAsync(fromEnv);
305
92
  ```
306
93
 
307
- Interface for components that require explicit initialization. Used by helpers and components that expose a `configure()` lifecycle method.
308
-
309
- ### JSX Types
94
+ ### Look up an HTTP header, content type, or status constant
310
95
 
311
- Re-exported from `hono/jsx` for convenience when building JSX-based views:
96
+ `HTTP` groups headers, header values, methods, and status codes under one class.
312
97
 
313
98
  ```typescript
314
- export type { Child, FC, PropsWithChildren } from 'hono/jsx';
315
- ```
316
-
317
- - `FC` -- Function component type
318
- - `Child` -- Valid child element type
319
- - `PropsWithChildren` -- Props type that includes a `children` property
320
-
321
- ### Constants
322
-
323
- #### Defaults
99
+ import { HTTP } from '@venizia/ignis-helpers';
324
100
 
325
- ```typescript
326
- class Defaults {
327
- static readonly APPLICATION_NAME: string; // process.env.APP_ENV_APPLICATION_NAME ?? 'APP'
328
- static readonly QUERY_LIMIT = 50;
329
- static readonly QUERY_OFFSET = 0;
330
- }
101
+ response.header(HTTP.Headers.CONTENT_TYPE, HTTP.HeaderValues.APPLICATION_JSON);
102
+ response.status(HTTP.ResultCodes.RS_4.NotFound);
331
103
  ```
332
104
 
333
- Application-wide defaults for query pagination and application naming.
105
+ ### Constrain a mixin's base class
334
106
 
335
- #### RuntimeModules
107
+ `TMixinTarget<T>` types a mixin factory's `Base` parameter so the returned class keeps `T`'s shape.
336
108
 
337
109
  ```typescript
338
- class RuntimeModules {
339
- static readonly NODE = 'node';
340
- static readonly BUN = 'bun';
341
-
342
- static detect(): TRuntimeModule;
343
- static isBun(): boolean;
344
- static isNode(): boolean;
345
- }
346
-
347
- type TRuntimeModule = TConstValue<typeof RuntimeModules>; // 'node' | 'bun'
348
- ```
349
-
350
- Runtime detection utility. `detect()` returns `'bun'` if `typeof Bun !== 'undefined'`, `'node'` otherwise. `isBun()` and `isNode()` are convenience methods that call `detect()` internally.
110
+ import { TMixinTarget } from '@venizia/ignis-helpers';
351
111
 
352
- #### DataTypes
353
-
354
- ```typescript
355
- class DataTypes {
356
- static readonly NUMBER = 'NUMBER';
357
- static readonly TEXT = 'TEXT';
358
- static readonly BYTE = 'BYTE';
359
- static readonly JSON = 'JSON';
360
- static readonly BOOLEAN = 'BOOLEAN';
361
-
362
- static readonly SCHEME_SET: Set<string>;
363
- static isValid(orgType: string): boolean;
112
+ function WithTimestamps<T extends TMixinTarget<BaseEntity>>(Base: T) {
113
+ return class extends Base {
114
+ createdAt = new Date();
115
+ };
364
116
  }
365
117
  ```
366
118
 
367
- Schema data type constants with validation. `SCHEME_SET` contains all valid type strings, and `isValid()` checks membership.
368
-
369
- #### HTTP
370
-
371
- The `HTTP` class groups all HTTP-related constants into nested objects.
372
-
373
- **Headers** (commonly used subset -- the full list in `packages/helpers/src/common/constants/http.ts` also covers content negotiation, CORS, security, proxy/forwarding, and rate-limit headers):
374
-
375
- | Constant | Value |
376
- |----------|-------|
377
- | `HTTP.Headers.AUTHORIZATION` | `'authorization'` |
378
- | `HTTP.Headers.CACHE_CONTROL` | `'cache-control'` |
379
- | `HTTP.Headers.CONTENT_DISPOSITION` | `'content-disposition'` |
380
- | `HTTP.Headers.CONTENT_ENCODING` | `'content-encoding'` |
381
- | `HTTP.Headers.CONTENT_LENGTH` | `'content-length'` |
382
- | `HTTP.Headers.CONTENT_TYPE` | `'content-type'` |
383
- | `HTTP.Headers.CONTENT_RANGE` | `'content-range'` |
384
- | `HTTP.Headers.ETAG` | `'etag'` |
385
- | `HTTP.Headers.LAST_MODIFIED` | `'last-modified'` |
386
- | `HTTP.Headers.REQUEST_TRACING_ID` | `'x-request-id'` |
387
- | `HTTP.Headers.REQUEST_DEVICE_INFO` | `'x-device-info'` |
388
- | `HTTP.Headers.REQUEST_CHANNEL` | `'x-request-channel'` |
389
- | `HTTP.Headers.REQUEST_COUNT_DATA` | `'x-request-count'` |
390
- | `HTTP.Headers.RESPONSE_COUNT_DATA` | `'x-response-count'` |
391
- | `HTTP.Headers.RESPONSE_FORMAT` | `'x-response-format'` |
392
-
393
- **Header Values** (commonly used subset -- the full list also covers XML, PDF, zip, image, CSS/CSV/HTML, and event-stream types):
394
-
395
- | Constant | Value |
396
- |----------|-------|
397
- | `HTTP.HeaderValues.APPLICATION_JSON` | `'application/json'` |
398
- | `HTTP.HeaderValues.APPLICATION_FORM_URLENCODED` | `'application/x-www-form-urlencoded'` |
399
- | `HTTP.HeaderValues.APPLICATION_OCTET_STREAM` | `'application/octet-stream'` |
400
- | `HTTP.HeaderValues.MULTIPART_FORM_DATA` | `'multipart/form-data'` |
401
- | `HTTP.HeaderValues.TEXT_PLAIN` | `'text/plain'` |
402
-
403
- **Methods:**
404
-
405
- | Constant | Value |
406
- |----------|-------|
407
- | `HTTP.Methods.GET` | `'get'` |
408
- | `HTTP.Methods.POST` | `'post'` |
409
- | `HTTP.Methods.PUT` | `'put'` |
410
- | `HTTP.Methods.PATCH` | `'patch'` |
411
- | `HTTP.Methods.DELETE` | `'delete'` |
412
- | `HTTP.Methods.HEAD` | `'head'` |
413
- | `HTTP.Methods.OPTIONS` | `'options'` |
414
-
415
- **Result Codes:**
416
-
417
- Status codes are grouped by class under `HTTP.ResultCodes.RS_1` through `HTTP.ResultCodes.RS_5` (e.g. `HTTP.ResultCodes.RS_4.NotFound`).
418
-
419
- | Group | Constant | Value |
420
- |-------|----------|-------|
421
- | **RS_1** (1xx) | `Continue` | `100` |
422
- | | `SwitchingProtocols` | `101` |
423
- | | `EarlyHints` | `103` |
424
- | **RS_2** (2xx) | `Ok` | `200` |
425
- | | `Created` | `201` |
426
- | | `Accepted` | `202` |
427
- | | `NonAuthoritativeInformation` | `203` |
428
- | | `NoContent` | `204` |
429
- | | `ResetContent` | `205` |
430
- | | `PartialContent` | `206` |
431
- | | `MultiStatus` | `207` |
432
- | **RS_3** (3xx) | `MovedPermanently` | `301` |
433
- | | `Found` | `302` |
434
- | | `NotModified` | `304` |
435
- | | `TemporaryRedirect` | `307` |
436
- | | `PermanentRedirect` | `308` |
437
- | **RS_4** (4xx) | `BadRequest` | `400` |
438
- | | `Unauthorized` | `401` |
439
- | | `PaymentRequired` | `402` |
440
- | | `Forbidden` | `403` |
441
- | | `NotFound` | `404` |
442
- | | `MethodNotAllowed` | `405` |
443
- | | `NotAcceptable` | `406` |
444
- | | `RequestTimeout` | `408` |
445
- | | `Conflict` | `409` |
446
- | | `Gone` | `410` |
447
- | | `LengthRequired` | `411` |
448
- | | `PreconditionFailed` | `412` |
449
- | | `ContentTooLarge` | `413` |
450
- | | `URITooLong` | `414` |
451
- | | `UnsupportedMediaType` | `415` |
452
- | | `RangeNotSatisfiable` | `416` |
453
- | | `ExpectationFailed` | `417` |
454
- | | `UnprocessableEntity` | `422` |
455
- | | `Locked` | `423` |
456
- | | `FailedDependency` | `424` |
457
- | | `TooEarly` | `425` |
458
- | | `UpgradeRequired` | `426` |
459
- | | `PreconditionRequired` | `428` |
460
- | | `TooManyRequests` | `429` |
461
- | | `RequestHeaderFieldsTooLarge` | `431` |
462
- | | `UnavailableForLegalReasons` | `451` |
463
- | **RS_5** (5xx) | `InternalServerError` | `500` |
464
- | | `NotImplemented` | `501` |
465
- | | `BadGateway` | `502` |
466
- | | `ServiceUnavailable` | `503` |
467
- | | `GatewayTimeout` | `504` |
468
- | | `HTTPVersionNotSupported` | `505` |
469
- | | `InsufficientStorage` | `507` |
470
- | | `LoopDetected` | `508` |
471
- | | `NetworkAuthenticationRequired` | `511` |
472
-
473
- **Derived Types:**
474
-
475
- ```typescript
476
- type THttpMethod = ValueOf<typeof HTTP.Methods>; // 'get' | 'post' | 'put' | ...
477
- type THttpResultCode = ValueOf<typeof HTTP.ResultCodes>; // union of the RS_1..RS_5 group objects
478
- ```
479
-
480
- #### GRPC
119
+ ### Flatten an intersection type for readable hover tooltips
481
120
 
482
- gRPC protocol constants for headers, methods, content types, and status codes.
121
+ `TPrettify<T>` collapses `A & B` into a single flat object type. IDE tooltips render that far more readably than a chain of intersections.
483
122
 
484
123
  ```typescript
485
- import { GRPC } from '@venizia/ignis-helpers';
486
- ```
487
-
488
- | Property | Type | Description |
489
- |----------|------|-------------|
490
- | `GRPC.Methods.UNARY` | `'unary'` | Single request, single response |
491
- | `GRPC.Methods.SERVER_STREAMING` | `'server_streaming'` | Single request, stream of responses |
492
- | `GRPC.Methods.CLIENT_STREAMING` | `'client_streaming'` | Stream of requests, single response |
493
- | `GRPC.Methods.BIDI_STREAMING` | `'bidi_streaming'` | Bidirectional streaming |
494
- | `GRPC.Headers.CONTENT_TYPE` | `'content-type'` | HTTP content type header |
495
- | `GRPC.Headers.TE` | `'te'` | Transfer encoding header |
496
- | `GRPC.Headers.USER_AGENT` | `'user-agent'` | User agent header |
497
- | `GRPC.Headers.GRPC_TIMEOUT` | `'grpc-timeout'` | gRPC timeout header |
498
- | `GRPC.Headers.GRPC_ENCODING` | `'grpc-encoding'` | gRPC encoding header |
499
- | `GRPC.Headers.GRPC_ACCEPT_ENCODING` | `'grpc-accept-encoding'` | gRPC accepted encodings header |
500
- | `GRPC.Headers.GRPC_MESSAGE_TYPE` | `'grpc-message-type'` | gRPC message type header |
501
- | `GRPC.Headers.GRPC_STATUS` | `'grpc-status'` | gRPC status code header |
502
- | `GRPC.Headers.GRPC_MESSAGE` | `'grpc-message'` | gRPC error message header |
503
- | `GRPC.Headers.GRPC_STATUS_DETAILS_BIN` | `'grpc-status-details-bin'` | gRPC binary status details header |
504
- | `GRPC.Headers.GRPC_PREVIOUS_RPC_ATTEMPTS` | `'grpc-previous-rpc-attempts'` | gRPC previous RPC attempts header |
505
- | `GRPC.Headers.GRPC_RETRY_PUSHBACK_MS` | `'grpc-retry-pushback-ms'` | gRPC retry pushback milliseconds header |
506
- | `GRPC.Headers.GRPC_TRACE_BIN` | `'grpc-trace-bin'` | gRPC binary trace context header |
507
- | `GRPC.Headers.GRPC_TAGS_BIN` | `'grpc-tags-bin'` | gRPC binary tags header |
508
- | `GRPC.HeaderValues.GRPC` | `'application/grpc'` | Standard gRPC content type |
509
- | `GRPC.HeaderValues.GRPC_PROTO` | `'application/grpc+proto'` | gRPC Protobuf content type |
510
- | `GRPC.HeaderValues.GRPC_JSON` | `'application/grpc+json'` | gRPC JSON content type |
511
- | `GRPC.HeaderValues.GRPC_WEB` | `'application/grpc-web'` | gRPC-Web content type |
512
- | `GRPC.HeaderValues.GRPC_WEB_PROTO` | `'application/grpc-web+proto'` | gRPC-Web Protobuf content type |
513
- | `GRPC.HeaderValues.GRPC_WEB_JSON` | `'application/grpc-web+json'` | gRPC-Web JSON content type |
514
- | `GRPC.HeaderValues.GRPC_WEB_TEXT` | `'application/grpc-web-text'` | gRPC-Web text content type |
515
- | `GRPC.ResultCodes.OK` | `0` | Success |
516
- | `GRPC.ResultCodes.CANCELLED` | `1` | Operation cancelled |
517
- | `GRPC.ResultCodes.UNKNOWN` | `2` | Unknown error |
518
- | `GRPC.ResultCodes.INVALID_ARGUMENT` | `3` | Invalid argument |
519
- | `GRPC.ResultCodes.DEADLINE_EXCEEDED` | `4` | Deadline exceeded |
520
- | `GRPC.ResultCodes.NOT_FOUND` | `5` | Not found |
521
- | `GRPC.ResultCodes.ALREADY_EXISTS` | `6` | Already exists |
522
- | `GRPC.ResultCodes.PERMISSION_DENIED` | `7` | Permission denied |
523
- | `GRPC.ResultCodes.RESOURCE_EXHAUSTED` | `8` | Resource exhausted |
524
- | `GRPC.ResultCodes.FAILED_PRECONDITION` | `9` | Failed precondition |
525
- | `GRPC.ResultCodes.ABORTED` | `10` | Operation aborted |
526
- | `GRPC.ResultCodes.OUT_OF_RANGE` | `11` | Out of range |
527
- | `GRPC.ResultCodes.UNIMPLEMENTED` | `12` | Unimplemented |
528
- | `GRPC.ResultCodes.INTERNAL` | `13` | Internal server error |
529
- | `GRPC.ResultCodes.UNAVAILABLE` | `14` | Service unavailable |
530
- | `GRPC.ResultCodes.DATA_LOSS` | `15` | Unrecoverable data loss |
531
- | `GRPC.ResultCodes.UNAUTHENTICATED` | `16` | Unauthenticated |
124
+ import { TPrettify } from '@venizia/ignis-helpers';
532
125
 
533
- ```typescript
534
- // Derived types
535
- type TGrpcMethod = ValueOf<typeof GRPC.Methods>;
536
- type TGrpcResultCode = ValueOf<typeof GRPC.ResultCodes>;
126
+ type Merged = TPrettify<{ id: string } & { name: string }>;
127
+ // Hovers as { id: string; name: string } instead of { id: string } & { name: string }
537
128
  ```
538
129
 
539
- #### MimeTypes
540
-
541
- ```typescript
542
- class MimeTypes {
543
- static readonly UNKNOWN = 'unknown';
544
- static readonly IMAGE = 'image';
545
- static readonly VIDEO = 'video';
546
- static readonly TEXT = 'text';
547
- }
548
-
549
- type TMimeTypes = TConstValue<typeof MimeTypes>; // 'unknown' | 'image' | 'video' | 'text'
550
- ```
130
+ See the [Full reference](/extensions/helpers/types/reference) for every type, resolver function, and constant - including the full `HTTP.Headers`, `HTTP.ResultCodes`, and `GRPC` tables.
551
131
 
552
- Content type classification constants.
132
+ ## See also
553
133
 
554
- ## See Also
134
+ - [Full reference](/extensions/helpers/types/reference) - every type, resolver, and constant class
135
+ - [Dependency Injection](/guides/core-concepts/dependency-injection) - `TInjectionGetter` and DI-adjacent types in use
136
+ - [Repository Mixins](/references/base/repositories/mixins) - `TMixinTarget` in use
137
+ - [Helpers Overview](/extensions/helpers/) - all available helpers
555
138
 
556
- - **Guides:**
557
- - [Dependency Injection](/guides/core-concepts/dependency-injection) - DI types and patterns
558
- - [Repositories](/guides/core-concepts/persistent/repositories) - Repository mixins use these types
139
+ **Files:**
559
140
 
560
- - **References:**
561
- - [Repository Mixins](/references/base/repositories/mixins) - Uses mixin types
562
- - [Utilities Index](/references/utilities/index) - Type utilities
141
+ - [`packages/helpers/src/common/types.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/common/types.ts) - utility types, resolvers, field-mapping types
142
+ - [`packages/helpers/src/common/constants/index.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/common/constants/index.ts) - constants barrel