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
|
@@ -13,21 +13,21 @@ Sonamu supports pgvector-based vector search. It integrates both Voyage AI and O
|
|
|
13
13
|
|
|
14
14
|
## Structure
|
|
15
15
|
|
|
16
|
-
| File
|
|
17
|
-
|
|
18
|
-
| `types.ts`
|
|
19
|
-
| `config.ts`
|
|
20
|
-
| `embedding.ts` | Embedding client (Voyage AI and OpenAI integration)
|
|
21
|
-
| `chunking.ts`
|
|
16
|
+
| File | Role |
|
|
17
|
+
| -------------- | --------------------------------------------------------------------------------- |
|
|
18
|
+
| `types.ts` | Full type definitions (EmbeddingProvider, VectorSearchResult, VectorConfig, etc.) |
|
|
19
|
+
| `config.ts` | Default configuration values + `createVectorConfig()` helper |
|
|
20
|
+
| `embedding.ts` | Embedding client (Voyage AI and OpenAI integration) |
|
|
21
|
+
| `chunking.ts` | Text chunking (splitting long documents) |
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
## Embedding Providers
|
|
26
26
|
|
|
27
|
-
| Provider | Model
|
|
28
|
-
|
|
29
|
-
| `voyage` | `voyage-3`
|
|
30
|
-
| `openai` | `text-embedding-3-small` | 1536
|
|
27
|
+
| Provider | Model | Dimensions | maxTokens | batchSize | Package |
|
|
28
|
+
| -------- | ------------------------ | ---------- | --------- | --------- | ---------------- |
|
|
29
|
+
| `voyage` | `voyage-3` | 1024 | 32000 | 128 | `voyageai` |
|
|
30
|
+
| `openai` | `text-embedding-3-small` | 1536 | 8191 | 100 | `@ai-sdk/openai` |
|
|
31
31
|
|
|
32
32
|
### API Key Configuration
|
|
33
33
|
|
|
@@ -38,6 +38,7 @@ export OPENAI_API_KEY=sk-...
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Or in `sonamu.config.ts`:
|
|
41
|
+
|
|
41
42
|
```typescript
|
|
42
43
|
export default defineConfig({
|
|
43
44
|
secret: {
|
|
@@ -75,10 +76,10 @@ Embedding.getDimensions("openai"); // 1536
|
|
|
75
76
|
|
|
76
77
|
### Voyage AI inputType (Asymmetric Embedding)
|
|
77
78
|
|
|
78
|
-
| inputType
|
|
79
|
-
|
|
79
|
+
| inputType | Use case |
|
|
80
|
+
| ------------ | --------------------------------------- |
|
|
80
81
|
| `"document"` | When embedding documents to store in DB |
|
|
81
|
-
| `"query"`
|
|
82
|
+
| `"query"` | When embedding search queries |
|
|
82
83
|
|
|
83
84
|
**CRITICAL: Use `"document"` when storing and `"query"` when searching for asymmetric embedding to work correctly.**
|
|
84
85
|
|
|
@@ -92,31 +93,31 @@ Splits long documents into appropriately-sized pieces.
|
|
|
92
93
|
import { Chunking } from "sonamu/vector";
|
|
93
94
|
|
|
94
95
|
const chunker = new Chunking({
|
|
95
|
-
chunkSize: 500,
|
|
96
|
-
chunkOverlap: 50,
|
|
97
|
-
minChunkSize: 50,
|
|
96
|
+
chunkSize: 500, // Maximum chunk size (character count)
|
|
97
|
+
chunkOverlap: 50, // Overlap between chunks
|
|
98
|
+
minChunkSize: 50, // Minimum chunk size
|
|
98
99
|
});
|
|
99
100
|
|
|
100
101
|
// Check if chunking is needed
|
|
101
|
-
chunker.needsChunking("short text");
|
|
102
|
+
chunker.needsChunking("short text"); // false
|
|
102
103
|
|
|
103
104
|
// Split into chunks
|
|
104
105
|
const chunks = chunker.chunk(longText);
|
|
105
106
|
// chunks: [{ index: 0, text: "...", startOffset: 0, endOffset: 500 }, ...]
|
|
106
107
|
|
|
107
108
|
// Estimate number of chunks
|
|
108
|
-
chunker.estimateChunkCount(longText);
|
|
109
|
+
chunker.estimateChunkCount(longText); // 5
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
### Chunking Default Settings
|
|
112
113
|
|
|
113
|
-
| Option
|
|
114
|
-
|
|
115
|
-
| `chunkSize`
|
|
116
|
-
| `chunkOverlap`
|
|
117
|
-
| `minChunkSize`
|
|
118
|
-
| `skipThreshold` | 200
|
|
119
|
-
| `separators`
|
|
114
|
+
| Option | Default | Description |
|
|
115
|
+
| --------------- | --------------------------------- | -------------------------------------------------------- |
|
|
116
|
+
| `chunkSize` | 500 | Maximum chunk size (character count) |
|
|
117
|
+
| `chunkOverlap` | 50 | Overlap between chunks |
|
|
118
|
+
| `minChunkSize` | 50 | Minimum chunk size |
|
|
119
|
+
| `skipThreshold` | 200 | Passes through without chunking if at or below this size |
|
|
120
|
+
| `separators` | `["\n\n", "\n", "。", ". ", ...]` | Split delimiters (in priority order) |
|
|
120
121
|
|
|
121
122
|
---
|
|
122
123
|
|
|
@@ -128,13 +129,13 @@ import { createVectorConfig } from "sonamu/vector";
|
|
|
128
129
|
const config = createVectorConfig({
|
|
129
130
|
search: {
|
|
130
131
|
defaultLimit: 10,
|
|
131
|
-
similarityThreshold: 0.5,
|
|
132
|
-
vectorWeight: 0.7,
|
|
133
|
-
ftsWeight: 0.3,
|
|
132
|
+
similarityThreshold: 0.5, // Results below this value are excluded
|
|
133
|
+
vectorWeight: 0.7, // Vector weight in hybrid search
|
|
134
|
+
ftsWeight: 0.3, // FTS weight in hybrid search
|
|
134
135
|
},
|
|
135
136
|
pgvector: {
|
|
136
|
-
iterativeScan: true,
|
|
137
|
-
efSearch: 100,
|
|
137
|
+
iterativeScan: true, // Use pgvector iterative scan
|
|
138
|
+
efSearch: 100, // HNSW index search accuracy
|
|
138
139
|
},
|
|
139
140
|
});
|
|
140
141
|
```
|
|
@@ -166,10 +167,10 @@ interface HybridSearchResult<T> extends VectorSearchResult<T> {
|
|
|
166
167
|
|
|
167
168
|
```typescript
|
|
168
169
|
interface VectorSearchOptions {
|
|
169
|
-
embeddingColumn?: string;
|
|
170
|
+
embeddingColumn?: string; // Embedding column name (default: "embedding")
|
|
170
171
|
limit?: number;
|
|
171
|
-
threshold?: number;
|
|
172
|
-
where?: string;
|
|
172
|
+
threshold?: number; // Similarity threshold
|
|
173
|
+
where?: string; // SQL WHERE condition
|
|
173
174
|
}
|
|
174
175
|
```
|
|
175
176
|
|
|
@@ -177,9 +178,9 @@ interface VectorSearchOptions {
|
|
|
177
178
|
|
|
178
179
|
```typescript
|
|
179
180
|
interface HybridSearchOptions extends VectorSearchOptions {
|
|
180
|
-
vectorWeight?: number;
|
|
181
|
-
ftsWeight?: number;
|
|
182
|
-
ftsColumn?: string;
|
|
181
|
+
vectorWeight?: number; // Vector search weight
|
|
182
|
+
ftsWeight?: number; // FTS weight
|
|
183
|
+
ftsColumn?: string; // Target column name for FTS
|
|
183
184
|
}
|
|
184
185
|
```
|
|
185
186
|
|
package/src/ssr/index.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
clearSSRRoutes,
|
|
3
|
-
getSSRRoutes,
|
|
4
|
-
matchSSRRoute,
|
|
5
|
-
registerSSR,
|
|
6
|
-
} from "./registry";
|
|
1
|
+
export { clearSSRRoutes, getSSRRoutes, matchSSRRoute, registerSSR } from "./registry";
|
|
7
2
|
export { renderSSR } from "./renderer";
|
|
8
|
-
export type {
|
|
9
|
-
PreloadConfig,
|
|
10
|
-
PreloadedData,
|
|
11
|
-
SSRQuery,
|
|
12
|
-
SSRRoute,
|
|
13
|
-
} from "./types";
|
|
3
|
+
export type { PreloadConfig, PreloadedData, SSRQuery, SSRRoute } from "./types";
|
package/src/ssr/registry.ts
CHANGED
package/src/ssr/renderer.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
|
|
3
|
-
import type
|
|
2
|
+
|
|
3
|
+
import { type FastifyReply, type FastifyRequest } from "fastify";
|
|
4
|
+
import { type ViteDevServer } from "vite";
|
|
5
|
+
|
|
4
6
|
import { applyCacheHeaders } from "../cache-control/cache-control";
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
7
|
+
import { type CacheControlRequest } from "../cache-control/types";
|
|
8
|
+
import { type SonamuFastifyConfig } from "../types/types";
|
|
9
|
+
import { type PreloadedData, type SSRRoute } from "./types";
|
|
8
10
|
|
|
9
11
|
export async function renderSSR(
|
|
10
12
|
url: string,
|
package/src/ssr/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type CacheControlConfig } from "../cache-control/types";
|
|
2
|
+
import { type CompressConfig } from "../compress/types";
|
|
3
3
|
|
|
4
4
|
// Branded type - 실수로 일반 객체 사용 방지
|
|
5
5
|
export type SSRQuery = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { MultipartFile } from "@fastify/multipart";
|
|
2
1
|
import { createHash } from "crypto";
|
|
2
|
+
|
|
3
|
+
import { type MultipartFile } from "@fastify/multipart";
|
|
4
|
+
|
|
3
5
|
import { BaseFile } from "./base-file";
|
|
4
|
-
import type
|
|
6
|
+
import { type DriverKey } from "./drivers";
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Buffer 모드로 업로드된 파일
|
package/src/storage/drivers.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FSDriver } from "flydrive/drivers/fs";
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
2
|
+
import { type FSDriverOptions } from "flydrive/drivers/fs/types";
|
|
3
|
+
import { type S3DriverOptions } from "flydrive/drivers/s3/types";
|
|
4
|
+
|
|
4
5
|
import { SonamuS3Driver } from "./s3-driver";
|
|
5
6
|
|
|
6
7
|
/**
|
package/src/storage/s3-driver.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type Readable } from "stream";
|
|
2
|
+
|
|
3
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
4
|
+
import { type ObjectCannedACL } from "@aws-sdk/client-s3";
|
|
5
|
+
import { Upload } from "@aws-sdk/lib-storage";
|
|
6
|
+
import { type Options } from "@aws-sdk/lib-storage";
|
|
3
7
|
import { S3Driver } from "flydrive/drivers/s3";
|
|
4
|
-
import type
|
|
5
|
-
import type { Readable } from "stream";
|
|
8
|
+
import { type S3DriverOptions } from "flydrive/drivers/s3/types";
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Sonamu용 S3 드라이버
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Disk } from "flydrive";
|
|
2
|
+
|
|
2
3
|
import { assertDefined } from "../utils/utils";
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
4
|
+
import { type DriverKey } from "./drivers";
|
|
5
|
+
import { type StorageConfig } from "./types";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 여러 디스크를 관리하는 매니저
|
package/src/storage/types.ts
CHANGED
package/src/stream/sse.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type FastifyReply, type FastifyRequest } from "fastify";
|
|
2
|
+
import { type z } from "zod";
|
|
3
3
|
|
|
4
4
|
// NOTE(Haze, 251106): context provider에서 인자를 채워주면 createSSE(events)만으로 사용 가능
|
|
5
5
|
export function createSSEFactory<T extends z.ZodObject>(
|
package/src/syncer/api-parser.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { readFile } from "fs/promises";
|
|
3
|
+
|
|
3
4
|
import inflection from "inflection";
|
|
4
5
|
import ts from "typescript";
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
import { registeredApis } from "../api/decorators";
|
|
8
|
+
import { type ExtendedApi } from "../api/decorators";
|
|
6
9
|
import { validateMethodName } from "../api/validator";
|
|
7
|
-
import type
|
|
8
|
-
import type
|
|
10
|
+
import { type ApiParam, type ApiParamType } from "../types/types";
|
|
11
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* TypeScript 파일을 파싱하여 API 메소드 정보를 추출합니다.
|
|
@@ -43,7 +46,7 @@ export async function readApisFromFile(filePath: AbsolutePath): Promise<Extended
|
|
|
43
46
|
|
|
44
47
|
const typeParameters: ApiParamType.TypeParam[] = (node.typeParameters ?? []).map(
|
|
45
48
|
(typeParam) => {
|
|
46
|
-
const tp = typeParam
|
|
49
|
+
const tp = typeParam;
|
|
47
50
|
|
|
48
51
|
return {
|
|
49
52
|
t: "type-param",
|
|
@@ -186,7 +189,7 @@ function resolveTypeNode(typeNode: ts.TypeNode): ApiParamType {
|
|
|
186
189
|
name: {
|
|
187
190
|
escapedText: `[${res.name}${res.optional ? "?" : ""}: ${res.type}]`,
|
|
188
191
|
} as ts.Identifier,
|
|
189
|
-
type: member.type
|
|
192
|
+
type: member.type,
|
|
190
193
|
});
|
|
191
194
|
} else {
|
|
192
195
|
return resolveParamDec({
|
package/src/syncer/checksum.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import crypto
|
|
2
|
-
import
|
|
3
|
-
import { createReadStream
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import { type BinaryLike } from "crypto";
|
|
3
|
+
import { createReadStream } from "fs";
|
|
4
|
+
import { type PathLike } from "fs";
|
|
4
5
|
import { readFile, writeFile } from "fs/promises";
|
|
5
6
|
import path from "path";
|
|
7
|
+
|
|
8
|
+
import equal from "fast-deep-equal";
|
|
6
9
|
import { isEqual } from "radashi";
|
|
10
|
+
|
|
7
11
|
import { Sonamu } from "../api/sonamu";
|
|
8
12
|
import { globAsync } from "../utils/async-utils";
|
|
9
13
|
import { exists } from "../utils/fs-utils";
|
|
10
|
-
import type
|
|
14
|
+
import { type AbsolutePath, type ApiRelativePath } from "../utils/path-utils";
|
|
11
15
|
import { differenceWith } from "../utils/utils";
|
|
12
16
|
import { getChecksumPatternGroupInAbsolutePath } from "./file-patterns";
|
|
13
17
|
|
|
@@ -57,7 +61,7 @@ async function getCurrentChecksums(): Promise<PathAndChecksum[]> {
|
|
|
57
61
|
)
|
|
58
62
|
)
|
|
59
63
|
.flat()
|
|
60
|
-
.
|
|
64
|
+
.toSorted();
|
|
61
65
|
|
|
62
66
|
const fileChecksums = await Promise.all(
|
|
63
67
|
filePaths.map(async (filePath) => {
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
1
|
import { mkdir, writeFile } from "fs/promises";
|
|
3
2
|
import path from "path";
|
|
3
|
+
|
|
4
|
+
import chalk from "chalk";
|
|
4
5
|
import { unique } from "radashi";
|
|
6
|
+
|
|
5
7
|
import { Sonamu } from "../api/sonamu";
|
|
6
8
|
import { SD } from "../dict/sd";
|
|
7
9
|
import { EntityManager } from "../entity/entity-manager";
|
|
8
10
|
import { AlreadyProcessedException } from "../exceptions/so-exceptions";
|
|
9
11
|
import { Naite } from "../naite/naite";
|
|
10
|
-
import type
|
|
12
|
+
import { type RenderedTemplate } from "../template/template";
|
|
11
13
|
import { TemplateManager } from "../template/template-manager";
|
|
12
14
|
import { BUILT_IN_TYPES } from "../template/zod-converter";
|
|
13
|
-
import
|
|
15
|
+
import {
|
|
16
|
+
type GenerateOptions,
|
|
17
|
+
type PathAndCode,
|
|
18
|
+
type TemplateKey,
|
|
19
|
+
type TemplateOptions,
|
|
20
|
+
} from "../types/types";
|
|
14
21
|
import { everyAsync, filterAsync } from "../utils/async-utils";
|
|
15
22
|
import { isTest } from "../utils/controller";
|
|
16
23
|
import { formatCode } from "../utils/formatter";
|
|
17
24
|
import { exists } from "../utils/fs-utils";
|
|
18
25
|
import { wrapIf } from "../utils/lodash-able";
|
|
19
|
-
import type
|
|
26
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
20
27
|
|
|
21
28
|
/**
|
|
22
29
|
* 템플릿을 렌더링하고 파일로 생성합니다.
|
|
@@ -50,7 +57,7 @@ export async function generateTemplate<T extends TemplateKey>(
|
|
|
50
57
|
).flat();
|
|
51
58
|
|
|
52
59
|
const filteredPathAndCodes: PathAndCode[] = await (async () => {
|
|
53
|
-
if (generateOptions.overwrite
|
|
60
|
+
if (generateOptions.overwrite) {
|
|
54
61
|
return pathAndCodes;
|
|
55
62
|
} else {
|
|
56
63
|
return await filterAsync(pathAndCodes, async (pathAndCode) => {
|
|
@@ -126,12 +133,13 @@ async function resolveRenderedTemplate(
|
|
|
126
133
|
} catch (error) {
|
|
127
134
|
throw new Error(
|
|
128
135
|
`[resolveRenderedTemplate:${key}] ${importKey} 모듈 경로 찾기 실패: ${error}`,
|
|
136
|
+
{ cause: error },
|
|
129
137
|
);
|
|
130
138
|
}
|
|
131
139
|
let importPath = modulePath;
|
|
132
140
|
if (modulePath.includes("/") || modulePath.includes(".")) {
|
|
133
141
|
importPath = wrapIf(path.relative(path.dirname(filePath), modulePath), (p) => [
|
|
134
|
-
p.startsWith(".")
|
|
142
|
+
!p.startsWith("."),
|
|
135
143
|
`./${p}`,
|
|
136
144
|
]);
|
|
137
145
|
}
|
|
@@ -154,7 +162,7 @@ async function resolveRenderedTemplate(
|
|
|
154
162
|
}[],
|
|
155
163
|
)
|
|
156
164
|
// 셀프 참조 방지
|
|
157
|
-
.filter((importDef) => filePath.endsWith(`${importDef.from.replace("./", "")}.ts`)
|
|
165
|
+
.filter((importDef) => !filePath.endsWith(`${importDef.from.replace("./", "")}.ts`));
|
|
158
166
|
|
|
159
167
|
// 커스텀 헤더 포함하여 헤더 생성
|
|
160
168
|
const header = [
|
|
@@ -169,7 +177,7 @@ async function resolveRenderedTemplate(
|
|
|
169
177
|
return [header, body].join("\n\n");
|
|
170
178
|
} else {
|
|
171
179
|
Naite.t("resolveRenderedTemplate:beforeFormat", { key, header, body });
|
|
172
|
-
const formatted = formatCode(
|
|
180
|
+
const formatted = await formatCode(
|
|
173
181
|
[header, body].join("\n\n"),
|
|
174
182
|
key === "entity" ? "json" : "typescript",
|
|
175
183
|
`${Sonamu.appRootPath}/${filePath}`,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
1
|
import { rm } from "fs/promises";
|
|
2
|
+
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
|
|
3
5
|
import { Sonamu } from "../api/sonamu";
|
|
4
6
|
import { SD } from "../dict/sd";
|
|
5
7
|
import { EntityManager } from "../entity/entity-manager";
|
|
6
8
|
import { BadRequestException } from "../exceptions/so-exceptions";
|
|
7
|
-
import type
|
|
9
|
+
import { type TemplateOptions } from "../types/types";
|
|
8
10
|
import { isTest } from "../utils/controller";
|
|
9
11
|
import { exists } from "../utils/fs-utils";
|
|
10
12
|
import { generateTemplate } from "./code-generator";
|
|
@@ -50,7 +52,7 @@ export async function delEntity(entityId: string): Promise<{ delPaths: string[]
|
|
|
50
52
|
}
|
|
51
53
|
})(); // iife
|
|
52
54
|
|
|
53
|
-
for
|
|
55
|
+
for (const delPath of delPaths) {
|
|
54
56
|
if (await exists(delPath)) {
|
|
55
57
|
!isTest() && console.log(chalk.red(`DELETE ${delPath}`));
|
|
56
58
|
await rm(delPath, { recursive: true, force: true });
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
+
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
import type
|
|
4
|
+
|
|
5
|
+
import { type BaseFrameClass } from "../api/base-frame";
|
|
6
|
+
import { type ApiDecoratorOptions } from "../api/decorators";
|
|
5
7
|
import { Sonamu } from "../api/sonamu";
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
8
|
-
import type
|
|
8
|
+
import { type BaseModelClass } from "../database/base-model";
|
|
9
|
+
import { type WorkflowMetadata } from "../tasks/decorator";
|
|
10
|
+
import { type ApiParam, type ApiParamType } from "../types/types";
|
|
9
11
|
import { globAsync } from "../utils/async-utils";
|
|
10
12
|
import { importMembers } from "../utils/esm-utils";
|
|
11
|
-
import {
|
|
13
|
+
import { runtimePath } from "../utils/path-utils";
|
|
14
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
12
15
|
import { readApisFromFile } from "./api-parser";
|
|
13
16
|
|
|
14
17
|
export type LoadedApis = {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
-
import chalk from "chalk";
|
|
3
2
|
import { mkdir, writeFile } from "fs/promises";
|
|
4
3
|
import path, { dirname } from "path";
|
|
4
|
+
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
|
|
5
7
|
import { Sonamu } from "../api/sonamu";
|
|
6
|
-
import type
|
|
8
|
+
import { type EntityNamesRecord } from "../entity/entity-manager";
|
|
7
9
|
import { Naite } from "../naite/naite";
|
|
8
10
|
import { isTest } from "../utils/controller";
|
|
9
11
|
import { copyFileWithReplaceCoreToShared, exists } from "../utils/fs-utils";
|
|
10
|
-
import type
|
|
12
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
11
13
|
import { generateTemplate } from "./code-generator";
|
|
12
14
|
|
|
13
15
|
// web/.sonamu.env 에 현재 설정값 저장
|
package/src/syncer/syncer.ts
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
import { hot } from "@sonamu-kit/hmr-hook";
|
|
2
1
|
import assert from "assert";
|
|
3
|
-
import chalk from "chalk";
|
|
4
2
|
import { EventEmitter } from "events";
|
|
5
3
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
4
|
+
import path from "path";
|
|
5
|
+
|
|
6
|
+
import { hot } from "@sonamu-kit/hmr-hook";
|
|
7
|
+
import chalk from "chalk";
|
|
6
8
|
import inflection from "inflection";
|
|
7
9
|
import { minimatch } from "minimatch";
|
|
8
|
-
import path from "path";
|
|
9
10
|
import { group, unique } from "radashi";
|
|
10
|
-
import type
|
|
11
|
-
|
|
11
|
+
import { type z } from "zod";
|
|
12
|
+
|
|
12
13
|
import { registeredApis } from "../api/decorators";
|
|
13
14
|
import { Sonamu } from "../api/sonamu";
|
|
14
|
-
import { EntityManager
|
|
15
|
+
import { EntityManager } from "../entity/entity-manager";
|
|
16
|
+
import { type EntityNamesRecord } from "../entity/entity-manager";
|
|
15
17
|
import { AlreadyProcessedException } from "../exceptions/so-exceptions";
|
|
16
18
|
import { Naite } from "../naite/naite";
|
|
19
|
+
import { type WorkflowMetadata } from "../tasks/decorator";
|
|
17
20
|
import { TemplateManager } from "../template/template-manager";
|
|
18
|
-
import type
|
|
19
|
-
import { TemplateKey
|
|
21
|
+
import { type GenerateOptions, type PathAndCode } from "../types/types";
|
|
22
|
+
import { TemplateKey } from "../types/types";
|
|
23
|
+
import { type TemplateOptions } from "../types/types";
|
|
20
24
|
import { mapAsync, reduceAsync } from "../utils/async-utils";
|
|
21
25
|
import { centerText } from "../utils/console-util";
|
|
22
26
|
import { isTest } from "../utils/controller";
|
|
23
27
|
import { copyFileWithReplaceCoreToShared, exists } from "../utils/fs-utils";
|
|
24
|
-
import type
|
|
28
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
25
29
|
import { runWithGracefulShutdown } from "../utils/process-utils";
|
|
26
30
|
import { findChangedFilesUsingChecksums, renewChecksums } from "./checksum";
|
|
27
31
|
import { generateTemplate, renderTemplate } from "./code-generator";
|
|
28
32
|
import { createEntity, delEntity } from "./entity-operations";
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from "./file-patterns";
|
|
34
|
-
import {
|
|
35
|
-
type LoadedApis,
|
|
36
|
-
type LoadedModels,
|
|
37
|
-
type LoadedTypes,
|
|
38
|
-
loadApis,
|
|
39
|
-
loadModels,
|
|
40
|
-
loadTypes,
|
|
41
|
-
loadWorkflows,
|
|
42
|
-
} from "./module-loader";
|
|
33
|
+
import { checksumPatternGroup, getChecksumPatternGroupInAbsolutePath } from "./file-patterns";
|
|
34
|
+
import { type FileType } from "./file-patterns";
|
|
35
|
+
import { loadApis, loadModels, loadTypes, loadWorkflows } from "./module-loader";
|
|
36
|
+
import { type LoadedApis, type LoadedModels, type LoadedTypes } from "./module-loader";
|
|
43
37
|
import * as SyncerActions from "./syncer-actions";
|
|
44
38
|
|
|
45
39
|
type DiffGroups = {
|
|
@@ -517,7 +511,7 @@ export class Syncer {
|
|
|
517
511
|
async checkExists(
|
|
518
512
|
entityId: string,
|
|
519
513
|
enums: {
|
|
520
|
-
[name: string]: z.ZodEnum
|
|
514
|
+
[name: string]: z.ZodEnum;
|
|
521
515
|
},
|
|
522
516
|
): Promise<Record<`${TemplateKey}${string}`, boolean>> {
|
|
523
517
|
const keys: TemplateKey[] = TemplateKey.options;
|
package/src/tasks/decorator.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type RetryPolicy,
|
|
5
|
+
type SchemaInput,
|
|
6
|
+
type SchemaOutput,
|
|
7
|
+
type StandardSchemaV1,
|
|
8
|
+
type WorkflowSpec,
|
|
8
9
|
} from "@sonamu-kit/tasks/internal";
|
|
9
10
|
import inflection from "inflection";
|
|
10
|
-
|
|
11
|
-
import type
|
|
11
|
+
|
|
12
|
+
import { type Executable } from "../types/types";
|
|
13
|
+
import { type WorkflowFunction } from "./workflow-manager";
|
|
12
14
|
|
|
13
15
|
// 워크플로우의 메타데이터 객체
|
|
14
16
|
export interface WorkflowMetadata {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DurationString, type StepApi } from "@sonamu-kit/tasks/internal";
|
|
2
2
|
import inflection from "inflection";
|
|
3
3
|
|
|
4
4
|
export type StepFunction<TArgs extends unknown[], TResult> = (...args: TArgs) => TResult;
|