@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,11 @@
|
|
|
1
|
+
import { createSelectDTO } from "../base/base.dto.mjs";
|
|
2
|
+
import { taggings, tags } from "./tag.db.mjs";
|
|
3
|
+
//#region src/modules/tag/tag.dto.ts
|
|
4
|
+
const tagsSelectDTO = createSelectDTO(tags);
|
|
5
|
+
const taggingsSelectDTO = createSelectDTO(taggings);
|
|
6
|
+
const tagsSelectOutput = tagsSelectDTO.schema;
|
|
7
|
+
const taggingsSelectOutput = taggingsSelectDTO.schema;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { taggingsSelectDTO, taggingsSelectOutput, tagsSelectDTO, tagsSelectOutput };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=tag.dto.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.dto.mjs","names":[],"sources":["../../../../src/modules/tag/tag.dto.ts"],"sourcesContent":["import type { Result } from \"neverthrow\";\r\nimport type { z } from \"zod\";\r\nimport { createSelectDTO } from \"../base/base.dto\";\r\nimport { taggings, tags } from \"./tag.db\";\r\nimport type { ServerError } from \"../../utils/errors\";\r\n\r\nexport const tagsSelectDTO = createSelectDTO(tags);\r\nexport const taggingsSelectDTO = createSelectDTO(taggings);\r\n\r\nexport const tagsSelectOutput = tagsSelectDTO.schema;\r\nexport const taggingsSelectOutput = taggingsSelectDTO.schema;\r\n\r\nexport type TagSelectOutputResult = Result<z.infer<typeof tagsSelectOutput>, ServerError>;\r\nexport type TaggingSelectOutputResult = Result<z.infer<typeof taggingsSelectOutput>, ServerError>;\r\nexport type TaggingSelectOutputResults = Result<\r\n z.infer<typeof taggingsSelectOutput>[],\r\n ServerError\r\n>;\r\n"],"mappings":";;;AAMA,MAAa,gBAAgB,gBAAgB,KAAK;AAClD,MAAa,oBAAoB,gBAAgB,SAAS;AAE1D,MAAa,mBAAmB,cAAc;AAC9C,MAAa,uBAAuB,kBAAkB"}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
3
|
+
import { TagSelectOutputResult, TaggingSelectOutputResult } from "./tag.dto.mjs";
|
|
4
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
5
|
+
import { TagLinkSchema, TagListInputSchema, TagListSchema, TagSchema, TaggingSchema } from "@m5kdev/commons/modules/tag/tag.schema";
|
|
6
|
+
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
7
|
+
|
|
8
|
+
//#region src/modules/tag/tag.repository.d.ts
|
|
9
|
+
declare const schema: {
|
|
10
|
+
tags: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
11
|
+
name: "tags";
|
|
12
|
+
schema: undefined;
|
|
13
|
+
columns: {
|
|
14
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
15
|
+
name: "id";
|
|
16
|
+
tableName: "tags";
|
|
17
|
+
dataType: "string";
|
|
18
|
+
columnType: "SQLiteText";
|
|
19
|
+
data: string;
|
|
20
|
+
driverParam: string;
|
|
21
|
+
notNull: true;
|
|
22
|
+
hasDefault: true;
|
|
23
|
+
isPrimaryKey: true;
|
|
24
|
+
isAutoincrement: false;
|
|
25
|
+
hasRuntimeDefault: true;
|
|
26
|
+
enumValues: [string, ...string[]];
|
|
27
|
+
baseColumn: never;
|
|
28
|
+
identity: undefined;
|
|
29
|
+
generated: undefined;
|
|
30
|
+
}, {}, {
|
|
31
|
+
length: number | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
34
|
+
name: "created_at";
|
|
35
|
+
tableName: "tags";
|
|
36
|
+
dataType: "date";
|
|
37
|
+
columnType: "SQLiteTimestamp";
|
|
38
|
+
data: Date;
|
|
39
|
+
driverParam: number;
|
|
40
|
+
notNull: true;
|
|
41
|
+
hasDefault: true;
|
|
42
|
+
isPrimaryKey: false;
|
|
43
|
+
isAutoincrement: false;
|
|
44
|
+
hasRuntimeDefault: true;
|
|
45
|
+
enumValues: undefined;
|
|
46
|
+
baseColumn: never;
|
|
47
|
+
identity: undefined;
|
|
48
|
+
generated: undefined;
|
|
49
|
+
}, {}, {}>;
|
|
50
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
51
|
+
name: "updated_at";
|
|
52
|
+
tableName: "tags";
|
|
53
|
+
dataType: "date";
|
|
54
|
+
columnType: "SQLiteTimestamp";
|
|
55
|
+
data: Date;
|
|
56
|
+
driverParam: number;
|
|
57
|
+
notNull: false;
|
|
58
|
+
hasDefault: false;
|
|
59
|
+
isPrimaryKey: false;
|
|
60
|
+
isAutoincrement: false;
|
|
61
|
+
hasRuntimeDefault: false;
|
|
62
|
+
enumValues: undefined;
|
|
63
|
+
baseColumn: never;
|
|
64
|
+
identity: undefined;
|
|
65
|
+
generated: undefined;
|
|
66
|
+
}, {}, {}>;
|
|
67
|
+
deletedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
68
|
+
name: "deleted_at";
|
|
69
|
+
tableName: "tags";
|
|
70
|
+
dataType: "date";
|
|
71
|
+
columnType: "SQLiteTimestamp";
|
|
72
|
+
data: Date;
|
|
73
|
+
driverParam: number;
|
|
74
|
+
notNull: false;
|
|
75
|
+
hasDefault: false;
|
|
76
|
+
isPrimaryKey: false;
|
|
77
|
+
isAutoincrement: false;
|
|
78
|
+
hasRuntimeDefault: false;
|
|
79
|
+
enumValues: undefined;
|
|
80
|
+
baseColumn: never;
|
|
81
|
+
identity: undefined;
|
|
82
|
+
generated: undefined;
|
|
83
|
+
}, {}, {}>;
|
|
84
|
+
userId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
85
|
+
name: "user_id";
|
|
86
|
+
tableName: "tags";
|
|
87
|
+
dataType: "string";
|
|
88
|
+
columnType: "SQLiteText";
|
|
89
|
+
data: string;
|
|
90
|
+
driverParam: string;
|
|
91
|
+
notNull: true;
|
|
92
|
+
hasDefault: false;
|
|
93
|
+
isPrimaryKey: false;
|
|
94
|
+
isAutoincrement: false;
|
|
95
|
+
hasRuntimeDefault: false;
|
|
96
|
+
enumValues: [string, ...string[]];
|
|
97
|
+
baseColumn: never;
|
|
98
|
+
identity: undefined;
|
|
99
|
+
generated: undefined;
|
|
100
|
+
}, {}, {
|
|
101
|
+
length: number | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
organizationId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
104
|
+
name: "organization_id";
|
|
105
|
+
tableName: "tags";
|
|
106
|
+
dataType: "string";
|
|
107
|
+
columnType: "SQLiteText";
|
|
108
|
+
data: string;
|
|
109
|
+
driverParam: string;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: [string, ...string[]];
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {
|
|
120
|
+
length: number | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
teamId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
123
|
+
name: "team_id";
|
|
124
|
+
tableName: "tags";
|
|
125
|
+
dataType: "string";
|
|
126
|
+
columnType: "SQLiteText";
|
|
127
|
+
data: string;
|
|
128
|
+
driverParam: string;
|
|
129
|
+
notNull: false;
|
|
130
|
+
hasDefault: false;
|
|
131
|
+
isPrimaryKey: false;
|
|
132
|
+
isAutoincrement: false;
|
|
133
|
+
hasRuntimeDefault: false;
|
|
134
|
+
enumValues: [string, ...string[]];
|
|
135
|
+
baseColumn: never;
|
|
136
|
+
identity: undefined;
|
|
137
|
+
generated: undefined;
|
|
138
|
+
}, {}, {
|
|
139
|
+
length: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
name: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
142
|
+
name: "name";
|
|
143
|
+
tableName: "tags";
|
|
144
|
+
dataType: "string";
|
|
145
|
+
columnType: "SQLiteText";
|
|
146
|
+
data: string;
|
|
147
|
+
driverParam: string;
|
|
148
|
+
notNull: true;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: [string, ...string[]];
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {
|
|
158
|
+
length: number | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
color: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
161
|
+
name: "color";
|
|
162
|
+
tableName: "tags";
|
|
163
|
+
dataType: "string";
|
|
164
|
+
columnType: "SQLiteText";
|
|
165
|
+
data: string;
|
|
166
|
+
driverParam: string;
|
|
167
|
+
notNull: false;
|
|
168
|
+
hasDefault: false;
|
|
169
|
+
isPrimaryKey: false;
|
|
170
|
+
isAutoincrement: false;
|
|
171
|
+
hasRuntimeDefault: false;
|
|
172
|
+
enumValues: [string, ...string[]];
|
|
173
|
+
baseColumn: never;
|
|
174
|
+
identity: undefined;
|
|
175
|
+
generated: undefined;
|
|
176
|
+
}, {}, {
|
|
177
|
+
length: number | undefined;
|
|
178
|
+
}>;
|
|
179
|
+
type: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
180
|
+
name: "type";
|
|
181
|
+
tableName: "tags";
|
|
182
|
+
dataType: "string";
|
|
183
|
+
columnType: "SQLiteText";
|
|
184
|
+
data: string;
|
|
185
|
+
driverParam: string;
|
|
186
|
+
notNull: false;
|
|
187
|
+
hasDefault: false;
|
|
188
|
+
isPrimaryKey: false;
|
|
189
|
+
isAutoincrement: false;
|
|
190
|
+
hasRuntimeDefault: false;
|
|
191
|
+
enumValues: [string, ...string[]];
|
|
192
|
+
baseColumn: never;
|
|
193
|
+
identity: undefined;
|
|
194
|
+
generated: undefined;
|
|
195
|
+
}, {}, {
|
|
196
|
+
length: number | undefined;
|
|
197
|
+
}>;
|
|
198
|
+
isEnabled: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
199
|
+
name: "is_enabled";
|
|
200
|
+
tableName: "tags";
|
|
201
|
+
dataType: "boolean";
|
|
202
|
+
columnType: "SQLiteBoolean";
|
|
203
|
+
data: boolean;
|
|
204
|
+
driverParam: number;
|
|
205
|
+
notNull: true;
|
|
206
|
+
hasDefault: true;
|
|
207
|
+
isPrimaryKey: false;
|
|
208
|
+
isAutoincrement: false;
|
|
209
|
+
hasRuntimeDefault: false;
|
|
210
|
+
enumValues: undefined;
|
|
211
|
+
baseColumn: never;
|
|
212
|
+
identity: undefined;
|
|
213
|
+
generated: undefined;
|
|
214
|
+
}, {}, {}>;
|
|
215
|
+
parentId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
216
|
+
name: "parent_id";
|
|
217
|
+
tableName: "tags";
|
|
218
|
+
dataType: "string";
|
|
219
|
+
columnType: "SQLiteText";
|
|
220
|
+
data: string;
|
|
221
|
+
driverParam: string;
|
|
222
|
+
notNull: false;
|
|
223
|
+
hasDefault: false;
|
|
224
|
+
isPrimaryKey: false;
|
|
225
|
+
isAutoincrement: false;
|
|
226
|
+
hasRuntimeDefault: false;
|
|
227
|
+
enumValues: [string, ...string[]];
|
|
228
|
+
baseColumn: never;
|
|
229
|
+
identity: undefined;
|
|
230
|
+
generated: undefined;
|
|
231
|
+
}, {}, {
|
|
232
|
+
length: number | undefined;
|
|
233
|
+
}>;
|
|
234
|
+
assignableTo: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
235
|
+
name: "assignable_to";
|
|
236
|
+
tableName: "tags";
|
|
237
|
+
dataType: "json";
|
|
238
|
+
columnType: "SQLiteTextJson";
|
|
239
|
+
data: string[];
|
|
240
|
+
driverParam: string;
|
|
241
|
+
notNull: true;
|
|
242
|
+
hasDefault: false;
|
|
243
|
+
isPrimaryKey: false;
|
|
244
|
+
isAutoincrement: false;
|
|
245
|
+
hasRuntimeDefault: false;
|
|
246
|
+
enumValues: undefined;
|
|
247
|
+
baseColumn: never;
|
|
248
|
+
identity: undefined;
|
|
249
|
+
generated: undefined;
|
|
250
|
+
}, {}, {
|
|
251
|
+
$type: string[];
|
|
252
|
+
}>;
|
|
253
|
+
};
|
|
254
|
+
dialect: "sqlite";
|
|
255
|
+
}>;
|
|
256
|
+
taggings: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
257
|
+
name: "taggings";
|
|
258
|
+
schema: undefined;
|
|
259
|
+
columns: {
|
|
260
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
261
|
+
name: "id";
|
|
262
|
+
tableName: "taggings";
|
|
263
|
+
dataType: "string";
|
|
264
|
+
columnType: "SQLiteText";
|
|
265
|
+
data: string;
|
|
266
|
+
driverParam: string;
|
|
267
|
+
notNull: true;
|
|
268
|
+
hasDefault: true;
|
|
269
|
+
isPrimaryKey: true;
|
|
270
|
+
isAutoincrement: false;
|
|
271
|
+
hasRuntimeDefault: true;
|
|
272
|
+
enumValues: [string, ...string[]];
|
|
273
|
+
baseColumn: never;
|
|
274
|
+
identity: undefined;
|
|
275
|
+
generated: undefined;
|
|
276
|
+
}, {}, {
|
|
277
|
+
length: number | undefined;
|
|
278
|
+
}>;
|
|
279
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
280
|
+
name: "created_at";
|
|
281
|
+
tableName: "taggings";
|
|
282
|
+
dataType: "date";
|
|
283
|
+
columnType: "SQLiteTimestamp";
|
|
284
|
+
data: Date;
|
|
285
|
+
driverParam: number;
|
|
286
|
+
notNull: true;
|
|
287
|
+
hasDefault: true;
|
|
288
|
+
isPrimaryKey: false;
|
|
289
|
+
isAutoincrement: false;
|
|
290
|
+
hasRuntimeDefault: true;
|
|
291
|
+
enumValues: undefined;
|
|
292
|
+
baseColumn: never;
|
|
293
|
+
identity: undefined;
|
|
294
|
+
generated: undefined;
|
|
295
|
+
}, {}, {}>;
|
|
296
|
+
tagId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
297
|
+
name: "tag_id";
|
|
298
|
+
tableName: "taggings";
|
|
299
|
+
dataType: "string";
|
|
300
|
+
columnType: "SQLiteText";
|
|
301
|
+
data: string;
|
|
302
|
+
driverParam: string;
|
|
303
|
+
notNull: true;
|
|
304
|
+
hasDefault: false;
|
|
305
|
+
isPrimaryKey: false;
|
|
306
|
+
isAutoincrement: false;
|
|
307
|
+
hasRuntimeDefault: false;
|
|
308
|
+
enumValues: [string, ...string[]];
|
|
309
|
+
baseColumn: never;
|
|
310
|
+
identity: undefined;
|
|
311
|
+
generated: undefined;
|
|
312
|
+
}, {}, {
|
|
313
|
+
length: number | undefined;
|
|
314
|
+
}>;
|
|
315
|
+
resourceType: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
316
|
+
name: "resource_type";
|
|
317
|
+
tableName: "taggings";
|
|
318
|
+
dataType: "string";
|
|
319
|
+
columnType: "SQLiteText";
|
|
320
|
+
data: string;
|
|
321
|
+
driverParam: string;
|
|
322
|
+
notNull: true;
|
|
323
|
+
hasDefault: false;
|
|
324
|
+
isPrimaryKey: false;
|
|
325
|
+
isAutoincrement: false;
|
|
326
|
+
hasRuntimeDefault: false;
|
|
327
|
+
enumValues: [string, ...string[]];
|
|
328
|
+
baseColumn: never;
|
|
329
|
+
identity: undefined;
|
|
330
|
+
generated: undefined;
|
|
331
|
+
}, {}, {
|
|
332
|
+
length: number | undefined;
|
|
333
|
+
}>;
|
|
334
|
+
resourceId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
335
|
+
name: "resource_id";
|
|
336
|
+
tableName: "taggings";
|
|
337
|
+
dataType: "string";
|
|
338
|
+
columnType: "SQLiteText";
|
|
339
|
+
data: string;
|
|
340
|
+
driverParam: string;
|
|
341
|
+
notNull: true;
|
|
342
|
+
hasDefault: false;
|
|
343
|
+
isPrimaryKey: false;
|
|
344
|
+
isAutoincrement: false;
|
|
345
|
+
hasRuntimeDefault: false;
|
|
346
|
+
enumValues: [string, ...string[]];
|
|
347
|
+
baseColumn: never;
|
|
348
|
+
identity: undefined;
|
|
349
|
+
generated: undefined;
|
|
350
|
+
}, {}, {
|
|
351
|
+
length: number | undefined;
|
|
352
|
+
}>;
|
|
353
|
+
};
|
|
354
|
+
dialect: "sqlite";
|
|
355
|
+
}>;
|
|
356
|
+
};
|
|
357
|
+
type Schema = typeof schema;
|
|
358
|
+
type Orm = LibSQLDatabase<Schema>;
|
|
359
|
+
declare class TagRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["tags"]> {
|
|
360
|
+
link({
|
|
361
|
+
userId,
|
|
362
|
+
...data
|
|
363
|
+
}: TagLinkSchema & {
|
|
364
|
+
userId: string;
|
|
365
|
+
}, tx?: Orm): Promise<TaggingSelectOutputResult>;
|
|
366
|
+
linkBulk(data: TagLinkSchema[], tx?: Orm): ServerResultAsync<TagSchema[]>;
|
|
367
|
+
set(data: TagLinkSchema[], tx?: Orm): ServerResultAsync<TagSchema[]>;
|
|
368
|
+
unlink({
|
|
369
|
+
userId,
|
|
370
|
+
...data
|
|
371
|
+
}: TagLinkSchema & {
|
|
372
|
+
userId: string;
|
|
373
|
+
}, tx?: Orm): Promise<TagSelectOutputResult>;
|
|
374
|
+
findTagsForResources(data: {
|
|
375
|
+
resourceType: string;
|
|
376
|
+
resourceIds: readonly string[];
|
|
377
|
+
}, tx?: Orm): ServerResultAsync<Record<string, TagSchema[]>>;
|
|
378
|
+
attachTagsToResources<TRow extends {
|
|
379
|
+
id: string;
|
|
380
|
+
}>(resourceType: string, rows: readonly TRow[], tx?: Orm): ServerResultAsync<Array<TRow & {
|
|
381
|
+
tags: TagSchema[];
|
|
382
|
+
}>>;
|
|
383
|
+
listTaggings(input: {
|
|
384
|
+
resourceType: string;
|
|
385
|
+
resourceIds?: readonly string[];
|
|
386
|
+
}, tx?: Orm): ServerResultAsync<TaggingSchema[]>;
|
|
387
|
+
list(input: (TagListInputSchema & TagListSchema) | undefined, tx?: Orm): ServerResultAsync<{
|
|
388
|
+
rows: TagSchema[];
|
|
389
|
+
total: number;
|
|
390
|
+
}>;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
export { TagRepository };
|
|
394
|
+
//# sourceMappingURL=tag.repository.d.mts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
2
|
+
import { tag_db_exports } from "./tag.db.mjs";
|
|
3
|
+
import { and, count, eq, inArray, isNull } from "drizzle-orm";
|
|
4
|
+
import { err, ok } from "neverthrow";
|
|
5
|
+
//#region src/modules/tag/tag.repository.ts
|
|
6
|
+
({ ...tag_db_exports });
|
|
7
|
+
var TagRepository = class extends BaseTableRepository {
|
|
8
|
+
async link({ userId, ...data }, tx) {
|
|
9
|
+
return this.throwableAsync(async () => {
|
|
10
|
+
const db = tx ?? this.orm;
|
|
11
|
+
const [foundTag] = await db.select({ id: this.schema.tags.id }).from(this.schema.tags).where(and(eq(this.schema.tags.id, data.tagId), eq(this.schema.tags.userId, userId))).limit(1);
|
|
12
|
+
if (!foundTag) return this.error("FORBIDDEN");
|
|
13
|
+
const [tagging] = await db.insert(this.schema.taggings).values({
|
|
14
|
+
...data,
|
|
15
|
+
tagId: foundTag.id
|
|
16
|
+
}).returning();
|
|
17
|
+
if (!tagging) return this.error("NOT_FOUND");
|
|
18
|
+
return ok(tagging);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async linkBulk(data, tx) {
|
|
22
|
+
return this.throwableAsync(async () => {
|
|
23
|
+
const db = tx ?? this.orm;
|
|
24
|
+
await db.insert(this.schema.taggings).values(data);
|
|
25
|
+
return ok(await db.select().from(this.schema.tags).where(inArray(this.schema.tags.id, data.map((tag) => tag.tagId))));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async set(data, tx) {
|
|
29
|
+
return this.throwableAsync(async () => {
|
|
30
|
+
const db = tx ?? this.orm;
|
|
31
|
+
return ok(await db.transaction(async (trx) => {
|
|
32
|
+
await trx.delete(this.schema.taggings).where(eq(this.schema.taggings.resourceId, data[0].resourceId));
|
|
33
|
+
await db.insert(this.schema.taggings).values(data);
|
|
34
|
+
return await db.select().from(this.schema.tags).where(inArray(this.schema.tags.id, data.map((tag) => tag.tagId)));
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async unlink({ userId, ...data }, tx) {
|
|
39
|
+
return this.throwableAsync(async () => {
|
|
40
|
+
const db = tx ?? this.orm;
|
|
41
|
+
const [foundTag] = await db.select().from(this.schema.tags).where(and(eq(this.schema.tags.id, data.tagId), eq(this.schema.tags.userId, userId))).limit(1);
|
|
42
|
+
if (!foundTag) return this.error("FORBIDDEN");
|
|
43
|
+
await db.delete(this.schema.taggings).where(and(eq(this.schema.taggings.tagId, data.tagId), eq(this.schema.taggings.resourceId, data.resourceId), eq(this.schema.taggings.resourceType, data.resourceType)));
|
|
44
|
+
return ok(foundTag);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async findTagsForResources(data, tx) {
|
|
48
|
+
return this.throwableAsync(async () => {
|
|
49
|
+
const db = tx ?? this.orm;
|
|
50
|
+
if (data.resourceIds.length === 0) return ok({});
|
|
51
|
+
const taggings = await db.select({
|
|
52
|
+
resourceId: this.schema.taggings.resourceId,
|
|
53
|
+
tagId: this.schema.taggings.tagId
|
|
54
|
+
}).from(this.schema.taggings).where(and(eq(this.schema.taggings.resourceType, data.resourceType), inArray(this.schema.taggings.resourceId, data.resourceIds)));
|
|
55
|
+
if (taggings.length === 0) return ok({});
|
|
56
|
+
const tagIds = Array.from(new Set(taggings.map((tagging) => tagging.tagId)));
|
|
57
|
+
const tagById = (await db.select().from(this.schema.tags).where(inArray(this.schema.tags.id, tagIds))).reduce((acc, tagRow) => {
|
|
58
|
+
acc[tagRow.id] = tagRow;
|
|
59
|
+
return acc;
|
|
60
|
+
}, {});
|
|
61
|
+
return ok(taggings.reduce((acc, tagging) => {
|
|
62
|
+
const tagRow = tagById[tagging.tagId];
|
|
63
|
+
if (!tagRow) return acc;
|
|
64
|
+
const existing = acc[tagging.resourceId] ?? [];
|
|
65
|
+
acc[tagging.resourceId] = [...existing, tagRow];
|
|
66
|
+
return acc;
|
|
67
|
+
}, {}));
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async attachTagsToResources(resourceType, rows, tx) {
|
|
71
|
+
return this.throwableAsync(async () => {
|
|
72
|
+
if (rows.length === 0) return ok([]);
|
|
73
|
+
const tagsResult = await this.findTagsForResources({
|
|
74
|
+
resourceType,
|
|
75
|
+
resourceIds: rows.map((row) => row.id)
|
|
76
|
+
}, tx);
|
|
77
|
+
if (tagsResult.isErr()) return err(tagsResult.error);
|
|
78
|
+
const tagsByResource = tagsResult.value;
|
|
79
|
+
return ok(rows.map((row) => ({
|
|
80
|
+
...row,
|
|
81
|
+
tags: tagsByResource[row.id] ?? []
|
|
82
|
+
})));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async listTaggings(input, tx) {
|
|
86
|
+
const db = tx ?? this.orm;
|
|
87
|
+
const filters = [eq(this.schema.taggings.resourceType, input.resourceType)];
|
|
88
|
+
if (input.resourceIds?.length) filters.push(inArray(this.schema.taggings.resourceId, input.resourceIds));
|
|
89
|
+
const rows = await this.throwableQuery(() => db.select().from(this.schema.taggings).where(and(...filters)));
|
|
90
|
+
if (rows.isErr()) return err(rows.error);
|
|
91
|
+
return ok(rows.value);
|
|
92
|
+
}
|
|
93
|
+
async list(input, tx) {
|
|
94
|
+
const db = tx ?? this.orm;
|
|
95
|
+
const conditions = this.getConditionBuilder(this.table);
|
|
96
|
+
conditions.push(isNull(this.table.deletedAt));
|
|
97
|
+
conditions.applyFilters(input);
|
|
98
|
+
if (input?.assignableTo) conditions.push(this.helpers.arrayContains(this.table.assignableTo, [input.assignableTo]));
|
|
99
|
+
const whereClause = conditions.join();
|
|
100
|
+
const rowsQuery = this.withSortingAndPagination(db.select().from(this.table).where(whereClause), input || {});
|
|
101
|
+
const countQuery = db.select({ count: count() }).from(this.table).where(whereClause);
|
|
102
|
+
const countResult = await this.throwableQuery(() => Promise.all([rowsQuery, countQuery]));
|
|
103
|
+
if (countResult.isErr()) return err(countResult.error);
|
|
104
|
+
const [rows, [totalResult]] = countResult.value;
|
|
105
|
+
return ok({
|
|
106
|
+
rows,
|
|
107
|
+
total: totalResult?.count ?? 0
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
export { TagRepository };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=tag.repository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.repository.mjs","names":["tag"],"sources":["../../../../src/modules/tag/tag.repository.ts"],"sourcesContent":["import type {\r\n TaggingSchema,\r\n TagLinkSchema,\r\n TagListInputSchema,\r\n TagListSchema,\r\n TagSchema,\r\n} from \"@m5kdev/commons/modules/tag/tag.schema\";\r\nimport { and, count, eq, inArray, isNull } from \"drizzle-orm\";\r\nimport type { LibSQLDatabase } from \"drizzle-orm/libsql\";\r\nimport { err, ok } from \"neverthrow\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseTableRepository } from \"../base/base.repository\";\r\nimport * as tag from \"./tag.db\";\r\nimport type { TaggingSelectOutputResult, TagSelectOutputResult } from \"./tag.dto\";\r\n\r\nconst schema = { ...tag };\r\ntype Schema = typeof schema;\r\ntype Orm = LibSQLDatabase<Schema>;\r\n\r\nexport class TagRepository extends BaseTableRepository<\r\n Orm,\r\n Schema,\r\n Record<string, never>,\r\n Schema[\"tags\"]\r\n> {\r\n async link(\r\n { userId, ...data }: TagLinkSchema & { userId: string },\r\n tx?: Orm\r\n ): Promise<TaggingSelectOutputResult> {\r\n return this.throwableAsync(async () => {\r\n const db = tx ?? this.orm;\r\n const [foundTag] = await db\r\n .select({ id: this.schema.tags.id })\r\n .from(this.schema.tags)\r\n .where(and(eq(this.schema.tags.id, data.tagId), eq(this.schema.tags.userId, userId)))\r\n .limit(1);\r\n if (!foundTag) return this.error(\"FORBIDDEN\");\r\n\r\n const [tagging] = await db\r\n .insert(this.schema.taggings)\r\n .values({ ...data, tagId: foundTag.id })\r\n .returning();\r\n if (!tagging) return this.error(\"NOT_FOUND\");\r\n return ok(tagging);\r\n });\r\n }\r\n\r\n async linkBulk(data: TagLinkSchema[], tx?: Orm): ServerResultAsync<TagSchema[]> {\r\n return this.throwableAsync(async () => {\r\n const db = tx ?? this.orm;\r\n await db.insert(this.schema.taggings).values(data);\r\n const tags = await db\r\n .select()\r\n .from(this.schema.tags)\r\n .where(\r\n inArray(\r\n this.schema.tags.id,\r\n data.map((tag) => tag.tagId)\r\n )\r\n );\r\n return ok(tags);\r\n });\r\n }\r\n\r\n async set(data: TagLinkSchema[], tx?: Orm): ServerResultAsync<TagSchema[]> {\r\n return this.throwableAsync(async () => {\r\n const db = tx ?? this.orm;\r\n const result = await db.transaction(async (trx) => {\r\n // FIXME: We are assuming that all resourceIds are the same, this is not a good assumption.\r\n await trx\r\n .delete(this.schema.taggings)\r\n .where(eq(this.schema.taggings.resourceId, data[0].resourceId));\r\n await db.insert(this.schema.taggings).values(data);\r\n const tags = await db\r\n .select()\r\n .from(this.schema.tags)\r\n .where(\r\n inArray(\r\n this.schema.tags.id,\r\n data.map((tag) => tag.tagId)\r\n )\r\n );\r\n return tags;\r\n });\r\n return ok(result);\r\n });\r\n }\r\n\r\n async unlink(\r\n { userId, ...data }: TagLinkSchema & { userId: string },\r\n tx?: Orm\r\n ): Promise<TagSelectOutputResult> {\r\n return this.throwableAsync(async () => {\r\n const db = tx ?? this.orm;\r\n const [foundTag] = await db\r\n .select()\r\n .from(this.schema.tags)\r\n .where(and(eq(this.schema.tags.id, data.tagId), eq(this.schema.tags.userId, userId)))\r\n .limit(1);\r\n if (!foundTag) return this.error(\"FORBIDDEN\");\r\n\r\n await db\r\n .delete(this.schema.taggings)\r\n .where(\r\n and(\r\n eq(this.schema.taggings.tagId, data.tagId),\r\n eq(this.schema.taggings.resourceId, data.resourceId),\r\n eq(this.schema.taggings.resourceType, data.resourceType)\r\n )\r\n );\r\n\r\n return ok(foundTag);\r\n });\r\n }\r\n\r\n async findTagsForResources(\r\n data: { resourceType: string; resourceIds: readonly string[] },\r\n tx?: Orm\r\n ): ServerResultAsync<Record<string, TagSchema[]>> {\r\n return this.throwableAsync(async () => {\r\n const db = tx ?? this.orm;\r\n if (data.resourceIds.length === 0) return ok({});\r\n\r\n const taggings = await db\r\n .select({\r\n resourceId: this.schema.taggings.resourceId,\r\n tagId: this.schema.taggings.tagId,\r\n })\r\n .from(this.schema.taggings)\r\n .where(\r\n and(\r\n eq(this.schema.taggings.resourceType, data.resourceType),\r\n inArray(this.schema.taggings.resourceId, data.resourceIds as string[])\r\n )\r\n );\r\n\r\n if (taggings.length === 0) return ok({});\r\n\r\n const tagIds = Array.from(new Set(taggings.map((tagging) => tagging.tagId)));\r\n const tags = await db\r\n .select()\r\n .from(this.schema.tags)\r\n .where(inArray(this.schema.tags.id, tagIds));\r\n\r\n const tagById = tags.reduce<Record<string, TagSchema>>((acc, tagRow) => {\r\n acc[tagRow.id] = tagRow;\r\n return acc;\r\n }, {});\r\n\r\n const grouped = taggings.reduce<Record<string, TagSchema[]>>((acc, tagging) => {\r\n const tagRow = tagById[tagging.tagId];\r\n if (!tagRow) return acc;\r\n const existing = acc[tagging.resourceId] ?? [];\r\n acc[tagging.resourceId] = [...existing, tagRow];\r\n return acc;\r\n }, {});\r\n\r\n return ok(grouped);\r\n });\r\n }\r\n\r\n async attachTagsToResources<TRow extends { id: string }>(\r\n resourceType: string,\r\n rows: readonly TRow[],\r\n tx?: Orm\r\n ): ServerResultAsync<Array<TRow & { tags: TagSchema[] }>> {\r\n return this.throwableAsync(async () => {\r\n if (rows.length === 0) return ok([]);\r\n const tagsResult = await this.findTagsForResources(\r\n { resourceType, resourceIds: rows.map((row) => row.id) },\r\n tx\r\n );\r\n if (tagsResult.isErr()) return err(tagsResult.error);\r\n const tagsByResource = tagsResult.value;\r\n const withTags = rows.map((row) => ({\r\n ...row,\r\n tags: tagsByResource[row.id] ?? [],\r\n }));\r\n return ok(withTags);\r\n });\r\n }\r\n\r\n async listTaggings(\r\n input: { resourceType: string; resourceIds?: readonly string[] },\r\n tx?: Orm\r\n ): ServerResultAsync<TaggingSchema[]> {\r\n const db = tx ?? this.orm;\r\n const filters = [eq(this.schema.taggings.resourceType, input.resourceType)];\r\n if (input.resourceIds?.length) {\r\n filters.push(inArray(this.schema.taggings.resourceId, input.resourceIds as string[]));\r\n }\r\n const rows = await this.throwableQuery(() =>\r\n db\r\n .select()\r\n .from(this.schema.taggings)\r\n .where(and(...filters))\r\n );\r\n if (rows.isErr()) return err(rows.error);\r\n return ok(rows.value);\r\n }\r\n\r\n async list(\r\n input: (TagListInputSchema & TagListSchema) | undefined,\r\n tx?: Orm\r\n ): ServerResultAsync<{ rows: TagSchema[]; total: number }> {\r\n const db = tx ?? this.orm;\r\n const conditions = this.getConditionBuilder(this.table);\r\n conditions.push(isNull(this.table.deletedAt));\r\n conditions.applyFilters(input);\r\n\r\n if (input?.assignableTo) {\r\n conditions.push(this.helpers.arrayContains(this.table.assignableTo, [input.assignableTo]));\r\n }\r\n const whereClause = conditions.join();\r\n const rowsQuery = this.withSortingAndPagination(\r\n db.select().from(this.table).where(whereClause),\r\n input || {}\r\n );\r\n const countQuery = db.select({ count: count() }).from(this.table).where(whereClause);\r\n const countResult = await this.throwableQuery(() => Promise.all([rowsQuery, countQuery]));\r\n if (countResult.isErr()) return err(countResult.error);\r\n const [rows, [totalResult]] = countResult.value;\r\n return ok({ rows, total: totalResult?.count ?? 0 });\r\n }\r\n}\r\n"],"mappings":"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"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ServerResult, ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { AuthenticatedActor, UserActor } from "../base/base.actor.mjs";
|
|
3
|
+
import { ServiceProcedure } from "../base/base.procedure.mjs";
|
|
4
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
5
|
+
import { TagRepository } from "./tag.repository.mjs";
|
|
6
|
+
import { TagDeleteSchema, TagLinkSchema, TagListInputSchema, TagListOutputSchema, TagListSchema, TagSchema } from "@m5kdev/commons/modules/tag/tag.schema";
|
|
7
|
+
|
|
8
|
+
//#region src/modules/tag/tag.service.d.ts
|
|
9
|
+
declare class TagService extends BaseService<{
|
|
10
|
+
tag: TagRepository;
|
|
11
|
+
}, Record<string, never>> {
|
|
12
|
+
list(input: TagListInputSchema & TagListSchema): ServerResultAsync<TagListOutputSchema>;
|
|
13
|
+
listTaggings(input: {
|
|
14
|
+
resourceType: string;
|
|
15
|
+
resourceIds?: readonly string[];
|
|
16
|
+
}): Promise<ServerResult<TaggingSchema[]>>;
|
|
17
|
+
readonly create: ServiceProcedure<TagCreateSchema, {
|
|
18
|
+
actor?: AuthenticatedActor | null;
|
|
19
|
+
} & Record<string, unknown> & {
|
|
20
|
+
actor: UserActor;
|
|
21
|
+
}, {
|
|
22
|
+
id: string;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date | null;
|
|
25
|
+
deletedAt: Date | null;
|
|
26
|
+
userId: string;
|
|
27
|
+
organizationId: string | null;
|
|
28
|
+
teamId: string | null;
|
|
29
|
+
name: string;
|
|
30
|
+
color: string | null;
|
|
31
|
+
type: string | null;
|
|
32
|
+
isEnabled: boolean;
|
|
33
|
+
parentId: string | null;
|
|
34
|
+
assignableTo: string[];
|
|
35
|
+
}>;
|
|
36
|
+
readonly update: ServiceProcedure<TagUpdateSchema, {
|
|
37
|
+
actor?: AuthenticatedActor | null;
|
|
38
|
+
} & Record<string, unknown> & {
|
|
39
|
+
actor: UserActor;
|
|
40
|
+
}, {
|
|
41
|
+
id: string;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date | null;
|
|
44
|
+
deletedAt: Date | null;
|
|
45
|
+
userId: string;
|
|
46
|
+
organizationId: string | null;
|
|
47
|
+
teamId: string | null;
|
|
48
|
+
name: string;
|
|
49
|
+
color: string | null;
|
|
50
|
+
type: string | null;
|
|
51
|
+
isEnabled: boolean;
|
|
52
|
+
parentId: string | null;
|
|
53
|
+
assignableTo: string[];
|
|
54
|
+
}>;
|
|
55
|
+
readonly link: ServiceProcedure<TagLinkSchema, {
|
|
56
|
+
actor?: AuthenticatedActor | null;
|
|
57
|
+
} & Record<string, unknown> & {
|
|
58
|
+
actor: UserActor;
|
|
59
|
+
}, {
|
|
60
|
+
id: string;
|
|
61
|
+
createdAt: Date;
|
|
62
|
+
tagId: string;
|
|
63
|
+
resourceType: string;
|
|
64
|
+
resourceId: string;
|
|
65
|
+
}>;
|
|
66
|
+
linkBulk(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]>;
|
|
67
|
+
set(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]>;
|
|
68
|
+
readonly unlink: ServiceProcedure<TagLinkSchema, {
|
|
69
|
+
actor?: AuthenticatedActor | null;
|
|
70
|
+
} & Record<string, unknown> & {
|
|
71
|
+
actor: UserActor;
|
|
72
|
+
}, {
|
|
73
|
+
id: string;
|
|
74
|
+
createdAt: Date;
|
|
75
|
+
updatedAt: Date | null;
|
|
76
|
+
deletedAt: Date | null;
|
|
77
|
+
userId: string;
|
|
78
|
+
organizationId: string | null;
|
|
79
|
+
teamId: string | null;
|
|
80
|
+
name: string;
|
|
81
|
+
color: string | null;
|
|
82
|
+
type: string | null;
|
|
83
|
+
isEnabled: boolean;
|
|
84
|
+
parentId: string | null;
|
|
85
|
+
assignableTo: string[];
|
|
86
|
+
}>;
|
|
87
|
+
delete(data: TagDeleteSchema): ServerResultAsync<{
|
|
88
|
+
id: string;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { TagService };
|
|
93
|
+
//# sourceMappingURL=tag.service.d.mts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
2
|
+
//#region src/modules/tag/tag.service.ts
|
|
3
|
+
var TagService = class extends BaseService {
|
|
4
|
+
async list(input) {
|
|
5
|
+
return this.repository.tag.list(input);
|
|
6
|
+
}
|
|
7
|
+
async listTaggings(input) {
|
|
8
|
+
return this.repository.tag.listTaggings(input);
|
|
9
|
+
}
|
|
10
|
+
create = this.procedure("create").requireAuth().handle(({ input, ctx }) => {
|
|
11
|
+
return this.repository.tag.create({
|
|
12
|
+
...input,
|
|
13
|
+
userId: ctx.actor.userId
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
update = this.procedure("update").requireAuth().handle(({ input, ctx }) => {
|
|
17
|
+
return this.repository.tag.update({
|
|
18
|
+
...input,
|
|
19
|
+
userId: ctx.actor.userId
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
link = this.procedure("link").requireAuth().handle(({ input, ctx }) => {
|
|
23
|
+
return this.repository.tag.link({
|
|
24
|
+
...input,
|
|
25
|
+
userId: ctx.actor.userId
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
async linkBulk(data) {
|
|
29
|
+
return this.repository.tag.linkBulk(data);
|
|
30
|
+
}
|
|
31
|
+
async set(data) {
|
|
32
|
+
return this.repository.tag.set(data);
|
|
33
|
+
}
|
|
34
|
+
unlink = this.procedure("unlink").requireAuth().handle(({ input, ctx }) => {
|
|
35
|
+
return this.repository.tag.unlink({
|
|
36
|
+
...input,
|
|
37
|
+
userId: ctx.actor.userId
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
async delete(data) {
|
|
41
|
+
return this.repository.tag.softDeleteById(data.id);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { TagService };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=tag.service.mjs.map
|