@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,129 @@
|
|
|
1
|
+
// Virtual column types and helpers
|
|
2
|
+
export type {
|
|
3
|
+
VirtualColumnType,
|
|
4
|
+
VirtualColumnFunctionFn,
|
|
5
|
+
VirtualColumnExpressionFn,
|
|
6
|
+
CreateYAndNToBooleanMSSQLFn,
|
|
7
|
+
CreateOneToBooleanMSSQLFn,
|
|
8
|
+
} from "./virtual-columns";
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
virtualColumnFunction,
|
|
12
|
+
virtualColumnExpression,
|
|
13
|
+
createYAndNToBooleanMSSQL,
|
|
14
|
+
createOneToBooleanMSSQL,
|
|
15
|
+
VirtualColumnZod,
|
|
16
|
+
} from "./virtual-columns";
|
|
17
|
+
|
|
18
|
+
// Operation types and Zod schemas
|
|
19
|
+
export type {
|
|
20
|
+
DefaultInput,
|
|
21
|
+
OperationRestConfig,
|
|
22
|
+
OperationGraphQLConfig,
|
|
23
|
+
OperationCacheConfig,
|
|
24
|
+
BeforeRequestContext,
|
|
25
|
+
AfterRequestContext,
|
|
26
|
+
GqlQueryResult,
|
|
27
|
+
OperationOptions,
|
|
28
|
+
OperationInitHook,
|
|
29
|
+
OperationBeforeRequestHook,
|
|
30
|
+
OperationAfterRequestHook,
|
|
31
|
+
OperationHandler,
|
|
32
|
+
BaseOperation,
|
|
33
|
+
QueryOperation,
|
|
34
|
+
HandlerOperation,
|
|
35
|
+
TypedOperation,
|
|
36
|
+
Operation,
|
|
37
|
+
Operations,
|
|
38
|
+
} from "./operation";
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
OperationRestConfigZod,
|
|
42
|
+
OperationGraphQLConfigZod,
|
|
43
|
+
OperationCacheConfigZod,
|
|
44
|
+
OperationZod,
|
|
45
|
+
OperationsZod,
|
|
46
|
+
} from "./operation";
|
|
47
|
+
|
|
48
|
+
// Cron types
|
|
49
|
+
export type { CronTickCallback, CronJobConfig } from "./cron";
|
|
50
|
+
|
|
51
|
+
// AI / MCP types
|
|
52
|
+
export type { AIConfig, MCPConfig } from "./ai";
|
|
53
|
+
|
|
54
|
+
// Remote schema types
|
|
55
|
+
export type { RemoteSchemaConfig, RemoteSchemaIntrospectionConfig } from "./remote-schema";
|
|
56
|
+
|
|
57
|
+
// Remote REST types
|
|
58
|
+
export type { RemoteRESTConfig } from "./remote-rest";
|
|
59
|
+
|
|
60
|
+
// Queue types and Zod schemas
|
|
61
|
+
export type {
|
|
62
|
+
ReconnectConfig,
|
|
63
|
+
PublisherConfig,
|
|
64
|
+
SubscriberConfig,
|
|
65
|
+
TopicConfig,
|
|
66
|
+
CacheContext,
|
|
67
|
+
SubscriberHandler,
|
|
68
|
+
RabbitMQConnection,
|
|
69
|
+
KafkaConnection,
|
|
70
|
+
QueueConfig,
|
|
71
|
+
} from "./queue";
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
ReconnectConfigZod,
|
|
75
|
+
PublisherConfigZod,
|
|
76
|
+
SubscriberConfigZod,
|
|
77
|
+
TopicConfigZod,
|
|
78
|
+
BaseQueueConfigZod,
|
|
79
|
+
RabbitMQConnectionZod,
|
|
80
|
+
KafkaConnectionZod,
|
|
81
|
+
} from "./queue";
|
|
82
|
+
|
|
83
|
+
// Auth types and Zod schemas
|
|
84
|
+
export type {
|
|
85
|
+
DirectionUnion,
|
|
86
|
+
OrderByClause,
|
|
87
|
+
FilterCondition,
|
|
88
|
+
TablePermission,
|
|
89
|
+
RolePermission,
|
|
90
|
+
AuthConfig,
|
|
91
|
+
} from "./auth";
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
DirectionUnionZod,
|
|
95
|
+
OrderByClauseZod,
|
|
96
|
+
FilterConditionZod,
|
|
97
|
+
TablePermissionZod,
|
|
98
|
+
RolePermissionZod,
|
|
99
|
+
AuthConfigZod,
|
|
100
|
+
} from "./auth";
|
|
101
|
+
|
|
102
|
+
// Database types and Zod schemas
|
|
103
|
+
export type {
|
|
104
|
+
DatabaseType,
|
|
105
|
+
DatabaseConnection,
|
|
106
|
+
TableRelationship,
|
|
107
|
+
TableSchemaConfig,
|
|
108
|
+
DatabaseSchemaConfig,
|
|
109
|
+
CustomRepositoryFactory,
|
|
110
|
+
DatabaseConfig,
|
|
111
|
+
OnConnectHandler,
|
|
112
|
+
BunSQLConnectionOptions,
|
|
113
|
+
MSSQLConnectionOptions,
|
|
114
|
+
ConnectionOptionsForType,
|
|
115
|
+
AnyDatabaseConfig,
|
|
116
|
+
} from "./db";
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
TableRelationshipZod,
|
|
120
|
+
TableSchemaConfigZod,
|
|
121
|
+
DatabaseSchemaConfigZod,
|
|
122
|
+
BunSQLConnectionOptionsZod,
|
|
123
|
+
MSSQLConnectionOptionsZod,
|
|
124
|
+
DatabaseConnectionZod,
|
|
125
|
+
} from "./db";
|
|
126
|
+
|
|
127
|
+
export type { ConfigurationInput, TokenStrategy } from "./configuration";
|
|
128
|
+
|
|
129
|
+
export { TokenStrategyZod } from "./configuration";
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default input type when no schema is provided
|
|
5
|
+
*/
|
|
6
|
+
export type DefaultInput = Record<string, unknown>;
|
|
7
|
+
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Zod Schemas for Runtime Validation
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Zod schema for REST configuration
|
|
14
|
+
*/
|
|
15
|
+
export const OperationRestConfigZod = z.object({
|
|
16
|
+
path: z.string(),
|
|
17
|
+
method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("GET"),
|
|
18
|
+
pathParams: z.custom<z.ZodType>().optional(),
|
|
19
|
+
queryParams: z.custom<z.ZodType>().optional(),
|
|
20
|
+
body: z.custom<z.ZodType>().optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Zod schema for GraphQL configuration
|
|
25
|
+
*/
|
|
26
|
+
export const OperationGraphQLConfigZod = z.object({
|
|
27
|
+
enabled: z.boolean().optional().default(true),
|
|
28
|
+
name: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Zod schema for cache configuration
|
|
33
|
+
*/
|
|
34
|
+
export const OperationCacheConfigZod = z.object({
|
|
35
|
+
max: z.number().int().positive().optional(),
|
|
36
|
+
maxSize: z.number().int().positive().optional(),
|
|
37
|
+
ttl: z.number().int().positive().optional(),
|
|
38
|
+
allowStale: z.boolean().optional(),
|
|
39
|
+
updateAgeOnGet: z.boolean().optional(),
|
|
40
|
+
updateAgeOnHas: z.boolean().optional().default(false),
|
|
41
|
+
ttlAutopurge: z.boolean().optional().default(true),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// Type Definitions
|
|
46
|
+
// ============================================================================
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* REST exposure configuration for an operation
|
|
50
|
+
*/
|
|
51
|
+
export type OperationRestConfig = z.input<typeof OperationRestConfigZod>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* GraphQL exposure configuration for an operation
|
|
55
|
+
*/
|
|
56
|
+
export type OperationGraphQLConfig = z.input<typeof OperationGraphQLConfigZod>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Cache configuration for an operation
|
|
60
|
+
*/
|
|
61
|
+
export type OperationCacheConfig = z.input<typeof OperationCacheConfigZod>;
|
|
62
|
+
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// Runtime Operation Validation Schema
|
|
65
|
+
// ============================================================================
|
|
66
|
+
|
|
67
|
+
export const OperationZod = z
|
|
68
|
+
.object({
|
|
69
|
+
description: z.string().optional(),
|
|
70
|
+
query: z.string().optional(),
|
|
71
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
72
|
+
handler: z.custom<OperationHandler<any, any, any>>().optional(),
|
|
73
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
74
|
+
input: z.custom<z.ZodType<any>>().optional(),
|
|
75
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
76
|
+
output: z.custom<z.ZodType<any>>().optional(),
|
|
77
|
+
hooks: z
|
|
78
|
+
.object({
|
|
79
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
80
|
+
init: z.custom<OperationInitHook<any>>().optional(),
|
|
81
|
+
beforeRequest: z
|
|
82
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
83
|
+
.custom<OperationBeforeRequestHook<any, any, any>>()
|
|
84
|
+
.optional(),
|
|
85
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
86
|
+
afterRequest: z.custom<OperationAfterRequestHook<any>>().optional(),
|
|
87
|
+
})
|
|
88
|
+
.optional(),
|
|
89
|
+
rest: OperationRestConfigZod.optional(),
|
|
90
|
+
graphql: OperationGraphQLConfigZod.optional().default({ enabled: true }),
|
|
91
|
+
cache: OperationCacheConfigZod.optional(),
|
|
92
|
+
})
|
|
93
|
+
.refine(
|
|
94
|
+
(operation) => {
|
|
95
|
+
const hasQuery = operation.query !== undefined;
|
|
96
|
+
const hasHandler = operation.handler !== undefined;
|
|
97
|
+
return (hasQuery || hasHandler) && !(hasQuery && hasHandler);
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
message: "Operation must have either 'query' or 'handler', but not both",
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
export type Operation = z.input<typeof OperationZod>;
|
|
105
|
+
|
|
106
|
+
export const OperationsZod = z.record(z.string(), OperationZod);
|
|
107
|
+
|
|
108
|
+
export type Operations = z.input<typeof OperationsZod>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Context passed to beforeRequest hook
|
|
112
|
+
*/
|
|
113
|
+
export type BeforeRequestContext<TInput = DefaultInput> = {
|
|
114
|
+
input: TInput;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Context passed to afterRequest hook
|
|
119
|
+
*/
|
|
120
|
+
export type AfterRequestContext<TOutput = unknown> = {
|
|
121
|
+
output: TOutput;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Result type for GraphQL queries
|
|
126
|
+
*/
|
|
127
|
+
export type GqlQueryResult<TReturn = unknown> = {
|
|
128
|
+
data: TReturn;
|
|
129
|
+
errors?: unknown[];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Base options passed to operation handlers and hooks.
|
|
134
|
+
* This is a simplified type for configuration purposes.
|
|
135
|
+
* At runtime, @graphoria/server provides a fully-typed version with BunRequest support.
|
|
136
|
+
*/
|
|
137
|
+
export type OperationOptions<TRepository = unknown> = {
|
|
138
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
139
|
+
gqlQuery: <TReturn = unknown>(
|
|
140
|
+
query: string,
|
|
141
|
+
params?: Record<string, unknown>,
|
|
142
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
143
|
+
req?: any,
|
|
144
|
+
) => Promise<GqlQueryResult<TReturn>>;
|
|
145
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
146
|
+
databases: any;
|
|
147
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
148
|
+
queues: any;
|
|
149
|
+
/**
|
|
150
|
+
* Custom repositories keyed by database name (`repository[dbName]`).
|
|
151
|
+
* `TRepository` is that whole map — e.g. `{ main: MainRepo }`.
|
|
152
|
+
*/
|
|
153
|
+
repository: TRepository;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Init hook - runs once at startup, can return cached data
|
|
158
|
+
*/
|
|
159
|
+
export type OperationInitHook<TInitData = unknown> = (
|
|
160
|
+
options: OperationOptions,
|
|
161
|
+
) => TInitData | Promise<TInitData>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* BeforeRequest hook - transforms input before execution
|
|
165
|
+
*/
|
|
166
|
+
export type OperationBeforeRequestHook<
|
|
167
|
+
TInput = DefaultInput,
|
|
168
|
+
TInitData = unknown,
|
|
169
|
+
TVariables = Record<string, unknown>,
|
|
170
|
+
> = (
|
|
171
|
+
context: BeforeRequestContext<TInput>,
|
|
172
|
+
initData: TInitData | undefined,
|
|
173
|
+
) => TVariables | Promise<TVariables>;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* AfterRequest hook - transforms output after execution
|
|
177
|
+
*/
|
|
178
|
+
export type OperationAfterRequestHook<TOutput = unknown> = (
|
|
179
|
+
context: AfterRequestContext<TOutput>,
|
|
180
|
+
) => TOutput | Promise<TOutput>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Custom handler function for operations with custom logic
|
|
184
|
+
*/
|
|
185
|
+
export type OperationHandler<TInput = DefaultInput, TOutput = unknown, TRepository = unknown> = (
|
|
186
|
+
options: OperationOptions<TRepository>,
|
|
187
|
+
input: TInput,
|
|
188
|
+
) => TOutput | Promise<TOutput>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Base operation properties shared by all operation types
|
|
192
|
+
*/
|
|
193
|
+
export type BaseOperation<TInput, TOutput, TInitData> = {
|
|
194
|
+
/** Description for documentation */
|
|
195
|
+
description?: string;
|
|
196
|
+
/** Input schema (Zod) - defines what the operation accepts */
|
|
197
|
+
input?: z.ZodType<TInput>;
|
|
198
|
+
/** Output schema (Zod) - defines what the operation returns (for OpenAPI) */
|
|
199
|
+
output?: z.ZodType<TOutput>;
|
|
200
|
+
/** Hooks for initialization and request transformation */
|
|
201
|
+
hooks?: {
|
|
202
|
+
init?: OperationInitHook<TInitData>;
|
|
203
|
+
beforeRequest?: OperationBeforeRequestHook<TInput, TInitData>;
|
|
204
|
+
afterRequest?: OperationAfterRequestHook<TOutput>;
|
|
205
|
+
};
|
|
206
|
+
/** REST exposure configuration */
|
|
207
|
+
rest?: OperationRestConfig;
|
|
208
|
+
/** GraphQL exposure configuration (enabled by default) */
|
|
209
|
+
graphql?: OperationGraphQLConfig;
|
|
210
|
+
/** Cache configuration */
|
|
211
|
+
cache?: OperationCacheConfig;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Query-based operation - executes a GraphQL query
|
|
216
|
+
*/
|
|
217
|
+
export type QueryOperation<
|
|
218
|
+
TInput = DefaultInput,
|
|
219
|
+
TOutput = unknown,
|
|
220
|
+
TInitData = unknown,
|
|
221
|
+
> = BaseOperation<TInput, TOutput, TInitData> & {
|
|
222
|
+
/** GraphQL query to execute */
|
|
223
|
+
query: string;
|
|
224
|
+
/** Custom handler is not allowed with query */
|
|
225
|
+
handler?: never;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Handler-based operation - executes custom logic
|
|
230
|
+
*/
|
|
231
|
+
export type HandlerOperation<
|
|
232
|
+
TInput = DefaultInput,
|
|
233
|
+
TOutput = unknown,
|
|
234
|
+
TInitData = unknown,
|
|
235
|
+
TRepository = unknown,
|
|
236
|
+
> = BaseOperation<TInput, TOutput, TInitData> & {
|
|
237
|
+
/** Query is not allowed with handler */
|
|
238
|
+
query?: never;
|
|
239
|
+
/** Custom handler function */
|
|
240
|
+
handler: OperationHandler<TInput, TOutput, TRepository>;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Union type for typed operations - must have either query OR handler
|
|
245
|
+
*/
|
|
246
|
+
export type TypedOperation<
|
|
247
|
+
TInput = DefaultInput,
|
|
248
|
+
TOutput = unknown,
|
|
249
|
+
TInitData = unknown,
|
|
250
|
+
TRepository = unknown,
|
|
251
|
+
> =
|
|
252
|
+
| QueryOperation<TInput, TOutput, TInitData>
|
|
253
|
+
| HandlerOperation<TInput, TOutput, TInitData, TRepository>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Base Zod Schemas for Queue Configuration
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// These are the pre-transform base schemas — the single source of truth for
|
|
7
|
+
// queue config authoring types. Server-only extensions and the publishers/
|
|
8
|
+
// subscribers/topics → exchanges/queues pivot transform live in types/zod/queue.ts.
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Reconnection configuration
|
|
12
|
+
*/
|
|
13
|
+
export const ReconnectConfigZod = z.object({
|
|
14
|
+
/** Initial delay before first reconnect attempt (ms) */
|
|
15
|
+
initialDelay: z.number().int().positive().default(1000),
|
|
16
|
+
/** Maximum delay between reconnect attempts (ms) */
|
|
17
|
+
maxDelay: z.number().int().positive().default(30000),
|
|
18
|
+
/** Multiplier for exponential backoff */
|
|
19
|
+
multiplier: z.number().positive().default(2),
|
|
20
|
+
/** Maximum number of reconnect attempts (0 = infinite) */
|
|
21
|
+
maxAttempts: z.number().int().nonnegative().default(0),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type ReconnectConfig = z.input<typeof ReconnectConfigZod>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Publisher configuration — defines how to send messages
|
|
28
|
+
*/
|
|
29
|
+
export const PublisherConfigZod = z.object({
|
|
30
|
+
/** Topic/Exchange name to publish to */
|
|
31
|
+
topic: z.string(),
|
|
32
|
+
/** Routing key (RabbitMQ) or message key (Kafka) */
|
|
33
|
+
routingKey: z.string().optional(),
|
|
34
|
+
/** Whether messages should survive broker restart (RabbitMQ only) */
|
|
35
|
+
persistent: z.boolean().optional().default(true),
|
|
36
|
+
/** Custom headers (Kafka only) */
|
|
37
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type PublisherConfig = z.input<typeof PublisherConfigZod>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Cache invalidation context passed to subscriber handlers
|
|
44
|
+
*/
|
|
45
|
+
export type CacheContext = {
|
|
46
|
+
invalidate: (operationName: string, pattern?: Record<string, unknown>) => Promise<boolean>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Subscriber handler function — single canonical spelling used by both
|
|
51
|
+
* SubscriberConfigZod and the transformQueueConfig return type.
|
|
52
|
+
*/
|
|
53
|
+
export type SubscriberHandler = (
|
|
54
|
+
message: unknown,
|
|
55
|
+
context: { cache: CacheContext },
|
|
56
|
+
) => Promise<void> | void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Subscriber configuration — defines how to receive messages
|
|
60
|
+
*/
|
|
61
|
+
export const SubscriberConfigZod = z.object({
|
|
62
|
+
/** Topic/Exchange name to subscribe to */
|
|
63
|
+
topic: z.string(),
|
|
64
|
+
/** Pattern for filtering messages (routing key pattern for RabbitMQ) */
|
|
65
|
+
pattern: z.string().optional().default("#"),
|
|
66
|
+
/** Explicit queue name (RabbitMQ) — auto-generated if not provided */
|
|
67
|
+
queue: z.string().optional(),
|
|
68
|
+
/** Consumer group ID (Kafka) — auto-generated if not provided */
|
|
69
|
+
group: z.string().optional(),
|
|
70
|
+
/** Whether queue should survive broker restart (RabbitMQ only) */
|
|
71
|
+
durable: z.boolean().optional(),
|
|
72
|
+
/** Whether queue should auto-delete when no consumers (RabbitMQ only) */
|
|
73
|
+
autoDelete: z.boolean().optional(),
|
|
74
|
+
/** Handler function to process received messages */
|
|
75
|
+
handler: z.custom<SubscriberHandler>().optional(),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export type SubscriberConfig = z.input<typeof SubscriberConfigZod>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Topic/Exchange configuration — for auto-setup
|
|
82
|
+
*/
|
|
83
|
+
export const TopicConfigZod = z.object({
|
|
84
|
+
/** Exchange type (RabbitMQ only) */
|
|
85
|
+
type: z.enum(["direct", "fanout", "topic", "headers"]).optional().default("topic"),
|
|
86
|
+
/** Whether exchange should survive broker restart */
|
|
87
|
+
durable: z.boolean().optional().default(true),
|
|
88
|
+
/** Whether exchange should auto-delete when no bindings */
|
|
89
|
+
autoDelete: z.boolean().optional().default(false),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export type TopicConfig = z.input<typeof TopicConfigZod>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Base queue configuration shared by all providers
|
|
96
|
+
*/
|
|
97
|
+
export const BaseQueueConfigZod = z.object({
|
|
98
|
+
/** Unique name for this queue connection */
|
|
99
|
+
name: z.string(),
|
|
100
|
+
/** Whether to auto-create topics/exchanges/queues */
|
|
101
|
+
autoSetup: z.boolean().optional().default(true),
|
|
102
|
+
/** Whether this queue is enabled */
|
|
103
|
+
enabled: z.boolean().optional().default(true),
|
|
104
|
+
/** Reconnection configuration */
|
|
105
|
+
reconnect: ReconnectConfigZod.optional(),
|
|
106
|
+
/** Publishers keyed by resolver name — become GraphQL mutations */
|
|
107
|
+
publishers: z.record(z.string(), PublisherConfigZod).optional().default({}),
|
|
108
|
+
/** Subscribers keyed by subscription name — become GraphQL subscriptions */
|
|
109
|
+
subscribers: z.record(z.string(), SubscriberConfigZod).optional().default({}),
|
|
110
|
+
/** Topic configurations for customizing auto-setup behavior */
|
|
111
|
+
topics: z.record(z.string(), TopicConfigZod).optional().default({}),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// Connection Schemas
|
|
116
|
+
// ============================================================================
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* RabbitMQ connection configuration (object form)
|
|
120
|
+
*/
|
|
121
|
+
export const RabbitMQConnectionZod = z.object({
|
|
122
|
+
hostname: z.string().default("localhost"),
|
|
123
|
+
port: z.number().default(5672),
|
|
124
|
+
username: z.string().optional(),
|
|
125
|
+
password: z.string().optional(),
|
|
126
|
+
vhost: z.string().default("/"),
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export type RabbitMQConnection = z.input<typeof RabbitMQConnectionZod>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Kafka connection configuration
|
|
133
|
+
*/
|
|
134
|
+
export const KafkaConnectionZod = z.object({
|
|
135
|
+
/** Broker addresses — "host:port" or ["host1:port1", "host2:port2"] */
|
|
136
|
+
brokers: z.union([z.string(), z.array(z.string())]),
|
|
137
|
+
/** Client identifier sent to the broker (default: "datagraph-<queue name>") */
|
|
138
|
+
clientId: z.string().optional(),
|
|
139
|
+
/** Enable SSL/TLS */
|
|
140
|
+
ssl: z.boolean().optional().default(false),
|
|
141
|
+
/** SASL authentication (optional) */
|
|
142
|
+
sasl: z
|
|
143
|
+
.object({
|
|
144
|
+
mechanism: z.enum(["plain", "scram-sha-256", "scram-sha-512"]).optional().default("plain"),
|
|
145
|
+
username: z.string(),
|
|
146
|
+
password: z.string(),
|
|
147
|
+
})
|
|
148
|
+
.optional(),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export type KafkaConnection = z.input<typeof KafkaConnectionZod>;
|
|
152
|
+
|
|
153
|
+
// ============================================================================
|
|
154
|
+
// Pre-transform Queue Config Union (used by ConfigurationInput)
|
|
155
|
+
// ============================================================================
|
|
156
|
+
// These mirror the .extend() logic in types/zod/queue.ts — the shape users
|
|
157
|
+
// write in graphoria.ts before transformQueueConfig derives exchanges/queues.
|
|
158
|
+
|
|
159
|
+
/** RabbitMQ queue config as authored by the user (pre-transform) */
|
|
160
|
+
export type RabbitMQQueueConfig = z.input<typeof BaseQueueConfigZod> & {
|
|
161
|
+
type: "rabbitmq";
|
|
162
|
+
connection: string | RabbitMQConnection;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** Kafka queue config as authored by the user (pre-transform) */
|
|
166
|
+
export type KafkaQueueConfig = z.input<typeof BaseQueueConfigZod> & {
|
|
167
|
+
type: "kafka";
|
|
168
|
+
connection: string | KafkaConnection;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/** Queue configuration union — the shape users write in graphoria.ts */
|
|
172
|
+
export type QueueConfig = RabbitMQQueueConfig | KafkaQueueConfig;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Remote REST API configuration (OpenAPI-based)
|
|
5
|
+
*/
|
|
6
|
+
export const RemoteRESTConfigZod = z.object({
|
|
7
|
+
/** Unique identifier for this remote REST API */
|
|
8
|
+
name: z.string().min(1),
|
|
9
|
+
/** Base URL of the remote API for proxying requests */
|
|
10
|
+
url: z.url().optional(),
|
|
11
|
+
/** URL to fetch the OpenAPI spec from */
|
|
12
|
+
specUrl: z.url().optional(),
|
|
13
|
+
/** Local file path to the OpenAPI spec (JSON or YAML) */
|
|
14
|
+
specPath: z.string().optional(),
|
|
15
|
+
/** Whether the remote REST API is enabled (default: true) */
|
|
16
|
+
enabled: z.boolean().optional().default(true),
|
|
17
|
+
/** Subpath prefix under /rest (default: name) */
|
|
18
|
+
prefix: z.string().optional(),
|
|
19
|
+
/** Static headers to send with every proxied request */
|
|
20
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
21
|
+
/** Client headers to forward to the remote endpoint */
|
|
22
|
+
forwardHeaders: z.array(z.string()).optional(),
|
|
23
|
+
/** Request timeout in milliseconds (default: 10000) */
|
|
24
|
+
timeout: z.number().int().positive().optional().default(10000),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** Authoring type for remote REST API config */
|
|
28
|
+
export type RemoteRESTConfig = z.input<typeof RemoteRESTConfigZod>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Remote GraphQL schema introspection configuration
|
|
5
|
+
*/
|
|
6
|
+
export const RemoteSchemaIntrospectionConfigZod = z
|
|
7
|
+
.object({
|
|
8
|
+
/** Re-introspect interval in ms (0 = only at startup, default: 0) */
|
|
9
|
+
interval: z.number().int().min(0).optional().default(0),
|
|
10
|
+
})
|
|
11
|
+
.optional();
|
|
12
|
+
|
|
13
|
+
/** Authoring type for remote schema introspection config */
|
|
14
|
+
export type RemoteSchemaIntrospectionConfig = z.input<typeof RemoteSchemaIntrospectionConfigZod>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Remote GraphQL schema configuration
|
|
18
|
+
*/
|
|
19
|
+
export const RemoteSchemaConfigZod = z.object({
|
|
20
|
+
/** Unique identifier for this remote schema */
|
|
21
|
+
name: z.string().min(1),
|
|
22
|
+
/** Remote GraphQL endpoint URL */
|
|
23
|
+
url: z.url(),
|
|
24
|
+
/** Whether the remote schema is enabled (default: true) */
|
|
25
|
+
enabled: z.boolean().optional().default(true),
|
|
26
|
+
/** Type/field prefix (default: name + "_") */
|
|
27
|
+
prefix: z.string().optional(),
|
|
28
|
+
/** Static headers to send with every request */
|
|
29
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
30
|
+
/** Client headers to forward to the remote endpoint */
|
|
31
|
+
forwardHeaders: z.array(z.string()).optional(),
|
|
32
|
+
/** Request timeout in milliseconds (default: 10000) */
|
|
33
|
+
timeout: z.number().int().positive().optional().default(10000),
|
|
34
|
+
/** Introspection configuration */
|
|
35
|
+
introspection: RemoteSchemaIntrospectionConfigZod,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** Authoring type for remote GraphQL schema config */
|
|
39
|
+
export type RemoteSchemaConfig = z.input<typeof RemoteSchemaConfigZod>;
|