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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */ // Puri의 타입은 개별 모델에서 확정되므로 BaseModel에서는 any를 허용함
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* BaseModel 타입 시스템
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Enhancer, SubsetQuery 교집합 등 Model 계층에서 필요한 타입 정의.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
10
|
+
import { type DatabaseSchemaExtend } from "../types/types";
|
|
11
|
+
import { type Puri } from "./puri";
|
|
12
|
+
import { type PuriSubsetFn } from "./puri-subset.types";
|
|
13
|
+
import { type ExtractTTables } from "./puri.types";
|
|
14
14
|
|
|
15
15
|
// ============================================================================
|
|
16
16
|
// Subset 교집합 계산 (onSubset 메서드용)
|
|
@@ -81,12 +81,13 @@ type IsEnhancerOptional<
|
|
|
81
81
|
TSubsetMapping extends Record<TSubsetKey, any>,
|
|
82
82
|
TSubsetQueries extends Record<TSubsetKey, PuriSubsetFn>,
|
|
83
83
|
K extends TSubsetKey,
|
|
84
|
-
> =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
>
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
> =
|
|
85
|
+
TComputedResults[K] extends OmitVirtualQueryFromMapping<
|
|
86
|
+
TSubsetMapping[K],
|
|
87
|
+
ExtractVirtualQueryKeys<TSubsetQueries>
|
|
88
|
+
>
|
|
89
|
+
? true
|
|
90
|
+
: false;
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
93
|
* 단일 Enhancer 함수 타입
|
package/src/database/db.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { AsyncLocalStorage } from "async_hooks";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import type
|
|
3
|
+
|
|
4
|
+
import { type Knex } from "knex";
|
|
5
|
+
|
|
6
|
+
import { type DatabaseConfig, type SonamuConfig } from "../api/config";
|
|
7
7
|
import { createKnexInstance } from "./knex";
|
|
8
8
|
import { TransactionContext } from "./transaction-context";
|
|
9
9
|
|
|
@@ -11,8 +11,37 @@ import { TransactionContext } from "./transaction-context";
|
|
|
11
11
|
* 여러 설정 객체를 순차적으로 deep merge합니다.
|
|
12
12
|
* undefined/null인 인자는 무시됩니다.
|
|
13
13
|
*/
|
|
14
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
15
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function mergeRecord(
|
|
19
|
+
target: Record<string, unknown>,
|
|
20
|
+
source: Record<string, unknown>,
|
|
21
|
+
): Record<string, unknown> {
|
|
22
|
+
for (const [key, value] of Object.entries(source)) {
|
|
23
|
+
const currentValue = target[key];
|
|
24
|
+
|
|
25
|
+
if (isPlainObject(currentValue) && isPlainObject(value)) {
|
|
26
|
+
target[key] = mergeRecord({ ...currentValue }, value);
|
|
27
|
+
} else {
|
|
28
|
+
target[key] = value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
34
|
+
|
|
14
35
|
function mergeConfigs<T extends object>(...configs: (Partial<T> | undefined | null)[]): T {
|
|
15
|
-
|
|
36
|
+
const merged: Record<string, unknown> = {};
|
|
37
|
+
|
|
38
|
+
for (const config of configs) {
|
|
39
|
+
if (config !== undefined && config !== null) {
|
|
40
|
+
mergeRecord(merged, config as Record<string, unknown>);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return merged as T;
|
|
16
45
|
}
|
|
17
46
|
|
|
18
47
|
export type DBPreset = "w" | "r";
|
|
@@ -30,6 +59,7 @@ export class DBClass {
|
|
|
30
59
|
private wdb?: Knex;
|
|
31
60
|
private rdb?: Knex;
|
|
32
61
|
private workerDBs: Map<number, Knex> = new Map();
|
|
62
|
+
private currentConfig: SonamuDBConfig | null = null;
|
|
33
63
|
|
|
34
64
|
public transactionStorage = new AsyncLocalStorage<TransactionContext>();
|
|
35
65
|
|
|
@@ -37,12 +67,24 @@ export class DBClass {
|
|
|
37
67
|
return this.transactionStorage.run(new TransactionContext(), callback);
|
|
38
68
|
}
|
|
39
69
|
|
|
70
|
+
setConfig(dbConfig: SonamuDBConfig): void {
|
|
71
|
+
this.currentConfig = dbConfig;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private getCurrentConfig(): SonamuDBConfig {
|
|
75
|
+
if (this.currentConfig === null) {
|
|
76
|
+
throw new Error("Sonamu DB config has not been initialized");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return this.currentConfig;
|
|
80
|
+
}
|
|
81
|
+
|
|
40
82
|
public getTransactionContext(): TransactionContext {
|
|
41
83
|
return this.transactionStorage.getStore() ?? new TransactionContext();
|
|
42
84
|
}
|
|
43
85
|
|
|
44
86
|
getDB(which: DBPreset): Knex {
|
|
45
|
-
const dbConfig =
|
|
87
|
+
const dbConfig = this.getCurrentConfig();
|
|
46
88
|
|
|
47
89
|
// 테스트 트랜잭션 격리
|
|
48
90
|
if (process.env.NODE_ENV === "test") {
|
|
@@ -115,7 +157,7 @@ export class DBClass {
|
|
|
115
157
|
}
|
|
116
158
|
|
|
117
159
|
getDBConfig(which: DBPreset): Knex.Config {
|
|
118
|
-
const dbConfig =
|
|
160
|
+
const dbConfig = this.getCurrentConfig();
|
|
119
161
|
if (process.env.NODE_ENV === "test") {
|
|
120
162
|
return {
|
|
121
163
|
...dbConfig.test,
|
|
@@ -158,7 +200,7 @@ export class DBClass {
|
|
|
158
200
|
}
|
|
159
201
|
|
|
160
202
|
public generateDBConfig(config: SonamuConfig["database"]): SonamuDBConfig {
|
|
161
|
-
const defaultKnexConfig
|
|
203
|
+
const defaultKnexConfig = mergeConfigs<Partial<DatabaseConfig>>(
|
|
162
204
|
{
|
|
163
205
|
client: "postgresql",
|
|
164
206
|
pool: {
|
|
@@ -170,38 +212,31 @@ export class DBClass {
|
|
|
170
212
|
},
|
|
171
213
|
connection: {
|
|
172
214
|
database: config.name,
|
|
173
|
-
...config.defaultOptions?.connection,
|
|
174
215
|
},
|
|
175
216
|
},
|
|
176
217
|
config.defaultOptions,
|
|
177
218
|
);
|
|
178
219
|
|
|
179
|
-
//
|
|
220
|
+
// oxfmt-ignore -- 설정 구조 가독성을 위해 여러 줄로 유지
|
|
180
221
|
return {
|
|
181
222
|
// 여기에 나열한 순서대로 Sonamu UI의 DB Migration 탭에 표시됩니다.
|
|
182
223
|
test: mergeConfigs(
|
|
183
|
-
defaultKnexConfig,
|
|
224
|
+
defaultKnexConfig,
|
|
184
225
|
{ connection: { database: `${config.name}_test` } },
|
|
185
|
-
config.environments?.test
|
|
226
|
+
config.environments?.test,
|
|
186
227
|
),
|
|
187
228
|
fixture: mergeConfigs(
|
|
188
|
-
defaultKnexConfig,
|
|
229
|
+
defaultKnexConfig,
|
|
189
230
|
{ connection: { database: `${config.name}_fixture` } },
|
|
190
231
|
config.environments?.fixture,
|
|
191
232
|
),
|
|
192
|
-
development_master: mergeConfigs(
|
|
193
|
-
defaultKnexConfig,
|
|
194
|
-
config.environments?.development
|
|
195
|
-
),
|
|
233
|
+
development_master: mergeConfigs(defaultKnexConfig, config.environments?.development),
|
|
196
234
|
development_slave: mergeConfigs(
|
|
197
235
|
defaultKnexConfig,
|
|
198
236
|
config.environments?.development,
|
|
199
237
|
config.environments?.development_slave,
|
|
200
238
|
),
|
|
201
|
-
production_master: mergeConfigs(
|
|
202
|
-
defaultKnexConfig,
|
|
203
|
-
config.environments?.production
|
|
204
|
-
),
|
|
239
|
+
production_master: mergeConfigs(defaultKnexConfig, config.environments?.production),
|
|
205
240
|
production_slave: mergeConfigs(
|
|
206
241
|
defaultKnexConfig,
|
|
207
242
|
config.environments?.production,
|
package/src/database/knex.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Knex } from "knex";
|
|
2
2
|
import knex from "knex";
|
|
3
3
|
|
|
4
4
|
export function createKnexInstance(config: Knex.Config): Knex {
|
|
@@ -12,7 +12,7 @@ export function createKnexInstance(config: Knex.Config): Knex {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
config.pool = {
|
|
15
|
-
...
|
|
15
|
+
...config.pool,
|
|
16
16
|
propagateCreateError: false,
|
|
17
17
|
idleTimeoutMillis: 10000,
|
|
18
18
|
reapIntervalMillis: 1000,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { describe, expectTypeOf, it } from "vitest";
|
|
2
|
-
import type { DatabaseSchemaExtend } from "../types/types";
|
|
3
|
-
import type { Puri } from "./puri";
|
|
4
|
-
import type { Hydrate, InferAllSubsets, LoadersResult } from "./puri-subset.types";
|
|
5
|
-
import type { PuriWrapper } from "./puri-wrapper";
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
import { type DatabaseSchemaExtend } from "../types/types";
|
|
4
|
+
import { type Puri } from "./puri";
|
|
5
|
+
import { type Hydrate, type InferAllSubsets, type LoadersResult } from "./puri-subset.types";
|
|
6
|
+
import { type PuriWrapper } from "./puri-wrapper";
|
|
7
|
+
|
|
8
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- Puri Subset 타입 시스템에서 any를 허용함
|
|
8
9
|
type MockPuri<T> = Puri<DatabaseSchemaExtend, any, T>;
|
|
9
10
|
|
|
10
11
|
describe("Hydrate", () => {
|
|
@@ -108,7 +109,7 @@ describe("Hydrate", () => {
|
|
|
108
109
|
describe("LoadersResult", () => {
|
|
109
110
|
it("단일 로더의 결과 타입을 생성한다", () => {
|
|
110
111
|
type MockLoaderQb = (
|
|
111
|
-
qbWrapper: PuriWrapper
|
|
112
|
+
qbWrapper: PuriWrapper,
|
|
112
113
|
fromIds: number[] | string[],
|
|
113
114
|
) => MockPuri<{ id: number; title: string; refId: number }>;
|
|
114
115
|
|
|
@@ -128,12 +129,12 @@ describe("LoadersResult", () => {
|
|
|
128
129
|
|
|
129
130
|
it("중첩 로더를 처리한다", () => {
|
|
130
131
|
type CommentLoaderQb = (
|
|
131
|
-
qbWrapper: PuriWrapper
|
|
132
|
+
qbWrapper: PuriWrapper,
|
|
132
133
|
fromIds: number[] | string[],
|
|
133
134
|
) => MockPuri<{ id: number; content: string; refId: number }>;
|
|
134
135
|
|
|
135
136
|
type PostLoaderQb = (
|
|
136
|
-
qbWrapper: PuriWrapper
|
|
137
|
+
qbWrapper: PuriWrapper,
|
|
137
138
|
fromIds: number[] | string[],
|
|
138
139
|
) => MockPuri<{ id: number; title: string; refId: number }>;
|
|
139
140
|
|
|
@@ -162,12 +163,12 @@ describe("LoadersResult", () => {
|
|
|
162
163
|
|
|
163
164
|
it("중첩 로더의 as 경로도 hydrate한다", () => {
|
|
164
165
|
type IngredientLoaderQb = (
|
|
165
|
-
qbWrapper: PuriWrapper
|
|
166
|
+
qbWrapper: PuriWrapper,
|
|
166
167
|
fromIds: number[] | string[],
|
|
167
168
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
168
169
|
|
|
169
170
|
type PrescriptionItemLoaderQb = (
|
|
170
|
-
qbWrapper: PuriWrapper
|
|
171
|
+
qbWrapper: PuriWrapper,
|
|
171
172
|
fromIds: number[] | string[],
|
|
172
173
|
) => MockPuri<{
|
|
173
174
|
id: number;
|
|
@@ -210,7 +211,7 @@ describe("LoadersResult", () => {
|
|
|
210
211
|
as: "projects";
|
|
211
212
|
refId: "id";
|
|
212
213
|
qb: (
|
|
213
|
-
qbWrapper: PuriWrapper
|
|
214
|
+
qbWrapper: PuriWrapper,
|
|
214
215
|
fromIds: number[] | string[],
|
|
215
216
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
216
217
|
};
|
|
@@ -218,7 +219,7 @@ describe("LoadersResult", () => {
|
|
|
218
219
|
as: "department";
|
|
219
220
|
refId: "id";
|
|
220
221
|
qb: (
|
|
221
|
-
qbWrapper: PuriWrapper
|
|
222
|
+
qbWrapper: PuriWrapper,
|
|
222
223
|
fromIds: number[] | string[],
|
|
223
224
|
) => MockPuri<{ id: number; name: string; company_name: string; refId: number }>;
|
|
224
225
|
};
|
|
@@ -226,7 +227,7 @@ describe("LoadersResult", () => {
|
|
|
226
227
|
as: "employees";
|
|
227
228
|
refId: "id";
|
|
228
229
|
qb: (
|
|
229
|
-
qbWrapper: PuriWrapper
|
|
230
|
+
qbWrapper: PuriWrapper,
|
|
230
231
|
fromIds: number[] | string[],
|
|
231
232
|
) => MockPuri<{ id: number; employee_number: string; refId: number }>;
|
|
232
233
|
loaders: [
|
|
@@ -234,7 +235,7 @@ describe("LoadersResult", () => {
|
|
|
234
235
|
as: "user";
|
|
235
236
|
refId: "id";
|
|
236
237
|
qb: (
|
|
237
|
-
qbWrapper: PuriWrapper
|
|
238
|
+
qbWrapper: PuriWrapper,
|
|
238
239
|
fromIds: number[] | string[],
|
|
239
240
|
) => MockPuri<{ id: number; name: string; email: string; refId: number }>;
|
|
240
241
|
},
|
|
@@ -264,7 +265,7 @@ describe("InferAllSubsets", () => {
|
|
|
264
265
|
describe("서브셋이 하나인 경우", () => {
|
|
265
266
|
it("로더 없이 기본 Subset 결과를 추론한다", () => {
|
|
266
267
|
// SubsetQuery
|
|
267
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
268
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
268
269
|
id: number;
|
|
269
270
|
user__name: string;
|
|
270
271
|
user__email: string;
|
|
@@ -295,7 +296,7 @@ describe("InferAllSubsets", () => {
|
|
|
295
296
|
|
|
296
297
|
it("로더를 포함한 Subset 결과를 추론한다", () => {
|
|
297
298
|
// SubsetQuery
|
|
298
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
299
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
299
300
|
id: number;
|
|
300
301
|
company__id: number;
|
|
301
302
|
company__name: string;
|
|
@@ -311,7 +312,7 @@ describe("InferAllSubsets", () => {
|
|
|
311
312
|
as: "company__departments";
|
|
312
313
|
refId: "company__id";
|
|
313
314
|
qb: (
|
|
314
|
-
qbWrapper: PuriWrapper
|
|
315
|
+
qbWrapper: PuriWrapper,
|
|
315
316
|
fromIds: number[] | string[],
|
|
316
317
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
317
318
|
};
|
|
@@ -319,7 +320,7 @@ describe("InferAllSubsets", () => {
|
|
|
319
320
|
as: "department__projects";
|
|
320
321
|
refId: "department__id";
|
|
321
322
|
qb: (
|
|
322
|
-
qbWrapper: PuriWrapper
|
|
323
|
+
qbWrapper: PuriWrapper,
|
|
323
324
|
fromIds: number[] | string[],
|
|
324
325
|
) => MockPuri<{ id: number; name: string; status: string; refId: number }>;
|
|
325
326
|
};
|
|
@@ -347,7 +348,7 @@ describe("InferAllSubsets", () => {
|
|
|
347
348
|
|
|
348
349
|
it("중첩 로더를 포함한 Subset 결과를 추론한다", () => {
|
|
349
350
|
// SubsetQuery
|
|
350
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
351
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
351
352
|
id: number;
|
|
352
353
|
company__name: string;
|
|
353
354
|
}>;
|
|
@@ -360,7 +361,7 @@ describe("InferAllSubsets", () => {
|
|
|
360
361
|
as: "company__departments";
|
|
361
362
|
refId: "company__id";
|
|
362
363
|
qb: (
|
|
363
|
-
qbWrapper: PuriWrapper
|
|
364
|
+
qbWrapper: PuriWrapper,
|
|
364
365
|
fromIds: number[] | string[],
|
|
365
366
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
366
367
|
loaders: [
|
|
@@ -368,7 +369,7 @@ describe("InferAllSubsets", () => {
|
|
|
368
369
|
as: "projects";
|
|
369
370
|
refId: "id";
|
|
370
371
|
qb: (
|
|
371
|
-
qbWrapper: PuriWrapper
|
|
372
|
+
qbWrapper: PuriWrapper,
|
|
372
373
|
fromIds: number[] | string[],
|
|
373
374
|
) => MockPuri<{ id: number; name: string; status: string; refId: number }>;
|
|
374
375
|
},
|
|
@@ -398,7 +399,7 @@ describe("InferAllSubsets", () => {
|
|
|
398
399
|
});
|
|
399
400
|
|
|
400
401
|
it("중첩 로더 경로 alias를 포함한 Subset 결과를 추론한다", () => {
|
|
401
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
402
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
402
403
|
id: number;
|
|
403
404
|
root__id: number;
|
|
404
405
|
}>;
|
|
@@ -410,7 +411,7 @@ describe("InferAllSubsets", () => {
|
|
|
410
411
|
as: "root__items";
|
|
411
412
|
refId: "root__id";
|
|
412
413
|
qb: (
|
|
413
|
-
qbWrapper: PuriWrapper
|
|
414
|
+
qbWrapper: PuriWrapper,
|
|
414
415
|
fromIds: number[] | string[],
|
|
415
416
|
) => MockPuri<{
|
|
416
417
|
id: number;
|
|
@@ -423,7 +424,7 @@ describe("InferAllSubsets", () => {
|
|
|
423
424
|
as: "test__inner_items";
|
|
424
425
|
refId: "test__id";
|
|
425
426
|
qb: (
|
|
426
|
-
qbWrapper: PuriWrapper
|
|
427
|
+
qbWrapper: PuriWrapper,
|
|
427
428
|
fromIds: number[] | string[],
|
|
428
429
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
429
430
|
},
|
|
@@ -458,18 +459,18 @@ describe("InferAllSubsets", () => {
|
|
|
458
459
|
describe("서브셋이 여러 개인 경우", () => {
|
|
459
460
|
it("로더 없이 기본 Subset 결과를 추론한다", () => {
|
|
460
461
|
// SubsetQuery
|
|
461
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
462
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
462
463
|
id: number;
|
|
463
464
|
name: string;
|
|
464
465
|
email: string;
|
|
465
466
|
department__name: string;
|
|
466
467
|
}>;
|
|
467
|
-
type SubsetFnP = (qbWrapper: PuriWrapper
|
|
468
|
+
type SubsetFnP = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
468
469
|
id: number;
|
|
469
470
|
name: string;
|
|
470
471
|
department__name: string;
|
|
471
472
|
}>;
|
|
472
|
-
type SubsetFnSS = (qbWrapper: PuriWrapper
|
|
473
|
+
type SubsetFnSS = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
473
474
|
id: number;
|
|
474
475
|
name: string;
|
|
475
476
|
email: string;
|
|
@@ -501,18 +502,18 @@ describe("InferAllSubsets", () => {
|
|
|
501
502
|
|
|
502
503
|
it("로더를 포함한 Subset 결과를 추론한다", () => {
|
|
503
504
|
// SubsetQuery
|
|
504
|
-
type SubsetFnA = (qbWrapper: PuriWrapper
|
|
505
|
+
type SubsetFnA = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
505
506
|
id: number;
|
|
506
507
|
name: string;
|
|
507
508
|
email: string;
|
|
508
509
|
department__name: string;
|
|
509
510
|
}>;
|
|
510
|
-
type SubsetFnP = (qbWrapper: PuriWrapper
|
|
511
|
+
type SubsetFnP = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
511
512
|
id: number;
|
|
512
513
|
name: string;
|
|
513
514
|
department__name: string;
|
|
514
515
|
}>;
|
|
515
|
-
type SubsetFnSS = (qbWrapper: PuriWrapper
|
|
516
|
+
type SubsetFnSS = (qbWrapper: PuriWrapper) => MockPuri<{
|
|
516
517
|
id: number;
|
|
517
518
|
name: string;
|
|
518
519
|
email: string;
|
|
@@ -529,7 +530,7 @@ describe("InferAllSubsets", () => {
|
|
|
529
530
|
as: "projects";
|
|
530
531
|
refId: "id";
|
|
531
532
|
qb: (
|
|
532
|
-
qbWrapper: PuriWrapper
|
|
533
|
+
qbWrapper: PuriWrapper,
|
|
533
534
|
fromIds: number[] | string[],
|
|
534
535
|
) => MockPuri<{ id: number; name: string; status: string; refId: number }>;
|
|
535
536
|
loaders: [
|
|
@@ -537,7 +538,7 @@ describe("InferAllSubsets", () => {
|
|
|
537
538
|
as: "tags";
|
|
538
539
|
refId: "id";
|
|
539
540
|
qb: (
|
|
540
|
-
qbWrapper: PuriWrapper
|
|
541
|
+
qbWrapper: PuriWrapper,
|
|
541
542
|
fromIds: number[] | string[],
|
|
542
543
|
) => MockPuri<{ id: number; name: string; refId: number }>;
|
|
543
544
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */ // Puri Subset 타입 시스템에서 any를 허용함
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Puri Subset 타입 시스템
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
* - Hydrate: flat한 결과를 중첩 객체로 변환 (예: user__name → { user: { name } })
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type
|
|
14
|
-
import type
|
|
15
|
-
import type
|
|
16
|
-
import type { PuriWrapper } from "./puri-wrapper";
|
|
13
|
+
import { type Puri } from "./puri";
|
|
14
|
+
import { type PuriWrapper } from "./puri-wrapper";
|
|
15
|
+
import { type Expand } from "./puri.types";
|
|
17
16
|
|
|
18
17
|
// ============================================================================
|
|
19
18
|
// 기본 타입 정의
|
|
@@ -23,7 +22,7 @@ import type { PuriWrapper } from "./puri-wrapper";
|
|
|
23
22
|
* SubsetQuery 함수 시그니처
|
|
24
23
|
* PuriWrapper를 받아 Puri 쿼리 빌더를 반환
|
|
25
24
|
*/
|
|
26
|
-
export type PuriSubsetFn = (qbWrapper: PuriWrapper
|
|
25
|
+
export type PuriSubsetFn = (qbWrapper: PuriWrapper) => Puri<any, any, any>;
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Puri 인스턴스에서 TResult 타입 추출
|
|
@@ -40,7 +39,7 @@ export type ExtractPuriResult<T> = T extends Puri<any, any, infer R> ? R : never
|
|
|
40
39
|
* @param fromIds - 부모 레코드 ID 배열
|
|
41
40
|
*/
|
|
42
41
|
export type PuriLoaderQbFn = (
|
|
43
|
-
qbWrapper: PuriWrapper
|
|
42
|
+
qbWrapper: PuriWrapper,
|
|
44
43
|
fromIds: number[] | string[],
|
|
45
44
|
) => Puri<any, any, any>;
|
|
46
45
|
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */ // PuriWrapper는 다양한 타입을 사용하고 있습니다.
|
|
2
2
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
import type
|
|
4
|
+
import { type Knex } from "knex";
|
|
5
|
+
|
|
6
|
+
import { type DatabaseSchemaExtend } from "../types/types";
|
|
7
|
+
import { type DBPreset } from "./db";
|
|
7
8
|
import { Puri } from "./puri";
|
|
8
|
-
import
|
|
9
|
-
|
|
9
|
+
import {
|
|
10
|
+
type ColumnKeys,
|
|
11
|
+
type IdType,
|
|
12
|
+
type OmitInternalTypeKeys,
|
|
13
|
+
type PuriTable,
|
|
14
|
+
} from "./puri.types";
|
|
15
|
+
import {
|
|
16
|
+
type InsertOnlyOptions,
|
|
17
|
+
type UBRef,
|
|
18
|
+
type UpsertBuilder,
|
|
19
|
+
type UpsertOptions,
|
|
20
|
+
} from "./upsert-builder";
|
|
10
21
|
|
|
11
22
|
type TableName<TSchema extends DatabaseSchemaExtend> = Extract<keyof TSchema, string>;
|
|
12
23
|
|
|
@@ -35,21 +46,17 @@ export class PuriWrapper<TSchema extends DatabaseSchemaExtend = DatabaseSchemaEx
|
|
|
35
46
|
OmitInternalTypeKeys<PuriTable<TSchema[TTable]>>
|
|
36
47
|
>;
|
|
37
48
|
// 테이블명 + Alias로 시작
|
|
38
|
-
from<TTable extends keyof TSchema, TAlias extends string>(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
): Puri<
|
|
49
|
+
from<TTable extends keyof TSchema, TAlias extends string>(spec: {
|
|
50
|
+
[K in TAlias]: TTable;
|
|
51
|
+
}): Puri<
|
|
43
52
|
TSchema,
|
|
44
53
|
Record<TAlias, PuriTable<TSchema[TTable]>>,
|
|
45
54
|
OmitInternalTypeKeys<PuriTable<TSchema[TTable]>>
|
|
46
55
|
>;
|
|
47
56
|
// 서브쿼리로 시작
|
|
48
|
-
from<TAlias extends string, TSubResult>(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
): Puri<
|
|
57
|
+
from<TAlias extends string, TSubResult>(spec: {
|
|
58
|
+
[K in TAlias]: Puri<TSchema, any, TSubResult>;
|
|
59
|
+
}): Puri<
|
|
53
60
|
TSchema,
|
|
54
61
|
Record<TAlias, PuriTable<TSubResult>>,
|
|
55
62
|
OmitInternalTypeKeys<PuriTable<TSubResult>>
|
|
@@ -67,21 +74,17 @@ export class PuriWrapper<TSchema extends DatabaseSchemaExtend = DatabaseSchemaEx
|
|
|
67
74
|
OmitInternalTypeKeys<PuriTable<TSchema[TTable]>>
|
|
68
75
|
>;
|
|
69
76
|
// 테이블명 + Alias로 시작
|
|
70
|
-
table<TTable extends keyof TSchema, TAlias extends string>(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
): Puri<
|
|
77
|
+
table<TTable extends keyof TSchema, TAlias extends string>(spec: {
|
|
78
|
+
[K in TAlias]: TTable;
|
|
79
|
+
}): Puri<
|
|
75
80
|
TSchema,
|
|
76
81
|
Record<TAlias, PuriTable<TSchema[TTable]>>,
|
|
77
82
|
OmitInternalTypeKeys<PuriTable<TSchema[TTable]>>
|
|
78
83
|
>;
|
|
79
84
|
// 서브쿼리로 시작
|
|
80
|
-
table<TAlias extends string, TSubResult>(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
): Puri<
|
|
85
|
+
table<TAlias extends string, TSubResult>(spec: {
|
|
86
|
+
[K in TAlias]: Puri<TSchema, any, TSubResult>;
|
|
87
|
+
}): Puri<
|
|
85
88
|
TSchema,
|
|
86
89
|
Record<TAlias, PuriTable<TSubResult>>,
|
|
87
90
|
OmitInternalTypeKeys<PuriTable<TSubResult>>
|
package/src/database/puri.ts
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
/** biome-ignore-all lint/suspicious/noExplicitAny: Puri는 다양한 타입을 사용하고 있습니다. */
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */ // Puri는 다양한 타입을 사용하고 있습니다.
|
|
3
2
|
|
|
4
3
|
import assert from "assert";
|
|
4
|
+
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import inflection from "inflection";
|
|
7
|
-
import type
|
|
8
|
-
|
|
7
|
+
import { type Knex } from "knex";
|
|
8
|
+
|
|
9
|
+
import { EntityManager } from "../entity/entity-manager";
|
|
10
|
+
import { type TableSpec } from "../entity/entity-manager";
|
|
9
11
|
import { Naite } from "../naite/naite";
|
|
10
|
-
import type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
12
|
+
import { type ClearStatements } from "./puri-subset.types";
|
|
13
|
+
import {
|
|
14
|
+
type AvailableColumns,
|
|
15
|
+
type ColumnKeys,
|
|
16
|
+
type ComparisonOperator,
|
|
17
|
+
type Expand,
|
|
18
|
+
type ExtractColumnType,
|
|
19
|
+
type FulltextColumns,
|
|
20
|
+
type FuzzyOperator,
|
|
21
|
+
type InsertData,
|
|
22
|
+
type InsertResult,
|
|
23
|
+
type LeftJoinedMarker,
|
|
24
|
+
type LeftJoinMarkerFor,
|
|
25
|
+
type NumericColumns,
|
|
26
|
+
type OnConflictAction,
|
|
27
|
+
type ParseSelectObject,
|
|
28
|
+
type ResultAvailableColumns,
|
|
29
|
+
type SelectAllResult,
|
|
30
|
+
type SelectObject,
|
|
31
|
+
type SingleTableValue,
|
|
32
|
+
type SqlExpression,
|
|
33
|
+
type TsHighlightOptions,
|
|
34
|
+
type TsQueryConfig,
|
|
35
|
+
type TsQueryOptions,
|
|
36
|
+
type TsRankOptions,
|
|
37
|
+
type VectorColumns,
|
|
38
|
+
type WhereCondition,
|
|
39
|
+
type WhereOperator,
|
|
37
40
|
} from "./puri.types";
|
|
38
41
|
import { FUZZY_OPERATORS } from "./puri.types";
|
|
39
|
-
import type { ClearStatements } from "./puri-subset.types";
|
|
40
42
|
|
|
41
43
|
function normalizeFuzzyOperator(operator?: string): FuzzyOperator {
|
|
42
44
|
const normalized = operator?.trim() ?? "<%";
|
|
@@ -481,7 +483,7 @@ export class Puri<TSchema, TTables extends Record<string, any>, TResult> {
|
|
|
481
483
|
// DISTINCT
|
|
482
484
|
distinct<TColumns extends AvailableColumns<TTables>>(...columns: TColumns[]): this;
|
|
483
485
|
distinct(...columns: string[]): this {
|
|
484
|
-
this.knexQuery.distinct(...
|
|
486
|
+
this.knexQuery.distinct(...columns);
|
|
485
487
|
return this;
|
|
486
488
|
}
|
|
487
489
|
|
|
@@ -988,7 +990,7 @@ export class Puri<TSchema, TTables extends Record<string, any>, TResult> {
|
|
|
988
990
|
// GROUP BY
|
|
989
991
|
groupBy<TColumns extends ResultAvailableColumns<TTables, TResult>>(...columns: TColumns[]): this;
|
|
990
992
|
groupBy(...columns: string[]): this {
|
|
991
|
-
this.knexQuery.groupBy(...
|
|
993
|
+
this.knexQuery.groupBy(...columns);
|
|
992
994
|
return this;
|
|
993
995
|
}
|
|
994
996
|
|