@ductape/sdk 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent-context.d.ts +100 -0
- package/dist/agents/agent-context.js +604 -0
- package/dist/agents/agent-context.js.map +1 -0
- package/dist/agents/agent-executor.d.ts +180 -0
- package/dist/agents/agent-executor.js +715 -0
- package/dist/agents/agent-executor.js.map +1 -0
- package/dist/agents/agents.service.d.ts +310 -0
- package/dist/agents/agents.service.js +1255 -0
- package/dist/agents/agents.service.js.map +1 -0
- package/dist/agents/index.d.ts +55 -0
- package/dist/agents/index.js +110 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/memory-manager.d.ts +182 -0
- package/dist/agents/memory-manager.js +383 -0
- package/dist/agents/memory-manager.js.map +1 -0
- package/dist/agents/tool-registry.d.ts +141 -0
- package/dist/agents/tool-registry.js +355 -0
- package/dist/agents/tool-registry.js.map +1 -0
- package/dist/agents/types/agents.types.d.ts +1240 -0
- package/dist/agents/types/agents.types.js +12 -0
- package/dist/agents/types/agents.types.js.map +1 -0
- package/dist/agents/types/index.d.ts +6 -0
- package/dist/agents/types/index.js +23 -0
- package/dist/agents/types/index.js.map +1 -0
- package/dist/agents/vector-store-adapter.d.ts +108 -0
- package/dist/agents/vector-store-adapter.js +213 -0
- package/dist/agents/vector-store-adapter.js.map +1 -0
- package/dist/api/services/appApi.service.d.ts +78 -0
- package/dist/api/services/appApi.service.js +303 -0
- package/dist/api/services/appApi.service.js.map +1 -0
- package/dist/api/services/cloudApi.service.d.ts +31 -0
- package/dist/api/services/cloudApi.service.js +103 -0
- package/dist/api/services/cloudApi.service.js.map +1 -0
- package/dist/api/services/logsApi.service.d.ts +62 -0
- package/dist/api/services/logsApi.service.js +67 -0
- package/dist/api/services/logsApi.service.js.map +1 -0
- package/dist/api/services/pricingApi.service.d.ts +10 -0
- package/dist/api/services/pricingApi.service.js +34 -0
- package/dist/api/services/pricingApi.service.js.map +1 -0
- package/dist/api/services/processorApi.service.d.ts +927 -0
- package/dist/api/services/processorApi.service.js +787 -0
- package/dist/api/services/processorApi.service.js.map +1 -0
- package/dist/api/services/productsApi.service.d.ts +167 -0
- package/dist/api/services/productsApi.service.js +293 -0
- package/dist/api/services/productsApi.service.js.map +1 -0
- package/dist/api/services/resilienceApi.service.d.ts +106 -0
- package/dist/api/services/resilienceApi.service.js +224 -0
- package/dist/api/services/resilienceApi.service.js.map +1 -0
- package/dist/api/services/secretsApi.service.d.ts +51 -0
- package/dist/api/services/secretsApi.service.js +126 -0
- package/dist/api/services/secretsApi.service.js.map +1 -0
- package/dist/api/services/userApi.service.d.ts +10 -0
- package/dist/api/services/userApi.service.js +20 -0
- package/dist/api/services/userApi.service.js.map +1 -0
- package/dist/api/services/webhooksApi.service.d.ts +14 -0
- package/dist/api/services/webhooksApi.service.js +65 -0
- package/dist/api/services/webhooksApi.service.js.map +1 -0
- package/dist/api/services/workflowApi.service.d.ts +199 -0
- package/dist/api/services/workflowApi.service.js +201 -0
- package/dist/api/services/workflowApi.service.js.map +1 -0
- package/dist/api/services/workspaceApi.service.d.ts +20 -0
- package/dist/api/services/workspaceApi.service.js +54 -0
- package/dist/api/services/workspaceApi.service.js.map +1 -0
- package/dist/api/urls.d.ts +145 -0
- package/dist/api/urls.js +195 -0
- package/dist/api/urls.js.map +1 -0
- package/dist/api/utils/auth.utils.d.ts +10 -0
- package/dist/api/utils/auth.utils.js +24 -0
- package/dist/api/utils/auth.utils.js.map +1 -0
- package/dist/api/utils/cache.utils.d.ts +3 -0
- package/dist/api/utils/cache.utils.js +18 -0
- package/dist/api/utils/cache.utils.js.map +1 -0
- package/dist/api/utils/integration-api-error.d.ts +6 -0
- package/dist/api/utils/integration-api-error.js +45 -0
- package/dist/api/utils/integration-api-error.js.map +1 -0
- package/dist/api/utils/strings.utils.d.ts +7 -0
- package/dist/api/utils/strings.utils.js +64 -0
- package/dist/api/utils/strings.utils.js.map +1 -0
- package/dist/apps/services/app.service.d.ts +126 -0
- package/dist/apps/services/app.service.js +1436 -0
- package/dist/apps/services/app.service.js.map +1 -0
- package/dist/apps/utils/auth-context-manager.d.ts +137 -0
- package/dist/apps/utils/auth-context-manager.js +248 -0
- package/dist/apps/utils/auth-context-manager.js.map +1 -0
- package/dist/apps/utils/credential-manager.d.ts +128 -0
- package/dist/apps/utils/credential-manager.js +199 -0
- package/dist/apps/utils/credential-manager.js.map +1 -0
- package/dist/apps/utils/index.d.ts +10 -0
- package/dist/apps/utils/index.js +54 -0
- package/dist/apps/utils/index.js.map +1 -0
- package/dist/apps/utils/input-helpers.d.ts +67 -0
- package/dist/apps/utils/input-helpers.js +185 -0
- package/dist/apps/utils/input-helpers.js.map +1 -0
- package/dist/apps/utils/input-resolver.d.ts +165 -0
- package/dist/apps/utils/input-resolver.js +477 -0
- package/dist/apps/utils/input-resolver.js.map +1 -0
- package/dist/apps/utils/oauth-manager.d.ts +196 -0
- package/dist/apps/utils/oauth-manager.js +429 -0
- package/dist/apps/utils/oauth-manager.js.map +1 -0
- package/dist/apps/utils/objects.utils.d.ts +4 -0
- package/dist/apps/utils/objects.utils.js +59 -0
- package/dist/apps/utils/objects.utils.js.map +1 -0
- package/dist/apps/utils/string.utils.d.ts +9 -0
- package/dist/apps/utils/string.utils.js +89 -0
- package/dist/apps/utils/string.utils.js.map +1 -0
- package/dist/apps/validators/index.d.ts +17 -0
- package/dist/apps/validators/index.js +39 -0
- package/dist/apps/validators/index.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.app.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/create.app.validator.js +43 -0
- package/dist/apps/validators/joi-validators/create.app.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +72 -0
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.d.ts +7 -0
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +81 -0
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appAuth.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js +64 -0
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appBody.validators.d.ts +4 -0
- package/dist/apps/validators/joi-validators/create.appBody.validators.js +44 -0
- package/dist/apps/validators/joi-validators/create.appBody.validators.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appConstants.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js +45 -0
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appEnv.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js +50 -0
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appVariable.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js +47 -0
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +60 -0
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js +48 -0
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/sample.validator.d.ts +6 -0
- package/dist/apps/validators/joi-validators/sample.validator.js +65 -0
- package/dist/apps/validators/joi-validators/sample.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.app.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.app.validator.js +66 -0
- package/dist/apps/validators/joi-validators/update.app.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +76 -0
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +57 -0
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appAuth.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js +52 -0
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appConstants.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js +45 -0
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appEnv.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js +50 -0
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appVariables.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js +47 -0
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +4 -0
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +59 -0
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js +48 -0
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js.map +1 -0
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.d.ts +3 -0
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js +60 -0
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js.map +1 -0
- package/dist/bin.d.ts +26 -0
- package/dist/bin.js +28 -0
- package/dist/bin.js.map +1 -0
- package/dist/brokers/brokers.service.d.ts +438 -0
- package/dist/brokers/brokers.service.js +1315 -0
- package/dist/brokers/brokers.service.js.map +1 -0
- package/dist/brokers/index.d.ts +46 -0
- package/dist/brokers/index.js +83 -0
- package/dist/brokers/index.js.map +1 -0
- package/dist/brokers/types/index.d.ts +569 -0
- package/dist/brokers/types/index.js +8 -0
- package/dist/brokers/types/index.js.map +1 -0
- package/dist/brokers/utils/broker.util.d.ts +33 -0
- package/dist/brokers/utils/broker.util.js +125 -0
- package/dist/brokers/utils/broker.util.js.map +1 -0
- package/dist/brokers/utils/providers/aws-sqs.service.d.ts +16 -0
- package/dist/brokers/utils/providers/aws-sqs.service.js +71 -0
- package/dist/brokers/utils/providers/aws-sqs.service.js.map +1 -0
- package/dist/brokers/utils/providers/google-pubsub.service.d.ts +16 -0
- package/dist/brokers/utils/providers/google-pubsub.service.js +43 -0
- package/dist/brokers/utils/providers/google-pubsub.service.js.map +1 -0
- package/dist/brokers/utils/providers/index.d.ts +6 -0
- package/dist/brokers/utils/providers/index.js +16 -0
- package/dist/brokers/utils/providers/index.js.map +1 -0
- package/dist/brokers/utils/providers/kafka.service.d.ts +23 -0
- package/dist/brokers/utils/providers/kafka.service.js +131 -0
- package/dist/brokers/utils/providers/kafka.service.js.map +1 -0
- package/dist/brokers/utils/providers/nats.service.d.ts +18 -0
- package/dist/brokers/utils/providers/nats.service.js +63 -0
- package/dist/brokers/utils/providers/nats.service.js.map +1 -0
- package/dist/brokers/utils/providers/rabbitmq.service.d.ts +25 -0
- package/dist/brokers/utils/providers/rabbitmq.service.js +138 -0
- package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -0
- package/dist/brokers/utils/providers/redis.service.d.ts +18 -0
- package/dist/brokers/utils/providers/redis.service.js +93 -0
- package/dist/brokers/utils/providers/redis.service.js.map +1 -0
- package/dist/cache/cache.manager.d.ts +308 -0
- package/dist/cache/cache.manager.js +900 -0
- package/dist/cache/cache.manager.js.map +1 -0
- package/dist/cache/cache.service.d.ts +194 -0
- package/dist/cache/cache.service.js +601 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cache/index.d.ts +52 -0
- package/dist/cache/index.js +81 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/types/index.d.ts +114 -0
- package/dist/cache/types/index.js +6 -0
- package/dist/cache/types/index.js.map +1 -0
- package/dist/clients/apps.client.d.ts +4 -0
- package/dist/clients/apps.client.js +31 -0
- package/dist/clients/apps.client.js.map +1 -0
- package/dist/clients/email.client.d.ts +4 -0
- package/dist/clients/email.client.js +29 -0
- package/dist/clients/email.client.js.map +1 -0
- package/dist/clients/expo.client.d.ts +3 -0
- package/dist/clients/expo.client.js +28 -0
- package/dist/clients/expo.client.js.map +1 -0
- package/dist/clients/function.client.d.ts +3 -0
- package/dist/clients/function.client.js +27 -0
- package/dist/clients/function.client.js.map +1 -0
- package/dist/clients/http.client.d.ts +3 -0
- package/dist/clients/http.client.js +27 -0
- package/dist/clients/http.client.js.map +1 -0
- package/dist/clients/logs.client.d.ts +4 -0
- package/dist/clients/logs.client.js +34 -0
- package/dist/clients/logs.client.js.map +1 -0
- package/dist/clients/pricing.client.d.ts +4 -0
- package/dist/clients/pricing.client.js +34 -0
- package/dist/clients/pricing.client.js.map +1 -0
- package/dist/clients/products.client.d.ts +3 -0
- package/dist/clients/products.client.js +32 -0
- package/dist/clients/products.client.js.map +1 -0
- package/dist/clients/users.client.d.ts +4 -0
- package/dist/clients/users.client.js +34 -0
- package/dist/clients/users.client.js.map +1 -0
- package/dist/clients/webhooks.client.d.ts +4 -0
- package/dist/clients/webhooks.client.js +34 -0
- package/dist/clients/webhooks.client.js.map +1 -0
- package/dist/clients/workspace.client.d.ts +7 -0
- package/dist/clients/workspace.client.js +39 -0
- package/dist/clients/workspace.client.js.map +1 -0
- package/dist/cloud/cloud-runtime.util.d.ts +22 -0
- package/dist/cloud/cloud-runtime.util.js +61 -0
- package/dist/cloud/cloud-runtime.util.js.map +1 -0
- package/dist/cloud/cloud.service.d.ts +43 -0
- package/dist/cloud/cloud.service.js +121 -0
- package/dist/cloud/cloud.service.js.map +1 -0
- package/dist/cloud/index.d.ts +5 -0
- package/dist/cloud/index.js +25 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/types/cloud.types.d.ts +140 -0
- package/dist/cloud/types/cloud.types.js +6 -0
- package/dist/cloud/types/cloud.types.js.map +1 -0
- package/dist/cloud/types/index.d.ts +1 -0
- package/dist/cloud/types/index.js +18 -0
- package/dist/cloud/types/index.js.map +1 -0
- package/dist/database/actions/action-manager.d.ts +170 -0
- package/dist/database/actions/action-manager.js +465 -0
- package/dist/database/actions/action-manager.js.map +1 -0
- package/dist/database/actions/index.d.ts +6 -0
- package/dist/database/actions/index.js +13 -0
- package/dist/database/actions/index.js.map +1 -0
- package/dist/database/adapters/adapter.factory.d.ts +62 -0
- package/dist/database/adapters/adapter.factory.js +97 -0
- package/dist/database/adapters/adapter.factory.js.map +1 -0
- package/dist/database/adapters/base.adapter.d.ts +423 -0
- package/dist/database/adapters/base.adapter.js +260 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/cassandra.adapter.d.ts +92 -0
- package/dist/database/adapters/cassandra.adapter.js +1091 -0
- package/dist/database/adapters/cassandra.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +110 -0
- package/dist/database/adapters/dynamodb.adapter.js +1564 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/index.d.ts +11 -0
- package/dist/database/adapters/index.js +27 -0
- package/dist/database/adapters/index.js.map +1 -0
- package/dist/database/adapters/mariadb.adapter.d.ts +100 -0
- package/dist/database/adapters/mariadb.adapter.js +247 -0
- package/dist/database/adapters/mariadb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +121 -0
- package/dist/database/adapters/mongodb.adapter.js +1284 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +86 -0
- package/dist/database/adapters/mysql.adapter.js +1371 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +90 -0
- package/dist/database/adapters/postgresql.adapter.js +1487 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/databases.service.d.ts +1526 -0
- package/dist/database/databases.service.js +3370 -0
- package/dist/database/databases.service.js.map +1 -0
- package/dist/database/index.d.ts +46 -0
- package/dist/database/index.js +109 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/migrations/index.d.ts +6 -0
- package/dist/database/migrations/index.js +12 -0
- package/dist/database/migrations/index.js.map +1 -0
- package/dist/database/migrations/migration-engine.d.ts +136 -0
- package/dist/database/migrations/migration-engine.js +1421 -0
- package/dist/database/migrations/migration-engine.js.map +1 -0
- package/dist/database/operators/aggregation-builder.d.ts +67 -0
- package/dist/database/operators/aggregation-builder.js +841 -0
- package/dist/database/operators/aggregation-builder.js.map +1 -0
- package/dist/database/operators/index.d.ts +7 -0
- package/dist/database/operators/index.js +15 -0
- package/dist/database/operators/index.js.map +1 -0
- package/dist/database/operators/query-builder.d.ts +69 -0
- package/dist/database/operators/query-builder.js +447 -0
- package/dist/database/operators/query-builder.js.map +1 -0
- package/dist/database/presave/decrypt.d.ts +25 -0
- package/dist/database/presave/decrypt.js +146 -0
- package/dist/database/presave/decrypt.js.map +1 -0
- package/dist/database/presave/index.d.ts +9 -0
- package/dist/database/presave/index.js +18 -0
- package/dist/database/presave/index.js.map +1 -0
- package/dist/database/presave/presave-processor.d.ts +148 -0
- package/dist/database/presave/presave-processor.js +702 -0
- package/dist/database/presave/presave-processor.js.map +1 -0
- package/dist/database/schema/index.d.ts +7 -0
- package/dist/database/schema/index.js +13 -0
- package/dist/database/schema/index.js.map +1 -0
- package/dist/database/schema/schema-manager.d.ts +258 -0
- package/dist/database/schema/schema-manager.js +638 -0
- package/dist/database/schema/schema-manager.js.map +1 -0
- package/dist/database/transactions/index.d.ts +6 -0
- package/dist/database/transactions/index.js +13 -0
- package/dist/database/transactions/index.js.map +1 -0
- package/dist/database/transactions/transaction-manager.d.ts +113 -0
- package/dist/database/transactions/transaction-manager.js +344 -0
- package/dist/database/transactions/transaction-manager.js.map +1 -0
- package/dist/database/triggers/index.d.ts +7 -0
- package/dist/database/triggers/index.js +14 -0
- package/dist/database/triggers/index.js.map +1 -0
- package/dist/database/triggers/trigger-processor.d.ts +239 -0
- package/dist/database/triggers/trigger-processor.js +1034 -0
- package/dist/database/triggers/trigger-processor.js.map +1 -0
- package/dist/database/types/action.interface.d.ts +148 -0
- package/dist/database/types/action.interface.js +6 -0
- package/dist/database/types/action.interface.js.map +1 -0
- package/dist/database/types/aggregation.interface.d.ts +185 -0
- package/dist/database/types/aggregation.interface.js +6 -0
- package/dist/database/types/aggregation.interface.js.map +1 -0
- package/dist/database/types/connection.interface.d.ts +141 -0
- package/dist/database/types/connection.interface.js +6 -0
- package/dist/database/types/connection.interface.js.map +1 -0
- package/dist/database/types/dashboard.interface.d.ts +74 -0
- package/dist/database/types/dashboard.interface.js +7 -0
- package/dist/database/types/dashboard.interface.js.map +1 -0
- package/dist/database/types/enums.d.ts +195 -0
- package/dist/database/types/enums.js +244 -0
- package/dist/database/types/enums.js.map +1 -0
- package/dist/database/types/index.d.ts +15 -0
- package/dist/database/types/index.js +31 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/migration.interface.d.ts +686 -0
- package/dist/database/types/migration.interface.js +9 -0
- package/dist/database/types/migration.interface.js.map +1 -0
- package/dist/database/types/presave.interface.d.ts +292 -0
- package/dist/database/types/presave.interface.js +60 -0
- package/dist/database/types/presave.interface.js.map +1 -0
- package/dist/database/types/query.interface.d.ts +205 -0
- package/dist/database/types/query.interface.js +6 -0
- package/dist/database/types/query.interface.js.map +1 -0
- package/dist/database/types/schema.interface.d.ts +412 -0
- package/dist/database/types/schema.interface.js +6 -0
- package/dist/database/types/schema.interface.js.map +1 -0
- package/dist/database/types/transaction.interface.d.ts +84 -0
- package/dist/database/types/transaction.interface.js +6 -0
- package/dist/database/types/transaction.interface.js.map +1 -0
- package/dist/database/types/trigger.interface.d.ts +612 -0
- package/dist/database/types/trigger.interface.js +121 -0
- package/dist/database/types/trigger.interface.js.map +1 -0
- package/dist/database/types/write.interface.d.ts +216 -0
- package/dist/database/types/write.interface.js +6 -0
- package/dist/database/types/write.interface.js.map +1 -0
- package/dist/database/utils/database-error.d.ts +96 -0
- package/dist/database/utils/database-error.js +221 -0
- package/dist/database/utils/database-error.js.map +1 -0
- package/dist/database/utils/index.d.ts +6 -0
- package/dist/database/utils/index.js +11 -0
- package/dist/database/utils/index.js.map +1 -0
- package/dist/graph/adapters/adapter.factory.d.ts +47 -0
- package/dist/graph/adapters/adapter.factory.js +77 -0
- package/dist/graph/adapters/adapter.factory.js.map +1 -0
- package/dist/graph/adapters/arangodb.adapter.d.ts +86 -0
- package/dist/graph/adapters/arangodb.adapter.js +1588 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +264 -0
- package/dist/graph/adapters/base.adapter.js +156 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +11 -0
- package/dist/graph/adapters/index.js +21 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +110 -0
- package/dist/graph/adapters/memgraph.adapter.js +1452 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +81 -0
- package/dist/graph/adapters/neo4j.adapter.js +1317 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +82 -0
- package/dist/graph/adapters/neptune.adapter.js +1369 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graphs.service.d.ts +633 -0
- package/dist/graph/graphs.service.js +2684 -0
- package/dist/graph/graphs.service.js.map +1 -0
- package/dist/graph/index.d.ts +58 -0
- package/dist/graph/index.js +77 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/transactions/index.d.ts +4 -0
- package/dist/graph/transactions/index.js +9 -0
- package/dist/graph/transactions/index.js.map +1 -0
- package/dist/graph/transactions/transaction-manager.d.ts +61 -0
- package/dist/graph/transactions/transaction-manager.js +126 -0
- package/dist/graph/transactions/transaction-manager.js.map +1 -0
- package/dist/graph/types/connection.interface.d.ts +161 -0
- package/dist/graph/types/connection.interface.js +9 -0
- package/dist/graph/types/connection.interface.js.map +1 -0
- package/dist/graph/types/enums.d.ts +101 -0
- package/dist/graph/types/enums.js +114 -0
- package/dist/graph/types/enums.js.map +1 -0
- package/dist/graph/types/index.d.ts +13 -0
- package/dist/graph/types/index.js +20 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.interface.d.ts +248 -0
- package/dist/graph/types/node.interface.js +9 -0
- package/dist/graph/types/node.interface.js.map +1 -0
- package/dist/graph/types/query.interface.d.ts +175 -0
- package/dist/graph/types/query.interface.js +9 -0
- package/dist/graph/types/query.interface.js.map +1 -0
- package/dist/graph/types/relationship.interface.d.ts +207 -0
- package/dist/graph/types/relationship.interface.js +9 -0
- package/dist/graph/types/relationship.interface.js.map +1 -0
- package/dist/graph/types/schema.interface.d.ts +295 -0
- package/dist/graph/types/schema.interface.js +9 -0
- package/dist/graph/types/schema.interface.js.map +1 -0
- package/dist/graph/types/transaction.interface.d.ts +55 -0
- package/dist/graph/types/transaction.interface.js +9 -0
- package/dist/graph/types/transaction.interface.js.map +1 -0
- package/dist/graph/types/traversal.interface.d.ts +181 -0
- package/dist/graph/types/traversal.interface.js +9 -0
- package/dist/graph/types/traversal.interface.js.map +1 -0
- package/dist/graph/utils/graph-error.d.ts +71 -0
- package/dist/graph/utils/graph-error.js +142 -0
- package/dist/graph/utils/graph-error.js.map +1 -0
- package/dist/graph/utils/index.d.ts +4 -0
- package/dist/graph/utils/index.js +9 -0
- package/dist/graph/utils/index.js.map +1 -0
- package/dist/imports/imports.repo.d.ts +0 -0
- package/dist/imports/imports.repo.js +1 -0
- package/dist/imports/imports.repo.js.map +1 -0
- package/dist/imports/imports.service.d.ts +23 -0
- package/dist/imports/imports.service.js +71 -0
- package/dist/imports/imports.service.js.map +1 -0
- package/dist/imports/imports.types.d.ts +350 -0
- package/dist/imports/imports.types.js +33 -0
- package/dist/imports/imports.types.js.map +1 -0
- package/dist/imports/openAPI3.0.types.d.ts +52 -0
- package/dist/imports/openAPI3.0.types.js +3 -0
- package/dist/imports/openAPI3.0.types.js.map +1 -0
- package/dist/imports/repos/openApi.repo.d.ts +6 -0
- package/dist/imports/repos/openApi.repo.js +422 -0
- package/dist/imports/repos/openApi.repo.js.map +1 -0
- package/dist/imports/repos/postmanV21.repo.d.ts +14 -0
- package/dist/imports/repos/postmanV21.repo.js +257 -0
- package/dist/imports/repos/postmanV21.repo.js.map +1 -0
- package/dist/imports/utils/imports.utils.d.ts +80 -0
- package/dist/imports/utils/imports.utils.js +114 -0
- package/dist/imports/utils/imports.utils.js.map +1 -0
- package/dist/imports/validators/index.d.ts +0 -0
- package/dist/imports/validators/index.js +1 -0
- package/dist/imports/validators/index.js.map +1 -0
- package/dist/imports/validators/joi-validators/postmanV21.validator.d.ts +5 -0
- package/dist/imports/validators/joi-validators/postmanV21.validator.js +96 -0
- package/dist/imports/validators/joi-validators/postmanV21.validator.js.map +1 -0
- package/dist/index.d.ts +4233 -0
- package/dist/index.js +5933 -0
- package/dist/index.js.map +1 -0
- package/dist/init.interface.d.ts +407 -0
- package/dist/init.interface.js +3 -0
- package/dist/init.interface.js.map +1 -0
- package/dist/inputs/inputs.repo.d.ts +7 -0
- package/dist/inputs/inputs.repo.js +16 -0
- package/dist/inputs/inputs.repo.js.map +1 -0
- package/dist/inputs/inputs.service.d.ts +61 -0
- package/dist/inputs/inputs.service.js +468 -0
- package/dist/inputs/inputs.service.js.map +1 -0
- package/dist/inputs/utils/inputs.utils.create.d.ts +11 -0
- package/dist/inputs/utils/inputs.utils.create.js +273 -0
- package/dist/inputs/utils/inputs.utils.create.js.map +1 -0
- package/dist/inputs/validators/inputs.validator.parse.d.ts +4 -0
- package/dist/inputs/validators/inputs.validator.parse.js +53 -0
- package/dist/inputs/validators/inputs.validator.parse.js.map +1 -0
- package/dist/jobs/index.d.ts +38 -0
- package/dist/jobs/index.js +50 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/jobs.service.d.ts +154 -0
- package/dist/jobs/jobs.service.js +491 -0
- package/dist/jobs/jobs.service.js.map +1 -0
- package/dist/jobs/jobs.state.d.ts +113 -0
- package/dist/jobs/jobs.state.js +447 -0
- package/dist/jobs/jobs.state.js.map +1 -0
- package/dist/jobs/types.d.ts +449 -0
- package/dist/jobs/types.js +74 -0
- package/dist/jobs/types.js.map +1 -0
- package/dist/logs/logs.repo.d.ts +6 -0
- package/dist/logs/logs.repo.js +12 -0
- package/dist/logs/logs.repo.js.map +1 -0
- package/dist/logs/logs.service.d.ts +30 -0
- package/dist/logs/logs.service.js +89 -0
- package/dist/logs/logs.service.js.map +1 -0
- package/dist/logs/logs.types.d.ts +85 -0
- package/dist/logs/logs.types.js +52 -0
- package/dist/logs/logs.types.js.map +1 -0
- package/dist/logs/utils/logs.utils.create.d.ts +0 -0
- package/dist/logs/utils/logs.utils.create.js +1 -0
- package/dist/logs/utils/logs.utils.create.js.map +1 -0
- package/dist/logs/utils/logs.utils.errors.d.ts +2 -0
- package/dist/logs/utils/logs.utils.errors.js +8 -0
- package/dist/logs/utils/logs.utils.errors.js.map +1 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/models.service.d.ts +137 -0
- package/dist/models/models.service.js +195 -0
- package/dist/models/models.service.js.map +1 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.js +26 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/notifications.service.d.ts +270 -0
- package/dist/notifications/notifications.service.js +912 -0
- package/dist/notifications/notifications.service.js.map +1 -0
- package/dist/notifications/types/index.d.ts +4 -0
- package/dist/notifications/types/index.js +21 -0
- package/dist/notifications/types/index.js.map +1 -0
- package/dist/notifications/types/notifications.types.d.ts +456 -0
- package/dist/notifications/types/notifications.types.js +51 -0
- package/dist/notifications/types/notifications.types.js.map +1 -0
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +27 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
- package/dist/parsers/pipelines/postman.pipelines.js +103 -0
- package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
- package/dist/parsers/types/postman.types.d.ts +200 -0
- package/dist/parsers/types/postman.types.js +3 -0
- package/dist/parsers/types/postman.types.js.map +1 -0
- package/dist/parsers/utils/postman.utils.d.ts +12 -0
- package/dist/parsers/utils/postman.utils.js +116 -0
- package/dist/parsers/utils/postman.utils.js.map +1 -0
- package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
- package/dist/parsers/validators/postman-auth.validators.js +127 -0
- package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
- package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-request.validators.js +139 -0
- package/dist/parsers/validators/postman-request.validators.js.map +1 -0
- package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-response.validators.js +150 -0
- package/dist/parsers/validators/postman-response.validators.js.map +1 -0
- package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
- package/dist/parsers/validators/postman-variable.validators.js +163 -0
- package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +1 -0
- package/dist/pricing/pricing.repo.js.map +1 -0
- package/dist/pricing/pricing.service.d.ts +24 -0
- package/dist/pricing/pricing.service.js +51 -0
- package/dist/pricing/pricing.service.js.map +1 -0
- package/dist/pricing/pricing.types.d.ts +76 -0
- package/dist/pricing/pricing.types.js +21 -0
- package/dist/pricing/pricing.types.js.map +1 -0
- package/dist/pricing/utils/string.utils.d.ts +1 -0
- package/dist/pricing/utils/string.utils.js +9 -0
- package/dist/pricing/utils/string.utils.js.map +1 -0
- package/dist/processor/repos/mongo.repo.d.ts +39 -0
- package/dist/processor/repos/mongo.repo.js +260 -0
- package/dist/processor/repos/mongo.repo.js.map +1 -0
- package/dist/processor/repos/postgres.repo.d.ts +31 -0
- package/dist/processor/repos/postgres.repo.js +185 -0
- package/dist/processor/repos/postgres.repo.js.map +1 -0
- package/dist/processor/repos/sms.repo.d.ts +39 -0
- package/dist/processor/repos/sms.repo.js +124 -0
- package/dist/processor/repos/sms.repo.js.map +1 -0
- package/dist/processor/services/processor.service.d.ts +465 -0
- package/dist/processor/services/processor.service.js +5343 -0
- package/dist/processor/services/processor.service.js.map +1 -0
- package/dist/processor/services/request.service.d.ts +36 -0
- package/dist/processor/services/request.service.js +304 -0
- package/dist/processor/services/request.service.js.map +1 -0
- package/dist/processor/types/request.types.d.ts +14 -0
- package/dist/processor/types/request.types.js +3 -0
- package/dist/processor/types/request.types.js.map +1 -0
- package/dist/processor/utils/processor.utils.d.ts +104 -0
- package/dist/processor/utils/processor.utils.js +1066 -0
- package/dist/processor/utils/processor.utils.js.map +1 -0
- package/dist/processor/utils/request.utils.d.ts +20 -0
- package/dist/processor/utils/request.utils.js +113 -0
- package/dist/processor/utils/request.utils.js.map +1 -0
- package/dist/processor/utils/storage.util.d.ts +8 -0
- package/dist/processor/utils/storage.util.js +106 -0
- package/dist/processor/utils/storage.util.js.map +1 -0
- package/dist/products/services/products.service.d.ts +579 -0
- package/dist/products/services/products.service.js +5853 -0
- package/dist/products/services/products.service.js.map +1 -0
- package/dist/products/utils/crypt.utils.d.ts +1 -0
- package/dist/products/utils/crypt.utils.js +17 -0
- package/dist/products/utils/crypt.utils.js.map +1 -0
- package/dist/products/utils/functions.utils.d.ts +13 -0
- package/dist/products/utils/functions.utils.js +294 -0
- package/dist/products/utils/functions.utils.js.map +1 -0
- package/dist/products/utils/objects.utils.d.ts +13 -0
- package/dist/products/utils/objects.utils.js +89 -0
- package/dist/products/utils/objects.utils.js.map +1 -0
- package/dist/products/utils/string.utils.d.ts +12 -0
- package/dist/products/utils/string.utils.js +168 -0
- package/dist/products/utils/string.utils.js.map +1 -0
- package/dist/products/validators/index.d.ts +33 -0
- package/dist/products/validators/index.js +75 -0
- package/dist/products/validators/index.js.map +1 -0
- package/dist/products/validators/joi-validators/create.html.validator.d.ts +2 -0
- package/dist/products/validators/joi-validators/create.html.validator.js +55 -0
- package/dist/products/validators/joi-validators/create.html.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +266 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productApp.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productApp.validator.js +61 -0
- package/dist/products/validators/joi-validators/create.productApp.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productCache.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productCache.validator.js +46 -0
- package/dist/products/validators/joi-validators/create.productCache.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +77 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +7 -0
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +194 -0
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js +63 -0
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +45 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productFallback.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productFallback.validator.js +64 -0
- package/dist/products/validators/joi-validators/create.productFallback.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productFeature.validator.d.ts +14 -0
- package/dist/products/validators/joi-validators/create.productFeature.validator.js +140 -0
- package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productFunction.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productFunction.validator.js +57 -0
- package/dist/products/validators/joi-validators/create.productFunction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +89 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productJob.validator.d.ts +12 -0
- package/dist/products/validators/joi-validators/create.productJob.validator.js +60 -0
- package/dist/products/validators/joi-validators/create.productJob.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +52 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +193 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productModel.validator.js +132 -0
- package/dist/products/validators/joi-validators/create.productModel.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productNotification.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +241 -0
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +57 -0
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productNotifications.validator.d.ts +0 -0
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productQuota.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productQuota.validator.js +67 -0
- package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productStorage.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +158 -0
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js +136 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.products.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.products.validator.js +43 -0
- package/dist/products/validators/joi-validators/create.products.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.requestAction.validator.d.ts +2 -0
- package/dist/products/validators/joi-validators/create.requestAction.validator.js +45 -0
- package/dist/products/validators/joi-validators/create.requestAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +48 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js +48 -0
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +104 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productApp.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productApp.validator.js +42 -0
- package/dist/products/validators/joi-validators/update.productApp.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productCache.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productCache.validator.js +45 -0
- package/dist/products/validators/joi-validators/update.productCache.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js +76 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +79 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js +64 -0
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +46 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productFallback.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productFallback.validator.js +60 -0
- package/dist/products/validators/joi-validators/update.productFallback.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productFeature.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productFeature.validator.js +53 -0
- package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productFunction.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productFunction.validator.js +41 -0
- package/dist/products/validators/joi-validators/update.productFunction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +88 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productJob.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productJob.validator.js +50 -0
- package/dist/products/validators/joi-validators/update.productJob.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +52 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productNotification.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productNotification.validator.js +47 -0
- package/dist/products/validators/joi-validators/update.productNotification.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +58 -0
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productQuota.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productQuota.validator.js +64 -0
- package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +48 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -0
- package/dist/resilience/fallback.service.d.ts +143 -0
- package/dist/resilience/fallback.service.js +771 -0
- package/dist/resilience/fallback.service.js.map +1 -0
- package/dist/resilience/healthcheck.service.d.ts +165 -0
- package/dist/resilience/healthcheck.service.js +1019 -0
- package/dist/resilience/healthcheck.service.js.map +1 -0
- package/dist/resilience/index.d.ts +104 -0
- package/dist/resilience/index.js +140 -0
- package/dist/resilience/index.js.map +1 -0
- package/dist/resilience/quota.service.d.ts +85 -0
- package/dist/resilience/quota.service.js +523 -0
- package/dist/resilience/quota.service.js.map +1 -0
- package/dist/resilience/resilience.service.d.ts +98 -0
- package/dist/resilience/resilience.service.js +560 -0
- package/dist/resilience/resilience.service.js.map +1 -0
- package/dist/resilience/types/index.d.ts +515 -0
- package/dist/resilience/types/index.js +29 -0
- package/dist/resilience/types/index.js.map +1 -0
- package/dist/runtime/runtime-defaults.d.ts +28 -0
- package/dist/runtime/runtime-defaults.js +38 -0
- package/dist/runtime/runtime-defaults.js.map +1 -0
- package/dist/secrets/index.d.ts +10 -0
- package/dist/secrets/index.js +33 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/secrets/secrets.resolver.d.ts +52 -0
- package/dist/secrets/secrets.resolver.js +236 -0
- package/dist/secrets/secrets.resolver.js.map +1 -0
- package/dist/secrets/secrets.service.d.ts +93 -0
- package/dist/secrets/secrets.service.js +246 -0
- package/dist/secrets/secrets.service.js.map +1 -0
- package/dist/secrets/secrets.types.d.ts +188 -0
- package/dist/secrets/secrets.types.js +87 -0
- package/dist/secrets/secrets.types.js.map +1 -0
- package/dist/sessions/index.d.ts +50 -0
- package/dist/sessions/index.js +96 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/sessions/sessions.helper.d.ts +88 -0
- package/dist/sessions/sessions.helper.js +190 -0
- package/dist/sessions/sessions.helper.js.map +1 -0
- package/dist/sessions/sessions.resolver.d.ts +188 -0
- package/dist/sessions/sessions.resolver.js +603 -0
- package/dist/sessions/sessions.resolver.js.map +1 -0
- package/dist/sessions/sessions.service.d.ts +196 -0
- package/dist/sessions/sessions.service.js +993 -0
- package/dist/sessions/sessions.service.js.map +1 -0
- package/dist/sessions/types/index.d.ts +347 -0
- package/dist/sessions/types/index.js +6 -0
- package/dist/sessions/types/index.js.map +1 -0
- package/dist/storage/index.d.ts +66 -0
- package/dist/storage/index.js +99 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/storage.service.d.ts +179 -0
- package/dist/storage/storage.service.js +938 -0
- package/dist/storage/storage.service.js.map +1 -0
- package/dist/storage/types/index.d.ts +273 -0
- package/dist/storage/types/index.js +6 -0
- package/dist/storage/types/index.js.map +1 -0
- package/dist/storage/utils/storage.util.d.ts +62 -0
- package/dist/storage/utils/storage.util.js +623 -0
- package/dist/storage/utils/storage.util.js.map +1 -0
- package/dist/types/actions.types.d.ts +0 -0
- package/dist/types/actions.types.js +1 -0
- package/dist/types/actions.types.js.map +1 -0
- package/dist/types/appBuilder.types.d.ts +316 -0
- package/dist/types/appBuilder.types.js +3 -0
- package/dist/types/appBuilder.types.js.map +1 -0
- package/dist/types/database.types.d.ts +9 -0
- package/dist/types/database.types.js +3 -0
- package/dist/types/database.types.js.map +1 -0
- package/dist/types/enums.d.ts +232 -0
- package/dist/types/enums.js +262 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +29 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.types.d.ts +37 -0
- package/dist/types/index.types.js +18 -0
- package/dist/types/index.types.js.map +1 -0
- package/dist/types/inputs.types.d.ts +114 -0
- package/dist/types/inputs.types.js +44 -0
- package/dist/types/inputs.types.js.map +1 -0
- package/dist/types/logs.types.d.ts +19 -0
- package/dist/types/logs.types.js +8 -0
- package/dist/types/logs.types.js.map +1 -0
- package/dist/types/pricing.types.d.ts +4 -0
- package/dist/types/pricing.types.js +3 -0
- package/dist/types/pricing.types.js.map +1 -0
- package/dist/types/processor.types.d.ts +602 -0
- package/dist/types/processor.types.js +19 -0
- package/dist/types/processor.types.js.map +1 -0
- package/dist/types/productsBuilder.types.d.ts +1583 -0
- package/dist/types/productsBuilder.types.js +303 -0
- package/dist/types/productsBuilder.types.js.map +1 -0
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +1 -0
- package/dist/types/request-tracker.interface.js.map +1 -0
- package/dist/types/requests.types.d.ts +8 -0
- package/dist/types/requests.types.js +3 -0
- package/dist/types/requests.types.js.map +1 -0
- package/dist/types/workspaces.types.d.ts +28 -0
- package/dist/types/workspaces.types.js +4 -0
- package/dist/types/workspaces.types.js.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +109 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/vector/actions/action-manager.d.ts +140 -0
- package/dist/vector/actions/action-manager.js +356 -0
- package/dist/vector/actions/action-manager.js.map +1 -0
- package/dist/vector/adapters/base.adapter.d.ts +169 -0
- package/dist/vector/adapters/base.adapter.js +218 -0
- package/dist/vector/adapters/base.adapter.js.map +1 -0
- package/dist/vector/adapters/index.d.ts +10 -0
- package/dist/vector/adapters/index.js +19 -0
- package/dist/vector/adapters/index.js.map +1 -0
- package/dist/vector/adapters/memory.adapter.d.ts +85 -0
- package/dist/vector/adapters/memory.adapter.js +505 -0
- package/dist/vector/adapters/memory.adapter.js.map +1 -0
- package/dist/vector/adapters/pinecone.adapter.d.ts +52 -0
- package/dist/vector/adapters/pinecone.adapter.js +433 -0
- package/dist/vector/adapters/pinecone.adapter.js.map +1 -0
- package/dist/vector/adapters/qdrant.adapter.d.ts +56 -0
- package/dist/vector/adapters/qdrant.adapter.js +442 -0
- package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
- package/dist/vector/adapters/weaviate.adapter.d.ts +68 -0
- package/dist/vector/adapters/weaviate.adapter.js +661 -0
- package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
- package/dist/vector/index.d.ts +37 -0
- package/dist/vector/index.js +72 -0
- package/dist/vector/index.js.map +1 -0
- package/dist/vector/types/action.interface.d.ts +195 -0
- package/dist/vector/types/action.interface.js +100 -0
- package/dist/vector/types/action.interface.js.map +1 -0
- package/dist/vector/types/connection.interface.d.ts +151 -0
- package/dist/vector/types/connection.interface.js +8 -0
- package/dist/vector/types/connection.interface.js.map +1 -0
- package/dist/vector/types/embedding.interface.d.ts +144 -0
- package/dist/vector/types/embedding.interface.js +8 -0
- package/dist/vector/types/embedding.interface.js.map +1 -0
- package/dist/vector/types/enums.d.ts +104 -0
- package/dist/vector/types/enums.js +113 -0
- package/dist/vector/types/enums.js.map +1 -0
- package/dist/vector/types/index.d.ts +11 -0
- package/dist/vector/types/index.js +23 -0
- package/dist/vector/types/index.js.map +1 -0
- package/dist/vector/types/vector.interface.d.ts +315 -0
- package/dist/vector/types/vector.interface.js +8 -0
- package/dist/vector/types/vector.interface.js.map +1 -0
- package/dist/vector/utils/index.d.ts +7 -0
- package/dist/vector/utils/index.js +13 -0
- package/dist/vector/utils/index.js.map +1 -0
- package/dist/vector/utils/metadata-schema.d.ts +14 -0
- package/dist/vector/utils/metadata-schema.js +79 -0
- package/dist/vector/utils/metadata-schema.js.map +1 -0
- package/dist/vector/utils/vector-error.d.ts +69 -0
- package/dist/vector/utils/vector-error.js +116 -0
- package/dist/vector/utils/vector-error.js.map +1 -0
- package/dist/vector/vector-database.service.d.ts +511 -0
- package/dist/vector/vector-database.service.js +1073 -0
- package/dist/vector/vector-database.service.js.map +1 -0
- package/dist/vector/vector.service.d.ts +283 -0
- package/dist/vector/vector.service.js +544 -0
- package/dist/vector/vector.service.js.map +1 -0
- package/dist/warehouse/executor/index.d.ts +5 -0
- package/dist/warehouse/executor/index.js +12 -0
- package/dist/warehouse/executor/index.js.map +1 -0
- package/dist/warehouse/executor/joins/index.d.ts +5 -0
- package/dist/warehouse/executor/joins/index.js +11 -0
- package/dist/warehouse/executor/joins/index.js.map +1 -0
- package/dist/warehouse/executor/joins/join-executor.d.ts +101 -0
- package/dist/warehouse/executor/joins/join-executor.js +493 -0
- package/dist/warehouse/executor/joins/join-executor.js.map +1 -0
- package/dist/warehouse/executor/joins/semantic-join.d.ts +64 -0
- package/dist/warehouse/executor/joins/semantic-join.js +241 -0
- package/dist/warehouse/executor/joins/semantic-join.js.map +1 -0
- package/dist/warehouse/executor/single-source-executor.d.ts +155 -0
- package/dist/warehouse/executor/single-source-executor.js +573 -0
- package/dist/warehouse/executor/single-source-executor.js.map +1 -0
- package/dist/warehouse/index.d.ts +79 -0
- package/dist/warehouse/index.js +111 -0
- package/dist/warehouse/index.js.map +1 -0
- package/dist/warehouse/parser/index.d.ts +4 -0
- package/dist/warehouse/parser/index.js +10 -0
- package/dist/warehouse/parser/index.js.map +1 -0
- package/dist/warehouse/parser/query-parser.d.ts +181 -0
- package/dist/warehouse/parser/query-parser.js +415 -0
- package/dist/warehouse/parser/query-parser.js.map +1 -0
- package/dist/warehouse/registry/data-source-registry.d.ts +207 -0
- package/dist/warehouse/registry/data-source-registry.js +396 -0
- package/dist/warehouse/registry/data-source-registry.js.map +1 -0
- package/dist/warehouse/registry/index.d.ts +4 -0
- package/dist/warehouse/registry/index.js +9 -0
- package/dist/warehouse/registry/index.js.map +1 -0
- package/dist/warehouse/transactions/index.d.ts +4 -0
- package/dist/warehouse/transactions/index.js +9 -0
- package/dist/warehouse/transactions/index.js.map +1 -0
- package/dist/warehouse/transactions/saga-orchestrator.d.ts +92 -0
- package/dist/warehouse/transactions/saga-orchestrator.js +383 -0
- package/dist/warehouse/transactions/saga-orchestrator.js.map +1 -0
- package/dist/warehouse/types/index.d.ts +9 -0
- package/dist/warehouse/types/index.js +33 -0
- package/dist/warehouse/types/index.js.map +1 -0
- package/dist/warehouse/types/join.interface.d.ts +225 -0
- package/dist/warehouse/types/join.interface.js +87 -0
- package/dist/warehouse/types/join.interface.js.map +1 -0
- package/dist/warehouse/types/query.interface.d.ts +232 -0
- package/dist/warehouse/types/query.interface.js +9 -0
- package/dist/warehouse/types/query.interface.js.map +1 -0
- package/dist/warehouse/types/transaction.interface.d.ts +236 -0
- package/dist/warehouse/types/transaction.interface.js +74 -0
- package/dist/warehouse/types/transaction.interface.js.map +1 -0
- package/dist/warehouse/types/where.interface.d.ts +208 -0
- package/dist/warehouse/types/where.interface.js +89 -0
- package/dist/warehouse/types/where.interface.js.map +1 -0
- package/dist/warehouse/warehouse.service.d.ts +200 -0
- package/dist/warehouse/warehouse.service.js +470 -0
- package/dist/warehouse/warehouse.service.js.map +1 -0
- package/dist/workflows/index.d.ts +30 -0
- package/dist/workflows/index.js +64 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/types/index.d.ts +6 -0
- package/dist/workflows/types/index.js +23 -0
- package/dist/workflows/types/index.js.map +1 -0
- package/dist/workflows/types/workflows.types.d.ts +1095 -0
- package/dist/workflows/types/workflows.types.js +13 -0
- package/dist/workflows/types/workflows.types.js.map +1 -0
- package/dist/workflows/workflow-builder.d.ts +70 -0
- package/dist/workflows/workflow-builder.js +353 -0
- package/dist/workflows/workflow-builder.js.map +1 -0
- package/dist/workflows/workflow-executor.d.ts +289 -0
- package/dist/workflows/workflow-executor.js +2467 -0
- package/dist/workflows/workflow-executor.js.map +1 -0
- package/dist/workflows/workflows.service.d.ts +412 -0
- package/dist/workflows/workflows.service.js +2233 -0
- package/dist/workflows/workflows.service.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,1526 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatabaseService - Main ORM Service Class
|
|
3
|
+
*
|
|
4
|
+
* This is the primary entry point for all database operations in the Ductape SDK.
|
|
5
|
+
* It provides a unified interface for querying, writing, transactions, schema management,
|
|
6
|
+
* migrations, and database actions across multiple database types.
|
|
7
|
+
*
|
|
8
|
+
* Supported databases: PostgreSQL, MySQL, MongoDB, DynamoDB, MariaDB, Cassandra
|
|
9
|
+
*/
|
|
10
|
+
import { IConnectionConfig, IConnectionResult, IConnectionContext, IDatabaseConfig } from './types/connection.interface';
|
|
11
|
+
import { IQueryOptions, IQueryResult, IRawQueryOptions, IRawQueryResult } from './types/query.interface';
|
|
12
|
+
import { IInsertOptions, IInsertResult, IUpdateOptions, IUpdateResult, IDeleteOptions, IDeleteResult, IUpsertOptions, IUpsertResult } from './types/write.interface';
|
|
13
|
+
import { ITransactionOptions, ITransaction, ITransactionCallback } from './types/transaction.interface';
|
|
14
|
+
import { IAggregateOptions, IAggregateResult, ICountOptions, ISumOptions, IAvgOptions, IMinMaxOptions, IGroupByOptions, IGroupByResult } from './types/aggregation.interface';
|
|
15
|
+
import { ICreateTableOptions, ITableDefinition, IAlterTableOperation, ITableSchema, ITableInfo, ICreateIndexOptions, IDropIndexOptions, IListIndexesOptions, IIndexInfo, IIndexStatistics, SimpleFieldType, ISimpleFieldDefinition, ISimpleSchemaDefinition, ISimpleCreateOptions, ISimpleDropOptions, ISimpleIndexOptions } from './types/schema.interface';
|
|
16
|
+
import { IIndexFieldDefinition, IConstraintDefinition as IMigrationConstraintDefinition, IMigration, IMigrationHistory, IMigrationStatusResult, IMigrationResult } from './types/migration.interface';
|
|
17
|
+
import { ISchemaOperationResult } from './schema/schema-manager';
|
|
18
|
+
import { IActionDefinition, IActionCreateOptions, IActionUpdateOptions, IActionExecuteOptions } from './types/action.interface';
|
|
19
|
+
import { BaseAdapter } from './adapters/base.adapter';
|
|
20
|
+
import { TriggerProcessor } from './triggers/trigger-processor';
|
|
21
|
+
import { TriggerEvent, TriggerTiming, TriggerActionType, ITriggerDefinition, ITriggerContext, ITriggerResult } from './types/trigger.interface';
|
|
22
|
+
import { IProductDatabase, IProductDatabaseTrigger } from '../types';
|
|
23
|
+
import type { Redis as IORedisClient } from 'ioredis';
|
|
24
|
+
import { IDBActionDispatchInput, IDBOperationDispatchInput, IDispatchResult } from '../types/processor.types';
|
|
25
|
+
/**
|
|
26
|
+
* Configuration options for DatabaseService initialization
|
|
27
|
+
*/
|
|
28
|
+
export interface IDatabaseServiceConfig {
|
|
29
|
+
/** Workspace ID */
|
|
30
|
+
workspace_id: string;
|
|
31
|
+
/** Public key for authentication */
|
|
32
|
+
public_key: string;
|
|
33
|
+
/** User ID */
|
|
34
|
+
user_id: string;
|
|
35
|
+
/** Authentication token */
|
|
36
|
+
token: string;
|
|
37
|
+
/** Environment type (staging, production, local) */
|
|
38
|
+
env_type: string;
|
|
39
|
+
private_key: string;
|
|
40
|
+
/** Optional Redis client for caching */
|
|
41
|
+
redis_client?: IORedisClient;
|
|
42
|
+
/** Default product tag when omitted from connect/query payloads */
|
|
43
|
+
default_product?: string;
|
|
44
|
+
/** Default environment slug when omitted from connect/query payloads */
|
|
45
|
+
default_env?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Normalized schema snapshot for a database connection context.
|
|
49
|
+
* Used by payload/metadata generation to get full table+column+index context in one call.
|
|
50
|
+
*/
|
|
51
|
+
export interface IDatabaseSchemaSnapshot {
|
|
52
|
+
database: string;
|
|
53
|
+
env: string;
|
|
54
|
+
tables: ITableSchema[];
|
|
55
|
+
generatedAt: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Main Database Service class
|
|
59
|
+
* Provides unified ORM interface for all supported databases
|
|
60
|
+
*/
|
|
61
|
+
export declare class DatabaseService {
|
|
62
|
+
private adapters;
|
|
63
|
+
private connectionContexts;
|
|
64
|
+
private currentContext;
|
|
65
|
+
private adapterFactory;
|
|
66
|
+
private transactionManager;
|
|
67
|
+
private schemaManagers;
|
|
68
|
+
private migrationEngines;
|
|
69
|
+
private actionManager;
|
|
70
|
+
private _privateKey;
|
|
71
|
+
/** Service configuration */
|
|
72
|
+
private config;
|
|
73
|
+
/** ProductBuilder instances cache (keyed by product tag) */
|
|
74
|
+
private productBuilders;
|
|
75
|
+
/** LogService instance for logging operations */
|
|
76
|
+
private logService;
|
|
77
|
+
/** Current product ID for logging */
|
|
78
|
+
private productId;
|
|
79
|
+
/** CacheManager for two-tier caching (Redis + remote) */
|
|
80
|
+
private cacheManager;
|
|
81
|
+
/** Private keys cache for products (keyed by product tag) */
|
|
82
|
+
private privateKeys;
|
|
83
|
+
/** Local cache for cache configurations to avoid repeated API calls (5 minute TTL) */
|
|
84
|
+
private cacheConfigCache;
|
|
85
|
+
/** In-flight connect() promises per contextKey to deduplicate concurrent connects and avoid duplicate logs */
|
|
86
|
+
private connectPromises;
|
|
87
|
+
private runtimeDefaults;
|
|
88
|
+
/**
|
|
89
|
+
* Create a new DatabaseService instance
|
|
90
|
+
* @param config - Optional configuration for authentication and workspace context
|
|
91
|
+
*/
|
|
92
|
+
constructor(config?: IDatabaseServiceConfig & {
|
|
93
|
+
access_key: string;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Get or create a SchemaManager for the given adapter key or current context
|
|
97
|
+
*/
|
|
98
|
+
private getSchemaManager;
|
|
99
|
+
/**
|
|
100
|
+
* Get or create a MigrationEngine for the given adapter key or current context
|
|
101
|
+
*/
|
|
102
|
+
private getMigrationEngine;
|
|
103
|
+
/**
|
|
104
|
+
* Create a new ProductBuilder instance
|
|
105
|
+
*/
|
|
106
|
+
private createNewProductBuilder;
|
|
107
|
+
/**
|
|
108
|
+
* Get or create a ProductBuilder instance for the given product tag
|
|
109
|
+
*/
|
|
110
|
+
private getProductBuilder;
|
|
111
|
+
/**
|
|
112
|
+
* Initialize logging service
|
|
113
|
+
*/
|
|
114
|
+
private initializeLogService;
|
|
115
|
+
/**
|
|
116
|
+
* Create a new ProcessorService instance for job scheduling
|
|
117
|
+
*/
|
|
118
|
+
private createNewProcessor;
|
|
119
|
+
/**
|
|
120
|
+
* Register a new database configuration for a product
|
|
121
|
+
* @param productTag - The product tag
|
|
122
|
+
* @param data - The database configuration data
|
|
123
|
+
*/
|
|
124
|
+
registerDatabase(productTag: string, data: IProductDatabase): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Fetch all databases for a product
|
|
127
|
+
* @param productTag - The product tag
|
|
128
|
+
* @returns Array of database configurations
|
|
129
|
+
*/
|
|
130
|
+
fetchAllDatabases(productTag: string): Promise<IProductDatabase[]>;
|
|
131
|
+
/**
|
|
132
|
+
* Fetch a specific database by tag
|
|
133
|
+
* @param productTag - The product tag
|
|
134
|
+
* @param databaseTag - The database tag
|
|
135
|
+
* @returns The database configuration or null if not found
|
|
136
|
+
*/
|
|
137
|
+
fetchDatabase(productTag: string, databaseTag: string): Promise<IProductDatabase | null>;
|
|
138
|
+
/**
|
|
139
|
+
* Update a database configuration
|
|
140
|
+
* @param productTag - The product tag
|
|
141
|
+
* @param databaseTag - The database tag
|
|
142
|
+
* @param data - The data to update
|
|
143
|
+
*/
|
|
144
|
+
updateDatabase(productTag: string, databaseTag: string, data: Partial<IProductDatabase>): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Create a database trigger
|
|
147
|
+
* @param productTag - The product tag
|
|
148
|
+
* @param data - The trigger configuration
|
|
149
|
+
*/
|
|
150
|
+
createTrigger(productTag: string, data: Partial<IProductDatabaseTrigger>): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Update a database trigger
|
|
153
|
+
* @param productTag - The product tag
|
|
154
|
+
* @param data - The trigger configuration
|
|
155
|
+
*/
|
|
156
|
+
updateTrigger(productTag: string, data: Partial<IProductDatabaseTrigger>): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Fetch a database trigger
|
|
159
|
+
* @param productTag - The product tag
|
|
160
|
+
* @param tag - The trigger tag (format: database_tag:trigger_tag)
|
|
161
|
+
*/
|
|
162
|
+
fetchTrigger(productTag: string, tag: string): Promise<IProductDatabaseTrigger | null>;
|
|
163
|
+
/**
|
|
164
|
+
* Fetch all triggers for a database
|
|
165
|
+
* @param productTag - The product tag
|
|
166
|
+
* @param databaseTag - The database tag
|
|
167
|
+
*/
|
|
168
|
+
fetchTriggers(productTag: string, databaseTag: string): Promise<IProductDatabaseTrigger[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Delete a database trigger
|
|
171
|
+
* @param productTag - The product tag
|
|
172
|
+
* @param tag - The trigger tag (format: database_tag:trigger_tag)
|
|
173
|
+
*/
|
|
174
|
+
deleteTrigger(productTag: string, tag: string): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Get the current service configuration
|
|
177
|
+
*/
|
|
178
|
+
getConfig(): IDatabaseServiceConfig | null;
|
|
179
|
+
/**
|
|
180
|
+
* Validate cache tag exists in product and return cache configuration
|
|
181
|
+
* Uses local in-memory cache to avoid repeated API calls (5 minute TTL)
|
|
182
|
+
*/
|
|
183
|
+
private validateCache;
|
|
184
|
+
/**
|
|
185
|
+
* Update the service configuration (used after auth is complete)
|
|
186
|
+
*/
|
|
187
|
+
updateConfig(config: Partial<IDatabaseServiceConfig>): void;
|
|
188
|
+
/**
|
|
189
|
+
* Get workspace ID from config
|
|
190
|
+
*/
|
|
191
|
+
getWorkspaceId(): string | null;
|
|
192
|
+
/**
|
|
193
|
+
* Get user ID from config
|
|
194
|
+
*/
|
|
195
|
+
getUserId(): string | null;
|
|
196
|
+
/**
|
|
197
|
+
* Get authentication token from config
|
|
198
|
+
*/
|
|
199
|
+
getToken(): string | null;
|
|
200
|
+
/**
|
|
201
|
+
* Get environment type from config
|
|
202
|
+
*/
|
|
203
|
+
getEnvType(): string | null;
|
|
204
|
+
/**
|
|
205
|
+
* Create/register a new database configuration
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* // Persist to product
|
|
209
|
+
* await ductape.database.create({
|
|
210
|
+
* product: 'my-product',
|
|
211
|
+
* name: 'User Database',
|
|
212
|
+
* tag: 'users-db',
|
|
213
|
+
* type: 'postgresql',
|
|
214
|
+
* description: 'Stores user accounts and profiles',
|
|
215
|
+
* envs: [
|
|
216
|
+
* { slug: 'dev', connection_url: 'postgresql://localhost:5432/myapp_dev' },
|
|
217
|
+
* { slug: 'prd', connection_url: 'postgresql://prod-host:5432/myapp_prod' },
|
|
218
|
+
* ],
|
|
219
|
+
* });
|
|
220
|
+
*
|
|
221
|
+
* // Local only (not persisted)
|
|
222
|
+
* await ductape.database.create({
|
|
223
|
+
* name: 'Temp Database',
|
|
224
|
+
* tag: 'temp-db',
|
|
225
|
+
* type: 'postgresql',
|
|
226
|
+
* envs: [{ slug: 'dev', connection_url: 'postgresql://localhost:5432/temp' }],
|
|
227
|
+
* });
|
|
228
|
+
*/
|
|
229
|
+
create(config: IDatabaseConfig): Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Create local adapter and connection context for a database configuration.
|
|
232
|
+
* This is a lightweight operation that only sets up local state without API calls.
|
|
233
|
+
* Use this when the database config is already fetched/decrypted from the API.
|
|
234
|
+
*
|
|
235
|
+
* @param config - The database configuration (already decrypted if from API)
|
|
236
|
+
*/
|
|
237
|
+
private createAdapter;
|
|
238
|
+
/**
|
|
239
|
+
* Generate a secret key for database connection URLs
|
|
240
|
+
* Format: DB_{PRODUCT}_{ASSET_TAG}_{ENV}_{KEY}
|
|
241
|
+
*
|
|
242
|
+
* Where:
|
|
243
|
+
* - PRODUCT = productTag.split('.')[1] (second part after workspace)
|
|
244
|
+
* - ASSET_TAG = if dbTag starts with same workspace prefix, use second part; otherwise sanitize full tag
|
|
245
|
+
* - All parts are automatically capitalized
|
|
246
|
+
*/
|
|
247
|
+
private generateDbSecretKey;
|
|
248
|
+
private resolveRuntimeProductEnv;
|
|
249
|
+
private mergeConnectionConfig;
|
|
250
|
+
/**
|
|
251
|
+
* Connect to a database
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* const result = await ductape.database.connect({
|
|
255
|
+
* env: 'dev',
|
|
256
|
+
* product: 'my-app',
|
|
257
|
+
* database: 'users-db',
|
|
258
|
+
* });
|
|
259
|
+
* console.log('Connected:', result.connected);
|
|
260
|
+
* console.log('Database Version:', result.version);
|
|
261
|
+
* console.log('Latency:', result.latency, 'ms');
|
|
262
|
+
*
|
|
263
|
+
* // With the returned connection object, you can use scoped operations:
|
|
264
|
+
* const db = await ductape.databases.connect({ env: 'dev', product: 'my-app', database: 'users-db' });
|
|
265
|
+
* await db.triggers.create({ tag: 'my-trigger', ... });
|
|
266
|
+
*/
|
|
267
|
+
connect(config: IConnectionConfig): Promise<DatabaseConnection>;
|
|
268
|
+
/**
|
|
269
|
+
* Disconnect any existing connection to this resource from the SDK (shared registry and this instance) before creating a fresh one.
|
|
270
|
+
*/
|
|
271
|
+
private disconnectExistingForResource;
|
|
272
|
+
/**
|
|
273
|
+
* Get or create adapter/context, connect, and register in shared registry.
|
|
274
|
+
* Only used when connect() is scoped with workspace_id and product (no cross-tenant sharing).
|
|
275
|
+
*/
|
|
276
|
+
private connectAndRegisterShared;
|
|
277
|
+
/**
|
|
278
|
+
* Performs the actual connect (resolve URL, adapter.connect(), log). Called once per contextKey when not already connected.
|
|
279
|
+
*/
|
|
280
|
+
private runConnect;
|
|
281
|
+
/**
|
|
282
|
+
* Test database connection without establishing persistent connection
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* const result = await ductape.database.testConnection({
|
|
286
|
+
* env: 'dev',
|
|
287
|
+
* product: 'my-app',
|
|
288
|
+
* database: 'users-db',
|
|
289
|
+
* });
|
|
290
|
+
* if (result.connected) {
|
|
291
|
+
* console.log('Connection successful!');
|
|
292
|
+
* } else {
|
|
293
|
+
* console.error('Connection failed:', result.error);
|
|
294
|
+
* }
|
|
295
|
+
*/
|
|
296
|
+
testConnection(config: IConnectionConfig): Promise<IConnectionResult>;
|
|
297
|
+
/**
|
|
298
|
+
* Disconnect from the current database
|
|
299
|
+
*/
|
|
300
|
+
disconnect(): Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Close all database connections
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* await ductape.database.closeAll();
|
|
306
|
+
*/
|
|
307
|
+
closeAll(): Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
* Fetch all registered databases
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* const databases = await ductape.database.fetchAll();
|
|
313
|
+
* databases.forEach((db) => {
|
|
314
|
+
* console.log(`${db.name} (${db.tag}): ${db.type}`);
|
|
315
|
+
* });
|
|
316
|
+
*/
|
|
317
|
+
fetchAll(product: string): Promise<IDatabaseConfig[]>;
|
|
318
|
+
/**
|
|
319
|
+
* Fetch a specific database configuration
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* const usersDb = await ductape.database.fetch('users-db');
|
|
323
|
+
* console.log('Database:', usersDb.name);
|
|
324
|
+
* console.log('Type:', usersDb.type);
|
|
325
|
+
* console.log('Environments:', usersDb.envs);
|
|
326
|
+
*/
|
|
327
|
+
fetch(product: string, database: string): Promise<IDatabaseConfig | null>;
|
|
328
|
+
/**
|
|
329
|
+
* Update a local database configuration
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* await ductape.database.updateLocalConfig('users-db', {
|
|
333
|
+
* name: 'User Database v2',
|
|
334
|
+
* description: 'Updated user storage',
|
|
335
|
+
* envs: [
|
|
336
|
+
* { slug: 'dev', connection_url: 'postgresql://new-dev-host:5432/myapp' },
|
|
337
|
+
* ],
|
|
338
|
+
* });
|
|
339
|
+
*/
|
|
340
|
+
updateLocalConfig(tag: string, updates: Partial<IDatabaseConfig>): Promise<void>;
|
|
341
|
+
/**
|
|
342
|
+
* Query records from a table
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* // With established connection
|
|
346
|
+
* const result = await ductape.database.query({
|
|
347
|
+
* table: 'users',
|
|
348
|
+
* where: { status: 'active' },
|
|
349
|
+
* orderBy: { column: 'created_at', order: 'DESC' },
|
|
350
|
+
* limit: 10,
|
|
351
|
+
* });
|
|
352
|
+
*
|
|
353
|
+
* // With explicit connection params
|
|
354
|
+
* const result = await ductape.database.query({
|
|
355
|
+
* env: 'prd',
|
|
356
|
+
* product: 'my-app',
|
|
357
|
+
* database: 'main-db',
|
|
358
|
+
* table: 'users',
|
|
359
|
+
* });
|
|
360
|
+
*/
|
|
361
|
+
query<T = any>(options: IQueryOptions): Promise<IQueryResult<T>>;
|
|
362
|
+
/**
|
|
363
|
+
* Execute a raw query
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* // PostgreSQL
|
|
367
|
+
* const result = await ductape.database.raw({
|
|
368
|
+
* query: 'SELECT * FROM users WHERE created_at > $1 AND status = $2',
|
|
369
|
+
* params: [new Date('2024-01-01'), 'active'],
|
|
370
|
+
* });
|
|
371
|
+
*
|
|
372
|
+
* // MySQL
|
|
373
|
+
* const result = await ductape.database.raw({
|
|
374
|
+
* query: 'SELECT * FROM users WHERE created_at > ? AND status = ?',
|
|
375
|
+
* params: [new Date('2024-01-01'), 'active'],
|
|
376
|
+
* });
|
|
377
|
+
*
|
|
378
|
+
* // MongoDB
|
|
379
|
+
* const result = await ductape.database.raw({
|
|
380
|
+
* query: { status: 'active', created_at: { $gte: new Date('2024-01-01') } },
|
|
381
|
+
* collection: 'users',
|
|
382
|
+
* });
|
|
383
|
+
*/
|
|
384
|
+
raw<T = any>(options: IRawQueryOptions): Promise<IRawQueryResult<T>>;
|
|
385
|
+
/**
|
|
386
|
+
* Insert one or more records
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* // Single record
|
|
390
|
+
* const result = await ductape.database.insert({
|
|
391
|
+
* table: 'users',
|
|
392
|
+
* data: {
|
|
393
|
+
* name: 'Jane Doe',
|
|
394
|
+
* email: 'jane@example.com',
|
|
395
|
+
* status: 'active',
|
|
396
|
+
* },
|
|
397
|
+
* returning: true,
|
|
398
|
+
* });
|
|
399
|
+
*
|
|
400
|
+
* // Multiple records
|
|
401
|
+
* const result = await ductape.database.insert({
|
|
402
|
+
* table: 'users',
|
|
403
|
+
* data: [
|
|
404
|
+
* { name: 'User 1', email: 'user1@example.com' },
|
|
405
|
+
* { name: 'User 2', email: 'user2@example.com' },
|
|
406
|
+
* ],
|
|
407
|
+
* });
|
|
408
|
+
*
|
|
409
|
+
* // With conflict handling (upsert)
|
|
410
|
+
* const result = await ductape.database.insert({
|
|
411
|
+
* table: 'users',
|
|
412
|
+
* data: { email: 'john@example.com', name: 'John' },
|
|
413
|
+
* onConflict: {
|
|
414
|
+
* columns: ['email'],
|
|
415
|
+
* action: 'update',
|
|
416
|
+
* update: ['name'],
|
|
417
|
+
* },
|
|
418
|
+
* });
|
|
419
|
+
*/
|
|
420
|
+
insert<T = any>(options: IInsertOptions): Promise<IInsertResult<T>>;
|
|
421
|
+
/**
|
|
422
|
+
* Update records matching conditions
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* // Simple update
|
|
426
|
+
* const result = await ductape.database.update({
|
|
427
|
+
* table: 'users',
|
|
428
|
+
* data: { status: 'inactive' },
|
|
429
|
+
* where: { last_login: { $LT: new Date('2023-01-01') } },
|
|
430
|
+
* });
|
|
431
|
+
*
|
|
432
|
+
* // With increment/decrement
|
|
433
|
+
* await ductape.database.update({
|
|
434
|
+
* table: 'products',
|
|
435
|
+
* data: { stock: { $inc: 10 } },
|
|
436
|
+
* where: { id: productId },
|
|
437
|
+
* });
|
|
438
|
+
*/
|
|
439
|
+
update<T = any>(options: IUpdateOptions): Promise<IUpdateResult<T>>;
|
|
440
|
+
/**
|
|
441
|
+
* Delete records matching conditions
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* const result = await ductape.database.delete({
|
|
445
|
+
* table: 'users',
|
|
446
|
+
* where: { status: 'deleted' },
|
|
447
|
+
* });
|
|
448
|
+
* console.log('Deleted count:', result.count);
|
|
449
|
+
*/
|
|
450
|
+
delete(options: IDeleteOptions): Promise<IDeleteResult>;
|
|
451
|
+
/**
|
|
452
|
+
* Insert or update a record based on conflict keys
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* const result = await ductape.database.upsert({
|
|
456
|
+
* table: 'user_preferences',
|
|
457
|
+
* data: {
|
|
458
|
+
* user_id: 123,
|
|
459
|
+
* theme: 'dark',
|
|
460
|
+
* language: 'en',
|
|
461
|
+
* },
|
|
462
|
+
* conflictKeys: ['user_id'],
|
|
463
|
+
* });
|
|
464
|
+
* console.log('Operation:', result.operation); // 'inserted' or 'updated'
|
|
465
|
+
*/
|
|
466
|
+
upsert<T = any>(options: IUpsertOptions): Promise<IUpsertResult<T>>;
|
|
467
|
+
/**
|
|
468
|
+
* Count records
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* const count = await ductape.database.count({
|
|
472
|
+
* table: 'users',
|
|
473
|
+
* where: { status: 'active' },
|
|
474
|
+
* });
|
|
475
|
+
*/
|
|
476
|
+
count(options: ICountOptions): Promise<number>;
|
|
477
|
+
/**
|
|
478
|
+
* Sum values of a column
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* const totalRevenue = await ductape.database.sum({
|
|
482
|
+
* table: 'orders',
|
|
483
|
+
* column: 'total',
|
|
484
|
+
* where: { status: 'completed' },
|
|
485
|
+
* });
|
|
486
|
+
*/
|
|
487
|
+
sum(options: ISumOptions): Promise<number>;
|
|
488
|
+
/**
|
|
489
|
+
* Calculate average of a column
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* const avgOrderValue = await ductape.database.avg({
|
|
493
|
+
* table: 'orders',
|
|
494
|
+
* column: 'total',
|
|
495
|
+
* });
|
|
496
|
+
*/
|
|
497
|
+
avg(options: IAvgOptions): Promise<number>;
|
|
498
|
+
/**
|
|
499
|
+
* Get minimum value of a column
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* const minPrice = await ductape.database.min({
|
|
503
|
+
* table: 'products',
|
|
504
|
+
* column: 'price',
|
|
505
|
+
* });
|
|
506
|
+
*/
|
|
507
|
+
min(options: IMinMaxOptions): Promise<any>;
|
|
508
|
+
/**
|
|
509
|
+
* Get maximum value of a column
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* const maxPrice = await ductape.database.max({
|
|
513
|
+
* table: 'products',
|
|
514
|
+
* column: 'price',
|
|
515
|
+
* });
|
|
516
|
+
*/
|
|
517
|
+
max(options: IMinMaxOptions): Promise<any>;
|
|
518
|
+
/**
|
|
519
|
+
* Perform multiple aggregations in one query
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* const stats = await ductape.database.aggregate({
|
|
523
|
+
* table: 'orders',
|
|
524
|
+
* operations: {
|
|
525
|
+
* total_revenue: { $SUM: 'total' },
|
|
526
|
+
* order_count: { $COUNT: '*' },
|
|
527
|
+
* avg_order_value: { $AVG: 'total' },
|
|
528
|
+
* },
|
|
529
|
+
* where: { status: 'completed' },
|
|
530
|
+
* });
|
|
531
|
+
*/
|
|
532
|
+
aggregate(options: IAggregateOptions): Promise<IAggregateResult>;
|
|
533
|
+
/**
|
|
534
|
+
* Group records and perform aggregations
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
* const salesByCategory = await ductape.database.groupBy({
|
|
538
|
+
* table: 'products',
|
|
539
|
+
* groupBy: ['category'],
|
|
540
|
+
* operations: {
|
|
541
|
+
* total_sales: { $SUM: 'sales_count' },
|
|
542
|
+
* avg_price: { $AVG: 'price' },
|
|
543
|
+
* },
|
|
544
|
+
* having: {
|
|
545
|
+
* total_sales: { $GT: 100 },
|
|
546
|
+
* },
|
|
547
|
+
* });
|
|
548
|
+
*/
|
|
549
|
+
groupBy<T = any>(options: IGroupByOptions): Promise<IGroupByResult<T>[]>;
|
|
550
|
+
/**
|
|
551
|
+
* Execute operations within a transaction (callback API - recommended)
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* const order = await ductape.database.transaction({
|
|
555
|
+
* env: 'prd',
|
|
556
|
+
* product: 'my-app',
|
|
557
|
+
* database: 'main-db',
|
|
558
|
+
* }, async (transaction) => {
|
|
559
|
+
* const order = await ductape.database.insert({
|
|
560
|
+
* table: 'orders',
|
|
561
|
+
* data: { customer_id: 123, total: 99.99 },
|
|
562
|
+
* transaction,
|
|
563
|
+
* });
|
|
564
|
+
*
|
|
565
|
+
* await ductape.database.insert({
|
|
566
|
+
* table: 'order_items',
|
|
567
|
+
* data: items.map(item => ({ order_id: order.insertedIds[0], ...item })),
|
|
568
|
+
* transaction,
|
|
569
|
+
* });
|
|
570
|
+
*
|
|
571
|
+
* return order;
|
|
572
|
+
* });
|
|
573
|
+
*/
|
|
574
|
+
transaction<T>(options: ITransactionOptions, callback: ITransactionCallback<T>): Promise<T>;
|
|
575
|
+
/**
|
|
576
|
+
* Begin a transaction manually
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* const transaction = await ductape.database.beginTransaction({
|
|
580
|
+
* env: 'prd',
|
|
581
|
+
* product: 'my-app',
|
|
582
|
+
* database: 'main-db',
|
|
583
|
+
* isolationLevel: 'REPEATABLE_READ',
|
|
584
|
+
* });
|
|
585
|
+
*
|
|
586
|
+
* try {
|
|
587
|
+
* await ductape.database.insert({ table: 'accounts', data: {...}, transaction });
|
|
588
|
+
* await transaction.commit();
|
|
589
|
+
* } catch (error) {
|
|
590
|
+
* await transaction.rollback();
|
|
591
|
+
* throw error;
|
|
592
|
+
* }
|
|
593
|
+
*/
|
|
594
|
+
beginTransaction(options: ITransactionOptions): Promise<ITransaction>;
|
|
595
|
+
/**
|
|
596
|
+
* Create a new table
|
|
597
|
+
*
|
|
598
|
+
* @example
|
|
599
|
+
* import { SchemaHelpers } from '@ductape/sdk';
|
|
600
|
+
*
|
|
601
|
+
* await ductape.database.createTable(
|
|
602
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
603
|
+
* {
|
|
604
|
+
* name: 'products',
|
|
605
|
+
* columns: [
|
|
606
|
+
* SchemaHelpers.id(),
|
|
607
|
+
* SchemaHelpers.string('name', 255, false),
|
|
608
|
+
* SchemaHelpers.decimal('price', 10, 2),
|
|
609
|
+
* ...SchemaHelpers.timestamps(),
|
|
610
|
+
* ],
|
|
611
|
+
* },
|
|
612
|
+
* { ifNotExists: true }
|
|
613
|
+
* );
|
|
614
|
+
*/
|
|
615
|
+
createTable(connectionConfigOrDefinition: IConnectionConfig | ITableDefinition, tableDefinitionOrOptions?: ITableDefinition | ICreateTableOptions, options?: ICreateTableOptions): Promise<void>;
|
|
616
|
+
/**
|
|
617
|
+
* Alter an existing table
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* import { ColumnAlterationType, ColumnType } from '@ductape/sdk';
|
|
621
|
+
*
|
|
622
|
+
* // Add column
|
|
623
|
+
* await ductape.database.alterTable(
|
|
624
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
625
|
+
* 'products',
|
|
626
|
+
* [{ type: ColumnAlterationType.ADD, column: { name: 'sku', type: ColumnType.STRING, length: 50 } }]
|
|
627
|
+
* );
|
|
628
|
+
*
|
|
629
|
+
* // Drop column
|
|
630
|
+
* await ductape.database.alterTable(
|
|
631
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
632
|
+
* 'products',
|
|
633
|
+
* [{ type: ColumnAlterationType.DROP, columnName: 'old_field' }]
|
|
634
|
+
* );
|
|
635
|
+
*
|
|
636
|
+
* // Rename column
|
|
637
|
+
* await ductape.database.alterTable(
|
|
638
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
639
|
+
* 'products',
|
|
640
|
+
* [{ type: ColumnAlterationType.RENAME, oldName: 'old_name', newName: 'new_name' }]
|
|
641
|
+
* );
|
|
642
|
+
*/
|
|
643
|
+
alterTable(connectionConfigOrTableName: IConnectionConfig | string, tableNameOrAlterations: string | IAlterTableOperation[], alterations?: IAlterTableOperation[]): Promise<void>;
|
|
644
|
+
/**
|
|
645
|
+
* Drop a table
|
|
646
|
+
*
|
|
647
|
+
* @example
|
|
648
|
+
* await ductape.database.dropTable(
|
|
649
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
650
|
+
* 'old_table'
|
|
651
|
+
* );
|
|
652
|
+
*/
|
|
653
|
+
dropTable(connectionConfigOrTableName: IConnectionConfig | string, tableName?: string): Promise<void>;
|
|
654
|
+
/**
|
|
655
|
+
* List all tables in the database
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* const tables = await ductape.database.listTables({
|
|
659
|
+
* env: 'dev',
|
|
660
|
+
* product: 'my-app',
|
|
661
|
+
* database: 'main-db',
|
|
662
|
+
* });
|
|
663
|
+
*/
|
|
664
|
+
listTables(connectionConfig?: IConnectionConfig): Promise<string[]>;
|
|
665
|
+
/**
|
|
666
|
+
* List all tables with basic information including estimated row counts
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
* const tables = await ductape.database.listTablesWithInfo({
|
|
670
|
+
* env: 'dev',
|
|
671
|
+
* product: 'my-app',
|
|
672
|
+
* database: 'main-db',
|
|
673
|
+
* });
|
|
674
|
+
* // Returns: [{ name: 'users', estimatedRowCount: 1247, schema: 'public' }, ...]
|
|
675
|
+
*/
|
|
676
|
+
listTablesWithInfo(connectionConfig?: IConnectionConfig): Promise<ITableInfo[]>;
|
|
677
|
+
/**
|
|
678
|
+
* Check if a table exists
|
|
679
|
+
*
|
|
680
|
+
* @example
|
|
681
|
+
* const exists = await ductape.database.tableExists(
|
|
682
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
683
|
+
* 'users'
|
|
684
|
+
* );
|
|
685
|
+
*/
|
|
686
|
+
tableExists(connectionConfigOrTableName: IConnectionConfig | string, tableName?: string): Promise<boolean>;
|
|
687
|
+
/**
|
|
688
|
+
* Get the schema of a table
|
|
689
|
+
*
|
|
690
|
+
* @example
|
|
691
|
+
* const schema = await ductape.database.getTableSchema(
|
|
692
|
+
* { env: 'dev', product: 'my-app', database: 'main-db' },
|
|
693
|
+
* 'users'
|
|
694
|
+
* );
|
|
695
|
+
* console.log('Table:', schema.name);
|
|
696
|
+
* console.log('Columns:', schema.columns);
|
|
697
|
+
* console.log('Indexes:', schema.indexes);
|
|
698
|
+
*/
|
|
699
|
+
getTableSchema(connectionConfigOrTableName: IConnectionConfig | string, tableName?: string): Promise<ITableSchema>;
|
|
700
|
+
/**
|
|
701
|
+
* Create an index
|
|
702
|
+
*
|
|
703
|
+
* @example
|
|
704
|
+
* await ductape.database.createIndex({
|
|
705
|
+
* env: 'dev',
|
|
706
|
+
* product: 'my-app',
|
|
707
|
+
* database: 'main-db',
|
|
708
|
+
* table: 'users',
|
|
709
|
+
* index: {
|
|
710
|
+
* name: 'idx_users_email',
|
|
711
|
+
* table: 'users',
|
|
712
|
+
* columns: [{ name: 'email' }],
|
|
713
|
+
* unique: true,
|
|
714
|
+
* },
|
|
715
|
+
* ifNotExists: true,
|
|
716
|
+
* concurrent: true, // PostgreSQL: create without locking
|
|
717
|
+
* });
|
|
718
|
+
*/
|
|
719
|
+
createIndex(options: ICreateIndexOptions): Promise<void>;
|
|
720
|
+
/**
|
|
721
|
+
* Drop an index
|
|
722
|
+
*
|
|
723
|
+
* @example
|
|
724
|
+
* await ductape.database.dropIndex({
|
|
725
|
+
* env: 'dev',
|
|
726
|
+
* product: 'my-app',
|
|
727
|
+
* database: 'main-db',
|
|
728
|
+
* table: 'users',
|
|
729
|
+
* indexName: 'idx_users_old',
|
|
730
|
+
* ifExists: true,
|
|
731
|
+
* concurrent: true,
|
|
732
|
+
* });
|
|
733
|
+
*/
|
|
734
|
+
dropIndex(options: IDropIndexOptions): Promise<void>;
|
|
735
|
+
/**
|
|
736
|
+
* List all indexes on a table
|
|
737
|
+
*
|
|
738
|
+
* @example
|
|
739
|
+
* const indexes = await ductape.database.listIndexes({
|
|
740
|
+
* env: 'dev',
|
|
741
|
+
* product: 'my-app',
|
|
742
|
+
* database: 'main-db',
|
|
743
|
+
* table: 'users',
|
|
744
|
+
* includeSystem: false,
|
|
745
|
+
* });
|
|
746
|
+
*/
|
|
747
|
+
listIndexes(options: IListIndexesOptions): Promise<IIndexInfo[]>;
|
|
748
|
+
/**
|
|
749
|
+
* Get index statistics
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* // All indexes on a table
|
|
753
|
+
* const stats = await ductape.database.getIndexStatistics(
|
|
754
|
+
* { env: 'prd', product: 'my-app', database: 'main-db' },
|
|
755
|
+
* 'users'
|
|
756
|
+
* );
|
|
757
|
+
*
|
|
758
|
+
* // Specific index
|
|
759
|
+
* const emailStats = await ductape.database.getIndexStatistics(
|
|
760
|
+
* { env: 'prd', product: 'my-app', database: 'main-db' },
|
|
761
|
+
* 'users',
|
|
762
|
+
* 'idx_users_email'
|
|
763
|
+
* );
|
|
764
|
+
*/
|
|
765
|
+
getIndexStatistics(connectionConfig: IConnectionConfig, tableName: string, indexName?: string): Promise<IIndexStatistics[]>;
|
|
766
|
+
/**
|
|
767
|
+
* Get a normalized schema snapshot for the given database/env context.
|
|
768
|
+
*
|
|
769
|
+
* @example
|
|
770
|
+
* const snapshot = await ductape.database.getSchemaSnapshot({
|
|
771
|
+
* env: 'prd',
|
|
772
|
+
* product: 'my-product',
|
|
773
|
+
* database: 'main-db',
|
|
774
|
+
* });
|
|
775
|
+
*/
|
|
776
|
+
getSchemaSnapshot(connectionConfig: IConnectionConfig, options?: {
|
|
777
|
+
includeTables?: string[];
|
|
778
|
+
}): Promise<IDatabaseSchemaSnapshot>;
|
|
779
|
+
/**
|
|
780
|
+
* Run a migration
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* const result = await ductape.database.runMigration([migration]);
|
|
784
|
+
* console.log('Migrated:', result.size);
|
|
785
|
+
*/
|
|
786
|
+
runMigration(migrations: IMigration[], options?: {
|
|
787
|
+
dryRun?: boolean;
|
|
788
|
+
appliedBy?: string;
|
|
789
|
+
}): Promise<Map<string, IMigrationResult>>;
|
|
790
|
+
/**
|
|
791
|
+
* Rollback migrations
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
* const result = await ductape.database.rollbackMigration([migration], 1);
|
|
795
|
+
* console.log('Rolled back:', result.size);
|
|
796
|
+
*/
|
|
797
|
+
rollbackMigration(migrations: IMigration[], count?: number): Promise<Map<string, IMigrationResult>>;
|
|
798
|
+
/**
|
|
799
|
+
* Get migration history (applied migrations)
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* const history = await ductape.database.getMigrationHistory();
|
|
803
|
+
* history.forEach((entry) => {
|
|
804
|
+
* console.log('Tag:', entry.tag);
|
|
805
|
+
* console.log('Applied at:', entry.appliedAt);
|
|
806
|
+
* });
|
|
807
|
+
*/
|
|
808
|
+
getMigrationHistory(): Promise<IMigrationHistory[]>;
|
|
809
|
+
/**
|
|
810
|
+
* Get status of all migrations
|
|
811
|
+
*
|
|
812
|
+
* @example
|
|
813
|
+
* const status = await ductape.database.getMigrationStatus(allMigrations);
|
|
814
|
+
* console.log('Pending:', status.pending);
|
|
815
|
+
*/
|
|
816
|
+
getMigrationStatus(migrations: IMigration[]): Promise<IMigrationStatusResult>;
|
|
817
|
+
/**
|
|
818
|
+
* Migration management sub-object
|
|
819
|
+
* Provides CRUD operations for database migrations via ProductBuilder
|
|
820
|
+
*/
|
|
821
|
+
get migration(): {
|
|
822
|
+
/**
|
|
823
|
+
* Create a new database migration
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* await ductape.database.migration.create({
|
|
827
|
+
* product: 'my-product',
|
|
828
|
+
* database: 'main-db',
|
|
829
|
+
* data: {
|
|
830
|
+
* name: 'Add users table',
|
|
831
|
+
* tag: 'main-db:add-users-table',
|
|
832
|
+
* value: {
|
|
833
|
+
* up: ['CREATE TABLE users (id SERIAL PRIMARY KEY, email VARCHAR(255))'],
|
|
834
|
+
* down: ['DROP TABLE users'],
|
|
835
|
+
* },
|
|
836
|
+
* },
|
|
837
|
+
* });
|
|
838
|
+
*/
|
|
839
|
+
create: (options: {
|
|
840
|
+
product: string;
|
|
841
|
+
database: string;
|
|
842
|
+
data: {
|
|
843
|
+
name: string;
|
|
844
|
+
tag: string;
|
|
845
|
+
description?: string;
|
|
846
|
+
value: {
|
|
847
|
+
up: string[];
|
|
848
|
+
down: string[];
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
}) => Promise<void>;
|
|
852
|
+
/**
|
|
853
|
+
* Update an existing database migration
|
|
854
|
+
*
|
|
855
|
+
* @example
|
|
856
|
+
* await ductape.database.migration.update({
|
|
857
|
+
* product: 'my-product',
|
|
858
|
+
* tag: 'main-db:add-users-table',
|
|
859
|
+
* data: {
|
|
860
|
+
* description: 'Updated description',
|
|
861
|
+
* },
|
|
862
|
+
* });
|
|
863
|
+
*/
|
|
864
|
+
update: (options: {
|
|
865
|
+
product: string;
|
|
866
|
+
tag: string;
|
|
867
|
+
data: {
|
|
868
|
+
name?: string;
|
|
869
|
+
description?: string;
|
|
870
|
+
value?: {
|
|
871
|
+
up: string[];
|
|
872
|
+
down: string[];
|
|
873
|
+
};
|
|
874
|
+
};
|
|
875
|
+
}) => Promise<void>;
|
|
876
|
+
/**
|
|
877
|
+
* Fetch a specific database migration
|
|
878
|
+
*
|
|
879
|
+
* @example
|
|
880
|
+
* const migration = await ductape.database.migration.fetch({
|
|
881
|
+
* product: 'my-product',
|
|
882
|
+
* tag: 'main-db:add-users-table',
|
|
883
|
+
* });
|
|
884
|
+
*/
|
|
885
|
+
fetch: (options: {
|
|
886
|
+
product: string;
|
|
887
|
+
tag: string;
|
|
888
|
+
}) => Promise<any>;
|
|
889
|
+
/**
|
|
890
|
+
* Fetch all database migrations for a database
|
|
891
|
+
*
|
|
892
|
+
* @example
|
|
893
|
+
* const migrations = await ductape.database.migration.fetchAll({
|
|
894
|
+
* product: 'my-product',
|
|
895
|
+
* database: 'main-db',
|
|
896
|
+
* });
|
|
897
|
+
*/
|
|
898
|
+
fetchAll: (options: {
|
|
899
|
+
product: string;
|
|
900
|
+
database: string;
|
|
901
|
+
}) => Promise<any[]>;
|
|
902
|
+
/**
|
|
903
|
+
* Delete a database migration
|
|
904
|
+
*
|
|
905
|
+
* @example
|
|
906
|
+
* await ductape.database.migration.delete({
|
|
907
|
+
* product: 'my-product',
|
|
908
|
+
* tag: 'main-db:add-users-table',
|
|
909
|
+
* });
|
|
910
|
+
*/
|
|
911
|
+
delete: (options: {
|
|
912
|
+
product: string;
|
|
913
|
+
tag: string;
|
|
914
|
+
}) => Promise<void>;
|
|
915
|
+
/**
|
|
916
|
+
* Run a database migration (up)
|
|
917
|
+
* @deprecated Migration execution has been deprecated
|
|
918
|
+
*/
|
|
919
|
+
run: (_options: {
|
|
920
|
+
product: string;
|
|
921
|
+
migration: string;
|
|
922
|
+
env: string;
|
|
923
|
+
}) => Promise<any>;
|
|
924
|
+
/**
|
|
925
|
+
* Rollback a database migration (down)
|
|
926
|
+
* @deprecated Migration execution has been deprecated
|
|
927
|
+
*/
|
|
928
|
+
rollback: (_options: {
|
|
929
|
+
product: string;
|
|
930
|
+
migration: string;
|
|
931
|
+
env: string;
|
|
932
|
+
}) => Promise<any>;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* Action management sub-object
|
|
936
|
+
*/
|
|
937
|
+
get action(): {
|
|
938
|
+
/**
|
|
939
|
+
* Create a new database action
|
|
940
|
+
*
|
|
941
|
+
* @example
|
|
942
|
+
* await ductape.database.action.create({
|
|
943
|
+
* name: 'Get Users Paginated',
|
|
944
|
+
* tag: 'postgresdb:get-users-paginated',
|
|
945
|
+
* tableName: 'users',
|
|
946
|
+
* operation: DatabaseActionTypes.QUERY,
|
|
947
|
+
* template: {
|
|
948
|
+
* where: { is_active: true },
|
|
949
|
+
* limit: '{{limit}}',
|
|
950
|
+
* offset: '{{offset}}',
|
|
951
|
+
* },
|
|
952
|
+
* });
|
|
953
|
+
*/
|
|
954
|
+
create: (options: IActionCreateOptions) => Promise<void>;
|
|
955
|
+
/**
|
|
956
|
+
* Update an existing action
|
|
957
|
+
*
|
|
958
|
+
* @example
|
|
959
|
+
* await ductape.database.action.update({
|
|
960
|
+
* tag: 'postgresdb:get-users',
|
|
961
|
+
* template: { where: { status: '{{status}}' } },
|
|
962
|
+
* });
|
|
963
|
+
*/
|
|
964
|
+
update: (options: IActionUpdateOptions) => Promise<void>;
|
|
965
|
+
/**
|
|
966
|
+
* Fetch a specific action
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
* const action = await ductape.database.action.fetch('postgresdb:get-users');
|
|
970
|
+
*/
|
|
971
|
+
fetch: (tag: string) => Promise<IActionDefinition | null>;
|
|
972
|
+
/**
|
|
973
|
+
* Fetch all actions for a database
|
|
974
|
+
*
|
|
975
|
+
* @example
|
|
976
|
+
* const actions = await ductape.database.action.fetchAll('postgresdb');
|
|
977
|
+
*/
|
|
978
|
+
fetchAll: (databaseTag: string) => Promise<IActionDefinition[]>;
|
|
979
|
+
/**
|
|
980
|
+
* Delete a database action
|
|
981
|
+
*
|
|
982
|
+
* @example
|
|
983
|
+
* await ductape.database.action.delete('postgresdb:get-users');
|
|
984
|
+
*/
|
|
985
|
+
delete: (tag: string) => Promise<void>;
|
|
986
|
+
/**
|
|
987
|
+
* Dispatches a database action to run as a scheduled job.
|
|
988
|
+
* @param {IDBActionDispatchInput} data - The database action dispatch input.
|
|
989
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
990
|
+
* @example
|
|
991
|
+
* // Schedule a database action to run in 1 hour
|
|
992
|
+
* await ductape.databases.action.dispatch({
|
|
993
|
+
* product: 'my-product',
|
|
994
|
+
* env: 'production',
|
|
995
|
+
* database: 'users-db',
|
|
996
|
+
* event: 'cleanup-inactive',
|
|
997
|
+
* input: { query: { inactive: true } },
|
|
998
|
+
* schedule: { start_at: Date.now() + 3600000 }
|
|
999
|
+
* });
|
|
1000
|
+
*
|
|
1001
|
+
* // Run on a cron schedule
|
|
1002
|
+
* await ductape.databases.action.dispatch({
|
|
1003
|
+
* product: 'my-product',
|
|
1004
|
+
* env: 'production',
|
|
1005
|
+
* database: 'analytics-db',
|
|
1006
|
+
* event: 'aggregate-daily',
|
|
1007
|
+
* input: { query: {} },
|
|
1008
|
+
* schedule: { cron: '0 0 * * *' } // Daily at midnight
|
|
1009
|
+
* });
|
|
1010
|
+
*/
|
|
1011
|
+
dispatch: (data: IDBActionDispatchInput) => Promise<IDispatchResult>;
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* Execute a database action
|
|
1015
|
+
*
|
|
1016
|
+
* @example
|
|
1017
|
+
* const users = await ductape.database.execute({
|
|
1018
|
+
* product: 'my-product',
|
|
1019
|
+
* env: 'prd',
|
|
1020
|
+
* database: 'postgresdb',
|
|
1021
|
+
* action: 'get-users-paginated',
|
|
1022
|
+
* input: {
|
|
1023
|
+
* limit: 25,
|
|
1024
|
+
* offset: 0,
|
|
1025
|
+
* },
|
|
1026
|
+
* });
|
|
1027
|
+
*/
|
|
1028
|
+
execute<T = any>(options: IActionExecuteOptions): Promise<T>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Dispatches a database operation to run as a scheduled job.
|
|
1031
|
+
* Use this for direct database operations (query, insert, update, delete, etc.).
|
|
1032
|
+
* @param {IDBOperationDispatchInput} data - The database operation dispatch input.
|
|
1033
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
1034
|
+
* @example
|
|
1035
|
+
* // Schedule a database operation to run in 1 hour
|
|
1036
|
+
* await ductape.databases.dispatch({
|
|
1037
|
+
* product: 'my-product',
|
|
1038
|
+
* env: 'production',
|
|
1039
|
+
* database: 'users-db',
|
|
1040
|
+
* operation: 'deleteMany',
|
|
1041
|
+
* input: { filter: { inactive: true, lastLogin: { $lt: '2024-01-01' } } },
|
|
1042
|
+
* schedule: { start_at: Date.now() + 3600000 }
|
|
1043
|
+
* });
|
|
1044
|
+
*
|
|
1045
|
+
* // Run daily database cleanup
|
|
1046
|
+
* await ductape.databases.dispatch({
|
|
1047
|
+
* product: 'my-product',
|
|
1048
|
+
* env: 'production',
|
|
1049
|
+
* database: 'logs-db',
|
|
1050
|
+
* operation: 'deleteMany',
|
|
1051
|
+
* input: { filter: { createdAt: { $lt: '$DateAdd($Now(), -30, "days")' } } },
|
|
1052
|
+
* schedule: { cron: '0 3 * * *' } // Daily at 3 AM
|
|
1053
|
+
* });
|
|
1054
|
+
*/
|
|
1055
|
+
dispatch(data: IDBOperationDispatchInput): Promise<IDispatchResult>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Get the appropriate adapter for the operation
|
|
1058
|
+
*/
|
|
1059
|
+
getAdapter(options?: {
|
|
1060
|
+
env?: string;
|
|
1061
|
+
database?: string;
|
|
1062
|
+
}): BaseAdapter;
|
|
1063
|
+
/**
|
|
1064
|
+
* Ensure an adapter exists for the given database/env/product (connect on demand).
|
|
1065
|
+
* Use before getAdapter() when options include database+env+product (e.g. from proxy).
|
|
1066
|
+
*/
|
|
1067
|
+
private ensureAdapterFor;
|
|
1068
|
+
/**
|
|
1069
|
+
* Get the current connection context
|
|
1070
|
+
*/
|
|
1071
|
+
getCurrentContext(): IConnectionContext | null;
|
|
1072
|
+
/**
|
|
1073
|
+
* Get a connection-scoped interface for a specific database/environment.
|
|
1074
|
+
* This ensures schema operations are isolated to a specific connection.
|
|
1075
|
+
*
|
|
1076
|
+
* @example
|
|
1077
|
+
* const usersDb = db.connection('users-db', 'dev');
|
|
1078
|
+
* await usersDb.schema.create('users', { ... });
|
|
1079
|
+
*
|
|
1080
|
+
* const ordersDb = db.connection('orders-db', 'dev');
|
|
1081
|
+
* await ordersDb.schema.create('orders', { ... }); // Different connection
|
|
1082
|
+
*/
|
|
1083
|
+
connection(database: string, env: string, product?: string): DatabaseConnection;
|
|
1084
|
+
/**
|
|
1085
|
+
* Build a context key from database and environment
|
|
1086
|
+
*/
|
|
1087
|
+
private buildContextKey;
|
|
1088
|
+
/**
|
|
1089
|
+
* Convert DatabaseTypes (from product API) to DatabaseType (ORM internal)
|
|
1090
|
+
*/
|
|
1091
|
+
private convertDatabaseType;
|
|
1092
|
+
/**
|
|
1093
|
+
* Simplified schema operations API (Mongoose-style)
|
|
1094
|
+
*
|
|
1095
|
+
* @example
|
|
1096
|
+
* await db.connect({ env: 'dev', product: 'my-app', database: 'users-db' });
|
|
1097
|
+
*
|
|
1098
|
+
* // Create a table with Mongoose-style schema
|
|
1099
|
+
* await db.schema.create('users', {
|
|
1100
|
+
* id: { type: 'uuid', primaryKey: true },
|
|
1101
|
+
* email: { type: 'string', length: 255, required: true, unique: true },
|
|
1102
|
+
* name: { type: 'string', length: 100 },
|
|
1103
|
+
* age: 'integer', // Shorthand
|
|
1104
|
+
* status: { type: 'enum', enum: ['active', 'inactive'], default: 'active' },
|
|
1105
|
+
* }, { timestamps: true });
|
|
1106
|
+
*/
|
|
1107
|
+
get schema(): {
|
|
1108
|
+
/**
|
|
1109
|
+
* Create a collection/table with Mongoose-style schema definition
|
|
1110
|
+
*/
|
|
1111
|
+
create: (name: string, definition: ISimpleSchemaDefinition, options?: ISimpleCreateOptions) => Promise<ISchemaOperationResult>;
|
|
1112
|
+
/**
|
|
1113
|
+
* Drop a collection/table
|
|
1114
|
+
*/
|
|
1115
|
+
drop: (name: string, options?: ISimpleDropOptions) => Promise<ISchemaOperationResult>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Add a field to a collection
|
|
1118
|
+
*/
|
|
1119
|
+
addField: (collection: string, fieldName: string, definition: SimpleFieldType | ISimpleFieldDefinition) => Promise<ISchemaOperationResult>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Drop a field from a collection
|
|
1122
|
+
*/
|
|
1123
|
+
dropField: (collection: string, fieldName: string) => Promise<ISchemaOperationResult>;
|
|
1124
|
+
/**
|
|
1125
|
+
* Rename a field in a collection
|
|
1126
|
+
*/
|
|
1127
|
+
renameField: (collection: string, oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
1128
|
+
/**
|
|
1129
|
+
* Modify a field's definition
|
|
1130
|
+
*/
|
|
1131
|
+
modifyField: (collection: string, fieldName: string, changes: Partial<ISimpleFieldDefinition>) => Promise<ISchemaOperationResult>;
|
|
1132
|
+
/**
|
|
1133
|
+
* Create an index on a collection
|
|
1134
|
+
*/
|
|
1135
|
+
createIndex: (collection: string, fields: string[] | IIndexFieldDefinition[], options?: ISimpleIndexOptions) => Promise<ISchemaOperationResult>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Drop an index from a collection
|
|
1138
|
+
*/
|
|
1139
|
+
dropIndex: (collection: string, indexName: string) => Promise<ISchemaOperationResult>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Add a constraint (SQL databases only)
|
|
1142
|
+
*/
|
|
1143
|
+
addConstraint: (collection: string, constraint: IMigrationConstraintDefinition) => Promise<ISchemaOperationResult>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Drop a constraint (SQL databases only)
|
|
1146
|
+
*/
|
|
1147
|
+
dropConstraint: (collection: string, constraintName: string) => Promise<ISchemaOperationResult>;
|
|
1148
|
+
/**
|
|
1149
|
+
* Rename a collection/table
|
|
1150
|
+
*/
|
|
1151
|
+
rename: (oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Check if a collection/table exists
|
|
1154
|
+
*/
|
|
1155
|
+
exists: (name: string) => Promise<boolean>;
|
|
1156
|
+
/**
|
|
1157
|
+
* List all collections/tables
|
|
1158
|
+
*/
|
|
1159
|
+
list: (schemaName?: string) => Promise<string[]>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Get detailed schema information for a collection
|
|
1162
|
+
*/
|
|
1163
|
+
describe: (name: string) => Promise<ITableSchema>;
|
|
1164
|
+
/**
|
|
1165
|
+
* List indexes on a collection
|
|
1166
|
+
*/
|
|
1167
|
+
indexes: (collection: string) => Promise<IIndexInfo[]>;
|
|
1168
|
+
};
|
|
1169
|
+
/**
|
|
1170
|
+
* Create a collection with Mongoose-style definition
|
|
1171
|
+
*/
|
|
1172
|
+
private schemaCreate;
|
|
1173
|
+
/**
|
|
1174
|
+
* Drop a collection
|
|
1175
|
+
*/
|
|
1176
|
+
private schemaDrop;
|
|
1177
|
+
/**
|
|
1178
|
+
* Add a field to a collection
|
|
1179
|
+
*/
|
|
1180
|
+
private schemaAddField;
|
|
1181
|
+
/**
|
|
1182
|
+
* Drop a field from a collection
|
|
1183
|
+
*/
|
|
1184
|
+
private schemaDropField;
|
|
1185
|
+
/**
|
|
1186
|
+
* Rename a field
|
|
1187
|
+
*/
|
|
1188
|
+
private schemaRenameField;
|
|
1189
|
+
/**
|
|
1190
|
+
* Modify a field's definition
|
|
1191
|
+
*/
|
|
1192
|
+
private schemaModifyField;
|
|
1193
|
+
/**
|
|
1194
|
+
* Create an index
|
|
1195
|
+
*/
|
|
1196
|
+
private schemaCreateIndex;
|
|
1197
|
+
/**
|
|
1198
|
+
* Drop an index
|
|
1199
|
+
*/
|
|
1200
|
+
private schemaDropIndex;
|
|
1201
|
+
/**
|
|
1202
|
+
* Add a constraint (SQL only)
|
|
1203
|
+
*/
|
|
1204
|
+
private schemaAddConstraint;
|
|
1205
|
+
/**
|
|
1206
|
+
* Drop a constraint (SQL only)
|
|
1207
|
+
*/
|
|
1208
|
+
private schemaDropConstraint;
|
|
1209
|
+
/**
|
|
1210
|
+
* Rename a collection
|
|
1211
|
+
*/
|
|
1212
|
+
private schemaRename;
|
|
1213
|
+
/**
|
|
1214
|
+
* Check if collection exists
|
|
1215
|
+
*/
|
|
1216
|
+
private schemaExists;
|
|
1217
|
+
/**
|
|
1218
|
+
* List all collections
|
|
1219
|
+
*/
|
|
1220
|
+
private schemaList;
|
|
1221
|
+
/**
|
|
1222
|
+
* Describe a collection's schema
|
|
1223
|
+
*/
|
|
1224
|
+
private schemaDescribe;
|
|
1225
|
+
/**
|
|
1226
|
+
* List indexes on a collection
|
|
1227
|
+
*/
|
|
1228
|
+
private schemaListIndexes;
|
|
1229
|
+
/**
|
|
1230
|
+
* Convert Mongoose-style schema definition to IFieldDefinition array
|
|
1231
|
+
*/
|
|
1232
|
+
private convertToFieldDefinitions;
|
|
1233
|
+
/**
|
|
1234
|
+
* Convert a single field definition
|
|
1235
|
+
*/
|
|
1236
|
+
private convertFieldDefinition;
|
|
1237
|
+
/**
|
|
1238
|
+
* Normalize Mongoose-style type names to FieldType
|
|
1239
|
+
*/
|
|
1240
|
+
private normalizeFieldType;
|
|
1241
|
+
/**
|
|
1242
|
+
* Normalize index fields to IIndexFieldDefinition array
|
|
1243
|
+
*/
|
|
1244
|
+
private normalizeIndexFields;
|
|
1245
|
+
/**
|
|
1246
|
+
* Get adapter by context key (used by DatabaseConnection)
|
|
1247
|
+
* @internal
|
|
1248
|
+
*/
|
|
1249
|
+
getAdapterByContextKey(contextKey: string): BaseAdapter;
|
|
1250
|
+
/**
|
|
1251
|
+
* Fetch database dashboard metrics from logs
|
|
1252
|
+
*
|
|
1253
|
+
* @example
|
|
1254
|
+
* ```ts
|
|
1255
|
+
* const dashboard = await databases.fetchDashboard({
|
|
1256
|
+
* product: 'my-product',
|
|
1257
|
+
* database: 'my-database',
|
|
1258
|
+
* env: 'production',
|
|
1259
|
+
* });
|
|
1260
|
+
* console.log(dashboard.dau, dashboard.activityTimeline);
|
|
1261
|
+
* ```
|
|
1262
|
+
*/
|
|
1263
|
+
fetchDashboard(options: {
|
|
1264
|
+
product: string;
|
|
1265
|
+
database: string;
|
|
1266
|
+
env?: string;
|
|
1267
|
+
}): Promise<{
|
|
1268
|
+
dau: {
|
|
1269
|
+
current: number;
|
|
1270
|
+
previous: number;
|
|
1271
|
+
change: number;
|
|
1272
|
+
};
|
|
1273
|
+
wau: {
|
|
1274
|
+
current: number;
|
|
1275
|
+
previous: number;
|
|
1276
|
+
change: number;
|
|
1277
|
+
};
|
|
1278
|
+
mau: {
|
|
1279
|
+
current: number;
|
|
1280
|
+
previous: number;
|
|
1281
|
+
change: number;
|
|
1282
|
+
};
|
|
1283
|
+
totalOperations: number;
|
|
1284
|
+
successfulOperations: number;
|
|
1285
|
+
failedOperations: number;
|
|
1286
|
+
newOperationsThisWeek: number;
|
|
1287
|
+
avgExecutionTime: {
|
|
1288
|
+
current: string;
|
|
1289
|
+
previous: string;
|
|
1290
|
+
change: number;
|
|
1291
|
+
};
|
|
1292
|
+
activityTimeline: Array<{
|
|
1293
|
+
date: string;
|
|
1294
|
+
sessions: number;
|
|
1295
|
+
}>;
|
|
1296
|
+
peakHours: Array<{
|
|
1297
|
+
hour: string;
|
|
1298
|
+
count: number;
|
|
1299
|
+
}>;
|
|
1300
|
+
environmentBreakdown: Array<{
|
|
1301
|
+
env: string;
|
|
1302
|
+
count: number;
|
|
1303
|
+
percentage: number;
|
|
1304
|
+
}>;
|
|
1305
|
+
methodBreakdown: Array<{
|
|
1306
|
+
method: string;
|
|
1307
|
+
count: number;
|
|
1308
|
+
percentage: number;
|
|
1309
|
+
}>;
|
|
1310
|
+
}>;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Connection-scoped database interface.
|
|
1314
|
+
* Provides isolated schema, query, and aggregation operations for a specific database/environment.
|
|
1315
|
+
*/
|
|
1316
|
+
export declare class DatabaseConnection {
|
|
1317
|
+
private service;
|
|
1318
|
+
private _database;
|
|
1319
|
+
private _env;
|
|
1320
|
+
private _product;
|
|
1321
|
+
private contextKey;
|
|
1322
|
+
private triggerProcessor;
|
|
1323
|
+
constructor(service: DatabaseService, database: string, env: string, product: string);
|
|
1324
|
+
/** Database tag */
|
|
1325
|
+
get database(): string;
|
|
1326
|
+
/** Environment slug */
|
|
1327
|
+
get env(): string;
|
|
1328
|
+
/** Product tag */
|
|
1329
|
+
get product(): string;
|
|
1330
|
+
/** Get the adapter for this connection */
|
|
1331
|
+
getAdapter(): BaseAdapter;
|
|
1332
|
+
/**
|
|
1333
|
+
* Schema operations scoped to this connection
|
|
1334
|
+
*/
|
|
1335
|
+
get schema(): {
|
|
1336
|
+
create: (name: string, definition: ISimpleSchemaDefinition, options?: ISimpleCreateOptions) => Promise<ISchemaOperationResult>;
|
|
1337
|
+
drop: (name: string, options?: ISimpleDropOptions) => Promise<ISchemaOperationResult>;
|
|
1338
|
+
addField: (collection: string, fieldName: string, definition: SimpleFieldType | ISimpleFieldDefinition) => Promise<ISchemaOperationResult>;
|
|
1339
|
+
dropField: (collection: string, fieldName: string) => Promise<ISchemaOperationResult>;
|
|
1340
|
+
renameField: (collection: string, oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
1341
|
+
modifyField: (collection: string, fieldName: string, changes: Partial<ISimpleFieldDefinition>) => Promise<ISchemaOperationResult>;
|
|
1342
|
+
createIndex: (collection: string, fields: string[] | IIndexFieldDefinition[], options?: ISimpleIndexOptions) => Promise<ISchemaOperationResult>;
|
|
1343
|
+
dropIndex: (collection: string, indexName: string) => Promise<ISchemaOperationResult>;
|
|
1344
|
+
addConstraint: (collection: string, constraint: IMigrationConstraintDefinition) => Promise<ISchemaOperationResult>;
|
|
1345
|
+
dropConstraint: (collection: string, constraintName: string) => Promise<ISchemaOperationResult>;
|
|
1346
|
+
rename: (oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
1347
|
+
exists: (name: string) => Promise<boolean>;
|
|
1348
|
+
list: (schemaName?: string) => Promise<string[]>;
|
|
1349
|
+
describe: (name: string) => Promise<ITableSchema>;
|
|
1350
|
+
indexes: (collection: string) => Promise<IIndexInfo[]>;
|
|
1351
|
+
};
|
|
1352
|
+
query<T = any>(options: Omit<IQueryOptions, 'database' | 'env'>): Promise<IQueryResult<T>>;
|
|
1353
|
+
insert<T = any>(options: Omit<IInsertOptions, 'database' | 'env'>): Promise<IInsertResult<T>>;
|
|
1354
|
+
update<T = any>(options: Omit<IUpdateOptions, 'database' | 'env'>): Promise<IUpdateResult<T>>;
|
|
1355
|
+
delete(options: Omit<IDeleteOptions, 'database' | 'env'>): Promise<IDeleteResult>;
|
|
1356
|
+
upsert<T = any>(options: Omit<IUpsertOptions, 'database' | 'env'>): Promise<IUpsertResult<T>>;
|
|
1357
|
+
raw<T = any>(options: Omit<IRawQueryOptions, 'database' | 'env'>): Promise<IRawQueryResult<T>>;
|
|
1358
|
+
count(options: Omit<ICountOptions, 'database' | 'env'>): Promise<number>;
|
|
1359
|
+
sum(options: Omit<ISumOptions, 'database' | 'env'>): Promise<number>;
|
|
1360
|
+
avg(options: Omit<IAvgOptions, 'database' | 'env'>): Promise<number>;
|
|
1361
|
+
min(options: Omit<IMinMaxOptions, 'database' | 'env'>): Promise<any>;
|
|
1362
|
+
max(options: Omit<IMinMaxOptions, 'database' | 'env'>): Promise<any>;
|
|
1363
|
+
aggregate(options: Omit<IAggregateOptions, 'database' | 'env'>): Promise<IAggregateResult>;
|
|
1364
|
+
groupBy<T = any>(options: Omit<IGroupByOptions, 'database' | 'env'>): Promise<IGroupByResult<T>[]>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Trigger operations scoped to this connection
|
|
1367
|
+
*/
|
|
1368
|
+
get triggers(): {
|
|
1369
|
+
/**
|
|
1370
|
+
* Create a trigger and store it on the backend
|
|
1371
|
+
* @param data - Trigger configuration (tag should be just the trigger name, database tag is added automatically)
|
|
1372
|
+
*/
|
|
1373
|
+
create: (data: Partial<IProductDatabaseTrigger>) => Promise<void>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Update an existing trigger on the backend
|
|
1376
|
+
* @param data - Trigger configuration
|
|
1377
|
+
*/
|
|
1378
|
+
update: (data: Partial<IProductDatabaseTrigger>) => Promise<void>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Fetch a specific trigger from the backend
|
|
1381
|
+
* @param triggerTag - The trigger tag (without database prefix)
|
|
1382
|
+
*/
|
|
1383
|
+
fetch: (triggerTag: string) => Promise<IProductDatabaseTrigger | null>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Fetch all triggers for this database from the backend
|
|
1386
|
+
* @deprecated Use list() instead
|
|
1387
|
+
*/
|
|
1388
|
+
fetchAll: () => Promise<IProductDatabaseTrigger[]>;
|
|
1389
|
+
/**
|
|
1390
|
+
* List all triggers for this database from the backend
|
|
1391
|
+
* @param options - Optional filters (table, event, enabled)
|
|
1392
|
+
*/
|
|
1393
|
+
list: (options?: {
|
|
1394
|
+
table?: string;
|
|
1395
|
+
event?: string;
|
|
1396
|
+
enabled?: boolean;
|
|
1397
|
+
}) => Promise<IProductDatabaseTrigger[]>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Delete a trigger from the backend
|
|
1400
|
+
* @param triggerTag - The trigger tag (without database prefix)
|
|
1401
|
+
*/
|
|
1402
|
+
delete: (triggerTag: string) => Promise<boolean>;
|
|
1403
|
+
/**
|
|
1404
|
+
* Register a trigger in memory for the current session (does not persist to backend)
|
|
1405
|
+
* @deprecated Use create() for persistent triggers
|
|
1406
|
+
*/
|
|
1407
|
+
register: (table: string, trigger: ITriggerDefinition) => void;
|
|
1408
|
+
/**
|
|
1409
|
+
* Register multiple triggers in memory (does not persist to backend)
|
|
1410
|
+
* @deprecated Use create() for persistent triggers
|
|
1411
|
+
*/
|
|
1412
|
+
registerAll: (triggers: Array<{
|
|
1413
|
+
table: string;
|
|
1414
|
+
trigger: ITriggerDefinition;
|
|
1415
|
+
}>) => void;
|
|
1416
|
+
/**
|
|
1417
|
+
* Unregister a trigger from memory
|
|
1418
|
+
*/
|
|
1419
|
+
unregister: (table: string, triggerName: string) => boolean;
|
|
1420
|
+
/**
|
|
1421
|
+
* Get all triggers for a table and event
|
|
1422
|
+
*/
|
|
1423
|
+
getTriggersForEvent: (table: string, event: TriggerEvent) => ITriggerDefinition[];
|
|
1424
|
+
/**
|
|
1425
|
+
* Execute all triggers for an event
|
|
1426
|
+
*/
|
|
1427
|
+
execute: (event: TriggerEvent, context: Omit<ITriggerContext, "database" | "env">) => Promise<ITriggerResult[]>;
|
|
1428
|
+
/**
|
|
1429
|
+
* Load triggers from the backend and register them in memory
|
|
1430
|
+
*/
|
|
1431
|
+
load: () => Promise<void>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Set the Ductape instance for trigger actions
|
|
1434
|
+
*/
|
|
1435
|
+
setDuctapeInstance: (instance: any) => void;
|
|
1436
|
+
/**
|
|
1437
|
+
* Get the trigger processor instance
|
|
1438
|
+
*/
|
|
1439
|
+
getProcessor: () => TriggerProcessor;
|
|
1440
|
+
/**
|
|
1441
|
+
* Trigger action builders
|
|
1442
|
+
*/
|
|
1443
|
+
Trigger: {
|
|
1444
|
+
database: {
|
|
1445
|
+
insert: (table: string, data: Record<string, any> | string) => import("./types/trigger.interface").ITriggerDatabaseAction;
|
|
1446
|
+
update: (table: string, data: Record<string, any> | string, where: Record<string, any> | string) => import("./types/trigger.interface").ITriggerDatabaseAction;
|
|
1447
|
+
delete: (table: string, where: Record<string, any> | string) => import("./types/trigger.interface").ITriggerDatabaseAction;
|
|
1448
|
+
query: (table: string, where: Record<string, any> | string) => import("./types/trigger.interface").ITriggerDatabaseAction;
|
|
1449
|
+
};
|
|
1450
|
+
storage: {
|
|
1451
|
+
upload: (storage: string, path: string, options?: Partial<import("./types/trigger.interface").ITriggerStorageAction>) => import("./types/trigger.interface").ITriggerStorageAction;
|
|
1452
|
+
delete: (storage: string, path: string) => import("./types/trigger.interface").ITriggerStorageAction;
|
|
1453
|
+
copy: (storage: string, sourcePath: string, destinationPath: string) => import("./types/trigger.interface").ITriggerStorageAction;
|
|
1454
|
+
};
|
|
1455
|
+
notification: {
|
|
1456
|
+
email: (notification: string, recipients: string | string[], options?: Partial<import("./types/trigger.interface").ITriggerNotificationAction>) => import("./types/trigger.interface").ITriggerNotificationAction;
|
|
1457
|
+
sms: (notification: string, recipients: string | string[], options?: Partial<import("./types/trigger.interface").ITriggerNotificationAction>) => import("./types/trigger.interface").ITriggerNotificationAction;
|
|
1458
|
+
push: (notification: string, recipients: string | string[], options?: Partial<import("./types/trigger.interface").ITriggerNotificationAction>) => import("./types/trigger.interface").ITriggerNotificationAction;
|
|
1459
|
+
callback: (notification: string, options?: Partial<import("./types/trigger.interface").ITriggerNotificationAction>) => import("./types/trigger.interface").ITriggerNotificationAction;
|
|
1460
|
+
};
|
|
1461
|
+
broker: {
|
|
1462
|
+
publish: (event: string, message: Record<string, any> | string, options?: Partial<import("./types/trigger.interface").ITriggerBrokerAction>) => import("./types/trigger.interface").ITriggerBrokerAction;
|
|
1463
|
+
};
|
|
1464
|
+
cache: {
|
|
1465
|
+
set: (cache: string, key: string, value: any, ttl?: number) => import("./types/trigger.interface").ITriggerCacheAction;
|
|
1466
|
+
invalidate: (cache: string, pattern: string) => import("./types/trigger.interface").ITriggerCacheAction;
|
|
1467
|
+
delete: (cache: string, key: string) => import("./types/trigger.interface").ITriggerCacheAction;
|
|
1468
|
+
};
|
|
1469
|
+
workflow: {
|
|
1470
|
+
execute: (workflow: string, input?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerWorkflowAction;
|
|
1471
|
+
dispatch: (workflow: string, input?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerWorkflowAction;
|
|
1472
|
+
};
|
|
1473
|
+
action: {
|
|
1474
|
+
execute: (app: string, action: string, input?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerActionExecuteAction;
|
|
1475
|
+
};
|
|
1476
|
+
agent: {
|
|
1477
|
+
run: (agent: string, prompt?: string, input?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerAgentAction;
|
|
1478
|
+
};
|
|
1479
|
+
log: {
|
|
1480
|
+
debug: (message: string, data?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerLogAction;
|
|
1481
|
+
info: (message: string, data?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerLogAction;
|
|
1482
|
+
warn: (message: string, data?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerLogAction;
|
|
1483
|
+
error: (message: string, data?: Record<string, any> | string) => import("./types/trigger.interface").ITriggerLogAction;
|
|
1484
|
+
};
|
|
1485
|
+
http: {
|
|
1486
|
+
get: (url: string, options?: Partial<import("./types/trigger.interface").ITriggerHttpAction>) => import("./types/trigger.interface").ITriggerHttpAction;
|
|
1487
|
+
post: (url: string, body?: Record<string, any> | string, options?: Partial<import("./types/trigger.interface").ITriggerHttpAction>) => import("./types/trigger.interface").ITriggerHttpAction;
|
|
1488
|
+
put: (url: string, body?: Record<string, any> | string, options?: Partial<import("./types/trigger.interface").ITriggerHttpAction>) => import("./types/trigger.interface").ITriggerHttpAction;
|
|
1489
|
+
patch: (url: string, body?: Record<string, any> | string, options?: Partial<import("./types/trigger.interface").ITriggerHttpAction>) => import("./types/trigger.interface").ITriggerHttpAction;
|
|
1490
|
+
delete: (url: string, options?: Partial<import("./types/trigger.interface").ITriggerHttpAction>) => import("./types/trigger.interface").ITriggerHttpAction;
|
|
1491
|
+
};
|
|
1492
|
+
custom: (handler: (context: ITriggerContext) => Promise<any>) => import("./types/trigger.interface").ITriggerCustomAction;
|
|
1493
|
+
when: {
|
|
1494
|
+
field: (field: string) => {
|
|
1495
|
+
equals: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1496
|
+
notEquals: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1497
|
+
greaterThan: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1498
|
+
lessThan: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1499
|
+
in: (values: any[]) => import("./types/trigger.interface").IConditionClause;
|
|
1500
|
+
contains: (value: string) => import("./types/trigger.interface").IConditionClause;
|
|
1501
|
+
isNull: () => import("./types/trigger.interface").IConditionClause;
|
|
1502
|
+
isNotNull: () => import("./types/trigger.interface").IConditionClause;
|
|
1503
|
+
changed: () => import("./types/trigger.interface").IConditionClause;
|
|
1504
|
+
changedTo: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1505
|
+
changedFrom: (value: any) => import("./types/trigger.interface").IConditionClause;
|
|
1506
|
+
};
|
|
1507
|
+
and: (...conditions: (import("./types/trigger.interface").IConditionClause | import("./types/trigger.interface").ITriggerCondition)[]) => import("./types/trigger.interface").ITriggerCondition;
|
|
1508
|
+
or: (...conditions: (import("./types/trigger.interface").IConditionClause | import("./types/trigger.interface").ITriggerCondition)[]) => import("./types/trigger.interface").ITriggerCondition;
|
|
1509
|
+
not: (condition: import("./types/trigger.interface").IConditionClause | import("./types/trigger.interface").ITriggerCondition) => import("./types/trigger.interface").ITriggerCondition;
|
|
1510
|
+
};
|
|
1511
|
+
};
|
|
1512
|
+
/**
|
|
1513
|
+
* Trigger events enum
|
|
1514
|
+
*/
|
|
1515
|
+
TriggerEvent: typeof TriggerEvent;
|
|
1516
|
+
/**
|
|
1517
|
+
* Trigger timing enum
|
|
1518
|
+
*/
|
|
1519
|
+
TriggerTiming: typeof TriggerTiming;
|
|
1520
|
+
/**
|
|
1521
|
+
* Trigger action types enum
|
|
1522
|
+
*/
|
|
1523
|
+
TriggerActionType: typeof TriggerActionType;
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
export declare const databaseService: DatabaseService;
|