sonamu 0.5.6 → 0.6.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/dist/api/base-frame.js +12 -2
- package/dist/api/caster.js +66 -2
- package/dist/api/code-converters.js +489 -2
- package/dist/api/config.d.ts +76 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +32 -0
- package/dist/api/context.d.ts +1 -0
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +3 -2
- package/dist/api/decorators.d.ts +1 -0
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +142 -2
- package/dist/api/index.js +9 -2
- package/dist/api/sonamu.d.ts +8 -22
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +482 -2
- package/dist/bin/build-config.d.ts +2 -1
- package/dist/bin/build-config.d.ts.map +1 -1
- package/dist/bin/build-config.js +12 -2
- package/dist/bin/cli-wrapper.js +71 -2
- package/dist/bin/cli.js +418 -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/database/_batch_update.js +78 -2
- package/dist/database/base-model.js +247 -2
- package/dist/database/code-generator.js +53 -2
- package/dist/database/db.d.ts +5 -16
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +132 -2
- package/dist/database/knex-plugins/knex-on-duplicate-update.js +39 -2
- package/dist/database/puri-wrapper.d.ts +22 -10
- package/dist/database/puri-wrapper.d.ts.map +1 -1
- package/dist/database/puri-wrapper.js +109 -2
- package/dist/database/puri.d.ts +105 -73
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +539 -2
- package/dist/database/puri.types.d.ts +33 -42
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +3 -2
- package/dist/database/transaction-context.d.ts +3 -3
- package/dist/database/transaction-context.d.ts.map +1 -1
- package/dist/database/transaction-context.js +14 -2
- package/dist/database/upsert-builder.js +215 -2
- package/dist/entity/entity-manager.d.ts +3 -1
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +114 -2
- package/dist/entity/entity-utils.js +210 -2
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +651 -2
- package/dist/exceptions/error-handler.js +29 -2
- package/dist/exceptions/so-exceptions.js +85 -2
- package/dist/file-storage/driver.js +79 -2
- package/dist/file-storage/file-storage.js +75 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/migration/code-generation.js +558 -2
- package/dist/migration/migration-set.js +364 -2
- package/dist/migration/migrator.d.ts +0 -9
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +510 -2
- package/dist/migration/types.js +3 -2
- package/dist/naite/naite.d.ts +12 -0
- package/dist/naite/naite.d.ts.map +1 -0
- package/dist/naite/naite.js +72 -0
- package/dist/stream/index.js +3 -2
- package/dist/stream/sse.js +38 -2
- package/dist/syncer/api-parser.d.ts +20 -0
- package/dist/syncer/api-parser.d.ts.map +1 -0
- package/dist/syncer/api-parser.js +229 -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 +141 -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 +58 -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 +82 -0
- package/dist/syncer/syncer.d.ts +93 -108
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +375 -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 +101 -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 +87 -0
- package/dist/{templates → template/implementations}/generated.template.d.ts +3 -3
- package/dist/template/implementations/generated.template.d.ts.map +1 -0
- package/dist/template/implementations/generated.template.js +232 -0
- package/dist/{templates → template/implementations}/generated_http.template.d.ts +3 -3
- 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 +3 -3
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -0
- package/dist/template/implementations/generated_sso.template.js +105 -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 +171 -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 +193 -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 +465 -0
- package/dist/{templates → template/implementations}/view_list_columns.template.d.ts +3 -3
- 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 +5 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +6 -0
- package/dist/template/template.d.ts +39 -0
- package/dist/template/template.d.ts.map +1 -0
- package/dist/template/template.js +47 -0
- package/dist/template/zod-converter.d.ts +18 -0
- package/dist/template/zod-converter.d.ts.map +1 -0
- package/dist/template/zod-converter.js +166 -0
- package/dist/testing/_relation-graph.js +80 -2
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +521 -2
- package/dist/types/types.d.ts +39 -40
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +289 -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.js +26 -2
- package/dist/utils/esm-utils.d.ts +45 -0
- package/dist/utils/esm-utils.d.ts.map +1 -0
- package/dist/utils/esm-utils.js +56 -0
- package/dist/utils/fs-utils.js +17 -2
- package/dist/utils/lodash-able.js +6 -2
- package/dist/utils/model.js +22 -2
- 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.js +35 -2
- package/dist/utils/utils.d.ts +4 -7
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +33 -2
- package/dist/utils/zod-error.d.ts.map +1 -1
- package/dist/utils/zod-error.js +19 -2
- package/package.json +21 -9
- package/src/api/code-converters.ts +2 -2
- package/src/api/config.ts +142 -0
- package/src/api/context.ts +1 -0
- package/src/api/decorators.ts +15 -5
- package/src/api/sonamu.ts +102 -87
- package/src/bin/build-config.ts +2 -1
- package/src/bin/cli-wrapper.ts +10 -3
- package/src/bin/cli.ts +108 -56
- package/src/bin/hot-hook-register.ts +22 -0
- package/src/database/base-model.ts +1 -1
- package/src/database/code-generator.ts +1 -1
- package/src/database/db.ts +53 -60
- package/src/database/puri-wrapper.ts +104 -26
- package/src/database/puri.ts +477 -580
- package/src/database/puri.types.ts +111 -201
- package/src/database/transaction-context.ts +4 -4
- package/src/database/upsert-builder.ts +1 -1
- package/src/entity/entity-manager.ts +19 -15
- package/src/entity/entity.ts +4 -3
- package/src/index.ts +2 -0
- package/src/migration/code-generation.ts +1 -1
- package/src/migration/migration-set.ts +1 -1
- package/src/migration/migrator.ts +23 -152
- package/src/naite/naite.ts +70 -0
- package/src/syncer/api-parser.ts +299 -0
- package/src/syncer/checksum.ts +152 -0
- package/src/syncer/code-generator.ts +202 -0
- package/src/syncer/entity-operations.ts +68 -0
- package/src/syncer/file-patterns.ts +56 -0
- package/src/syncer/index.ts +6 -0
- package/src/syncer/module-loader.ts +125 -0
- package/src/syncer/syncer.ts +363 -1420
- package/src/template/entity-converter.ts +123 -0
- package/src/template/helpers.ts +84 -0
- package/src/{templates → template/implementations}/entity.template.ts +4 -4
- package/src/{templates → template/implementations}/generated.template.ts +9 -9
- package/src/{templates → template/implementations}/generated_http.template.ts +9 -6
- package/src/{templates → template/implementations}/generated_sso.template.ts +7 -7
- package/src/{templates → template/implementations}/init_types.template.ts +4 -4
- package/src/{templates → template/implementations}/model.template.ts +9 -9
- package/src/{templates → template/implementations}/model_test.template.ts +5 -5
- package/src/{templates → template/implementations}/service.template.ts +29 -12
- package/src/{templates → template/implementations}/view_enums_buttonset.template.ts +3 -3
- package/src/{templates → template/implementations}/view_enums_dropdown.template.ts +5 -21
- package/src/{templates → template/implementations}/view_enums_select.template.ts +4 -4
- package/src/{templates → template/implementations}/view_form.template.ts +11 -13
- package/src/{templates → template/implementations}/view_id_all_select.template.ts +3 -3
- package/src/{templates → template/implementations}/view_id_async_select.template.ts +3 -3
- package/src/{templates → template/implementations}/view_list.template.ts +13 -64
- package/src/{templates → template/implementations}/view_list_columns.template.ts +3 -3
- package/src/{templates → template/implementations}/view_search_input.template.ts +3 -3
- package/src/template/index.ts +4 -0
- package/src/template/template.ts +86 -0
- package/src/template/zod-converter.ts +219 -0
- package/src/testing/fixture-manager.ts +8 -1
- package/src/types/types.ts +39 -62
- package/src/utils/async-utils.ts +17 -0
- package/src/utils/console-util.ts +4 -0
- package/src/utils/esm-utils.ts +69 -0
- package/src/utils/path-utils.ts +102 -0
- package/src/utils/process-utils.ts +46 -0
- package/src/utils/sql-parser.ts +1 -1
- package/src/utils/utils.ts +14 -40
- package/src/utils/zod-error.ts +0 -1
- 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.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.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.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.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/templates/base-template.ts +0 -19
- package/src/templates/index.ts +0 -1
package/dist/types/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/types.ts"],"sourcesContent":["import type { GuardKey } from \"./../api/decorators\";\nimport type { FastifyCorsOptions } from \"@fastify/cors\";\nimport type { FastifyFormbodyOptions } from \"@fastify/formbody\";\nimport type {\n FastifyInstance,\n FastifyReply,\n FastifyRequest,\n FastifyServerOptions,\n} from \"fastify\";\nimport type { QsPluginOptions } from \"fastify-qs\";\nimport { z } from \"zod\";\nimport type { ApiDecoratorOptions, AuthContext, Context } from \"../api\";\nimport type { FastifyMultipartOptions } from \"@fastify/multipart\";\nimport type { Driver } from \"../file-storage/driver\";\nimport type { SsePluginOptions } from \"fastify-sse-v2/lib/types\";\nimport type { FastifyStaticOptions } from \"@fastify/static\";\nimport { SecureSessionPluginOptions } from \"@fastify/secure-session\";\nimport {\n DeserializeFunction,\n SerializeFunction,\n} from \"@fastify/passport/dist/Authenticator\";\n\n/*\n Enums\n*/\nexport type EnumsLabel<T extends string, L extends \"ko\" | \"en\"> = {\n [key in T]: { [lang in L]: string };\n};\nexport type EnumsLabelKo<T extends string> = EnumsLabel<T, \"ko\">;\n\n/*\n Custom Scalars\n*/\nexport const SQLDateTimeString = z\n .string()\n .regex(/([0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*)$/, {\n message: \"잘못된 SQLDate 타입\",\n })\n .min(10)\n .max(19)\n .describe(\"SQLDateTimeString\");\nexport type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;\n\n/*\n Utility Types\n*/\nexport function zArrayable<T extends z.ZodTypeAny>(\n shape: T\n): z.ZodUnion<[T, z.ZodArray<T>]> {\n return z.union([shape, shape.array()]);\n}\nexport type DistributiveOmit<T, K extends keyof any> = T extends any\n ? Omit<T, K>\n : never;\n\n/*\n Model-Defintion\n*/\nexport type CommonProp = {\n name: string;\n nullable?: boolean;\n toFilter?: true;\n desc?: string;\n dbDefault?: string;\n};\nexport type IntegerProp = CommonProp & {\n type: \"integer\";\n unsigned?: true;\n};\nexport type BigIntegerProp = CommonProp & {\n type: \"bigInteger\";\n unsigned?: true;\n};\nexport type TextProp = CommonProp & {\n type: \"text\";\n textType: \"text\" | \"mediumtext\" | \"longtext\";\n};\nexport type StringProp = CommonProp & {\n type: \"string\";\n length: number;\n};\nexport type EnumProp = CommonProp & {\n type: \"enum\";\n length: number;\n id: string;\n};\nexport type FloatProp = CommonProp & {\n type: \"float\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DoubleProp = CommonProp & {\n type: \"double\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DecimalProp = CommonProp & {\n type: \"decimal\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type BooleanProp = CommonProp & {\n type: \"boolean\";\n};\nexport type DateProp = CommonProp & {\n type: \"date\";\n};\nexport type DateTimeProp = CommonProp & {\n type: \"datetime\";\n};\nexport type TimeProp = CommonProp & {\n type: \"time\";\n};\nexport type TimestampProp = CommonProp & {\n type: \"timestamp\";\n};\nexport type JsonProp = CommonProp & {\n type: \"json\";\n id: string;\n};\nexport type UuidProp = CommonProp & {\n type: \"uuid\";\n};\nexport type VirtualProp = CommonProp & {\n type: \"virtual\";\n id: string;\n};\n\nexport type RelationType =\n | \"HasMany\"\n | \"BelongsToOne\"\n | \"ManyToMany\"\n | \"OneToOne\";\nexport type RelationOn =\n | \"CASCADE\"\n | \"SET NULL\"\n | \"NO ACTION\"\n | \"SET DEFAULT\"\n | \"RESTRICT\";\ntype _RelationProp = {\n type: \"relation\";\n name: string;\n with: string;\n nullable?: boolean; // DEFAULT: false\n toFilter?: true; // DEFAULT: false\n desc?: string;\n};\nexport type OneToOneRelationProp = _RelationProp & {\n relationType: \"OneToOne\";\n customJoinClause?: string;\n} & (\n | {\n hasJoinColumn: true;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n }\n | {\n hasJoinColumn: false;\n }\n );\nexport type BelongsToOneRelationProp = _RelationProp & {\n relationType: \"BelongsToOne\";\n customJoinClause?: string;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n};\nexport type HasManyRelationProp = _RelationProp & {\n relationType: \"HasMany\";\n joinColumn: string;\n fromColumn?: string;\n};\nexport type ManyToManyRelationProp = _RelationProp & {\n relationType: \"ManyToMany\";\n joinTable: `${string}__${string}`;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type RelationProp =\n | OneToOneRelationProp\n | BelongsToOneRelationProp\n | HasManyRelationProp\n | ManyToManyRelationProp;\n\nexport type EntityProp =\n | IntegerProp\n | BigIntegerProp\n | TextProp\n | StringProp\n | FloatProp\n | DoubleProp\n | DecimalProp\n | BooleanProp\n | DateProp\n | DateTimeProp\n | TimeProp\n | TimestampProp\n | JsonProp\n | UuidProp\n | EnumProp\n | VirtualProp\n | RelationProp;\n\nexport type EntityIndex = {\n type: \"index\" | \"unique\" | \"fulltext\";\n columns: string[];\n name?: string;\n parser?: \"built-in\" | \"ngram\";\n};\nexport type EntityJson = {\n id: string;\n parentId?: string;\n table: string;\n title?: string;\n props: EntityProp[];\n indexes: EntityIndex[];\n subsets: {\n [subset: string]: string[];\n };\n enums: {\n [enumId: string]: {\n [key: string]: string;\n };\n };\n};\nexport type EntitySubsetRow = {\n field: string;\n has: {\n [key: string]: boolean;\n };\n children: EntitySubsetRow[];\n prefixes: string[];\n relationEntity?: string;\n isOpen?: boolean;\n};\nexport type FlattenSubsetRow = Omit<EntitySubsetRow, \"children\">;\n\n// SMD Legacy\nexport type SMDInput<T extends string> = {\n id: string;\n parentId?: string;\n table?: string;\n title?: string;\n props?: EntityProp[];\n indexes?: EntityIndex[];\n subsets?: {\n [subset: string]: T[];\n };\n};\n\n/*\n PropNode\n*/\n\nexport type EntityPropNode =\n | {\n nodeType: \"plain\";\n prop: EntityProp;\n }\n | {\n nodeType: \"object\" | \"array\";\n prop?: EntityProp;\n children: EntityPropNode[];\n };\n\n/*\n Prop Type Guards\n*/\nexport function isIntegerProp(p: any): p is IntegerProp {\n return p?.type === \"integer\";\n}\nexport function isBigIntegerProp(p: any): p is BigIntegerProp {\n return p?.type === \"bigInteger\";\n}\nexport function isTextProp(p: any): p is TextProp {\n return p?.type === \"text\";\n}\nexport function isStringProp(p: any): p is StringProp {\n return p?.type === \"string\";\n}\nexport function isEnumProp(p: any): p is EnumProp {\n return p?.type === \"enum\";\n}\nexport function isFloatProp(p: any): p is FloatProp {\n return p?.type === \"float\";\n}\nexport function isDoubleProp(p: any): p is DoubleProp {\n return p?.type === \"double\";\n}\nexport function isDecimalProp(p: any): p is DecimalProp {\n return p?.type === \"decimal\";\n}\nexport function isBooleanProp(p: any): p is BooleanProp {\n return p?.type === \"boolean\";\n}\nexport function isDateProp(p: any): p is DateProp {\n return p?.type === \"date\";\n}\nexport function isDateTimeProp(p: any): p is DateTimeProp {\n return p?.type === \"datetime\";\n}\nexport function isTimeProp(p: any): p is TimeProp {\n return p?.type === \"time\";\n}\nexport function isTimestampProp(p: any): p is TimestampProp {\n return p?.type === \"timestamp\";\n}\nexport function isJsonProp(p: any): p is JsonProp {\n return p?.type === \"json\";\n}\nexport function isUuidProp(p: any): p is UuidProp {\n return p?.type === \"uuid\";\n}\nexport function isVirtualProp(p: any): p is VirtualProp {\n return p?.type === \"virtual\";\n}\nexport function isRelationProp(p: any): p is RelationProp {\n return p?.type === \"relation\";\n}\nexport function isOneToOneRelationProp(p: any): p is OneToOneRelationProp {\n return p?.relationType === \"OneToOne\";\n}\nexport function isBelongsToOneRelationProp(\n p: any\n): p is BelongsToOneRelationProp {\n return p?.relationType === \"BelongsToOne\";\n}\nexport function isHasManyRelationProp(p: any): p is HasManyRelationProp {\n return p?.relationType === \"HasMany\";\n}\nexport function isManyToManyRelationProp(p: any): p is ManyToManyRelationProp {\n return p?.relationType === \"ManyToMany\";\n}\n\ntype JoinClause =\n | {\n from: string;\n to: string;\n }\n | {\n custom: string;\n };\nexport function isCustomJoinClause(p: any): p is { custom: string } {\n return p?.custom;\n}\n\n/* 서브셋 */\n// type SubsetLoader = {\n// as: string;\n// table: string;\n// manyJoin: {\n// fromTable: string;\n// fromCol: string;\n// idField: string;\n// toTable: string;\n// toCol: string;\n// through?: {\n// table: string;\n// fromCol: string;\n// toCol: string;\n// };\n// };\n// oneJoins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// select: (string | Knex.Raw)[];\n// loaders?: SubsetLoader[];\n// };\n// export type SubsetQuery = {\n// select: (string | Knex.Raw)[];\n// virtual: string[];\n// joins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// loaders: SubsetLoader[];\n// };\n\ntype SubsetLoader = {\n as: string;\n table: string;\n manyJoin: {\n fromTable: string;\n fromCol: string;\n idField: string;\n toTable: string;\n toCol: string;\n through?: {\n table: string;\n fromCol: string;\n toCol: string;\n };\n };\n oneJoins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n select: string[];\n loaders?: SubsetLoader[];\n};\n\nexport type SubsetQuery = {\n select: string[];\n virtual: string[];\n joins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n loaders: SubsetLoader[];\n};\n\n/* BaseModel */\nexport const SonamuQueryMode = z.enum([\"both\", \"list\", \"count\"]);\nexport type SonamuQueryMode = z.infer<typeof SonamuQueryMode>;\n\n/* Knex Migration */\nexport type KnexError = {\n code: string;\n errno: number;\n sql: string;\n sqlMessage: string;\n sqlState: string;\n};\nexport function isKnexError(e: any): e is KnexError {\n return e.code && e.sqlMessage && e.sqlState;\n}\n\nexport type KnexColumnType =\n | \"string\"\n | \"text\"\n | \"smalltext\"\n | \"mediumtext\"\n | \"longtext\"\n | \"integer\"\n | \"bigInteger\"\n | \"decimal\"\n | \"timestamp\"\n | \"boolean\"\n | \"foreign\"\n | \"uuid\"\n | \"json\"\n | \"float\"\n | \"date\"\n | \"time\"\n | \"datetime\";\nexport type MigrationColumn = {\n name: string;\n type: KnexColumnType;\n nullable: boolean;\n unsigned?: boolean;\n length?: number;\n defaultTo?: string;\n precision?: number;\n scale?: number;\n};\nexport type MigrationIndex = {\n columns: string[];\n type: \"unique\" | \"index\" | \"fulltext\";\n parser?: \"built-in\" | \"ngram\";\n};\nexport type MigrationForeign = {\n columns: string[];\n to: string;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type MigrationJoinTable = {\n table: string;\n indexes: MigrationIndex[];\n columns: MigrationColumn[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSet = {\n table: string;\n columns: MigrationColumn[];\n indexes: MigrationIndex[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSetAndJoinTable = MigrationSet & {\n joinTables: MigrationJoinTable[];\n};\nexport type GenMigrationCode = {\n title: string;\n table: string;\n type: \"normal\" | \"foreign\";\n formatted: string | null;\n};\n\n/* Api */\nexport type ApiParam = {\n name: string;\n type: ApiParamType;\n optional: boolean;\n defaultDef?: string;\n};\nexport namespace ApiParamType {\n export type Object = {\n t: \"object\";\n props: ApiParam[];\n };\n export type Union = {\n t: \"union\";\n types: ApiParamType[];\n };\n export type Intersection = {\n t: \"intersection\";\n types: ApiParamType[];\n };\n export type StringLiteral = {\n t: \"string-literal\";\n value: string;\n };\n export type NumericLiteral = {\n t: \"numeric-literal\";\n value: number;\n };\n export type Array = {\n t: \"array\";\n elementsType: ApiParamType;\n };\n export type Ref = {\n t: \"ref\";\n id: string;\n args?: ApiParamType[];\n };\n export type IndexedAccess = {\n t: \"indexed-access\";\n object: ApiParamType;\n index: ApiParamType;\n };\n export type TupleType = {\n t: \"tuple-type\";\n elements: ApiParamType[];\n };\n export type Pick = Ref & {\n t: \"ref\";\n id: \"Pick\";\n };\n export type Omit = Ref & {\n t: \"ref\";\n id: \"Omit\";\n };\n export type Partial = Ref & {\n t: \"ref\";\n id: \"Partial\";\n };\n export type Promise = Ref & {\n t: \"ref\";\n id: \"Promise\";\n };\n export type Context = Ref & {\n t: \"ref\";\n id: \"Context\";\n };\n export type TypeParam = {\n t: \"type-param\";\n id: string;\n constraint?: ApiParamType;\n };\n\n export function isObject(v: any): v is ApiParamType.Object {\n return v?.t === \"object\";\n }\n export function isUnion(v: any): v is ApiParamType.Union {\n return v?.t === \"union\";\n }\n export function isIntersection(v: any): v is ApiParamType.Intersection {\n return v?.t === \"intersection\";\n }\n export function isStringLiteral(v: any): v is ApiParamType.StringLiteral {\n return v?.t === \"string-literal\";\n }\n export function isNumericLiteral(v: any): v is ApiParamType.NumericLiteral {\n return v?.t === \"numeric-literal\";\n }\n export function isArray(v: any): v is ApiParamType.Array {\n return v?.t === \"array\";\n }\n export function isRef(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\";\n }\n export function isIndexedAccess(v: any): v is ApiParamType.IndexedAccess {\n return v?.t === \"indexed-access\";\n }\n export function isTupleType(v: any): v is ApiParamType.TupleType {\n return v?.t === \"tuple-type\";\n }\n export function isPick(v: any): v is ApiParamType.Pick {\n return v?.t === \"ref\" && v.id === \"Pick\";\n }\n export function isOmit(v: any): v is ApiParamType.Omit {\n return v?.t === \"ref\" && v.id === \"Omit\";\n }\n export function isPartial(v: any): v is ApiParamType.Partial {\n return v?.t === \"ref\" && v.id === \"Partial\";\n }\n export function isPromise(v: any): v is ApiParamType.Promise {\n return v?.t === \"ref\" && v.id === \"Promise\";\n }\n export function isContext(v: any): v is ApiParamType.Context {\n return v?.t === \"ref\" && v.id === \"Context\";\n }\n export function isRefKnex(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\" && v.id === \"Knex\";\n }\n export function isTypeParam(v: any): v is ApiParamType.TypeParam {\n return v?.t === \"type-param\";\n }\n}\nexport type ApiParamType =\n | \"string\"\n | \"number\"\n | \"boolean\"\n | \"null\"\n | \"undefined\"\n | \"void\"\n | \"any\"\n | \"unknown\"\n | \"true\"\n | \"false\"\n | ApiParamType.StringLiteral\n | ApiParamType.NumericLiteral\n | ApiParamType.Object\n | ApiParamType.Union\n | ApiParamType.Intersection\n | ApiParamType.Array\n | ApiParamType.Ref\n | ApiParamType.IndexedAccess\n | ApiParamType.TypeParam\n | ApiParamType.TupleType;\n\n/* Template */\n// 셀프 참조 타입이므로 Zod 생략하고 직접 정의\nexport const RenderingNode = z.any();\nexport type RenderingNode = {\n name: string;\n label: string;\n renderType:\n | \"string-plain\"\n | \"string-image\"\n | \"string-datetime\"\n | \"string-date\"\n | \"datetime\"\n | \"number-plain\"\n | \"number-id\"\n | \"number-fk_id\"\n | \"boolean\"\n | \"enums\"\n | \"array\"\n | \"array-images\"\n | \"object\"\n | \"object-pick\"\n | \"record\";\n zodType: z.ZodTypeAny;\n element?: RenderingNode;\n children?: RenderingNode[];\n config?: {\n picked: string;\n };\n optional?: boolean;\n nullable?: boolean;\n};\n\nexport const TemplateOptions = z.object({\n entity: z.object({\n entityId: z.string(),\n parentId: z.string().optional(),\n title: z.string(),\n table: z.string().optional(),\n props: z.array(z.object({})).optional(),\n indexes: z.array(z.object({})).optional(),\n subsets: z.object({}).optional(),\n enums: z.object({}).optional(),\n }),\n init_types: z.object({\n entityId: z.string(),\n }),\n generated: z.object({}),\n generated_sso: z.object({}),\n generated_http: z.object({\n entityId: z.string(),\n }),\n model: z.object({\n entityId: z.string(),\n defaultSearchField: z.string(),\n defaultOrderBy: z.string(),\n }),\n model_test: z.object({\n entityId: z.string(),\n }),\n bridge: z.object({\n entityId: z.string(),\n }),\n service: z.object({\n namesRecord: z.object({\n fs: z.string(),\n fsPlural: z.string(),\n camel: z.string(),\n camelPlural: z.string(),\n capital: z.string(),\n capitalPlural: z.string(),\n upper: z.string(),\n constant: z.string(),\n }),\n modelTsPath: z.string(),\n }),\n view_list: z.object({\n entityId: z.string(),\n extra: z.unknown(),\n }),\n view_list_columns: z.object({\n entityId: z.string(),\n columns: z\n .object({\n name: z.string(),\n label: z.string(),\n tc: z.string(),\n })\n .array(),\n columnImports: z.string(),\n }),\n view_search_input: z.object({\n entityId: z.string(),\n }),\n view_form: z.object({\n entityId: z.string(),\n }),\n view_id_all_select: z.object({\n entityId: z.string(),\n }),\n view_id_async_select: z.object({\n entityId: z.string(),\n textField: z.string(),\n }),\n view_enums_select: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_dropdown: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_buttonset: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n});\nexport type TemplateOptions = z.infer<typeof TemplateOptions>;\n\nexport const TemplateKey = z.enum([\n \"entity\",\n \"init_types\",\n \"generated\",\n \"generated_sso\",\n \"generated_http\",\n \"model\",\n \"model_test\",\n \"bridge\",\n \"service\",\n \"view_list\",\n \"view_list_columns\",\n \"view_search_input\",\n \"view_form\",\n \"view_id_all_select\",\n \"view_id_async_select\",\n \"view_enums_select\",\n \"view_enums_dropdown\",\n \"view_enums_buttonset\",\n]);\nexport type TemplateKey = z.infer<typeof TemplateKey>;\n\nexport const GenerateOptions = z.object({\n overwrite: z.boolean().optional(),\n});\nexport type GenerateOptions = z.infer<typeof GenerateOptions>;\n\nexport const PathAndCode = z.object({\n path: z.string(),\n code: z.string(),\n});\nexport type PathAndCode = z.infer<typeof PathAndCode>;\n\nexport type FixtureSearchOptions = {\n entityId: string;\n field: string;\n value: string;\n searchType: \"equals\" | \"like\";\n};\n\nexport type FixtureRecord = {\n fixtureId: string;\n entityId: string;\n id: number;\n columns: {\n [key: string]: {\n prop: EntityProp;\n value: any;\n };\n };\n fetchedRecords: string[];\n belongsRecords: string[];\n target?: FixtureRecord; // Import 대상 DB 레코드(id가 같은)\n unique?: FixtureRecord; // Import 대상 DB 레코드(unique key가 같은)\n override?: boolean;\n};\n\nexport type FixtureImportResult = {\n entityId: string;\n data: {\n [key: string]: any;\n };\n};\n\nexport type RelationNode = {\n fixtureId: string;\n entityId: string;\n related: Set<string>;\n};\n\nexport interface DatabaseSchemaExtend {}\nexport type ManyToManyBaseSchema<\n FromIdKey extends string,\n ToIdKey extends string,\n> = {\n id: number;\n} & {\n [K in `${FromIdKey}_id`]: number;\n} & {\n [K in `${ToIdKey}_id`]: number;\n};\n\nexport type SonamuFastifyConfig = {\n contextProvider: (\n defaultContext: Pick<\n Context,\n \"request\" | \"reply\" | \"headers\" | \"createSSE\"\n > &\n AuthContext,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Context;\n guardHandler: (\n guard: GuardKey,\n request: FastifyRequest,\n api: {\n typeParameters: ApiParamType.TypeParam[];\n parameters: ApiParam[];\n returnType: ApiParamType;\n modelName: string;\n methodName: string;\n path: string;\n options: ApiDecoratorOptions;\n }\n ) => void;\n cache?: {\n get: (key: string) => Promise<unknown | null>;\n put: (key: string, value: unknown, ttl?: number) => Promise<void>;\n resolveKey: (\n path: string,\n reqBody: {\n [key: string]: unknown;\n }\n ) =>\n | {\n cache: false;\n }\n | {\n cache: true;\n key: string;\n ttl?: number;\n };\n };\n};\n\nexport type SonamuServerOptions = {\n fastify?: FastifyServerOptions;\n\n listen?: {\n port: number;\n host?: string;\n };\n\n plugins?: {\n cors?: boolean | FastifyCorsOptions;\n formbody?: boolean | FastifyFormbodyOptions;\n multipart?: boolean | FastifyMultipartOptions;\n qs?: boolean | QsPluginOptions;\n sse?: boolean | SsePluginOptions;\n static?: boolean | FastifyStaticOptions;\n session?: boolean | SecureSessionPluginOptions;\n\n custom?: (server: FastifyInstance) => void;\n };\n\n auth?:\n | boolean\n | {\n userSerializer: SerializeFunction<unknown, unknown>;\n userDeserializer: DeserializeFunction<unknown, unknown>;\n };\n\n apiConfig: SonamuFastifyConfig;\n\n storage?: Driver;\n\n lifecycle?: {\n onStart?: (server: FastifyInstance) => Promise<void> | void;\n onShutdown?: (server: FastifyInstance) => Promise<void> | void;\n onError?: (\n error: Error,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Promise<void> | void;\n };\n};\n"],"names":["GenerateOptions","PathAndCode","RenderingNode","SQLDateTimeString","SonamuQueryMode","TemplateKey","TemplateOptions","isBelongsToOneRelationProp","isBigIntegerProp","isBooleanProp","isCustomJoinClause","isDateProp","isDateTimeProp","isDecimalProp","isDoubleProp","isEnumProp","isFloatProp","isHasManyRelationProp","isIntegerProp","isJsonProp","isKnexError","isManyToManyRelationProp","isOneToOneRelationProp","isRelationProp","isStringProp","isTextProp","isTimeProp","isTimestampProp","isUuidProp","isVirtualProp","zArrayable","z","string","regex","message","min","max","describe","shape","union","array","p","type","relationType","custom","enum","e","code","sqlMessage","sqlState","ApiParamType","isObject","v","t","isUnion","isIntersection","isStringLiteral","isNumericLiteral","isArray","isRef","isIndexedAccess","isTupleType","isPick","id","isOmit","isPartial","isPromise","isContext","isRefKnex","isTypeParam","any","object","entity","entityId","parentId","optional","title","table","props","indexes","subsets","enums","init_types","generated","generated_sso","generated_http","model","defaultSearchField","defaultOrderBy","model_test","bridge","service","namesRecord","fs","fsPlural","camel","camelPlural","capital","capitalPlural","upper","constant","modelTsPath","view_list","extra","unknown","view_list_columns","columns","name","label","tc","columnImports","view_search_input","view_form","view_id_all_select","view_id_async_select","textField","view_enums_select","enumId","view_enums_dropdown","view_enums_buttonset","overwrite","boolean","path"],"mappings":"2RA4wBaA,yBAAAA,qBAKAC,qBAAAA,iBA/IAC,uBAAAA,mBAjmBAC,2BAAAA,uBAoYAC,yBAAAA,qBAiVAC,qBAAAA,iBAtFAC,yBAAAA,qBA1VGC,oCAAAA,gCAnDAC,0BAAAA,sBAqBAC,uBAAAA,mBAkDAC,4BAAAA,wBA/CAC,oBAAAA,gBAGAC,wBAAAA,oBATAC,uBAAAA,mBAHAC,sBAAAA,kBANAC,oBAAAA,gBAGAC,qBAAAA,iBA4CAC,+BAAAA,2BA3DAC,uBAAAA,mBAuCAC,oBAAAA,gBAyHAC,qBAAAA,iBAlGAC,kCAAAA,8BAXAC,gCAAAA,4BAHAC,wBAAAA,oBAvCAC,sBAAAA,kBAHAC,oBAAAA,gBA2BAC,oBAAAA,gBAGAC,yBAAAA,qBAMAC,oBAAAA,gBAGAC,uBAAAA,mBA/QAC,oBAAAA,+BApCE,OAuBX,IAAM3B,kBAAoB4B,MAAC,CAC/BC,MAAM,GACNC,KAAK,CAAC,8DAA+D,CACpEC,QAAS,gBACX,GACCC,GAAG,CAAC,IACJC,GAAG,CAAC,IACJC,QAAQ,CAAC,qBAML,SAASP,WACdQ,KAAQ,EAER,OAAOP,MAAC,CAACQ,KAAK,CAAC,CAACD,MAAOA,MAAME,KAAK,GAAG,CACvC,CA8NO,SAAStB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3BE,SAAU1C,MAAC,CAACC,MAAM,EACpB,GACAkF,qBAAsBnF,MAAC,CAACwC,MAAM,CAAC,CAC7BE,SAAU1C,MAAC,CAACC,MAAM,GAClBmF,UAAWpF,MAAC,CAACC,MAAM,EACrB,GACAoF,kBAAmBrF,MAAC,CAACwC,MAAM,CAAC,CAC1BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,GACAsF,oBAAqBvF,MAAC,CAACwC,MAAM,CAAC,CAC5BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,GACAuF,qBAAsBxF,MAAC,CAACwC,MAAM,CAAC,CAC7BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,EACF,GAGO,IAAM3B,YAAc0B,MAAC,CAACc,IAAI,CAAC,CAChC,SACA,aACA,YACA,gBACA,iBACA,QACA,aACA,SACA,UACA,YACA,oBACA,oBACA,YACA,qBACA,uBACA,oBACA,sBACA,uBACD,EAGM,IAAM7C,gBAAkB+B,MAAC,CAACwC,MAAM,CAAC,CACtCiD,UAAWzF,MAAC,CAAC0F,OAAO,GAAG9C,QAAQ,EACjC,GAGO,IAAM1E,YAAc8B,MAAC,CAACwC,MAAM,CAAC,CAClCmD,KAAM3F,MAAC,CAACC,MAAM,GACde,KAAMhB,MAAC,CAACC,MAAM,EAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typings/knex.d.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/async-utils.ts"],"sourcesContent":["/**\n * 비동기 조건으로 배열을 필터링합니다\n * @example\n * const filtered = await filterAsync([1, 2, 3], async (x) => x > 1);\n */\nexport async function filterAsync<T>(\n arr: T[],\n predicate: (item: T, index: number, array: T[]) => Promise<boolean>\n): Promise<T[]> {\n const results = await Promise.all(\n arr.map((item, index) =>\n predicate(item, index, arr).then((keep) => ({ item, keep }))\n )\n );\n return results.filter((r) => r.keep).map((r) => r.item);\n}\n\n/**\n * 비동기 조건이 모든 요소에 대해 참인지 확인합니다\n * @example\n * const allValid = await everyAsync([1, 2, 3], async (x) => x > 0);\n */\nexport async function everyAsync<T>(\n arr: T[],\n predicate: (item: T, index: number, array: T[]) => Promise<boolean>\n): Promise<boolean> {\n for (let i = 0; i < arr.length; i++) {\n if (!(await predicate(arr[i], i, arr))) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 비동기 변환 함수를 배열의 각 요소에 적용합니다\n * @example\n * const doubled = await mapAsync([1, 2, 3], async (x) => x * 2);\n */\nexport async function mapAsync<T, U>(\n arr: T[],\n mapper: (item: T, index: number, array: T[]) => Promise<U>\n): Promise<U[]> {\n return Promise.all(\n arr.map((item, index) => mapper(item, index, arr))\n );\n}\n\n/**\n * 비동기 리듀서로 배열을 축약합니다\n * @example\n * const sum = await reduceAsync([1, 2, 3], async (acc, x) => acc + x, 0);\n */\nexport async function reduceAsync<T, U>(\n arr: T[],\n reducer: (accumulator: U, currentValue: T, index: number, array: T[]) => Promise<U>,\n initialValue: U\n): Promise<U> {\n let accumulator = initialValue;\n for (let i = 0; i < arr.length; i++) {\n accumulator = await reducer(accumulator, arr[i], i, arr);\n }\n return accumulator;\n}\n"],"names":["everyAsync","filterAsync","mapAsync","reduceAsync","arr","predicate","results","Promise","all","map","item","index","then","keep","filter","r","i","length","mapper","reducer","initialValue","accumulator"],"mappings":"mPAsBsBA,oBAAAA,gBAjBAC,qBAAAA,iBAkCAC,kBAAAA,cAcAC,qBAAAA,qzDAhDf,SAAeF,YACpBG,GAAQ,CACRC,SAAmE,4CAE7DC,+EAAU,SAAMC,QAAQC,GAAG,CAC/BJ,IAAIK,GAAG,CAAC,SAACC,KAAMC,cACbN,UAAUK,KAAMC,MAAOP,KAAKQ,IAAI,CAAC,SAACC,YAAU,CAAEH,KAAAA,KAAMG,KAAAA,IAAK,eAFvDP,QAAU,cAKhB,SAAOA,QAAQQ,MAAM,CAAC,SAACC,UAAMA,EAAEF,IAAI,GAAEJ,GAAG,CAAC,SAACM,UAAMA,EAAEL,IAAI,MACxD,KAOO,SAAeV,WACpBI,GAAQ,CACRC,SAAmE,4CAE1DW,yEAAAA,EAAI,4BAAGA,CAAAA,EAAIZ,IAAIa,MAAM,AAAD,cACrB,SAAMZ,UAAUD,GAAG,CAACY,EAAE,CAAEA,EAAGZ,aAAjC,GAAI,CAAE,cAAkC,CACtC,SAAO,MACT,uBAH8BY,uBAKhC,SAAO,QACT,KAOO,SAAed,SACpBE,GAAQ,CACRc,MAA0D,mFAE1D,SAAOX,QAAQC,GAAG,CAChBJ,IAAIK,GAAG,CAAC,SAACC,KAAMC,cAAUO,OAAOR,KAAMC,MAAOP,UAEjD,KAOO,SAAeD,YACpBC,GAAQ,CACRe,OAAmF,CACnFC,YAAe,4CAEXC,YACKL,yEADLK,YAAcD,aACTJ,EAAI,4BAAGA,CAAAA,EAAIZ,IAAIa,MAAM,AAAD,cACb,SAAME,QAAQE,YAAajB,GAAG,CAACY,EAAE,CAAEA,EAAGZ,aAApDiB,YAAc,oCADgBL,uBAGhC,SAAOK,eACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/controller.ts"],"sourcesContent":["export function isLocal(): boolean {\n return process.env.LR === undefined || process.env.LR === \"local\";\n}\nexport function isRemote(): boolean {\n return process.env.LR === \"remote\";\n}\nexport function isInDocker(): boolean {\n return process.env.LR !== undefined;\n}\nexport function isDaemonServer(): boolean {\n return process.env.NODE_TYPE === \"daemon\";\n}\nexport function isDevelopment(): boolean {\n return isRemote() && process.env.NODE_ENV === \"development\";\n}\nexport function isStaging(): boolean {\n return isRemote() && process.env.NODE_ENV === \"staging\";\n}\nexport function isProduction(): boolean {\n return isRemote() && process.env.NODE_ENV === \"production\";\n}\nexport function isTest(): boolean {\n return isLocal() && process.env.NODE_ENV === \"test\";\n}\n"],"names":["isDaemonServer","isDevelopment","isInDocker","isLocal","isProduction","isRemote","isStaging","isTest","process","env","LR","undefined","NODE_TYPE","NODE_ENV"],"mappings":"mPASgBA,wBAAAA,oBAGAC,uBAAAA,mBANAC,oBAAAA,gBANAC,iBAAAA,aAkBAC,sBAAAA,kBAfAC,kBAAAA,cAYAC,mBAAAA,eAMAC,gBAAAA,UArBT,SAASJ,UACd,OAAOK,QAAQC,GAAG,CAACC,EAAE,GAAKC,WAAaH,QAAQC,GAAG,CAACC,EAAE,GAAK,OAC5D,CACO,SAASL,WACd,OAAOG,QAAQC,GAAG,CAACC,EAAE,GAAK,QAC5B,CACO,SAASR,aACd,OAAOM,QAAQC,GAAG,CAACC,EAAE,GAAKC,SAC5B,CACO,SAASX,iBACd,OAAOQ,QAAQC,GAAG,CAACG,SAAS,GAAK,QACnC,CACO,SAASX,gBACd,OAAOI,YAAcG,QAAQC,GAAG,CAACI,QAAQ,GAAK,aAChD,CACO,SAASP,YACd,OAAOD,YAAcG,QAAQC,GAAG,CAACI,QAAQ,GAAK,SAChD,CACO,SAAST,eACd,OAAOC,YAAcG,QAAQC,GAAG,CAACI,QAAQ,GAAK,YAChD,CACO,SAASN,SACd,OAAOJ,WAAaK,QAAQC,GAAG,CAACI,QAAQ,GAAK,MAC/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/fs-utils.ts"],"sourcesContent":["import { PathLike, constants } from \"fs\";\nimport { access } from \"fs/promises\";\n\n/**\n * fs/promises에는 exists가 없어요. 대신 access가 있습니다.\n * 근데 얘는 인터페이스가 쓰기 불편해요. 그래서 감싸주었습니다.\n * @param path\n * @returns\n */\nexport async function exists(path: PathLike): Promise<boolean> {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["exists","path","access","constants","F_OK"],"mappings":"oGASsBA,gDAAAA,0BATc,4BACb,qzDAQhB,SAAeA,OAAOC,IAAc,gJAEvC,SAAMC,GAAAA,gBAAM,EAACD,KAAME,aAAS,CAACC,IAAI,UAAjC,cACA,SAAO,6BAEP,SAAO,0BAEX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/lodash-able.ts"],"sourcesContent":["export function wrapIf(\n source: string,\n predicate: (str: string) => [boolean, string]\n): string {\n const [ok, wrapped] = predicate(source);\n return ok ? wrapped : source;\n}\n"],"names":["wrapIf","source","predicate","ok","wrapped"],"mappings":"oGAAgBA,gDAAAA,o2CAAT,SAASA,OACdC,MAAc,CACdC,SAA6C,EAE7C,IAAsBA,4BAAAA,UAAUD,WAAzBE,GAAeD,cAAXE,QAAWF,cACtB,OAAOC,GAAKC,QAAUH,MACxB"}
|
package/dist/utils/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/model.ts"],"sourcesContent":["export type ListResult<T> = {\n rows: T[];\n total?: number;\n};\n\nexport type ArrayOr<T> = T | T[];\n\nexport function asArray<T>(param: T | T[]): T[] {\n if (Array.isArray(param)) {\n return param;\n } else {\n return [param as T] as T[];\n }\n}\n\nexport function objToMap<T>(obj: { [k: string]: T }) {\n const keys = Object.keys(obj);\n if (keys.every((key) => parseInt(key).toString() === key)) {\n return new Map<number, T>(keys.map((key) => [parseInt(key), obj[key]]));\n } else {\n return new Map<string, T>(Object.entries(obj));\n }\n}\n\nexport interface BaseListParams {\n id?: number | number[];\n num?: number;\n page?: number;\n keyword?: string;\n queryMode?: \"list\" | \"count\" | \"both\";\n}\n"],"names":["asArray","objToMap","param","Array","isArray","obj","keys","Object","every","key","parseInt","toString","Map","map","entries"],"mappings":"mPAOgBA,iBAAAA,aAQAC,kBAAAA,YART,SAASD,QAAWE,KAAc,EACvC,GAAIC,MAAMC,OAAO,CAACF,OAAQ,CACxB,OAAOA,KACT,KAAO,CACL,MAAO,CAACA,MAAW,AACrB,CACF,CAEO,SAASD,SAAYI,GAAuB,EACjD,IAAMC,KAAOC,OAAOD,IAAI,CAACD,KACzB,GAAIC,KAAKE,KAAK,CAAC,SAACC,YAAQC,SAASD,KAAKE,QAAQ,KAAOF,MAAM,CACzD,OAAO,IAAIG,IAAeN,KAAKO,GAAG,CAAC,SAACJ,WAAQ,CAACC,SAASD,KAAMJ,GAAG,CAACI,IAAI,CAAC,GACvE,KAAO,CACL,OAAO,IAAIG,IAAeL,OAAOO,OAAO,CAACT,KAC3C,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/sql-parser.ts"],"sourcesContent":["import _ from \"lodash\";\nimport { AST, ColumnRef, Expr, ExpressionValue, Select } from \"node-sql-parser\";\n\nexport function getTableName(expr: ColumnRef) {\n if (\"table\" in expr && expr.table !== null) {\n return typeof expr.table === \"string\"\n ? expr.table\n : (expr.table as { type: string; value: string }).value;\n }\n return null;\n}\n\n// where 조건에 사용된 테이블명을 추출\nexport function getTableNamesFromWhere(ast: AST | AST[]): string[] {\n const extractTableNames = (where: Select[\"where\"]): string[] => {\n if (where === null || !(where.type === \"binary_expr\" && \"left\" in where)) {\n return [];\n }\n\n const extractTableName = (expr: Expr | ExpressionValue): string[] => {\n if (expr.type === \"column_ref\") {\n const table = getTableName(expr as ColumnRef);\n return table ? [table] : [];\n } else if (expr.type === \"binary_expr\" && \"left\" in expr) {\n return extractTableNames(expr);\n }\n return [];\n };\n\n return [...extractTableName(where.left), ...extractTableName(where.right)];\n };\n\n return _.uniq(\n (Array.isArray(ast) ? ast : [ast]).flatMap((a) =>\n a.type === \"select\" || a.type === \"update\" || a.type === \"delete\"\n ? extractTableNames(a.where)\n : []\n )\n );\n}\n"],"names":["getTableName","getTableNamesFromWhere","expr","table","value","ast","extractTableNames","where","type","extractTableName","left","right","_","uniq","Array","isArray","flatMap","a"],"mappings":"mPAGgBA,sBAAAA,kBAUAC,gCAAAA,oFAbF,srCAGP,SAASD,aAAaE,IAAe,EAC1C,GAAI,UAAWA,MAAQA,KAAKC,KAAK,GAAK,KAAM,CAC1C,OAAO,OAAOD,KAAKC,KAAK,GAAK,SACzBD,KAAKC,KAAK,CACV,AAACD,KAAKC,KAAK,CAAqCC,KAAK,AAC3D,CACA,OAAO,IACT,CAGO,SAASH,uBAAuBI,GAAgB,EACrD,IAAMC,kBAAoB,SAACC,OACzB,GAAIA,QAAU,MAAQ,CAAEA,CAAAA,MAAMC,IAAI,GAAK,eAAiB,SAAUD,KAAI,EAAI,CACxE,MAAO,EAAE,AACX,CAEA,IAAME,iBAAmB,SAACP,MACxB,GAAIA,KAAKM,IAAI,GAAK,aAAc,CAC9B,IAAML,MAAQH,aAAaE,MAC3B,OAAOC,MAAQ,CAACA,MAAM,CAAG,EAAE,AAC7B,MAAO,GAAID,KAAKM,IAAI,GAAK,eAAiB,SAAUN,KAAM,CACxD,OAAOI,kBAAkBJ,KAC3B,CACA,MAAO,EAAE,AACX,EAEA,OAAO,AAAC,qBAAGO,iBAAiBF,MAAMG,IAAI,UAAG,qBAAGD,iBAAiBF,MAAMI,KAAK,GAC1E,EAEA,OAAOC,eAAC,CAACC,IAAI,CACX,AAACC,CAAAA,MAAMC,OAAO,CAACV,KAAOA,IAAM,CAACA,IAAI,AAAD,EAAGW,OAAO,CAAC,SAACC,UAC1CA,EAAET,IAAI,GAAK,UAAYS,EAAET,IAAI,GAAK,UAAYS,EAAET,IAAI,GAAK,SACrDF,kBAAkBW,EAAEV,KAAK,EACzB,EAAE,GAGZ"}
|
package/dist/utils/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/utils.ts"],"sourcesContent":["import path from \"path\";\nimport { glob } from \"fs/promises\";\nimport fs from \"fs\";\n\nexport async function globAsync(pathPattern: string): Promise<string[]> {\n const files: string[] = [];\n for await (const file of glob(path.resolve(pathPattern))) {\n files.push(file);\n }\n return files;\n}\nexport async function importMultiple(\n filePaths: string[],\n doRefresh: boolean = false\n): Promise<{ filePath: string; imported: any }[]> {\n const results: { filePath: string; imported: any }[] = [];\n\n for (const filePath of filePaths) {\n let importPath = \"./\" + path.relative(__dirname, filePath);\n\n if (doRefresh) {\n if (require.resolve) {\n delete require.cache[require.resolve(importPath)];\n } else {\n importPath += `?t=${Date.now()}`;\n }\n }\n\n const imported = await import(importPath);\n results.push({\n filePath,\n imported,\n });\n }\n\n return results;\n}\nexport async function findAppRootPath() {\n const apiRootPath = findApiRootPath();\n return apiRootPath.split(path.sep).slice(0, -1).join(path.sep);\n}\n\nexport function findApiRootPath() {\n // NOTE: for support npm / yarn workspaces\n const workspacePath = process.env[\"INIT_CWD\"];\n if (workspacePath && workspacePath.length !== 0) {\n return workspacePath;\n }\n\n const basePath = require.main?.path ?? __dirname;\n let dir = path.dirname(basePath);\n if (dir.includes(\"/.yarn/\")) {\n dir = dir.split(\"/.yarn/\")[0];\n }\n do {\n if (fs.existsSync(path.join(dir, \"/package.json\"))) {\n return dir.split(path.sep).join(path.sep);\n }\n dir = dir.split(path.sep).slice(0, -1).join(path.sep);\n } while (dir.split(path.sep).length > 1);\n throw new Error(\"Cannot find AppRoot using Sonamu -2\");\n}\n\nexport function nonNullable<T>(value: T): value is NonNullable<T> {\n return value !== null && value !== undefined;\n}\n"],"names":["findApiRootPath","findAppRootPath","globAsync","importMultiple","nonNullable","pathPattern","files","file","glob","path","resolve","push","filePaths","doRefresh","results","filePath","importPath","imported","relative","__dirname","require","cache","Date","now","apiRootPath","split","sep","slice","join","workspacePath","process","env","length","basePath","main","dir","dirname","includes","fs","existsSync","Error","value","undefined"],"mappings":"mPA0CgBA,yBAAAA,qBALMC,yBAAAA,qBAjCAC,mBAAAA,eAOAC,wBAAAA,oBAoDNC,qBAAAA,uEA/DC,+BACI,qEACN,8iIAER,SAAeF,UAAUG,WAAmB,4CAC3CC,wFACWC,gFADXD,8IACmBE,GAAAA,cAAI,EAACC,aAAI,CAACC,OAAO,CAACL,kKAA1BE,YACfD,MAAMK,IAAI,CAACJ,gcAEb,SAAOD,SACT,KACO,SAAeH,eAC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AI,CAACO,IAAK,kBAAmB,CAClD,OAAOA,IAAIV,KAAK,CAAChB,aAAI,CAACiB,GAAG,EAAEE,IAAI,CAACnB,aAAI,CAACiB,GAAG,CAC1C,CACAS,IAAMA,IAAIV,KAAK,CAAChB,aAAI,CAACiB,GAAG,EAAEC,KAAK,CAAC,EAAG,CAAC,GAAGC,IAAI,CAACnB,aAAI,CAACiB,GAAG,CACtD,OAASS,IAAIV,KAAK,CAAChB,aAAI,CAACiB,GAAG,EAAEM,MAAM,CAAG,EAAG,AACzC,OAAM,IAAIQ,MAAM,sCAClB,CAEO,SAASpC,YAAeqC,KAAQ,EACrC,OAAOA,QAAU,MAAQA,QAAUC,SACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/zod-error.ts"],"sourcesContent":["\nimport { z } from 'zod';\n\ntype ValidationError = {\n path: string[];\n message: string;\n};\n\nexport function humanizeZodError(error: z.ZodError): ValidationError[] {\n return error.issues.map(({ path: originPath, message }) => {\n const path = originPath.map(item => {\n if (typeof item === \"symbol\") {\n return item.description ?? item.toString();\n }\n\n if (typeof item === \"number\") {\n return `[${item}]`;\n }\n\n return item;\n });\n\n return { path, message: message };\n });\n}\n"],"names":["humanizeZodError","error","issues","map","path","originPath","message","item","description","toString"],"mappings":"oGAQgBA,0DAAAA,yJAAT,SAASA,iBAAiBC,KAAiB,EAChD,OAAOA,MAAMC,MAAM,CAACC,GAAG,CAAC,oBAAIC,AAAMC,iBAAND,KAAkBE,cAAAA,QAC5C,IAAMF,KAAOC,WAAWF,GAAG,CAACI,SAAAA,MAC1B,GAAI,CAAA,OAAOA,+BAAP,SAAOA,KAAG,IAAM,SAAU,KACrBA,kBAAP,MAAOA,CAAAA,kBAAAA,KAAKC,WAAW,UAAhBD,2BAAAA,kBAAoBA,KAAKE,QAAQ,EAC1C,CAEA,GAAI,OAAOF,OAAS,SAAU,CAC5B,MAAO,AAAC,IAAQ,OAALA,KAAK,IAClB,CAEA,OAAOA,IACT,GAEA,MAAO,CAAEH,KAAAA,KAAME,QAASA,OAAQ,CAClC,EACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TemplateKey, TemplateOptions } from "../types/types";
|
|
2
|
-
import { EntityNamesRecord } from "../entity/entity-manager";
|
|
3
|
-
import { RenderedTemplate } from "../syncer/syncer";
|
|
4
|
-
|
|
5
|
-
export abstract class Template {
|
|
6
|
-
constructor(public key: TemplateKey) {}
|
|
7
|
-
public abstract render(
|
|
8
|
-
options: TemplateOptions[TemplateKey],
|
|
9
|
-
...extra: unknown[]
|
|
10
|
-
): RenderedTemplate | Promise<RenderedTemplate>;
|
|
11
|
-
|
|
12
|
-
public abstract getTargetAndPath(
|
|
13
|
-
names?: EntityNamesRecord,
|
|
14
|
-
...extra: unknown[]
|
|
15
|
-
): {
|
|
16
|
-
target: string;
|
|
17
|
-
path: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
package/src/templates/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./base-template";
|