sonamu 0.5.7 → 0.7.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/.swcrc.project-default +18 -0
- package/bin/cli.js +24 -0
- package/dist/ai/agents/agent.d.ts +11 -0
- package/dist/ai/agents/agent.d.ts.map +1 -0
- package/dist/ai/agents/agent.js +65 -0
- package/dist/ai/agents/index.d.ts +3 -0
- package/dist/ai/agents/index.d.ts.map +1 -0
- package/dist/ai/agents/index.js +4 -0
- package/dist/ai/agents/types.d.ts +43 -0
- package/dist/ai/agents/types.d.ts.map +1 -0
- package/dist/ai/agents/types.js +3 -0
- package/dist/ai/index.d.ts +2 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +3 -0
- package/dist/ai/providers/rtzr/api.d.ts +22 -0
- package/dist/ai/providers/rtzr/api.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/api.js +28 -0
- package/dist/ai/providers/rtzr/error.d.ts +18 -0
- package/dist/ai/providers/rtzr/error.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/error.js +29 -0
- package/dist/ai/providers/rtzr/index.d.ts +5 -0
- package/dist/ai/providers/rtzr/index.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/index.js +6 -0
- package/dist/ai/providers/rtzr/model.d.ts +52 -0
- package/dist/ai/providers/rtzr/model.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/model.js +137 -0
- package/dist/ai/providers/rtzr/options.d.ts +7 -0
- package/dist/ai/providers/rtzr/options.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/options.js +47 -0
- package/dist/ai/providers/rtzr/provider.d.ts +18 -0
- package/dist/ai/providers/rtzr/provider.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/provider.js +54 -0
- package/dist/ai/providers/rtzr/utils.d.ts +19 -0
- package/dist/ai/providers/rtzr/utils.d.ts.map +1 -0
- package/dist/ai/providers/rtzr/utils.js +88 -0
- 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 +13 -2
- package/dist/api/caster.d.ts.map +1 -1
- package/dist/api/caster.js +71 -2
- package/dist/api/code-converters.d.ts +58 -14
- package/dist/api/code-converters.d.ts.map +1 -1
- package/dist/api/code-converters.js +258 -2
- package/dist/api/config.d.ts +90 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +25 -0
- package/dist/api/context.d.ts +4 -2
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +3 -2
- package/dist/api/decorators.d.ts +20 -6
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +235 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +9 -2
- package/dist/api/sonamu.d.ts +10 -24
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +514 -2
- package/dist/api/validator.d.ts +6 -0
- package/dist/api/validator.d.ts.map +1 -0
- package/dist/api/validator.js +81 -0
- package/dist/bin/build-config.d.ts +6 -1
- package/dist/bin/build-config.d.ts.map +1 -1
- package/dist/bin/build-config.js +15 -2
- package/dist/bin/cli.js +519 -2
- package/dist/bin/hot-hook-register.d.ts +11 -0
- package/dist/bin/hot-hook-register.d.ts.map +1 -0
- package/dist/bin/hot-hook-register.js +21 -0
- package/dist/bin/loader-register.d.ts +2 -0
- package/dist/bin/loader-register.d.ts.map +1 -0
- package/dist/bin/loader-register.js +34 -0
- package/dist/database/_batch_update.d.ts +5 -3
- package/dist/database/_batch_update.d.ts.map +1 -1
- package/dist/database/_batch_update.js +95 -2
- package/dist/database/base-model.d.ts +96 -10
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +390 -2
- package/dist/database/base-model.types.d.ts +93 -0
- package/dist/database/base-model.types.d.ts.map +1 -0
- package/dist/database/base-model.types.js +10 -0
- package/dist/database/code-generator.d.ts +1 -1
- package/dist/database/code-generator.d.ts.map +1 -1
- package/dist/database/code-generator.js +54 -2
- package/dist/database/db.d.ts +6 -21
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +129 -2
- package/dist/database/puri-subset.test-d.js +81 -0
- package/dist/database/puri-subset.types.d.ts +123 -0
- package/dist/database/puri-subset.types.d.ts.map +1 -0
- package/dist/database/puri-subset.types.js +16 -0
- package/dist/database/puri-wrapper.d.ts +13 -11
- package/dist/database/puri-wrapper.d.ts.map +1 -1
- package/dist/database/puri-wrapper.js +109 -2
- package/dist/database/puri.d.ts +41 -23
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +601 -2
- package/dist/database/puri.types.d.ts +25 -6
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +6 -2
- package/dist/database/transaction-context.d.ts +1 -1
- package/dist/database/transaction-context.d.ts.map +1 -1
- package/dist/database/transaction-context.js +14 -2
- package/dist/database/upsert-builder.d.ts +9 -3
- package/dist/database/upsert-builder.d.ts.map +1 -1
- package/dist/database/upsert-builder.js +365 -2
- package/dist/entity/entity-manager.d.ts +167 -2
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +130 -2
- package/dist/entity/entity.d.ts +5 -3
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +750 -2
- 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 +29 -2
- 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 +85 -2
- package/dist/file-storage/driver.d.ts +1 -1
- package/dist/file-storage/driver.d.ts.map +1 -1
- package/dist/file-storage/driver.js +79 -2
- package/dist/file-storage/file-storage.js +75 -2
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -2
- package/dist/migration/code-generation.d.ts +1 -1
- package/dist/migration/code-generation.d.ts.map +1 -1
- package/dist/migration/code-generation.js +614 -2
- package/dist/migration/migration-set.d.ts +2 -10
- package/dist/migration/migration-set.d.ts.map +1 -1
- package/dist/migration/migration-set.js +213 -2
- package/dist/migration/migrator.d.ts +24 -82
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +330 -2
- package/dist/migration/postgresql-schema-reader.d.ts +51 -0
- package/dist/migration/postgresql-schema-reader.d.ts.map +1 -0
- package/dist/migration/postgresql-schema-reader.js +245 -0
- package/dist/migration/types.d.ts +6 -38
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/migration/types.js +3 -2
- package/dist/naite/messaging-types.d.ts +43 -0
- package/dist/naite/messaging-types.d.ts.map +1 -0
- package/dist/naite/messaging-types.js +7 -0
- package/dist/naite/naite-reporter.d.ts +41 -0
- package/dist/naite/naite-reporter.d.ts.map +1 -0
- package/dist/naite/naite-reporter.js +102 -0
- package/dist/naite/naite.d.ts +95 -0
- package/dist/naite/naite.d.ts.map +1 -0
- package/dist/naite/naite.js +316 -0
- package/dist/stream/index.js +3 -2
- package/dist/stream/sse.d.ts +2 -2
- package/dist/stream/sse.d.ts.map +1 -1
- package/dist/stream/sse.js +38 -2
- package/dist/syncer/api-parser.d.ts +10 -0
- package/dist/syncer/api-parser.d.ts.map +1 -0
- package/dist/syncer/api-parser.js +240 -0
- package/dist/syncer/checksum.d.ts +21 -0
- package/dist/syncer/checksum.d.ts.map +1 -0
- package/dist/syncer/checksum.js +98 -0
- package/dist/syncer/code-generator.d.ts +20 -0
- package/dist/syncer/code-generator.d.ts.map +1 -0
- package/dist/syncer/code-generator.js +161 -0
- package/dist/syncer/entity-operations.d.ts +17 -0
- package/dist/syncer/entity-operations.d.ts.map +1 -0
- package/dist/syncer/entity-operations.js +59 -0
- package/dist/syncer/file-patterns.d.ts +29 -0
- package/dist/syncer/file-patterns.d.ts.map +1 -0
- package/dist/syncer/file-patterns.js +38 -0
- package/dist/syncer/index.d.ts +6 -0
- package/dist/syncer/index.d.ts.map +1 -1
- package/dist/syncer/index.js +9 -2
- package/dist/syncer/module-loader.d.ts +35 -0
- package/dist/syncer/module-loader.d.ts.map +1 -0
- package/dist/syncer/module-loader.js +87 -0
- package/dist/syncer/syncer.d.ts +98 -106
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +422 -2
- package/dist/template/entity-converter.d.ts +14 -0
- package/dist/template/entity-converter.d.ts.map +1 -0
- package/dist/template/entity-converter.js +108 -0
- package/dist/template/helpers.d.ts +23 -0
- package/dist/template/helpers.d.ts.map +1 -0
- package/dist/template/helpers.js +64 -0
- package/dist/{templates → template/implementations}/entity.template.d.ts +3 -3
- package/dist/template/implementations/entity.template.d.ts.map +1 -0
- package/dist/template/implementations/entity.template.js +86 -0
- package/dist/{templates → template/implementations}/generated.template.d.ts +3 -4
- package/dist/template/implementations/generated.template.d.ts.map +1 -0
- package/dist/template/implementations/generated.template.js +249 -0
- package/dist/{templates → template/implementations}/generated_http.template.d.ts +3 -4
- package/dist/template/implementations/generated_http.template.d.ts.map +1 -0
- package/dist/template/implementations/generated_http.template.js +131 -0
- package/dist/{templates → template/implementations}/generated_sso.template.d.ts +4 -5
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -0
- package/dist/template/implementations/generated_sso.template.js +134 -0
- package/dist/{templates → template/implementations}/init_types.template.d.ts +3 -3
- package/dist/template/implementations/init_types.template.d.ts.map +1 -0
- package/dist/template/implementations/init_types.template.js +38 -0
- package/dist/template/implementations/model.template.d.ts +17 -0
- package/dist/template/implementations/model.template.d.ts.map +1 -0
- package/dist/template/implementations/model.template.js +181 -0
- package/dist/{templates → template/implementations}/model_test.template.d.ts +3 -3
- package/dist/template/implementations/model_test.template.d.ts.map +1 -0
- package/dist/template/implementations/model_test.template.js +35 -0
- package/dist/{templates → template/implementations}/service.template.d.ts +6 -6
- package/dist/template/implementations/service.template.d.ts.map +1 -0
- package/dist/template/implementations/service.template.js +201 -0
- package/dist/{templates → template/implementations}/view_enums_buttonset.template.d.ts +3 -3
- package/dist/template/implementations/view_enums_buttonset.template.d.ts.map +1 -0
- package/dist/template/implementations/view_enums_buttonset.template.js +31 -0
- package/dist/{templates → template/implementations}/view_enums_dropdown.template.d.ts +3 -4
- package/dist/template/implementations/view_enums_dropdown.template.d.ts.map +1 -0
- package/dist/template/implementations/view_enums_dropdown.template.js +50 -0
- package/dist/{templates → template/implementations}/view_enums_select.template.d.ts +3 -3
- package/dist/template/implementations/view_enums_select.template.d.ts.map +1 -0
- package/dist/template/implementations/view_enums_select.template.js +55 -0
- package/dist/{templates → template/implementations}/view_form.template.d.ts +5 -5
- package/dist/template/implementations/view_form.template.d.ts.map +1 -0
- package/dist/template/implementations/view_form.template.js +337 -0
- package/dist/{templates → template/implementations}/view_id_all_select.template.d.ts +3 -3
- package/dist/template/implementations/view_id_all_select.template.d.ts.map +1 -0
- package/dist/template/implementations/view_id_all_select.template.js +31 -0
- package/dist/{templates → template/implementations}/view_id_async_select.template.d.ts +3 -3
- package/dist/template/implementations/view_id_async_select.template.d.ts.map +1 -0
- package/dist/template/implementations/view_id_async_select.template.js +105 -0
- package/dist/{templates → template/implementations}/view_list.template.d.ts +5 -13
- package/dist/template/implementations/view_list.template.d.ts.map +1 -0
- package/dist/template/implementations/view_list.template.js +475 -0
- package/dist/template/implementations/view_list_columns.template.d.ts +17 -0
- package/dist/template/implementations/view_list_columns.template.d.ts.map +1 -0
- package/dist/template/implementations/view_list_columns.template.js +49 -0
- package/dist/{templates → template/implementations}/view_search_input.template.d.ts +3 -3
- package/dist/template/implementations/view_search_input.template.d.ts.map +1 -0
- package/dist/template/implementations/view_search_input.template.js +64 -0
- package/dist/template/index.d.ts +7 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +8 -0
- package/dist/template/template-manager.d.ts +56 -0
- package/dist/template/template-manager.d.ts.map +1 -0
- package/dist/template/template-manager.js +125 -0
- package/dist/template/template-types.d.ts +16 -0
- package/dist/template/template-types.d.ts.map +1 -0
- package/dist/template/template-types.js +7 -0
- package/dist/template/template.d.ts +49 -0
- package/dist/template/template.d.ts.map +1 -0
- package/dist/template/template.js +60 -0
- package/dist/template/zod-converter.d.ts +51 -0
- package/dist/template/zod-converter.d.ts.map +1 -0
- package/dist/template/zod-converter.js +449 -0
- 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 +89 -2
- package/dist/testing/fixture-manager.d.ts +42 -11
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +623 -2
- package/dist/types/types.d.ts +747 -143
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +546 -2
- package/dist/typings/knex.d.js +3 -2
- package/dist/utils/async-utils.d.ts +7 -0
- package/dist/utils/async-utils.d.ts.map +1 -1
- package/dist/utils/async-utils.js +57 -2
- package/dist/utils/console-util.d.ts +2 -0
- package/dist/utils/console-util.d.ts.map +1 -0
- package/dist/utils/console-util.js +6 -0
- package/dist/utils/controller.d.ts +1 -0
- package/dist/utils/controller.d.ts.map +1 -1
- package/dist/utils/controller.js +29 -2
- package/dist/utils/esm-utils.d.ts +39 -0
- package/dist/utils/esm-utils.d.ts.map +1 -0
- package/dist/utils/esm-utils.js +49 -0
- package/dist/utils/formatter.d.ts +3 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +110 -0
- package/dist/utils/fs-utils.d.ts +1 -1
- package/dist/utils/fs-utils.d.ts.map +1 -1
- package/dist/utils/fs-utils.js +17 -2
- package/dist/utils/lodash-able.d.ts.map +1 -1
- package/dist/utils/lodash-able.js +6 -2
- package/dist/utils/model.js +22 -2
- package/dist/utils/object-utils.d.ts +44 -0
- package/dist/utils/object-utils.d.ts.map +1 -0
- package/dist/utils/object-utils.js +191 -0
- package/dist/utils/path-utils.d.ts +89 -0
- package/dist/utils/path-utils.d.ts.map +1 -0
- package/dist/utils/path-utils.js +60 -0
- package/dist/utils/process-utils.d.ts +13 -0
- package/dist/utils/process-utils.d.ts.map +1 -0
- package/dist/utils/process-utils.js +36 -0
- package/dist/utils/sql-parser.d.ts +5 -1
- package/dist/utils/sql-parser.d.ts.map +1 -1
- package/dist/utils/sql-parser.js +46 -2
- package/dist/utils/type-utils.d.ts +23 -0
- package/dist/utils/type-utils.d.ts.map +1 -0
- package/dist/utils/type-utils.js +45 -0
- package/dist/utils/utils.d.ts +10 -7
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +72 -2
- 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 +19 -2
- package/package.json +65 -27
- package/src/ai/agents/agent.ts +87 -0
- package/src/ai/agents/index.ts +2 -0
- package/src/ai/agents/types.ts +47 -0
- package/src/ai/index.ts +1 -0
- package/src/ai/providers/rtzr/api.ts +37 -0
- package/src/ai/providers/rtzr/error.ts +34 -0
- package/src/ai/providers/rtzr/index.ts +4 -0
- package/src/ai/providers/rtzr/model.ts +201 -0
- package/src/ai/providers/rtzr/options.ts +49 -0
- package/src/ai/providers/rtzr/provider.ts +91 -0
- package/src/ai/providers/rtzr/utils.ts +127 -0
- package/src/api/base-frame.ts +4 -2
- package/src/api/caster.ts +17 -23
- package/src/api/code-converters.ts +178 -535
- package/src/api/config.ts +125 -0
- package/src/api/context.ts +7 -17
- package/src/api/decorators.ts +176 -46
- package/src/api/index.ts +2 -2
- package/src/api/sonamu.ts +190 -167
- package/src/api/validator.ts +83 -0
- package/src/bin/build-config.ts +8 -1
- package/src/bin/cli.ts +258 -124
- package/src/bin/hot-hook-register.ts +22 -0
- package/src/bin/loader-register.ts +38 -0
- package/src/database/_batch_update.ts +46 -31
- package/src/database/base-model.ts +390 -182
- package/src/database/base-model.types.ts +155 -0
- package/src/database/code-generator.ts +13 -32
- package/src/database/db.ts +40 -96
- package/src/database/puri-subset.test-d.ts +471 -0
- package/src/database/puri-subset.types.ts +195 -0
- package/src/database/puri-wrapper.ts +58 -67
- package/src/database/puri.ts +229 -148
- package/src/database/puri.types.ts +76 -30
- package/src/database/transaction-context.ts +1 -1
- package/src/database/upsert-builder.ts +262 -132
- package/src/entity/entity-manager.ts +48 -36
- package/src/entity/entity.ts +330 -248
- package/src/exceptions/error-handler.ts +3 -3
- package/src/exceptions/so-exceptions.ts +11 -11
- package/src/file-storage/driver.ts +5 -5
- package/src/file-storage/file-storage.ts +2 -2
- package/src/index.ts +18 -10
- package/src/migration/code-generation.ts +185 -172
- package/src/migration/migration-set.ts +80 -293
- package/src/migration/migrator.ts +199 -571
- package/src/migration/mysql-schema-reader.ts.txt +272 -0
- package/src/migration/postgresql-schema-reader.ts +310 -0
- package/src/migration/types.ts +6 -39
- package/src/naite/messaging-types.ts +51 -0
- package/src/naite/naite-reporter.ts +128 -0
- package/src/naite/naite.ts +415 -0
- package/src/shared/web.shared.ts.txt +20 -24
- package/src/stream/sse.ts +5 -5
- package/src/syncer/api-parser.ts +282 -0
- package/src/syncer/checksum.ts +140 -0
- package/src/syncer/code-generator.ts +198 -0
- package/src/syncer/entity-operations.ts +65 -0
- package/src/syncer/file-patterns.ts +56 -0
- package/src/syncer/index.ts +6 -0
- package/src/syncer/module-loader.ts +128 -0
- package/src/syncer/syncer.ts +389 -1453
- package/src/template/entity-converter.ts +114 -0
- package/src/template/helpers.ts +81 -0
- package/src/{templates → template/implementations}/entity.template.ts +7 -7
- package/src/{templates → template/implementations}/generated.template.ts +101 -101
- package/src/{templates → template/implementations}/generated_http.template.ts +27 -57
- package/src/template/implementations/generated_sso.template.ts +151 -0
- package/src/{templates → template/implementations}/init_types.template.ts +5 -7
- package/src/{templates → template/implementations}/model.template.ts +52 -43
- package/src/{templates → template/implementations}/model_test.template.ts +5 -5
- package/src/{templates → template/implementations}/service.template.ts +66 -82
- package/src/{templates → template/implementations}/view_enums_buttonset.template.ts +3 -3
- package/src/{templates → template/implementations}/view_enums_dropdown.template.ts +4 -20
- package/src/{templates → template/implementations}/view_enums_select.template.ts +4 -4
- package/src/{templates → template/implementations}/view_form.template.ts +40 -83
- package/src/{templates → template/implementations}/view_id_all_select.template.ts +3 -3
- package/src/{templates → template/implementations}/view_id_async_select.template.ts +10 -24
- package/src/{templates → template/implementations}/view_list.template.ts +60 -152
- package/src/{templates → template/implementations}/view_list_columns.template.ts +5 -11
- package/src/{templates → template/implementations}/view_search_input.template.ts +3 -3
- package/src/template/index.ts +6 -0
- package/src/template/template-manager.ts +166 -0
- package/src/template/template-types.ts +16 -0
- package/src/template/template.ts +105 -0
- package/src/template/zod-converter.ts +525 -0
- package/src/testing/_relation-graph.ts +18 -11
- package/src/testing/fixture-manager.ts +472 -359
- package/src/types/types.ts +553 -308
- package/src/typings/knex.d.ts +7 -9
- package/src/utils/async-utils.ts +23 -10
- package/src/utils/console-util.ts +4 -0
- package/src/utils/controller.ts +3 -0
- package/src/utils/esm-utils.ts +59 -0
- package/src/utils/formatter.ts +109 -0
- package/src/utils/fs-utils.ts +1 -1
- package/src/utils/lodash-able.ts +1 -4
- package/src/utils/object-utils.ts +217 -0
- package/src/utils/path-utils.ts +99 -0
- package/src/utils/process-utils.ts +46 -0
- package/src/utils/sql-parser.ts +23 -5
- package/src/utils/type-utils.ts +83 -0
- package/src/utils/utils.ts +66 -43
- package/src/utils/zod-error.ts +3 -4
- package/dist/api/base-frame.js.map +0 -1
- package/dist/api/caster.js.map +0 -1
- package/dist/api/code-converters.js.map +0 -1
- package/dist/api/context.js.map +0 -1
- package/dist/api/decorators.js.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/sonamu.js.map +0 -1
- package/dist/bin/build-config.js.map +0 -1
- package/dist/bin/cli-wrapper.d.ts +0 -3
- package/dist/bin/cli-wrapper.d.ts.map +0 -1
- package/dist/bin/cli-wrapper.js +0 -3
- package/dist/bin/cli-wrapper.js.map +0 -1
- package/dist/bin/cli.js.map +0 -1
- package/dist/database/_batch_update.js.map +0 -1
- package/dist/database/base-model.js.map +0 -1
- package/dist/database/code-generator.js.map +0 -1
- package/dist/database/db.js.map +0 -1
- package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts +0 -2
- package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts.map +0 -1
- package/dist/database/knex-plugins/knex-on-duplicate-update.js +0 -2
- package/dist/database/knex-plugins/knex-on-duplicate-update.js.map +0 -1
- package/dist/database/puri-wrapper.js.map +0 -1
- package/dist/database/puri.js.map +0 -1
- package/dist/database/puri.types.js.map +0 -1
- package/dist/database/transaction-context.js.map +0 -1
- package/dist/database/upsert-builder.js.map +0 -1
- package/dist/entity/entity-manager.js.map +0 -1
- package/dist/entity/entity-utils.d.ts +0 -61
- package/dist/entity/entity-utils.d.ts.map +0 -1
- package/dist/entity/entity-utils.js +0 -2
- package/dist/entity/entity-utils.js.map +0 -1
- package/dist/entity/entity.js.map +0 -1
- package/dist/exceptions/error-handler.js.map +0 -1
- package/dist/exceptions/so-exceptions.js.map +0 -1
- package/dist/file-storage/driver.js.map +0 -1
- package/dist/file-storage/file-storage.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/migration/code-generation.js.map +0 -1
- package/dist/migration/migration-set.js.map +0 -1
- package/dist/migration/migrator.js.map +0 -1
- package/dist/migration/types.js.map +0 -1
- package/dist/stream/index.js.map +0 -1
- package/dist/stream/sse.js.map +0 -1
- package/dist/syncer/index.js.map +0 -1
- package/dist/syncer/syncer.js.map +0 -1
- package/dist/templates/base-template.d.ts +0 -13
- package/dist/templates/base-template.d.ts.map +0 -1
- package/dist/templates/base-template.js +0 -2
- package/dist/templates/base-template.js.map +0 -1
- package/dist/templates/entity.template.d.ts.map +0 -1
- package/dist/templates/entity.template.js +0 -2
- package/dist/templates/entity.template.js.map +0 -1
- package/dist/templates/generated.template.d.ts.map +0 -1
- package/dist/templates/generated.template.js +0 -2
- package/dist/templates/generated.template.js.map +0 -1
- package/dist/templates/generated_http.template.d.ts.map +0 -1
- package/dist/templates/generated_http.template.js +0 -2
- package/dist/templates/generated_http.template.js.map +0 -1
- package/dist/templates/generated_sso.template.d.ts.map +0 -1
- package/dist/templates/generated_sso.template.js +0 -2
- package/dist/templates/generated_sso.template.js.map +0 -1
- package/dist/templates/index.d.ts +0 -2
- package/dist/templates/index.d.ts.map +0 -1
- package/dist/templates/index.js +0 -2
- package/dist/templates/index.js.map +0 -1
- package/dist/templates/init_types.template.d.ts.map +0 -1
- package/dist/templates/init_types.template.js +0 -2
- package/dist/templates/init_types.template.js.map +0 -1
- package/dist/templates/model.template.d.ts +0 -17
- package/dist/templates/model.template.d.ts.map +0 -1
- package/dist/templates/model.template.js +0 -2
- package/dist/templates/model.template.js.map +0 -1
- package/dist/templates/model_test.template.d.ts.map +0 -1
- package/dist/templates/model_test.template.js +0 -2
- package/dist/templates/model_test.template.js.map +0 -1
- package/dist/templates/service.template.d.ts.map +0 -1
- package/dist/templates/service.template.js +0 -2
- package/dist/templates/service.template.js.map +0 -1
- package/dist/templates/view_enums_buttonset.template.d.ts.map +0 -1
- package/dist/templates/view_enums_buttonset.template.js +0 -2
- package/dist/templates/view_enums_buttonset.template.js.map +0 -1
- package/dist/templates/view_enums_dropdown.template.d.ts.map +0 -1
- package/dist/templates/view_enums_dropdown.template.js +0 -2
- package/dist/templates/view_enums_dropdown.template.js.map +0 -1
- package/dist/templates/view_enums_select.template.d.ts.map +0 -1
- package/dist/templates/view_enums_select.template.js +0 -2
- package/dist/templates/view_enums_select.template.js.map +0 -1
- package/dist/templates/view_form.template.d.ts.map +0 -1
- package/dist/templates/view_form.template.js +0 -2
- package/dist/templates/view_form.template.js.map +0 -1
- package/dist/templates/view_id_all_select.template.d.ts.map +0 -1
- package/dist/templates/view_id_all_select.template.js +0 -2
- package/dist/templates/view_id_all_select.template.js.map +0 -1
- package/dist/templates/view_id_async_select.template.d.ts.map +0 -1
- package/dist/templates/view_id_async_select.template.js +0 -2
- package/dist/templates/view_id_async_select.template.js.map +0 -1
- package/dist/templates/view_list.template.d.ts.map +0 -1
- package/dist/templates/view_list.template.js +0 -2
- package/dist/templates/view_list.template.js.map +0 -1
- package/dist/templates/view_list_columns.template.d.ts +0 -17
- package/dist/templates/view_list_columns.template.d.ts.map +0 -1
- package/dist/templates/view_list_columns.template.js +0 -2
- package/dist/templates/view_list_columns.template.js.map +0 -1
- package/dist/templates/view_search_input.template.d.ts.map +0 -1
- package/dist/templates/view_search_input.template.js +0 -2
- package/dist/templates/view_search_input.template.js.map +0 -1
- package/dist/testing/_relation-graph.js.map +0 -1
- package/dist/testing/fixture-manager.js.map +0 -1
- package/dist/types/types.js.map +0 -1
- package/dist/typings/knex.d.js.map +0 -1
- package/dist/utils/async-utils.js.map +0 -1
- package/dist/utils/controller.js.map +0 -1
- package/dist/utils/fs-utils.js.map +0 -1
- package/dist/utils/lodash-able.js.map +0 -1
- package/dist/utils/model.js.map +0 -1
- package/dist/utils/sql-parser.js.map +0 -1
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/zod-error.js.map +0 -1
- package/src/bin/cli-wrapper.ts +0 -75
- package/src/database/knex-plugins/knex-on-duplicate-update.ts +0 -45
- package/src/entity/entity-utils.ts +0 -291
- package/src/templates/base-template.ts +0 -19
- package/src/templates/generated_sso.template.ts +0 -138
- package/src/templates/index.ts +0 -1
|
@@ -1,108 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* code-converters는 API 타입 정의들을 Zod 객체나 TypeScript 코드로 변환하는 함수들을 제공합니다.
|
|
3
|
+
*
|
|
4
|
+
* 1. API 시리즈들:
|
|
5
|
+
* - ExtendedApi, ApiParam, ApiParamType
|
|
6
|
+
* - API 메타데이터를 표현하는 타입 정의들
|
|
7
|
+
*
|
|
8
|
+
* 2. ZodObject 변환
|
|
9
|
+
* - API 타입 정의 → Zod 타입 인스턴스 (런타임 밸리데이션용)
|
|
10
|
+
* - getZodTypeFromApiParamType → getZodObjectFromApiParams → getZodObjectFromApi
|
|
11
|
+
*
|
|
12
|
+
* 3. TsTypeDef 변환
|
|
13
|
+
* - API 타입 정의 → TypeScript 타입 코드 문자열 (코드 생성용)
|
|
14
|
+
* - apiParamTypeToTsType → apiParamToTsCode, apiParamToTsCodeAsObject
|
|
15
|
+
*
|
|
16
|
+
* 참고:
|
|
17
|
+
* - ZodTypeDef 생성 (Zod 코드 문자열): zod-converter.ts의 zodTypeToZodCode 사용
|
|
18
|
+
* - EntityProp 변환: zod-converter.ts 참조
|
|
19
|
+
*/
|
|
20
|
+
|
|
1
21
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
EntityProp,
|
|
7
|
-
EntityPropNode,
|
|
8
|
-
TextProp,
|
|
9
|
-
isBelongsToOneRelationProp,
|
|
10
|
-
isBigIntegerProp,
|
|
11
|
-
isBooleanProp,
|
|
12
|
-
isDateProp,
|
|
13
|
-
isDateTimeProp,
|
|
14
|
-
isDecimalProp,
|
|
15
|
-
isDoubleProp,
|
|
16
|
-
isEnumProp,
|
|
17
|
-
isFloatProp,
|
|
18
|
-
isIntegerProp,
|
|
19
|
-
isJsonProp,
|
|
20
|
-
isOneToOneRelationProp,
|
|
21
|
-
isRelationProp,
|
|
22
|
-
isStringProp,
|
|
23
|
-
isTextProp,
|
|
24
|
-
isTimeProp,
|
|
25
|
-
isTimestampProp,
|
|
26
|
-
isUuidProp,
|
|
27
|
-
isVirtualProp,
|
|
28
|
-
} from "../types/types";
|
|
29
|
-
import { ExtendedApi } from "./decorators";
|
|
30
|
-
import type { Literal } from "zod/v4/core/util";
|
|
22
|
+
import type { core } from "zod/v4";
|
|
23
|
+
import type { $ZodLooseShape } from "zod/v4/core";
|
|
24
|
+
import { type ApiParam, ApiParamType } from "../types/types";
|
|
25
|
+
import type { ExtendedApi } from "./decorators";
|
|
31
26
|
|
|
32
27
|
// <any>를 자제하고, Zod에서 제약하는 기본적인 Generic Type Parameter를 사용함.
|
|
33
|
-
type AnyZodRecord = z.ZodRecord<z.ZodString | z.ZodNumber | z.ZodSymbol, z.ZodType>;
|
|
34
28
|
type AnyZodObject = z.ZodObject<$ZodLooseShape>;
|
|
35
|
-
type
|
|
36
|
-
type AnyZodNullable = z.ZodNullable<z.ZodType>;
|
|
37
|
-
type AnyZodOptional = z.ZodOptional<z.ZodType>;
|
|
38
|
-
type AnyZodDefault = z.ZodDefault<z.ZodType>;
|
|
39
|
-
type AnyZodLiteral = z.ZodLiteral<Literal>;
|
|
40
|
-
type AnyZodUnion = z.ZodUnion<z.ZodType[]>;
|
|
29
|
+
type AnyZodLiteral = z.ZodLiteral<core.util.Literal>;
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
[
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (api.typeParameters?.length > 0) {
|
|
52
|
-
api.typeParameters.map((typeParam) => {
|
|
53
|
-
if (typeParam.constraint) {
|
|
54
|
-
let zodType = getZodTypeFromApiParamType(
|
|
55
|
-
typeParam.constraint,
|
|
56
|
-
references
|
|
57
|
-
);
|
|
58
|
-
(references[typeParam.id] as any) = zodType;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
31
|
+
/**
|
|
32
|
+
* Promise 타입을 한 번 언래핑하여 내부 타입을 반환합니다.
|
|
33
|
+
* Promise가 아닌 경우 원본 타입을 그대로 반환합니다.
|
|
34
|
+
*/
|
|
35
|
+
export function unwrapPromiseOnce(paramType: ApiParamType) {
|
|
36
|
+
if (ApiParamType.isPromise(paramType)) {
|
|
37
|
+
return paramType.args?.[0];
|
|
38
|
+
} else {
|
|
39
|
+
return paramType;
|
|
61
40
|
}
|
|
62
|
-
|
|
63
|
-
const ReqType = getZodObjectFromApiParams(
|
|
64
|
-
api.parameters.filter(
|
|
65
|
-
(param) =>
|
|
66
|
-
!ApiParamType.isContext(param.type) &&
|
|
67
|
-
!ApiParamType.isRefKnex(param.type) &&
|
|
68
|
-
!(param.optional === true && param.name.startsWith("_")) // _로 시작하는 파라미터는 제외
|
|
69
|
-
),
|
|
70
|
-
references
|
|
71
|
-
);
|
|
72
|
-
return ReqType;
|
|
73
41
|
}
|
|
74
42
|
|
|
75
43
|
/*
|
|
76
|
-
|
|
77
|
-
*/
|
|
78
|
-
export function getZodObjectFromApiParams(
|
|
79
|
-
apiParams: ApiParam[],
|
|
80
|
-
references: {
|
|
81
|
-
[id: string]: AnyZodObject;
|
|
82
|
-
} = {}
|
|
83
|
-
): z.ZodObject {
|
|
84
|
-
return z.object(
|
|
85
|
-
apiParams.reduce((r, param) => {
|
|
86
|
-
let zodType = getZodTypeFromApiParamType(param.type, references);
|
|
87
|
-
if (param.optional) {
|
|
88
|
-
zodType = zodType.optional();
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
...r,
|
|
92
|
-
[param.name]: zodType,
|
|
93
|
-
};
|
|
94
|
-
}, {})
|
|
95
|
-
);
|
|
96
|
-
}
|
|
44
|
+
* API를 구성하는 요소들을 ZodObject로 변환하기 위한 함수들입니다.
|
|
45
|
+
*/
|
|
97
46
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
47
|
+
/**
|
|
48
|
+
* ApiParamType을 Zod 타입 인스턴스로 변환합니다.
|
|
49
|
+
* string, number, array, union 등 모든 ApiParamType을 처리하며,
|
|
50
|
+
* 순환참조가 발생하는 경우 z.unknown()으로 fallback합니다.
|
|
51
|
+
*/
|
|
101
52
|
export function getZodTypeFromApiParamType(
|
|
102
53
|
paramType: ApiParamType,
|
|
103
54
|
references: {
|
|
104
55
|
[id: string]: AnyZodObject;
|
|
105
|
-
}
|
|
56
|
+
},
|
|
106
57
|
): z.ZodType<unknown> {
|
|
107
58
|
switch (paramType) {
|
|
108
59
|
case "string":
|
|
@@ -111,58 +62,52 @@ export function getZodTypeFromApiParamType(
|
|
|
111
62
|
return z.number();
|
|
112
63
|
case "boolean":
|
|
113
64
|
return z.boolean();
|
|
114
|
-
default:
|
|
115
|
-
const advType = paramType as { t: string };
|
|
65
|
+
default: {
|
|
66
|
+
const advType = paramType as { t: string; value?: string | number };
|
|
116
67
|
switch (advType.t) {
|
|
117
68
|
case "string-literal":
|
|
118
69
|
case "numeric-literal":
|
|
119
|
-
return z.literal(
|
|
120
|
-
case "object":
|
|
70
|
+
return z.literal(advType.value);
|
|
71
|
+
case "object": {
|
|
121
72
|
const objType = paramType as { t: string; props: ApiParam[] };
|
|
122
73
|
return getZodObjectFromApiParams(objType.props);
|
|
123
|
-
|
|
74
|
+
}
|
|
75
|
+
case "array": {
|
|
124
76
|
const arrType = paramType as {
|
|
125
77
|
t: string;
|
|
126
78
|
elementsType: ApiParamType;
|
|
127
79
|
};
|
|
128
|
-
return z.array(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
case "ref":
|
|
80
|
+
return z.array(getZodTypeFromApiParamType(arrType.elementsType, references));
|
|
81
|
+
}
|
|
82
|
+
case "ref": {
|
|
132
83
|
const refType = paramType as {
|
|
133
84
|
t: string;
|
|
134
85
|
id: string;
|
|
135
86
|
args?: ApiParamType[];
|
|
136
87
|
};
|
|
137
|
-
|
|
138
88
|
// Date 타입 처리
|
|
139
89
|
if (refType.id === "Date") {
|
|
140
90
|
return z.date();
|
|
141
91
|
}
|
|
142
|
-
|
|
143
92
|
// 객체 키 관리 유틸리티
|
|
144
93
|
if (["Pick", "Omit"].includes(refType.id)) {
|
|
145
94
|
if (refType.args?.length !== 2) {
|
|
146
95
|
throw new Error(`잘못된 ${refType.id}`);
|
|
147
96
|
}
|
|
148
|
-
const [obj, literalOrUnion] = refType.args
|
|
149
|
-
getZodTypeFromApiParamType(arg, references)
|
|
97
|
+
const [obj, literalOrUnion] = refType.args.map(
|
|
98
|
+
(arg) => getZodTypeFromApiParamType(arg, references),
|
|
99
|
+
// biome-ignore lint/suspicious/noExplicitAny: 생성되는 ZodUnion의 타입을 추적하기 어려움
|
|
150
100
|
) as [AnyZodObject, z.ZodUnion<any> | AnyZodLiteral];
|
|
101
|
+
|
|
151
102
|
let keys: string[] = [];
|
|
152
103
|
if (literalOrUnion instanceof z.ZodUnion) {
|
|
153
104
|
keys = literalOrUnion.def.options.map(
|
|
154
|
-
(option: { def: {
|
|
105
|
+
(option: { def: { values: string[] } }) => option.def.values[0],
|
|
155
106
|
);
|
|
156
107
|
} else {
|
|
157
108
|
keys = (literalOrUnion as z.ZodLiteral<string>).def.values;
|
|
158
109
|
}
|
|
159
|
-
const keyRecord = keys.
|
|
160
|
-
return {
|
|
161
|
-
...result,
|
|
162
|
-
[key]: true,
|
|
163
|
-
};
|
|
164
|
-
}, {} as any);
|
|
165
|
-
|
|
110
|
+
const keyRecord = Object.fromEntries(keys.map((key) => [key, true as const]));
|
|
166
111
|
if (refType.id === "Pick") {
|
|
167
112
|
if (obj.pick) {
|
|
168
113
|
return obj.pick(keyRecord);
|
|
@@ -178,303 +123,130 @@ export function getZodTypeFromApiParamType(
|
|
|
178
123
|
throw new Error(`잘못된 ${refType.id}`);
|
|
179
124
|
}
|
|
180
125
|
const obj = getZodTypeFromApiParamType(refType.args[0], references);
|
|
181
|
-
|
|
126
|
+
// biome-ignore lint/suspicious/noExplicitAny: Partial 인수 타입 캐스팅
|
|
127
|
+
return (obj as z.ZodObject<any>).partial();
|
|
182
128
|
}
|
|
183
|
-
|
|
184
129
|
const reference = references[refType.id];
|
|
185
130
|
if (reference === undefined) {
|
|
186
|
-
return z.
|
|
131
|
+
return z.unknown();
|
|
187
132
|
// throw new Error(`ref 참조 불가 ${refType.id}`);
|
|
188
133
|
}
|
|
189
134
|
return reference;
|
|
190
|
-
|
|
135
|
+
}
|
|
136
|
+
case "union": {
|
|
191
137
|
const unionType = paramType as {
|
|
192
138
|
t: string;
|
|
193
139
|
types: ApiParamType[];
|
|
194
140
|
};
|
|
195
141
|
// nullable 유니온
|
|
196
|
-
if (
|
|
197
|
-
unionType.types.length === 2 &&
|
|
198
|
-
unionType.types.some((type) => type === "null")
|
|
199
|
-
) {
|
|
142
|
+
if (unionType.types.length === 2 && unionType.types.some((type) => type === "null")) {
|
|
200
143
|
if (unionType.types[0] === "null") {
|
|
201
|
-
return getZodTypeFromApiParamType(
|
|
202
|
-
unionType.types[1],
|
|
203
|
-
references
|
|
204
|
-
).nullable();
|
|
144
|
+
return getZodTypeFromApiParamType(unionType.types[1], references).nullable();
|
|
205
145
|
} else {
|
|
206
|
-
return getZodTypeFromApiParamType(
|
|
207
|
-
unionType.types[0],
|
|
208
|
-
references
|
|
209
|
-
).nullable();
|
|
146
|
+
return getZodTypeFromApiParamType(unionType.types[0], references).nullable();
|
|
210
147
|
}
|
|
211
148
|
}
|
|
212
|
-
|
|
213
149
|
// 일반 유니온
|
|
214
150
|
return z.union(
|
|
215
|
-
unionType.types.map((type) =>
|
|
216
|
-
getZodTypeFromApiParamType(type, references)
|
|
217
|
-
) as any
|
|
151
|
+
unionType.types.map((type) => getZodTypeFromApiParamType(type, references)),
|
|
218
152
|
);
|
|
219
|
-
|
|
153
|
+
}
|
|
154
|
+
case "intersection": {
|
|
220
155
|
const intersectionType = paramType as {
|
|
221
156
|
t: string;
|
|
222
157
|
types: ApiParamType[];
|
|
223
158
|
};
|
|
224
|
-
return intersectionType.types.reduce(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
159
|
+
return intersectionType.types.reduce(
|
|
160
|
+
(result, type, index) => {
|
|
161
|
+
const resolvedType = getZodTypeFromApiParamType(type, references);
|
|
162
|
+
if (index === 0) {
|
|
163
|
+
return resolvedType;
|
|
164
|
+
} else {
|
|
165
|
+
return z.intersection(result, resolvedType);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
z.unknown() as z.ZodType<unknown>,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
case "tuple-type": {
|
|
233
172
|
const tupleType = paramType as ApiParamType.TupleType;
|
|
234
173
|
return z.tuple(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
) as any
|
|
174
|
+
// biome-ignore lint/suspicious/noExplicitAny: 생성되는 ZodTuple의 타입을 추적하기 어려움
|
|
175
|
+
tupleType.elements.map((elem) => getZodTypeFromApiParamType(elem, references)) as any,
|
|
238
176
|
);
|
|
177
|
+
}
|
|
239
178
|
}
|
|
240
179
|
return z.unknown();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export function propNodeToZodTypeDef(
|
|
245
|
-
propNode: EntityPropNode,
|
|
246
|
-
injectImportKeys: string[]
|
|
247
|
-
): string {
|
|
248
|
-
if (propNode.nodeType === "plain") {
|
|
249
|
-
return propToZodTypeDef(propNode.prop, injectImportKeys);
|
|
250
|
-
} else if (propNode.nodeType === "array") {
|
|
251
|
-
return [
|
|
252
|
-
propNode.prop ? `${propNode.prop.name}: ` : "",
|
|
253
|
-
"z.array(z.object({",
|
|
254
|
-
propNode.children
|
|
255
|
-
.map((childPropNode) =>
|
|
256
|
-
propNodeToZodTypeDef(childPropNode, injectImportKeys)
|
|
257
|
-
)
|
|
258
|
-
.join("\n"),
|
|
259
|
-
"",
|
|
260
|
-
"})),",
|
|
261
|
-
].join("\n");
|
|
262
|
-
} else if (propNode.nodeType === "object") {
|
|
263
|
-
return [
|
|
264
|
-
propNode.prop ? `${propNode.prop.name}: ` : "",
|
|
265
|
-
"z.object({",
|
|
266
|
-
propNode.children
|
|
267
|
-
.map((childPropNode) =>
|
|
268
|
-
propNodeToZodTypeDef(childPropNode, injectImportKeys)
|
|
269
|
-
)
|
|
270
|
-
.join("\n"),
|
|
271
|
-
"",
|
|
272
|
-
`})${propNode.prop && propNode.prop.nullable ? ".nullable()" : ""},`,
|
|
273
|
-
].join("\n");
|
|
274
|
-
} else {
|
|
275
|
-
throw Error;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export function getTextTypeLength(textType: TextProp["textType"]): number {
|
|
280
|
-
switch (textType) {
|
|
281
|
-
case "text":
|
|
282
|
-
return 1024 * 64 - 1;
|
|
283
|
-
case "mediumtext":
|
|
284
|
-
return 1024 * 1024 * 16 - 1;
|
|
285
|
-
case "longtext":
|
|
286
|
-
return 1024 * 1024 * 1024 * 4 - 1;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function propToZodTypeDef(
|
|
291
|
-
prop: EntityProp,
|
|
292
|
-
injectImportKeys: string[]
|
|
293
|
-
): string {
|
|
294
|
-
let stmt: string;
|
|
295
|
-
if (isIntegerProp(prop)) {
|
|
296
|
-
stmt = `${prop.name}: z.int()`;
|
|
297
|
-
} else if (isBigIntegerProp(prop)) {
|
|
298
|
-
stmt = `${prop.name}: z.bigint()`;
|
|
299
|
-
} else if (isTextProp(prop)) {
|
|
300
|
-
stmt = `${prop.name}: z.string().max(${getTextTypeLength(prop.textType)})`;
|
|
301
|
-
} else if (isEnumProp(prop)) {
|
|
302
|
-
stmt = `${prop.name}: ${prop.id}`;
|
|
303
|
-
injectImportKeys.push(prop.id);
|
|
304
|
-
} else if (isStringProp(prop)) {
|
|
305
|
-
stmt = `${prop.name}: z.string().max(${prop.length})`;
|
|
306
|
-
} else if (isDecimalProp(prop)) {
|
|
307
|
-
stmt = `${prop.name}: z.string()`;
|
|
308
|
-
} else if (isFloatProp(prop) || isDoubleProp(prop)) {
|
|
309
|
-
stmt = `${prop.name}: z.number()`;
|
|
310
|
-
} else if (isBooleanProp(prop)) {
|
|
311
|
-
stmt = `${prop.name}: z.boolean()`;
|
|
312
|
-
} else if (isDateProp(prop)) {
|
|
313
|
-
stmt = `${prop.name}: z.string().length(10)`;
|
|
314
|
-
} else if (isTimeProp(prop)) {
|
|
315
|
-
stmt = `${prop.name}: z.string().length(8)`;
|
|
316
|
-
} else if (isDateTimeProp(prop)) {
|
|
317
|
-
stmt = `${prop.name}: z.date()`;
|
|
318
|
-
} else if (isTimestampProp(prop)) {
|
|
319
|
-
stmt = `${prop.name}: z.date()`;
|
|
320
|
-
} else if (isJsonProp(prop)) {
|
|
321
|
-
stmt = `${prop.name}: ${prop.id}`;
|
|
322
|
-
injectImportKeys.push(prop.id);
|
|
323
|
-
} else if (isUuidProp(prop)) {
|
|
324
|
-
stmt = `${prop.name}: z.uuid()`;
|
|
325
|
-
} else if (isVirtualProp(prop)) {
|
|
326
|
-
stmt = `${prop.name}: ${prop.id}`;
|
|
327
|
-
injectImportKeys.push(prop.id);
|
|
328
|
-
} else if (isRelationProp(prop)) {
|
|
329
|
-
if (
|
|
330
|
-
isBelongsToOneRelationProp(prop) ||
|
|
331
|
-
(isOneToOneRelationProp(prop) && prop.hasJoinColumn)
|
|
332
|
-
) {
|
|
333
|
-
stmt = `${prop.name}_id: z.int()`;
|
|
334
|
-
} else {
|
|
335
|
-
// 그외 relation 케이스 제외
|
|
336
|
-
return `// ${prop.name}: ${prop.relationType} ${prop.with}`;
|
|
337
180
|
}
|
|
338
|
-
} else {
|
|
339
|
-
return "// unable to resolve";
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if ((prop as { unsigned?: boolean }).unsigned) {
|
|
343
|
-
stmt += ".nonnegative()";
|
|
344
181
|
}
|
|
345
|
-
if (prop.nullable) {
|
|
346
|
-
stmt += ".nullable()";
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return stmt + ",";
|
|
350
182
|
}
|
|
351
183
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return "z.undefined()";
|
|
369
|
-
case "any":
|
|
370
|
-
return "z.any()";
|
|
371
|
-
case "unknown":
|
|
372
|
-
return "z.unknown()";
|
|
373
|
-
case "never":
|
|
374
|
-
return "z.never()";
|
|
375
|
-
case "nullable":
|
|
376
|
-
return zodTypeToZodCode((zt as AnyZodNullable).def.innerType) + ".nullable()";
|
|
377
|
-
case "default":
|
|
378
|
-
const zDefaultDef = (zt as AnyZodDefault).def;
|
|
379
|
-
return (
|
|
380
|
-
zodTypeToZodCode(zDefaultDef.innerType) +
|
|
381
|
-
`.default(${zDefaultDef.defaultValue})`
|
|
382
|
-
);
|
|
383
|
-
case "record":
|
|
384
|
-
const zRecordDef = (zt as AnyZodRecord).def;
|
|
385
|
-
return `z.record(${zodTypeToZodCode(zRecordDef.keyType)}, ${zodTypeToZodCode(
|
|
386
|
-
zRecordDef.valueType
|
|
387
|
-
)})`;
|
|
388
|
-
case "literal":
|
|
389
|
-
const items = Array.from((zt as z.ZodLiteral<any>).values).map(value => {
|
|
390
|
-
if (typeof value === "string") {
|
|
391
|
-
return `"${value}"`;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
if (value === null) {
|
|
395
|
-
return `null`;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
if (value === undefined) {
|
|
399
|
-
return `undefined`;
|
|
184
|
+
/**
|
|
185
|
+
* ApiParam 배열을 ZodObject로 변환합니다.
|
|
186
|
+
* 각 파라미터의 optional 여부를 반영하여 Zod 스키마를 생성합니다.
|
|
187
|
+
*/
|
|
188
|
+
export function getZodObjectFromApiParams(
|
|
189
|
+
apiParams: ApiParam[],
|
|
190
|
+
references: {
|
|
191
|
+
[id: string]: AnyZodObject;
|
|
192
|
+
} = {},
|
|
193
|
+
): z.ZodObject {
|
|
194
|
+
return z.object(
|
|
195
|
+
Object.fromEntries(
|
|
196
|
+
apiParams.map((param) => {
|
|
197
|
+
let zodType = getZodTypeFromApiParamType(param.type, references);
|
|
198
|
+
if (param.optional) {
|
|
199
|
+
zodType = zodType.optional();
|
|
400
200
|
}
|
|
201
|
+
return [param.name, zodType];
|
|
202
|
+
}),
|
|
203
|
+
),
|
|
204
|
+
);
|
|
205
|
+
}
|
|
401
206
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
207
|
+
/**
|
|
208
|
+
* ExtendedApi를 ZodObject로 변환합니다.
|
|
209
|
+
* TypeParameter와 일반 파라미터를 처리하며,
|
|
210
|
+
* Context, RefKnex, _로 시작하는 optional 파라미터는 제외합니다.
|
|
211
|
+
*/
|
|
212
|
+
export function getZodObjectFromApi(
|
|
213
|
+
api: ExtendedApi,
|
|
214
|
+
references: {
|
|
215
|
+
[id: string]: AnyZodObject;
|
|
216
|
+
} = {},
|
|
217
|
+
) {
|
|
218
|
+
if (api.typeParameters?.length > 0) {
|
|
219
|
+
for (const typeParam of api.typeParameters) {
|
|
220
|
+
if (typeParam.constraint) {
|
|
221
|
+
const zodType = getZodTypeFromApiParamType(typeParam.constraint, references);
|
|
222
|
+
// biome-ignore lint/suspicious/noExplicitAny: 레퍼런스 타입 캐스팅
|
|
223
|
+
(references[typeParam.id] as z.ZodType<any>) = zodType;
|
|
407
224
|
}
|
|
408
|
-
|
|
409
|
-
case "union":
|
|
410
|
-
return `z.union([${(zt as AnyZodUnion).def.options
|
|
411
|
-
.map((option: z.ZodType) => zodTypeToZodCode(option))
|
|
412
|
-
.join(",")}])`;
|
|
413
|
-
case "enum":
|
|
414
|
-
// NOTE: z.enum(["A", "B"])도 z.enum({ A: "A", B: "B" })로 처리됨.
|
|
415
|
-
return `z.enum({${Object.entries((zt as z.ZodEnum).def.entries)
|
|
416
|
-
.map(([key, val]) =>
|
|
417
|
-
typeof val === "string" ? `${key}: "${val}"` : `${key}: ${val}`)
|
|
418
|
-
.join(", ")}})`;
|
|
419
|
-
case "array":
|
|
420
|
-
return `z.array(${zodTypeToZodCode((zt as z.ZodArray<z.ZodType>).def.element)})`;
|
|
421
|
-
case "object":
|
|
422
|
-
const shape = (zt as any).shape;
|
|
423
|
-
return [
|
|
424
|
-
"z.object({",
|
|
425
|
-
...Object.keys(shape).map(
|
|
426
|
-
(key) => `${key}: ${zodTypeToZodCode(shape[key])},`
|
|
427
|
-
),
|
|
428
|
-
"})",
|
|
429
|
-
].join("\n");
|
|
430
|
-
case "optional":
|
|
431
|
-
return zodTypeToZodCode((zt as z.ZodOptional<z.ZodType>).def.innerType) + ".optional()";
|
|
432
|
-
case "file":
|
|
433
|
-
return `z.file()`;
|
|
434
|
-
case "intersection":
|
|
435
|
-
const zIntersectionDef = (zt as z.ZodIntersection<z.ZodType, z.ZodType>).def;
|
|
436
|
-
return `z.intersection(${zodTypeToZodCode(zIntersectionDef.left)}, ${zodTypeToZodCode(zIntersectionDef.right)})`;
|
|
437
|
-
case "file":
|
|
438
|
-
return `z.file()`;
|
|
439
|
-
default:
|
|
440
|
-
throw new Error(`처리되지 않은 ZodType ${zt.def.type}`);
|
|
225
|
+
}
|
|
441
226
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
params: ApiParam[],
|
|
446
|
-
injectImportKeys: string[]
|
|
447
|
-
): string {
|
|
448
|
-
return params
|
|
449
|
-
.map((param) => {
|
|
450
|
-
return `${param.name}${
|
|
451
|
-
param.optional && !param.defaultDef ? "?" : ""
|
|
452
|
-
}: ${apiParamTypeToTsType(param.type, injectImportKeys)}${
|
|
453
|
-
param.defaultDef ? `= ${param.defaultDef}` : ""
|
|
454
|
-
}`;
|
|
455
|
-
})
|
|
456
|
-
.join(", ");
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
export function apiParamToTsCodeAsObject(
|
|
460
|
-
params: ApiParam[],
|
|
461
|
-
injectImportKeys: string[]
|
|
462
|
-
): string {
|
|
463
|
-
return `{ ${params
|
|
464
|
-
.map(
|
|
227
|
+
const ReqType = getZodObjectFromApiParams(
|
|
228
|
+
// api parsing한 결과가 api params
|
|
229
|
+
api.parameters.filter(
|
|
465
230
|
(param) =>
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
231
|
+
!ApiParamType.isContext(param.type) &&
|
|
232
|
+
!ApiParamType.isRefKnex(param.type) &&
|
|
233
|
+
!(param.optional === true && param.name.startsWith("_")), // _로 시작하는 파라미터는 제외
|
|
234
|
+
),
|
|
235
|
+
references,
|
|
236
|
+
);
|
|
237
|
+
return ReqType;
|
|
472
238
|
}
|
|
473
239
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
240
|
+
/*
|
|
241
|
+
* API 타입 정의를 TypeScript 코드 문자열로 변환하기 위한 함수들입니다.
|
|
242
|
+
*/
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* ApiParamType을 TypeScript 타입 문자열로 변환합니다.
|
|
246
|
+
* union, intersection, array, ref 등 모든 타입을 TS 문법으로 표현하며,
|
|
247
|
+
* import가 필요한 타입 ID는 injectImportKeys에 수집합니다.
|
|
248
|
+
*/
|
|
249
|
+
export function apiParamTypeToTsType(paramType: ApiParamType, injectImportKeys: string[]): string {
|
|
478
250
|
if (
|
|
479
251
|
[
|
|
480
252
|
"string",
|
|
@@ -497,22 +269,13 @@ export function apiParamTypeToTsType(
|
|
|
497
269
|
} else if (ApiParamType.isNumericLiteral(paramType)) {
|
|
498
270
|
return String(paramType.value);
|
|
499
271
|
} else if (ApiParamType.isUnion(paramType)) {
|
|
500
|
-
return paramType.types
|
|
501
|
-
.map((type) => apiParamTypeToTsType(type, injectImportKeys))
|
|
502
|
-
.join(" | ");
|
|
272
|
+
return paramType.types.map((type) => apiParamTypeToTsType(type, injectImportKeys)).join(" | ");
|
|
503
273
|
} else if (ApiParamType.isIntersection(paramType)) {
|
|
504
|
-
return paramType.types
|
|
505
|
-
.map((type) => apiParamTypeToTsType(type, injectImportKeys))
|
|
506
|
-
.join(" & ");
|
|
274
|
+
return paramType.types.map((type) => apiParamTypeToTsType(type, injectImportKeys)).join(" & ");
|
|
507
275
|
} else if (ApiParamType.isArray(paramType)) {
|
|
508
|
-
return (
|
|
509
|
-
apiParamTypeToTsType(paramType.elementsType, injectImportKeys) + "[]"
|
|
510
|
-
);
|
|
276
|
+
return `${apiParamTypeToTsType(paramType.elementsType, injectImportKeys)}[]`;
|
|
511
277
|
} else if (ApiParamType.isRef(paramType)) {
|
|
512
|
-
if (
|
|
513
|
-
["Pick", "Omit", "Promise", "Partial", "Date"].includes(paramType.id) ===
|
|
514
|
-
false
|
|
515
|
-
) {
|
|
278
|
+
if (["Pick", "Omit", "Promise", "Partial", "Date"].includes(paramType.id) === false) {
|
|
516
279
|
// importKeys 인젝션
|
|
517
280
|
injectImportKeys.push(paramType.id);
|
|
518
281
|
}
|
|
@@ -526,19 +289,14 @@ export function apiParamTypeToTsType(
|
|
|
526
289
|
} else if (ApiParamType.isIndexedAccess(paramType)) {
|
|
527
290
|
return `${apiParamTypeToTsType(
|
|
528
291
|
paramType.object,
|
|
529
|
-
injectImportKeys
|
|
292
|
+
injectImportKeys,
|
|
530
293
|
)}[${apiParamTypeToTsType(paramType.index, injectImportKeys)}]`;
|
|
531
294
|
} else if (ApiParamType.isTupleType(paramType)) {
|
|
532
|
-
return `[ ${paramType.elements.map((elem) =>
|
|
533
|
-
apiParamTypeToTsType(elem, injectImportKeys)
|
|
534
|
-
)} ]`;
|
|
295
|
+
return `[ ${paramType.elements.map((elem) => apiParamTypeToTsType(elem, injectImportKeys))} ]`;
|
|
535
296
|
} else if (ApiParamType.isTypeParam(paramType)) {
|
|
536
297
|
return `<${paramType.id}${
|
|
537
298
|
paramType.constraint
|
|
538
|
-
? ` extends ${apiParamTypeToTsType(
|
|
539
|
-
paramType.constraint,
|
|
540
|
-
injectImportKeys
|
|
541
|
-
)}`
|
|
299
|
+
? ` extends ${apiParamTypeToTsType(paramType.constraint, injectImportKeys)}`
|
|
542
300
|
: ""
|
|
543
301
|
}>`;
|
|
544
302
|
} else {
|
|
@@ -546,149 +304,34 @@ export function apiParamTypeToTsType(
|
|
|
546
304
|
}
|
|
547
305
|
}
|
|
548
306
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
shape: Object.keys((zt as AnyZodObject).shape).reduce(
|
|
564
|
-
(result, key) => {
|
|
565
|
-
return {
|
|
566
|
-
...result,
|
|
567
|
-
[key]: serializeZodType((zt as AnyZodObject).shape[key]),
|
|
568
|
-
};
|
|
569
|
-
},
|
|
570
|
-
{}
|
|
571
|
-
),
|
|
572
|
-
};
|
|
573
|
-
case "array":
|
|
574
|
-
return {
|
|
575
|
-
type: "array",
|
|
576
|
-
element: serializeZodType((zt as AnyZodArray).def.element),
|
|
577
|
-
};
|
|
578
|
-
case "enum":
|
|
579
|
-
return {
|
|
580
|
-
type: "enum",
|
|
581
|
-
values: (zt as z.ZodEnum).def.entries,
|
|
582
|
-
};
|
|
583
|
-
case "string":
|
|
584
|
-
return {
|
|
585
|
-
type: "string",
|
|
586
|
-
checks: zt.def.checks,
|
|
587
|
-
};
|
|
588
|
-
case "number":
|
|
589
|
-
return {
|
|
590
|
-
type: "number",
|
|
591
|
-
checks: zt.def.checks,
|
|
592
|
-
};
|
|
593
|
-
case "boolean":
|
|
594
|
-
return {
|
|
595
|
-
type: "boolean",
|
|
596
|
-
};
|
|
597
|
-
case "nullable":
|
|
598
|
-
return {
|
|
599
|
-
...serializeZodType((zt as AnyZodNullable).def.innerType),
|
|
600
|
-
nullable: true,
|
|
601
|
-
};
|
|
602
|
-
case "optional":
|
|
603
|
-
return {
|
|
604
|
-
...serializeZodType((zt as AnyZodOptional).def.innerType),
|
|
605
|
-
optional: true,
|
|
606
|
-
};
|
|
607
|
-
case "any":
|
|
608
|
-
return {
|
|
609
|
-
type: "any",
|
|
610
|
-
};
|
|
611
|
-
case "record":
|
|
612
|
-
return {
|
|
613
|
-
type: "record",
|
|
614
|
-
keyType: serializeZodType((zt as AnyZodRecord).def.keyType),
|
|
615
|
-
valueType: serializeZodType((zt as AnyZodRecord).def.valueType),
|
|
616
|
-
};
|
|
617
|
-
case "union":
|
|
618
|
-
return {
|
|
619
|
-
type: "union",
|
|
620
|
-
options: (zt.def as AnyZodUnion).options.map((option) =>
|
|
621
|
-
serializeZodType(option)
|
|
622
|
-
),
|
|
623
|
-
};
|
|
624
|
-
default:
|
|
625
|
-
throw new Error(
|
|
626
|
-
`Serialize 로직이 정의되지 않은 ZodType: ${zt.def.type}`
|
|
627
|
-
);
|
|
628
|
-
}
|
|
307
|
+
/**
|
|
308
|
+
* ApiParam 배열을 TypeScript 함수 파라미터 코드로 변환합니다.
|
|
309
|
+
* 예: "name: string, age?: number, active: boolean = true"
|
|
310
|
+
*/
|
|
311
|
+
export function apiParamToTsCode(params: ApiParam[], injectImportKeys: string[]): string {
|
|
312
|
+
return params
|
|
313
|
+
.map((param) => {
|
|
314
|
+
return `${param.name}${
|
|
315
|
+
param.optional && !param.defaultDef ? "?" : ""
|
|
316
|
+
}: ${apiParamTypeToTsType(param.type, injectImportKeys)}${
|
|
317
|
+
param.defaultDef ? `= ${param.defaultDef}` : ""
|
|
318
|
+
}`;
|
|
319
|
+
})
|
|
320
|
+
.join(", ");
|
|
629
321
|
}
|
|
630
322
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
case "nullable":
|
|
646
|
-
return zodTypeToTsTypeDef((zt as AnyZodNullable).def.innerType) + " | null";
|
|
647
|
-
case "default":
|
|
648
|
-
return zodTypeToTsTypeDef((zt as AnyZodDefault).def.innerType);
|
|
649
|
-
case "record":
|
|
650
|
-
const recordType = zt as AnyZodRecord;
|
|
651
|
-
return `{ [ key: ${zodTypeToTsTypeDef(recordType.def.keyType)} ]: ${zodTypeToTsTypeDef(recordType.def.valueType)}}`;
|
|
652
|
-
case "literal":
|
|
653
|
-
return Array.from((zt as z.ZodLiteral).values).map(value => {
|
|
654
|
-
if (typeof value === "string") {
|
|
655
|
-
return `"${value}"`;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
if (value === null) {
|
|
659
|
-
return `null`;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
if (value === undefined) {
|
|
663
|
-
return `undefined`;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
return `${value}`;
|
|
667
|
-
}).join(" | ")
|
|
668
|
-
case "union":
|
|
669
|
-
return `${(zt as AnyZodUnion).options
|
|
670
|
-
.map((option) => zodTypeToTsTypeDef(option))
|
|
671
|
-
.join(" | ")}`;
|
|
672
|
-
case "enum":
|
|
673
|
-
return `${(zt as z.ZodEnum).options.map((val) => `"${val}"`).join(" | ")}`;
|
|
674
|
-
case "array":
|
|
675
|
-
return `${zodTypeToTsTypeDef((zt as AnyZodArray).element)}[]`;
|
|
676
|
-
case "object":
|
|
677
|
-
const shape = (zt as AnyZodObject).shape;
|
|
678
|
-
return [
|
|
679
|
-
"{",
|
|
680
|
-
...Object.keys(shape).map((key) => {
|
|
681
|
-
if (shape[key].def.type === "optional") {
|
|
682
|
-
return `${key}?: ${zodTypeToTsTypeDef(shape[key].def.innerType)},`;
|
|
683
|
-
} else {
|
|
684
|
-
return `${key}: ${zodTypeToTsTypeDef(shape[key])},`;
|
|
685
|
-
}
|
|
686
|
-
}),
|
|
687
|
-
"}",
|
|
688
|
-
].join("\n");
|
|
689
|
-
case "optional":
|
|
690
|
-
return zodTypeToTsTypeDef((zt as AnyZodOptional).def.innerType) + " | undefined";
|
|
691
|
-
default:
|
|
692
|
-
throw new Error(`처리되지 않은 ZodType ${zt.def.type}`);
|
|
693
|
-
}
|
|
323
|
+
/**
|
|
324
|
+
* ApiParam 배열을 TypeScript 객체 타입 코드로 변환합니다.
|
|
325
|
+
* 예: "{ name: string, age?: number, active: boolean = true }"
|
|
326
|
+
*/
|
|
327
|
+
export function apiParamToTsCodeAsObject(params: ApiParam[], injectImportKeys: string[]): string {
|
|
328
|
+
return `{ ${params
|
|
329
|
+
.map(
|
|
330
|
+
(param) =>
|
|
331
|
+
`${param.name}${param.optional ? "?" : ""}: ${apiParamTypeToTsType(
|
|
332
|
+
param.type,
|
|
333
|
+
injectImportKeys,
|
|
334
|
+
)}${param.defaultDef ? `= ${param.defaultDef}` : ""}`,
|
|
335
|
+
)
|
|
336
|
+
.join(", ")} }`;
|
|
694
337
|
}
|