create-entity-app-server 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create.js +47 -13
- package/dist/.env.example +68 -0
- package/dist/app/plugins/ocr/cache.ts +1 -0
- package/dist/app/plugins/ocr/config.ts +1 -0
- package/dist/app/plugins/ocr/direction.ts +1 -0
- package/dist/app/plugins/ocr/dispatch.ts +1 -0
- package/dist/app/plugins/ocr/entity-adapter.ts +1 -0
- package/dist/app/plugins/ocr/errors.ts +1 -0
- package/dist/app/plugins/ocr/handlers.ts +1 -0
- package/dist/app/plugins/ocr/index.ts +1 -0
- package/dist/app/plugins/ocr/llm-parser.ts +1 -0
- package/dist/app/plugins/ocr/parsing-pipeline.ts +1 -0
- package/dist/app/plugins/ocr/pdf-converter.ts +1 -0
- package/dist/app/plugins/ocr/preprocessor.ts +1 -0
- package/dist/app/plugins/ocr/providers/aws.ts +1 -0
- package/dist/app/plugins/ocr/providers/azure.ts +1 -0
- package/dist/app/plugins/ocr/providers/google.ts +1 -0
- package/dist/app/plugins/ocr/providers/index.ts +1 -0
- package/dist/app/plugins/ocr/providers/naver.ts +1 -0
- package/dist/app/plugins/ocr/providers/tesseract.ts +1 -0
- package/dist/app/plugins/ocr/providers/upstage.ts +1 -0
- package/dist/app/plugins/ocr/quota.ts +1 -0
- package/dist/app/plugins/ocr/refiner.ts +1 -0
- package/dist/app/plugins/ocr/routes.ts +1 -0
- package/dist/app/plugins/ocr/service.ts +1 -0
- package/dist/app/plugins/ocr/template-loader.ts +1 -0
- package/dist/app/plugins/ocr/template-matcher.ts +1 -0
- package/dist/app/plugins/ocr/types/config.ts +1 -0
- package/dist/app/plugins/ocr/types/driver.ts +1 -0
- package/dist/app/plugins/ocr/types/index.ts +1 -0
- package/dist/app/plugins/ocr/types/parsed.ts +1 -0
- package/dist/app/plugins/ocr/types/store.ts +1 -0
- package/dist/app/plugins/ocr/types/template.ts +1 -0
- package/dist/app/plugins/ocr/utils.ts +1 -0
- package/dist/app/plugins/sms/config.ts +1 -0
- package/dist/app/plugins/sms/entity-adapter.ts +1 -0
- package/dist/app/plugins/sms/handlers.ts +1 -0
- package/dist/app/plugins/sms/index.ts +1 -0
- package/dist/app/plugins/sms/providers/aligo.ts +1 -0
- package/dist/app/plugins/sms/providers/aws-sns.ts +1 -0
- package/dist/app/plugins/sms/providers/index.ts +1 -0
- package/dist/app/plugins/sms/providers/nhn.ts +1 -0
- package/dist/app/plugins/sms/providers/ppurio.ts +1 -0
- package/dist/app/plugins/sms/providers/solapi.ts +1 -0
- package/dist/app/plugins/sms/routes.ts +1 -0
- package/dist/app/plugins/sms/service.ts +1 -0
- package/dist/app/plugins/sms/types/client.ts +1 -0
- package/dist/app/plugins/sms/types/config.ts +1 -0
- package/dist/app/plugins/sms/types/index.ts +1 -0
- package/dist/app/plugins/sms/types/job.ts +1 -0
- package/dist/app/plugins/sms/verification.ts +1 -0
- package/dist/app/plugins/smtp/config.ts +1 -0
- package/dist/app/plugins/smtp/handlers.ts +1 -0
- package/dist/app/plugins/smtp/index.ts +1 -0
- package/dist/app/plugins/smtp/routes.ts +1 -0
- package/dist/app/plugins/smtp/types/config.ts +1 -0
- package/dist/app/plugins/smtp/types/index.ts +1 -0
- package/dist/logs/access.1.log +0 -0
- package/dist/system-api.js +1 -0
- package/dist/system.js +1 -0
- package/package.json +3 -8
- package/docs/design/board-api-design.md +0 -2342
- package/scripts/_gen-table-type.ts +0 -605
- package/scripts/build-minify-plugins.mjs +0 -124
- package/scripts/build-obfuscate-system.mjs +0 -38
- package/scripts/build.sh +0 -140
- package/scripts/gen-table-type.sh +0 -169
- package/scripts/push.sh +0 -102
- package/scripts/release.sh +0 -51
- package/src/app/plugins/2fa/config.json +0 -17
- package/src/app/plugins/ais/config.json +0 -7
- package/src/app/plugins/ais/config.ts +0 -32
- package/src/app/plugins/ais/docs/README.md +0 -142
- package/src/app/plugins/ais/docs/api.md +0 -138
- package/src/app/plugins/ais/entities/ais_vessel.json +0 -64
- package/src/app/plugins/ais/handlers.ts +0 -88
- package/src/app/plugins/ais/index.ts +0 -21
- package/src/app/plugins/ais/routes.ts +0 -13
- package/src/app/plugins/ais/service.ts +0 -242
- package/src/app/plugins/ais/types/index.ts +0 -78
- package/src/app/plugins/alimtalk/config.json +0 -26
- package/src/app/plugins/distance-server/config.json +0 -6
- package/src/app/plugins/distance-server/config.ts +0 -50
- package/src/app/plugins/distance-server/docs/README.md +0 -114
- package/src/app/plugins/distance-server/handlers.ts +0 -104
- package/src/app/plugins/distance-server/index.ts +0 -23
- package/src/app/plugins/distance-server/routes.ts +0 -36
- package/src/app/plugins/distance-server/service.ts +0 -187
- package/src/app/plugins/distance-server/types/index.ts +0 -8
- package/src/app/plugins/friendtalk/config.json +0 -11
- package/src/app/plugins/holidays/config.json +0 -10
- package/src/app/plugins/identity/config.json +0 -30
- package/src/app/plugins/kobc_freight/config.json +0 -6
- package/src/app/plugins/kobc_freight/config.ts +0 -28
- package/src/app/plugins/kobc_freight/docs/README.md +0 -316
- package/src/app/plugins/kobc_freight/entities/kobc_freight_entry.json +0 -31
- package/src/app/plugins/kobc_freight/entities/kobc_kcci_entry.json +0 -67
- package/src/app/plugins/kobc_freight/entities/kobc_kpli_entry.json +0 -27
- package/src/app/plugins/kobc_freight/entities/kobc_ncfi_entry.json +0 -99
- package/src/app/plugins/kobc_freight/handlers.ts +0 -283
- package/src/app/plugins/kobc_freight/index.ts +0 -21
- package/src/app/plugins/kobc_freight/routes.ts +0 -39
- package/src/app/plugins/kobc_freight/service.ts +0 -604
- package/src/app/plugins/kobc_freight/types/index.ts +0 -99
- package/src/app/plugins/llm/config.json +0 -71
- package/src/app/plugins/oauth/config.json +0 -72
- package/src/app/plugins/ocr/cache.ts +0 -50
- package/src/app/plugins/ocr/config.json +0 -110
- package/src/app/plugins/ocr/config.ts +0 -126
- package/src/app/plugins/ocr/direction.ts +0 -48
- package/src/app/plugins/ocr/dispatch.ts +0 -130
- package/src/app/plugins/ocr/entity-adapter.ts +0 -198
- package/src/app/plugins/ocr/errors.ts +0 -42
- package/src/app/plugins/ocr/handlers.ts +0 -250
- package/src/app/plugins/ocr/index.ts +0 -68
- package/src/app/plugins/ocr/llm-parser.ts +0 -164
- package/src/app/plugins/ocr/parsing-pipeline.ts +0 -87
- package/src/app/plugins/ocr/pdf-converter.ts +0 -136
- package/src/app/plugins/ocr/preprocessor.ts +0 -313
- package/src/app/plugins/ocr/providers/aws.ts +0 -200
- package/src/app/plugins/ocr/providers/azure.ts +0 -183
- package/src/app/plugins/ocr/providers/google.ts +0 -155
- package/src/app/plugins/ocr/providers/index.ts +0 -80
- package/src/app/plugins/ocr/providers/naver.ts +0 -186
- package/src/app/plugins/ocr/providers/tesseract.ts +0 -198
- package/src/app/plugins/ocr/providers/upstage.ts +0 -156
- package/src/app/plugins/ocr/quota.ts +0 -108
- package/src/app/plugins/ocr/refiner.ts +0 -112
- package/src/app/plugins/ocr/routes.ts +0 -19
- package/src/app/plugins/ocr/service.ts +0 -333
- package/src/app/plugins/ocr/template-loader.ts +0 -72
- package/src/app/plugins/ocr/template-matcher.ts +0 -422
- package/src/app/plugins/ocr/types/config.ts +0 -60
- package/src/app/plugins/ocr/types/driver.ts +0 -71
- package/src/app/plugins/ocr/types/index.ts +0 -5
- package/src/app/plugins/ocr/types/parsed.ts +0 -101
- package/src/app/plugins/ocr/types/store.ts +0 -70
- package/src/app/plugins/ocr/types/template.ts +0 -89
- package/src/app/plugins/ocr/utils.ts +0 -18
- package/src/app/plugins/pg/config.json +0 -35
- package/src/app/plugins/push/config.json +0 -18
- package/src/app/plugins/sms/config.json +0 -33
- package/src/app/plugins/sms/config.ts +0 -158
- package/src/app/plugins/sms/entity-adapter.ts +0 -213
- package/src/app/plugins/sms/handlers.ts +0 -149
- package/src/app/plugins/sms/index.ts +0 -93
- package/src/app/plugins/sms/providers/aligo.ts +0 -73
- package/src/app/plugins/sms/providers/aws-sns.ts +0 -182
- package/src/app/plugins/sms/providers/index.ts +0 -47
- package/src/app/plugins/sms/providers/nhn.ts +0 -82
- package/src/app/plugins/sms/providers/ppurio.ts +0 -76
- package/src/app/plugins/sms/providers/solapi.ts +0 -83
- package/src/app/plugins/sms/routes.ts +0 -23
- package/src/app/plugins/sms/service.ts +0 -239
- package/src/app/plugins/sms/types/client.ts +0 -41
- package/src/app/plugins/sms/types/config.ts +0 -46
- package/src/app/plugins/sms/types/index.ts +0 -3
- package/src/app/plugins/sms/types/job.ts +0 -51
- package/src/app/plugins/sms/verification.ts +0 -162
- package/src/app/plugins/smtp/config.ts +0 -41
- package/src/app/plugins/smtp/handlers.ts +0 -52
- package/src/app/plugins/smtp/index.ts +0 -33
- package/src/app/plugins/smtp/routes.ts +0 -19
- package/src/app/plugins/smtp/types/config.ts +0 -8
- package/src/app/plugins/smtp/types/index.ts +0 -1
- package/src/app/plugins/taxinvoice/config.json +0 -35
- package/src/app/routes/calendar/config.json +0 -5
- package/src/app/routes/calendar/entities/calendar_attendees.json +0 -23
- package/src/app/routes/calendar/entities/calendar_comments.json +0 -17
- package/src/app/routes/calendar/entities/calendar_events.json +0 -48
- package/src/app/routes/calendar/entities/calendar_kind.json +0 -11
- package/src/app/routes/calendar/entities/calendar_method.json +0 -11
- package/src/app/routes/calendar/routes.ts +0 -32
- package/src/app/routes/email-verify/config-loader.ts +0 -47
- package/src/app/routes/email-verify/config.example.json +0 -13
- package/src/app/routes/email-verify/config.json +0 -16
- package/src/app/routes/email-verify/entities/account.json +0 -23
- package/src/app/routes/email-verify/handlers/activate.ts +0 -103
- package/src/app/routes/email-verify/handlers/change.ts +0 -106
- package/src/app/routes/email-verify/handlers/confirm.ts +0 -87
- package/src/app/routes/email-verify/handlers/index.ts +0 -20
- package/src/app/routes/email-verify/handlers/send.ts +0 -157
- package/src/app/routes/email-verify/handlers/status.ts +0 -53
- package/src/app/routes/email-verify/handlers/utils.ts +0 -85
- package/src/app/routes/email-verify/routes.ts +0 -54
- package/src/app/routes/email-verify/templates/verification.html +0 -15
- package/src/app/routes/email-verify/templates/verification_link.html +0 -19
- package/src/app/routes/email-verify/types/index.ts +0 -77
- package/src/app/routes/email-verify/verification-utils.ts +0 -57
- package/src/app/routes/example-db/config.json +0 -5
- package/src/app/routes/example-db/handlers.ts +0 -220
- package/src/app/routes/example-db/models/account-ext.ts +0 -33
- package/src/app/routes/example-db/models/users.ts +0 -30
- package/src/app/routes/example-db/routes.ts +0 -23
- package/src/app/routes/example-db/types/defaults.ts +0 -21
- package/src/app/routes/example-db/types/index.ts +0 -4
- package/src/app/routes/example-db/types/params.ts +0 -3
- package/src/app/routes/example-db/types/query.ts +0 -6
- package/src/app/routes/example-db/types/user.ts +0 -11
- package/src/app/routes/example-es/config.json +0 -5
- package/src/app/routes/example-es/handlers.ts +0 -216
- package/src/app/routes/example-es/routes.ts +0 -24
- package/src/app/routes/example-es/types/defaults.ts +0 -30
- package/src/app/routes/example-es/types/index.ts +0 -4
- package/src/app/routes/example-es/types/params.ts +0 -3
- package/src/app/routes/example-es/types/post.ts +0 -12
- package/src/app/routes/example-es/types/query.ts +0 -14
- package/src/app/routes/funeral/config.json +0 -5
- package/src/app/routes/funeral/entities/funeral.json +0 -77
- package/src/app/routes/funeral/entities/funeral_docs.json +0 -36
- package/src/app/routes/funeral/entities/funeral_mourner.json +0 -31
- package/src/app/routes/funeral/entities/funeral_order.json +0 -48
- package/src/app/routes/funeral/entities/funeral_room.json +0 -61
- package/src/app/routes/funeral/entities/funeral_schedule.json +0 -39
- package/src/app/routes/funeral/routes.ts +0 -32
- package/src/app/routes/health/config.json +0 -5
- package/src/app/routes/health/handlers.ts +0 -69
- package/src/app/routes/health/routes.ts +0 -14
- package/src/app/routes/hr/career/config.json +0 -5
- package/src/app/routes/hr/career/entities/employee_career.json +0 -15
- package/src/app/routes/hr/career/routes.ts +0 -25
- package/src/app/routes/hr/config.json +0 -5
- package/src/app/routes/hr/education/config.json +0 -5
- package/src/app/routes/hr/education/entities/employee_education.json +0 -29
- package/src/app/routes/hr/education/entities/employee_education_mans.json +0 -25
- package/src/app/routes/hr/education/entities/employee_school.json +0 -19
- package/src/app/routes/hr/education/routes.ts +0 -28
- package/src/app/routes/hr/employee/config.json +0 -5
- package/src/app/routes/hr/employee/entities/employee.json +0 -59
- package/src/app/routes/hr/employee/entities/employee_cert.json +0 -19
- package/src/app/routes/hr/employee/entities/employee_reward.json +0 -21
- package/src/app/routes/hr/employee/routes.ts +0 -27
- package/src/app/routes/hr/entities/hr_group.json +0 -47
- package/src/app/routes/hr/entities/hr_group_pv.json +0 -20
- package/src/app/routes/hr/entities/hr_role.json +0 -43
- package/src/app/routes/hr/entities/hr_role_pv.json +0 -20
- package/src/app/routes/hr/routes.ts +0 -29
- package/src/app/routes/messages/chat/config.json +0 -5
- package/src/app/routes/messages/chat/entities/user_chat.json +0 -47
- package/src/app/routes/messages/chat/entities/user_chat_room.json +0 -38
- package/src/app/routes/messages/chat/entities/user_chat_room_member.json +0 -49
- package/src/app/routes/messages/chat/routes.ts +0 -28
- package/src/app/routes/messages/msgbox/config.json +0 -5
- package/src/app/routes/messages/msgbox/entities/user_msgbox.json +0 -73
- package/src/app/routes/messages/msgbox/routes.ts +0 -28
- package/src/app/routes/vessel-tracking/config.json +0 -3
- package/src/app/routes/vessel-tracking/entities/tracked_vessel.json +0 -261
- package/src/app/routes/vessel-tracking/handlers.ts +0 -134
- package/src/app/routes/vessel-tracking/routes.ts +0 -25
- package/src/app/routes/vessel-tracking/types/index.ts +0 -5
- package/src/app/routes/vessel-tracking/types/vessel.ts +0 -59
- package/src/app/schedules/ais_sync/config.json +0 -4
- package/src/app/schedules/ais_sync/index.ts +0 -69
- package/src/app/schedules/kobc_freight_sync/config.json +0 -4
- package/src/app/schedules/kobc_freight_sync/index.ts +0 -94
- package/src/app/schedules/vessel_kr_sync/config.json +0 -4
- package/src/app/schedules/vessel_kr_sync/index.ts +0 -72
- package/src/system/app.ts +0 -129
- package/src/system/cache/_store-ref.ts +0 -15
- package/src/system/cache/config.ts +0 -61
- package/src/system/cache/drivers/memcached.ts +0 -135
- package/src/system/cache/drivers/memory.ts +0 -92
- package/src/system/cache/drivers/redis.ts +0 -109
- package/src/system/cache/index.ts +0 -43
- package/src/system/cache/namespaced.ts +0 -79
- package/src/system/cache/plugin.ts +0 -59
- package/src/system/cache/types.ts +0 -81
- package/src/system/config/config-path.ts +0 -20
- package/src/system/config/cors.ts +0 -49
- package/src/system/config/database.ts +0 -190
- package/src/system/config/entity-server.ts +0 -8
- package/src/system/config/env-substitution.ts +0 -4
- package/src/system/config/env.ts +0 -30
- package/src/system/config/json-config.ts +0 -13
- package/src/system/config/module-path.ts +0 -16
- package/src/system/config/packet-encrypt.ts +0 -80
- package/src/system/config/rate-limit.ts +0 -4
- package/src/system/config/security-loader.ts +0 -25
- package/src/system/config/security.ts +0 -16
- package/src/system/config/server.ts +0 -81
- package/src/system/crypto/cipher.ts +0 -117
- package/src/system/crypto/data-encrypt.ts +0 -174
- package/src/system/crypto/hash.ts +0 -24
- package/src/system/crypto/packet.test.ts +0 -23
- package/src/system/crypto/packet.ts +0 -97
- package/src/system/crypto/random.ts +0 -19
- package/src/system/email/sender.ts +0 -85
- package/src/system/email/template-engine.ts +0 -147
- package/src/system/entity-server/bootstrap.ts +0 -270
- package/src/system/entity-server/client.ts +0 -64
- package/src/system/hooks/loader.ts +0 -32
- package/src/system/hooks/runner.ts +0 -159
- package/src/system/hooks/types.ts +0 -75
- package/src/system/hooks/withdraw-hooks.ts +0 -42
- package/src/system/http/cookie.ts +0 -62
- package/src/system/http/response.ts +0 -16
- package/src/system/index.ts +0 -48
- package/src/system/logging/log-format.ts +0 -50
- package/src/system/logging/logger.ts +0 -104
- package/src/system/middleware/_db-ref.ts +0 -26
- package/src/system/middleware/_push-ref.ts +0 -28
- package/src/system/middleware/access-log.ts +0 -34
- package/src/system/middleware/auth.ts +0 -67
- package/src/system/middleware/csrf.ts +0 -172
- package/src/system/middleware/database.ts +0 -44
- package/src/system/middleware/error-handler.ts +0 -51
- package/src/system/middleware/extension-loader.ts +0 -111
- package/src/system/middleware/packet-encrypt.ts +0 -281
- package/src/system/middleware/request-id.ts +0 -18
- package/src/system/plugins/access-log.ts +0 -34
- package/src/system/plugins/packet-encrypt.ts +0 -281
- package/src/system/proxy/register.ts +0 -37
- package/src/system/public-api.ts +0 -140
- package/src/system/push/sender.ts +0 -131
- package/src/system/routes/entity-interceptor.ts +0 -327
- package/src/system/routes/loader.ts +0 -215
- package/src/system/scheduler/cron-utils.ts +0 -150
- package/src/system/scheduler/distributed-lock.ts +0 -141
- package/src/system/scheduler/schedule-loader.ts +0 -105
- package/src/system/security/anonymous-device-id.ts +0 -41
- package/src/system/security/anonymous-device.ts +0 -98
- package/src/system/security/anonymous-packet-token.ts +0 -23
- package/src/system/security/packet-bootstrap.ts +0 -16
- package/src/system/security/password-policy.ts +0 -191
- package/src/system/startup-banner.ts +0 -191
- package/src/system/types/fastify.d.ts +0 -53
- package/src/system/utils/app-path.ts +0 -31
- package/src/system/utils/coerce.ts +0 -28
- package/src/system/utils/date-prefixed-log-stream.ts +0 -176
- package/src/system/utils/errors.ts +0 -66
- package/src/system/utils/format.ts +0 -45
- package/src/system/utils/http-client.ts +0 -79
- package/src/system/utils/user-agent.ts +0 -82
- package/tsconfig.app.json +0 -17
- package/tsconfig.json +0 -39
- /package/{.env.example → dist/.env} +0 -0
- /package/{src → dist}/app/hooks/README.md +0 -0
- /package/{src → dist}/app/hooks/account.ts +0 -0
- /package/{src → dist}/app/hooks/index.ts +0 -0
- /package/{src → dist}/app/hooks/order.ts +0 -0
- /package/{src → dist}/app/hooks/post.ts +0 -0
- /package/{src/app/plugins/2fa/config.example.json → dist/app/plugins/2fa/config.json} +0 -0
- /package/{src → dist}/app/plugins/2fa/config.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/2fa/entities/account.json +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/disable.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/index.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/recovery.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/regenerate.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/setup-verify.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/setup.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/status.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/utils.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/handlers/verify.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/index.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/routes.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/templates/auth/2fa_disabled.html +0 -0
- /package/{src → dist}/app/plugins/2fa/templates/auth/2fa_recovery_regenerated.html +0 -0
- /package/{src → dist}/app/plugins/2fa/templates/auth/2fa_setup_complete.html +0 -0
- /package/{src → dist}/app/plugins/2fa/totp-utils.ts +0 -0
- /package/{src → dist}/app/plugins/2fa/types.ts +0 -0
- /package/{src → dist}/app/plugins/README.md +0 -0
- /package/{src/app/plugins/alimtalk/config.example.json → dist/app/plugins/alimtalk/config.json} +0 -0
- /package/{src → dist}/app/plugins/alimtalk/config.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/alimtalk/entities/alimtalk_log.json +0 -0
- /package/{src → dist}/app/plugins/alimtalk/entities/alimtalk_msg.json +0 -0
- /package/{src → dist}/app/plugins/alimtalk/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/index.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/providers/aligo.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/providers/nhn.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/providers/ppurio.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/providers/solapi.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/routes.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/service.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/template-cache.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/templates/alimtalk.json +0 -0
- /package/{src → dist}/app/plugins/alimtalk/types/client.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/types/friendtalk.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/types/job.ts +0 -0
- /package/{src → dist}/app/plugins/alimtalk/webhook.ts +0 -0
- /package/{src → dist}/app/plugins/example/config.json +0 -0
- /package/{src → dist}/app/plugins/example/config.ts +0 -0
- /package/{src → dist}/app/plugins/example/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/example/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/example/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/example/index.ts +0 -0
- /package/{src → dist}/app/plugins/example/routes.ts +0 -0
- /package/{src → dist}/app/plugins/example/service.ts +0 -0
- /package/{src → dist}/app/plugins/example/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/example/types/index.ts +0 -0
- /package/{src/app/plugins/friendtalk/config.example.json → dist/app/plugins/friendtalk/config.json} +0 -0
- /package/{src → dist}/app/plugins/friendtalk/config.ts +0 -0
- /package/{src → dist}/app/plugins/friendtalk/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/friendtalk/entities/friendtalk_log.json +0 -0
- /package/{src → dist}/app/plugins/friendtalk/entities/friendtalk_msg.json +0 -0
- /package/{src → dist}/app/plugins/friendtalk/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/friendtalk/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/friendtalk/routes.ts +0 -0
- /package/{src → dist}/app/plugins/friendtalk/templates/friendtalk.json +0 -0
- /package/{src/app/plugins/holidays/config.example.json → dist/app/plugins/holidays/config.json} +0 -0
- /package/{src → dist}/app/plugins/holidays/config.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/holidays/entities/holiday.json +0 -0
- /package/{src → dist}/app/plugins/holidays/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/index.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/routes.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/service.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/types/api.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/holidays/types/index.ts +0 -0
- /package/{src/app/plugins/identity/config.example.json → dist/app/plugins/identity/config.json} +0 -0
- /package/{src → dist}/app/plugins/identity/config.ts +0 -0
- /package/{src → dist}/app/plugins/identity/crypto.ts +0 -0
- /package/{src → dist}/app/plugins/identity/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/identity/entities/account.json +0 -0
- /package/{src → dist}/app/plugins/identity/entities/identity_verification.json +0 -0
- /package/{src → dist}/app/plugins/identity/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/identity/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/identity/index.ts +0 -0
- /package/{src → dist}/app/plugins/identity/providers/danal.ts +0 -0
- /package/{src → dist}/app/plugins/identity/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/identity/providers/kmc.ts +0 -0
- /package/{src → dist}/app/plugins/identity/providers/nice.ts +0 -0
- /package/{src → dist}/app/plugins/identity/routes.ts +0 -0
- /package/{src → dist}/app/plugins/identity/service.ts +0 -0
- /package/{src → dist}/app/plugins/identity/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/identity/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/identity/types/verification.ts +0 -0
- /package/{src → dist}/app/plugins/llm/cache.ts +0 -0
- /package/{src → dist}/app/plugins/llm/chatbot-store.ts +0 -0
- /package/{src → dist}/app/plugins/llm/chunker.ts +0 -0
- /package/{src/app/plugins/llm/config.example.json → dist/app/plugins/llm/config.json} +0 -0
- /package/{src → dist}/app/plugins/llm/config.ts +0 -0
- /package/{src → dist}/app/plugins/llm/conversation-store.ts +0 -0
- /package/{src → dist}/app/plugins/llm/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/llm/docs/api.md +0 -0
- /package/{src → dist}/app/plugins/llm/document-store.ts +0 -0
- /package/{src → dist}/app/plugins/llm/entities/llm_chatbot.json +0 -0
- /package/{src → dist}/app/plugins/llm/entities/llm_conversation.json +0 -0
- /package/{src → dist}/app/plugins/llm/entities/llm_document.json +0 -0
- /package/{src → dist}/app/plugins/llm/entities/llm_usage.json +0 -0
- /package/{src → dist}/app/plugins/llm/entities/llm_user_profile.json +0 -0
- /package/{src → dist}/app/plugins/llm/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/llm/index.ts +0 -0
- /package/{src → dist}/app/plugins/llm/profile-store.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/anthropic.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/azure.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/gemini.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/ollama.ts +0 -0
- /package/{src → dist}/app/plugins/llm/providers/openai.ts +0 -0
- /package/{src → dist}/app/plugins/llm/routes.ts +0 -0
- /package/{src → dist}/app/plugins/llm/service.ts +0 -0
- /package/{src → dist}/app/plugins/llm/template-loader.ts +0 -0
- /package/{src → dist}/app/plugins/llm/templates/prompts/extract_json.json +0 -0
- /package/{src → dist}/app/plugins/llm/templates/prompts/summarize.json +0 -0
- /package/{src → dist}/app/plugins/llm/templates/prompts/translate.json +0 -0
- /package/{src → dist}/app/plugins/llm/types/chat.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/chatbot.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/conversation.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/profile.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/store.ts +0 -0
- /package/{src → dist}/app/plugins/llm/types/usage.ts +0 -0
- /package/{src → dist}/app/plugins/llm/usage-store.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/account/handlers/index.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/account/handlers/link.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/account/handlers/providers-list.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/account/handlers/refresh.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/account/handlers/unlink.ts +0 -0
- /package/{src/app/plugins/oauth/config.example.json → dist/app/plugins/oauth/config.json} +0 -0
- /package/{src → dist}/app/plugins/oauth/config.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/oauth/entities/account_oauth.json +0 -0
- /package/{src → dist}/app/plugins/oauth/handlers/callback.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/handlers/index.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/handlers/redirect.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/index.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/routes.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/service.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/state.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/oauth/upsert.ts +0 -0
- /package/{src/app/plugins/ocr/config.example.json → dist/app/plugins/ocr/config.json} +0 -0
- /package/{src → dist}/app/plugins/ocr/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/ocr/docs/api.md +0 -0
- /package/{src → dist}/app/plugins/ocr/entities/ocr_result.json +0 -0
- /package/{src → dist}/app/plugins/ocr/entities/ocr_usage.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/business_reg.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/career_cert.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/driver_license.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/facility_card.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/id_card.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/invoice.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/namecard.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/business_reg.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/career_cert.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/driver_license.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/facility_card.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/general.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/id_card.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/invoice.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/namecard.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/prompts/receipt.json +0 -0
- /package/{src → dist}/app/plugins/ocr/templates/receipt.json +0 -0
- /package/{src/app/plugins/pg/config.example.json → dist/app/plugins/pg/config.json} +0 -0
- /package/{src → dist}/app/plugins/pg/config.ts +0 -0
- /package/{src → dist}/app/plugins/pg/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/pg/entities/pg_cancel.json +0 -0
- /package/{src → dist}/app/plugins/pg/entities/pg_order.json +0 -0
- /package/{src → dist}/app/plugins/pg/entities/pg_webhook_log.json +0 -0
- /package/{src → dist}/app/plugins/pg/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/pg/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/pg/index.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/danal.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/hecto.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/inicis.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/kakaopay.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/kcp.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/naverpay.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/payco.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/payletter.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/paypal.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/toss.ts +0 -0
- /package/{src → dist}/app/plugins/pg/providers/wanna.ts +0 -0
- /package/{src → dist}/app/plugins/pg/routes.ts +0 -0
- /package/{src → dist}/app/plugins/pg/service.ts +0 -0
- /package/{src → dist}/app/plugins/pg/types/client.ts +0 -0
- /package/{src → dist}/app/plugins/pg/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/pg/types/error.ts +0 -0
- /package/{src → dist}/app/plugins/pg/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/pg/types/payment.ts +0 -0
- /package/{src → dist}/app/plugins/providers/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/providers/solapi-auth.ts +0 -0
- /package/{src/app/plugins/push/config.example.json → dist/app/plugins/push/config.json} +0 -0
- /package/{src → dist}/app/plugins/push/config.ts +0 -0
- /package/{src → dist}/app/plugins/push/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/push/entities/push_log.json +0 -0
- /package/{src → dist}/app/plugins/push/entities/push_msg.json +0 -0
- /package/{src → dist}/app/plugins/push/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/push/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/push/index.ts +0 -0
- /package/{src → dist}/app/plugins/push/providers/apns.ts +0 -0
- /package/{src → dist}/app/plugins/push/providers/fcm.ts +0 -0
- /package/{src → dist}/app/plugins/push/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/push/providers/utils.ts +0 -0
- /package/{src → dist}/app/plugins/push/routes.ts +0 -0
- /package/{src → dist}/app/plugins/push/service.ts +0 -0
- /package/{src → dist}/app/plugins/push/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/push/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/push/types/job.ts +0 -0
- /package/{src → dist}/app/plugins/shared/docs/README.md +0 -0
- /package/{src/app/plugins/sms/config.example.json → dist/app/plugins/sms/config.json} +0 -0
- /package/{src → dist}/app/plugins/sms/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/sms/entities/sms_log.json +0 -0
- /package/{src → dist}/app/plugins/sms/entities/sms_msg.json +0 -0
- /package/{src → dist}/app/plugins/sms/entities/sms_verification.json +0 -0
- /package/{src → dist}/app/plugins/smtp/config.json +0 -0
- /package/{src → dist}/app/plugins/smtp/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/smtp/templates/layout.html +0 -0
- /package/{src/app/plugins/taxinvoice/config.example.json → dist/app/plugins/taxinvoice/config.json} +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/config.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/entities/tax_invoice.json +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/entities/tax_invoice_item.json +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/entities/tax_invoice_log.json +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/entities/tax_invoice_party.json +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/entity-adapter.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/index.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/barobill.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/bolta.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/esero.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/index.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/popbill.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/sendbill.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/providers/smartbill.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/routes.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/service.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/types/client.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/types/config.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/types/index.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/types/invoice.ts +0 -0
- /package/{src → dist}/app/plugins/taxinvoice/types/queue.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/config.json +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/config.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/docs/README.md +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/entities/vessel_kr_entry.json +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/handlers.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/index.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/routes.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/service.ts +0 -0
- /package/{src → dist}/app/plugins/vessel_kr/types/index.ts +0 -0
- /package/{src → dist}/app/routes/README.md +0 -0
- /package/{src → dist}/app/routes/account/change-password/config.json +0 -0
- /package/{src → dist}/app/routes/account/change-password/entities/password_history.json +0 -0
- /package/{src → dist}/app/routes/account/change-password/handlers.ts +0 -0
- /package/{src → dist}/app/routes/account/change-password/routes.ts +0 -0
- /package/{src → dist}/app/routes/account/config.json +0 -0
- /package/{src → dist}/app/routes/account/reactivate/config.json +0 -0
- /package/{src → dist}/app/routes/account/reactivate/handlers.ts +0 -0
- /package/{src → dist}/app/routes/account/reactivate/routes.ts +0 -0
- /package/{src → dist}/app/routes/account/register/config-loader.ts +0 -0
- /package/{src → dist}/app/routes/account/register/config.json +0 -0
- /package/{src → dist}/app/routes/account/register/handlers.ts +0 -0
- /package/{src → dist}/app/routes/account/register/routes.ts +0 -0
- /package/{src → dist}/app/routes/account/register/types/index.ts +0 -0
- /package/{src → dist}/app/routes/account/routes.ts +0 -0
- /package/{src → dist}/app/routes/account/templates/force_reset.html +0 -0
- /package/{src → dist}/app/routes/account/templates/welcome.html +0 -0
- /package/{src → dist}/app/routes/account/withdraw/handlers.ts +0 -0
- /package/{src → dist}/app/routes/account/withdraw/routes.ts +0 -0
- /package/{src → dist}/app/routes/approval/config.json +0 -0
- /package/{src → dist}/app/routes/approval/entities/approval.json +0 -0
- /package/{src → dist}/app/routes/approval/entities/comments.json +0 -0
- /package/{src → dist}/app/routes/approval/entities/reference.json +0 -0
- /package/{src → dist}/app/routes/approval/routes.ts +0 -0
- /package/{src → dist}/app/routes/auth/config.json +0 -0
- /package/{src → dist}/app/routes/auth/handlers.ts +0 -0
- /package/{src → dist}/app/routes/auth/routes.ts +0 -0
- /package/{src → dist}/app/routes/board/config.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_category.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_comment.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_like.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_mention.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_post.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_post_tag.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_rating.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_read_log.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_report.json +0 -0
- /package/{src → dist}/app/routes/board/entities/board_tag.json +0 -0
- /package/{src → dist}/app/routes/board/handlers/categories.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/comments.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/files.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/likes.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/mentions.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/posts.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/ratings.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/reports.ts +0 -0
- /package/{src → dist}/app/routes/board/handlers/tags.ts +0 -0
- /package/{src → dist}/app/routes/board/routes.ts +0 -0
- /package/{src → dist}/app/routes/password-reset/config.example.json +0 -0
- /package/{src → dist}/app/routes/password-reset/config.json +0 -0
- /package/{src → dist}/app/routes/password-reset/entities/account.json +0 -0
- /package/{src → dist}/app/routes/password-reset/handlers.ts +0 -0
- /package/{src → dist}/app/routes/password-reset/password-utils.ts +0 -0
- /package/{src → dist}/app/routes/password-reset/routes.ts +0 -0
- /package/{src → dist}/app/routes/password-reset/templates/password_reset.html +0 -0
- /package/{src → dist}/app/routes/password-reset/templates/password_reset_link.html +0 -0
- /package/{src → dist}/app/routes/password-reset/types/index.ts +0 -0
- /package/{src → dist}/app/routes/privilege/config.json +0 -0
- /package/{src → dist}/app/routes/privilege/entities/pv_group.json +0 -0
- /package/{src → dist}/app/routes/privilege/entities/pv_group_item.json +0 -0
- /package/{src → dist}/app/routes/privilege/entities/pv_item.json +0 -0
- /package/{src → dist}/app/routes/privilege/entities/user_pv_group.json +0 -0
- /package/{src → dist}/app/routes/privilege/entities/user_pv_item.json +0 -0
- /package/{src → dist}/app/routes/privilege/routes.ts +0 -0
- /package/{src → dist}/app/routes/user/config.json +0 -0
- /package/{src → dist}/app/routes/user/entities/user.json +0 -0
- /package/{src → dist}/app/routes/user/entities/user_biometric.json +0 -0
- /package/{src → dist}/app/routes/user/routes.ts +0 -0
- /package/{src → dist}/app/schedules/README.md +0 -0
- /package/{src → dist}/app/schedules/data-retention/config.json +0 -0
- /package/{src → dist}/app/schedules/data-retention/index.ts +0 -0
- /package/{src → dist}/app/schedules/dormancy/config.json +0 -0
- /package/{src → dist}/app/schedules/dormancy/entities/account.json +0 -0
- /package/{src → dist}/app/schedules/dormancy/entities/privacy_cron_lock.json +0 -0
- /package/{src → dist}/app/schedules/dormancy/index.ts +0 -0
- /package/{src → dist}/app/schedules/dormancy/templates/dormancy_completed.html +0 -0
- /package/{src → dist}/app/schedules/dormancy/templates/dormancy_warning.html +0 -0
- /package/{configs → dist/configs}/cache.json +0 -0
- /package/{configs → dist/configs}/cors.json +0 -0
- /package/{configs → dist/configs}/database.json +0 -0
- /package/{configs → dist/configs}/security.json +0 -0
- /package/{configs → dist/configs}/server.json +0 -0
- /package/{docs → dist/docs}/README.md +0 -0
- /package/{docs → dist/docs}/architecture.md +0 -0
- /package/{docs → dist/docs}/cache.md +0 -0
- /package/{docs → dist/docs}/configs.md +0 -0
- /package/{docs → dist/docs}/database.md +0 -0
- /package/{docs → dist/docs}/flows.md +0 -0
- /package/{docs → dist/docs}/getting-started.md +0 -0
- /package/{docs → dist/docs}/hooks.md +0 -0
- /package/{docs → dist/docs}/internals.md +0 -0
- /package/{docs → dist/docs}/plugins/2fa.md +0 -0
- /package/{docs → dist/docs}/plugins/alimtalk.md +0 -0
- /package/{docs → dist/docs}/plugins/friendtalk.md +0 -0
- /package/{docs → dist/docs}/plugins/holidays.md +0 -0
- /package/{docs → dist/docs}/plugins/how-to-create.md +0 -0
- /package/{docs → dist/docs}/plugins/identity.md +0 -0
- /package/{docs → dist/docs}/plugins/llm.md +0 -0
- /package/{docs → dist/docs}/plugins/oauth.md +0 -0
- /package/{docs → dist/docs}/plugins/ocr.md +0 -0
- /package/{docs → dist/docs}/plugins/pg.md +0 -0
- /package/{docs → dist/docs}/plugins/push.md +0 -0
- /package/{docs → dist/docs}/plugins/sms.md +0 -0
- /package/{docs → dist/docs}/plugins/taxinvoice.md +0 -0
- /package/{docs → dist/docs}/routes/README.md +0 -0
- /package/{docs → dist/docs}/routes/account-routes.md +0 -0
- /package/{docs → dist/docs}/routes/alimtalk-routes.md +0 -0
- /package/{docs → dist/docs}/routes/board-routes.md +0 -0
- /package/{docs → dist/docs}/routes/email-verification.md +0 -0
- /package/{docs → dist/docs}/routes/friendtalk-routes.md +0 -0
- /package/{docs → dist/docs}/routes/holidays-routes.md +0 -0
- /package/{docs → dist/docs}/routes/how-to-create.md +0 -0
- /package/{docs → dist/docs}/routes/identity-routes.md +0 -0
- /package/{docs → dist/docs}/routes/llm-routes.md +0 -0
- /package/{docs → dist/docs}/routes/ocr-routes.md +0 -0
- /package/{docs → dist/docs}/routes/password-reset.md +0 -0
- /package/{docs → dist/docs}/routes/pg-routes.md +0 -0
- /package/{docs → dist/docs}/routes/push-routes.md +0 -0
- /package/{docs → dist/docs}/routes/sms-routes.md +0 -0
- /package/{docs → dist/docs}/routes/smtp-routes.md +0 -0
- /package/{docs → dist/docs}/routes/tax-invoice-routes.md +0 -0
- /package/{docs → dist/docs}/schedules/dormancy-and-retention.md +0 -0
- /package/{docs → dist/docs}/schedules/how-to-create.md +0 -0
- /package/{docs → dist/docs}/scripts-guide.md +0 -0
- /package/{docs → dist/docs}/security.md +0 -0
- /package/{docs → dist/docs}/system.md +0 -0
- /package/{scripts → dist/scripts}/entity.sh +0 -0
- /package/{scripts → dist/scripts}/reset-all.sh +0 -0
- /package/{scripts → dist/scripts}/run.sh +0 -0
- /package/{scripts/dist-tsconfig.json → dist/tsconfig.json} +0 -0
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AWS Textract OCR 드라이버
|
|
3
|
-
* DetectDocumentText API + SigV4 서명
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { createHmac, createHash } from "node:crypto";
|
|
7
|
-
import type {
|
|
8
|
-
OcrDriver,
|
|
9
|
-
OcrProviderConfig,
|
|
10
|
-
RawOcrResult,
|
|
11
|
-
RecognizeOptions,
|
|
12
|
-
TextBlock,
|
|
13
|
-
RawOcrPage,
|
|
14
|
-
} from "../types/index.ts";
|
|
15
|
-
|
|
16
|
-
export class AwsDriver implements OcrDriver {
|
|
17
|
-
private readonly accessKeyId: string;
|
|
18
|
-
private readonly secretAccessKey: string;
|
|
19
|
-
private readonly region: string;
|
|
20
|
-
private readonly timeout: number;
|
|
21
|
-
|
|
22
|
-
/** AWS Textract 드라이버를 설정으로 초기화한다 */
|
|
23
|
-
constructor(cfg: OcrProviderConfig) {
|
|
24
|
-
this.accessKeyId = cfg.accessKeyId ?? "";
|
|
25
|
-
this.secretAccessKey = cfg.secretAccessKey ?? "";
|
|
26
|
-
this.region = cfg.region ?? "ap-northeast-2";
|
|
27
|
-
this.timeout = (cfg.timeoutSec ?? 30) * 1000;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** 드라이버 이름을 반환한다 */
|
|
31
|
-
name() {
|
|
32
|
-
return "aws_textract";
|
|
33
|
-
}
|
|
34
|
-
/** 지원하는 파일 형식 목록을 반환한다 */
|
|
35
|
-
supportedFormats() {
|
|
36
|
-
return ["image/jpeg", "image/png", "application/pdf"];
|
|
37
|
-
}
|
|
38
|
-
/** 드라이버 리소스를 해제한다 */
|
|
39
|
-
async close() {}
|
|
40
|
-
|
|
41
|
-
/** 이미지 데이터를 AWS Textract API로 인식한다 */
|
|
42
|
-
async recognize(
|
|
43
|
-
data: Buffer,
|
|
44
|
-
opts: RecognizeOptions,
|
|
45
|
-
): Promise<RawOcrResult> {
|
|
46
|
-
const start = Date.now();
|
|
47
|
-
const host = `textract.${this.region}.amazonaws.com`;
|
|
48
|
-
const url = `https://${host}`;
|
|
49
|
-
const payload = JSON.stringify({
|
|
50
|
-
Document: { Bytes: data.toString("base64") },
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const now = new Date();
|
|
54
|
-
const amzDate = now
|
|
55
|
-
.toISOString()
|
|
56
|
-
.replace(/[-:]/g, "")
|
|
57
|
-
.replace(/\.\d{3}/, "");
|
|
58
|
-
const dateStamp = amzDate.slice(0, 8);
|
|
59
|
-
|
|
60
|
-
const headers = this.buildAWSAuth(host, payload, amzDate, dateStamp);
|
|
61
|
-
|
|
62
|
-
const resp = await fetch(url, {
|
|
63
|
-
method: "POST",
|
|
64
|
-
headers: {
|
|
65
|
-
...headers,
|
|
66
|
-
"Content-Type": "application/x-amz-json-1.1",
|
|
67
|
-
"X-Amz-Target": "Textract.DetectDocumentText",
|
|
68
|
-
},
|
|
69
|
-
body: payload,
|
|
70
|
-
signal: AbortSignal.timeout(this.timeout),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
if (!resp.ok) {
|
|
74
|
-
const text = await resp.text();
|
|
75
|
-
throw new Error(`AWS Textract API error ${resp.status}: ${text}`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const json = (await resp.json()) as any;
|
|
79
|
-
const blocks: TextBlock[] = [];
|
|
80
|
-
const lineTexts: string[] = [];
|
|
81
|
-
|
|
82
|
-
for (const block of json.Blocks ?? []) {
|
|
83
|
-
if (block.BlockType === "WORD") {
|
|
84
|
-
const bb = block.Geometry?.BoundingBox ?? {};
|
|
85
|
-
const w = bb.Width ?? 0;
|
|
86
|
-
const h = bb.Height ?? 0;
|
|
87
|
-
const left = bb.Left ?? 0;
|
|
88
|
-
const top = bb.Top ?? 0;
|
|
89
|
-
const right = left + w;
|
|
90
|
-
const bottom = top + h;
|
|
91
|
-
|
|
92
|
-
// Textract는 정규화 좌표 (0~1) → 1000 기준 변환
|
|
93
|
-
const scale = 1000;
|
|
94
|
-
const sLeft = Math.round(left * scale);
|
|
95
|
-
const sTop = Math.round(top * scale);
|
|
96
|
-
const sRight = Math.round(right * scale);
|
|
97
|
-
const sBottom = Math.round(bottom * scale);
|
|
98
|
-
|
|
99
|
-
blocks.push({
|
|
100
|
-
text: block.Text ?? "",
|
|
101
|
-
boundingBox: {
|
|
102
|
-
top: sTop,
|
|
103
|
-
left: sLeft,
|
|
104
|
-
right: sRight,
|
|
105
|
-
bottom: sBottom,
|
|
106
|
-
},
|
|
107
|
-
centerX: (sLeft + sRight) / 2,
|
|
108
|
-
centerY: (sTop + sBottom) / 2,
|
|
109
|
-
slope: 0,
|
|
110
|
-
confidence: (block.Confidence ?? 0) / 100,
|
|
111
|
-
lineBreak: false,
|
|
112
|
-
});
|
|
113
|
-
} else if (block.BlockType === "LINE") {
|
|
114
|
-
lineTexts.push(block.Text ?? "");
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const fullText = lineTexts.join("\n");
|
|
119
|
-
const avgConf =
|
|
120
|
-
blocks.length > 0
|
|
121
|
-
? blocks.reduce((s, b) => s + b.confidence, 0) / blocks.length
|
|
122
|
-
: 0;
|
|
123
|
-
|
|
124
|
-
return {
|
|
125
|
-
provider: "aws_textract",
|
|
126
|
-
providerRaw: json,
|
|
127
|
-
fullText,
|
|
128
|
-
processingMs: Date.now() - start,
|
|
129
|
-
processedAt: new Date().toISOString(),
|
|
130
|
-
confidence: avgConf,
|
|
131
|
-
pages: [
|
|
132
|
-
{
|
|
133
|
-
pageNum: 1,
|
|
134
|
-
width: 1000,
|
|
135
|
-
height: 1000,
|
|
136
|
-
text: fullText,
|
|
137
|
-
blocks,
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/** AWS SigV4 서명 헤더를 생성한다 */
|
|
144
|
-
private buildAWSAuth(
|
|
145
|
-
host: string,
|
|
146
|
-
payload: string,
|
|
147
|
-
amzDate: string,
|
|
148
|
-
dateStamp: string,
|
|
149
|
-
): Record<string, string> {
|
|
150
|
-
const service = "textract";
|
|
151
|
-
const algorithm = "AWS4-HMAC-SHA256";
|
|
152
|
-
const credentialScope = `${dateStamp}/${this.region}/${service}/aws4_request`;
|
|
153
|
-
|
|
154
|
-
const payloadHash = createHash("sha256").update(payload).digest("hex");
|
|
155
|
-
|
|
156
|
-
const canonicalHeaders = `content-type:application/x-amz-json-1.1\nhost:${host}\nx-amz-date:${amzDate}\nx-amz-target:Textract.DetectDocumentText\n`;
|
|
157
|
-
const signedHeaders = "content-type;host;x-amz-date;x-amz-target";
|
|
158
|
-
|
|
159
|
-
const canonicalRequest = [
|
|
160
|
-
"POST",
|
|
161
|
-
"/",
|
|
162
|
-
"",
|
|
163
|
-
canonicalHeaders,
|
|
164
|
-
signedHeaders,
|
|
165
|
-
payloadHash,
|
|
166
|
-
].join("\n");
|
|
167
|
-
|
|
168
|
-
const stringToSign = [
|
|
169
|
-
algorithm,
|
|
170
|
-
amzDate,
|
|
171
|
-
credentialScope,
|
|
172
|
-
createHash("sha256").update(canonicalRequest).digest("hex"),
|
|
173
|
-
].join("\n");
|
|
174
|
-
|
|
175
|
-
const signingKey = this.getSignatureKey(dateStamp, service);
|
|
176
|
-
const signature = createHmac("sha256", signingKey)
|
|
177
|
-
.update(stringToSign)
|
|
178
|
-
.digest("hex");
|
|
179
|
-
|
|
180
|
-
const authorization = `${algorithm} Credential=${this.accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`;
|
|
181
|
-
|
|
182
|
-
return {
|
|
183
|
-
Host: host,
|
|
184
|
-
"X-Amz-Date": amzDate,
|
|
185
|
-
Authorization: authorization,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/** SigV4 서명 키를 생성한다 */
|
|
190
|
-
private getSignatureKey(dateStamp: string, service: string): Buffer {
|
|
191
|
-
const kDate = createHmac("sha256", `AWS4${this.secretAccessKey}`)
|
|
192
|
-
.update(dateStamp)
|
|
193
|
-
.digest();
|
|
194
|
-
const kRegion = createHmac("sha256", kDate)
|
|
195
|
-
.update(this.region)
|
|
196
|
-
.digest();
|
|
197
|
-
const kService = createHmac("sha256", kRegion).update(service).digest();
|
|
198
|
-
return createHmac("sha256", kService).update("aws4_request").digest();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Azure Document Intelligence OCR 드라이버
|
|
3
|
-
* 비동기 폴링 방식
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
OcrDriver,
|
|
8
|
-
OcrProviderConfig,
|
|
9
|
-
RawOcrResult,
|
|
10
|
-
RecognizeOptions,
|
|
11
|
-
TextBlock,
|
|
12
|
-
RawOcrPage,
|
|
13
|
-
} from "../types/index.ts";
|
|
14
|
-
|
|
15
|
-
export class AzureDriver implements OcrDriver {
|
|
16
|
-
private readonly endpoint: string;
|
|
17
|
-
private readonly apiKey: string;
|
|
18
|
-
private readonly apiVersion: string;
|
|
19
|
-
private readonly timeout: number;
|
|
20
|
-
|
|
21
|
-
/** Azure Document Intelligence 드라이버를 설정으로 초기화한다 */
|
|
22
|
-
constructor(cfg: OcrProviderConfig) {
|
|
23
|
-
this.endpoint = (cfg.endpoint ?? "").replace(/\/$/, "");
|
|
24
|
-
this.apiKey = cfg.apiKey ?? "";
|
|
25
|
-
this.apiVersion = cfg.apiVersion ?? "2023-07-31";
|
|
26
|
-
this.timeout = (cfg.timeoutSec ?? 60) * 1000;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** 드라이버 이름을 반환한다 */
|
|
30
|
-
name() {
|
|
31
|
-
return "azure";
|
|
32
|
-
}
|
|
33
|
-
/** 지원하는 파일 형식 목록을 반환한다 */
|
|
34
|
-
supportedFormats() {
|
|
35
|
-
return [
|
|
36
|
-
"image/jpeg",
|
|
37
|
-
"image/png",
|
|
38
|
-
"image/tiff",
|
|
39
|
-
"image/bmp",
|
|
40
|
-
"application/pdf",
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
/** 드라이버 리소스를 해제한다 */
|
|
44
|
-
async close() {}
|
|
45
|
-
|
|
46
|
-
/** 이미지 데이터를 Azure Document Intelligence API로 인식한다 */
|
|
47
|
-
async recognize(
|
|
48
|
-
data: Buffer,
|
|
49
|
-
opts: RecognizeOptions,
|
|
50
|
-
): Promise<RawOcrResult> {
|
|
51
|
-
const start = Date.now();
|
|
52
|
-
const url = `${this.endpoint}/documentintelligence/documentModels/prebuilt-read:analyze?api-version=${this.apiVersion}`;
|
|
53
|
-
|
|
54
|
-
// 1단계: 분석 요청
|
|
55
|
-
const submitResp = await fetch(url, {
|
|
56
|
-
method: "POST",
|
|
57
|
-
headers: {
|
|
58
|
-
"Ocp-Apim-Subscription-Key": this.apiKey,
|
|
59
|
-
"Content-Type": opts.mimeType || "application/octet-stream",
|
|
60
|
-
},
|
|
61
|
-
body: data,
|
|
62
|
-
signal: AbortSignal.timeout(this.timeout),
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (!submitResp.ok && submitResp.status !== 202) {
|
|
66
|
-
const text = await submitResp.text();
|
|
67
|
-
throw new Error(
|
|
68
|
-
`Azure DI submit error ${submitResp.status}: ${text}`,
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const operationLocation =
|
|
73
|
-
submitResp.headers.get("Operation-Location") ??
|
|
74
|
-
submitResp.headers.get("operation-location") ??
|
|
75
|
-
"";
|
|
76
|
-
|
|
77
|
-
if (!operationLocation) {
|
|
78
|
-
throw new Error("Azure DI: no Operation-Location header");
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 2단계: 폴링
|
|
82
|
-
const pollTimeout = Date.now() + this.timeout;
|
|
83
|
-
let resultJson: any;
|
|
84
|
-
|
|
85
|
-
while (Date.now() < pollTimeout) {
|
|
86
|
-
await new Promise((r) => setTimeout(r, 1500));
|
|
87
|
-
|
|
88
|
-
const pollResp = await fetch(operationLocation, {
|
|
89
|
-
headers: { "Ocp-Apim-Subscription-Key": this.apiKey },
|
|
90
|
-
signal: AbortSignal.timeout(30_000),
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
if (!pollResp.ok) {
|
|
94
|
-
throw new Error(`Azure DI poll error ${pollResp.status}`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const pollData = (await pollResp.json()) as any;
|
|
98
|
-
if (pollData.status === "succeeded") {
|
|
99
|
-
resultJson = pollData.analyzeResult;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
if (pollData.status === "failed") {
|
|
103
|
-
throw new Error(
|
|
104
|
-
`Azure DI analysis failed: ${JSON.stringify(pollData.error)}`,
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (!resultJson) {
|
|
110
|
-
throw new Error("Azure DI: polling timeout");
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return this.buildResult(resultJson, start);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** Azure 분석 결과를 RawOcrResult로 변환한다 */
|
|
117
|
-
private buildResult(analyzeResult: any, startMs: number): RawOcrResult {
|
|
118
|
-
const DPI = 72; // Azure inch → pixel 변환에 사용하는 기본 DPI
|
|
119
|
-
const pages: RawOcrPage[] = [];
|
|
120
|
-
let fullText = analyzeResult.content ?? "";
|
|
121
|
-
|
|
122
|
-
for (const ap of analyzeResult.pages ?? []) {
|
|
123
|
-
const blocks: TextBlock[] = [];
|
|
124
|
-
const unit: string = ap.unit ?? "pixel";
|
|
125
|
-
const scale = unit === "inch" ? DPI : 1;
|
|
126
|
-
|
|
127
|
-
for (const word of ap.words ?? []) {
|
|
128
|
-
const polygon = word.polygon ?? [];
|
|
129
|
-
const xs = polygon
|
|
130
|
-
.filter((_: number, i: number) => i % 2 === 0)
|
|
131
|
-
.map((v: number) => v * scale);
|
|
132
|
-
const ys = polygon
|
|
133
|
-
.filter((_: number, i: number) => i % 2 === 1)
|
|
134
|
-
.map((v: number) => v * scale);
|
|
135
|
-
const left = xs.length ? Math.min(...xs) : 0;
|
|
136
|
-
const right = xs.length ? Math.max(...xs) : 0;
|
|
137
|
-
const top = ys.length ? Math.min(...ys) : 0;
|
|
138
|
-
const bottom = ys.length ? Math.max(...ys) : 0;
|
|
139
|
-
|
|
140
|
-
const slope =
|
|
141
|
-
right - left > 0 && ys.length >= 2
|
|
142
|
-
? (ys[1] - ys[0]) / (right - left)
|
|
143
|
-
: 0;
|
|
144
|
-
|
|
145
|
-
blocks.push({
|
|
146
|
-
text: word.content ?? "",
|
|
147
|
-
boundingBox: { top, left, right, bottom },
|
|
148
|
-
centerX: (left + right) / 2,
|
|
149
|
-
centerY: (top + bottom) / 2,
|
|
150
|
-
slope,
|
|
151
|
-
confidence: word.confidence ?? 0,
|
|
152
|
-
lineBreak: false,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
pages.push({
|
|
157
|
-
pageNum: ap.pageNumber ?? pages.length + 1,
|
|
158
|
-
width: (ap.width ?? 0) * scale,
|
|
159
|
-
height: (ap.height ?? 0) * scale,
|
|
160
|
-
text: (ap.lines ?? [])
|
|
161
|
-
.map((l: any) => l.content ?? "")
|
|
162
|
-
.join("\n"),
|
|
163
|
-
blocks,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const totalConf = pages.reduce(
|
|
168
|
-
(s, p) => s + p.blocks.reduce((ss, b) => ss + b.confidence, 0),
|
|
169
|
-
0,
|
|
170
|
-
);
|
|
171
|
-
const totalBlocks = pages.reduce((s, p) => s + p.blocks.length, 0);
|
|
172
|
-
|
|
173
|
-
return {
|
|
174
|
-
provider: "azure",
|
|
175
|
-
providerRaw: analyzeResult,
|
|
176
|
-
fullText,
|
|
177
|
-
processingMs: Date.now() - startMs,
|
|
178
|
-
processedAt: new Date().toISOString(),
|
|
179
|
-
confidence: totalBlocks > 0 ? totalConf / totalBlocks : 0,
|
|
180
|
-
pages,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Cloud Vision OCR 드라이버
|
|
3
|
-
* DOCUMENT_TEXT_DETECTION API 사용
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
OcrDriver,
|
|
8
|
-
OcrProviderConfig,
|
|
9
|
-
RawOcrResult,
|
|
10
|
-
RecognizeOptions,
|
|
11
|
-
TextBlock,
|
|
12
|
-
RawOcrPage,
|
|
13
|
-
} from "../types/index.ts";
|
|
14
|
-
|
|
15
|
-
export class GoogleDriver implements OcrDriver {
|
|
16
|
-
private readonly apiKey: string;
|
|
17
|
-
private readonly apiUrl: string;
|
|
18
|
-
private readonly timeout: number;
|
|
19
|
-
|
|
20
|
-
/** Google Cloud Vision 드라이버를 설정으로 초기화한다 */
|
|
21
|
-
constructor(cfg: OcrProviderConfig) {
|
|
22
|
-
this.apiKey = cfg.apiKey ?? "";
|
|
23
|
-
this.apiUrl =
|
|
24
|
-
cfg.apiUrl ??
|
|
25
|
-
`https://vision.googleapis.com/v1/images:annotate?key=${this.apiKey}`;
|
|
26
|
-
this.timeout = (cfg.timeoutSec ?? 30) * 1000;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** 드라이버 이름을 반환한다 */
|
|
30
|
-
name() {
|
|
31
|
-
return "google";
|
|
32
|
-
}
|
|
33
|
-
/** 지원하는 파일 형식 목록을 반환한다 */
|
|
34
|
-
supportedFormats() {
|
|
35
|
-
return [
|
|
36
|
-
"image/jpeg",
|
|
37
|
-
"image/png",
|
|
38
|
-
"image/gif",
|
|
39
|
-
"image/bmp",
|
|
40
|
-
"image/webp",
|
|
41
|
-
"application/pdf",
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
/** 드라이버 리소스를 해제한다 */
|
|
45
|
-
async close() {}
|
|
46
|
-
|
|
47
|
-
/** 이미지 데이터를 Google Vision API로 인식한다 */
|
|
48
|
-
async recognize(
|
|
49
|
-
data: Buffer,
|
|
50
|
-
opts: RecognizeOptions,
|
|
51
|
-
): Promise<RawOcrResult> {
|
|
52
|
-
const start = Date.now();
|
|
53
|
-
const body = {
|
|
54
|
-
requests: [
|
|
55
|
-
{
|
|
56
|
-
image: { content: data.toString("base64") },
|
|
57
|
-
features: [{ type: "DOCUMENT_TEXT_DETECTION" }],
|
|
58
|
-
imageContext: opts.languages?.length
|
|
59
|
-
? { languageHints: opts.languages }
|
|
60
|
-
: undefined,
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const resp = await fetch(this.apiUrl, {
|
|
66
|
-
method: "POST",
|
|
67
|
-
headers: { "Content-Type": "application/json" },
|
|
68
|
-
body: JSON.stringify(body),
|
|
69
|
-
signal: AbortSignal.timeout(this.timeout),
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
if (!resp.ok) {
|
|
73
|
-
const text = await resp.text();
|
|
74
|
-
throw new Error(`Google Vision API error ${resp.status}: ${text}`);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const json = (await resp.json()) as any;
|
|
78
|
-
const annotation = json.responses?.[0]?.fullTextAnnotation;
|
|
79
|
-
const fullText = annotation?.text ?? "";
|
|
80
|
-
|
|
81
|
-
// 페이지별 텍스트 블록 파싱
|
|
82
|
-
const gPages = annotation?.pages ?? [];
|
|
83
|
-
const resultPages: RawOcrPage[] = [];
|
|
84
|
-
let totalConf = 0;
|
|
85
|
-
let totalBlocks = 0;
|
|
86
|
-
|
|
87
|
-
for (let pi = 0; pi < gPages.length; pi++) {
|
|
88
|
-
const page = gPages[pi];
|
|
89
|
-
const blocks: TextBlock[] = [];
|
|
90
|
-
const pageTexts: string[] = [];
|
|
91
|
-
for (const block of page.blocks ?? []) {
|
|
92
|
-
for (const paragraph of block.paragraphs ?? []) {
|
|
93
|
-
for (const word of paragraph.words ?? []) {
|
|
94
|
-
const symbols = (word.symbols ?? [])
|
|
95
|
-
.map((s: any) => s.text ?? "")
|
|
96
|
-
.join("");
|
|
97
|
-
const vertices = word.boundingBox?.vertices ?? [];
|
|
98
|
-
const [tl, tr, br, bl] = [
|
|
99
|
-
vertices[0] ?? {},
|
|
100
|
-
vertices[1] ?? {},
|
|
101
|
-
vertices[2] ?? {},
|
|
102
|
-
vertices[3] ?? {},
|
|
103
|
-
];
|
|
104
|
-
const top = Math.min(tl.y ?? 0, tr.y ?? 0);
|
|
105
|
-
const bottom = Math.max(bl.y ?? 0, br.y ?? 0);
|
|
106
|
-
const left = Math.min(tl.x ?? 0, bl.x ?? 0);
|
|
107
|
-
const right = Math.max(tr.x ?? 0, br.x ?? 0);
|
|
108
|
-
|
|
109
|
-
const conf = word.confidence ?? 0;
|
|
110
|
-
const slope =
|
|
111
|
-
right - left > 0
|
|
112
|
-
? ((tr.y ?? 0) - (tl.y ?? 0)) / (right - left)
|
|
113
|
-
: 0;
|
|
114
|
-
|
|
115
|
-
blocks.push({
|
|
116
|
-
text: symbols,
|
|
117
|
-
boundingBox: { top, left, right, bottom },
|
|
118
|
-
centerX: (left + right) / 2,
|
|
119
|
-
centerY: (top + bottom) / 2,
|
|
120
|
-
slope,
|
|
121
|
-
confidence: conf,
|
|
122
|
-
lineBreak: false,
|
|
123
|
-
});
|
|
124
|
-
pageTexts.push(symbols);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
totalConf += blocks.reduce((s, b) => s + b.confidence, 0);
|
|
130
|
-
totalBlocks += blocks.length;
|
|
131
|
-
|
|
132
|
-
resultPages.push({
|
|
133
|
-
pageNum: pi + 1,
|
|
134
|
-
width: page.width ?? 0,
|
|
135
|
-
height: page.height ?? 0,
|
|
136
|
-
text: pageTexts.join(" "),
|
|
137
|
-
blocks,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const avgConf = totalBlocks > 0 ? totalConf / totalBlocks : 0;
|
|
142
|
-
|
|
143
|
-
const result: RawOcrResult = {
|
|
144
|
-
provider: "google",
|
|
145
|
-
providerRaw: json,
|
|
146
|
-
fullText,
|
|
147
|
-
processingMs: Date.now() - start,
|
|
148
|
-
processedAt: new Date().toISOString(),
|
|
149
|
-
confidence: avgConf,
|
|
150
|
-
pages: resultPages,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
return result;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OCR 드라이버 팩토리 + 재시도 + 파일 크기 검증
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
OcrDriver,
|
|
7
|
-
OcrProviderConfig,
|
|
8
|
-
RawOcrResult,
|
|
9
|
-
RecognizeOptions,
|
|
10
|
-
RetryConfig,
|
|
11
|
-
} from "../types/index.ts";
|
|
12
|
-
import { OcrError, ERR_FILE_TOO_LARGE } from "../errors.ts";
|
|
13
|
-
import { GoogleDriver } from "./google.ts";
|
|
14
|
-
import { NaverDriver } from "./naver.ts";
|
|
15
|
-
import { AwsDriver } from "./aws.ts";
|
|
16
|
-
import { AzureDriver } from "./azure.ts";
|
|
17
|
-
import { UpstageDriver } from "./upstage.ts";
|
|
18
|
-
import { TesseractDriver } from "./tesseract.ts";
|
|
19
|
-
|
|
20
|
-
const MAX_FILE_SIZE_BYTES = 50 * 1024 * 1024; // 50MB
|
|
21
|
-
|
|
22
|
-
/** 프로바이더 설정에 따라 OCR 드라이버 인스턴스를 생성한다 */
|
|
23
|
-
export function createOcrDriver(cfg: OcrProviderConfig): OcrDriver {
|
|
24
|
-
switch (cfg.driver) {
|
|
25
|
-
case "google":
|
|
26
|
-
return new GoogleDriver(cfg);
|
|
27
|
-
case "naver":
|
|
28
|
-
return new NaverDriver(cfg);
|
|
29
|
-
case "aws_textract":
|
|
30
|
-
return new AwsDriver(cfg);
|
|
31
|
-
case "azure":
|
|
32
|
-
return new AzureDriver(cfg);
|
|
33
|
-
case "upstage":
|
|
34
|
-
return new UpstageDriver(cfg);
|
|
35
|
-
case "tesseract":
|
|
36
|
-
return new TesseractDriver(cfg);
|
|
37
|
-
default:
|
|
38
|
-
throw new Error(`Unsupported OCR driver: ${cfg.driver}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** 재시도 정책에 따라 OCR 인식을 수행한다 */
|
|
43
|
-
export async function retryRecognize(
|
|
44
|
-
driver: OcrDriver,
|
|
45
|
-
data: Buffer,
|
|
46
|
-
opts: RecognizeOptions,
|
|
47
|
-
cfg: RetryConfig,
|
|
48
|
-
): Promise<RawOcrResult> {
|
|
49
|
-
const maxRetries = cfg.maxRetries > 0 ? cfg.maxRetries : 3;
|
|
50
|
-
const delay = cfg.retryDelayMs > 0 ? cfg.retryDelayMs : 1000;
|
|
51
|
-
|
|
52
|
-
let lastErr: Error | undefined;
|
|
53
|
-
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
54
|
-
if (attempt > 0) {
|
|
55
|
-
console.log(
|
|
56
|
-
`[INFO] OCR API retry #${attempt} (driver=${driver.name()})`,
|
|
57
|
-
);
|
|
58
|
-
await new Promise((r) => setTimeout(r, delay));
|
|
59
|
-
}
|
|
60
|
-
try {
|
|
61
|
-
return await driver.recognize(data, opts);
|
|
62
|
-
} catch (err) {
|
|
63
|
-
lastErr = err instanceof Error ? err : new Error(String(err));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
throw new Error(
|
|
67
|
-
`OCR API failed after ${maxRetries} retries: ${lastErr?.message}`,
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** 파일 크기가 제한을 초과하는지 검증한다 */
|
|
72
|
-
export function validateFileSize(data: Buffer, limitMB: number): void {
|
|
73
|
-
const limit = limitMB > 0 ? limitMB * 1024 * 1024 : MAX_FILE_SIZE_BYTES;
|
|
74
|
-
if (data.length > limit) {
|
|
75
|
-
throw new OcrError(
|
|
76
|
-
`file size exceeds limit: ${data.length} bytes (limit ${limit} bytes)`,
|
|
77
|
-
ERR_FILE_TOO_LARGE,
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|