@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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
3
|
+
import { WebhookStatus } from "./webhook.constants.mjs";
|
|
4
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
5
|
+
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/webhook/webhook.repository.d.ts
|
|
8
|
+
declare const schema: {
|
|
9
|
+
webhook: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
10
|
+
name: "webhook";
|
|
11
|
+
schema: undefined;
|
|
12
|
+
columns: {
|
|
13
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
14
|
+
name: "id";
|
|
15
|
+
tableName: "webhook";
|
|
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
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
33
|
+
name: "created_at";
|
|
34
|
+
tableName: "webhook";
|
|
35
|
+
dataType: "date";
|
|
36
|
+
columnType: "SQLiteTimestamp";
|
|
37
|
+
data: Date;
|
|
38
|
+
driverParam: number;
|
|
39
|
+
notNull: true;
|
|
40
|
+
hasDefault: true;
|
|
41
|
+
isPrimaryKey: false;
|
|
42
|
+
isAutoincrement: false;
|
|
43
|
+
hasRuntimeDefault: true;
|
|
44
|
+
enumValues: undefined;
|
|
45
|
+
baseColumn: never;
|
|
46
|
+
identity: undefined;
|
|
47
|
+
generated: undefined;
|
|
48
|
+
}, {}, {}>;
|
|
49
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
50
|
+
name: "updated_at";
|
|
51
|
+
tableName: "webhook";
|
|
52
|
+
dataType: "date";
|
|
53
|
+
columnType: "SQLiteTimestamp";
|
|
54
|
+
data: Date;
|
|
55
|
+
driverParam: number;
|
|
56
|
+
notNull: false;
|
|
57
|
+
hasDefault: false;
|
|
58
|
+
isPrimaryKey: false;
|
|
59
|
+
isAutoincrement: false;
|
|
60
|
+
hasRuntimeDefault: false;
|
|
61
|
+
enumValues: undefined;
|
|
62
|
+
baseColumn: never;
|
|
63
|
+
identity: undefined;
|
|
64
|
+
generated: undefined;
|
|
65
|
+
}, {}, {}>;
|
|
66
|
+
timeoutSec: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
67
|
+
name: "timeout_sec";
|
|
68
|
+
tableName: "webhook";
|
|
69
|
+
dataType: "number";
|
|
70
|
+
columnType: "SQLiteInteger";
|
|
71
|
+
data: number;
|
|
72
|
+
driverParam: number;
|
|
73
|
+
notNull: true;
|
|
74
|
+
hasDefault: true;
|
|
75
|
+
isPrimaryKey: false;
|
|
76
|
+
isAutoincrement: false;
|
|
77
|
+
hasRuntimeDefault: false;
|
|
78
|
+
enumValues: undefined;
|
|
79
|
+
baseColumn: never;
|
|
80
|
+
identity: undefined;
|
|
81
|
+
generated: undefined;
|
|
82
|
+
}, {}, {}>;
|
|
83
|
+
status: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
84
|
+
name: "status";
|
|
85
|
+
tableName: "webhook";
|
|
86
|
+
dataType: "string";
|
|
87
|
+
columnType: "SQLiteText";
|
|
88
|
+
data: WebhookStatus;
|
|
89
|
+
driverParam: string;
|
|
90
|
+
notNull: true;
|
|
91
|
+
hasDefault: true;
|
|
92
|
+
isPrimaryKey: false;
|
|
93
|
+
isAutoincrement: false;
|
|
94
|
+
hasRuntimeDefault: false;
|
|
95
|
+
enumValues: [string, ...string[]];
|
|
96
|
+
baseColumn: never;
|
|
97
|
+
identity: undefined;
|
|
98
|
+
generated: undefined;
|
|
99
|
+
}, {}, {
|
|
100
|
+
length: number | undefined;
|
|
101
|
+
$type: WebhookStatus;
|
|
102
|
+
}>;
|
|
103
|
+
error: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
104
|
+
name: "error";
|
|
105
|
+
tableName: "webhook";
|
|
106
|
+
dataType: "string";
|
|
107
|
+
columnType: "SQLiteText";
|
|
108
|
+
data: string;
|
|
109
|
+
driverParam: string;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: [string, ...string[]];
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {
|
|
120
|
+
length: number | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
payload: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
123
|
+
name: "payload";
|
|
124
|
+
tableName: "webhook";
|
|
125
|
+
dataType: "string";
|
|
126
|
+
columnType: "SQLiteText";
|
|
127
|
+
data: string;
|
|
128
|
+
driverParam: string;
|
|
129
|
+
notNull: false;
|
|
130
|
+
hasDefault: false;
|
|
131
|
+
isPrimaryKey: false;
|
|
132
|
+
isAutoincrement: false;
|
|
133
|
+
hasRuntimeDefault: false;
|
|
134
|
+
enumValues: [string, ...string[]];
|
|
135
|
+
baseColumn: never;
|
|
136
|
+
identity: undefined;
|
|
137
|
+
generated: undefined;
|
|
138
|
+
}, {}, {
|
|
139
|
+
length: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
};
|
|
142
|
+
dialect: "sqlite";
|
|
143
|
+
}>;
|
|
144
|
+
};
|
|
145
|
+
type Schema = typeof schema;
|
|
146
|
+
type Orm = LibSQLDatabase<Schema>;
|
|
147
|
+
declare class WebhookRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["webhook"]> {
|
|
148
|
+
completed(id: string, payload: unknown, tx?: Orm): ServerResultAsync<void>;
|
|
149
|
+
timeout(id: string, tx?: Orm): ServerResultAsync<void>;
|
|
150
|
+
registerError(id: string, status: "ERROR_CALLBACK" | "ERROR_DATA", error: string, tx?: Orm): ServerResultAsync<void>;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { WebhookRepository };
|
|
154
|
+
//# sourceMappingURL=webhook.repository.d.mts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseTableRepository } from "../base/base.repository.mjs";
|
|
2
|
+
import { WEBHOOK_STATUS_ENUM } from "./webhook.constants.mjs";
|
|
3
|
+
import "./webhook.db.mjs";
|
|
4
|
+
import { err, ok } from "neverthrow";
|
|
5
|
+
//#region src/modules/webhook/webhook.repository.ts
|
|
6
|
+
var WebhookRepository = class extends BaseTableRepository {
|
|
7
|
+
async completed(id, payload, tx) {
|
|
8
|
+
return this.throwableAsync(async () => {
|
|
9
|
+
const webhook = await this.findById(id, tx);
|
|
10
|
+
if (webhook.isErr()) return err(webhook.error);
|
|
11
|
+
if (!webhook.value) return this.error("NOT_FOUND");
|
|
12
|
+
await this.update({
|
|
13
|
+
id,
|
|
14
|
+
status: WEBHOOK_STATUS_ENUM.COMPLETED,
|
|
15
|
+
payload: JSON.stringify(payload)
|
|
16
|
+
}, tx);
|
|
17
|
+
return ok();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async timeout(id, tx) {
|
|
21
|
+
return this.throwableAsync(async () => {
|
|
22
|
+
const webhook = await this.findById(id, tx);
|
|
23
|
+
if (webhook.isErr()) return err(webhook.error);
|
|
24
|
+
if (!webhook.value) return this.error("NOT_FOUND");
|
|
25
|
+
await this.update({
|
|
26
|
+
id,
|
|
27
|
+
status: WEBHOOK_STATUS_ENUM.TIMEOUT,
|
|
28
|
+
error: `Timeout of ${webhook.value.timeoutSec} seconds reached`
|
|
29
|
+
}, tx);
|
|
30
|
+
return ok();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async registerError(id, status, error, tx) {
|
|
34
|
+
return this.throwableAsync(async () => {
|
|
35
|
+
const webhook = await this.findById(id, tx);
|
|
36
|
+
if (webhook.isErr()) return err(webhook.error);
|
|
37
|
+
if (!webhook.value) return this.error("NOT_FOUND");
|
|
38
|
+
await this.update({
|
|
39
|
+
id,
|
|
40
|
+
status,
|
|
41
|
+
error
|
|
42
|
+
}, tx);
|
|
43
|
+
return ok();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { WebhookRepository };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=webhook.repository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.repository.mjs","names":[],"sources":["../../../../src/modules/webhook/webhook.repository.ts"],"sourcesContent":["import type { LibSQLDatabase } from \"drizzle-orm/libsql\";\r\nimport { err, ok } from \"neverthrow\";\r\nimport type { ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseTableRepository } from \"../base/base.repository\";\r\nimport { WEBHOOK_STATUS_ENUM } from \"./webhook.constants\";\r\nimport { webhook } from \"./webhook.db\";\r\n\r\nconst schema = { webhook };\r\ntype Schema = typeof schema;\r\ntype Orm = LibSQLDatabase<Schema>;\r\n\r\nexport class WebhookRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema[\"webhook\"]> {\r\n async completed(id: string, payload: unknown, tx?: Orm): ServerResultAsync<void> {\r\n return this.throwableAsync(async () => {\r\n const webhook = await this.findById(id, tx);\r\n if (webhook.isErr()) return err(webhook.error);\r\n if (!webhook.value) return this.error(\"NOT_FOUND\");\r\n await this.update(\r\n {\r\n id,\r\n status: WEBHOOK_STATUS_ENUM.COMPLETED,\r\n payload: JSON.stringify(payload),\r\n },\r\n tx\r\n );\r\n return ok();\r\n });\r\n }\r\n\r\n async timeout(id: string, tx?: Orm): ServerResultAsync<void> {\r\n return this.throwableAsync(async () => {\r\n const webhook = await this.findById(id, tx);\r\n if (webhook.isErr()) return err(webhook.error);\r\n if (!webhook.value) return this.error(\"NOT_FOUND\");\r\n await this.update(\r\n {\r\n id,\r\n status: WEBHOOK_STATUS_ENUM.TIMEOUT,\r\n error: `Timeout of ${webhook.value.timeoutSec} seconds reached`,\r\n },\r\n tx\r\n );\r\n return ok();\r\n });\r\n }\r\n\r\n async registerError(\r\n id: string,\r\n status: \"ERROR_CALLBACK\" | \"ERROR_DATA\",\r\n error: string,\r\n tx?: Orm\r\n ): ServerResultAsync<void> {\r\n return this.throwableAsync(async () => {\r\n const webhook = await this.findById(id, tx);\r\n if (webhook.isErr()) return err(webhook.error);\r\n if (!webhook.value) return this.error(\"NOT_FOUND\");\r\n await this.update(\r\n {\r\n id,\r\n status,\r\n error,\r\n },\r\n tx\r\n );\r\n return ok();\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;;AAWA,IAAa,oBAAb,cAAuC,oBAA2E;CAChH,MAAM,UAAU,IAAY,SAAkB,IAAmC;AAC/E,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,UAAU,MAAM,KAAK,SAAS,IAAI,GAAG;AAC3C,OAAI,QAAQ,OAAO,CAAE,QAAO,IAAI,QAAQ,MAAM;AAC9C,OAAI,CAAC,QAAQ,MAAO,QAAO,KAAK,MAAM,YAAY;AAClD,SAAM,KAAK,OACT;IACE;IACA,QAAQ,oBAAoB;IAC5B,SAAS,KAAK,UAAU,QAAQ;IACjC,EACD,GACD;AACD,UAAO,IAAI;IACX;;CAGJ,MAAM,QAAQ,IAAY,IAAmC;AAC3D,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,UAAU,MAAM,KAAK,SAAS,IAAI,GAAG;AAC3C,OAAI,QAAQ,OAAO,CAAE,QAAO,IAAI,QAAQ,MAAM;AAC9C,OAAI,CAAC,QAAQ,MAAO,QAAO,KAAK,MAAM,YAAY;AAClD,SAAM,KAAK,OACT;IACE;IACA,QAAQ,oBAAoB;IAC5B,OAAO,cAAc,QAAQ,MAAM,WAAW;IAC/C,EACD,GACD;AACD,UAAO,IAAI;IACX;;CAGJ,MAAM,cACJ,IACA,QACA,OACA,IACyB;AACzB,SAAO,KAAK,eAAe,YAAY;GACrC,MAAM,UAAU,MAAM,KAAK,SAAS,IAAI,GAAG;AAC3C,OAAI,QAAQ,OAAO,CAAE,QAAO,IAAI,QAAQ,MAAM;AAC9C,OAAI,CAAC,QAAQ,MAAO,QAAO,KAAK,MAAM,YAAY;AAClD,SAAM,KAAK,OACT;IACE;IACA;IACA;IACD,EACD,GACD;AACD,UAAO,IAAI;IACX"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebhookService } from "./webhook.service.mjs";
|
|
2
|
+
import { Router } from "express";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/webhook/webhook.router.d.ts
|
|
5
|
+
declare function createWebhookRouter(webhookService: WebhookService): Router;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createWebhookRouter };
|
|
8
|
+
//# sourceMappingURL=webhook.router.d.mts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import bodyParser from "body-parser";
|
|
2
|
+
import { Router } from "express";
|
|
3
|
+
//#region src/modules/webhook/webhook.router.ts
|
|
4
|
+
function createWebhookRouter(webhookService) {
|
|
5
|
+
const webhookRouter = Router();
|
|
6
|
+
webhookRouter.post("/:id", bodyParser.json(), async (req, res) => {
|
|
7
|
+
const { authorization } = req.headers;
|
|
8
|
+
if (!authorization) return res.status(401).json({ message: "Missing authorization header" });
|
|
9
|
+
if (typeof authorization !== "string") return res.status(401).json({ message: "Authorization header is not a string" });
|
|
10
|
+
if (!authorization.startsWith("Bearer ")) return res.status(401).json({ message: "Invalid authorization header" });
|
|
11
|
+
const token = authorization.split(" ")[1];
|
|
12
|
+
if (!token) return res.status(401).json({ message: "Missing token" });
|
|
13
|
+
if (token !== process.env.WEBHOOK_SECRET) return res.status(401).json({ message: "Invalid token" });
|
|
14
|
+
const result = await webhookService.completed(req.params.id, req.body);
|
|
15
|
+
if (result.isErr()) return res.status(result.error.getHTTPStatusCode() || 500).json({ message: result.error.message });
|
|
16
|
+
return res.status(200).json({ message: "Webhook completed" });
|
|
17
|
+
});
|
|
18
|
+
return webhookRouter;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { createWebhookRouter };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=webhook.router.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.router.mjs","names":[],"sources":["../../../../src/modules/webhook/webhook.router.ts"],"sourcesContent":["import bodyParser from \"body-parser\";\r\nimport { Router } from \"express\";\r\nimport type { WebhookService } from \"./webhook.service\";\r\n\r\nexport function createWebhookRouter(webhookService: WebhookService): Router {\r\n const webhookRouter = Router();\r\n\r\n webhookRouter.post(\"/:id\", bodyParser.json(), async (req, res) => {\r\n const { authorization } = req.headers;\r\n if (!authorization) return res.status(401).json({ message: \"Missing authorization header\" });\r\n if (typeof authorization !== \"string\")\r\n return res.status(401).json({ message: \"Authorization header is not a string\" });\r\n if (!authorization.startsWith(\"Bearer \"))\r\n return res.status(401).json({ message: \"Invalid authorization header\" });\r\n const token = authorization.split(\" \")[1];\r\n if (!token) return res.status(401).json({ message: \"Missing token\" });\r\n if (token !== process.env.WEBHOOK_SECRET)\r\n return res.status(401).json({ message: \"Invalid token\" });\r\n\r\n const result = await webhookService.completed(req.params.id, req.body);\r\n if (result.isErr())\r\n return res\r\n .status(result.error.getHTTPStatusCode() || 500)\r\n .json({ message: result.error.message });\r\n return res.status(200).json({ message: \"Webhook completed\" });\r\n });\r\n\r\n return webhookRouter;\r\n}\r\n"],"mappings":";;;AAIA,SAAgB,oBAAoB,gBAAwC;CAC1E,MAAM,gBAAgB,QAAQ;AAE9B,eAAc,KAAK,QAAQ,WAAW,MAAM,EAAE,OAAO,KAAK,QAAQ;EAChE,MAAM,EAAE,kBAAkB,IAAI;AAC9B,MAAI,CAAC,cAAe,QAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,gCAAgC,CAAC;AAC5F,MAAI,OAAO,kBAAkB,SAC3B,QAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,wCAAwC,CAAC;AAClF,MAAI,CAAC,cAAc,WAAW,UAAU,CACtC,QAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,gCAAgC,CAAC;EAC1E,MAAM,QAAQ,cAAc,MAAM,IAAI,CAAC;AACvC,MAAI,CAAC,MAAO,QAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,iBAAiB,CAAC;AACrE,MAAI,UAAU,QAAQ,IAAI,eACxB,QAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,iBAAiB,CAAC;EAE3D,MAAM,SAAS,MAAM,eAAe,UAAU,IAAI,OAAO,IAAI,IAAI,KAAK;AACtE,MAAI,OAAO,OAAO,CAChB,QAAO,IACJ,OAAO,OAAO,MAAM,mBAAmB,IAAI,IAAI,CAC/C,KAAK,EAAE,SAAS,OAAO,MAAM,SAAS,CAAC;AAC5C,SAAO,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,qBAAqB,CAAC;GAC7D;AAEF,QAAO"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ServerResultAsync } from "../base/base.dto.mjs";
|
|
2
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
3
|
+
import { WebhookRepository } from "./webhook.repository.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/webhook/webhook.service.d.ts
|
|
6
|
+
declare class WebhookService extends BaseService<{
|
|
7
|
+
webhook: WebhookRepository;
|
|
8
|
+
}, never> {
|
|
9
|
+
completed(id: string, payload: unknown): ServerResultAsync<void>;
|
|
10
|
+
waitForRequest<T>(callback: (url: string) => any, timeoutSec?: number): ServerResultAsync<T>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { WebhookService };
|
|
14
|
+
//# sourceMappingURL=webhook.service.d.mts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BaseService } from "../base/base.service.mjs";
|
|
2
|
+
import { WEBHOOK_STATUS_ENUM } from "./webhook.constants.mjs";
|
|
3
|
+
import { err, ok } from "neverthrow";
|
|
4
|
+
import { safeParseJson } from "@m5kdev/commons/utils/json";
|
|
5
|
+
//#region src/modules/webhook/webhook.service.ts
|
|
6
|
+
var WebhookService = class extends BaseService {
|
|
7
|
+
async completed(id, payload) {
|
|
8
|
+
const result = await this.repository.webhook.completed(id, payload);
|
|
9
|
+
if (result.isErr()) {
|
|
10
|
+
await this.repository.webhook.registerError(id, WEBHOOK_STATUS_ENUM.ERROR_DATA, JSON.stringify(result.error));
|
|
11
|
+
return this.error("INTERNAL_SERVER_ERROR", "Webhook completed failed", { cause: result.error });
|
|
12
|
+
}
|
|
13
|
+
return ok();
|
|
14
|
+
}
|
|
15
|
+
async waitForRequest(callback, timeoutSec = 60) {
|
|
16
|
+
const webhook = await this.repository.webhook.create({ timeoutSec });
|
|
17
|
+
if (webhook.isErr()) return Promise.reject(webhook.error);
|
|
18
|
+
const url = `${process.env.NGROK_LOCALHOST_TUNNEL || process.env.VITE_SERVER_URL}/webhook/${webhook.value.id}`;
|
|
19
|
+
try {
|
|
20
|
+
await callback(url);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
await this.repository.webhook.registerError(webhook.value.id, WEBHOOK_STATUS_ENUM.ERROR_CALLBACK, JSON.stringify(error));
|
|
23
|
+
return this.error("INTERNAL_SERVER_ERROR", "Error callback failed", { cause: error });
|
|
24
|
+
}
|
|
25
|
+
const endTime = new Date(webhook.value.createdAt).getTime() + timeoutSec * 1e3;
|
|
26
|
+
return await new Promise((resolve, reject) => {
|
|
27
|
+
const intervalId = setInterval(async () => {
|
|
28
|
+
if (Date.now() > endTime) {
|
|
29
|
+
await this.repository.webhook.timeout(webhook.value.id);
|
|
30
|
+
clearInterval(intervalId);
|
|
31
|
+
return reject(this.error("TIMEOUT", "Wait for request timeout"));
|
|
32
|
+
}
|
|
33
|
+
const result = await this.repository.webhook.findById(webhook.value.id);
|
|
34
|
+
if (result.isErr()) {
|
|
35
|
+
clearInterval(intervalId);
|
|
36
|
+
return reject(err(result.error));
|
|
37
|
+
}
|
|
38
|
+
if (!result.value) {
|
|
39
|
+
clearInterval(intervalId);
|
|
40
|
+
return reject(this.error("NOT_FOUND", "Wait for request failed: cannot find webhook"));
|
|
41
|
+
}
|
|
42
|
+
const { status, payload } = result.value;
|
|
43
|
+
if (status === "COMPLETED") {
|
|
44
|
+
const data = payload ? safeParseJson(payload, payload) : payload;
|
|
45
|
+
clearInterval(intervalId);
|
|
46
|
+
return resolve(ok(data));
|
|
47
|
+
}
|
|
48
|
+
if (status !== "WAITING") {
|
|
49
|
+
clearInterval(intervalId);
|
|
50
|
+
return reject(this.error("BAD_REQUEST", "Wait for request failed"));
|
|
51
|
+
}
|
|
52
|
+
}, 1e3);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { WebhookService };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=webhook.service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.service.mjs","names":[],"sources":["../../../../src/modules/webhook/webhook.service.ts"],"sourcesContent":["import { safeParseJson } from \"@m5kdev/commons/utils/json\";\r\nimport { err, ok } from \"neverthrow\";\r\nimport type { ServerResult, ServerResultAsync } from \"../base/base.dto\";\r\nimport { BaseService } from \"../base/base.service\";\r\nimport { WEBHOOK_STATUS_ENUM } from \"./webhook.constants\";\r\nimport type { WebhookRepository } from \"./webhook.repository\";\r\n\r\nexport class WebhookService extends BaseService<{ webhook: WebhookRepository }, never> {\r\n async completed(id: string, payload: unknown): ServerResultAsync<void> {\r\n const result = await this.repository.webhook.completed(id, payload);\r\n if (result.isErr()) {\r\n await this.repository.webhook.registerError(\r\n id,\r\n WEBHOOK_STATUS_ENUM.ERROR_DATA,\r\n JSON.stringify(result.error)\r\n );\r\n return this.error(\"INTERNAL_SERVER_ERROR\", \"Webhook completed failed\", {\r\n cause: result.error,\r\n });\r\n }\r\n return ok();\r\n }\r\n\r\n async waitForRequest<T>(callback: (url: string) => any, timeoutSec = 60): ServerResultAsync<T> {\r\n const webhook = await this.repository.webhook.create({\r\n timeoutSec,\r\n });\r\n if (webhook.isErr()) return Promise.reject(webhook.error);\r\n const url = `${process.env.NGROK_LOCALHOST_TUNNEL || process.env.VITE_SERVER_URL}/webhook/${webhook.value.id}`;\r\n try {\r\n await callback(url);\r\n } catch (error) {\r\n await this.repository.webhook.registerError(\r\n webhook.value.id,\r\n WEBHOOK_STATUS_ENUM.ERROR_CALLBACK,\r\n JSON.stringify(error)\r\n );\r\n return this.error(\"INTERNAL_SERVER_ERROR\", \"Error callback failed\", { cause: error });\r\n }\r\n\r\n const startTime = new Date(webhook.value.createdAt).getTime();\r\n const endTime = startTime + timeoutSec * 1000;\r\n\r\n const promise = await new Promise<ServerResult<T>>((resolve, reject) => {\r\n const intervalId = setInterval(async () => {\r\n const currentTime = Date.now();\r\n\r\n // Check if the timeout is reached\r\n if (currentTime > endTime) {\r\n await this.repository.webhook.timeout(webhook.value.id);\r\n clearInterval(intervalId);\r\n return reject(this.error(\"TIMEOUT\", \"Wait for request timeout\"));\r\n }\r\n const result = await this.repository.webhook.findById(webhook.value.id);\r\n if (result.isErr()) {\r\n clearInterval(intervalId);\r\n return reject(err(result.error));\r\n }\r\n\r\n if (!result.value) {\r\n clearInterval(intervalId);\r\n return reject(this.error(\"NOT_FOUND\", \"Wait for request failed: cannot find webhook\"));\r\n }\r\n const { status, payload } = result.value;\r\n if (status === \"COMPLETED\") {\r\n const data = payload ? safeParseJson<T>(payload, payload as T) : (payload as T);\r\n clearInterval(intervalId);\r\n return resolve(ok(data));\r\n }\r\n if (status !== \"WAITING\") {\r\n clearInterval(intervalId);\r\n return reject(this.error(\"BAD_REQUEST\", \"Wait for request failed\"));\r\n }\r\n }, 1000);\r\n });\r\n return promise;\r\n }\r\n}\r\n"],"mappings":";;;;;AAOA,IAAa,iBAAb,cAAoC,YAAmD;CACrF,MAAM,UAAU,IAAY,SAA2C;EACrE,MAAM,SAAS,MAAM,KAAK,WAAW,QAAQ,UAAU,IAAI,QAAQ;AACnE,MAAI,OAAO,OAAO,EAAE;AAClB,SAAM,KAAK,WAAW,QAAQ,cAC5B,IACA,oBAAoB,YACpB,KAAK,UAAU,OAAO,MAAM,CAC7B;AACD,UAAO,KAAK,MAAM,yBAAyB,4BAA4B,EACrE,OAAO,OAAO,OACf,CAAC;;AAEJ,SAAO,IAAI;;CAGb,MAAM,eAAkB,UAAgC,aAAa,IAA0B;EAC7F,MAAM,UAAU,MAAM,KAAK,WAAW,QAAQ,OAAO,EACnD,YACD,CAAC;AACF,MAAI,QAAQ,OAAO,CAAE,QAAO,QAAQ,OAAO,QAAQ,MAAM;EACzD,MAAM,MAAM,GAAG,QAAQ,IAAI,0BAA0B,QAAQ,IAAI,gBAAgB,WAAW,QAAQ,MAAM;AAC1G,MAAI;AACF,SAAM,SAAS,IAAI;WACZ,OAAO;AACd,SAAM,KAAK,WAAW,QAAQ,cAC5B,QAAQ,MAAM,IACd,oBAAoB,gBACpB,KAAK,UAAU,MAAM,CACtB;AACD,UAAO,KAAK,MAAM,yBAAyB,yBAAyB,EAAE,OAAO,OAAO,CAAC;;EAIvF,MAAM,UADY,IAAI,KAAK,QAAQ,MAAM,UAAU,CAAC,SAAS,GACjC,aAAa;AAkCzC,SAhCgB,MAAM,IAAI,SAA0B,SAAS,WAAW;GACtE,MAAM,aAAa,YAAY,YAAY;AAIzC,QAHoB,KAAK,KAAK,GAGZ,SAAS;AACzB,WAAM,KAAK,WAAW,QAAQ,QAAQ,QAAQ,MAAM,GAAG;AACvD,mBAAc,WAAW;AACzB,YAAO,OAAO,KAAK,MAAM,WAAW,2BAA2B,CAAC;;IAElE,MAAM,SAAS,MAAM,KAAK,WAAW,QAAQ,SAAS,QAAQ,MAAM,GAAG;AACvE,QAAI,OAAO,OAAO,EAAE;AAClB,mBAAc,WAAW;AACzB,YAAO,OAAO,IAAI,OAAO,MAAM,CAAC;;AAGlC,QAAI,CAAC,OAAO,OAAO;AACjB,mBAAc,WAAW;AACzB,YAAO,OAAO,KAAK,MAAM,aAAa,+CAA+C,CAAC;;IAExF,MAAM,EAAE,QAAQ,YAAY,OAAO;AACnC,QAAI,WAAW,aAAa;KAC1B,MAAM,OAAO,UAAU,cAAiB,SAAS,QAAa,GAAI;AAClE,mBAAc,WAAW;AACzB,YAAO,QAAQ,GAAG,KAAK,CAAC;;AAE1B,QAAI,WAAW,WAAW;AACxB,mBAAc,WAAW;AACzB,YAAO,OAAO,KAAK,MAAM,eAAe,0BAA0B,CAAC;;MAEpE,IAAK;IACR"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/workflow/workflow.db.d.ts
|
|
4
|
+
declare const workflows: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
5
|
+
name: "workflows";
|
|
6
|
+
schema: undefined;
|
|
7
|
+
columns: {
|
|
8
|
+
id: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
9
|
+
name: "id";
|
|
10
|
+
tableName: "workflows";
|
|
11
|
+
dataType: "string";
|
|
12
|
+
columnType: "SQLiteText";
|
|
13
|
+
data: string;
|
|
14
|
+
driverParam: string;
|
|
15
|
+
notNull: true;
|
|
16
|
+
hasDefault: true;
|
|
17
|
+
isPrimaryKey: true;
|
|
18
|
+
isAutoincrement: false;
|
|
19
|
+
hasRuntimeDefault: true;
|
|
20
|
+
enumValues: [string, ...string[]];
|
|
21
|
+
baseColumn: never;
|
|
22
|
+
identity: undefined;
|
|
23
|
+
generated: undefined;
|
|
24
|
+
}, {}, {
|
|
25
|
+
length: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
userId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
28
|
+
name: "user_id";
|
|
29
|
+
tableName: "workflows";
|
|
30
|
+
dataType: "string";
|
|
31
|
+
columnType: "SQLiteText";
|
|
32
|
+
data: string;
|
|
33
|
+
driverParam: string;
|
|
34
|
+
notNull: false;
|
|
35
|
+
hasDefault: false;
|
|
36
|
+
isPrimaryKey: false;
|
|
37
|
+
isAutoincrement: false;
|
|
38
|
+
hasRuntimeDefault: false;
|
|
39
|
+
enumValues: [string, ...string[]];
|
|
40
|
+
baseColumn: never;
|
|
41
|
+
identity: undefined;
|
|
42
|
+
generated: undefined;
|
|
43
|
+
}, {}, {
|
|
44
|
+
length: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
jobId: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
47
|
+
name: "job_id";
|
|
48
|
+
tableName: "workflows";
|
|
49
|
+
dataType: "string";
|
|
50
|
+
columnType: "SQLiteText";
|
|
51
|
+
data: string;
|
|
52
|
+
driverParam: string;
|
|
53
|
+
notNull: true;
|
|
54
|
+
hasDefault: false;
|
|
55
|
+
isPrimaryKey: false;
|
|
56
|
+
isAutoincrement: false;
|
|
57
|
+
hasRuntimeDefault: false;
|
|
58
|
+
enumValues: [string, ...string[]];
|
|
59
|
+
baseColumn: never;
|
|
60
|
+
identity: undefined;
|
|
61
|
+
generated: undefined;
|
|
62
|
+
}, {}, {
|
|
63
|
+
length: number | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
jobName: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
66
|
+
name: "job_name";
|
|
67
|
+
tableName: "workflows";
|
|
68
|
+
dataType: "string";
|
|
69
|
+
columnType: "SQLiteText";
|
|
70
|
+
data: string;
|
|
71
|
+
driverParam: string;
|
|
72
|
+
notNull: true;
|
|
73
|
+
hasDefault: false;
|
|
74
|
+
isPrimaryKey: false;
|
|
75
|
+
isAutoincrement: false;
|
|
76
|
+
hasRuntimeDefault: false;
|
|
77
|
+
enumValues: [string, ...string[]];
|
|
78
|
+
baseColumn: never;
|
|
79
|
+
identity: undefined;
|
|
80
|
+
generated: undefined;
|
|
81
|
+
}, {}, {
|
|
82
|
+
length: number | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
queueName: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
85
|
+
name: "queue_name";
|
|
86
|
+
tableName: "workflows";
|
|
87
|
+
dataType: "string";
|
|
88
|
+
columnType: "SQLiteText";
|
|
89
|
+
data: string;
|
|
90
|
+
driverParam: string;
|
|
91
|
+
notNull: true;
|
|
92
|
+
hasDefault: false;
|
|
93
|
+
isPrimaryKey: false;
|
|
94
|
+
isAutoincrement: false;
|
|
95
|
+
hasRuntimeDefault: false;
|
|
96
|
+
enumValues: [string, ...string[]];
|
|
97
|
+
baseColumn: never;
|
|
98
|
+
identity: undefined;
|
|
99
|
+
generated: undefined;
|
|
100
|
+
}, {}, {
|
|
101
|
+
length: number | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
timeout: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
104
|
+
name: "timeout";
|
|
105
|
+
tableName: "workflows";
|
|
106
|
+
dataType: "number";
|
|
107
|
+
columnType: "SQLiteInteger";
|
|
108
|
+
data: number;
|
|
109
|
+
driverParam: number;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: undefined;
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {}>;
|
|
120
|
+
tags: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
121
|
+
name: "tags";
|
|
122
|
+
tableName: "workflows";
|
|
123
|
+
dataType: "json";
|
|
124
|
+
columnType: "SQLiteTextJson";
|
|
125
|
+
data: string[];
|
|
126
|
+
driverParam: string;
|
|
127
|
+
notNull: false;
|
|
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
|
+
$type: string[];
|
|
138
|
+
}>;
|
|
139
|
+
input: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
140
|
+
name: "input";
|
|
141
|
+
tableName: "workflows";
|
|
142
|
+
dataType: "json";
|
|
143
|
+
columnType: "SQLiteTextJson";
|
|
144
|
+
data: unknown;
|
|
145
|
+
driverParam: string;
|
|
146
|
+
notNull: false;
|
|
147
|
+
hasDefault: false;
|
|
148
|
+
isPrimaryKey: false;
|
|
149
|
+
isAutoincrement: false;
|
|
150
|
+
hasRuntimeDefault: false;
|
|
151
|
+
enumValues: undefined;
|
|
152
|
+
baseColumn: never;
|
|
153
|
+
identity: undefined;
|
|
154
|
+
generated: undefined;
|
|
155
|
+
}, {}, {}>;
|
|
156
|
+
output: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
157
|
+
name: "output";
|
|
158
|
+
tableName: "workflows";
|
|
159
|
+
dataType: "json";
|
|
160
|
+
columnType: "SQLiteTextJson";
|
|
161
|
+
data: unknown;
|
|
162
|
+
driverParam: string;
|
|
163
|
+
notNull: false;
|
|
164
|
+
hasDefault: false;
|
|
165
|
+
isPrimaryKey: false;
|
|
166
|
+
isAutoincrement: false;
|
|
167
|
+
hasRuntimeDefault: false;
|
|
168
|
+
enumValues: undefined;
|
|
169
|
+
baseColumn: never;
|
|
170
|
+
identity: undefined;
|
|
171
|
+
generated: undefined;
|
|
172
|
+
}, {}, {}>;
|
|
173
|
+
status: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
174
|
+
name: "status";
|
|
175
|
+
tableName: "workflows";
|
|
176
|
+
dataType: "string";
|
|
177
|
+
columnType: "SQLiteText";
|
|
178
|
+
data: WorkflowStatus;
|
|
179
|
+
driverParam: string;
|
|
180
|
+
notNull: true;
|
|
181
|
+
hasDefault: false;
|
|
182
|
+
isPrimaryKey: false;
|
|
183
|
+
isAutoincrement: false;
|
|
184
|
+
hasRuntimeDefault: false;
|
|
185
|
+
enumValues: [string, ...string[]];
|
|
186
|
+
baseColumn: never;
|
|
187
|
+
identity: undefined;
|
|
188
|
+
generated: undefined;
|
|
189
|
+
}, {}, {
|
|
190
|
+
length: number | undefined;
|
|
191
|
+
$type: WorkflowStatus;
|
|
192
|
+
}>;
|
|
193
|
+
error: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
194
|
+
name: "error";
|
|
195
|
+
tableName: "workflows";
|
|
196
|
+
dataType: "string";
|
|
197
|
+
columnType: "SQLiteText";
|
|
198
|
+
data: string;
|
|
199
|
+
driverParam: string;
|
|
200
|
+
notNull: false;
|
|
201
|
+
hasDefault: false;
|
|
202
|
+
isPrimaryKey: false;
|
|
203
|
+
isAutoincrement: false;
|
|
204
|
+
hasRuntimeDefault: false;
|
|
205
|
+
enumValues: [string, ...string[]];
|
|
206
|
+
baseColumn: never;
|
|
207
|
+
identity: undefined;
|
|
208
|
+
generated: undefined;
|
|
209
|
+
}, {}, {
|
|
210
|
+
length: number | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
retries: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
213
|
+
name: "retries";
|
|
214
|
+
tableName: "workflows";
|
|
215
|
+
dataType: "number";
|
|
216
|
+
columnType: "SQLiteInteger";
|
|
217
|
+
data: number;
|
|
218
|
+
driverParam: number;
|
|
219
|
+
notNull: true;
|
|
220
|
+
hasDefault: true;
|
|
221
|
+
isPrimaryKey: false;
|
|
222
|
+
isAutoincrement: false;
|
|
223
|
+
hasRuntimeDefault: false;
|
|
224
|
+
enumValues: undefined;
|
|
225
|
+
baseColumn: never;
|
|
226
|
+
identity: undefined;
|
|
227
|
+
generated: undefined;
|
|
228
|
+
}, {}, {}>;
|
|
229
|
+
finishedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
230
|
+
name: "finished_at";
|
|
231
|
+
tableName: "workflows";
|
|
232
|
+
dataType: "date";
|
|
233
|
+
columnType: "SQLiteTimestamp";
|
|
234
|
+
data: Date;
|
|
235
|
+
driverParam: number;
|
|
236
|
+
notNull: false;
|
|
237
|
+
hasDefault: false;
|
|
238
|
+
isPrimaryKey: false;
|
|
239
|
+
isAutoincrement: false;
|
|
240
|
+
hasRuntimeDefault: false;
|
|
241
|
+
enumValues: undefined;
|
|
242
|
+
baseColumn: never;
|
|
243
|
+
identity: undefined;
|
|
244
|
+
generated: undefined;
|
|
245
|
+
}, {}, {}>;
|
|
246
|
+
processedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
247
|
+
name: "processed_at";
|
|
248
|
+
tableName: "workflows";
|
|
249
|
+
dataType: "date";
|
|
250
|
+
columnType: "SQLiteTimestamp";
|
|
251
|
+
data: Date;
|
|
252
|
+
driverParam: number;
|
|
253
|
+
notNull: false;
|
|
254
|
+
hasDefault: false;
|
|
255
|
+
isPrimaryKey: false;
|
|
256
|
+
isAutoincrement: false;
|
|
257
|
+
hasRuntimeDefault: false;
|
|
258
|
+
enumValues: undefined;
|
|
259
|
+
baseColumn: never;
|
|
260
|
+
identity: undefined;
|
|
261
|
+
generated: undefined;
|
|
262
|
+
}, {}, {}>;
|
|
263
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
264
|
+
name: "created_at";
|
|
265
|
+
tableName: "workflows";
|
|
266
|
+
dataType: "date";
|
|
267
|
+
columnType: "SQLiteTimestamp";
|
|
268
|
+
data: Date;
|
|
269
|
+
driverParam: number;
|
|
270
|
+
notNull: true;
|
|
271
|
+
hasDefault: true;
|
|
272
|
+
isPrimaryKey: false;
|
|
273
|
+
isAutoincrement: false;
|
|
274
|
+
hasRuntimeDefault: true;
|
|
275
|
+
enumValues: undefined;
|
|
276
|
+
baseColumn: never;
|
|
277
|
+
identity: undefined;
|
|
278
|
+
generated: undefined;
|
|
279
|
+
}, {}, {}>;
|
|
280
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
281
|
+
name: "updated_at";
|
|
282
|
+
tableName: "workflows";
|
|
283
|
+
dataType: "date";
|
|
284
|
+
columnType: "SQLiteTimestamp";
|
|
285
|
+
data: Date;
|
|
286
|
+
driverParam: number;
|
|
287
|
+
notNull: true;
|
|
288
|
+
hasDefault: true;
|
|
289
|
+
isPrimaryKey: false;
|
|
290
|
+
isAutoincrement: false;
|
|
291
|
+
hasRuntimeDefault: true;
|
|
292
|
+
enumValues: undefined;
|
|
293
|
+
baseColumn: never;
|
|
294
|
+
identity: undefined;
|
|
295
|
+
generated: undefined;
|
|
296
|
+
}, {}, {}>;
|
|
297
|
+
};
|
|
298
|
+
dialect: "sqlite";
|
|
299
|
+
}>;
|
|
300
|
+
//#endregion
|
|
301
|
+
export { workflows };
|
|
302
|
+
//# sourceMappingURL=workflow.db.d.mts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { users } from "../auth/auth.db.mjs";
|
|
3
|
+
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
4
|
+
import { v4 } from "uuid";
|
|
5
|
+
//#region src/modules/workflow/workflow.db.ts
|
|
6
|
+
var workflow_db_exports = /* @__PURE__ */ __exportAll({ workflows: () => workflows });
|
|
7
|
+
const workflows = sqliteTable("workflows", {
|
|
8
|
+
id: text("id").primaryKey().$default(v4),
|
|
9
|
+
userId: text("user_id").references(() => users.id, { onDelete: "cascade" }),
|
|
10
|
+
jobId: text("job_id").unique().notNull(),
|
|
11
|
+
jobName: text("job_name").notNull(),
|
|
12
|
+
queueName: text("queue_name").notNull(),
|
|
13
|
+
timeout: integer("timeout"),
|
|
14
|
+
tags: text("tags", { mode: "json" }).$default(() => []).$type(),
|
|
15
|
+
input: text("input", { mode: "json" }),
|
|
16
|
+
output: text("output", { mode: "json" }),
|
|
17
|
+
status: text("status").notNull().$type(),
|
|
18
|
+
error: text("error"),
|
|
19
|
+
retries: integer("retries").notNull().default(0),
|
|
20
|
+
finishedAt: integer("finished_at", { mode: "timestamp" }),
|
|
21
|
+
processedAt: integer("processed_at", { mode: "timestamp" }),
|
|
22
|
+
createdAt: integer("created_at", { mode: "timestamp" }).notNull().$default(() => /* @__PURE__ */ new Date()),
|
|
23
|
+
updatedAt: integer("updated_at", { mode: "timestamp" }).notNull().$default(() => /* @__PURE__ */ new Date())
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { workflow_db_exports, workflows };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=workflow.db.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.db.mjs","names":["table","uuidv4"],"sources":["../../../../src/modules/workflow/workflow.db.ts"],"sourcesContent":["import type { WorkflowStatus } from \"@m5kdev/commons/modules/workflow/workflow.constants\";\r\nimport { integer, sqliteTable as table, text } from \"drizzle-orm/sqlite-core\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport { users } from \"../auth/auth.db\";\r\n\r\nexport const workflows = table(\"workflows\", {\r\n id: text(\"id\").primaryKey().$default(uuidv4),\r\n userId: text(\"user_id\").references(() => users.id, { onDelete: \"cascade\" }),\r\n jobId: text(\"job_id\").unique().notNull(),\r\n jobName: text(\"job_name\").notNull(),\r\n queueName: text(\"queue_name\").notNull(),\r\n timeout: integer(\"timeout\"),\r\n tags: text(\"tags\", { mode: \"json\" })\r\n .$default(() => [])\r\n .$type<string[]>(),\r\n input: text(\"input\", { mode: \"json\" }),\r\n output: text(\"output\", { mode: \"json\" }),\r\n status: text(\"status\").notNull().$type<WorkflowStatus>(),\r\n error: text(\"error\"),\r\n retries: integer(\"retries\").notNull().default(0),\r\n finishedAt: integer(\"finished_at\", { mode: \"timestamp\" }),\r\n processedAt: integer(\"processed_at\", { mode: \"timestamp\" }),\r\n createdAt: integer(\"created_at\", { mode: \"timestamp\" })\r\n .notNull()\r\n .$default(() => new Date()),\r\n updatedAt: integer(\"updated_at\", { mode: \"timestamp\" })\r\n .notNull()\r\n .$default(() => new Date()),\r\n});\r\n"],"mappings":";;;;;;AAKA,MAAa,YAAYA,YAAM,aAAa;CAC1C,IAAI,KAAK,KAAK,CAAC,YAAY,CAAC,SAASC,GAAO;CAC5C,QAAQ,KAAK,UAAU,CAAC,iBAAiB,MAAM,IAAI,EAAE,UAAU,WAAW,CAAC;CAC3E,OAAO,KAAK,SAAS,CAAC,QAAQ,CAAC,SAAS;CACxC,SAAS,KAAK,WAAW,CAAC,SAAS;CACnC,WAAW,KAAK,aAAa,CAAC,SAAS;CACvC,SAAS,QAAQ,UAAU;CAC3B,MAAM,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC,CACjC,eAAe,EAAE,CAAC,CAClB,OAAiB;CACpB,OAAO,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;CACtC,QAAQ,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;CACxC,QAAQ,KAAK,SAAS,CAAC,SAAS,CAAC,OAAuB;CACxD,OAAO,KAAK,QAAQ;CACpB,SAAS,QAAQ,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE;CAChD,YAAY,QAAQ,eAAe,EAAE,MAAM,aAAa,CAAC;CACzD,aAAa,QAAQ,gBAAgB,EAAE,MAAM,aAAa,CAAC;CAC3D,WAAW,QAAQ,cAAc,EAAE,MAAM,aAAa,CAAC,CACpD,SAAS,CACT,+BAAe,IAAI,MAAM,CAAC;CAC7B,WAAW,QAAQ,cAAc,EAAE,MAAM,aAAa,CAAC,CACpD,SAAS,CACT,+BAAe,IAAI,MAAM,CAAC;CAC9B,CAAC"}
|