sonamu 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/agents/agent.d.ts +1 -1
- package/dist/ai/agents/agent.d.ts.map +1 -1
- package/dist/ai/agents/agent.js +5 -6
- package/dist/ai/agents/types.d.ts +1 -1
- package/dist/ai/agents/types.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/api.js +18 -18
- package/dist/ai/providers/rtzr/error.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/error.js +17 -15
- package/dist/ai/providers/rtzr/model.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/model.js +3 -2
- package/dist/ai/providers/rtzr/options.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/options.js +16 -16
- package/dist/ai/providers/rtzr/provider.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/provider.js +9 -9
- package/dist/ai/providers/rtzr/utils.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/utils.js +1 -1
- package/dist/api/caster.d.ts.map +1 -1
- package/dist/api/caster.js +17 -17
- package/dist/api/code-converters.d.ts +4 -2
- package/dist/api/code-converters.d.ts.map +1 -1
- package/dist/api/code-converters.js +100 -19
- package/dist/api/config.d.ts +16 -1
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +28 -21
- package/dist/api/context.d.ts +2 -2
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +1 -1
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +18 -11
- package/dist/api/http-validator.d.ts +36 -0
- package/dist/api/http-validator.d.ts.map +1 -0
- package/dist/api/http-validator.js +72 -0
- package/dist/api/index.js +6 -4
- package/dist/api/sonamu.d.ts +59 -20
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +250 -106
- package/dist/api/websocket-helpers.d.ts +7 -5
- package/dist/api/websocket-helpers.d.ts.map +1 -1
- package/dist/api/websocket-helpers.js +6 -6
- package/dist/auth/audit-log/builders.d.ts.map +1 -1
- package/dist/auth/audit-log/builders.js +1 -1
- package/dist/auth/audit-log/client-ip.d.ts +1 -1
- package/dist/auth/audit-log/client-ip.d.ts.map +1 -1
- package/dist/auth/audit-log/client-ip.js +4 -2
- package/dist/auth/audit-log/events.d.ts +5 -1
- package/dist/auth/audit-log/events.d.ts.map +1 -1
- package/dist/auth/audit-log/events.js +1 -1
- package/dist/auth/audit-log/plugin.d.ts +0 -8
- package/dist/auth/audit-log/plugin.d.ts.map +1 -1
- package/dist/auth/audit-log/plugin.js +48 -52
- package/dist/auth/audit-log-ingestor.d.ts.map +1 -1
- package/dist/auth/audit-log-ingestor.js +16 -12
- package/dist/auth/auth-generator.d.ts.map +1 -1
- package/dist/auth/auth-generator.js +1 -1
- package/dist/auth/better-auth-request.d.ts.map +1 -1
- package/dist/auth/better-auth-request.js +6 -5
- package/dist/auth/knex-adapter.js +1 -1
- package/dist/auth/plugins/entity-definitions/index.d.ts +13 -1
- package/dist/auth/plugins/entity-definitions/index.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/index.js +1 -1
- package/dist/auth/plugins/wrappers/admin.d.ts +1 -1
- package/dist/bin/build-config.d.ts +25 -0
- package/dist/bin/build-config.d.ts.map +1 -1
- package/dist/bin/build-config.js +105 -2
- package/dist/bin/cli.js +131 -27
- package/dist/bin/compiler-policy.d.ts +3 -0
- package/dist/bin/compiler-policy.d.ts.map +1 -0
- package/dist/bin/compiler-policy.js +24 -0
- package/dist/bin/fixture.d.ts.map +1 -1
- package/dist/bin/fixture.js +5 -3
- package/dist/bin/test-command.d.ts +22 -1
- package/dist/bin/test-command.d.ts.map +1 -1
- package/dist/bin/test-command.js +18 -10
- package/dist/bin/ts-loader-registration.d.ts +7 -1
- package/dist/bin/ts-loader-registration.d.ts.map +1 -1
- package/dist/bin/ts-loader-registration.js +13 -4
- package/dist/cache/decorator.d.ts.map +1 -1
- package/dist/cache/decorator.js +11 -4
- package/dist/compress/compress.d.ts.map +1 -1
- package/dist/compress/compress.js +1 -1
- package/dist/cone/cone-generator.d.ts +14 -1
- package/dist/cone/cone-generator.d.ts.map +1 -1
- package/dist/cone/cone-generator.js +13 -9
- package/dist/database/_batch_update.js +1 -1
- package/dist/database/base-model.d.ts +22 -10
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +26 -16
- package/dist/database/base-model.types.d.ts +15 -3
- package/dist/database/base-model.types.d.ts.map +1 -1
- package/dist/database/db.d.ts +12 -2
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +10 -7
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +17 -14
- package/dist/database/puri.d.ts +11 -9
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +93 -79
- package/dist/database/puri.types.d.ts +21 -21
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +1 -1
- package/dist/database/upsert-builder.d.ts +12 -10
- package/dist/database/upsert-builder.d.ts.map +1 -1
- package/dist/database/upsert-builder.js +20 -12
- package/dist/dict/sd.d.ts.map +1 -1
- package/dist/dict/sd.js +1 -1
- package/dist/dict/sonamu-dictionary.d.ts.map +1 -1
- package/dist/dict/sonamu-dictionary.js +1 -1
- package/dist/dict/utils.d.ts.map +1 -1
- package/dist/dict/utils.js +7 -2
- package/dist/entity/entity-manager.d.ts +13 -4
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +19 -11
- package/dist/entity/entity-template-cone.d.ts +73 -5
- package/dist/entity/entity-template-cone.d.ts.map +1 -1
- package/dist/entity/entity-template-cone.js +4 -2
- package/dist/entity/entity.d.ts +6 -2
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +30 -28
- package/dist/env.d.ts +3 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -1
- package/dist/exceptions/error-handler.d.ts.map +1 -1
- package/dist/exceptions/error-handler.js +7 -2
- package/dist/exceptions/so-exceptions.d.ts +24 -20
- package/dist/exceptions/so-exceptions.d.ts.map +1 -1
- package/dist/exceptions/so-exceptions.js +4 -2
- package/dist/filter/utils.d.ts +7 -2
- package/dist/filter/utils.d.ts.map +1 -1
- package/dist/filter/utils.js +8 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -6
- package/dist/logger/configure.d.ts.map +1 -1
- package/dist/logger/configure.js +10 -10
- package/dist/migration/code-generation.d.ts.map +1 -1
- package/dist/migration/code-generation.js +50 -46
- package/dist/migration/index-where-predicate.d.ts.map +1 -1
- package/dist/migration/index-where-predicate.js +22 -8
- package/dist/migration/migration-set.d.ts.map +1 -1
- package/dist/migration/migration-set.js +1 -1
- package/dist/migration/migrator.d.ts +3 -2
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +27 -21
- package/dist/migration/postgresql-schema-reader.d.ts.map +1 -1
- package/dist/migration/postgresql-schema-reader.js +51 -36
- package/dist/migration/slack-confirm.d.ts.map +1 -1
- package/dist/migration/slack-confirm.js +1 -1
- package/dist/naite/naite-reporter.js +2 -2
- package/dist/naite/naite.d.ts +74 -15
- package/dist/naite/naite.d.ts.map +1 -1
- package/dist/naite/naite.js +5 -19
- package/dist/runtime-type.d.ts +6 -0
- package/dist/runtime-type.d.ts.map +1 -0
- package/dist/runtime-type.js +26 -0
- package/dist/ssr/hmr-opt-out.d.ts +26 -0
- package/dist/ssr/hmr-opt-out.d.ts.map +1 -0
- package/dist/ssr/hmr-opt-out.js +59 -0
- package/dist/ssr/renderer.d.ts.map +1 -1
- package/dist/ssr/renderer.js +4 -1
- package/dist/storage/base-file.js +14 -14
- package/dist/storage/buffered-file.d.ts +2 -2
- package/dist/storage/buffered-file.d.ts.map +1 -1
- package/dist/storage/buffered-file.js +12 -12
- package/dist/storage/s3-driver.d.ts.map +1 -1
- package/dist/storage/s3-driver.js +1 -1
- package/dist/storage/uploaded-file.d.ts +2 -2
- package/dist/storage/uploaded-file.d.ts.map +1 -1
- package/dist/storage/uploaded-file.js +8 -8
- package/dist/stream/sse.js +11 -11
- package/dist/stream/ws-core.d.ts +1 -1
- package/dist/stream/ws-core.d.ts.map +1 -1
- package/dist/stream/ws-delivery.d.ts +1 -1
- package/dist/stream/ws-delivery.d.ts.map +1 -1
- package/dist/stream/ws-delivery.js +6 -4
- package/dist/stream/ws-local-connection-store.d.ts.map +1 -1
- package/dist/stream/ws-local-connection-store.js +4 -2
- package/dist/stream/ws-presence-store.js +1 -1
- package/dist/stream/ws-registry.d.ts +4 -4
- package/dist/stream/ws-registry.d.ts.map +1 -1
- package/dist/stream/ws-registry.js +4 -2
- package/dist/stream/ws-telemetry.d.ts +16 -12
- package/dist/stream/ws-telemetry.d.ts.map +1 -1
- package/dist/stream/ws-telemetry.js +22 -18
- package/dist/stream/ws.d.ts +18 -12
- package/dist/stream/ws.d.ts.map +1 -1
- package/dist/stream/ws.js +26 -22
- package/dist/syncer/api-parser.js +1 -1
- package/dist/syncer/checksum.d.ts.map +1 -1
- package/dist/syncer/checksum.js +7 -8
- package/dist/syncer/code-generator.d.ts.map +1 -1
- package/dist/syncer/code-generator.js +13 -14
- package/dist/syncer/entity-operations.d.ts.map +1 -1
- package/dist/syncer/entity-operations.js +5 -6
- package/dist/syncer/file-copy.d.ts +5 -0
- package/dist/syncer/file-copy.d.ts.map +1 -0
- package/dist/syncer/file-copy.js +36 -0
- package/dist/syncer/file-patterns.d.ts +1 -0
- package/dist/syncer/file-patterns.d.ts.map +1 -1
- package/dist/syncer/file-patterns.js +5 -2
- package/dist/syncer/file-tracking.d.ts.map +1 -1
- package/dist/syncer/file-tracking.js +5 -4
- package/dist/syncer/filesystem-dependencies.d.ts +15 -0
- package/dist/syncer/filesystem-dependencies.d.ts.map +1 -0
- package/dist/syncer/filesystem-dependencies.js +53 -0
- package/dist/syncer/module-loader.d.ts +1 -1
- package/dist/syncer/module-loader.d.ts.map +1 -1
- package/dist/syncer/module-loader.js +6 -4
- package/dist/syncer/syncer-actions.d.ts +4 -0
- package/dist/syncer/syncer-actions.d.ts.map +1 -1
- package/dist/syncer/syncer-actions.js +34 -17
- package/dist/syncer/syncer.d.ts +17 -6
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +71 -29
- package/dist/syncer/watcher.d.ts.map +1 -1
- package/dist/syncer/watcher.js +3 -3
- package/dist/tasks/decorator.d.ts +6 -6
- package/dist/tasks/decorator.d.ts.map +1 -1
- package/dist/tasks/decorator.js +4 -4
- package/dist/tasks/step-wrapper.d.ts +6 -4
- package/dist/tasks/step-wrapper.d.ts.map +1 -1
- package/dist/tasks/step-wrapper.js +5 -5
- package/dist/tasks/workflow-manager.d.ts.map +1 -1
- package/dist/tasks/workflow-manager.js +13 -7
- package/dist/template/entity-converter.d.ts +1 -1
- package/dist/template/entity-converter.d.ts.map +1 -1
- package/dist/template/entity-converter.js +2 -2
- package/dist/template/helpers.d.ts +8 -6
- package/dist/template/helpers.d.ts.map +1 -1
- package/dist/template/helpers.js +1 -1
- package/dist/template/implementations/generated.template.d.ts.map +1 -1
- package/dist/template/implementations/generated.template.js +4 -4
- package/dist/template/implementations/generated_http.template.d.ts +7 -4
- package/dist/template/implementations/generated_http.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_http.template.js +21 -21
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_sso.template.js +6 -3
- package/dist/template/implementations/http_validators.template.d.ts +18 -0
- package/dist/template/implementations/http_validators.template.d.ts.map +1 -0
- package/dist/template/implementations/http_validators.template.js +127 -0
- package/dist/template/implementations/model.template.d.ts.map +1 -1
- package/dist/template/implementations/model.template.js +1 -1
- package/dist/template/implementations/queries.template.js +1 -1
- package/dist/template/implementations/sd.template.d.ts.map +1 -1
- package/dist/template/implementations/sd.template.js +79 -39
- package/dist/template/implementations/services.template.d.ts.map +1 -1
- package/dist/template/implementations/services.template.js +6 -4
- package/dist/template/implementations/view_form.template.d.ts +6 -1
- package/dist/template/implementations/view_form.template.d.ts.map +1 -1
- package/dist/template/implementations/view_form.template.js +23 -15
- package/dist/template/implementations/view_list.template.d.ts.map +1 -1
- package/dist/template/implementations/view_list.template.js +11 -6
- package/dist/template/template-manager.d.ts.map +1 -1
- package/dist/template/template-manager.js +9 -7
- package/dist/template/template-types.d.ts +12 -5
- package/dist/template/template-types.d.ts.map +1 -1
- package/dist/template/template-types.js +1 -1
- package/dist/template/template.d.ts +2 -2
- package/dist/template/template.d.ts.map +1 -1
- package/dist/template/template.js +6 -4
- package/dist/template/zod-converter.d.ts +0 -19
- package/dist/template/zod-converter.d.ts.map +1 -1
- package/dist/template/zod-converter.js +100 -84
- package/dist/testing/_relation-graph.d.ts.map +1 -1
- package/dist/testing/_relation-graph.js +2 -1
- package/dist/testing/bootstrap.d.ts.map +1 -1
- package/dist/testing/bootstrap.js +9 -6
- package/dist/testing/data-explorer.d.ts +32 -7
- package/dist/testing/data-explorer.d.ts.map +1 -1
- package/dist/testing/data-explorer.js +77 -31
- package/dist/testing/dev-test-routes.d.ts +8 -1
- package/dist/testing/dev-test-routes.d.ts.map +1 -1
- package/dist/testing/dev-test-routes.js +125 -108
- package/dist/testing/dev-vitest-manager.d.ts +54 -8
- package/dist/testing/dev-vitest-manager.d.ts.map +1 -1
- package/dist/testing/dev-vitest-manager.js +24 -9
- package/dist/testing/faker-mappings.d.ts +412 -1
- package/dist/testing/faker-mappings.d.ts.map +1 -1
- package/dist/testing/faker-mappings.js +1 -1
- package/dist/testing/filesystem.d.ts +2 -0
- package/dist/testing/filesystem.d.ts.map +1 -0
- package/dist/testing/filesystem.js +7 -0
- package/dist/testing/fixture-generator.d.ts +25 -8
- package/dist/testing/fixture-generator.d.ts.map +1 -1
- package/dist/testing/fixture-generator.js +132 -73
- package/dist/testing/fixture-loader.d.ts +3 -1
- package/dist/testing/fixture-loader.d.ts.map +1 -1
- package/dist/testing/fixture-loader.js +1 -20
- package/dist/testing/fixture-manager.d.ts +8 -7
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +91 -59
- package/dist/testing/global-setup.d.ts.map +1 -1
- package/dist/testing/global-setup.js +5 -2
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -3
- package/dist/types/types.d.ts +101 -99
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +234 -225
- package/dist/ui/ai-api.d.ts.map +1 -1
- package/dist/ui/ai-api.js +1 -1
- package/dist/ui/ai-client.d.ts.map +1 -1
- package/dist/ui/ai-client.js +28 -18
- package/dist/ui/api.d.ts.map +1 -1
- package/dist/ui/api.js +135 -128
- package/dist/ui/async-route.d.ts +3 -0
- package/dist/ui/async-route.d.ts.map +1 -0
- package/dist/ui/async-route.js +12 -0
- package/dist/ui/cdd-service.d.ts +9 -7
- package/dist/ui/cdd-service.d.ts.map +1 -1
- package/dist/ui/cdd-service.js +7 -5
- package/dist/ui/migrations-api.d.ts.map +1 -1
- package/dist/ui/migrations-api.js +17 -15
- package/dist/ui-web/assets/index-DV1AAq6W.js +178 -0
- package/dist/ui-web/index.html +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +7 -5
- package/dist/utils/fs-utils.d.ts +3 -3
- package/dist/utils/fs-utils.d.ts.map +1 -1
- package/dist/utils/fs-utils.js +6 -6
- package/dist/utils/model.d.ts +3 -5
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +1 -1
- package/dist/utils/object-utils.d.ts +1 -1
- package/dist/utils/object-utils.d.ts.map +1 -1
- package/dist/utils/object-utils.js +17 -16
- package/dist/utils/process-utils.d.ts.map +1 -1
- package/dist/utils/process-utils.js +4 -2
- package/dist/utils/runtime-value.d.ts +13 -0
- package/dist/utils/runtime-value.d.ts.map +1 -0
- package/dist/utils/runtime-value.js +40 -0
- package/dist/utils/sql-parser.d.ts +8 -1
- package/dist/utils/sql-parser.d.ts.map +1 -1
- package/dist/utils/sql-parser.js +6 -3
- package/dist/utils/type-utils.d.ts.map +1 -1
- package/dist/utils/type-utils.js +10 -8
- package/dist/utils/utils.d.ts +2 -2
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +11 -8
- package/dist/utils/zod-error.d.ts.map +1 -1
- package/dist/utils/zod-error.js +7 -4
- package/dist/vector/chunking.d.ts.map +1 -1
- package/dist/vector/chunking.js +1 -1
- package/dist/vector/embedding.d.ts.map +1 -1
- package/dist/vector/embedding.js +1 -1
- package/dist/vector/types.d.ts +3 -2
- package/dist/vector/types.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/ai/agents/agent.ts +5 -5
- package/src/ai/agents/types.ts +1 -1
- package/src/ai/providers/rtzr/__tests__/model.test.ts +2 -2
- package/src/ai/providers/rtzr/error.ts +5 -3
- package/src/ai/providers/rtzr/model.ts +3 -2
- package/src/ai/providers/rtzr/options.ts +10 -5
- package/src/ai/providers/rtzr/provider.ts +10 -10
- package/src/ai/providers/rtzr/utils.ts +3 -1
- package/src/api/__tests__/config.test.ts +11 -21
- package/src/api/__tests__/sonamu.http-validator.test.ts +512 -0
- package/src/api/__tests__/sonamu.websocket.test.ts +51 -41
- package/src/api/__tests__/zod-compiler-policy.test.ts +95 -0
- package/src/api/caster.ts +6 -8
- package/src/api/code-converters.ts +136 -36
- package/src/api/config.ts +62 -4
- package/src/api/context.ts +3 -3
- package/src/api/decorators.ts +28 -17
- package/src/api/http-validator.ts +149 -0
- package/src/api/sonamu.ts +459 -152
- package/src/api/websocket-helpers.ts +24 -17
- package/src/auth/audit-log/builders.ts +3 -2
- package/src/auth/audit-log/client-ip.ts +4 -2
- package/src/auth/audit-log/events.ts +15 -1
- package/src/auth/audit-log/plugin.ts +129 -200
- package/src/auth/audit-log-ingestor.ts +19 -15
- package/src/auth/auth-generator.ts +10 -5
- package/src/auth/better-auth-request.ts +4 -3
- package/src/auth/knex-adapter.ts +8 -2
- package/src/auth/plugins/entity-definitions/index.ts +6 -5
- package/src/bin/__tests__/http-validator-benchmark.test.ts +94 -0
- package/src/bin/__tests__/test-command.test.ts +9 -15
- package/src/bin/__tests__/ts-loader-register.test.ts +15 -17
- package/src/bin/__tests__/zod-compiler-build.test.ts +307 -0
- package/src/bin/build-config.ts +167 -0
- package/src/bin/cli.ts +153 -36
- package/src/bin/compiler-policy.ts +35 -0
- package/src/bin/fixture.ts +14 -3
- package/src/bin/test-command.ts +74 -29
- package/src/bin/ts-loader-registration.ts +22 -4
- package/src/cache/decorator.ts +10 -3
- package/src/compress/compress.ts +17 -4
- package/src/cone/cone-generator.ts +34 -6
- package/src/database/__tests__/db.test.ts +1 -0
- package/src/database/__tests__/puri.test.ts +16 -15
- package/src/database/__tests__/transaction-scope.test.ts +5 -0
- package/src/database/_batch_update.ts +1 -0
- package/src/database/base-model.ts +81 -50
- package/src/database/base-model.types.ts +6 -6
- package/src/database/db.ts +29 -19
- package/src/database/knex.ts +30 -17
- package/src/database/puri-subset.test-d.ts +17 -0
- package/src/database/puri.ts +181 -143
- package/src/database/puri.types.test-d.ts +31 -1
- package/src/database/puri.types.ts +23 -21
- package/src/database/upsert-builder.ts +75 -53
- package/src/dict/sd.ts +15 -5
- package/src/dict/sonamu-dictionary.ts +6 -6
- package/src/dict/utils.ts +9 -1
- package/src/entity/entity-manager.ts +26 -9
- package/src/entity/entity-template-cone.ts +5 -10
- package/src/entity/entity.ts +50 -34
- package/src/env.ts +7 -3
- package/src/exceptions/error-handler.ts +17 -2
- package/src/exceptions/so-exceptions.ts +26 -20
- package/src/filter/utils.ts +21 -11
- package/src/index.ts +3 -0
- package/src/logger/configure.ts +26 -18
- package/src/migration/__tests__/migrator.test.ts +50 -57
- package/src/migration/code-generation.ts +132 -104
- package/src/migration/index-where-predicate.ts +51 -24
- package/src/migration/migration-set.ts +11 -5
- package/src/migration/migrator.ts +68 -41
- package/src/migration/postgresql-schema-reader.ts +52 -47
- package/src/migration/slack-confirm.ts +17 -15
- package/src/naite/naite-reporter.ts +1 -1
- package/src/naite/naite.ts +97 -24
- package/src/runtime-type.ts +34 -0
- package/src/ssr/hmr-opt-out.ts +78 -0
- package/src/ssr/renderer.ts +6 -0
- package/src/storage/base-file.ts +13 -13
- package/src/storage/buffered-file.ts +11 -11
- package/src/storage/s3-driver.ts +4 -1
- package/src/storage/uploaded-file.ts +8 -8
- package/src/stream/__tests__/ws-contracts.test.ts +4 -2
- package/src/stream/__tests__/ws-telemetry.test.ts +1 -1
- package/src/stream/__tests__/ws.test.ts +30 -6
- package/src/stream/sse.ts +12 -11
- package/src/stream/ws-core.ts +1 -1
- package/src/stream/ws-delivery.ts +16 -7
- package/src/stream/ws-local-connection-store.ts +2 -3
- package/src/stream/ws-presence-store.ts +6 -1
- package/src/stream/ws-registry.ts +16 -7
- package/src/stream/ws-telemetry.ts +66 -43
- package/src/stream/ws.ts +73 -39
- package/src/syncer/__tests__/api-parser.websocket-type-ref.test.ts +3 -2
- package/src/syncer/__tests__/http-validator-registry.test.ts +137 -0
- package/src/syncer/api-parser.ts +67 -27
- package/src/syncer/checksum.ts +17 -11
- package/src/syncer/code-generator.ts +25 -17
- package/src/syncer/entity-operations.ts +3 -5
- package/src/syncer/file-copy.ts +46 -0
- package/src/syncer/file-patterns.ts +11 -8
- package/src/syncer/file-tracking.ts +3 -4
- package/src/syncer/filesystem-dependencies.ts +73 -0
- package/src/syncer/module-loader.ts +8 -4
- package/src/syncer/syncer-actions.ts +56 -18
- package/src/syncer/syncer.ts +116 -43
- package/src/syncer/watcher.ts +8 -4
- package/src/tasks/decorator.ts +20 -12
- package/src/tasks/step-wrapper.ts +19 -9
- package/src/tasks/workflow-manager.ts +15 -9
- package/src/template/__tests__/http_validators.template.test.ts +160 -0
- package/src/template/__tests__/services.template.mutation.test.ts +24 -23
- package/src/template/__tests__/services.template.websocket.test.ts +21 -25
- package/src/template/entity-converter.ts +5 -2
- package/src/template/helpers.ts +8 -9
- package/src/template/implementations/generated.template.ts +5 -4
- package/src/template/implementations/generated_http.template.ts +61 -15
- package/src/template/implementations/generated_sso.template.ts +15 -4
- package/src/template/implementations/http_validators.template.ts +175 -0
- package/src/template/implementations/model.template.ts +3 -1
- package/src/template/implementations/sd.template.ts +81 -41
- package/src/template/implementations/services.template.ts +2 -2
- package/src/template/implementations/view_form.template.ts +56 -39
- package/src/template/implementations/view_list.template.ts +31 -23
- package/src/template/template-manager.ts +15 -13
- package/src/template/template-types.ts +13 -5
- package/src/template/template.ts +4 -3
- package/src/template/zod-converter.ts +206 -91
- package/src/testing/__tests__/dev-test-routes.test.ts +85 -25
- package/src/testing/__tests__/dev-vitest-manager.test.ts +15 -15
- package/src/testing/_relation-graph.ts +4 -1
- package/src/testing/bootstrap.ts +12 -5
- package/src/testing/data-explorer.ts +102 -53
- package/src/testing/dev-test-routes.ts +87 -50
- package/src/testing/dev-vitest-manager.ts +88 -32
- package/src/testing/faker-mappings.ts +2 -2
- package/src/testing/filesystem.ts +1 -0
- package/src/testing/fixture-generator.ts +191 -131
- package/src/testing/fixture-loader.ts +5 -1
- package/src/testing/fixture-manager.ts +129 -90
- package/src/testing/global-setup.ts +7 -3
- package/src/testing/index.ts +5 -0
- package/src/types/__tests__/entity-json-schema-search-text.test.ts +9 -3
- package/src/types/types.ts +184 -158
- package/src/ui/ai-api.ts +9 -7
- package/src/ui/ai-client.ts +61 -56
- package/src/ui/api.ts +727 -616
- package/src/ui/async-route.ts +4 -0
- package/src/ui/cdd-service.ts +35 -12
- package/src/ui/migrations-api.ts +63 -51
- package/src/utils/formatter.ts +7 -3
- package/src/utils/fs-utils.ts +5 -5
- package/src/utils/model.ts +4 -5
- package/src/utils/object-utils.ts +32 -22
- package/src/utils/process-utils.ts +4 -1
- package/src/utils/runtime-value.ts +43 -0
- package/src/utils/sql-parser.ts +13 -6
- package/src/utils/type-utils.ts +9 -7
- package/src/utils/utils.ts +19 -21
- package/src/utils/zod-error.ts +4 -2
- package/src/vector/chunking.ts +6 -1
- package/src/vector/embedding.ts +2 -1
- package/src/vector/types.ts +4 -2
- package/tsdown.api.config.ts +5 -2
- package/dist/ui-web/assets/index-C0m1pk6K.js +0 -177
package/src/types/types.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { type FastifyReply, type FastifyRequest } from "fastify";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
import { type ApiDecoratorOptions, type Context } from "../api";
|
|
4
|
+
import { type ApiDecoratorOptions, type Context as ApiContext } from "../api";
|
|
5
5
|
import { type CacheControlHandler } from "../cache-control/types";
|
|
6
|
+
import { isObjectValue, isStringValue } from "../utils/runtime-value";
|
|
6
7
|
import { type GuardKey } from "./../api/decorators";
|
|
7
8
|
|
|
9
|
+
function describeInputField<Value>(input: Value, field: string): string {
|
|
10
|
+
if (!isObjectValue(input)) {
|
|
11
|
+
return "undefined";
|
|
12
|
+
}
|
|
13
|
+
const fieldEntry = Object.entries(input).find(([key]) => key === field);
|
|
14
|
+
return String(fieldEntry?.[1]);
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
/*
|
|
9
18
|
Utility Types
|
|
10
19
|
*/
|
|
11
|
-
export function zArrayable<T extends z.ZodTypeAny>(
|
|
12
|
-
return z.union([
|
|
20
|
+
export function zArrayable<T extends z.ZodTypeAny>(schema: T): z.ZodUnion<[T, z.ZodArray<T>]> {
|
|
21
|
+
return z.union([schema, schema.array()]);
|
|
13
22
|
}
|
|
14
23
|
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- any is used to make the type distributive
|
|
15
24
|
export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
@@ -23,50 +32,41 @@ export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K
|
|
|
23
32
|
*
|
|
24
33
|
* 예: User fixture 생성 시 credentials Account를 함께 생성
|
|
25
34
|
*/
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* 예: { "account_id": "{{email}}" } → 부모 User의 email 값 사용
|
|
34
|
-
*/
|
|
35
|
-
overrides?: Record<string, unknown>;
|
|
35
|
+
export type JsonValue =
|
|
36
|
+
| string
|
|
37
|
+
| number
|
|
38
|
+
| boolean
|
|
39
|
+
| null
|
|
40
|
+
| JsonValue[]
|
|
41
|
+
| { [key: string]: JsonValue };
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
+
const FixtureCompanionSchema = z.object({
|
|
44
|
+
entity: z.string(),
|
|
45
|
+
overrides: z.record(z.string(), z.unknown()).optional(),
|
|
46
|
+
count: z.number().int().positive().optional(),
|
|
47
|
+
});
|
|
43
48
|
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
dataSource?: {
|
|
63
|
-
strategy: "sample" | "ids" | "query" | "file" | "recent" | "random";
|
|
64
|
-
config?: unknown; // 전략별 설정
|
|
65
|
-
};
|
|
49
|
+
/** cone 메타데이터를 검증하면서 사용자 정의 확장 값은 그대로 보존합니다. */
|
|
50
|
+
const ConeSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
note: z.string().optional(),
|
|
53
|
+
tags: z.array(z.string()).optional(),
|
|
54
|
+
fixtureGenerator: z.string().optional(),
|
|
55
|
+
fixtureDefault: z.unknown().optional(),
|
|
56
|
+
fixtureStrategy: z.literal("sequence").optional(),
|
|
57
|
+
fixtureCompanions: z.array(FixtureCompanionSchema).optional(),
|
|
58
|
+
fixtureParentOverrides: z.record(z.string(), z.unknown()).optional(),
|
|
59
|
+
dataSource: z
|
|
60
|
+
.object({
|
|
61
|
+
strategy: z.enum(["sample", "ids", "query", "file", "recent", "random"]),
|
|
62
|
+
config: z.unknown().optional(),
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
})
|
|
66
|
+
.catchall(z.unknown());
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
68
|
+
export type FixtureCompanion = z.infer<typeof FixtureCompanionSchema>;
|
|
69
|
+
export type Cone = z.infer<typeof ConeSchema>;
|
|
70
70
|
|
|
71
71
|
export type GeneratedColumnType = "STORED" | "VIRTUAL";
|
|
72
72
|
export type GeneratedColumn = {
|
|
@@ -451,10 +451,10 @@ export type EntityIndex = {
|
|
|
451
451
|
export type SubsetField = string | { field: string; internal?: boolean };
|
|
452
452
|
|
|
453
453
|
export function normalizeSubsetField(f: SubsetField): string {
|
|
454
|
-
return
|
|
454
|
+
return isStringValue(f) ? f : f.field;
|
|
455
455
|
}
|
|
456
456
|
export function isInternalSubsetField(f: SubsetField): boolean {
|
|
457
|
-
return
|
|
457
|
+
return !isStringValue(f) && f.internal === true;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
/**
|
|
@@ -579,129 +579,160 @@ export type EntityPropNode =
|
|
|
579
579
|
/*
|
|
580
580
|
Prop Type Guards
|
|
581
581
|
*/
|
|
582
|
-
export function isIntegerSingleProp(p:
|
|
582
|
+
export function isIntegerSingleProp<Value>(p: Value): p is Value & IntegerProp {
|
|
583
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
583
584
|
return (p as IntegerProp)?.type === "integer";
|
|
584
585
|
}
|
|
585
|
-
export function isIntegerArrayProp(p:
|
|
586
|
+
export function isIntegerArrayProp<Value>(p: Value): p is Value & IntegerArrayProp {
|
|
587
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
586
588
|
return (p as IntegerArrayProp)?.type === "integer[]";
|
|
587
589
|
}
|
|
588
|
-
export function isIntegerProp(p:
|
|
590
|
+
export function isIntegerProp<Value>(p: Value): p is Value & (IntegerProp | IntegerArrayProp) {
|
|
589
591
|
return isIntegerSingleProp(p) || isIntegerArrayProp(p);
|
|
590
592
|
}
|
|
591
|
-
export function isBigIntegerSingleProp(p:
|
|
593
|
+
export function isBigIntegerSingleProp<Value>(p: Value): p is Value & BigIntegerProp {
|
|
594
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
592
595
|
return (p as BigIntegerProp)?.type === "bigInteger";
|
|
593
596
|
}
|
|
594
|
-
export function isBigIntegerArrayProp(p:
|
|
597
|
+
export function isBigIntegerArrayProp<Value>(p: Value): p is Value & BigIntegerArrayProp {
|
|
598
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
595
599
|
return (p as BigIntegerArrayProp)?.type === "bigInteger[]";
|
|
596
600
|
}
|
|
597
|
-
export function isBigIntegerProp(
|
|
601
|
+
export function isBigIntegerProp<Value>(
|
|
602
|
+
p: Value,
|
|
603
|
+
): p is Value & (BigIntegerProp | BigIntegerArrayProp) {
|
|
598
604
|
return isBigIntegerSingleProp(p) || isBigIntegerArrayProp(p);
|
|
599
605
|
}
|
|
600
|
-
export function isStringSingleProp(p:
|
|
606
|
+
export function isStringSingleProp<Value>(p: Value): p is Value & StringProp {
|
|
607
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
601
608
|
return (p as StringProp)?.type === "string";
|
|
602
609
|
}
|
|
603
|
-
export function isStringArrayProp(p:
|
|
610
|
+
export function isStringArrayProp<Value>(p: Value): p is Value & StringArrayProp {
|
|
611
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
604
612
|
return (p as StringArrayProp)?.type === "string[]";
|
|
605
613
|
}
|
|
606
|
-
export function isStringProp(p:
|
|
614
|
+
export function isStringProp<Value>(p: Value): p is Value & (StringProp | StringArrayProp) {
|
|
607
615
|
return isStringSingleProp(p) || isStringArrayProp(p);
|
|
608
616
|
}
|
|
609
|
-
export function isEnumSingleProp(p:
|
|
617
|
+
export function isEnumSingleProp<Value>(p: Value): p is Value & EnumProp {
|
|
618
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
610
619
|
return (p as EnumProp)?.type === "enum";
|
|
611
620
|
}
|
|
612
|
-
export function isEnumArrayProp(p:
|
|
621
|
+
export function isEnumArrayProp<Value>(p: Value): p is Value & EnumArrayProp {
|
|
622
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
613
623
|
return (p as EnumArrayProp)?.type === "enum[]";
|
|
614
624
|
}
|
|
615
|
-
export function isEnumProp(p:
|
|
625
|
+
export function isEnumProp<Value>(p: Value): p is Value & (EnumProp | EnumArrayProp) {
|
|
616
626
|
return isEnumSingleProp(p) || isEnumArrayProp(p);
|
|
617
627
|
}
|
|
618
|
-
export function isNumberSingleProp(p:
|
|
628
|
+
export function isNumberSingleProp<Value>(p: Value): p is Value & NumberProp {
|
|
629
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
619
630
|
return (p as NumberProp)?.type === "number";
|
|
620
631
|
}
|
|
621
|
-
export function isNumberArrayProp(p:
|
|
632
|
+
export function isNumberArrayProp<Value>(p: Value): p is Value & NumberArrayProp {
|
|
633
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
622
634
|
return (p as NumberArrayProp)?.type === "number[]";
|
|
623
635
|
}
|
|
624
|
-
export function isNumberProp(p:
|
|
636
|
+
export function isNumberProp<Value>(p: Value): p is Value & (NumberProp | NumberArrayProp) {
|
|
625
637
|
return isNumberSingleProp(p) || isNumberArrayProp(p);
|
|
626
638
|
}
|
|
627
|
-
export function isNumericSingleProp(p:
|
|
639
|
+
export function isNumericSingleProp<Value>(p: Value): p is Value & NumericProp {
|
|
640
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
628
641
|
return (p as NumericProp)?.type === "numeric";
|
|
629
642
|
}
|
|
630
|
-
export function isNumericArrayProp(p:
|
|
643
|
+
export function isNumericArrayProp<Value>(p: Value): p is Value & NumericArrayProp {
|
|
644
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
631
645
|
return (p as NumericArrayProp)?.type === "numeric[]";
|
|
632
646
|
}
|
|
633
|
-
export function isNumericProp(p:
|
|
647
|
+
export function isNumericProp<Value>(p: Value): p is Value & (NumericProp | NumericArrayProp) {
|
|
634
648
|
return isNumericSingleProp(p) || isNumericArrayProp(p);
|
|
635
649
|
}
|
|
636
|
-
export function isBooleanSingleProp(p:
|
|
650
|
+
export function isBooleanSingleProp<Value>(p: Value): p is Value & BooleanProp {
|
|
651
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
637
652
|
return (p as BooleanProp)?.type === "boolean";
|
|
638
653
|
}
|
|
639
|
-
export function isBooleanArrayProp(p:
|
|
654
|
+
export function isBooleanArrayProp<Value>(p: Value): p is Value & BooleanArrayProp {
|
|
655
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
640
656
|
return (p as BooleanArrayProp)?.type === "boolean[]";
|
|
641
657
|
}
|
|
642
|
-
export function isBooleanProp(p:
|
|
658
|
+
export function isBooleanProp<Value>(p: Value): p is Value & (BooleanProp | BooleanArrayProp) {
|
|
643
659
|
return isBooleanSingleProp(p) || isBooleanArrayProp(p);
|
|
644
660
|
}
|
|
645
|
-
export function isDateSingleProp(p:
|
|
661
|
+
export function isDateSingleProp<Value>(p: Value): p is Value & DateProp {
|
|
662
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
646
663
|
return (p as DateProp)?.type === "date";
|
|
647
664
|
}
|
|
648
|
-
export function isDateArrayProp(p:
|
|
665
|
+
export function isDateArrayProp<Value>(p: Value): p is Value & DateArrayProp {
|
|
666
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
649
667
|
return (p as DateArrayProp)?.type === "date[]";
|
|
650
668
|
}
|
|
651
|
-
export function isDateProp(p:
|
|
669
|
+
export function isDateProp<Value>(p: Value): p is Value & (DateProp | DateArrayProp) {
|
|
652
670
|
return isDateSingleProp(p) || isDateArrayProp(p);
|
|
653
671
|
}
|
|
654
|
-
export function isUuidSingleProp(p:
|
|
672
|
+
export function isUuidSingleProp<Value>(p: Value): p is Value & UuidProp {
|
|
673
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
655
674
|
return (p as UuidProp)?.type === "uuid";
|
|
656
675
|
}
|
|
657
|
-
export function isUuidArrayProp(p:
|
|
676
|
+
export function isUuidArrayProp<Value>(p: Value): p is Value & UuidArrayProp {
|
|
677
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
658
678
|
return (p as UuidArrayProp)?.type === "uuid[]";
|
|
659
679
|
}
|
|
660
|
-
export function isUuidProp(p:
|
|
680
|
+
export function isUuidProp<Value>(p: Value): p is Value & (UuidProp | UuidArrayProp) {
|
|
661
681
|
return isUuidSingleProp(p) || isUuidArrayProp(p);
|
|
662
682
|
}
|
|
663
|
-
export function isJsonProp(p:
|
|
683
|
+
export function isJsonProp<Value>(p: Value): p is Value & JsonProp {
|
|
684
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
664
685
|
return (p as JsonProp)?.type === "json";
|
|
665
686
|
}
|
|
666
|
-
export function isSearchTextProp(p:
|
|
687
|
+
export function isSearchTextProp<Value>(p: Value): p is Value & SearchTextProp {
|
|
688
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
667
689
|
return (p as SearchTextProp)?.type === "searchText";
|
|
668
690
|
}
|
|
669
|
-
export function isVirtualProp(p:
|
|
691
|
+
export function isVirtualProp<Value>(p: Value): p is Value & VirtualProp {
|
|
692
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
670
693
|
return (p as VirtualProp)?.type === "virtual";
|
|
671
694
|
}
|
|
672
|
-
export function isVirtualCodeProp(p:
|
|
695
|
+
export function isVirtualCodeProp<Value>(p: Value): p is Value & VirtualProp {
|
|
673
696
|
if (!isVirtualProp(p)) return false;
|
|
674
697
|
return p.virtualType !== "query"; // undefined도 "code"로 취급
|
|
675
698
|
}
|
|
676
|
-
export function isVirtualQueryProp(p:
|
|
699
|
+
export function isVirtualQueryProp<Value>(p: Value): p is Value & VirtualProp {
|
|
677
700
|
if (!isVirtualProp(p)) return false;
|
|
678
701
|
return p.virtualType === "query";
|
|
679
702
|
}
|
|
680
|
-
export function isVectorSingleProp(p:
|
|
703
|
+
export function isVectorSingleProp<Value>(p: Value): p is Value & VectorProp {
|
|
704
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
681
705
|
return (p as VectorProp)?.type === "vector";
|
|
682
706
|
}
|
|
683
|
-
export function isVectorArrayProp(p:
|
|
707
|
+
export function isVectorArrayProp<Value>(p: Value): p is Value & VectorArrayProp {
|
|
708
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
684
709
|
return (p as VectorArrayProp)?.type === "vector[]";
|
|
685
710
|
}
|
|
686
|
-
export function isVectorProp(p:
|
|
711
|
+
export function isVectorProp<Value>(p: Value): p is Value & (VectorProp | VectorArrayProp) {
|
|
687
712
|
return isVectorSingleProp(p) || isVectorArrayProp(p);
|
|
688
713
|
}
|
|
689
|
-
export function isTsVectorProp(p:
|
|
714
|
+
export function isTsVectorProp<Value>(p: Value): p is Value & TsVectorProp {
|
|
715
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
690
716
|
return (p as TsVectorProp)?.type === "tsvector";
|
|
691
717
|
}
|
|
692
|
-
export function isRelationProp(p:
|
|
718
|
+
export function isRelationProp<Value>(p: Value): p is Value & RelationProp {
|
|
719
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
693
720
|
return (p as RelationProp)?.type === "relation";
|
|
694
721
|
}
|
|
695
|
-
export function isOneToOneRelationProp(p:
|
|
722
|
+
export function isOneToOneRelationProp<Value>(p: Value): p is Value & OneToOneRelationProp {
|
|
723
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
696
724
|
return (p as OneToOneRelationProp)?.relationType === "OneToOne";
|
|
697
725
|
}
|
|
698
|
-
export function isBelongsToOneRelationProp(p:
|
|
726
|
+
export function isBelongsToOneRelationProp<Value>(p: Value): p is Value & BelongsToOneRelationProp {
|
|
727
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
699
728
|
return (p as BelongsToOneRelationProp)?.relationType === "BelongsToOne";
|
|
700
729
|
}
|
|
701
|
-
export function isHasManyRelationProp(p:
|
|
730
|
+
export function isHasManyRelationProp<Value>(p: Value): p is Value & HasManyRelationProp {
|
|
731
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
702
732
|
return (p as HasManyRelationProp)?.relationType === "HasMany";
|
|
703
733
|
}
|
|
704
|
-
export function isManyToManyRelationProp(p:
|
|
734
|
+
export function isManyToManyRelationProp<Value>(p: Value): p is Value & ManyToManyRelationProp {
|
|
735
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
705
736
|
return (p as ManyToManyRelationProp)?.relationType === "ManyToMany";
|
|
706
737
|
}
|
|
707
738
|
|
|
@@ -713,7 +744,8 @@ type JoinClause =
|
|
|
713
744
|
| {
|
|
714
745
|
custom: string;
|
|
715
746
|
};
|
|
716
|
-
export function isCustomJoinClause(p:
|
|
747
|
+
export function isCustomJoinClause<Value>(p: Value): p is Value & { custom: string } {
|
|
748
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
717
749
|
return !!(p as { custom: string })?.custom;
|
|
718
750
|
}
|
|
719
751
|
|
|
@@ -774,7 +806,8 @@ export type KnexError = {
|
|
|
774
806
|
sqlMessage: string;
|
|
775
807
|
sqlState: string;
|
|
776
808
|
};
|
|
777
|
-
export function isKnexError(e:
|
|
809
|
+
export function isKnexError<Value>(e: Value): e is Value & KnexError {
|
|
810
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
778
811
|
return !!(e as KnexError)?.code && !!(e as KnexError)?.sqlMessage && !!(e as KnexError)?.sqlState;
|
|
779
812
|
}
|
|
780
813
|
|
|
@@ -947,84 +980,99 @@ export namespace ApiParamType {
|
|
|
947
980
|
constraint?: ApiParamType;
|
|
948
981
|
};
|
|
949
982
|
|
|
950
|
-
export function isObject(v:
|
|
983
|
+
export function isObject<Value>(v: Value): v is Value & ApiParamType.Object {
|
|
984
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
951
985
|
return (v as ApiParamType.Object)?.t === "object";
|
|
952
986
|
}
|
|
953
|
-
export function isUnion(v:
|
|
987
|
+
export function isUnion<Value>(v: Value): v is Value & ApiParamType.Union {
|
|
988
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
954
989
|
return (v as ApiParamType.Union)?.t === "union";
|
|
955
990
|
}
|
|
956
|
-
export function isIntersection(v:
|
|
991
|
+
export function isIntersection<Value>(v: Value): v is Value & ApiParamType.Intersection {
|
|
992
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
957
993
|
return (v as ApiParamType.Intersection)?.t === "intersection";
|
|
958
994
|
}
|
|
959
|
-
export function isStringLiteral(v:
|
|
995
|
+
export function isStringLiteral<Value>(v: Value): v is Value & ApiParamType.StringLiteral {
|
|
996
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
960
997
|
return (v as ApiParamType.StringLiteral)?.t === "string-literal";
|
|
961
998
|
}
|
|
962
|
-
export function isNumericLiteral(v:
|
|
999
|
+
export function isNumericLiteral<Value>(v: Value): v is Value & ApiParamType.NumericLiteral {
|
|
1000
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
963
1001
|
return (v as ApiParamType.NumericLiteral)?.t === "numeric-literal";
|
|
964
1002
|
}
|
|
965
|
-
export function isArray(v:
|
|
1003
|
+
export function isArray<Value>(v: Value): v is Value & ApiParamType.Array {
|
|
1004
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
966
1005
|
return (v as ApiParamType.Array)?.t === "array";
|
|
967
1006
|
}
|
|
968
|
-
export function isRef(v:
|
|
969
|
-
|
|
1007
|
+
export function isRef<Value>(v: Value): v is Value & ApiParamType.Ref {
|
|
1008
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1009
|
+
return isObjectValue(v) && (v as { t?: unknown }).t === "ref";
|
|
970
1010
|
}
|
|
971
|
-
export function isIndexedAccess(v:
|
|
972
|
-
|
|
1011
|
+
export function isIndexedAccess<Value>(v: Value): v is Value & ApiParamType.IndexedAccess {
|
|
1012
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1013
|
+
return isObjectValue(v) && (v as { t?: unknown }).t === "indexed-access";
|
|
973
1014
|
}
|
|
974
|
-
export function isTupleType(v:
|
|
975
|
-
|
|
1015
|
+
export function isTupleType<Value>(v: Value): v is Value & ApiParamType.TupleType {
|
|
1016
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1017
|
+
return isObjectValue(v) && (v as { t?: unknown }).t === "tuple-type";
|
|
976
1018
|
}
|
|
977
|
-
export function isPick(v:
|
|
1019
|
+
export function isPick<Value>(v: Value): v is Value & ApiParamType.Pick {
|
|
978
1020
|
return (
|
|
979
|
-
|
|
980
|
-
|
|
1021
|
+
isObjectValue(v) &&
|
|
1022
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
981
1023
|
(v as { t?: unknown }).t === "ref" &&
|
|
1024
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
982
1025
|
(v as { id?: unknown }).id === "Pick"
|
|
983
1026
|
);
|
|
984
1027
|
}
|
|
985
|
-
export function isOmit(v:
|
|
1028
|
+
export function isOmit<Value>(v: Value): v is Value & ApiParamType.Omit {
|
|
986
1029
|
return (
|
|
987
|
-
|
|
988
|
-
|
|
1030
|
+
isObjectValue(v) &&
|
|
1031
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
989
1032
|
(v as { t?: unknown }).t === "ref" &&
|
|
1033
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
990
1034
|
(v as { id?: unknown }).id === "Omit"
|
|
991
1035
|
);
|
|
992
1036
|
}
|
|
993
|
-
export function isPartial(v:
|
|
1037
|
+
export function isPartial<Value>(v: Value): v is Value & ApiParamType.Partial {
|
|
994
1038
|
return (
|
|
995
|
-
|
|
996
|
-
|
|
1039
|
+
isObjectValue(v) &&
|
|
1040
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
997
1041
|
(v as { t?: unknown }).t === "ref" &&
|
|
1042
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
998
1043
|
(v as { id?: unknown }).id === "Partial"
|
|
999
1044
|
);
|
|
1000
1045
|
}
|
|
1001
|
-
export function isPromise(v:
|
|
1046
|
+
export function isPromise<Value>(v: Value): v is Value & ApiParamType.Promise {
|
|
1002
1047
|
return (
|
|
1003
|
-
|
|
1004
|
-
|
|
1048
|
+
isObjectValue(v) &&
|
|
1049
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1005
1050
|
(v as { t?: unknown }).t === "ref" &&
|
|
1051
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1006
1052
|
(v as { id?: unknown }).id === "Promise"
|
|
1007
1053
|
);
|
|
1008
1054
|
}
|
|
1009
|
-
export function isContext(v:
|
|
1055
|
+
export function isContext<Value>(v: Value): v is Value & ApiParamType.Context {
|
|
1010
1056
|
return (
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1057
|
+
isObjectValue(v) &&
|
|
1058
|
+
"t" in v &&
|
|
1059
|
+
v.t === "ref" &&
|
|
1060
|
+
"id" in v &&
|
|
1061
|
+
(v.id === "Context" || v.id === "WebSocketContext")
|
|
1016
1062
|
);
|
|
1017
1063
|
}
|
|
1018
|
-
export function isRefKnex(v:
|
|
1064
|
+
export function isRefKnex<Value>(v: Value): v is Value & ApiParamType.Ref {
|
|
1019
1065
|
return (
|
|
1020
|
-
|
|
1021
|
-
|
|
1066
|
+
isObjectValue(v) &&
|
|
1067
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1022
1068
|
(v as { t?: unknown }).t === "ref" &&
|
|
1069
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1023
1070
|
(v as { id?: unknown }).id === "Knex"
|
|
1024
1071
|
);
|
|
1025
1072
|
}
|
|
1026
|
-
export function isTypeParam(v:
|
|
1027
|
-
|
|
1073
|
+
export function isTypeParam<Value>(v: Value): v is Value & ApiParamType.TypeParam {
|
|
1074
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1075
|
+
return isObjectValue(v) && (v as { t?: unknown }).t === "type-param";
|
|
1028
1076
|
}
|
|
1029
1077
|
}
|
|
1030
1078
|
export type ApiParamType =
|
|
@@ -1112,35 +1160,6 @@ const GeneratedColumnSchema = z.object({
|
|
|
1112
1160
|
expression: z.string(),
|
|
1113
1161
|
});
|
|
1114
1162
|
|
|
1115
|
-
const FixtureCompanionSchema = z.object({
|
|
1116
|
-
entity: z.string(),
|
|
1117
|
-
overrides: z.record(z.string(), z.unknown()).optional(),
|
|
1118
|
-
count: z.number().int().positive().optional(),
|
|
1119
|
-
});
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* Cone 스키마 검증
|
|
1123
|
-
*
|
|
1124
|
-
* cone 메타데이터의 유효성을 검증합니다.
|
|
1125
|
-
*/
|
|
1126
|
-
const ConeSchema = z
|
|
1127
|
-
.object({
|
|
1128
|
-
note: z.string().optional(),
|
|
1129
|
-
tags: z.array(z.string()).optional(),
|
|
1130
|
-
fixtureGenerator: z.string().optional(),
|
|
1131
|
-
fixtureDefault: z.unknown().optional(),
|
|
1132
|
-
fixtureStrategy: z.literal("sequence").optional(),
|
|
1133
|
-
fixtureCompanions: z.array(FixtureCompanionSchema).optional(),
|
|
1134
|
-
fixtureParentOverrides: z.record(z.string(), z.unknown()).optional(),
|
|
1135
|
-
dataSource: z
|
|
1136
|
-
.object({
|
|
1137
|
-
strategy: z.enum(["sample", "ids", "query", "file", "recent", "random"]),
|
|
1138
|
-
config: z.unknown().optional(),
|
|
1139
|
-
})
|
|
1140
|
-
.optional(),
|
|
1141
|
-
})
|
|
1142
|
-
.catchall(z.unknown()); // 사용자 정의 메타데이터 허용
|
|
1143
|
-
|
|
1144
1163
|
const BasePropFields = {
|
|
1145
1164
|
name: z.string(),
|
|
1146
1165
|
desc: z.string().optional(),
|
|
@@ -1367,7 +1386,8 @@ export const RelationPropSchema = z.discriminatedUnion(
|
|
|
1367
1386
|
],
|
|
1368
1387
|
{
|
|
1369
1388
|
error: (iss) =>
|
|
1370
|
-
|
|
1389
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1390
|
+
`relationType은 ${RelationTypes.map((t) => `'${t}'`).join(", ")} 중 하나여야 합니다. 입력값: "${describeInputField(iss.input, "relationType")}"`,
|
|
1371
1391
|
},
|
|
1372
1392
|
);
|
|
1373
1393
|
|
|
@@ -1437,7 +1457,8 @@ export const NormalPropSchema = z
|
|
|
1437
1457
|
],
|
|
1438
1458
|
{
|
|
1439
1459
|
error: (iss) =>
|
|
1440
|
-
|
|
1460
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1461
|
+
`type은 ${NormalPropTypes.map((t) => `'${t}'`).join(", ")} 중 하나여야 합니다. 입력값: "${describeInputField(iss.input, "type")}"`,
|
|
1441
1462
|
},
|
|
1442
1463
|
)
|
|
1443
1464
|
.superRefine((data, ctx) => {
|
|
@@ -1465,6 +1486,7 @@ export const NormalPropSchema = z
|
|
|
1465
1486
|
|
|
1466
1487
|
// VIRTUAL Generated Column 타입 제한 검증
|
|
1467
1488
|
if (data.generated.type === "VIRTUAL") {
|
|
1489
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1468
1490
|
if ((VirtualGeneratedDisallowedTypes as readonly string[]).includes(data.type)) {
|
|
1469
1491
|
ctx.addIssue({
|
|
1470
1492
|
code: "custom",
|
|
@@ -1479,7 +1501,8 @@ export const NormalPropSchema = z
|
|
|
1479
1501
|
const AllPropTypes = [...NormalPropTypes, "relation"] as const;
|
|
1480
1502
|
const EntityPropSchema = z.discriminatedUnion("type", [NormalPropSchema, RelationPropSchema], {
|
|
1481
1503
|
error: (iss) =>
|
|
1482
|
-
|
|
1504
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1505
|
+
`type은 ${AllPropTypes.map((t) => `'${t}'`).join(", ")} 중 하나여야 합니다. 입력값: "${describeInputField(iss.input, "type")}"`,
|
|
1483
1506
|
});
|
|
1484
1507
|
|
|
1485
1508
|
const EntityIndexColumnSchema = z.object({
|
|
@@ -1541,6 +1564,7 @@ function unwrapSearchTextJsonSourceType(zodType: z.ZodTypeAny): z.ZodTypeAny {
|
|
|
1541
1564
|
let current = zodType;
|
|
1542
1565
|
|
|
1543
1566
|
while (current instanceof z.ZodOptional || current instanceof z.ZodNullable) {
|
|
1567
|
+
// SAFETY: 스키마 검증과 메타데이터 계약이 이 타입을 보장합니다.
|
|
1544
1568
|
current = current.unwrap() as z.ZodTypeAny;
|
|
1545
1569
|
}
|
|
1546
1570
|
|
|
@@ -1652,6 +1676,7 @@ export const TemplateOptions = z.object({
|
|
|
1652
1676
|
generated_http: z.object({
|
|
1653
1677
|
entityId: z.string(),
|
|
1654
1678
|
}),
|
|
1679
|
+
http_validators: z.object({}),
|
|
1655
1680
|
model: z.object({
|
|
1656
1681
|
entityId: z.string(),
|
|
1657
1682
|
defaultSearchField: z.string().optional(),
|
|
@@ -1706,6 +1731,7 @@ export const TemplateKey = z.enum([
|
|
|
1706
1731
|
"generated",
|
|
1707
1732
|
"generated_sso",
|
|
1708
1733
|
"generated_http",
|
|
1734
|
+
"http_validators",
|
|
1709
1735
|
"model",
|
|
1710
1736
|
"model_test",
|
|
1711
1737
|
"bridge",
|
|
@@ -1794,7 +1820,7 @@ export type Executable<T> = T | Promise<T> | (() => T) | (() => Promise<T>);
|
|
|
1794
1820
|
export type SonamuFastifyConfig = {
|
|
1795
1821
|
contextProvider: (
|
|
1796
1822
|
defaultContext: Pick<
|
|
1797
|
-
|
|
1823
|
+
ApiContext,
|
|
1798
1824
|
| "transport"
|
|
1799
1825
|
| "request"
|
|
1800
1826
|
| "reply"
|
|
@@ -1807,7 +1833,7 @@ export type SonamuFastifyConfig = {
|
|
|
1807
1833
|
>,
|
|
1808
1834
|
request: FastifyRequest,
|
|
1809
1835
|
reply: FastifyReply,
|
|
1810
|
-
) =>
|
|
1836
|
+
) => ApiContext | Promise<ApiContext>;
|
|
1811
1837
|
websocketContextProvider?: (
|
|
1812
1838
|
defaultContext: Pick<
|
|
1813
1839
|
import("../api/context").WebSocketContext,
|
package/src/ui/ai-api.ts
CHANGED
|
@@ -11,10 +11,11 @@ export async function setAiApi(server: FastifyInstance) {
|
|
|
11
11
|
await aiClient.init();
|
|
12
12
|
|
|
13
13
|
server.post("/api/ai/fixture/chat", async (request, reply) => {
|
|
14
|
-
const { messages, fixtureRecords } =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const { messages, fixtureRecords } =
|
|
15
|
+
/* SAFETY: UI 도구의 Zod 입력 스키마가 이 값의 타입을 보장한다. */ request.body as {
|
|
16
|
+
messages: UIMessage[];
|
|
17
|
+
fixtureRecords?: FixtureRecord[];
|
|
18
|
+
};
|
|
18
19
|
|
|
19
20
|
if (!fixtureRecords || fixtureRecords.length === 0) {
|
|
20
21
|
throw new BadRequestException(SD("sonamu.error.fixtureRecordRequired"));
|
|
@@ -40,9 +41,10 @@ export async function setAiApi(server: FastifyInstance) {
|
|
|
40
41
|
|
|
41
42
|
// Entity/Enum 생성용 AI Chat Stream
|
|
42
43
|
server.post("/api/ai/entity/chat", async (request, reply) => {
|
|
43
|
-
const { messages } =
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const { messages } =
|
|
45
|
+
/* SAFETY: UI 도구의 Zod 입력 스키마가 이 값의 타입을 보장한다. */ request.body as {
|
|
46
|
+
messages: UIMessage[];
|
|
47
|
+
};
|
|
46
48
|
|
|
47
49
|
const result = aiClient.handleEntity(await convertToModelMessages(messages));
|
|
48
50
|
const response = result.toUIMessageStreamResponse();
|