sonamu 0.8.26 → 0.9.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/bin/cli.js +60 -13
- package/dist/_virtual/rolldown_runtime.js +39 -0
- package/dist/ai/agents/agent.d.ts +3 -3
- package/dist/ai/agents/agent.d.ts.map +1 -1
- package/dist/ai/agents/agent.js +76 -73
- package/dist/ai/agents/index.js +3 -3
- package/dist/ai/agents/types.d.ts +3 -3
- package/dist/ai/agents/types.d.ts.map +1 -1
- package/dist/ai/agents/types.js +1 -3
- package/dist/ai/index.js +3 -2
- package/dist/ai/providers/rtzr/api.js +25 -25
- package/dist/ai/providers/rtzr/error.js +25 -26
- package/dist/ai/providers/rtzr/index.js +5 -5
- package/dist/ai/providers/rtzr/model.d.ts +1 -1
- package/dist/ai/providers/rtzr/model.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/model.js +117 -133
- package/dist/ai/providers/rtzr/options.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/options.js +35 -41
- package/dist/ai/providers/rtzr/provider.d.ts +1 -1
- package/dist/ai/providers/rtzr/provider.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/provider.js +53 -51
- package/dist/ai/providers/rtzr/utils.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/utils.js +84 -84
- package/dist/api/base-frame.d.ts +2 -2
- package/dist/api/base-frame.d.ts.map +1 -1
- package/dist/api/base-frame.js +29 -19
- package/dist/api/caster.d.ts +1 -1
- package/dist/api/caster.d.ts.map +1 -1
- package/dist/api/caster.js +51 -61
- package/dist/api/code-converters.d.ts +4 -3
- package/dist/api/code-converters.d.ts.map +1 -1
- package/dist/api/code-converters.js +226 -249
- package/dist/api/config.d.ts +17 -17
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +37 -30
- package/dist/api/context.d.ts +10 -10
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +8 -2
- package/dist/api/decorators.d.ts +8 -8
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +245 -268
- package/dist/api/index.js +39 -7
- package/dist/api/secret.js +22 -15
- package/dist/api/sonamu.d.ts +15 -15
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +1012 -1131
- package/dist/api/validator.js +88 -79
- package/dist/auth/auth-generator.d.ts.map +1 -1
- package/dist/auth/auth-generator.js +203 -200
- package/dist/auth/better-auth-entities.d.ts +2 -2
- package/dist/auth/better-auth-entities.d.ts.map +1 -1
- package/dist/auth/better-auth-entities.js +369 -429
- package/dist/auth/index.js +21 -6
- package/dist/auth/knex-adapter.d.ts +2 -2
- package/dist/auth/knex-adapter.d.ts.map +1 -1
- package/dist/auth/knex-adapter.js +153 -157
- package/dist/auth/plugins/entity-definitions/admin.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/admin.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/admin.js +58 -56
- package/dist/auth/plugins/entity-definitions/anonymous.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/anonymous.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/anonymous.js +20 -20
- package/dist/auth/plugins/entity-definitions/api-key.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/api-key.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/api-key.js +185 -196
- package/dist/auth/plugins/entity-definitions/index.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/index.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/index.js +26 -29
- package/dist/auth/plugins/entity-definitions/jwt.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/jwt.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/jwt.js +62 -64
- package/dist/auth/plugins/entity-definitions/organization.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/organization.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/organization.js +362 -421
- package/dist/auth/plugins/entity-definitions/passkey.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/passkey.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/passkey.js +115 -126
- package/dist/auth/plugins/entity-definitions/phone-number.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/phone-number.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/phone-number.js +31 -40
- package/dist/auth/plugins/entity-definitions/sso.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/sso.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/sso.js +94 -107
- package/dist/auth/plugins/entity-definitions/two-factor.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/two-factor.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/two-factor.js +78 -92
- package/dist/auth/plugins/entity-definitions/types.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/types.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/types.js +1 -10
- package/dist/auth/plugins/entity-definitions/username.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/username.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/username.js +31 -40
- package/dist/auth/plugins/index.js +12 -3
- package/dist/auth/plugins/wrappers/admin.d.ts +2 -2
- package/dist/auth/plugins/wrappers/admin.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/admin.js +28 -29
- package/dist/auth/plugins/wrappers/anonymous.d.ts +2 -1
- package/dist/auth/plugins/wrappers/anonymous.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/anonymous.js +23 -22
- package/dist/auth/plugins/wrappers/api-key.d.ts +2 -1
- package/dist/auth/plugins/wrappers/api-key.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/api-key.js +39 -34
- package/dist/auth/plugins/wrappers/index.js +11 -11
- package/dist/auth/plugins/wrappers/jwt.d.ts +2 -1
- package/dist/auth/plugins/wrappers/jwt.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/jwt.js +31 -26
- package/dist/auth/plugins/wrappers/organization.d.ts +2 -1
- package/dist/auth/plugins/wrappers/organization.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/organization.js +65 -62
- package/dist/auth/plugins/wrappers/passkey.d.ts +2 -1
- package/dist/auth/plugins/wrappers/passkey.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/passkey.js +33 -28
- package/dist/auth/plugins/wrappers/phone-number.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/phone-number.js +26 -23
- package/dist/auth/plugins/wrappers/sso.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/sso.js +37 -31
- package/dist/auth/plugins/wrappers/two-factor.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/two-factor.js +31 -28
- package/dist/auth/plugins/wrappers/username.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/username.js +23 -23
- package/dist/bin/build-config.js +31 -31
- package/dist/bin/cli.js +1063 -1204
- package/dist/bin/fixture.d.ts.map +1 -1
- package/dist/bin/fixture.js +266 -259
- package/dist/bin/hmr-hook-register.d.ts.map +1 -1
- package/dist/bin/hmr-hook-register.js +19 -18
- package/dist/bin/test-command.d.ts.map +1 -1
- package/dist/bin/test-command.js +180 -177
- package/dist/bin/ts-loader-register.js +13 -6
- package/dist/bin/ts-loader-registration.d.ts.map +1 -1
- package/dist/bin/ts-loader-registration.js +28 -38
- package/dist/cache/cache-manager.d.ts +1 -1
- package/dist/cache/cache-manager.d.ts.map +1 -1
- package/dist/cache/cache-manager.js +20 -15
- package/dist/cache/decorator.d.ts +1 -1
- package/dist/cache/decorator.d.ts.map +1 -1
- package/dist/cache/decorator.js +84 -76
- package/dist/cache/drivers.js +21 -34
- package/dist/cache/index.js +10 -7
- package/dist/cache/types.d.ts +2 -2
- package/dist/cache/types.d.ts.map +1 -1
- package/dist/cache/types.js +1 -6
- package/dist/cache-control/cache-control.d.ts +2 -2
- package/dist/cache-control/cache-control.d.ts.map +1 -1
- package/dist/cache-control/cache-control.js +106 -122
- package/dist/cache-control/types.d.ts +2 -2
- package/dist/cache-control/types.d.ts.map +1 -1
- package/dist/cache-control/types.js +1 -19
- package/dist/compress/compress.d.ts +1 -1
- package/dist/compress/compress.d.ts.map +1 -1
- package/dist/compress/compress.js +58 -56
- package/dist/compress/index.js +7 -2
- package/dist/compress/types.js +1 -11
- package/dist/cone/cone-generator.d.ts +1 -1
- package/dist/cone/cone-generator.d.ts.map +1 -1
- package/dist/cone/cone-generator.js +216 -219
- package/dist/database/_batch_update.d.ts +1 -1
- package/dist/database/_batch_update.d.ts.map +1 -1
- package/dist/database/_batch_update.js +107 -102
- package/dist/database/base-model.d.ts +8 -9
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +371 -392
- package/dist/database/base-model.types.d.ts +5 -5
- package/dist/database/base-model.types.d.ts.map +1 -1
- package/dist/database/base-model.types.js +1 -20
- package/dist/database/db.d.ts +5 -2
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +185 -171
- package/dist/database/knex.d.ts +1 -1
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +48 -42
- package/dist/database/puri-subset.types.d.ts +6 -7
- package/dist/database/puri-subset.types.d.ts.map +1 -1
- package/dist/database/puri-subset.types.js +1 -16
- package/dist/database/puri-wrapper.d.ts +6 -6
- package/dist/database/puri-wrapper.d.ts.map +1 -1
- package/dist/database/puri-wrapper.js +99 -101
- package/dist/database/puri.d.ts +4 -5
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +1021 -1227
- package/dist/database/puri.types.d.ts +6 -6
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +15 -6
- package/dist/database/transaction-context.d.ts +2 -2
- package/dist/database/transaction-context.d.ts.map +1 -1
- package/dist/database/transaction-context.js +22 -13
- package/dist/database/upsert-builder.d.ts +3 -3
- package/dist/database/upsert-builder.d.ts.map +1 -1
- package/dist/database/upsert-builder.js +405 -465
- package/dist/dict/en.js +72 -74
- package/dist/dict/index.js +13 -13
- package/dist/dict/ko.js +72 -74
- package/dist/dict/rc-keys.js +150 -168
- package/dist/dict/sd.d.ts +3 -1
- package/dist/dict/sd.d.ts.map +1 -1
- package/dist/dict/sd.js +54 -40
- package/dist/dict/sonamu-dictionary.d.ts +1 -1
- package/dist/dict/sonamu-dictionary.d.ts.map +1 -1
- package/dist/dict/sonamu-dictionary.js +887 -955
- package/dist/dict/types.js +1 -7
- package/dist/dict/utils.js +26 -24
- package/dist/entity/entity-manager.d.ts +9 -9
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +226 -223
- package/dist/entity/entity-template-cone.d.ts +1 -1
- package/dist/entity/entity-template-cone.d.ts.map +1 -1
- package/dist/entity/entity-template-cone.js +152 -151
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +952 -1089
- package/dist/exceptions/error-handler.d.ts +1 -1
- package/dist/exceptions/error-handler.d.ts.map +1 -1
- package/dist/exceptions/error-handler.js +32 -27
- package/dist/exceptions/so-exceptions.d.ts +1 -1
- package/dist/exceptions/so-exceptions.d.ts.map +1 -1
- package/dist/exceptions/so-exceptions.js +61 -68
- package/dist/filter/index.js +9 -3
- package/dist/filter/types.js +92 -88
- package/dist/filter/utils.d.ts +1 -1
- package/dist/filter/utils.d.ts.map +1 -1
- package/dist/filter/utils.js +147 -161
- package/dist/index.js +87 -40
- package/dist/logger/category.d.ts.map +1 -1
- package/dist/logger/category.js +30 -29
- package/dist/logger/configure.d.ts.map +1 -1
- package/dist/logger/configure.js +83 -107
- package/dist/migration/code-generation.d.ts +2 -2
- package/dist/migration/code-generation.d.ts.map +1 -1
- package/dist/migration/code-generation.js +1385 -1578
- package/dist/migration/migration-set.d.ts +1 -1
- package/dist/migration/migration-set.d.ts.map +1 -1
- package/dist/migration/migration-set.js +177 -227
- package/dist/migration/migrator.d.ts +4 -3
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +340 -345
- package/dist/migration/postgresql-schema-reader.d.ts +2 -2
- package/dist/migration/postgresql-schema-reader.d.ts.map +1 -1
- package/dist/migration/postgresql-schema-reader.js +506 -564
- package/dist/migration/slack-confirm.d.ts +2 -2
- package/dist/migration/slack-confirm.d.ts.map +1 -1
- package/dist/migration/slack-confirm.js +205 -193
- package/dist/migration/types.d.ts +2 -2
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/migration/types.js +1 -3
- package/dist/naite/messaging-types.d.ts +1 -0
- package/dist/naite/messaging-types.d.ts.map +1 -1
- package/dist/naite/messaging-types.js +1 -7
- package/dist/naite/naite-reporter.d.ts +2 -2
- package/dist/naite/naite-reporter.d.ts.map +1 -1
- package/dist/naite/naite-reporter.js +127 -120
- package/dist/naite/naite.d.ts +3 -2
- package/dist/naite/naite.d.ts.map +1 -1
- package/dist/naite/naite.js +266 -300
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +13 -3
- package/dist/ssr/registry.d.ts +1 -1
- package/dist/ssr/registry.d.ts.map +1 -1
- package/dist/ssr/registry.js +45 -37
- package/dist/ssr/renderer.d.ts +4 -4
- package/dist/ssr/renderer.d.ts.map +1 -1
- package/dist/ssr/renderer.js +84 -91
- package/dist/ssr/types.d.ts +2 -2
- package/dist/ssr/types.d.ts.map +1 -1
- package/dist/ssr/types.js +1 -3
- package/dist/storage/base-file.js +54 -41
- 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 +51 -44
- package/dist/storage/drivers.d.ts +2 -2
- package/dist/storage/drivers.d.ts.map +1 -1
- package/dist/storage/drivers.js +12 -7
- package/dist/storage/index.js +14 -7
- package/dist/storage/s3-driver.d.ts +2 -2
- package/dist/storage/s3-driver.d.ts.map +1 -1
- package/dist/storage/s3-driver.js +52 -48
- package/dist/storage/storage-manager.d.ts +2 -2
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +33 -25
- package/dist/storage/types.d.ts +2 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/types.js +1 -5
- package/dist/storage/uploaded-file.d.ts +1 -1
- package/dist/storage/uploaded-file.d.ts.map +1 -1
- package/dist/storage/uploaded-file.js +45 -35
- package/dist/stream/index.js +7 -2
- package/dist/stream/sse.d.ts +2 -2
- package/dist/stream/sse.d.ts.map +1 -1
- package/dist/stream/sse.js +72 -67
- package/dist/syncer/api-parser.d.ts +1 -1
- package/dist/syncer/api-parser.d.ts.map +1 -1
- package/dist/syncer/api-parser.js +224 -245
- package/dist/syncer/checksum.d.ts +1 -1
- package/dist/syncer/checksum.d.ts.map +1 -1
- package/dist/syncer/checksum.js +86 -72
- package/dist/syncer/code-generator.d.ts +2 -2
- package/dist/syncer/code-generator.d.ts.map +1 -1
- package/dist/syncer/code-generator.js +154 -160
- package/dist/syncer/entity-operations.d.ts +1 -1
- package/dist/syncer/entity-operations.d.ts.map +1 -1
- package/dist/syncer/entity-operations.js +63 -54
- package/dist/syncer/file-patterns.d.ts +1 -1
- package/dist/syncer/file-patterns.d.ts.map +1 -1
- package/dist/syncer/file-patterns.js +38 -38
- package/dist/syncer/index.js +19 -8
- package/dist/syncer/module-loader.d.ts +5 -5
- package/dist/syncer/module-loader.d.ts.map +1 -1
- package/dist/syncer/module-loader.js +83 -78
- package/dist/syncer/syncer-actions.d.ts +2 -2
- package/dist/syncer/syncer-actions.d.ts.map +1 -1
- package/dist/syncer/syncer-actions.js +76 -91
- package/dist/syncer/syncer.d.ts +7 -6
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +426 -492
- package/dist/tasks/decorator.d.ts +3 -3
- package/dist/tasks/decorator.d.ts.map +1 -1
- package/dist/tasks/decorator.js +32 -28
- package/dist/tasks/step-wrapper.d.ts +1 -1
- package/dist/tasks/step-wrapper.d.ts.map +1 -1
- package/dist/tasks/step-wrapper.js +42 -41
- package/dist/tasks/workflow-manager.d.ts +2 -2
- package/dist/tasks/workflow-manager.d.ts.map +1 -1
- package/dist/tasks/workflow-manager.js +192 -221
- 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 +103 -103
- package/dist/template/helpers.d.ts.map +1 -1
- package/dist/template/helpers.js +163 -163
- package/dist/template/implementations/entity.template.d.ts +1 -1
- package/dist/template/implementations/entity.template.d.ts.map +1 -1
- package/dist/template/implementations/entity.template.js +76 -85
- package/dist/template/implementations/entry-server.template.d.ts +1 -1
- package/dist/template/implementations/entry-server.template.d.ts.map +1 -1
- package/dist/template/implementations/entry-server.template.js +32 -27
- package/dist/template/implementations/generated.template.d.ts +1 -1
- package/dist/template/implementations/generated.template.d.ts.map +1 -1
- package/dist/template/implementations/generated.template.js +254 -275
- package/dist/template/implementations/generated_http.template.d.ts +2 -2
- package/dist/template/implementations/generated_http.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_http.template.js +114 -133
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_sso.template.js +249 -275
- package/dist/template/implementations/init_types.template.d.ts +1 -1
- package/dist/template/implementations/init_types.template.d.ts.map +1 -1
- package/dist/template/implementations/init_types.template.js +40 -34
- package/dist/template/implementations/model.template.d.ts +1 -1
- package/dist/template/implementations/model.template.d.ts.map +1 -1
- package/dist/template/implementations/model.template.js +56 -53
- package/dist/template/implementations/model_test.template.d.ts +1 -1
- package/dist/template/implementations/model_test.template.d.ts.map +1 -1
- package/dist/template/implementations/model_test.template.js +32 -24
- package/dist/template/implementations/queries.template.d.ts +1 -1
- package/dist/template/implementations/queries.template.d.ts.map +1 -1
- package/dist/template/implementations/queries.template.js +84 -89
- package/dist/template/implementations/sd.template.d.ts +1 -1
- package/dist/template/implementations/sd.template.d.ts.map +1 -1
- package/dist/template/implementations/sd.template.js +137 -144
- package/dist/template/implementations/services.template.d.ts +1 -1
- package/dist/template/implementations/services.template.d.ts.map +1 -1
- package/dist/template/implementations/services.template.js +164 -189
- package/dist/template/implementations/view_form.template.d.ts +1 -1
- package/dist/template/implementations/view_form.template.d.ts.map +1 -1
- package/dist/template/implementations/view_form.template.js +258 -285
- package/dist/template/implementations/view_id_all_select.template.d.ts +1 -1
- package/dist/template/implementations/view_id_all_select.template.d.ts.map +1 -1
- package/dist/template/implementations/view_id_all_select.template.js +31 -25
- package/dist/template/implementations/view_list.template.d.ts +1 -1
- package/dist/template/implementations/view_list.template.d.ts.map +1 -1
- package/dist/template/implementations/view_list.template.js +304 -355
- package/dist/template/implementations/view_search_input.template.d.ts +1 -1
- package/dist/template/implementations/view_search_input.template.d.ts.map +1 -1
- package/dist/template/implementations/view_search_input.template.js +31 -27
- package/dist/template/index.js +21 -7
- package/dist/template/template-manager.d.ts +1 -1
- package/dist/template/template-manager.d.ts.map +1 -1
- package/dist/template/template-manager.js +132 -123
- package/dist/template/template-types.js +8 -6
- package/dist/template/template.d.ts +2 -2
- package/dist/template/template.d.ts.map +1 -1
- package/dist/template/template.js +73 -68
- package/dist/template/zod-converter.d.ts.map +1 -1
- package/dist/template/zod-converter.js +603 -657
- package/dist/testing/_relation-graph.d.ts +1 -1
- package/dist/testing/_relation-graph.d.ts.map +1 -1
- package/dist/testing/_relation-graph.js +93 -88
- package/dist/testing/bootstrap.d.ts +22 -13
- package/dist/testing/bootstrap.d.ts.map +1 -1
- package/dist/testing/bootstrap.js +114 -114
- package/dist/testing/data-explorer.d.ts +3 -3
- package/dist/testing/data-explorer.d.ts.map +1 -1
- package/dist/testing/data-explorer.js +237 -265
- package/dist/testing/dev-test-routes.d.ts +2 -2
- package/dist/testing/dev-test-routes.d.ts.map +1 -1
- package/dist/testing/dev-test-routes.js +258 -249
- package/dist/testing/dev-vitest-manager.d.ts +1 -1
- package/dist/testing/dev-vitest-manager.d.ts.map +1 -1
- package/dist/testing/dev-vitest-manager.js +514 -539
- package/dist/testing/faker-mappings.js +422 -420
- package/dist/testing/fixture-generator.d.ts +3 -3
- package/dist/testing/fixture-generator.d.ts.map +1 -1
- package/dist/testing/fixture-generator.js +1216 -1346
- package/dist/testing/fixture-loader.js +26 -25
- package/dist/testing/fixture-manager.d.ts +3 -3
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +706 -776
- package/dist/testing/global-setup.js +53 -49
- package/dist/testing/index.js +19 -11
- package/dist/testing/naite-vitest-reporter.js +18 -13
- package/dist/testing/parallel-db-manager.d.ts +1 -1
- package/dist/testing/parallel-db-manager.d.ts.map +1 -1
- package/dist/testing/parallel-db-manager.js +63 -78
- package/dist/testing/vitest-helpers.d.ts +1 -1
- package/dist/testing/vitest-helpers.d.ts.map +1 -1
- package/dist/testing/vitest-helpers.js +37 -33
- package/dist/types/types.d.ts +28 -28
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +764 -890
- package/dist/ui/ai-api.d.ts +1 -1
- package/dist/ui/ai-api.d.ts.map +1 -1
- package/dist/ui/ai-api.js +52 -42
- package/dist/ui/ai-client.d.ts +1 -2
- package/dist/ui/ai-client.d.ts.map +1 -1
- package/dist/ui/ai-client.js +353 -388
- package/dist/ui/api.d.ts +1 -1
- package/dist/ui/api.d.ts.map +1 -1
- package/dist/ui/api.js +903 -1145
- package/dist/ui/cdd-service.d.ts +1 -1
- package/dist/ui/cdd-service.d.ts.map +1 -1
- package/dist/ui/cdd-service.js +406 -407
- package/dist/ui/cdd-types.js +1 -3
- package/dist/ui-web/assets/index-C-Zz-wYg.css +1 -0
- package/dist/ui-web/assets/index-DejDON8K.js +238 -0
- package/dist/ui-web/index.html +3 -3
- package/dist/utils/async-utils.js +57 -45
- package/dist/utils/console-util.d.ts.map +1 -1
- package/dist/utils/console-util.js +104 -87
- package/dist/utils/controller.js +26 -19
- package/dist/utils/esm-utils.js +49 -38
- package/dist/utils/formatter.d.ts +1 -2
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +89 -115
- package/dist/utils/fs-utils.d.ts.map +1 -1
- package/dist/utils/fs-utils.js +68 -65
- package/dist/utils/lodash-able.js +11 -4
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +21 -19
- package/dist/utils/object-utils.js +148 -186
- package/dist/utils/path-utils.js +67 -57
- package/dist/utils/process-utils.d.ts.map +1 -1
- package/dist/utils/process-utils.js +37 -31
- package/dist/utils/sql-parser.d.ts +1 -1
- package/dist/utils/sql-parser.d.ts.map +1 -1
- package/dist/utils/sql-parser.js +40 -40
- package/dist/utils/type-utils.js +44 -43
- package/dist/utils/utils.d.ts +2 -3
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +81 -93
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.d.ts.map +1 -1
- package/dist/utils/zod-error.js +24 -17
- package/dist/vector/chunking.d.ts +1 -1
- package/dist/vector/chunking.d.ts.map +1 -1
- package/dist/vector/chunking.js +100 -94
- package/dist/vector/config.d.ts +1 -1
- package/dist/vector/config.d.ts.map +1 -1
- package/dist/vector/config.js +76 -78
- package/dist/vector/embedding.d.ts +1 -1
- package/dist/vector/embedding.d.ts.map +1 -1
- package/dist/vector/embedding.js +128 -125
- package/dist/vector/index.js +5 -5
- package/dist/vector/types.js +1 -5
- package/package.json +31 -36
- package/src/ai/agents/agent.ts +12 -5
- package/src/ai/agents/types.ts +5 -5
- package/src/ai/providers/rtzr/model.ts +8 -10
- package/src/ai/providers/rtzr/options.ts +2 -1
- package/src/ai/providers/rtzr/provider.ts +5 -3
- package/src/ai/providers/rtzr/utils.ts +2 -7
- package/src/api/__tests__/config.test.ts +15 -8
- package/src/api/base-frame.ts +5 -3
- package/src/api/caster.ts +7 -6
- package/src/api/code-converters.ts +23 -26
- package/src/api/config.ts +23 -17
- package/src/api/context.ts +18 -11
- package/src/api/decorators.ts +17 -18
- package/src/api/sonamu.ts +44 -49
- package/src/auth/auth-generator.ts +4 -6
- package/src/auth/better-auth-entities.ts +3 -2
- package/src/auth/knex-adapter.ts +6 -5
- package/src/auth/plugins/entity-definitions/admin.ts +1 -1
- package/src/auth/plugins/entity-definitions/anonymous.ts +1 -1
- package/src/auth/plugins/entity-definitions/api-key.ts +1 -1
- package/src/auth/plugins/entity-definitions/index.ts +1 -1
- package/src/auth/plugins/entity-definitions/jwt.ts +1 -1
- package/src/auth/plugins/entity-definitions/organization.ts +1 -1
- package/src/auth/plugins/entity-definitions/passkey.ts +1 -1
- package/src/auth/plugins/entity-definitions/phone-number.ts +1 -1
- package/src/auth/plugins/entity-definitions/sso.ts +1 -1
- package/src/auth/plugins/entity-definitions/two-factor.ts +1 -1
- package/src/auth/plugins/entity-definitions/types.ts +1 -1
- package/src/auth/plugins/entity-definitions/username.ts +1 -1
- package/src/auth/plugins/wrappers/admin.ts +3 -1
- package/src/auth/plugins/wrappers/anonymous.ts +3 -1
- package/src/auth/plugins/wrappers/api-key.ts +3 -1
- package/src/auth/plugins/wrappers/jwt.ts +3 -1
- package/src/auth/plugins/wrappers/organization.ts +3 -1
- package/src/auth/plugins/wrappers/passkey.ts +3 -1
- package/src/auth/plugins/wrappers/phone-number.ts +3 -1
- package/src/auth/plugins/wrappers/sso.ts +2 -1
- package/src/auth/plugins/wrappers/two-factor.ts +3 -1
- package/src/auth/plugins/wrappers/username.ts +3 -1
- package/src/bin/__tests__/ts-loader-register.test.ts +7 -12
- package/src/bin/build-config.ts +3 -3
- package/src/bin/cli.ts +27 -25
- package/src/bin/fixture.ts +4 -2
- package/src/bin/hmr-hook-register.ts +1 -0
- package/src/bin/test-command.ts +4 -2
- package/src/bin/ts-loader-registration.ts +6 -22
- package/src/cache/cache-manager.ts +2 -1
- package/src/cache/decorator.ts +2 -2
- package/src/cache/types.ts +3 -3
- package/src/cache-control/cache-control.ts +3 -2
- package/src/cache-control/types.ts +2 -2
- package/src/compress/compress.ts +1 -1
- package/src/cone/cone-generator.ts +5 -3
- package/src/database/_batch_update.ts +1 -1
- package/src/database/base-model.ts +20 -14
- package/src/database/base-model.types.ts +12 -11
- package/src/database/db.ts +56 -21
- package/src/database/knex.ts +2 -2
- package/src/database/puri-subset.test-d.ts +33 -32
- package/src/database/puri-subset.types.ts +6 -7
- package/src/database/puri-wrapper.ts +29 -26
- package/src/database/puri.ts +36 -34
- package/src/database/puri.types.test-d.ts +6 -5
- package/src/database/puri.types.ts +9 -12
- package/src/database/transaction-context.ts +2 -2
- package/src/database/upsert-builder.ts +17 -10
- package/src/dict/sd.ts +17 -4
- package/src/dict/sonamu-dictionary.ts +23 -17
- package/src/entity/entity-manager.ts +9 -7
- package/src/entity/entity-template-cone.ts +10 -3
- package/src/entity/entity.ts +20 -16
- package/src/exceptions/error-handler.ts +2 -1
- package/src/exceptions/so-exceptions.ts +1 -1
- package/src/filter/utils.ts +3 -2
- package/src/logger/category.ts +1 -0
- package/src/logger/configure.ts +5 -5
- package/src/migration/__tests__/code-generation.search-text.test.ts +2 -3
- package/src/migration/code-generation.ts +26 -25
- package/src/migration/migration-set.ts +16 -18
- package/src/migration/migrator.ts +38 -33
- package/src/migration/postgresql-schema-reader.ts +12 -12
- package/src/migration/slack-confirm.ts +5 -4
- package/src/migration/types.ts +2 -2
- package/src/naite/messaging-types.ts +1 -1
- package/src/naite/naite-reporter.ts +5 -3
- package/src/naite/naite.ts +12 -7
- package/src/shared/app.shared.ts.txt +2 -2
- package/src/shared/web.shared.ts.txt +2 -2
- package/src/skills/AGENTS.md +19 -18
- package/src/skills/commands/sonamu-skills.md +9 -9
- package/src/skills/sonamu/SKILL.md +111 -104
- package/src/skills/sonamu/ai-agents.md +27 -26
- package/src/skills/sonamu/api.md +81 -69
- package/src/skills/sonamu/auth-migration.md +13 -27
- package/src/skills/sonamu/auth-plugins.md +41 -31
- package/src/skills/sonamu/auth.md +30 -24
- package/src/skills/sonamu/cdd.md +26 -17
- package/src/skills/sonamu/cone.md +50 -50
- package/src/skills/sonamu/config.md +74 -51
- package/src/skills/sonamu/create-sonamu.md +31 -19
- package/src/skills/sonamu/database.md +43 -26
- package/src/skills/sonamu/entity-basic.md +61 -61
- package/src/skills/sonamu/entity-relations.md +84 -80
- package/src/skills/sonamu/entity-validation-checklist.md +19 -15
- package/src/skills/sonamu/fixture-cli.md +52 -30
- package/src/skills/sonamu/framework-change.md +9 -7
- package/src/skills/sonamu/frontend.md +64 -82
- package/src/skills/sonamu/i18n.md +45 -37
- package/src/skills/sonamu/migration.md +54 -31
- package/src/skills/sonamu/model.md +98 -66
- package/src/skills/sonamu/naite.md +34 -32
- package/src/skills/sonamu/project-init.md +28 -8
- package/src/skills/sonamu/puri.md +82 -91
- package/src/skills/sonamu/scaffolding.md +44 -32
- package/src/skills/sonamu/skill-contribution.md +50 -45
- package/src/skills/sonamu/subset.md +13 -13
- package/src/skills/sonamu/tasks.md +73 -58
- package/src/skills/sonamu/testing-devrunner.md +56 -36
- package/src/skills/sonamu/testing.md +23 -58
- package/src/skills/sonamu/upsert.md +32 -31
- package/src/skills/sonamu/vector.md +37 -36
- package/src/ssr/index.ts +2 -12
- package/src/ssr/registry.ts +1 -1
- package/src/ssr/renderer.ts +7 -5
- package/src/ssr/types.ts +2 -2
- package/src/storage/buffered-file.ts +4 -2
- package/src/storage/drivers.ts +3 -2
- package/src/storage/s3-driver.ts +7 -4
- package/src/storage/storage-manager.ts +3 -2
- package/src/storage/types.ts +3 -2
- package/src/storage/uploaded-file.ts +1 -1
- package/src/stream/sse.ts +2 -2
- package/src/syncer/api-parser.ts +8 -5
- package/src/syncer/checksum.ts +9 -5
- package/src/syncer/code-generator.ts +16 -8
- package/src/syncer/entity-operations.ts +5 -3
- package/src/syncer/file-patterns.ts +2 -1
- package/src/syncer/module-loader.ts +9 -6
- package/src/syncer/syncer-actions.ts +5 -3
- package/src/syncer/syncer.ts +18 -24
- package/src/tasks/decorator.ts +10 -8
- package/src/tasks/step-wrapper.ts +1 -1
- package/src/tasks/workflow-manager.ts +18 -15
- package/src/template/__tests__/generated.template.search-text.test.ts +1 -0
- package/src/template/entity-converter.ts +4 -2
- package/src/template/generated.template.test-d.ts +2 -1
- package/src/template/helpers.ts +5 -2
- package/src/template/implementations/entity.template.ts +9 -8
- package/src/template/implementations/entry-server.template.ts +1 -1
- package/src/template/implementations/generated.template.ts +21 -29
- package/src/template/implementations/generated_http.template.ts +9 -6
- package/src/template/implementations/generated_sso.template.ts +6 -4
- package/src/template/implementations/init_types.template.ts +3 -2
- package/src/template/implementations/model.template.ts +4 -2
- package/src/template/implementations/model_test.template.ts +3 -2
- package/src/template/implementations/queries.template.ts +6 -14
- package/src/template/implementations/sd.template.ts +4 -2
- package/src/template/implementations/services.template.ts +7 -11
- package/src/template/implementations/view_form.template.ts +5 -3
- package/src/template/implementations/view_id_all_select.template.ts +3 -2
- package/src/template/implementations/view_list.template.ts +7 -5
- package/src/template/implementations/view_search_input.template.ts +3 -2
- package/src/template/template-manager.ts +4 -3
- package/src/template/template.ts +4 -3
- package/src/template/zod-converter.ts +10 -7
- package/src/testing/__tests__/dev-test-routes.test.ts +3 -2
- package/src/testing/__tests__/dev-vitest-manager.test.ts +1 -0
- package/src/testing/_relation-graph.ts +2 -2
- package/src/testing/bootstrap.ts +55 -27
- package/src/testing/data-explorer.ts +5 -4
- package/src/testing/dev-test-routes.ts +8 -5
- package/src/testing/dev-vitest-manager.ts +13 -12
- package/src/testing/fixture-generator.ts +11 -17
- package/src/testing/fixture-manager.ts +21 -17
- package/src/testing/parallel-db-manager.ts +2 -1
- package/src/testing/vitest-helpers.ts +2 -1
- package/src/types/__tests__/entity-json-schema-search-text.test.ts +1 -0
- package/src/types/types.ts +8 -8
- package/src/typings/knex.d.ts +4 -4
- package/src/ui/ai-api.ts +5 -3
- package/src/ui/ai-client.ts +6 -5
- package/src/ui/api.ts +25 -23
- package/src/ui/cdd-service.ts +12 -11
- package/src/utils/console-util.ts +3 -1
- package/src/utils/formatter.ts +94 -102
- package/src/utils/fs-utils.ts +2 -1
- package/src/utils/model.ts +2 -2
- package/src/utils/object-utils.ts +3 -3
- package/src/utils/process-utils.ts +2 -1
- package/src/utils/sql-parser.ts +10 -1
- package/src/utils/type-utils.ts +3 -3
- package/src/utils/utils.ts +9 -7
- package/src/utils/zod-error.ts +1 -1
- package/src/vector/chunking.ts +1 -1
- package/src/vector/config.ts +1 -1
- package/src/vector/embedding.ts +11 -9
- package/tsdown.api.config.ts +50 -0
- package/.swcrc.project-default +0 -18
- package/dist/api/__tests__/config.test.js +0 -189
- package/dist/bin/__tests__/test-command.test.js +0 -112
- package/dist/bin/__tests__/ts-loader-register.test.js +0 -45
- package/dist/database/puri-subset.test-d.js +0 -89
- package/dist/database/puri.types.test-d.js +0 -129
- package/dist/migration/__tests__/code-generation.search-text.test.js +0 -435
- package/dist/template/__tests__/generated.template.search-text.test.js +0 -99
- package/dist/template/generated.template.test-d.js +0 -24
- package/dist/testing/__tests__/dev-test-routes.test.js +0 -144
- package/dist/testing/__tests__/dev-vitest-manager.test.js +0 -152
- package/dist/types/__tests__/entity-json-schema-search-text.test.js +0 -256
- package/dist/typings/knex.d.js +0 -3
- package/dist/ui-web/assets/index-CKo0Z2Iu.css +0 -1
- package/dist/ui-web/assets/index-DK-2aacv.js +0 -257
|
@@ -2,6 +2,7 @@ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
5
6
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
7
|
|
|
7
8
|
const tsLoaderRegisterStateKey = Symbol.for("sonamu.ts-loader-register.state");
|
|
@@ -17,7 +18,6 @@ type GlobalWithTsLoaderRegisterState = typeof globalThis & {
|
|
|
17
18
|
function resetRegisterState() {
|
|
18
19
|
const globalState = globalThis as GlobalWithTsLoaderRegisterState;
|
|
19
20
|
delete globalState[tsLoaderRegisterStateKey];
|
|
20
|
-
delete process.env.SWCRC_PATH;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async function createTempRoot(): Promise<string> {
|
|
@@ -26,6 +26,20 @@ async function createTempRoot(): Promise<string> {
|
|
|
26
26
|
|
|
27
27
|
async function writeSourceFixture(rootPath: string): Promise<void> {
|
|
28
28
|
await mkdir(path.join(rootPath, "src"), { recursive: true });
|
|
29
|
+
await writeFile(
|
|
30
|
+
path.join(rootPath, "tsconfig.json"),
|
|
31
|
+
JSON.stringify(
|
|
32
|
+
{
|
|
33
|
+
compilerOptions: {
|
|
34
|
+
experimentalDecorators: true,
|
|
35
|
+
module: "esnext",
|
|
36
|
+
target: "esnext",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
null,
|
|
40
|
+
2,
|
|
41
|
+
),
|
|
42
|
+
);
|
|
29
43
|
await writeFile(
|
|
30
44
|
path.join(rootPath, "src", "support.ts"),
|
|
31
45
|
`
|
|
@@ -122,7 +136,6 @@ describe("loadConfig", () => {
|
|
|
122
136
|
const tempRoots: string[] = [];
|
|
123
137
|
const originalHot = process.env.HOT;
|
|
124
138
|
const originalVitest = process.env.VITEST;
|
|
125
|
-
const originalSwcrcPath = process.env.SWCRC_PATH;
|
|
126
139
|
|
|
127
140
|
beforeEach(() => {
|
|
128
141
|
vi.resetModules();
|
|
@@ -149,12 +162,6 @@ describe("loadConfig", () => {
|
|
|
149
162
|
process.env.VITEST = originalVitest;
|
|
150
163
|
}
|
|
151
164
|
|
|
152
|
-
if (originalSwcrcPath === undefined) {
|
|
153
|
-
delete process.env.SWCRC_PATH;
|
|
154
|
-
} else {
|
|
155
|
-
process.env.SWCRC_PATH = originalSwcrcPath;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
165
|
await Promise.all(
|
|
159
166
|
tempRoots.splice(0).map((rootPath) => rm(rootPath, { recursive: true, force: true })),
|
|
160
167
|
);
|
package/src/api/base-frame.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { getLogger
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
1
|
+
import { getLogger } from "@logtape/logtape";
|
|
2
|
+
import { type Logger } from "@logtape/logtape";
|
|
3
|
+
import { type Knex } from "knex";
|
|
4
|
+
|
|
5
|
+
import { type DBPreset } from "../database/db";
|
|
4
6
|
// Static imports kept for non-async functions (getDB, getUpsertBuilder)
|
|
5
7
|
import { DB } from "../database/db";
|
|
6
8
|
import { UpsertBuilder } from "../database/upsert-builder";
|
package/src/api/caster.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
+
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
import type
|
|
4
|
+
import { type $ZodType } from "zod/v4/core";
|
|
4
5
|
|
|
5
6
|
function isNumberType(zodType: $ZodType): zodType is z.ZodNumber {
|
|
6
7
|
return zodType instanceof z.ZodNumber;
|
|
@@ -25,7 +26,7 @@ function isZodNumberAnyway(zodType: $ZodType) {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
// ZodType을 이용해 raw를 Type Coercing
|
|
28
|
-
//
|
|
29
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 캐스팅에는 any가 필요함.
|
|
29
30
|
export function caster(zodType: $ZodType, raw: any): any {
|
|
30
31
|
if (isZodNumberAnyway(zodType) && typeof raw === "string") {
|
|
31
32
|
// number
|
|
@@ -38,7 +39,7 @@ export function caster(zodType: $ZodType, raw: any): any {
|
|
|
38
39
|
if (Array.isArray(raw)) {
|
|
39
40
|
const numType = zodType.options.find((opt) => isNumberType(opt));
|
|
40
41
|
assert(numType !== undefined);
|
|
41
|
-
//
|
|
42
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 캐스팅에는 any가 필요함.
|
|
42
43
|
return raw.map((elem: any) => caster(numType, elem));
|
|
43
44
|
} else {
|
|
44
45
|
return Number(raw);
|
|
@@ -48,7 +49,7 @@ export function caster(zodType: $ZodType, raw: any): any {
|
|
|
48
49
|
return raw === "true";
|
|
49
50
|
} else if (raw !== null && Array.isArray(raw) && zodType instanceof z.ZodArray) {
|
|
50
51
|
// array
|
|
51
|
-
//
|
|
52
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 캐스팅에는 any가 필요함.
|
|
52
53
|
return raw.map((elem: any) => caster(zodType.element, elem));
|
|
53
54
|
} else if (zodType instanceof z.ZodObject && typeof raw === "object" && raw !== null) {
|
|
54
55
|
// object
|
|
@@ -79,9 +80,9 @@ export function caster(zodType: $ZodType, raw: any): any {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
//
|
|
83
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 캐스팅에는 any가 필요함.
|
|
83
84
|
export function fastifyCaster(schema: z.ZodObject<any>) {
|
|
84
|
-
//
|
|
85
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 캐스팅에는 any가 필요함.
|
|
85
86
|
return z.preprocess((raw: any) => {
|
|
86
87
|
return caster(schema, raw);
|
|
87
88
|
}, schema);
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { z } from "zod";
|
|
22
|
-
|
|
23
|
-
import
|
|
24
|
-
import { type ApiParam
|
|
25
|
-
import type
|
|
22
|
+
|
|
23
|
+
import { ApiParamType } from "../types/types";
|
|
24
|
+
import { type ApiParam } from "../types/types";
|
|
25
|
+
import { type ExtendedApi } from "./decorators";
|
|
26
26
|
|
|
27
27
|
// <any>를 자제하고, Zod에서 제약하는 기본적인 Generic Type Parameter를 사용함.
|
|
28
|
-
type AnyZodObject = z.ZodObject
|
|
29
|
-
type AnyZodLiteral = z.ZodLiteral
|
|
28
|
+
type AnyZodObject = z.ZodObject;
|
|
29
|
+
type AnyZodLiteral = z.ZodLiteral;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Promise 타입을 한 번 언래핑하여 내부 타입을 반환합니다.
|
|
@@ -54,7 +54,7 @@ export function getZodTypeFromApiParamType(
|
|
|
54
54
|
references: {
|
|
55
55
|
[id: string]: z.ZodType;
|
|
56
56
|
},
|
|
57
|
-
): z.ZodType
|
|
57
|
+
): z.ZodType {
|
|
58
58
|
switch (paramType) {
|
|
59
59
|
case "string":
|
|
60
60
|
return z.string();
|
|
@@ -96,7 +96,7 @@ export function getZodTypeFromApiParamType(
|
|
|
96
96
|
}
|
|
97
97
|
const [obj, literalOrUnion] = refType.args.map(
|
|
98
98
|
(arg) => getZodTypeFromApiParamType(arg, references),
|
|
99
|
-
//
|
|
99
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 생성되는 ZodUnion의 타입을 추적하기 어려움
|
|
100
100
|
) as [AnyZodObject, z.ZodUnion<any> | AnyZodLiteral];
|
|
101
101
|
|
|
102
102
|
let keys: string[] = [];
|
|
@@ -110,12 +110,12 @@ export function getZodTypeFromApiParamType(
|
|
|
110
110
|
const keyRecord = Object.fromEntries(keys.map((key) => [key, true as const]));
|
|
111
111
|
if (refType.id === "Pick") {
|
|
112
112
|
if (obj.pick) {
|
|
113
|
-
//
|
|
113
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- Zod 4.3.6 pick 타입 호환성
|
|
114
114
|
return obj.pick(keyRecord as any);
|
|
115
115
|
}
|
|
116
116
|
} else {
|
|
117
117
|
if (obj.omit) {
|
|
118
|
-
//
|
|
118
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- Zod 4.3.6 omit 타입 호환성
|
|
119
119
|
return obj.omit(keyRecord as any);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -125,7 +125,7 @@ export function getZodTypeFromApiParamType(
|
|
|
125
125
|
throw new Error(`잘못된 ${refType.id}`);
|
|
126
126
|
}
|
|
127
127
|
const obj = getZodTypeFromApiParamType(refType.args[0], references);
|
|
128
|
-
//
|
|
128
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- Partial 인수 타입 캐스팅
|
|
129
129
|
return (obj as z.ZodObject<any>).partial();
|
|
130
130
|
}
|
|
131
131
|
const reference = references[refType.id];
|
|
@@ -158,22 +158,19 @@ export function getZodTypeFromApiParamType(
|
|
|
158
158
|
t: string;
|
|
159
159
|
types: ApiParamType[];
|
|
160
160
|
};
|
|
161
|
-
return intersectionType.types.reduce(
|
|
162
|
-
(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
z.unknown() as z.ZodType<unknown>,
|
|
171
|
-
);
|
|
161
|
+
return intersectionType.types.reduce((result, type, index) => {
|
|
162
|
+
const resolvedType = getZodTypeFromApiParamType(type, references);
|
|
163
|
+
if (index === 0) {
|
|
164
|
+
return resolvedType;
|
|
165
|
+
} else {
|
|
166
|
+
return z.intersection(result, resolvedType);
|
|
167
|
+
}
|
|
168
|
+
}, z.unknown() as z.ZodType);
|
|
172
169
|
}
|
|
173
170
|
case "tuple-type": {
|
|
174
171
|
const tupleType = paramType as ApiParamType.TupleType;
|
|
175
172
|
return z.tuple(
|
|
176
|
-
//
|
|
173
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 생성되는 ZodTuple의 타입을 추적하기 어려움
|
|
177
174
|
tupleType.elements.map((elem) => getZodTypeFromApiParamType(elem, references)) as any,
|
|
178
175
|
);
|
|
179
176
|
}
|
|
@@ -223,7 +220,7 @@ export function getZodObjectFromApi(
|
|
|
223
220
|
const zodType = getZodTypeFromApiParamType(typeParam.constraint, references);
|
|
224
221
|
|
|
225
222
|
// FIXME: references는 글로벌 오브젝트로, typeParam.id("T" 등)를 key로 이렇게 덮어씌워버리면 loadedTypes가 오염됨.
|
|
226
|
-
//
|
|
223
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 레퍼런스 타입 캐스팅
|
|
227
224
|
(references[typeParam.id] as z.ZodType<any>) = zodType;
|
|
228
225
|
}
|
|
229
226
|
}
|
|
@@ -234,7 +231,7 @@ export function getZodObjectFromApi(
|
|
|
234
231
|
(param) =>
|
|
235
232
|
!ApiParamType.isContext(param.type) &&
|
|
236
233
|
!ApiParamType.isRefKnex(param.type) &&
|
|
237
|
-
!(param.optional
|
|
234
|
+
!(param.optional && param.name.startsWith("_")), // _로 시작하는 파라미터는 제외
|
|
238
235
|
),
|
|
239
236
|
references,
|
|
240
237
|
);
|
|
@@ -284,7 +281,7 @@ export function apiParamTypeToTsType(paramType: ApiParamType, injectImportKeys:
|
|
|
284
281
|
? `(${elementsType})[]`
|
|
285
282
|
: `${elementsType}[]`;
|
|
286
283
|
} else if (ApiParamType.isRef(paramType)) {
|
|
287
|
-
if (["Pick", "Omit", "Promise", "Partial", "Date"].includes(paramType.id)
|
|
284
|
+
if (!["Pick", "Omit", "Promise", "Partial", "Date"].includes(paramType.id)) {
|
|
288
285
|
// importKeys 인젝션
|
|
289
286
|
injectImportKeys.push(paramType.id);
|
|
290
287
|
}
|
package/src/api/config.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import type
|
|
14
|
-
import type
|
|
15
|
-
import type
|
|
16
|
-
|
|
17
|
-
import type
|
|
1
|
+
import { type FastifyCompressOptions } from "@fastify/compress";
|
|
2
|
+
import { type FastifyCorsOptions } from "@fastify/cors";
|
|
3
|
+
import { type FastifyFormbodyOptions } from "@fastify/formbody";
|
|
4
|
+
import { type FastifyMultipartOptions } from "@fastify/multipart";
|
|
5
|
+
import { type FastifyStaticOptions } from "@fastify/static";
|
|
6
|
+
import { type BetterAuthOptions } from "better-auth";
|
|
7
|
+
import {
|
|
8
|
+
type FastifyInstance,
|
|
9
|
+
type FastifyReply,
|
|
10
|
+
type FastifyRequest,
|
|
11
|
+
type FastifyServerOptions,
|
|
12
|
+
} from "fastify";
|
|
13
|
+
import { type QsPluginOptions } from "fastify-qs";
|
|
14
|
+
import { type SsePluginOptions } from "fastify-sse-v2/lib/types";
|
|
15
|
+
import { type Knex } from "knex";
|
|
16
|
+
|
|
17
|
+
import { type CacheConfig } from "../cache/types";
|
|
18
|
+
import { type SonamuDBConfig } from "../database/db";
|
|
19
|
+
import { type SonamuLoggingOptions } from "../logger/configure";
|
|
20
|
+
import { type StorageConfig } from "../storage/types";
|
|
21
|
+
import { type WorkflowOptions } from "../tasks/workflow-manager";
|
|
22
|
+
import { type Executable, type SonamuFastifyConfig } from "../types/types";
|
|
23
|
+
import { type Context } from "./context";
|
|
18
24
|
|
|
19
25
|
export type DatabaseConfig = Omit<Knex.Config, "connection"> & {
|
|
20
26
|
connection?: Knex.PgConnectionConfig;
|
package/src/api/context.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import type { BufferedFile } from "../storage/buffered-file";
|
|
8
|
-
import type { UploadedFile } from "../storage/uploaded-file";
|
|
9
|
-
import type { createSSEFactory } from "../stream/sse";
|
|
1
|
+
import {
|
|
2
|
+
type IncomingHttpHeaders,
|
|
3
|
+
type IncomingMessage,
|
|
4
|
+
type Server,
|
|
5
|
+
type ServerResponse,
|
|
6
|
+
} from "http";
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
import { type Session, type User } from "better-auth";
|
|
9
|
+
import { type FastifyReply, type FastifyRequest } from "fastify";
|
|
10
|
+
import { type RouteGenericInterface } from "fastify/types/route";
|
|
11
|
+
import { type ZodObject } from "zod";
|
|
12
|
+
|
|
13
|
+
import { type NaiteStore } from "../naite/naite";
|
|
14
|
+
import { type BufferedFile } from "../storage/buffered-file";
|
|
15
|
+
import { type UploadedFile } from "../storage/uploaded-file";
|
|
16
|
+
import { type createSSEFactory } from "../stream/sse";
|
|
17
|
+
|
|
18
|
+
// oxlint-disable-next-line @typescript-eslint/no-empty-interface -- Context 확장 타입
|
|
12
19
|
export interface ContextExtend {}
|
|
13
20
|
export type Context = {
|
|
14
21
|
request: FastifyRequest;
|
|
15
|
-
reply: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface
|
|
22
|
+
reply: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface>;
|
|
16
23
|
headers: IncomingHttpHeaders;
|
|
17
24
|
createSSE: <T extends ZodObject>(events: T) => ReturnType<typeof createSSEFactory<T>>;
|
|
18
25
|
naiteStore: NaiteStore;
|
package/src/api/decorators.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import type { FastifyMultipartBaseOptions } from "@fastify/multipart";
|
|
2
|
-
import { getLogger } from "@logtape/logtape";
|
|
3
1
|
import assert from "assert";
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
import { type FastifyMultipartBaseOptions } from "@fastify/multipart";
|
|
4
|
+
import { getLogger } from "@logtape/logtape";
|
|
5
|
+
import { type HTTPMethods } from "fastify";
|
|
5
6
|
import inflection from "inflection";
|
|
6
7
|
import { isEqual } from "radashi";
|
|
7
|
-
import type
|
|
8
|
-
|
|
9
|
-
import type
|
|
8
|
+
import { type z } from "zod";
|
|
9
|
+
|
|
10
|
+
import { type CacheControlConfig } from "../cache-control/types";
|
|
11
|
+
import { type CompressConfig } from "../compress/types";
|
|
10
12
|
import { BaseModelClass } from "../database/base-model";
|
|
11
13
|
import { DB } from "../database/db";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
type PuriWrapper,
|
|
15
|
-
type TransactionalOptions,
|
|
16
|
-
} from "../database/puri-wrapper";
|
|
14
|
+
import { PuriTransactionWrapper } from "../database/puri-wrapper";
|
|
15
|
+
import { type TransactionalOptions } from "../database/puri-wrapper";
|
|
17
16
|
import { UpsertBuilder } from "../database/upsert-builder";
|
|
18
17
|
import { convertDomainToCategory } from "../logger/category";
|
|
19
|
-
import type
|
|
20
|
-
import type
|
|
21
|
-
import type
|
|
18
|
+
import { type DriverKey } from "../storage/drivers";
|
|
19
|
+
import { type KeyGenerator } from "../storage/types";
|
|
20
|
+
import { type ApiParam, type ApiParamType } from "../types/types";
|
|
22
21
|
import { BaseFrameClass } from "./base-frame";
|
|
23
22
|
|
|
24
23
|
export interface GuardKeys {
|
|
@@ -55,7 +54,7 @@ export type ApiDecoratorOptions = {
|
|
|
55
54
|
};
|
|
56
55
|
export type StreamDecoratorOptions = {
|
|
57
56
|
type: "sse"; // | 'ws
|
|
58
|
-
//
|
|
57
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 이벤트 키별로 넘겨주는 값이므로 어떤 타입이든 상관없음
|
|
59
58
|
events: z.ZodObject<any>;
|
|
60
59
|
path?: string;
|
|
61
60
|
resourceName?: string;
|
|
@@ -301,7 +300,7 @@ export function transactional(options: TransactionalOptions = {}) {
|
|
|
301
300
|
|
|
302
301
|
// AsyncLocalStorage 컨텍스트 없거나 해당 preset의 트랜잭션이 없으면 새로 시작
|
|
303
302
|
const startTransaction = async () => {
|
|
304
|
-
const puri = this.getPuri(dbPreset)
|
|
303
|
+
const puri = this.getPuri(dbPreset);
|
|
305
304
|
|
|
306
305
|
return puri.knex.transaction(
|
|
307
306
|
async (trx) => {
|
|
@@ -454,9 +453,9 @@ function assertNoConflictingOptions(
|
|
|
454
453
|
decoratorName: string,
|
|
455
454
|
modelName: string,
|
|
456
455
|
methodName: string,
|
|
457
|
-
//
|
|
456
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- <아 쉽게쉽게 좀 갑시다>
|
|
458
457
|
existingOptions: Record<string, any>,
|
|
459
|
-
//
|
|
458
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- <이럴 때 아니면 any 언제 씁니까>
|
|
460
459
|
newOptions: Record<string, any>,
|
|
461
460
|
) {
|
|
462
461
|
Object.keys(newOptions).forEach((key) => {
|
package/src/api/sonamu.ts
CHANGED
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
import { dispose as logtapeDispose } from "@logtape/logtape";
|
|
2
1
|
import assert from "assert";
|
|
3
2
|
import { AsyncLocalStorage } from "async_hooks";
|
|
4
|
-
import type { Auth } from "better-auth";
|
|
5
|
-
import type { FSWatcher } from "chokidar";
|
|
6
|
-
import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
|
7
3
|
import fs from "fs/promises";
|
|
8
|
-
import type
|
|
9
|
-
import mime, { lookup as mimeLookup } from "mime-types";
|
|
4
|
+
import { type IncomingMessage, type Server, type ServerResponse } from "http";
|
|
10
5
|
import os from "os";
|
|
11
6
|
import path from "path";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from "..";
|
|
22
|
-
import type { CacheConfig, CacheManager } from "../cache/types";
|
|
7
|
+
|
|
8
|
+
import { dispose as logtapeDispose } from "@logtape/logtape";
|
|
9
|
+
import { type Auth } from "better-auth";
|
|
10
|
+
import { type FSWatcher } from "chokidar";
|
|
11
|
+
import { type FastifyInstance, type FastifyReply, type FastifyRequest } from "fastify";
|
|
12
|
+
import mime, { lookup as mimeLookup } from "mime-types";
|
|
13
|
+
import { type ZodObject } from "zod";
|
|
14
|
+
|
|
15
|
+
import { BASE_FIELD_MAPPINGS } from "../auth/better-auth-entities";
|
|
23
16
|
import { applyCacheHeaders, CachePresets } from "../cache-control/cache-control";
|
|
24
|
-
import type
|
|
17
|
+
import { type CacheControlConfig, type CacheControlRequest } from "../cache-control/types";
|
|
18
|
+
import { type CacheConfig, type CacheManager } from "../cache/types";
|
|
25
19
|
import { toFastifyCompressOption } from "../compress/compress";
|
|
26
|
-
import type
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
20
|
+
import { type CompressOptions } from "../compress/types";
|
|
21
|
+
import { DB } from "../database/db";
|
|
22
|
+
import { type SonamuDBConfig } from "../database/db";
|
|
23
|
+
import { SD, setSDConfig } from "../dict/sd";
|
|
24
|
+
import { type LocalizedString } from "../dict/types";
|
|
25
|
+
import { NotFoundException } from "../exceptions/so-exceptions";
|
|
31
26
|
import { BufferedFile } from "../storage/buffered-file";
|
|
32
|
-
import type
|
|
33
|
-
import type
|
|
27
|
+
import { type StorageManager } from "../storage/storage-manager";
|
|
28
|
+
import { type KeyGenerator } from "../storage/types";
|
|
34
29
|
import { UploadedFile } from "../storage/uploaded-file";
|
|
35
|
-
import
|
|
36
|
-
import type
|
|
37
|
-
import type
|
|
38
|
-
import type
|
|
30
|
+
import { createMockSSEFactory } from "../stream/sse";
|
|
31
|
+
import { type Syncer } from "../syncer/syncer";
|
|
32
|
+
import { type WorkflowManager } from "../tasks/workflow-manager";
|
|
33
|
+
import { type DevVitestManager } from "../testing/dev-vitest-manager";
|
|
34
|
+
import { type SonamuFastifyConfig } from "../types/types";
|
|
35
|
+
import { isDaemonServer } from "../utils/controller";
|
|
39
36
|
import { exists, fileExists } from "../utils/fs-utils";
|
|
40
|
-
import type
|
|
41
|
-
import
|
|
42
|
-
import type
|
|
43
|
-
import type
|
|
44
|
-
import {
|
|
37
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
38
|
+
import { convertFastifyHeadersToStandard, merge } from "../utils/utils";
|
|
39
|
+
import { type SonamuConfig, type SonamuServerOptions, type SonamuTaskOptions } from "./config";
|
|
40
|
+
import { type Context } from "./context";
|
|
41
|
+
import { type ExtendedApi } from "./decorators";
|
|
42
|
+
import { getSecrets } from "./secret";
|
|
43
|
+
import { type SonamuSecrets } from "./secret";
|
|
45
44
|
|
|
46
45
|
class SonamuClass {
|
|
47
46
|
public isInitialized: boolean = false;
|
|
@@ -53,7 +52,7 @@ class SonamuClass {
|
|
|
53
52
|
public getContext(): Context {
|
|
54
53
|
const store = this.asyncLocalStorage.getStore();
|
|
55
54
|
if (store?.context) {
|
|
56
|
-
return store.context
|
|
55
|
+
return store.context;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
if (process.env.NODE_ENV === "test") {
|
|
@@ -63,7 +62,7 @@ class SonamuClass {
|
|
|
63
62
|
reply: null,
|
|
64
63
|
headers: {},
|
|
65
64
|
createSSE: (schema: ZodObject) => createMockSSEFactory(schema),
|
|
66
|
-
//
|
|
65
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 테스팅 환경에서 컨텍스트가 주입되지 않은 경우 빈 컨텍스트 리턴
|
|
67
66
|
naiteStore: new Map<string, any>(),
|
|
68
67
|
} as unknown as Context;
|
|
69
68
|
} else {
|
|
@@ -202,6 +201,7 @@ class SonamuClass {
|
|
|
202
201
|
// 설정을 로딩하는 것부터 시작
|
|
203
202
|
const { loadConfig } = await import("./config");
|
|
204
203
|
this.config = await loadConfig(this.apiRootPath);
|
|
204
|
+
setSDConfig(this.config.i18n);
|
|
205
205
|
// sonamu.config.ts 기본값 설정
|
|
206
206
|
this.config.database.database = this.config.database.database ?? "pg";
|
|
207
207
|
this.config.database.defaultOptions.client = this.config.database.database ?? "pg";
|
|
@@ -217,6 +217,7 @@ class SonamuClass {
|
|
|
217
217
|
// DB 로드
|
|
218
218
|
const { DB } = await import("../database/db");
|
|
219
219
|
this.dbConfig = DB.generateDBConfig(this.config.database);
|
|
220
|
+
DB.setConfig(this.dbConfig);
|
|
220
221
|
if (!doSilent) {
|
|
221
222
|
const chalk = (await import("chalk")).default;
|
|
222
223
|
console.log(chalk.green("DB Config Loaded!"));
|
|
@@ -269,13 +270,7 @@ class SonamuClass {
|
|
|
269
270
|
await TemplateManager.autoload();
|
|
270
271
|
await this.syncer.autoloadSSRRoutes();
|
|
271
272
|
|
|
272
|
-
const { isLocal, isTest } = await import("../utils/controller");
|
|
273
|
-
if (isLocal()) {
|
|
274
|
-
// 로컬에서는 코드 생성을 위해 Biome 셋업이 필요함 (현재 apiRootPath 전달하여 실행)
|
|
275
|
-
(await import("../utils/formatter")).setupBiome(this.apiRootPath);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const { isHotReloadServer } = await import("../utils/controller");
|
|
273
|
+
const { isLocal, isTest, isHotReloadServer } = await import("../utils/controller");
|
|
279
274
|
if (isLocal() && !isTest() && isHotReloadServer() && enableSync) {
|
|
280
275
|
await this.syncer.sync();
|
|
281
276
|
await this.startWatcher();
|
|
@@ -289,7 +284,7 @@ class SonamuClass {
|
|
|
289
284
|
}
|
|
290
285
|
|
|
291
286
|
async createServer(initOptions?: { enableSync?: boolean; doSilent?: boolean }) {
|
|
292
|
-
if (this.isInitialized
|
|
287
|
+
if (!this.isInitialized) {
|
|
293
288
|
await this.init(initOptions?.doSilent, initOptions?.enableSync);
|
|
294
289
|
}
|
|
295
290
|
|
|
@@ -342,7 +337,7 @@ class SonamuClass {
|
|
|
342
337
|
doSilent?: boolean;
|
|
343
338
|
},
|
|
344
339
|
) {
|
|
345
|
-
if (this.isInitialized
|
|
340
|
+
if (!this.isInitialized) {
|
|
346
341
|
await this.init(options?.doSilent, options?.enableSync);
|
|
347
342
|
}
|
|
348
343
|
|
|
@@ -516,7 +511,7 @@ class SonamuClass {
|
|
|
516
511
|
});
|
|
517
512
|
}
|
|
518
513
|
|
|
519
|
-
//
|
|
514
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- ViteDevServer 타입을 동적으로 로드해야 함
|
|
520
515
|
private viteServer: any = null;
|
|
521
516
|
|
|
522
517
|
/**
|
|
@@ -1035,7 +1030,7 @@ class SonamuClass {
|
|
|
1035
1030
|
*/
|
|
1036
1031
|
async invokeApiForSSR(
|
|
1037
1032
|
api: ExtendedApi,
|
|
1038
|
-
//
|
|
1033
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- SSR에서 다양한 타입의 params를 받아야 함
|
|
1039
1034
|
params: any[],
|
|
1040
1035
|
config: SonamuFastifyConfig,
|
|
1041
1036
|
request: FastifyRequest,
|
|
@@ -1066,7 +1061,7 @@ class SonamuClass {
|
|
|
1066
1061
|
reply: FastifyReply,
|
|
1067
1062
|
): Promise<unknown> {
|
|
1068
1063
|
const model = this.syncer.models[api.modelName];
|
|
1069
|
-
//
|
|
1064
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- model은 모델 인스턴스이므로 메서드 호출 가능
|
|
1070
1065
|
const result = await (model as any)[api.methodName].apply(model, args);
|
|
1071
1066
|
reply.type(api.options.contentType ?? "application/json");
|
|
1072
1067
|
|
|
@@ -1103,7 +1098,7 @@ class SonamuClass {
|
|
|
1103
1098
|
reply,
|
|
1104
1099
|
headers: request.headers,
|
|
1105
1100
|
createSSE,
|
|
1106
|
-
naiteStore:
|
|
1101
|
+
naiteStore: new Map(),
|
|
1107
1102
|
locale,
|
|
1108
1103
|
// auth
|
|
1109
1104
|
user: session?.user ?? null,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
+
|
|
2
3
|
import { Sonamu } from "../api/sonamu";
|
|
3
4
|
import { EntityManager } from "../entity/entity-manager";
|
|
4
|
-
import type
|
|
5
|
+
import { type EntityIndex, type EntityJson, type EntityProp } from "../types/types";
|
|
5
6
|
import { betterAuthV1 } from "./better-auth-entities";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
ENTITY_DEFINITIONS,
|
|
9
|
-
isValidPluginId,
|
|
10
|
-
} from "./plugins/entity-definitions";
|
|
7
|
+
import { ENTITY_DEFINITIONS, isValidPluginId } from "./plugins/entity-definitions";
|
|
8
|
+
import { type BetterAuthPluginId } from "./plugins/entity-definitions";
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* 누락된 props 찾기
|
package/src/auth/knex-adapter.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
AdapterFactoryCustomizeAdapterCreator,
|
|
4
|
-
DBTransactionAdapter,
|
|
1
|
+
import { type BetterAuthOptions } from "better-auth";
|
|
2
|
+
import {
|
|
3
|
+
type AdapterFactoryCustomizeAdapterCreator,
|
|
4
|
+
type DBTransactionAdapter,
|
|
5
5
|
} from "better-auth/adapters";
|
|
6
6
|
import { createAdapterFactory } from "better-auth/adapters";
|
|
7
|
-
import type
|
|
7
|
+
import { type Knex } from "knex";
|
|
8
|
+
|
|
8
9
|
import { DB } from "../database/db";
|
|
9
10
|
|
|
10
11
|
interface CleanedWhere {
|