@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
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{{error}}
|
|
15
|
-
|
|
1
|
+
import { Prompt } from "./ai.prompt.mjs";
|
|
2
|
+
//#region src/modules/ai/ai.prompts.ts
|
|
3
|
+
const repairJsonPrompt = new Prompt(`
|
|
4
|
+
You are a JSON repair expert. You are given a JSON string that is invalid, error message and a schema that is used to parse the JSON string. You need to repair the JSON string and return the repaired JSON adher to the schema.
|
|
5
|
+
|
|
6
|
+
## Text
|
|
7
|
+
|
|
8
|
+
{{text}}
|
|
9
|
+
|
|
10
|
+
## Error
|
|
11
|
+
|
|
12
|
+
{{error}}
|
|
13
|
+
|
|
16
14
|
`);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { repairJsonPrompt };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=ai.prompts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.prompts.mjs","names":[],"sources":["../../../../src/modules/ai/ai.prompts.ts"],"sourcesContent":["import { Prompt } from \"./ai.prompt\";\r\n\r\nexport const repairJsonPrompt = new Prompt<{\r\n text: string;\r\n error: string;\r\n}>(`\r\nYou are a JSON repair expert. You are given a JSON string that is invalid, error message and a schema that is used to parse the JSON string. You need to repair the JSON string and return the repaired JSON adher to the schema.\r\n\r\n## Text\r\n\r\n{{text}}\r\n\r\n## Error\r\n\r\n{{error}}\r\n\r\n`);\r\n"],"mappings":";;AAEA,MAAa,mBAAmB,IAAI,OAGjC;;;;;;;;;;;EAWD"}
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
3
|
+
import { InferInsertModel, InferSelectModel } from "drizzle-orm";
|
|
4
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
5
|
+
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/ai/ai.repository.d.ts
|
|
8
|
+
declare const schema: {
|
|
9
|
+
chats: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
10
|
+
name: "chats";
|
|
11
|
+
schema: undefined;
|
|
12
|
+
columns: {
|
|
13
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
14
|
+
name: "id";
|
|
15
|
+
tableName: "chats";
|
|
16
|
+
dataType: "string";
|
|
17
|
+
columnType: "SQLiteText";
|
|
18
|
+
data: string;
|
|
19
|
+
driverParam: string;
|
|
20
|
+
notNull: true;
|
|
21
|
+
hasDefault: true;
|
|
22
|
+
isPrimaryKey: true;
|
|
23
|
+
isAutoincrement: false;
|
|
24
|
+
hasRuntimeDefault: true;
|
|
25
|
+
enumValues: [string, ...string[]];
|
|
26
|
+
baseColumn: never;
|
|
27
|
+
identity: undefined;
|
|
28
|
+
generated: undefined;
|
|
29
|
+
}, {}, {
|
|
30
|
+
length: number | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
userId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
33
|
+
name: "user_id";
|
|
34
|
+
tableName: "chats";
|
|
35
|
+
dataType: "string";
|
|
36
|
+
columnType: "SQLiteText";
|
|
37
|
+
data: string;
|
|
38
|
+
driverParam: string;
|
|
39
|
+
notNull: true;
|
|
40
|
+
hasDefault: false;
|
|
41
|
+
isPrimaryKey: false;
|
|
42
|
+
isAutoincrement: false;
|
|
43
|
+
hasRuntimeDefault: false;
|
|
44
|
+
enumValues: [string, ...string[]];
|
|
45
|
+
baseColumn: never;
|
|
46
|
+
identity: undefined;
|
|
47
|
+
generated: undefined;
|
|
48
|
+
}, {}, {
|
|
49
|
+
length: number | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
title: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
52
|
+
name: "title";
|
|
53
|
+
tableName: "chats";
|
|
54
|
+
dataType: "string";
|
|
55
|
+
columnType: "SQLiteText";
|
|
56
|
+
data: string;
|
|
57
|
+
driverParam: string;
|
|
58
|
+
notNull: false;
|
|
59
|
+
hasDefault: false;
|
|
60
|
+
isPrimaryKey: false;
|
|
61
|
+
isAutoincrement: false;
|
|
62
|
+
hasRuntimeDefault: false;
|
|
63
|
+
enumValues: [string, ...string[]];
|
|
64
|
+
baseColumn: never;
|
|
65
|
+
identity: undefined;
|
|
66
|
+
generated: undefined;
|
|
67
|
+
}, {}, {
|
|
68
|
+
length: number | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
type: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
71
|
+
name: "type";
|
|
72
|
+
tableName: "chats";
|
|
73
|
+
dataType: "string";
|
|
74
|
+
columnType: "SQLiteText";
|
|
75
|
+
data: string;
|
|
76
|
+
driverParam: string;
|
|
77
|
+
notNull: false;
|
|
78
|
+
hasDefault: false;
|
|
79
|
+
isPrimaryKey: false;
|
|
80
|
+
isAutoincrement: false;
|
|
81
|
+
hasRuntimeDefault: false;
|
|
82
|
+
enumValues: [string, ...string[]];
|
|
83
|
+
baseColumn: never;
|
|
84
|
+
identity: undefined;
|
|
85
|
+
generated: undefined;
|
|
86
|
+
}, {}, {
|
|
87
|
+
length: number | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
conversation: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
90
|
+
name: "conversation";
|
|
91
|
+
tableName: "chats";
|
|
92
|
+
dataType: "json";
|
|
93
|
+
columnType: "SQLiteTextJson";
|
|
94
|
+
data: unknown;
|
|
95
|
+
driverParam: string;
|
|
96
|
+
notNull: false;
|
|
97
|
+
hasDefault: false;
|
|
98
|
+
isPrimaryKey: false;
|
|
99
|
+
isAutoincrement: false;
|
|
100
|
+
hasRuntimeDefault: false;
|
|
101
|
+
enumValues: undefined;
|
|
102
|
+
baseColumn: never;
|
|
103
|
+
identity: undefined;
|
|
104
|
+
generated: undefined;
|
|
105
|
+
}, {}, {}>;
|
|
106
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
107
|
+
name: "created_at";
|
|
108
|
+
tableName: "chats";
|
|
109
|
+
dataType: "date";
|
|
110
|
+
columnType: "SQLiteTimestamp";
|
|
111
|
+
data: Date;
|
|
112
|
+
driverParam: number;
|
|
113
|
+
notNull: false;
|
|
114
|
+
hasDefault: true;
|
|
115
|
+
isPrimaryKey: false;
|
|
116
|
+
isAutoincrement: false;
|
|
117
|
+
hasRuntimeDefault: true;
|
|
118
|
+
enumValues: undefined;
|
|
119
|
+
baseColumn: never;
|
|
120
|
+
identity: undefined;
|
|
121
|
+
generated: undefined;
|
|
122
|
+
}, {}, {}>;
|
|
123
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
124
|
+
name: "updated_at";
|
|
125
|
+
tableName: "chats";
|
|
126
|
+
dataType: "date";
|
|
127
|
+
columnType: "SQLiteTimestamp";
|
|
128
|
+
data: Date;
|
|
129
|
+
driverParam: number;
|
|
130
|
+
notNull: true;
|
|
131
|
+
hasDefault: true;
|
|
132
|
+
isPrimaryKey: false;
|
|
133
|
+
isAutoincrement: false;
|
|
134
|
+
hasRuntimeDefault: true;
|
|
135
|
+
enumValues: undefined;
|
|
136
|
+
baseColumn: never;
|
|
137
|
+
identity: undefined;
|
|
138
|
+
generated: undefined;
|
|
139
|
+
}, {}, {}>;
|
|
140
|
+
};
|
|
141
|
+
dialect: "sqlite";
|
|
142
|
+
}>;
|
|
143
|
+
aiUsage: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
144
|
+
name: "ai_usage";
|
|
145
|
+
schema: undefined;
|
|
146
|
+
columns: {
|
|
147
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
148
|
+
name: "id";
|
|
149
|
+
tableName: "ai_usage";
|
|
150
|
+
dataType: "string";
|
|
151
|
+
columnType: "SQLiteText";
|
|
152
|
+
data: string;
|
|
153
|
+
driverParam: string;
|
|
154
|
+
notNull: true;
|
|
155
|
+
hasDefault: true;
|
|
156
|
+
isPrimaryKey: true;
|
|
157
|
+
isAutoincrement: false;
|
|
158
|
+
hasRuntimeDefault: true;
|
|
159
|
+
enumValues: [string, ...string[]];
|
|
160
|
+
baseColumn: never;
|
|
161
|
+
identity: undefined;
|
|
162
|
+
generated: undefined;
|
|
163
|
+
}, {}, {
|
|
164
|
+
length: number | undefined;
|
|
165
|
+
}>;
|
|
166
|
+
userId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
167
|
+
name: "user_id";
|
|
168
|
+
tableName: "ai_usage";
|
|
169
|
+
dataType: "string";
|
|
170
|
+
columnType: "SQLiteText";
|
|
171
|
+
data: string;
|
|
172
|
+
driverParam: string;
|
|
173
|
+
notNull: false;
|
|
174
|
+
hasDefault: false;
|
|
175
|
+
isPrimaryKey: false;
|
|
176
|
+
isAutoincrement: false;
|
|
177
|
+
hasRuntimeDefault: false;
|
|
178
|
+
enumValues: [string, ...string[]];
|
|
179
|
+
baseColumn: never;
|
|
180
|
+
identity: undefined;
|
|
181
|
+
generated: undefined;
|
|
182
|
+
}, {}, {
|
|
183
|
+
length: number | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
teamId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
186
|
+
name: "team_id";
|
|
187
|
+
tableName: "ai_usage";
|
|
188
|
+
dataType: "string";
|
|
189
|
+
columnType: "SQLiteText";
|
|
190
|
+
data: string;
|
|
191
|
+
driverParam: string;
|
|
192
|
+
notNull: false;
|
|
193
|
+
hasDefault: false;
|
|
194
|
+
isPrimaryKey: false;
|
|
195
|
+
isAutoincrement: false;
|
|
196
|
+
hasRuntimeDefault: false;
|
|
197
|
+
enumValues: [string, ...string[]];
|
|
198
|
+
baseColumn: never;
|
|
199
|
+
identity: undefined;
|
|
200
|
+
generated: undefined;
|
|
201
|
+
}, {}, {
|
|
202
|
+
length: number | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
organizationId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
205
|
+
name: "organization_id";
|
|
206
|
+
tableName: "ai_usage";
|
|
207
|
+
dataType: "string";
|
|
208
|
+
columnType: "SQLiteText";
|
|
209
|
+
data: string;
|
|
210
|
+
driverParam: string;
|
|
211
|
+
notNull: false;
|
|
212
|
+
hasDefault: false;
|
|
213
|
+
isPrimaryKey: false;
|
|
214
|
+
isAutoincrement: false;
|
|
215
|
+
hasRuntimeDefault: false;
|
|
216
|
+
enumValues: [string, ...string[]];
|
|
217
|
+
baseColumn: never;
|
|
218
|
+
identity: undefined;
|
|
219
|
+
generated: undefined;
|
|
220
|
+
}, {}, {
|
|
221
|
+
length: number | undefined;
|
|
222
|
+
}>;
|
|
223
|
+
feature: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
224
|
+
name: "feature";
|
|
225
|
+
tableName: "ai_usage";
|
|
226
|
+
dataType: "string";
|
|
227
|
+
columnType: "SQLiteText";
|
|
228
|
+
data: string;
|
|
229
|
+
driverParam: string;
|
|
230
|
+
notNull: true;
|
|
231
|
+
hasDefault: false;
|
|
232
|
+
isPrimaryKey: false;
|
|
233
|
+
isAutoincrement: false;
|
|
234
|
+
hasRuntimeDefault: false;
|
|
235
|
+
enumValues: [string, ...string[]];
|
|
236
|
+
baseColumn: never;
|
|
237
|
+
identity: undefined;
|
|
238
|
+
generated: undefined;
|
|
239
|
+
}, {}, {
|
|
240
|
+
length: number | undefined;
|
|
241
|
+
}>;
|
|
242
|
+
provider: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
243
|
+
name: "provider";
|
|
244
|
+
tableName: "ai_usage";
|
|
245
|
+
dataType: "string";
|
|
246
|
+
columnType: "SQLiteText";
|
|
247
|
+
data: string;
|
|
248
|
+
driverParam: string;
|
|
249
|
+
notNull: true;
|
|
250
|
+
hasDefault: false;
|
|
251
|
+
isPrimaryKey: false;
|
|
252
|
+
isAutoincrement: false;
|
|
253
|
+
hasRuntimeDefault: false;
|
|
254
|
+
enumValues: [string, ...string[]];
|
|
255
|
+
baseColumn: never;
|
|
256
|
+
identity: undefined;
|
|
257
|
+
generated: undefined;
|
|
258
|
+
}, {}, {
|
|
259
|
+
length: number | undefined;
|
|
260
|
+
}>;
|
|
261
|
+
model: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
262
|
+
name: "model";
|
|
263
|
+
tableName: "ai_usage";
|
|
264
|
+
dataType: "string";
|
|
265
|
+
columnType: "SQLiteText";
|
|
266
|
+
data: string;
|
|
267
|
+
driverParam: string;
|
|
268
|
+
notNull: true;
|
|
269
|
+
hasDefault: false;
|
|
270
|
+
isPrimaryKey: false;
|
|
271
|
+
isAutoincrement: false;
|
|
272
|
+
hasRuntimeDefault: false;
|
|
273
|
+
enumValues: [string, ...string[]];
|
|
274
|
+
baseColumn: never;
|
|
275
|
+
identity: undefined;
|
|
276
|
+
generated: undefined;
|
|
277
|
+
}, {}, {
|
|
278
|
+
length: number | undefined;
|
|
279
|
+
}>;
|
|
280
|
+
inputTokens: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
281
|
+
name: "input_tokens";
|
|
282
|
+
tableName: "ai_usage";
|
|
283
|
+
dataType: "number";
|
|
284
|
+
columnType: "SQLiteInteger";
|
|
285
|
+
data: number;
|
|
286
|
+
driverParam: number;
|
|
287
|
+
notNull: false;
|
|
288
|
+
hasDefault: false;
|
|
289
|
+
isPrimaryKey: false;
|
|
290
|
+
isAutoincrement: false;
|
|
291
|
+
hasRuntimeDefault: false;
|
|
292
|
+
enumValues: undefined;
|
|
293
|
+
baseColumn: never;
|
|
294
|
+
identity: undefined;
|
|
295
|
+
generated: undefined;
|
|
296
|
+
}, {}, {}>;
|
|
297
|
+
outputTokens: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
298
|
+
name: "output_tokens";
|
|
299
|
+
tableName: "ai_usage";
|
|
300
|
+
dataType: "number";
|
|
301
|
+
columnType: "SQLiteInteger";
|
|
302
|
+
data: number;
|
|
303
|
+
driverParam: number;
|
|
304
|
+
notNull: false;
|
|
305
|
+
hasDefault: false;
|
|
306
|
+
isPrimaryKey: false;
|
|
307
|
+
isAutoincrement: false;
|
|
308
|
+
hasRuntimeDefault: false;
|
|
309
|
+
enumValues: undefined;
|
|
310
|
+
baseColumn: never;
|
|
311
|
+
identity: undefined;
|
|
312
|
+
generated: undefined;
|
|
313
|
+
}, {}, {}>;
|
|
314
|
+
totalTokens: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
315
|
+
name: "total_tokens";
|
|
316
|
+
tableName: "ai_usage";
|
|
317
|
+
dataType: "number";
|
|
318
|
+
columnType: "SQLiteInteger";
|
|
319
|
+
data: number;
|
|
320
|
+
driverParam: number;
|
|
321
|
+
notNull: false;
|
|
322
|
+
hasDefault: false;
|
|
323
|
+
isPrimaryKey: false;
|
|
324
|
+
isAutoincrement: false;
|
|
325
|
+
hasRuntimeDefault: false;
|
|
326
|
+
enumValues: undefined;
|
|
327
|
+
baseColumn: never;
|
|
328
|
+
identity: undefined;
|
|
329
|
+
generated: undefined;
|
|
330
|
+
}, {}, {}>;
|
|
331
|
+
cost: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
332
|
+
name: "cost";
|
|
333
|
+
tableName: "ai_usage";
|
|
334
|
+
dataType: "number";
|
|
335
|
+
columnType: "SQLiteReal";
|
|
336
|
+
data: number;
|
|
337
|
+
driverParam: number;
|
|
338
|
+
notNull: false;
|
|
339
|
+
hasDefault: false;
|
|
340
|
+
isPrimaryKey: false;
|
|
341
|
+
isAutoincrement: false;
|
|
342
|
+
hasRuntimeDefault: false;
|
|
343
|
+
enumValues: undefined;
|
|
344
|
+
baseColumn: never;
|
|
345
|
+
identity: undefined;
|
|
346
|
+
generated: undefined;
|
|
347
|
+
}, {}, {}>;
|
|
348
|
+
traceId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
349
|
+
name: "trace_id";
|
|
350
|
+
tableName: "ai_usage";
|
|
351
|
+
dataType: "string";
|
|
352
|
+
columnType: "SQLiteText";
|
|
353
|
+
data: string;
|
|
354
|
+
driverParam: string;
|
|
355
|
+
notNull: false;
|
|
356
|
+
hasDefault: false;
|
|
357
|
+
isPrimaryKey: false;
|
|
358
|
+
isAutoincrement: false;
|
|
359
|
+
hasRuntimeDefault: false;
|
|
360
|
+
enumValues: [string, ...string[]];
|
|
361
|
+
baseColumn: never;
|
|
362
|
+
identity: undefined;
|
|
363
|
+
generated: undefined;
|
|
364
|
+
}, {}, {
|
|
365
|
+
length: number | undefined;
|
|
366
|
+
}>;
|
|
367
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
368
|
+
name: "created_at";
|
|
369
|
+
tableName: "ai_usage";
|
|
370
|
+
dataType: "date";
|
|
371
|
+
columnType: "SQLiteTimestamp";
|
|
372
|
+
data: Date;
|
|
373
|
+
driverParam: number;
|
|
374
|
+
notNull: true;
|
|
375
|
+
hasDefault: true;
|
|
376
|
+
isPrimaryKey: false;
|
|
377
|
+
isAutoincrement: false;
|
|
378
|
+
hasRuntimeDefault: true;
|
|
379
|
+
enumValues: undefined;
|
|
380
|
+
baseColumn: never;
|
|
381
|
+
identity: undefined;
|
|
382
|
+
generated: undefined;
|
|
383
|
+
}, {}, {}>;
|
|
384
|
+
metadata: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
385
|
+
name: "metadata";
|
|
386
|
+
tableName: "ai_usage";
|
|
387
|
+
dataType: "json";
|
|
388
|
+
columnType: "SQLiteTextJson";
|
|
389
|
+
data: unknown;
|
|
390
|
+
driverParam: string;
|
|
391
|
+
notNull: false;
|
|
392
|
+
hasDefault: false;
|
|
393
|
+
isPrimaryKey: false;
|
|
394
|
+
isAutoincrement: false;
|
|
395
|
+
hasRuntimeDefault: false;
|
|
396
|
+
enumValues: undefined;
|
|
397
|
+
baseColumn: never;
|
|
398
|
+
identity: undefined;
|
|
399
|
+
generated: undefined;
|
|
400
|
+
}, {}, {}>;
|
|
401
|
+
};
|
|
402
|
+
dialect: "sqlite";
|
|
403
|
+
}>;
|
|
404
|
+
};
|
|
405
|
+
type Schema = typeof schema;
|
|
406
|
+
type Orm = LibSQLDatabase<Schema>;
|
|
407
|
+
type AiUsageRow = InferSelectModel<Schema["aiUsage"]>;
|
|
408
|
+
type AiUsageInsert = InferInsertModel<Schema["aiUsage"]>;
|
|
409
|
+
interface CreateAiUsageInput {
|
|
410
|
+
userId?: string;
|
|
411
|
+
teamId?: string;
|
|
412
|
+
organizationId?: string;
|
|
413
|
+
feature: string;
|
|
414
|
+
provider: string;
|
|
415
|
+
model: string;
|
|
416
|
+
inputTokens?: number;
|
|
417
|
+
outputTokens?: number;
|
|
418
|
+
totalTokens?: number;
|
|
419
|
+
cost?: number;
|
|
420
|
+
traceId?: string;
|
|
421
|
+
metadata?: unknown;
|
|
422
|
+
}
|
|
423
|
+
declare class AiUsageRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["aiUsage"]> {
|
|
424
|
+
getUsage(userId: string): ServerResultAsync<Pick<AiUsageRow, "inputTokens" | "outputTokens" | "totalTokens" | "cost">>;
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
export { AiUsageInsert, AiUsageRepository, AiUsageRow, CreateAiUsageInput };
|
|
428
|
+
//# sourceMappingURL=ai.repository.d.mts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
2
|
+
import { ai_db_exports } from "./ai.db.mjs";
|
|
3
|
+
import { eq, sql } from "drizzle-orm";
|
|
4
|
+
import { ok } from "neverthrow";
|
|
5
|
+
//#region src/modules/ai/ai.repository.ts
|
|
6
|
+
({ ...ai_db_exports });
|
|
7
|
+
var AiUsageRepository = class extends BaseTableRepository {
|
|
8
|
+
getUsage(userId) {
|
|
9
|
+
return this.throwableAsync(async () => {
|
|
10
|
+
const [usage] = await this.orm.select({
|
|
11
|
+
inputTokens: sql`SUM(${this.table.inputTokens})`,
|
|
12
|
+
outputTokens: sql`SUM(${this.table.outputTokens})`,
|
|
13
|
+
totalTokens: sql`SUM(${this.table.totalTokens})`,
|
|
14
|
+
cost: sql`SUM(${this.table.cost})`
|
|
15
|
+
}).from(this.table).where(eq(this.table.userId, userId));
|
|
16
|
+
return ok(usage);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AiUsageRepository };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=ai.repository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.repository.mjs","names":["ai"],"sources":["../../../../src/modules/ai/ai.repository.ts"],"sourcesContent":["import type { InferInsertModel, InferSelectModel } from \"drizzle-orm\";\r\nimport { eq, sql } from \"drizzle-orm\";\r\nimport type { LibSQLDatabase } from \"drizzle-orm/libsql\";\r\nimport { ok } from \"neverthrow\";\r\nimport * as ai from \"./ai.db\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseTableRepository } from \"../base/base.repository\";\r\n\r\nconst schema = { ...ai };\r\ntype Schema = typeof schema;\r\ntype Orm = LibSQLDatabase<Schema>;\r\n\r\nexport type AiUsageRow = InferSelectModel<Schema[\"aiUsage\"]>;\r\nexport type AiUsageInsert = InferInsertModel<Schema[\"aiUsage\"]>;\r\n\r\nexport interface CreateAiUsageInput {\r\n userId?: string;\r\n teamId?: string;\r\n organizationId?: string;\r\n feature: string;\r\n provider: string;\r\n model: string;\r\n inputTokens?: number;\r\n outputTokens?: number;\r\n totalTokens?: number;\r\n cost?: number;\r\n traceId?: string;\r\n metadata?: unknown;\r\n}\r\n\r\nexport class AiUsageRepository extends BaseTableRepository<\r\n Orm,\r\n Schema,\r\n Record<string, never>,\r\n Schema[\"aiUsage\"]\r\n> {\r\n getUsage(\r\n userId: string\r\n ): ServerResultAsync<Pick<AiUsageRow, \"inputTokens\" | \"outputTokens\" | \"totalTokens\" | \"cost\">> {\r\n return this.throwableAsync(async () => {\r\n const [usage] = await this.orm\r\n .select({\r\n inputTokens: sql<number>`SUM(${this.table.inputTokens})`,\r\n outputTokens: sql<number>`SUM(${this.table.outputTokens})`,\r\n totalTokens: sql<number>`SUM(${this.table.totalTokens})`,\r\n cost: sql<number>`SUM(${this.table.cost})`,\r\n })\r\n .from(this.table)\r\n .where(eq(this.table.userId, userId));\r\n return ok(usage);\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;;CAQe,EAAE,GAAGA,eAAI;AAsBxB,IAAa,oBAAb,cAAuC,oBAKrC;CACA,SACE,QAC8F;AAC9F,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,CAAC,SAAS,MAAM,KAAK,IACxB,OAAO;IACN,aAAa,GAAW,OAAO,KAAK,MAAM,YAAY;IACtD,cAAc,GAAW,OAAO,KAAK,MAAM,aAAa;IACxD,aAAa,GAAW,OAAO,KAAK,MAAM,YAAY;IACtD,MAAM,GAAW,OAAO,KAAK,MAAM,KAAK;IACzC,CAAC,CACD,KAAK,KAAK,MAAM,CAChB,MAAM,GAAG,KAAK,MAAM,QAAQ,OAAO,CAAC;AACvC,UAAO,GAAG,MAAM;IAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { RequiredServiceActor } from "../base/base.actor.mjs";
|
|
3
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
4
|
+
import { AiUsageRepository, AiUsageRow } from "./ai.repository.mjs";
|
|
5
|
+
import { IdeogramV3GenerateInput, IdeogramV3GenerateOutput } from "./ideogram/ideogram.dto.mjs";
|
|
6
|
+
import { IdeogramService } from "./ideogram/ideogram.service.mjs";
|
|
7
|
+
import { ZodType, z } from "zod";
|
|
8
|
+
import { MDocument } from "@mastra/rag";
|
|
9
|
+
import { ModelMessage, generateText } from "ai";
|
|
10
|
+
import { Mastra } from "@mastra/core";
|
|
11
|
+
import { FullOutput, MastraModelOutput } from "@mastra/core/stream";
|
|
12
|
+
import { OpenRouterProvider } from "@openrouter/ai-sdk-provider";
|
|
13
|
+
import Replicate from "replicate";
|
|
14
|
+
|
|
15
|
+
//#region src/modules/ai/ai.service.d.ts
|
|
16
|
+
type MastraAgent = ReturnType<Mastra["getAgent"]>;
|
|
17
|
+
type MastraAgentGenerateOptions = Parameters<MastraAgent["generate"]>[1];
|
|
18
|
+
type MessageListInput = {
|
|
19
|
+
role: "user" | "assistant" | "system";
|
|
20
|
+
content: string;
|
|
21
|
+
}[];
|
|
22
|
+
type GenerateTextParams = Parameters<typeof generateText>[0];
|
|
23
|
+
type GenerateTextInput = {
|
|
24
|
+
prompt: string | ModelMessage[];
|
|
25
|
+
messages?: never;
|
|
26
|
+
} | {
|
|
27
|
+
messages: ModelMessage[];
|
|
28
|
+
prompt?: never;
|
|
29
|
+
};
|
|
30
|
+
type AIServiceActorContext = {
|
|
31
|
+
actor: RequiredServiceActor<"user">;
|
|
32
|
+
};
|
|
33
|
+
type AIServiceGenerateTextParams = Omit<GenerateTextParams, "model" | "prompt" | "messages"> & GenerateTextInput & {
|
|
34
|
+
model: string;
|
|
35
|
+
removeMDash?: boolean;
|
|
36
|
+
ctx?: AIServiceActorContext;
|
|
37
|
+
};
|
|
38
|
+
type AIServiceGenerateObjectParams<T extends ZodType> = Omit<GenerateTextParams, "model" | "prompt" | "messages" | "output"> & GenerateTextInput & {
|
|
39
|
+
model: string;
|
|
40
|
+
schema: T;
|
|
41
|
+
repairAttempts?: number;
|
|
42
|
+
repairModel?: string;
|
|
43
|
+
ctx?: AIServiceActorContext;
|
|
44
|
+
};
|
|
45
|
+
declare class AIService<MastraInstance extends Mastra> extends BaseService<{
|
|
46
|
+
aiUsage?: AiUsageRepository;
|
|
47
|
+
}, {
|
|
48
|
+
ideogram?: IdeogramService;
|
|
49
|
+
}> {
|
|
50
|
+
helpers: {
|
|
51
|
+
arrayToPseudoXML: any;
|
|
52
|
+
};
|
|
53
|
+
mastra?: MastraInstance;
|
|
54
|
+
openrouter?: OpenRouterProvider;
|
|
55
|
+
replicate?: Replicate;
|
|
56
|
+
constructor(repositories: {
|
|
57
|
+
aiUsage?: AiUsageRepository;
|
|
58
|
+
}, services: {
|
|
59
|
+
ideogram?: IdeogramService;
|
|
60
|
+
}, libs: {
|
|
61
|
+
mastra?: MastraInstance;
|
|
62
|
+
openrouter?: OpenRouterProvider;
|
|
63
|
+
replicate?: Replicate;
|
|
64
|
+
});
|
|
65
|
+
getMastra(): MastraInstance;
|
|
66
|
+
prepareModel(model: string): ReturnType<OpenRouterProvider["chat"]>;
|
|
67
|
+
prepareEmbeddingModel(model: string): ReturnType<OpenRouterProvider["textEmbeddingModel"]>;
|
|
68
|
+
agentUse(agent: string, options: MastraAgentGenerateOptions & {
|
|
69
|
+
prompt?: string;
|
|
70
|
+
messages?: MessageListInput;
|
|
71
|
+
}, ctx?: AIServiceActorContext & {
|
|
72
|
+
model?: string;
|
|
73
|
+
}): ServerResultAsync<Awaited<ReturnType<MastraModelOutput<any>["getFullOutput"]>>>;
|
|
74
|
+
agentText(agent: string, options: MastraAgentGenerateOptions & {
|
|
75
|
+
prompt?: string;
|
|
76
|
+
messages?: MessageListInput;
|
|
77
|
+
}, ctx?: AIServiceActorContext & {
|
|
78
|
+
model?: string;
|
|
79
|
+
}): ServerResultAsync<string>;
|
|
80
|
+
agentTextResult(agent: string, options: MastraAgentGenerateOptions & {
|
|
81
|
+
prompt?: string;
|
|
82
|
+
messages?: MessageListInput;
|
|
83
|
+
}, ctx?: AIServiceActorContext & {
|
|
84
|
+
model?: string;
|
|
85
|
+
}): ServerResultAsync<FullOutput<any>>;
|
|
86
|
+
agentObject<T extends ZodType<any>>(agent: string, options: MastraAgentGenerateOptions & {
|
|
87
|
+
schema: T;
|
|
88
|
+
prompt?: string;
|
|
89
|
+
messages?: MessageListInput;
|
|
90
|
+
}, ctx?: AIServiceActorContext & {
|
|
91
|
+
model?: string;
|
|
92
|
+
}): ServerResultAsync<z.infer<T>>;
|
|
93
|
+
agentObjectResult<T extends ZodType<any>>(agent: string, options: MastraAgentGenerateOptions & {
|
|
94
|
+
schema: T;
|
|
95
|
+
prompt?: string;
|
|
96
|
+
messages?: MessageListInput;
|
|
97
|
+
}, ctx?: AIServiceActorContext & {
|
|
98
|
+
model?: string;
|
|
99
|
+
}): ServerResultAsync<FullOutput<any> & {
|
|
100
|
+
object: z.infer<T>;
|
|
101
|
+
}>;
|
|
102
|
+
embedDocument(value: string, options?: Parameters<ReturnType<typeof MDocument.fromText>["chunk"]>[0], type?: "text" | "markdown" | "html" | "json", model?: string): ServerResultAsync<{
|
|
103
|
+
embeddings: number[][];
|
|
104
|
+
chunks: {
|
|
105
|
+
text: string;
|
|
106
|
+
}[];
|
|
107
|
+
}>;
|
|
108
|
+
embed(text: string, model?: string): ServerResultAsync<{
|
|
109
|
+
embedding: number[];
|
|
110
|
+
}>;
|
|
111
|
+
embedMany(chunks: {
|
|
112
|
+
text: string;
|
|
113
|
+
}[], model?: string): ServerResultAsync<{
|
|
114
|
+
embeddings: number[][];
|
|
115
|
+
}>;
|
|
116
|
+
generateText(params: AIServiceGenerateTextParams): ServerResultAsync<string>;
|
|
117
|
+
generateObject<T extends ZodType>(params: AIServiceGenerateObjectParams<T>): ServerResultAsync<z.infer<T>>;
|
|
118
|
+
generateReplicate(model: Parameters<Replicate["run"]>[0], options: Parameters<Replicate["run"]>[1]): ServerResultAsync<object>;
|
|
119
|
+
generateTranscript(file_url: string): ServerResultAsync<{
|
|
120
|
+
text: string;
|
|
121
|
+
metadata: unknown;
|
|
122
|
+
}>;
|
|
123
|
+
generateIdeogram(input: IdeogramV3GenerateInput): ServerResultAsync<IdeogramV3GenerateOutput>;
|
|
124
|
+
getUsage(userId: string): ServerResultAsync<Pick<AiUsageRow, "inputTokens" | "outputTokens" | "totalTokens" | "cost">>;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { AIService };
|
|
128
|
+
//# sourceMappingURL=ai.service.d.mts.map
|