@graphoria/server 0.1.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/LICENSE +201 -0
- package/NOTICE +10 -0
- package/README.md +129 -0
- package/cli.ts +105 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/src/ai/agent/agent.d.ts +37 -0
- package/dist/src/ai/agent/agent.d.ts.map +1 -0
- package/dist/src/ai/agent/index.d.ts +3 -0
- package/dist/src/ai/agent/index.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/anthropic.d.ts +10 -0
- package/dist/src/ai/agent/providers/anthropic.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/index.d.ts +8 -0
- package/dist/src/ai/agent/providers/index.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/ollama.d.ts +11 -0
- package/dist/src/ai/agent/providers/ollama.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/openai.d.ts +14 -0
- package/dist/src/ai/agent/providers/openai.d.ts.map +1 -0
- package/dist/src/ai/agent/types.d.ts +51 -0
- package/dist/src/ai/agent/types.d.ts.map +1 -0
- package/dist/src/ai/ask-field.test.d.ts +2 -0
- package/dist/src/ai/ask-field.test.d.ts.map +1 -0
- package/dist/src/ai/index.d.ts +7 -0
- package/dist/src/ai/index.d.ts.map +1 -0
- package/dist/src/ai/mcp/create-server.d.ts +14 -0
- package/dist/src/ai/mcp/create-server.d.ts.map +1 -0
- package/dist/src/ai/mcp/create-server.test.d.ts +2 -0
- package/dist/src/ai/mcp/create-server.test.d.ts.map +1 -0
- package/dist/src/ai/mcp/index.d.ts +13 -0
- package/dist/src/ai/mcp/index.d.ts.map +1 -0
- package/dist/src/ai/mcp/index.test.d.ts +2 -0
- package/dist/src/ai/mcp/index.test.d.ts.map +1 -0
- package/dist/src/ai/mcp/instructions.d.ts +2 -0
- package/dist/src/ai/mcp/instructions.d.ts.map +1 -0
- package/dist/src/ai/tools/agent.d.ts +4 -0
- package/dist/src/ai/tools/agent.d.ts.map +1 -0
- package/dist/src/ai/tools/agent.test.d.ts +2 -0
- package/dist/src/ai/tools/agent.test.d.ts.map +1 -0
- package/dist/src/ai/tools/core.d.ts +75 -0
- package/dist/src/ai/tools/core.d.ts.map +1 -0
- package/dist/src/ai/tools/query-data.d.ts +35 -0
- package/dist/src/ai/tools/query-data.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/fragmentAnalyzer.d.ts +5 -0
- package/dist/src/analyzeQuery/analyzers/fragmentAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/operationAnalyzer.d.ts +6 -0
- package/dist/src/analyzeQuery/analyzers/operationAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/selectionAnalyzer.d.ts +6 -0
- package/dist/src/analyzeQuery/analyzers/selectionAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/variableAnalyzer.d.ts +4 -0
- package/dist/src/analyzeQuery/analyzers/variableAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/depthLimit.d.ts +16 -0
- package/dist/src/analyzeQuery/depthLimit.d.ts.map +1 -0
- package/dist/src/analyzeQuery/depthLimit.test.d.ts +2 -0
- package/dist/src/analyzeQuery/depthLimit.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/directiveUtils.d.ts +4 -0
- package/dist/src/analyzeQuery/directiveUtils.d.ts.map +1 -0
- package/dist/src/analyzeQuery/directiveUtils.test.d.ts +2 -0
- package/dist/src/analyzeQuery/directiveUtils.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/index.d.ts +5 -0
- package/dist/src/analyzeQuery/index.d.ts.map +1 -0
- package/dist/src/analyzeQuery/index.test.d.ts +2 -0
- package/dist/src/analyzeQuery/index.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/resolveVariables.d.ts +71 -0
- package/dist/src/analyzeQuery/resolveVariables.d.ts.map +1 -0
- package/dist/src/analyzeQuery/resolveVariables.test.d.ts +2 -0
- package/dist/src/analyzeQuery/resolveVariables.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/staticValues.test.d.ts +2 -0
- package/dist/src/analyzeQuery/staticValues.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/typeUtils.d.ts +9 -0
- package/dist/src/analyzeQuery/typeUtils.d.ts.map +1 -0
- package/dist/src/analyzeQuery/types.d.ts +54 -0
- package/dist/src/analyzeQuery/types.d.ts.map +1 -0
- package/dist/src/analyzeQuery/valueExtractors.d.ts +4 -0
- package/dist/src/analyzeQuery/valueExtractors.d.ts.map +1 -0
- package/dist/src/authentication/duration.d.ts +14 -0
- package/dist/src/authentication/duration.d.ts.map +1 -0
- package/dist/src/authentication/duration.test.d.ts +2 -0
- package/dist/src/authentication/duration.test.d.ts.map +1 -0
- package/dist/src/authentication/index.d.ts +4 -0
- package/dist/src/authentication/index.d.ts.map +1 -0
- package/dist/src/authentication/index.test.d.ts +2 -0
- package/dist/src/authentication/index.test.d.ts.map +1 -0
- package/dist/src/authentication/jwt.d.ts +10 -0
- package/dist/src/authentication/jwt.d.ts.map +1 -0
- package/dist/src/authentication/jwt.test.d.ts +2 -0
- package/dist/src/authentication/jwt.test.d.ts.map +1 -0
- package/dist/src/authentication/paseto.d.ts +7 -0
- package/dist/src/authentication/paseto.d.ts.map +1 -0
- package/dist/src/authentication/paseto.test.d.ts +2 -0
- package/dist/src/authentication/paseto.test.d.ts.map +1 -0
- package/dist/src/authentication/tokenRepository.d.ts +14 -0
- package/dist/src/authentication/tokenRepository.d.ts.map +1 -0
- package/dist/src/authentication/tokenRepository.test.d.ts +2 -0
- package/dist/src/authentication/tokenRepository.test.d.ts.map +1 -0
- package/dist/src/authentication/types.d.ts +42 -0
- package/dist/src/authentication/types.d.ts.map +1 -0
- package/dist/src/cli/seedAuth.d.ts +4 -0
- package/dist/src/cli/seedAuth.d.ts.map +1 -0
- package/dist/src/cli/seedAuth.test.d.ts +2 -0
- package/dist/src/cli/seedAuth.test.d.ts.map +1 -0
- package/dist/src/cli/seedAuthArgs.d.ts +9 -0
- package/dist/src/cli/seedAuthArgs.d.ts.map +1 -0
- package/dist/src/config/helpers/cronHelper.d.ts +21 -0
- package/dist/src/config/helpers/cronHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/cronHelper.test.d.ts +2 -0
- package/dist/src/config/helpers/cronHelper.test.d.ts.map +1 -0
- package/dist/src/config/helpers/index.d.ts +4 -0
- package/dist/src/config/helpers/index.d.ts.map +1 -0
- package/dist/src/config/helpers/operationHelper.d.ts +44 -0
- package/dist/src/config/helpers/operationHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/queueHelper.d.ts +20 -0
- package/dist/src/config/helpers/queueHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/queueHelper.test.d.ts +2 -0
- package/dist/src/config/helpers/queueHelper.test.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +236 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types/ai.d.ts +29 -0
- package/dist/src/config/types/ai.d.ts.map +1 -0
- package/dist/src/config/types/auth.d.ts +112 -0
- package/dist/src/config/types/auth.d.ts.map +1 -0
- package/dist/src/config/types/configuration.d.ts +61 -0
- package/dist/src/config/types/configuration.d.ts.map +1 -0
- package/dist/src/config/types/cron.d.ts +81 -0
- package/dist/src/config/types/cron.d.ts.map +1 -0
- package/dist/src/config/types/db.d.ts +210 -0
- package/dist/src/config/types/db.d.ts.map +1 -0
- package/dist/src/config/types/index.d.ts +17 -0
- package/dist/src/config/types/index.d.ts.map +1 -0
- package/dist/src/config/types/operation.d.ts +226 -0
- package/dist/src/config/types/operation.d.ts.map +1 -0
- package/dist/src/config/types/queue.d.ts +142 -0
- package/dist/src/config/types/queue.d.ts.map +1 -0
- package/dist/src/config/types/remote-rest.d.ts +18 -0
- package/dist/src/config/types/remote-rest.d.ts.map +1 -0
- package/dist/src/config/types/remote-schema.d.ts +27 -0
- package/dist/src/config/types/remote-schema.d.ts.map +1 -0
- package/dist/src/config/types/virtual-columns.d.ts +89 -0
- package/dist/src/config/types/virtual-columns.d.ts.map +1 -0
- package/dist/src/config/types/virtual-columns.test.d.ts +2 -0
- package/dist/src/config/types/virtual-columns.test.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/index.d.ts +867 -0
- package/dist/src/configuration/getSchemas/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts +412 -0
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.d.ts +16 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.test.d.ts +2 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/buildExecute.d.ts +31 -0
- package/dist/src/configuration/gql/buildExecute.d.ts.map +1 -0
- package/dist/src/configuration/gql/buildExecute.test.d.ts +2 -0
- package/dist/src/configuration/gql/buildExecute.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/gqlAuthOperations.d.ts +9 -0
- package/dist/src/configuration/gql/gqlAuthOperations.d.ts.map +1 -0
- package/dist/src/configuration/gql/gqlAuthOperations.test.d.ts +2 -0
- package/dist/src/configuration/gql/gqlAuthOperations.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.d.ts +28 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.test.d.ts +2 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLSubscriptionFactory.d.ts +19 -0
- package/dist/src/configuration/gql/handleGraphQLSubscriptionFactory.d.ts.map +1 -0
- package/dist/src/configuration/index.d.ts +719 -0
- package/dist/src/configuration/index.d.ts.map +1 -0
- package/dist/src/configuration/rest/generateOpenAPI.d.ts +19 -0
- package/dist/src/configuration/rest/generateOpenAPI.d.ts.map +1 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.d.ts +12 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.d.ts.map +1 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.test.d.ts +2 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.test.d.ts.map +1 -0
- package/dist/src/configuration/rest/index.d.ts +20 -0
- package/dist/src/configuration/rest/index.d.ts.map +1 -0
- package/dist/src/configuration/rest/openApiErrors.d.ts +71 -0
- package/dist/src/configuration/rest/openApiErrors.d.ts.map +1 -0
- package/dist/src/console/App.d.ts +3 -0
- package/dist/src/console/App.d.ts.map +1 -0
- package/dist/src/console/Login.d.ts +6 -0
- package/dist/src/console/Login.d.ts.map +1 -0
- package/dist/src/console/api.d.ts +17 -0
- package/dist/src/console/api.d.ts.map +1 -0
- package/dist/src/console/api.test.d.ts +2 -0
- package/dist/src/console/api.test.d.ts.map +1 -0
- package/dist/src/console/client.d.ts +67 -0
- package/dist/src/console/client.d.ts.map +1 -0
- package/dist/src/console/frontend.d.ts +8 -0
- package/dist/src/console/frontend.d.ts.map +1 -0
- package/dist/src/console/pages/ConfigPage.d.ts +2 -0
- package/dist/src/console/pages/ConfigPage.d.ts.map +1 -0
- package/dist/src/console/pages/RolesPage.d.ts +2 -0
- package/dist/src/console/pages/RolesPage.d.ts.map +1 -0
- package/dist/src/console/pages/StatusPage.d.ts +2 -0
- package/dist/src/console/pages/StatusPage.d.ts.map +1 -0
- package/dist/src/console/pages/TablesPage.d.ts +2 -0
- package/dist/src/console/pages/TablesPage.d.ts.map +1 -0
- package/dist/src/console/useApi.d.ts +8 -0
- package/dist/src/console/useApi.d.ts.map +1 -0
- package/dist/src/cron/index.d.ts +63 -0
- package/dist/src/cron/index.d.ts.map +1 -0
- package/dist/src/databases/auth/auth-operations.d.ts +11 -0
- package/dist/src/databases/auth/auth-operations.d.ts.map +1 -0
- package/dist/src/databases/auth/password.d.ts +3 -0
- package/dist/src/databases/auth/password.d.ts.map +1 -0
- package/dist/src/databases/auth/password.test.d.ts +2 -0
- package/dist/src/databases/auth/password.test.d.ts.map +1 -0
- package/dist/src/databases/common.d.ts +53 -0
- package/dist/src/databases/common.d.ts.map +1 -0
- package/dist/src/databases/common.test.d.ts +2 -0
- package/dist/src/databases/common.test.d.ts.map +1 -0
- package/dist/src/databases/core/executor.d.ts +10 -0
- package/dist/src/databases/core/executor.d.ts.map +1 -0
- package/dist/src/databases/core/executor.test.d.ts +2 -0
- package/dist/src/databases/core/executor.test.d.ts.map +1 -0
- package/dist/src/databases/core/function-mapping.d.ts +38 -0
- package/dist/src/databases/core/function-mapping.d.ts.map +1 -0
- package/dist/src/databases/core/identifier.d.ts +2 -0
- package/dist/src/databases/core/identifier.d.ts.map +1 -0
- package/dist/src/databases/core/identifier.test.d.ts +2 -0
- package/dist/src/databases/core/identifier.test.d.ts.map +1 -0
- package/dist/src/databases/core/query-builder.d.ts +64 -0
- package/dist/src/databases/core/query-builder.d.ts.map +1 -0
- package/dist/src/databases/core/query-builder.test.d.ts +2 -0
- package/dist/src/databases/core/query-builder.test.d.ts.map +1 -0
- package/dist/src/databases/directives.d.ts +16 -0
- package/dist/src/databases/directives.d.ts.map +1 -0
- package/dist/src/databases/directives.test.d.ts +2 -0
- package/dist/src/databases/directives.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/auth.d.ts +9 -0
- package/dist/src/databases/engines/mssql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/mssql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/connection.d.ts +14 -0
- package/dist/src/databases/engines/mssql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/format.d.ts +5 -0
- package/dist/src/databases/engines/mssql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/mssql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/mssql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/mssql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/mssql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/auth.d.ts +9 -0
- package/dist/src/databases/engines/mysql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/mysql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/connection.d.ts +14 -0
- package/dist/src/databases/engines/mysql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/format.d.ts +5 -0
- package/dist/src/databases/engines/mysql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/mysql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/mysql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/mysql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/mysql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/auth.d.ts +9 -0
- package/dist/src/databases/engines/postgresql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/postgresql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/connection.d.ts +14 -0
- package/dist/src/databases/engines/postgresql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/format.d.ts +5 -0
- package/dist/src/databases/engines/postgresql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/postgresql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/postgresql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/postgresql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/postgresql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/shared/claims.d.ts +2 -0
- package/dist/src/databases/engines/shared/claims.d.ts.map +1 -0
- package/dist/src/databases/engines/shared/types.d.ts +8 -0
- package/dist/src/databases/engines/shared/types.d.ts.map +1 -0
- package/dist/src/databases/high-level-operations.d.ts +146 -0
- package/dist/src/databases/high-level-operations.d.ts.map +1 -0
- package/dist/src/databases/high-level-operations.test.d.ts +2 -0
- package/dist/src/databases/high-level-operations.test.d.ts.map +1 -0
- package/dist/src/databases/index.d.ts +8 -0
- package/dist/src/databases/index.d.ts.map +1 -0
- package/dist/src/databases/metadata/structure.d.ts +56 -0
- package/dist/src/databases/metadata/structure.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/convert.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/convert.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.d.ts +15 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateView/index.d.ts +18 -0
- package/dist/src/databases/schemaBuilder/generateCreateView/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.d.ts +8 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.d.ts +7 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/mssqlToPostgres/convertView.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/mssqlToPostgres/convertView.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/utils.d.ts +8 -0
- package/dist/src/databases/schemaBuilder/utils.d.ts.map +1 -0
- package/dist/src/databases/sqlTypeUtils.d.ts +24 -0
- package/dist/src/databases/sqlTypeUtils.d.ts.map +1 -0
- package/dist/src/databases/sqlTypeUtils.test.d.ts +2 -0
- package/dist/src/databases/sqlTypeUtils.test.d.ts.map +1 -0
- package/dist/src/databases/transformers/data-transformers.d.ts +215 -0
- package/dist/src/databases/transformers/data-transformers.d.ts.map +1 -0
- package/dist/src/databases/transformers/data-transformers.test.d.ts +2 -0
- package/dist/src/databases/transformers/data-transformers.test.d.ts.map +1 -0
- package/dist/src/databases/transformers/genResolverName.d.ts +2 -0
- package/dist/src/databases/transformers/genResolverName.d.ts.map +1 -0
- package/dist/src/databases/transformers/genResolverName.test.d.ts +2 -0
- package/dist/src/databases/transformers/genResolverName.test.d.ts.map +1 -0
- package/dist/src/index.d.ts +139 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/logging/index.d.ts +21 -0
- package/dist/src/logging/index.d.ts.map +1 -0
- package/dist/src/queues/kafka.d.ts +22 -0
- package/dist/src/queues/kafka.d.ts.map +1 -0
- package/dist/src/queues/rabbitmq.d.ts +34 -0
- package/dist/src/queues/rabbitmq.d.ts.map +1 -0
- package/dist/src/queues/rabbitmq.test.d.ts +2 -0
- package/dist/src/queues/rabbitmq.test.d.ts.map +1 -0
- package/dist/src/remoteREST/index.d.ts +13 -0
- package/dist/src/remoteREST/index.d.ts.map +1 -0
- package/dist/src/remoteREST/parse.d.ts +8 -0
- package/dist/src/remoteREST/parse.d.ts.map +1 -0
- package/dist/src/remoteREST/parse.test.d.ts +2 -0
- package/dist/src/remoteREST/parse.test.d.ts.map +1 -0
- package/dist/src/remoteREST/proxy.d.ts +6 -0
- package/dist/src/remoteREST/proxy.d.ts.map +1 -0
- package/dist/src/remoteREST/proxy.test.d.ts +2 -0
- package/dist/src/remoteREST/proxy.test.d.ts.map +1 -0
- package/dist/src/remoteREST/transform.d.ts +8 -0
- package/dist/src/remoteREST/transform.d.ts.map +1 -0
- package/dist/src/remoteREST/transform.test.d.ts +2 -0
- package/dist/src/remoteREST/transform.test.d.ts.map +1 -0
- package/dist/src/remoteREST/types.d.ts +37 -0
- package/dist/src/remoteREST/types.d.ts.map +1 -0
- package/dist/src/remoteSchemas/index.d.ts +13 -0
- package/dist/src/remoteSchemas/index.d.ts.map +1 -0
- package/dist/src/remoteSchemas/introspect.d.ts +7 -0
- package/dist/src/remoteSchemas/introspect.d.ts.map +1 -0
- package/dist/src/remoteSchemas/introspect.test.d.ts +2 -0
- package/dist/src/remoteSchemas/introspect.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/proxy.d.ts +7 -0
- package/dist/src/remoteSchemas/proxy.d.ts.map +1 -0
- package/dist/src/remoteSchemas/proxy.test.d.ts +2 -0
- package/dist/src/remoteSchemas/proxy.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/transform.d.ts +9 -0
- package/dist/src/remoteSchemas/transform.d.ts.map +1 -0
- package/dist/src/remoteSchemas/transform.test.d.ts +2 -0
- package/dist/src/remoteSchemas/transform.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/types.d.ts +41 -0
- package/dist/src/remoteSchemas/types.d.ts.map +1 -0
- package/dist/src/singletons/ai.d.ts +25 -0
- package/dist/src/singletons/ai.d.ts.map +1 -0
- package/dist/src/singletons/ai.test.d.ts +2 -0
- package/dist/src/singletons/ai.test.d.ts.map +1 -0
- package/dist/src/singletons/authentication.d.ts +4 -0
- package/dist/src/singletons/authentication.d.ts.map +1 -0
- package/dist/src/singletons/cache/index.d.ts +5 -0
- package/dist/src/singletons/cache/index.d.ts.map +1 -0
- package/dist/src/singletons/cache/lruCacheStore.d.ts +12 -0
- package/dist/src/singletons/cache/lruCacheStore.d.ts.map +1 -0
- package/dist/src/singletons/cache/lruCacheStore.test.d.ts +2 -0
- package/dist/src/singletons/cache/lruCacheStore.test.d.ts.map +1 -0
- package/dist/src/singletons/cache/redisCacheStore.d.ts +16 -0
- package/dist/src/singletons/cache/redisCacheStore.d.ts.map +1 -0
- package/dist/src/singletons/cache/redisClient.d.ts +3 -0
- package/dist/src/singletons/cache/redisClient.d.ts.map +1 -0
- package/dist/src/singletons/cache/registry.d.ts +7 -0
- package/dist/src/singletons/cache/registry.d.ts.map +1 -0
- package/dist/src/singletons/cache/registry.test.d.ts +2 -0
- package/dist/src/singletons/cache/registry.test.d.ts.map +1 -0
- package/dist/src/singletons/cache/types.d.ts +8 -0
- package/dist/src/singletons/cache/types.d.ts.map +1 -0
- package/dist/src/singletons/cron.d.ts +69 -0
- package/dist/src/singletons/cron.d.ts.map +1 -0
- package/dist/src/singletons/databases.d.ts +27 -0
- package/dist/src/singletons/databases.d.ts.map +1 -0
- package/dist/src/singletons/databases.test.d.ts +2 -0
- package/dist/src/singletons/databases.test.d.ts.map +1 -0
- package/dist/src/singletons/env.d.ts +494 -0
- package/dist/src/singletons/env.d.ts.map +1 -0
- package/dist/src/singletons/queues.d.ts +17 -0
- package/dist/src/singletons/queues.d.ts.map +1 -0
- package/dist/src/subscriptions/index.d.ts +4 -0
- package/dist/src/subscriptions/index.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/database.d.ts +12 -0
- package/dist/src/subscriptions/strategies/database.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/index.d.ts +12 -0
- package/dist/src/subscriptions/strategies/index.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/queue.d.ts +11 -0
- package/dist/src/subscriptions/strategies/queue.d.ts.map +1 -0
- package/dist/src/subscriptions/types.d.ts +67 -0
- package/dist/src/subscriptions/types.d.ts.map +1 -0
- package/dist/src/subscriptions/utils/polling.d.ts +17 -0
- package/dist/src/subscriptions/utils/polling.d.ts.map +1 -0
- package/dist/src/types/common.d.ts +44 -0
- package/dist/src/types/common.d.ts.map +1 -0
- package/dist/src/types/configuration.d.ts +28 -0
- package/dist/src/types/configuration.d.ts.map +1 -0
- package/dist/src/types/db.d.ts +43 -0
- package/dist/src/types/db.d.ts.map +1 -0
- package/dist/src/types/env.d.ts +2302 -0
- package/dist/src/types/env.d.ts.map +1 -0
- package/dist/src/types/env.test.d.ts +2 -0
- package/dist/src/types/env.test.d.ts.map +1 -0
- package/dist/src/types/resolver.d.ts +121 -0
- package/dist/src/types/resolver.d.ts.map +1 -0
- package/dist/src/types/zod/ai.d.ts +6 -0
- package/dist/src/types/zod/ai.d.ts.map +1 -0
- package/dist/src/types/zod/auth.d.ts +76 -0
- package/dist/src/types/zod/auth.d.ts.map +1 -0
- package/dist/src/types/zod/configuration.d.ts +1278 -0
- package/dist/src/types/zod/configuration.d.ts.map +1 -0
- package/dist/src/types/zod/configuration.test.d.ts +2 -0
- package/dist/src/types/zod/configuration.test.d.ts.map +1 -0
- package/dist/src/types/zod/cron.d.ts +32 -0
- package/dist/src/types/zod/cron.d.ts.map +1 -0
- package/dist/src/types/zod/db.d.ts +441 -0
- package/dist/src/types/zod/db.d.ts.map +1 -0
- package/dist/src/types/zod/db.test.d.ts +2 -0
- package/dist/src/types/zod/db.test.d.ts.map +1 -0
- package/dist/src/types/zod/mcp.d.ts +6 -0
- package/dist/src/types/zod/mcp.d.ts.map +1 -0
- package/dist/src/types/zod/operation.d.ts +9 -0
- package/dist/src/types/zod/operation.d.ts.map +1 -0
- package/dist/src/types/zod/queue.d.ts +656 -0
- package/dist/src/types/zod/queue.d.ts.map +1 -0
- package/dist/src/types/zod/queue.test.d.ts +2 -0
- package/dist/src/types/zod/queue.test.d.ts.map +1 -0
- package/dist/src/types/zod/remoteREST.d.ts +6 -0
- package/dist/src/types/zod/remoteREST.d.ts.map +1 -0
- package/dist/src/types/zod/remoteSchema.d.ts +6 -0
- package/dist/src/types/zod/remoteSchema.d.ts.map +1 -0
- package/dist/src/utils/benchmark.d.ts +2 -0
- package/dist/src/utils/benchmark.d.ts.map +1 -0
- package/dist/src/utils/event-emitter.d.ts +19 -0
- package/dist/src/utils/event-emitter.d.ts.map +1 -0
- package/dist/src/utils/responses.d.ts +19 -0
- package/dist/src/utils/responses.d.ts.map +1 -0
- package/dist/src/utils/responses.test.d.ts +2 -0
- package/dist/src/utils/responses.test.d.ts.map +1 -0
- package/dist/src/utils/safeJSONParse.d.ts +2 -0
- package/dist/src/utils/safeJSONParse.d.ts.map +1 -0
- package/dist/src/utils/selection.d.ts +3 -0
- package/dist/src/utils/selection.d.ts.map +1 -0
- package/dist/src/utils/selection.test.d.ts +2 -0
- package/dist/src/utils/selection.test.d.ts.map +1 -0
- package/dist/src/utils/sessionVariables.d.ts +47 -0
- package/dist/src/utils/sessionVariables.d.ts.map +1 -0
- package/dist/src/utils/sessionVariables.test.d.ts +2 -0
- package/dist/src/utils/sessionVariables.test.d.ts.map +1 -0
- package/dist/src/utils/writeSchema.d.ts +3 -0
- package/dist/src/utils/writeSchema.d.ts.map +1 -0
- package/dist/standalone.d.ts +3 -0
- package/dist/standalone.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +119 -0
- package/playgrounds/console/index.html +25 -0
- package/playgrounds/graphiql/index.html +1144 -0
- package/playgrounds/scalar/index.html +19 -0
- package/src/ai/agent/agent.ts +222 -0
- package/src/ai/agent/index.ts +2 -0
- package/src/ai/agent/providers/anthropic.ts +113 -0
- package/src/ai/agent/providers/index.ts +62 -0
- package/src/ai/agent/providers/ollama.ts +128 -0
- package/src/ai/agent/providers/openai.ts +100 -0
- package/src/ai/agent/types.ts +65 -0
- package/src/ai/index.ts +8 -0
- package/src/ai/mcp/create-server.ts +444 -0
- package/src/ai/mcp/index.ts +80 -0
- package/src/ai/mcp/instructions.ts +103 -0
- package/src/ai/tools/agent.ts +111 -0
- package/src/ai/tools/core.ts +486 -0
- package/src/ai/tools/query-data.ts +109 -0
- package/src/analyzeQuery/analyzers/fragmentAnalyzer.ts +29 -0
- package/src/analyzeQuery/analyzers/operationAnalyzer.ts +50 -0
- package/src/analyzeQuery/analyzers/selectionAnalyzer.ts +135 -0
- package/src/analyzeQuery/analyzers/variableAnalyzer.ts +17 -0
- package/src/analyzeQuery/depthLimit.ts +124 -0
- package/src/analyzeQuery/directiveUtils.ts +99 -0
- package/src/analyzeQuery/index.ts +66 -0
- package/src/analyzeQuery/resolveVariables.ts +394 -0
- package/src/analyzeQuery/typeUtils.ts +47 -0
- package/src/analyzeQuery/types.ts +57 -0
- package/src/analyzeQuery/valueExtractors.ts +96 -0
- package/src/authentication/duration.ts +50 -0
- package/src/authentication/index.ts +34 -0
- package/src/authentication/jwt.ts +220 -0
- package/src/authentication/paseto.ts +256 -0
- package/src/authentication/tokenRepository.ts +75 -0
- package/src/authentication/types.ts +78 -0
- package/src/cli/seedAuth.ts +51 -0
- package/src/cli/seedAuthArgs.ts +50 -0
- package/src/config/helpers/cronHelper.ts +29 -0
- package/src/config/helpers/index.ts +8 -0
- package/src/config/helpers/operationHelper.ts +146 -0
- package/src/config/helpers/queueHelper.ts +27 -0
- package/src/config/index.ts +315 -0
- package/src/config/types/ai.ts +35 -0
- package/src/config/types/auth.ts +147 -0
- package/src/config/types/configuration.ts +69 -0
- package/src/config/types/cron.ts +140 -0
- package/src/config/types/db.ts +256 -0
- package/src/config/types/index.ts +129 -0
- package/src/config/types/operation.ts +253 -0
- package/src/config/types/queue.ts +172 -0
- package/src/config/types/remote-rest.ts +28 -0
- package/src/config/types/remote-schema.ts +39 -0
- package/src/config/types/virtual-columns.ts +157 -0
- package/src/configuration/getSchemas/index.ts +82 -0
- package/src/configuration/getSchemas/mergeEntities/index.ts +221 -0
- package/src/configuration/getSchemas/type-definition-generator/index.ts +511 -0
- package/src/configuration/gql/buildExecute.ts +54 -0
- package/src/configuration/gql/gqlAuthOperations.ts +150 -0
- package/src/configuration/gql/handleGraphQLRequestFactory.ts +415 -0
- package/src/configuration/gql/handleGraphQLSubscriptionFactory.ts +249 -0
- package/src/configuration/index.ts +138 -0
- package/src/configuration/rest/generateOpenAPI.ts +361 -0
- package/src/configuration/rest/handleRESTRequestFactory.ts +335 -0
- package/src/configuration/rest/index.ts +167 -0
- package/src/configuration/rest/openApiErrors.ts +106 -0
- package/src/console/api.ts +270 -0
- package/src/cron/index.ts +251 -0
- package/src/databases/auth/auth-operations.ts +36 -0
- package/src/databases/auth/password.ts +4 -0
- package/src/databases/common.ts +642 -0
- package/src/databases/core/executor.ts +97 -0
- package/src/databases/core/function-mapping.ts +176 -0
- package/src/databases/core/identifier.ts +8 -0
- package/src/databases/core/query-builder.ts +47 -0
- package/src/databases/directives.ts +112 -0
- package/src/databases/engines/mssql/auth.ts +112 -0
- package/src/databases/engines/mssql/connection.ts +151 -0
- package/src/databases/engines/mssql/format.ts +23 -0
- package/src/databases/engines/mssql/getStructure.ts +112 -0
- package/src/databases/engines/mssql/getViews.ts +17 -0
- package/src/databases/engines/mssql/query/index.ts +306 -0
- package/src/databases/engines/mysql/auth.ts +100 -0
- package/src/databases/engines/mysql/connection.ts +100 -0
- package/src/databases/engines/mysql/format.ts +23 -0
- package/src/databases/engines/mysql/getStructure.ts +116 -0
- package/src/databases/engines/mysql/getViews.ts +20 -0
- package/src/databases/engines/mysql/query/index.ts +291 -0
- package/src/databases/engines/postgresql/auth.ts +98 -0
- package/src/databases/engines/postgresql/connection.ts +99 -0
- package/src/databases/engines/postgresql/format.ts +23 -0
- package/src/databases/engines/postgresql/getStructure.ts +149 -0
- package/src/databases/engines/postgresql/getViews.ts +20 -0
- package/src/databases/engines/postgresql/query/index.ts +291 -0
- package/src/databases/engines/shared/claims.ts +26 -0
- package/src/databases/engines/shared/types.ts +7 -0
- package/src/databases/high-level-operations.ts +272 -0
- package/src/databases/index.ts +28 -0
- package/src/databases/metadata/structure.ts +12 -0
- package/src/databases/schemaBuilder/convert.ts +121 -0
- package/src/databases/schemaBuilder/generateCreateTable/index.ts +133 -0
- package/src/databases/schemaBuilder/generateCreateView/index.ts +101 -0
- package/src/databases/schemaBuilder/generateInsert/index.ts +47 -0
- package/src/databases/schemaBuilder/generateSchemaCreation/index.ts +29 -0
- package/src/databases/schemaBuilder/mssqlToPostgres/convertView.ts +47 -0
- package/src/databases/schemaBuilder/utils.ts +17 -0
- package/src/databases/sqlTypeUtils.ts +91 -0
- package/src/databases/transformers/data-transformers.ts +128 -0
- package/src/databases/transformers/genResolverName.ts +18 -0
- package/src/index.ts +461 -0
- package/src/logging/index.ts +69 -0
- package/src/queues/kafka.ts +409 -0
- package/src/queues/rabbitmq.ts +331 -0
- package/src/remoteREST/index.ts +46 -0
- package/src/remoteREST/parse.ts +68 -0
- package/src/remoteREST/proxy.ts +92 -0
- package/src/remoteREST/transform.ts +121 -0
- package/src/remoteREST/types.ts +38 -0
- package/src/remoteSchemas/index.ts +48 -0
- package/src/remoteSchemas/introspect.ts +44 -0
- package/src/remoteSchemas/proxy.ts +146 -0
- package/src/remoteSchemas/transform.ts +210 -0
- package/src/remoteSchemas/types.ts +43 -0
- package/src/singletons/ai.ts +91 -0
- package/src/singletons/authentication.ts +13 -0
- package/src/singletons/cache/index.ts +4 -0
- package/src/singletons/cache/lruCacheStore.ts +34 -0
- package/src/singletons/cache/redisCacheStore.ts +81 -0
- package/src/singletons/cache/redisClient.ts +12 -0
- package/src/singletons/cache/registry.ts +51 -0
- package/src/singletons/cache/types.ts +7 -0
- package/src/singletons/cron.ts +21 -0
- package/src/singletons/databases.ts +68 -0
- package/src/singletons/env.ts +3 -0
- package/src/singletons/queues.ts +101 -0
- package/src/subscriptions/index.ts +20 -0
- package/src/subscriptions/strategies/database.ts +68 -0
- package/src/subscriptions/strategies/index.ts +38 -0
- package/src/subscriptions/strategies/queue.ts +61 -0
- package/src/subscriptions/types.ts +74 -0
- package/src/subscriptions/utils/polling.ts +119 -0
- package/src/types/common.ts +57 -0
- package/src/types/configuration.ts +52 -0
- package/src/types/db.ts +87 -0
- package/src/types/env.ts +137 -0
- package/src/types/resolver.ts +181 -0
- package/src/types/zod/ai.ts +8 -0
- package/src/types/zod/auth.ts +96 -0
- package/src/types/zod/configuration.ts +46 -0
- package/src/types/zod/cron.ts +35 -0
- package/src/types/zod/db.ts +146 -0
- package/src/types/zod/mcp.ts +8 -0
- package/src/types/zod/operation.ts +37 -0
- package/src/types/zod/queue.ts +182 -0
- package/src/types/zod/remoteREST.ts +8 -0
- package/src/types/zod/remoteSchema.ts +11 -0
- package/src/utils/benchmark.ts +13 -0
- package/src/utils/event-emitter.ts +217 -0
- package/src/utils/responses.ts +42 -0
- package/src/utils/safeJSONParse.ts +10 -0
- package/src/utils/selection.ts +35 -0
- package/src/utils/sessionVariables.ts +131 -0
- package/src/utils/writeSchema.ts +13 -0
- package/standalone.ts +32 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { match } from "path-to-regexp";
|
|
2
|
+
|
|
3
|
+
import type { BunRequest } from "bun";
|
|
4
|
+
import type { MatchFunction } from "path-to-regexp";
|
|
5
|
+
import type { GetGQLEntitiesReturn } from "../../configuration/getSchemas";
|
|
6
|
+
import type { RemoteRESTResolved, RemoteRESTRoute } from "../../remoteREST/types";
|
|
7
|
+
import type { Auth } from "../../types/configuration";
|
|
8
|
+
import type { SessionContext } from "../../utils/sessionVariables";
|
|
9
|
+
import type { MergedEntities } from "../getSchemas/mergeEntities";
|
|
10
|
+
import type { HandleGraphQLRequest } from "../gql/handleGraphQLRequestFactory";
|
|
11
|
+
|
|
12
|
+
import { analyzeQuery } from "../../analyzeQuery";
|
|
13
|
+
import { checkUserCredentials } from "../../databases";
|
|
14
|
+
import { proxyRemoteRESTRequest } from "../../remoteREST/proxy";
|
|
15
|
+
import { getTokenService } from "../../singletons/authentication";
|
|
16
|
+
import { getCache } from "../../singletons/cache";
|
|
17
|
+
import { databasesConnections, repositoryMap } from "../../singletons/databases";
|
|
18
|
+
import { queueManager } from "../../singletons/queues";
|
|
19
|
+
import { S200, S401, S404 } from "../../utils/responses";
|
|
20
|
+
import { buildApiRoutes } from "../rest";
|
|
21
|
+
import { logger } from "../../logging";
|
|
22
|
+
|
|
23
|
+
// Build remote REST route matchers
|
|
24
|
+
type RemoteRouteEntry = {
|
|
25
|
+
route: RemoteRESTRoute;
|
|
26
|
+
resolved: RemoteRESTResolved;
|
|
27
|
+
testPath: MatchFunction<Record<string, string>>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const handleRESTRequestFactory = (
|
|
31
|
+
entities: MergedEntities,
|
|
32
|
+
gqlEntities: GetGQLEntitiesReturn,
|
|
33
|
+
gql: HandleGraphQLRequest,
|
|
34
|
+
auth: Auth | null = null,
|
|
35
|
+
gqlSuperadminHandler: HandleGraphQLRequest | null = null,
|
|
36
|
+
) => {
|
|
37
|
+
const { operationsEnhanced } = buildApiRoutes(
|
|
38
|
+
entities,
|
|
39
|
+
gqlEntities,
|
|
40
|
+
gql,
|
|
41
|
+
auth,
|
|
42
|
+
gqlSuperadminHandler,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const routes = Object.values(operationsEnhanced);
|
|
46
|
+
|
|
47
|
+
const remoteRoutes: RemoteRouteEntry[] = [];
|
|
48
|
+
for (const rr of entities.remoteRESTApis) {
|
|
49
|
+
for (const route of rr.routes) {
|
|
50
|
+
// Convert OpenAPI path params {id} to path-to-regexp :id
|
|
51
|
+
const expressPath = route.prefixedPath.replace(/\{([^}]+)\}/g, ":$1");
|
|
52
|
+
remoteRoutes.push({
|
|
53
|
+
route,
|
|
54
|
+
resolved: rr,
|
|
55
|
+
testPath: match<Record<string, string>>(expressPath),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const routesInitDataPromises: Record<string, unknown> = {};
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
operationsEnhanced,
|
|
64
|
+
handler: async (
|
|
65
|
+
url: URL,
|
|
66
|
+
pathname: string,
|
|
67
|
+
method = "GET",
|
|
68
|
+
req: BunRequest,
|
|
69
|
+
session?: SessionContext,
|
|
70
|
+
) => {
|
|
71
|
+
const log = logger("rest").child({ role: session?.role });
|
|
72
|
+
log.debug({ method, pathname }, "rest request");
|
|
73
|
+
|
|
74
|
+
let pathParameters: Record<string, string | string[]> = {};
|
|
75
|
+
|
|
76
|
+
const route = routes.find((a) => {
|
|
77
|
+
const pathFound = a.testPath(pathname);
|
|
78
|
+
|
|
79
|
+
if (pathFound && a.rest!.method === method) {
|
|
80
|
+
pathParameters = pathFound.params as Record<string, string>;
|
|
81
|
+
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return false;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (!route) {
|
|
89
|
+
// Try remote REST routes
|
|
90
|
+
for (const remote of remoteRoutes) {
|
|
91
|
+
const pathFound = remote.testPath(pathname);
|
|
92
|
+
if (pathFound && remote.route.method === method.toLowerCase()) {
|
|
93
|
+
return proxyRemoteRESTRequest(
|
|
94
|
+
remote.route,
|
|
95
|
+
remote.resolved,
|
|
96
|
+
req,
|
|
97
|
+
(pathFound.params ?? {}) as Record<string, string>,
|
|
98
|
+
url.search ? url.search.slice(1) : "",
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return new S404({ error: "Method not found" });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (route.hasError) return new S401({ error: "You are not authorized" });
|
|
107
|
+
|
|
108
|
+
if (routesInitDataPromises[route.routeKey] === undefined) {
|
|
109
|
+
routesInitDataPromises[route.routeKey] = await route.hooks?.init?.({
|
|
110
|
+
gqlQuery: gqlSuperadminHandler?.handler ?? gql.handler,
|
|
111
|
+
databases: databasesConnections,
|
|
112
|
+
queues: queueManager,
|
|
113
|
+
repository: repositoryMap,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Validate and parse path parameters with Zod
|
|
118
|
+
const pathVariables = route.rest!.pathParams?.parse(pathParameters) as Record<
|
|
119
|
+
string,
|
|
120
|
+
unknown
|
|
121
|
+
>;
|
|
122
|
+
|
|
123
|
+
const paramsQuery = new URLSearchParams(url.search);
|
|
124
|
+
const paramsQueryDictionary = Object.fromEntries(paramsQuery.entries());
|
|
125
|
+
|
|
126
|
+
const queryVariables = (route.rest!.queryParams?.parse(paramsQueryDictionary) ??
|
|
127
|
+
{}) as Record<string, unknown>;
|
|
128
|
+
|
|
129
|
+
let bodyVariables: Record<string, unknown> = {};
|
|
130
|
+
|
|
131
|
+
if (req.method === "POST") {
|
|
132
|
+
const body = req.body ? await req.json() : {};
|
|
133
|
+
|
|
134
|
+
bodyVariables = (route.rest!.body?.parse(body) ?? {}) as Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Prepare all variables for the request
|
|
138
|
+
const allVariables = {
|
|
139
|
+
...pathVariables,
|
|
140
|
+
...queryVariables,
|
|
141
|
+
...bodyVariables,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Only analyze query if route has a query (not a custom handler)
|
|
145
|
+
const queryAnalysis = route.query
|
|
146
|
+
? analyzeQuery(route.query, entities, gqlEntities.schema)
|
|
147
|
+
: null;
|
|
148
|
+
|
|
149
|
+
const variables =
|
|
150
|
+
(await route.hooks?.beforeRequest?.(
|
|
151
|
+
{
|
|
152
|
+
input: allVariables,
|
|
153
|
+
},
|
|
154
|
+
routesInitDataPromises[route.routeKey],
|
|
155
|
+
)) ?? allVariables;
|
|
156
|
+
|
|
157
|
+
// Handle auth routes directly without going through GQL pipeline
|
|
158
|
+
if (route.authOperation) {
|
|
159
|
+
if (!auth?.enabled) {
|
|
160
|
+
return new S401({ errors: ["Authentication is not enabled"] });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
try {
|
|
164
|
+
if (route.authOperation === "login") {
|
|
165
|
+
const { username, password } = variables as {
|
|
166
|
+
username: string;
|
|
167
|
+
password: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const result = await checkUserCredentials(auth, username, password);
|
|
171
|
+
|
|
172
|
+
if (!result.valid) {
|
|
173
|
+
return new S401({ errors: ["Invalid username or password"] });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const data = await getTokenService().createTokenPair({
|
|
177
|
+
sub: username,
|
|
178
|
+
role: result.role,
|
|
179
|
+
claims: result.claims,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
if (req?.cookies) {
|
|
183
|
+
req.cookies.set("refresh_token", data.refresh_token, {
|
|
184
|
+
httpOnly: true,
|
|
185
|
+
secure: true,
|
|
186
|
+
sameSite: "strict",
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return new S200({
|
|
191
|
+
data: {
|
|
192
|
+
access_token: data.access_token,
|
|
193
|
+
expires_in: data.expires_in,
|
|
194
|
+
role: result.role,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (route.authOperation === "refresh") {
|
|
200
|
+
const tokenValue = req?.cookies?.get("refresh_token");
|
|
201
|
+
|
|
202
|
+
if (!tokenValue) {
|
|
203
|
+
return new S401({ errors: ["Refresh token is required"] });
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const result = await getTokenService().refreshAccessToken(tokenValue.toString());
|
|
207
|
+
|
|
208
|
+
if (req?.cookies) {
|
|
209
|
+
req.cookies.set("refresh_token", result.refresh_token, {
|
|
210
|
+
httpOnly: true,
|
|
211
|
+
secure: true,
|
|
212
|
+
sameSite: "strict",
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return new S200({
|
|
217
|
+
data: {
|
|
218
|
+
access_token: result.access_token,
|
|
219
|
+
expires_in: result.expires_in,
|
|
220
|
+
role: result.role,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (route.authOperation === "logout") {
|
|
226
|
+
const tokenService = getTokenService();
|
|
227
|
+
|
|
228
|
+
if (session?.jti) {
|
|
229
|
+
await tokenService.revoke(session.jti);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const refreshCookie = req?.cookies?.get("refresh_token");
|
|
233
|
+
if (refreshCookie) {
|
|
234
|
+
try {
|
|
235
|
+
const refreshPayload = await tokenService.verifyToken(refreshCookie.toString(), {
|
|
236
|
+
audience: "refresh",
|
|
237
|
+
});
|
|
238
|
+
await tokenService.revoke(refreshPayload.jti);
|
|
239
|
+
} catch {
|
|
240
|
+
// tampered or expired cookie — nothing to revoke
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (req?.cookies) {
|
|
245
|
+
req.cookies.delete("refresh_token");
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return new S200({ data: true });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (route.authOperation === "me") {
|
|
252
|
+
return new S200({
|
|
253
|
+
data: session?.sub ? { username: session.sub, role: session.role } : null,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
} catch (error: unknown) {
|
|
257
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
258
|
+
return new S401({ errors: [message] });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Check if this route uses a custom handler
|
|
263
|
+
if (route.handler) {
|
|
264
|
+
try {
|
|
265
|
+
const result = await route.handler(
|
|
266
|
+
{
|
|
267
|
+
gqlQuery: gqlSuperadminHandler?.handler ?? gql.handler,
|
|
268
|
+
databases: databasesConnections,
|
|
269
|
+
queues: queueManager,
|
|
270
|
+
repository: repositoryMap,
|
|
271
|
+
},
|
|
272
|
+
variables,
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
// Apply afterRequest hook if present
|
|
276
|
+
const finalResult = route.hooks?.afterRequest
|
|
277
|
+
? await route.hooks.afterRequest({
|
|
278
|
+
output: result,
|
|
279
|
+
})
|
|
280
|
+
: result;
|
|
281
|
+
|
|
282
|
+
return new S200(finalResult);
|
|
283
|
+
} catch (error: unknown) {
|
|
284
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
285
|
+
return new S401({ errors: [message] });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Check if this route has caching enabled
|
|
290
|
+
const cache = route.routeKey ? getCache(route.routeKey) : undefined;
|
|
291
|
+
|
|
292
|
+
if (cache && route.query) {
|
|
293
|
+
// Create cache key from route pattern, method, variables, and session
|
|
294
|
+
const cacheKey = JSON.stringify({
|
|
295
|
+
pathname,
|
|
296
|
+
method,
|
|
297
|
+
variables,
|
|
298
|
+
sub: session?.sub,
|
|
299
|
+
role: session?.role,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Try to get from cache first
|
|
303
|
+
const cachedResult = await cache.get(cacheKey);
|
|
304
|
+
if (cachedResult) {
|
|
305
|
+
log.debug({ route: route.routeKey }, "rest cache hit");
|
|
306
|
+
return new S200(cachedResult);
|
|
307
|
+
}
|
|
308
|
+
log.debug({ route: route.routeKey }, "rest cache miss");
|
|
309
|
+
|
|
310
|
+
try {
|
|
311
|
+
// Execute the GraphQL request
|
|
312
|
+
const result = await gql.handler(queryAnalysis!, variables, req, session);
|
|
313
|
+
|
|
314
|
+
// Cache the result
|
|
315
|
+
await cache.set(cacheKey, result);
|
|
316
|
+
|
|
317
|
+
return new S200(result);
|
|
318
|
+
} catch (error: unknown) {
|
|
319
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
320
|
+
return new S401({ errors: [message] });
|
|
321
|
+
}
|
|
322
|
+
} else if (queryAnalysis) {
|
|
323
|
+
// No caching for this route, execute normally
|
|
324
|
+
return new S200(await gql.handler(queryAnalysis, variables, req, session));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Fallback - should not reach here if endpoint is properly configured
|
|
328
|
+
return new S401({
|
|
329
|
+
errors: ["Endpoint misconfigured: no query or customHandler"],
|
|
330
|
+
});
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export type HandleRESTRequest = ReturnType<typeof handleRESTRequestFactory>;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { match } from "path-to-regexp";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
|
|
4
|
+
import type { LRUCache } from "lru-cache";
|
|
5
|
+
import type { MatchFunction } from "path-to-regexp";
|
|
6
|
+
import type { AnalysisResult } from "../../analyzeQuery/types";
|
|
7
|
+
import type { GetGQLEntitiesReturn } from "../../configuration/getSchemas";
|
|
8
|
+
import type { Auth, Operations } from "../../types/configuration";
|
|
9
|
+
import type { MergedEntities } from "../getSchemas/mergeEntities";
|
|
10
|
+
import type { HandleGraphQLRequest } from "../gql/handleGraphQLRequestFactory";
|
|
11
|
+
|
|
12
|
+
import { analyzeQuery } from "../../analyzeQuery";
|
|
13
|
+
import { LruCacheStore, RedisCacheStore, registerCache } from "../../singletons/cache";
|
|
14
|
+
import { env } from "../../singletons/env";
|
|
15
|
+
|
|
16
|
+
type LruOptions = LRUCache.Options<string, unknown, unknown>;
|
|
17
|
+
|
|
18
|
+
export type AuthOperation = "login" | "logout" | "refresh" | "me";
|
|
19
|
+
|
|
20
|
+
export type OperationsEnhanced = {
|
|
21
|
+
[K in keyof Operations]: Operations[K] & {
|
|
22
|
+
queryStructure: AnalysisResult | null;
|
|
23
|
+
testPath: MatchFunction<Partial<Record<string, string | string[]>>>;
|
|
24
|
+
hasError: boolean;
|
|
25
|
+
routeKey: K;
|
|
26
|
+
authOperation?: AuthOperation;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const buildApiRoutes = (
|
|
31
|
+
entities: MergedEntities,
|
|
32
|
+
gqlEntities: GetGQLEntitiesReturn,
|
|
33
|
+
gql: HandleGraphQLRequest,
|
|
34
|
+
auth: Auth | null = null,
|
|
35
|
+
gqlSuperadminHandler: HandleGraphQLRequest | null = null,
|
|
36
|
+
) => {
|
|
37
|
+
const operationsEnhanced: OperationsEnhanced = {};
|
|
38
|
+
|
|
39
|
+
for (const [routeKey, routeConfig] of Object.entries(entities.operations)) {
|
|
40
|
+
// Skip validation for custom handler endpoints (they don't have a query)
|
|
41
|
+
let queryStructure: AnalysisResult | null = null;
|
|
42
|
+
let hasError = false;
|
|
43
|
+
|
|
44
|
+
if (routeConfig.query) {
|
|
45
|
+
const validationErrors = gql.hasErrors(routeConfig.query);
|
|
46
|
+
|
|
47
|
+
if (validationErrors.hasErrors && gqlSuperadminHandler) {
|
|
48
|
+
// Re-validate with superadmin handler if available
|
|
49
|
+
const superadminErrors = gqlSuperadminHandler.hasErrors(routeConfig.query);
|
|
50
|
+
|
|
51
|
+
if (superadminErrors.hasErrors) {
|
|
52
|
+
throw new Error(`Endpoint ${routeKey} has invalid query.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
hasError = validationErrors.hasErrors;
|
|
57
|
+
|
|
58
|
+
queryStructure = analyzeQuery(routeConfig.query, entities, gqlEntities.schema);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const testPath = match(routeConfig.rest!.path);
|
|
62
|
+
|
|
63
|
+
if (routeConfig.cache) {
|
|
64
|
+
if (env.cache.store === "redis") {
|
|
65
|
+
registerCache(routeKey, new RedisCacheStore(routeKey, routeConfig.cache.ttl));
|
|
66
|
+
} else {
|
|
67
|
+
const cacheOptions: Partial<LruOptions> = {};
|
|
68
|
+
|
|
69
|
+
if (routeConfig.cache.max) cacheOptions.max = routeConfig.cache.max;
|
|
70
|
+
if (routeConfig.cache.maxSize) cacheOptions.maxSize = routeConfig.cache.maxSize;
|
|
71
|
+
if (routeConfig.cache.ttl) cacheOptions.ttl = routeConfig.cache.ttl;
|
|
72
|
+
if (routeConfig.cache.allowStale !== undefined)
|
|
73
|
+
cacheOptions.allowStale = routeConfig.cache.allowStale;
|
|
74
|
+
if (routeConfig.cache.updateAgeOnGet !== undefined)
|
|
75
|
+
cacheOptions.updateAgeOnGet = routeConfig.cache.updateAgeOnGet;
|
|
76
|
+
if (routeConfig.cache.updateAgeOnHas !== undefined)
|
|
77
|
+
cacheOptions.updateAgeOnHas = routeConfig.cache.updateAgeOnHas;
|
|
78
|
+
if (routeConfig.cache.ttlAutopurge !== undefined)
|
|
79
|
+
cacheOptions.ttlAutopurge = routeConfig.cache.ttlAutopurge;
|
|
80
|
+
|
|
81
|
+
// LRUCache.Options requires at least one of max/maxSize/ttl. Caller is
|
|
82
|
+
// responsible for setting one; the cast bridges the structural gap.
|
|
83
|
+
registerCache(routeKey, new LruCacheStore(cacheOptions as LruOptions));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
operationsEnhanced[routeKey] = {
|
|
88
|
+
...routeConfig,
|
|
89
|
+
queryStructure,
|
|
90
|
+
testPath,
|
|
91
|
+
hasError,
|
|
92
|
+
routeKey,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (auth?.enabled) {
|
|
97
|
+
operationsEnhanced["login"] = {
|
|
98
|
+
graphql: { enabled: false },
|
|
99
|
+
hasError: false,
|
|
100
|
+
routeKey: "login",
|
|
101
|
+
testPath: match("/auth/login"),
|
|
102
|
+
queryStructure: null,
|
|
103
|
+
authOperation: "login",
|
|
104
|
+
description: "Authentication check endpoint",
|
|
105
|
+
rest: {
|
|
106
|
+
path: "/auth/login",
|
|
107
|
+
method: "POST",
|
|
108
|
+
body: z.object({
|
|
109
|
+
username: z.string().min(1),
|
|
110
|
+
password: z.string().min(1),
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
output: z.object({
|
|
114
|
+
access_token: z.string(),
|
|
115
|
+
expires_in: z.number(),
|
|
116
|
+
role: z.string(),
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
operationsEnhanced["logout"] = {
|
|
121
|
+
graphql: { enabled: false },
|
|
122
|
+
hasError: false,
|
|
123
|
+
routeKey: "logout",
|
|
124
|
+
testPath: match("/auth/logout"),
|
|
125
|
+
queryStructure: null,
|
|
126
|
+
authOperation: "logout",
|
|
127
|
+
description: "Logout endpoint",
|
|
128
|
+
rest: { path: "/auth/logout", method: "POST" },
|
|
129
|
+
output: z.boolean(),
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
operationsEnhanced["refresh"] = {
|
|
133
|
+
graphql: { enabled: false },
|
|
134
|
+
hasError: false,
|
|
135
|
+
routeKey: "refresh",
|
|
136
|
+
testPath: match("/auth/refresh"),
|
|
137
|
+
queryStructure: null,
|
|
138
|
+
authOperation: "refresh",
|
|
139
|
+
description: "Refresh endpoint",
|
|
140
|
+
rest: { path: "/auth/refresh", method: "POST" },
|
|
141
|
+
output: z.object({
|
|
142
|
+
access_token: z.string(),
|
|
143
|
+
expires_in: z.number(),
|
|
144
|
+
role: z.string(),
|
|
145
|
+
}),
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
operationsEnhanced["me"] = {
|
|
149
|
+
graphql: { enabled: false },
|
|
150
|
+
hasError: false,
|
|
151
|
+
routeKey: "me",
|
|
152
|
+
testPath: match("/auth/me"),
|
|
153
|
+
queryStructure: null,
|
|
154
|
+
authOperation: "me",
|
|
155
|
+
description: "Me endpoint",
|
|
156
|
+
rest: { path: "/auth/me", method: "GET" },
|
|
157
|
+
output: z.object({
|
|
158
|
+
username: z.string(),
|
|
159
|
+
role: z.string(),
|
|
160
|
+
}),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
operationsEnhanced,
|
|
166
|
+
};
|
|
167
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { omit } from "es-toolkit";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import type { OpenAPIV3_1 } from "openapi-types";
|
|
5
|
+
|
|
6
|
+
export const convertFromZod = (type?: z.ZodType): OpenAPIV3_1.NonArraySchemaObject => {
|
|
7
|
+
if (!type)
|
|
8
|
+
return {
|
|
9
|
+
type: "object",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return omit(z.toJSONSchema(type, { io: "input" }), ["$schema"]);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Base error
|
|
16
|
+
export const BaseError = z
|
|
17
|
+
.object({
|
|
18
|
+
code: z.string().describe("Machine-readable error code"),
|
|
19
|
+
message: z.string().describe("Human-readable error message"),
|
|
20
|
+
status: z.number().describe("HTTP status code"),
|
|
21
|
+
traceId: z.string().optional().describe("Correlation ID for debugging"),
|
|
22
|
+
})
|
|
23
|
+
.meta({
|
|
24
|
+
example: {
|
|
25
|
+
code: "ERROR_CODE",
|
|
26
|
+
message: "Error message",
|
|
27
|
+
status: 400,
|
|
28
|
+
traceId: "fee0f7ce-5f80-4649-af6f-0a4d2926f84e",
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
.describe("Base error object");
|
|
32
|
+
|
|
33
|
+
// Validation error
|
|
34
|
+
export const ValidationError = BaseError.extend({
|
|
35
|
+
fields: z
|
|
36
|
+
.array(
|
|
37
|
+
z.object({
|
|
38
|
+
field: z.string().describe("Name of the invalid field"),
|
|
39
|
+
issue: z.string().describe("Explanation of the validation issue"),
|
|
40
|
+
}),
|
|
41
|
+
)
|
|
42
|
+
.describe("Validation errors for specific fields"),
|
|
43
|
+
})
|
|
44
|
+
.meta({
|
|
45
|
+
example: {
|
|
46
|
+
code: "VALIDATION_ERROR",
|
|
47
|
+
message: "Request validation failed",
|
|
48
|
+
status: 400,
|
|
49
|
+
traceId: "fee0f7ce-5f80-4649-af6f-0a4d2926f84e",
|
|
50
|
+
fields: [
|
|
51
|
+
{
|
|
52
|
+
field: "email",
|
|
53
|
+
issue: "Invalid email format",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
field: "password",
|
|
57
|
+
issue: "Password must be at least 8 characters",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
.describe("Validation error object");
|
|
63
|
+
|
|
64
|
+
// Unauthorized error
|
|
65
|
+
export const UnauthorizedError = BaseError.meta({
|
|
66
|
+
example: {
|
|
67
|
+
code: "UNAUTHORIZED",
|
|
68
|
+
message: "Authentication required",
|
|
69
|
+
status: 401,
|
|
70
|
+
traceId: "fee0f7ce-5f80-4649-af6f-0a4d2926f84e",
|
|
71
|
+
},
|
|
72
|
+
}).describe("Unauthorized error");
|
|
73
|
+
|
|
74
|
+
// Forbidden error
|
|
75
|
+
export const ForbiddenError = BaseError.meta({
|
|
76
|
+
example: {
|
|
77
|
+
code: "FORBIDDEN",
|
|
78
|
+
message: "Insufficient permissions",
|
|
79
|
+
status: 403,
|
|
80
|
+
traceId: "fee0f7ce-5f80-4649-af6f-0a4d2926f84e",
|
|
81
|
+
},
|
|
82
|
+
}).describe("Forbidden error");
|
|
83
|
+
|
|
84
|
+
// Not found error
|
|
85
|
+
export const NotFoundError = BaseError.meta({
|
|
86
|
+
example: {
|
|
87
|
+
code: "NOT_FOUND",
|
|
88
|
+
message: "Resource not found",
|
|
89
|
+
status: 404,
|
|
90
|
+
traceId: "fee0f7ce-5f80-4649-af6f-0a4d2926f84e",
|
|
91
|
+
},
|
|
92
|
+
}).describe("Not found error");
|
|
93
|
+
|
|
94
|
+
// Union of all errors
|
|
95
|
+
export const ErrorResponse = z
|
|
96
|
+
.union([ValidationError, UnauthorizedError, ForbiddenError, NotFoundError])
|
|
97
|
+
.describe("General error response (can be any of the defined error types)");
|
|
98
|
+
|
|
99
|
+
export const errors = {
|
|
100
|
+
BaseError: convertFromZod(BaseError),
|
|
101
|
+
ValidationError: convertFromZod(ValidationError),
|
|
102
|
+
UnauthorizedError: convertFromZod(UnauthorizedError),
|
|
103
|
+
ForbiddenError: convertFromZod(ForbiddenError),
|
|
104
|
+
NotFoundError: convertFromZod(NotFoundError),
|
|
105
|
+
ErrorResponse: convertFromZod(ErrorResponse),
|
|
106
|
+
};
|