@hexagen-monaco/sync 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +33 -0
- package/README.md +181 -0
- package/dist/application/index.d.ts +3 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/ports/index.d.ts +2 -0
- package/dist/application/ports/index.d.ts.map +1 -0
- package/dist/application/ports/out/architecture-graph-provider.port.d.ts +6 -0
- package/dist/application/ports/out/architecture-graph-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/file-system.port.d.ts +22 -0
- package/dist/application/ports/out/file-system.port.d.ts.map +1 -0
- package/dist/application/ports/out/generator-config.port.d.ts +51 -0
- package/dist/application/ports/out/generator-config.port.d.ts.map +1 -0
- package/dist/application/ports/out/index.d.ts +9 -0
- package/dist/application/ports/out/index.d.ts.map +1 -0
- package/dist/application/ports/out/linter-report-provider.port.d.ts +6 -0
- package/dist/application/ports/out/linter-report-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/ownership-registry.port.d.ts +35 -0
- package/dist/application/ports/out/ownership-registry.port.d.ts.map +1 -0
- package/dist/application/ports/out/project-configuration-read.port.d.ts +9 -0
- package/dist/application/ports/out/project-configuration-read.port.d.ts.map +1 -0
- package/dist/application/ports/out/symbol-reference-provider.port.d.ts +10 -0
- package/dist/application/ports/out/symbol-reference-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/workspace-file-provider.port.d.ts +14 -0
- package/dist/application/ports/out/workspace-file-provider.port.d.ts.map +1 -0
- package/dist/application/use-cases/get-architecture-graph.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-architecture-graph.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/get-linter-report.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-linter-report.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/get-manifest-resource.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-manifest-resource.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/index.d.ts +4 -0
- package/dist/application/use-cases/index.d.ts.map +1 -0
- package/dist/application/use-cases/refactoring-impact.use-case.d.ts +29 -0
- package/dist/application/use-cases/refactoring-impact.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/stub-generation.use-case.d.ts +23 -0
- package/dist/application/use-cases/stub-generation.use-case.d.ts.map +1 -0
- package/dist/arch-linter-bin.d.ts +20 -0
- package/dist/arch-linter-bin.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +12149 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add/index.d.ts +8 -0
- package/dist/commands/add/index.d.ts.map +1 -0
- package/dist/commands/add/validate.d.ts +2 -0
- package/dist/commands/add/validate.d.ts.map +1 -0
- package/dist/commands/arch/add.d.ts +3 -0
- package/dist/commands/arch/add.d.ts.map +1 -0
- package/dist/commands/arch/context/command.d.ts +4 -0
- package/dist/commands/arch/context/command.d.ts.map +1 -0
- package/dist/commands/arch/context/persistence.d.ts +22 -0
- package/dist/commands/arch/context/persistence.d.ts.map +1 -0
- package/dist/commands/arch/context/wizard.d.ts +7 -0
- package/dist/commands/arch/context/wizard.d.ts.map +1 -0
- package/dist/commands/arch/diff.d.ts +3 -0
- package/dist/commands/arch/diff.d.ts.map +1 -0
- package/dist/commands/arch/edit.d.ts +9 -0
- package/dist/commands/arch/edit.d.ts.map +1 -0
- package/dist/commands/arch/index.d.ts +3 -0
- package/dist/commands/arch/index.d.ts.map +1 -0
- package/dist/commands/arch/list.d.ts +2 -0
- package/dist/commands/arch/list.d.ts.map +1 -0
- package/dist/commands/arch/port/persistence.d.ts +28 -0
- package/dist/commands/arch/port/persistence.d.ts.map +1 -0
- package/dist/commands/arch/port.d.ts +4 -0
- package/dist/commands/arch/port.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-entity.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-entity.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-port.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-port.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-use-case.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-use-case.d.ts.map +1 -0
- package/dist/commands/arch/refactor-shared.d.ts +11 -0
- package/dist/commands/arch/refactor-shared.d.ts.map +1 -0
- package/dist/commands/arch/refactor.d.ts +3 -0
- package/dist/commands/arch/refactor.d.ts.map +1 -0
- package/dist/commands/arch/remove/context.d.ts +7 -0
- package/dist/commands/arch/remove/context.d.ts.map +1 -0
- package/dist/commands/arch/remove/port.d.ts +7 -0
- package/dist/commands/arch/remove/port.d.ts.map +1 -0
- package/dist/commands/arch/remove.d.ts +3 -0
- package/dist/commands/arch/remove.d.ts.map +1 -0
- package/dist/commands/arch/validate.d.ts +2 -0
- package/dist/commands/arch/validate.d.ts.map +1 -0
- package/dist/commands/manifest/index.d.ts +3 -0
- package/dist/commands/manifest/index.d.ts.map +1 -0
- package/dist/commands/manifest/split-utils.d.ts +8 -0
- package/dist/commands/manifest/split-utils.d.ts.map +1 -0
- package/dist/commands/manifest/split.d.ts +3 -0
- package/dist/commands/manifest/split.d.ts.map +1 -0
- package/dist/commands/shared/confirm.d.ts +5 -0
- package/dist/commands/shared/confirm.d.ts.map +1 -0
- package/dist/commands/shared/error-formatter.d.ts +7 -0
- package/dist/commands/shared/error-formatter.d.ts.map +1 -0
- package/dist/commands/shared/index.d.ts +15 -0
- package/dist/commands/shared/index.d.ts.map +1 -0
- package/dist/commands/shared/project-root.d.ts +3 -0
- package/dist/commands/shared/project-root.d.ts.map +1 -0
- package/dist/commands/shared/prompt-service.d.ts +15 -0
- package/dist/commands/shared/prompt-service.d.ts.map +1 -0
- package/dist/commands/shared/spinner.d.ts +13 -0
- package/dist/commands/shared/spinner.d.ts.map +1 -0
- package/dist/commands/shared/template-engine-path.d.ts +12 -0
- package/dist/commands/shared/template-engine-path.d.ts.map +1 -0
- package/dist/commands/shared/validation.d.ts +15 -0
- package/dist/commands/shared/validation.d.ts.map +1 -0
- package/dist/commands/shared/yaml-service.d.ts +23 -0
- package/dist/commands/shared/yaml-service.d.ts.map +1 -0
- package/dist/commands/templates/index.d.ts +3 -0
- package/dist/commands/templates/index.d.ts.map +1 -0
- package/dist/commands/templates/info.d.ts +2 -0
- package/dist/commands/templates/info.d.ts.map +1 -0
- package/dist/commands/templates/list.d.ts +2 -0
- package/dist/commands/templates/list.d.ts.map +1 -0
- package/dist/config/barrel-exclusions.d.ts +10 -0
- package/dist/config/barrel-exclusions.d.ts.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/domain/index.d.ts +5 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/result.d.ts +4 -0
- package/dist/domain/result.d.ts.map +1 -0
- package/dist/domain/services/architectural-boundary-checker.d.ts +18 -0
- package/dist/domain/services/architectural-boundary-checker.d.ts.map +1 -0
- package/dist/domain/services/emission-plan-builder.d.ts +17 -0
- package/dist/domain/services/emission-plan-builder.d.ts.map +1 -0
- package/dist/domain/services/impact-analysis.types.d.ts +24 -0
- package/dist/domain/services/impact-analysis.types.d.ts.map +1 -0
- package/dist/domain/services/impact-request-validator.d.ts +14 -0
- package/dist/domain/services/impact-request-validator.d.ts.map +1 -0
- package/dist/domain/services/index.d.ts +7 -0
- package/dist/domain/services/index.d.ts.map +1 -0
- package/dist/domain/services/layer-classifier.d.ts +4 -0
- package/dist/domain/services/layer-classifier.d.ts.map +1 -0
- package/dist/domain/services/stub-template-resolver.d.ts +16 -0
- package/dist/domain/services/stub-template-resolver.d.ts.map +1 -0
- package/dist/domain/session.d.ts +6 -0
- package/dist/domain/session.d.ts.map +1 -0
- package/dist/domain/stub-templates.d.ts +8 -0
- package/dist/domain/stub-templates.d.ts.map +1 -0
- package/dist/domain/types.d.ts +4 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/fs-utils.d.ts +28 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/generators/apps-framework-templates.d.ts +4 -0
- package/dist/generators/apps-framework-templates.d.ts.map +1 -0
- package/dist/generators/apps.d.ts +5 -0
- package/dist/generators/apps.d.ts.map +1 -0
- package/dist/generators/architecture-file-templates.d.ts +9 -0
- package/dist/generators/architecture-file-templates.d.ts.map +1 -0
- package/dist/generators/architecture-files.d.ts +5 -0
- package/dist/generators/architecture-files.d.ts.map +1 -0
- package/dist/generators/barrels/index.d.ts +6 -0
- package/dist/generators/barrels/index.d.ts.map +1 -0
- package/dist/generators/barrels/recursive.d.ts +44 -0
- package/dist/generators/barrels/recursive.d.ts.map +1 -0
- package/dist/generators/barrels/utils.d.ts +56 -0
- package/dist/generators/barrels/utils.d.ts.map +1 -0
- package/dist/generators/barrels.d.ts +31 -0
- package/dist/generators/barrels.d.ts.map +1 -0
- package/dist/generators/eslint.d.ts +47 -0
- package/dist/generators/eslint.d.ts.map +1 -0
- package/dist/generators/layer-folders.d.ts +16 -0
- package/dist/generators/layer-folders.d.ts.map +1 -0
- package/dist/generators/migration-assistant.d.ts +7 -0
- package/dist/generators/migration-assistant.d.ts.map +1 -0
- package/dist/generators/migration-audit.d.ts +28 -0
- package/dist/generators/migration-audit.d.ts.map +1 -0
- package/dist/generators/migration-stubs.d.ts +7 -0
- package/dist/generators/migration-stubs.d.ts.map +1 -0
- package/dist/generators/package-json.d.ts +11 -0
- package/dist/generators/package-json.d.ts.map +1 -0
- package/dist/generators/port-analyzer.d.ts +56 -0
- package/dist/generators/port-analyzer.d.ts.map +1 -0
- package/dist/generators/reap.d.ts +11 -0
- package/dist/generators/reap.d.ts.map +1 -0
- package/dist/generators/root-file-templates.d.ts +8 -0
- package/dist/generators/root-file-templates.d.ts.map +1 -0
- package/dist/generators/root-files.d.ts +5 -0
- package/dist/generators/root-files.d.ts.map +1 -0
- package/dist/generators/stubs/index.d.ts +4 -0
- package/dist/generators/stubs/index.d.ts.map +1 -0
- package/dist/generators/stubs/stub-templates.d.ts +3 -0
- package/dist/generators/stubs/stub-templates.d.ts.map +1 -0
- package/dist/generators/stubs.d.ts +5 -0
- package/dist/generators/stubs.d.ts.map +1 -0
- package/dist/generators/test-generator.d.ts +7 -0
- package/dist/generators/test-generator.d.ts.map +1 -0
- package/dist/generators/test-templates/data-builder.d.ts +2 -0
- package/dist/generators/test-templates/data-builder.d.ts.map +1 -0
- package/dist/generators/test-templates/enhanced-test-double.d.ts +2 -0
- package/dist/generators/test-templates/enhanced-test-double.d.ts.map +1 -0
- package/dist/generators/test-templates/index.d.ts +5 -0
- package/dist/generators/test-templates/index.d.ts.map +1 -0
- package/dist/generators/test-templates/integration-test.d.ts +2 -0
- package/dist/generators/test-templates/integration-test.d.ts.map +1 -0
- package/dist/generators/test-templates/unit-test.d.ts +2 -0
- package/dist/generators/test-templates/unit-test.d.ts.map +1 -0
- package/dist/generators/tsconfig.d.ts +16 -0
- package/dist/generators/tsconfig.d.ts.map +1 -0
- package/dist/generators/validators/index.d.ts +11 -0
- package/dist/generators/validators/index.d.ts.map +1 -0
- package/dist/generators/validators/validate-dependencies.d.ts +7 -0
- package/dist/generators/validators/validate-dependencies.d.ts.map +1 -0
- package/dist/generators/validators/validate-manifest-sync.d.ts +5 -0
- package/dist/generators/validators/validate-manifest-sync.d.ts.map +1 -0
- package/dist/generators/validators/validate-port-adapter.d.ts +5 -0
- package/dist/generators/validators/validate-port-adapter.d.ts.map +1 -0
- package/dist/generators/validators/validation-types.d.ts +20 -0
- package/dist/generators/validators/validation-types.d.ts.map +1 -0
- package/dist/generators/validators.d.ts +7 -0
- package/dist/generators/validators.d.ts.map +1 -0
- package/dist/generators/wiring.d.ts +20 -0
- package/dist/generators/wiring.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8070 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/adapters/atomic-file-system.adapter.d.ts +13 -0
- package/dist/infrastructure/adapters/atomic-file-system.adapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/file-system-workspace.adapter.d.ts +12 -0
- package/dist/infrastructure/adapters/file-system-workspace.adapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/in-memory-config-double.d.ts +30 -0
- package/dist/infrastructure/adapters/in-memory-config-double.d.ts.map +1 -0
- package/dist/infrastructure/adapters/index.d.ts +5 -0
- package/dist/infrastructure/adapters/index.d.ts.map +1 -0
- package/dist/infrastructure/adapters/yaml-config.adapter.d.ts +38 -0
- package/dist/infrastructure/adapters/yaml-config.adapter.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +2 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/linter.d.ts +7 -0
- package/dist/linter.d.ts.map +1 -0
- package/dist/loaders/index.d.ts +2 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/manifest-merge-loader.d.ts +3 -0
- package/dist/loaders/manifest-merge-loader.d.ts.map +1 -0
- package/dist/lock.d.ts +14 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/manifest-service.d.ts +10 -0
- package/dist/manifest-service.d.ts.map +1 -0
- package/dist/migration-report.d.ts +12 -0
- package/dist/migration-report.d.ts.map +1 -0
- package/dist/preflight.d.ts +7 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/refactoring/git-operations.d.ts +9 -0
- package/dist/refactoring/git-operations.d.ts.map +1 -0
- package/dist/refactoring/impact-analyzer.d.ts +23 -0
- package/dist/refactoring/impact-analyzer.d.ts.map +1 -0
- package/dist/refactoring/index.d.ts +6 -0
- package/dist/refactoring/index.d.ts.map +1 -0
- package/dist/refactoring/refactoring-engine.d.ts +40 -0
- package/dist/refactoring/refactoring-engine.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/base-pattern.d.ts +37 -0
- package/dist/refactoring/refactoring-patterns/base-pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/index.d.ts +5 -0
- package/dist/refactoring/refactoring-patterns/index.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/refactoring-utils.d.ts +8 -0
- package/dist/refactoring/refactoring-patterns/refactoring-utils.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-entity.pattern.d.ts +19 -0
- package/dist/refactoring/refactoring-patterns/rename-entity.pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-port.pattern.d.ts +42 -0
- package/dist/refactoring/refactoring-patterns/rename-port.pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-use-case.pattern.d.ts +40 -0
- package/dist/refactoring/refactoring-patterns/rename-use-case.pattern.d.ts.map +1 -0
- package/dist/refactoring/safe-refactoring-orchestrator.d.ts +24 -0
- package/dist/refactoring/safe-refactoring-orchestrator.d.ts.map +1 -0
- package/dist/refactoring/validation-suite.d.ts +20 -0
- package/dist/refactoring/validation-suite.d.ts.map +1 -0
- package/dist/results.d.ts +16 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/sync-engine-helpers.d.ts +15 -0
- package/dist/sync-engine-helpers.d.ts.map +1 -0
- package/dist/sync-engine-init.d.ts +12 -0
- package/dist/sync-engine-init.d.ts.map +1 -0
- package/dist/sync-engine.d.ts +21 -0
- package/dist/sync-engine.d.ts.map +1 -0
- package/dist/template-engine.d.ts +3 -0
- package/dist/template-engine.d.ts.map +1 -0
- package/dist/templates/__example__/files/example-output.txt +9 -0
- package/dist/templates/__example__/manifest.json +44 -0
- package/dist/templates/adobe-creative-production/README.md +89 -0
- package/dist/templates/adobe-creative-production/files/.env.adobe-creative-production.example +6 -0
- package/dist/templates/adobe-creative-production/files/src/domain/ports/out/creative-production.port.ts +62 -0
- package/dist/templates/adobe-creative-production/files/src/infrastructure/adobe/creative-production/creative-production.adapter.ts +144 -0
- package/dist/templates/adobe-creative-production/manifest.json +25 -0
- package/dist/templates/adobe-express/README.md +85 -0
- package/dist/templates/adobe-express/files/.env.adobe-express.example +7 -0
- package/dist/templates/adobe-express/files/src/domain/ports/out/express.port.ts +47 -0
- package/dist/templates/adobe-express/files/src/infrastructure/adobe/express/express.adapter.ts +155 -0
- package/dist/templates/adobe-express/manifest.json +32 -0
- package/dist/templates/adobe-firefly-composite/README.md +75 -0
- package/dist/templates/adobe-firefly-composite/files/.env.adobe-composite.example +5 -0
- package/dist/templates/adobe-firefly-composite/files/src/domain/ports/out/composite.port.ts +39 -0
- package/dist/templates/adobe-firefly-composite/files/src/infrastructure/adobe/composite/composite.adapter.ts +102 -0
- package/dist/templates/adobe-firefly-composite/manifest.json +32 -0
- package/dist/templates/adobe-firefly-content-tagging/README.md +70 -0
- package/dist/templates/adobe-firefly-content-tagging/files/.env.adobe-content-tagging.example +4 -0
- package/dist/templates/adobe-firefly-content-tagging/files/src/domain/ports/out/content-tagging.port.ts +28 -0
- package/dist/templates/adobe-firefly-content-tagging/files/src/infrastructure/adobe/content-tagging/content-tagging.adapter.ts +120 -0
- package/dist/templates/adobe-firefly-content-tagging/manifest.json +31 -0
- package/dist/templates/adobe-firefly-core/README.md +147 -0
- package/dist/templates/adobe-firefly-core/files/.env.adobe.example +15 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-auth.port.ts +11 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-job.port.ts +50 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-storage.port.ts +20 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/auth/ims-token-provider.adapter.ts +112 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/auth/smoke-token.ts +17 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/errors/firefly-errors.ts +91 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/http/firefly-client.ts +135 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/index.ts +46 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-poller.ts +52 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-port.ts +149 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-result.ts +113 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/webhook-verifier.ts +67 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/storage/passthrough-storage.adapter.ts +36 -0
- package/dist/templates/adobe-firefly-core/manifest.json +86 -0
- package/dist/templates/adobe-firefly-custom-models/README.md +96 -0
- package/dist/templates/adobe-firefly-custom-models/files/.env.adobe-custom-models.example +6 -0
- package/dist/templates/adobe-firefly-custom-models/files/src/domain/ports/out/custom-model.port.ts +77 -0
- package/dist/templates/adobe-firefly-custom-models/files/src/infrastructure/adobe/custom-models/firefly-custom-model.adapter.ts +199 -0
- package/dist/templates/adobe-firefly-custom-models/manifest.json +33 -0
- package/dist/templates/adobe-firefly-generate/README.md +86 -0
- package/dist/templates/adobe-firefly-generate/files/.env.adobe-generate.example +5 -0
- package/dist/templates/adobe-firefly-generate/files/src/domain/ports/out/image-generation.port.ts +61 -0
- package/dist/templates/adobe-firefly-generate/files/src/infrastructure/adobe/generate/firefly-generate.adapter.ts +167 -0
- package/dist/templates/adobe-firefly-generate/manifest.json +45 -0
- package/dist/templates/adobe-firefly-media/README.md +99 -0
- package/dist/templates/adobe-firefly-media/files/.env.adobe-media.example +8 -0
- package/dist/templates/adobe-firefly-media/files/src/domain/ports/out/media-generation.port.ts +80 -0
- package/dist/templates/adobe-firefly-media/files/src/infrastructure/adobe/media/firefly-media.adapter.ts +161 -0
- package/dist/templates/adobe-firefly-media/manifest.json +32 -0
- package/dist/templates/adobe-firefly-storage-azure/README.md +88 -0
- package/dist/templates/adobe-firefly-storage-azure/files/.env.adobe-storage-azure.example +9 -0
- package/dist/templates/adobe-firefly-storage-azure/files/src/infrastructure/adobe/storage/azure-blob-presign.adapter.ts +171 -0
- package/dist/templates/adobe-firefly-storage-azure/files/src/infrastructure/adobe/storage/azure-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-azure/manifest.json +37 -0
- package/dist/templates/adobe-firefly-storage-gcs/README.md +85 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/.env.adobe-storage-gcs.example +8 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/src/infrastructure/adobe/storage/gcs-presign.adapter.ts +100 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/src/infrastructure/adobe/storage/gcs-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-gcs/manifest.json +33 -0
- package/dist/templates/adobe-firefly-storage-s3/README.md +76 -0
- package/dist/templates/adobe-firefly-storage-s3/files/.env.adobe-storage-s3.example +8 -0
- package/dist/templates/adobe-firefly-storage-s3/files/src/infrastructure/adobe/storage/s3-presign.adapter.ts +109 -0
- package/dist/templates/adobe-firefly-storage-s3/files/src/infrastructure/adobe/storage/s3-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-s3/manifest.json +31 -0
- package/dist/templates/adobe-firefly-upscale/README.md +68 -0
- package/dist/templates/adobe-firefly-upscale/files/.env.adobe-upscale.example +3 -0
- package/dist/templates/adobe-firefly-upscale/files/src/domain/ports/out/upscale.port.ts +25 -0
- package/dist/templates/adobe-firefly-upscale/files/src/infrastructure/adobe/upscale/upscale.adapter.ts +85 -0
- package/dist/templates/adobe-firefly-upscale/manifest.json +30 -0
- package/dist/templates/adobe-illustrator/README.md +80 -0
- package/dist/templates/adobe-illustrator/files/.env.adobe-illustrator.example +7 -0
- package/dist/templates/adobe-illustrator/files/src/domain/ports/out/illustrator.port.ts +51 -0
- package/dist/templates/adobe-illustrator/files/src/infrastructure/adobe/illustrator/illustrator.adapter.ts +167 -0
- package/dist/templates/adobe-illustrator/manifest.json +38 -0
- package/dist/templates/adobe-ims-spa/README.md +99 -0
- package/dist/templates/adobe-ims-spa/files/.env.adobe-ims.example +12 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/callback/route.ts +84 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/login/route.ts +30 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/logout/route.ts +24 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/me/route.ts +18 -0
- package/dist/templates/adobe-ims-spa/files/middleware.ts +74 -0
- package/dist/templates/adobe-ims-spa/files/src/domain/ports/out/ims-auth.port.ts +24 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/adobe-ims-auth.adapter.ts +71 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/config.ts +34 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/ims-client.ts +85 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/pkce.ts +37 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/token-store.ts +54 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/user-profile-mapper.ts +12 -0
- package/dist/templates/adobe-ims-spa/files/src/lib/auth/get-current-user.ts +56 -0
- package/dist/templates/adobe-ims-spa/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/adobe-ims-spa/manifest.json +88 -0
- package/dist/templates/adobe-indesign/README.md +76 -0
- package/dist/templates/adobe-indesign/files/.env.adobe-indesign.example +7 -0
- package/dist/templates/adobe-indesign/files/src/domain/ports/out/indesign.port.ts +43 -0
- package/dist/templates/adobe-indesign/files/src/infrastructure/adobe/indesign/indesign.adapter.ts +160 -0
- package/dist/templates/adobe-indesign/manifest.json +38 -0
- package/dist/templates/adobe-lightroom/README.md +81 -0
- package/dist/templates/adobe-lightroom/files/.env.adobe-lightroom.example +7 -0
- package/dist/templates/adobe-lightroom/files/src/domain/ports/out/lightroom.port.ts +36 -0
- package/dist/templates/adobe-lightroom/files/src/infrastructure/adobe/lightroom/lightroom.adapter.ts +145 -0
- package/dist/templates/adobe-lightroom/manifest.json +39 -0
- package/dist/templates/adobe-photoshop/README.md +87 -0
- package/dist/templates/adobe-photoshop/files/.env.adobe-photoshop.example +7 -0
- package/dist/templates/adobe-photoshop/files/src/domain/ports/out/photoshop-automation.port.ts +60 -0
- package/dist/templates/adobe-photoshop/files/src/infrastructure/adobe/photoshop/photoshop-automation.adapter.ts +180 -0
- package/dist/templates/adobe-photoshop/manifest.json +45 -0
- package/dist/templates/adobe-substance-3d/README.md +88 -0
- package/dist/templates/adobe-substance-3d/files/.env.adobe-substance-3d.example +12 -0
- package/dist/templates/adobe-substance-3d/files/src/domain/ports/out/substance-3d.port.ts +45 -0
- package/dist/templates/adobe-substance-3d/files/src/infrastructure/adobe/substance-3d/substance-3d.adapter.ts +177 -0
- package/dist/templates/adobe-substance-3d/manifest.json +39 -0
- package/dist/templates/agents-md/README.md +55 -0
- package/dist/templates/agents-md/files/.agents/architecture.md +42 -0
- package/dist/templates/agents-md/files/.agents/git.md +30 -0
- package/dist/templates/agents-md/files/.agents/session-log.md +37 -0
- package/dist/templates/agents-md/files/.agents/tech-stack.md +34 -0
- package/dist/templates/agents-md/files/.agents/testing.md +30 -0
- package/dist/templates/agents-md/files/AGENTS.md +97 -0
- package/dist/templates/agents-md/manifest.json +49 -0
- package/dist/templates/auth-mock/README.md +57 -0
- package/dist/templates/auth-mock/files/.env.auth.example +9 -0
- package/dist/templates/auth-mock/files/middleware.ts +28 -0
- package/dist/templates/auth-mock/manifest.json +23 -0
- package/dist/templates/bedrock-agentcore-runtime/README.md +68 -0
- package/dist/templates/bedrock-agentcore-runtime/files/.env.agentcore.example +19 -0
- package/dist/templates/bedrock-agentcore-runtime/files/.github/workflows/deploy-agentcore.yml +100 -0
- package/dist/templates/bedrock-agentcore-runtime/files/Dockerfile.agentcore +33 -0
- package/dist/templates/bedrock-agentcore-runtime/files/agentcore/agentcore.json +16 -0
- package/dist/templates/bedrock-agentcore-runtime/files/agentcore/aws-targets.json +7 -0
- package/dist/templates/bedrock-agentcore-runtime/files/iam/agentcore-runtime-role.policy.json +49 -0
- package/dist/templates/bedrock-agentcore-runtime/files/infra/agentcore-stack.ts +90 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/invocations.handler.ts +152 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/ping.handler.ts +13 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/server.ts +134 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/runtime/payload.ts +63 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/runtime/session.ts +58 -0
- package/dist/templates/bedrock-agentcore-runtime/manifest.json +89 -0
- package/dist/templates/bedrock-agentcore-services/README.md +65 -0
- package/dist/templates/bedrock-agentcore-services/files/.env.agentcore-services.example +20 -0
- package/dist/templates/bedrock-agentcore-services/files/agentcore/agentcore-services.json +14 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/agent-identity.port.ts +26 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/agent-memory.port.ts +30 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/tool-gateway.port.ts +27 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/gateway/agentcore-gateway.adapter.ts +103 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/gateway/mcp-tool-mapper.ts +44 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/identity/agentcore-identity.adapter.ts +82 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/identity/idp-bridge.ts +74 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/memory/agentcore-memory.adapter.ts +82 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/memory/memory-config.ts +45 -0
- package/dist/templates/bedrock-agentcore-services/manifest.json +97 -0
- package/dist/templates/better-auth/README.md +60 -0
- package/dist/templates/better-auth/files/.env.better-auth.example +20 -0
- package/dist/templates/better-auth/files/app/api/auth/[...all]/route.ts +5 -0
- package/dist/templates/better-auth/files/src/db/index.ts +10 -0
- package/dist/templates/better-auth/files/src/db/migrations/0001_better_auth.sql +49 -0
- package/dist/templates/better-auth/files/src/db/schema/better-auth.ts +57 -0
- package/dist/templates/better-auth/files/src/lib/auth-client.ts +13 -0
- package/dist/templates/better-auth/files/src/lib/auth.ts +72 -0
- package/dist/templates/better-auth/manifest.json +71 -0
- package/dist/templates/bullmq/README.md +61 -0
- package/dist/templates/bullmq/files/.env.bullmq.example +34 -0
- package/dist/templates/bullmq/files/app/admin/queues/[[...slug]]/route.ts +103 -0
- package/dist/templates/bullmq/files/scripts/start-worker.ts +55 -0
- package/dist/templates/bullmq/files/server/startup/start-workers.ts +171 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/connection.ts +105 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/fallback/sync-executor.ts +96 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/index.ts +30 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/ai-generation.job.ts +53 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/email.job.ts +42 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/export.job.ts +49 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/image-processing.job.ts +48 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/webhook.job.ts +139 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/parse-int-env.ts +28 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/queues.ts +153 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/scheduler/job-scheduler.ts +70 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/workers.ts +101 -0
- package/dist/templates/bullmq/manifest.json +120 -0
- package/dist/templates/ci-github-actions/README.md +62 -0
- package/dist/templates/ci-github-actions/files/.github/dependabot.yml +20 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/ci.yml +103 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-fly.yml +30 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-railway.yml +32 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vercel.yml +39 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vps.yml +34 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/preview.yml +58 -0
- package/dist/templates/ci-github-actions/files/fly.toml +23 -0
- package/dist/templates/ci-github-actions/manifest.json +100 -0
- package/dist/templates/clerk/README.md +59 -0
- package/dist/templates/clerk/files/.env.clerk.example +11 -0
- package/dist/templates/clerk/files/app/(protected)/layout.tsx +18 -0
- package/dist/templates/clerk/files/app/api/protected-example/route.ts +17 -0
- package/dist/templates/clerk/files/middleware.ts +25 -0
- package/dist/templates/clerk/files/src/lib/auth.ts +12 -0
- package/dist/templates/clerk/files/src/lib/role-guard.tsx +32 -0
- package/dist/templates/clerk/manifest.json +67 -0
- package/dist/templates/design-system/README.md +60 -0
- package/dist/templates/design-system/files/.storybook/main.ts +9 -0
- package/dist/templates/design-system/files/.storybook/preview.ts +13 -0
- package/dist/templates/design-system/files/DESIGN.md +76 -0
- package/dist/templates/design-system/files/src/components/ui/button.stories.tsx +17 -0
- package/dist/templates/design-system/files/src/components/ui/button.tsx +61 -0
- package/dist/templates/design-system/files/src/components/ui/card.tsx +40 -0
- package/dist/templates/design-system/files/src/components/ui/index.ts +6 -0
- package/dist/templates/design-system/files/src/components/ui/input.tsx +29 -0
- package/dist/templates/design-system/files/src/lib/cn.ts +13 -0
- package/dist/templates/design-system/files/src/styles/globals.css +37 -0
- package/dist/templates/design-system/files/src/styles/theme.ts +56 -0
- package/dist/templates/design-system/files/src/styles/tokens.css +73 -0
- package/dist/templates/design-system/files/tailwind.config.ts +58 -0
- package/dist/templates/design-system/manifest.json +81 -0
- package/dist/templates/docker/README.md +62 -0
- package/dist/templates/docker/files/.dockerignore +34 -0
- package/dist/templates/docker/files/.github/workflows/docker-build.yml +74 -0
- package/dist/templates/docker/files/Dockerfile +57 -0
- package/dist/templates/docker/files/docker-compose.ci.yml +22 -0
- package/dist/templates/docker/files/docker-compose.override.yml +20 -0
- package/dist/templates/docker/files/docker-compose.yml +109 -0
- package/dist/templates/docker/manifest.json +59 -0
- package/dist/templates/env-setup/README.md +70 -0
- package/dist/templates/env-setup/files/.env.example +28 -0
- package/dist/templates/env-setup/files/.gitignore.hexagen +16 -0
- package/dist/templates/env-setup/files/SETUP.md +70 -0
- package/dist/templates/env-setup/files/scripts/check-env.ts +95 -0
- package/dist/templates/env-setup/files/src/config/env.client.ts +18 -0
- package/dist/templates/env-setup/files/src/config/env.server.ts +49 -0
- package/dist/templates/env-setup/files/src/config/env.ts +14 -0
- package/dist/templates/env-setup/files/src/config/load-env.ts +40 -0
- package/dist/templates/env-setup/manifest.json +55 -0
- package/dist/templates/error-handling/README.md +72 -0
- package/dist/templates/error-handling/files/.env.sentry.example +8 -0
- package/dist/templates/error-handling/files/app/components/ErrorBoundary.tsx +49 -0
- package/dist/templates/error-handling/files/app/components/ErrorFallback.tsx +35 -0
- package/dist/templates/error-handling/files/server/middleware/error-handler.ts +131 -0
- package/dist/templates/error-handling/files/src/application/errors/application.error.ts +33 -0
- package/dist/templates/error-handling/files/src/domain/errors/authorization.error.ts +20 -0
- package/dist/templates/error-handling/files/src/domain/errors/domain.error.ts +23 -0
- package/dist/templates/error-handling/files/src/domain/errors/not-found.error.ts +11 -0
- package/dist/templates/error-handling/files/src/domain/errors/validation.error.ts +17 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/external-service.error.ts +24 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/infrastructure.error.ts +22 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/llm-errors.ts +57 -0
- package/dist/templates/error-handling/files/src/shared/errors/error-codes.ts +29 -0
- package/dist/templates/error-handling/files/src/shared/result.ts +38 -0
- package/dist/templates/error-handling/manifest.json +63 -0
- package/dist/templates/eslint-no-console/README.md +78 -0
- package/dist/templates/eslint-no-console/files/eslint.no-console.mjs +35 -0
- package/dist/templates/eslint-no-console/manifest.json +28 -0
- package/dist/templates/github-oauth/README.md +61 -0
- package/dist/templates/github-oauth/files/.env.github-oauth.example +13 -0
- package/dist/templates/github-oauth/files/app/api/auth/callback/github/route.ts +105 -0
- package/dist/templates/github-oauth/files/app/api/auth/login/github/route.ts +33 -0
- package/dist/templates/github-oauth/files/app/api/auth/logout/github/route.ts +8 -0
- package/dist/templates/github-oauth/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/github-oauth/files/middleware.ts +59 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/config.ts +34 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-auth.adapter.ts +12 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-client.ts +95 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-user.ts +8 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/session-store.ts +56 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/user-profile-mapper.ts +24 -0
- package/dist/templates/github-oauth/files/src/lib/auth/get-current-user.ts +31 -0
- package/dist/templates/github-oauth/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/github-oauth/manifest.json +83 -0
- package/dist/templates/google-oauth/README.md +70 -0
- package/dist/templates/google-oauth/files/.env.google-oauth.example +14 -0
- package/dist/templates/google-oauth/files/app/api/auth/callback/google/route.ts +78 -0
- package/dist/templates/google-oauth/files/app/api/auth/login/google/route.ts +34 -0
- package/dist/templates/google-oauth/files/app/api/auth/logout/google/route.ts +8 -0
- package/dist/templates/google-oauth/files/app/api/auth/me/route.ts +13 -0
- package/dist/templates/google-oauth/files/middleware.ts +62 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/config.ts +29 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-auth.adapter.ts +22 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-client.ts +65 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-user.ts +9 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/session-store.ts +62 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/user-profile-mapper.ts +24 -0
- package/dist/templates/google-oauth/files/src/lib/auth/get-current-user.ts +36 -0
- package/dist/templates/google-oauth/files/src/lib/auth/require-auth.ts +13 -0
- package/dist/templates/google-oauth/manifest.json +82 -0
- package/dist/templates/langgraph/README.md +60 -0
- package/dist/templates/langgraph/files/.env.langgraph.example +26 -0
- package/dist/templates/langgraph/files/app/api/agent/invoke/route.ts +48 -0
- package/dist/templates/langgraph/files/app/api/agent/resume/route.ts +66 -0
- package/dist/templates/langgraph/files/app/api/agent/stream/route.ts +63 -0
- package/dist/templates/langgraph/files/src/domain/ports/out/agent-graph.port.ts +78 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/adapters/langgraph.adapter.ts +185 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/index.ts +84 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/memory-checkpointer.ts +12 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/postgres-checkpointer.ts +20 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/redis-checkpointer.ts +25 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/supabase-checkpointer.ts +26 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/edges/routing.ts +31 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/research-agent.graph.ts +81 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/simple-chain.graph.ts +81 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/index.ts +23 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/human-review.node.ts +34 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/input-processor.node.ts +31 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/llm-call.node.ts +38 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/output-formatter.node.ts +27 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/planner.node.ts +51 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/researcher.node.ts +63 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/synthesiser.node.ts +62 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/state/graph-state.ts +57 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/streaming/token-stream.ts +84 -0
- package/dist/templates/langgraph/manifest.json +131 -0
- package/dist/templates/llm-adapter/README.md +63 -0
- package/dist/templates/llm-adapter/files/.env.llm.example +49 -0
- package/dist/templates/llm-adapter/files/src/domain/ports/out/llm-client.port.ts +36 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/anthropic-llm-client.adapter.ts +111 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/azure-openai-llm-client.adapter.ts +105 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/ollama-llm-client.adapter.ts +102 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/openai-llm-client.adapter.ts +104 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/xai-llm-client.adapter.ts +104 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/constants/capabilities.ts +38 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/constants/models.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/errors/llm-errors.ts +83 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/index.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/router/llm-router.ts +117 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/router/provider-registry.ts +45 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/smoke-test.ts +25 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/parse-env.ts +8 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/retry.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/structured-output.ts +78 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/timeout.ts +22 -0
- package/dist/templates/llm-adapter/manifest.json +113 -0
- package/dist/templates/llm-adapter-bedrock/README.md +58 -0
- package/dist/templates/llm-adapter-bedrock/files/.env.bedrock.example +23 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/adapters/bedrock-llm-client.adapter.ts +126 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/adapters/bedrock-register.ts +20 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/errors/bedrock-errors.ts +42 -0
- package/dist/templates/llm-adapter-bedrock/manifest.json +51 -0
- package/dist/templates/magic-link/README.md +66 -0
- package/dist/templates/magic-link/files/.env.magic-link.example +24 -0
- package/dist/templates/magic-link/files/app/api/auth/logout/route.ts +12 -0
- package/dist/templates/magic-link/files/app/api/auth/magic-link/request/route.ts +34 -0
- package/dist/templates/magic-link/files/app/api/auth/magic-link/verify/route.ts +41 -0
- package/dist/templates/magic-link/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/magic-link/files/middleware.ts +60 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/config.ts +17 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/email-templates.ts +46 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/email-transport.ts +71 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/magic-link-auth.adapter.ts +11 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/magic-link-store.ts +31 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/session-store.ts +56 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/token-generator.ts +71 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/user-profile-mapper.ts +10 -0
- package/dist/templates/magic-link/files/src/lib/auth/get-current-user.ts +28 -0
- package/dist/templates/magic-link/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/magic-link/manifest.json +99 -0
- package/dist/templates/microsoft-entra/README.md +63 -0
- package/dist/templates/microsoft-entra/files/.env.microsoft-entra.example +17 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/callback/entra/route.ts +93 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/login/entra/route.ts +29 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/logout/entra/route.ts +26 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/microsoft-entra/files/middleware.ts +59 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/config.ts +43 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-auth.adapter.ts +14 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-client.ts +82 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-user.ts +9 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/group-role-mapper.ts +22 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/pkce.ts +20 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/session-store.ts +56 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/user-profile-mapper.ts +33 -0
- package/dist/templates/microsoft-entra/files/src/lib/auth/get-current-user.ts +31 -0
- package/dist/templates/microsoft-entra/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/microsoft-entra/manifest.json +93 -0
- package/dist/templates/nextauth/README.md +61 -0
- package/dist/templates/nextauth/files/.env.nextauth.example +16 -0
- package/dist/templates/nextauth/files/app/api/auth/[...nextauth]/route.ts +4 -0
- package/dist/templates/nextauth/files/middleware.ts +17 -0
- package/dist/templates/nextauth/files/src/auth.config.ts +41 -0
- package/dist/templates/nextauth/files/src/auth.ts +67 -0
- package/dist/templates/nextauth/files/types/next-auth.d.ts +16 -0
- package/dist/templates/nextauth/manifest.json +74 -0
- package/dist/templates/observability/README.md +69 -0
- package/dist/templates/observability/files/.env.observability.example +12 -0
- package/dist/templates/observability/files/.env.otel.example +7 -0
- package/dist/templates/observability/files/app/api/health/route.ts +37 -0
- package/dist/templates/observability/files/instrumentation.ts +52 -0
- package/dist/templates/observability/files/server/middleware/request-logger.ts +53 -0
- package/dist/templates/observability/files/src/infrastructure/logging/context.ts +21 -0
- package/dist/templates/observability/files/src/infrastructure/logging/correlation.ts +39 -0
- package/dist/templates/observability/files/src/infrastructure/logging/index.ts +12 -0
- package/dist/templates/observability/files/src/infrastructure/logging/logger.ts +68 -0
- package/dist/templates/observability/files/src/infrastructure/logging/redact.ts +89 -0
- package/dist/templates/observability/manifest.json +57 -0
- package/dist/templates/rate-limiting/README.md +63 -0
- package/dist/templates/rate-limiting/files/.env.rate-limit.example +21 -0
- package/dist/templates/rate-limiting/files/server/errors/rate-limit-exceeded.error.ts +43 -0
- package/dist/templates/rate-limiting/files/server/middleware/rate-limit.ts +79 -0
- package/dist/templates/rate-limiting/files/server/utils/get-client-ip.ts +27 -0
- package/dist/templates/rate-limiting/files/server/utils/rate-limiter.ts +82 -0
- package/dist/templates/rate-limiting/files/server/utils/session-id.ts +28 -0
- package/dist/templates/rate-limiting/files/types/rate-limit.d.ts +12 -0
- package/dist/templates/rate-limiting/manifest.json +66 -0
- package/dist/templates/shared-types/README.md +59 -0
- package/dist/templates/shared-types/files/.env.shared-types.example +14 -0
- package/dist/templates/shared-types/files/src/domain/value-objects/user-context.ts +11 -0
- package/dist/templates/shared-types/files/src/infrastructure/auth/mock-user.ts +16 -0
- package/dist/templates/shared-types/files/src/infrastructure/auth/session/session-manager.ts +59 -0
- package/dist/templates/shared-types/manifest.json +37 -0
- package/dist/templates/supabase/README.md +59 -0
- package/dist/templates/supabase/files/.env.supabase.example +15 -0
- package/dist/templates/supabase/files/drizzle.config.ts +15 -0
- package/dist/templates/supabase/files/scripts/gen-types.sh +9 -0
- package/dist/templates/supabase/files/scripts/migrate.ts +23 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/admin.ts +23 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/client.ts +16 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/drizzle/client.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/drizzle/schema.ts +10 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/realtime/subscribe.ts +41 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/result.ts +30 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/server.ts +28 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/delete.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/download.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/index.ts +4 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/signed-url.ts +26 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/upload.ts +24 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/types/database.types.ts +10 -0
- package/dist/templates/supabase/files/supabase/migrations/0001_example_rls.sql +23 -0
- package/dist/templates/supabase/files/supabase/seed.sql +7 -0
- package/dist/templates/supabase/manifest.json +133 -0
- package/dist/templates/supabase-auth/README.md +55 -0
- package/dist/templates/supabase-auth/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/supabase-auth/files/middleware.ts +108 -0
- package/dist/templates/supabase-auth/files/src/lib/auth/get-current-user.ts +46 -0
- package/dist/templates/supabase-auth/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/supabase-auth/manifest.json +40 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/manifest/apps.d.ts +24 -0
- package/dist/types/manifest/apps.d.ts.map +1 -0
- package/dist/types/manifest/bounded-context.d.ts +43 -0
- package/dist/types/manifest/bounded-context.d.ts.map +1 -0
- package/dist/types/manifest/generator.d.ts +51 -0
- package/dist/types/manifest/generator.d.ts.map +1 -0
- package/dist/types/manifest/helpers.d.ts +30 -0
- package/dist/types/manifest/helpers.d.ts.map +1 -0
- package/dist/types/manifest/index.d.ts +8 -0
- package/dist/types/manifest/index.d.ts.map +1 -0
- package/dist/types/manifest/layers.d.ts +32 -0
- package/dist/types/manifest/layers.d.ts.map +1 -0
- package/dist/types/manifest/manifest.d.ts +64 -0
- package/dist/types/manifest/manifest.d.ts.map +1 -0
- package/dist/types/manifest/monorepo.d.ts +94 -0
- package/dist/types/manifest/monorepo.d.ts.map +1 -0
- package/dist/types/manifest.d.ts +2 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# -------- Observability (logging) --------
|
|
2
|
+
# All optional — the logger ships sensible defaults.
|
|
3
|
+
# error | warn | info | debug
|
|
4
|
+
LOG_LEVEL=info
|
|
5
|
+
# json | pretty-dev | auto (auto = pretty in dev, json in production)
|
|
6
|
+
LOG_FORMAT=auto
|
|
7
|
+
# Header carrying the per-request correlation id
|
|
8
|
+
CORRELATION_ID_HEADER=x-request-id
|
|
9
|
+
#
|
|
10
|
+
# Note: redaction masks by field name only. Error messages and stack traces are
|
|
11
|
+
# logged verbatim (they can contain file paths) — keep secrets out of error
|
|
12
|
+
# messages and treat your logs as sensitive at rest.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# -------- OpenTelemetry (tracing) --------
|
|
2
|
+
# Optional — only if you enabled OTel. Install:
|
|
3
|
+
# npm install @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http @opentelemetry/auto-instrumentations-node
|
|
4
|
+
# Name this service shows up as in traces.
|
|
5
|
+
OTEL_SERVICE_NAME=
|
|
6
|
+
# OTLP/HTTP collector endpoint (e.g. a local collector or a vendor URL).
|
|
7
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// GET /api/health — readiness probe. 200 when healthy, 503 when degraded.
|
|
2
|
+
//
|
|
3
|
+
// Standalone by default (a liveness/process check). As you install templates
|
|
4
|
+
// that own external services, push their checks into `checks` — e.g. ping Redis
|
|
5
|
+
// (bullmq/rate-limiting), Supabase, or verify the LLM key is configured. Keep
|
|
6
|
+
// each check fast and time-boxed; a health probe must not hang.
|
|
7
|
+
|
|
8
|
+
export const dynamic = "force-dynamic";
|
|
9
|
+
|
|
10
|
+
interface HealthCheck {
|
|
11
|
+
name: string;
|
|
12
|
+
status: "ok" | "degraded";
|
|
13
|
+
[detail: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function GET(): Promise<Response> {
|
|
17
|
+
const checks: HealthCheck[] = [
|
|
18
|
+
{
|
|
19
|
+
name: "process",
|
|
20
|
+
status: "ok",
|
|
21
|
+
uptimeSeconds: Math.round(process.uptime()),
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const healthy = checks.every((check) => check.status === "ok");
|
|
26
|
+
|
|
27
|
+
return Response.json(
|
|
28
|
+
{
|
|
29
|
+
status: healthy ? "ok" : "degraded",
|
|
30
|
+
version: process.env.npm_package_version ?? "unknown",
|
|
31
|
+
uptime: process.uptime(),
|
|
32
|
+
checks,
|
|
33
|
+
timestamp: new Date().toISOString(),
|
|
34
|
+
},
|
|
35
|
+
{ status: healthy ? 200 : 503 },
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Next.js instrumentation hook — runs once at server startup. Boots the
|
|
2
|
+
// OpenTelemetry Node SDK in the Node.js runtime only (not Edge).
|
|
3
|
+
//
|
|
4
|
+
// The OTel packages are optional peers — install them when you enable tracing:
|
|
5
|
+
// npm install @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http \
|
|
6
|
+
// @opentelemetry/auto-instrumentations-node
|
|
7
|
+
// Their specifiers are held in variables so a project that hasn't installed them
|
|
8
|
+
// still typechecks; registration is skipped if they're missing at runtime. The
|
|
9
|
+
// `webpackIgnore` hints keep Next.js/Webpack from trying to resolve these
|
|
10
|
+
// optional imports at build time (which would emit a "Critical dependency"
|
|
11
|
+
// warning); they are left as native runtime imports.
|
|
12
|
+
|
|
13
|
+
export async function register(): Promise<void> {
|
|
14
|
+
if (process.env.NEXT_RUNTIME !== "nodejs") return;
|
|
15
|
+
|
|
16
|
+
const sdkModule: string = "@opentelemetry/sdk-node";
|
|
17
|
+
const otlpModule: string = "@opentelemetry/exporter-trace-otlp-http";
|
|
18
|
+
const autoModule: string = "@opentelemetry/auto-instrumentations-node";
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const { NodeSDK } = (await import(/* webpackIgnore: true */ sdkModule)) as {
|
|
22
|
+
NodeSDK: new (config: unknown) => { start(): void };
|
|
23
|
+
};
|
|
24
|
+
const { OTLPTraceExporter } = (await import(
|
|
25
|
+
/* webpackIgnore: true */ otlpModule
|
|
26
|
+
)) as {
|
|
27
|
+
OTLPTraceExporter: new (config: unknown) => unknown;
|
|
28
|
+
};
|
|
29
|
+
const { getNodeAutoInstrumentations } = (await import(
|
|
30
|
+
/* webpackIgnore: true */ autoModule
|
|
31
|
+
)) as {
|
|
32
|
+
getNodeAutoInstrumentations: () => unknown;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const sdk = new NodeSDK({
|
|
36
|
+
serviceName: process.env.OTEL_SERVICE_NAME ?? "app",
|
|
37
|
+
traceExporter: new OTLPTraceExporter({
|
|
38
|
+
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
|
|
39
|
+
}),
|
|
40
|
+
instrumentations: [getNodeAutoInstrumentations()],
|
|
41
|
+
});
|
|
42
|
+
sdk.start();
|
|
43
|
+
} catch (err) {
|
|
44
|
+
// A missing optional package is the expected "tracing not installed" case —
|
|
45
|
+
// stay silent. Surface anything else (a real bootstrap failure) so it is not
|
|
46
|
+
// swallowed behind the optional-dependency guard.
|
|
47
|
+
const code = (err as { code?: string }).code;
|
|
48
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND") {
|
|
49
|
+
console.warn("[instrumentation] OpenTelemetry bootstrap failed:", err);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CORRELATION_ID_HEADER,
|
|
3
|
+
getOrCreateCorrelationId,
|
|
4
|
+
} from "../../src/infrastructure/logging/correlation";
|
|
5
|
+
import { runWithContext } from "../../src/infrastructure/logging/context";
|
|
6
|
+
import { logger } from "../../src/infrastructure/logging/logger";
|
|
7
|
+
|
|
8
|
+
// Minimal structural shapes so this stays framework-agnostic (no express/next
|
|
9
|
+
// type dependency). They match the Connect/Express req/res surface we use.
|
|
10
|
+
interface RequestLike {
|
|
11
|
+
method?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
headers: Record<string, string | string[] | undefined>;
|
|
14
|
+
}
|
|
15
|
+
interface ResponseLike {
|
|
16
|
+
statusCode: number;
|
|
17
|
+
setHeader(name: string, value: string): void;
|
|
18
|
+
on(event: "finish", listener: () => void): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Connect/Express-style middleware: assigns a correlation id, echoes it on the
|
|
23
|
+
* response header, runs the handler chain inside the request context, and emits
|
|
24
|
+
* one structured line per request when the response finishes.
|
|
25
|
+
*/
|
|
26
|
+
export function requestLoggerMiddleware(
|
|
27
|
+
req: RequestLike,
|
|
28
|
+
res: ResponseLike,
|
|
29
|
+
next: () => void,
|
|
30
|
+
): void {
|
|
31
|
+
const requestId = getOrCreateCorrelationId((name) => {
|
|
32
|
+
const value = req.headers[name.toLowerCase()];
|
|
33
|
+
return Array.isArray(value) ? value[0] : value;
|
|
34
|
+
});
|
|
35
|
+
const startedAt = Date.now();
|
|
36
|
+
res.setHeader(CORRELATION_ID_HEADER, requestId);
|
|
37
|
+
|
|
38
|
+
res.on("finish", () => {
|
|
39
|
+
logger.info({
|
|
40
|
+
type: "request",
|
|
41
|
+
method: req.method,
|
|
42
|
+
// Log the path only — strip the query string so secrets passed as query
|
|
43
|
+
// params (e.g. ?token=...) never reach the logs. Redaction is key-based
|
|
44
|
+
// and cannot scrub values embedded inside a URL string.
|
|
45
|
+
path: req.url?.split("?")[0],
|
|
46
|
+
status: res.statusCode,
|
|
47
|
+
durationMs: Date.now() - startedAt,
|
|
48
|
+
requestId,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
runWithContext({ requestId, startedAt }, next);
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
|
|
3
|
+
/** Ambient per-request context, carried through the async call chain. */
|
|
4
|
+
export interface RequestContext {
|
|
5
|
+
requestId: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const store = new AsyncLocalStorage<RequestContext>();
|
|
12
|
+
|
|
13
|
+
/** Run `fn` with `ctx` available to every async descendant via getRequestContext(). */
|
|
14
|
+
export function runWithContext<T>(ctx: RequestContext, fn: () => T): T {
|
|
15
|
+
return store.run(ctx, fn);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The current request context, or undefined outside a request scope. */
|
|
19
|
+
export function getRequestContext(): RequestContext | undefined {
|
|
20
|
+
return store.getStore();
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The header carrying each request's correlation id. Defaults to the value
|
|
5
|
+
* chosen at install time; the CORRELATION_ID_HEADER env var (see
|
|
6
|
+
* .env.observability.example) overrides it at runtime.
|
|
7
|
+
*/
|
|
8
|
+
export const CORRELATION_ID_HEADER =
|
|
9
|
+
process.env.CORRELATION_ID_HEADER ?? "{correlation_header}";
|
|
10
|
+
|
|
11
|
+
// An incoming correlation id is attacker-controllable: it is echoed back in the
|
|
12
|
+
// response header and written to every log line. Only trust values that are
|
|
13
|
+
// bounded and use a safe charset; anything else is replaced with a minted id so
|
|
14
|
+
// a hostile/buggy client cannot pollute logs or break response-header emission.
|
|
15
|
+
const MAX_CORRELATION_ID_LENGTH = 128;
|
|
16
|
+
const SAFE_CORRELATION_ID = /^[A-Za-z0-9._-]+$/;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Return the incoming correlation id when it is well-formed, otherwise mint a
|
|
20
|
+
* fresh one. `getHeader` abstracts over framework header APIs — pass
|
|
21
|
+
* `(name) => req.headers[name]` (Express) or `(name) => request.headers.get(name)`
|
|
22
|
+
* (Next / Fetch).
|
|
23
|
+
*/
|
|
24
|
+
export function getOrCreateCorrelationId(
|
|
25
|
+
getHeader: (name: string) => string | null | undefined,
|
|
26
|
+
): string {
|
|
27
|
+
const existing = getHeader(CORRELATION_ID_HEADER);
|
|
28
|
+
if (typeof existing === "string") {
|
|
29
|
+
const candidate = existing.trim();
|
|
30
|
+
if (
|
|
31
|
+
candidate.length > 0 &&
|
|
32
|
+
candidate.length <= MAX_CORRELATION_ID_LENGTH &&
|
|
33
|
+
SAFE_CORRELATION_ID.test(candidate)
|
|
34
|
+
) {
|
|
35
|
+
return candidate;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return randomUUID();
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Public surface of the logging module — import from here, not the files.
|
|
2
|
+
export { logger } from "./logger";
|
|
3
|
+
export {
|
|
4
|
+
CORRELATION_ID_HEADER,
|
|
5
|
+
getOrCreateCorrelationId,
|
|
6
|
+
} from "./correlation";
|
|
7
|
+
export {
|
|
8
|
+
runWithContext,
|
|
9
|
+
getRequestContext,
|
|
10
|
+
type RequestContext,
|
|
11
|
+
} from "./context";
|
|
12
|
+
export { REDACTED_FIELDS, redact } from "./redact";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRequestContext } from "./context";
|
|
2
|
+
import { redact } from "./redact";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Zero-dependency structured logger. Emits one line per call: JSON in
|
|
6
|
+
* production, a readable line in development. Swap the internals for pino/winston
|
|
7
|
+
* later without changing call sites — the interface (logger.info(fields, msg))
|
|
8
|
+
* stays the same.
|
|
9
|
+
*/
|
|
10
|
+
type Level = "error" | "warn" | "info" | "debug";
|
|
11
|
+
|
|
12
|
+
const PRIORITY: Record<Level, number> = { error: 0, warn: 1, info: 2, debug: 3 };
|
|
13
|
+
|
|
14
|
+
const ACTIVE_LEVEL = ((): Level => {
|
|
15
|
+
const raw = (process.env.LOG_LEVEL ?? "info").toLowerCase();
|
|
16
|
+
return raw in PRIORITY ? (raw as Level) : "info";
|
|
17
|
+
})();
|
|
18
|
+
|
|
19
|
+
// Default set by the observability wizard via the `log_format` answer; the
|
|
20
|
+
// LOG_FORMAT env var (see .env.observability.example) overrides it at runtime.
|
|
21
|
+
const LOG_FORMAT = process.env.LOG_FORMAT ?? "{log_format}";
|
|
22
|
+
const USE_PRETTY =
|
|
23
|
+
LOG_FORMAT === "pretty-dev" ||
|
|
24
|
+
(LOG_FORMAT === "auto" && process.env.NODE_ENV !== "production");
|
|
25
|
+
|
|
26
|
+
function enabled(level: Level): boolean {
|
|
27
|
+
return PRIORITY[level] <= PRIORITY[ACTIVE_LEVEL];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type Fields = Record<string, unknown> | Error;
|
|
31
|
+
|
|
32
|
+
function emit(level: Level, fields: Fields, message?: string): void {
|
|
33
|
+
if (!enabled(level)) return;
|
|
34
|
+
const ctx = getRequestContext();
|
|
35
|
+
// A bare Error has non-enumerable name/message/stack, so spreading it would
|
|
36
|
+
// log an empty object. Normalize `logger.error(err)` into `{ err }` so
|
|
37
|
+
// redact() can serialize the error's details.
|
|
38
|
+
const normalized = fields instanceof Error ? { err: fields } : fields;
|
|
39
|
+
const base: Record<string, unknown> = {
|
|
40
|
+
level,
|
|
41
|
+
time: new Date().toISOString(),
|
|
42
|
+
...(ctx ? { requestId: ctx.requestId, userId: ctx.userId } : {}),
|
|
43
|
+
...(message ? { message } : {}),
|
|
44
|
+
...normalized,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (USE_PRETTY) {
|
|
48
|
+
const reqId = ctx ? " [" + ctx.requestId + "]" : "";
|
|
49
|
+
const tail =
|
|
50
|
+
Object.keys(normalized).length > 0
|
|
51
|
+
? " " + JSON.stringify(redact(normalized))
|
|
52
|
+
: "";
|
|
53
|
+
console.log("[" + level.toUpperCase() + "]" + reqId + " " + (message ?? "") + tail);
|
|
54
|
+
} else {
|
|
55
|
+
console.log(JSON.stringify(redact(base)));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const logger = {
|
|
60
|
+
error: (fields: Fields = {}, message?: string): void =>
|
|
61
|
+
emit("error", fields, message),
|
|
62
|
+
warn: (fields: Fields = {}, message?: string): void =>
|
|
63
|
+
emit("warn", fields, message),
|
|
64
|
+
info: (fields: Fields = {}, message?: string): void =>
|
|
65
|
+
emit("info", fields, message),
|
|
66
|
+
debug: (fields: Fields = {}, message?: string): void =>
|
|
67
|
+
emit("debug", fields, message),
|
|
68
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Redaction policy: masking is by field *name* only. An Error's `message` and
|
|
2
|
+
// `stack` are logged verbatim (see redactInternal) — they are not scrubbed, so
|
|
3
|
+
// they can surface file paths and any secret a caller embedded in an error
|
|
4
|
+
// message. Keep secrets out of error construction, and treat logs as sensitive
|
|
5
|
+
// at rest. This is a deliberate trade-off: key-redacting stack traces is
|
|
6
|
+
// unreliable and destroys their debugging value.
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Field-name fragments whose values are masked in logs. Matched case-insensitively
|
|
10
|
+
* as substrings, so "apiKey", "AUTHORIZATION", and "user_password" all redact.
|
|
11
|
+
*/
|
|
12
|
+
export const REDACTED_FIELDS = [
|
|
13
|
+
"password",
|
|
14
|
+
"token",
|
|
15
|
+
"secret",
|
|
16
|
+
"authorization",
|
|
17
|
+
"cookie",
|
|
18
|
+
"apikey",
|
|
19
|
+
"api_key",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const MASK = "[REDACTED]";
|
|
23
|
+
const CIRCULAR = "[CIRCULAR]";
|
|
24
|
+
|
|
25
|
+
function isSensitive(key: string): boolean {
|
|
26
|
+
const lower = key.toLowerCase();
|
|
27
|
+
return REDACTED_FIELDS.some((fragment) => lower.includes(fragment));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Recursively copy `value`, masking the value of any key that looks sensitive.
|
|
32
|
+
* Never mutates the input. Use before logging anything that may carry secrets.
|
|
33
|
+
*
|
|
34
|
+
* Cyclic references are replaced with `"[CIRCULAR]"` so logging an object with
|
|
35
|
+
* back-references (common with framework/ORM/request objects) can never cause
|
|
36
|
+
* unbounded recursion. The `seen` set tracks only the current ancestor chain
|
|
37
|
+
* (entries are removed on the way back up), so a value shared across sibling
|
|
38
|
+
* branches without a cycle is still fully redacted.
|
|
39
|
+
*/
|
|
40
|
+
export function redact(value: unknown): unknown {
|
|
41
|
+
return redactInternal(value, new WeakSet<object>());
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function redactInternal(value: unknown, seen: WeakSet<object>): unknown {
|
|
45
|
+
// Preserve Date — the generic object branch sees no enumerable keys and would
|
|
46
|
+
// emit `{}`. Returned as-is so JSON serialization renders it as an ISO string.
|
|
47
|
+
if (value instanceof Date) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
// Error's name/message/stack are non-enumerable, so Object.entries() yields
|
|
51
|
+
// nothing and the object branch would erase the crash details. Extract them
|
|
52
|
+
// explicitly, plus the cause chain and any enumerable own props (redacted).
|
|
53
|
+
if (value instanceof Error) {
|
|
54
|
+
if (seen.has(value)) return CIRCULAR;
|
|
55
|
+
seen.add(value);
|
|
56
|
+
const out: Record<string, unknown> = {
|
|
57
|
+
name: value.name,
|
|
58
|
+
message: value.message,
|
|
59
|
+
stack: value.stack,
|
|
60
|
+
};
|
|
61
|
+
const cause = (value as { cause?: unknown }).cause;
|
|
62
|
+
if (cause !== undefined) {
|
|
63
|
+
out.cause = redactInternal(cause, seen);
|
|
64
|
+
}
|
|
65
|
+
for (const [key, child] of Object.entries(value)) {
|
|
66
|
+
out[key] = isSensitive(key) ? MASK : redactInternal(child, seen);
|
|
67
|
+
}
|
|
68
|
+
seen.delete(value);
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(value)) {
|
|
72
|
+
if (seen.has(value)) return CIRCULAR;
|
|
73
|
+
seen.add(value);
|
|
74
|
+
const out = value.map((item) => redactInternal(item, seen));
|
|
75
|
+
seen.delete(value);
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
if (value !== null && typeof value === "object") {
|
|
79
|
+
if (seen.has(value)) return CIRCULAR;
|
|
80
|
+
seen.add(value);
|
|
81
|
+
const out: Record<string, unknown> = {};
|
|
82
|
+
for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
|
|
83
|
+
out[key] = isSensitive(key) ? MASK : redactInternal(child, seen);
|
|
84
|
+
}
|
|
85
|
+
seen.delete(value);
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "observability",
|
|
3
|
+
"name": "Observability",
|
|
4
|
+
"description": "Structured JSON logging, correlation IDs via AsyncLocalStorage, request logger middleware, /api/health endpoint",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": [],
|
|
7
|
+
"conflicts": [],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "log_format",
|
|
11
|
+
"type": "select",
|
|
12
|
+
"prompt": "Log format?",
|
|
13
|
+
"options": ["json", "pretty-dev", "auto"],
|
|
14
|
+
"default": "auto"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "correlation_header",
|
|
18
|
+
"type": "select",
|
|
19
|
+
"prompt": "Correlation ID header name?",
|
|
20
|
+
"options": ["x-request-id", "x-correlation-id", "x-trace-id"],
|
|
21
|
+
"default": "x-request-id"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "otel",
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"prompt": "Set up OpenTelemetry tracing?",
|
|
27
|
+
"default": false
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"envVars": [],
|
|
31
|
+
"outputs": [
|
|
32
|
+
"src/infrastructure/logging/logger.ts",
|
|
33
|
+
"src/infrastructure/logging/correlation.ts",
|
|
34
|
+
"src/infrastructure/logging/context.ts",
|
|
35
|
+
"src/infrastructure/logging/redact.ts",
|
|
36
|
+
"src/infrastructure/logging/index.ts",
|
|
37
|
+
"server/middleware/request-logger.ts",
|
|
38
|
+
"app/api/health/route.ts",
|
|
39
|
+
".env.observability.example",
|
|
40
|
+
{
|
|
41
|
+
"path": "instrumentation.ts",
|
|
42
|
+
"when": { "answer": "otel", "equals": true }
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": ".env.otel.example",
|
|
46
|
+
"when": { "answer": "otel", "equals": true }
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"checklist": [
|
|
50
|
+
"Merge .env.observability.example into .env.local (all vars are optional — the logger has defaults)",
|
|
51
|
+
"Wire requestLoggerMiddleware into your server (Express) or call runWithContext/getOrCreateCorrelationId from a Next.js middleware/route wrapper",
|
|
52
|
+
"Visit http://localhost:3000/api/health — extend its checks array as you add Redis/Supabase/LLM templates",
|
|
53
|
+
"Set LOG_LEVEL=debug to see all request logs; check responses for the correlation header (default x-request-id)",
|
|
54
|
+
"If you enabled OTel: npm install @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http @opentelemetry/auto-instrumentations-node, then merge .env.otel.example and set OTEL_EXPORTER_OTLP_ENDPOINT"
|
|
55
|
+
],
|
|
56
|
+
"branch": "feature/generator-template-observability"
|
|
57
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Rate Limiting (`rate-limiting`)
|
|
2
|
+
|
|
3
|
+
> Differentiated middleware (text/image/general), session+IP hybrid identification, configurable
|
|
4
|
+
> per-type limits, and proximity-to-limit debug logging.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ------------------------------------------ |
|
|
8
|
+
| **ID** | `rate-limiting` |
|
|
9
|
+
| **Category** | Core infrastructure |
|
|
10
|
+
| **Requires** | `env-setup` |
|
|
11
|
+
| **Conflicts** | none |
|
|
12
|
+
| **Branch** | `feature/generator-template-rate-limiting` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
Adds middleware that rate-limits requests by type (text vs image vs general — useful for LLM
|
|
19
|
+
apps where image generation is far costlier) and identifies callers by a hybrid of session
|
|
20
|
+
cookie + client IP. Optionally Redis-backed for multi-instance deployments.
|
|
21
|
+
|
|
22
|
+
## What it scaffolds
|
|
23
|
+
|
|
24
|
+
- `server/middleware/rate-limit.ts` — the middleware.
|
|
25
|
+
- `server/utils/{rate-limiter,get-client-ip,session-id}.ts`.
|
|
26
|
+
- `server/errors/rate-limit-exceeded.error.ts` (429), `types/rate-limit.d.ts`, `.env.rate-limit.example`.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
`hexagen add rate-limiting`. Questions:
|
|
31
|
+
|
|
32
|
+
| Question | Options (default) |
|
|
33
|
+
| --------------------- | -------------------------------------------------------- |
|
|
34
|
+
| `framework` | `nitro` / `nextjs-api` / `express` / `fastify` (`nitro`) |
|
|
35
|
+
| `session_cookie_name` | `__session` |
|
|
36
|
+
| `differentiated` | `true` — separate text/image/general limits |
|
|
37
|
+
| `debug_logging` | `true` |
|
|
38
|
+
| `redis_backed` | `false` — Redis for distributed limiting |
|
|
39
|
+
|
|
40
|
+
Env: `TEXT_RPM`, `IMAGE_RPM`, `GENERAL_RPM`, `RATE_LIMIT_WARN_AT`, `RATE_LIMIT_SESSION_TTL`,
|
|
41
|
+
`RATE_LIMIT_DEBUG`, `RATE_LIMIT_TRUST_PROXY`.
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
Wire `server/middleware/rate-limit.ts` into your framework's middleware chain; it classifies the
|
|
46
|
+
request, identifies the caller, and on exceeding the limit raises an **HTTP 429** via the
|
|
47
|
+
framework's `createError` with a structured body (from `buildRateLimitExceededBody`) — handle it
|
|
48
|
+
as an HTTP response error, not a thrown `RateLimitExceededError` instance.
|
|
49
|
+
|
|
50
|
+
## Notes for agents
|
|
51
|
+
|
|
52
|
+
- Tune per-tier: e.g. `TEXT_RPM=40`, `IMAGE_RPM=12` for the xAI free tier.
|
|
53
|
+
- In-memory by default; set `redis_backed=true` for multi-instance correctness.
|
|
54
|
+
- If you also enable Better Auth's built-in `rateLimit`, reconcile the two so they don't stack.
|
|
55
|
+
|
|
56
|
+
## Checklist (post-install)
|
|
57
|
+
|
|
58
|
+
Merge `.env.rate-limit.example`; set the RPM limits for your tier; confirm the session cookie is
|
|
59
|
+
set; `RATE_LIMIT_DEBUG=true` while testing.
|
|
60
|
+
|
|
61
|
+
## Related
|
|
62
|
+
|
|
63
|
+
Requires [`env-setup`](../env-setup). Complements [`llm-adapter`](../llm-adapter).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Rate Limiting — @generated by @hexagen/sync
|
|
2
|
+
# Merge these into your .env.local
|
|
3
|
+
|
|
4
|
+
# Requests per minute per session (tune to match your LLM provider tier)
|
|
5
|
+
TEXT_RPM=40
|
|
6
|
+
IMAGE_RPM=12
|
|
7
|
+
GENERAL_RPM=60
|
|
8
|
+
|
|
9
|
+
# Warn at this fraction of the limit (0.0–1.0). 0.8 = warn at 80 %
|
|
10
|
+
RATE_LIMIT_WARN_AT=0.8
|
|
11
|
+
|
|
12
|
+
# Session cookie TTL in seconds (604800 = 7 days)
|
|
13
|
+
RATE_LIMIT_SESSION_TTL=604800
|
|
14
|
+
|
|
15
|
+
# Set to "true" during local development to see per-request limit proximity logs
|
|
16
|
+
RATE_LIMIT_DEBUG=false
|
|
17
|
+
|
|
18
|
+
# Set to "true" ONLY when a trusted reverse proxy unconditionally overwrites
|
|
19
|
+
# X-Forwarded-For (e.g. Nginx, Cloudflare, AWS ALB). Leaving this false means
|
|
20
|
+
# socket.remoteAddress is used, which prevents header-spoofing bypasses.
|
|
21
|
+
RATE_LIMIT_TRUST_PROXY=false
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @generated by @hexagen/sync — rate-limiting template
|
|
2
|
+
import type { RateLimitResult } from "../../types/rate-limit.js";
|
|
3
|
+
|
|
4
|
+
export interface RateLimitExceededBody {
|
|
5
|
+
error: "rate_limit_exceeded";
|
|
6
|
+
bucket: string;
|
|
7
|
+
limit: number;
|
|
8
|
+
remaining: 0;
|
|
9
|
+
retryAfter: number;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function buildRateLimitExceededBody(
|
|
14
|
+
result: RateLimitResult,
|
|
15
|
+
): RateLimitExceededBody {
|
|
16
|
+
const retryAfter = Math.max(
|
|
17
|
+
0,
|
|
18
|
+
result.resetAt - Math.floor(Date.now() / 1000),
|
|
19
|
+
);
|
|
20
|
+
return {
|
|
21
|
+
error: "rate_limit_exceeded",
|
|
22
|
+
bucket: result.bucket,
|
|
23
|
+
limit: result.limit,
|
|
24
|
+
remaining: 0,
|
|
25
|
+
retryAfter,
|
|
26
|
+
message: `Too many ${result.bucket} requests. Try again in ${retryAfter} seconds.`,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function rateLimitHeaders(
|
|
31
|
+
result: RateLimitResult,
|
|
32
|
+
): Record<string, string> {
|
|
33
|
+
const retryAfter = Math.max(
|
|
34
|
+
0,
|
|
35
|
+
result.resetAt - Math.floor(Date.now() / 1000),
|
|
36
|
+
);
|
|
37
|
+
return {
|
|
38
|
+
"X-RateLimit-Limit": String(result.limit),
|
|
39
|
+
"X-RateLimit-Remaining": String(result.remaining),
|
|
40
|
+
"X-RateLimit-Reset": String(result.resetAt),
|
|
41
|
+
"Retry-After": String(retryAfter),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// @generated by @hexagen/sync — rate-limiting template
|
|
2
|
+
// Framework: {framework}
|
|
3
|
+
//
|
|
4
|
+
// This middleware is written for Nitro (h3). For other frameworks:
|
|
5
|
+
// nextjs-api — wrap in a Next.js middleware.ts using NextRequest/NextResponse
|
|
6
|
+
// express — export (req, res, next) => {} using req.headers and res.setHeader
|
|
7
|
+
// fastify — register as a preHandler hook using request.headers and reply.header
|
|
8
|
+
import {
|
|
9
|
+
defineEventHandler,
|
|
10
|
+
getCookie,
|
|
11
|
+
setCookie,
|
|
12
|
+
createError,
|
|
13
|
+
getRequestURL,
|
|
14
|
+
} from "h3";
|
|
15
|
+
import { checkRateLimit } from "../utils/rate-limiter.js";
|
|
16
|
+
import { getClientIp } from "../utils/get-client-ip.js";
|
|
17
|
+
import { getOrCreateSessionId } from "../utils/session-id.js";
|
|
18
|
+
import {
|
|
19
|
+
buildRateLimitExceededBody,
|
|
20
|
+
rateLimitHeaders,
|
|
21
|
+
} from "../errors/rate-limit-exceeded.error.js";
|
|
22
|
+
import type { RateLimitBucket } from "../../types/rate-limit.js";
|
|
23
|
+
|
|
24
|
+
const DIFFERENTIATED = {differentiated};
|
|
25
|
+
|
|
26
|
+
// Add or reorder entries to customise bucket routing.
|
|
27
|
+
// The first matching rule wins; unmatched requests fall through to "general".
|
|
28
|
+
const BUCKET_ROUTES: Array<{
|
|
29
|
+
method: string;
|
|
30
|
+
pattern: RegExp;
|
|
31
|
+
bucket: RateLimitBucket;
|
|
32
|
+
}> = [
|
|
33
|
+
{ method: "POST", pattern: /^\/api\/generate\/text/, bucket: "text" },
|
|
34
|
+
{ method: "POST", pattern: /^\/api\/generate\/image/, bucket: "image" },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function resolveBucket(method: string, pathname: string): RateLimitBucket {
|
|
38
|
+
if (!DIFFERENTIATED) return "general";
|
|
39
|
+
for (const route of BUCKET_ROUTES) {
|
|
40
|
+
if (route.method === method && route.pattern.test(pathname)) {
|
|
41
|
+
return route.bucket;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return "general";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default defineEventHandler((event) => {
|
|
48
|
+
const req = event.node.req;
|
|
49
|
+
const res = event.node.res;
|
|
50
|
+
|
|
51
|
+
const ip = getClientIp(
|
|
52
|
+
req.headers as Record<string, string | string[] | undefined>,
|
|
53
|
+
req.socket?.remoteAddress,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// Use session cookie as primary identifier; fall back to IP for cookieless clients
|
|
57
|
+
const clientId =
|
|
58
|
+
getOrCreateSessionId(
|
|
59
|
+
(name) => getCookie(event, name),
|
|
60
|
+
(name, value, opts) => setCookie(event, name, value, opts),
|
|
61
|
+
) || ip;
|
|
62
|
+
|
|
63
|
+
const method = (req.method ?? "GET").toUpperCase();
|
|
64
|
+
const pathname = getRequestURL(event).pathname;
|
|
65
|
+
const bucket = resolveBucket(method, pathname);
|
|
66
|
+
const result = checkRateLimit(clientId, bucket);
|
|
67
|
+
|
|
68
|
+
const headers = rateLimitHeaders(result);
|
|
69
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
70
|
+
res.setHeader(name, value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!result.allowed) {
|
|
74
|
+
throw createError({
|
|
75
|
+
statusCode: 429,
|
|
76
|
+
data: buildRateLimitExceededBody(result),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|