@m5kdev/backend 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/api/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/factory.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/adapter/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/get-tables.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/account.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/session.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/shared.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/user.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/db/schema/verification.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/social-providers/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/context.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/helper.d.mts +7 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/init-options.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/plugin-client.d.mts +1 -0
- package/dist/node_modules/.pnpm/@better-auth_core@1.4.18_@better-auth_utils@0.3.0_@better-fetch_fetch@1.1.21_better-cal_347838d331444e5371f256b914727290/node_modules/@better-auth/core/dist/types/plugin.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter-base.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mssql/mssql-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/mysql/mysql-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/postgres/postgres-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-adapter.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-dialect.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/dialect/sqlite/sqlite-introspector.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/expression/expression-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/kysely.d.mts +38 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/file-migration-provider.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/migration/migrator.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/binary-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/delete-from-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/expression-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/group-by-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/insert-values-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/join-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/merge-into-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/reference-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/returning-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-from-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/select-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/set-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/tuple-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/unary-operation-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/update-set-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/value-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/parser/with-parser.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/case-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/delete-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/having-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/insert-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/join-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/merge-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/on-conflict-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/output-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/returning-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/select-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/update-query-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-builder/where-interface.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-creator.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/default-query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/noop-query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-base.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor-provider.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/query-executor/query-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/raw-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/raw-builder/sql.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-add-foreign-key-constraint-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-add-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-drop-constraint-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/alter-table-executor.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-schema-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-type-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/create-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-index-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-schema-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-table-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-type-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/drop-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/refresh-materialized-view-builder.d.mts +1 -0
- package/dist/node_modules/.pnpm/kysely@0.28.5/node_modules/kysely/dist/esm/schema/schema.d.mts +1 -0
- package/dist/src/lib/posthog.d.mts +7 -0
- package/dist/src/lib/posthog.mjs +7 -0
- package/dist/src/lib/posthog.mjs.map +1 -0
- package/dist/src/lib/sentry.d.mts +1 -0
- package/dist/src/lib/sentry.mjs +10 -0
- package/dist/src/lib/sentry.mjs.map +1 -0
- package/dist/src/modules/access/access.repository.d.mts +2352 -0
- package/dist/src/modules/access/access.repository.mjs +24 -0
- package/dist/src/modules/access/access.repository.mjs.map +1 -0
- package/dist/src/modules/access/access.service.d.mts +25 -0
- package/dist/src/modules/access/access.service.mjs +40 -0
- package/dist/src/modules/access/access.service.mjs.map +1 -0
- package/dist/src/modules/access/access.utils.d.mts +19 -0
- package/dist/src/modules/access/access.utils.mjs +21 -0
- package/dist/src/modules/access/access.utils.mjs.map +1 -0
- package/dist/src/modules/ai/ai.db.d.mts +401 -0
- package/dist/src/modules/ai/ai.db.mjs +38 -0
- package/dist/src/modules/ai/ai.db.mjs.map +1 -0
- package/dist/src/modules/ai/ai.prompt.d.mts +30 -0
- package/dist/src/modules/ai/ai.prompt.mjs +30 -0
- package/dist/src/modules/ai/ai.prompt.mjs.map +1 -0
- package/dist/src/modules/ai/ai.prompts.d.mts +10 -0
- package/dist/src/modules/ai/{ai.prompts.js → ai.prompts.mjs} +17 -15
- package/dist/src/modules/ai/ai.prompts.mjs.map +1 -0
- package/dist/src/modules/ai/ai.repository.d.mts +428 -0
- package/dist/src/modules/ai/ai.repository.mjs +23 -0
- package/dist/src/modules/ai/ai.repository.mjs.map +1 -0
- package/dist/src/modules/ai/ai.router.d.mts +1 -0
- package/dist/src/modules/ai/ai.service.d.mts +128 -0
- package/dist/src/modules/ai/ai.service.mjs +267 -0
- package/dist/src/modules/ai/ai.service.mjs.map +1 -0
- package/dist/src/modules/ai/ai.trpc.d.mts +31 -0
- package/dist/src/modules/ai/ai.trpc.mjs +17 -0
- package/dist/src/modules/ai/ai.trpc.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.d.mts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.mjs +184 -0
- package/dist/src/modules/ai/ideogram/ideogram.constants.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.d.mts +234 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.mjs +45 -0
- package/dist/src/modules/ai/ideogram/ideogram.dto.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.prompt.d.mts +7 -0
- package/dist/src/modules/ai/ideogram/{ideogram.prompt.js → ideogram.prompt.mjs} +861 -859
- package/dist/src/modules/ai/ideogram/ideogram.prompt.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.d.mts +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.mjs +32 -0
- package/dist/src/modules/ai/ideogram/ideogram.repository.mjs.map +1 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.d.mts +14 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.mjs +11 -0
- package/dist/src/modules/ai/ideogram/ideogram.service.mjs.map +1 -0
- package/dist/src/modules/auth/auth.db.d.mts +2341 -0
- package/dist/src/modules/auth/auth.db.mjs +169 -0
- package/dist/src/modules/auth/auth.db.mjs.map +1 -0
- package/dist/src/modules/auth/auth.dto.d.mts +70 -0
- package/dist/src/modules/auth/auth.dto.mjs +43 -0
- package/dist/src/modules/auth/auth.dto.mjs.map +1 -0
- package/dist/src/modules/auth/auth.lib.d.mts +4894 -0
- package/dist/src/modules/auth/auth.lib.mjs +232 -0
- package/dist/src/modules/auth/auth.lib.mjs.map +1 -0
- package/dist/src/modules/auth/auth.middleware.d.mts +619 -0
- package/dist/src/modules/auth/auth.middleware.mjs +38 -0
- package/dist/src/modules/auth/auth.middleware.mjs.map +1 -0
- package/dist/src/modules/auth/auth.repository.d.mts +2453 -0
- package/dist/src/modules/auth/auth.repository.mjs +401 -0
- package/dist/src/modules/auth/auth.repository.mjs.map +1 -0
- package/dist/src/modules/auth/auth.service.d.mts +105 -0
- package/dist/src/modules/auth/auth.service.mjs +227 -0
- package/dist/src/modules/auth/auth.service.mjs.map +1 -0
- package/dist/src/modules/auth/auth.trpc.d.mts +303 -0
- package/dist/src/modules/auth/auth.trpc.mjs +108 -0
- package/dist/src/modules/auth/auth.trpc.mjs.map +1 -0
- package/dist/src/modules/auth/auth.utils.d.mts +2356 -0
- package/dist/src/modules/auth/auth.utils.mjs +77 -0
- package/dist/src/modules/auth/auth.utils.mjs.map +1 -0
- package/dist/src/modules/base/base.abstract.d.mts +29 -0
- package/dist/src/modules/base/base.abstract.mjs +60 -0
- package/dist/src/modules/base/base.abstract.mjs.map +1 -0
- package/dist/src/modules/base/base.actor.d.mts +73 -0
- package/dist/src/modules/base/base.actor.mjs +78 -0
- package/dist/src/modules/base/base.actor.mjs.map +1 -0
- package/dist/src/modules/base/base.dto.d.mts +67 -0
- package/dist/src/modules/base/base.dto.mjs +79 -0
- package/dist/src/modules/base/base.dto.mjs.map +1 -0
- package/dist/src/modules/base/base.grants.d.mts +28 -0
- package/dist/src/modules/base/base.grants.mjs +103 -0
- package/dist/src/modules/base/base.grants.mjs.map +1 -0
- package/dist/src/modules/base/base.procedure.d.mts +111 -0
- package/dist/src/modules/base/base.procedure.mjs +252 -0
- package/dist/src/modules/base/base.procedure.mjs.map +1 -0
- package/dist/src/modules/base/base.repository.d.mts +123 -0
- package/dist/src/modules/base/base.repository.mjs +250 -0
- package/dist/src/modules/base/base.repository.mjs.map +1 -0
- package/dist/src/modules/base/base.service.d.mts +44 -0
- package/dist/src/modules/base/base.service.mjs +116 -0
- package/dist/src/modules/base/base.service.mjs.map +1 -0
- package/dist/src/modules/base/base.types.d.mts +5 -0
- package/dist/src/modules/billing/billing.db.d.mts +371 -0
- package/dist/src/modules/billing/billing.db.mjs +31 -0
- package/dist/src/modules/billing/billing.db.mjs.map +1 -0
- package/dist/src/modules/billing/billing.repository.d.mts +2787 -0
- package/dist/src/modules/billing/billing.repository.mjs +188 -0
- package/dist/src/modules/billing/billing.repository.mjs.map +1 -0
- package/dist/src/modules/billing/billing.router.d.mts +9 -0
- package/dist/src/modules/billing/billing.router.mjs +40 -0
- package/dist/src/modules/billing/billing.router.mjs.map +1 -0
- package/dist/src/modules/billing/billing.service.d.mts +53 -0
- package/dist/src/modules/billing/billing.service.mjs +125 -0
- package/dist/src/modules/billing/billing.service.mjs.map +1 -0
- package/dist/src/modules/billing/billing.trpc.d.mts +29 -0
- package/dist/src/modules/billing/billing.trpc.mjs +17 -0
- package/dist/src/modules/billing/billing.trpc.mjs.map +1 -0
- package/dist/src/modules/clay/clay.repository.d.mts +10 -0
- package/dist/src/modules/clay/clay.repository.mjs +27 -0
- package/dist/src/modules/clay/clay.repository.mjs.map +1 -0
- package/dist/src/modules/clay/clay.service.d.mts +32 -0
- package/dist/src/modules/clay/clay.service.mjs +23 -0
- package/dist/src/modules/clay/clay.service.mjs.map +1 -0
- package/dist/src/modules/connect/connect.db.d.mts +362 -0
- package/dist/src/modules/connect/connect.db.mjs +30 -0
- package/dist/src/modules/connect/connect.db.mjs.map +1 -0
- package/dist/src/modules/connect/connect.dto.d.mts +79 -0
- package/dist/src/modules/connect/connect.dto.mjs +38 -0
- package/dist/src/modules/connect/connect.dto.mjs.map +1 -0
- package/dist/src/modules/connect/connect.linkedin.d.mts +7 -0
- package/dist/src/modules/connect/connect.linkedin.mjs +47 -0
- package/dist/src/modules/connect/connect.linkedin.mjs.map +1 -0
- package/dist/src/modules/connect/connect.oauth.d.mts +32 -0
- package/dist/src/modules/connect/connect.oauth.mjs +145 -0
- package/dist/src/modules/connect/connect.oauth.mjs.map +1 -0
- package/dist/src/modules/connect/connect.repository.d.mts +419 -0
- package/dist/src/modules/connect/connect.repository.mjs +40 -0
- package/dist/src/modules/connect/connect.repository.mjs.map +1 -0
- package/dist/src/modules/connect/connect.router.d.mts +9 -0
- package/dist/src/modules/connect/connect.router.mjs +46 -0
- package/dist/src/modules/connect/connect.router.mjs.map +1 -0
- package/dist/src/modules/connect/connect.service.d.mts +103 -0
- package/dist/src/modules/connect/connect.service.mjs +88 -0
- package/dist/src/modules/connect/connect.service.mjs.map +1 -0
- package/dist/src/modules/connect/connect.trpc.d.mts +53 -0
- package/dist/src/modules/connect/connect.trpc.mjs +17 -0
- package/dist/src/modules/connect/connect.trpc.mjs.map +1 -0
- package/dist/src/modules/connect/connect.types.d.mts +29 -0
- package/dist/src/modules/crypto/crypto.db.d.mts +157 -0
- package/dist/src/modules/crypto/crypto.db.mjs +19 -0
- package/dist/src/modules/crypto/crypto.db.mjs.map +1 -0
- package/dist/src/modules/crypto/crypto.repository.d.mts +163 -0
- package/dist/src/modules/crypto/crypto.repository.mjs +9 -0
- package/dist/src/modules/crypto/crypto.repository.mjs.map +1 -0
- package/dist/src/modules/crypto/crypto.service.d.mts +15 -0
- package/dist/src/modules/crypto/crypto.service.mjs +40 -0
- package/dist/src/modules/crypto/crypto.service.mjs.map +1 -0
- package/dist/src/modules/email/email.service.d.mts +62 -0
- package/dist/src/modules/email/email.service.mjs +105 -0
- package/dist/src/modules/email/email.service.mjs.map +1 -0
- package/dist/src/modules/file/file.repository.d.mts +17 -0
- package/dist/src/modules/file/file.repository.mjs +72 -0
- package/dist/src/modules/file/file.repository.mjs.map +1 -0
- package/dist/src/modules/file/{file.router.d.ts → file.router.d.mts} +4 -0
- package/dist/src/modules/file/file.router.mjs +88 -0
- package/dist/src/modules/file/file.router.mjs.map +1 -0
- package/dist/src/modules/file/file.service.d.mts +30 -0
- package/dist/src/modules/file/file.service.mjs +117 -0
- package/dist/src/modules/file/file.service.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.db.d.mts +568 -0
- package/dist/src/modules/recurrence/recurrence.db.mjs +47 -0
- package/dist/src/modules/recurrence/recurrence.db.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.repository.d.mts +588 -0
- package/dist/src/modules/recurrence/recurrence.repository.mjs +28 -0
- package/dist/src/modules/recurrence/recurrence.repository.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.service.d.mts +51 -0
- package/dist/src/modules/recurrence/recurrence.service.mjs +64 -0
- package/dist/src/modules/recurrence/recurrence.service.mjs.map +1 -0
- package/dist/src/modules/recurrence/recurrence.trpc.d.mts +65 -0
- package/dist/src/modules/recurrence/recurrence.trpc.mjs +44 -0
- package/dist/src/modules/recurrence/recurrence.trpc.mjs.map +1 -0
- package/dist/src/modules/social/social.dto.d.mts +39 -0
- package/dist/src/modules/social/social.dto.mjs +22 -0
- package/dist/src/modules/social/social.dto.mjs.map +1 -0
- package/dist/src/modules/social/{social.linkedin.d.ts → social.linkedin.d.mts} +8 -3
- package/dist/src/modules/social/social.linkedin.mjs +346 -0
- package/dist/src/modules/social/social.linkedin.mjs.map +1 -0
- package/dist/src/modules/social/social.service.d.mts +34 -0
- package/dist/src/modules/social/social.service.mjs +55 -0
- package/dist/src/modules/social/social.service.mjs.map +1 -0
- package/dist/src/modules/social/social.types.d.mts +40 -0
- package/dist/src/modules/tag/tag.db.d.mts +352 -0
- package/dist/src/modules/tag/tag.db.mjs +35 -0
- package/dist/src/modules/tag/tag.db.mjs.map +1 -0
- package/dist/src/modules/tag/tag.dto.d.mts +1025 -0
- package/dist/src/modules/tag/tag.dto.mjs +11 -0
- package/dist/src/modules/tag/tag.dto.mjs.map +1 -0
- package/dist/src/modules/tag/tag.repository.d.mts +394 -0
- package/dist/src/modules/tag/tag.repository.mjs +114 -0
- package/dist/src/modules/tag/tag.repository.mjs.map +1 -0
- package/dist/src/modules/tag/tag.service.d.mts +93 -0
- package/dist/src/modules/tag/tag.service.mjs +47 -0
- package/dist/src/modules/tag/tag.service.mjs.map +1 -0
- package/dist/src/modules/tag/tag.trpc.d.mts +109 -0
- package/dist/src/modules/tag/tag.trpc.mjs +30 -0
- package/dist/src/modules/tag/tag.trpc.mjs.map +1 -0
- package/dist/src/modules/utils/{applyPagination.d.ts → applyPagination.d.mts} +5 -1
- package/dist/src/modules/utils/applyPagination.mjs +15 -0
- package/dist/src/modules/utils/applyPagination.mjs.map +1 -0
- package/dist/src/modules/utils/applySorting.d.mts +13 -0
- package/dist/src/modules/utils/applySorting.mjs +18 -0
- package/dist/src/modules/utils/applySorting.mjs.map +1 -0
- package/dist/src/modules/utils/getConditionsFromFilters.d.mts +9 -0
- package/dist/src/modules/utils/getConditionsFromFilters.mjs +150 -0
- package/dist/src/modules/utils/getConditionsFromFilters.mjs.map +1 -0
- package/dist/src/modules/video/video.service.d.mts +12 -0
- package/dist/src/modules/video/video.service.mjs +50 -0
- package/dist/src/modules/video/video.service.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.constants.d.mts +12 -0
- package/dist/src/modules/webhook/webhook.constants.mjs +12 -0
- package/dist/src/modules/webhook/webhook.constants.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.db.d.mts +142 -0
- package/dist/src/modules/webhook/webhook.db.mjs +17 -0
- package/dist/src/modules/webhook/webhook.db.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.dto.d.mts +402 -0
- package/dist/src/modules/webhook/webhook.dto.mjs +9 -0
- package/dist/src/modules/webhook/webhook.dto.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.repository.d.mts +154 -0
- package/dist/src/modules/webhook/webhook.repository.mjs +50 -0
- package/dist/src/modules/webhook/webhook.repository.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.router.d.mts +8 -0
- package/dist/src/modules/webhook/webhook.router.mjs +23 -0
- package/dist/src/modules/webhook/webhook.router.mjs.map +1 -0
- package/dist/src/modules/webhook/webhook.service.d.mts +14 -0
- package/dist/src/modules/webhook/webhook.service.mjs +59 -0
- package/dist/src/modules/webhook/webhook.service.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.db.d.mts +302 -0
- package/dist/src/modules/workflow/workflow.db.mjs +28 -0
- package/dist/src/modules/workflow/workflow.db.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.repository.d.mts +371 -0
- package/dist/src/modules/workflow/workflow.repository.mjs +93 -0
- package/dist/src/modules/workflow/workflow.repository.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.service.d.mts +31 -0
- package/dist/src/modules/workflow/workflow.service.mjs +40 -0
- package/dist/src/modules/workflow/workflow.service.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.trpc.d.mts +28 -0
- package/dist/src/modules/workflow/workflow.trpc.mjs +17 -0
- package/dist/src/modules/workflow/workflow.trpc.mjs.map +1 -0
- package/dist/src/modules/workflow/workflow.types.d.mts +25 -0
- package/dist/src/modules/workflow/workflow.utils.d.mts +36 -0
- package/dist/src/modules/workflow/workflow.utils.mjs +181 -0
- package/dist/src/modules/workflow/workflow.utils.mjs.map +1 -0
- package/dist/src/types.d.mts +346 -0
- package/dist/src/types.mjs +13 -0
- package/dist/src/types.mjs.map +1 -0
- package/dist/src/utils/errors.d.mts +62 -0
- package/dist/src/utils/errors.mjs +96 -0
- package/dist/src/utils/errors.mjs.map +1 -0
- package/dist/src/utils/logger.d.mts +7 -0
- package/dist/src/utils/logger.mjs +10 -0
- package/dist/src/utils/logger.mjs.map +1 -0
- package/dist/src/utils/posthog.d.mts +17 -0
- package/dist/src/utils/posthog.mjs +25 -0
- package/dist/src/utils/posthog.mjs.map +1 -0
- package/dist/src/utils/trpc.d.mts +54 -0
- package/dist/src/utils/trpc.mjs +146 -0
- package/dist/src/utils/trpc.mjs.map +1 -0
- package/dist/src/utils/types.d.mts +9 -0
- package/package.json +5 -4
- package/dist/src/lib/posthog.d.ts +0 -2
- package/dist/src/lib/posthog.js +0 -7
- package/dist/src/lib/sentry.js +0 -9
- package/dist/src/modules/access/access.repository.d.ts +0 -2347
- package/dist/src/modules/access/access.repository.js +0 -32
- package/dist/src/modules/access/access.service.d.ts +0 -21
- package/dist/src/modules/access/access.service.js +0 -51
- package/dist/src/modules/access/access.test.js +0 -182
- package/dist/src/modules/access/access.utils.d.ts +0 -16
- package/dist/src/modules/access/access.utils.js +0 -20
- package/dist/src/modules/ai/ai.db.d.ts +0 -395
- package/dist/src/modules/ai/ai.db.js +0 -39
- package/dist/src/modules/ai/ai.prompt.d.ts +0 -26
- package/dist/src/modules/ai/ai.prompt.js +0 -30
- package/dist/src/modules/ai/ai.prompts.d.ts +0 -5
- package/dist/src/modules/ai/ai.repository.d.ts +0 -423
- package/dist/src/modules/ai/ai.repository.js +0 -26
- package/dist/src/modules/ai/ai.router.js +0 -132
- package/dist/src/modules/ai/ai.service.d.ts +0 -127
- package/dist/src/modules/ai/ai.service.js +0 -297
- package/dist/src/modules/ai/ai.trpc.d.ts +0 -22
- package/dist/src/modules/ai/ai.trpc.js +0 -20
- package/dist/src/modules/ai/ideogram/ideogram.constants.d.ts +0 -7
- package/dist/src/modules/ai/ideogram/ideogram.constants.js +0 -167
- package/dist/src/modules/ai/ideogram/ideogram.dto.d.ts +0 -229
- package/dist/src/modules/ai/ideogram/ideogram.dto.js +0 -49
- package/dist/src/modules/ai/ideogram/ideogram.prompt.d.ts +0 -2
- package/dist/src/modules/ai/ideogram/ideogram.repository.d.ts +0 -6
- package/dist/src/modules/ai/ideogram/ideogram.repository.js +0 -46
- package/dist/src/modules/ai/ideogram/ideogram.service.d.ts +0 -9
- package/dist/src/modules/ai/ideogram/ideogram.service.js +0 -11
- package/dist/src/modules/auth/auth.db.d.ts +0 -2335
- package/dist/src/modules/auth/auth.db.js +0 -215
- package/dist/src/modules/auth/auth.dto.d.ts +0 -65
- package/dist/src/modules/auth/auth.dto.js +0 -38
- package/dist/src/modules/auth/auth.lib.d.ts +0 -4873
- package/dist/src/modules/auth/auth.lib.js +0 -284
- package/dist/src/modules/auth/auth.middleware.d.ts +0 -614
- package/dist/src/modules/auth/auth.middleware.js +0 -52
- package/dist/src/modules/auth/auth.repository.d.ts +0 -2421
- package/dist/src/modules/auth/auth.repository.js +0 -636
- package/dist/src/modules/auth/auth.service.d.ts +0 -108
- package/dist/src/modules/auth/auth.service.js +0 -246
- package/dist/src/modules/auth/auth.trpc.d.ts +0 -292
- package/dist/src/modules/auth/auth.trpc.js +0 -179
- package/dist/src/modules/auth/auth.utils.d.ts +0 -2351
- package/dist/src/modules/auth/auth.utils.js +0 -97
- package/dist/src/modules/base/base.abstract.d.ts +0 -19
- package/dist/src/modules/base/base.abstract.js +0 -62
- package/dist/src/modules/base/base.dto.d.ts +0 -69
- package/dist/src/modules/base/base.dto.js +0 -112
- package/dist/src/modules/base/base.grants.d.ts +0 -28
- package/dist/src/modules/base/base.grants.js +0 -123
- package/dist/src/modules/base/base.grants.test.js +0 -668
- package/dist/src/modules/base/base.procedure.d.ts +0 -112
- package/dist/src/modules/base/base.procedure.js +0 -289
- package/dist/src/modules/base/base.repository.d.ts +0 -97
- package/dist/src/modules/base/base.repository.js +0 -317
- package/dist/src/modules/base/base.service.d.ts +0 -52
- package/dist/src/modules/base/base.service.js +0 -116
- package/dist/src/modules/base/base.service.test.js +0 -415
- package/dist/src/modules/base/base.types.d.ts +0 -1
- package/dist/src/modules/base/base.types.js +0 -2
- package/dist/src/modules/billing/billing.db.d.ts +0 -365
- package/dist/src/modules/billing/billing.db.js +0 -29
- package/dist/src/modules/billing/billing.repository.d.ts +0 -2763
- package/dist/src/modules/billing/billing.repository.js +0 -235
- package/dist/src/modules/billing/billing.router.d.ts +0 -4
- package/dist/src/modules/billing/billing.router.js +0 -56
- package/dist/src/modules/billing/billing.service.d.ts +0 -59
- package/dist/src/modules/billing/billing.service.js +0 -147
- package/dist/src/modules/billing/billing.trpc.d.ts +0 -38
- package/dist/src/modules/billing/billing.trpc.js +0 -17
- package/dist/src/modules/clay/clay.repository.d.ts +0 -5
- package/dist/src/modules/clay/clay.repository.js +0 -26
- package/dist/src/modules/clay/clay.service.d.ts +0 -28
- package/dist/src/modules/clay/clay.service.js +0 -24
- package/dist/src/modules/connect/connect.db.d.ts +0 -356
- package/dist/src/modules/connect/connect.db.js +0 -30
- package/dist/src/modules/connect/connect.dto.d.ts +0 -74
- package/dist/src/modules/connect/connect.dto.js +0 -36
- package/dist/src/modules/connect/connect.linkedin.d.ts +0 -2
- package/dist/src/modules/connect/connect.linkedin.js +0 -53
- package/dist/src/modules/connect/connect.oauth.d.ts +0 -27
- package/dist/src/modules/connect/connect.oauth.js +0 -198
- package/dist/src/modules/connect/connect.repository.d.ts +0 -413
- package/dist/src/modules/connect/connect.repository.js +0 -54
- package/dist/src/modules/connect/connect.router.d.ts +0 -4
- package/dist/src/modules/connect/connect.router.js +0 -54
- package/dist/src/modules/connect/connect.service.d.ts +0 -88
- package/dist/src/modules/connect/connect.service.js +0 -114
- package/dist/src/modules/connect/connect.trpc.d.ts +0 -44
- package/dist/src/modules/connect/connect.trpc.js +0 -21
- package/dist/src/modules/connect/connect.types.d.ts +0 -25
- package/dist/src/modules/connect/connect.types.js +0 -2
- package/dist/src/modules/crypto/crypto.db.d.ts +0 -151
- package/dist/src/modules/crypto/crypto.db.js +0 -17
- package/dist/src/modules/crypto/crypto.repository.d.ts +0 -159
- package/dist/src/modules/crypto/crypto.repository.js +0 -10
- package/dist/src/modules/crypto/crypto.service.d.ts +0 -10
- package/dist/src/modules/crypto/crypto.service.js +0 -52
- package/dist/src/modules/email/email.service.d.ts +0 -56
- package/dist/src/modules/email/email.service.js +0 -106
- package/dist/src/modules/file/file.repository.d.ts +0 -12
- package/dist/src/modules/file/file.repository.js +0 -79
- package/dist/src/modules/file/file.router.js +0 -99
- package/dist/src/modules/file/file.service.d.ts +0 -24
- package/dist/src/modules/file/file.service.js +0 -150
- package/dist/src/modules/recurrence/recurrence.db.d.ts +0 -562
- package/dist/src/modules/recurrence/recurrence.db.js +0 -66
- package/dist/src/modules/recurrence/recurrence.repository.d.ts +0 -584
- package/dist/src/modules/recurrence/recurrence.repository.js +0 -39
- package/dist/src/modules/recurrence/recurrence.service.d.ts +0 -50
- package/dist/src/modules/recurrence/recurrence.service.js +0 -69
- package/dist/src/modules/recurrence/recurrence.trpc.d.ts +0 -206
- package/dist/src/modules/recurrence/recurrence.trpc.js +0 -65
- package/dist/src/modules/social/social.dto.d.ts +0 -34
- package/dist/src/modules/social/social.dto.js +0 -18
- package/dist/src/modules/social/social.linkedin.js +0 -427
- package/dist/src/modules/social/social.linkedin.test.js +0 -235
- package/dist/src/modules/social/social.service.d.ts +0 -28
- package/dist/src/modules/social/social.service.js +0 -76
- package/dist/src/modules/social/social.types.d.ts +0 -35
- package/dist/src/modules/social/social.types.js +0 -2
- package/dist/src/modules/tag/tag.db.d.ts +0 -346
- package/dist/src/modules/tag/tag.db.js +0 -42
- package/dist/src/modules/tag/tag.dto.d.ts +0 -1018
- package/dist/src/modules/tag/tag.dto.js +0 -9
- package/dist/src/modules/tag/tag.repository.d.ts +0 -383
- package/dist/src/modules/tag/tag.repository.js +0 -156
- package/dist/src/modules/tag/tag.service.d.ts +0 -109
- package/dist/src/modules/tag/tag.service.js +0 -42
- package/dist/src/modules/tag/tag.trpc.d.ts +0 -164
- package/dist/src/modules/tag/tag.trpc.js +0 -53
- package/dist/src/modules/utils/applyPagination.js +0 -16
- package/dist/src/modules/utils/applySorting.d.ts +0 -8
- package/dist/src/modules/utils/applySorting.js +0 -18
- package/dist/src/modules/utils/getConditionsFromFilters.d.ts +0 -4
- package/dist/src/modules/utils/getConditionsFromFilters.js +0 -200
- package/dist/src/modules/video/video.service.d.ts +0 -7
- package/dist/src/modules/video/video.service.js +0 -84
- package/dist/src/modules/webhook/webhook.constants.d.ts +0 -8
- package/dist/src/modules/webhook/webhook.constants.js +0 -10
- package/dist/src/modules/webhook/webhook.db.d.ts +0 -136
- package/dist/src/modules/webhook/webhook.db.js +0 -17
- package/dist/src/modules/webhook/webhook.dto.d.ts +0 -394
- package/dist/src/modules/webhook/webhook.dto.js +0 -7
- package/dist/src/modules/webhook/webhook.repository.d.ts +0 -148
- package/dist/src/modules/webhook/webhook.repository.js +0 -56
- package/dist/src/modules/webhook/webhook.router.d.ts +0 -3
- package/dist/src/modules/webhook/webhook.router.js +0 -30
- package/dist/src/modules/webhook/webhook.service.d.ts +0 -9
- package/dist/src/modules/webhook/webhook.service.js +0 -68
- package/dist/src/modules/workflow/workflow.db.d.ts +0 -296
- package/dist/src/modules/workflow/workflow.db.js +0 -30
- package/dist/src/modules/workflow/workflow.repository.d.ts +0 -343
- package/dist/src/modules/workflow/workflow.repository.js +0 -105
- package/dist/src/modules/workflow/workflow.service.d.ts +0 -21
- package/dist/src/modules/workflow/workflow.service.js +0 -37
- package/dist/src/modules/workflow/workflow.trpc.d.ts +0 -56
- package/dist/src/modules/workflow/workflow.trpc.js +0 -21
- package/dist/src/modules/workflow/workflow.types.d.ts +0 -20
- package/dist/src/modules/workflow/workflow.types.js +0 -2
- package/dist/src/modules/workflow/workflow.utils.d.ts +0 -21
- package/dist/src/modules/workflow/workflow.utils.js +0 -173
- package/dist/src/test/stubs/utils.d.ts +0 -2
- package/dist/src/test/stubs/utils.js +0 -5
- package/dist/src/trpc/context.d.ts +0 -41
- package/dist/src/trpc/context.js +0 -17
- package/dist/src/trpc/index.d.ts +0 -3
- package/dist/src/trpc/index.js +0 -6
- package/dist/src/trpc/procedures.d.ts +0 -233
- package/dist/src/trpc/procedures.js +0 -32
- package/dist/src/trpc/utils.d.ts +0 -4
- package/dist/src/trpc/utils.js +0 -20
- package/dist/src/types.d.ts +0 -358
- package/dist/src/types.js +0 -12
- package/dist/src/utils/errors.d.ts +0 -49
- package/dist/src/utils/errors.js +0 -104
- package/dist/src/utils/logger.d.ts +0 -1
- package/dist/src/utils/logger.js +0 -11
- package/dist/src/utils/posthog.d.ts +0 -13
- package/dist/src/utils/posthog.js +0 -31
- package/dist/src/utils/trpc.d.ts +0 -58
- package/dist/src/utils/trpc.js +0 -63
- package/dist/src/utils/types.d.ts +0 -4
- package/dist/src/utils/types.js +0 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/src/{lib/sentry.d.ts → modules/ai/ai.router.mjs} +0 -0
- /package/dist/src/modules/{access/access.test.d.ts → base/base.types.mjs} +0 -0
- /package/dist/src/modules/{ai/ai.router.d.ts → connect/connect.types.mjs} +0 -0
- /package/dist/src/modules/{base/base.grants.test.d.ts → social/social.types.mjs} +0 -0
- /package/dist/src/modules/{base/base.service.test.d.ts → workflow/workflow.types.mjs} +0 -0
- /package/dist/src/{modules/social/social.linkedin.test.d.ts → utils/types.mjs} +0 -0
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseExternaRepository = exports.BaseTableRepository = exports.BaseRepository = exports.arrayContains = exports.TableConditionBuilder = exports.ConditionBuilder = void 0;
|
|
4
|
-
const drizzle_orm_1 = require("drizzle-orm");
|
|
5
|
-
const neverthrow_1 = require("neverthrow");
|
|
6
|
-
const errors_1 = require("../../utils/errors");
|
|
7
|
-
const applyPagination_1 = require("../utils/applyPagination");
|
|
8
|
-
const applySorting_1 = require("../utils/applySorting");
|
|
9
|
-
const getConditionsFromFilters_1 = require("../utils/getConditionsFromFilters");
|
|
10
|
-
const base_abstract_1 = require("./base.abstract");
|
|
11
|
-
const base_dto_1 = require("./base.dto");
|
|
12
|
-
class ConditionBuilder {
|
|
13
|
-
conditions;
|
|
14
|
-
constructor(conditions = []) {
|
|
15
|
-
this.conditions = conditions;
|
|
16
|
-
this.conditions = conditions;
|
|
17
|
-
}
|
|
18
|
-
push(condition) {
|
|
19
|
-
if (condition)
|
|
20
|
-
this.conditions.push(condition);
|
|
21
|
-
}
|
|
22
|
-
join(type = "and") {
|
|
23
|
-
if (this.conditions.length === 0)
|
|
24
|
-
return undefined;
|
|
25
|
-
if (this.conditions.length === 1)
|
|
26
|
-
return this.conditions[0];
|
|
27
|
-
return type === "and" ? (0, drizzle_orm_1.and)(...this.conditions) : (0, drizzle_orm_1.or)(...this.conditions);
|
|
28
|
-
}
|
|
29
|
-
[Symbol.iterator]() {
|
|
30
|
-
return this.conditions[Symbol.iterator]();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.ConditionBuilder = ConditionBuilder;
|
|
34
|
-
class TableConditionBuilder extends ConditionBuilder {
|
|
35
|
-
table;
|
|
36
|
-
constructor(table) {
|
|
37
|
-
super();
|
|
38
|
-
this.table = table;
|
|
39
|
-
}
|
|
40
|
-
applyFilters({ filters } = {}) {
|
|
41
|
-
if (filters && filters.length > 0)
|
|
42
|
-
(0, getConditionsFromFilters_1.getConditionsFromFilters)(this, filters, this.table);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.TableConditionBuilder = TableConditionBuilder;
|
|
46
|
-
const arrayContains = (table, values) => {
|
|
47
|
-
const arrayContains = [];
|
|
48
|
-
for (const value of values) {
|
|
49
|
-
arrayContains.push((0, drizzle_orm_1.like)(table, `%"${value}%"`));
|
|
50
|
-
}
|
|
51
|
-
return (0, drizzle_orm_1.or)(...arrayContains);
|
|
52
|
-
};
|
|
53
|
-
exports.arrayContains = arrayContains;
|
|
54
|
-
class BaseRepository extends base_abstract_1.Base {
|
|
55
|
-
orm;
|
|
56
|
-
schema;
|
|
57
|
-
repository;
|
|
58
|
-
constructor(options, repository) {
|
|
59
|
-
super("repository");
|
|
60
|
-
this.orm = options.orm;
|
|
61
|
-
this.schema = options.schema;
|
|
62
|
-
this.repository = repository;
|
|
63
|
-
}
|
|
64
|
-
getConditionBuilder(table) {
|
|
65
|
-
if (table === undefined) {
|
|
66
|
-
return new ConditionBuilder();
|
|
67
|
-
}
|
|
68
|
-
return new TableConditionBuilder(table);
|
|
69
|
-
}
|
|
70
|
-
throwableQuery(fn) {
|
|
71
|
-
return this.throwablePromise(() => fn(), (error) => new errors_1.ServerError({
|
|
72
|
-
code: "INTERNAL_SERVER_ERROR",
|
|
73
|
-
layer: "repository",
|
|
74
|
-
layerName: this.constructor.name,
|
|
75
|
-
message: "Database query failed",
|
|
76
|
-
cause: error,
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
withPagination(query, { page, limit }) {
|
|
80
|
-
return (0, applyPagination_1.applyPagination)(query, limit, page);
|
|
81
|
-
}
|
|
82
|
-
withSorting(query, { sort, order }, table) {
|
|
83
|
-
if (!table)
|
|
84
|
-
throw new Error("No table provided");
|
|
85
|
-
return (0, applySorting_1.applySorting)(query, table, sort, order);
|
|
86
|
-
}
|
|
87
|
-
withSortingAndPagination(query, { sort, order, page, limit }, table) {
|
|
88
|
-
if (!table)
|
|
89
|
-
throw new Error("No table provided");
|
|
90
|
-
return this.withSorting(this.withPagination(query, { page, limit }), { sort, order }, table);
|
|
91
|
-
}
|
|
92
|
-
addUserIdFilter(userId, query) {
|
|
93
|
-
const userIdFilter = {
|
|
94
|
-
columnId: "userId",
|
|
95
|
-
type: "string",
|
|
96
|
-
method: "equals",
|
|
97
|
-
value: userId,
|
|
98
|
-
};
|
|
99
|
-
return query
|
|
100
|
-
? { ...query, filters: [...(query?.filters ?? []), userIdFilter] }
|
|
101
|
-
: { filters: [userIdFilter] };
|
|
102
|
-
}
|
|
103
|
-
helpers = {
|
|
104
|
-
pickColumns: base_dto_1.pickColumns,
|
|
105
|
-
arrayContains: exports.arrayContains,
|
|
106
|
-
ConditionBuilder,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
exports.BaseRepository = BaseRepository;
|
|
110
|
-
/**
|
|
111
|
-
* Generic table-bound repository with typed CRUD, returning ServerResultAsync via throwableAsync.
|
|
112
|
-
*
|
|
113
|
-
* Example:
|
|
114
|
-
* const userRepo = new UserRepository(db, schema);
|
|
115
|
-
* class UserRepository extends BaseTableRepository<typeof schema.user> {
|
|
116
|
-
* constructor(db: LibSQLDatabase<typeof schema>, schema: typeof schema) {
|
|
117
|
-
* super(db, schema, schema.user);
|
|
118
|
-
* }
|
|
119
|
-
* }
|
|
120
|
-
*/
|
|
121
|
-
class BaseTableRepository extends BaseRepository {
|
|
122
|
-
table;
|
|
123
|
-
idKey;
|
|
124
|
-
idColumn;
|
|
125
|
-
constructor(options, repository) {
|
|
126
|
-
super({ orm: options.orm, schema: options.schema }, repository);
|
|
127
|
-
this.table = options.table;
|
|
128
|
-
this.idKey = options.idKey ?? "id";
|
|
129
|
-
this.idColumn = this.table[this.idKey];
|
|
130
|
-
}
|
|
131
|
-
withSorting(query, { sort, order }, table) {
|
|
132
|
-
return super.withSorting(query, { sort, order }, table || this.table);
|
|
133
|
-
}
|
|
134
|
-
withSortingAndPagination(query, { sort, order, page, limit }, table) {
|
|
135
|
-
return super.withSortingAndPagination(query, { sort, order, page, limit }, table || this.table);
|
|
136
|
-
}
|
|
137
|
-
async queryList(query, options, tx) {
|
|
138
|
-
return this.throwableAsync(async () => {
|
|
139
|
-
const db = tx ?? this.orm;
|
|
140
|
-
const conditions = options?.conditions ?? this.getConditionBuilder(this.table);
|
|
141
|
-
conditions.applyFilters(query);
|
|
142
|
-
const whereClause = conditions.join();
|
|
143
|
-
const rowsQuery = this.withSortingAndPagination((options?.select ? db.select(options.select) : db.select())
|
|
144
|
-
.from(this.table)
|
|
145
|
-
.where(whereClause), query || {});
|
|
146
|
-
const countQuery = db
|
|
147
|
-
.select({ count: (0, drizzle_orm_1.count)() })
|
|
148
|
-
.from(this.table)
|
|
149
|
-
.where(whereClause);
|
|
150
|
-
const [rows, [totalResult]] = await Promise.all([rowsQuery, countQuery]);
|
|
151
|
-
return (0, neverthrow_1.ok)({ rows: rows, total: totalResult?.count ?? 0 });
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
async findById(id, tx) {
|
|
155
|
-
return this.throwableAsync(async () => {
|
|
156
|
-
const db = tx ?? this.orm;
|
|
157
|
-
const rows = (await db
|
|
158
|
-
.select()
|
|
159
|
-
.from(this.table)
|
|
160
|
-
.where((0, drizzle_orm_1.eq)(this.idColumn, id)));
|
|
161
|
-
return (0, neverthrow_1.ok)(rows[0]);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
async findManyById(ids, tx) {
|
|
165
|
-
return this.throwableAsync(async () => {
|
|
166
|
-
const db = tx ?? this.orm;
|
|
167
|
-
if (ids.length === 0) {
|
|
168
|
-
return (0, neverthrow_1.ok)([]);
|
|
169
|
-
}
|
|
170
|
-
const rows = (await db
|
|
171
|
-
.select()
|
|
172
|
-
.from(this.table)
|
|
173
|
-
.where((0, drizzle_orm_1.inArray)(this.idColumn, ids)));
|
|
174
|
-
return (0, neverthrow_1.ok)(rows);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
async create(data, tx) {
|
|
178
|
-
return this.throwableAsync(async () => {
|
|
179
|
-
const db = tx ?? this.orm;
|
|
180
|
-
const rows = (await db
|
|
181
|
-
.insert(this.table)
|
|
182
|
-
.values(data)
|
|
183
|
-
.returning());
|
|
184
|
-
if (rows.length === 0)
|
|
185
|
-
return this.error("UNPROCESSABLE_CONTENT");
|
|
186
|
-
return (0, neverthrow_1.ok)(rows[0]);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
async createMany(data, tx) {
|
|
190
|
-
return this.throwableAsync(async () => {
|
|
191
|
-
const db = tx ?? this.orm;
|
|
192
|
-
if (data.length === 0) {
|
|
193
|
-
return (0, neverthrow_1.ok)([]);
|
|
194
|
-
}
|
|
195
|
-
const rows = (await db
|
|
196
|
-
.insert(this.table)
|
|
197
|
-
.values(data)
|
|
198
|
-
.returning());
|
|
199
|
-
return (0, neverthrow_1.ok)(rows);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
async update(data, tx) {
|
|
203
|
-
return this.throwableAsync(async () => {
|
|
204
|
-
const db = tx ?? this.orm;
|
|
205
|
-
const single = data;
|
|
206
|
-
const id = String(single[this.idKey]);
|
|
207
|
-
const { [this.idKey]: _removed, ...rest } = single;
|
|
208
|
-
const update = rest;
|
|
209
|
-
if (this.table.updatedAt)
|
|
210
|
-
update.updatedAt = new Date();
|
|
211
|
-
const rows = (await db
|
|
212
|
-
.update(this.table)
|
|
213
|
-
.set(update)
|
|
214
|
-
.where((0, drizzle_orm_1.eq)(this.idColumn, id))
|
|
215
|
-
.returning());
|
|
216
|
-
const [row] = rows;
|
|
217
|
-
if (!row)
|
|
218
|
-
return this.error("NOT_FOUND");
|
|
219
|
-
return (0, neverthrow_1.ok)(row);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
async updateMany(data, tx) {
|
|
223
|
-
return this.throwableAsync(async () => {
|
|
224
|
-
const db = tx ?? this.orm;
|
|
225
|
-
if (data.length === 0) {
|
|
226
|
-
return (0, neverthrow_1.ok)([]);
|
|
227
|
-
}
|
|
228
|
-
const results = [];
|
|
229
|
-
for (const item of data) {
|
|
230
|
-
const record = item;
|
|
231
|
-
const id = String(record[this.idKey]);
|
|
232
|
-
const { [this.idKey]: _removed, ...rest } = record;
|
|
233
|
-
const update = rest;
|
|
234
|
-
if (this.table.updatedAt)
|
|
235
|
-
update.updatedAt = new Date();
|
|
236
|
-
const rows = (await db
|
|
237
|
-
.update(this.table)
|
|
238
|
-
.set(update)
|
|
239
|
-
.where((0, drizzle_orm_1.eq)(this.idColumn, id))
|
|
240
|
-
.returning());
|
|
241
|
-
if (rows[0])
|
|
242
|
-
results.push(rows[0]);
|
|
243
|
-
}
|
|
244
|
-
return (0, neverthrow_1.ok)(results);
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
async softDeleteById(id, tx) {
|
|
248
|
-
return this.throwableAsync(async () => {
|
|
249
|
-
const db = tx ?? this.orm;
|
|
250
|
-
if (!this.table.deletedAt)
|
|
251
|
-
return this.error("METHOD_NOT_SUPPORTED");
|
|
252
|
-
const rows = await db
|
|
253
|
-
.update(this.table)
|
|
254
|
-
.set({ deletedAt: new Date() })
|
|
255
|
-
.where((0, drizzle_orm_1.eq)(this.idColumn, id))
|
|
256
|
-
.returning({
|
|
257
|
-
id: this.idColumn,
|
|
258
|
-
});
|
|
259
|
-
if (rows.length === 0)
|
|
260
|
-
return this.error("NOT_FOUND");
|
|
261
|
-
return (0, neverthrow_1.ok)(rows[0]);
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
async softDeleteManyById(ids, tx) {
|
|
265
|
-
return this.throwableAsync(async () => {
|
|
266
|
-
const db = tx ?? this.orm;
|
|
267
|
-
if (!this.table.deletedAt)
|
|
268
|
-
return this.error("METHOD_NOT_SUPPORTED");
|
|
269
|
-
const rows = await db
|
|
270
|
-
.update(this.table)
|
|
271
|
-
.set({ deletedAt: new Date() })
|
|
272
|
-
.where((0, drizzle_orm_1.inArray)(this.idColumn, ids))
|
|
273
|
-
.returning({
|
|
274
|
-
id: this.idColumn,
|
|
275
|
-
});
|
|
276
|
-
if (rows.length === 0)
|
|
277
|
-
return this.error("NOT_FOUND");
|
|
278
|
-
return (0, neverthrow_1.ok)(rows);
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
async deleteById(id, tx) {
|
|
282
|
-
return this.throwableAsync(async () => {
|
|
283
|
-
const db = tx ?? this.orm;
|
|
284
|
-
const rows = await db
|
|
285
|
-
.delete(this.table)
|
|
286
|
-
.where((0, drizzle_orm_1.eq)(this.idColumn, id))
|
|
287
|
-
.returning({
|
|
288
|
-
id: this.idColumn,
|
|
289
|
-
});
|
|
290
|
-
if (rows.length === 0)
|
|
291
|
-
return this.error("NOT_FOUND");
|
|
292
|
-
return (0, neverthrow_1.ok)(rows[0]);
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
async deleteManyById(ids, tx) {
|
|
296
|
-
return this.throwableAsync(async () => {
|
|
297
|
-
const db = tx ?? this.orm;
|
|
298
|
-
if (ids.length === 0) {
|
|
299
|
-
return (0, neverthrow_1.ok)([]);
|
|
300
|
-
}
|
|
301
|
-
const rows = await db
|
|
302
|
-
.delete(this.table)
|
|
303
|
-
.where((0, drizzle_orm_1.inArray)(this.idColumn, ids))
|
|
304
|
-
.returning({
|
|
305
|
-
id: this.idColumn,
|
|
306
|
-
});
|
|
307
|
-
return (0, neverthrow_1.ok)(rows);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
exports.BaseTableRepository = BaseTableRepository;
|
|
312
|
-
class BaseExternaRepository extends base_abstract_1.Base {
|
|
313
|
-
constructor() {
|
|
314
|
-
super("repository");
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
exports.BaseExternaRepository = BaseExternaRepository;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { QueryFilter, QueryInput } from "@m5kdev/commons/modules/schemas/query.schema";
|
|
2
|
-
import type { Context, Session, User } from "../auth/auth.lib";
|
|
3
|
-
import { Base } from "./base.abstract";
|
|
4
|
-
import type { ServerResult, ServerResultAsync } from "./base.dto";
|
|
5
|
-
import { type Entity, type ResourceActionGrant, type ResourceGrant } from "./base.grants";
|
|
6
|
-
import { type PermissionServiceProcedureBuilder, type ServiceProcedureBuilder, type ServiceProcedureContext } from "./base.procedure";
|
|
7
|
-
export type { PermissionServiceProcedureBuilder, ServiceProcedure, ServiceProcedureAccessConfig, ServiceProcedureAccessEntitiesConfig, ServiceProcedureAccessStateConfig, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilteredInput, ServiceProcedureContextFilterScope, ServiceProcedureEntityStepName, ServiceProcedureInputMapper, } from "./base.procedure";
|
|
8
|
-
export declare class BaseService<Repositories extends Record<string, Base>, Services extends Record<string, Base>, DefaultContext extends ServiceProcedureContext = ServiceProcedureContext> extends Base {
|
|
9
|
-
repository: Repositories;
|
|
10
|
-
service: Services;
|
|
11
|
-
constructor(repository?: Repositories, service?: Services);
|
|
12
|
-
addUserFilter(value: string, query?: undefined, columnId?: string, method?: QueryFilter["method"]): QueryInput;
|
|
13
|
-
addUserFilter<TQuery extends QueryInput>(value: string, query: TQuery, columnId?: string, method?: QueryFilter["method"]): TQuery;
|
|
14
|
-
protected procedure<TInput, TCtx extends ServiceProcedureContext = DefaultContext>(name: string): ServiceProcedureBuilder<TInput, TCtx, Repositories, Services>;
|
|
15
|
-
addContextFilter(ctx: Context, include?: {
|
|
16
|
-
user?: boolean;
|
|
17
|
-
organization?: boolean;
|
|
18
|
-
team?: boolean;
|
|
19
|
-
}, query?: undefined, map?: Record<string, {
|
|
20
|
-
columnId: string;
|
|
21
|
-
method: QueryFilter["method"];
|
|
22
|
-
}>): QueryInput;
|
|
23
|
-
addContextFilter<TQuery extends QueryInput>(ctx: Context, include: {
|
|
24
|
-
user?: boolean;
|
|
25
|
-
organization?: boolean;
|
|
26
|
-
team?: boolean;
|
|
27
|
-
} | undefined, query: TQuery, map?: Record<string, {
|
|
28
|
-
columnId: string;
|
|
29
|
-
method: QueryFilter["method"];
|
|
30
|
-
}>): TQuery;
|
|
31
|
-
}
|
|
32
|
-
export declare class BasePermissionService<Repositories extends Record<string, Base>, Services extends Record<string, Base>, DefaultContext extends ServiceProcedureContext = ServiceProcedureContext> extends BaseService<Repositories, Services, DefaultContext> {
|
|
33
|
-
grants: ResourceGrant[];
|
|
34
|
-
constructor(repository: Repositories, service: Services, grants?: ResourceGrant[]);
|
|
35
|
-
accessGuard<T extends Entity>(ctx: {
|
|
36
|
-
session: Session;
|
|
37
|
-
user: User;
|
|
38
|
-
}, action: string, entities?: T | T[], grants?: ResourceActionGrant[]): ServerResult<true>;
|
|
39
|
-
accessGuardAsync<T extends Entity>(ctx: {
|
|
40
|
-
session: Session;
|
|
41
|
-
user: User;
|
|
42
|
-
}, action: string, getEntities: () => ServerResultAsync<T | T[] | undefined>, grants?: ResourceActionGrant[]): ServerResultAsync<true>;
|
|
43
|
-
protected procedure<TInput, TCtx extends ServiceProcedureContext = DefaultContext>(name: string): PermissionServiceProcedureBuilder<TInput, TCtx, Repositories, Services>;
|
|
44
|
-
checkPermission<T extends Entity>(ctx: {
|
|
45
|
-
session: Session;
|
|
46
|
-
user: User;
|
|
47
|
-
}, action: string, entities?: T | T[], grants?: ResourceActionGrant[]): boolean;
|
|
48
|
-
checkPermissionAsync<T extends Entity>(ctx: {
|
|
49
|
-
session: Session;
|
|
50
|
-
user: User;
|
|
51
|
-
}, action: string, getEntities: () => ServerResultAsync<T | T[] | undefined>, grants?: ResourceActionGrant[]): ServerResultAsync<boolean>;
|
|
52
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BasePermissionService = exports.BaseService = void 0;
|
|
4
|
-
const neverthrow_1 = require("neverthrow");
|
|
5
|
-
const base_abstract_1 = require("./base.abstract");
|
|
6
|
-
const base_grants_1 = require("./base.grants");
|
|
7
|
-
const base_procedure_1 = require("./base.procedure");
|
|
8
|
-
class BaseService extends base_abstract_1.Base {
|
|
9
|
-
repository;
|
|
10
|
-
service;
|
|
11
|
-
constructor(repository = {}, service = {}) {
|
|
12
|
-
super("service");
|
|
13
|
-
this.repository = repository;
|
|
14
|
-
this.service = service;
|
|
15
|
-
this.repository = repository;
|
|
16
|
-
this.service = service;
|
|
17
|
-
}
|
|
18
|
-
addUserFilter(value, query, columnId = "userId", method = "equals") {
|
|
19
|
-
const userFilter = {
|
|
20
|
-
columnId,
|
|
21
|
-
type: "string",
|
|
22
|
-
method,
|
|
23
|
-
value,
|
|
24
|
-
};
|
|
25
|
-
return query
|
|
26
|
-
? { ...query, filters: [...(query?.filters ?? []), userFilter] }
|
|
27
|
-
: { filters: [userFilter] };
|
|
28
|
-
}
|
|
29
|
-
procedure(name) {
|
|
30
|
-
return (0, base_procedure_1.createServiceProcedureBuilder)(this, { name, steps: [] });
|
|
31
|
-
}
|
|
32
|
-
addContextFilter(ctx, include = {
|
|
33
|
-
user: true,
|
|
34
|
-
organization: false,
|
|
35
|
-
team: false,
|
|
36
|
-
}, query, map = {
|
|
37
|
-
userId: {
|
|
38
|
-
columnId: "userId",
|
|
39
|
-
method: "equals",
|
|
40
|
-
},
|
|
41
|
-
organizationId: {
|
|
42
|
-
columnId: "organizationId",
|
|
43
|
-
method: "equals",
|
|
44
|
-
},
|
|
45
|
-
teamId: {
|
|
46
|
-
columnId: "teamId",
|
|
47
|
-
method: "equals",
|
|
48
|
-
},
|
|
49
|
-
}) {
|
|
50
|
-
const filters = [];
|
|
51
|
-
if (include.user) {
|
|
52
|
-
filters.push({
|
|
53
|
-
columnId: map.userId.columnId,
|
|
54
|
-
type: "string",
|
|
55
|
-
method: map.userId.method,
|
|
56
|
-
value: ctx.user.id,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
if (include.organization) {
|
|
60
|
-
filters.push({
|
|
61
|
-
columnId: map.organizationId.columnId,
|
|
62
|
-
type: "string",
|
|
63
|
-
method: map.organizationId.method,
|
|
64
|
-
value: ctx.session.activeOrganizationId ?? "",
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
if (include.team) {
|
|
68
|
-
filters.push({
|
|
69
|
-
columnId: map.teamId.columnId,
|
|
70
|
-
type: "string",
|
|
71
|
-
method: map.teamId.method,
|
|
72
|
-
value: ctx.session.activeTeamId ?? "",
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return query ? { ...query, filters: [...(query?.filters ?? []), ...filters] } : { filters };
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.BaseService = BaseService;
|
|
79
|
-
class BasePermissionService extends BaseService {
|
|
80
|
-
grants;
|
|
81
|
-
constructor(repository, service, grants = []) {
|
|
82
|
-
super(repository, service);
|
|
83
|
-
this.grants = grants;
|
|
84
|
-
}
|
|
85
|
-
accessGuard(ctx, action, entities, grants) {
|
|
86
|
-
const hasPermission = this.checkPermission(ctx, action, entities, grants);
|
|
87
|
-
if (!hasPermission)
|
|
88
|
-
return this.error("FORBIDDEN");
|
|
89
|
-
return (0, neverthrow_1.ok)(true);
|
|
90
|
-
}
|
|
91
|
-
async accessGuardAsync(ctx, action, getEntities, grants) {
|
|
92
|
-
const hasPermission = await this.checkPermissionAsync(ctx, action, getEntities, grants);
|
|
93
|
-
if (hasPermission.isErr())
|
|
94
|
-
return (0, neverthrow_1.err)(hasPermission.error);
|
|
95
|
-
if (!hasPermission.value)
|
|
96
|
-
return this.error("FORBIDDEN");
|
|
97
|
-
return (0, neverthrow_1.ok)(true);
|
|
98
|
-
}
|
|
99
|
-
procedure(name) {
|
|
100
|
-
return (0, base_procedure_1.createPermissionServiceProcedureBuilder)(this, { name, steps: [] });
|
|
101
|
-
}
|
|
102
|
-
checkPermission(ctx, action, entities, grants) {
|
|
103
|
-
const actionGrants = grants ?? this.grants.filter((grant) => grant.action === action);
|
|
104
|
-
return (0, base_grants_1.checkPermissionSync)(ctx, actionGrants, entities);
|
|
105
|
-
}
|
|
106
|
-
async checkPermissionAsync(ctx, action, getEntities, grants) {
|
|
107
|
-
const actionGrants = grants ?? this.grants.filter((grant) => grant.action === action);
|
|
108
|
-
const permission = await (0, base_grants_1.checkPermissionAsync)(ctx, actionGrants, getEntities);
|
|
109
|
-
if (permission.isErr())
|
|
110
|
-
return this.error("INTERNAL_SERVER_ERROR", "Failed to check permission", {
|
|
111
|
-
cause: permission.error,
|
|
112
|
-
});
|
|
113
|
-
return (0, neverthrow_1.ok)(permission.value);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.BasePermissionService = BasePermissionService;
|