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
|
@@ -9,13 +9,13 @@ description: Reference for using Sonamu UI Scaffolding. Common errors and soluti
|
|
|
9
9
|
|
|
10
10
|
**The following 5 items must all be scaffolded for every entity:**
|
|
11
11
|
|
|
12
|
-
| Item
|
|
13
|
-
|
|
14
|
-
| `model`
|
|
15
|
-
| `model_test`
|
|
16
|
-
| `view_list`
|
|
17
|
-
| `view_search_input` | Search input component
|
|
18
|
-
| `view_form`
|
|
12
|
+
| Item | Description |
|
|
13
|
+
| ------------------- | ---------------------------------- |
|
|
14
|
+
| `model` | CRUD model based on BaseModelClass |
|
|
15
|
+
| `model_test` | Model test file |
|
|
16
|
+
| `view_list` | List view component |
|
|
17
|
+
| `view_search_input` | Search input component |
|
|
18
|
+
| `view_form` | Create/edit form component |
|
|
19
19
|
|
|
20
20
|
**DO NOT:** scaffold only model and model_test and skip the view-related items
|
|
21
21
|
|
|
@@ -36,6 +36,7 @@ Run from the **`packages/api`** directory:
|
|
|
36
36
|
**CRITICAL: After scaffolding is complete, you must perform the following steps.**
|
|
37
37
|
|
|
38
38
|
### 1. Build Test
|
|
39
|
+
|
|
39
40
|
```bash
|
|
40
41
|
cd packages/api
|
|
41
42
|
pnpm build
|
|
@@ -43,14 +44,17 @@ pnpm build
|
|
|
43
44
|
cd packages/web
|
|
44
45
|
pnpm build
|
|
45
46
|
```
|
|
47
|
+
|
|
46
48
|
- [ ] API build succeeds
|
|
47
49
|
- [ ] Web build succeeds
|
|
48
50
|
|
|
49
51
|
### 2. Restart Dev Server
|
|
52
|
+
|
|
50
53
|
```bash
|
|
51
54
|
cd packages/api
|
|
52
55
|
pnpm dev
|
|
53
56
|
```
|
|
57
|
+
|
|
54
58
|
- [ ] Server running normally
|
|
55
59
|
|
|
56
60
|
### 3. If Relations Exist (Add i18n Keys)
|
|
@@ -61,19 +65,20 @@ pnpm dev
|
|
|
61
65
|
// packages/api/src/i18n/ko.ts
|
|
62
66
|
export default {
|
|
63
67
|
// ... existing keys
|
|
64
|
-
|
|
68
|
+
|
|
65
69
|
// Add for each entity with relations
|
|
66
70
|
"entity.Post.author_id": "Author",
|
|
67
71
|
"entity.Question.collection_id": "Collection",
|
|
68
72
|
"entity.Question.parent_id": "Parent Question",
|
|
69
73
|
"entity.Employee.department_id": "Department",
|
|
70
74
|
"entity.Task.principal_investigator_id": "Principal Investigator",
|
|
71
|
-
|
|
75
|
+
|
|
72
76
|
// ...
|
|
73
77
|
} as const;
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
**Pattern**: `entity.{EntityId}.{relation}_id`
|
|
81
|
+
|
|
77
82
|
- Add `_id` suffix to the relation name
|
|
78
83
|
- Example: `author` relation → `author_id` key
|
|
79
84
|
|
|
@@ -90,7 +95,7 @@ export default {
|
|
|
90
95
|
if (params.orderBy === "id-desc") {
|
|
91
96
|
qb.orderBy("posts.id", "desc");
|
|
92
97
|
} else {
|
|
93
|
-
exhaustive(params.orderBy);
|
|
98
|
+
exhaustive(params.orderBy); // type error!
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
// Fix: add the remaining cases
|
|
@@ -101,7 +106,7 @@ if (params.orderBy === "id-desc") {
|
|
|
101
106
|
} else if (params.orderBy === "name-asc") {
|
|
102
107
|
qb.orderBy("posts.name", "asc");
|
|
103
108
|
} else {
|
|
104
|
-
exhaustive(params.orderBy);
|
|
109
|
+
exhaustive(params.orderBy); // no more type errors
|
|
105
110
|
}
|
|
106
111
|
```
|
|
107
112
|
|
|
@@ -121,19 +126,17 @@ export const PostSaveParams = PostBaseSchema.partial({
|
|
|
121
126
|
});
|
|
122
127
|
|
|
123
128
|
// Fix: add nullable fields
|
|
124
|
-
export const PostSaveParams = PostBaseSchema
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
description: z.string().nullish(),
|
|
136
|
-
});
|
|
129
|
+
export const PostSaveParams = PostBaseSchema.partial({
|
|
130
|
+
id: true,
|
|
131
|
+
created_at: true,
|
|
132
|
+
updated_at: true, // nullable field
|
|
133
|
+
category: true, // nullable field
|
|
134
|
+
description: true, // nullable field
|
|
135
|
+
}).extend({
|
|
136
|
+
updated_at: z.date().nullish(),
|
|
137
|
+
category: z.string().nullish(),
|
|
138
|
+
description: z.string().nullish(),
|
|
139
|
+
});
|
|
137
140
|
```
|
|
138
141
|
|
|
139
142
|
**Detailed guide**: See "Tasks to do immediately after entity creation" in `testing.md`
|
|
@@ -154,12 +157,12 @@ Post-scaffolding required checklist complete
|
|
|
154
157
|
|
|
155
158
|
## Common Errors
|
|
156
159
|
|
|
157
|
-
| Error
|
|
158
|
-
|
|
159
|
-
| "Non-existent module path requested {Type}" | types.ts not created or not compiled
|
|
160
|
-
| exhaustive() type error
|
|
161
|
-
| Missing i18n key (relation)
|
|
162
|
-
| IdAsyncSelect API mismatch
|
|
160
|
+
| Error | Cause | Fix |
|
|
161
|
+
| ------------------------------------------- | ----------------------------------------------------- | ------------------------------------------ |
|
|
162
|
+
| "Non-existent module path requested {Type}" | types.ts not created or not compiled | Wait/create manually → build → restart dev |
|
|
163
|
+
| exhaustive() type error | Only the first OrderBy value is handled automatically | See "4. Add OrderBy Cases" above |
|
|
164
|
+
| Missing i18n key (relation) | `author_id` vs `author` | See "3. If Relations Exist" above |
|
|
165
|
+
| IdAsyncSelect API mismatch | Old scaffolding template used | See "IdAsyncSelect API Migration" below |
|
|
163
166
|
|
|
164
167
|
## Detailed Explanations
|
|
165
168
|
|
|
@@ -194,14 +197,17 @@ if (entityId) {
|
|
|
194
197
|
```
|
|
195
198
|
|
|
196
199
|
**Auto-generation conditions**:
|
|
200
|
+
|
|
197
201
|
- When `parentId` is absent (top-level entity)
|
|
198
202
|
- When the `types.ts` file does not yet exist
|
|
199
203
|
|
|
200
204
|
**Causes of errors**:
|
|
205
|
+
|
|
201
206
|
- Attempting scaffolding immediately after entity creation before the syncer has run
|
|
202
207
|
- types.ts was created but the build has not completed so the `.js` file is missing
|
|
203
208
|
|
|
204
209
|
**Resolution order** (run from `packages/api`):
|
|
210
|
+
|
|
205
211
|
1. Wait briefly after entity creation for the syncer to generate types.ts (2-3 seconds)
|
|
206
212
|
2. If types.ts is missing, create it manually (see template below)
|
|
207
213
|
3. Create migration (Sonamu UI) and run it (`pnpm sonamu migrate run`)
|
|
@@ -256,7 +262,7 @@ The scaffolding template only handles the **first value** of the `OrderBy` enum
|
|
|
256
262
|
if (params.orderBy === "id-desc") {
|
|
257
263
|
qb.orderBy("posts.id", "desc");
|
|
258
264
|
} else {
|
|
259
|
-
exhaustive(params.orderBy);
|
|
265
|
+
exhaustive(params.orderBy); // remaining cases unhandled → type error
|
|
260
266
|
}
|
|
261
267
|
```
|
|
262
268
|
|
|
@@ -288,6 +294,7 @@ An entity's relation prop is defined as `author`, and the i18n label in `sd.gene
|
|
|
288
294
|
**Fix (choose one)**:
|
|
289
295
|
|
|
290
296
|
1. **Manually add `_id` key to ko.ts** (recommended):
|
|
297
|
+
|
|
291
298
|
```typescript
|
|
292
299
|
// packages/api/src/i18n/ko.ts
|
|
293
300
|
export default {
|
|
@@ -300,9 +307,12 @@ export default {
|
|
|
300
307
|
```
|
|
301
308
|
|
|
302
309
|
2. **Remove `_id` from form.tsx** (requires manual edit):
|
|
310
|
+
|
|
303
311
|
```typescript
|
|
304
312
|
// Manual edit after scaffolding
|
|
305
|
-
{
|
|
313
|
+
{
|
|
314
|
+
SD("entity.Post.author");
|
|
315
|
+
} // remove _id
|
|
306
316
|
```
|
|
307
317
|
|
|
308
318
|
**Recommended**: First option - add the `_id` key to ko.ts. It is preserved during sync and can be reused across multiple forms.
|
|
@@ -318,6 +328,7 @@ Therefore, running `pnpm sonamu scaffold` generates wrapper components based on
|
|
|
318
328
|
#### Specific API Changes
|
|
319
329
|
|
|
320
330
|
**Old API (code generated by scaffolding):**
|
|
331
|
+
|
|
321
332
|
```typescript
|
|
322
333
|
export function UserIdAsyncSelect<T extends UserSubsetKey>({
|
|
323
334
|
subset,
|
|
@@ -350,6 +361,7 @@ export function UserIdAsyncSelect<T extends UserSubsetKey>({
|
|
|
350
361
|
```
|
|
351
362
|
|
|
352
363
|
**New API (actual package API):**
|
|
364
|
+
|
|
353
365
|
```typescript
|
|
354
366
|
export function UserIdAsyncSelect<T extends UserSubsetKey>({
|
|
355
367
|
subset,
|
|
@@ -11,9 +11,9 @@ The process for capturing knowledge from a resolved troubleshooting session into
|
|
|
11
11
|
|
|
12
12
|
## Triggers
|
|
13
13
|
|
|
14
|
-
| Trigger
|
|
15
|
-
|
|
16
|
-
| **Explicit request** | User
|
|
14
|
+
| Trigger | Owner | Example |
|
|
15
|
+
| -------------------- | ----- | ------------------------------------------------------------------------------ |
|
|
16
|
+
| **Explicit request** | User | "Document this in skills", "Record this fix" |
|
|
17
17
|
| **Agent suggestion** | Agent | When a detection pattern below is met, propose: "Should I add this to skills?" |
|
|
18
18
|
|
|
19
19
|
### Agent detection patterns
|
|
@@ -25,6 +25,7 @@ Suggest contribution when the following flow is observed in the conversation:
|
|
|
25
25
|
3. The same problem is **likely to occur in other projects or for other users**
|
|
26
26
|
|
|
27
27
|
Do not suggest when:
|
|
28
|
+
|
|
28
29
|
- Simple typos or missing imports
|
|
29
30
|
- Project-specific business logic bugs
|
|
30
31
|
- One-off environment issues (e.g., port conflict on a specific machine)
|
|
@@ -52,22 +53,22 @@ Summarize from the conversation using the following structure:
|
|
|
52
53
|
symptom: "one-line description (error message or observed behavior)"
|
|
53
54
|
cause: "explanation of root cause"
|
|
54
55
|
solution: "resolution steps (include specific commands/code)"
|
|
55
|
-
source_paths:
|
|
56
|
+
source_paths: # related source file paths
|
|
56
57
|
- "src/testing/dev-vitest-manager.ts"
|
|
57
|
-
tags:
|
|
58
|
+
tags: # keywords for matching
|
|
58
59
|
- "testing"
|
|
59
60
|
- "devrunner"
|
|
60
|
-
scope: "sonamu"
|
|
61
|
+
scope: "sonamu" # "sonamu" (framework-level) or "local" (project-specific)
|
|
61
62
|
```
|
|
62
63
|
|
|
63
64
|
### Scope decision criteria
|
|
64
65
|
|
|
65
|
-
| Condition
|
|
66
|
-
|
|
67
|
-
| Relates to Sonamu framework behavior or constraints
|
|
68
|
-
| Relates to Sonamu CLI, config, migration, or shared tooling
|
|
69
|
-
| Relates to a specific project's business logic or configuration | `local`
|
|
70
|
-
| Unclear
|
|
66
|
+
| Condition | scope |
|
|
67
|
+
| --------------------------------------------------------------- | ------------ |
|
|
68
|
+
| Relates to Sonamu framework behavior or constraints | `sonamu` |
|
|
69
|
+
| Relates to Sonamu CLI, config, migration, or shared tooling | `sonamu` |
|
|
70
|
+
| Relates to a specific project's business logic or configuration | `local` |
|
|
71
|
+
| Unclear | Ask the user |
|
|
71
72
|
|
|
72
73
|
---
|
|
73
74
|
|
|
@@ -77,30 +78,30 @@ scope: "sonamu" # "sonamu" (framework-level) or "local" (project-specific)
|
|
|
77
78
|
|
|
78
79
|
### Match priority
|
|
79
80
|
|
|
80
|
-
| Priority | Method
|
|
81
|
-
|
|
82
|
-
| 1
|
|
83
|
-
| 2
|
|
84
|
-
| 3
|
|
81
|
+
| Priority | Method | Description |
|
|
82
|
+
| -------- | ----------------------- | ------------------------------------------------------------------------------ |
|
|
83
|
+
| 1 | **Source paths** | Check whether `source_paths` overlap with source references in existing skills |
|
|
84
|
+
| 2 | **Tags/keywords** | Compare against each skill's YAML `description` and tags |
|
|
85
|
+
| 3 | **SKILL.md task table** | Cross-reference which task row maps to the problem domain |
|
|
85
86
|
|
|
86
87
|
### Source path → skill mapping (key paths)
|
|
87
88
|
|
|
88
|
-
| Source path pattern
|
|
89
|
-
|
|
90
|
-
| `src/testing/*`
|
|
91
|
-
| `src/database/puri*`
|
|
92
|
-
| `src/database/migrator*`
|
|
93
|
-
| `src/auth/*`
|
|
94
|
-
| `src/entity/*`, `src/syncer/*` | entity-basic.md, entity-relations.md
|
|
95
|
-
| `src/vector/*`
|
|
96
|
-
| `src/ai/agents/*`
|
|
97
|
-
| `src/naite/*`
|
|
98
|
-
| `src/cone/*`
|
|
99
|
-
| `src/api/*`
|
|
100
|
-
| `src/template/*`
|
|
101
|
-
| `src/model/*`
|
|
102
|
-
| `src/ssr/*`
|
|
103
|
-
| `sonamu.config.ts` related
|
|
89
|
+
| Source path pattern | Corresponding skill |
|
|
90
|
+
| ------------------------------ | ---------------------------------------------------------- |
|
|
91
|
+
| `src/testing/*` | testing.md, testing-devrunner.md, naite.md, fixture-cli.md |
|
|
92
|
+
| `src/database/puri*` | puri.md |
|
|
93
|
+
| `src/database/migrator*` | migration.md |
|
|
94
|
+
| `src/auth/*` | auth.md, auth-plugins.md, auth-migration.md |
|
|
95
|
+
| `src/entity/*`, `src/syncer/*` | entity-basic.md, entity-relations.md |
|
|
96
|
+
| `src/vector/*` | vector.md |
|
|
97
|
+
| `src/ai/agents/*` | ai-agents.md |
|
|
98
|
+
| `src/naite/*` | naite.md |
|
|
99
|
+
| `src/cone/*` | cone.md |
|
|
100
|
+
| `src/api/*` | api.md |
|
|
101
|
+
| `src/template/*` | framework-change.md |
|
|
102
|
+
| `src/model/*` | model.md |
|
|
103
|
+
| `src/ssr/*` | (no skill — candidate for new file) |
|
|
104
|
+
| `sonamu.config.ts` related | config.md |
|
|
104
105
|
|
|
105
106
|
If the path is not in this table, fall through to tag/keyword matching.
|
|
106
107
|
|
|
@@ -114,13 +115,13 @@ If the path is not in this table, fall through to tag/keyword matching.
|
|
|
114
115
|
|
|
115
116
|
## [3] Decide
|
|
116
117
|
|
|
117
|
-
| Match result
|
|
118
|
-
|
|
119
|
-
| **Same content exists** in an existing skill
|
|
120
|
-
| Match found + skill has **troubleshooting section**
|
|
118
|
+
| Match result | Decision | Description |
|
|
119
|
+
| ------------------------------------------------------ | --------------- | -------------------------------------------- |
|
|
120
|
+
| **Same content exists** in an existing skill | **SKIP** | Report: "Already documented in {skill}.md" |
|
|
121
|
+
| Match found + skill has **troubleshooting section** | **APPEND** | Add item to existing section |
|
|
121
122
|
| Match found + skill has **no troubleshooting section** | **ADD_SECTION** | Add a new troubleshooting section at the end |
|
|
122
|
-
| No match + scope=`sonamu`
|
|
123
|
-
| No match + scope=`local`
|
|
123
|
+
| No match + scope=`sonamu` | **NEW_FILE** | Create a new skill file (rare) |
|
|
124
|
+
| No match + scope=`local` | **LOCAL** | Create in `.claude/skills/local/` |
|
|
124
125
|
|
|
125
126
|
**CRITICAL: APPEND and ADD_SECTION should account for the vast majority of cases.** NEW_FILE is only for when the content genuinely does not fit anywhere in the existing skills.
|
|
126
127
|
|
|
@@ -136,6 +137,7 @@ Use the pattern from `testing-devrunner.md` as the standard:
|
|
|
136
137
|
## Troubleshooting
|
|
137
138
|
|
|
138
139
|
### "Error message or one-line symptom"
|
|
140
|
+
|
|
139
141
|
→ Explanation of root cause
|
|
140
142
|
→ Fix: specific resolution (commands / code / config)
|
|
141
143
|
```
|
|
@@ -148,6 +150,7 @@ Adding to cone.md:
|
|
|
148
150
|
|
|
149
151
|
```markdown
|
|
150
152
|
### "pnpm sonamu cone gen --all fails with 'ANTHROPIC_API_KEY is not set'"
|
|
153
|
+
|
|
151
154
|
→ Key is missing from .env or was set only in root .env rather than packages/api/.env
|
|
152
155
|
→ Fix: add `ANTHROPIC_API_KEY=sk-ant-...` to `packages/api/.env`
|
|
153
156
|
```
|
|
@@ -162,6 +165,7 @@ Adding a new section at the end of puri.md:
|
|
|
162
165
|
## Troubleshooting
|
|
163
166
|
|
|
164
167
|
### "nullable field type inferred as non-null after leftJoin"
|
|
168
|
+
|
|
165
169
|
→ Puri type inference does not account for join direction. leftJoin results may be null at runtime but are not reflected as optional in the types.
|
|
166
170
|
→ Fix: explicitly mark the field as optional in the subset, or add a null check at the call site
|
|
167
171
|
```
|
|
@@ -181,6 +185,7 @@ description: Deployment notes for the KOPRI project. Use when deploying KOPRI pr
|
|
|
181
185
|
## Troubleshooting
|
|
182
186
|
|
|
183
187
|
### "sharp package installation fails during Docker build"
|
|
188
|
+
|
|
184
189
|
→ Alpine image is missing native dependencies for sharp
|
|
185
190
|
→ Fix: add `RUN apk add --no-cache vips-dev` to Dockerfile
|
|
186
191
|
```
|
|
@@ -212,13 +217,13 @@ Shall I apply this?
|
|
|
212
217
|
|
|
213
218
|
## [6] Apply
|
|
214
219
|
|
|
215
|
-
| Decision
|
|
216
|
-
|
|
217
|
-
| SKIP
|
|
218
|
-
| APPEND
|
|
220
|
+
| Decision | Action |
|
|
221
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
222
|
+
| SKIP | None |
|
|
223
|
+
| APPEND | Add `###` entry to the troubleshooting section in the skill |
|
|
219
224
|
| ADD_SECTION | Add `## Troubleshooting` section + entry at the end of the skill (just before `## References` if it exists, otherwise at the very end) |
|
|
220
|
-
| NEW_FILE
|
|
221
|
-
| LOCAL
|
|
225
|
+
| NEW_FILE | Create new .md file + **register in both tables in SKILL.md** |
|
|
226
|
+
| LOCAL | Create `.claude/skills/local/{name}.md` |
|
|
222
227
|
|
|
223
228
|
### ADD_SECTION insertion position
|
|
224
229
|
|
|
@@ -6,6 +6,7 @@ description: Define API response field scope with Sonamu Subsets. Include relati
|
|
|
6
6
|
# Subset Definition
|
|
7
7
|
|
|
8
8
|
**Working code references:**
|
|
9
|
+
|
|
9
10
|
- `sonamu/examples/miomock/api/src/application/project/project.entity.json` - complex Subset example
|
|
10
11
|
- `sonamu/examples/miomock/api/src/application/employee/employee.entity.json` - basic Subset example
|
|
11
12
|
|
|
@@ -25,18 +26,19 @@ description: Define API response field scope with Sonamu Subsets. Include relati
|
|
|
25
26
|
|
|
26
27
|
**WARNING: Only use A, P, and SS as Subset names. Do not use arbitrary names like S, D, or L.**
|
|
27
28
|
|
|
28
|
-
| Subset
|
|
29
|
-
|
|
30
|
-
| `A`
|
|
31
|
-
| `P`
|
|
32
|
-
| `SS`
|
|
33
|
-
| `P2`, `P3` | Additional profiles (only for special cases)
|
|
29
|
+
| Subset | Purpose |
|
|
30
|
+
| ---------- | ------------------------------------------------------------------------------ |
|
|
31
|
+
| `A` | All - all fields (detail view, admin). **Required** |
|
|
32
|
+
| `P` | Partial/Profile - partial fields including relations (for list views) |
|
|
33
|
+
| `SS` | Super Simple/Summary - minimal fields, just ID + name (for dropdowns, selects) |
|
|
34
|
+
| `P2`, `P3` | Additional profiles (only for special cases) |
|
|
34
35
|
|
|
35
36
|
### IMPORTANT: Subset A Must Include All Fields
|
|
36
37
|
|
|
37
38
|
**Subset A must include all regular fields and major relation fields of the Entity.**
|
|
38
39
|
|
|
39
40
|
**DO:**
|
|
41
|
+
|
|
40
42
|
```json
|
|
41
43
|
{
|
|
42
44
|
"props": [
|
|
@@ -53,15 +55,17 @@ description: Define API response field scope with Sonamu Subsets. Include relati
|
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
**DO NOT:**
|
|
58
|
+
|
|
56
59
|
```json
|
|
57
60
|
{
|
|
58
61
|
"subsets": {
|
|
59
|
-
"A": ["id", "title"]
|
|
62
|
+
"A": ["id", "title"] // created_at, status, author omitted - incorrect
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
```
|
|
63
66
|
|
|
64
67
|
**Rules:**
|
|
68
|
+
|
|
65
69
|
- Include all regular fields (id, created_at, business fields, etc.)
|
|
66
70
|
- For BelongsToOne relations, include at least `.id` and a display field (`.name`, `.title`, etc.)
|
|
67
71
|
- HasMany relations are optional (include only when needed)
|
|
@@ -92,12 +96,7 @@ description: Define API response field scope with Sonamu Subsets. Include relati
|
|
|
92
96
|
```json
|
|
93
97
|
{
|
|
94
98
|
"subsets": {
|
|
95
|
-
"P": [
|
|
96
|
-
"id",
|
|
97
|
-
"username",
|
|
98
|
-
"employee.salary",
|
|
99
|
-
"employee.department.name"
|
|
100
|
-
]
|
|
99
|
+
"P": ["id", "username", "employee.salary", "employee.department.name"]
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
```
|
|
@@ -162,5 +161,6 @@ const result = await UserModel.executeSubsetQuery({
|
|
|
162
161
|
```
|
|
163
162
|
|
|
164
163
|
**Working code references:**
|
|
164
|
+
|
|
165
165
|
- `sonamu/examples/miomock/api/src/application/project/project.entity.json` - Subset definition examples
|
|
166
166
|
- `sonamu/examples/miomock/api/src/application/employee/employee.entity.json` - BelongsToOne relation examples
|
|
@@ -8,6 +8,7 @@ description: Sonamu Tasks workflow system. Background jobs, scheduling, durable
|
|
|
8
8
|
PostgreSQL-based durable workflow engine. Uses the `@sonamu-kit/tasks` package.
|
|
9
9
|
|
|
10
10
|
**Source code:**
|
|
11
|
+
|
|
11
12
|
- Decorator: `modules/sonamu/src/tasks/decorator.ts`
|
|
12
13
|
- StepWrapper: `modules/sonamu/src/tasks/step-wrapper.ts`
|
|
13
14
|
- WorkflowManager: `modules/sonamu/src/tasks/workflow-manager.ts`
|
|
@@ -28,31 +29,34 @@ export const myTask = workflow({
|
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
// Method 2: decorator + function inlined
|
|
31
|
-
export const myTask = workflow(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
32
|
+
export const myTask = workflow(
|
|
33
|
+
{
|
|
34
|
+
version: "1",
|
|
35
|
+
},
|
|
36
|
+
async ({ input, step, logger, version }) => {
|
|
37
|
+
// ...
|
|
38
|
+
},
|
|
39
|
+
);
|
|
36
40
|
```
|
|
37
41
|
|
|
38
42
|
### DefineWorkflowOptions
|
|
39
43
|
|
|
40
|
-
| Option
|
|
41
|
-
|
|
42
|
-
| `version`
|
|
43
|
-
| `name`
|
|
44
|
-
| `schema`
|
|
45
|
-
| `schedules`
|
|
46
|
-
| `retryPolicy` | `RetryPolicy`
|
|
44
|
+
| Option | Type | Required | Description |
|
|
45
|
+
| ------------- | ------------------ | -------- | ------------------------------------------------------------------- |
|
|
46
|
+
| `version` | `string` | Y | Workflow version (distinguishes from existing runs when changed) |
|
|
47
|
+
| `name` | `string` | N | Workflow name (default: function name converted to underscore case) |
|
|
48
|
+
| `schema` | `StandardSchemaV1` | N | Input validation schema (Zod, etc.) |
|
|
49
|
+
| `schedules` | `Schedule[]` | N | Array of cron schedules |
|
|
50
|
+
| `retryPolicy` | `RetryPolicy` | N | Retry policy |
|
|
47
51
|
|
|
48
52
|
### Workflow Function Parameters
|
|
49
53
|
|
|
50
|
-
| Parameter | Type
|
|
51
|
-
|
|
52
|
-
| `input`
|
|
53
|
-
| `step`
|
|
54
|
-
| `logger`
|
|
55
|
-
| `version` | `string \| null` | Current workflow version
|
|
54
|
+
| Parameter | Type | Description |
|
|
55
|
+
| --------- | ---------------- | ----------------------------------------- |
|
|
56
|
+
| `input` | `Input` | Input value passed when the workflow runs |
|
|
57
|
+
| `step` | `StepWrapper` | Tool for defining/executing steps |
|
|
58
|
+
| `logger` | `Logger` | @logtape/logtape logger |
|
|
59
|
+
| `version` | `string \| null` | Current workflow version |
|
|
56
60
|
|
|
57
61
|
## Step
|
|
58
62
|
|
|
@@ -61,10 +65,12 @@ An atomic unit of execution within a workflow. On failure, retry begins from tha
|
|
|
61
65
|
### step.define — Inline Function
|
|
62
66
|
|
|
63
67
|
```typescript
|
|
64
|
-
const result = await step
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
const result = await step
|
|
69
|
+
.define({ name: "fetch-data" }, async () => {
|
|
70
|
+
const data = await fetchSomething();
|
|
71
|
+
return data;
|
|
72
|
+
})
|
|
73
|
+
.run();
|
|
68
74
|
```
|
|
69
75
|
|
|
70
76
|
### step.get — Wrapping an Existing Method
|
|
@@ -78,6 +84,7 @@ const result = await step.get({ name: "custom_step" }, MyService, "execute").run
|
|
|
78
84
|
```
|
|
79
85
|
|
|
80
86
|
Overloads for `step.get`:
|
|
87
|
+
|
|
81
88
|
- `step.get(object, methodName)` — Step name is the methodName converted to underscore case
|
|
82
89
|
- `step.get({ name }, object, methodName)` — Step name specified directly
|
|
83
90
|
|
|
@@ -95,23 +102,28 @@ The wait time is preserved even if the server restarts.
|
|
|
95
102
|
## Scheduling (cron)
|
|
96
103
|
|
|
97
104
|
```typescript
|
|
98
|
-
export const dailyReport = workflow(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
export const dailyReport = workflow(
|
|
106
|
+
{
|
|
107
|
+
version: "1",
|
|
108
|
+
schedules: [
|
|
109
|
+
{
|
|
110
|
+
expression: "0 9 * * *", // every day at 9am
|
|
111
|
+
name: "daily-report", // optional (default: workflowName[expression])
|
|
112
|
+
input: () => ({ date: new Date().toISOString() }), // optional
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
async ({ input, step }) => {
|
|
117
|
+
// ...
|
|
118
|
+
},
|
|
119
|
+
);
|
|
108
120
|
```
|
|
109
121
|
|
|
110
|
-
| Field
|
|
111
|
-
|
|
112
|
-
| `expression` | `string`
|
|
113
|
-
| `name`
|
|
114
|
-
| `input`
|
|
122
|
+
| Field | Type | Required | Description |
|
|
123
|
+
| ------------ | ------------------- | -------- | ---------------------------------------------------- |
|
|
124
|
+
| `expression` | `string` | Y | cron expression |
|
|
125
|
+
| `name` | `string` | N | Schedule name (default: `workflowName[expression]`) |
|
|
126
|
+
| `input` | `Executable<Input>` | N | Input value to pass on execution (function or value) |
|
|
115
127
|
|
|
116
128
|
The timezone follows the `api.timezone` setting in `sonamu.config.ts`.
|
|
117
129
|
|
|
@@ -120,17 +132,20 @@ The timezone follows the `api.timezone` setting in `sonamu.config.ts`.
|
|
|
120
132
|
### Static Policy (Default)
|
|
121
133
|
|
|
122
134
|
```typescript
|
|
123
|
-
export const reliableTask = workflow(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
135
|
+
export const reliableTask = workflow(
|
|
136
|
+
{
|
|
137
|
+
version: "1",
|
|
138
|
+
retryPolicy: {
|
|
139
|
+
maxAttempts: 5, // maximum retry attempts (default: 5)
|
|
140
|
+
initialIntervalMs: 1000, // first retry wait time (default: 1000ms)
|
|
141
|
+
backoffCoefficient: 2, // wait time multiplier (default: 2)
|
|
142
|
+
maximumIntervalMs: 60000, // maximum wait time
|
|
143
|
+
},
|
|
130
144
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
145
|
+
async ({ step }) => {
|
|
146
|
+
// ...
|
|
147
|
+
},
|
|
148
|
+
);
|
|
134
149
|
```
|
|
135
150
|
|
|
136
151
|
### Dynamic Policy
|
|
@@ -152,9 +167,9 @@ export default defineConfig({
|
|
|
152
167
|
tasks: {
|
|
153
168
|
enableWorker: true,
|
|
154
169
|
workerOptions: {
|
|
155
|
-
concurrency: 4,
|
|
156
|
-
usePubSub: true,
|
|
157
|
-
listenDelay: 500,
|
|
170
|
+
concurrency: 4, // concurrent execution count (default: CPU cores - 1)
|
|
171
|
+
usePubSub: true, // use DB pub/sub (default: true)
|
|
172
|
+
listenDelay: 500, // execution delay after pub/sub receive in ms (default: 500)
|
|
158
173
|
},
|
|
159
174
|
contextProvider: (defaultContext) => {
|
|
160
175
|
// build Context to use within workflows
|
|
@@ -164,13 +179,13 @@ export default defineConfig({
|
|
|
164
179
|
});
|
|
165
180
|
```
|
|
166
181
|
|
|
167
|
-
| Option
|
|
168
|
-
|
|
169
|
-
| `enableWorker`
|
|
170
|
-
| `workerOptions.concurrency` | `number`
|
|
171
|
-
| `workerOptions.usePubSub`
|
|
172
|
-
| `workerOptions.listenDelay` | `number`
|
|
173
|
-
| `contextProvider`
|
|
182
|
+
| Option | Type | Description |
|
|
183
|
+
| --------------------------- | ------------------ | -------------------------------------------------- |
|
|
184
|
+
| `enableWorker` | `boolean` | Whether to enable Worker (use only in daemon mode) |
|
|
185
|
+
| `workerOptions.concurrency` | `number` | Number of concurrently executing tasks |
|
|
186
|
+
| `workerOptions.usePubSub` | `boolean` | Use PostgreSQL pub/sub |
|
|
187
|
+
| `workerOptions.listenDelay` | `number` | Execution delay after pub/sub receive (ms) |
|
|
188
|
+
| `contextProvider` | `(ctx) => Context` | Context creation function when workflow runs |
|
|
174
189
|
|
|
175
190
|
## Manual Execution
|
|
176
191
|
|
|
@@ -180,7 +195,7 @@ import { Sonamu } from "sonamu";
|
|
|
180
195
|
// Run via WorkflowManager
|
|
181
196
|
const handle = await Sonamu.workflowManager.run(
|
|
182
197
|
{ name: "my-task", version: "1" },
|
|
183
|
-
{ target: "manual" }
|
|
198
|
+
{ target: "manual" },
|
|
184
199
|
);
|
|
185
200
|
|
|
186
201
|
// Wait for result
|