@m5kdev/backend 0.7.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.d.ts +0 -1
- 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.d.ts +0 -1
- 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 -125
- 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 -4869
- 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 -78
- package/dist/src/modules/auth/auth.service.js +0 -259
- 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.actor.d.ts +0 -68
- package/dist/src/modules/base/base.actor.js +0 -99
- package/dist/src/modules/base/base.actor.test.js +0 -58
- 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 -24
- package/dist/src/modules/base/base.grants.js +0 -135
- package/dist/src/modules/base/base.grants.test.js +0 -639
- package/dist/src/modules/base/base.procedure.d.ts +0 -109
- package/dist/src/modules/base/base.procedure.js +0 -301
- 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 -40
- package/dist/src/modules/base/base.service.js +0 -123
- package/dist/src/modules/base/base.service.test.js +0 -443
- 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 -38
- 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 -15
- 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 -96
- package/dist/src/modules/connect/connect.service.js +0 -116
- 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 -80
- package/dist/src/modules/recurrence/recurrence.service.js +0 -72
- 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 -27
- 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 -113
- 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 -61
- 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 -48
- package/dist/src/utils/trpc.js +0 -158
- package/dist/src/utils/trpc.test.js +0 -154
- 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/{utils/trpc.test.d.ts → modules/ai/ai.router.mjs} +0 -0
- /package/dist/src/modules/{social/social.linkedin.test.d.ts → base/base.types.mjs} +0 -0
- /package/dist/src/modules/{base/base.service.test.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.actor.test.d.ts → workflow/workflow.types.mjs} +0 -0
- /package/dist/src/{modules/ai/ai.router.d.ts → utils/types.mjs} +0 -0
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import type { InferInsertModel, InferSelectModel } from "drizzle-orm";
|
|
2
|
-
import type { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
3
|
-
import type { ServerResultAsync } from "../base/base.dto";
|
|
4
|
-
import { BaseTableRepository } from "../base/base.repository";
|
|
5
|
-
declare const schema: {
|
|
6
|
-
chats: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
7
|
-
name: "chats";
|
|
8
|
-
schema: undefined;
|
|
9
|
-
columns: {
|
|
10
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
11
|
-
name: "id";
|
|
12
|
-
tableName: "chats";
|
|
13
|
-
dataType: "string";
|
|
14
|
-
columnType: "SQLiteText";
|
|
15
|
-
data: string;
|
|
16
|
-
driverParam: string;
|
|
17
|
-
notNull: true;
|
|
18
|
-
hasDefault: true;
|
|
19
|
-
isPrimaryKey: true;
|
|
20
|
-
isAutoincrement: false;
|
|
21
|
-
hasRuntimeDefault: true;
|
|
22
|
-
enumValues: [string, ...string[]];
|
|
23
|
-
baseColumn: never;
|
|
24
|
-
identity: undefined;
|
|
25
|
-
generated: undefined;
|
|
26
|
-
}, {}, {
|
|
27
|
-
length: number | undefined;
|
|
28
|
-
}>;
|
|
29
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
30
|
-
name: "user_id";
|
|
31
|
-
tableName: "chats";
|
|
32
|
-
dataType: "string";
|
|
33
|
-
columnType: "SQLiteText";
|
|
34
|
-
data: string;
|
|
35
|
-
driverParam: string;
|
|
36
|
-
notNull: true;
|
|
37
|
-
hasDefault: false;
|
|
38
|
-
isPrimaryKey: false;
|
|
39
|
-
isAutoincrement: false;
|
|
40
|
-
hasRuntimeDefault: false;
|
|
41
|
-
enumValues: [string, ...string[]];
|
|
42
|
-
baseColumn: never;
|
|
43
|
-
identity: undefined;
|
|
44
|
-
generated: undefined;
|
|
45
|
-
}, {}, {
|
|
46
|
-
length: number | undefined;
|
|
47
|
-
}>;
|
|
48
|
-
title: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
49
|
-
name: "title";
|
|
50
|
-
tableName: "chats";
|
|
51
|
-
dataType: "string";
|
|
52
|
-
columnType: "SQLiteText";
|
|
53
|
-
data: string;
|
|
54
|
-
driverParam: string;
|
|
55
|
-
notNull: false;
|
|
56
|
-
hasDefault: false;
|
|
57
|
-
isPrimaryKey: false;
|
|
58
|
-
isAutoincrement: false;
|
|
59
|
-
hasRuntimeDefault: false;
|
|
60
|
-
enumValues: [string, ...string[]];
|
|
61
|
-
baseColumn: never;
|
|
62
|
-
identity: undefined;
|
|
63
|
-
generated: undefined;
|
|
64
|
-
}, {}, {
|
|
65
|
-
length: number | undefined;
|
|
66
|
-
}>;
|
|
67
|
-
type: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
68
|
-
name: "type";
|
|
69
|
-
tableName: "chats";
|
|
70
|
-
dataType: "string";
|
|
71
|
-
columnType: "SQLiteText";
|
|
72
|
-
data: string;
|
|
73
|
-
driverParam: string;
|
|
74
|
-
notNull: false;
|
|
75
|
-
hasDefault: false;
|
|
76
|
-
isPrimaryKey: false;
|
|
77
|
-
isAutoincrement: false;
|
|
78
|
-
hasRuntimeDefault: false;
|
|
79
|
-
enumValues: [string, ...string[]];
|
|
80
|
-
baseColumn: never;
|
|
81
|
-
identity: undefined;
|
|
82
|
-
generated: undefined;
|
|
83
|
-
}, {}, {
|
|
84
|
-
length: number | undefined;
|
|
85
|
-
}>;
|
|
86
|
-
conversation: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
87
|
-
name: "conversation";
|
|
88
|
-
tableName: "chats";
|
|
89
|
-
dataType: "json";
|
|
90
|
-
columnType: "SQLiteTextJson";
|
|
91
|
-
data: unknown;
|
|
92
|
-
driverParam: string;
|
|
93
|
-
notNull: false;
|
|
94
|
-
hasDefault: false;
|
|
95
|
-
isPrimaryKey: false;
|
|
96
|
-
isAutoincrement: false;
|
|
97
|
-
hasRuntimeDefault: false;
|
|
98
|
-
enumValues: undefined;
|
|
99
|
-
baseColumn: never;
|
|
100
|
-
identity: undefined;
|
|
101
|
-
generated: undefined;
|
|
102
|
-
}, {}, {}>;
|
|
103
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
104
|
-
name: "created_at";
|
|
105
|
-
tableName: "chats";
|
|
106
|
-
dataType: "date";
|
|
107
|
-
columnType: "SQLiteTimestamp";
|
|
108
|
-
data: Date;
|
|
109
|
-
driverParam: number;
|
|
110
|
-
notNull: false;
|
|
111
|
-
hasDefault: true;
|
|
112
|
-
isPrimaryKey: false;
|
|
113
|
-
isAutoincrement: false;
|
|
114
|
-
hasRuntimeDefault: true;
|
|
115
|
-
enumValues: undefined;
|
|
116
|
-
baseColumn: never;
|
|
117
|
-
identity: undefined;
|
|
118
|
-
generated: undefined;
|
|
119
|
-
}, {}, {}>;
|
|
120
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
121
|
-
name: "updated_at";
|
|
122
|
-
tableName: "chats";
|
|
123
|
-
dataType: "date";
|
|
124
|
-
columnType: "SQLiteTimestamp";
|
|
125
|
-
data: Date;
|
|
126
|
-
driverParam: number;
|
|
127
|
-
notNull: true;
|
|
128
|
-
hasDefault: true;
|
|
129
|
-
isPrimaryKey: false;
|
|
130
|
-
isAutoincrement: false;
|
|
131
|
-
hasRuntimeDefault: true;
|
|
132
|
-
enumValues: undefined;
|
|
133
|
-
baseColumn: never;
|
|
134
|
-
identity: undefined;
|
|
135
|
-
generated: undefined;
|
|
136
|
-
}, {}, {}>;
|
|
137
|
-
};
|
|
138
|
-
dialect: "sqlite";
|
|
139
|
-
}>;
|
|
140
|
-
aiUsage: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
141
|
-
name: "ai_usage";
|
|
142
|
-
schema: undefined;
|
|
143
|
-
columns: {
|
|
144
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
145
|
-
name: "id";
|
|
146
|
-
tableName: "ai_usage";
|
|
147
|
-
dataType: "string";
|
|
148
|
-
columnType: "SQLiteText";
|
|
149
|
-
data: string;
|
|
150
|
-
driverParam: string;
|
|
151
|
-
notNull: true;
|
|
152
|
-
hasDefault: true;
|
|
153
|
-
isPrimaryKey: true;
|
|
154
|
-
isAutoincrement: false;
|
|
155
|
-
hasRuntimeDefault: true;
|
|
156
|
-
enumValues: [string, ...string[]];
|
|
157
|
-
baseColumn: never;
|
|
158
|
-
identity: undefined;
|
|
159
|
-
generated: undefined;
|
|
160
|
-
}, {}, {
|
|
161
|
-
length: number | undefined;
|
|
162
|
-
}>;
|
|
163
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
164
|
-
name: "user_id";
|
|
165
|
-
tableName: "ai_usage";
|
|
166
|
-
dataType: "string";
|
|
167
|
-
columnType: "SQLiteText";
|
|
168
|
-
data: string;
|
|
169
|
-
driverParam: string;
|
|
170
|
-
notNull: false;
|
|
171
|
-
hasDefault: false;
|
|
172
|
-
isPrimaryKey: false;
|
|
173
|
-
isAutoincrement: false;
|
|
174
|
-
hasRuntimeDefault: false;
|
|
175
|
-
enumValues: [string, ...string[]];
|
|
176
|
-
baseColumn: never;
|
|
177
|
-
identity: undefined;
|
|
178
|
-
generated: undefined;
|
|
179
|
-
}, {}, {
|
|
180
|
-
length: number | undefined;
|
|
181
|
-
}>;
|
|
182
|
-
teamId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
183
|
-
name: "team_id";
|
|
184
|
-
tableName: "ai_usage";
|
|
185
|
-
dataType: "string";
|
|
186
|
-
columnType: "SQLiteText";
|
|
187
|
-
data: string;
|
|
188
|
-
driverParam: string;
|
|
189
|
-
notNull: false;
|
|
190
|
-
hasDefault: false;
|
|
191
|
-
isPrimaryKey: false;
|
|
192
|
-
isAutoincrement: false;
|
|
193
|
-
hasRuntimeDefault: false;
|
|
194
|
-
enumValues: [string, ...string[]];
|
|
195
|
-
baseColumn: never;
|
|
196
|
-
identity: undefined;
|
|
197
|
-
generated: undefined;
|
|
198
|
-
}, {}, {
|
|
199
|
-
length: number | undefined;
|
|
200
|
-
}>;
|
|
201
|
-
organizationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
202
|
-
name: "organization_id";
|
|
203
|
-
tableName: "ai_usage";
|
|
204
|
-
dataType: "string";
|
|
205
|
-
columnType: "SQLiteText";
|
|
206
|
-
data: string;
|
|
207
|
-
driverParam: string;
|
|
208
|
-
notNull: false;
|
|
209
|
-
hasDefault: false;
|
|
210
|
-
isPrimaryKey: false;
|
|
211
|
-
isAutoincrement: false;
|
|
212
|
-
hasRuntimeDefault: false;
|
|
213
|
-
enumValues: [string, ...string[]];
|
|
214
|
-
baseColumn: never;
|
|
215
|
-
identity: undefined;
|
|
216
|
-
generated: undefined;
|
|
217
|
-
}, {}, {
|
|
218
|
-
length: number | undefined;
|
|
219
|
-
}>;
|
|
220
|
-
feature: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
221
|
-
name: "feature";
|
|
222
|
-
tableName: "ai_usage";
|
|
223
|
-
dataType: "string";
|
|
224
|
-
columnType: "SQLiteText";
|
|
225
|
-
data: string;
|
|
226
|
-
driverParam: string;
|
|
227
|
-
notNull: true;
|
|
228
|
-
hasDefault: false;
|
|
229
|
-
isPrimaryKey: false;
|
|
230
|
-
isAutoincrement: false;
|
|
231
|
-
hasRuntimeDefault: false;
|
|
232
|
-
enumValues: [string, ...string[]];
|
|
233
|
-
baseColumn: never;
|
|
234
|
-
identity: undefined;
|
|
235
|
-
generated: undefined;
|
|
236
|
-
}, {}, {
|
|
237
|
-
length: number | undefined;
|
|
238
|
-
}>;
|
|
239
|
-
provider: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
240
|
-
name: "provider";
|
|
241
|
-
tableName: "ai_usage";
|
|
242
|
-
dataType: "string";
|
|
243
|
-
columnType: "SQLiteText";
|
|
244
|
-
data: string;
|
|
245
|
-
driverParam: string;
|
|
246
|
-
notNull: true;
|
|
247
|
-
hasDefault: false;
|
|
248
|
-
isPrimaryKey: false;
|
|
249
|
-
isAutoincrement: false;
|
|
250
|
-
hasRuntimeDefault: false;
|
|
251
|
-
enumValues: [string, ...string[]];
|
|
252
|
-
baseColumn: never;
|
|
253
|
-
identity: undefined;
|
|
254
|
-
generated: undefined;
|
|
255
|
-
}, {}, {
|
|
256
|
-
length: number | undefined;
|
|
257
|
-
}>;
|
|
258
|
-
model: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
259
|
-
name: "model";
|
|
260
|
-
tableName: "ai_usage";
|
|
261
|
-
dataType: "string";
|
|
262
|
-
columnType: "SQLiteText";
|
|
263
|
-
data: string;
|
|
264
|
-
driverParam: string;
|
|
265
|
-
notNull: true;
|
|
266
|
-
hasDefault: false;
|
|
267
|
-
isPrimaryKey: false;
|
|
268
|
-
isAutoincrement: false;
|
|
269
|
-
hasRuntimeDefault: false;
|
|
270
|
-
enumValues: [string, ...string[]];
|
|
271
|
-
baseColumn: never;
|
|
272
|
-
identity: undefined;
|
|
273
|
-
generated: undefined;
|
|
274
|
-
}, {}, {
|
|
275
|
-
length: number | undefined;
|
|
276
|
-
}>;
|
|
277
|
-
inputTokens: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
278
|
-
name: "input_tokens";
|
|
279
|
-
tableName: "ai_usage";
|
|
280
|
-
dataType: "number";
|
|
281
|
-
columnType: "SQLiteInteger";
|
|
282
|
-
data: number;
|
|
283
|
-
driverParam: number;
|
|
284
|
-
notNull: false;
|
|
285
|
-
hasDefault: false;
|
|
286
|
-
isPrimaryKey: false;
|
|
287
|
-
isAutoincrement: false;
|
|
288
|
-
hasRuntimeDefault: false;
|
|
289
|
-
enumValues: undefined;
|
|
290
|
-
baseColumn: never;
|
|
291
|
-
identity: undefined;
|
|
292
|
-
generated: undefined;
|
|
293
|
-
}, {}, {}>;
|
|
294
|
-
outputTokens: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
295
|
-
name: "output_tokens";
|
|
296
|
-
tableName: "ai_usage";
|
|
297
|
-
dataType: "number";
|
|
298
|
-
columnType: "SQLiteInteger";
|
|
299
|
-
data: number;
|
|
300
|
-
driverParam: number;
|
|
301
|
-
notNull: false;
|
|
302
|
-
hasDefault: false;
|
|
303
|
-
isPrimaryKey: false;
|
|
304
|
-
isAutoincrement: false;
|
|
305
|
-
hasRuntimeDefault: false;
|
|
306
|
-
enumValues: undefined;
|
|
307
|
-
baseColumn: never;
|
|
308
|
-
identity: undefined;
|
|
309
|
-
generated: undefined;
|
|
310
|
-
}, {}, {}>;
|
|
311
|
-
totalTokens: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
312
|
-
name: "total_tokens";
|
|
313
|
-
tableName: "ai_usage";
|
|
314
|
-
dataType: "number";
|
|
315
|
-
columnType: "SQLiteInteger";
|
|
316
|
-
data: number;
|
|
317
|
-
driverParam: number;
|
|
318
|
-
notNull: false;
|
|
319
|
-
hasDefault: false;
|
|
320
|
-
isPrimaryKey: false;
|
|
321
|
-
isAutoincrement: false;
|
|
322
|
-
hasRuntimeDefault: false;
|
|
323
|
-
enumValues: undefined;
|
|
324
|
-
baseColumn: never;
|
|
325
|
-
identity: undefined;
|
|
326
|
-
generated: undefined;
|
|
327
|
-
}, {}, {}>;
|
|
328
|
-
cost: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
329
|
-
name: "cost";
|
|
330
|
-
tableName: "ai_usage";
|
|
331
|
-
dataType: "number";
|
|
332
|
-
columnType: "SQLiteReal";
|
|
333
|
-
data: number;
|
|
334
|
-
driverParam: number;
|
|
335
|
-
notNull: false;
|
|
336
|
-
hasDefault: false;
|
|
337
|
-
isPrimaryKey: false;
|
|
338
|
-
isAutoincrement: false;
|
|
339
|
-
hasRuntimeDefault: false;
|
|
340
|
-
enumValues: undefined;
|
|
341
|
-
baseColumn: never;
|
|
342
|
-
identity: undefined;
|
|
343
|
-
generated: undefined;
|
|
344
|
-
}, {}, {}>;
|
|
345
|
-
traceId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
346
|
-
name: "trace_id";
|
|
347
|
-
tableName: "ai_usage";
|
|
348
|
-
dataType: "string";
|
|
349
|
-
columnType: "SQLiteText";
|
|
350
|
-
data: string;
|
|
351
|
-
driverParam: string;
|
|
352
|
-
notNull: false;
|
|
353
|
-
hasDefault: false;
|
|
354
|
-
isPrimaryKey: false;
|
|
355
|
-
isAutoincrement: false;
|
|
356
|
-
hasRuntimeDefault: false;
|
|
357
|
-
enumValues: [string, ...string[]];
|
|
358
|
-
baseColumn: never;
|
|
359
|
-
identity: undefined;
|
|
360
|
-
generated: undefined;
|
|
361
|
-
}, {}, {
|
|
362
|
-
length: number | undefined;
|
|
363
|
-
}>;
|
|
364
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
365
|
-
name: "created_at";
|
|
366
|
-
tableName: "ai_usage";
|
|
367
|
-
dataType: "date";
|
|
368
|
-
columnType: "SQLiteTimestamp";
|
|
369
|
-
data: Date;
|
|
370
|
-
driverParam: number;
|
|
371
|
-
notNull: true;
|
|
372
|
-
hasDefault: true;
|
|
373
|
-
isPrimaryKey: false;
|
|
374
|
-
isAutoincrement: false;
|
|
375
|
-
hasRuntimeDefault: true;
|
|
376
|
-
enumValues: undefined;
|
|
377
|
-
baseColumn: never;
|
|
378
|
-
identity: undefined;
|
|
379
|
-
generated: undefined;
|
|
380
|
-
}, {}, {}>;
|
|
381
|
-
metadata: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
382
|
-
name: "metadata";
|
|
383
|
-
tableName: "ai_usage";
|
|
384
|
-
dataType: "json";
|
|
385
|
-
columnType: "SQLiteTextJson";
|
|
386
|
-
data: unknown;
|
|
387
|
-
driverParam: string;
|
|
388
|
-
notNull: false;
|
|
389
|
-
hasDefault: false;
|
|
390
|
-
isPrimaryKey: false;
|
|
391
|
-
isAutoincrement: false;
|
|
392
|
-
hasRuntimeDefault: false;
|
|
393
|
-
enumValues: undefined;
|
|
394
|
-
baseColumn: never;
|
|
395
|
-
identity: undefined;
|
|
396
|
-
generated: undefined;
|
|
397
|
-
}, {}, {}>;
|
|
398
|
-
};
|
|
399
|
-
dialect: "sqlite";
|
|
400
|
-
}>;
|
|
401
|
-
};
|
|
402
|
-
type Schema = typeof schema;
|
|
403
|
-
type Orm = LibSQLDatabase<Schema>;
|
|
404
|
-
export type AiUsageRow = InferSelectModel<Schema["aiUsage"]>;
|
|
405
|
-
export type AiUsageInsert = InferInsertModel<Schema["aiUsage"]>;
|
|
406
|
-
export interface CreateAiUsageInput {
|
|
407
|
-
userId?: string;
|
|
408
|
-
teamId?: string;
|
|
409
|
-
organizationId?: string;
|
|
410
|
-
feature: string;
|
|
411
|
-
provider: string;
|
|
412
|
-
model: string;
|
|
413
|
-
inputTokens?: number;
|
|
414
|
-
outputTokens?: number;
|
|
415
|
-
totalTokens?: number;
|
|
416
|
-
cost?: number;
|
|
417
|
-
traceId?: string;
|
|
418
|
-
metadata?: unknown;
|
|
419
|
-
}
|
|
420
|
-
export declare class AiUsageRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["aiUsage"]> {
|
|
421
|
-
getUsage(userId: string): ServerResultAsync<Pick<AiUsageRow, "inputTokens" | "outputTokens" | "totalTokens" | "cost">>;
|
|
422
|
-
}
|
|
423
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AiUsageRepository = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const drizzle_orm_1 = require("drizzle-orm");
|
|
6
|
-
const neverthrow_1 = require("neverthrow");
|
|
7
|
-
const ai = tslib_1.__importStar(require("./ai.db"));
|
|
8
|
-
const base_repository_1 = require("../base/base.repository");
|
|
9
|
-
const schema = { ...ai };
|
|
10
|
-
class AiUsageRepository extends base_repository_1.BaseTableRepository {
|
|
11
|
-
getUsage(userId) {
|
|
12
|
-
return this.throwableAsync(async () => {
|
|
13
|
-
const [usage] = await this.orm
|
|
14
|
-
.select({
|
|
15
|
-
inputTokens: (0, drizzle_orm_1.sql) `SUM(${this.table.inputTokens})`,
|
|
16
|
-
outputTokens: (0, drizzle_orm_1.sql) `SUM(${this.table.outputTokens})`,
|
|
17
|
-
totalTokens: (0, drizzle_orm_1.sql) `SUM(${this.table.totalTokens})`,
|
|
18
|
-
cost: (0, drizzle_orm_1.sql) `SUM(${this.table.cost})`,
|
|
19
|
-
})
|
|
20
|
-
.from(this.table)
|
|
21
|
-
.where((0, drizzle_orm_1.eq)(this.table.userId, userId));
|
|
22
|
-
return (0, neverthrow_1.ok)(usage);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.AiUsageRepository = AiUsageRepository;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import { openai } from "@ai-sdk/openai";
|
|
3
|
-
// import { open}
|
|
4
|
-
// import { withTracing } from "@posthog/ai";
|
|
5
|
-
// import {
|
|
6
|
-
// appendClientMessage,
|
|
7
|
-
// appendResponseMessages,
|
|
8
|
-
// type Message,
|
|
9
|
-
// streamText,
|
|
10
|
-
// type Tool,
|
|
11
|
-
// } from "ai";
|
|
12
|
-
// import bodyParser from "body-parser";
|
|
13
|
-
// import { and, eq } from "drizzle-orm";
|
|
14
|
-
// import express, { type Response, type Router } from "express";
|
|
15
|
-
// import { v4 as uuidv4 } from "uuid";
|
|
16
|
-
// import type { AuthRequest, createAuthMiddleware } from "../auth/auth.middleware";
|
|
17
|
-
// import { type Orm, schema } from "../db";
|
|
18
|
-
// import { logger } from "../logger";
|
|
19
|
-
// import { posthogClient } from "../posthog";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
// export type Tooling = Record<
|
|
22
|
-
// string,
|
|
23
|
-
// {
|
|
24
|
-
// getMesseges: (chatId: string) => Promise<Message[]>;
|
|
25
|
-
// getTools: (chatId: string) => Promise<
|
|
26
|
-
// Record<
|
|
27
|
-
// string,
|
|
28
|
-
// {
|
|
29
|
-
// tool: Tool;
|
|
30
|
-
// handler?: (
|
|
31
|
-
// chatId: string,
|
|
32
|
-
// args: unknown,
|
|
33
|
-
// user: NonNullable<AuthRequest["user"]>
|
|
34
|
-
// ) => Promise<void>;
|
|
35
|
-
// }
|
|
36
|
-
// >
|
|
37
|
-
// >;
|
|
38
|
-
// }
|
|
39
|
-
// >;
|
|
40
|
-
// export function tracedOpenAiModel(
|
|
41
|
-
// model: Parameters<typeof openai>[0],
|
|
42
|
-
// clientOptions: Parameters<typeof withTracing>[2]
|
|
43
|
-
// ) {
|
|
44
|
-
// return withTracing(openai(model), posthogClient, clientOptions);
|
|
45
|
-
// }
|
|
46
|
-
// async function getRouteSettings(id: string, name: string, settings: Tooling) {
|
|
47
|
-
// const entity = settings[name as keyof typeof settings];
|
|
48
|
-
// if (!entity) return { tools: {}, entityMesseges: [], entityTools: {} };
|
|
49
|
-
// const entityTools = await entity.getTools(id);
|
|
50
|
-
// const entityMesseges = await entity.getMesseges(id);
|
|
51
|
-
// const tools = Object.entries(entityTools).reduce<
|
|
52
|
-
// Record<string, (typeof entityTools)[keyof typeof entityTools]["tool"]>
|
|
53
|
-
// >((acc, [key, value]) => {
|
|
54
|
-
// acc[key] = value.tool as (typeof entityTools)[keyof typeof entityTools]["tool"];
|
|
55
|
-
// return acc;
|
|
56
|
-
// }, {});
|
|
57
|
-
// return { tools, entityMesseges, entityTools };
|
|
58
|
-
// }
|
|
59
|
-
// export function createAiRouter(
|
|
60
|
-
// orm: Orm,
|
|
61
|
-
// authMiddleware: ReturnType<typeof createAuthMiddleware>,
|
|
62
|
-
// settings: Tooling
|
|
63
|
-
// ) {
|
|
64
|
-
// const aiRouter: Router = express.Router();
|
|
65
|
-
// aiRouter.use(bodyParser.json());
|
|
66
|
-
// aiRouter.post("/completion/:name", authMiddleware, async (req: AuthRequest, res: Response) => {
|
|
67
|
-
// try {
|
|
68
|
-
// const { id, message } = req.body as {
|
|
69
|
-
// id: string;
|
|
70
|
-
// message: Message;
|
|
71
|
-
// };
|
|
72
|
-
// logger.info(req.body, "body");
|
|
73
|
-
// const { name } = req.params;
|
|
74
|
-
// const user = req.user!;
|
|
75
|
-
// logger.info(message, "Received message:");
|
|
76
|
-
// const { tools, entityMesseges, entityTools } = await getRouteSettings(id, name, settings);
|
|
77
|
-
// const [chat] = await orm
|
|
78
|
-
// .select()
|
|
79
|
-
// .from(schema.chats)
|
|
80
|
-
// .where(and(eq(schema.chats.id, id), eq(schema.chats.userId, user.id)));
|
|
81
|
-
// if (!chat) throw new Error("Chat not found");
|
|
82
|
-
// const messages = appendClientMessage({
|
|
83
|
-
// messages: (chat.conversation || []) as Message[],
|
|
84
|
-
// message,
|
|
85
|
-
// });
|
|
86
|
-
// // Process any tool invocations in the message
|
|
87
|
-
// const toolInvocation = message?.parts?.find((p) => p.type === "tool-invocation");
|
|
88
|
-
// if (toolInvocation) {
|
|
89
|
-
// logger.info(toolInvocation, "Processing tool invocation:");
|
|
90
|
-
// const tool =
|
|
91
|
-
// entityTools[toolInvocation.toolInvocation.toolName as keyof typeof entityTools];
|
|
92
|
-
// if (tool?.handler) {
|
|
93
|
-
// const result = await tool.handler(id, toolInvocation.toolInvocation.args, user);
|
|
94
|
-
// logger.info({ result }, "Tool handler result:");
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
|
-
// logger.info([...entityMesseges, ...messages], "Processed messages");
|
|
98
|
-
// const result = streamText({
|
|
99
|
-
// model: tracedOpenAiModel("gpt-4o", {
|
|
100
|
-
// posthogDistinctId: user.id,
|
|
101
|
-
// posthogProperties: { conversation_id: id, paid: true },
|
|
102
|
-
// posthogPrivacyMode: false,
|
|
103
|
-
// }),
|
|
104
|
-
// experimental_generateMessageId: uuidv4,
|
|
105
|
-
// messages: [...entityMesseges, ...messages],
|
|
106
|
-
// async onFinish({ response }) {
|
|
107
|
-
// logger.info(response, "Final response:");
|
|
108
|
-
// try {
|
|
109
|
-
// await orm
|
|
110
|
-
// .update(schema.chats)
|
|
111
|
-
// .set({
|
|
112
|
-
// conversation: appendResponseMessages({
|
|
113
|
-
// messages,
|
|
114
|
-
// responseMessages: response.messages,
|
|
115
|
-
// }),
|
|
116
|
-
// })
|
|
117
|
-
// .where(eq(schema.chats.id, id));
|
|
118
|
-
// } catch (error) {
|
|
119
|
-
// logger.error("Error in onFinish handler:", error);
|
|
120
|
-
// }
|
|
121
|
-
// },
|
|
122
|
-
// tools,
|
|
123
|
-
// });
|
|
124
|
-
// result.consumeStream();
|
|
125
|
-
// result.pipeDataStreamToResponse(res);
|
|
126
|
-
// } catch (error) {
|
|
127
|
-
// logger.error(error, "Error in ai handler");
|
|
128
|
-
// res.status(500).send({ error: "Internal Server Error" });
|
|
129
|
-
// }
|
|
130
|
-
// });
|
|
131
|
-
// return aiRouter;
|
|
132
|
-
// }
|