@m5kdev/backend 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.mjs +13 -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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +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.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter-base.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/expression/expression-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/kysely.d.mts +38 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/file-migration-provider.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/migrator.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/binary-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/delete-from-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/expression-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/group-by-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/insert-values-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/join-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/merge-into-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/reference-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/returning-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-from-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/set-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/tuple-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/unary-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-set-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/value-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/with-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/case-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/delete-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/having-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/insert-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/join-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/merge-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/on-conflict-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/output-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/returning-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/select-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/update-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/where-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-creator.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/default-query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/noop-query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-base.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-provider.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/raw-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/sql.d.mts +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.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-add-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-drop-constraint-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-schema-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-type-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-schema-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-type-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/refresh-materialized-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/schema.d.mts +1 -0
- package/dist/src/lib/posthog.d.mts +7 -0
- package/dist/src/lib/posthog.mjs +7 -0
- package/dist/src/lib/posthog.mjs.map +1 -0
- package/dist/src/lib/sentry.d.mts +1 -0
- package/dist/src/lib/sentry.mjs +10 -0
- package/dist/src/lib/sentry.mjs.map +1 -0
- package/dist/src/modules/access/access.repository.d.mts +2352 -0
- package/dist/src/modules/access/access.repository.mjs +24 -0
- package/dist/src/modules/access/access.repository.mjs.map +1 -0
- package/dist/src/modules/access/access.service.d.mts +25 -0
- package/dist/src/modules/access/access.service.mjs +40 -0
- package/dist/src/modules/access/access.service.mjs.map +1 -0
- package/dist/src/modules/access/access.utils.d.mts +19 -0
- package/dist/src/modules/access/access.utils.mjs +21 -0
- package/dist/src/modules/access/access.utils.mjs.map +1 -0
- package/dist/src/modules/ai/ai.db.d.mts +401 -0
- package/dist/src/modules/ai/ai.db.mjs +38 -0
- package/dist/src/modules/ai/ai.db.mjs.map +1 -0
- package/dist/src/modules/ai/ai.prompt.d.mts +30 -0
- package/dist/src/modules/ai/ai.prompt.mjs +30 -0
- package/dist/src/modules/ai/ai.prompt.mjs.map +1 -0
- package/dist/src/modules/ai/ai.prompts.d.mts +10 -0
- package/dist/src/modules/ai/{ai.prompts.js → ai.prompts.mjs} +17 -15
- package/dist/src/modules/ai/ai.prompts.mjs.map +1 -0
- package/dist/src/modules/ai/ai.repository.d.mts +428 -0
- package/dist/src/modules/ai/ai.repository.mjs +23 -0
- package/dist/src/modules/ai/ai.repository.mjs.map +1 -0
- package/dist/src/modules/ai/ai.router.d.mts +1 -0
- package/dist/src/modules/ai/ai.service.d.mts +128 -0
- package/dist/src/modules/ai/ai.service.mjs +267 -0
- package/dist/src/modules/ai/ai.service.mjs.map +1 -0
- package/dist/src/modules/ai/ai.trpc.d.mts +31 -0
- package/dist/src/modules/ai/ai.trpc.mjs +17 -0
- package/dist/src/modules/ai/ai.trpc.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.d.mts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.mjs +184 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.d.mts +234 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.mjs +45 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.prompt.d.mts +7 -0
- package/dist/src/modules/ai/ideogram/{ideogram.prompt.js → ideogram.prompt.mjs} +861 -859
- package/dist/src/modules/ai/ideogram/ideogram.prompt.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.d.mts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.mjs +32 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.d.mts +14 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.mjs +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.mjs.map +1 -0
- package/dist/src/modules/auth/auth.db.d.mts +2341 -0
- package/dist/src/modules/auth/auth.db.mjs +169 -0
- package/dist/src/modules/auth/auth.db.mjs.map +1 -0
- package/dist/src/modules/auth/auth.dto.d.mts +70 -0
- package/dist/src/modules/auth/auth.dto.mjs +43 -0
- package/dist/src/modules/auth/auth.dto.mjs.map +1 -0
- package/dist/src/modules/auth/auth.lib.d.mts +4894 -0
- package/dist/src/modules/auth/auth.lib.mjs +232 -0
- package/dist/src/modules/auth/auth.lib.mjs.map +1 -0
- package/dist/src/modules/auth/auth.middleware.d.mts +619 -0
- package/dist/src/modules/auth/auth.middleware.mjs +38 -0
- package/dist/src/modules/auth/auth.middleware.mjs.map +1 -0
- package/dist/src/modules/auth/auth.repository.d.mts +2453 -0
- package/dist/src/modules/auth/auth.repository.mjs +401 -0
- package/dist/src/modules/auth/auth.repository.mjs.map +1 -0
- package/dist/src/modules/auth/auth.service.d.mts +105 -0
- package/dist/src/modules/auth/auth.service.mjs +227 -0
- package/dist/src/modules/auth/auth.service.mjs.map +1 -0
- package/dist/src/modules/auth/auth.trpc.d.mts +303 -0
- package/dist/src/modules/auth/auth.trpc.mjs +108 -0
- package/dist/src/modules/auth/auth.trpc.mjs.map +1 -0
- package/dist/src/modules/auth/auth.utils.d.mts +2356 -0
- package/dist/src/modules/auth/auth.utils.mjs +77 -0
- package/dist/src/modules/auth/auth.utils.mjs.map +1 -0
- package/dist/src/modules/base/base.abstract.d.mts +29 -0
- package/dist/src/modules/base/base.abstract.mjs +60 -0
- package/dist/src/modules/base/base.abstract.mjs.map +1 -0
- package/dist/src/modules/base/base.actor.d.mts +73 -0
- package/dist/src/modules/base/base.actor.mjs +78 -0
- package/dist/src/modules/base/base.actor.mjs.map +1 -0
- package/dist/src/modules/base/base.dto.d.mts +67 -0
- package/dist/src/modules/base/base.dto.mjs +79 -0
- package/dist/src/modules/base/base.dto.mjs.map +1 -0
- package/dist/src/modules/base/base.grants.d.mts +28 -0
- package/dist/src/modules/base/base.grants.mjs +103 -0
- package/dist/src/modules/base/base.grants.mjs.map +1 -0
- package/dist/src/modules/base/base.procedure.d.mts +111 -0
- package/dist/src/modules/base/base.procedure.mjs +252 -0
- package/dist/src/modules/base/base.procedure.mjs.map +1 -0
- package/dist/src/modules/base/base.repository.d.mts +123 -0
- package/dist/src/modules/base/base.repository.mjs +250 -0
- package/dist/src/modules/base/base.repository.mjs.map +1 -0
- package/dist/src/modules/base/base.service.d.mts +44 -0
- package/dist/src/modules/base/base.service.mjs +116 -0
- package/dist/src/modules/base/base.service.mjs.map +1 -0
- package/dist/src/modules/base/base.types.d.mts +5 -0
- package/dist/src/modules/billing/billing.db.d.mts +371 -0
- package/dist/src/modules/billing/billing.db.mjs +31 -0
- package/dist/src/modules/billing/billing.db.mjs.map +1 -0
- package/dist/src/modules/billing/billing.repository.d.mts +2787 -0
- package/dist/src/modules/billing/billing.repository.mjs +188 -0
- package/dist/src/modules/billing/billing.repository.mjs.map +1 -0
- package/dist/src/modules/billing/billing.router.d.mts +9 -0
- package/dist/src/modules/billing/billing.router.mjs +40 -0
- package/dist/src/modules/billing/billing.router.mjs.map +1 -0
- package/dist/src/modules/billing/billing.service.d.mts +53 -0
- package/dist/src/modules/billing/billing.service.mjs +125 -0
- package/dist/src/modules/billing/billing.service.mjs.map +1 -0
- package/dist/src/modules/billing/billing.trpc.d.mts +29 -0
- package/dist/src/modules/billing/billing.trpc.mjs +17 -0
- package/dist/src/modules/billing/billing.trpc.mjs.map +1 -0
- package/dist/src/modules/clay/clay.repository.d.mts +10 -0
- package/dist/src/modules/clay/clay.repository.mjs +27 -0
- package/dist/src/modules/clay/clay.repository.mjs.map +1 -0
- package/dist/src/modules/clay/clay.service.d.mts +32 -0
- package/dist/src/modules/clay/clay.service.mjs +23 -0
- package/dist/src/modules/clay/clay.service.mjs.map +1 -0
- package/dist/src/modules/connect/connect.db.d.mts +362 -0
- package/dist/src/modules/connect/connect.db.mjs +30 -0
- package/dist/src/modules/connect/connect.db.mjs.map +1 -0
- package/dist/src/modules/connect/connect.dto.d.mts +79 -0
- package/dist/src/modules/connect/connect.dto.mjs +38 -0
- package/dist/src/modules/connect/connect.dto.mjs.map +1 -0
- package/dist/src/modules/connect/connect.linkedin.d.mts +7 -0
- package/dist/src/modules/connect/connect.linkedin.mjs +47 -0
- package/dist/src/modules/connect/connect.linkedin.mjs.map +1 -0
- package/dist/src/modules/connect/connect.oauth.d.mts +32 -0
- package/dist/src/modules/connect/connect.oauth.mjs +145 -0
- package/dist/src/modules/connect/connect.oauth.mjs.map +1 -0
- package/dist/src/modules/connect/connect.repository.d.mts +419 -0
- package/dist/src/modules/connect/connect.repository.mjs +40 -0
- package/dist/src/modules/connect/connect.repository.mjs.map +1 -0
- package/dist/src/modules/connect/connect.router.d.mts +9 -0
- package/dist/src/modules/connect/connect.router.mjs +46 -0
- package/dist/src/modules/connect/connect.router.mjs.map +1 -0
- package/dist/src/modules/connect/connect.service.d.mts +103 -0
- package/dist/src/modules/connect/connect.service.mjs +88 -0
- package/dist/src/modules/connect/connect.service.mjs.map +1 -0
- package/dist/src/modules/connect/connect.trpc.d.mts +53 -0
- package/dist/src/modules/connect/connect.trpc.mjs +17 -0
- package/dist/src/modules/connect/connect.trpc.mjs.map +1 -0
- package/dist/src/modules/connect/connect.types.d.mts +29 -0
- package/dist/src/modules/crypto/crypto.db.d.mts +157 -0
- package/dist/src/modules/crypto/crypto.db.mjs +19 -0
- package/dist/src/modules/crypto/crypto.db.mjs.map +1 -0
- package/dist/src/modules/crypto/crypto.repository.d.mts +163 -0
- package/dist/src/modules/crypto/crypto.repository.mjs +9 -0
- package/dist/src/modules/crypto/crypto.repository.mjs.map +1 -0
- package/dist/src/modules/crypto/crypto.service.d.mts +15 -0
- package/dist/src/modules/crypto/crypto.service.mjs +40 -0
- package/dist/src/modules/crypto/crypto.service.mjs.map +1 -0
- package/dist/src/modules/email/email.service.d.mts +62 -0
- package/dist/src/modules/email/email.service.mjs +105 -0
- package/dist/src/modules/email/email.service.mjs.map +1 -0
- package/dist/src/modules/file/file.repository.d.mts +17 -0
- package/dist/src/modules/file/file.repository.mjs +72 -0
- package/dist/src/modules/file/file.repository.mjs.map +1 -0
- package/dist/src/modules/file/{file.router.d.ts → file.router.d.mts} +4 -0
- package/dist/src/modules/file/file.router.mjs +88 -0
- package/dist/src/modules/file/file.router.mjs.map +1 -0
- package/dist/src/modules/file/file.service.d.mts +30 -0
- package/dist/src/modules/file/file.service.mjs +117 -0
- package/dist/src/modules/file/file.service.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.db.d.mts +568 -0
- package/dist/src/modules/recurrence/recurrence.db.mjs +47 -0
- package/dist/src/modules/recurrence/recurrence.db.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.repository.d.mts +588 -0
- package/dist/src/modules/recurrence/recurrence.repository.mjs +28 -0
- package/dist/src/modules/recurrence/recurrence.repository.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.service.d.mts +51 -0
- package/dist/src/modules/recurrence/recurrence.service.mjs +64 -0
- package/dist/src/modules/recurrence/recurrence.service.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.trpc.d.mts +65 -0
- package/dist/src/modules/recurrence/recurrence.trpc.mjs +44 -0
- package/dist/src/modules/recurrence/recurrence.trpc.mjs.map +1 -0
- package/dist/src/modules/social/social.dto.d.mts +39 -0
- package/dist/src/modules/social/social.dto.mjs +22 -0
- package/dist/src/modules/social/social.dto.mjs.map +1 -0
- package/dist/src/modules/social/{social.linkedin.d.ts → social.linkedin.d.mts} +8 -3
- package/dist/src/modules/social/social.linkedin.mjs +346 -0
- package/dist/src/modules/social/social.linkedin.mjs.map +1 -0
- package/dist/src/modules/social/social.service.d.mts +34 -0
- package/dist/src/modules/social/social.service.mjs +55 -0
- package/dist/src/modules/social/social.service.mjs.map +1 -0
- package/dist/src/modules/social/social.types.d.mts +40 -0
- package/dist/src/modules/tag/tag.db.d.mts +352 -0
- package/dist/src/modules/tag/tag.db.mjs +35 -0
- package/dist/src/modules/tag/tag.db.mjs.map +1 -0
- package/dist/src/modules/tag/tag.dto.d.mts +1025 -0
- package/dist/src/modules/tag/tag.dto.mjs +11 -0
- package/dist/src/modules/tag/tag.dto.mjs.map +1 -0
- package/dist/src/modules/tag/tag.repository.d.mts +394 -0
- package/dist/src/modules/tag/tag.repository.mjs +114 -0
- package/dist/src/modules/tag/tag.repository.mjs.map +1 -0
- package/dist/src/modules/tag/tag.service.d.mts +93 -0
- package/dist/src/modules/tag/tag.service.mjs +47 -0
- package/dist/src/modules/tag/tag.service.mjs.map +1 -0
- package/dist/src/modules/tag/tag.trpc.d.mts +109 -0
- package/dist/src/modules/tag/tag.trpc.mjs +30 -0
- package/dist/src/modules/tag/tag.trpc.mjs.map +1 -0
- package/dist/src/modules/utils/{applyPagination.d.ts → applyPagination.d.mts} +5 -1
- package/dist/src/modules/utils/applyPagination.mjs +15 -0
- package/dist/src/modules/utils/applyPagination.mjs.map +1 -0
- package/dist/src/modules/utils/applySorting.d.mts +13 -0
- package/dist/src/modules/utils/applySorting.mjs +18 -0
- package/dist/src/modules/utils/applySorting.mjs.map +1 -0
- package/dist/src/modules/utils/getConditionsFromFilters.d.mts +9 -0
- package/dist/src/modules/utils/getConditionsFromFilters.mjs +150 -0
- package/dist/src/modules/utils/getConditionsFromFilters.mjs.map +1 -0
- package/dist/src/modules/video/video.service.d.mts +12 -0
- package/dist/src/modules/video/video.service.mjs +50 -0
- package/dist/src/modules/video/video.service.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.constants.d.mts +12 -0
- package/dist/src/modules/webhook/webhook.constants.mjs +12 -0
- package/dist/src/modules/webhook/webhook.constants.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.db.d.mts +142 -0
- package/dist/src/modules/webhook/webhook.db.mjs +17 -0
- package/dist/src/modules/webhook/webhook.db.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.dto.d.mts +402 -0
- package/dist/src/modules/webhook/webhook.dto.mjs +9 -0
- package/dist/src/modules/webhook/webhook.dto.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.repository.d.mts +154 -0
- package/dist/src/modules/webhook/webhook.repository.mjs +50 -0
- package/dist/src/modules/webhook/webhook.repository.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.router.d.mts +8 -0
- package/dist/src/modules/webhook/webhook.router.mjs +23 -0
- package/dist/src/modules/webhook/webhook.router.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.service.d.mts +14 -0
- package/dist/src/modules/webhook/webhook.service.mjs +59 -0
- package/dist/src/modules/webhook/webhook.service.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.db.d.mts +302 -0
- package/dist/src/modules/workflow/workflow.db.mjs +28 -0
- package/dist/src/modules/workflow/workflow.db.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.repository.d.mts +371 -0
- package/dist/src/modules/workflow/workflow.repository.mjs +93 -0
- package/dist/src/modules/workflow/workflow.repository.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.service.d.mts +31 -0
- package/dist/src/modules/workflow/workflow.service.mjs +40 -0
- package/dist/src/modules/workflow/workflow.service.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.trpc.d.mts +28 -0
- package/dist/src/modules/workflow/workflow.trpc.mjs +17 -0
- package/dist/src/modules/workflow/workflow.trpc.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.types.d.mts +25 -0
- package/dist/src/modules/workflow/workflow.utils.d.mts +36 -0
- package/dist/src/modules/workflow/workflow.utils.mjs +181 -0
- package/dist/src/modules/workflow/workflow.utils.mjs.map +1 -0
- package/dist/src/types.d.mts +346 -0
- package/dist/src/types.mjs +13 -0
- package/dist/src/types.mjs.map +1 -0
- package/dist/src/utils/errors.d.mts +62 -0
- package/dist/src/utils/errors.mjs +96 -0
- package/dist/src/utils/errors.mjs.map +1 -0
- package/dist/src/utils/logger.d.mts +7 -0
- package/dist/src/utils/logger.mjs +10 -0
- package/dist/src/utils/logger.mjs.map +1 -0
- package/dist/src/utils/posthog.d.mts +17 -0
- package/dist/src/utils/posthog.mjs +25 -0
- package/dist/src/utils/posthog.mjs.map +1 -0
- package/dist/src/utils/trpc.d.mts +54 -0
- package/dist/src/utils/trpc.mjs +146 -0
- package/dist/src/utils/trpc.mjs.map +1 -0
- package/dist/src/utils/types.d.mts +9 -0
- package/package.json +5 -4
- package/dist/src/lib/posthog.d.ts +0 -2
- package/dist/src/lib/posthog.js +0 -7
- package/dist/src/lib/sentry.js +0 -9
- package/dist/src/modules/access/access.repository.d.ts +0 -2347
- package/dist/src/modules/access/access.repository.js +0 -32
- package/dist/src/modules/access/access.service.d.ts +0 -21
- package/dist/src/modules/access/access.service.js +0 -51
- package/dist/src/modules/access/access.test.js +0 -182
- package/dist/src/modules/access/access.utils.d.ts +0 -16
- package/dist/src/modules/access/access.utils.js +0 -20
- package/dist/src/modules/ai/ai.db.d.ts +0 -395
- package/dist/src/modules/ai/ai.db.js +0 -39
- package/dist/src/modules/ai/ai.prompt.d.ts +0 -26
- package/dist/src/modules/ai/ai.prompt.js +0 -30
- package/dist/src/modules/ai/ai.prompts.d.ts +0 -5
- package/dist/src/modules/ai/ai.repository.d.ts +0 -423
- package/dist/src/modules/ai/ai.repository.js +0 -26
- package/dist/src/modules/ai/ai.router.js +0 -132
- package/dist/src/modules/ai/ai.service.d.ts +0 -127
- package/dist/src/modules/ai/ai.service.js +0 -297
- package/dist/src/modules/ai/ai.trpc.d.ts +0 -22
- package/dist/src/modules/ai/ai.trpc.js +0 -20
- package/dist/src/modules/ai/ideogram/ideogram.constants.d.ts +0 -7
- package/dist/src/modules/ai/ideogram/ideogram.constants.js +0 -167
- package/dist/src/modules/ai/ideogram/ideogram.dto.d.ts +0 -229
- package/dist/src/modules/ai/ideogram/ideogram.dto.js +0 -49
- package/dist/src/modules/ai/ideogram/ideogram.prompt.d.ts +0 -2
- package/dist/src/modules/ai/ideogram/ideogram.repository.d.ts +0 -6
- package/dist/src/modules/ai/ideogram/ideogram.repository.js +0 -46
- package/dist/src/modules/ai/ideogram/ideogram.service.d.ts +0 -9
- package/dist/src/modules/ai/ideogram/ideogram.service.js +0 -11
- package/dist/src/modules/auth/auth.db.d.ts +0 -2335
- package/dist/src/modules/auth/auth.db.js +0 -215
- package/dist/src/modules/auth/auth.dto.d.ts +0 -65
- package/dist/src/modules/auth/auth.dto.js +0 -38
- package/dist/src/modules/auth/auth.lib.d.ts +0 -4873
- package/dist/src/modules/auth/auth.lib.js +0 -284
- package/dist/src/modules/auth/auth.middleware.d.ts +0 -614
- package/dist/src/modules/auth/auth.middleware.js +0 -52
- package/dist/src/modules/auth/auth.repository.d.ts +0 -2421
- package/dist/src/modules/auth/auth.repository.js +0 -636
- package/dist/src/modules/auth/auth.service.d.ts +0 -108
- package/dist/src/modules/auth/auth.service.js +0 -246
- package/dist/src/modules/auth/auth.trpc.d.ts +0 -292
- package/dist/src/modules/auth/auth.trpc.js +0 -179
- package/dist/src/modules/auth/auth.utils.d.ts +0 -2351
- package/dist/src/modules/auth/auth.utils.js +0 -97
- package/dist/src/modules/base/base.abstract.d.ts +0 -19
- package/dist/src/modules/base/base.abstract.js +0 -62
- package/dist/src/modules/base/base.dto.d.ts +0 -69
- package/dist/src/modules/base/base.dto.js +0 -112
- package/dist/src/modules/base/base.grants.d.ts +0 -28
- package/dist/src/modules/base/base.grants.js +0 -123
- package/dist/src/modules/base/base.grants.test.js +0 -668
- package/dist/src/modules/base/base.procedure.d.ts +0 -112
- package/dist/src/modules/base/base.procedure.js +0 -289
- package/dist/src/modules/base/base.repository.d.ts +0 -97
- package/dist/src/modules/base/base.repository.js +0 -317
- package/dist/src/modules/base/base.service.d.ts +0 -52
- package/dist/src/modules/base/base.service.js +0 -116
- package/dist/src/modules/base/base.service.test.js +0 -415
- package/dist/src/modules/base/base.types.d.ts +0 -1
- package/dist/src/modules/base/base.types.js +0 -2
- package/dist/src/modules/billing/billing.db.d.ts +0 -365
- package/dist/src/modules/billing/billing.db.js +0 -29
- package/dist/src/modules/billing/billing.repository.d.ts +0 -2763
- package/dist/src/modules/billing/billing.repository.js +0 -235
- package/dist/src/modules/billing/billing.router.d.ts +0 -4
- package/dist/src/modules/billing/billing.router.js +0 -56
- package/dist/src/modules/billing/billing.service.d.ts +0 -59
- package/dist/src/modules/billing/billing.service.js +0 -147
- package/dist/src/modules/billing/billing.trpc.d.ts +0 -38
- package/dist/src/modules/billing/billing.trpc.js +0 -17
- package/dist/src/modules/clay/clay.repository.d.ts +0 -5
- package/dist/src/modules/clay/clay.repository.js +0 -26
- package/dist/src/modules/clay/clay.service.d.ts +0 -28
- package/dist/src/modules/clay/clay.service.js +0 -24
- package/dist/src/modules/connect/connect.db.d.ts +0 -356
- package/dist/src/modules/connect/connect.db.js +0 -30
- package/dist/src/modules/connect/connect.dto.d.ts +0 -74
- package/dist/src/modules/connect/connect.dto.js +0 -36
- package/dist/src/modules/connect/connect.linkedin.d.ts +0 -2
- package/dist/src/modules/connect/connect.linkedin.js +0 -53
- package/dist/src/modules/connect/connect.oauth.d.ts +0 -27
- package/dist/src/modules/connect/connect.oauth.js +0 -198
- package/dist/src/modules/connect/connect.repository.d.ts +0 -413
- package/dist/src/modules/connect/connect.repository.js +0 -54
- package/dist/src/modules/connect/connect.router.d.ts +0 -4
- package/dist/src/modules/connect/connect.router.js +0 -54
- package/dist/src/modules/connect/connect.service.d.ts +0 -88
- package/dist/src/modules/connect/connect.service.js +0 -114
- package/dist/src/modules/connect/connect.trpc.d.ts +0 -44
- package/dist/src/modules/connect/connect.trpc.js +0 -21
- package/dist/src/modules/connect/connect.types.d.ts +0 -25
- package/dist/src/modules/connect/connect.types.js +0 -2
- package/dist/src/modules/crypto/crypto.db.d.ts +0 -151
- package/dist/src/modules/crypto/crypto.db.js +0 -17
- package/dist/src/modules/crypto/crypto.repository.d.ts +0 -159
- package/dist/src/modules/crypto/crypto.repository.js +0 -10
- package/dist/src/modules/crypto/crypto.service.d.ts +0 -10
- package/dist/src/modules/crypto/crypto.service.js +0 -52
- package/dist/src/modules/email/email.service.d.ts +0 -56
- package/dist/src/modules/email/email.service.js +0 -106
- package/dist/src/modules/file/file.repository.d.ts +0 -12
- package/dist/src/modules/file/file.repository.js +0 -79
- package/dist/src/modules/file/file.router.js +0 -99
- package/dist/src/modules/file/file.service.d.ts +0 -24
- package/dist/src/modules/file/file.service.js +0 -150
- package/dist/src/modules/recurrence/recurrence.db.d.ts +0 -562
- package/dist/src/modules/recurrence/recurrence.db.js +0 -66
- package/dist/src/modules/recurrence/recurrence.repository.d.ts +0 -584
- package/dist/src/modules/recurrence/recurrence.repository.js +0 -39
- package/dist/src/modules/recurrence/recurrence.service.d.ts +0 -50
- package/dist/src/modules/recurrence/recurrence.service.js +0 -69
- package/dist/src/modules/recurrence/recurrence.trpc.d.ts +0 -206
- package/dist/src/modules/recurrence/recurrence.trpc.js +0 -65
- package/dist/src/modules/social/social.dto.d.ts +0 -34
- package/dist/src/modules/social/social.dto.js +0 -18
- package/dist/src/modules/social/social.linkedin.js +0 -427
- package/dist/src/modules/social/social.linkedin.test.js +0 -235
- package/dist/src/modules/social/social.service.d.ts +0 -28
- package/dist/src/modules/social/social.service.js +0 -76
- package/dist/src/modules/social/social.types.d.ts +0 -35
- package/dist/src/modules/social/social.types.js +0 -2
- package/dist/src/modules/tag/tag.db.d.ts +0 -346
- package/dist/src/modules/tag/tag.db.js +0 -42
- package/dist/src/modules/tag/tag.dto.d.ts +0 -1018
- package/dist/src/modules/tag/tag.dto.js +0 -9
- package/dist/src/modules/tag/tag.repository.d.ts +0 -383
- package/dist/src/modules/tag/tag.repository.js +0 -156
- package/dist/src/modules/tag/tag.service.d.ts +0 -109
- package/dist/src/modules/tag/tag.service.js +0 -42
- package/dist/src/modules/tag/tag.trpc.d.ts +0 -164
- package/dist/src/modules/tag/tag.trpc.js +0 -53
- package/dist/src/modules/utils/applyPagination.js +0 -16
- package/dist/src/modules/utils/applySorting.d.ts +0 -8
- package/dist/src/modules/utils/applySorting.js +0 -18
- package/dist/src/modules/utils/getConditionsFromFilters.d.ts +0 -4
- package/dist/src/modules/utils/getConditionsFromFilters.js +0 -200
- package/dist/src/modules/video/video.service.d.ts +0 -7
- package/dist/src/modules/video/video.service.js +0 -84
- package/dist/src/modules/webhook/webhook.constants.d.ts +0 -8
- package/dist/src/modules/webhook/webhook.constants.js +0 -10
- package/dist/src/modules/webhook/webhook.db.d.ts +0 -136
- package/dist/src/modules/webhook/webhook.db.js +0 -17
- package/dist/src/modules/webhook/webhook.dto.d.ts +0 -394
- package/dist/src/modules/webhook/webhook.dto.js +0 -7
- package/dist/src/modules/webhook/webhook.repository.d.ts +0 -148
- package/dist/src/modules/webhook/webhook.repository.js +0 -56
- package/dist/src/modules/webhook/webhook.router.d.ts +0 -3
- package/dist/src/modules/webhook/webhook.router.js +0 -30
- package/dist/src/modules/webhook/webhook.service.d.ts +0 -9
- package/dist/src/modules/webhook/webhook.service.js +0 -68
- package/dist/src/modules/workflow/workflow.db.d.ts +0 -296
- package/dist/src/modules/workflow/workflow.db.js +0 -30
- package/dist/src/modules/workflow/workflow.repository.d.ts +0 -343
- package/dist/src/modules/workflow/workflow.repository.js +0 -105
- package/dist/src/modules/workflow/workflow.service.d.ts +0 -21
- package/dist/src/modules/workflow/workflow.service.js +0 -37
- package/dist/src/modules/workflow/workflow.trpc.d.ts +0 -56
- package/dist/src/modules/workflow/workflow.trpc.js +0 -21
- package/dist/src/modules/workflow/workflow.types.d.ts +0 -20
- package/dist/src/modules/workflow/workflow.types.js +0 -2
- package/dist/src/modules/workflow/workflow.utils.d.ts +0 -21
- package/dist/src/modules/workflow/workflow.utils.js +0 -173
- package/dist/src/test/stubs/utils.d.ts +0 -2
- package/dist/src/test/stubs/utils.js +0 -5
- package/dist/src/trpc/context.d.ts +0 -41
- package/dist/src/trpc/context.js +0 -17
- package/dist/src/trpc/index.d.ts +0 -3
- package/dist/src/trpc/index.js +0 -6
- package/dist/src/trpc/procedures.d.ts +0 -233
- package/dist/src/trpc/procedures.js +0 -32
- package/dist/src/trpc/utils.d.ts +0 -4
- package/dist/src/trpc/utils.js +0 -20
- package/dist/src/types.d.ts +0 -358
- package/dist/src/types.js +0 -12
- package/dist/src/utils/errors.d.ts +0 -49
- package/dist/src/utils/errors.js +0 -104
- package/dist/src/utils/logger.d.ts +0 -1
- package/dist/src/utils/logger.js +0 -11
- package/dist/src/utils/posthog.d.ts +0 -13
- package/dist/src/utils/posthog.js +0 -31
- package/dist/src/utils/trpc.d.ts +0 -58
- package/dist/src/utils/trpc.js +0 -63
- package/dist/src/utils/types.d.ts +0 -4
- package/dist/src/utils/types.js +0 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/src/{lib/sentry.d.ts → modules/ai/ai.router.mjs} +0 -0
- /package/dist/src/modules/{access/access.test.d.ts → base/base.types.mjs} +0 -0
- /package/dist/src/modules/{ai/ai.router.d.ts → connect/connect.types.mjs} +0 -0
- /package/dist/src/modules/{base/base.grants.test.d.ts → social/social.types.mjs} +0 -0
- /package/dist/src/modules/{base/base.service.test.d.ts → workflow/workflow.types.mjs} +0 -0
- /package/dist/src/{modules/social/social.linkedin.test.d.ts → utils/types.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.service.mjs","names":[],"sources":["../../../../src/modules/tag/tag.service.ts"],"sourcesContent":["import type {\r\n TagCreateSchema,\r\n TagDeleteSchema,\r\n TagLinkSchema,\r\n TagListInputSchema,\r\n TagListOutputSchema,\r\n TagListSchema,\r\n TagSchema,\r\n TagUpdateSchema,\r\n} from \"@m5kdev/commons/modules/tag/tag.schema\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseService } from \"../base/base.service\";\r\nimport type { TaggingSelectOutputResult, TagSelectOutputResult } from \"./tag.dto\";\r\nimport type { TagRepository } from \"./tag.repository\";\r\n\r\nexport class TagService extends BaseService<{ tag: TagRepository }, Record<string, never>> {\r\n async list(input: TagListInputSchema & TagListSchema): ServerResultAsync<TagListOutputSchema> {\r\n return this.repository.tag.list(input);\r\n }\r\n\r\n async listTaggings(input: { resourceType: string; resourceIds?: readonly string[] }) {\r\n return this.repository.tag.listTaggings(input);\r\n }\r\n\r\n readonly create = this.procedure<TagCreateSchema>(\"create\")\r\n .requireAuth()\r\n .handle(({ input, ctx }): Promise<TagSelectOutputResult> => {\r\n return this.repository.tag.create({ ...input, userId: ctx.actor.userId });\r\n });\r\n\r\n readonly update = this.procedure<TagUpdateSchema>(\"update\")\r\n .requireAuth()\r\n .handle(({ input, ctx }): Promise<TagSelectOutputResult> => {\r\n return this.repository.tag.update({ ...input, userId: ctx.actor.userId });\r\n });\r\n\r\n readonly link = this.procedure<TagLinkSchema>(\"link\")\r\n .requireAuth()\r\n .handle(({ input, ctx }): Promise<TaggingSelectOutputResult> => {\r\n return this.repository.tag.link({ ...input, userId: ctx.actor.userId });\r\n });\r\n\r\n async linkBulk(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]> {\r\n return this.repository.tag.linkBulk(data);\r\n }\r\n\r\n async set(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]> {\r\n return this.repository.tag.set(data);\r\n }\r\n\r\n readonly unlink = this.procedure<TagLinkSchema>(\"unlink\")\r\n .requireAuth()\r\n .handle(({ input, ctx }): Promise<TagSelectOutputResult> => {\r\n return this.repository.tag.unlink({ ...input, userId: ctx.actor.userId });\r\n });\r\n\r\n async delete(data: TagDeleteSchema): ServerResultAsync<{ id: string }> {\r\n return this.repository.tag.softDeleteById(data.id);\r\n }\r\n}\r\n"],"mappings":";;AAeA,IAAa,aAAb,cAAgC,YAA2D;CACzF,MAAM,KAAK,OAAmF;AAC5F,SAAO,KAAK,WAAW,IAAI,KAAK,MAAM;;CAGxC,MAAM,aAAa,OAAkE;AACnF,SAAO,KAAK,WAAW,IAAI,aAAa,MAAM;;CAGhD,SAAkB,KAAK,UAA2B,SAAS,CACxD,aAAa,CACb,QAAQ,EAAE,OAAO,UAA0C;AAC1D,SAAO,KAAK,WAAW,IAAI,OAAO;GAAE,GAAG;GAAO,QAAQ,IAAI,MAAM;GAAQ,CAAC;GACzE;CAEJ,SAAkB,KAAK,UAA2B,SAAS,CACxD,aAAa,CACb,QAAQ,EAAE,OAAO,UAA0C;AAC1D,SAAO,KAAK,WAAW,IAAI,OAAO;GAAE,GAAG;GAAO,QAAQ,IAAI,MAAM;GAAQ,CAAC;GACzE;CAEJ,OAAgB,KAAK,UAAyB,OAAO,CAClD,aAAa,CACb,QAAQ,EAAE,OAAO,UAA8C;AAC9D,SAAO,KAAK,WAAW,IAAI,KAAK;GAAE,GAAG;GAAO,QAAQ,IAAI,MAAM;GAAQ,CAAC;GACvE;CAEJ,MAAM,SAAS,MAAuD;AACpE,SAAO,KAAK,WAAW,IAAI,SAAS,KAAK;;CAG3C,MAAM,IAAI,MAAuD;AAC/D,SAAO,KAAK,WAAW,IAAI,IAAI,KAAK;;CAGtC,SAAkB,KAAK,UAAyB,SAAS,CACtD,aAAa,CACb,QAAQ,EAAE,OAAO,UAA0C;AAC1D,SAAO,KAAK,WAAW,IAAI,OAAO;GAAE,GAAG;GAAO,QAAQ,IAAI,MAAM;GAAQ,CAAC;GACzE;CAEJ,MAAM,OAAO,MAA0D;AACrE,SAAO,KAAK,WAAW,IAAI,eAAe,KAAK,GAAG"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Context, TRPCMethods } from "../../utils/trpc.mjs";
|
|
2
|
+
import { TagService } from "./tag.service.mjs";
|
|
3
|
+
import * as _$_trpc_server0 from "@trpc/server";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/tag/tag.trpc.d.ts
|
|
6
|
+
declare function createTagTRPC({
|
|
7
|
+
router,
|
|
8
|
+
privateProcedure: procedure
|
|
9
|
+
}: TRPCMethods, tagService: TagService): _$_trpc_server0.TRPCBuiltRouter<{
|
|
10
|
+
ctx: Context;
|
|
11
|
+
meta: any;
|
|
12
|
+
errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
|
|
13
|
+
transformer: any;
|
|
14
|
+
}, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
|
|
15
|
+
list: _$_trpc_server0.TRPCQueryProcedure<{
|
|
16
|
+
input: any;
|
|
17
|
+
output: any;
|
|
18
|
+
meta: any;
|
|
19
|
+
}>;
|
|
20
|
+
listTaggings: _$_trpc_server0.TRPCQueryProcedure<{
|
|
21
|
+
input: any;
|
|
22
|
+
output: {
|
|
23
|
+
id: string;
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
tagId: string;
|
|
26
|
+
resourceType: string;
|
|
27
|
+
resourceId: string;
|
|
28
|
+
}[];
|
|
29
|
+
meta: any;
|
|
30
|
+
}>;
|
|
31
|
+
create: _$_trpc_server0.TRPCMutationProcedure<{
|
|
32
|
+
input: any;
|
|
33
|
+
output: {
|
|
34
|
+
id: string;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date | null;
|
|
37
|
+
deletedAt: Date | null;
|
|
38
|
+
userId: string;
|
|
39
|
+
organizationId: string | null;
|
|
40
|
+
teamId: string | null;
|
|
41
|
+
name: string;
|
|
42
|
+
color: string | null;
|
|
43
|
+
type: string | null;
|
|
44
|
+
isEnabled: boolean;
|
|
45
|
+
parentId: string | null;
|
|
46
|
+
assignableTo: string[];
|
|
47
|
+
};
|
|
48
|
+
meta: any;
|
|
49
|
+
}>;
|
|
50
|
+
update: _$_trpc_server0.TRPCMutationProcedure<{
|
|
51
|
+
input: any;
|
|
52
|
+
output: {
|
|
53
|
+
id: string;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date | null;
|
|
56
|
+
deletedAt: Date | null;
|
|
57
|
+
userId: string;
|
|
58
|
+
organizationId: string | null;
|
|
59
|
+
teamId: string | null;
|
|
60
|
+
name: string;
|
|
61
|
+
color: string | null;
|
|
62
|
+
type: string | null;
|
|
63
|
+
isEnabled: boolean;
|
|
64
|
+
parentId: string | null;
|
|
65
|
+
assignableTo: string[];
|
|
66
|
+
};
|
|
67
|
+
meta: any;
|
|
68
|
+
}>;
|
|
69
|
+
link: _$_trpc_server0.TRPCMutationProcedure<{
|
|
70
|
+
input: any;
|
|
71
|
+
output: {
|
|
72
|
+
id: string;
|
|
73
|
+
createdAt: Date;
|
|
74
|
+
tagId: string;
|
|
75
|
+
resourceType: string;
|
|
76
|
+
resourceId: string;
|
|
77
|
+
};
|
|
78
|
+
meta: any;
|
|
79
|
+
}>;
|
|
80
|
+
unlink: _$_trpc_server0.TRPCMutationProcedure<{
|
|
81
|
+
input: any;
|
|
82
|
+
output: {
|
|
83
|
+
id: string;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
updatedAt: Date | null;
|
|
86
|
+
deletedAt: Date | null;
|
|
87
|
+
userId: string;
|
|
88
|
+
organizationId: string | null;
|
|
89
|
+
teamId: string | null;
|
|
90
|
+
name: string;
|
|
91
|
+
color: string | null;
|
|
92
|
+
type: string | null;
|
|
93
|
+
isEnabled: boolean;
|
|
94
|
+
parentId: string | null;
|
|
95
|
+
assignableTo: string[];
|
|
96
|
+
};
|
|
97
|
+
meta: any;
|
|
98
|
+
}>;
|
|
99
|
+
delete: _$_trpc_server0.TRPCMutationProcedure<{
|
|
100
|
+
input: any;
|
|
101
|
+
output: {
|
|
102
|
+
id: string;
|
|
103
|
+
};
|
|
104
|
+
meta: any;
|
|
105
|
+
}>;
|
|
106
|
+
}>>;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { createTagTRPC };
|
|
109
|
+
//# sourceMappingURL=tag.trpc.d.mts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { handleTRPCResult } from "../../utils/trpc.mjs";
|
|
2
|
+
import { taggingsSelectOutput, tagsSelectOutput } from "./tag.dto.mjs";
|
|
3
|
+
import { tagCreateSchema, tagDeleteSchema, tagLinkSchema, tagListInputSchema, tagListOutputSchema, tagListSchema, tagUpdateSchema, taggingSchema } from "@m5kdev/commons/modules/tag/tag.schema";
|
|
4
|
+
//#region src/modules/tag/tag.trpc.ts
|
|
5
|
+
function createTagTRPC({ router, privateProcedure: procedure }, tagService) {
|
|
6
|
+
const tagListInput = tagListInputSchema.extend({ assignableTo: tagListSchema.shape.assignableTo });
|
|
7
|
+
return router({
|
|
8
|
+
list: procedure.input(tagListInput).output(tagListOutputSchema).query(async ({ input }) => handleTRPCResult(await tagService.list(input))),
|
|
9
|
+
listTaggings: procedure.input(taggingSchema.pick({ resourceType: true }).extend({ resourceIds: tagListInputSchema.shape.filters.optional() })).output(taggingsSelectOutput.array()).query(async ({ input }) => handleTRPCResult(await tagService.listTaggings(input))),
|
|
10
|
+
create: procedure.input(tagCreateSchema).output(tagsSelectOutput).mutation(async ({ ctx, input }) => {
|
|
11
|
+
return handleTRPCResult(await tagService.create(input, ctx));
|
|
12
|
+
}),
|
|
13
|
+
update: procedure.input(tagUpdateSchema).output(tagsSelectOutput).mutation(async ({ ctx, input }) => {
|
|
14
|
+
return handleTRPCResult(await tagService.update(input, ctx));
|
|
15
|
+
}),
|
|
16
|
+
link: procedure.input(tagLinkSchema).output(taggingsSelectOutput).mutation(async ({ ctx, input }) => {
|
|
17
|
+
return handleTRPCResult(await tagService.link(input, ctx));
|
|
18
|
+
}),
|
|
19
|
+
unlink: procedure.input(tagLinkSchema).output(tagsSelectOutput).mutation(async ({ ctx, input }) => {
|
|
20
|
+
return handleTRPCResult(await tagService.unlink(input, ctx));
|
|
21
|
+
}),
|
|
22
|
+
delete: procedure.input(tagDeleteSchema).output(tagsSelectOutput.pick({ id: true })).mutation(async ({ input }) => {
|
|
23
|
+
return handleTRPCResult(await tagService.delete(input));
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { createTagTRPC };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=tag.trpc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.trpc.mjs","names":[],"sources":["../../../../src/modules/tag/tag.trpc.ts"],"sourcesContent":["import {\r\n tagCreateSchema,\r\n tagDeleteSchema,\r\n taggingSchema,\r\n tagLinkSchema,\r\n tagListInputSchema,\r\n tagListOutputSchema,\r\n tagListSchema,\r\n tagUpdateSchema,\r\n} from \"@m5kdev/commons/modules/tag/tag.schema\";\r\nimport { handleTRPCResult, type TRPCMethods } from \"../../utils/trpc\";\r\nimport { taggingsSelectOutput, tagsSelectOutput } from \"./tag.dto\";\r\nimport type { TagService } from \"./tag.service\";\r\n\r\nexport function createTagTRPC(\r\n { router, privateProcedure: procedure }: TRPCMethods,\r\n tagService: TagService\r\n) {\r\n const tagListInput = tagListInputSchema.extend({\r\n assignableTo: tagListSchema.shape.assignableTo,\r\n });\r\n\r\n return router({\r\n list: procedure\r\n .input(tagListInput)\r\n .output(tagListOutputSchema)\r\n .query(async ({ input }) => handleTRPCResult(await tagService.list(input))),\r\n\r\n listTaggings: procedure\r\n .input(\r\n taggingSchema\r\n .pick({ resourceType: true })\r\n .extend({ resourceIds: tagListInputSchema.shape.filters.optional() })\r\n )\r\n .output(taggingsSelectOutput.array())\r\n .query(async ({ input }) => handleTRPCResult(await tagService.listTaggings(input as any))),\r\n\r\n create: procedure\r\n .input(tagCreateSchema)\r\n .output(tagsSelectOutput)\r\n .mutation(async ({ ctx, input }) => {\r\n return handleTRPCResult(await tagService.create(input, ctx));\r\n }),\r\n\r\n update: procedure\r\n .input(tagUpdateSchema)\r\n .output(tagsSelectOutput)\r\n .mutation(async ({ ctx, input }) => {\r\n return handleTRPCResult(await tagService.update(input, ctx));\r\n }),\r\n\r\n link: procedure\r\n .input(tagLinkSchema)\r\n .output(taggingsSelectOutput)\r\n .mutation(async ({ ctx, input }) => {\r\n return handleTRPCResult(await tagService.link(input, ctx));\r\n }),\r\n\r\n unlink: procedure\r\n .input(tagLinkSchema)\r\n .output(tagsSelectOutput)\r\n .mutation(async ({ ctx, input }) => {\r\n return handleTRPCResult(await tagService.unlink(input, ctx));\r\n }),\r\n\r\n delete: procedure\r\n .input(tagDeleteSchema)\r\n .output(tagsSelectOutput.pick({ id: true }))\r\n .mutation(async ({ input }) => {\r\n return handleTRPCResult(await tagService.delete(input));\r\n }),\r\n });\r\n}\r\n"],"mappings":";;;;AAcA,SAAgB,cACd,EAAE,QAAQ,kBAAkB,aAC5B,YACA;CACA,MAAM,eAAe,mBAAmB,OAAO,EAC7C,cAAc,cAAc,MAAM,cACnC,CAAC;AAEF,QAAO,OAAO;EACZ,MAAM,UACH,MAAM,aAAa,CACnB,OAAO,oBAAoB,CAC3B,MAAM,OAAO,EAAE,YAAY,iBAAiB,MAAM,WAAW,KAAK,MAAM,CAAC,CAAC;EAE7E,cAAc,UACX,MACC,cACG,KAAK,EAAE,cAAc,MAAM,CAAC,CAC5B,OAAO,EAAE,aAAa,mBAAmB,MAAM,QAAQ,UAAU,EAAE,CAAC,CACxE,CACA,OAAO,qBAAqB,OAAO,CAAC,CACpC,MAAM,OAAO,EAAE,YAAY,iBAAiB,MAAM,WAAW,aAAa,MAAa,CAAC,CAAC;EAE5F,QAAQ,UACL,MAAM,gBAAgB,CACtB,OAAO,iBAAiB,CACxB,SAAS,OAAO,EAAE,KAAK,YAAY;AAClC,UAAO,iBAAiB,MAAM,WAAW,OAAO,OAAO,IAAI,CAAC;IAC5D;EAEJ,QAAQ,UACL,MAAM,gBAAgB,CACtB,OAAO,iBAAiB,CACxB,SAAS,OAAO,EAAE,KAAK,YAAY;AAClC,UAAO,iBAAiB,MAAM,WAAW,OAAO,OAAO,IAAI,CAAC;IAC5D;EAEJ,MAAM,UACH,MAAM,cAAc,CACpB,OAAO,qBAAqB,CAC5B,SAAS,OAAO,EAAE,KAAK,YAAY;AAClC,UAAO,iBAAiB,MAAM,WAAW,KAAK,OAAO,IAAI,CAAC;IAC1D;EAEJ,QAAQ,UACL,MAAM,cAAc,CACpB,OAAO,iBAAiB,CACxB,SAAS,OAAO,EAAE,KAAK,YAAY;AAClC,UAAO,iBAAiB,MAAM,WAAW,OAAO,OAAO,IAAI,CAAC;IAC5D;EAEJ,QAAQ,UACL,MAAM,gBAAgB,CACtB,OAAO,iBAAiB,KAAK,EAAE,IAAI,MAAM,CAAC,CAAC,CAC3C,SAAS,OAAO,EAAE,YAAY;AAC7B,UAAO,iBAAiB,MAAM,WAAW,OAAO,MAAM,CAAC;IACvD;EACL,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
//#region src/modules/utils/applyPagination.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Applies pagination (limit and offset) to a drizzle query builder.
|
|
3
4
|
* Returns the query builder with pagination applied, or the original query if no limit is specified.
|
|
4
5
|
* Page is 1-based and only applied if limit is also provided.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
declare const applyPagination: <TQuery>(query: TQuery, limit?: number, page?: number) => TQuery;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { applyPagination };
|
|
10
|
+
//# sourceMappingURL=applyPagination.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/modules/utils/applyPagination.ts
|
|
2
|
+
/**
|
|
3
|
+
* Applies pagination (limit and offset) to a drizzle query builder.
|
|
4
|
+
* Returns the query builder with pagination applied, or the original query if no limit is specified.
|
|
5
|
+
* Page is 1-based and only applied if limit is also provided.
|
|
6
|
+
*/
|
|
7
|
+
const applyPagination = (query, limit, page) => {
|
|
8
|
+
if (limit) query.limit(limit);
|
|
9
|
+
if (page && page > 1 && limit) query.offset((page - 1) * limit);
|
|
10
|
+
return query;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { applyPagination };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=applyPagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyPagination.mjs","names":[],"sources":["../../../../src/modules/utils/applyPagination.ts"],"sourcesContent":["/**\r\n * Applies pagination (limit and offset) to a drizzle query builder.\r\n * Returns the query builder with pagination applied, or the original query if no limit is specified.\r\n * Page is 1-based and only applied if limit is also provided.\r\n */\r\n\r\nexport const applyPagination = <TQuery>(query: TQuery, limit?: number, page?: number): TQuery => {\r\n if (limit) (query as any).limit(limit);\r\n\r\n if (page && page > 1 && limit) (query as any).offset((page - 1) * limit);\r\n\r\n return query;\r\n};\r\n"],"mappings":";;;;;;AAMA,MAAa,mBAA2B,OAAe,OAAgB,SAA0B;AAC/F,KAAI,MAAQ,OAAc,MAAM,MAAM;AAEtC,KAAI,QAAQ,OAAO,KAAK,MAAQ,OAAc,QAAQ,OAAO,KAAK,MAAM;AAExE,QAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/utils/applySorting.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Applies sorting to a drizzle query builder.
|
|
6
|
+
* Returns the query builder with sorting applied.
|
|
7
|
+
* If no sort or order is specified, defaults to createdAt descending.
|
|
8
|
+
* If createdAt column doesn't exist, returns the query unchanged.
|
|
9
|
+
*/
|
|
10
|
+
declare const applySorting: <TQuery, TTable extends SQLiteTableWithColumns<any>>(query: TQuery, table: TTable, sort?: string, order?: "asc" | "desc") => TQuery;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { applySorting };
|
|
13
|
+
//# sourceMappingURL=applySorting.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { asc, desc } from "drizzle-orm";
|
|
2
|
+
//#region src/modules/utils/applySorting.ts
|
|
3
|
+
/**
|
|
4
|
+
* Applies sorting to a drizzle query builder.
|
|
5
|
+
* Returns the query builder with sorting applied.
|
|
6
|
+
* If no sort or order is specified, defaults to createdAt descending.
|
|
7
|
+
* If createdAt column doesn't exist, returns the query unchanged.
|
|
8
|
+
*/
|
|
9
|
+
const applySorting = (query, table, sort, order) => {
|
|
10
|
+
const column = sort ? table[sort] : table.createdAt || table.id;
|
|
11
|
+
if (!column) throw new Error(`Column ${sort} not found in table ${table.name}`);
|
|
12
|
+
query.orderBy(order === "asc" ? asc(column) : desc(column));
|
|
13
|
+
return query;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { applySorting };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=applySorting.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applySorting.mjs","names":[],"sources":["../../../../src/modules/utils/applySorting.ts"],"sourcesContent":["import { asc, desc } from \"drizzle-orm\";\r\nimport type { SQLiteTableWithColumns } from \"drizzle-orm/sqlite-core\";\r\n\r\n/**\r\n * Applies sorting to a drizzle query builder.\r\n * Returns the query builder with sorting applied.\r\n * If no sort or order is specified, defaults to createdAt descending.\r\n * If createdAt column doesn't exist, returns the query unchanged.\r\n */\r\n\r\nexport const applySorting = <TQuery, TTable extends SQLiteTableWithColumns<any>>(\r\n query: TQuery,\r\n table: TTable,\r\n sort?: string,\r\n order?: \"asc\" | \"desc\"\r\n): TQuery => {\r\n const column = sort ? table[sort] : table.createdAt || table.id;\r\n if (!column) throw new Error(`Column ${sort} not found in table ${table.name}`);\r\n (query as any).orderBy(order === \"asc\" ? asc(column) : desc(column));\r\n return query;\r\n};\r\n"],"mappings":";;;;;;;;AAUA,MAAa,gBACX,OACA,OACA,MACA,UACW;CACX,MAAM,SAAS,OAAO,MAAM,QAAQ,MAAM,aAAa,MAAM;AAC7D,KAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,UAAU,KAAK,sBAAsB,MAAM,OAAO;AAC9E,OAAc,QAAQ,UAAU,QAAQ,IAAI,OAAO,GAAG,KAAK,OAAO,CAAC;AACpE,QAAO"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConditionBuilder } from "../base/base.repository.mjs";
|
|
2
|
+
import { SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
|
|
3
|
+
import { QueryFilters } from "@m5kdev/commons/modules/schemas/query.schema";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/utils/getConditionsFromFilters.d.ts
|
|
6
|
+
declare const getConditionsFromFilters: <T extends SQLiteTableWithColumns<any>>(conditions: ConditionBuilder, filters: QueryFilters | undefined, table: T) => ConditionBuilder;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getConditionsFromFilters };
|
|
9
|
+
//# sourceMappingURL=getConditionsFromFilters.d.mts.map
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { and, between, eq, gte, inArray, isNotNull, isNull, like, lte, ne, or } from "drizzle-orm";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
//#region src/modules/utils/getConditionsFromFilters.ts
|
|
4
|
+
const getUTCDateBoundaries = (isoString) => {
|
|
5
|
+
const dateTime = DateTime.fromISO(isoString, { zone: "utc" });
|
|
6
|
+
return {
|
|
7
|
+
start: dateTime.startOf("day").toJSDate(),
|
|
8
|
+
end: dateTime.endOf("day").toJSDate()
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const getConditionsFromFilters = (conditions, filters, table) => {
|
|
12
|
+
if (!filters || filters.length === 0) return conditions;
|
|
13
|
+
for (const filter of filters) {
|
|
14
|
+
const { columnId, type, method, value, valueTo } = filter;
|
|
15
|
+
const column = table[columnId];
|
|
16
|
+
if (!column) continue;
|
|
17
|
+
if (method === "isEmpty" || method === "isNotEmpty") switch (type) {
|
|
18
|
+
case "string":
|
|
19
|
+
case "enum":
|
|
20
|
+
if (method === "isEmpty") conditions.push(or(isNull(column), eq(column, "")));
|
|
21
|
+
else conditions.push(and(isNotNull(column), ne(column, "")));
|
|
22
|
+
continue;
|
|
23
|
+
case "number":
|
|
24
|
+
if (method === "isEmpty") conditions.push(or(isNull(column), eq(column, 0)));
|
|
25
|
+
else conditions.push(and(isNotNull(column), ne(column, 0)));
|
|
26
|
+
continue;
|
|
27
|
+
case "boolean": continue;
|
|
28
|
+
default: continue;
|
|
29
|
+
}
|
|
30
|
+
switch (type) {
|
|
31
|
+
case "string":
|
|
32
|
+
switch (method) {
|
|
33
|
+
case "contains":
|
|
34
|
+
if (typeof value === "string") conditions.push(like(column, `%${value}%`));
|
|
35
|
+
break;
|
|
36
|
+
case "equals":
|
|
37
|
+
if (typeof value === "string") conditions.push(eq(column, value));
|
|
38
|
+
break;
|
|
39
|
+
case "starts_with":
|
|
40
|
+
if (typeof value === "string") conditions.push(like(column, `${value}%`));
|
|
41
|
+
break;
|
|
42
|
+
case "ends_with":
|
|
43
|
+
if (typeof value === "string") conditions.push(like(column, `%${value}`));
|
|
44
|
+
break;
|
|
45
|
+
case "is_null":
|
|
46
|
+
conditions.push(isNull(column));
|
|
47
|
+
break;
|
|
48
|
+
case "is_not_null":
|
|
49
|
+
conditions.push(isNotNull(column));
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case "number":
|
|
54
|
+
switch (method) {
|
|
55
|
+
case "equals":
|
|
56
|
+
if (typeof value === "number") conditions.push(eq(column, value));
|
|
57
|
+
break;
|
|
58
|
+
case "greater_than":
|
|
59
|
+
if (typeof value === "number") conditions.push(gte(column, value));
|
|
60
|
+
break;
|
|
61
|
+
case "less_than":
|
|
62
|
+
if (typeof value === "number") conditions.push(lte(column, value));
|
|
63
|
+
break;
|
|
64
|
+
case "is_null":
|
|
65
|
+
conditions.push(isNull(column));
|
|
66
|
+
break;
|
|
67
|
+
case "is_not_null":
|
|
68
|
+
conditions.push(isNotNull(column));
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case "date":
|
|
73
|
+
if (typeof value !== "string") break;
|
|
74
|
+
switch (method) {
|
|
75
|
+
case "on": {
|
|
76
|
+
const { start, end } = getUTCDateBoundaries(value);
|
|
77
|
+
conditions.push(and(gte(column, start), lte(column, end)));
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case "between":
|
|
81
|
+
if (valueTo) {
|
|
82
|
+
const { start } = getUTCDateBoundaries(value);
|
|
83
|
+
const { end } = getUTCDateBoundaries(valueTo);
|
|
84
|
+
conditions.push(between(column, start, end));
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case "before": {
|
|
88
|
+
const { end } = getUTCDateBoundaries(value);
|
|
89
|
+
conditions.push(lte(column, end));
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "after": {
|
|
93
|
+
const { start } = getUTCDateBoundaries(value);
|
|
94
|
+
conditions.push(gte(column, start));
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case "intersect": {
|
|
98
|
+
if (!valueTo || !filter.endColumnId) break;
|
|
99
|
+
const endColumn = table[filter.endColumnId];
|
|
100
|
+
if (!endColumn) break;
|
|
101
|
+
const { start } = getUTCDateBoundaries(value);
|
|
102
|
+
const { end } = getUTCDateBoundaries(valueTo);
|
|
103
|
+
conditions.push(and(lte(column, end), or(isNull(endColumn), gte(endColumn, start))));
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "is_null":
|
|
107
|
+
conditions.push(isNull(column));
|
|
108
|
+
break;
|
|
109
|
+
case "is_not_null":
|
|
110
|
+
conditions.push(isNotNull(column));
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case "boolean":
|
|
115
|
+
switch (method) {
|
|
116
|
+
case "equals":
|
|
117
|
+
if (typeof value === "boolean") conditions.push(eq(column, value));
|
|
118
|
+
break;
|
|
119
|
+
case "is_null":
|
|
120
|
+
conditions.push(isNull(column));
|
|
121
|
+
break;
|
|
122
|
+
case "is_not_null":
|
|
123
|
+
conditions.push(isNotNull(column));
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case "enum":
|
|
128
|
+
switch (method) {
|
|
129
|
+
case "oneOf":
|
|
130
|
+
if (Array.isArray(value) && value.length > 0) conditions.push(inArray(column, value));
|
|
131
|
+
break;
|
|
132
|
+
case "equals":
|
|
133
|
+
if (typeof value === "string") conditions.push(eq(column, value));
|
|
134
|
+
break;
|
|
135
|
+
case "is_null":
|
|
136
|
+
conditions.push(isNull(column));
|
|
137
|
+
break;
|
|
138
|
+
case "is_not_null":
|
|
139
|
+
conditions.push(isNotNull(column));
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return conditions;
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { getConditionsFromFilters };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=getConditionsFromFilters.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConditionsFromFilters.mjs","names":[],"sources":["../../../../src/modules/utils/getConditionsFromFilters.ts"],"sourcesContent":["import type { QueryFilters } from \"@m5kdev/commons/modules/schemas/query.schema\";\r\nimport { and, between, eq, gte, inArray, isNotNull, isNull, like, lte, ne, or } from \"drizzle-orm\";\r\nimport type { SQLiteTableWithColumns } from \"drizzle-orm/sqlite-core\";\r\nimport { DateTime } from \"luxon\";\r\nimport type { ConditionBuilder } from \"../base/base.repository\";\r\n\r\ntype ColumnDataType = \"string\" | \"number\" | \"date\" | \"boolean\" | \"enum\";\r\n\r\n// Helper: Create UTC date boundaries from ISO string\r\nconst getUTCDateBoundaries = (isoString: string) => {\r\n const dateTime = DateTime.fromISO(isoString, { zone: \"utc\" });\r\n return {\r\n start: dateTime.startOf(\"day\").toJSDate(),\r\n end: dateTime.endOf(\"day\").toJSDate(),\r\n };\r\n};\r\n\r\nexport const getConditionsFromFilters = <T extends SQLiteTableWithColumns<any>>(\r\n conditions: ConditionBuilder,\r\n filters: QueryFilters | undefined,\r\n table: T\r\n): ConditionBuilder => {\r\n if (!filters || filters.length === 0) {\r\n return conditions;\r\n }\r\n\r\n // Process each filter (maximum one filter per column)\r\n for (const filter of filters) {\r\n const { columnId, type, method, value, valueTo } = filter;\r\n\r\n // Get the column from the table using columnId\r\n const column = (table as any)[columnId];\r\n if (!column) {\r\n continue; // Skip if column doesn't exist\r\n }\r\n\r\n // Handle isEmpty/isNotEmpty methods (work across types, ignore value)\r\n if (method === \"isEmpty\" || method === \"isNotEmpty\") {\r\n switch (type as ColumnDataType) {\r\n case \"string\":\r\n case \"enum\":\r\n // isEmpty: IS NULL OR = ''\r\n // isNotEmpty: IS NOT NULL AND != ''\r\n if (method === \"isEmpty\") {\r\n conditions.push(or(isNull(column), eq(column, \"\")));\r\n } else {\r\n conditions.push(and(isNotNull(column), ne(column, \"\")));\r\n }\r\n continue;\r\n case \"number\":\r\n // isEmpty: IS NULL OR = 0\r\n // isNotEmpty: IS NOT NULL AND != 0\r\n if (method === \"isEmpty\") {\r\n conditions.push(or(isNull(column), eq(column, 0)));\r\n } else {\r\n conditions.push(and(isNotNull(column), ne(column, 0)));\r\n }\r\n continue;\r\n case \"boolean\":\r\n // Should not happen per plan, but handle gracefully\r\n continue;\r\n default:\r\n continue;\r\n }\r\n }\r\n\r\n // Apply filter based on type and method\r\n switch (type as ColumnDataType) {\r\n case \"string\":\r\n switch (method) {\r\n case \"contains\":\r\n if (typeof value === \"string\") {\r\n conditions.push(like(column, `%${value}%`));\r\n }\r\n break;\r\n case \"equals\":\r\n if (typeof value === \"string\") {\r\n conditions.push(eq(column, value));\r\n }\r\n break;\r\n case \"starts_with\":\r\n if (typeof value === \"string\") {\r\n conditions.push(like(column, `${value}%`));\r\n }\r\n break;\r\n case \"ends_with\":\r\n if (typeof value === \"string\") {\r\n conditions.push(like(column, `%${value}`));\r\n }\r\n break;\r\n case \"is_null\":\r\n conditions.push(isNull(column));\r\n break;\r\n case \"is_not_null\":\r\n conditions.push(isNotNull(column));\r\n break;\r\n }\r\n break;\r\n\r\n case \"number\":\r\n switch (method) {\r\n case \"equals\":\r\n if (typeof value === \"number\") {\r\n conditions.push(eq(column, value));\r\n }\r\n break;\r\n case \"greater_than\":\r\n if (typeof value === \"number\") {\r\n conditions.push(gte(column, value));\r\n }\r\n break;\r\n case \"less_than\":\r\n if (typeof value === \"number\") {\r\n conditions.push(lte(column, value));\r\n }\r\n break;\r\n case \"is_null\":\r\n conditions.push(isNull(column));\r\n break;\r\n case \"is_not_null\":\r\n conditions.push(isNotNull(column));\r\n break;\r\n }\r\n break;\r\n\r\n case \"date\":\r\n if (typeof value !== \"string\") break;\r\n\r\n switch (method) {\r\n case \"on\": {\r\n const { start, end } = getUTCDateBoundaries(value);\r\n conditions.push(and(gte(column, start), lte(column, end)));\r\n break;\r\n }\r\n case \"between\":\r\n if (valueTo) {\r\n const { start } = getUTCDateBoundaries(value);\r\n const { end } = getUTCDateBoundaries(valueTo);\r\n conditions.push(between(column, start, end));\r\n }\r\n break;\r\n case \"before\": {\r\n const { end } = getUTCDateBoundaries(value);\r\n conditions.push(lte(column, end));\r\n break;\r\n }\r\n case \"after\": {\r\n const { start } = getUTCDateBoundaries(value);\r\n conditions.push(gte(column, start));\r\n break;\r\n }\r\n case \"intersect\": {\r\n // Interval overlap: [columnId, endColumnId] intersects with [value, valueTo]\r\n // Logic: columnId <= valueTo AND (endColumnId IS NULL OR endColumnId >= value)\r\n if (!valueTo || !filter.endColumnId) break;\r\n\r\n const endColumn = (table as any)[filter.endColumnId];\r\n if (!endColumn) break;\r\n\r\n const { start } = getUTCDateBoundaries(value);\r\n const { end } = getUTCDateBoundaries(valueTo);\r\n\r\n conditions.push(and(lte(column, end), or(isNull(endColumn), gte(endColumn, start))));\r\n break;\r\n }\r\n case \"is_null\":\r\n conditions.push(isNull(column));\r\n break;\r\n case \"is_not_null\":\r\n conditions.push(isNotNull(column));\r\n break;\r\n }\r\n break;\r\n\r\n case \"boolean\":\r\n switch (method) {\r\n case \"equals\":\r\n if (typeof value === \"boolean\") {\r\n conditions.push(eq(column, value));\r\n }\r\n break;\r\n case \"is_null\":\r\n conditions.push(isNull(column));\r\n break;\r\n case \"is_not_null\":\r\n conditions.push(isNotNull(column));\r\n break;\r\n }\r\n\r\n break;\r\n\r\n case \"enum\":\r\n switch (method) {\r\n case \"oneOf\":\r\n if (Array.isArray(value) && value.length > 0) {\r\n conditions.push(inArray(column, value));\r\n }\r\n break;\r\n case \"equals\":\r\n if (typeof value === \"string\") {\r\n conditions.push(eq(column, value));\r\n }\r\n break;\r\n case \"is_null\":\r\n conditions.push(isNull(column));\r\n break;\r\n case \"is_not_null\":\r\n conditions.push(isNotNull(column));\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return conditions;\r\n};\r\n"],"mappings":";;;AASA,MAAM,wBAAwB,cAAsB;CAClD,MAAM,WAAW,SAAS,QAAQ,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,QAAO;EACL,OAAO,SAAS,QAAQ,MAAM,CAAC,UAAU;EACzC,KAAK,SAAS,MAAM,MAAM,CAAC,UAAU;EACtC;;AAGH,MAAa,4BACX,YACA,SACA,UACqB;AACrB,KAAI,CAAC,WAAW,QAAQ,WAAW,EACjC,QAAO;AAIT,MAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,EAAE,UAAU,MAAM,QAAQ,OAAO,YAAY;EAGnD,MAAM,SAAU,MAAc;AAC9B,MAAI,CAAC,OACH;AAIF,MAAI,WAAW,aAAa,WAAW,aACrC,SAAQ,MAAR;GACE,KAAK;GACL,KAAK;AAGH,QAAI,WAAW,UACb,YAAW,KAAK,GAAG,OAAO,OAAO,EAAE,GAAG,QAAQ,GAAG,CAAC,CAAC;QAEnD,YAAW,KAAK,IAAI,UAAU,OAAO,EAAE,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEzD;GACF,KAAK;AAGH,QAAI,WAAW,UACb,YAAW,KAAK,GAAG,OAAO,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;QAElD,YAAW,KAAK,IAAI,UAAU,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AAExD;GACF,KAAK,UAEH;GACF,QACE;;AAKN,UAAQ,MAAR;GACE,KAAK;AACH,YAAQ,QAAR;KACE,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,KAAK,QAAQ,IAAI,MAAM,GAAG,CAAC;AAE7C;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,GAAG,QAAQ,MAAM,CAAC;AAEpC;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,CAAC;AAE5C;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC;AAE5C;KACF,KAAK;AACH,iBAAW,KAAK,OAAO,OAAO,CAAC;AAC/B;KACF,KAAK;AACH,iBAAW,KAAK,UAAU,OAAO,CAAC;AAClC;;AAEJ;GAEF,KAAK;AACH,YAAQ,QAAR;KACE,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,GAAG,QAAQ,MAAM,CAAC;AAEpC;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,IAAI,QAAQ,MAAM,CAAC;AAErC;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,IAAI,QAAQ,MAAM,CAAC;AAErC;KACF,KAAK;AACH,iBAAW,KAAK,OAAO,OAAO,CAAC;AAC/B;KACF,KAAK;AACH,iBAAW,KAAK,UAAU,OAAO,CAAC;AAClC;;AAEJ;GAEF,KAAK;AACH,QAAI,OAAO,UAAU,SAAU;AAE/B,YAAQ,QAAR;KACE,KAAK,MAAM;MACT,MAAM,EAAE,OAAO,QAAQ,qBAAqB,MAAM;AAClD,iBAAW,KAAK,IAAI,IAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,IAAI,CAAC,CAAC;AAC1D;;KAEF,KAAK;AACH,UAAI,SAAS;OACX,MAAM,EAAE,UAAU,qBAAqB,MAAM;OAC7C,MAAM,EAAE,QAAQ,qBAAqB,QAAQ;AAC7C,kBAAW,KAAK,QAAQ,QAAQ,OAAO,IAAI,CAAC;;AAE9C;KACF,KAAK,UAAU;MACb,MAAM,EAAE,QAAQ,qBAAqB,MAAM;AAC3C,iBAAW,KAAK,IAAI,QAAQ,IAAI,CAAC;AACjC;;KAEF,KAAK,SAAS;MACZ,MAAM,EAAE,UAAU,qBAAqB,MAAM;AAC7C,iBAAW,KAAK,IAAI,QAAQ,MAAM,CAAC;AACnC;;KAEF,KAAK,aAAa;AAGhB,UAAI,CAAC,WAAW,CAAC,OAAO,YAAa;MAErC,MAAM,YAAa,MAAc,OAAO;AACxC,UAAI,CAAC,UAAW;MAEhB,MAAM,EAAE,UAAU,qBAAqB,MAAM;MAC7C,MAAM,EAAE,QAAQ,qBAAqB,QAAQ;AAE7C,iBAAW,KAAK,IAAI,IAAI,QAAQ,IAAI,EAAE,GAAG,OAAO,UAAU,EAAE,IAAI,WAAW,MAAM,CAAC,CAAC,CAAC;AACpF;;KAEF,KAAK;AACH,iBAAW,KAAK,OAAO,OAAO,CAAC;AAC/B;KACF,KAAK;AACH,iBAAW,KAAK,UAAU,OAAO,CAAC;AAClC;;AAEJ;GAEF,KAAK;AACH,YAAQ,QAAR;KACE,KAAK;AACH,UAAI,OAAO,UAAU,UACnB,YAAW,KAAK,GAAG,QAAQ,MAAM,CAAC;AAEpC;KACF,KAAK;AACH,iBAAW,KAAK,OAAO,OAAO,CAAC;AAC/B;KACF,KAAK;AACH,iBAAW,KAAK,UAAU,OAAO,CAAC;AAClC;;AAGJ;GAEF,KAAK;AACH,YAAQ,QAAR;KACE,KAAK;AACH,UAAI,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EACzC,YAAW,KAAK,QAAQ,QAAQ,MAAM,CAAC;AAEzC;KACF,KAAK;AACH,UAAI,OAAO,UAAU,SACnB,YAAW,KAAK,GAAG,QAAQ,MAAM,CAAC;AAEpC;KACF,KAAK;AACH,iBAAW,KAAK,OAAO,OAAO,CAAC;AAC/B;KACF,KAAK;AACH,iBAAW,KAAK,UAAU,OAAO,CAAC;AAClC;;AAEJ;;;AAIN,QAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
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.mts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
2
|
+
import { err, ok } from "neverthrow";
|
|
3
|
+
import { v4 } from "uuid";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { closeSync, existsSync, mkdirSync, openSync } from "node:fs";
|
|
6
|
+
import ffbin from "ffmpeg-ffprobe-static";
|
|
7
|
+
import ffmpeg from "fluent-ffmpeg";
|
|
8
|
+
//#region src/modules/video/video.service.ts
|
|
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
|
+
const uploadsDir = path.join(__dirname, "..", "uploads");
|
|
13
|
+
if (!existsSync(uploadsDir)) mkdirSync(uploadsDir, { recursive: true });
|
|
14
|
+
var VideoService = class extends BaseService {
|
|
15
|
+
async cut(file, start, end) {
|
|
16
|
+
return this.throwableAsync(async () => {
|
|
17
|
+
const duration = end - start;
|
|
18
|
+
const output = path.join(uploadsDir, `${v4()}.mp4`);
|
|
19
|
+
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
20
|
+
await new Promise((resolve, reject) => {
|
|
21
|
+
ffmpeg(file).seekOutput(start).videoCodec("libx264").audioCodec("copy").outputOptions(["-y", "-movflags +faststart"]).duration(duration).on("end", () => resolve()).on("error", (e, _stdout, _stderr) => reject(e)).save(output);
|
|
22
|
+
}).catch((error) => err(this.handleUnknownError(error)));
|
|
23
|
+
return ok(output);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async webmToWav(input, hz = 48e3) {
|
|
27
|
+
return this.throwableAsync(async () => {
|
|
28
|
+
const output = path.join(uploadsDir, `${v4()}.wav`);
|
|
29
|
+
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
30
|
+
await new Promise((resolve, reject) => {
|
|
31
|
+
ffmpeg(input).noVideo().audioCodec("pcm_s16le").audioFrequency(hz).audioChannels(2).format("wav").outputOptions(["-y"]).on("end", () => resolve()).on("error", reject).save(output);
|
|
32
|
+
}).catch((error) => err(this.handleUnknownError(error)));
|
|
33
|
+
return ok(output);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async extractAudioMp3(input, kbps = 192, streamIndex = 0) {
|
|
37
|
+
return this.throwableAsync(async () => {
|
|
38
|
+
const output = path.join(uploadsDir, `${v4()}.mp3`);
|
|
39
|
+
if (!existsSync(output)) closeSync(openSync(output, "w"));
|
|
40
|
+
await new Promise((resolve, reject) => {
|
|
41
|
+
ffmpeg(input).outputOptions(["-y", `-map 0:a:${streamIndex}`]).audioCodec("libmp3lame").audioBitrate(kbps).on("end", () => resolve()).on("error", reject).save(output);
|
|
42
|
+
}).catch((error) => err(this.handleUnknownError(error)));
|
|
43
|
+
return ok(output);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { VideoService };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=video.service.mjs.map
|
|
@@ -0,0 +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\n//\r\nimport ffbin from \"ffmpeg-ffprobe-static\";\r\nimport ffmpeg from \"fluent-ffmpeg\";\r\nimport { err, 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\nffmpeg.setFfmpegPath(ffbin.ffmpegPath);\r\nffmpeg.setFfprobePath(ffbin.ffprobePath);\r\n\r\nconst uploadsDir = path.join(__dirname, \"..\", \"uploads\");\r\nif (!existsSync(uploadsDir)) {\r\n mkdirSync(uploadsDir, { recursive: true });\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 new Promise<void>((resolve, reject) => {\r\n ffmpeg(file)\r\n .seekOutput(start)\r\n .videoCodec(\"libx264\")\r\n .audioCodec(\"copy\")\r\n .outputOptions([\"-y\", \"-movflags +faststart\"])\r\n .duration(duration)\r\n .on(\"end\", () => resolve())\r\n .on(\"error\", (e: Error, _stdout: string | null, _stderr: string | null) => reject(e))\r\n .save(output);\r\n }).catch((error) => err(this.handleUnknownError(error)));\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 await new Promise<void>((resolve, reject) => {\r\n ffmpeg(input)\r\n .noVideo()\r\n .audioCodec(\"pcm_s16le\") // WAV PCM 16-bit\r\n .audioFrequency(hz) // 48000 or 44100\r\n .audioChannels(2) // down/up-mix as needed\r\n .format(\"wav\")\r\n .outputOptions([\"-y\"])\r\n .on(\"end\", () => resolve())\r\n .on(\"error\", reject)\r\n .save(output);\r\n }).catch((error) => err(this.handleUnknownError(error)));\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 new Promise<void>((resolve, reject) => {\r\n ffmpeg(input)\r\n .outputOptions([\"-y\", `-map 0:a:${streamIndex}`])\r\n .audioCodec(\"libmp3lame\")\r\n .audioBitrate(kbps)\r\n .on(\"end\", () => resolve())\r\n .on(\"error\", reject)\r\n .save(output);\r\n }).catch((error) => err(this.handleUnknownError(error)));\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,OAAO,cAAc,MAAM,WAAW;AACtC,OAAO,eAAe,MAAM,YAAY;AAExC,MAAM,aAAa,KAAK,KAAK,WAAW,MAAM,UAAU;AACxD,IAAI,CAAC,WAAW,WAAW,CACzB,WAAU,YAAY,EAAE,WAAW,MAAM,CAAC;AAG5C,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,IAAI,SAAe,SAAS,WAAW;AAC3C,WAAO,KAAK,CACT,WAAW,MAAM,CACjB,WAAW,UAAU,CACrB,WAAW,OAAO,CAClB,cAAc,CAAC,MAAM,uBAAuB,CAAC,CAC7C,SAAS,SAAS,CAClB,GAAG,aAAa,SAAS,CAAC,CAC1B,GAAG,UAAU,GAAU,SAAwB,YAA2B,OAAO,EAAE,CAAC,CACpF,KAAK,OAAO;KACf,CAAC,OAAO,UAAU,IAAI,KAAK,mBAAmB,MAAM,CAAC,CAAC;AAExD,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;AAElC,SAAM,IAAI,SAAe,SAAS,WAAW;AAC3C,WAAO,MAAM,CACV,SAAS,CACT,WAAW,YAAY,CACvB,eAAe,GAAG,CAClB,cAAc,EAAE,CAChB,OAAO,MAAM,CACb,cAAc,CAAC,KAAK,CAAC,CACrB,GAAG,aAAa,SAAS,CAAC,CAC1B,GAAG,SAAS,OAAO,CACnB,KAAK,OAAO;KACf,CAAC,OAAO,UAAU,IAAI,KAAK,mBAAmB,MAAM,CAAC,CAAC;AACxD,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,IAAI,SAAe,SAAS,WAAW;AAC3C,WAAO,MAAM,CACV,cAAc,CAAC,MAAM,YAAY,cAAc,CAAC,CAChD,WAAW,aAAa,CACxB,aAAa,KAAK,CAClB,GAAG,aAAa,SAAS,CAAC,CAC1B,GAAG,SAAS,OAAO,CACnB,KAAK,OAAO;KACf,CAAC,OAAO,UAAU,IAAI,KAAK,mBAAmB,MAAM,CAAC,CAAC;AAExD,UAAO,GAAG,OAAO;IACjB"}
|
|
@@ -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.mts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/modules/webhook/webhook.constants.ts
|
|
2
|
+
const WEBHOOK_STATUS_ENUM = {
|
|
3
|
+
WAITING: "WAITING",
|
|
4
|
+
COMPLETED: "COMPLETED",
|
|
5
|
+
TIMEOUT: "TIMEOUT",
|
|
6
|
+
ERROR_CALLBACK: "ERROR_CALLBACK",
|
|
7
|
+
ERROR_DATA: "ERROR_DATA"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { WEBHOOK_STATUS_ENUM };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=webhook.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.constants.mjs","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"}
|