@m5kdev/backend 0.8.6 → 0.8.8
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/_virtual/_rolldown/runtime.cjs +33 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/api/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/factory.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/types.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/get-tables.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/account.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/session.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/shared.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/user.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/verification.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/social-providers/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/context.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/helper.d.cts +7 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/init-options.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/plugin-client.d.cts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/plugin.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter-base.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-adapter.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-dialect.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-introspector.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-adapter.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-dialect.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-introspector.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-adapter.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-dialect.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-introspector.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-adapter.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-dialect.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-introspector.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/expression/expression-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/index.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/kysely.d.cts +38 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/file-migration-provider.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/migrator.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/binary-operation-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/delete-from-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/expression-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/group-by-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/insert-values-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/join-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/merge-into-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/reference-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/returning-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-from-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/set-operation-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/tuple-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/unary-operation-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-set-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/value-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/with-parser.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/case-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/delete-query-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/having-interface.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/insert-query-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/join-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/merge-query-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/on-conflict-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/output-interface.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/returning-interface.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/select-query-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/update-query-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/where-interface.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-creator.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/default-query-executor.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/noop-query-executor.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-base.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-provider.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/raw-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/sql.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-add-foreign-key-constraint-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-add-index-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-drop-constraint-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-executor.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-index-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-schema-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-table-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-type-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-view-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-index-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-schema-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-table-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-type-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-view-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/refresh-materialized-view-builder.d.cts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/schema.d.cts +1 -0
- package/dist/src/lib/posthog.cjs +8 -0
- package/dist/src/lib/posthog.cjs.map +1 -0
- package/dist/src/lib/posthog.d.cts +7 -0
- package/dist/src/lib/sentry.cjs +11 -0
- package/dist/src/lib/sentry.cjs.map +1 -0
- package/dist/src/lib/sentry.d.cts +1 -0
- package/dist/src/modules/access/access.repository.cjs +26 -0
- package/dist/src/modules/access/access.repository.cjs.map +1 -0
- package/dist/src/modules/access/access.repository.d.cts +2352 -0
- package/dist/src/modules/access/access.service.cjs +42 -0
- package/dist/src/modules/access/access.service.cjs.map +1 -0
- package/dist/src/modules/access/access.service.d.cts +25 -0
- package/dist/src/modules/access/access.utils.cjs +23 -0
- package/dist/src/modules/access/access.utils.cjs.map +1 -0
- package/dist/src/modules/access/access.utils.d.cts +19 -0
- package/dist/src/modules/ai/ai.db.cjs +46 -0
- package/dist/src/modules/ai/ai.db.cjs.map +1 -0
- package/dist/src/modules/ai/ai.db.d.cts +401 -0
- package/dist/src/modules/ai/ai.prompt.cjs +33 -0
- package/dist/src/modules/ai/ai.prompt.cjs.map +1 -0
- package/dist/src/modules/ai/ai.prompt.d.cts +30 -0
- package/dist/src/modules/ai/ai.prompts.cjs +18 -0
- package/dist/src/modules/ai/ai.prompts.cjs.map +1 -0
- package/dist/src/modules/ai/ai.prompts.d.cts +10 -0
- package/dist/src/modules/ai/ai.repository.cjs +25 -0
- package/dist/src/modules/ai/ai.repository.cjs.map +1 -0
- package/dist/src/modules/ai/ai.repository.d.cts +428 -0
- package/dist/src/modules/ai/ai.router.cjs +0 -0
- package/dist/src/modules/ai/ai.router.d.cts +1 -0
- package/dist/src/modules/ai/ai.service.cjs +312 -0
- package/dist/src/modules/ai/ai.service.cjs.map +1 -0
- package/dist/src/modules/ai/ai.service.d.cts +141 -0
- package/dist/src/modules/ai/ai.trpc.cjs +19 -0
- package/dist/src/modules/ai/ai.trpc.cjs.map +1 -0
- package/dist/src/modules/ai/ai.trpc.d.cts +31 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.cjs +191 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.cjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.d.cts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.cjs +49 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.cjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.d.cts +234 -0
- package/dist/src/modules/ai/ideogram/ideogram.prompt.cjs +862 -0
- package/dist/src/modules/ai/ideogram/ideogram.prompt.cjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.prompt.d.cts +7 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.cjs +34 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.cjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.d.cts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.cjs +12 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.cjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.d.cts +14 -0
- package/dist/src/modules/auth/auth.db.cjs +187 -0
- package/dist/src/modules/auth/auth.db.cjs.map +1 -0
- package/dist/src/modules/auth/auth.db.d.cts +2341 -0
- package/dist/src/modules/auth/auth.dto.cjs +50 -0
- package/dist/src/modules/auth/auth.dto.cjs.map +1 -0
- package/dist/src/modules/auth/auth.dto.d.cts +70 -0
- package/dist/src/modules/auth/auth.lib.cjs +234 -0
- package/dist/src/modules/auth/auth.lib.cjs.map +1 -0
- package/dist/src/modules/auth/auth.lib.d.cts +4894 -0
- package/dist/src/modules/auth/auth.middleware.cjs +41 -0
- package/dist/src/modules/auth/auth.middleware.cjs.map +1 -0
- package/dist/src/modules/auth/auth.middleware.d.cts +619 -0
- package/dist/src/modules/auth/auth.repository.cjs +403 -0
- package/dist/src/modules/auth/auth.repository.cjs.map +1 -0
- package/dist/src/modules/auth/auth.repository.d.cts +2453 -0
- package/dist/src/modules/auth/auth.service.cjs +229 -0
- package/dist/src/modules/auth/auth.service.cjs.map +1 -0
- package/dist/src/modules/auth/auth.service.d.cts +105 -0
- package/dist/src/modules/auth/auth.trpc.cjs +110 -0
- package/dist/src/modules/auth/auth.trpc.cjs.map +1 -0
- package/dist/src/modules/auth/auth.trpc.d.cts +303 -0
- package/dist/src/modules/auth/auth.utils.cjs +80 -0
- package/dist/src/modules/auth/auth.utils.cjs.map +1 -0
- package/dist/src/modules/auth/auth.utils.d.cts +2356 -0
- package/dist/src/modules/base/base.abstract.cjs +62 -0
- package/dist/src/modules/base/base.abstract.cjs.map +1 -0
- package/dist/src/modules/base/base.abstract.d.cts +29 -0
- package/dist/src/modules/base/base.actor.cjs +83 -0
- package/dist/src/modules/base/base.actor.cjs.map +1 -0
- package/dist/src/modules/base/base.actor.d.cts +73 -0
- package/dist/src/modules/base/base.dto.cjs +98 -0
- package/dist/src/modules/base/base.dto.cjs.map +1 -0
- package/dist/src/modules/base/base.dto.d.cts +67 -0
- package/dist/src/modules/base/base.grants.cjs +107 -0
- package/dist/src/modules/base/base.grants.cjs.map +1 -0
- package/dist/src/modules/base/base.grants.d.cts +28 -0
- package/dist/src/modules/base/base.procedure.cjs +255 -0
- package/dist/src/modules/base/base.procedure.cjs.map +1 -0
- package/dist/src/modules/base/base.procedure.d.cts +111 -0
- package/dist/src/modules/base/base.repository.cjs +269 -0
- package/dist/src/modules/base/base.repository.cjs.map +1 -0
- package/dist/src/modules/base/base.repository.d.cts +125 -0
- package/dist/src/modules/base/base.repository.d.mts +2 -0
- package/dist/src/modules/base/base.repository.mjs +12 -0
- package/dist/src/modules/base/base.repository.mjs.map +1 -1
- package/dist/src/modules/base/base.service.cjs +119 -0
- package/dist/src/modules/base/base.service.cjs.map +1 -0
- package/dist/src/modules/base/base.service.d.cts +44 -0
- package/dist/src/modules/base/base.types.cjs +0 -0
- package/dist/src/modules/base/base.types.d.cts +5 -0
- package/dist/src/modules/billing/billing.db.cjs +38 -0
- package/dist/src/modules/billing/billing.db.cjs.map +1 -0
- package/dist/src/modules/billing/billing.db.d.cts +371 -0
- package/dist/src/modules/billing/billing.repository.cjs +190 -0
- package/dist/src/modules/billing/billing.repository.cjs.map +1 -0
- package/dist/src/modules/billing/billing.repository.d.cts +2787 -0
- package/dist/src/modules/billing/billing.repository.d.mts +11 -11
- package/dist/src/modules/billing/billing.router.cjs +43 -0
- package/dist/src/modules/billing/billing.router.cjs.map +1 -0
- package/dist/src/modules/billing/billing.router.d.cts +9 -0
- package/dist/src/modules/billing/billing.service.cjs +127 -0
- package/dist/src/modules/billing/billing.service.cjs.map +1 -0
- package/dist/src/modules/billing/billing.service.d.cts +53 -0
- package/dist/src/modules/billing/billing.service.d.mts +7 -7
- package/dist/src/modules/billing/billing.trpc.cjs +19 -0
- package/dist/src/modules/billing/billing.trpc.cjs.map +1 -0
- package/dist/src/modules/billing/billing.trpc.d.cts +48 -0
- package/dist/src/modules/clay/clay.repository.cjs +29 -0
- package/dist/src/modules/clay/clay.repository.cjs.map +1 -0
- package/dist/src/modules/clay/clay.repository.d.cts +10 -0
- package/dist/src/modules/clay/clay.service.cjs +24 -0
- package/dist/src/modules/clay/clay.service.cjs.map +1 -0
- package/dist/src/modules/clay/clay.service.d.cts +32 -0
- package/dist/src/modules/connect/connect.db.cjs +37 -0
- package/dist/src/modules/connect/connect.db.cjs.map +1 -0
- package/dist/src/modules/connect/connect.db.d.cts +362 -0
- package/dist/src/modules/connect/connect.dto.cjs +45 -0
- package/dist/src/modules/connect/connect.dto.cjs.map +1 -0
- package/dist/src/modules/connect/connect.dto.d.cts +79 -0
- package/dist/src/modules/connect/connect.linkedin.cjs +48 -0
- package/dist/src/modules/connect/connect.linkedin.cjs.map +1 -0
- package/dist/src/modules/connect/connect.linkedin.d.cts +7 -0
- package/dist/src/modules/connect/connect.oauth.cjs +153 -0
- package/dist/src/modules/connect/connect.oauth.cjs.map +1 -0
- package/dist/src/modules/connect/connect.oauth.d.cts +32 -0
- package/dist/src/modules/connect/connect.repository.cjs +42 -0
- package/dist/src/modules/connect/connect.repository.cjs.map +1 -0
- package/dist/src/modules/connect/connect.repository.d.cts +419 -0
- package/dist/src/modules/connect/connect.router.cjs +48 -0
- package/dist/src/modules/connect/connect.router.cjs.map +1 -0
- package/dist/src/modules/connect/connect.router.d.cts +9 -0
- package/dist/src/modules/connect/connect.service.cjs +90 -0
- package/dist/src/modules/connect/connect.service.cjs.map +1 -0
- package/dist/src/modules/connect/connect.service.d.cts +103 -0
- package/dist/src/modules/connect/connect.trpc.cjs +18 -0
- package/dist/src/modules/connect/connect.trpc.cjs.map +1 -0
- package/dist/src/modules/connect/connect.trpc.d.cts +53 -0
- package/dist/src/modules/connect/connect.types.cjs +0 -0
- package/dist/src/modules/connect/connect.types.d.cts +29 -0
- package/dist/src/modules/crypto/crypto.db.cjs +26 -0
- package/dist/src/modules/crypto/crypto.db.cjs.map +1 -0
- package/dist/src/modules/crypto/crypto.db.d.cts +157 -0
- package/dist/src/modules/crypto/crypto.repository.cjs +9 -0
- package/dist/src/modules/crypto/crypto.repository.cjs.map +1 -0
- package/dist/src/modules/crypto/crypto.repository.d.cts +163 -0
- package/dist/src/modules/crypto/crypto.service.cjs +46 -0
- package/dist/src/modules/crypto/crypto.service.cjs.map +1 -0
- package/dist/src/modules/crypto/crypto.service.d.cts +15 -0
- package/dist/src/modules/email/email.service.cjs +107 -0
- package/dist/src/modules/email/email.service.cjs.map +1 -0
- package/dist/src/modules/email/email.service.d.cts +62 -0
- package/dist/src/modules/file/file.repository.cjs +74 -0
- package/dist/src/modules/file/file.repository.cjs.map +1 -0
- package/dist/src/modules/file/file.repository.d.cts +17 -0
- package/dist/src/modules/file/file.router.cjs +94 -0
- package/dist/src/modules/file/file.router.cjs.map +1 -0
- package/dist/src/modules/file/file.router.d.cts +7 -0
- package/dist/src/modules/file/file.service.cjs +120 -0
- package/dist/src/modules/file/file.service.cjs.map +1 -0
- package/dist/src/modules/file/file.service.d.cts +30 -0
- package/dist/src/modules/recurrence/recurrence.db.cjs +55 -0
- package/dist/src/modules/recurrence/recurrence.db.cjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.db.d.cts +568 -0
- package/dist/src/modules/recurrence/recurrence.repository.cjs +31 -0
- package/dist/src/modules/recurrence/recurrence.repository.cjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.repository.d.cts +588 -0
- package/dist/src/modules/recurrence/recurrence.service.cjs +66 -0
- package/dist/src/modules/recurrence/recurrence.service.cjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.service.d.cts +88 -0
- package/dist/src/modules/recurrence/recurrence.service.d.mts +2 -1
- package/dist/src/modules/recurrence/recurrence.service.mjs +1 -1
- package/dist/src/modules/recurrence/recurrence.service.mjs.map +1 -1
- package/dist/src/modules/recurrence/recurrence.trpc.cjs +46 -0
- package/dist/src/modules/recurrence/recurrence.trpc.cjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.trpc.d.cts +216 -0
- package/dist/src/modules/recurrence/recurrence.trpc.d.mts +2 -1
- package/dist/src/modules/social/social.dto.cjs +26 -0
- package/dist/src/modules/social/social.dto.cjs.map +1 -0
- package/dist/src/modules/social/social.dto.d.cts +39 -0
- package/dist/src/modules/social/social.linkedin.cjs +349 -0
- package/dist/src/modules/social/social.linkedin.cjs.map +1 -0
- package/dist/src/modules/social/social.linkedin.d.cts +15 -0
- package/dist/src/modules/social/social.service.cjs +57 -0
- package/dist/src/modules/social/social.service.cjs.map +1 -0
- package/dist/src/modules/social/social.service.d.cts +34 -0
- package/dist/src/modules/social/social.types.cjs +0 -0
- package/dist/src/modules/social/social.types.d.cts +40 -0
- package/dist/src/modules/tag/tag.db.cjs +43 -0
- package/dist/src/modules/tag/tag.db.cjs.map +1 -0
- package/dist/src/modules/tag/tag.db.d.cts +352 -0
- package/dist/src/modules/tag/tag.dto.cjs +15 -0
- package/dist/src/modules/tag/tag.dto.cjs.map +1 -0
- package/dist/src/modules/tag/tag.dto.d.cts +1025 -0
- package/dist/src/modules/tag/tag.repository.cjs +116 -0
- package/dist/src/modules/tag/tag.repository.cjs.map +1 -0
- package/dist/src/modules/tag/tag.repository.d.cts +394 -0
- package/dist/src/modules/tag/tag.service.cjs +48 -0
- package/dist/src/modules/tag/tag.service.cjs.map +1 -0
- package/dist/src/modules/tag/tag.service.d.cts +120 -0
- package/dist/src/modules/tag/tag.trpc.cjs +32 -0
- package/dist/src/modules/tag/tag.trpc.cjs.map +1 -0
- package/dist/src/modules/tag/tag.trpc.d.cts +174 -0
- package/dist/src/modules/tag/tag.trpc.d.mts +3 -2
- package/dist/src/modules/utils/applyPagination.cjs +16 -0
- package/dist/src/modules/utils/applyPagination.cjs.map +1 -0
- package/dist/src/modules/utils/applyPagination.d.cts +10 -0
- package/dist/src/modules/utils/applySorting.cjs +20 -0
- package/dist/src/modules/utils/applySorting.cjs.map +1 -0
- package/dist/src/modules/utils/applySorting.d.cts +13 -0
- package/dist/src/modules/utils/getConditionsFromFilters.cjs +152 -0
- package/dist/src/modules/utils/getConditionsFromFilters.cjs.map +1 -0
- package/dist/src/modules/utils/getConditionsFromFilters.d.cts +9 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.cjs +30 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.cjs.map +1 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.d.cts +18 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.d.mts +18 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.mjs +26 -0
- package/dist/src/modules/utils/getGlobalSearchCondition.mjs.map +1 -0
- package/dist/src/modules/video/video.service.cjs +114 -0
- package/dist/src/modules/video/video.service.cjs.map +1 -0
- package/dist/src/modules/video/video.service.d.cts +12 -0
- package/dist/src/modules/video/video.service.mjs +73 -13
- package/dist/src/modules/video/video.service.mjs.map +1 -1
- package/dist/src/modules/webhook/webhook.constants.cjs +13 -0
- package/dist/src/modules/webhook/webhook.constants.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.constants.d.cts +12 -0
- package/dist/src/modules/webhook/webhook.db.cjs +19 -0
- package/dist/src/modules/webhook/webhook.db.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.db.d.cts +142 -0
- package/dist/src/modules/webhook/webhook.dto.cjs +11 -0
- package/dist/src/modules/webhook/webhook.dto.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.dto.d.cts +402 -0
- package/dist/src/modules/webhook/webhook.repository.cjs +52 -0
- package/dist/src/modules/webhook/webhook.repository.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.repository.d.cts +154 -0
- package/dist/src/modules/webhook/webhook.router.cjs +26 -0
- package/dist/src/modules/webhook/webhook.router.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.router.d.cts +8 -0
- package/dist/src/modules/webhook/webhook.service.cjs +61 -0
- package/dist/src/modules/webhook/webhook.service.cjs.map +1 -0
- package/dist/src/modules/webhook/webhook.service.d.cts +14 -0
- package/dist/src/modules/workflow/workflow.db.cjs +35 -0
- package/dist/src/modules/workflow/workflow.db.cjs.map +1 -0
- package/dist/src/modules/workflow/workflow.db.d.cts +302 -0
- package/dist/src/modules/workflow/workflow.repository.cjs +95 -0
- package/dist/src/modules/workflow/workflow.repository.cjs.map +1 -0
- package/dist/src/modules/workflow/workflow.repository.d.cts +371 -0
- package/dist/src/modules/workflow/workflow.service.cjs +41 -0
- package/dist/src/modules/workflow/workflow.service.cjs.map +1 -0
- package/dist/src/modules/workflow/workflow.service.d.cts +68 -0
- package/dist/src/modules/workflow/workflow.trpc.cjs +19 -0
- package/dist/src/modules/workflow/workflow.trpc.cjs.map +1 -0
- package/dist/src/modules/workflow/workflow.trpc.d.cts +65 -0
- package/dist/src/modules/workflow/workflow.types.cjs +0 -0
- package/dist/src/modules/workflow/workflow.types.d.cts +25 -0
- package/dist/src/modules/workflow/workflow.utils.cjs +185 -0
- package/dist/src/modules/workflow/workflow.utils.cjs.map +1 -0
- package/dist/src/modules/workflow/workflow.utils.d.cts +36 -0
- package/dist/src/types.cjs +12 -0
- package/dist/src/types.cjs.map +1 -0
- package/dist/src/types.d.cts +344 -0
- package/dist/src/utils/errors.cjs +101 -0
- package/dist/src/utils/errors.cjs.map +1 -0
- package/dist/src/utils/errors.d.cts +62 -0
- package/dist/src/utils/logger.cjs +13 -0
- package/dist/src/utils/logger.cjs.map +1 -0
- package/dist/src/utils/logger.d.cts +7 -0
- package/dist/src/utils/posthog.cjs +31 -0
- package/dist/src/utils/posthog.cjs.map +1 -0
- package/dist/src/utils/posthog.d.cts +17 -0
- package/dist/src/utils/trpc.cjs +156 -0
- package/dist/src/utils/trpc.cjs.map +1 -0
- package/dist/src/utils/trpc.d.cts +54 -0
- package/dist/src/utils/types.cjs +0 -0
- package/dist/src/utils/types.d.cts +9 -0
- package/package.json +171 -47
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGlobalSearchCondition.cjs","names":[],"sources":["../../../../src/modules/utils/getGlobalSearchCondition.ts"],"sourcesContent":["import { or, type SQL, sql } from \"drizzle-orm\";\r\nimport type { SQLiteColumn } from \"drizzle-orm/sqlite-core\";\r\n\r\ninterface SqlConditionSink {\r\n push(condition?: SQL): void;\r\n}\r\n\r\n/** Escape `%`, `_`, and `\\` for use in SQL `LIKE … ESCAPE '\\\\'`. */\r\nexport function escapeLikeUserInput(value: string): string {\r\n return value.replace(/\\\\/g, \"\\\\\\\\\").replace(/%/g, \"\\\\%\").replace(/_/g, \"\\\\_\");\r\n}\r\n\r\n/**\r\n * Builds `(col1 LIKE %q% ESCAPE '\\') OR …` across the given text columns.\r\n * Returns undefined when `q` is empty or there are no columns.\r\n */\r\nexport function getGlobalSearchCondition(\r\n q: string | undefined,\r\n columns: readonly SQLiteColumn[]\r\n): SQL | undefined {\r\n const trimmed = q?.trim();\r\n if (!trimmed || columns.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const pattern = `%${escapeLikeUserInput(trimmed)}%`;\r\n const clauses = columns.map((col) => sql`${col} LIKE ${pattern} ESCAPE '\\\\'`);\r\n\r\n if (clauses.length === 1) {\r\n return clauses[0];\r\n }\r\n\r\n return or(...clauses);\r\n}\r\n\r\nexport function pushGlobalSearch(\r\n builder: SqlConditionSink,\r\n q: string | undefined,\r\n columns: readonly SQLiteColumn[]\r\n): void {\r\n const cond = getGlobalSearchCondition(q, columns);\r\n if (cond) {\r\n builder.push(cond);\r\n }\r\n}\r\n"],"mappings":";;;;;AAQA,SAAgB,oBAAoB,OAAuB;AACzD,QAAO,MAAM,QAAQ,OAAO,OAAO,CAAC,QAAQ,MAAM,MAAM,CAAC,QAAQ,MAAM,MAAM;;;;;;AAO/E,SAAgB,yBACd,GACA,SACiB;CACjB,MAAM,UAAU,GAAG,MAAM;AACzB,KAAI,CAAC,WAAW,QAAQ,WAAW,EACjC;CAGF,MAAM,UAAU,IAAI,oBAAoB,QAAQ,CAAC;CACjD,MAAM,UAAU,QAAQ,KAAK,QAAQ,YAAA,GAAG,GAAG,IAAI,QAAQ,QAAQ,cAAc;AAE7E,KAAI,QAAQ,WAAW,EACrB,QAAO,QAAQ;AAGjB,SAAA,GAAA,YAAA,IAAU,GAAG,QAAQ;;AAGvB,SAAgB,iBACd,SACA,GACA,SACM;CACN,MAAM,OAAO,yBAAyB,GAAG,QAAQ;AACjD,KAAI,KACF,SAAQ,KAAK,KAAK"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SQLiteColumn } from "drizzle-orm/sqlite-core";
|
|
2
|
+
import { SQL } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/utils/getGlobalSearchCondition.d.ts
|
|
5
|
+
interface SqlConditionSink {
|
|
6
|
+
push(condition?: SQL): void;
|
|
7
|
+
}
|
|
8
|
+
/** Escape `%`, `_`, and `\` for use in SQL `LIKE … ESCAPE '\\'`. */
|
|
9
|
+
declare function escapeLikeUserInput(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Builds `(col1 LIKE %q% ESCAPE '\') OR …` across the given text columns.
|
|
12
|
+
* Returns undefined when `q` is empty or there are no columns.
|
|
13
|
+
*/
|
|
14
|
+
declare function getGlobalSearchCondition(q: string | undefined, columns: readonly SQLiteColumn[]): SQL | undefined;
|
|
15
|
+
declare function pushGlobalSearch(builder: SqlConditionSink, q: string | undefined, columns: readonly SQLiteColumn[]): void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { escapeLikeUserInput, getGlobalSearchCondition, pushGlobalSearch };
|
|
18
|
+
//# sourceMappingURL=getGlobalSearchCondition.d.cts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SQL } from "drizzle-orm";
|
|
2
|
+
import { SQLiteColumn } from "drizzle-orm/sqlite-core";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/utils/getGlobalSearchCondition.d.ts
|
|
5
|
+
interface SqlConditionSink {
|
|
6
|
+
push(condition?: SQL): void;
|
|
7
|
+
}
|
|
8
|
+
/** Escape `%`, `_`, and `\` for use in SQL `LIKE … ESCAPE '\\'`. */
|
|
9
|
+
declare function escapeLikeUserInput(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Builds `(col1 LIKE %q% ESCAPE '\') OR …` across the given text columns.
|
|
12
|
+
* Returns undefined when `q` is empty or there are no columns.
|
|
13
|
+
*/
|
|
14
|
+
declare function getGlobalSearchCondition(q: string | undefined, columns: readonly SQLiteColumn[]): SQL | undefined;
|
|
15
|
+
declare function pushGlobalSearch(builder: SqlConditionSink, q: string | undefined, columns: readonly SQLiteColumn[]): void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { escapeLikeUserInput, getGlobalSearchCondition, pushGlobalSearch };
|
|
18
|
+
//# sourceMappingURL=getGlobalSearchCondition.d.mts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { or, sql } from "drizzle-orm";
|
|
2
|
+
//#region src/modules/utils/getGlobalSearchCondition.ts
|
|
3
|
+
/** Escape `%`, `_`, and `\` for use in SQL `LIKE … ESCAPE '\\'`. */
|
|
4
|
+
function escapeLikeUserInput(value) {
|
|
5
|
+
return value.replace(/\\/g, "\\\\").replace(/%/g, "\\%").replace(/_/g, "\\_");
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Builds `(col1 LIKE %q% ESCAPE '\') OR …` across the given text columns.
|
|
9
|
+
* Returns undefined when `q` is empty or there are no columns.
|
|
10
|
+
*/
|
|
11
|
+
function getGlobalSearchCondition(q, columns) {
|
|
12
|
+
const trimmed = q?.trim();
|
|
13
|
+
if (!trimmed || columns.length === 0) return;
|
|
14
|
+
const pattern = `%${escapeLikeUserInput(trimmed)}%`;
|
|
15
|
+
const clauses = columns.map((col) => sql`${col} LIKE ${pattern} ESCAPE '\\'`);
|
|
16
|
+
if (clauses.length === 1) return clauses[0];
|
|
17
|
+
return or(...clauses);
|
|
18
|
+
}
|
|
19
|
+
function pushGlobalSearch(builder, q, columns) {
|
|
20
|
+
const cond = getGlobalSearchCondition(q, columns);
|
|
21
|
+
if (cond) builder.push(cond);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { escapeLikeUserInput, getGlobalSearchCondition, pushGlobalSearch };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=getGlobalSearchCondition.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGlobalSearchCondition.mjs","names":[],"sources":["../../../../src/modules/utils/getGlobalSearchCondition.ts"],"sourcesContent":["import { or, type SQL, sql } from \"drizzle-orm\";\r\nimport type { SQLiteColumn } from \"drizzle-orm/sqlite-core\";\r\n\r\ninterface SqlConditionSink {\r\n push(condition?: SQL): void;\r\n}\r\n\r\n/** Escape `%`, `_`, and `\\` for use in SQL `LIKE … ESCAPE '\\\\'`. */\r\nexport function escapeLikeUserInput(value: string): string {\r\n return value.replace(/\\\\/g, \"\\\\\\\\\").replace(/%/g, \"\\\\%\").replace(/_/g, \"\\\\_\");\r\n}\r\n\r\n/**\r\n * Builds `(col1 LIKE %q% ESCAPE '\\') OR …` across the given text columns.\r\n * Returns undefined when `q` is empty or there are no columns.\r\n */\r\nexport function getGlobalSearchCondition(\r\n q: string | undefined,\r\n columns: readonly SQLiteColumn[]\r\n): SQL | undefined {\r\n const trimmed = q?.trim();\r\n if (!trimmed || columns.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const pattern = `%${escapeLikeUserInput(trimmed)}%`;\r\n const clauses = columns.map((col) => sql`${col} LIKE ${pattern} ESCAPE '\\\\'`);\r\n\r\n if (clauses.length === 1) {\r\n return clauses[0];\r\n }\r\n\r\n return or(...clauses);\r\n}\r\n\r\nexport function pushGlobalSearch(\r\n builder: SqlConditionSink,\r\n q: string | undefined,\r\n columns: readonly SQLiteColumn[]\r\n): void {\r\n const cond = getGlobalSearchCondition(q, columns);\r\n if (cond) {\r\n builder.push(cond);\r\n }\r\n}\r\n"],"mappings":";;;AAQA,SAAgB,oBAAoB,OAAuB;AACzD,QAAO,MAAM,QAAQ,OAAO,OAAO,CAAC,QAAQ,MAAM,MAAM,CAAC,QAAQ,MAAM,MAAM;;;;;;AAO/E,SAAgB,yBACd,GACA,SACiB;CACjB,MAAM,UAAU,GAAG,MAAM;AACzB,KAAI,CAAC,WAAW,QAAQ,WAAW,EACjC;CAGF,MAAM,UAAU,IAAI,oBAAoB,QAAQ,CAAC;CACjD,MAAM,UAAU,QAAQ,KAAK,QAAQ,GAAG,GAAG,IAAI,QAAQ,QAAQ,cAAc;AAE7E,KAAI,QAAQ,WAAW,EACrB,QAAO,QAAQ;AAGjB,QAAO,GAAG,GAAG,QAAQ;;AAGvB,SAAgB,iBACd,SACA,GACA,SACM;CACN,MAAM,OAAO,yBAAyB,GAAG,QAAQ;AACjD,KAAI,KACF,SAAQ,KAAK,KAAK"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_src_modules_base_base_service = require("../base/base.service.cjs");
|
|
4
|
+
let neverthrow = require("neverthrow");
|
|
5
|
+
let uuid = require("uuid");
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_runtime.__toESM(node_path);
|
|
8
|
+
let node_fs = require("node:fs");
|
|
9
|
+
let node_child_process = require("node:child_process");
|
|
10
|
+
let ffmpeg_ffprobe_static = require("ffmpeg-ffprobe-static");
|
|
11
|
+
ffmpeg_ffprobe_static = require_runtime.__toESM(ffmpeg_ffprobe_static);
|
|
12
|
+
//#region src/modules/video/video.service.ts
|
|
13
|
+
if (!ffmpeg_ffprobe_static.default.ffmpegPath || !ffmpeg_ffprobe_static.default.ffprobePath) throw new Error("FFmpeg or FFprobe not found");
|
|
14
|
+
const uploadsDir = node_path.default.join(__dirname, "..", "uploads");
|
|
15
|
+
if (!(0, node_fs.existsSync)(uploadsDir)) (0, node_fs.mkdirSync)(uploadsDir, { recursive: true });
|
|
16
|
+
const runFfmpeg = async (args) => {
|
|
17
|
+
await new Promise((resolve, reject) => {
|
|
18
|
+
const child = (0, node_child_process.spawn)(ffmpeg_ffprobe_static.default.ffmpegPath, [...args], { stdio: [
|
|
19
|
+
"ignore",
|
|
20
|
+
"ignore",
|
|
21
|
+
"pipe"
|
|
22
|
+
] });
|
|
23
|
+
let stderr = "";
|
|
24
|
+
child.stderr?.setEncoding("utf8");
|
|
25
|
+
child.stderr?.on("data", (chunk) => {
|
|
26
|
+
stderr += chunk;
|
|
27
|
+
});
|
|
28
|
+
child.on("error", (error) => reject(error));
|
|
29
|
+
child.on("close", (code) => {
|
|
30
|
+
if (code === 0) {
|
|
31
|
+
resolve();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
reject(new Error(stderr || `ffmpeg exited with code ${code ?? "unknown"}`));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var VideoService = class extends require_src_modules_base_base_service.BaseService {
|
|
39
|
+
async cut(file, start, end) {
|
|
40
|
+
return this.throwableAsync(async () => {
|
|
41
|
+
const duration = end - start;
|
|
42
|
+
const output = node_path.default.join(uploadsDir, `${(0, uuid.v4)()}.mp4`);
|
|
43
|
+
if (!(0, node_fs.existsSync)(output)) (0, node_fs.closeSync)((0, node_fs.openSync)(output, "w"));
|
|
44
|
+
await runFfmpeg([
|
|
45
|
+
"-i",
|
|
46
|
+
file,
|
|
47
|
+
"-ss",
|
|
48
|
+
String(start),
|
|
49
|
+
"-t",
|
|
50
|
+
String(duration),
|
|
51
|
+
"-c:v",
|
|
52
|
+
"libx264",
|
|
53
|
+
"-c:a",
|
|
54
|
+
"copy",
|
|
55
|
+
"-movflags",
|
|
56
|
+
"+faststart",
|
|
57
|
+
"-y",
|
|
58
|
+
output
|
|
59
|
+
]).catch((error) => {
|
|
60
|
+
throw this.handleUnknownError(error);
|
|
61
|
+
});
|
|
62
|
+
return (0, neverthrow.ok)(output);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async webmToWav(input, hz = 48e3) {
|
|
66
|
+
return this.throwableAsync(async () => {
|
|
67
|
+
const output = node_path.default.join(uploadsDir, `${(0, uuid.v4)()}.wav`);
|
|
68
|
+
if (!(0, node_fs.existsSync)(output)) (0, node_fs.closeSync)((0, node_fs.openSync)(output, "w"));
|
|
69
|
+
await runFfmpeg([
|
|
70
|
+
"-i",
|
|
71
|
+
input,
|
|
72
|
+
"-vn",
|
|
73
|
+
"-c:a",
|
|
74
|
+
"pcm_s16le",
|
|
75
|
+
"-ar",
|
|
76
|
+
String(hz),
|
|
77
|
+
"-ac",
|
|
78
|
+
"2",
|
|
79
|
+
"-f",
|
|
80
|
+
"wav",
|
|
81
|
+
"-y",
|
|
82
|
+
output
|
|
83
|
+
]).catch((error) => {
|
|
84
|
+
throw this.handleUnknownError(error);
|
|
85
|
+
});
|
|
86
|
+
return (0, neverthrow.ok)(output);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
async extractAudioMp3(input, kbps = 192, streamIndex = 0) {
|
|
90
|
+
return this.throwableAsync(async () => {
|
|
91
|
+
const output = node_path.default.join(uploadsDir, `${(0, uuid.v4)()}.mp3`);
|
|
92
|
+
if (!(0, node_fs.existsSync)(output)) (0, node_fs.closeSync)((0, node_fs.openSync)(output, "w"));
|
|
93
|
+
await runFfmpeg([
|
|
94
|
+
"-i",
|
|
95
|
+
input,
|
|
96
|
+
"-map",
|
|
97
|
+
`0:a:${streamIndex}`,
|
|
98
|
+
"-c:a",
|
|
99
|
+
"libmp3lame",
|
|
100
|
+
"-b:a",
|
|
101
|
+
`${kbps}k`,
|
|
102
|
+
"-y",
|
|
103
|
+
output
|
|
104
|
+
]).catch((error) => {
|
|
105
|
+
throw this.handleUnknownError(error);
|
|
106
|
+
});
|
|
107
|
+
return (0, neverthrow.ok)(output);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.VideoService = VideoService;
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=video.service.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.service.cjs","names":["ffbin","path","BaseService"],"sources":["../../../../src/modules/video/video.service.ts"],"sourcesContent":["import { closeSync, existsSync, mkdirSync, openSync } from \"node:fs\";\r\nimport path from \"node:path\";\r\nimport { spawn } from \"node:child_process\";\r\n//\r\nimport ffbin from \"ffmpeg-ffprobe-static\";\r\nimport { ok } from \"neverthrow\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseService } from \"../base/base.service\";\r\n\r\nif (!ffbin.ffmpegPath || !ffbin.ffprobePath) {\r\n throw new Error(\"FFmpeg or FFprobe not found\");\r\n}\r\n\r\nconst uploadsDir = path.join(__dirname, \"..\", \"uploads\");\r\nif (!existsSync(uploadsDir)) {\r\n mkdirSync(uploadsDir, { recursive: true });\r\n}\r\n\r\nconst runFfmpeg = async (args: readonly string[]): Promise<void> => {\r\n await new Promise<void>((resolve, reject) => {\r\n const child = spawn(ffbin.ffmpegPath as string, [...args], {\r\n stdio: [\"ignore\", \"ignore\", \"pipe\"],\r\n });\r\n\r\n let stderr = \"\";\r\n child.stderr?.setEncoding(\"utf8\");\r\n child.stderr?.on(\"data\", (chunk: string) => {\r\n stderr += chunk;\r\n });\r\n\r\n child.on(\"error\", (error) => reject(error));\r\n child.on(\"close\", (code) => {\r\n if (code === 0) {\r\n resolve();\r\n return;\r\n }\r\n reject(new Error(stderr || `ffmpeg exited with code ${code ?? \"unknown\"}`));\r\n });\r\n });\r\n};\r\n\r\nexport class VideoService extends BaseService<never, never> {\r\n async cut(file: string, start: number, end: number): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const duration = end - start;\r\n const output = path.join(uploadsDir, `${uuidv4()}.mp4`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n\r\n await runFfmpeg([\r\n \"-i\",\r\n file,\r\n \"-ss\",\r\n String(start),\r\n \"-t\",\r\n String(duration),\r\n \"-c:v\",\r\n \"libx264\",\r\n \"-c:a\",\r\n \"copy\",\r\n \"-movflags\",\r\n \"+faststart\",\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n\r\n return ok(output);\r\n });\r\n }\r\n\r\n async webmToWav(input: string, hz = 48000): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const output = path.join(uploadsDir, `${uuidv4()}.wav`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n\r\n await runFfmpeg([\r\n \"-i\",\r\n input,\r\n \"-vn\",\r\n \"-c:a\",\r\n \"pcm_s16le\",\r\n \"-ar\",\r\n String(hz),\r\n \"-ac\",\r\n \"2\",\r\n \"-f\",\r\n \"wav\",\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n return ok(output);\r\n });\r\n }\r\n\r\n async extractAudioMp3(input: string, kbps = 192, streamIndex = 0): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const output = path.join(uploadsDir, `${uuidv4()}.mp3`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n await runFfmpeg([\r\n \"-i\",\r\n input,\r\n \"-map\",\r\n `0:a:${streamIndex}`,\r\n \"-c:a\",\r\n \"libmp3lame\",\r\n \"-b:a\",\r\n `${kbps}k`,\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n\r\n return ok(output);\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAUA,IAAI,CAACA,sBAAAA,QAAM,cAAc,CAACA,sBAAAA,QAAM,YAC9B,OAAM,IAAI,MAAM,8BAA8B;AAGhD,MAAM,aAAaC,UAAAA,QAAK,KAAK,WAAW,MAAM,UAAU;AACxD,IAAI,EAAA,GAAA,QAAA,YAAY,WAAW,CACzB,EAAA,GAAA,QAAA,WAAU,YAAY,EAAE,WAAW,MAAM,CAAC;AAG5C,MAAM,YAAY,OAAO,SAA2C;AAClE,OAAM,IAAI,SAAe,SAAS,WAAW;EAC3C,MAAM,SAAA,GAAA,mBAAA,OAAcD,sBAAAA,QAAM,YAAsB,CAAC,GAAG,KAAK,EAAE,EACzD,OAAO;GAAC;GAAU;GAAU;GAAO,EACpC,CAAC;EAEF,IAAI,SAAS;AACb,QAAM,QAAQ,YAAY,OAAO;AACjC,QAAM,QAAQ,GAAG,SAAS,UAAkB;AAC1C,aAAU;IACV;AAEF,QAAM,GAAG,UAAU,UAAU,OAAO,MAAM,CAAC;AAC3C,QAAM,GAAG,UAAU,SAAS;AAC1B,OAAI,SAAS,GAAG;AACd,aAAS;AACT;;AAEF,UAAO,IAAI,MAAM,UAAU,2BAA2B,QAAQ,YAAY,CAAC;IAC3E;GACF;;AAGJ,IAAa,eAAb,cAAkCE,sCAAAA,YAA0B;CAC1D,MAAM,IAAI,MAAc,OAAe,KAAwC;AAC7E,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,WAAW,MAAM;GACvB,MAAM,SAASD,UAAAA,QAAK,KAAK,YAAY,IAAA,GAAA,KAAA,KAAW,CAAC,MAAM;AACvD,OAAI,EAAA,GAAA,QAAA,YAAY,OAAO,CACrB,EAAA,GAAA,QAAA,YAAA,GAAA,QAAA,UAAmB,QAAQ,IAAI,CAAC;AAGlC,SAAM,UAAU;IACd;IACA;IACA;IACA,OAAO,MAAM;IACb;IACA,OAAO,SAAS;IAChB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AAEF,WAAA,GAAA,WAAA,IAAU,OAAO;IACjB;;CAGJ,MAAM,UAAU,OAAe,KAAK,MAAkC;AACpE,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,SAASA,UAAAA,QAAK,KAAK,YAAY,IAAA,GAAA,KAAA,KAAW,CAAC,MAAM;AACvD,OAAI,EAAA,GAAA,QAAA,YAAY,OAAO,CACrB,EAAA,GAAA,QAAA,YAAA,GAAA,QAAA,UAAmB,QAAQ,IAAI,CAAC;AAGlC,SAAM,UAAU;IACd;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,GAAG;IACV;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AACF,WAAA,GAAA,WAAA,IAAU,OAAO;IACjB;;CAGJ,MAAM,gBAAgB,OAAe,OAAO,KAAK,cAAc,GAA8B;AAC3F,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,SAASA,UAAAA,QAAK,KAAK,YAAY,IAAA,GAAA,KAAA,KAAW,CAAC,MAAM;AACvD,OAAI,EAAA,GAAA,QAAA,YAAY,OAAO,CACrB,EAAA,GAAA,QAAA,YAAA,GAAA,QAAA,UAAmB,QAAQ,IAAI,CAAC;AAElC,SAAM,UAAU;IACd;IACA;IACA;IACA,OAAO;IACP;IACA;IACA;IACA,GAAG,KAAK;IACR;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AAEF,WAAA,GAAA,WAAA,IAAU,OAAO;IACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.cjs";
|
|
2
|
+
import { BaseService } from "../base/base.service.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/video/video.service.d.ts
|
|
5
|
+
declare class VideoService extends BaseService<never, never> {
|
|
6
|
+
cut(file: string, start: number, end: number): ServerResultAsync<string>;
|
|
7
|
+
webmToWav(input: string, hz?: number): ServerResultAsync<string>;
|
|
8
|
+
extractAudioMp3(input: string, kbps?: number, streamIndex?: number): ServerResultAsync<string>;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { VideoService };
|
|
12
|
+
//# sourceMappingURL=video.service.d.cts.map
|
|
@@ -1,25 +1,60 @@
|
|
|
1
1
|
import { BaseService } from "../base/base.service.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { ok } from "neverthrow";
|
|
3
3
|
import { v4 } from "uuid";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { closeSync, existsSync, mkdirSync, openSync } from "node:fs";
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
6
7
|
import ffbin from "ffmpeg-ffprobe-static";
|
|
7
|
-
import ffmpeg from "fluent-ffmpeg";
|
|
8
8
|
//#region src/modules/video/video.service.ts
|
|
9
9
|
if (!ffbin.ffmpegPath || !ffbin.ffprobePath) throw new Error("FFmpeg or FFprobe not found");
|
|
10
|
-
ffmpeg.setFfmpegPath(ffbin.ffmpegPath);
|
|
11
|
-
ffmpeg.setFfprobePath(ffbin.ffprobePath);
|
|
12
10
|
const uploadsDir = path.join(__dirname, "..", "uploads");
|
|
13
11
|
if (!existsSync(uploadsDir)) mkdirSync(uploadsDir, { recursive: true });
|
|
12
|
+
const runFfmpeg = async (args) => {
|
|
13
|
+
await new Promise((resolve, reject) => {
|
|
14
|
+
const child = spawn(ffbin.ffmpegPath, [...args], { stdio: [
|
|
15
|
+
"ignore",
|
|
16
|
+
"ignore",
|
|
17
|
+
"pipe"
|
|
18
|
+
] });
|
|
19
|
+
let stderr = "";
|
|
20
|
+
child.stderr?.setEncoding("utf8");
|
|
21
|
+
child.stderr?.on("data", (chunk) => {
|
|
22
|
+
stderr += chunk;
|
|
23
|
+
});
|
|
24
|
+
child.on("error", (error) => reject(error));
|
|
25
|
+
child.on("close", (code) => {
|
|
26
|
+
if (code === 0) {
|
|
27
|
+
resolve();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
reject(new Error(stderr || `ffmpeg exited with code ${code ?? "unknown"}`));
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
14
34
|
var VideoService = class extends BaseService {
|
|
15
35
|
async cut(file, start, end) {
|
|
16
36
|
return this.throwableAsync(async () => {
|
|
17
37
|
const duration = end - start;
|
|
18
38
|
const output = path.join(uploadsDir, `${v4()}.mp4`);
|
|
19
39
|
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
20
|
-
await
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
await runFfmpeg([
|
|
41
|
+
"-i",
|
|
42
|
+
file,
|
|
43
|
+
"-ss",
|
|
44
|
+
String(start),
|
|
45
|
+
"-t",
|
|
46
|
+
String(duration),
|
|
47
|
+
"-c:v",
|
|
48
|
+
"libx264",
|
|
49
|
+
"-c:a",
|
|
50
|
+
"copy",
|
|
51
|
+
"-movflags",
|
|
52
|
+
"+faststart",
|
|
53
|
+
"-y",
|
|
54
|
+
output
|
|
55
|
+
]).catch((error) => {
|
|
56
|
+
throw this.handleUnknownError(error);
|
|
57
|
+
});
|
|
23
58
|
return ok(output);
|
|
24
59
|
});
|
|
25
60
|
}
|
|
@@ -27,9 +62,23 @@ var VideoService = class extends BaseService {
|
|
|
27
62
|
return this.throwableAsync(async () => {
|
|
28
63
|
const output = path.join(uploadsDir, `${v4()}.wav`);
|
|
29
64
|
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
30
|
-
await
|
|
31
|
-
|
|
32
|
-
|
|
65
|
+
await runFfmpeg([
|
|
66
|
+
"-i",
|
|
67
|
+
input,
|
|
68
|
+
"-vn",
|
|
69
|
+
"-c:a",
|
|
70
|
+
"pcm_s16le",
|
|
71
|
+
"-ar",
|
|
72
|
+
String(hz),
|
|
73
|
+
"-ac",
|
|
74
|
+
"2",
|
|
75
|
+
"-f",
|
|
76
|
+
"wav",
|
|
77
|
+
"-y",
|
|
78
|
+
output
|
|
79
|
+
]).catch((error) => {
|
|
80
|
+
throw this.handleUnknownError(error);
|
|
81
|
+
});
|
|
33
82
|
return ok(output);
|
|
34
83
|
});
|
|
35
84
|
}
|
|
@@ -37,9 +86,20 @@ var VideoService = class extends BaseService {
|
|
|
37
86
|
return this.throwableAsync(async () => {
|
|
38
87
|
const output = path.join(uploadsDir, `${v4()}.mp3`);
|
|
39
88
|
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
40
|
-
await
|
|
41
|
-
|
|
42
|
-
|
|
89
|
+
await runFfmpeg([
|
|
90
|
+
"-i",
|
|
91
|
+
input,
|
|
92
|
+
"-map",
|
|
93
|
+
`0:a:${streamIndex}`,
|
|
94
|
+
"-c:a",
|
|
95
|
+
"libmp3lame",
|
|
96
|
+
"-b:a",
|
|
97
|
+
`${kbps}k`,
|
|
98
|
+
"-y",
|
|
99
|
+
output
|
|
100
|
+
]).catch((error) => {
|
|
101
|
+
throw this.handleUnknownError(error);
|
|
102
|
+
});
|
|
43
103
|
return ok(output);
|
|
44
104
|
});
|
|
45
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.service.mjs","names":["uuidv4"],"sources":["../../../../src/modules/video/video.service.ts"],"sourcesContent":["import { closeSync, existsSync, mkdirSync, openSync } from \"node:fs\";\r\nimport path from \"node:path\";\r\
|
|
1
|
+
{"version":3,"file":"video.service.mjs","names":["uuidv4"],"sources":["../../../../src/modules/video/video.service.ts"],"sourcesContent":["import { closeSync, existsSync, mkdirSync, openSync } from \"node:fs\";\r\nimport path from \"node:path\";\r\nimport { spawn } from \"node:child_process\";\r\n//\r\nimport ffbin from \"ffmpeg-ffprobe-static\";\r\nimport { ok } from \"neverthrow\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseService } from \"../base/base.service\";\r\n\r\nif (!ffbin.ffmpegPath || !ffbin.ffprobePath) {\r\n throw new Error(\"FFmpeg or FFprobe not found\");\r\n}\r\n\r\nconst uploadsDir = path.join(__dirname, \"..\", \"uploads\");\r\nif (!existsSync(uploadsDir)) {\r\n mkdirSync(uploadsDir, { recursive: true });\r\n}\r\n\r\nconst runFfmpeg = async (args: readonly string[]): Promise<void> => {\r\n await new Promise<void>((resolve, reject) => {\r\n const child = spawn(ffbin.ffmpegPath as string, [...args], {\r\n stdio: [\"ignore\", \"ignore\", \"pipe\"],\r\n });\r\n\r\n let stderr = \"\";\r\n child.stderr?.setEncoding(\"utf8\");\r\n child.stderr?.on(\"data\", (chunk: string) => {\r\n stderr += chunk;\r\n });\r\n\r\n child.on(\"error\", (error) => reject(error));\r\n child.on(\"close\", (code) => {\r\n if (code === 0) {\r\n resolve();\r\n return;\r\n }\r\n reject(new Error(stderr || `ffmpeg exited with code ${code ?? \"unknown\"}`));\r\n });\r\n });\r\n};\r\n\r\nexport class VideoService extends BaseService<never, never> {\r\n async cut(file: string, start: number, end: number): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const duration = end - start;\r\n const output = path.join(uploadsDir, `${uuidv4()}.mp4`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n\r\n await runFfmpeg([\r\n \"-i\",\r\n file,\r\n \"-ss\",\r\n String(start),\r\n \"-t\",\r\n String(duration),\r\n \"-c:v\",\r\n \"libx264\",\r\n \"-c:a\",\r\n \"copy\",\r\n \"-movflags\",\r\n \"+faststart\",\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n\r\n return ok(output);\r\n });\r\n }\r\n\r\n async webmToWav(input: string, hz = 48000): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const output = path.join(uploadsDir, `${uuidv4()}.wav`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n\r\n await runFfmpeg([\r\n \"-i\",\r\n input,\r\n \"-vn\",\r\n \"-c:a\",\r\n \"pcm_s16le\",\r\n \"-ar\",\r\n String(hz),\r\n \"-ac\",\r\n \"2\",\r\n \"-f\",\r\n \"wav\",\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n return ok(output);\r\n });\r\n }\r\n\r\n async extractAudioMp3(input: string, kbps = 192, streamIndex = 0): ServerResultAsync<string> {\r\n return this.throwableAsync(async () => {\r\n const output = path.join(uploadsDir, `${uuidv4()}.mp3`);\r\n if (!existsSync(output)) {\r\n closeSync(openSync(output, \"w\"));\r\n }\r\n await runFfmpeg([\r\n \"-i\",\r\n input,\r\n \"-map\",\r\n `0:a:${streamIndex}`,\r\n \"-c:a\",\r\n \"libmp3lame\",\r\n \"-b:a\",\r\n `${kbps}k`,\r\n \"-y\",\r\n output,\r\n ]).catch((error) => {\r\n throw this.handleUnknownError(error);\r\n });\r\n\r\n return ok(output);\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;;;;;AAUA,IAAI,CAAC,MAAM,cAAc,CAAC,MAAM,YAC9B,OAAM,IAAI,MAAM,8BAA8B;AAGhD,MAAM,aAAa,KAAK,KAAK,WAAW,MAAM,UAAU;AACxD,IAAI,CAAC,WAAW,WAAW,CACzB,WAAU,YAAY,EAAE,WAAW,MAAM,CAAC;AAG5C,MAAM,YAAY,OAAO,SAA2C;AAClE,OAAM,IAAI,SAAe,SAAS,WAAW;EAC3C,MAAM,QAAQ,MAAM,MAAM,YAAsB,CAAC,GAAG,KAAK,EAAE,EACzD,OAAO;GAAC;GAAU;GAAU;GAAO,EACpC,CAAC;EAEF,IAAI,SAAS;AACb,QAAM,QAAQ,YAAY,OAAO;AACjC,QAAM,QAAQ,GAAG,SAAS,UAAkB;AAC1C,aAAU;IACV;AAEF,QAAM,GAAG,UAAU,UAAU,OAAO,MAAM,CAAC;AAC3C,QAAM,GAAG,UAAU,SAAS;AAC1B,OAAI,SAAS,GAAG;AACd,aAAS;AACT;;AAEF,UAAO,IAAI,MAAM,UAAU,2BAA2B,QAAQ,YAAY,CAAC;IAC3E;GACF;;AAGJ,IAAa,eAAb,cAAkC,YAA0B;CAC1D,MAAM,IAAI,MAAc,OAAe,KAAwC;AAC7E,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,WAAW,MAAM;GACvB,MAAM,SAAS,KAAK,KAAK,YAAY,GAAGA,IAAQ,CAAC,MAAM;AACvD,OAAI,CAAC,WAAW,OAAO,CACrB,WAAU,SAAS,QAAQ,IAAI,CAAC;AAGlC,SAAM,UAAU;IACd;IACA;IACA;IACA,OAAO,MAAM;IACb;IACA,OAAO,SAAS;IAChB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AAEF,UAAO,GAAG,OAAO;IACjB;;CAGJ,MAAM,UAAU,OAAe,KAAK,MAAkC;AACpE,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,SAAS,KAAK,KAAK,YAAY,GAAGA,IAAQ,CAAC,MAAM;AACvD,OAAI,CAAC,WAAW,OAAO,CACrB,WAAU,SAAS,QAAQ,IAAI,CAAC;AAGlC,SAAM,UAAU;IACd;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,GAAG;IACV;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AACF,UAAO,GAAG,OAAO;IACjB;;CAGJ,MAAM,gBAAgB,OAAe,OAAO,KAAK,cAAc,GAA8B;AAC3F,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,SAAS,KAAK,KAAK,YAAY,GAAGA,IAAQ,CAAC,MAAM;AACvD,OAAI,CAAC,WAAW,OAAO,CACrB,WAAU,SAAS,QAAQ,IAAI,CAAC;AAElC,SAAM,UAAU;IACd;IACA;IACA;IACA,OAAO;IACP;IACA;IACA;IACA,GAAG,KAAK;IACR;IACA;IACD,CAAC,CAAC,OAAO,UAAU;AAClB,UAAM,KAAK,mBAAmB,MAAM;KACpC;AAEF,UAAO,GAAG,OAAO;IACjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/modules/webhook/webhook.constants.ts
|
|
3
|
+
const WEBHOOK_STATUS_ENUM = {
|
|
4
|
+
WAITING: "WAITING",
|
|
5
|
+
COMPLETED: "COMPLETED",
|
|
6
|
+
TIMEOUT: "TIMEOUT",
|
|
7
|
+
ERROR_CALLBACK: "ERROR_CALLBACK",
|
|
8
|
+
ERROR_DATA: "ERROR_DATA"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.WEBHOOK_STATUS_ENUM = WEBHOOK_STATUS_ENUM;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=webhook.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.constants.cjs","names":[],"sources":["../../../../src/modules/webhook/webhook.constants.ts"],"sourcesContent":["export const WEBHOOK_STATUS_ENUM = {\r\n WAITING: \"WAITING\",\r\n COMPLETED: \"COMPLETED\",\r\n TIMEOUT: \"TIMEOUT\",\r\n ERROR_CALLBACK: \"ERROR_CALLBACK\",\r\n ERROR_DATA: \"ERROR_DATA\",\r\n} as const;\r\n\r\nexport type WebhookStatus = (typeof WEBHOOK_STATUS_ENUM)[keyof typeof WEBHOOK_STATUS_ENUM];\r\n"],"mappings":";;AAAA,MAAa,sBAAsB;CACjC,SAAS;CACT,WAAW;CACX,SAAS;CACT,gBAAgB;CAChB,YAAY;CACb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/modules/webhook/webhook.constants.d.ts
|
|
2
|
+
declare const WEBHOOK_STATUS_ENUM: {
|
|
3
|
+
readonly WAITING: "WAITING";
|
|
4
|
+
readonly COMPLETED: "COMPLETED";
|
|
5
|
+
readonly TIMEOUT: "TIMEOUT";
|
|
6
|
+
readonly ERROR_CALLBACK: "ERROR_CALLBACK";
|
|
7
|
+
readonly ERROR_DATA: "ERROR_DATA";
|
|
8
|
+
};
|
|
9
|
+
type WebhookStatus = (typeof WEBHOOK_STATUS_ENUM)[keyof typeof WEBHOOK_STATUS_ENUM];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { WEBHOOK_STATUS_ENUM, WebhookStatus };
|
|
12
|
+
//# sourceMappingURL=webhook.constants.d.cts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_src_modules_webhook_webhook_constants = require("./webhook.constants.cjs");
|
|
4
|
+
let drizzle_orm_sqlite_core = require("drizzle-orm/sqlite-core");
|
|
5
|
+
let uuid = require("uuid");
|
|
6
|
+
//#region src/modules/webhook/webhook.db.ts
|
|
7
|
+
const webhook = (0, drizzle_orm_sqlite_core.sqliteTable)("webhook", {
|
|
8
|
+
id: (0, drizzle_orm_sqlite_core.text)("id").primaryKey().$default(uuid.v4),
|
|
9
|
+
createdAt: (0, drizzle_orm_sqlite_core.integer)("created_at", { mode: "timestamp" }).notNull().$default(() => /* @__PURE__ */ new Date()),
|
|
10
|
+
updatedAt: (0, drizzle_orm_sqlite_core.integer)("updated_at", { mode: "timestamp" }),
|
|
11
|
+
timeoutSec: (0, drizzle_orm_sqlite_core.integer)("timeout_sec").notNull().default(60),
|
|
12
|
+
status: (0, drizzle_orm_sqlite_core.text)("status").notNull().default(require_src_modules_webhook_webhook_constants.WEBHOOK_STATUS_ENUM.WAITING).$type(),
|
|
13
|
+
error: (0, drizzle_orm_sqlite_core.text)("error"),
|
|
14
|
+
payload: (0, drizzle_orm_sqlite_core.text)("payload")
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.webhook = webhook;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=webhook.db.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.db.cjs","names":["uuidv4","WEBHOOK_STATUS_ENUM"],"sources":["../../../../src/modules/webhook/webhook.db.ts"],"sourcesContent":["import { integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport { WEBHOOK_STATUS_ENUM, type WebhookStatus } from \"./webhook.constants\";\r\n\r\nexport const webhook = sqliteTable(\"webhook\", {\r\n id: text(\"id\").primaryKey().$default(uuidv4),\r\n createdAt: integer(\"created_at\", { mode: \"timestamp\" })\r\n .notNull()\r\n .$default(() => new Date()),\r\n updatedAt: integer(\"updated_at\", { mode: \"timestamp\" }),\r\n timeoutSec: integer(\"timeout_sec\").notNull().default(60),\r\n status: text(\"status\").notNull().default(WEBHOOK_STATUS_ENUM.WAITING).$type<WebhookStatus>(),\r\n error: text(\"error\"),\r\n payload: text(\"payload\"),\r\n});\r\n"],"mappings":";;;;;;AAIA,MAAa,WAAA,GAAA,wBAAA,aAAsB,WAAW;CAC5C,KAAA,GAAA,wBAAA,MAAS,KAAK,CAAC,YAAY,CAAC,SAASA,KAAAA,GAAO;CAC5C,YAAA,GAAA,wBAAA,SAAmB,cAAc,EAAE,MAAM,aAAa,CAAC,CACpD,SAAS,CACT,+BAAe,IAAI,MAAM,CAAC;CAC7B,YAAA,GAAA,wBAAA,SAAmB,cAAc,EAAE,MAAM,aAAa,CAAC;CACvD,aAAA,GAAA,wBAAA,SAAoB,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG;CACxD,SAAA,GAAA,wBAAA,MAAa,SAAS,CAAC,SAAS,CAAC,QAAQC,8CAAAA,oBAAoB,QAAQ,CAAC,OAAsB;CAC5F,QAAA,GAAA,wBAAA,MAAY,QAAQ;CACpB,UAAA,GAAA,wBAAA,MAAc,UAAU;CACzB,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { WebhookStatus } from "./webhook.constants.cjs";
|
|
2
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/webhook/webhook.db.d.ts
|
|
5
|
+
declare const webhook: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
6
|
+
name: "webhook";
|
|
7
|
+
schema: undefined;
|
|
8
|
+
columns: {
|
|
9
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
10
|
+
name: "id";
|
|
11
|
+
tableName: "webhook";
|
|
12
|
+
dataType: "string";
|
|
13
|
+
columnType: "SQLiteText";
|
|
14
|
+
data: string;
|
|
15
|
+
driverParam: string;
|
|
16
|
+
notNull: true;
|
|
17
|
+
hasDefault: true;
|
|
18
|
+
isPrimaryKey: true;
|
|
19
|
+
isAutoincrement: false;
|
|
20
|
+
hasRuntimeDefault: true;
|
|
21
|
+
enumValues: [string, ...string[]];
|
|
22
|
+
baseColumn: never;
|
|
23
|
+
identity: undefined;
|
|
24
|
+
generated: undefined;
|
|
25
|
+
}, {}, {
|
|
26
|
+
length: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
29
|
+
name: "created_at";
|
|
30
|
+
tableName: "webhook";
|
|
31
|
+
dataType: "date";
|
|
32
|
+
columnType: "SQLiteTimestamp";
|
|
33
|
+
data: Date;
|
|
34
|
+
driverParam: number;
|
|
35
|
+
notNull: true;
|
|
36
|
+
hasDefault: true;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: true;
|
|
40
|
+
enumValues: undefined;
|
|
41
|
+
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}, {}, {}>;
|
|
45
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
46
|
+
name: "updated_at";
|
|
47
|
+
tableName: "webhook";
|
|
48
|
+
dataType: "date";
|
|
49
|
+
columnType: "SQLiteTimestamp";
|
|
50
|
+
data: Date;
|
|
51
|
+
driverParam: number;
|
|
52
|
+
notNull: false;
|
|
53
|
+
hasDefault: false;
|
|
54
|
+
isPrimaryKey: false;
|
|
55
|
+
isAutoincrement: false;
|
|
56
|
+
hasRuntimeDefault: false;
|
|
57
|
+
enumValues: undefined;
|
|
58
|
+
baseColumn: never;
|
|
59
|
+
identity: undefined;
|
|
60
|
+
generated: undefined;
|
|
61
|
+
}, {}, {}>;
|
|
62
|
+
timeoutSec: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
63
|
+
name: "timeout_sec";
|
|
64
|
+
tableName: "webhook";
|
|
65
|
+
dataType: "number";
|
|
66
|
+
columnType: "SQLiteInteger";
|
|
67
|
+
data: number;
|
|
68
|
+
driverParam: number;
|
|
69
|
+
notNull: true;
|
|
70
|
+
hasDefault: true;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: undefined;
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {}>;
|
|
79
|
+
status: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
80
|
+
name: "status";
|
|
81
|
+
tableName: "webhook";
|
|
82
|
+
dataType: "string";
|
|
83
|
+
columnType: "SQLiteText";
|
|
84
|
+
data: WebhookStatus;
|
|
85
|
+
driverParam: string;
|
|
86
|
+
notNull: true;
|
|
87
|
+
hasDefault: true;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: [string, ...string[]];
|
|
92
|
+
baseColumn: never;
|
|
93
|
+
identity: undefined;
|
|
94
|
+
generated: undefined;
|
|
95
|
+
}, {}, {
|
|
96
|
+
length: number | undefined;
|
|
97
|
+
$type: WebhookStatus;
|
|
98
|
+
}>;
|
|
99
|
+
error: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
100
|
+
name: "error";
|
|
101
|
+
tableName: "webhook";
|
|
102
|
+
dataType: "string";
|
|
103
|
+
columnType: "SQLiteText";
|
|
104
|
+
data: string;
|
|
105
|
+
driverParam: string;
|
|
106
|
+
notNull: false;
|
|
107
|
+
hasDefault: false;
|
|
108
|
+
isPrimaryKey: false;
|
|
109
|
+
isAutoincrement: false;
|
|
110
|
+
hasRuntimeDefault: false;
|
|
111
|
+
enumValues: [string, ...string[]];
|
|
112
|
+
baseColumn: never;
|
|
113
|
+
identity: undefined;
|
|
114
|
+
generated: undefined;
|
|
115
|
+
}, {}, {
|
|
116
|
+
length: number | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
payload: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
119
|
+
name: "payload";
|
|
120
|
+
tableName: "webhook";
|
|
121
|
+
dataType: "string";
|
|
122
|
+
columnType: "SQLiteText";
|
|
123
|
+
data: string;
|
|
124
|
+
driverParam: string;
|
|
125
|
+
notNull: false;
|
|
126
|
+
hasDefault: false;
|
|
127
|
+
isPrimaryKey: false;
|
|
128
|
+
isAutoincrement: false;
|
|
129
|
+
hasRuntimeDefault: false;
|
|
130
|
+
enumValues: [string, ...string[]];
|
|
131
|
+
baseColumn: never;
|
|
132
|
+
identity: undefined;
|
|
133
|
+
generated: undefined;
|
|
134
|
+
}, {}, {
|
|
135
|
+
length: number | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
};
|
|
138
|
+
dialect: "sqlite";
|
|
139
|
+
}>;
|
|
140
|
+
//#endregion
|
|
141
|
+
export { webhook };
|
|
142
|
+
//# sourceMappingURL=webhook.db.d.cts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src_modules_base_base_dto = require("../base/base.dto.cjs");
|
|
3
|
+
const require_src_modules_webhook_webhook_db = require("./webhook.db.cjs");
|
|
4
|
+
//#region src/modules/webhook/webhook.dto.ts
|
|
5
|
+
const webhookSelectDTO = require_src_modules_base_base_dto.createSelectDTO(require_src_modules_webhook_webhook_db.webhook);
|
|
6
|
+
const webhookSelectSchema = webhookSelectDTO.schema;
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.webhookSelectDTO = webhookSelectDTO;
|
|
9
|
+
exports.webhookSelectSchema = webhookSelectSchema;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=webhook.dto.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.dto.cjs","names":["createSelectDTO","webhook"],"sources":["../../../../src/modules/webhook/webhook.dto.ts"],"sourcesContent":["import type { z } from \"zod\";\r\nimport { createSelectDTO } from \"../base/base.dto\";\r\nimport { webhook } from \"./webhook.db\";\r\n\r\nexport const webhookSelectDTO = createSelectDTO(webhook);\r\n\r\nexport const webhookSelectSchema = webhookSelectDTO.schema;\r\n\r\nexport type WebhookSelectOutput = z.infer<typeof webhookSelectSchema>;\r\n"],"mappings":";;;;AAIA,MAAa,mBAAmBA,kCAAAA,gBAAgBC,uCAAAA,QAAQ;AAExD,MAAa,sBAAsB,iBAAiB"}
|