sonamu 0.4.14 → 0.5.1
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 +15 -0
- package/dist/api/base-frame.d.ts +8 -0
- package/dist/api/base-frame.d.ts.map +1 -0
- package/dist/api/base-frame.js +2 -0
- package/dist/api/base-frame.js.map +1 -0
- package/dist/api/caster.d.ts +5 -0
- package/dist/api/caster.d.ts.map +1 -0
- package/dist/api/caster.js +2 -0
- package/dist/api/caster.js.map +1 -0
- package/dist/api/code-converters.d.ts +23 -0
- package/dist/api/code-converters.d.ts.map +1 -0
- package/dist/api/code-converters.js +2 -0
- package/dist/api/code-converters.js.map +1 -0
- package/dist/api/context.d.ts +19 -0
- package/dist/api/context.d.ts.map +1 -0
- package/dist/api/context.js +2 -0
- package/dist/api/context.js.map +1 -0
- package/dist/api/decorators.d.ts +50 -0
- package/dist/api/decorators.d.ts.map +1 -0
- package/dist/api/decorators.js +2 -0
- package/dist/api/decorators.js.map +1 -0
- package/dist/api/index.d.ts +8 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/sonamu.d.ts +84 -0
- package/dist/api/sonamu.d.ts.map +1 -0
- package/dist/api/sonamu.js +2 -0
- package/dist/api/sonamu.js.map +1 -0
- package/dist/bin/build-config.d.ts +9 -0
- package/dist/bin/build-config.d.ts.map +1 -0
- package/dist/bin/build-config.js +2 -0
- package/dist/bin/build-config.js.map +1 -0
- package/dist/bin/cli-wrapper.d.ts +2 -0
- package/dist/bin/cli-wrapper.d.ts.map +1 -0
- package/dist/bin/cli-wrapper.js +1 -38
- package/dist/bin/cli-wrapper.js.map +1 -1
- package/dist/bin/cli.d.ts +2 -2
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +1 -903
- package/dist/bin/cli.js.map +1 -1
- package/dist/database/_batch_update.d.ts +15 -0
- package/dist/database/_batch_update.d.ts.map +1 -0
- package/dist/database/_batch_update.js +2 -0
- package/dist/database/_batch_update.js.map +1 -0
- package/dist/database/base-model.d.ts +48 -0
- package/dist/database/base-model.d.ts.map +1 -0
- package/dist/database/base-model.js +2 -0
- package/dist/database/base-model.js.map +1 -0
- package/dist/database/code-generator.d.ts +13 -0
- package/dist/database/code-generator.d.ts.map +1 -0
- package/dist/database/code-generator.js +2 -0
- package/dist/database/code-generator.js.map +1 -0
- package/dist/database/db.d.ts +40 -0
- package/dist/database/db.d.ts.map +1 -0
- package/dist/database/db.js +2 -0
- package/dist/database/db.js.map +1 -0
- package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts +2 -0
- package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts.map +1 -0
- package/dist/database/knex-plugins/knex-on-duplicate-update.js +2 -0
- package/dist/database/knex-plugins/knex-on-duplicate-update.js.map +1 -0
- package/dist/database/puri-wrapper.d.ts +34 -0
- package/dist/database/puri-wrapper.d.ts.map +1 -0
- package/dist/database/puri-wrapper.js +2 -0
- package/dist/database/puri-wrapper.js.map +1 -0
- package/dist/database/puri.d.ts +83 -0
- package/dist/database/puri.d.ts.map +1 -0
- package/dist/database/puri.js +2 -0
- package/dist/database/puri.js.map +1 -0
- package/dist/database/puri.types.d.ts +60 -0
- package/dist/database/puri.types.d.ts.map +1 -0
- package/dist/database/puri.types.js +2 -0
- package/dist/database/puri.types.js.map +1 -0
- package/dist/database/transaction-context.d.ts +9 -0
- package/dist/database/transaction-context.d.ts.map +1 -0
- package/dist/database/transaction-context.js +2 -0
- package/dist/database/transaction-context.js.map +1 -0
- package/dist/database/upsert-builder.d.ts +34 -0
- package/dist/database/upsert-builder.d.ts.map +1 -0
- package/dist/database/upsert-builder.js +2 -0
- package/dist/database/upsert-builder.js.map +1 -0
- package/dist/entity/entity-manager.d.ts +32 -0
- package/dist/entity/entity-manager.d.ts.map +1 -0
- package/dist/entity/entity-manager.js +2 -0
- package/dist/entity/entity-manager.js.map +1 -0
- package/dist/entity/entity-utils.d.ts +61 -0
- package/dist/entity/entity-utils.d.ts.map +1 -0
- package/dist/entity/entity-utils.js +2 -0
- package/dist/entity/entity-utils.js.map +1 -0
- package/dist/entity/entity.d.ts +62 -0
- package/dist/entity/entity.d.ts.map +1 -0
- package/dist/entity/entity.js +2 -0
- package/dist/entity/entity.js.map +1 -0
- package/dist/entity/migrator.d.ts +135 -0
- package/dist/entity/migrator.d.ts.map +1 -0
- package/dist/entity/migrator.js +2 -0
- package/dist/entity/migrator.js.map +1 -0
- package/dist/exceptions/error-handler.d.ts +3 -0
- package/dist/exceptions/error-handler.d.ts.map +1 -0
- package/dist/exceptions/error-handler.js +2 -0
- package/dist/exceptions/error-handler.js.map +1 -0
- package/dist/exceptions/so-exceptions.d.ts +48 -0
- package/dist/exceptions/so-exceptions.d.ts.map +1 -0
- package/dist/exceptions/so-exceptions.js +2 -0
- package/dist/exceptions/so-exceptions.js.map +1 -0
- package/dist/file-storage/driver.d.ts +48 -0
- package/dist/file-storage/driver.d.ts.map +1 -0
- package/dist/file-storage/driver.js +2 -0
- package/dist/file-storage/driver.js.map +1 -0
- package/dist/file-storage/file-storage.d.ts +50 -0
- package/dist/file-storage/file-storage.d.ts.map +1 -0
- package/dist/file-storage/file-storage.js +2 -0
- package/dist/file-storage/file-storage.js.map +1 -0
- package/dist/index.d.ts +23 -813
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -433
- package/dist/index.js.map +1 -1
- package/dist/migration/code-generation.d.ts +15 -0
- package/dist/migration/code-generation.d.ts.map +1 -0
- package/dist/migration/code-generation.js +2 -0
- package/dist/migration/code-generation.js.map +1 -0
- package/dist/migration/migration-set.d.ts +17 -0
- package/dist/migration/migration-set.d.ts.map +1 -0
- package/dist/migration/migration-set.js +2 -0
- package/dist/migration/migration-set.js.map +1 -0
- package/dist/migration/migrator.d.ts +130 -0
- package/dist/migration/migrator.d.ts.map +1 -0
- package/dist/migration/migrator.js +2 -0
- package/dist/migration/migrator.js.map +1 -0
- package/dist/migration/types.d.ts +52 -0
- package/dist/migration/types.d.ts.map +1 -0
- package/dist/migration/types.js +2 -0
- package/dist/migration/types.js.map +1 -0
- package/dist/stream/index.d.ts +2 -0
- package/dist/stream/index.d.ts.map +1 -0
- package/dist/stream/index.js +2 -0
- package/dist/stream/index.js.map +1 -0
- package/dist/stream/sse.d.ts +13 -0
- package/dist/stream/sse.d.ts.map +1 -0
- package/dist/stream/sse.js +2 -0
- package/dist/stream/sse.js.map +1 -0
- package/dist/syncer/index.d.ts +2 -0
- package/dist/syncer/index.d.ts.map +1 -0
- package/dist/syncer/index.js +2 -0
- package/dist/syncer/index.js.map +1 -0
- package/dist/syncer/syncer.d.ts +127 -0
- package/dist/syncer/syncer.d.ts.map +1 -0
- package/dist/syncer/syncer.js +2 -0
- package/dist/syncer/syncer.js.map +1 -0
- package/dist/templates/base-template.d.ts +13 -0
- package/dist/templates/base-template.d.ts.map +1 -0
- package/dist/templates/base-template.js +2 -0
- package/dist/templates/base-template.js.map +1 -0
- package/dist/templates/entity.template.d.ts +17 -0
- package/dist/templates/entity.template.d.ts.map +1 -0
- package/dist/templates/entity.template.js +2 -0
- package/dist/templates/entity.template.js.map +1 -0
- package/dist/templates/generated.template.d.ts +27 -0
- package/dist/templates/generated.template.d.ts.map +1 -0
- package/dist/templates/generated.template.js +2 -0
- package/dist/templates/generated.template.js.map +1 -0
- package/dist/templates/generated_http.template.d.ts +24 -0
- package/dist/templates/generated_http.template.d.ts.map +1 -0
- package/dist/templates/generated_http.template.js +2 -0
- package/dist/templates/generated_http.template.js.map +1 -0
- package/dist/templates/generated_sso.template.d.ts +20 -0
- package/dist/templates/generated_sso.template.d.ts.map +1 -0
- package/dist/templates/generated_sso.template.js +2 -0
- package/dist/templates/generated_sso.template.js.map +1 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/init_types.template.d.ts +17 -0
- package/dist/templates/init_types.template.d.ts.map +1 -0
- package/dist/templates/init_types.template.js +2 -0
- package/dist/templates/init_types.template.js.map +1 -0
- package/dist/templates/model.template.d.ts +17 -0
- package/dist/templates/model.template.d.ts.map +1 -0
- package/dist/templates/model.template.js +2 -0
- package/dist/templates/model.template.js.map +1 -0
- package/dist/templates/model_test.template.d.ts +17 -0
- package/dist/templates/model_test.template.d.ts.map +1 -0
- package/dist/templates/model_test.template.js +2 -0
- package/dist/templates/model_test.template.js.map +1 -0
- package/dist/templates/service.template.d.ts +29 -0
- package/dist/templates/service.template.d.ts.map +1 -0
- package/dist/templates/service.template.js +2 -0
- package/dist/templates/service.template.js.map +1 -0
- package/dist/templates/view_enums_buttonset.template.d.ts +17 -0
- package/dist/templates/view_enums_buttonset.template.d.ts.map +1 -0
- package/dist/templates/view_enums_buttonset.template.js +2 -0
- package/dist/templates/view_enums_buttonset.template.js.map +1 -0
- package/dist/templates/view_enums_dropdown.template.d.ts +18 -0
- package/dist/templates/view_enums_dropdown.template.d.ts.map +1 -0
- package/dist/templates/view_enums_dropdown.template.js +2 -0
- package/dist/templates/view_enums_dropdown.template.js.map +1 -0
- package/dist/templates/view_enums_select.template.d.ts +17 -0
- package/dist/templates/view_enums_select.template.d.ts.map +1 -0
- package/dist/templates/view_enums_select.template.js +2 -0
- package/dist/templates/view_enums_select.template.js.map +1 -0
- package/dist/templates/view_form.template.d.ts +26 -0
- package/dist/templates/view_form.template.d.ts.map +1 -0
- package/dist/templates/view_form.template.js +2 -0
- package/dist/templates/view_form.template.js.map +1 -0
- package/dist/templates/view_id_all_select.template.d.ts +17 -0
- package/dist/templates/view_id_all_select.template.d.ts.map +1 -0
- package/dist/templates/view_id_all_select.template.js +2 -0
- package/dist/templates/view_id_all_select.template.js.map +1 -0
- package/dist/templates/view_id_async_select.template.d.ts +17 -0
- package/dist/templates/view_id_async_select.template.d.ts.map +1 -0
- package/dist/templates/view_id_async_select.template.js +2 -0
- package/dist/templates/view_id_async_select.template.js.map +1 -0
- package/dist/templates/view_list.template.d.ts +38 -0
- package/dist/templates/view_list.template.d.ts.map +1 -0
- package/dist/templates/view_list.template.js +2 -0
- package/dist/templates/view_list.template.js.map +1 -0
- package/dist/templates/view_list_columns.template.d.ts +17 -0
- package/dist/templates/view_list_columns.template.d.ts.map +1 -0
- package/dist/templates/view_list_columns.template.js +2 -0
- package/dist/templates/view_list_columns.template.js.map +1 -0
- package/dist/templates/view_search_input.template.d.ts +17 -0
- package/dist/templates/view_search_input.template.d.ts.map +1 -0
- package/dist/templates/view_search_input.template.js +2 -0
- package/dist/templates/view_search_input.template.js.map +1 -0
- package/dist/testing/_relation-graph.d.ts +7 -0
- package/dist/testing/_relation-graph.d.ts.map +1 -0
- package/dist/testing/_relation-graph.js +2 -0
- package/dist/testing/_relation-graph.js.map +1 -0
- package/dist/testing/fixture-manager.d.ts +35 -0
- package/dist/testing/fixture-manager.d.ts.map +1 -0
- package/dist/testing/fixture-manager.js +2 -0
- package/dist/testing/fixture-manager.js.map +1 -0
- package/dist/types/types.d.ts +611 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +2 -0
- package/dist/types/types.js.map +1 -0
- package/dist/typings/knex.d.js +2 -0
- package/dist/typings/knex.d.js.map +1 -0
- package/dist/utils/async-utils.d.ts +25 -0
- package/dist/utils/async-utils.d.ts.map +1 -0
- package/dist/utils/async-utils.js +2 -0
- package/dist/utils/async-utils.js.map +1 -0
- package/dist/utils/controller.d.ts +9 -0
- package/dist/utils/controller.d.ts.map +1 -0
- package/dist/utils/controller.js +2 -0
- package/dist/utils/controller.js.map +1 -0
- package/dist/utils/fs-utils.d.ts +9 -0
- package/dist/utils/fs-utils.d.ts.map +1 -0
- package/dist/utils/fs-utils.js +2 -0
- package/dist/utils/fs-utils.js.map +1 -0
- package/dist/utils/lodash-able.d.ts +2 -0
- package/dist/utils/lodash-able.d.ts.map +1 -0
- package/dist/utils/lodash-able.js +2 -0
- package/dist/utils/lodash-able.js.map +1 -0
- package/dist/utils/model.d.ts +17 -0
- package/dist/utils/model.d.ts.map +1 -0
- package/dist/utils/model.js +2 -0
- package/dist/utils/model.js.map +1 -0
- package/dist/utils/sql-parser.d.ts +4 -0
- package/dist/utils/sql-parser.d.ts.map +1 -0
- package/dist/utils/sql-parser.js +2 -0
- package/dist/utils/sql-parser.js.map +1 -0
- package/dist/utils/utils.d.ts +9 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +2 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/zod-error.d.ts +8 -0
- package/dist/utils/zod-error.d.ts.map +1 -0
- package/dist/utils/zod-error.js +2 -0
- package/dist/utils/zod-error.js.map +1 -0
- package/nodemon.json +6 -0
- package/package.json +32 -45
- package/src/api/base-frame.ts +3 -4
- package/src/api/caster.ts +22 -23
- package/src/api/code-converters.ts +170 -134
- package/src/api/context.ts +15 -3
- package/src/api/decorators.ts +144 -20
- package/src/api/index.ts +2 -0
- package/src/api/sonamu.ts +408 -165
- package/src/bin/build-config.ts +10 -0
- package/src/bin/cli-wrapper.ts +35 -32
- package/src/bin/cli.ts +141 -204
- package/src/database/_batch_update.ts +10 -15
- package/src/database/base-model.ts +326 -216
- package/src/database/db.ts +191 -21
- package/src/database/{drivers/knex/plugins → knex-plugins}/knex-on-duplicate-update.ts +1 -1
- package/src/database/puri-wrapper.ts +129 -0
- package/src/database/puri.ts +808 -0
- package/src/database/puri.types.ts +222 -0
- package/src/database/transaction-context.ts +18 -0
- package/src/database/upsert-builder.ts +32 -35
- package/src/entity/entity-manager.ts +7 -15
- package/src/entity/entity.ts +9 -31
- package/src/entity/migrator-/354/235/264/354/202/254/352/260/224/354/226/264/354/232/224.md +1 -0
- package/src/file-storage/driver.ts +131 -0
- package/src/file-storage/file-storage.ts +100 -0
- package/src/index.ts +15 -11
- package/src/migration/code-generation.ts +777 -0
- package/src/migration/migration-set.ts +453 -0
- package/src/migration/migrator.ts +823 -0
- package/src/migration/types.ts +53 -0
- package/src/shared/web.shared.ts.txt +33 -2
- package/src/stream/index.ts +1 -0
- package/src/stream/sse.ts +49 -0
- package/src/syncer/syncer.ts +294 -127
- package/src/templates/generated.template.ts +13 -1
- package/src/templates/generated_http.template.ts +15 -12
- package/src/templates/generated_sso.template.ts +50 -2
- package/src/templates/model.template.ts +138 -2
- package/src/templates/service.template.ts +0 -1
- package/src/templates/view_form.template.ts +11 -7
- package/src/templates/view_list.template.ts +12 -4
- package/src/testing/fixture-manager.ts +229 -174
- package/src/types/types.ts +108 -14
- package/src/utils/async-utils.ts +64 -0
- package/src/utils/fs-utils.ts +17 -0
- package/src/utils/model.ts +0 -2
- package/src/utils/utils.ts +14 -58
- package/src/utils/zod-error.ts +12 -176
- package/tsconfig.json +6 -0
- package/tsup.config.js +4 -2
- package/.pnp.cjs +0 -14363
- package/.pnp.loader.mjs +0 -2047
- package/.vscode/extensions.json +0 -6
- package/.vscode/settings.json +0 -9
- package/.yarnrc.yml +0 -5
- package/dist/base-model-CEB0H0aO.d.mts +0 -43
- package/dist/base-model-CrqDMYhI.d.ts +0 -43
- package/dist/bin/cli-wrapper.d.mts +0 -1
- package/dist/bin/cli-wrapper.mjs +0 -43
- package/dist/bin/cli-wrapper.mjs.map +0 -1
- package/dist/bin/cli.d.mts +0 -2
- package/dist/bin/cli.mjs +0 -907
- package/dist/bin/cli.mjs.map +0 -1
- package/dist/chunk-2WAC2GER.js +0 -7625
- package/dist/chunk-2WAC2GER.js.map +0 -1
- package/dist/chunk-C3IPIF6O.mjs +0 -1581
- package/dist/chunk-C3IPIF6O.mjs.map +0 -1
- package/dist/chunk-EXHKSVTE.js +0 -280
- package/dist/chunk-EXHKSVTE.js.map +0 -1
- package/dist/chunk-FCERKIIF.mjs +0 -7623
- package/dist/chunk-FCERKIIF.mjs.map +0 -1
- package/dist/chunk-HGIBJYOU.mjs +0 -231
- package/dist/chunk-HGIBJYOU.mjs.map +0 -1
- package/dist/chunk-JKSOJRQA.mjs +0 -280
- package/dist/chunk-JKSOJRQA.mjs.map +0 -1
- package/dist/chunk-OTKKFP3Y.js +0 -1581
- package/dist/chunk-OTKKFP3Y.js.map +0 -1
- package/dist/chunk-PTFDTOJU.mjs +0 -19
- package/dist/chunk-PTFDTOJU.mjs.map +0 -1
- package/dist/chunk-UZ2IY5VE.js +0 -231
- package/dist/chunk-UZ2IY5VE.js.map +0 -1
- package/dist/database/drivers/knex/base-model.d.mts +0 -16
- package/dist/database/drivers/knex/base-model.d.ts +0 -16
- package/dist/database/drivers/knex/base-model.js +0 -55
- package/dist/database/drivers/knex/base-model.js.map +0 -1
- package/dist/database/drivers/knex/base-model.mjs +0 -56
- package/dist/database/drivers/knex/base-model.mjs.map +0 -1
- package/dist/database/drivers/kysely/base-model.d.mts +0 -22
- package/dist/database/drivers/kysely/base-model.d.ts +0 -22
- package/dist/database/drivers/kysely/base-model.js +0 -64
- package/dist/database/drivers/kysely/base-model.js.map +0 -1
- package/dist/database/drivers/kysely/base-model.mjs +0 -65
- package/dist/database/drivers/kysely/base-model.mjs.map +0 -1
- package/dist/index.d.mts +0 -813
- package/dist/index.mjs +0 -435
- package/dist/index.mjs.map +0 -1
- package/dist/model-aFgomcdc.d.mts +0 -1112
- package/dist/model-aFgomcdc.d.ts +0 -1112
- package/src/database/base-model.abstract.ts +0 -97
- package/src/database/db.abstract.ts +0 -75
- package/src/database/drivers/knex/base-model.ts +0 -55
- package/src/database/drivers/knex/client.ts +0 -209
- package/src/database/drivers/knex/db.ts +0 -232
- package/src/database/drivers/knex/generator.ts +0 -659
- package/src/database/drivers/kysely/base-model.ts +0 -89
- package/src/database/drivers/kysely/client.ts +0 -309
- package/src/database/drivers/kysely/db.ts +0 -238
- package/src/database/drivers/kysely/generator.ts +0 -714
- package/src/database/types.ts +0 -118
- package/src/entity/migrator.ts +0 -1400
- package/src/smd/smd-manager.ts +0 -139
- package/src/smd/smd.ts +0 -571
- package/src/templates/kysely_types.template.ts +0 -205
package/dist/index.d.ts
CHANGED
|
@@ -1,813 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type StreamDecoratorOptions = {
|
|
25
|
-
type: "sse";
|
|
26
|
-
events: z.ZodObject<any>;
|
|
27
|
-
path?: string;
|
|
28
|
-
resourceName?: string;
|
|
29
|
-
guards?: string[];
|
|
30
|
-
description?: string;
|
|
31
|
-
};
|
|
32
|
-
declare const registeredApis: {
|
|
33
|
-
modelName: string;
|
|
34
|
-
methodName: string;
|
|
35
|
-
path: string;
|
|
36
|
-
options: ApiDecoratorOptions;
|
|
37
|
-
streamOptions?: StreamDecoratorOptions;
|
|
38
|
-
}[];
|
|
39
|
-
type ExtendedApi = {
|
|
40
|
-
modelName: string;
|
|
41
|
-
methodName: string;
|
|
42
|
-
path: string;
|
|
43
|
-
options: ApiDecoratorOptions;
|
|
44
|
-
streamOptions?: StreamDecoratorOptions;
|
|
45
|
-
typeParameters: ApiParamType.TypeParam[];
|
|
46
|
-
parameters: ApiParam[];
|
|
47
|
-
returnType: ApiParamType;
|
|
48
|
-
};
|
|
49
|
-
declare function api(options?: ApiDecoratorOptions): (target: Object, propertyKey: string) => void;
|
|
50
|
-
declare function stream(options: StreamDecoratorOptions): (target: Object, propertyKey: string) => void;
|
|
51
|
-
|
|
52
|
-
declare function getZodObjectFromApi(api: ExtendedApi, references?: {
|
|
53
|
-
[id: string]: z.ZodObject<any>;
|
|
54
|
-
}): z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
55
|
-
declare function getZodObjectFromApiParams(apiParams: ApiParam[], references?: {
|
|
56
|
-
[id: string]: z.ZodObject<any>;
|
|
57
|
-
}): z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
58
|
-
declare function getZodTypeFromApiParamType(paramType: ApiParamType, references: {
|
|
59
|
-
[id: string]: z.ZodObject<any>;
|
|
60
|
-
}): z.ZodType<unknown>;
|
|
61
|
-
declare function propNodeToZodTypeDef(propNode: EntityPropNode, injectImportKeys: string[]): string;
|
|
62
|
-
declare function getTextTypeLength(textType: TextProp["textType"]): number;
|
|
63
|
-
declare function propToZodTypeDef(prop: EntityProp, injectImportKeys: string[]): string;
|
|
64
|
-
declare function zodTypeToZodCode(zt: z.ZodFirstPartySchemaTypes | z.ZodObject<any>): string;
|
|
65
|
-
declare function apiParamToTsCode(params: ApiParam[], injectImportKeys: string[]): string;
|
|
66
|
-
declare function apiParamToTsCodeAsObject(params: ApiParam[], injectImportKeys: string[]): string;
|
|
67
|
-
declare function apiParamTypeToTsType(paramType: ApiParamType, injectImportKeys: string[]): string;
|
|
68
|
-
declare function unwrapPromiseOnce(paramType: ApiParamType): ApiParamType;
|
|
69
|
-
declare function serializeZodType(zt: z.ZodTypeAny): any;
|
|
70
|
-
declare function zodTypeToTsTypeDef(zt: z.ZodFirstPartySchemaTypes | z.ZodObject<any>): string;
|
|
71
|
-
|
|
72
|
-
interface ContextExtend {
|
|
73
|
-
}
|
|
74
|
-
type Context = {
|
|
75
|
-
reply: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>;
|
|
76
|
-
headers: IncomingHttpHeaders;
|
|
77
|
-
} & ContextExtend;
|
|
78
|
-
|
|
79
|
-
declare class Entity {
|
|
80
|
-
id: string;
|
|
81
|
-
parentId?: string;
|
|
82
|
-
table: string;
|
|
83
|
-
title: string;
|
|
84
|
-
names: {
|
|
85
|
-
parentFs: string;
|
|
86
|
-
fs: string;
|
|
87
|
-
module: string;
|
|
88
|
-
};
|
|
89
|
-
props: EntityProp[];
|
|
90
|
-
propsDict: {
|
|
91
|
-
[key: string]: EntityProp;
|
|
92
|
-
};
|
|
93
|
-
relations: {
|
|
94
|
-
[key: string]: RelationProp;
|
|
95
|
-
};
|
|
96
|
-
indexes: EntityIndex[];
|
|
97
|
-
subsets: {
|
|
98
|
-
[key: string]: string[];
|
|
99
|
-
};
|
|
100
|
-
types: {
|
|
101
|
-
[name: string]: z.ZodTypeAny;
|
|
102
|
-
};
|
|
103
|
-
enums: {
|
|
104
|
-
[enumId: string]: z.ZodEnum<any>;
|
|
105
|
-
};
|
|
106
|
-
enumLabels: {
|
|
107
|
-
[enumId: string]: {
|
|
108
|
-
[key: string]: string;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
constructor({ id, parentId, table, title, props, indexes, subsets, enums, }: EntityJson);
|
|
112
|
-
getSubsetQuery(subsetKey: string): SubsetQuery;
|
|
113
|
-
resolveSubsetQuery(prefix: string, fields: string[], isAlreadyOuterJoined?: boolean): SubsetQuery;
|
|
114
|
-
fieldExprsToPropNodes(fieldExprs: string[], entity?: Entity): EntityPropNode[];
|
|
115
|
-
getFieldExprs(prefix?: string, maxDepth?: number, froms?: string[]): string[];
|
|
116
|
-
getTableColumns(): string[];
|
|
117
|
-
registerModulePaths(): Promise<void>;
|
|
118
|
-
registerTableSpecs(): void;
|
|
119
|
-
toJson(): EntityJson;
|
|
120
|
-
save(): Promise<void>;
|
|
121
|
-
getSubsetRows(_subsets?: {
|
|
122
|
-
[key: string]: string[];
|
|
123
|
-
}, prefixes?: string[]): EntitySubsetRow[];
|
|
124
|
-
subsetRowsToSubsetFields(subsetRows: EntitySubsetRow[], subsetKey: string): string[];
|
|
125
|
-
createProp(prop: EntityProp, at?: number): Promise<void>;
|
|
126
|
-
analyzeSubsetField(subsetField: string): {
|
|
127
|
-
entityId: string;
|
|
128
|
-
propName: string;
|
|
129
|
-
}[];
|
|
130
|
-
modifyProp(newProp: EntityProp, at: number): Promise<void>;
|
|
131
|
-
delProp(at: number): Promise<void>;
|
|
132
|
-
getEntityIdFromSubsetField(subsetField: string): string;
|
|
133
|
-
moveProp(at: number, to: number): Promise<void>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
type EntityNamesRecord = Record<"fs" | "fsPlural" | "camel" | "camelPlural" | "capital" | "capitalPlural" | "upper" | "constant", string>;
|
|
137
|
-
type TableSpec = {
|
|
138
|
-
name: string;
|
|
139
|
-
uniqueIndexes: {
|
|
140
|
-
name?: string;
|
|
141
|
-
columns: string[];
|
|
142
|
-
}[];
|
|
143
|
-
};
|
|
144
|
-
declare class EntityManagerClass {
|
|
145
|
-
private entities;
|
|
146
|
-
modulePaths: Map<string, string>;
|
|
147
|
-
private tableSpecs;
|
|
148
|
-
isAutoloaded: boolean;
|
|
149
|
-
autoload(doSilent?: boolean): Promise<unknown>;
|
|
150
|
-
reload(doSilent?: boolean): Promise<unknown>;
|
|
151
|
-
register(json: EntityJson): Promise<void>;
|
|
152
|
-
get(entityId: string): Entity;
|
|
153
|
-
exists(entityId: string): boolean;
|
|
154
|
-
getAllIds(): string[];
|
|
155
|
-
getAllParentIds(): string[];
|
|
156
|
-
getChildrenIds(parentId: string): string[];
|
|
157
|
-
setModulePath(key: string, modulePath: string): void;
|
|
158
|
-
getModulePath(key: string): string;
|
|
159
|
-
setTableSpec(tableSpec: TableSpec): void;
|
|
160
|
-
getTableSpec(key: string): TableSpec;
|
|
161
|
-
getNamesFromId(entityId: string): EntityNamesRecord;
|
|
162
|
-
}
|
|
163
|
-
declare const EntityManager: EntityManagerClass;
|
|
164
|
-
|
|
165
|
-
declare abstract class Template {
|
|
166
|
-
key: TemplateKey;
|
|
167
|
-
constructor(key: TemplateKey);
|
|
168
|
-
abstract render(options: TemplateOptions[TemplateKey], ...extra: unknown[]): RenderedTemplate | Promise<RenderedTemplate>;
|
|
169
|
-
abstract getTargetAndPath(names?: EntityNamesRecord, ...extra: unknown[]): {
|
|
170
|
-
target: string;
|
|
171
|
-
path: string;
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
type PathAndChecksum = {
|
|
176
|
-
path: string;
|
|
177
|
-
checksum: string;
|
|
178
|
-
};
|
|
179
|
-
type RenderedTemplate = {
|
|
180
|
-
target: string;
|
|
181
|
-
path: string;
|
|
182
|
-
body: string;
|
|
183
|
-
importKeys: string[];
|
|
184
|
-
customHeaders?: string[];
|
|
185
|
-
preTemplates?: {
|
|
186
|
-
key: TemplateKey;
|
|
187
|
-
options: TemplateOptions[TemplateKey];
|
|
188
|
-
}[];
|
|
189
|
-
};
|
|
190
|
-
declare class Syncer {
|
|
191
|
-
apis: {
|
|
192
|
-
typeParameters: ApiParamType.TypeParam[];
|
|
193
|
-
parameters: ApiParam[];
|
|
194
|
-
returnType: ApiParamType;
|
|
195
|
-
modelName: string;
|
|
196
|
-
methodName: string;
|
|
197
|
-
path: string;
|
|
198
|
-
options: ApiDecoratorOptions;
|
|
199
|
-
}[];
|
|
200
|
-
types: {
|
|
201
|
-
[typeName: string]: z.ZodObject<any>;
|
|
202
|
-
};
|
|
203
|
-
models: {
|
|
204
|
-
[modelName: string]: unknown;
|
|
205
|
-
};
|
|
206
|
-
isSyncing: boolean;
|
|
207
|
-
get checksumsPath(): string;
|
|
208
|
-
constructor();
|
|
209
|
-
sync(): Promise<void>;
|
|
210
|
-
getEntityIdFromPath(filePaths: string[]): string[];
|
|
211
|
-
actionGenerateSchemas(): Promise<string[]>;
|
|
212
|
-
actionGenerateServices(paramsArray: {
|
|
213
|
-
namesRecord: EntityNamesRecord;
|
|
214
|
-
modelTsPath: string;
|
|
215
|
-
}[]): Promise<string[]>;
|
|
216
|
-
actionGenerateHttps(): Promise<string[]>;
|
|
217
|
-
copyFileWithReplaceCoreToShared(fromPath: string, toPath: string): Promise<void>;
|
|
218
|
-
actionSyncFilesToTargets(tsPaths: string[]): Promise<string[]>;
|
|
219
|
-
getCurrentChecksums(): Promise<PathAndChecksum[]>;
|
|
220
|
-
getPreviousChecksums(): Promise<PathAndChecksum[]>;
|
|
221
|
-
saveChecksums(checksums: PathAndChecksum[]): Promise<void>;
|
|
222
|
-
getChecksumOfFile(filePath: string): Promise<string>;
|
|
223
|
-
readApisFromFile(filePath: string): Promise<{
|
|
224
|
-
typeParameters: ApiParamType.TypeParam[];
|
|
225
|
-
parameters: ApiParam[];
|
|
226
|
-
returnType: ApiParamType;
|
|
227
|
-
modelName: string;
|
|
228
|
-
methodName: string;
|
|
229
|
-
path: string;
|
|
230
|
-
options: ApiDecoratorOptions;
|
|
231
|
-
streamOptions?: StreamDecoratorOptions | undefined;
|
|
232
|
-
}[]>;
|
|
233
|
-
resolveTypeNode(typeNode: ts.TypeNode): ApiParamType;
|
|
234
|
-
resolveParamDec: (paramDec: {
|
|
235
|
-
name: ts.BindingName;
|
|
236
|
-
type: ts.TypeNode;
|
|
237
|
-
optional?: boolean;
|
|
238
|
-
defaultDef?: string;
|
|
239
|
-
}, index?: number) => ApiParam;
|
|
240
|
-
printNode(node: ts.Node | undefined, sourceFile: ts.SourceFile): string | undefined;
|
|
241
|
-
autoloadApis(): Promise<{
|
|
242
|
-
typeParameters: ApiParamType.TypeParam[];
|
|
243
|
-
parameters: ApiParam[];
|
|
244
|
-
returnType: ApiParamType;
|
|
245
|
-
modelName: string;
|
|
246
|
-
methodName: string;
|
|
247
|
-
path: string;
|
|
248
|
-
options: ApiDecoratorOptions;
|
|
249
|
-
}[]>;
|
|
250
|
-
autoloadModels(): Promise<{
|
|
251
|
-
[modelName: string]: unknown;
|
|
252
|
-
}>;
|
|
253
|
-
autoloadTypes(doRefresh?: boolean): Promise<{
|
|
254
|
-
[typeName: string]: z.ZodObject<any>;
|
|
255
|
-
}>;
|
|
256
|
-
getTemplate(key: TemplateKey): Template;
|
|
257
|
-
renderTemplate<T extends keyof TemplateOptions>(key: T, options: TemplateOptions[T]): Promise<PathAndCode[]>;
|
|
258
|
-
resolveRenderedTemplate(key: TemplateKey, result: RenderedTemplate): Promise<PathAndCode>;
|
|
259
|
-
writeCodeToPath(pathAndCode: PathAndCode): Promise<string[]>;
|
|
260
|
-
generateTemplate(key: TemplateKey, templateOptions: any, _generateOptions?: GenerateOptions): Promise<string[][]>;
|
|
261
|
-
checkExistsGenCode(entityId: string, templateKey: TemplateKey, enumId?: string): {
|
|
262
|
-
subPath: string;
|
|
263
|
-
fullPath: string;
|
|
264
|
-
isExists: boolean;
|
|
265
|
-
};
|
|
266
|
-
checkExists(entityId: string, enums: {
|
|
267
|
-
[name: string]: z.ZodEnum<any>;
|
|
268
|
-
}): Record<`${TemplateKey}${string}`, boolean>;
|
|
269
|
-
getZodTypeById(zodTypeId: string): Promise<z.ZodTypeAny>;
|
|
270
|
-
propNodeToZodType(propNode: EntityPropNode): Promise<z.ZodTypeAny>;
|
|
271
|
-
propToZodType(prop: EntityProp): Promise<z.ZodTypeAny>;
|
|
272
|
-
resolveRenderType(key: string, zodType: z.ZodTypeAny): RenderingNode["renderType"];
|
|
273
|
-
zodTypeToRenderingNode(zodType: z.ZodTypeAny, baseKey?: string): RenderingNode;
|
|
274
|
-
getColumnsNode(entityId: string, subsetKey: string): Promise<RenderingNode>;
|
|
275
|
-
createEntity(form: Omit<TemplateOptions["entity"], "title"> & {
|
|
276
|
-
title?: string;
|
|
277
|
-
}): Promise<void>;
|
|
278
|
-
delEntity(entityId: string): Promise<{
|
|
279
|
-
delPaths: string[];
|
|
280
|
-
}>;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
type SonamuConfig = {
|
|
284
|
-
projectName?: string;
|
|
285
|
-
api: {
|
|
286
|
-
dir: string;
|
|
287
|
-
};
|
|
288
|
-
sync: {
|
|
289
|
-
targets: string[];
|
|
290
|
-
};
|
|
291
|
-
route: {
|
|
292
|
-
prefix: string;
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
type SonamuSecrets = {
|
|
296
|
-
[key: string]: string;
|
|
297
|
-
};
|
|
298
|
-
type SonamuFastifyConfig = {
|
|
299
|
-
contextProvider: (defaultContext: Pick<Context, "headers" | "reply">, request: FastifyRequest, reply: FastifyReply) => Context;
|
|
300
|
-
guardHandler: (guard: string, request: FastifyRequest, api: {
|
|
301
|
-
typeParameters: ApiParamType.TypeParam[];
|
|
302
|
-
parameters: ApiParam[];
|
|
303
|
-
returnType: ApiParamType;
|
|
304
|
-
modelName: string;
|
|
305
|
-
methodName: string;
|
|
306
|
-
path: string;
|
|
307
|
-
options: ApiDecoratorOptions;
|
|
308
|
-
}) => void;
|
|
309
|
-
cache?: {
|
|
310
|
-
get: (key: string) => Promise<unknown | null>;
|
|
311
|
-
put: (key: string, value: unknown, ttl?: number) => Promise<void>;
|
|
312
|
-
resolveKey: (path: string, reqBody: {
|
|
313
|
-
[key: string]: unknown;
|
|
314
|
-
}) => {
|
|
315
|
-
cache: false;
|
|
316
|
-
} | {
|
|
317
|
-
cache: true;
|
|
318
|
-
key: string;
|
|
319
|
-
ttl?: number;
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
declare class SonamuClass {
|
|
324
|
-
isInitialized: boolean;
|
|
325
|
-
asyncLocalStorage: AsyncLocalStorage<{
|
|
326
|
-
context: Context;
|
|
327
|
-
}>;
|
|
328
|
-
getContext(): Context;
|
|
329
|
-
private _apiRootPath;
|
|
330
|
-
set apiRootPath(apiRootPath: string);
|
|
331
|
-
get apiRootPath(): string;
|
|
332
|
-
get appRootPath(): string;
|
|
333
|
-
private _dbConfig;
|
|
334
|
-
set dbConfig(dbConfig: SonamuDBConfig);
|
|
335
|
-
get dbConfig(): SonamuDBConfig;
|
|
336
|
-
private _dbClient;
|
|
337
|
-
set dbClient(_dbClient: DatabaseDriver);
|
|
338
|
-
get dbClient(): DatabaseDriver;
|
|
339
|
-
private _syncer;
|
|
340
|
-
set syncer(syncer: Syncer);
|
|
341
|
-
get syncer(): Syncer;
|
|
342
|
-
private _config;
|
|
343
|
-
set config(config: SonamuConfig);
|
|
344
|
-
get config(): SonamuConfig;
|
|
345
|
-
private _secrets;
|
|
346
|
-
set secrets(secrets: SonamuSecrets);
|
|
347
|
-
get secrets(): SonamuSecrets | null;
|
|
348
|
-
initForTesting(): Promise<void>;
|
|
349
|
-
init(doSilent?: boolean, enableSync?: boolean, apiRootPath?: string, forTesting?: boolean): Promise<void>;
|
|
350
|
-
withFastify(server: FastifyInstance<Server, IncomingMessage, ServerResponse>, config: SonamuFastifyConfig, options?: {
|
|
351
|
-
enableSync?: boolean;
|
|
352
|
-
doSilent?: boolean;
|
|
353
|
-
}): Promise<void>;
|
|
354
|
-
destroy(): Promise<void>;
|
|
355
|
-
}
|
|
356
|
-
declare const Sonamu: SonamuClass;
|
|
357
|
-
|
|
358
|
-
declare abstract class BaseFrameClass {
|
|
359
|
-
getDB(which: DBPreset): Knex;
|
|
360
|
-
getUpsertBuilder(): UpsertBuilder<"knex">;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
declare abstract class DBClass {
|
|
364
|
-
_fullConfig?: SonamuDBConfig;
|
|
365
|
-
set fullConfig(config: SonamuDBConfig);
|
|
366
|
-
get fullConfig(): SonamuDBConfig;
|
|
367
|
-
abstract tdb: KnexClient | KyselyClient;
|
|
368
|
-
abstract fdb: KnexClient | KyselyClient;
|
|
369
|
-
abstract testInit(): Promise<void>;
|
|
370
|
-
abstract getDB(which: DBPreset): Knex | Kysely<Database>;
|
|
371
|
-
abstract destroy(): Promise<void>;
|
|
372
|
-
abstract raw(db: Knex | Kysely<Database>, query: string): any;
|
|
373
|
-
getBaseConfig(rootPath: string): Promise<SonamuDBBaseConfig>;
|
|
374
|
-
getCurrentConfig(which?: DBPreset): KnexConfig | KyselyConfig;
|
|
375
|
-
toClient(db: Knex | Kysely<Database>): KnexClient | KyselyClient;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
declare class DBKnexClass extends DBClass {
|
|
379
|
-
migrationTable: string;
|
|
380
|
-
generator: KnexGenerator;
|
|
381
|
-
baseConfig?: KnexBaseConfig;
|
|
382
|
-
_fullConfig?: SonamuKnexDBConfig;
|
|
383
|
-
set fullConfig(config: SonamuKnexDBConfig);
|
|
384
|
-
get fullConfig(): SonamuKnexDBConfig;
|
|
385
|
-
private wdb?;
|
|
386
|
-
private rdb?;
|
|
387
|
-
private _tdb;
|
|
388
|
-
set tdb(tdb: KnexClient);
|
|
389
|
-
get tdb(): KnexClient;
|
|
390
|
-
private _fdb;
|
|
391
|
-
set fdb(fdb: KnexClient);
|
|
392
|
-
get fdb(): KnexClient;
|
|
393
|
-
get connectionInfo(): {
|
|
394
|
-
development_master: {
|
|
395
|
-
host: string;
|
|
396
|
-
port: number;
|
|
397
|
-
database: string | undefined;
|
|
398
|
-
user: string | undefined;
|
|
399
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
400
|
-
};
|
|
401
|
-
development_slave: {
|
|
402
|
-
host: string;
|
|
403
|
-
port: number;
|
|
404
|
-
database: string | undefined;
|
|
405
|
-
user: string | undefined;
|
|
406
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
407
|
-
};
|
|
408
|
-
test: {
|
|
409
|
-
host: string;
|
|
410
|
-
port: number;
|
|
411
|
-
database: string | undefined;
|
|
412
|
-
user: string | undefined;
|
|
413
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
414
|
-
};
|
|
415
|
-
fixture_local: {
|
|
416
|
-
host: string;
|
|
417
|
-
port: number;
|
|
418
|
-
database: string | undefined;
|
|
419
|
-
user: string | undefined;
|
|
420
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
421
|
-
};
|
|
422
|
-
fixture_remote: {
|
|
423
|
-
host: string;
|
|
424
|
-
port: number;
|
|
425
|
-
database: string | undefined;
|
|
426
|
-
user: string | undefined;
|
|
427
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
428
|
-
};
|
|
429
|
-
production_master: {
|
|
430
|
-
host: string;
|
|
431
|
-
port: number;
|
|
432
|
-
database: string | undefined;
|
|
433
|
-
user: string | undefined;
|
|
434
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
435
|
-
};
|
|
436
|
-
production_slave: {
|
|
437
|
-
host: string;
|
|
438
|
-
port: number;
|
|
439
|
-
database: string | undefined;
|
|
440
|
-
user: string | undefined;
|
|
441
|
-
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
442
|
-
};
|
|
443
|
-
};
|
|
444
|
-
constructor();
|
|
445
|
-
init(config: KnexBaseConfig): void;
|
|
446
|
-
testInit(): Promise<void>;
|
|
447
|
-
getDB(which: DBPreset): knex.Knex<any, any[]>;
|
|
448
|
-
getClient(mode: keyof SonamuKnexDBConfig): KnexClient;
|
|
449
|
-
destroy(): Promise<void>;
|
|
450
|
-
testDestroy(): Promise<void>;
|
|
451
|
-
raw(db: Knex, query: string): Knex.Raw<any>;
|
|
452
|
-
generateDBConfig(config: KnexBaseConfig): SonamuKnexDBConfig;
|
|
453
|
-
/**
|
|
454
|
-
* keys에 해당하는 설정들을 중복없이 가져옵니다. (host/port/database가 같은 설정은 중복으로 처리합니다.)
|
|
455
|
-
*/
|
|
456
|
-
getUniqueConfigs(keys: (keyof SonamuKnexDBConfig)[]): {
|
|
457
|
-
connKey: keyof SonamuKnexDBConfig;
|
|
458
|
-
options: KnexConfig;
|
|
459
|
-
}[];
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
declare class KyselyGenerator extends CodeGenerator {
|
|
463
|
-
generateCreateCode_ColumnAndIndexes(table: string, columns: MigrationColumn[], indexes: MigrationIndex[]): Promise<GenMigrationCode>;
|
|
464
|
-
generateCreateCode_Foreign(table: string, foreigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
465
|
-
generateAlterCode_ColumnAndIndexes(table: string, entityColumns: MigrationColumn[], entityIndexes: MigrationIndex[], dbColumns: MigrationColumn[], dbIndexes: MigrationIndex[]): Promise<GenMigrationCode[]>;
|
|
466
|
-
generateAlterCode_Foreigns(table: string, entityForeigns: MigrationForeign[], dbForeigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
467
|
-
generateModelTemplate(entityId: string, def: {
|
|
468
|
-
orderBy: string;
|
|
469
|
-
search: string;
|
|
470
|
-
}): string;
|
|
471
|
-
private genColumnDefinitions;
|
|
472
|
-
private genIndexDefinitions;
|
|
473
|
-
private genForeignDefinitions;
|
|
474
|
-
private getAlterColumnLinesTo;
|
|
475
|
-
private getAlterIndexLinesTo;
|
|
476
|
-
private createIndexName;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
declare class DBKyselyClass extends DBClass {
|
|
480
|
-
migrationTable: string;
|
|
481
|
-
generator: KyselyGenerator;
|
|
482
|
-
baseConfig?: KyselyBaseConfig;
|
|
483
|
-
_fullConfig?: SonamuKyselyDBConfig;
|
|
484
|
-
set fullConfig(config: SonamuKyselyDBConfig);
|
|
485
|
-
get fullConfig(): SonamuKyselyDBConfig;
|
|
486
|
-
private wdb?;
|
|
487
|
-
private rdb?;
|
|
488
|
-
private _tdb;
|
|
489
|
-
set tdb(tdb: KyselyClient);
|
|
490
|
-
get tdb(): KyselyClient;
|
|
491
|
-
private _fdb;
|
|
492
|
-
set fdb(fdb: KyselyClient);
|
|
493
|
-
get fdb(): KyselyClient;
|
|
494
|
-
get connectionInfo(): {
|
|
495
|
-
development_master: {
|
|
496
|
-
host: string;
|
|
497
|
-
port: number;
|
|
498
|
-
database: string | undefined;
|
|
499
|
-
user: string | undefined;
|
|
500
|
-
password: string | undefined;
|
|
501
|
-
};
|
|
502
|
-
development_slave: {
|
|
503
|
-
host: string;
|
|
504
|
-
port: number;
|
|
505
|
-
database: string | undefined;
|
|
506
|
-
user: string | undefined;
|
|
507
|
-
password: string | undefined;
|
|
508
|
-
};
|
|
509
|
-
test: {
|
|
510
|
-
host: string;
|
|
511
|
-
port: number;
|
|
512
|
-
database: string | undefined;
|
|
513
|
-
user: string | undefined;
|
|
514
|
-
password: string | undefined;
|
|
515
|
-
};
|
|
516
|
-
fixture_local: {
|
|
517
|
-
host: string;
|
|
518
|
-
port: number;
|
|
519
|
-
database: string | undefined;
|
|
520
|
-
user: string | undefined;
|
|
521
|
-
password: string | undefined;
|
|
522
|
-
};
|
|
523
|
-
fixture_remote: {
|
|
524
|
-
host: string;
|
|
525
|
-
port: number;
|
|
526
|
-
database: string | undefined;
|
|
527
|
-
user: string | undefined;
|
|
528
|
-
password: string | undefined;
|
|
529
|
-
};
|
|
530
|
-
production_master: {
|
|
531
|
-
host: string;
|
|
532
|
-
port: number;
|
|
533
|
-
database: string | undefined;
|
|
534
|
-
user: string | undefined;
|
|
535
|
-
password: string | undefined;
|
|
536
|
-
};
|
|
537
|
-
production_slave: {
|
|
538
|
-
host: string;
|
|
539
|
-
port: number;
|
|
540
|
-
database: string | undefined;
|
|
541
|
-
user: string | undefined;
|
|
542
|
-
password: string | undefined;
|
|
543
|
-
};
|
|
544
|
-
};
|
|
545
|
-
constructor();
|
|
546
|
-
init(config: KyselyBaseConfig): void;
|
|
547
|
-
testInit(): Promise<void>;
|
|
548
|
-
get config(): SonamuKyselyDBConfig;
|
|
549
|
-
getDB(which: DBPreset): Kysely<DatabaseExtend>;
|
|
550
|
-
getClient(mode: keyof SonamuKyselyDBConfig): KyselyClient;
|
|
551
|
-
destroy(): Promise<void>;
|
|
552
|
-
testDestroy(): Promise<void>;
|
|
553
|
-
raw(db: Kysely<Database>, query: string): Promise<kysely.QueryResult<unknown>>;
|
|
554
|
-
generateDBConfig(config: KyselyBaseConfig): SonamuKyselyDBConfig;
|
|
555
|
-
/**
|
|
556
|
-
* keys에 해당하는 설정들을 중복없이 가져옵니다. (host/port/database가 같은 설정은 중복으로 처리합니다.)
|
|
557
|
-
*/
|
|
558
|
-
getUniqueConfigs(keys: (keyof SonamuKyselyDBConfig)[]): {
|
|
559
|
-
connKey: keyof SonamuKyselyDBConfig;
|
|
560
|
-
options: KyselyConfig;
|
|
561
|
-
}[];
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
declare const DB: DBKnexClass | DBKyselyClass;
|
|
565
|
-
|
|
566
|
-
declare function setupErrorHandler(server: FastifyInstance): void;
|
|
567
|
-
|
|
568
|
-
declare abstract class SoException extends Error {
|
|
569
|
-
readonly statusCode: number;
|
|
570
|
-
message: string;
|
|
571
|
-
payload?: unknown;
|
|
572
|
-
constructor(statusCode: number, message: string, payload?: unknown);
|
|
573
|
-
}
|
|
574
|
-
declare function isSoException(err: any): err is SoException;
|
|
575
|
-
declare class BadRequestException extends SoException {
|
|
576
|
-
message: string;
|
|
577
|
-
payload?: unknown;
|
|
578
|
-
constructor(message?: string, payload?: unknown);
|
|
579
|
-
}
|
|
580
|
-
declare class UnauthorizedException extends SoException {
|
|
581
|
-
message: string;
|
|
582
|
-
payload?: unknown;
|
|
583
|
-
constructor(message?: string, payload?: unknown);
|
|
584
|
-
}
|
|
585
|
-
declare class NotFoundException extends SoException {
|
|
586
|
-
message: string;
|
|
587
|
-
payload?: unknown;
|
|
588
|
-
constructor(message?: string, payload?: unknown);
|
|
589
|
-
}
|
|
590
|
-
declare class ServiceUnavailableException extends SoException {
|
|
591
|
-
message: string;
|
|
592
|
-
payload?: unknown;
|
|
593
|
-
constructor(message?: string, payload?: unknown);
|
|
594
|
-
}
|
|
595
|
-
declare class InternalServerErrorException extends SoException {
|
|
596
|
-
message: string;
|
|
597
|
-
payload?: unknown;
|
|
598
|
-
constructor(message?: string, payload?: unknown);
|
|
599
|
-
}
|
|
600
|
-
declare class AlreadyProcessedException extends SoException {
|
|
601
|
-
message: string;
|
|
602
|
-
payload?: unknown;
|
|
603
|
-
constructor(message?: string, payload?: unknown);
|
|
604
|
-
}
|
|
605
|
-
declare class DuplicateRowException extends SoException {
|
|
606
|
-
message: string;
|
|
607
|
-
payload?: unknown;
|
|
608
|
-
constructor(message?: string, payload?: unknown);
|
|
609
|
-
}
|
|
610
|
-
declare class TargetNotFoundException extends SoException {
|
|
611
|
-
message: string;
|
|
612
|
-
payload?: unknown;
|
|
613
|
-
constructor(message?: string, payload?: unknown);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
declare const p: {
|
|
617
|
-
integer: typeof integer;
|
|
618
|
-
bigInteger: typeof bigInteger;
|
|
619
|
-
text: typeof text;
|
|
620
|
-
string: typeof string;
|
|
621
|
-
float: typeof float;
|
|
622
|
-
double: typeof double;
|
|
623
|
-
decimal: typeof decimal;
|
|
624
|
-
boolean: typeof boolean;
|
|
625
|
-
date: typeof date;
|
|
626
|
-
dateTime: typeof dateTime;
|
|
627
|
-
time: typeof time;
|
|
628
|
-
timestamp: typeof timestamp;
|
|
629
|
-
json: typeof json;
|
|
630
|
-
uuid: typeof uuid;
|
|
631
|
-
enums: typeof enums;
|
|
632
|
-
virtual: typeof virtual;
|
|
633
|
-
relationOneToOne: typeof relationOneToOne;
|
|
634
|
-
relationBelongsToOne: typeof relationBelongsToOne;
|
|
635
|
-
relationHasMany: typeof relationHasMany;
|
|
636
|
-
relationManyToMany: typeof relationManyToMany;
|
|
637
|
-
};
|
|
638
|
-
declare function integer(name: string, option?: Omit<IntegerProp, "name" | "type">): IntegerProp;
|
|
639
|
-
declare function bigInteger(name: string, option?: Omit<BigIntegerProp, "name" | "type">): BigIntegerProp;
|
|
640
|
-
declare function text(name: string, option: Omit<TextProp, "name" | "type">): TextProp;
|
|
641
|
-
declare function string(name: string, option: Omit<StringProp, "name" | "type">): StringProp;
|
|
642
|
-
declare function float(name: string, option?: Omit<FloatProp, "name" | "type">): FloatProp;
|
|
643
|
-
declare function double(name: string, option?: Omit<DoubleProp, "name" | "type">): DoubleProp;
|
|
644
|
-
declare function decimal(name: string, option?: Omit<DecimalProp, "name" | "type">): DecimalProp;
|
|
645
|
-
declare function boolean(name: string, option?: Omit<BooleanProp, "name" | "type">): BooleanProp;
|
|
646
|
-
declare function date(name: string, option?: Omit<DateProp, "name" | "type"> & {
|
|
647
|
-
now?: true;
|
|
648
|
-
}): DateProp;
|
|
649
|
-
declare function dateTime(name: string, option?: Omit<DateTimeProp, "name" | "type"> & {
|
|
650
|
-
now?: true;
|
|
651
|
-
}): DateTimeProp;
|
|
652
|
-
declare function time(name: string, option?: Omit<TimeProp, "name" | "type"> & {
|
|
653
|
-
now?: true;
|
|
654
|
-
}): TimeProp;
|
|
655
|
-
declare function timestamp(name: string, option?: Omit<TimestampProp, "name" | "type"> & {
|
|
656
|
-
now?: true;
|
|
657
|
-
}): TimestampProp;
|
|
658
|
-
declare function json(name: string, option: Omit<JsonProp, "name" | "type">): JsonProp;
|
|
659
|
-
declare function uuid(name: string, option: Omit<UuidProp, "name" | "type">): UuidProp;
|
|
660
|
-
declare function enums(name: string, option: Omit<EnumProp, "name" | "type" | "id"> & {
|
|
661
|
-
id?: string;
|
|
662
|
-
}): EnumProp;
|
|
663
|
-
declare function virtual(name: string, option: Omit<VirtualProp, "name" | "type" | "dbDefault" | "toFilter">): VirtualProp;
|
|
664
|
-
declare function relationOneToOne(name: string, option: DistributiveOmit<OneToOneRelationProp, "name" | "type" | "relationType">): OneToOneRelationProp;
|
|
665
|
-
declare function relationBelongsToOne(name: string, option: Omit<BelongsToOneRelationProp, "name" | "type" | "relationType">): BelongsToOneRelationProp;
|
|
666
|
-
declare function relationHasMany(name: string, option: Omit<HasManyRelationProp, "name" | "type" | "relationType">): HasManyRelationProp;
|
|
667
|
-
declare function relationManyToMany(name: string, option: Omit<ManyToManyRelationProp, "name" | "type" | "relationType">): ManyToManyRelationProp;
|
|
668
|
-
declare const i: {
|
|
669
|
-
index: typeof index;
|
|
670
|
-
unique: typeof unique;
|
|
671
|
-
};
|
|
672
|
-
declare function index(columns: string | string[]): EntityIndex;
|
|
673
|
-
declare function unique(columns: string | string[]): EntityIndex;
|
|
674
|
-
|
|
675
|
-
type MigratorMode = "dev" | "deploy";
|
|
676
|
-
type MigratorOptions = {
|
|
677
|
-
readonly mode: MigratorMode;
|
|
678
|
-
};
|
|
679
|
-
type MigrationCode = {
|
|
680
|
-
name: string;
|
|
681
|
-
path: string;
|
|
682
|
-
};
|
|
683
|
-
type ConnString = `${"mysql2"}://${string}@${string}:${number}/${string}`;
|
|
684
|
-
type MigrationStatus = {
|
|
685
|
-
codes: MigrationCode[];
|
|
686
|
-
conns: {
|
|
687
|
-
name: string;
|
|
688
|
-
connKey: string;
|
|
689
|
-
connString: ConnString;
|
|
690
|
-
currentVersion: string;
|
|
691
|
-
status: string | number;
|
|
692
|
-
pending: string[];
|
|
693
|
-
}[];
|
|
694
|
-
preparedCodes: GenMigrationCode[];
|
|
695
|
-
};
|
|
696
|
-
declare class Migrator {
|
|
697
|
-
readonly mode: MigratorMode;
|
|
698
|
-
targets: {
|
|
699
|
-
compare?: KnexClient | KyselyClient;
|
|
700
|
-
pending: KnexClient | KyselyClient;
|
|
701
|
-
shadow: KnexClient | KyselyClient;
|
|
702
|
-
apply: (KnexClient | KyselyClient)[];
|
|
703
|
-
};
|
|
704
|
-
constructor(options: MigratorOptions);
|
|
705
|
-
getMigrationCodes(): Promise<{
|
|
706
|
-
normal: MigrationCode[];
|
|
707
|
-
onlyTs: MigrationCode[];
|
|
708
|
-
onlyJs: MigrationCode[];
|
|
709
|
-
}>;
|
|
710
|
-
getStatus(): Promise<MigrationStatus>;
|
|
711
|
-
runAction(action: "latest" | "rollback", targets: string[]): Promise<{
|
|
712
|
-
connKey: string;
|
|
713
|
-
batchNo: number;
|
|
714
|
-
applied: string[];
|
|
715
|
-
}[]>;
|
|
716
|
-
delCodes(codeNames: string[]): Promise<number>;
|
|
717
|
-
generatePreparedCodes(): Promise<number>;
|
|
718
|
-
clearPendingList(): Promise<void>;
|
|
719
|
-
check(): Promise<void>;
|
|
720
|
-
run(): Promise<void>;
|
|
721
|
-
rollback(): Promise<void>;
|
|
722
|
-
cleanUpDist(force?: boolean): Promise<void>;
|
|
723
|
-
runShadowTest(): Promise<{
|
|
724
|
-
connKey: string;
|
|
725
|
-
batchNo: number;
|
|
726
|
-
applied: string[];
|
|
727
|
-
}[]>;
|
|
728
|
-
resetAll(): Promise<void>;
|
|
729
|
-
compareMigrations(compareDB: KnexClient | KyselyClient): Promise<GenMigrationCode[]>;
|
|
730
|
-
getMigrationSetFromDB(compareDB: KnexClient | KyselyClient, table: string): Promise<MigrationSet | null>;
|
|
731
|
-
resolveDBColType(colType: string, colField: string): Pick<MigrationColumn, "type" | "unsigned" | "length" | "precision" | "scale">;
|
|
732
|
-
readTable(compareDB: KnexClient | KyselyClient, tableName: string): Promise<[DBColumn[], DBIndex[], DBForeign[]]>;
|
|
733
|
-
getMigrationSetFromEntity(entity: Entity): MigrationSetAndJoinTable;
|
|
734
|
-
showMigrationSet(which: "Entity" | "DB", migrationSet: MigrationSet): void;
|
|
735
|
-
destroy(): Promise<void>;
|
|
736
|
-
}
|
|
737
|
-
type DBColumn = {
|
|
738
|
-
Field: string;
|
|
739
|
-
Type: string;
|
|
740
|
-
Null: string;
|
|
741
|
-
Key: string;
|
|
742
|
-
Default: string | null;
|
|
743
|
-
Extra: string;
|
|
744
|
-
};
|
|
745
|
-
type DBIndex = {
|
|
746
|
-
Table: string;
|
|
747
|
-
Non_unique: number;
|
|
748
|
-
Key_name: string;
|
|
749
|
-
Seq_in_index: number;
|
|
750
|
-
Column_name: string;
|
|
751
|
-
Collation: string | null;
|
|
752
|
-
Cardinality: number | null;
|
|
753
|
-
Sub_part: number | null;
|
|
754
|
-
Packed: string | null;
|
|
755
|
-
Null: string;
|
|
756
|
-
Index_type: string;
|
|
757
|
-
Comment: string;
|
|
758
|
-
Index_comment: string;
|
|
759
|
-
Visible: string;
|
|
760
|
-
Expression: string | null;
|
|
761
|
-
};
|
|
762
|
-
type DBForeign = {
|
|
763
|
-
keyName: string;
|
|
764
|
-
from: string;
|
|
765
|
-
referencesTable: string;
|
|
766
|
-
referencesField: string;
|
|
767
|
-
onDelete: string;
|
|
768
|
-
onUpdate: string;
|
|
769
|
-
};
|
|
770
|
-
|
|
771
|
-
declare class FixtureManagerClass {
|
|
772
|
-
private relationGraph;
|
|
773
|
-
init(): void;
|
|
774
|
-
cleanAndSeed(usingTables?: string[]): Promise<void>;
|
|
775
|
-
getChecksum(db: KnexClient | KyselyClient, tableName: string): Promise<string>;
|
|
776
|
-
sync(): Promise<void>;
|
|
777
|
-
importFixture(entityId: string, ids: number[]): Promise<void>;
|
|
778
|
-
getImportQueries(entityId: string, field: string, id: number): Promise<string[]>;
|
|
779
|
-
destory(): Promise<void>;
|
|
780
|
-
getFixtures(sourceDBName: keyof SonamuDBConfig, targetDBName: keyof SonamuDBConfig, searchOptions: FixtureSearchOptions): Promise<FixtureRecord[]>;
|
|
781
|
-
createFixtureRecord(entity: Entity, row: any, options?: {
|
|
782
|
-
singleRecord?: boolean;
|
|
783
|
-
_db?: KnexClient | KyselyClient;
|
|
784
|
-
}): Promise<FixtureRecord[]>;
|
|
785
|
-
insertFixtures(dbName: keyof SonamuDBConfig, _fixtures: FixtureRecord[]): Promise<FixtureImportResult[]>;
|
|
786
|
-
private prepareInsertData;
|
|
787
|
-
private insertFixture;
|
|
788
|
-
private handleManyToManyRelations;
|
|
789
|
-
addFixtureLoader(code: string): Promise<void>;
|
|
790
|
-
private checkUniqueViolation;
|
|
791
|
-
}
|
|
792
|
-
declare const FixtureManager: FixtureManagerClass;
|
|
793
|
-
|
|
794
|
-
declare function isLocal(): boolean;
|
|
795
|
-
declare function isRemote(): boolean;
|
|
796
|
-
declare function isInDocker(): boolean;
|
|
797
|
-
declare function isDaemonServer(): boolean;
|
|
798
|
-
declare function isDevelopment(): boolean;
|
|
799
|
-
declare function isStaging(): boolean;
|
|
800
|
-
declare function isProduction(): boolean;
|
|
801
|
-
declare function isTest(): boolean;
|
|
802
|
-
|
|
803
|
-
declare function globAsync(pathPattern: string): Promise<string[]>;
|
|
804
|
-
declare function importMultiple(filePaths: string[], doRefresh?: boolean): Promise<{
|
|
805
|
-
filePath: string;
|
|
806
|
-
imported: any;
|
|
807
|
-
}[]>;
|
|
808
|
-
declare function findAppRootPath(): Promise<string>;
|
|
809
|
-
declare function findApiRootPath(): string;
|
|
810
|
-
declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
811
|
-
declare function hydrate<T>(rows: T[]): T[];
|
|
812
|
-
|
|
813
|
-
export { AlreadyProcessedException, type ApiDecoratorOptions, ApiParam, ApiParamType, BadRequestException, BaseFrameClass, BelongsToOneRelationProp, BigIntegerProp, BooleanProp, type Context, type ContextExtend, DB, DBKnexClass, DBKyselyClass, DBPreset, Database, DatabaseDriver, DatabaseExtend, DateProp, DateTimeProp, DecimalProp, DistributiveOmit, DoubleProp, DuplicateRowException, Entity, EntityIndex, EntityJson, EntityManager, type EntityNamesRecord, EntityProp, EntityPropNode, EntitySubsetRow, EnumProp, type ExtendedApi, FixtureImportResult, FixtureManager, FixtureManagerClass, FixtureRecord, FixtureSearchOptions, FloatProp, GenMigrationCode, GenerateOptions, HasManyRelationProp, IntegerProp, InternalServerErrorException, JsonProp, KnexBaseConfig, KnexConfig, KyselyBaseConfig, KyselyConfig, ManyToManyRelationProp, MigrationColumn, MigrationForeign, MigrationIndex, MigrationSet, MigrationSetAndJoinTable, type MigrationStatus, Migrator, type MigratorOptions, NotFoundException, OneToOneRelationProp, PathAndCode, RelationProp, type RenderedTemplate, RenderingNode, type ServiceClient, ServiceUnavailableException, SoException, Sonamu, type SonamuConfig, SonamuDBBaseConfig, SonamuDBConfig, SonamuKnexDBConfig, SonamuKyselyDBConfig, type SonamuSecrets, type StreamDecoratorOptions, StringProp, SubsetQuery, Syncer, TargetNotFoundException, TemplateKey, TemplateOptions, TextProp, TimeProp, TimestampProp, UnauthorizedException, UpsertBuilder, UuidProp, VirtualProp, api, apiParamToTsCode, apiParamToTsCodeAsObject, apiParamTypeToTsType, findApiRootPath, findAppRootPath, getTextTypeLength, getZodObjectFromApi, getZodObjectFromApiParams, getZodTypeFromApiParamType, globAsync, hydrate, i, importMultiple, isDaemonServer, isDevelopment, isInDocker, isLocal, isProduction, isRemote, isSoException, isStaging, isTest, nonNullable, p, propNodeToZodTypeDef, propToZodTypeDef, registeredApis, serializeZodType, setupErrorHandler, stream, unwrapPromiseOnce, zodTypeToTsTypeDef, zodTypeToZodCode };
|
|
1
|
+
export type * from "./api/context";
|
|
2
|
+
export * from "./api/decorators";
|
|
3
|
+
export * from "./api/sonamu";
|
|
4
|
+
export * from "./database/base-model";
|
|
5
|
+
export * from "./api/base-frame";
|
|
6
|
+
export * from "./database/db";
|
|
7
|
+
export * from "./database/upsert-builder";
|
|
8
|
+
export * from "./database/puri";
|
|
9
|
+
export * from "./database/puri-wrapper";
|
|
10
|
+
export * from "./database/puri.types";
|
|
11
|
+
export * from "./exceptions/error-handler";
|
|
12
|
+
export * from "./exceptions/so-exceptions";
|
|
13
|
+
export * from "./stream/sse";
|
|
14
|
+
export * from "./types/types";
|
|
15
|
+
export * from "./utils/controller";
|
|
16
|
+
export * from "./utils/model";
|
|
17
|
+
export * from "./utils/utils";
|
|
18
|
+
export * from "./testing/fixture-manager";
|
|
19
|
+
export * from "./migration/migrator";
|
|
20
|
+
export * from "./entity/entity-manager";
|
|
21
|
+
export * from "./entity/entity";
|
|
22
|
+
export * from "./file-storage/driver";
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|