@venizia/ignis-atlas 0.1.0-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.
- package/LICENSE.md +104 -0
- package/README.md +144 -0
- package/dist/cjs/cli/modes.d.ts +29 -0
- package/dist/cjs/cli/modes.d.ts.map +1 -0
- package/dist/cjs/cli/modes.js +70 -0
- package/dist/cjs/cli/modes.js.map +1 -0
- package/dist/cjs/cli.d.ts +3 -0
- package/dist/cjs/cli.d.ts.map +1 -0
- package/dist/cjs/cli.js +60 -0
- package/dist/cjs/cli.js.map +1 -0
- package/dist/cjs/common/constants.d.ts +22 -0
- package/dist/cjs/common/constants.d.ts.map +1 -0
- package/dist/cjs/common/constants.js +32 -0
- package/dist/cjs/common/constants.js.map +1 -0
- package/dist/cjs/common/index.d.ts +3 -0
- package/dist/cjs/common/index.d.ts.map +1 -0
- package/dist/cjs/common/index.js +19 -0
- package/dist/cjs/common/index.js.map +1 -0
- package/dist/cjs/common/logger.d.ts +21 -0
- package/dist/cjs/common/logger.d.ts.map +1 -0
- package/dist/cjs/common/logger.js +50 -0
- package/dist/cjs/common/logger.js.map +1 -0
- package/dist/cjs/common/types.d.ts +5 -0
- package/dist/cjs/common/types.d.ts.map +1 -0
- package/dist/cjs/common/types.js +3 -0
- package/dist/cjs/common/types.js.map +1 -0
- package/dist/cjs/corpus/chunker.d.ts +12 -0
- package/dist/cjs/corpus/chunker.d.ts.map +1 -0
- package/dist/cjs/corpus/chunker.js +298 -0
- package/dist/cjs/corpus/chunker.js.map +1 -0
- package/dist/cjs/corpus/common/index.d.ts +2 -0
- package/dist/cjs/corpus/common/index.d.ts.map +1 -0
- package/dist/cjs/corpus/common/index.js +18 -0
- package/dist/cjs/corpus/common/index.js.map +1 -0
- package/dist/cjs/corpus/common/types.d.ts +37 -0
- package/dist/cjs/corpus/common/types.d.ts.map +1 -0
- package/dist/cjs/corpus/common/types.js +3 -0
- package/dist/cjs/corpus/common/types.js.map +1 -0
- package/dist/cjs/corpus/frontmatter.d.ts +13 -0
- package/dist/cjs/corpus/frontmatter.d.ts.map +1 -0
- package/dist/cjs/corpus/frontmatter.js +31 -0
- package/dist/cjs/corpus/frontmatter.js.map +1 -0
- package/dist/cjs/corpus/index.d.ts +6 -0
- package/dist/cjs/corpus/index.d.ts.map +1 -0
- package/dist/cjs/corpus/index.js +22 -0
- package/dist/cjs/corpus/index.js.map +1 -0
- package/dist/cjs/corpus/loader.d.ts +16 -0
- package/dist/cjs/corpus/loader.d.ts.map +1 -0
- package/dist/cjs/corpus/loader.js +72 -0
- package/dist/cjs/corpus/loader.js.map +1 -0
- package/dist/cjs/corpus/roots.d.ts +9 -0
- package/dist/cjs/corpus/roots.d.ts.map +1 -0
- package/dist/cjs/corpus/roots.js +30 -0
- package/dist/cjs/corpus/roots.js.map +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/protocol/common/constants.d.ts +9 -0
- package/dist/cjs/protocol/common/constants.d.ts.map +1 -0
- package/dist/cjs/protocol/common/constants.js +13 -0
- package/dist/cjs/protocol/common/constants.js.map +1 -0
- package/dist/cjs/protocol/common/index.d.ts +4 -0
- package/dist/cjs/protocol/common/index.d.ts.map +1 -0
- package/dist/cjs/protocol/common/index.js +20 -0
- package/dist/cjs/protocol/common/index.js.map +1 -0
- package/dist/cjs/protocol/common/rpc-error.d.ts +9 -0
- package/dist/cjs/protocol/common/rpc-error.d.ts.map +1 -0
- package/dist/cjs/protocol/common/rpc-error.js +12 -0
- package/dist/cjs/protocol/common/rpc-error.js.map +1 -0
- package/dist/cjs/protocol/common/types.d.ts +32 -0
- package/dist/cjs/protocol/common/types.d.ts.map +1 -0
- package/dist/cjs/protocol/common/types.js +3 -0
- package/dist/cjs/protocol/common/types.js.map +1 -0
- package/dist/cjs/protocol/index.d.ts +3 -0
- package/dist/cjs/protocol/index.d.ts.map +1 -0
- package/dist/cjs/protocol/index.js +19 -0
- package/dist/cjs/protocol/index.js.map +1 -0
- package/dist/cjs/protocol/transport.d.ts +28 -0
- package/dist/cjs/protocol/transport.d.ts.map +1 -0
- package/dist/cjs/protocol/transport.js +155 -0
- package/dist/cjs/protocol/transport.js.map +1 -0
- package/dist/cjs/search/common/constants.d.ts +23 -0
- package/dist/cjs/search/common/constants.d.ts.map +1 -0
- package/dist/cjs/search/common/constants.js +56 -0
- package/dist/cjs/search/common/constants.js.map +1 -0
- package/dist/cjs/search/common/index.d.ts +3 -0
- package/dist/cjs/search/common/index.d.ts.map +1 -0
- package/dist/cjs/search/common/index.js +19 -0
- package/dist/cjs/search/common/index.js.map +1 -0
- package/dist/cjs/search/common/types.d.ts +18 -0
- package/dist/cjs/search/common/types.d.ts.map +1 -0
- package/dist/cjs/search/common/types.js +3 -0
- package/dist/cjs/search/common/types.js.map +1 -0
- package/dist/cjs/search/index.d.ts +4 -0
- package/dist/cjs/search/index.d.ts.map +1 -0
- package/dist/cjs/search/index.js +20 -0
- package/dist/cjs/search/index.js.map +1 -0
- package/dist/cjs/search/planner.d.ts +13 -0
- package/dist/cjs/search/planner.d.ts.map +1 -0
- package/dist/cjs/search/planner.js +58 -0
- package/dist/cjs/search/planner.js.map +1 -0
- package/dist/cjs/search/store.d.ts +37 -0
- package/dist/cjs/search/store.d.ts.map +1 -0
- package/dist/cjs/search/store.js +141 -0
- package/dist/cjs/search/store.js.map +1 -0
- package/dist/cjs/server/freshness.d.ts +40 -0
- package/dist/cjs/server/freshness.d.ts.map +1 -0
- package/dist/cjs/server/freshness.js +85 -0
- package/dist/cjs/server/freshness.js.map +1 -0
- package/dist/cjs/server.d.ts +12 -0
- package/dist/cjs/server.d.ts.map +1 -0
- package/dist/cjs/server.js +65 -0
- package/dist/cjs/server.js.map +1 -0
- package/dist/cjs/tools/common/index.d.ts +2 -0
- package/dist/cjs/tools/common/index.d.ts.map +1 -0
- package/dist/cjs/tools/common/index.js +18 -0
- package/dist/cjs/tools/common/index.js.map +1 -0
- package/dist/cjs/tools/common/schemas.d.ts +23 -0
- package/dist/cjs/tools/common/schemas.d.ts.map +1 -0
- package/dist/cjs/tools/common/schemas.js +37 -0
- package/dist/cjs/tools/common/schemas.js.map +1 -0
- package/dist/cjs/tools/get.tool.d.ts +6 -0
- package/dist/cjs/tools/get.tool.d.ts.map +1 -0
- package/dist/cjs/tools/get.tool.js +115 -0
- package/dist/cjs/tools/get.tool.js.map +1 -0
- package/dist/cjs/tools/index.d.ts +4 -0
- package/dist/cjs/tools/index.d.ts.map +1 -0
- package/dist/cjs/tools/index.js +20 -0
- package/dist/cjs/tools/index.js.map +1 -0
- package/dist/cjs/tools/search.tool.d.ts +6 -0
- package/dist/cjs/tools/search.tool.d.ts.map +1 -0
- package/dist/cjs/tools/search.tool.js +58 -0
- package/dist/cjs/tools/search.tool.js.map +1 -0
- package/dist/corpus/changelogs/2025-12-16-initial-architecture.md +145 -0
- package/dist/corpus/changelogs/2025-12-16-model-repo-datasource-refactor.md +300 -0
- package/dist/corpus/changelogs/2025-12-17-refactor.md +90 -0
- package/dist/corpus/changelogs/2025-12-18-performance-optimizations.md +130 -0
- package/dist/corpus/changelogs/2025-12-18-repository-validation-security.md +255 -0
- package/dist/corpus/changelogs/2025-12-26-nested-relations-and-generics.md +86 -0
- package/dist/corpus/changelogs/2025-12-26-transaction-support.md +57 -0
- package/dist/corpus/changelogs/2025-12-29-dynamic-binding-registration.md +104 -0
- package/dist/corpus/changelogs/2025-12-29-snowflake-uid-helper.md +100 -0
- package/dist/corpus/changelogs/2025-12-30-repository-enhancements.md +214 -0
- package/dist/corpus/changelogs/2025-12-31-json-path-filtering-array-operators.md +214 -0
- package/dist/corpus/changelogs/2025-12-31-string-id-custom-generator.md +137 -0
- package/dist/corpus/changelogs/2026-01-02-default-filter-and-repository-mixins.md +421 -0
- package/dist/corpus/changelogs/2026-01-05-range-queries-content-range.md +184 -0
- package/dist/corpus/changelogs/2026-01-06-basic-authentication.md +103 -0
- package/dist/corpus/changelogs/2026-01-07-controller-route-customization.md +190 -0
- package/dist/corpus/changelogs/2026-01-11-logger-optimization-hf-logger.md +254 -0
- package/dist/corpus/changelogs/2026-02-06-socket-io-integration-fix.md +541 -0
- package/dist/corpus/changelogs/2026-02-10-websocket-heartbeat-payload.md +173 -0
- package/dist/corpus/changelogs/2026-02-11-crypto-refactor-ecdh.md +217 -0
- package/dist/corpus/changelogs/2026-02-11-websocket-encrypted-delivery.md +209 -0
- package/dist/corpus/changelogs/2026-02-11-websocket-generic-types.md +134 -0
- package/dist/corpus/changelogs/2026-02-16-authorization-system.md +378 -0
- package/dist/corpus/changelogs/2026-02-26-core-helpers-decoupling.md +145 -0
- package/dist/corpus/changelogs/2026-02-27-jwks-authentication.md +391 -0
- package/dist/corpus/changelogs/2026-03-02-model-authorize-settings.md +155 -0
- package/dist/corpus/changelogs/2026-03-04-jwt-payload-field-codecs.md +219 -0
- package/dist/corpus/changelogs/2026-03-06-filter-offset-skip-fix.md +88 -0
- package/dist/corpus/changelogs/2026-03-10-kafka-helpers-refactor.md +225 -0
- package/dist/corpus/changelogs/2026-03-12-kafka-helpers-enhancement.md +169 -0
- package/dist/corpus/changelogs/2026-03-15-grpc-controller-system.md +281 -0
- package/dist/corpus/changelogs/2026-03-30-row-level-locking.md +134 -0
- package/dist/corpus/changelogs/2026-03-31-typescript-6-and-toolchain.md +100 -0
- package/dist/corpus/changelogs/2026-04-23-error-response-extra-fields.md +131 -0
- package/dist/corpus/changelogs/2026-05-05-refresh-token-endpoint.md +116 -0
- package/dist/corpus/changelogs/2026-05-08-crud-route-toggles-and-typed-responses.md +136 -0
- package/dist/corpus/changelogs/2026-05-20-relation-scope-default-limit.md +133 -0
- package/dist/corpus/changelogs/2026-05-21-mass-mutation-guards.md +102 -0
- package/dist/corpus/changelogs/2026-05-22-casbin-adapter-schema-qualification.md +72 -0
- package/dist/corpus/changelogs/2026-05-25-per-model-default-limit.md +68 -0
- package/dist/corpus/changelogs/2026-05-27-casbin-domain-matching-function.md +90 -0
- package/dist/corpus/changelogs/2026-06-02-authorize-scoped-rbac.md +105 -0
- package/dist/corpus/changelogs/2026-06-14-validation-codes-and-error-hardening.md +124 -0
- package/dist/corpus/changelogs/2026-06-18-auth-user-information-endpoint.md +69 -0
- package/dist/corpus/changelogs/2026-06-25-redis-helpers-refactor.md +199 -0
- package/dist/corpus/changelogs/2026-07-05-unified-repository-connectors.md +206 -0
- package/dist/corpus/changelogs/2026-07-08-typesense-advanced-search.md +72 -0
- package/dist/corpus/changelogs/2026-07-11-connectors-consistency-hardening.md +192 -0
- package/dist/corpus/changelogs/2026-07-11-postgres-driver-seam-supabase.md +146 -0
- package/dist/corpus/changelogs/2026-07-12-core-consolidation-dedup.md +127 -0
- package/dist/corpus/changelogs/2026-07-13-hardening-round.md +99 -0
- package/dist/corpus/changelogs/2026-07-14-driver-class-bundling.md +100 -0
- package/dist/corpus/changelogs/2026-07-16-error-catalog-and-structured-message.md +64 -0
- package/dist/corpus/changelogs/2026-07-16-secrets-vault-integration.md +72 -0
- package/dist/corpus/changelogs/2026-07-17-error-module-redesign.md +202 -0
- package/dist/corpus/changelogs/2026-07-17-logger-correctness-pass.md +46 -0
- package/dist/corpus/changelogs/2026-07-17-secrets-bundler-invisible-peers.md +30 -0
- package/dist/corpus/changelogs/2026-07-18-dependency-refresh.md +55 -0
- package/dist/corpus/changelogs/2026-07-18-logger-overhaul.md +104 -0
- package/dist/corpus/changelogs/2026-07-18-repository-read-retry.md +74 -0
- package/dist/corpus/changelogs/2026-07-20-casbin-custom-grants.md +72 -0
- package/dist/corpus/changelogs/2026-07-20-casbin-single-wave-extraction.md +58 -0
- package/dist/corpus/changelogs/2026-07-20-error-from-error-client.md +66 -0
- package/dist/corpus/changelogs/2026-07-21-casbin-connector-resolution-fix.md +36 -0
- package/dist/corpus/changelogs/2026-07-25-error-logging.md +129 -0
- package/dist/corpus/changelogs/2026-07-25-ignis-filter-package.md +75 -0
- package/dist/corpus/changelogs/2026-07-26-search-and-mail-error-codes.md +58 -0
- package/dist/corpus/changelogs/2026-08-01-relational-connector-lift.md +403 -0
- package/dist/corpus/changelogs/2026-08-02-sqlite-and-pglite-connectors.md +177 -0
- package/dist/corpus/changelogs/2026-08-05-search-dialect-relational-parity.md +90 -0
- package/dist/corpus/changelogs/2026-08-06-aes-pbkdf2-and-key-rotation.md +131 -0
- package/dist/corpus/changelogs/2026-08-07-default-query-by.md +62 -0
- package/dist/corpus/changelogs/2026-08-07-nested-fields-and-order-validation.md +75 -0
- package/dist/corpus/changelogs/2026-08-07-typesense-multi-search-transport.md +97 -0
- package/dist/corpus/changelogs/2026-08-12-json-log-arguments.md +69 -0
- package/dist/corpus/changelogs/2026-08-13-browser-pure-kernel.md +130 -0
- package/dist/corpus/changelogs/2026-08-18-esm-builds-and-one-default-stack.md +104 -0
- package/dist/corpus/changelogs/2026-08-18-opaque-uid-helper.md +43 -0
- package/dist/corpus/changelogs/2026-08-19-browser-bff-multi-tab.md +88 -0
- package/dist/corpus/changelogs/2026-08-19-service-authentication-phase-1.md +157 -0
- package/dist/corpus/changelogs/2026-08-21-service-authentication-strategy.md +127 -0
- package/dist/corpus/changelogs/2026-08-22-logger-color-off-outside-development.md +48 -0
- package/dist/corpus/changelogs/2026-08-24-query-wrapper-schemas.md +77 -0
- package/dist/corpus/changelogs/2026-08-29-casbin-domain-hierarchy.md +66 -0
- package/dist/corpus/changelogs/2026-08-30-authorize-no-enforcer-fails-closed.md +60 -0
- package/dist/corpus/changelogs/2026-08-30-crypto-hashing.md +158 -0
- package/dist/corpus/changelogs/2026-08-30-policy-definition-extra-variants.md +62 -0
- package/dist/corpus/changelogs/2026-08-30-row-scope-filter.md +221 -0
- package/dist/corpus/changelogs/2026-08-30-search-connector-health-and-import-contract.md +46 -0
- package/dist/corpus/changelogs/2026-08-30-tree-and-recursive-sql.md +188 -0
- package/dist/corpus/changelogs/2026-08-30-typed-where-clauses.md +114 -0
- package/dist/corpus/changelogs/2026-08-31-entity-id-brand.md +70 -0
- package/dist/corpus/changelogs/2026-08-31-event-bus-retry.md +143 -0
- package/dist/corpus/changelogs/2026-08-31-policy-domain-split-release-b.md +54 -0
- package/dist/corpus/changelogs/2026-08-31-policy-domain-split.md +175 -0
- package/dist/corpus/changelogs/2026-08-31-scope-filter-boot-checks.md +77 -0
- package/dist/corpus/changelogs/2026-09-02-bundle-safe-helpers.md +71 -0
- package/dist/corpus/changelogs/2026-09-02-decorator-artifact-registration.md +119 -0
- package/dist/corpus/changelogs/2026-09-03-deprecated-boot-api-removed.md +133 -0
- package/dist/corpus/changelogs/2026-09-04-dependency-floors-raised.md +61 -0
- package/dist/corpus/changelogs/2026-09-05-boot-checks.md +57 -0
- package/dist/corpus/changelogs/2026-09-05-core-drops-boot-dependency.md +44 -0
- package/dist/corpus/changelogs/2026-09-05-list-response-contract.md +74 -0
- package/dist/corpus/changelogs/2026-09-06-bun-serve-options.md +51 -0
- package/dist/corpus/changelogs/2026-09-06-ignis-atlas.md +54 -0
- package/dist/corpus/changelogs/2026-09-06-repository-inheritance-and-quiet-cli.md +46 -0
- package/dist/corpus/changelogs/2026-09-06-shared-singletons-across-module-copies.md +43 -0
- package/dist/corpus/changelogs/index.md +135 -0
- package/dist/corpus/changelogs/planned-schema-migrator.md +553 -0
- package/dist/corpus/changelogs/template.md +64 -0
- package/dist/corpus/wiki/best-practices/api-usage-examples.md +617 -0
- package/dist/corpus/wiki/best-practices/architectural-patterns.md +437 -0
- package/dist/corpus/wiki/best-practices/architecture-decisions.md +524 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/advanced-patterns.md +283 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/constants-configuration.md +240 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/control-flow.md +280 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/documentation.md +241 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/function-patterns.md +178 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/index.md +114 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/naming-conventions.md +200 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/route-definitions.md +205 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/tooling.md +168 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/type-safety.md +199 -0
- package/dist/corpus/wiki/best-practices/common-pitfalls.md +447 -0
- package/dist/corpus/wiki/best-practices/contribution-workflow.md +211 -0
- package/dist/corpus/wiki/best-practices/data-modeling.md +548 -0
- package/dist/corpus/wiki/best-practices/deployment-strategies.md +736 -0
- package/dist/corpus/wiki/best-practices/error-handling.md +604 -0
- package/dist/corpus/wiki/best-practices/index.md +206 -0
- package/dist/corpus/wiki/best-practices/performance-optimization.md +437 -0
- package/dist/corpus/wiki/best-practices/security-guidelines.md +523 -0
- package/dist/corpus/wiki/best-practices/testing-strategies.md +639 -0
- package/dist/corpus/wiki/best-practices/troubleshooting-tips.md +227 -0
- package/dist/corpus/wiki/extensions/atlas/index.md +65 -0
- package/dist/corpus/wiki/extensions/components/api-reference.md +268 -0
- package/dist/corpus/wiki/extensions/components/authentication/api.md +643 -0
- package/dist/corpus/wiki/extensions/components/authentication/errors.md +211 -0
- package/dist/corpus/wiki/extensions/components/authentication/index.md +171 -0
- package/dist/corpus/wiki/extensions/components/authentication/usage.md +464 -0
- package/dist/corpus/wiki/extensions/components/authorization/api.md +1509 -0
- package/dist/corpus/wiki/extensions/components/authorization/errors.md +397 -0
- package/dist/corpus/wiki/extensions/components/authorization/getting-started.md +227 -0
- package/dist/corpus/wiki/extensions/components/authorization/index.md +155 -0
- package/dist/corpus/wiki/extensions/components/authorization/usage.md +587 -0
- package/dist/corpus/wiki/extensions/components/health-check.md +227 -0
- package/dist/corpus/wiki/extensions/components/index.md +26 -0
- package/dist/corpus/wiki/extensions/components/mail/api.md +773 -0
- package/dist/corpus/wiki/extensions/components/mail/errors.md +190 -0
- package/dist/corpus/wiki/extensions/components/mail/index.md +182 -0
- package/dist/corpus/wiki/extensions/components/mail/usage.md +370 -0
- package/dist/corpus/wiki/extensions/components/request-tracker.md +152 -0
- package/dist/corpus/wiki/extensions/components/socket-io/api.md +728 -0
- package/dist/corpus/wiki/extensions/components/socket-io/errors.md +119 -0
- package/dist/corpus/wiki/extensions/components/socket-io/index.md +116 -0
- package/dist/corpus/wiki/extensions/components/socket-io/usage.md +429 -0
- package/dist/corpus/wiki/extensions/components/static-asset/api.md +593 -0
- package/dist/corpus/wiki/extensions/components/static-asset/errors.md +159 -0
- package/dist/corpus/wiki/extensions/components/static-asset/index.md +160 -0
- package/dist/corpus/wiki/extensions/components/static-asset/usage.md +253 -0
- package/dist/corpus/wiki/extensions/components/template/api-page.md +125 -0
- package/dist/corpus/wiki/extensions/components/template/errors-page.md +100 -0
- package/dist/corpus/wiki/extensions/components/template/index.md +104 -0
- package/dist/corpus/wiki/extensions/components/template/setup-page.md +134 -0
- package/dist/corpus/wiki/extensions/components/template/single-page.md +132 -0
- package/dist/corpus/wiki/extensions/components/template/usage-page.md +127 -0
- package/dist/corpus/wiki/extensions/components/websocket/api.md +416 -0
- package/dist/corpus/wiki/extensions/components/websocket/errors.md +128 -0
- package/dist/corpus/wiki/extensions/components/websocket/index.md +127 -0
- package/dist/corpus/wiki/extensions/components/websocket/usage.md +257 -0
- package/dist/corpus/wiki/extensions/helpers/cron/index.md +116 -0
- package/dist/corpus/wiki/extensions/helpers/crypto/index.md +136 -0
- package/dist/corpus/wiki/extensions/helpers/crypto/reference.md +544 -0
- package/dist/corpus/wiki/extensions/helpers/env/index.md +119 -0
- package/dist/corpus/wiki/extensions/helpers/error/index.md +373 -0
- package/dist/corpus/wiki/extensions/helpers/index.md +63 -0
- package/dist/corpus/wiki/extensions/helpers/inversion/index.md +142 -0
- package/dist/corpus/wiki/extensions/helpers/inversion/reference.md +531 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/admin.md +210 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/compile-binary.md +125 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/consumer.md +422 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/examples.md +154 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/index.md +84 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/producer.md +408 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/schema-registry.md +194 -0
- package/dist/corpus/wiki/extensions/helpers/logger/hf-logger.md +220 -0
- package/dist/corpus/wiki/extensions/helpers/logger/index.md +156 -0
- package/dist/corpus/wiki/extensions/helpers/logger/pino.md +107 -0
- package/dist/corpus/wiki/extensions/helpers/logger/reference.md +938 -0
- package/dist/corpus/wiki/extensions/helpers/network/api.md +1067 -0
- package/dist/corpus/wiki/extensions/helpers/network/index.md +189 -0
- package/dist/corpus/wiki/extensions/helpers/queue/index.md +165 -0
- package/dist/corpus/wiki/extensions/helpers/queue/reference.md +490 -0
- package/dist/corpus/wiki/extensions/helpers/redis/index.md +159 -0
- package/dist/corpus/wiki/extensions/helpers/redis/reference.md +784 -0
- package/dist/corpus/wiki/extensions/helpers/secrets/index.md +136 -0
- package/dist/corpus/wiki/extensions/helpers/socket-io/api.md +618 -0
- package/dist/corpus/wiki/extensions/helpers/socket-io/index.md +167 -0
- package/dist/corpus/wiki/extensions/helpers/storage/api.md +1021 -0
- package/dist/corpus/wiki/extensions/helpers/storage/index.md +162 -0
- package/dist/corpus/wiki/extensions/helpers/template/index.md +69 -0
- package/dist/corpus/wiki/extensions/helpers/template/single-page.md +126 -0
- package/dist/corpus/wiki/extensions/helpers/types/index.md +143 -0
- package/dist/corpus/wiki/extensions/helpers/types/reference.md +708 -0
- package/dist/corpus/wiki/extensions/helpers/uid/index.md +259 -0
- package/dist/corpus/wiki/extensions/helpers/websocket/api.md +888 -0
- package/dist/corpus/wiki/extensions/helpers/websocket/index.md +139 -0
- package/dist/corpus/wiki/extensions/helpers/worker-thread/index.md +142 -0
- package/dist/corpus/wiki/extensions/helpers/worker-thread/reference.md +434 -0
- package/dist/corpus/wiki/extensions/index.md +46 -0
- package/dist/corpus/wiki/guides/core-concepts/application/bootstrapping.md +274 -0
- package/dist/corpus/wiki/guides/core-concepts/application/index.md +239 -0
- package/dist/corpus/wiki/guides/core-concepts/components-guide.md +513 -0
- package/dist/corpus/wiki/guides/core-concepts/components.md +155 -0
- package/dist/corpus/wiki/guides/core-concepts/dependency-injection.md +336 -0
- package/dist/corpus/wiki/guides/core-concepts/grpc-controllers.md +296 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/datasources.md +195 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/index.md +132 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/models.md +331 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/pglite.md +218 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/postgres-drivers.md +207 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/repositories.md +311 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/search-meilisearch.md +195 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/search-typesense.md +443 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/sqlite.md +296 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/transactions.md +238 -0
- package/dist/corpus/wiki/guides/core-concepts/rest-controllers.md +465 -0
- package/dist/corpus/wiki/guides/core-concepts/secrets-vault.md +177 -0
- package/dist/corpus/wiki/guides/core-concepts/services.md +389 -0
- package/dist/corpus/wiki/guides/get-started/5-minute-quickstart.md +163 -0
- package/dist/corpus/wiki/guides/get-started/philosophy.md +135 -0
- package/dist/corpus/wiki/guides/get-started/setup.md +136 -0
- package/dist/corpus/wiki/guides/index.md +82 -0
- package/dist/corpus/wiki/guides/migrations/boot-api-removal-migration.md +79 -0
- package/dist/corpus/wiki/guides/migrations/redis-helpers-migration.md +178 -0
- package/dist/corpus/wiki/guides/migrations/scoped-rbac-migration.md +300 -0
- package/dist/corpus/wiki/guides/migrations/unified-connectors-migration.md +114 -0
- package/dist/corpus/wiki/guides/reference/glossary.md +250 -0
- package/dist/corpus/wiki/guides/tutorials/building-a-crud-api.md +704 -0
- package/dist/corpus/wiki/guides/tutorials/complete-installation.md +440 -0
- package/dist/corpus/wiki/guides/tutorials/ecommerce-api.md +1442 -0
- package/dist/corpus/wiki/guides/tutorials/realtime-chat.md +1571 -0
- package/dist/corpus/wiki/guides/tutorials/testing.md +264 -0
- package/dist/corpus/wiki/index.md +5 -0
- package/dist/corpus/wiki/public/apple-touch-icon.png +0 -0
- package/dist/corpus/wiki/public/logo.svg +1 -0
- package/dist/corpus/wiki/public/og-image.png +0 -0
- package/dist/corpus/wiki/public/site.webmanifest +11 -0
- package/dist/corpus/wiki/references/base/application.md +482 -0
- package/dist/corpus/wiki/references/base/bootstrapping.md +351 -0
- package/dist/corpus/wiki/references/base/components.md +883 -0
- package/dist/corpus/wiki/references/base/connectors.md +121 -0
- package/dist/corpus/wiki/references/base/controllers.md +1022 -0
- package/dist/corpus/wiki/references/base/datasources-reference.md +598 -0
- package/dist/corpus/wiki/references/base/datasources.md +165 -0
- package/dist/corpus/wiki/references/base/dependency-injection.md +423 -0
- package/dist/corpus/wiki/references/base/filter-system/application-usage.md +215 -0
- package/dist/corpus/wiki/references/base/filter-system/array-operators.md +135 -0
- package/dist/corpus/wiki/references/base/filter-system/comparison-operators.md +110 -0
- package/dist/corpus/wiki/references/base/filter-system/default-filter.md +267 -0
- package/dist/corpus/wiki/references/base/filter-system/fields-order-pagination.md +244 -0
- package/dist/corpus/wiki/references/base/filter-system/index.md +149 -0
- package/dist/corpus/wiki/references/base/filter-system/json-filtering.md +122 -0
- package/dist/corpus/wiki/references/base/filter-system/list-operators.md +56 -0
- package/dist/corpus/wiki/references/base/filter-system/logical-operators.md +148 -0
- package/dist/corpus/wiki/references/base/filter-system/null-operators.md +80 -0
- package/dist/corpus/wiki/references/base/filter-system/pattern-matching.md +105 -0
- package/dist/corpus/wiki/references/base/filter-system/quick-reference.md +172 -0
- package/dist/corpus/wiki/references/base/filter-system/range-operators.md +53 -0
- package/dist/corpus/wiki/references/base/filter-system/tips.md +154 -0
- package/dist/corpus/wiki/references/base/filter-system/use-cases.md +394 -0
- package/dist/corpus/wiki/references/base/grpc-controllers.md +1020 -0
- package/dist/corpus/wiki/references/base/index.md +112 -0
- package/dist/corpus/wiki/references/base/middlewares.md +543 -0
- package/dist/corpus/wiki/references/base/models-reference.md +886 -0
- package/dist/corpus/wiki/references/base/models.md +154 -0
- package/dist/corpus/wiki/references/base/providers.md +728 -0
- package/dist/corpus/wiki/references/base/repositories/advanced.md +627 -0
- package/dist/corpus/wiki/references/base/repositories/index.md +152 -0
- package/dist/corpus/wiki/references/base/repositories/mixins.md +103 -0
- package/dist/corpus/wiki/references/base/repositories/relations.md +379 -0
- package/dist/corpus/wiki/references/base/repositories/soft-deletable.md +307 -0
- package/dist/corpus/wiki/references/base/secrets.md +267 -0
- package/dist/corpus/wiki/references/base/services.md +417 -0
- package/dist/corpus/wiki/references/configuration/environment-variables.md +498 -0
- package/dist/corpus/wiki/references/configuration/index.md +132 -0
- package/dist/corpus/wiki/references/index.md +172 -0
- package/dist/corpus/wiki/references/quick-reference.md +594 -0
- package/dist/corpus/wiki/references/utilities/date.md +50 -0
- package/dist/corpus/wiki/references/utilities/duration.md +85 -0
- package/dist/corpus/wiki/references/utilities/index.md +81 -0
- package/dist/corpus/wiki/references/utilities/jsx-reference.md +298 -0
- package/dist/corpus/wiki/references/utilities/jsx.md +131 -0
- package/dist/corpus/wiki/references/utilities/module.md +110 -0
- package/dist/corpus/wiki/references/utilities/parse.md +55 -0
- package/dist/corpus/wiki/references/utilities/performance.md +54 -0
- package/dist/corpus/wiki/references/utilities/promise.md +54 -0
- package/dist/corpus/wiki/references/utilities/request.md +85 -0
- package/dist/corpus/wiki/references/utilities/retry.md +148 -0
- package/dist/corpus/wiki/references/utilities/schema.md +69 -0
- package/dist/corpus/wiki/references/utilities/statuses-reference.md +360 -0
- package/dist/corpus/wiki/references/utilities/statuses.md +122 -0
- package/package.json +74 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Module Utility
|
|
3
|
+
description: Loads an optional peer dependency with a clear install error, and without letting the bundler see the specifier
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-27
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Module Utility
|
|
9
|
+
|
|
10
|
+
`ModuleUtility` loads an optional peer dependency. IGNIS components depend on packages the framework does not bundle - `nodemailer` for mail, `node-vault` for secrets. Loading one through `ModuleUtility` buys you two things: a missing package throws an install instruction instead of a cryptic crash, and the specifier stays invisible to `Bun.build`.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
This is how the secrets helper reaches `node-vault`:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { ModuleUtility } from '@venizia/ignis-helpers';
|
|
18
|
+
|
|
19
|
+
// Fails fast with a clear install instruction if the peer is absent.
|
|
20
|
+
ModuleUtility.assertInstalled({
|
|
21
|
+
scope: 'HashiCorpVaultHelper',
|
|
22
|
+
modules: ['node-vault'],
|
|
23
|
+
allowRegistered: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// The specifier is a parameter, so Bun.build never sees it.
|
|
27
|
+
const vault = await ModuleUtility.load({ module: 'node-vault' });
|
|
28
|
+
const client = vault.default({ endpoint, apiVersion: 'v1' });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Methods
|
|
32
|
+
|
|
33
|
+
| Method | Signature | What it does |
|
|
34
|
+
|--------|-----------|---------------|
|
|
35
|
+
| `load` | `load<T>(opts: { module: string }): Promise<T>` | Imports the module. Use this everywhere except a constructor |
|
|
36
|
+
| `loadSync` | `loadSync<T>(opts: { module: string }): T` | Same, without awaiting - for a constructor or any path that cannot be async |
|
|
37
|
+
| `assertInstalled` | `assertInstalled(opts: { modules: Array<string>; scope?: string; allowRegistered?: boolean }): void` | Presence check only. Resolves each module in order and throws on the first miss, without executing any of them |
|
|
38
|
+
| `register` | `register(opts: { modules: Record<string, AnyType> }): void` | Hands the framework peers the application already holds. `load` and `loadSync` serve a registered specifier from memory, with no filesystem lookup |
|
|
39
|
+
|
|
40
|
+
### `allowRegistered`
|
|
41
|
+
|
|
42
|
+
`assertInstalled` reports what is on disk. Set `allowRegistered` to count a `register` entry as present too.
|
|
43
|
+
|
|
44
|
+
Set it only where `load` or `loadSync` is what finally loads the module. A caller that resolves the specifier itself cannot see the registry - `pino.transport()` resolves inside a worker thread, and the gRPC adapter uses its own `createRequire`. For those, counting a registration as installed would replace a precise error with an opaque one.
|
|
45
|
+
|
|
46
|
+
## Error message format
|
|
47
|
+
|
|
48
|
+
| `scope` | Message |
|
|
49
|
+
|---------|---------|
|
|
50
|
+
| provided | `[ModuleUtility.<method>] <module> is required for <scope>. Please install '<module>'` |
|
|
51
|
+
| omitted | `[ModuleUtility.<method>] <module> is required. Please install '<module>'` |
|
|
52
|
+
|
|
53
|
+
## Why not a plain import
|
|
54
|
+
|
|
55
|
+
`Bun.build` resolves a literal specifier at bundle time. A literal `require('mailgun.js')` anywhere reachable from an entry point forces every consumer who compiles a binary to install that peer or list it in `external` - even a consumer who never touches mail.
|
|
56
|
+
|
|
57
|
+
A `const` does not help. `minify: { syntax: true }` folds `const s = 'mailgun.js'; import(s)` straight back into a resolvable literal.
|
|
58
|
+
|
|
59
|
+
Only a specifier that crosses a function boundary survives as a runtime import. That is the whole reason `ModuleUtility` takes the module name as a parameter.
|
|
60
|
+
|
|
61
|
+
## Compiled binaries
|
|
62
|
+
|
|
63
|
+
Runtime resolution needs a `node_modules` to resolve against. A `bun build --compile` binary usually runs without one - the deployment ships the executable and nothing else - so a peer the application genuinely installed is still unreachable at runtime, and the component that needs it dies at boot with the install hint.
|
|
64
|
+
|
|
65
|
+
**Check the component's options first.** Every component that reaches a peer this way takes it through its own options:
|
|
66
|
+
|
|
67
|
+
| Component | Option | You pass |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Mail transports | `module` | the `nodemailer` or `mailgun.js` module |
|
|
70
|
+
| gRPC component | `module` | `{ connect, protocol }` from `@connectrpc/connect` |
|
|
71
|
+
| `HashiCorpVaultHelper` | `client` | an already-built vault client |
|
|
72
|
+
| `DotenvVaultHelper` | `decode` | your own decode function |
|
|
73
|
+
|
|
74
|
+
Prefer the option. It is typed, it lands where it is used, and no ordering can defeat it.
|
|
75
|
+
|
|
76
|
+
`register` is the fallback for a peer the framework reaches with no options seam in between. The static import is what pulls the library into the binary; `register` is what lets the framework find it there:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { ModuleUtility } from '@venizia/ignis-helpers';
|
|
80
|
+
import * as vault from 'node-vault';
|
|
81
|
+
|
|
82
|
+
// At the entrypoint, before anything that reaches the peer runs.
|
|
83
|
+
ModuleUtility.register({ modules: { 'node-vault': vault } });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The registry is keyed by specifier and the value is returned as-is: what you register under `node-vault` is exactly what `load({ module: 'node-vault' })` hands the caller. `import * as` gives the right shape for a CommonJS peer.
|
|
87
|
+
|
|
88
|
+
Register before the consumer runs. Nothing enforces that ordering, which is the reason to prefer an options seam wherever one exists.
|
|
89
|
+
|
|
90
|
+
`register` cannot help a consumer that resolves the specifier itself. A `pino` transport target loads inside a worker thread the registry never reaches, so `pino-pretty` and `pino-roll` must be installed on disk.
|
|
91
|
+
|
|
92
|
+
Registration is only worth it for the compiled-binary case. An application running from source resolves its peers from `node_modules` already.
|
|
93
|
+
|
|
94
|
+
## Notes
|
|
95
|
+
|
|
96
|
+
- **Resolution is rooted at `process.cwd()/node_modules`** via Node's `createRequire`, so peers installed in the consuming application resolve even though this utility ships inside `packages/helpers/dist/`.
|
|
97
|
+
- **`assertInstalled` stops at the first miss.** Later entries are never checked.
|
|
98
|
+
- **`assertInstalled` never executes the module** - it only locates the file. Reach for it when you want to fail at startup rather than on first use.
|
|
99
|
+
- **Call it once, at startup, not per request.** Place it in an initialisation hook (`configure`, `binding`, `boot`).
|
|
100
|
+
- **`register` wins over the filesystem.** `load` and `loadSync` check the registry first, so a registered peer is never resolved. `assertInstalled` ignores the registry unless you set `allowRegistered`.
|
|
101
|
+
- **`register` never logs.** It runs at the entrypoint of a compiled binary, which is exactly where no logger provider exists yet.
|
|
102
|
+
- **Recommended pattern:** declare the dependency in `peerDependenciesMeta` with `optional: true`, then load it through `ModuleUtility` and pass the feature or class name as `scope` so the thrown message pinpoints the caller.
|
|
103
|
+
|
|
104
|
+
## See also
|
|
105
|
+
|
|
106
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
107
|
+
|
|
108
|
+
**Files:**
|
|
109
|
+
|
|
110
|
+
- [`packages/helpers/src/utilities/module.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/utilities/module.utility.ts)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Parse Utility
|
|
3
|
+
description: Type checking, safe numeric and boolean conversion, camelCase transforms, and array-to-map helpers
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Parse Utility
|
|
9
|
+
|
|
10
|
+
A collection of standalone functions for type checking, safe type conversion, and string/object/array transformation - the small helpers repositories and controllers reach for when normalizing loosely typed input.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { int, float, toBoolean, toCamel, keysToCamel } from '@venizia/ignis-helpers';
|
|
16
|
+
|
|
17
|
+
const myInt = int('1,000'); // => 1000
|
|
18
|
+
const myFloat = float('1,234.567', 2); // => 1234.57
|
|
19
|
+
const myBool = toBoolean('true'); // => true
|
|
20
|
+
|
|
21
|
+
const camelObject = keysToCamel({ 'first-name': 'John', 'last_name': 'Doe' });
|
|
22
|
+
// => { firstName: 'John', lastName: 'Doe' }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Functions
|
|
26
|
+
|
|
27
|
+
| Function | Signature | What it does |
|
|
28
|
+
|----------|-----------|---------------|
|
|
29
|
+
| `isInt` | `isInt(n: any): boolean` | `true` when `n` is (or coerces to) an integer. |
|
|
30
|
+
| `isFloat` | `isFloat(input: any): boolean` | `true` when `input` is (or coerces to) a non-integer number. |
|
|
31
|
+
| `int` | `int(input: any): number` | Parses `input` to an integer. Strips commas first; returns `0` for empty/invalid input. |
|
|
32
|
+
| `float` | `float(input: any, digit = 2): number` | Parses `input` to a float, rounded to `digit` places (via lodash `round`). Strips commas first; returns `0` for empty/invalid input. |
|
|
33
|
+
| `toBoolean` | `toBoolean(input: any): boolean` | `false` for `''`, `'false'`, `'0'`, `false`, `0`, `null`, `undefined`; `true` for everything else. |
|
|
34
|
+
| `toCamel` | `toCamel(s: string): string` | Converts a `snake_case` or `kebab-case` string to `camelCase`. |
|
|
35
|
+
| `keysToCamel` | `keysToCamel(object: object): any` | Recursively camelizes every key in `object`. Arrays stay arrays (their object elements are still camelized); `Date` values pass through untouched. |
|
|
36
|
+
| `parseArrayToMapWithKey` | `parseArrayToMapWithKey<T, K>(arr: T[], keyMap: K): Map<T[K], T>` | Turns an array of objects into a `Map` keyed by `keyMap`. Positional arguments, not an options object. Throws if `keyMap` is missing from an element; last element wins on duplicate keys. |
|
|
37
|
+
| `toDelimitedArray` | `toDelimitedArray(input: unknown, separator = ','): string[]` | Splits `input` on `separator` into trimmed, non-empty entries. `null`/`undefined` input returns `[]`. |
|
|
38
|
+
| `toTrimmed` | `toTrimmed(input: unknown): string` | Stringifies and trims `input`; `null`/`undefined` returns `''`. |
|
|
39
|
+
| `getUID` | `getUID(): string` | Generates a short, uppercase, `Math.random()`-based ID - not cryptographically unique. |
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- **`int`/`float` are comma-tolerant.** Both strip `,` before parsing, so `'1,000'` and `1000` behave the same - useful for user-typed numeric input.
|
|
44
|
+
- **`parseArrayToMapWithKey` breaks the options-object convention on purpose** - it takes `(arr, keyMap)` positionally, unlike every other function on this page.
|
|
45
|
+
- **`toDelimitedArray` and `toTrimmed` are the transform functions for list-shaped and string env values** - typical use is `applicationEnvironment.get(KEY, { transform: toDelimitedArray })`.
|
|
46
|
+
- **`getUID` is for short, human-glanceable identifiers**, not for anything that needs global uniqueness guarantees - use the [UID helper](/extensions/helpers/) (Snowflake-based) for that.
|
|
47
|
+
|
|
48
|
+
## See also
|
|
49
|
+
|
|
50
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
51
|
+
- [Schema Utility](/references/utilities/schema) - `snakeToCamel` for Zod schemas built on `toCamel`/`keysToCamel`
|
|
52
|
+
|
|
53
|
+
**Files:**
|
|
54
|
+
|
|
55
|
+
- [`packages/helpers/src/utilities/parse.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/utilities/parse.utility.ts)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Performance Utility
|
|
3
|
+
description: Checkpoint-based timing and a logging wrapper for measuring execution duration
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Performance Utility
|
|
9
|
+
|
|
10
|
+
Functions for measuring and logging how long a code block takes to run, built on `performance.now()` (millisecond resolution). `BaseApplication` uses `executeWithPerformanceMeasure` internally to time component, controller, and datasource registration during startup.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { executeWithPerformanceMeasure } from '@venizia/ignis-helpers';
|
|
16
|
+
|
|
17
|
+
await executeWithPerformanceMeasure({
|
|
18
|
+
logger: this.logger,
|
|
19
|
+
scope: this.registerComponents.name,
|
|
20
|
+
description: 'Register application components',
|
|
21
|
+
task: async () => {
|
|
22
|
+
// ... logic to register components
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
[RegisterComponents] START | Register application components ...
|
|
29
|
+
[RegisterComponents] DONE | Register application components | Took: 12.3456 (ms)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Functions
|
|
33
|
+
|
|
34
|
+
| Function | Signature | What it does |
|
|
35
|
+
|----------|-----------|---------------|
|
|
36
|
+
| `executeWithPerformanceMeasure` | `executeWithPerformanceMeasure<R>(opts: { logger?: ILogger; level?: string; description?: string; args?: any; scope: string; task: Function }): Promise<R>` | Runs `task` (sync or async), logging a `START` line before and a `DONE` line after with the elapsed time. Resolves to whatever `task` returns. |
|
|
37
|
+
| `getPerformanceCheckpoint` | `getPerformanceCheckpoint(): number` | Returns `performance.now()` - a starting timestamp to pass to `getExecutedPerformance`. |
|
|
38
|
+
| `getExecutedPerformance` | `getExecutedPerformance(opts: { from: number; digit?: number }): number` | Elapsed milliseconds since `from`, rounded to `digit` places (default `6`). |
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- **Defaults:** `logger` falls back to `console`, `level` to `'debug'`, `description` to `'Executing'`.
|
|
43
|
+
- **`args`, when provided, are logged as JSON (`%j`)** on both the `START` and `DONE` lines - handy for correlating a specific call's timing.
|
|
44
|
+
- **`task` is wrapped in `Promise.resolve()`**, so a plain synchronous function works exactly like an `async` one.
|
|
45
|
+
- **Prefer the checkpoint pair for granular, multi-point measurements** inside a single function, where wrapping the whole thing in `executeWithPerformanceMeasure` would not isolate the segment you care about.
|
|
46
|
+
|
|
47
|
+
## See also
|
|
48
|
+
|
|
49
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
50
|
+
- [Logger](/extensions/helpers/logger/) - the `ILogger` type accepted by `executeWithPerformanceMeasure`
|
|
51
|
+
|
|
52
|
+
**Files:**
|
|
53
|
+
|
|
54
|
+
- [`packages/helpers/src/utilities/performance.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/utilities/performance.utility.ts)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Promise Utility
|
|
3
|
+
description: Concurrency-limited task execution plus small Promise and object-path helpers
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Promise Utility
|
|
9
|
+
|
|
10
|
+
Helper functions for working with Promises - bounding concurrency, normalizing thrown values, type-guarding thenables, reading nested object paths, and firing-and-forgetting async work safely.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { executePromiseWithLimit, sleep } from '@venizia/ignis-helpers';
|
|
16
|
+
|
|
17
|
+
const tasks = [
|
|
18
|
+
() => sleep(1000).then(() => 'Task 1 done'),
|
|
19
|
+
() => sleep(500).then(() => 'Task 2 done'),
|
|
20
|
+
() => sleep(1200).then(() => 'Task 3 done'),
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const results = await executePromiseWithLimit({
|
|
24
|
+
tasks,
|
|
25
|
+
limit: 2,
|
|
26
|
+
onTaskDone: ({ result }) => console.log('A task finished:', result),
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Functions
|
|
31
|
+
|
|
32
|
+
| Function | Signature | What it does |
|
|
33
|
+
|----------|-----------|---------------|
|
|
34
|
+
| `executePromiseWithLimit` | `executePromiseWithLimit<T>(opts: { tasks: Array<() => Promise<T>>; limit: number; onTaskDone?: <R>(opts: { result: R }) => ValueOrPromise<void> }): Promise<T[]>` | Runs `tasks` with at most `limit` running concurrently. Calls `onTaskDone` each time the limit is hit and a slot frees up. Throws if `limit` is not a positive integer. |
|
|
35
|
+
| `toError` | `toError(error: unknown): Error` | Normalizes a `catch`-block value into an `Error` - passes an existing `Error` through, wraps anything else with `new Error(String(error))`. |
|
|
36
|
+
| `isPromiseLike` | `isPromiseLike<T>(value: T \| PromiseLike<T>): value is PromiseLike<T>` | Type guard: `true` when `value` is non-null and has a callable `.then`. |
|
|
37
|
+
| `getDeepProperty` | `getDeepProperty<T, V>(obj: T, path: string): V` | Reads a dot-separated `path` off `obj`. Throws if any intermediate segment is `null`/`undefined`. |
|
|
38
|
+
| `voidExecution` | `voidExecution(opts: { logger?: ILogger; scope: string; execution: ValueOrPromise<unknown> }): void` | Fire-and-forget: if `execution` is a Promise, routes a rejection to `logger.for(scope).error(...)` (or `console.error` without a logger) instead of an unhandled rejection. Synchronous values pass through untouched. |
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- **`executePromiseWithLimit` validates `limit` eagerly** - a non-integer or a value below `1` throws immediately, before any task runs.
|
|
43
|
+
- **`onTaskDone` only fires under backpressure.** It runs when the number of in-flight tasks reaches `limit` and `Promise.race` resolves one of them - not after every task.
|
|
44
|
+
- **`voidExecution` exists because `BaseHelper` cannot carry `protected` members** on classes the container instantiates anonymously (TS4094) - it is a standalone function, not a helper method, precisely so factory-built controllers can still use it.
|
|
45
|
+
- **`getDeepProperty` throws, it does not return `undefined`**, on a missing intermediate segment - wrap the call if you need optional-path semantics instead.
|
|
46
|
+
|
|
47
|
+
## See also
|
|
48
|
+
|
|
49
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
50
|
+
- [Date Utility](/references/utilities/date) - `sleep()`, used to build the tasks in the example above
|
|
51
|
+
|
|
52
|
+
**Files:**
|
|
53
|
+
|
|
54
|
+
- [`packages/helpers/src/utilities/promise.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/utilities/promise.utility.ts)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Request Utility
|
|
3
|
+
description: Multipart form parsing and secure Content-Disposition header helpers for file uploads and downloads
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Request Utility
|
|
9
|
+
|
|
10
|
+
Functions for handling HTTP request data: parsing `multipart/form-data` bodies for file uploads, and building safe, RFC-compliant `Content-Disposition` headers for downloads.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { BaseRestController, controller } from '@venizia/ignis';
|
|
16
|
+
import { parseMultipartBody, createContentDispositionHeader, HTTP } from '@venizia/ignis-helpers';
|
|
17
|
+
|
|
18
|
+
@controller({ path: '/files' })
|
|
19
|
+
export class FileController extends BaseRestController {
|
|
20
|
+
override binding() {
|
|
21
|
+
this.bindRoute({ configs: { path: '/upload', method: 'post' } }).to({
|
|
22
|
+
handler: async (ctx) => {
|
|
23
|
+
const files = await parseMultipartBody({ context: ctx, storage: 'disk', uploadDir: './uploads' });
|
|
24
|
+
return ctx.json(
|
|
25
|
+
{ message: 'Uploaded', files: files.map(f => ({ name: f.originalname, size: f.size })) },
|
|
26
|
+
HTTP.ResultCodes.RS_2.Ok,
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
this.bindRoute({ configs: { path: '/:filename', method: 'get' } }).to({
|
|
32
|
+
handler: (ctx) => {
|
|
33
|
+
const { filename } = ctx.req.valid('param');
|
|
34
|
+
ctx.header(
|
|
35
|
+
'content-disposition',
|
|
36
|
+
createContentDispositionHeader({ filename, type: 'attachment' }),
|
|
37
|
+
);
|
|
38
|
+
// ... stream the file
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Functions
|
|
46
|
+
|
|
47
|
+
| Function | Signature | What it does |
|
|
48
|
+
|----------|-----------|---------------|
|
|
49
|
+
| `parseMultipartBody` | `parseMultipartBody(opts: { context: { req: any }; storage?: 'memory' \| 'disk'; uploadDir?: string }): Promise<IParsedFile[]>` | Parses a `multipart/form-data` body via `context.req.formData()`. String fields are skipped - only `File` entries are returned. |
|
|
50
|
+
| `sanitizeFilename` | `sanitizeFilename(filename: string): string` | Strips path components and dangerous characters from `filename`. Returns `'download'` for empty or suspicious input. |
|
|
51
|
+
| `encodeRFC5987` | `encodeRFC5987(filename: string): string` | RFC 5987 encodes `filename` for the `filename*` header parameter (`encodeURIComponent` plus escaped `'`, `(`, `)`, `*`). |
|
|
52
|
+
| `createContentDispositionHeader` | `createContentDispositionHeader(opts: { filename: string; type: 'attachment' \| 'inline' }): string` | Builds a full `Content-Disposition` value: sanitizes the filename, then emits both the ASCII `filename=` and UTF-8 `filename*=` forms. |
|
|
53
|
+
|
|
54
|
+
## Parsed file shape
|
|
55
|
+
|
|
56
|
+
`parseMultipartBody` resolves to an array of objects (the `IParsedFile` shape, internal to the module - not separately exported):
|
|
57
|
+
|
|
58
|
+
| Field | Type | Present when |
|
|
59
|
+
|-------|------|---------------|
|
|
60
|
+
| `fieldname` | `string` | always |
|
|
61
|
+
| `originalname` | `string` | always |
|
|
62
|
+
| `encoding` | `string` | always - hardcoded `'utf8'` |
|
|
63
|
+
| `mimetype` | `string` | always |
|
|
64
|
+
| `size` | `number` | always |
|
|
65
|
+
| `buffer` | `Buffer` | `storage: 'memory'` (default) |
|
|
66
|
+
| `filename` | `string` | `storage: 'disk'` - format `{timestamp}-{randomString}-{sanitizedOriginalName}` |
|
|
67
|
+
| `path` | `string` | `storage: 'disk'` |
|
|
68
|
+
|
|
69
|
+
## Notes
|
|
70
|
+
|
|
71
|
+
- **`storage` defaults to `'memory'`**; `uploadDir` defaults to `'./uploads'` and is created recursively if it does not exist.
|
|
72
|
+
- **`sanitizeFilename` is applied automatically** inside `createContentDispositionHeader` - callers do not need to sanitize twice. It also removes leading dots, collapses repeated dots, and strips `..` sequences to block directory traversal and hidden-file tricks.
|
|
73
|
+
- **`createContentDispositionHeader` always emits both forms** (`filename="..."; filename*=UTF-8''...`) for maximum browser compatibility - older browsers read the ASCII fallback, modern ones read the UTF-8 form.
|
|
74
|
+
- **`IRequestedRemark`** is a separately exported interface for describing a request: `{ id: string; url: string; method: string; [extra: string | symbol]: any }`.
|
|
75
|
+
- It is not consumed internally by `parseMultipartBody` or any other function on this page - it is a general-purpose shape for application code that needs to tag a request with an id, URL, method, and arbitrary extra fields.
|
|
76
|
+
|
|
77
|
+
## See also
|
|
78
|
+
|
|
79
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
80
|
+
- [Static Asset Component](/extensions/components/static-asset/) - built-in upload/download CRUD built on this utility
|
|
81
|
+
- [Request Tracker Component](/extensions/components/request-tracker) - `x-request-id` header and request body parsing
|
|
82
|
+
|
|
83
|
+
**Files:**
|
|
84
|
+
|
|
85
|
+
- [`packages/helpers/src/utilities/request.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/utilities/request.utility.ts)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Retry Utility
|
|
3
|
+
description: Backoff-driven retry helpers on RetryHelper - executeWithRetry retries on errors, executeWithRetryUntil retries until a result looks right
|
|
4
|
+
difficulty: intermediate
|
|
5
|
+
lastUpdated: 2026-08-30
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Retry Utility
|
|
9
|
+
|
|
10
|
+
Two retry helpers on `RetryHelper`. One retries when a call **throws**. The other retries when a call **succeeds but the result is not what you want yet**.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { RetryHelper } from '@venizia/ignis-helpers';
|
|
16
|
+
|
|
17
|
+
// Retries because the call THREW
|
|
18
|
+
const data = await RetryHelper.executeWithRetry({
|
|
19
|
+
operation: 'fetch-remote-config',
|
|
20
|
+
execution: () => fetchConfig(),
|
|
21
|
+
maxAttempts: 5,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Retries because the result is not YET what we want
|
|
25
|
+
const order = await RetryHelper.executeWithRetryUntil({
|
|
26
|
+
operation: 'wait-for-paid-order',
|
|
27
|
+
execution: () => orderRepository.findById({ id: orderId }),
|
|
28
|
+
until: result => result?.status === 'PAID',
|
|
29
|
+
maxAttempts: 5,
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> [!TIP] Works in the browser
|
|
34
|
+
> Import from `@venizia/ignis-helpers/core` instead, and every method above is available - the whole class is part of the browser-pure surface, verified by the repo's purity gate rather than by inspection.
|
|
35
|
+
>
|
|
36
|
+
> ```typescript
|
|
37
|
+
> import { RetryHelper } from '@venizia/ignis-helpers/core';
|
|
38
|
+
> ```
|
|
39
|
+
|
|
40
|
+
## Which one do I need?
|
|
41
|
+
|
|
42
|
+
| Method | Retries when | Typical use |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `RetryHelper.executeWithRetry` | `execution` throws | Flaky network calls, connection setup |
|
|
45
|
+
| `RetryHelper.executeWithRetryUntil` | `until(result)` returns `false` | Polling until data is fresh or a job is done. Powers the repository [`retry` option](/references/base/repositories/advanced#read-retry-replica-lag). |
|
|
46
|
+
|
|
47
|
+
Both share the same backoff engine and the same habit: on exhaustion, log one `logger.warn` and hand back the LAST outcome.
|
|
48
|
+
|
|
49
|
+
## `RetryHelper.executeWithRetry`
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
static executeWithRetry: <T>(opts: {
|
|
53
|
+
operation: string;
|
|
54
|
+
execution: (context: { attempt: number; signal?: AbortSignal }) => ValueOrPromise<T>;
|
|
55
|
+
maxAttempts?: number; // default 3
|
|
56
|
+
maxTotalMs?: number; // total budget across attempts and sleeps
|
|
57
|
+
perAttemptTimeoutMs?: number; // race each attempt against a timeout
|
|
58
|
+
backoff?: IRetryBackoffOptions;
|
|
59
|
+
shouldRetry?: (context: IRetryContext) => boolean;
|
|
60
|
+
onRetry?: (context: IRetryContext & { nextDelayMs: number }) => ValueOrPromise<void>;
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
logger?: ILogger;
|
|
63
|
+
}) => Promise<T>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The rules:
|
|
67
|
+
|
|
68
|
+
- Every thrown error retries, unless `shouldRetry` returns `false` - then it rethrows immediately. Use this for permanent errors like a `400`.
|
|
69
|
+
- Out of attempts or budget? The LAST error is thrown.
|
|
70
|
+
- `signal` aborts between attempts and during sleeps. It is also passed to `execution` - a running promise cannot be cancelled from outside, so honor it inside if you can.
|
|
71
|
+
|
|
72
|
+
## `RetryHelper.executeWithRetryUntil`
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
static executeWithRetryUntil: <T>(opts: {
|
|
76
|
+
operation: string;
|
|
77
|
+
execution: (context: { attempt: number; signal?: AbortSignal }) => ValueOrPromise<T>;
|
|
78
|
+
until: (result: T) => boolean; // return true to stop: "the result is good"
|
|
79
|
+
maxAttempts?: number; // default 3
|
|
80
|
+
maxTotalMs?: number; // stop starting NEW attempts after this much time
|
|
81
|
+
backoff?: IRetryBackoffOptions;
|
|
82
|
+
signal?: AbortSignal;
|
|
83
|
+
logger?: ILogger;
|
|
84
|
+
}) => Promise<T>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The rules:
|
|
88
|
+
|
|
89
|
+
- A thrown error is never retried. It rethrows immediately. Only a successful call with a "not yet" result retries.
|
|
90
|
+
- Out of attempts or budget? The LAST result is returned as-is. No error.
|
|
91
|
+
- `maxTotalMs` never cuts a running read short. It only stops NEW attempts from starting. Zero or negative just means "no retries" - one call still runs.
|
|
92
|
+
- `maxAttempts` below `1` throws before anything runs.
|
|
93
|
+
- An aborted `signal` rejects the call - a cancelled caller does not want a stale result.
|
|
94
|
+
|
|
95
|
+
Use it for any polling: waiting for a job status to flip, for a downstream service to come up, for a replica to catch up.
|
|
96
|
+
|
|
97
|
+
## Backoff and jitter
|
|
98
|
+
|
|
99
|
+
Both helpers wait between attempts using `IRetryBackoffOptions`:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
interface IRetryBackoffOptions {
|
|
103
|
+
strategy?: 'fixed' | 'linear' | 'exponential' | 'schedule'; // default exponential
|
|
104
|
+
initialDelayMs?: number; // default 250
|
|
105
|
+
multiplier?: number; // exponential growth factor, default 2
|
|
106
|
+
maxDelayMs?: number; // cap before jitter, default 30000
|
|
107
|
+
scheduleMs?: readonly number[]; // required for 'schedule'
|
|
108
|
+
jitter?: 'none' | 'full' | 'equal'; // default full
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
| Strategy | Delay for attempt N |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `fixed` | `initialDelayMs` |
|
|
115
|
+
| `linear` | `initialDelayMs * N` |
|
|
116
|
+
| `exponential` | `initialDelayMs * multiplier ** (N - 1)` |
|
|
117
|
+
| `schedule` | `scheduleMs[N - 1]`, last entry repeats |
|
|
118
|
+
|
|
119
|
+
| Jitter | Effect |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `none` | delay used as-is |
|
|
122
|
+
| `full` | random in `[0, delay)` |
|
|
123
|
+
| `equal` | random in `[delay/2, delay)` |
|
|
124
|
+
|
|
125
|
+
Prefer named constants? `RetryBackoffStrategies.EXPONENTIAL`, `RetryJitterModes.EQUAL`, etc.
|
|
126
|
+
|
|
127
|
+
> [!NOTE]
|
|
128
|
+
> These defaults (250ms, 30s cap) suit network retries. The repository `retry` option uses its own tighter defaults (50ms up to 500ms) - see [Read Retry](/references/base/repositories/advanced#read-retry-replica-lag).
|
|
129
|
+
|
|
130
|
+
## Other exports
|
|
131
|
+
|
|
132
|
+
| Export | What it does |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `RetryHelper.runWithTimeout({ operation, timeoutMs, execution })` | Races `execution` against a timeout. Omitted or `<= 0` means no timeout. |
|
|
135
|
+
| `RetryHelper.isRetryTimeoutError(error)` | `true` when the error is a timeout from `runWithTimeout`/`executeWithRetry`. |
|
|
136
|
+
| `RetryHelper.computeBackoffDelayMs({ attempt, backoff })` | The delay both helpers use, exposed for your own loops. |
|
|
137
|
+
|
|
138
|
+
## See also
|
|
139
|
+
|
|
140
|
+
- [Read Retry](/references/base/repositories/advanced#read-retry-replica-lag) - the repository `retry` option built on `executeWithRetryUntil`
|
|
141
|
+
- [Repository Read Retry changelog](/changelogs/2026-07-18-repository-read-retry) - what shipped and why
|
|
142
|
+
- [Utilities Overview](/references/utilities/)
|
|
143
|
+
|
|
144
|
+
**Files:**
|
|
145
|
+
|
|
146
|
+
- [`packages/helpers/src/modules/retry/helper.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/modules/retry/helper.ts)
|
|
147
|
+
- [`packages/helpers/src/modules/retry/common/constants.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/modules/retry/common/constants.ts)
|
|
148
|
+
- [`packages/helpers/src/modules/retry/common/types.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/helpers/src/modules/retry/common/types.ts)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Schema Utility
|
|
3
|
+
description: Zod and OpenAPI helpers for JSON response schemas, path params, string constraints, and case conversion
|
|
4
|
+
difficulty: beginner
|
|
5
|
+
lastUpdated: 2026-07-16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Schema Utility
|
|
9
|
+
|
|
10
|
+
Helper functions and predefined schemas for working with `zod` and `@hono/zod-openapi` - building JSON request/response schemas, path-param schemas, and case-converting schemas for API routes.
|
|
11
|
+
|
|
12
|
+
## In one example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { jsonResponse, requiredString, idParamsSchema } from '@venizia/ignis';
|
|
16
|
+
import { z } from '@hono/zod-openapi';
|
|
17
|
+
|
|
18
|
+
const UserSchema = z.object({ id: z.number(), name: requiredString({ min: 1, max: 50 }) });
|
|
19
|
+
|
|
20
|
+
this.defineRoute({
|
|
21
|
+
configs: {
|
|
22
|
+
path: '/{id}',
|
|
23
|
+
method: 'get',
|
|
24
|
+
request: { params: idParamsSchema({ idType: 'number' }) },
|
|
25
|
+
responses: jsonResponse({ schema: UserSchema, description: 'A single user object' }),
|
|
26
|
+
},
|
|
27
|
+
handler: (c) => {
|
|
28
|
+
const { id } = c.req.valid('param');
|
|
29
|
+
// ...
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Functions
|
|
35
|
+
|
|
36
|
+
| Function | Signature | What it does |
|
|
37
|
+
|----------|-----------|---------------|
|
|
38
|
+
| `jsonContent` | `jsonContent(opts: { schema: ZodType; description: string; required?: boolean }): { description; content; required }` | Builds a standard OpenAPI content object for an `application/json` payload. |
|
|
39
|
+
| `jsonResponse` | `jsonResponse(opts: { schema: ZodType; description?: string; required?: boolean; headers?: Record<string, THeaderObject> }): Record<number \| string, ...>` | Builds a full response map: `200` success (via `jsonContent`, description defaults to `'Success Response'`) plus a `'4xx \| 5xx'` error entry using `ErrorSchema`. |
|
|
40
|
+
| `requiredString` | `requiredString(opts?: { min?: number; max?: number; fixed?: number }): ZodString` | A non-empty (`.nonempty()`) Zod string, optionally constrained by `min`, `max`, or an exact `fixed` length. |
|
|
41
|
+
| `idParamsSchema` | `idParamsSchema(opts?: { idType?: 'number' \| 'string' }): ZodObject` | Builds a path-param schema for `{ id }`, typed and OpenAPI-documented as `number` (default) or `string`. Throws on any other `idType`. |
|
|
42
|
+
| `snakeToCamel` | `snakeToCamel<T extends ZodRawShape>(shape: T): ZodEffects` | Wraps a Zod object `shape` so it accepts `snake_case` input keys and produces a `camelCase`-keyed output, via `.transform()` piped into a camelCase-shaped schema. |
|
|
43
|
+
|
|
44
|
+
## Predefined schemas and types
|
|
45
|
+
|
|
46
|
+
| Export | What it is |
|
|
47
|
+
|--------|------------|
|
|
48
|
+
| `AnyObjectSchema` | `z.object().catchall(z.any())`, OpenAPI-described as `'Unknown schema'` - a permissive object schema. |
|
|
49
|
+
| `TAnyObjectSchema` | Type alias for `z.ZodObject<z.ZodRawShape>`. |
|
|
50
|
+
| `TInferSchema<T>` | Type alias for `z.infer<T>` - the TypeScript type inferred from a Zod schema `T`. |
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- **Three source files, one page.** `requiredString`, `AnyObjectSchema`, `TAnyObjectSchema`, and `TInferSchema` live in `schema.utility.ts`; `jsonContent`, `jsonResponse`, and `idParamsSchema` live in `base/models/common/schemas.ts`; `snakeToCamel` lives in `base/models/common/utilities.ts`. All three are re-exported from the `@venizia/ignis` root barrel, so the import path is the same either way.
|
|
55
|
+
- **`jsonResponse`'s error branch is fixed** - it always uses `ErrorSchema` under the `'4xx | 5xx'` key; only the success schema, description, and headers are customizable per call.
|
|
56
|
+
- **HTML responses are a separate utility.** For `text/html` routes, use `htmlContent`/`htmlResponse` from the [JSX Utility](/references/utilities/jsx) instead of `jsonContent`/`jsonResponse`.
|
|
57
|
+
|
|
58
|
+
## See also
|
|
59
|
+
|
|
60
|
+
- [Utilities Overview](/references/utilities/) - all utility functions
|
|
61
|
+
- [JSX Utility](/references/utilities/jsx) - `htmlContent()` / `htmlResponse()` for HTML routes
|
|
62
|
+
- [Parse Utility](/references/utilities/parse) - `toCamel()` / `keysToCamel()`, the transforms `snakeToCamel` builds on
|
|
63
|
+
- [REST Controllers Guide](/guides/core-concepts/rest-controllers) - defining routes with `request`/`responses`
|
|
64
|
+
|
|
65
|
+
**Files:**
|
|
66
|
+
|
|
67
|
+
- [`packages/kernel/src/utilities/schema.utility.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/utilities/schema.utility.ts)
|
|
68
|
+
- [`packages/kernel/src/base/models/common/schemas.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/models/common/schemas.ts)
|
|
69
|
+
- [`packages/kernel/src/base/models/common/utilities.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/models/common/utilities.ts)
|