@ductape/sdk 0.0.4-v51 → 0.0.4-v53
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/README.md +1 -1
- package/dist/agents/agent-context.d.ts +98 -0
- package/dist/agents/agent-context.js +588 -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 +304 -0
- package/dist/agents/agents.service.js +1244 -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 +1225 -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.js +4 -5
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/processorApi.service.d.ts +322 -0
- package/dist/api/services/processorApi.service.js +252 -0
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +69 -1
- package/dist/api/services/productsApi.service.js +67 -31
- package/dist/api/services/productsApi.service.js.map +1 -1
- 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 +38 -0
- package/dist/api/services/secretsApi.service.js +96 -0
- package/dist/api/services/secretsApi.service.js.map +1 -0
- package/dist/api/services/userApi.service.js +0 -1
- package/dist/api/services/userApi.service.js.map +1 -1
- package/dist/api/services/workflowApi.service.d.ts +199 -0
- package/dist/api/services/workflowApi.service.js +183 -0
- package/dist/api/services/workflowApi.service.js.map +1 -0
- package/dist/api/services/workspaceApi.service.js +0 -1
- package/dist/api/services/workspaceApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +57 -0
- package/dist/api/urls.js +68 -1
- package/dist/api/urls.js.map +1 -1
- package/dist/api/utils/cache.utils.js +4 -10
- package/dist/api/utils/cache.utils.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +0 -10
- package/dist/apps/services/app.service.js +74 -30
- package/dist/apps/services/app.service.js.map +1 -1
- 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 +405 -0
- package/dist/apps/utils/oauth-manager.js.map +1 -0
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +2 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +15 -2
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +2 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +14 -2
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
- 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 +257 -0
- package/dist/brokers/brokers.service.js +604 -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 +288 -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 +16 -0
- package/dist/brokers/utils/providers/kafka.service.js +52 -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 +14 -0
- package/dist/brokers/utils/providers/rabbitmq.service.js +67 -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 +159 -0
- package/dist/cache/cache.manager.js +265 -0
- package/dist/cache/cache.manager.js.map +1 -0
- package/dist/cache/cache.service.d.ts +186 -0
- package/dist/cache/cache.service.js +437 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cache/index.d.ts +52 -0
- package/dist/cache/index.js +79 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/types/index.d.ts +106 -0
- package/dist/cache/types/index.js +6 -0
- package/dist/cache/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 +307 -90
- package/dist/database/adapters/base.adapter.js +139 -20
- package/dist/database/adapters/base.adapter.js.map +1 -1
- package/dist/database/adapters/cassandra.adapter.d.ts +90 -0
- package/dist/database/adapters/cassandra.adapter.js +1019 -0
- package/dist/database/adapters/cassandra.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +94 -77
- package/dist/database/adapters/dynamodb.adapter.js +1162 -1305
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -1
- 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 +105 -57
- package/dist/database/adapters/mongodb.adapter.js +941 -838
- package/dist/database/adapters/mongodb.adapter.js.map +1 -1
- package/dist/database/adapters/mysql.adapter.d.ts +76 -138
- package/dist/database/adapters/mysql.adapter.js +990 -1246
- package/dist/database/adapters/mysql.adapter.js.map +1 -1
- package/dist/database/adapters/postgresql.adapter.d.ts +75 -139
- package/dist/database/adapters/postgresql.adapter.js +1076 -1346
- package/dist/database/adapters/postgresql.adapter.js.map +1 -1
- package/dist/database/databases.service.d.ts +1374 -0
- package/dist/database/databases.service.js +2680 -0
- package/dist/database/databases.service.js.map +1 -0
- package/dist/database/index.d.ts +41 -13
- package/dist/database/index.js +97 -86
- package/dist/database/index.js.map +1 -1
- 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 +132 -0
- package/dist/database/migrations/migration-engine.js +1356 -0
- package/dist/database/migrations/migration-engine.js.map +1 -0
- package/dist/database/operators/aggregation-builder.d.ts +64 -0
- package/dist/database/operators/aggregation-builder.js +746 -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 +55 -0
- package/dist/database/operators/query-builder.js +365 -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 +637 -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 +179 -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 +137 -0
- package/dist/database/types/connection.interface.js +6 -0
- package/dist/database/types/connection.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 +12 -10
- package/dist/database/types/index.js +26 -32
- package/dist/database/types/index.js.map +1 -1
- 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 +199 -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 +398 -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 +208 -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 +78 -72
- package/dist/graph/adapters/arangodb.adapter.js +1310 -1220
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -1
- package/dist/graph/adapters/base.adapter.d.ts +135 -118
- package/dist/graph/adapters/base.adapter.js +46 -20
- package/dist/graph/adapters/base.adapter.js.map +1 -1
- package/dist/graph/adapters/index.d.ts +5 -4
- package/dist/graph/adapters/index.js +6 -8
- package/dist/graph/adapters/index.js.map +1 -1
- package/dist/graph/adapters/memgraph.adapter.d.ts +98 -73
- package/dist/graph/adapters/memgraph.adapter.js +1050 -1202
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -1
- package/dist/graph/adapters/neo4j.adapter.d.ts +71 -78
- package/dist/graph/adapters/neo4j.adapter.js +912 -1605
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -1
- package/dist/graph/adapters/neptune.adapter.d.ts +76 -81
- package/dist/graph/adapters/neptune.adapter.js +1095 -1228
- package/dist/graph/adapters/neptune.adapter.js.map +1 -1
- package/dist/graph/graphs.service.d.ts +524 -0
- package/dist/graph/graphs.service.js +1683 -0
- package/dist/graph/graphs.service.js.map +1 -0
- package/dist/graph/index.d.ts +54 -8
- package/dist/graph/index.js +67 -32
- package/dist/graph/index.js.map +1 -1
- 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 +141 -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 +11 -9
- package/dist/graph/types/index.js +15 -30
- package/dist/graph/types/index.js.map +1 -1
- 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 +168 -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/index.d.ts +1905 -875
- package/dist/index.js +3063 -1282
- package/dist/index.js.map +1 -1
- 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/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.types.d.ts +12 -2
- package/dist/logs/logs.types.js +5 -1
- package/dist/logs/logs.types.js.map +1 -1
- 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 +252 -0
- package/dist/notifications/notifications.service.js +654 -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 +400 -0
- package/dist/notifications/types/notifications.types.js +49 -0
- package/dist/notifications/types/notifications.types.js.map +1 -0
- package/dist/processor/services/messagebrokers/kafka.service.js +2 -0
- package/dist/processor/services/messagebrokers/kafka.service.js.map +1 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +1 -9
- package/dist/processor/services/messagebrokers/rabbitmq.service.js +11 -40
- package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +86 -70
- package/dist/processor/services/processor.service.js +1353 -1259
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/utils/processor.utils.js +5 -1
- package/dist/processor/utils/processor.utils.js.map +1 -1
- package/dist/products/services/products.service.d.ts +167 -25
- package/dist/products/services/products.service.js +1248 -412
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/validators/index.d.ts +6 -3
- package/dist/products/validators/index.js +14 -5
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +218 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +5 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +4 -15
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +109 -501
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +14 -9
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +0 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +87 -30
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- 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.js +135 -50
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +77 -18
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js +135 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js +5 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +0 -6
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +26 -28
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +11 -12
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +0 -1
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/resilience/fallback.service.d.ts +88 -0
- package/dist/resilience/fallback.service.js +511 -0
- package/dist/resilience/fallback.service.js.map +1 -0
- package/dist/resilience/healthcheck.service.d.ts +106 -0
- package/dist/resilience/healthcheck.service.js +379 -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 +90 -0
- package/dist/resilience/quota.service.js +519 -0
- package/dist/resilience/quota.service.js.map +1 -0
- package/dist/resilience/resilience.service.d.ts +95 -0
- package/dist/resilience/resilience.service.js +525 -0
- package/dist/resilience/resilience.service.js.map +1 -0
- package/dist/resilience/types/index.d.ts +479 -0
- package/dist/resilience/types/index.js +26 -0
- package/dist/resilience/types/index.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 +233 -0
- package/dist/secrets/secrets.resolver.js.map +1 -0
- package/dist/secrets/secrets.service.d.ts +83 -0
- package/dist/secrets/secrets.service.js +159 -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 +93 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/sessions/sessions.helper.d.ts +68 -0
- package/dist/sessions/sessions.helper.js +116 -0
- package/dist/sessions/sessions.helper.js.map +1 -0
- package/dist/sessions/sessions.resolver.d.ts +150 -0
- package/dist/sessions/sessions.resolver.js +356 -0
- package/dist/sessions/sessions.resolver.js.map +1 -0
- package/dist/sessions/sessions.service.d.ts +170 -0
- package/dist/sessions/sessions.service.js +736 -0
- package/dist/sessions/sessions.service.js.map +1 -0
- package/dist/sessions/types/index.d.ts +290 -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 +98 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/storage.service.d.ts +123 -0
- package/dist/storage/storage.service.js +478 -0
- package/dist/storage/storage.service.js.map +1 -0
- package/dist/storage/types/index.d.ts +207 -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 +51 -0
- package/dist/storage/utils/storage.util.js +402 -0
- package/dist/storage/utils/storage.util.js.map +1 -0
- package/dist/test/index.d.ts +3 -0
- package/dist/test/index.js +13 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/test.appBuilder.d.ts +0 -1
- package/dist/test/test.appBuilder.js +0 -15
- package/dist/test/test.appBuilder.js.map +1 -1
- package/dist/test/test.database.js +140 -0
- package/dist/test/test.database.js.map +1 -0
- package/dist/test/test.health.d.ts +0 -1
- package/dist/test/test.health.js +0 -48
- package/dist/test/test.health.js.map +1 -1
- package/dist/test/test.import.d.ts +0 -1
- package/dist/test/test.import.js +0 -1506
- package/dist/test/test.import.js.map +1 -1
- package/dist/test/test.import.openapi.d.ts +0 -1
- package/dist/test/test.import.openapi.js +0 -75
- package/dist/test/test.import.openapi.js.map +1 -1
- package/dist/test/test.imports.d.ts +0 -1
- package/dist/test/test.imports.js +0 -76
- package/dist/test/test.imports.js.map +1 -1
- package/dist/test/test.logs.d.ts +0 -1
- package/dist/test/test.logs.js +0 -17
- package/dist/test/test.logs.js.map +1 -1
- package/dist/test/test.notifiers.d.ts +0 -1
- package/dist/test/test.notifiers.js +0 -84
- package/dist/test/test.notifiers.js.map +1 -1
- package/dist/test/test.processor.d.ts +0 -1
- package/dist/test/test.processor.js +0 -37
- package/dist/test/test.processor.js.map +1 -1
- package/dist/test/test.productBuilder.d.ts +0 -1
- package/dist/test/test.productBuilder.js +0 -660
- package/dist/test/test.productBuilder.js.map +1 -1
- package/dist/test/test.products.d.ts +0 -1
- package/dist/test/test.products.js +0 -48
- package/dist/test/test.products.js.map +1 -1
- package/dist/test/test.storage.js +332 -0
- package/dist/test/test.storage.js.map +1 -0
- package/dist/test/test.triggers.js +314 -0
- package/dist/test/test.triggers.js.map +1 -0
- package/dist/types/appBuilder.types.d.ts +1 -1
- package/dist/types/enums.d.ts +6 -1
- package/dist/types/enums.js +5 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/processor.types.d.ts +197 -35
- package/dist/types/processor.types.js +9 -1
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +837 -75
- package/dist/types/productsBuilder.types.js +168 -62
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +2 -49
- package/dist/utils/index.js.map +1 -1
- package/dist/vector/adapters/base.adapter.d.ts +152 -0
- package/dist/vector/adapters/base.adapter.js +137 -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 +400 -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 +392 -0
- package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
- package/dist/vector/adapters/weaviate.adapter.d.ts +64 -0
- package/dist/vector/adapters/weaviate.adapter.js +478 -0
- package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
- package/dist/vector/index.d.ts +47 -0
- package/dist/vector/index.js +72 -0
- package/dist/vector/index.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 +9 -0
- package/dist/vector/types/index.js +16 -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 +6 -0
- package/dist/vector/utils/index.js +11 -0
- package/dist/vector/utils/index.js.map +1 -0
- package/dist/vector/utils/vector-error.d.ts +69 -0
- package/dist/vector/utils/vector-error.js +117 -0
- package/dist/vector/utils/vector-error.js.map +1 -0
- package/dist/vector/vector-database.service.d.ts +405 -0
- package/dist/vector/vector-database.service.js +544 -0
- package/dist/vector/vector-database.service.js.map +1 -0
- package/dist/vector/vector.service.d.ts +245 -0
- package/dist/vector/vector.service.js +381 -0
- package/dist/vector/vector.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 +1035 -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 +338 -0
- package/dist/workflows/workflow-builder.js.map +1 -0
- package/dist/workflows/workflow-executor.d.ts +205 -0
- package/dist/workflows/workflow-executor.js +1186 -0
- package/dist/workflows/workflow-executor.js.map +1 -0
- package/dist/workflows/workflows.service.d.ts +398 -0
- package/dist/workflows/workflows.service.js +1595 -0
- package/dist/workflows/workflows.service.js.map +1 -0
- package/package.json +16 -13
- package/dist/actions/actions.repo.d.ts +0 -0
- package/dist/actions/actions.repo.js +0 -13
- package/dist/actions/actions.repo.js.map +0 -1
- package/dist/actions/actions.service.d.ts +0 -0
- package/dist/actions/actions.service.js +0 -24
- package/dist/actions/actions.service.js.map +0 -1
- package/dist/actions/utils/actions.util.read.d.ts +0 -0
- package/dist/actions/utils/actions.util.read.js +0 -427
- package/dist/actions/utils/actions.util.read.js.map +0 -1
- package/dist/api/services/integrationsApi.service.d.ts +0 -18
- package/dist/api/services/integrationsApi.service.js +0 -80
- package/dist/api/services/integrationsApi.service.js.map +0 -1
- package/dist/api/services/workspaceSecretsApi.service.d.ts +0 -75
- package/dist/api/services/workspaceSecretsApi.service.js +0 -62
- package/dist/api/services/workspaceSecretsApi.service.js.map +0 -1
- package/dist/appBuilder/services/app.service.d.ts +0 -111
- package/dist/appBuilder/services/app.service.js +0 -737
- package/dist/appBuilder/services/app.service.js.map +0 -1
- package/dist/appBuilder/services/appBuilder.service.d.ts +0 -111
- package/dist/appBuilder/services/appBuilder.service.js +0 -662
- package/dist/appBuilder/services/appBuilder.service.js.map +0 -1
- package/dist/appBuilder/utils/objects.utils.d.ts +0 -3
- package/dist/appBuilder/utils/objects.utils.js +0 -9
- package/dist/appBuilder/utils/objects.utils.js.map +0 -1
- package/dist/appBuilder/utils/string.utils.d.ts +0 -2
- package/dist/appBuilder/utils/string.utils.js +0 -57
- package/dist/appBuilder/utils/string.utils.js.map +0 -1
- package/dist/appBuilder/validators/index.d.ts +0 -19
- package/dist/appBuilder/validators/index.js +0 -40
- package/dist/appBuilder/validators/index.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.app.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/create.app.validator.js +0 -10
- package/dist/appBuilder/validators/joi-validators/create.app.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js +0 -20
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js +0 -44
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js +0 -31
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js +0 -11
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js +0 -12
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js +0 -17
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js +0 -30
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js +0 -14
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/sample.validator.d.ts +0 -5
- package/dist/appBuilder/validators/joi-validators/sample.validator.js +0 -26
- package/dist/appBuilder/validators/joi-validators/sample.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.app.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.app.validator.js +0 -34
- package/dist/appBuilder/validators/joi-validators/update.app.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js +0 -23
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js +0 -21
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js +0 -19
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js +0 -12
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js +0 -17
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js +0 -16
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js +0 -14
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js +0 -27
- package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
- package/dist/apps/validators/joi-validators/create.appEvent.validator.js +0 -30
- package/dist/apps/validators/joi-validators/create.appEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appEvent.validator.js +0 -16
- package/dist/apps/validators/joi-validators/update.appEvent.validator.js.map +0 -1
- package/dist/clients/integrations.client.d.ts +0 -2
- package/dist/clients/integrations.client.js +0 -26
- package/dist/clients/integrations.client.js.map +0 -1
- package/dist/database/database.service.d.ts +0 -232
- package/dist/database/database.service.js +0 -802
- package/dist/database/database.service.js.map +0 -1
- package/dist/database/types/aggregation.types.d.ts +0 -261
- package/dist/database/types/aggregation.types.js +0 -21
- package/dist/database/types/aggregation.types.js.map +0 -1
- package/dist/database/types/connection.types.d.ts +0 -132
- package/dist/database/types/connection.types.js +0 -6
- package/dist/database/types/connection.types.js.map +0 -1
- package/dist/database/types/database.types.d.ts +0 -175
- package/dist/database/types/database.types.js +0 -75
- package/dist/database/types/database.types.js.map +0 -1
- package/dist/database/types/index.types.d.ts +0 -220
- package/dist/database/types/index.types.js +0 -27
- package/dist/database/types/index.types.js.map +0 -1
- package/dist/database/types/migration.types.d.ts +0 -205
- package/dist/database/types/migration.types.js +0 -44
- package/dist/database/types/migration.types.js.map +0 -1
- package/dist/database/types/query.types.d.ts +0 -305
- package/dist/database/types/query.types.js +0 -57
- package/dist/database/types/query.types.js.map +0 -1
- package/dist/database/types/result.types.d.ts +0 -220
- package/dist/database/types/result.types.js +0 -6
- package/dist/database/types/result.types.js.map +0 -1
- package/dist/database/types/schema.types.d.ts +0 -190
- package/dist/database/types/schema.types.js +0 -69
- package/dist/database/types/schema.types.js.map +0 -1
- package/dist/database/utils/helpers.d.ts +0 -66
- package/dist/database/utils/helpers.js +0 -501
- package/dist/database/utils/helpers.js.map +0 -1
- package/dist/database/utils/migration.utils.d.ts +0 -151
- package/dist/database/utils/migration.utils.js +0 -476
- package/dist/database/utils/migration.utils.js.map +0 -1
- package/dist/database/utils/transaction.d.ts +0 -64
- package/dist/database/utils/transaction.js +0 -130
- package/dist/database/utils/transaction.js.map +0 -1
- package/dist/database/validators/connection.validator.d.ts +0 -20
- package/dist/database/validators/connection.validator.js +0 -267
- package/dist/database/validators/connection.validator.js.map +0 -1
- package/dist/database/validators/query.validator.d.ts +0 -31
- package/dist/database/validators/query.validator.js +0 -305
- package/dist/database/validators/query.validator.js.map +0 -1
- package/dist/database/validators/schema.validator.d.ts +0 -31
- package/dist/database/validators/schema.validator.js +0 -334
- package/dist/database/validators/schema.validator.js.map +0 -1
- package/dist/graph/graph.service.d.ts +0 -278
- package/dist/graph/graph.service.js +0 -687
- package/dist/graph/graph.service.js.map +0 -1
- package/dist/graph/types/connection.types.d.ts +0 -158
- package/dist/graph/types/connection.types.js +0 -43
- package/dist/graph/types/connection.types.js.map +0 -1
- package/dist/graph/types/graph.types.d.ts +0 -144
- package/dist/graph/types/graph.types.js +0 -84
- package/dist/graph/types/graph.types.js.map +0 -1
- package/dist/graph/types/node.types.d.ts +0 -193
- package/dist/graph/types/node.types.js +0 -49
- package/dist/graph/types/node.types.js.map +0 -1
- package/dist/graph/types/path.types.d.ts +0 -224
- package/dist/graph/types/path.types.js +0 -38
- package/dist/graph/types/path.types.js.map +0 -1
- package/dist/graph/types/query.types.d.ts +0 -247
- package/dist/graph/types/query.types.js +0 -23
- package/dist/graph/types/query.types.js.map +0 -1
- package/dist/graph/types/relationship.types.d.ts +0 -224
- package/dist/graph/types/relationship.types.js +0 -35
- package/dist/graph/types/relationship.types.js.map +0 -1
- package/dist/graph/types/result.types.d.ts +0 -237
- package/dist/graph/types/result.types.js +0 -7
- package/dist/graph/types/result.types.js.map +0 -1
- package/dist/graph/validators/index.d.ts +0 -81
- package/dist/graph/validators/index.js +0 -243
- package/dist/graph/validators/index.js.map +0 -1
- package/dist/integrationsBuilder/services/integration.service.d.ts +0 -138
- package/dist/integrationsBuilder/services/integration.service.js +0 -1148
- package/dist/integrationsBuilder/services/integration.service.js.map +0 -1
- package/dist/integrationsBuilder/services/integrationBuilder.service.d.ts +0 -130
- package/dist/integrationsBuilder/services/integrationBuilder.service.js +0 -1017
- package/dist/integrationsBuilder/services/integrationBuilder.service.js.map +0 -1
- package/dist/integrationsBuilder/utils/objects.utils.d.ts +0 -2
- package/dist/integrationsBuilder/utils/objects.utils.js +0 -48
- package/dist/integrationsBuilder/utils/objects.utils.js.map +0 -1
- package/dist/integrationsBuilder/utils/string.utils.d.ts +0 -1
- package/dist/integrationsBuilder/utils/string.utils.js +0 -9
- package/dist/integrationsBuilder/utils/string.utils.js.map +0 -1
- package/dist/integrationsBuilder/validators/index.d.ts +0 -18
- package/dist/integrationsBuilder/validators/index.js +0 -38
- package/dist/integrationsBuilder/validators/index.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js +0 -10
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.d.ts +0 -4
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js +0 -26
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js +0 -10
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js +0 -60
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js +0 -9
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js.map +0 -1
- package/dist/postman.d.ts +0 -1
- package/dist/postman.js +0 -21674
- package/dist/postman.js.map +0 -1
- package/dist/processor/utils/mongo.util.d.ts +0 -0
- package/dist/processor/utils/mongo.util.js +0 -152
- package/dist/processor/utils/mongo.util.js.map +0 -1
- package/dist/processor/utils/postgres.util.d.ts +0 -14
- package/dist/processor/utils/postgres.util.js +0 -83
- package/dist/processor/utils/postgres.util.js.map +0 -1
- package/dist/products/services/utils/crypt.utils.d.ts +0 -1
- package/dist/products/services/utils/crypt.utils.js +0 -17
- package/dist/products/services/utils/crypt.utils.js.map +0 -1
- package/dist/products/services/utils/functions.utils.d.ts +0 -13
- package/dist/products/services/utils/functions.utils.js +0 -289
- package/dist/products/services/utils/functions.utils.js.map +0 -1
- package/dist/products/services/utils/objects.utils.d.ts +0 -13
- package/dist/products/services/utils/objects.utils.js +0 -89
- package/dist/products/services/utils/objects.utils.js.map +0 -1
- package/dist/products/services/utils/string.utils.d.ts +0 -12
- package/dist/products/services/utils/string.utils.js +0 -168
- package/dist/products/services/utils/string.utils.js.map +0 -1
- package/dist/products/validators/joi-validators/create.product.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.product.validator.js +0 -10
- package/dist/products/validators/joi-validators/create.product.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +0 -14
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +0 -696
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +0 -7
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +0 -72
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +0 -1
- package/dist/test.appBuilder.js +0 -14
- package/dist/test.appBuilder.js.map +0 -1
- package/dist/test.import.d.ts +0 -0
- package/dist/test.import.js +0 -24
- package/dist/test.import.js.map +0 -1
- package/dist/test.imports.js +0 -28
- package/dist/test.imports.js.map +0 -1
- package/dist/test.integrationBuilder.js +0 -276
- package/dist/test.integrationBuilder.js.map +0 -1
- package/dist/test.processor.d.ts +0 -1
- package/dist/test.processor.js +0 -23
- package/dist/test.processor.js.map +0 -1
- package/dist/test.utils.d.ts +0 -1
- package/dist/test.utils.js +0 -25
- package/dist/test.utils.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/integrationsBuilder.types.d.ts +0 -276
- package/dist/types/integrationsBuilder.types.js +0 -51
- package/dist/types/integrationsBuilder.types.js.map +0 -1
- /package/dist/{test.appBuilder.d.ts → test/test.database.d.ts} +0 -0
- /package/dist/{test.imports.d.ts → test/test.storage.d.ts} +0 -0
- /package/dist/{test.integrationBuilder.d.ts → test/test.triggers.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GraphService } from './graph/graph.service';
|
|
3
|
-
import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductJobs, IProductStorage, IProcessorInput, IActionProcessorInput, IDBActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IGenerateWebhookLink, IAppAuth, IMessageBrokerPublishInput, IMessageBrokerSubscribeInput, IProductMessageBrokerTopic, IAppAction, IProductDatabaseMigration, IProductGraph, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, ISessionInput, IActionUpdate, IProductFallback, IFetchFilesPayload, ISessionPayload, ISessionRefreshPayload, IFetchUsersPayload, IProductAppHealth } from './types';
|
|
1
|
+
import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductEnv, IProductJobs, IProductStorage, IActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IRegisterWebhook, IGenerateWebhookLink, IAppAuth, IProductMessageBrokerTopic, IAppAction, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, IActionUpdate, IProductFallback, IFetchUsersPayload, IProductAppHealth, IActionDispatchInput, INotificationDispatchInput, IStorageDispatchInput, IPublishDispatchInput, IDispatchResult } from './types';
|
|
4
2
|
import { IDuctapeInit } from './types/index.types';
|
|
5
3
|
import { PublicStates } from './types/enums';
|
|
6
|
-
import {
|
|
4
|
+
import { DatabaseService, IActionCreateOptions, IActionUpdateOptions, ISimpleSchemaDefinition, ISimpleCreateOptions, ISimpleDropOptions, ISimpleFieldDefinition, SimpleFieldType, ISimpleIndexOptions, ISchemaOperationResult, IIndexFieldDefinition, ITableSchema, IIndexInfo } from './database';
|
|
5
|
+
import { IConstraintDefinition as IMigrationConstraintDefinition } from './database/types/migration.interface';
|
|
6
|
+
import { IDBActionDispatchInput } from './types/processor.types';
|
|
7
|
+
import { GraphService } from './graph';
|
|
8
|
+
import { WorkflowService } from './workflows';
|
|
9
|
+
import { AgentsService } from './agents';
|
|
10
|
+
import { ModelService } from './models';
|
|
11
|
+
import { VectorDatabaseService } from './vector';
|
|
12
|
+
import { IShareCredentialsConfig } from './apps/utils/credential-manager';
|
|
13
|
+
import { IOAuthConfig } from './apps/utils/oauth-manager';
|
|
14
|
+
import { JobsService, JobStatus, IJobListOptions, ICancelOptions, IRetryOptions, IRescheduleOptions, IJobWebhookConfig } from './jobs';
|
|
15
|
+
import { SecretsService, ICreateSecretInput, IUpdateSecretInput, ISecretMetadata, ISecret, IResolveSecretsOptions } from './secrets';
|
|
7
16
|
/**
|
|
8
17
|
* @typedef {Object} IProduct
|
|
9
18
|
* @property {string} tag - Unique product tag.
|
|
@@ -210,31 +219,40 @@ import { IWorkspaceSecret } from './api/services/workspaceSecretsApi.service';
|
|
|
210
219
|
* @property {any} input - Health check input data.
|
|
211
220
|
* @see ts/src/types/productsBuilder.types.ts
|
|
212
221
|
*/
|
|
213
|
-
export
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
222
|
+
export { GraphService } from './graph';
|
|
223
|
+
export { GraphType, TraversalDirection, NodeIndexType, NodeConstraintType, GraphIsolationLevel, GraphTransactionStatus, GraphErrorType, GraphFeature, GraphSortOrder, } from './graph';
|
|
224
|
+
export type { IGraphEnvConfig, IGraphConfig, IGraphConnectionConfig, IGraphConnectionOptions, IGraphConnectionResult, IGraphConnectionContext, IGraphServiceConfig, IGraphTestConnectionResult, IGraphFilterOperator, IGraphWhereClause, IRawQueryOptions, IRawQueryResult, ICountNodesOptions, ICountNodesResult, ICountRelationshipsOptions, ICountRelationshipsResult, IGraphStatistics, IFullTextSearchOptions, IFullTextSearchResult, IVectorSearchOptions, IVectorSearchResult, NodeProperties, INode, ICreateNodeOptions, ICreateNodeResult, IFindNodesOptions, IGraphOrderBy, IFindNodesResult, IUpdateNodeOptions, INodePropertyUpdate, IUpdateNodeResult, IDeleteNodeOptions, IDeleteNodeResult, IMergeNodeOptions, IMergeNodeResult, INodeFilter, RelationshipProperties, IRelationship, ICreateRelationshipOptions, ICreateRelationshipResult, IFindRelationshipsOptions, IFindRelationshipsResult, IUpdateRelationshipOptions, IRelationshipPropertyUpdate, IUpdateRelationshipResult, IDeleteRelationshipOptions, IDeleteRelationshipResult, IMergeRelationshipOptions, IMergeRelationshipResult, IRelationshipFilter, ICreateRelationshipIndexOptions, IPath, ITraverseOptions, ITraverseResult, IShortestPathOptions, IShortestPathResult, IAllPathsOptions, IAllPathsResult, INeighborhoodOptions, INeighborhoodResult, IConnectedComponentsOptions, IConnectedComponent, IConnectedComponentsResult, IGraphTransaction, IGraphTransactionOptions, TransactionCallback, IGraphTransactionResult, ICreateNodeIndexOptions, ICreateNodeConstraintOptions, IGraphIndex, IGraphConstraint, IListIndexesResult, IListConstraintsResult, ICreateIndexResult, ICreateConstraintResult, IDropIndexResult, IDropConstraintResult, GraphPropertyType, IGraphLabelProperty, IGraphLabel, IListLabelsResult, IGraphRelationshipType, IListRelationshipTypesResult, GraphActionParameterType, IGraphActionParameter, IGraphAction, ICreateGraphActionOptions, IUpdateGraphActionOptions, IExecuteGraphActionOptions, IExecuteGraphActionResult, IListGraphActionsResult, } from './graph';
|
|
225
|
+
export { GraphError } from './graph';
|
|
226
|
+
export { BaseGraphAdapter, Neo4jAdapter, NeptuneAdapter, ArangoDBAdapter, MemgraphAdapter, GraphAdapterFactory, } from './graph';
|
|
227
|
+
export type { IAdapterConnectionOptions } from './graph';
|
|
228
|
+
export { WorkflowService, WorkflowError, workflowService } from './workflows';
|
|
229
|
+
export { WorkflowBuilder, createWorkflow } from './workflows';
|
|
230
|
+
export type { IWorkflowServiceConfig, IWorkflowConfig, IWorkflowContext, IWorkflowContextMeta, IDefineWorkflowOptions, IExecuteWorkflowOptions, IWorkflowExecutionResult, IWorkflowDispatchInput, IWorkflowDispatchResult, IWorkflowSchedule, ISendSignalOptions, IQueryWorkflowOptions, IWorkflowActionContext, IWorkflowDatabaseContext, IWorkflowGraphContext, IWorkflowNotificationContext, IWorkflowStorageContext, IWorkflowPublishContext, IWorkflowFeatureContext, IWorkflowQuotaContext, IWorkflowFallbackContext, IWorkflowHealthcheckContext, WorkflowHandler, IStepBuilder, IRollbackBuilder, IWorkflowBuilder, } from './workflows';
|
|
231
|
+
export { AgentsService, AgentError, agentsService } from './agents';
|
|
232
|
+
export { AgentExecutor, AgentContext, ToolRegistry, MemoryManager, createLLMProvider, AnthropicProvider, OpenAIProvider, VectorServiceAdapter, createVectorStoreAdapter, createPineconeAdapter, createQdrantAdapter, createWeaviateAdapter, createMemoryAdapter, } from './agents';
|
|
233
|
+
export type { IAgentServiceConfig, IDefineAgentOptions, IDefinedAgent, IRunAgentOptions, IAgentExecutionResult, IDispatchAgentOptions, IDispatchAgentResult, ISendAgentSignalOptions, IAgentStatusOptions, IAgentState, IListAgentExecutionsOptions, IAgentExecutionListResult, IAgentTool, IAgentToolSchema, IToolParam, IToolCallResult, ILLMConfig, LLMProvider, IAgentMemoryConfig, IAgentTerminationConfig, IAgentStreamEvent, IAgentToolContext, IConversationMessage, ITokenUsage, AgentStatus, IHumanInLoopConfig, IApprovalRequest, IApprovalResponse, IMultiAgentWorkflow, MultiAgentMode, } from './agents';
|
|
234
|
+
export { StorageService, StorageError } from './storage';
|
|
235
|
+
export { uploadBlobToCloud, downloadBlobFromCloud, deleteBlobFromCloud, listBlobsInCloud, generateSignedUrl, } from './storage';
|
|
236
|
+
export type { IStorageServiceConfig, IUploadOptions, IDownloadOptions, IDeleteOptions, IListFilesOptions, ISignedUrlOptions, IStorageResult, IDownloadResult, IDeleteResult as IStorageDeleteResult, IListFilesResult, ISignedUrlResult, IStorageDispatchOptions, IStorageDispatchResult, IStorageProviderConfig, IStorageFileInfo, } from './storage';
|
|
237
|
+
export { SessionsService, SessionError } from './sessions';
|
|
238
|
+
export type { ISessionServiceConfig, ICreateSessionOptions, IRefreshSessionOptions, IVerifySessionOptions, IRevokeSessionOptions, IListSessionsOptions, IDefineSessionOptions, ISessionResult, IVerifyResult, IListSessionsResult, ISessionInfo, ISessionSchema, ISessionSchemaField, ISessionContext, IDefinedSession, } from './sessions';
|
|
239
|
+
export { CacheService, CacheError } from './cache';
|
|
240
|
+
export type { ICacheServiceConfig, ICacheValue, IFetchCacheValuesOptions, IFetchCacheValuesResult, IFetchCacheDashboardOptions, ICacheDashboardMetrics, IClearCacheValueOptions, IClearCacheValuesOptions, IClearCacheValuesResult, ISetCacheValueOptions, IGetCacheValueOptions, IDeleteCacheValueOptions, IDeleteCacheValuesOptions, IDeleteCacheValuesResult, } from './cache';
|
|
241
|
+
export { BrokersService, BrokerError } from './brokers';
|
|
242
|
+
export { RabbitMQService, KafkaService, SQSService, RedisService, GooglePubSubService, loadBrokerService, parseEventString, isValidSqsUrl, getSqsQueueUrl, } from './brokers';
|
|
243
|
+
export type { IBrokerServiceConfig, IPublishOptions, ISubscribeOptions, IPublishResult, ISubscribeResult, IMessageBrokerService, BrokerConfig, IBrokerBootstrapData, IBrokerDispatchOptions, } from './brokers';
|
|
244
|
+
export { NotificationsService, notificationsService } from './notifications';
|
|
245
|
+
export { NotificationChannelType, PushNotificationProvider, SmsProvider } from './notifications';
|
|
246
|
+
export type { IFirebaseCredential, IPushNotificationHandler, IPushNotificationInput, IPushOptions, IEmailHandler, IEmailInput, IEmailOptions, ISmsHandler, ISmsInput, ISmsOptions, ICallbackHandler, ICallbackInput, ICallbackOptions, INotificationTemplate, INotificationEnvConfig, INotificationDefinition, INotificationsServiceConfig, INotificationResult, IMultiChannelNotificationResult, INotificationOptions, } from './notifications';
|
|
247
|
+
export { VectorDatabaseService, VectorService, createVectorService, createMemoryVectorService, VectorError, } from './vector';
|
|
248
|
+
export type { IVectorDatabaseServiceConfig, ICreateVectorDbOptions, IVectorDbEnvConfig, IUpdateVectorDbOptions, IFetchVectorOptions, IDeleteVectorConfigOptions, IProductVectorQueryOptions, IProductVectorUpsertOptions, IProductVectorFetchOptions, IProductVectorDeleteOptions, } from './vector';
|
|
249
|
+
export { BaseVectorAdapter, PineconeAdapter, QdrantAdapter, WeaviateAdapter, MemoryAdapter } from './vector';
|
|
250
|
+
export { VectorDBType, DistanceMetric, VectorIndexType, VectorErrorType, VectorFeature } from './vector';
|
|
251
|
+
export type { IVectorServiceOptions, IAdapterConnectionOptions as IVectorAdapterConnectionOptions, IVectorEnvConfig, IVectorConfig, IVectorConnectionConfig, IVectorConnectionOptions, IVectorConnectionResult, IVectorConnectionContext, IVectorServiceConfig, IVectorTestConnectionResult, VectorMetadata, IVector, ISparseVector, IUpsertVectorsOptions, IUpsertVectorsResult, IMetadataFilter, MetadataFilterOperator, IMetadataFilterGroup, IQueryVectorsOptions, IQueryMatch, IQueryVectorsResult, IFetchVectorsOptions, IFetchVectorsResult, IUpdateVectorOptions, IUpdateVectorResult, IDeleteVectorsOptions, IDeleteVectorsResult, IListVectorsOptions, IListVectorsResult, INamespaceInfo, IListNamespacesResult, IVectorIndexInfo, ICreateIndexOptions as IVectorCreateIndexOptions, ICreateIndexResult as IVectorCreateIndexResult, IDeleteIndexOptions as IVectorDeleteIndexOptions, IDeleteIndexResult as IVectorDeleteIndexResult, IVectorIndexStats, EmbeddingProvider, IEmbeddingModelConfig, IEmbedOptions, IEmbeddingResult, IBatchEmbeddingResult, IEmbeddingProvider, IOpenAIEmbeddingConfig, ICohereEmbeddingConfig, IVoyageEmbeddingConfig, IJinaEmbeddingConfig, IHuggingFaceEmbeddingConfig, ILocalEmbeddingConfig, } from './vector';
|
|
252
|
+
export { SecretsService } from './secrets';
|
|
253
|
+
export { SECRET_PATTERN, SECRET_PATTERN_GLOBAL, SecretNotFoundError, SecretScopeError, SecretEnvironmentError, SecretExpiredError, SecretRevokedError, SecretResolutionError, isSecretReference, containsSecretReferences, extractSecretKeys, findAllSecretReferences, mightContainSecrets, } from './secrets';
|
|
254
|
+
export type { SecretTokenType, ICreateSecretInput, IUpdateSecretInput, ISecretMetadata, ISecret, ISecretCheck, IResolveSecretsOptions, ISecretResolutionResult, ISecretsServiceConfig, ISecretsService, } from './secrets';
|
|
236
255
|
export interface IDuctape {
|
|
237
|
-
secrets: IDuctapeSecrets;
|
|
238
256
|
}
|
|
239
257
|
export default class Ductape implements IDuctape {
|
|
240
258
|
private user_id;
|
|
@@ -249,15 +267,19 @@ export default class Ductape implements IDuctape {
|
|
|
249
267
|
private appApi;
|
|
250
268
|
private productsApi;
|
|
251
269
|
private workspaceApi;
|
|
252
|
-
private
|
|
253
|
-
private
|
|
270
|
+
private productBuilders;
|
|
271
|
+
private appBuilders;
|
|
272
|
+
private _databaseService;
|
|
273
|
+
private _graphService;
|
|
274
|
+
private _workflowService;
|
|
275
|
+
private _agentsService;
|
|
276
|
+
private _modelService;
|
|
277
|
+
private _vectorService;
|
|
278
|
+
private _cacheService;
|
|
279
|
+
private _jobsService;
|
|
280
|
+
private _secretsService;
|
|
254
281
|
private loggerService;
|
|
255
|
-
private appBuilder;
|
|
256
282
|
private importService;
|
|
257
|
-
private databaseService;
|
|
258
|
-
private graphService;
|
|
259
|
-
private productInit;
|
|
260
|
-
private appInit;
|
|
261
283
|
private environment;
|
|
262
284
|
private redis_url;
|
|
263
285
|
private redisClient?;
|
|
@@ -295,12 +317,12 @@ export default class Ductape implements IDuctape {
|
|
|
295
317
|
* @param {string} public_key - The public key.
|
|
296
318
|
*/
|
|
297
319
|
setPublicKey(public_key: string): void;
|
|
298
|
-
private
|
|
299
|
-
private
|
|
300
|
-
private
|
|
301
|
-
private
|
|
320
|
+
private getProductBuilder;
|
|
321
|
+
private getAppBuilder;
|
|
322
|
+
private initProductBuilder;
|
|
323
|
+
private initAppBuilder;
|
|
302
324
|
/**
|
|
303
|
-
* Product-related operations for managing products
|
|
325
|
+
* Product-related operations for managing products.
|
|
304
326
|
*/
|
|
305
327
|
product: {
|
|
306
328
|
/**
|
|
@@ -323,81 +345,99 @@ export default class Ductape implements IDuctape {
|
|
|
323
345
|
*/
|
|
324
346
|
update: (tag: string, data: Partial<IProduct>) => Promise<void>;
|
|
325
347
|
/**
|
|
326
|
-
* Initializes a product by tag.
|
|
327
|
-
* @param {string}
|
|
348
|
+
* Initializes a product by tag (pre-loads builder into cache).
|
|
349
|
+
* @param {string} product - The product tag.
|
|
328
350
|
* @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
|
|
329
351
|
*/
|
|
330
|
-
init: (
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
352
|
+
init: (product: string) => Promise<void>;
|
|
353
|
+
/**
|
|
354
|
+
* Updates data validation for a product.
|
|
355
|
+
* @param {string} product - The product tag.
|
|
356
|
+
* @param {string} tag - The validation tag.
|
|
357
|
+
* @param {Partial<IParsedSample>} update - The update data.
|
|
358
|
+
* @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
|
|
359
|
+
*/
|
|
360
|
+
updateValidation: (product: string, tag: string, update: Partial<IParsedSample>) => Promise<boolean>;
|
|
361
|
+
environments: {
|
|
338
362
|
/**
|
|
339
|
-
*
|
|
340
|
-
* @param {string}
|
|
341
|
-
* @param {
|
|
342
|
-
* @returns {Promise<void>} Resolves when the
|
|
363
|
+
* Creates an environment for a product.
|
|
364
|
+
* @param {string} product - The product tag.
|
|
365
|
+
* @param {IProductEnv} data - The environment data.
|
|
366
|
+
* @returns {Promise<void>} Resolves when the environment is created. Throws on error.
|
|
343
367
|
*/
|
|
344
|
-
|
|
368
|
+
create: (product: string, data: IProductEnv) => Promise<void>;
|
|
345
369
|
/**
|
|
346
|
-
* Fetches all product
|
|
347
|
-
* @
|
|
370
|
+
* Fetches all environments for a product.
|
|
371
|
+
* @param {string} product - The product tag.
|
|
372
|
+
* @returns {IAppEnv[]} The list of environments.
|
|
348
373
|
*/
|
|
349
|
-
|
|
374
|
+
list: (product: string) => Promise<IProductEnv[]>;
|
|
350
375
|
/**
|
|
351
|
-
* Fetches
|
|
352
|
-
* @param {string}
|
|
353
|
-
* @
|
|
376
|
+
* Fetches an environment by slug.
|
|
377
|
+
* @param {string} product - The product tag.
|
|
378
|
+
* @param {string} slug - The environment slug.
|
|
379
|
+
* @returns {IAppEnv|null} The fetched environment, or null if not found.
|
|
354
380
|
*/
|
|
355
|
-
fetch: (
|
|
381
|
+
fetch: (product: string, slug: string) => Promise<IProductEnv>;
|
|
356
382
|
/**
|
|
357
|
-
*
|
|
358
|
-
* @param {
|
|
359
|
-
* @
|
|
383
|
+
* Updates an environment by slug.
|
|
384
|
+
* @param {string} product - The product tag.
|
|
385
|
+
* @param {string} slug - The environment slug.
|
|
386
|
+
* @param {Partial<IProductEnv>} data - The environment data to update.
|
|
387
|
+
* @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
|
|
360
388
|
*/
|
|
361
|
-
|
|
389
|
+
update: (product: string, slug: string, data: Partial<IProductEnv>) => Promise<void>;
|
|
362
390
|
};
|
|
363
391
|
apps: {
|
|
364
392
|
/**
|
|
365
393
|
* Connects an app to a product by app tag.
|
|
394
|
+
* @param {string} product - The product tag.
|
|
366
395
|
* @param {string} appTag - The app tag.
|
|
367
396
|
* @returns {Promise<IAppAccess>} The result of the connection.
|
|
368
397
|
*/
|
|
369
|
-
connect: (appTag: string) => Promise<import("./types").IAppAccess>;
|
|
398
|
+
connect: (product: string, appTag: string) => Promise<import("./types").IAppAccess>;
|
|
370
399
|
/**
|
|
371
400
|
* Adds an app to a product.
|
|
401
|
+
* @param {string} product - The product tag.
|
|
372
402
|
* @param {IProductApp} app - The app data.
|
|
373
403
|
* @returns {Promise<void>} Resolves when the app is added. Throws on error.
|
|
374
404
|
*/
|
|
375
|
-
add: (app: IProductApp) => Promise<void>;
|
|
405
|
+
add: (product: string, app: IProductApp) => Promise<void>;
|
|
376
406
|
/**
|
|
377
407
|
* Fetches all apps for a product.
|
|
408
|
+
* @param {string} product - The product tag.
|
|
378
409
|
* @returns {IProductApp[]} The list of apps.
|
|
379
410
|
*/
|
|
380
|
-
|
|
411
|
+
list: (product: string) => Promise<IProductApp[]>;
|
|
381
412
|
/**
|
|
382
413
|
* Fetches an app by tag.
|
|
414
|
+
* @param {string} product - The product tag.
|
|
383
415
|
* @param {string} tag - The app tag.
|
|
384
416
|
* @returns {IProductApp|null} The fetched app, or null if not found.
|
|
385
417
|
*/
|
|
386
|
-
fetch: (tag: string) => Promise<IProductApp>;
|
|
418
|
+
fetch: (product: string, tag: string) => Promise<IProductApp>;
|
|
387
419
|
/**
|
|
388
420
|
* Updates an app by access tag.
|
|
421
|
+
* @param {string} product - The product tag.
|
|
389
422
|
* @param {string} accessTag - The app access tag.
|
|
390
423
|
* @param {Partial<IProductApp>} data - The app data to update.
|
|
391
424
|
* @returns {Promise<void>} Resolves when the app is updated. Throws on error.
|
|
392
425
|
*/
|
|
393
|
-
update: (accessTag: string, data: Partial<IProductApp>) => Promise<void>;
|
|
426
|
+
update: (product: string, accessTag: string, data: Partial<IProductApp>) => Promise<void>;
|
|
394
427
|
webhooks: {
|
|
395
428
|
/**
|
|
396
429
|
* Fetches all webhooks for an app by access tag.
|
|
430
|
+
* @param {string} product - The product tag.
|
|
397
431
|
* @param {string} accessTag - The app access tag.
|
|
398
432
|
* @returns {Promise<IAppWebhook[]>} The list of webhooks.
|
|
399
433
|
*/
|
|
400
|
-
|
|
434
|
+
list: (product: string, accessTag: string) => Promise<IAppWebhook[]>;
|
|
435
|
+
/**
|
|
436
|
+
* Enables a webhook for an app.
|
|
437
|
+
* @param {IRegisterWebhook} data - The webhook registration data.
|
|
438
|
+
* @returns {Promise<void>} Resolves when the webhook is enabled. Throws on error.
|
|
439
|
+
*/
|
|
440
|
+
enable: (data: IRegisterWebhook) => Promise<void>;
|
|
401
441
|
/**
|
|
402
442
|
* Generates a webhook link for an app.
|
|
403
443
|
* @param {IGenerateWebhookLink} data - The webhook link data.
|
|
@@ -408,443 +448,1522 @@ export default class Ductape implements IDuctape {
|
|
|
408
448
|
health: {
|
|
409
449
|
/**
|
|
410
450
|
* Creates a health check for an app.
|
|
451
|
+
* @param {string} product - The product tag.
|
|
411
452
|
* @param {Partial<IProductAppHealth>} data - The health check data.
|
|
412
453
|
* @returns {Promise<void>} Resolves when the health check is created. Throws on error.
|
|
413
454
|
*/
|
|
414
|
-
create: (data: Partial<IProductAppHealth>) => Promise<void>;
|
|
455
|
+
create: (product: string, data: Partial<IProductAppHealth>) => Promise<void>;
|
|
415
456
|
/**
|
|
416
457
|
* Updates a health check by tag.
|
|
458
|
+
* @param {string} product - The product tag.
|
|
417
459
|
* @param {string} tag - The health check tag.
|
|
418
460
|
* @param {Partial<IProductAppHealth>} data - The health check data to update.
|
|
419
461
|
* @returns {Promise<void>} Resolves when the health check is updated. Throws on error.
|
|
420
462
|
*/
|
|
421
|
-
update: (tag: string, data: Partial<IProductAppHealth>) => Promise<void>;
|
|
463
|
+
update: (product: string, tag: string, data: Partial<IProductAppHealth>) => Promise<void>;
|
|
422
464
|
/**
|
|
423
465
|
* Fetches a health check by access tag and tag.
|
|
466
|
+
* @param {string} product - The product tag.
|
|
424
467
|
* @param {string} access_tag - The app access tag.
|
|
425
468
|
* @param {string} tag - The health check tag.
|
|
426
469
|
* @returns {Promise<IProductAppHealth|null>} The fetched health check, or null if not found.
|
|
427
470
|
*/
|
|
428
|
-
fetch: (access_tag: string, tag: string) => Promise<IProductAppHealth>;
|
|
471
|
+
fetch: (product: string, access_tag: string, tag: string) => Promise<IProductAppHealth>;
|
|
429
472
|
/**
|
|
430
473
|
* Fetches all health checks for an app by access tag.
|
|
474
|
+
* @param {string} product - The product tag.
|
|
431
475
|
* @param {string} access_tag - The app access tag.
|
|
432
476
|
* @returns {Promise<IProductAppHealth[]>} The list of health checks.
|
|
433
477
|
*/
|
|
434
|
-
|
|
478
|
+
list: (product: string, access_tag: string) => Promise<IProductAppHealth[]>;
|
|
435
479
|
};
|
|
436
480
|
};
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Session-related operations for managing product sessions.
|
|
484
|
+
*/
|
|
485
|
+
sessions: {
|
|
486
|
+
/**
|
|
487
|
+
* Creates a new product session.
|
|
488
|
+
* @param {string} product - The product tag.
|
|
489
|
+
* @param {IProductSession} payload - The session payload.
|
|
490
|
+
* @returns {Promise<void>} Resolves when the session is created. Throws on error.
|
|
491
|
+
*/
|
|
492
|
+
create: (product: string, payload: IProductSession) => Promise<void>;
|
|
493
|
+
/**
|
|
494
|
+
* Updates a product session by tag.
|
|
495
|
+
* @param {string} product - The product tag.
|
|
496
|
+
* @param {string} tag - The session tag.
|
|
497
|
+
* @param {Partial<IProductSession>} payload - The session data to update.
|
|
498
|
+
* @returns {Promise<void>} Resolves when the session is updated. Throws on error.
|
|
499
|
+
*/
|
|
500
|
+
update: (product: string, tag: string, payload: Partial<IProductSession>) => Promise<void>;
|
|
501
|
+
/**
|
|
502
|
+
* Fetches all product sessions.
|
|
503
|
+
* @param {string} product - The product tag.
|
|
504
|
+
* @returns {IProductSession[]} The list of sessions.
|
|
505
|
+
*/
|
|
506
|
+
list: (product: string) => Promise<IProductSession[]>;
|
|
507
|
+
/**
|
|
508
|
+
* Fetches a product session by tag.
|
|
509
|
+
* @param {string} product - The product tag.
|
|
510
|
+
* @param {string} tag - The session tag.
|
|
511
|
+
* @returns {IProductSession|null} The fetched session, or null if not found.
|
|
512
|
+
*/
|
|
513
|
+
fetch: (product: string, tag: string) => Promise<IProductSession>;
|
|
514
|
+
/**
|
|
515
|
+
* Fetches users for a session.
|
|
516
|
+
* @param {string} product - The product tag.
|
|
517
|
+
* @param {IFetchUsersPayload} data - The user fetch payload.
|
|
518
|
+
* @returns {Promise<any[]>} The users for the session.
|
|
519
|
+
*/
|
|
520
|
+
users: (product: string, data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
|
|
521
|
+
/**
|
|
522
|
+
* Deletes a product session by tag.
|
|
523
|
+
* @param {string} product - The product tag.
|
|
524
|
+
* @param {string} tag - The session tag.
|
|
525
|
+
* @returns {Promise<void>} Resolves when the session is deleted. Throws on error.
|
|
526
|
+
*/
|
|
527
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
528
|
+
/**
|
|
529
|
+
* Starts a new session and generates session tokens.
|
|
530
|
+
* @param data - The session input data.
|
|
531
|
+
* @returns The generated session tokens.
|
|
532
|
+
*/
|
|
533
|
+
start: (data: {
|
|
534
|
+
product: string;
|
|
535
|
+
env: string;
|
|
536
|
+
tag: string;
|
|
537
|
+
data: Record<string, unknown>;
|
|
538
|
+
}) => Promise<import("./sessions").ISessionResult>;
|
|
539
|
+
/**
|
|
540
|
+
* Verifies a session token.
|
|
541
|
+
* @param data - The session verification payload.
|
|
542
|
+
* @returns The verification result with session data.
|
|
543
|
+
*/
|
|
544
|
+
verify: (data: {
|
|
545
|
+
product: string;
|
|
546
|
+
env: string;
|
|
547
|
+
tag: string;
|
|
548
|
+
token: string;
|
|
549
|
+
}) => Promise<import("./sessions").IVerifyResult>;
|
|
550
|
+
/**
|
|
551
|
+
* Refreshes a session using the refresh token.
|
|
552
|
+
* @param data - The session refresh payload.
|
|
553
|
+
* @returns The new session tokens.
|
|
554
|
+
*/
|
|
555
|
+
refresh: (data: {
|
|
556
|
+
product: string;
|
|
557
|
+
env: string;
|
|
558
|
+
tag: string;
|
|
559
|
+
refreshToken: string;
|
|
560
|
+
}) => Promise<import("./sessions").ISessionResult>;
|
|
561
|
+
/**
|
|
562
|
+
* Revokes a session.
|
|
563
|
+
* @param data - The session revocation payload.
|
|
564
|
+
* @returns The revocation result.
|
|
565
|
+
*/
|
|
566
|
+
revoke: (data: {
|
|
567
|
+
product: string;
|
|
568
|
+
env: string;
|
|
569
|
+
tag: string;
|
|
570
|
+
sessionId?: string;
|
|
571
|
+
identifier?: string;
|
|
572
|
+
}) => Promise<void>;
|
|
573
|
+
/**
|
|
574
|
+
* Lists active sessions with pagination.
|
|
575
|
+
* @param data - The list sessions payload.
|
|
576
|
+
* @returns The list of sessions with pagination info.
|
|
577
|
+
*/
|
|
578
|
+
listActive: (data: {
|
|
579
|
+
product: string;
|
|
580
|
+
env: string;
|
|
581
|
+
tag: string;
|
|
582
|
+
identifier?: string;
|
|
583
|
+
page?: number;
|
|
584
|
+
limit?: number;
|
|
585
|
+
}) => Promise<import("./sessions").IListSessionsResult>;
|
|
586
|
+
};
|
|
587
|
+
/**
|
|
588
|
+
* Quota-related operations for managing product quotas.
|
|
589
|
+
*/
|
|
590
|
+
quota: {
|
|
437
591
|
/**
|
|
438
592
|
* Creates a quota for a product.
|
|
593
|
+
* @param {string} product - The product tag.
|
|
439
594
|
* @param {Partial<IProductQuota>} data - The quota data.
|
|
440
595
|
* @returns {Promise<void>} Resolves when the quota is created. Throws on error.
|
|
441
596
|
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
597
|
+
create: (product: string, data: Partial<IProductQuota>) => Promise<void>;
|
|
598
|
+
/**
|
|
599
|
+
* Fetches a quota by tag.
|
|
600
|
+
* @param {string} product - The product tag.
|
|
601
|
+
* @param {string} tag - The quota tag.
|
|
602
|
+
* @returns {IProductQuota|null} The fetched quota, or null if not found.
|
|
603
|
+
*/
|
|
604
|
+
fetch: (product: string, tag: string) => Promise<IProductQuota>;
|
|
605
|
+
/**
|
|
606
|
+
* Fetches all quotas for a product.
|
|
607
|
+
* @param {string} product - The product tag.
|
|
608
|
+
* @returns {IProductQuota[]} The list of quotas.
|
|
609
|
+
*/
|
|
610
|
+
list: (product: string) => Promise<IProductQuota[]>;
|
|
611
|
+
/**
|
|
612
|
+
* Updates a quota by tag.
|
|
613
|
+
* @param {string} product - The product tag.
|
|
614
|
+
* @param {string} tag - The quota tag.
|
|
615
|
+
* @param {Partial<IProductQuota>} data - The quota data to update.
|
|
616
|
+
* @returns {Promise<void>} Resolves when the quota is updated. Throws on error.
|
|
617
|
+
*/
|
|
618
|
+
update: (product: string, tag: string, data: Partial<IProductQuota>) => Promise<void>;
|
|
619
|
+
/**
|
|
620
|
+
* Deletes a quota by tag.
|
|
621
|
+
* @param {string} product - The product tag.
|
|
622
|
+
* @param {string} tag - The quota tag.
|
|
623
|
+
* @returns {Promise<void>} Resolves when the quota is deleted. Throws on error.
|
|
624
|
+
*/
|
|
625
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
626
|
+
/**
|
|
627
|
+
* Runs a quota with weighted distribution.
|
|
628
|
+
* @param {Object} data - The quota run input.
|
|
629
|
+
* @param {string} data.product - The product tag.
|
|
630
|
+
* @param {string} data.env - The environment slug.
|
|
631
|
+
* @param {string} data.tag - The quota tag.
|
|
632
|
+
* @param {Record<string, unknown>} data.input - The input data for the quota.
|
|
633
|
+
* @returns {Promise<any>} The result of the quota execution.
|
|
634
|
+
*/
|
|
635
|
+
run: (data: {
|
|
636
|
+
product: string;
|
|
637
|
+
env: string;
|
|
638
|
+
tag: string;
|
|
639
|
+
input: Record<string, unknown>;
|
|
640
|
+
}) => Promise<unknown>;
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Fallback-related operations for managing product fallbacks.
|
|
644
|
+
*/
|
|
645
|
+
fallback: {
|
|
463
646
|
/**
|
|
464
647
|
* Creates a fallback for a product.
|
|
648
|
+
* @param {string} product - The product tag.
|
|
465
649
|
* @param {Partial<IProductFallback>} data - The fallback data.
|
|
466
650
|
* @returns {Promise<void>} Resolves when the fallback is created. Throws on error.
|
|
467
651
|
*/
|
|
468
|
-
|
|
469
|
-
|
|
652
|
+
create: (product: string, data: Partial<IProductFallback>) => Promise<void>;
|
|
653
|
+
/**
|
|
654
|
+
* Fetches a fallback by tag.
|
|
655
|
+
* @param {string} product - The product tag.
|
|
656
|
+
* @param {string} tag - The fallback tag.
|
|
657
|
+
* @returns {IProductFallback|null} The fetched fallback, or null if not found.
|
|
658
|
+
*/
|
|
659
|
+
fetch: (product: string, tag: string) => Promise<IProductFallback>;
|
|
660
|
+
/**
|
|
661
|
+
* Fetches all fallbacks for a product.
|
|
662
|
+
* @param {string} product - The product tag.
|
|
663
|
+
* @returns {IProductFallback[]} The list of fallbacks.
|
|
664
|
+
*/
|
|
665
|
+
list: (product: string) => Promise<IProductFallback[]>;
|
|
666
|
+
/**
|
|
667
|
+
* Updates a fallback by tag.
|
|
668
|
+
* @param {string} product - The product tag.
|
|
669
|
+
* @param {string} tag - The fallback tag.
|
|
670
|
+
* @param {Partial<IProductFallback>} data - The fallback data to update.
|
|
671
|
+
* @returns {Promise<void>} Resolves when the fallback is updated. Throws on error.
|
|
672
|
+
*/
|
|
673
|
+
update: (product: string, tag: string, data: Partial<IProductFallback>) => Promise<void>;
|
|
674
|
+
/**
|
|
675
|
+
* Deletes a fallback by tag.
|
|
676
|
+
* @param {string} product - The product tag.
|
|
677
|
+
* @param {string} tag - The fallback tag.
|
|
678
|
+
* @returns {Promise<void>} Resolves when the fallback is deleted. Throws on error.
|
|
679
|
+
*/
|
|
680
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
681
|
+
/**
|
|
682
|
+
* Runs a fallback with sequential failover.
|
|
683
|
+
* @param {Object} data - The fallback run input.
|
|
684
|
+
* @param {string} data.product - The product tag.
|
|
685
|
+
* @param {string} data.env - The environment slug.
|
|
686
|
+
* @param {string} data.tag - The fallback tag.
|
|
687
|
+
* @param {Record<string, unknown>} data.input - The input data for the fallback.
|
|
688
|
+
* @returns {Promise<any>} The result of the fallback execution.
|
|
689
|
+
*/
|
|
690
|
+
run: (data: {
|
|
691
|
+
product: string;
|
|
692
|
+
env: string;
|
|
693
|
+
tag: string;
|
|
694
|
+
input: Record<string, unknown>;
|
|
695
|
+
}) => Promise<unknown>;
|
|
696
|
+
};
|
|
697
|
+
/**
|
|
698
|
+
* Storage-related operations for managing product storages.
|
|
699
|
+
*/
|
|
700
|
+
storage: {
|
|
701
|
+
/**
|
|
702
|
+
* Creates a storage for a product.
|
|
703
|
+
* @param {string} product - The product tag.
|
|
704
|
+
* @param {IProductStorage} data - The storage data.
|
|
705
|
+
* @returns {Promise<void>} Resolves when the storage is created. Throws on error.
|
|
706
|
+
*/
|
|
707
|
+
create: (product: string, data: IProductStorage) => Promise<void>;
|
|
708
|
+
/**
|
|
709
|
+
* Fetches all storages for a product.
|
|
710
|
+
* @param {string} product - The product tag.
|
|
711
|
+
* @returns {IProductStorage[]} The list of storages.
|
|
712
|
+
*/
|
|
713
|
+
list: (product: string) => Promise<IProductStorage[]>;
|
|
714
|
+
/**
|
|
715
|
+
* Fetches a storage by tag.
|
|
716
|
+
* @param {string} product - The product tag.
|
|
717
|
+
* @param {string} tag - The storage tag.
|
|
718
|
+
* @returns {IProductStorage|null} The fetched storage, or null if not found.
|
|
719
|
+
*/
|
|
720
|
+
fetch: (product: string, tag: string) => Promise<IProductStorage>;
|
|
721
|
+
/**
|
|
722
|
+
* Updates a storage by tag.
|
|
723
|
+
* @param {string} product - The product tag.
|
|
724
|
+
* @param {string} tag - The storage tag.
|
|
725
|
+
* @param {Partial<IProductStorage>} data - The storage data to update.
|
|
726
|
+
* @returns {Promise<void>} Resolves when the storage is updated. Throws on error.
|
|
727
|
+
*/
|
|
728
|
+
update: (product: string, tag: string, data: Partial<IProductStorage>) => Promise<void>;
|
|
729
|
+
/**
|
|
730
|
+
* Fetches storage files for a product.
|
|
731
|
+
* @param {string} product - The product tag.
|
|
732
|
+
* @param {IFetchFilesPayload} data - The fetch files payload.
|
|
733
|
+
* @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
|
|
734
|
+
*/
|
|
735
|
+
/**
|
|
736
|
+
* Deletes a storage by tag.
|
|
737
|
+
* @param {string} product - The product tag.
|
|
738
|
+
* @param {string} tag - The storage tag.
|
|
739
|
+
* @returns {Promise<void>} Resolves when the storage is deleted. Throws on error.
|
|
740
|
+
*/
|
|
741
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
742
|
+
/**
|
|
743
|
+
* Reads a file from local storage.
|
|
744
|
+
* @param {string} path - The file path.
|
|
745
|
+
* @returns {Promise<IFileReadResult>} The file read result.
|
|
746
|
+
*/
|
|
747
|
+
readFile: (path: string) => Promise<IFileReadResult>;
|
|
748
|
+
/**
|
|
749
|
+
* Saves data to storage using the storage processor.
|
|
750
|
+
* @param {IStorageProcessorInput} data - The storage processor input.
|
|
751
|
+
* @returns {Promise<any>} The result of the storage processing.
|
|
752
|
+
* @example
|
|
753
|
+
* await ductape.storage.save({
|
|
754
|
+
* product: 'my-product',
|
|
755
|
+
* env: 'production',
|
|
756
|
+
* event: 'upload-file',
|
|
757
|
+
* input: { buffer: fileData, fileName: 'report.pdf', mimeType: 'application/pdf' }
|
|
758
|
+
* });
|
|
759
|
+
* @deprecated Use upload() instead for direct cloud storage operations
|
|
760
|
+
*/
|
|
761
|
+
save: (data: IStorageProcessorInput) => Promise<any>;
|
|
762
|
+
/**
|
|
763
|
+
* Uploads a file to cloud storage.
|
|
764
|
+
* @param {Object} data - The upload options.
|
|
765
|
+
* @returns {Promise<IStorageResult>} The upload result with file URL.
|
|
766
|
+
* @example
|
|
767
|
+
* await ductape.storage.upload({
|
|
768
|
+
* product: 'my-product',
|
|
769
|
+
* env: 'production',
|
|
770
|
+
* storage: 's3-bucket',
|
|
771
|
+
* fileName: 'documents/report.pdf',
|
|
772
|
+
* buffer: fileBuffer,
|
|
773
|
+
* mimeType: 'application/pdf'
|
|
774
|
+
* });
|
|
775
|
+
*/
|
|
776
|
+
upload: (data: {
|
|
777
|
+
product: string;
|
|
778
|
+
env: string;
|
|
779
|
+
storage: string;
|
|
780
|
+
fileName: string;
|
|
781
|
+
buffer: string | Buffer;
|
|
782
|
+
mimeType?: string;
|
|
783
|
+
}) => Promise<import("./storage").IStorageResult>;
|
|
784
|
+
/**
|
|
785
|
+
* Downloads a file from cloud storage.
|
|
786
|
+
* @param data - The download options.
|
|
787
|
+
* @returns The download result with file data.
|
|
788
|
+
* @example
|
|
789
|
+
* const result = await ductape.storage.download({
|
|
790
|
+
* product: 'my-product',
|
|
791
|
+
* env: 'production',
|
|
792
|
+
* storage: 's3-bucket',
|
|
793
|
+
* fileName: 'documents/report.pdf'
|
|
794
|
+
* });
|
|
795
|
+
*/
|
|
796
|
+
download: (data: {
|
|
797
|
+
product: string;
|
|
798
|
+
env: string;
|
|
799
|
+
storage: string;
|
|
800
|
+
fileName: string;
|
|
801
|
+
}) => Promise<import("./storage").IDownloadResult>;
|
|
802
|
+
/**
|
|
803
|
+
* Removes a file from cloud storage.
|
|
804
|
+
* @param data - The delete options.
|
|
805
|
+
* @returns The delete result.
|
|
806
|
+
* @example
|
|
807
|
+
* await ductape.storage.remove({
|
|
808
|
+
* product: 'my-product',
|
|
809
|
+
* env: 'production',
|
|
810
|
+
* storage: 's3-bucket',
|
|
811
|
+
* fileName: 'documents/report.pdf'
|
|
812
|
+
* });
|
|
813
|
+
*/
|
|
814
|
+
remove: (data: {
|
|
815
|
+
product: string;
|
|
816
|
+
env: string;
|
|
817
|
+
storage: string;
|
|
818
|
+
fileName: string;
|
|
819
|
+
}) => Promise<import("./storage").IDeleteResult>;
|
|
820
|
+
/**
|
|
821
|
+
* Lists files in cloud storage with pagination.
|
|
822
|
+
* @param data - The list options.
|
|
823
|
+
* @returns The list result with files and pagination info.
|
|
824
|
+
* @example
|
|
825
|
+
* const result = await ductape.storage.list({
|
|
826
|
+
* product: 'my-product',
|
|
827
|
+
* env: 'production',
|
|
828
|
+
* storage: 's3-bucket',
|
|
829
|
+
* prefix: 'documents/',
|
|
830
|
+
* limit: 100
|
|
831
|
+
* });
|
|
832
|
+
*/
|
|
833
|
+
files: (data: {
|
|
834
|
+
product: string;
|
|
835
|
+
env: string;
|
|
836
|
+
storage: string;
|
|
837
|
+
prefix?: string;
|
|
838
|
+
limit?: number;
|
|
839
|
+
continuationToken?: string;
|
|
840
|
+
}) => Promise<import("./storage").IListFilesResult>;
|
|
841
|
+
/**
|
|
842
|
+
* Generates a signed URL for temporary file access.
|
|
843
|
+
* @param data - The signed URL options.
|
|
844
|
+
* @returns The signed URL result.
|
|
845
|
+
* @example
|
|
846
|
+
* const result = await ductape.storage.getSignedUrl({
|
|
847
|
+
* product: 'my-product',
|
|
848
|
+
* env: 'production',
|
|
849
|
+
* storage: 's3-bucket',
|
|
850
|
+
* fileName: 'documents/report.pdf',
|
|
851
|
+
* expiresIn: 3600,
|
|
852
|
+
* action: 'read'
|
|
853
|
+
* });
|
|
854
|
+
*/
|
|
855
|
+
getSignedUrl: (data: {
|
|
856
|
+
product: string;
|
|
857
|
+
env: string;
|
|
858
|
+
storage: string;
|
|
859
|
+
fileName: string;
|
|
860
|
+
expiresIn?: number;
|
|
861
|
+
action?: "read" | "write";
|
|
862
|
+
}) => Promise<import("./storage").ISignedUrlResult>;
|
|
863
|
+
/**
|
|
864
|
+
* Dispatches a storage operation to run as a scheduled job.
|
|
865
|
+
* @param {IStorageDispatchInput} data - The storage dispatch input.
|
|
866
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
867
|
+
* @example
|
|
868
|
+
* // Schedule a file backup in 6 hours
|
|
869
|
+
* await ductape.storage.dispatch({
|
|
870
|
+
* product: 'my-product',
|
|
871
|
+
* env: 'production',
|
|
872
|
+
* storage: 's3-storage',
|
|
873
|
+
* event: 'backup-files',
|
|
874
|
+
* input: { buffer: fileData, fileName: 'backup.zip', mimeType: 'application/zip' },
|
|
875
|
+
* schedule: { start_at: Date.now() + 21600000 }
|
|
876
|
+
* });
|
|
877
|
+
*
|
|
878
|
+
* // Run daily backups
|
|
879
|
+
* await ductape.storage.dispatch({
|
|
880
|
+
* product: 'my-product',
|
|
881
|
+
* env: 'production',
|
|
882
|
+
* storage: 's3-storage',
|
|
883
|
+
* event: 'daily-backup',
|
|
884
|
+
* input: { buffer: fileData, fileName: 'daily.zip', mimeType: 'application/zip' },
|
|
885
|
+
* schedule: { cron: '0 2 * * *' } // Daily at 2 AM
|
|
886
|
+
* });
|
|
887
|
+
*/
|
|
888
|
+
dispatch: (data: IStorageDispatchInput) => Promise<IDispatchResult>;
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* Events-related operations for managing product events (message brokers).
|
|
892
|
+
*/
|
|
893
|
+
events: {
|
|
894
|
+
/**
|
|
895
|
+
* Creates a message broker for a product.
|
|
896
|
+
* @param {string} product - The product tag.
|
|
897
|
+
* @param {Partial<IProductMessageBroker>} data - The message broker data.
|
|
898
|
+
* @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
|
|
899
|
+
*/
|
|
900
|
+
create: (product: string, data: Partial<IProductMessageBroker>) => Promise<void>;
|
|
901
|
+
/**
|
|
902
|
+
* Fetches all message brokers for a product.
|
|
903
|
+
* @param {string} product - The product tag.
|
|
904
|
+
* @returns {IProductMessageBroker[]} The list of message brokers.
|
|
905
|
+
*/
|
|
906
|
+
list: (product: string) => Promise<IProductMessageBroker[]>;
|
|
907
|
+
/**
|
|
908
|
+
* Fetches a message broker by tag.
|
|
909
|
+
* @param {string} product - The product tag.
|
|
910
|
+
* @param {string} tag - The message broker tag.
|
|
911
|
+
* @returns {IProductMessageBroker|null} The fetched message broker, or null if not found.
|
|
912
|
+
*/
|
|
913
|
+
fetch: (product: string, tag: string) => Promise<IProductMessageBroker>;
|
|
914
|
+
/**
|
|
915
|
+
* Updates a message broker by tag.
|
|
916
|
+
* @param {string} product - The product tag.
|
|
917
|
+
* @param {string} tag - The message broker tag.
|
|
918
|
+
* @param {Partial<IProductMessageBroker>} data - The message broker data to update.
|
|
919
|
+
* @returns {Promise<void>} Resolves when the message broker is updated. Throws on error.
|
|
920
|
+
*/
|
|
921
|
+
update: (product: string, tag: string, data: Partial<IProductMessageBroker>) => Promise<void>;
|
|
922
|
+
/**
|
|
923
|
+
* Deletes a message broker by tag.
|
|
924
|
+
* @param {string} product - The product tag.
|
|
925
|
+
* @param {string} tag - The message broker tag.
|
|
926
|
+
* @returns {Promise<void>} Resolves when the message broker is deleted. Throws on error.
|
|
927
|
+
*/
|
|
928
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
929
|
+
topics: {
|
|
470
930
|
/**
|
|
471
|
-
*
|
|
472
|
-
* @param {string}
|
|
473
|
-
* @
|
|
931
|
+
* Creates a message broker topic for a product.
|
|
932
|
+
* @param {string} product - The product tag.
|
|
933
|
+
* @param {IProductMessageBrokerTopic} data - The message broker topic data.
|
|
934
|
+
* @returns {Promise<void>} Resolves when the message broker topic is created. Throws on error.
|
|
474
935
|
*/
|
|
475
|
-
|
|
936
|
+
create: (product: string, data: IProductMessageBrokerTopic) => Promise<void>;
|
|
476
937
|
/**
|
|
477
|
-
* Fetches all
|
|
478
|
-
* @
|
|
938
|
+
* Fetches all message broker topics for a message broker by tag.
|
|
939
|
+
* @param {string} product - The product tag.
|
|
940
|
+
* @param {string} messageBrokerTag - The message broker tag.
|
|
941
|
+
* @returns {IProductMessageBrokerTopic[]} The list of message broker topics.
|
|
479
942
|
*/
|
|
480
|
-
|
|
943
|
+
list: (product: string, messageBrokerTag: string) => Promise<IProductMessageBrokerTopic[]>;
|
|
481
944
|
/**
|
|
482
|
-
*
|
|
483
|
-
* @param {string}
|
|
484
|
-
* @param {
|
|
485
|
-
* @returns {
|
|
945
|
+
* Fetches a message broker topic by tag.
|
|
946
|
+
* @param {string} product - The product tag.
|
|
947
|
+
* @param {string} tag - The message broker topic tag.
|
|
948
|
+
* @returns {IProductMessageBrokerTopic|null} The fetched message broker topic, or null if not found.
|
|
486
949
|
*/
|
|
487
|
-
|
|
950
|
+
fetch: (product: string, tag: string) => Promise<IProductMessageBrokerTopic>;
|
|
951
|
+
/**
|
|
952
|
+
* Updates a message broker topic by tag.
|
|
953
|
+
* @param {string} product - The product tag.
|
|
954
|
+
* @param {string} tag - The message broker topic tag.
|
|
955
|
+
* @param {Partial<IProductMessageBrokerTopic>} data - The message broker topic data to update.
|
|
956
|
+
* @returns {Promise<void>} Resolves when the message broker topic is updated. Throws on error.
|
|
957
|
+
*/
|
|
958
|
+
update: (product: string, tag: string, data: Partial<IProductMessageBrokerTopic>) => Promise<void>;
|
|
488
959
|
};
|
|
489
960
|
/**
|
|
490
|
-
*
|
|
491
|
-
* @param
|
|
492
|
-
* @
|
|
493
|
-
* @
|
|
961
|
+
* Publishes a message using the BrokersService.
|
|
962
|
+
* @param data - The publish input.
|
|
963
|
+
* @returns The result of the publish operation.
|
|
964
|
+
* @example
|
|
965
|
+
* await ductape.events.publish({
|
|
966
|
+
* product: 'my-product',
|
|
967
|
+
* env: 'production',
|
|
968
|
+
* event: 'broker-tag:topic-tag',
|
|
969
|
+
* message: { orderId: '123', status: 'pending' }
|
|
970
|
+
* });
|
|
494
971
|
*/
|
|
495
|
-
|
|
496
|
-
|
|
972
|
+
publish: (data: {
|
|
973
|
+
product: string;
|
|
974
|
+
env: string;
|
|
975
|
+
event: string;
|
|
976
|
+
message: Record<string, unknown>;
|
|
977
|
+
}) => Promise<import("./brokers").IPublishResult>;
|
|
978
|
+
/**
|
|
979
|
+
* Subscribes to a message broker topic.
|
|
980
|
+
* @param data - The subscribe input.
|
|
981
|
+
* @returns The result of the subscribe operation.
|
|
982
|
+
* @example
|
|
983
|
+
* await ductape.events.subscribe({
|
|
984
|
+
* product: 'my-product',
|
|
985
|
+
* env: 'production',
|
|
986
|
+
* event: 'broker-tag:topic-tag',
|
|
987
|
+
* callback: async (message) => console.log(message)
|
|
988
|
+
* });
|
|
989
|
+
*/
|
|
990
|
+
subscribe: (data: {
|
|
991
|
+
product: string;
|
|
992
|
+
env: string;
|
|
993
|
+
event: string;
|
|
994
|
+
callback: (message: object) => Promise<void>;
|
|
995
|
+
}) => Promise<import("./brokers").ISubscribeResult>;
|
|
996
|
+
/**
|
|
997
|
+
* Dispatches a publish operation to run as a scheduled job.
|
|
998
|
+
* @param {IPublishDispatchInput} data - The publish dispatch input.
|
|
999
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
1000
|
+
* @example
|
|
1001
|
+
* // Schedule a message to be published in 15 minutes
|
|
1002
|
+
* await ductape.events.dispatch({
|
|
1003
|
+
* product: 'my-product',
|
|
1004
|
+
* env: 'production',
|
|
1005
|
+
* broker: 'kafka-broker',
|
|
1006
|
+
* event: 'order-created',
|
|
1007
|
+
* input: { message: { orderId: '123', status: 'pending' } },
|
|
1008
|
+
* schedule: { start_at: Date.now() + 900000 }
|
|
1009
|
+
* });
|
|
1010
|
+
*
|
|
1011
|
+
* // Publish messages at regular intervals
|
|
1012
|
+
* await ductape.events.dispatch({
|
|
1013
|
+
* product: 'my-product',
|
|
1014
|
+
* env: 'production',
|
|
1015
|
+
* broker: 'redis-broker',
|
|
1016
|
+
* event: 'heartbeat',
|
|
1017
|
+
* input: { message: { ping: true } },
|
|
1018
|
+
* schedule: { every: 60000 } // Every minute
|
|
1019
|
+
* });
|
|
1020
|
+
*/
|
|
1021
|
+
dispatch: (data: IPublishDispatchInput) => Promise<IDispatchResult>;
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
1024
|
+
* Notification-related operations for managing product notifications.
|
|
1025
|
+
*/
|
|
1026
|
+
notifications: {
|
|
1027
|
+
/**
|
|
1028
|
+
* Creates a notification for a product.
|
|
1029
|
+
* @param {string} product - The product tag.
|
|
1030
|
+
* @param {IProductNotification} data - The notification data.
|
|
1031
|
+
* @returns {Promise<void>} Resolves when the notification is created. Throws on error.
|
|
1032
|
+
*/
|
|
1033
|
+
create: (product: string, data: IProductNotification) => Promise<void>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Fetches all notifications for a product.
|
|
1036
|
+
* @param {string} product - The product tag.
|
|
1037
|
+
* @returns {IProductNotification[]} The list of notifications.
|
|
1038
|
+
*/
|
|
1039
|
+
list: (product: string) => Promise<IProductNotification[]>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Fetches a notification by tag.
|
|
1042
|
+
* @param {string} product - The product tag.
|
|
1043
|
+
* @param {string} tag - The notification tag.
|
|
1044
|
+
* @returns {IProductNotification|null} The fetched notification, or null if not found.
|
|
1045
|
+
*/
|
|
1046
|
+
fetch: (product: string, tag: string) => Promise<IProductNotification>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Updates a notification by tag.
|
|
1049
|
+
* @param {string} product - The product tag.
|
|
1050
|
+
* @param {string} tag - The notification tag.
|
|
1051
|
+
* @param {Partial<IProductNotification>} data - The notification data to update.
|
|
1052
|
+
* @returns {Promise<void>} Resolves when the notification is updated. Throws on error.
|
|
1053
|
+
*/
|
|
1054
|
+
update: (product: string, tag: string, data: Partial<IProductNotification>) => Promise<void>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Deletes a notification by tag.
|
|
1057
|
+
* @param {string} product - The product tag.
|
|
1058
|
+
* @param {string} tag - The notification tag.
|
|
1059
|
+
* @returns {Promise<void>} Resolves when the notification is deleted. Throws on error.
|
|
1060
|
+
*/
|
|
1061
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
1062
|
+
messages: {
|
|
497
1063
|
/**
|
|
498
|
-
* Creates
|
|
499
|
-
* @param {
|
|
500
|
-
* @
|
|
1064
|
+
* Creates a notification message for a product.
|
|
1065
|
+
* @param {string} product - The product tag.
|
|
1066
|
+
* @param {IProductNotificationTemplate} data - The notification message data.
|
|
1067
|
+
* @returns {Promise<void>} Resolves when the notification message is created. Throws on error.
|
|
501
1068
|
*/
|
|
502
|
-
create: (data:
|
|
1069
|
+
create: (product: string, data: IProductNotificationTemplate) => Promise<void>;
|
|
503
1070
|
/**
|
|
504
|
-
* Fetches all
|
|
505
|
-
* @
|
|
1071
|
+
* Fetches all notification messages for a notification by tag.
|
|
1072
|
+
* @param {string} product - The product tag.
|
|
1073
|
+
* @param {string} notificationTag - The notification tag.
|
|
1074
|
+
* @returns {IProductNotificationTemplate[]} The list of notification messages.
|
|
506
1075
|
*/
|
|
507
|
-
|
|
1076
|
+
list: (product: string, notificationTag: string) => Promise<IProductNotificationTemplate[]>;
|
|
508
1077
|
/**
|
|
509
|
-
* Fetches
|
|
510
|
-
* @param {string}
|
|
511
|
-
* @
|
|
1078
|
+
* Fetches a notification message by tag.
|
|
1079
|
+
* @param {string} product - The product tag.
|
|
1080
|
+
* @param {string} tag - The notification message tag.
|
|
1081
|
+
* @returns {IProductNotificationTemplate|null} The fetched notification message, or null if not found.
|
|
512
1082
|
*/
|
|
513
|
-
fetch: (
|
|
1083
|
+
fetch: (product: string, tag: string) => Promise<IProductNotificationTemplate>;
|
|
514
1084
|
/**
|
|
515
|
-
* Updates
|
|
516
|
-
* @param {string}
|
|
517
|
-
* @param {
|
|
518
|
-
* @
|
|
1085
|
+
* Updates a notification message by tag.
|
|
1086
|
+
* @param {string} product - The product tag.
|
|
1087
|
+
* @param {string} tag - The notification message tag.
|
|
1088
|
+
* @param {Partial<IProductNotificationTemplate>} data - The notification message data to update.
|
|
1089
|
+
* @returns {Promise<void>} Resolves when the notification message is updated. Throws on error.
|
|
519
1090
|
*/
|
|
520
|
-
update: (
|
|
1091
|
+
update: (product: string, tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
|
|
521
1092
|
};
|
|
522
|
-
|
|
1093
|
+
/**
|
|
1094
|
+
* Sends a notification immediately using the notification processor.
|
|
1095
|
+
* @param {INotificationProcessorInput} data - The notification processor input.
|
|
1096
|
+
* @returns {Promise<any>} The result of the notification processing.
|
|
1097
|
+
* @example
|
|
1098
|
+
* await ductape.notifications.send({
|
|
1099
|
+
* product: 'my-product',
|
|
1100
|
+
* env: 'production',
|
|
1101
|
+
* event: 'welcome-email',
|
|
1102
|
+
* input: { email: { recipients: ['user@example.com'], subject: { name: 'John' } } }
|
|
1103
|
+
* });
|
|
1104
|
+
*/
|
|
1105
|
+
send: (data: INotificationProcessorInput) => Promise<{
|
|
1106
|
+
process_id: string;
|
|
1107
|
+
}>;
|
|
1108
|
+
/**
|
|
1109
|
+
* Dispatches a notification to be sent as a scheduled job.
|
|
1110
|
+
* @param {INotificationDispatchInput} data - The notification dispatch input.
|
|
1111
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
1112
|
+
* @example
|
|
1113
|
+
* // Schedule a notification to be sent in 1 hour
|
|
1114
|
+
* await ductape.notifications.dispatch({
|
|
1115
|
+
* product: 'my-product',
|
|
1116
|
+
* env: 'production',
|
|
1117
|
+
* notification: 'user-notifications',
|
|
1118
|
+
* event: 'welcome-email',
|
|
1119
|
+
* input: { email: { to: 'user@example.com' } },
|
|
1120
|
+
* schedule: { start_at: Date.now() + 3600000 }
|
|
1121
|
+
* });
|
|
1122
|
+
*
|
|
1123
|
+
* // Send recurring notifications
|
|
1124
|
+
* await ductape.notifications.dispatch({
|
|
1125
|
+
* product: 'my-product',
|
|
1126
|
+
* env: 'production',
|
|
1127
|
+
* notification: 'digest',
|
|
1128
|
+
* event: 'weekly-digest',
|
|
1129
|
+
* input: { email: { to: 'user@example.com' } },
|
|
1130
|
+
* schedule: { cron: '0 9 * * 1' } // Weekly on Monday at 9 AM
|
|
1131
|
+
* });
|
|
1132
|
+
*/
|
|
1133
|
+
dispatch: (data: INotificationDispatchInput) => Promise<IDispatchResult>;
|
|
1134
|
+
};
|
|
1135
|
+
/**
|
|
1136
|
+
* Database operations service.
|
|
1137
|
+
* Provides a unified API for database CRUD operations, schema management, queries, and migrations.
|
|
1138
|
+
*
|
|
1139
|
+
* @example
|
|
1140
|
+
* // Register a new database
|
|
1141
|
+
* await ductape.databases.create({
|
|
1142
|
+
* product: 'my-product',
|
|
1143
|
+
* name: 'User Database',
|
|
1144
|
+
* tag: 'users-db',
|
|
1145
|
+
* type: DatabaseType.POSTGRESQL,
|
|
1146
|
+
* envs: [{ slug: 'dev', connection_url: 'postgresql://localhost/mydb' }],
|
|
1147
|
+
* });
|
|
1148
|
+
*
|
|
1149
|
+
* // Connect to database
|
|
1150
|
+
* await ductape.databases.connect({ env: 'dev', product: 'my-product', database: 'users-db' });
|
|
1151
|
+
*/
|
|
1152
|
+
databases: {
|
|
1153
|
+
/**
|
|
1154
|
+
* Create/register a new database configuration
|
|
1155
|
+
*/
|
|
1156
|
+
create: (config: Parameters<DatabaseService["create"]>[0]) => Promise<void>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Register a database for a product (alias for create with product)
|
|
1159
|
+
*/
|
|
1160
|
+
register: (product: string, data: IProductDatabase) => Promise<void>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Fetch all databases for a product
|
|
1163
|
+
*/
|
|
1164
|
+
list: (product: string) => Promise<IProductDatabase[]>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Fetch a specific database
|
|
1167
|
+
*/
|
|
1168
|
+
fetch: (product: string, database: string) => Promise<IProductDatabase>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Update a database configuration
|
|
1171
|
+
*/
|
|
1172
|
+
update: (product: string, database: string, data: Partial<IProductDatabase>) => Promise<void>;
|
|
1173
|
+
/**
|
|
1174
|
+
* Update local database configuration
|
|
1175
|
+
*/
|
|
1176
|
+
updateLocalConfig: (tag: string, updates: Parameters<DatabaseService["updateLocalConfig"]>[1]) => Promise<void>;
|
|
1177
|
+
/**
|
|
1178
|
+
* Connect to a database
|
|
1179
|
+
*/
|
|
1180
|
+
connect: (config: Parameters<DatabaseService["connect"]>[0]) => Promise<import("./database").DatabaseConnection>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Test database connection
|
|
1183
|
+
*/
|
|
1184
|
+
testConnection: (config: Parameters<DatabaseService["testConnection"]>[0]) => Promise<import("./database").IConnectionResult>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Disconnect from the current database
|
|
1187
|
+
*/
|
|
1188
|
+
disconnect: () => Promise<void>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Close all database connections
|
|
1191
|
+
*/
|
|
1192
|
+
closeAll: () => Promise<void>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Get current connection context
|
|
1195
|
+
*/
|
|
1196
|
+
getCurrentContext: () => Promise<import("./database").IConnectionContext>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Get a connection-scoped interface for a specific database/environment
|
|
1199
|
+
*/
|
|
1200
|
+
connection: (database: string, env: string) => Promise<import("./database").DatabaseConnection>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Query records from a table
|
|
1203
|
+
*/
|
|
1204
|
+
query: <T = any>(options: Parameters<DatabaseService["query"]>[0]) => Promise<import("./database").IQueryResult<T>>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Insert records into a table
|
|
1207
|
+
*/
|
|
1208
|
+
insert: <T = any>(options: Parameters<DatabaseService["insert"]>[0]) => Promise<import("./database").IInsertResult<T>>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Update records in a table
|
|
1211
|
+
*/
|
|
1212
|
+
updateRecords: <T = any>(options: Parameters<DatabaseService["update"]>[0]) => Promise<import("./database").IUpdateResult<T>>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Delete records from a table
|
|
1215
|
+
*/
|
|
1216
|
+
delete: (options: Parameters<DatabaseService["delete"]>[0]) => Promise<import("./database").IDeleteResult>;
|
|
1217
|
+
/**
|
|
1218
|
+
* Insert or update a record based on conflict keys
|
|
1219
|
+
*/
|
|
1220
|
+
upsert: <T = any>(options: Parameters<DatabaseService["upsert"]>[0]) => Promise<import("./database").IUpsertResult<T>>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Count records
|
|
1223
|
+
*/
|
|
1224
|
+
count: (options: Parameters<DatabaseService["count"]>[0]) => Promise<number>;
|
|
1225
|
+
/**
|
|
1226
|
+
* Sum values of a column
|
|
1227
|
+
*/
|
|
1228
|
+
sum: (options: Parameters<DatabaseService["sum"]>[0]) => Promise<number>;
|
|
1229
|
+
/**
|
|
1230
|
+
* Calculate average of a column
|
|
1231
|
+
*/
|
|
1232
|
+
avg: (options: Parameters<DatabaseService["avg"]>[0]) => Promise<number>;
|
|
1233
|
+
/**
|
|
1234
|
+
* Get minimum value of a column
|
|
1235
|
+
*/
|
|
1236
|
+
min: (options: Parameters<DatabaseService["min"]>[0]) => Promise<any>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Get maximum value of a column
|
|
1239
|
+
*/
|
|
1240
|
+
max: (options: Parameters<DatabaseService["max"]>[0]) => Promise<any>;
|
|
1241
|
+
/**
|
|
1242
|
+
* Perform multiple aggregations in one query
|
|
1243
|
+
*/
|
|
1244
|
+
aggregate: (options: Parameters<DatabaseService["aggregate"]>[0]) => Promise<import("./database").IAggregateResult>;
|
|
1245
|
+
/**
|
|
1246
|
+
* Begin a database transaction
|
|
1247
|
+
*/
|
|
1248
|
+
beginTransaction: (options: Parameters<DatabaseService["beginTransaction"]>[0]) => Promise<import("./database").ITransaction>;
|
|
1249
|
+
/**
|
|
1250
|
+
* Schema operations sub-object - provides a simplified Mongoose-style API for schema management.
|
|
1251
|
+
* These operations work on the currently connected database context.
|
|
1252
|
+
*/
|
|
1253
|
+
schema: {
|
|
523
1254
|
/**
|
|
524
|
-
*
|
|
525
|
-
* @
|
|
526
|
-
*
|
|
1255
|
+
* Create a collection/table with Mongoose-style schema definition
|
|
1256
|
+
* @example
|
|
1257
|
+
* await ductape.databases.schema.create('users', {
|
|
1258
|
+
* name: 'string',
|
|
1259
|
+
* email: { type: 'string', unique: true },
|
|
1260
|
+
* age: 'number',
|
|
1261
|
+
* createdAt: 'date',
|
|
1262
|
+
* });
|
|
527
1263
|
*/
|
|
528
|
-
create: (
|
|
1264
|
+
create: (name: string, definition: ISimpleSchemaDefinition, options?: ISimpleCreateOptions) => Promise<ISchemaOperationResult>;
|
|
529
1265
|
/**
|
|
530
|
-
*
|
|
531
|
-
* @returns {IProductStorage[]} The list of storages.
|
|
1266
|
+
* Drop a collection/table
|
|
532
1267
|
*/
|
|
533
|
-
|
|
1268
|
+
drop: (name: string, options?: ISimpleDropOptions) => Promise<ISchemaOperationResult>;
|
|
534
1269
|
/**
|
|
535
|
-
*
|
|
536
|
-
* @param {string} tag - The storage tag.
|
|
537
|
-
* @returns {IProductStorage|null} The fetched storage, or null if not found.
|
|
1270
|
+
* Add a field to a collection
|
|
538
1271
|
*/
|
|
539
|
-
|
|
1272
|
+
addField: (collection: string, fieldName: string, definition: SimpleFieldType | ISimpleFieldDefinition) => Promise<ISchemaOperationResult>;
|
|
540
1273
|
/**
|
|
541
|
-
*
|
|
542
|
-
* @param {string} tag - The storage tag.
|
|
543
|
-
* @param {Partial<IProductStorage>} data - The storage data to update.
|
|
544
|
-
* @returns {Promise<void>} Resolves when the storage is updated. Throws on error.
|
|
1274
|
+
* Drop a field from a collection
|
|
545
1275
|
*/
|
|
546
|
-
|
|
1276
|
+
dropField: (collection: string, fieldName: string) => Promise<ISchemaOperationResult>;
|
|
547
1277
|
/**
|
|
548
|
-
*
|
|
549
|
-
* @param {IFetchFilesPayload} data - The fetch files payload.
|
|
550
|
-
* @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
|
|
1278
|
+
* Rename a field in a collection
|
|
551
1279
|
*/
|
|
552
|
-
|
|
553
|
-
};
|
|
554
|
-
messageBrokers: {
|
|
1280
|
+
renameField: (collection: string, oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
555
1281
|
/**
|
|
556
|
-
*
|
|
557
|
-
* @param {Partial<IProductMessageBroker>} data - The message broker data.
|
|
558
|
-
* @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
|
|
1282
|
+
* Modify a field's definition
|
|
559
1283
|
*/
|
|
560
|
-
|
|
1284
|
+
modifyField: (collection: string, fieldName: string, changes: Partial<ISimpleFieldDefinition>) => Promise<ISchemaOperationResult>;
|
|
561
1285
|
/**
|
|
562
|
-
*
|
|
563
|
-
* @returns {IProductMessageBroker[]} The list of message brokers.
|
|
1286
|
+
* Create an index on a collection
|
|
564
1287
|
*/
|
|
565
|
-
|
|
1288
|
+
createIndex: (collection: string, fields: string[] | IIndexFieldDefinition[], options?: ISimpleIndexOptions) => Promise<ISchemaOperationResult>;
|
|
566
1289
|
/**
|
|
567
|
-
*
|
|
568
|
-
* @param {string} tag - The message broker tag.
|
|
569
|
-
* @returns {IProductMessageBroker|null} The fetched message broker, or null if not found.
|
|
1290
|
+
* Drop an index from a collection
|
|
570
1291
|
*/
|
|
571
|
-
|
|
1292
|
+
dropIndex: (collection: string, indexName: string) => Promise<ISchemaOperationResult>;
|
|
572
1293
|
/**
|
|
573
|
-
*
|
|
574
|
-
* @param {string} tag - The message broker tag.
|
|
575
|
-
* @param {Partial<IProductMessageBroker>} data - The message broker data to update.
|
|
576
|
-
* @returns {Promise<void>} Resolves when the message broker is updated. Throws on error.
|
|
1294
|
+
* Add a constraint (SQL databases only)
|
|
577
1295
|
*/
|
|
578
|
-
|
|
579
|
-
topics: {
|
|
580
|
-
/**
|
|
581
|
-
* Creates a message broker topic for a product.
|
|
582
|
-
* @param {IProductMessageBrokerTopic} data - The message broker topic data.
|
|
583
|
-
* @returns {Promise<void>} Resolves when the message broker topic is created. Throws on error.
|
|
584
|
-
*/
|
|
585
|
-
create: (data: IProductMessageBrokerTopic) => Promise<void>;
|
|
586
|
-
/**
|
|
587
|
-
* Fetches all message broker topics for a message broker by tag.
|
|
588
|
-
* @param {string} messageBrokerTag - The message broker tag.
|
|
589
|
-
* @returns {IProductMessageBrokerTopic[]} The list of message broker topics.
|
|
590
|
-
*/
|
|
591
|
-
fetchAll: (messageBrokerTag: string) => Promise<IProductMessageBrokerTopic[]>;
|
|
592
|
-
/**
|
|
593
|
-
* Fetches a message broker topic by tag.
|
|
594
|
-
* @param {string} tag - The message broker topic tag.
|
|
595
|
-
* @returns {IProductMessageBrokerTopic|null} The fetched message broker topic, or null if not found.
|
|
596
|
-
*/
|
|
597
|
-
fetch: (tag: string) => Promise<IProductMessageBrokerTopic>;
|
|
598
|
-
/**
|
|
599
|
-
* Updates a message broker topic by tag.
|
|
600
|
-
* @param {string} tag - The message broker topic tag.
|
|
601
|
-
* @param {Partial<IProductMessageBrokerTopic>} data - The message broker topic data to update.
|
|
602
|
-
* @returns {Promise<void>} Resolves when the message broker topic is updated. Throws on error.
|
|
603
|
-
*/
|
|
604
|
-
update: (tag: string, data: Partial<IProductMessageBrokerTopic>) => Promise<void>;
|
|
605
|
-
};
|
|
606
|
-
};
|
|
607
|
-
notifications: {
|
|
1296
|
+
addConstraint: (collection: string, constraint: IMigrationConstraintDefinition) => Promise<ISchemaOperationResult>;
|
|
608
1297
|
/**
|
|
609
|
-
*
|
|
610
|
-
* @param {IProductNotification} data - The notification data.
|
|
611
|
-
* @returns {Promise<void>} Resolves when the notification is created. Throws on error.
|
|
1298
|
+
* Drop a constraint (SQL databases only)
|
|
612
1299
|
*/
|
|
613
|
-
|
|
1300
|
+
dropConstraint: (collection: string, constraintName: string) => Promise<ISchemaOperationResult>;
|
|
614
1301
|
/**
|
|
615
|
-
*
|
|
616
|
-
* @returns {IProductNotification[]} The list of notifications.
|
|
1302
|
+
* Rename a collection/table
|
|
617
1303
|
*/
|
|
618
|
-
|
|
1304
|
+
rename: (oldName: string, newName: string) => Promise<ISchemaOperationResult>;
|
|
619
1305
|
/**
|
|
620
|
-
*
|
|
621
|
-
* @param {string} tag - The notification tag.
|
|
622
|
-
* @returns {IProductNotification|null} The fetched notification, or null if not found.
|
|
1306
|
+
* Check if a collection/table exists
|
|
623
1307
|
*/
|
|
624
|
-
|
|
1308
|
+
exists: (name: string) => Promise<boolean>;
|
|
625
1309
|
/**
|
|
626
|
-
*
|
|
627
|
-
* @param {string} tag - The notification tag.
|
|
628
|
-
* @param {Partial<IProductNotification>} data - The notification data to update.
|
|
629
|
-
* @returns {Promise<void>} Resolves when the notification is updated. Throws on error.
|
|
1310
|
+
* List all collections/tables
|
|
630
1311
|
*/
|
|
631
|
-
|
|
632
|
-
messages: {
|
|
633
|
-
/**
|
|
634
|
-
* Creates a notification message for a product.
|
|
635
|
-
* @param {IProductNotificationTemplate} data - The notification message data.
|
|
636
|
-
* @returns {Promise<void>} Resolves when the notification message is created. Throws on error.
|
|
637
|
-
*/
|
|
638
|
-
create: (data: IProductNotificationTemplate) => Promise<void>;
|
|
639
|
-
/**
|
|
640
|
-
* Fetches all notification messages for a notification by tag.
|
|
641
|
-
* @param {string} notificationTag - The notification tag.
|
|
642
|
-
* @returns {IProductNotificationTemplate[]} The list of notification messages.
|
|
643
|
-
*/
|
|
644
|
-
fetchAll: (notificationTag: string) => Promise<IProductNotificationTemplate[]>;
|
|
645
|
-
/**
|
|
646
|
-
* Fetches a notification message by tag.
|
|
647
|
-
* @param {string} tag - The notification message tag.
|
|
648
|
-
* @returns {IProductNotificationTemplate|null} The fetched notification message, or null if not found.
|
|
649
|
-
*/
|
|
650
|
-
fetch: (tag: string) => Promise<IProductNotificationTemplate>;
|
|
651
|
-
/**
|
|
652
|
-
* Updates a notification message by tag.
|
|
653
|
-
* @param {string} tag - The notification message tag.
|
|
654
|
-
* @param {Partial<IProductNotificationTemplate>} data - The notification message data to update.
|
|
655
|
-
* @returns {Promise<void>} Resolves when the notification message is updated. Throws on error.
|
|
656
|
-
*/
|
|
657
|
-
update: (tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
|
|
658
|
-
};
|
|
659
|
-
};
|
|
660
|
-
databases: {
|
|
1312
|
+
list: (schemaName?: string) => Promise<string[]>;
|
|
661
1313
|
/**
|
|
662
|
-
*
|
|
663
|
-
* @param {IProductDatabase} data - The database data.
|
|
664
|
-
* @returns {Promise<void>} Resolves when the database is created. Throws on error.
|
|
1314
|
+
* Get detailed schema information for a collection
|
|
665
1315
|
*/
|
|
666
|
-
|
|
1316
|
+
describe: (name: string) => Promise<ITableSchema>;
|
|
667
1317
|
/**
|
|
668
|
-
*
|
|
669
|
-
* @returns {IProductDatabase[]} The list of databases.
|
|
1318
|
+
* List indexes on a collection
|
|
670
1319
|
*/
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Fetches a database by tag.
|
|
674
|
-
* @param {string} tag - The database tag.
|
|
675
|
-
* @returns {IProductDatabase|null} The fetched database, or null if not found.
|
|
676
|
-
*/
|
|
677
|
-
fetch: (tag: string) => Promise<IProductDatabase>;
|
|
678
|
-
/**
|
|
679
|
-
* Updates a database by tag.
|
|
680
|
-
* @param {string} tag - The database tag.
|
|
681
|
-
* @param {Partial<IProductDatabase>} data - The database data to update.
|
|
682
|
-
* @returns {Promise<void>} Resolves when the database is updated. Throws on error.
|
|
683
|
-
*/
|
|
684
|
-
update: (tag: string, data: Partial<IProductDatabase>) => Promise<void>;
|
|
685
|
-
actions: {
|
|
686
|
-
/**
|
|
687
|
-
* Creates a database action for a product.
|
|
688
|
-
* @param {IProductDatabaseAction} data - The database action data.
|
|
689
|
-
* @returns {Promise<void>} Resolves when the database action is created. Throws on error.
|
|
690
|
-
*/
|
|
691
|
-
create: (data: IProductDatabaseAction) => Promise<void>;
|
|
692
|
-
/**
|
|
693
|
-
* Fetches all database actions for a product.
|
|
694
|
-
* @param {string} databaseTag - The database tag.
|
|
695
|
-
* @returns {IProductDatabaseAction[]} The list of database actions.
|
|
696
|
-
*/
|
|
697
|
-
fetchAll: (databaseTag: string) => Promise<IProductDatabaseAction[]>;
|
|
698
|
-
/**
|
|
699
|
-
* Fetches a database action by tag.
|
|
700
|
-
* @param {string} tag - The database action tag.
|
|
701
|
-
* @returns {IProductDatabaseAction|null} The fetched database action, or null if not found.
|
|
702
|
-
*/
|
|
703
|
-
fetch: (tag: string) => Promise<IProductDatabaseAction>;
|
|
704
|
-
/**
|
|
705
|
-
* Updates a database action by tag.
|
|
706
|
-
* @param {string} tag - The database action tag.
|
|
707
|
-
* @param {Partial<IProductDatabaseAction>} data - The database action data to update.
|
|
708
|
-
* @returns {Promise<void>} Resolves when the database action is updated. Throws on error.
|
|
709
|
-
*/
|
|
710
|
-
update: (tag: string, data: Partial<IProductDatabaseAction>) => Promise<void>;
|
|
711
|
-
};
|
|
712
|
-
migrations: {
|
|
713
|
-
/**
|
|
714
|
-
* Creates a database migration for a product.
|
|
715
|
-
* @param {IProductDatabaseMigration} data - The database migration data.
|
|
716
|
-
* @returns {void} Resolves when the database migration is created. Throws on error.
|
|
717
|
-
*/
|
|
718
|
-
create: (data: IProductDatabaseMigration) => Promise<void>;
|
|
719
|
-
/**
|
|
720
|
-
* Fetches all database migrations for a product.
|
|
721
|
-
* @param {string} databaseTag - The database tag.
|
|
722
|
-
* @returns {IProductDatabaseMigration[]} The list of database migrations.
|
|
723
|
-
*/
|
|
724
|
-
fetchAll: (databaseTag: string) => Promise<IProductDatabaseMigration[]>;
|
|
725
|
-
/**
|
|
726
|
-
* Fetches a database migration by tag.
|
|
727
|
-
* @param {string} tag - The database migration tag.
|
|
728
|
-
* @returns {IProductDatabaseMigration|null} The fetched database migration, or null if not found.
|
|
729
|
-
*/
|
|
730
|
-
fetch: (tag: string) => Promise<IProductDatabaseMigration>;
|
|
731
|
-
/**
|
|
732
|
-
* Updates a database migration by tag.
|
|
733
|
-
* @param {string} tag - The database migration tag.
|
|
734
|
-
* @param {Partial<IProductDatabaseMigration>} data - The database migration data to update.
|
|
735
|
-
* @returns {void} Resolves when the database migration is updated. Throws on error.
|
|
736
|
-
*/
|
|
737
|
-
update: (tag: string, data: Partial<IProductDatabaseMigration>) => Promise<void>;
|
|
738
|
-
};
|
|
739
|
-
};
|
|
740
|
-
graphs: {
|
|
741
|
-
/**
|
|
742
|
-
* Creates a graph database for a product.
|
|
743
|
-
* @param {IProductGraph} data - The graph database data.
|
|
744
|
-
* @returns {Promise<void>} Resolves when the graph database is created. Throws on error.
|
|
745
|
-
*/
|
|
746
|
-
create: (data: IProductGraph) => Promise<void>;
|
|
747
|
-
/**
|
|
748
|
-
* Fetches all graph databases for a product.
|
|
749
|
-
* @returns {IProductGraph[]} The list of graph databases.
|
|
750
|
-
*/
|
|
751
|
-
fetchAll: () => Promise<IProductGraph[]>;
|
|
752
|
-
/**
|
|
753
|
-
* Fetches a graph database by tag.
|
|
754
|
-
* @param {string} tag - The graph database tag.
|
|
755
|
-
* @returns {IProductGraph|null} The fetched graph database, or null if not found.
|
|
756
|
-
*/
|
|
757
|
-
fetch: (tag: string) => Promise<IProductGraph>;
|
|
758
|
-
/**
|
|
759
|
-
* Updates a graph database by tag.
|
|
760
|
-
* @param {string} tag - The graph database tag.
|
|
761
|
-
* @param {Partial<IProductGraph>} data - The graph database data to update.
|
|
762
|
-
* @returns {Promise<void>} Resolves when the graph database is updated. Throws on error.
|
|
763
|
-
*/
|
|
764
|
-
update: (tag: string, data: Partial<IProductGraph>) => Promise<void>;
|
|
765
|
-
};
|
|
766
|
-
jobs: {
|
|
767
|
-
/**
|
|
768
|
-
* Creates a job for a product.
|
|
769
|
-
* @param {Partial<IProductJobs>} data - The job data.
|
|
770
|
-
* @returns {Promise<void>} Resolves when the job is created. Throws on error.
|
|
771
|
-
*/
|
|
772
|
-
create: (data: Partial<IProductJobs>) => Promise<void>;
|
|
773
|
-
/**
|
|
774
|
-
* Fetches all jobs for a product.
|
|
775
|
-
* @returns {IProductJobs[]} The list of jobs.
|
|
776
|
-
*/
|
|
777
|
-
fetchAll: () => Promise<IProductJobs[]>;
|
|
778
|
-
/**
|
|
779
|
-
* Fetches a job by tag.
|
|
780
|
-
* @param {string} tag - The job tag.
|
|
781
|
-
* @returns {IProductJobs|null} The fetched job, or null if not found.
|
|
782
|
-
*/
|
|
783
|
-
fetch: (tag: string) => Promise<IProductJobs>;
|
|
784
|
-
/**
|
|
785
|
-
* Updates a job by tag.
|
|
786
|
-
* @param {string} tag - The job tag.
|
|
787
|
-
* @param {Partial<IProductJobs>} data - The job data to update.
|
|
788
|
-
* @returns {Promise<void>} Resolves when the job is updated. Throws on error.
|
|
789
|
-
*/
|
|
790
|
-
update: (tag: string, data: Partial<IProductJobs>) => Promise<void>;
|
|
1320
|
+
indexes: (collection: string) => Promise<IIndexInfo[]>;
|
|
791
1321
|
};
|
|
792
|
-
|
|
1322
|
+
/**
|
|
1323
|
+
* Migration CRUD sub-object
|
|
1324
|
+
*/
|
|
1325
|
+
migration: {
|
|
1326
|
+
create: (options: {
|
|
1327
|
+
product: string;
|
|
1328
|
+
database: string;
|
|
1329
|
+
data: {
|
|
1330
|
+
name: string;
|
|
1331
|
+
tag: string;
|
|
1332
|
+
description?: string;
|
|
1333
|
+
value: {
|
|
1334
|
+
up: string[];
|
|
1335
|
+
down: string[];
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
}) => Promise<void>;
|
|
1339
|
+
update: (options: {
|
|
1340
|
+
product: string;
|
|
1341
|
+
tag: string;
|
|
1342
|
+
data: {
|
|
1343
|
+
name?: string;
|
|
1344
|
+
description?: string;
|
|
1345
|
+
value?: {
|
|
1346
|
+
up: string[];
|
|
1347
|
+
down: string[];
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
}) => Promise<void>;
|
|
1351
|
+
fetch: (options: {
|
|
1352
|
+
product: string;
|
|
1353
|
+
tag: string;
|
|
1354
|
+
}) => Promise<any>;
|
|
1355
|
+
list: (options: {
|
|
1356
|
+
product: string;
|
|
1357
|
+
database: string;
|
|
1358
|
+
}) => Promise<any[]>;
|
|
1359
|
+
delete: (options: {
|
|
1360
|
+
product: string;
|
|
1361
|
+
tag: string;
|
|
1362
|
+
}) => Promise<void>;
|
|
793
1363
|
/**
|
|
794
|
-
*
|
|
795
|
-
* @param {IProductCache} data - The cache data.
|
|
796
|
-
* @returns {Promise<void>} Resolves when the cache is created. Throws on error.
|
|
1364
|
+
* Run a migration
|
|
797
1365
|
*/
|
|
798
|
-
|
|
1366
|
+
run: (migrations: Parameters<DatabaseService["runMigration"]>[0], options?: Parameters<DatabaseService["runMigration"]>[1]) => Promise<Map<string, import("./database").IMigrationResult>>;
|
|
799
1367
|
/**
|
|
800
|
-
*
|
|
801
|
-
* @returns {IProductCache[]} The list of caches.
|
|
1368
|
+
* Rollback migrations
|
|
802
1369
|
*/
|
|
803
|
-
|
|
1370
|
+
rollback: (migrations: Parameters<DatabaseService["rollbackMigration"]>[0], count?: number) => Promise<Map<string, import("./database").IMigrationResult>>;
|
|
804
1371
|
/**
|
|
805
|
-
*
|
|
806
|
-
* @param {string} tag - The cache tag.
|
|
807
|
-
* @returns {IProductCache|null} The fetched cache, or null if not found.
|
|
1372
|
+
* Get migration history
|
|
808
1373
|
*/
|
|
809
|
-
|
|
1374
|
+
history: () => Promise<import("./database").IMigrationHistory[]>;
|
|
810
1375
|
/**
|
|
811
|
-
*
|
|
812
|
-
* @param {string} tag - The cache tag.
|
|
813
|
-
* @param {Partial<IProductCache>} data - The cache data to update.
|
|
814
|
-
* @returns {Promise<void>} Resolves when the cache is updated. Throws on error.
|
|
1376
|
+
* Get migration status
|
|
815
1377
|
*/
|
|
816
|
-
|
|
817
|
-
values: (data: FetchRemoteCachePayload) => Promise<import("./types").IRemoteCache[]>;
|
|
1378
|
+
status: (migrations: Parameters<DatabaseService["getMigrationStatus"]>[0]) => Promise<import("./database").IMigrationStatusResult>;
|
|
818
1379
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
*/
|
|
830
|
-
fetchAll: () => Promise<IProductFeature[]>;
|
|
831
|
-
/**
|
|
832
|
-
* Fetches a feature by tag.
|
|
833
|
-
* @param {string} tag - The feature tag.
|
|
834
|
-
* @returns {IProductFeature|null} The fetched feature, or null if not found.
|
|
835
|
-
*/
|
|
836
|
-
fetch: (tag: string) => Promise<IProductFeature>;
|
|
837
|
-
/**
|
|
838
|
-
* Updates a feature by tag.
|
|
839
|
-
* @param {string} tag - The feature tag.
|
|
840
|
-
* @param {Partial<IProductCache>} data - The feature data to update.
|
|
841
|
-
* @returns {Promise<void>} Resolves when the feature is updated. Throws on error.
|
|
842
|
-
*/
|
|
843
|
-
update: (tag: string, data: Partial<IProductCache>) => Promise<void>;
|
|
1380
|
+
/**
|
|
1381
|
+
* Action CRUD sub-object
|
|
1382
|
+
*/
|
|
1383
|
+
action: {
|
|
1384
|
+
create: (options: IActionCreateOptions) => Promise<void>;
|
|
1385
|
+
update: (options: IActionUpdateOptions) => Promise<void>;
|
|
1386
|
+
fetch: (tag: string) => Promise<import("./database").IActionDefinition>;
|
|
1387
|
+
list: (databaseTag: string) => Promise<import("./database").IActionDefinition[]>;
|
|
1388
|
+
delete: (tag: string) => Promise<void>;
|
|
1389
|
+
dispatch: (data: IDBActionDispatchInput) => Promise<IDispatchResult>;
|
|
844
1390
|
};
|
|
1391
|
+
/**
|
|
1392
|
+
* Dispatch a database operation as a scheduled job
|
|
1393
|
+
*/
|
|
1394
|
+
dispatch: (data: Parameters<DatabaseService["dispatch"]>[0]) => Promise<IDispatchResult>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Get the adapter for the current connection
|
|
1397
|
+
*/
|
|
1398
|
+
getAdapter: (options?: Parameters<DatabaseService["getAdapter"]>[0]) => Promise<import("./database").BaseAdapter>;
|
|
1399
|
+
/**
|
|
1400
|
+
* Get the underlying DatabaseService instance (for advanced usage)
|
|
1401
|
+
*/
|
|
1402
|
+
getService: () => Promise<DatabaseService>;
|
|
1403
|
+
};
|
|
1404
|
+
/**
|
|
1405
|
+
* Graph database operations service.
|
|
1406
|
+
* Provides a unified API for graph database operations including nodes, relationships,
|
|
1407
|
+
* traversals, and transactions.
|
|
1408
|
+
*
|
|
1409
|
+
* @example
|
|
1410
|
+
* // Register a new graph database
|
|
1411
|
+
* await ductape.graph.create({
|
|
1412
|
+
* name: 'Social Graph',
|
|
1413
|
+
* tag: 'social-graph',
|
|
1414
|
+
* type: 'neo4j',
|
|
1415
|
+
* envs: [{ slug: 'dev', connection_url: 'bolt://localhost:7687' }],
|
|
1416
|
+
* });
|
|
1417
|
+
*/
|
|
1418
|
+
graph: {
|
|
1419
|
+
/**
|
|
1420
|
+
* Get the underlying GraphService instance
|
|
1421
|
+
*/
|
|
1422
|
+
getService: () => Promise<GraphService>;
|
|
1423
|
+
};
|
|
1424
|
+
/**
|
|
1425
|
+
* Workflow service for building and executing durable workflows.
|
|
1426
|
+
*
|
|
1427
|
+
* @example
|
|
1428
|
+
* // Create a workflow from JSON schema
|
|
1429
|
+
* await ductape.workflows.create('my-product', {
|
|
1430
|
+
* tag: 'order-fulfillment',
|
|
1431
|
+
* name: 'Order Fulfillment',
|
|
1432
|
+
* steps: [...],
|
|
1433
|
+
* });
|
|
1434
|
+
*/
|
|
1435
|
+
workflows: {
|
|
1436
|
+
/**
|
|
1437
|
+
* Get the underlying WorkflowService instance
|
|
1438
|
+
*/
|
|
1439
|
+
getService: () => Promise<WorkflowService>;
|
|
1440
|
+
};
|
|
1441
|
+
/**
|
|
1442
|
+
* Agents service for building and executing AI-driven agentic workflows.
|
|
1443
|
+
*
|
|
1444
|
+
* @example
|
|
1445
|
+
* // Define an agent
|
|
1446
|
+
* await ductape.agents.define({
|
|
1447
|
+
* tag: 'customer-support',
|
|
1448
|
+
* name: 'Customer Support Agent',
|
|
1449
|
+
* model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' },
|
|
1450
|
+
* });
|
|
1451
|
+
*/
|
|
1452
|
+
agents: {
|
|
1453
|
+
/**
|
|
1454
|
+
* Get the underlying AgentsService instance
|
|
1455
|
+
*/
|
|
1456
|
+
getService: () => Promise<AgentsService>;
|
|
1457
|
+
};
|
|
1458
|
+
/**
|
|
1459
|
+
* LLM Model operations for managing model configurations.
|
|
1460
|
+
*
|
|
1461
|
+
* @example
|
|
1462
|
+
* // Create a model configuration
|
|
1463
|
+
* await ductape.models.create({
|
|
1464
|
+
* product: 'my-product',
|
|
1465
|
+
* tag: 'claude-sonnet',
|
|
1466
|
+
* name: 'Claude Sonnet',
|
|
1467
|
+
* provider: 'anthropic',
|
|
1468
|
+
* });
|
|
1469
|
+
*/
|
|
1470
|
+
models: {
|
|
1471
|
+
/**
|
|
1472
|
+
* Get the underlying ModelService instance
|
|
1473
|
+
*/
|
|
1474
|
+
getService: () => Promise<ModelService>;
|
|
1475
|
+
};
|
|
1476
|
+
/**
|
|
1477
|
+
* Vector database operations service.
|
|
1478
|
+
*
|
|
1479
|
+
* @example
|
|
1480
|
+
* // Create a vector database configuration
|
|
1481
|
+
* await ductape.vector.create({
|
|
1482
|
+
* product: 'my-product',
|
|
1483
|
+
* tag: 'embeddings',
|
|
1484
|
+
* name: 'Document Embeddings',
|
|
1485
|
+
* });
|
|
1486
|
+
*/
|
|
1487
|
+
vector: {
|
|
1488
|
+
/**
|
|
1489
|
+
* Get the underlying VectorDatabaseService instance
|
|
1490
|
+
*/
|
|
1491
|
+
getService: () => Promise<VectorDatabaseService>;
|
|
1492
|
+
};
|
|
1493
|
+
/**
|
|
1494
|
+
* Job-related operations for managing product jobs.
|
|
1495
|
+
*/
|
|
1496
|
+
jobs: {
|
|
1497
|
+
/**
|
|
1498
|
+
* Creates a job for a product.
|
|
1499
|
+
* @param {string} product - The product tag.
|
|
1500
|
+
* @param {Partial<IProductJobs>} data - The job data.
|
|
1501
|
+
* @returns {Promise<void>} Resolves when the job is created. Throws on error.
|
|
1502
|
+
*/
|
|
1503
|
+
create: (product: string, data: Partial<IProductJobs>) => Promise<void>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Fetches all jobs for a product.
|
|
1506
|
+
* @param {string} product - The product tag.
|
|
1507
|
+
* @returns {IProductJobs[]} The list of jobs.
|
|
1508
|
+
*/
|
|
1509
|
+
list: (product: string) => Promise<IProductJobs[]>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Fetches a job by tag.
|
|
1512
|
+
* @param {string} product - The product tag.
|
|
1513
|
+
* @param {string} tag - The job tag.
|
|
1514
|
+
* @returns {IProductJobs|null} The fetched job, or null if not found.
|
|
1515
|
+
*/
|
|
1516
|
+
fetch: (product: string, tag: string) => Promise<IProductJobs>;
|
|
1517
|
+
/**
|
|
1518
|
+
* Updates a job by tag.
|
|
1519
|
+
* @param {string} product - The product tag.
|
|
1520
|
+
* @param {string} tag - The job tag.
|
|
1521
|
+
* @param {Partial<IProductJobs>} data - The job data to update.
|
|
1522
|
+
* @returns {Promise<void>} Resolves when the job is updated. Throws on error.
|
|
1523
|
+
*/
|
|
1524
|
+
update: (product: string, tag: string, data: Partial<IProductJobs>) => Promise<void>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Deletes a job by tag.
|
|
1527
|
+
* @param {string} product - The product tag.
|
|
1528
|
+
* @param {string} tag - The job tag.
|
|
1529
|
+
* @returns {Promise<void>} Resolves when the job is deleted. Throws on error.
|
|
1530
|
+
*/
|
|
1531
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Get a scheduled/running job by ID
|
|
1534
|
+
* @param jobId - The job ID
|
|
1535
|
+
* @returns The job details or null if not found
|
|
1536
|
+
* @example
|
|
1537
|
+
* const job = await ductape.jobs.get('job_abc123');
|
|
1538
|
+
* console.log(job.status); // 'scheduled', 'running', 'completed', etc.
|
|
1539
|
+
*/
|
|
1540
|
+
get: (jobId: string) => Promise<import("./jobs").IJob>;
|
|
1541
|
+
/**
|
|
1542
|
+
* List jobs with filtering options
|
|
1543
|
+
* @param options - Filter options
|
|
1544
|
+
* @returns Paginated list of jobs
|
|
1545
|
+
* @example
|
|
1546
|
+
* const { jobs, total } = await ductape.jobs.listJobs({
|
|
1547
|
+
* product: 'my-product',
|
|
1548
|
+
* status: JobStatus.SCHEDULED,
|
|
1549
|
+
* limit: 20,
|
|
1550
|
+
* });
|
|
1551
|
+
*/
|
|
1552
|
+
listJobs: (options?: IJobListOptions) => Promise<import("./jobs").IJobListResult>;
|
|
1553
|
+
/**
|
|
1554
|
+
* Cancel a scheduled or running job
|
|
1555
|
+
* @param jobId - The job ID
|
|
1556
|
+
* @param options - Cancel options
|
|
1557
|
+
* @returns The cancelled job or null
|
|
1558
|
+
* @example
|
|
1559
|
+
* await ductape.jobs.cancel('job_abc123', { reason: 'User requested' });
|
|
1560
|
+
*/
|
|
1561
|
+
cancel: (jobId: string, options?: ICancelOptions) => Promise<import("./jobs").IJob>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Cancel multiple jobs matching a filter
|
|
1564
|
+
* @param filter - Filter to match jobs
|
|
1565
|
+
* @returns Count of cancelled jobs
|
|
1566
|
+
*/
|
|
1567
|
+
cancelMany: (filter: {
|
|
1568
|
+
product?: string;
|
|
1569
|
+
status?: JobStatus;
|
|
1570
|
+
}) => Promise<{
|
|
1571
|
+
count: number;
|
|
1572
|
+
}>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Pause a recurring job
|
|
1575
|
+
* @param jobId - The job ID
|
|
1576
|
+
* @returns The paused job or null
|
|
1577
|
+
* @example
|
|
1578
|
+
* await ductape.jobs.pause('job_abc123');
|
|
1579
|
+
*/
|
|
1580
|
+
pause: (jobId: string) => Promise<import("./jobs").IJob>;
|
|
1581
|
+
/**
|
|
1582
|
+
* Pause multiple jobs matching a filter
|
|
1583
|
+
* @param filter - Filter to match jobs
|
|
1584
|
+
* @returns Count of paused jobs
|
|
1585
|
+
*/
|
|
1586
|
+
pauseMany: (filter: {
|
|
1587
|
+
product?: string;
|
|
1588
|
+
recurring?: boolean;
|
|
1589
|
+
}) => Promise<{
|
|
1590
|
+
count: number;
|
|
1591
|
+
}>;
|
|
1592
|
+
/**
|
|
1593
|
+
* Resume a paused job
|
|
1594
|
+
* @param jobId - The job ID
|
|
1595
|
+
* @returns The resumed job or null
|
|
1596
|
+
* @example
|
|
1597
|
+
* await ductape.jobs.resume('job_abc123');
|
|
1598
|
+
*/
|
|
1599
|
+
resume: (jobId: string) => Promise<import("./jobs").IJob>;
|
|
1600
|
+
/**
|
|
1601
|
+
* Resume multiple jobs matching a filter
|
|
1602
|
+
* @param filter - Filter to match jobs
|
|
1603
|
+
* @returns Count of resumed jobs
|
|
1604
|
+
*/
|
|
1605
|
+
resumeMany: (filter: {
|
|
1606
|
+
product?: string;
|
|
1607
|
+
status?: JobStatus;
|
|
1608
|
+
}) => Promise<{
|
|
1609
|
+
count: number;
|
|
1610
|
+
}>;
|
|
1611
|
+
/**
|
|
1612
|
+
* Retry a failed job
|
|
1613
|
+
* @param jobId - The job ID
|
|
1614
|
+
* @param options - Retry options
|
|
1615
|
+
* @returns The retried job or null
|
|
1616
|
+
* @example
|
|
1617
|
+
* await ductape.jobs.retry('job_abc123', { delay: 5000 });
|
|
1618
|
+
*/
|
|
1619
|
+
retry: (jobId: string, options?: IRetryOptions) => Promise<import("./jobs").IJob>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Retry multiple failed jobs matching a filter
|
|
1622
|
+
* @param filter - Filter to match jobs
|
|
1623
|
+
* @returns Count of retried jobs
|
|
1624
|
+
*/
|
|
1625
|
+
retryMany: (filter: {
|
|
1626
|
+
status?: JobStatus;
|
|
1627
|
+
from?: number | string;
|
|
1628
|
+
}) => Promise<{
|
|
1629
|
+
count: number;
|
|
1630
|
+
}>;
|
|
1631
|
+
/**
|
|
1632
|
+
* Reschedule a job for a different time
|
|
1633
|
+
* @param jobId - The job ID
|
|
1634
|
+
* @param options - Reschedule options
|
|
1635
|
+
* @returns The rescheduled job or null
|
|
1636
|
+
* @example
|
|
1637
|
+
* await ductape.jobs.reschedule('job_abc123', {
|
|
1638
|
+
* start_at: Date.now() + 3600000, // 1 hour from now
|
|
1639
|
+
* });
|
|
1640
|
+
*/
|
|
1641
|
+
reschedule: (jobId: string, options: IRescheduleOptions) => Promise<import("./jobs").IJob>;
|
|
1642
|
+
/**
|
|
1643
|
+
* Get job execution history
|
|
1644
|
+
* @param jobId - The job ID
|
|
1645
|
+
* @param options - Options (limit)
|
|
1646
|
+
* @returns Execution history
|
|
1647
|
+
* @example
|
|
1648
|
+
* const history = await ductape.jobs.getHistory('job_abc123');
|
|
1649
|
+
* console.log(history.executions); // Array of past executions
|
|
1650
|
+
*/
|
|
1651
|
+
getHistory: (jobId: string, options?: {
|
|
1652
|
+
limit?: number;
|
|
1653
|
+
}) => Promise<import("./jobs").IJobHistory>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Get job statistics
|
|
1656
|
+
* @param options - Filter options
|
|
1657
|
+
* @returns Job statistics
|
|
1658
|
+
* @example
|
|
1659
|
+
* const stats = await ductape.jobs.getStats({ product: 'my-product' });
|
|
1660
|
+
* console.log(stats.total, stats.completed, stats.failed);
|
|
1661
|
+
*/
|
|
1662
|
+
getStats: (options?: {
|
|
1663
|
+
product?: string;
|
|
1664
|
+
env?: string;
|
|
1665
|
+
from?: number;
|
|
1666
|
+
to?: number;
|
|
1667
|
+
}) => Promise<import("./jobs").IJobStats>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Set a webhook for job events
|
|
1670
|
+
* @param config - Webhook configuration
|
|
1671
|
+
* @returns Promise<void>
|
|
1672
|
+
* @example
|
|
1673
|
+
* await ductape.jobs.setWebhook({
|
|
1674
|
+
* url: 'https://api.example.com/webhooks/jobs',
|
|
1675
|
+
* events: ['completed', 'failed'],
|
|
1676
|
+
* secret: 'webhook-secret',
|
|
1677
|
+
* });
|
|
1678
|
+
*/
|
|
1679
|
+
setWebhook: (config: IJobWebhookConfig) => Promise<void>;
|
|
1680
|
+
/**
|
|
1681
|
+
* Get the underlying JobsService instance (for advanced usage)
|
|
1682
|
+
*/
|
|
1683
|
+
getService: () => Promise<JobsService>;
|
|
1684
|
+
};
|
|
1685
|
+
/**
|
|
1686
|
+
* Secrets management for workspace secrets.
|
|
1687
|
+
*
|
|
1688
|
+
* Secrets allow you to store sensitive values (API keys, passwords, etc.) securely
|
|
1689
|
+
* and reference them in configurations using the $Secret{key} syntax.
|
|
1690
|
+
*
|
|
1691
|
+
* @example
|
|
1692
|
+
* // Create a secret
|
|
1693
|
+
* await ductape.secrets.create({
|
|
1694
|
+
* key: 'STRIPE_API_KEY',
|
|
1695
|
+
* value: 'sk_live_51ABC123...',
|
|
1696
|
+
* description: 'Production Stripe API key',
|
|
1697
|
+
* scope: ['payment_app'],
|
|
1698
|
+
* envs: ['prd'],
|
|
1699
|
+
* });
|
|
1700
|
+
*
|
|
1701
|
+
* // Use secret in database config
|
|
1702
|
+
* await ductape.databases.create({
|
|
1703
|
+
* tag: 'main-db',
|
|
1704
|
+
* name: 'Main Database',
|
|
1705
|
+
* type: 'mongodb',
|
|
1706
|
+
* envs: [{
|
|
1707
|
+
* slug: 'prd',
|
|
1708
|
+
* connection_url: '$Secret{MONGODB_CONNECTION_URL}'
|
|
1709
|
+
* }]
|
|
1710
|
+
* });
|
|
1711
|
+
*/
|
|
1712
|
+
secrets: {
|
|
1713
|
+
/**
|
|
1714
|
+
* Create a new secret in the workspace
|
|
1715
|
+
* @param input - Secret creation input
|
|
1716
|
+
* @returns The created secret metadata (without value)
|
|
1717
|
+
* @example
|
|
1718
|
+
* const secret = await ductape.secrets.create({
|
|
1719
|
+
* key: 'STRIPE_API_KEY',
|
|
1720
|
+
* value: 'sk_live_51ABC123...',
|
|
1721
|
+
* description: 'Production Stripe API key',
|
|
1722
|
+
* token_type: 'api',
|
|
1723
|
+
* scope: ['payment_app'],
|
|
1724
|
+
* envs: ['prd'],
|
|
1725
|
+
* expires_at: Math.floor(Date.now() / 1000) + (365 * 24 * 60 * 60)
|
|
1726
|
+
* });
|
|
1727
|
+
*/
|
|
1728
|
+
create: (input: ICreateSecretInput) => Promise<ISecretMetadata>;
|
|
1729
|
+
/**
|
|
1730
|
+
* Fetch all secrets in the workspace (metadata only, no values)
|
|
1731
|
+
* @returns Array of secret metadata
|
|
1732
|
+
* @example
|
|
1733
|
+
* const secrets = await ductape.secrets.fetchAll();
|
|
1734
|
+
* secrets.forEach(s => console.log(s.key, s.description));
|
|
1735
|
+
*/
|
|
1736
|
+
fetchAll: () => Promise<ISecretMetadata[]>;
|
|
1737
|
+
/**
|
|
1738
|
+
* Fetch a single secret with its decrypted value
|
|
1739
|
+
* @param key - The secret key
|
|
1740
|
+
* @returns The full secret including decrypted value
|
|
1741
|
+
* @example
|
|
1742
|
+
* const secret = await ductape.secrets.fetch('STRIPE_API_KEY');
|
|
1743
|
+
* console.log(secret.value); // sk_live_51ABC123...
|
|
1744
|
+
*/
|
|
1745
|
+
fetch: (key: string) => Promise<ISecret>;
|
|
1746
|
+
/**
|
|
1747
|
+
* Update an existing secret
|
|
1748
|
+
* @param key - The secret key to update
|
|
1749
|
+
* @param input - Update data
|
|
1750
|
+
* @returns Updated secret metadata
|
|
1751
|
+
* @example
|
|
1752
|
+
* await ductape.secrets.update('STRIPE_API_KEY', {
|
|
1753
|
+
* value: 'sk_live_NEW_KEY...',
|
|
1754
|
+
* description: 'Rotated Stripe API key'
|
|
1755
|
+
* });
|
|
1756
|
+
*/
|
|
1757
|
+
update: (key: string, input: IUpdateSecretInput) => Promise<ISecretMetadata>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Delete a secret permanently
|
|
1760
|
+
* @param key - The secret key to delete
|
|
1761
|
+
* @returns true if deleted successfully
|
|
1762
|
+
* @example
|
|
1763
|
+
* await ductape.secrets.delete('OLD_API_KEY');
|
|
1764
|
+
*/
|
|
1765
|
+
delete: (key: string) => Promise<boolean>;
|
|
1766
|
+
/**
|
|
1767
|
+
* Revoke a secret (disable without deleting)
|
|
1768
|
+
* @param key - The secret key to revoke
|
|
1769
|
+
* @returns true if revoked successfully
|
|
1770
|
+
* @example
|
|
1771
|
+
* await ductape.secrets.revoke('COMPROMISED_KEY');
|
|
1772
|
+
*/
|
|
1773
|
+
revoke: (key: string) => Promise<boolean>;
|
|
1774
|
+
/**
|
|
1775
|
+
* Check if a secret exists
|
|
1776
|
+
* @param key - The secret key to check
|
|
1777
|
+
* @returns true if the secret exists
|
|
1778
|
+
* @example
|
|
1779
|
+
* if (await ductape.secrets.exists('MY_SECRET')) {
|
|
1780
|
+
* console.log('Secret exists');
|
|
1781
|
+
* }
|
|
1782
|
+
*/
|
|
1783
|
+
exists: (key: string) => Promise<boolean>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Resolve all $Secret{key} references in a value
|
|
1786
|
+
* Works with strings, objects, and arrays
|
|
1787
|
+
* @param value - The value containing secret references
|
|
1788
|
+
* @param options - Resolution options (app, env for scope/env validation)
|
|
1789
|
+
* @returns Resolved value with secrets replaced
|
|
1790
|
+
* @example
|
|
1791
|
+
* const config = {
|
|
1792
|
+
* apiKey: '$Secret{API_KEY}',
|
|
1793
|
+
* dbUrl: '$Secret{DB_URL}'
|
|
1794
|
+
* };
|
|
1795
|
+
* const resolved = await ductape.secrets.resolve(config, { env: 'prd' });
|
|
1796
|
+
*/
|
|
1797
|
+
resolve: <T>(value: T, options?: IResolveSecretsOptions) => Promise<import("./secrets").ISecretResolutionResult<T>>;
|
|
1798
|
+
/**
|
|
1799
|
+
* Validate that all $Secret{key} references in a value exist
|
|
1800
|
+
* @param value - The value containing secret references
|
|
1801
|
+
* @returns Validation result with existing and missing keys
|
|
1802
|
+
* @example
|
|
1803
|
+
* const result = await ductape.secrets.validate({
|
|
1804
|
+
* url: '$Secret{API_URL}',
|
|
1805
|
+
* key: '$Secret{MISSING_KEY}'
|
|
1806
|
+
* });
|
|
1807
|
+
* if (!result.valid) {
|
|
1808
|
+
* console.error('Missing secrets:', result.missingKeys);
|
|
1809
|
+
* }
|
|
1810
|
+
*/
|
|
1811
|
+
validate: (value: unknown) => Promise<{
|
|
1812
|
+
valid: boolean;
|
|
1813
|
+
missingKeys: string[];
|
|
1814
|
+
existingKeys: string[];
|
|
1815
|
+
}>;
|
|
1816
|
+
/**
|
|
1817
|
+
* Get the underlying SecretsService instance (for advanced usage)
|
|
1818
|
+
*/
|
|
1819
|
+
getService: () => Promise<SecretsService>;
|
|
845
1820
|
};
|
|
846
1821
|
/**
|
|
847
|
-
*
|
|
1822
|
+
* Cache-related operations for managing product caches.
|
|
1823
|
+
*/
|
|
1824
|
+
caches: {
|
|
1825
|
+
/**
|
|
1826
|
+
* Creates a cache for a product.
|
|
1827
|
+
* @param {string} product - The product tag.
|
|
1828
|
+
* @param {IProductCache} data - The cache data.
|
|
1829
|
+
* @returns {Promise<void>} Resolves when the cache is created. Throws on error.
|
|
1830
|
+
*/
|
|
1831
|
+
create: (product: string, data: IProductCache) => Promise<void>;
|
|
1832
|
+
/**
|
|
1833
|
+
* Fetches all caches for a product.
|
|
1834
|
+
* @param {string} product - The product tag.
|
|
1835
|
+
* @returns {IProductCache[]} The list of caches.
|
|
1836
|
+
*/
|
|
1837
|
+
list: (product: string) => Promise<IProductCache[]>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Fetches a cache by tag.
|
|
1840
|
+
* @param {string} product - The product tag.
|
|
1841
|
+
* @param {string} tag - The cache tag.
|
|
1842
|
+
* @returns {IProductCache|null} The fetched cache, or null if not found.
|
|
1843
|
+
*/
|
|
1844
|
+
fetch: (product: string, tag: string) => Promise<IProductCache>;
|
|
1845
|
+
/**
|
|
1846
|
+
* Updates a cache by tag.
|
|
1847
|
+
* @param {string} product - The product tag.
|
|
1848
|
+
* @param {string} tag - The cache tag.
|
|
1849
|
+
* @param {Partial<IProductCache>} data - The cache data to update.
|
|
1850
|
+
* @returns {Promise<void>} Resolves when the cache is updated. Throws on error.
|
|
1851
|
+
*/
|
|
1852
|
+
update: (product: string, tag: string, data: Partial<IProductCache>) => Promise<void>;
|
|
1853
|
+
/**
|
|
1854
|
+
* Deletes a cache by tag.
|
|
1855
|
+
* @param {string} product - The product tag.
|
|
1856
|
+
* @param {string} tag - The cache tag.
|
|
1857
|
+
* @returns {Promise<void>} Resolves when the cache is deleted. Throws on error.
|
|
1858
|
+
*/
|
|
1859
|
+
delete: (product: string, tag: string) => Promise<void>;
|
|
1860
|
+
values: (data: FetchRemoteCachePayload) => Promise<import("./types").IRemoteCache[]>;
|
|
1861
|
+
/**
|
|
1862
|
+
* Fetch paginated cache values with filtering options.
|
|
1863
|
+
* @param options - Options for fetching cache values
|
|
1864
|
+
* @returns Paginated cache values result
|
|
1865
|
+
* @example
|
|
1866
|
+
* ```ts
|
|
1867
|
+
* const result = await ductape.caches.fetchValues({
|
|
1868
|
+
* product: 'my-product',
|
|
1869
|
+
* cache: 'user-cache',
|
|
1870
|
+
* page: 1,
|
|
1871
|
+
* limit: 20,
|
|
1872
|
+
* });
|
|
1873
|
+
* ```
|
|
1874
|
+
*/
|
|
1875
|
+
fetchValues: (options: {
|
|
1876
|
+
product: string;
|
|
1877
|
+
cache: string;
|
|
1878
|
+
env?: string;
|
|
1879
|
+
page?: number;
|
|
1880
|
+
limit?: number;
|
|
1881
|
+
}) => Promise<import("./cache").IFetchCacheValuesResult>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Fetch cache dashboard metrics.
|
|
1884
|
+
* @param options - Options for fetching dashboard
|
|
1885
|
+
* @returns Cache dashboard metrics
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```ts
|
|
1888
|
+
* const dashboard = await ductape.caches.fetchDashboard({
|
|
1889
|
+
* product: 'my-product',
|
|
1890
|
+
* cache: 'user-cache',
|
|
1891
|
+
* });
|
|
1892
|
+
* ```
|
|
1893
|
+
*/
|
|
1894
|
+
fetchDashboard: (options: {
|
|
1895
|
+
product: string;
|
|
1896
|
+
cache: string;
|
|
1897
|
+
env?: string;
|
|
1898
|
+
}) => Promise<import("./cache").ICacheDashboardMetrics>;
|
|
1899
|
+
/**
|
|
1900
|
+
* Get a cache value by key.
|
|
1901
|
+
* @param options - Options containing the key
|
|
1902
|
+
* @returns The cache value or null if not found
|
|
1903
|
+
* @example
|
|
1904
|
+
* ```ts
|
|
1905
|
+
* const value = await ductape.caches.get({ key: 'user:123' });
|
|
1906
|
+
* ```
|
|
1907
|
+
*/
|
|
1908
|
+
get: (options: {
|
|
1909
|
+
key: string;
|
|
1910
|
+
}) => Promise<import("./cache").ICacheValue>;
|
|
1911
|
+
/**
|
|
1912
|
+
* Set a cache value.
|
|
1913
|
+
* @param options - Options for setting the cache value
|
|
1914
|
+
* @returns Boolean indicating success
|
|
1915
|
+
* @example
|
|
1916
|
+
* ```ts
|
|
1917
|
+
* await ductape.caches.set({
|
|
1918
|
+
* product: 'my-product',
|
|
1919
|
+
* cache: 'user-cache',
|
|
1920
|
+
* key: 'user:123',
|
|
1921
|
+
* value: JSON.stringify({ name: 'John' }),
|
|
1922
|
+
* });
|
|
1923
|
+
* ```
|
|
1924
|
+
*/
|
|
1925
|
+
set: (options: {
|
|
1926
|
+
product: string;
|
|
1927
|
+
cache: string;
|
|
1928
|
+
key: string;
|
|
1929
|
+
value: string;
|
|
1930
|
+
componentTag?: string;
|
|
1931
|
+
componentType?: string;
|
|
1932
|
+
expiry?: Date;
|
|
1933
|
+
}) => Promise<boolean>;
|
|
1934
|
+
/**
|
|
1935
|
+
* Clear a cache value by key.
|
|
1936
|
+
* @param options - Options containing the key
|
|
1937
|
+
* @returns Boolean indicating success
|
|
1938
|
+
* @example
|
|
1939
|
+
* ```ts
|
|
1940
|
+
* await ductape.caches.clear({ key: 'user:123' });
|
|
1941
|
+
* ```
|
|
1942
|
+
*/
|
|
1943
|
+
clear: (options: {
|
|
1944
|
+
key: string;
|
|
1945
|
+
}) => Promise<boolean>;
|
|
1946
|
+
/**
|
|
1947
|
+
* Clear all cache values for a product/cache combination.
|
|
1948
|
+
* @param options - Options for clearing cache values
|
|
1949
|
+
* @returns Object with cleared count
|
|
1950
|
+
* @example
|
|
1951
|
+
* ```ts
|
|
1952
|
+
* const result = await ductape.caches.clearAll({
|
|
1953
|
+
* product: 'my-product',
|
|
1954
|
+
* cache: 'user-cache',
|
|
1955
|
+
* });
|
|
1956
|
+
* console.log('Cleared:', result.cleared);
|
|
1957
|
+
* ```
|
|
1958
|
+
*/
|
|
1959
|
+
clearAll: (options: {
|
|
1960
|
+
product: string;
|
|
1961
|
+
cache: string;
|
|
1962
|
+
env?: string;
|
|
1963
|
+
}) => Promise<import("./cache").IClearCacheValuesResult>;
|
|
1964
|
+
};
|
|
1965
|
+
/**
|
|
1966
|
+
* App-related operations for managing apps.
|
|
848
1967
|
*/
|
|
849
1968
|
app: {
|
|
850
1969
|
/**
|
|
@@ -869,474 +1988,395 @@ export default class Ductape implements IDuctape {
|
|
|
869
1988
|
*/
|
|
870
1989
|
update: (tag: string, data: Partial<IApp>) => Promise<void>;
|
|
871
1990
|
/**
|
|
872
|
-
* Initializes an app by tag.
|
|
1991
|
+
* Initializes an app by tag (pre-loads builder into cache).
|
|
873
1992
|
* @param {string} appTag - The app tag.
|
|
874
1993
|
* @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
|
|
875
1994
|
*/
|
|
876
1995
|
init: (appTag: string) => Promise<void>;
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
* Fetches all variables for an app.
|
|
886
|
-
* @returns {IAppVariables[]} The list of variables.
|
|
887
|
-
*/
|
|
888
|
-
fetchAll: () => Promise<IAppVariables[]>;
|
|
889
|
-
/**
|
|
890
|
-
* Fetches a variable by tag.
|
|
891
|
-
* @param {string} tag - The variable tag.
|
|
892
|
-
* @returns {IAppVariables|null} The fetched variable, or null if not found.
|
|
893
|
-
*/
|
|
894
|
-
fetch: (tag: string) => Promise<IAppVariables>;
|
|
895
|
-
/**
|
|
896
|
-
* Updates a variable by tag.
|
|
897
|
-
* @param {string} tag - The variable tag.
|
|
898
|
-
* @param {Partial<IAppVariables>} data - The variable data to update.
|
|
899
|
-
* @returns {Promise<void>} Resolves when the variable is updated. Throws on error.
|
|
900
|
-
*/
|
|
901
|
-
update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
902
|
-
};
|
|
903
|
-
constants: {
|
|
904
|
-
/**
|
|
905
|
-
* Creates a constant for an app.
|
|
906
|
-
* @param {IAppConstants} data - The constant data.
|
|
907
|
-
* @returns {Promise<void>} Resolves when the constant is created. Throws on error.
|
|
908
|
-
*/
|
|
909
|
-
create: (data: IAppConstants) => Promise<void>;
|
|
910
|
-
/**
|
|
911
|
-
* Fetches all constants for an app.
|
|
912
|
-
* @returns {IAppConstants[]} The list of constants.
|
|
913
|
-
*/
|
|
914
|
-
fetchAll: () => Promise<IAppConstants[]>;
|
|
915
|
-
/**
|
|
916
|
-
* Fetches a constant by tag.
|
|
917
|
-
* @param {string} tag - The constant tag.
|
|
918
|
-
* @returns {IAppConstants|null} The fetched constant, or null if not found.
|
|
919
|
-
*/
|
|
920
|
-
fetch: (tag: string) => Promise<IAppConstants>;
|
|
921
|
-
/**
|
|
922
|
-
* Updates a constant by tag.
|
|
923
|
-
* @param {string} tag - The constant tag.
|
|
924
|
-
* @param {Partial<IAppVariables>} data - The constant data to update.
|
|
925
|
-
* @returns {Promise<void>} Resolves when the constant is updated. Throws on error.
|
|
926
|
-
*/
|
|
927
|
-
update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
928
|
-
};
|
|
929
|
-
actions: {
|
|
930
|
-
/**
|
|
931
|
-
* Imports actions for an app from a file.
|
|
932
|
-
* @param {Object} params - The import parameters.
|
|
933
|
-
* @param {Buffer} params.file - The file buffer.
|
|
934
|
-
* @param {ImportDocsTypes} params.type - The import type.
|
|
935
|
-
* @param {string} params.version - The version.
|
|
936
|
-
* @param {string} [params.appTag] - The app tag (optional).
|
|
937
|
-
* @param {boolean} [params.updateIfExists] - Whether to update if actions exist (optional).
|
|
938
|
-
* @returns {Promise<void>} Resolves when the import is complete. Throws on error.
|
|
939
|
-
*/
|
|
940
|
-
import: ({ file, type, version, appTag, updateIfExists, isAdminImport, }: {
|
|
941
|
-
file: Buffer;
|
|
942
|
-
type: ImportDocsTypes;
|
|
943
|
-
version: string;
|
|
944
|
-
appTag?: string;
|
|
945
|
-
updateIfExists?: boolean;
|
|
946
|
-
isAdminImport?: boolean;
|
|
947
|
-
}) => Promise<void>;
|
|
948
|
-
/**
|
|
949
|
-
* Updates an action by tag.
|
|
950
|
-
* @param {string} tag - The action tag.
|
|
951
|
-
* @param {Partial<IActionUpdate>} data - The action data to update.
|
|
952
|
-
* @returns {Promise<void>} Resolves when the action is updated. Throws on error.
|
|
953
|
-
*/
|
|
954
|
-
update: (tag: string, data: Partial<IActionUpdate>) => Promise<void>;
|
|
955
|
-
/**
|
|
956
|
-
* Updates multiple actions at once with shared variables (query params or headers).
|
|
957
|
-
* @param {string[]} tags - Array of action tags to update.
|
|
958
|
-
* @param {Object} data - The shared variable data.
|
|
959
|
-
* @param {'query' | 'headers'} data.category - The variable type (query params or headers).
|
|
960
|
-
* @param {string} data.key - The variable key.
|
|
961
|
-
* @param {string} data.value - The variable value.
|
|
962
|
-
* @returns {Promise<void>} Resolves when all actions are updated. Throws on error.
|
|
963
|
-
*/
|
|
964
|
-
updateMany: (tags: string[], data: {
|
|
965
|
-
category: "query" | "headers";
|
|
966
|
-
key: string;
|
|
967
|
-
value: string;
|
|
968
|
-
}) => Promise<void>;
|
|
969
|
-
/**
|
|
970
|
-
* Creates an action.
|
|
971
|
-
* @param {Partial<IActionUpdate> & { tag: string; name: string; resource: string; method: string }} data - The action data to create.
|
|
972
|
-
* @returns {Promise<void>} Resolves when the action is created. Throws on error.
|
|
973
|
-
*/
|
|
974
|
-
create: (data: Partial<IActionUpdate> & {
|
|
975
|
-
tag: string;
|
|
976
|
-
name: string;
|
|
977
|
-
resource: string;
|
|
978
|
-
method: string;
|
|
979
|
-
}) => Promise<void>;
|
|
980
|
-
/**
|
|
981
|
-
* Fetches all actions for an app.
|
|
982
|
-
* @returns {IAppAction[]} The list of actions.
|
|
983
|
-
*/
|
|
984
|
-
fetchAll: () => Promise<IAppAction[]>;
|
|
985
|
-
/**
|
|
986
|
-
* Fetches an action by tag.
|
|
987
|
-
* @param {string} tag - The action tag.
|
|
988
|
-
* @returns {IAppAction|null} The fetched action, or null if not found.
|
|
989
|
-
*/
|
|
990
|
-
fetch: (tag: string) => Promise<IAppAction>;
|
|
991
|
-
};
|
|
992
|
-
auths: {
|
|
993
|
-
/**
|
|
994
|
-
* Creates an auth for an app.
|
|
995
|
-
* @param {IAppAuth} data - The auth data.
|
|
996
|
-
* @returns {Promise<void>} Resolves when the auth is created. Throws on error.
|
|
997
|
-
*/
|
|
998
|
-
create: (data: IAppAuth) => Promise<void>;
|
|
999
|
-
/**
|
|
1000
|
-
* Fetches all auths for an app.
|
|
1001
|
-
* @returns {IAppAuth[]} The list of auths.
|
|
1002
|
-
*/
|
|
1003
|
-
fetchAll: () => Promise<IAppAuth[]>;
|
|
1004
|
-
/**
|
|
1005
|
-
* Fetches an auth by tag.
|
|
1006
|
-
* @param {string} tag - The auth tag.
|
|
1007
|
-
* @returns {IAppAuth|null} The fetched auth, or null if not found.
|
|
1008
|
-
*/
|
|
1009
|
-
fetch: (tag: string) => Promise<IAppAuth>;
|
|
1010
|
-
/**
|
|
1011
|
-
* Updates an auth by tag.
|
|
1012
|
-
* @param {string} tag - The auth tag.
|
|
1013
|
-
* @param {Partial<IAppAuth>} data - The auth data to update.
|
|
1014
|
-
* @returns {Promise<void>} Resolves when the auth is updated. Throws on error.
|
|
1015
|
-
*/
|
|
1016
|
-
update: (tag: string, data: Partial<IAppAuth>) => Promise<void>;
|
|
1017
|
-
};
|
|
1018
|
-
webhooks: {
|
|
1019
|
-
/**
|
|
1020
|
-
* Creates a webhook for an app.
|
|
1021
|
-
* @param {Partial<IAppWebhook>} data - The webhook data.
|
|
1022
|
-
* @returns {Promise<void>} Resolves when the webhook is created. Throws on error.
|
|
1023
|
-
*/
|
|
1024
|
-
create: (data: Partial<IAppWebhook>) => Promise<void>;
|
|
1025
|
-
/**
|
|
1026
|
-
* Fetches all webhooks for an app.
|
|
1027
|
-
* @returns {IAppWebhook[]} The list of webhooks.
|
|
1028
|
-
*/
|
|
1029
|
-
fetchAll: () => Promise<IAppWebhook[]>;
|
|
1030
|
-
/**
|
|
1031
|
-
* Fetches a webhook by tag.
|
|
1032
|
-
* @param {string} tag - The webhook tag.
|
|
1033
|
-
* @returns {IAppWebhook|null} The fetched webhook, or null if not found.
|
|
1034
|
-
*/
|
|
1035
|
-
fetch: (tag: string) => Promise<IAppWebhook>;
|
|
1036
|
-
/**
|
|
1037
|
-
* Updates a webhook by tag.
|
|
1038
|
-
* @param {string} tag - The webhook tag.
|
|
1039
|
-
* @param {Partial<IAppWebhook>} data - The webhook data to update.
|
|
1040
|
-
* @returns {Promise<void>} Resolves when the webhook is updated. Throws on error.
|
|
1041
|
-
*/
|
|
1042
|
-
update: (tag: string, data: Partial<IAppWebhook>) => Promise<void>;
|
|
1043
|
-
events: {
|
|
1044
|
-
/**
|
|
1045
|
-
* Creates a webhook event for an app.
|
|
1046
|
-
* @param {IAppWebhookEvent} data - The webhook event data.
|
|
1047
|
-
* @returns {Promise<void>} Resolves when the webhook event is created. Throws on error.
|
|
1048
|
-
*/
|
|
1049
|
-
create: (data: IAppWebhookEvent) => Promise<void>;
|
|
1050
|
-
/**
|
|
1051
|
-
* Fetches all webhook events for a webhook by tag.
|
|
1052
|
-
* @param {string} webhookTag - The webhook tag.
|
|
1053
|
-
* @returns {IAppWebhookEvent[]} The list of webhook events.
|
|
1054
|
-
*/
|
|
1055
|
-
fetchAll: (webhookTag: string) => Promise<IAppWebhookEvent[]>;
|
|
1056
|
-
/**
|
|
1057
|
-
* Fetches a webhook event by tag.
|
|
1058
|
-
* @param {string} tag - The webhook event tag.
|
|
1059
|
-
* @returns {IAppWebhookEvent|null} The fetched webhook event, or null if not found.
|
|
1060
|
-
*/
|
|
1061
|
-
fetch: (tag: string) => Promise<IAppWebhookEvent>;
|
|
1062
|
-
/**
|
|
1063
|
-
* Updates a webhook event by tag.
|
|
1064
|
-
* @param {string} tag - The webhook event tag.
|
|
1065
|
-
* @param {Partial<IAppWebhookEvent>} data - The webhook event data to update.
|
|
1066
|
-
* @returns {Promise<void>} Resolves when the webhook event is updated. Throws on error.
|
|
1067
|
-
*/
|
|
1068
|
-
update: (tag: string, data: Partial<IAppWebhookEvent>) => Promise<void>;
|
|
1069
|
-
};
|
|
1070
|
-
};
|
|
1996
|
+
/**
|
|
1997
|
+
* Updates data validation for an app.
|
|
1998
|
+
* @param {string} appTag - The app tag.
|
|
1999
|
+
* @param {string} selector - The selector for the data validation.
|
|
2000
|
+
* @param {Partial<IParsedSample>} update - The update data.
|
|
2001
|
+
* @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
|
|
2002
|
+
*/
|
|
2003
|
+
validation: (appTag: string, selector: string, update: Partial<IParsedSample>) => Promise<void>;
|
|
1071
2004
|
environments: {
|
|
1072
2005
|
/**
|
|
1073
2006
|
* Creates an environment for an app.
|
|
2007
|
+
* @param {string} appTag - The app tag.
|
|
1074
2008
|
* @param {IAppEnv} data - The environment data.
|
|
1075
2009
|
* @returns {Promise<void>} Resolves when the environment is created. Throws on error.
|
|
1076
2010
|
*/
|
|
1077
|
-
create: (data: IAppEnv) => Promise<void>;
|
|
2011
|
+
create: (appTag: string, data: IAppEnv) => Promise<void>;
|
|
1078
2012
|
/**
|
|
1079
2013
|
* Fetches all environments for an app.
|
|
2014
|
+
* @param {string} appTag - The app tag.
|
|
1080
2015
|
* @returns {IAppEnv[]} The list of environments.
|
|
1081
2016
|
*/
|
|
1082
|
-
|
|
2017
|
+
list: (appTag: string) => Promise<IAppEnv[]>;
|
|
1083
2018
|
/**
|
|
1084
2019
|
* Fetches an environment by slug.
|
|
2020
|
+
* @param {string} appTag - The app tag.
|
|
1085
2021
|
* @param {string} slug - The environment slug.
|
|
1086
2022
|
* @returns {IAppEnv|null} The fetched environment, or null if not found.
|
|
1087
2023
|
*/
|
|
1088
|
-
fetch: (slug: string) => Promise<IAppEnv>;
|
|
2024
|
+
fetch: (appTag: string, slug: string) => Promise<IAppEnv>;
|
|
1089
2025
|
/**
|
|
1090
2026
|
* Updates an environment by slug.
|
|
2027
|
+
* @param {string} appTag - The app tag.
|
|
1091
2028
|
* @param {string} slug - The environment slug.
|
|
1092
2029
|
* @param {Partial<IAppEnv>} data - The environment data to update.
|
|
1093
2030
|
* @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
|
|
1094
2031
|
*/
|
|
1095
|
-
update: (slug: string, data: Partial<IAppEnv>) => Promise<void>;
|
|
2032
|
+
update: (appTag: string, slug: string, data: Partial<IAppEnv>) => Promise<void>;
|
|
1096
2033
|
};
|
|
1097
|
-
/**
|
|
1098
|
-
* Updates data validation for an app.
|
|
1099
|
-
* @param {string} selector - The selector for the data validation.
|
|
1100
|
-
* @param {Partial<IParsedSample>} update - The update data.
|
|
1101
|
-
* @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
|
|
1102
|
-
*/
|
|
1103
|
-
validation: (selector: string, update: Partial<IParsedSample>) => Promise<void>;
|
|
1104
2034
|
};
|
|
1105
2035
|
/**
|
|
1106
|
-
*
|
|
2036
|
+
* Variable-related operations for managing app variables.
|
|
1107
2037
|
*/
|
|
1108
|
-
|
|
2038
|
+
variables: {
|
|
1109
2039
|
/**
|
|
1110
|
-
*
|
|
1111
|
-
* @param {
|
|
1112
|
-
* @
|
|
2040
|
+
* Creates a variable for an app.
|
|
2041
|
+
* @param {string} appTag - The app tag.
|
|
2042
|
+
* @param {IAppVariables} data - The variable data.
|
|
2043
|
+
* @returns {Promise<void>} Resolves when the variable is created. Throws on error.
|
|
1113
2044
|
*/
|
|
1114
|
-
|
|
1115
|
-
};
|
|
1116
|
-
/**
|
|
1117
|
-
* Action-related operations for running actions.
|
|
1118
|
-
*/
|
|
1119
|
-
action: {
|
|
2045
|
+
create: (appTag: string, data: IAppVariables) => Promise<void>;
|
|
1120
2046
|
/**
|
|
1121
|
-
*
|
|
1122
|
-
* @param {
|
|
1123
|
-
* @returns {
|
|
2047
|
+
* Fetches all variables for an app.
|
|
2048
|
+
* @param {string} appTag - The app tag.
|
|
2049
|
+
* @returns {IAppVariables[]} The list of variables.
|
|
1124
2050
|
*/
|
|
1125
|
-
|
|
2051
|
+
list: (appTag: string) => Promise<IAppVariables[]>;
|
|
2052
|
+
/**
|
|
2053
|
+
* Fetches a variable by tag.
|
|
2054
|
+
* @param {string} appTag - The app tag.
|
|
2055
|
+
* @param {string} tag - The variable tag.
|
|
2056
|
+
* @returns {IAppVariables|null} The fetched variable, or null if not found.
|
|
2057
|
+
*/
|
|
2058
|
+
fetch: (appTag: string, tag: string) => Promise<IAppVariables>;
|
|
2059
|
+
/**
|
|
2060
|
+
* Updates a variable by tag.
|
|
2061
|
+
* @param {string} appTag - The app tag.
|
|
2062
|
+
* @param {string} tag - The variable tag.
|
|
2063
|
+
* @param {Partial<IAppVariables>} data - The variable data to update.
|
|
2064
|
+
* @returns {Promise<void>} Resolves when the variable is updated. Throws on error.
|
|
2065
|
+
*/
|
|
2066
|
+
update: (appTag: string, tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
1126
2067
|
};
|
|
1127
2068
|
/**
|
|
1128
|
-
*
|
|
2069
|
+
* Constant-related operations for managing app constants.
|
|
1129
2070
|
*/
|
|
1130
|
-
|
|
2071
|
+
constants: {
|
|
1131
2072
|
/**
|
|
1132
|
-
*
|
|
1133
|
-
* @param {
|
|
1134
|
-
* @
|
|
2073
|
+
* Creates a constant for an app.
|
|
2074
|
+
* @param {string} appTag - The app tag.
|
|
2075
|
+
* @param {IAppConstants} data - The constant data.
|
|
2076
|
+
* @returns {Promise<void>} Resolves when the constant is created. Throws on error.
|
|
1135
2077
|
*/
|
|
1136
|
-
create: (data:
|
|
2078
|
+
create: (appTag: string, data: IAppConstants) => Promise<void>;
|
|
1137
2079
|
/**
|
|
1138
|
-
*
|
|
1139
|
-
* @param {
|
|
1140
|
-
* @returns {
|
|
2080
|
+
* Fetches all constants for an app.
|
|
2081
|
+
* @param {string} appTag - The app tag.
|
|
2082
|
+
* @returns {IAppConstants[]} The list of constants.
|
|
1141
2083
|
*/
|
|
1142
|
-
|
|
2084
|
+
list: (appTag: string) => Promise<IAppConstants[]>;
|
|
1143
2085
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
* @param {
|
|
1146
|
-
* @
|
|
2086
|
+
* Fetches a constant by tag.
|
|
2087
|
+
* @param {string} appTag - The app tag.
|
|
2088
|
+
* @param {string} tag - The constant tag.
|
|
2089
|
+
* @returns {IAppConstants|null} The fetched constant, or null if not found.
|
|
1147
2090
|
*/
|
|
1148
|
-
|
|
2091
|
+
fetch: (appTag: string, tag: string) => Promise<IAppConstants>;
|
|
2092
|
+
/**
|
|
2093
|
+
* Updates a constant by tag.
|
|
2094
|
+
* @param {string} appTag - The app tag.
|
|
2095
|
+
* @param {string} tag - The constant tag.
|
|
2096
|
+
* @param {Partial<IAppVariables>} data - The constant data to update.
|
|
2097
|
+
* @returns {Promise<void>} Resolves when the constant is updated. Throws on error.
|
|
2098
|
+
*/
|
|
2099
|
+
update: (appTag: string, tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
1149
2100
|
};
|
|
1150
2101
|
/**
|
|
1151
|
-
*
|
|
2102
|
+
* Action-related operations for managing app actions.
|
|
1152
2103
|
*/
|
|
1153
|
-
|
|
2104
|
+
actions: {
|
|
1154
2105
|
/**
|
|
1155
|
-
*
|
|
1156
|
-
* @param {
|
|
1157
|
-
* @
|
|
2106
|
+
* Imports actions for an app from a file.
|
|
2107
|
+
* @param {Object} params - The import parameters.
|
|
2108
|
+
* @param {Buffer} params.file - The file buffer.
|
|
2109
|
+
* @param {ImportDocsTypes} params.type - The import type.
|
|
2110
|
+
* @param {string} params.version - The version.
|
|
2111
|
+
* @param {string} [params.appTag] - The app tag (optional).
|
|
2112
|
+
* @param {boolean} [params.updateIfExists] - Whether to update if actions exist (optional).
|
|
2113
|
+
* @returns {Promise<void>} Resolves when the import is complete. Throws on error.
|
|
1158
2114
|
*/
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
2115
|
+
import: ({ file, type, version, appTag, updateIfExists, isAdminImport, }: {
|
|
2116
|
+
file: Buffer;
|
|
2117
|
+
type: ImportDocsTypes;
|
|
2118
|
+
version: string;
|
|
2119
|
+
appTag?: string;
|
|
2120
|
+
updateIfExists?: boolean;
|
|
2121
|
+
isAdminImport?: boolean;
|
|
2122
|
+
}) => Promise<void>;
|
|
1162
2123
|
/**
|
|
1163
|
-
*
|
|
1164
|
-
* @param {string}
|
|
1165
|
-
* @
|
|
2124
|
+
* Updates an action by tag.
|
|
2125
|
+
* @param {string} appTag - The app tag.
|
|
2126
|
+
* @param {string} tag - The action tag.
|
|
2127
|
+
* @param {Partial<IActionUpdate>} data - The action data to update.
|
|
2128
|
+
* @returns {Promise<void>} Resolves when the action is updated. Throws on error.
|
|
1166
2129
|
*/
|
|
1167
|
-
|
|
1168
|
-
process_id: string;
|
|
1169
|
-
status: import("./types").LogEventStatus;
|
|
1170
|
-
data: Record<string, unknown>;
|
|
1171
|
-
errors?: undefined;
|
|
1172
|
-
} | {
|
|
1173
|
-
process_id: string;
|
|
1174
|
-
status: import("./types").LogEventStatus;
|
|
1175
|
-
errors: string[];
|
|
1176
|
-
data?: undefined;
|
|
1177
|
-
} | {
|
|
1178
|
-
process_id: string;
|
|
1179
|
-
status: import("./types").LogEventStatus;
|
|
1180
|
-
data?: undefined;
|
|
1181
|
-
errors?: undefined;
|
|
1182
|
-
}>;
|
|
2130
|
+
update: (appTag: string, tag: string, data: Partial<IActionUpdate>) => Promise<void>;
|
|
1183
2131
|
/**
|
|
1184
|
-
*
|
|
1185
|
-
* @param {string}
|
|
1186
|
-
* @
|
|
2132
|
+
* Creates an action.
|
|
2133
|
+
* @param {string} appTag - The app tag.
|
|
2134
|
+
* @param {Partial<IActionUpdate> & { tag: string; name: string; resource: string; method: string }} data - The action data.
|
|
2135
|
+
* @returns {Promise<void>} Resolves when the action is created. Throws on error.
|
|
1187
2136
|
*/
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
2137
|
+
create: (appTag: string, data: Partial<IActionUpdate> & {
|
|
2138
|
+
tag: string;
|
|
2139
|
+
name: string;
|
|
2140
|
+
resource: string;
|
|
2141
|
+
method: string;
|
|
2142
|
+
}) => Promise<void>;
|
|
1191
2143
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
* @param {string}
|
|
1194
|
-
* @returns {
|
|
2144
|
+
* Fetches all actions for an app.
|
|
2145
|
+
* @param {string} appTag - The app tag.
|
|
2146
|
+
* @returns {IAppAction[]} The list of actions.
|
|
1195
2147
|
*/
|
|
1196
|
-
|
|
1197
|
-
process_id: string;
|
|
1198
|
-
}>;
|
|
1199
|
-
};
|
|
1200
|
-
/**
|
|
1201
|
-
* Quota-related operations for running quota processors.
|
|
1202
|
-
*/
|
|
1203
|
-
quota: {
|
|
2148
|
+
list: (appTag: string) => Promise<IAppAction[]>;
|
|
1204
2149
|
/**
|
|
1205
|
-
*
|
|
1206
|
-
* @param {
|
|
1207
|
-
* @
|
|
2150
|
+
* Fetches an action by tag.
|
|
2151
|
+
* @param {string} appTag - The app tag.
|
|
2152
|
+
* @param {string} tag - The action tag.
|
|
2153
|
+
* @returns {IAppAction|null} The fetched action, or null if not found.
|
|
1208
2154
|
*/
|
|
1209
|
-
|
|
1210
|
-
};
|
|
1211
|
-
/**
|
|
1212
|
-
* Fallback-related operations for running fallback processors.
|
|
1213
|
-
*/
|
|
1214
|
-
fallback: {
|
|
2155
|
+
fetch: (appTag: string, tag: string) => Promise<IAppAction>;
|
|
1215
2156
|
/**
|
|
1216
|
-
* Runs
|
|
1217
|
-
* @param {
|
|
1218
|
-
* @returns {Promise<any>} The result of the
|
|
2157
|
+
* Runs an action processor immediately.
|
|
2158
|
+
* @param {IActionProcessorInput} data - The action processor input.
|
|
2159
|
+
* @returns {Promise<any>} The result of the action processing.
|
|
2160
|
+
* @example
|
|
2161
|
+
* await ductape.actions.run({
|
|
2162
|
+
* product: 'my-product',
|
|
2163
|
+
* env: 'production',
|
|
2164
|
+
* app: 'stripe',
|
|
2165
|
+
* action: 'charge',
|
|
2166
|
+
* input: { amount: 1000, currency: 'usd' }
|
|
2167
|
+
* });
|
|
1219
2168
|
*/
|
|
1220
|
-
run: (data:
|
|
1221
|
-
};
|
|
1222
|
-
/**
|
|
1223
|
-
* Notification-related operations for sending notifications.
|
|
1224
|
-
*/
|
|
1225
|
-
notification: {
|
|
2169
|
+
run: (data: IActionProcessorInput) => Promise<any>;
|
|
1226
2170
|
/**
|
|
1227
|
-
*
|
|
1228
|
-
* @param {
|
|
1229
|
-
* @returns {Promise<
|
|
2171
|
+
* Dispatches an action to run as a scheduled job.
|
|
2172
|
+
* @param {IActionDispatchInput} data - The action dispatch input with scheduling options.
|
|
2173
|
+
* @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
|
|
2174
|
+
* @example
|
|
2175
|
+
* // Run once at a specific time
|
|
2176
|
+
* await ductape.actions.dispatch({
|
|
2177
|
+
* product: 'my-product',
|
|
2178
|
+
* env: 'production',
|
|
2179
|
+
* app: 'stripe',
|
|
2180
|
+
* event: 'charge',
|
|
2181
|
+
* input: { amount: 1000 },
|
|
2182
|
+
* schedule: { start_at: Date.now() + 3600000 } // 1 hour from now
|
|
2183
|
+
* });
|
|
2184
|
+
*
|
|
2185
|
+
* // Run on a cron schedule
|
|
2186
|
+
* await ductape.actions.dispatch({
|
|
2187
|
+
* product: 'my-product',
|
|
2188
|
+
* env: 'production',
|
|
2189
|
+
* app: 'analytics',
|
|
2190
|
+
* event: 'daily-report',
|
|
2191
|
+
* input: {},
|
|
2192
|
+
* schedule: { cron: '0 9 * * *', tz: 'America/New_York' } // 9 AM daily
|
|
2193
|
+
* });
|
|
1230
2194
|
*/
|
|
1231
|
-
|
|
1232
|
-
process_id: string;
|
|
1233
|
-
}>;
|
|
1234
|
-
};
|
|
1235
|
-
/**
|
|
1236
|
-
* Storage-related operations for reading and saving files.
|
|
1237
|
-
*/
|
|
1238
|
-
storage: {
|
|
2195
|
+
dispatch: (data: IActionDispatchInput) => Promise<IDispatchResult>;
|
|
1239
2196
|
/**
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
* @
|
|
2197
|
+
* Set shared configuration (credentials) for a product/app/env combination.
|
|
2198
|
+
* Credentials are automatically merged into action inputs before resolution.
|
|
2199
|
+
* @param {IShareCredentialsConfig} config - The credential configuration.
|
|
2200
|
+
* @example
|
|
2201
|
+
* // Define app configuration and set credentials
|
|
2202
|
+
* const stripeConfig = { product: 'my-product', app: 'stripe', env: 'prd' };
|
|
2203
|
+
*
|
|
2204
|
+
* ductape.actions.config({
|
|
2205
|
+
* ...stripeConfig,
|
|
2206
|
+
* credentials: {
|
|
2207
|
+
* 'headers:Authorization': '$Secret{StripeApiKey}',
|
|
2208
|
+
* }
|
|
2209
|
+
* });
|
|
2210
|
+
*
|
|
2211
|
+
* // Now all stripe actions automatically include the Authorization header
|
|
2212
|
+
* await ductape.actions.run({
|
|
2213
|
+
* ...stripeConfig,
|
|
2214
|
+
* action: 'create-charge',
|
|
2215
|
+
* input: { amount: 1000, currency: 'usd' }
|
|
2216
|
+
* });
|
|
1243
2217
|
*/
|
|
1244
|
-
|
|
2218
|
+
config: (config: IShareCredentialsConfig) => void;
|
|
1245
2219
|
/**
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
* @
|
|
2220
|
+
* Set up OAuth configuration with automatic token refresh for a product/app/env combination.
|
|
2221
|
+
* Tokens are stored securely using $Secret{} and automatically refreshed when expired.
|
|
2222
|
+
* @param {IOAuthConfig} config - The OAuth configuration.
|
|
2223
|
+
* @example
|
|
2224
|
+
* // Set up OAuth with automatic refresh using ductape.actions.run
|
|
2225
|
+
* await ductape.actions.oauth({
|
|
2226
|
+
* product: 'my-product',
|
|
2227
|
+
* app: 'salesforce',
|
|
2228
|
+
* env: 'prd',
|
|
2229
|
+
* tokens: {
|
|
2230
|
+
* accessToken: initialAccessToken,
|
|
2231
|
+
* refreshToken: initialRefreshToken,
|
|
2232
|
+
* },
|
|
2233
|
+
* expiresAt: tokenExpiry,
|
|
2234
|
+
* credentials: (tokens) => ({
|
|
2235
|
+
* 'headers:Authorization': `Bearer ${tokens.accessToken}`
|
|
2236
|
+
* }),
|
|
2237
|
+
* onExpiry: async (currentTokens) => {
|
|
2238
|
+
* // Use ductape.actions.run to call your refresh token action
|
|
2239
|
+
* const response = await ductape.actions.run({
|
|
2240
|
+
* product: 'my-product',
|
|
2241
|
+
* app: 'salesforce',
|
|
2242
|
+
* env: 'prd',
|
|
2243
|
+
* action: 'refresh-token',
|
|
2244
|
+
* input: {
|
|
2245
|
+
* 'body:grant_type': 'refresh_token',
|
|
2246
|
+
* 'body:refresh_token': currentTokens.refreshToken,
|
|
2247
|
+
* }
|
|
2248
|
+
* });
|
|
2249
|
+
* return {
|
|
2250
|
+
* tokens: {
|
|
2251
|
+
* accessToken: response.access_token,
|
|
2252
|
+
* refreshToken: response.refresh_token || currentTokens.refreshToken
|
|
2253
|
+
* },
|
|
2254
|
+
* expiresIn: response.expires_in
|
|
2255
|
+
* };
|
|
2256
|
+
* }
|
|
2257
|
+
* });
|
|
2258
|
+
*
|
|
2259
|
+
* // Now all salesforce actions automatically include OAuth tokens
|
|
2260
|
+
* // and refresh automatically when expired
|
|
2261
|
+
* await ductape.actions.run({
|
|
2262
|
+
* product: 'my-product',
|
|
2263
|
+
* app: 'salesforce',
|
|
2264
|
+
* env: 'prd',
|
|
2265
|
+
* action: 'get-contacts',
|
|
2266
|
+
* input: { limit: 10 }
|
|
2267
|
+
* });
|
|
1249
2268
|
*/
|
|
1250
|
-
|
|
2269
|
+
oauth: (config: IOAuthConfig) => Promise<void>;
|
|
1251
2270
|
};
|
|
1252
2271
|
/**
|
|
1253
|
-
*
|
|
2272
|
+
* Auth-related operations for managing app auths.
|
|
1254
2273
|
*/
|
|
1255
|
-
|
|
2274
|
+
auths: {
|
|
1256
2275
|
/**
|
|
1257
|
-
*
|
|
1258
|
-
* @param {
|
|
1259
|
-
* @
|
|
2276
|
+
* Creates an auth for an app.
|
|
2277
|
+
* @param {string} appTag - The app tag.
|
|
2278
|
+
* @param {IAppAuth} data - The auth data.
|
|
2279
|
+
* @returns {Promise<void>} Resolves when the auth is created. Throws on error.
|
|
1260
2280
|
*/
|
|
1261
|
-
|
|
1262
|
-
process_id: string;
|
|
1263
|
-
}>;
|
|
2281
|
+
create: (appTag: string, data: IAppAuth) => Promise<void>;
|
|
1264
2282
|
/**
|
|
1265
|
-
*
|
|
1266
|
-
* @param {
|
|
1267
|
-
* @returns {
|
|
2283
|
+
* Fetches all auths for an app.
|
|
2284
|
+
* @param {string} appTag - The app tag.
|
|
2285
|
+
* @returns {IAppAuth[]} The list of auths.
|
|
1268
2286
|
*/
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
2287
|
+
list: (appTag: string) => Promise<IAppAuth[]>;
|
|
2288
|
+
/**
|
|
2289
|
+
* Fetches an auth by tag.
|
|
2290
|
+
* @param {string} appTag - The app tag.
|
|
2291
|
+
* @param {string} tag - The auth tag.
|
|
2292
|
+
* @returns {IAppAuth|null} The fetched auth, or null if not found.
|
|
2293
|
+
*/
|
|
2294
|
+
fetch: (appTag: string, tag: string) => Promise<IAppAuth>;
|
|
2295
|
+
/**
|
|
2296
|
+
* Updates an auth by tag.
|
|
2297
|
+
* @param {string} appTag - The app tag.
|
|
2298
|
+
* @param {string} tag - The auth tag.
|
|
2299
|
+
* @param {Partial<IAppAuth>} data - The auth data to update.
|
|
2300
|
+
* @returns {Promise<void>} Resolves when the auth is updated. Throws on error.
|
|
2301
|
+
*/
|
|
2302
|
+
update: (appTag: string, tag: string, data: Partial<IAppAuth>) => Promise<void>;
|
|
1272
2303
|
};
|
|
1273
2304
|
/**
|
|
1274
|
-
*
|
|
2305
|
+
* Webhook-related operations for managing app webhooks.
|
|
1275
2306
|
*/
|
|
1276
|
-
|
|
1277
|
-
|
|
2307
|
+
webhooks: {
|
|
2308
|
+
/**
|
|
2309
|
+
* Creates a webhook for an app.
|
|
2310
|
+
* @param {string} appTag - The app tag.
|
|
2311
|
+
* @param {Partial<IAppWebhook>} data - The webhook data.
|
|
2312
|
+
* @returns {Promise<void>} Resolves when the webhook is created. Throws on error.
|
|
2313
|
+
*/
|
|
2314
|
+
create: (appTag: string, data: Partial<IAppWebhook>) => Promise<void>;
|
|
2315
|
+
/**
|
|
2316
|
+
* Fetches all webhooks for an app.
|
|
2317
|
+
* @param {string} appTag - The app tag.
|
|
2318
|
+
* @returns {IAppWebhook[]} The list of webhooks.
|
|
2319
|
+
*/
|
|
2320
|
+
list: (appTag: string) => Promise<IAppWebhook[]>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Fetches a webhook by tag.
|
|
2323
|
+
* @param {string} appTag - The app tag.
|
|
2324
|
+
* @param {string} tag - The webhook tag.
|
|
2325
|
+
* @returns {IAppWebhook|null} The fetched webhook, or null if not found.
|
|
2326
|
+
*/
|
|
2327
|
+
fetch: (appTag: string, tag: string) => Promise<IAppWebhook>;
|
|
2328
|
+
/**
|
|
2329
|
+
* Updates a webhook by tag.
|
|
2330
|
+
* @param {string} appTag - The app tag.
|
|
2331
|
+
* @param {string} tag - The webhook tag.
|
|
2332
|
+
* @param {Partial<IAppWebhook>} data - The webhook data to update.
|
|
2333
|
+
* @returns {Promise<void>} Resolves when the webhook is updated. Throws on error.
|
|
2334
|
+
*/
|
|
2335
|
+
update: (appTag: string, tag: string, data: Partial<IAppWebhook>) => Promise<void>;
|
|
2336
|
+
events: {
|
|
1278
2337
|
/**
|
|
1279
|
-
*
|
|
1280
|
-
* @param {
|
|
1281
|
-
* @
|
|
2338
|
+
* Creates a webhook event for an app.
|
|
2339
|
+
* @param {string} appTag - The app tag.
|
|
2340
|
+
* @param {IAppWebhookEvent} data - The webhook event data.
|
|
2341
|
+
* @returns {Promise<void>} Resolves when the webhook event is created. Throws on error.
|
|
1282
2342
|
*/
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
* @returns {Promise<any>} The result of the rollback.
|
|
1307
|
-
*/
|
|
1308
|
-
rollback: ({ migration, env, product }: {
|
|
1309
|
-
migration: string;
|
|
1310
|
-
env: string;
|
|
1311
|
-
product: string;
|
|
1312
|
-
}) => Promise<{
|
|
1313
|
-
process_id: string;
|
|
1314
|
-
}>;
|
|
1315
|
-
};
|
|
2343
|
+
create: (appTag: string, data: IAppWebhookEvent) => Promise<void>;
|
|
2344
|
+
/**
|
|
2345
|
+
* Fetches all webhook events for a webhook by tag.
|
|
2346
|
+
* @param {string} appTag - The app tag.
|
|
2347
|
+
* @param {string} webhookTag - The webhook tag.
|
|
2348
|
+
* @returns {IAppWebhookEvent[]} The list of webhook events.
|
|
2349
|
+
*/
|
|
2350
|
+
list: (appTag: string, webhookTag: string) => Promise<IAppWebhookEvent[]>;
|
|
2351
|
+
/**
|
|
2352
|
+
* Fetches a webhook event by tag.
|
|
2353
|
+
* @param {string} appTag - The app tag.
|
|
2354
|
+
* @param {string} tag - The webhook event tag.
|
|
2355
|
+
* @returns {IAppWebhookEvent|null} The fetched webhook event, or null if not found.
|
|
2356
|
+
*/
|
|
2357
|
+
fetch: (appTag: string, tag: string) => Promise<IAppWebhookEvent>;
|
|
2358
|
+
/**
|
|
2359
|
+
* Updates a webhook event by tag.
|
|
2360
|
+
* @param {string} appTag - The app tag.
|
|
2361
|
+
* @param {string} tag - The webhook event tag.
|
|
2362
|
+
* @param {Partial<IAppWebhookEvent>} data - The webhook event data to update.
|
|
2363
|
+
* @returns {Promise<void>} Resolves when the webhook event is updated. Throws on error.
|
|
2364
|
+
*/
|
|
2365
|
+
update: (appTag: string, tag: string, data: Partial<IAppWebhookEvent>) => Promise<void>;
|
|
1316
2366
|
};
|
|
1317
2367
|
};
|
|
1318
|
-
/**
|
|
1319
|
-
* Database operations for querying, inserting, updating, and managing databases.
|
|
1320
|
-
* Provides unified interface for SQL and NoSQL databases.
|
|
1321
|
-
*/
|
|
1322
|
-
get database(): DatabaseService;
|
|
1323
|
-
/**
|
|
1324
|
-
* Graph database operations for Neo4j, AWS Neptune, ArangoDB, and Memgraph.
|
|
1325
|
-
* Provides unified interface for graph database CRUD, traversals, and path finding.
|
|
1326
|
-
*/
|
|
1327
|
-
get graph(): GraphService;
|
|
1328
2368
|
/**
|
|
1329
2369
|
* Logs-related operations for initializing and fetching logs.
|
|
1330
2370
|
*/
|
|
1331
2371
|
logs: {
|
|
1332
2372
|
/**
|
|
1333
2373
|
* Initializes the logger service for a product or app.
|
|
1334
|
-
* @param {string} [
|
|
1335
|
-
* @param {string} [
|
|
2374
|
+
* @param {string} [product] - The product tag (optional).
|
|
2375
|
+
* @param {string} [app] - The app tag (optional).
|
|
1336
2376
|
* @throws {Error} If neither productTag nor appTag is provided.
|
|
1337
2377
|
* @returns {Promise<void>} Resolves when logger is initialized.
|
|
1338
2378
|
*/
|
|
1339
|
-
init: (
|
|
2379
|
+
init: (product?: string, app?: string) => Promise<void>;
|
|
1340
2380
|
add: () => Promise<void>;
|
|
1341
2381
|
/**
|
|
1342
2382
|
* Fetches logs based on provided query parameters.
|
|
@@ -1346,87 +2386,78 @@ export default class Ductape implements IDuctape {
|
|
|
1346
2386
|
fetch: (params: LogQueryParams) => Promise<any>;
|
|
1347
2387
|
publish: () => Promise<void>;
|
|
1348
2388
|
};
|
|
1349
|
-
/**
|
|
1350
|
-
* Workspace secrets operations for securely storing encrypted key-value pairs.
|
|
1351
|
-
* Values are encrypted client-side using the workspace's private key.
|
|
1352
|
-
*/
|
|
1353
|
-
secrets: {
|
|
1354
|
-
/**
|
|
1355
|
-
* Cached workspace private key for encryption/decryption.
|
|
1356
|
-
* Fetched once and reused for the session.
|
|
1357
|
-
*/
|
|
1358
|
-
_privateKey: string | null;
|
|
1359
|
-
/**
|
|
1360
|
-
* Fetches and caches the workspace private key.
|
|
1361
|
-
* @returns {Promise<string>} The decrypted workspace private key.
|
|
1362
|
-
*/
|
|
1363
|
-
fetchPrivateKey: () => Promise<string>;
|
|
1364
|
-
/**
|
|
1365
|
-
* Creates a new workspace secret.
|
|
1366
|
-
* The value is encrypted client-side before being sent to the server.
|
|
1367
|
-
* @param {Object} data - The secret data.
|
|
1368
|
-
* @param {string} data.key - The unique key for the secret (alphanumeric + underscores).
|
|
1369
|
-
* @param {string} data.value - The plaintext value to encrypt and store.
|
|
1370
|
-
* @param {string} [data.description] - Optional description.
|
|
1371
|
-
* @param {string} [data.token_type] - Optional token type ('api' or 'access').
|
|
1372
|
-
* @param {string[]} [data.scope] - Optional array of scopes.
|
|
1373
|
-
* @param {string[]} [data.envs] - Optional array of environment slugs.
|
|
1374
|
-
* @param {number|null} [data.expires_at] - Optional expiry timestamp in seconds (Unix epoch).
|
|
1375
|
-
* @returns {Promise<IWorkspaceSecret>} The created secret (without encrypted value).
|
|
1376
|
-
*/
|
|
1377
|
-
create: (data: {
|
|
1378
|
-
key: string;
|
|
1379
|
-
value: string;
|
|
1380
|
-
description?: string;
|
|
1381
|
-
token_type?: string;
|
|
1382
|
-
scope?: string[];
|
|
1383
|
-
envs?: string[];
|
|
1384
|
-
expires_at?: number | null;
|
|
1385
|
-
}) => Promise<IWorkspaceSecret>;
|
|
1386
|
-
/**
|
|
1387
|
-
* Lists all workspace secrets.
|
|
1388
|
-
* Returns metadata only, not the encrypted values.
|
|
1389
|
-
* @returns {Promise<IWorkspaceSecret[]>} List of secrets.
|
|
1390
|
-
*/
|
|
1391
|
-
fetchAll: () => Promise<IWorkspaceSecret[]>;
|
|
1392
|
-
/**
|
|
1393
|
-
* Fetches a single secret by key and decrypts its value.
|
|
1394
|
-
* @param {string} key - The secret key.
|
|
1395
|
-
* @returns {Promise<IWorkspaceSecret & { value: string }>} The secret with decrypted value.
|
|
1396
|
-
*/
|
|
1397
|
-
fetch: (key: string) => Promise<IWorkspaceSecret & {
|
|
1398
|
-
value: string;
|
|
1399
|
-
}>;
|
|
1400
|
-
/**
|
|
1401
|
-
* Updates a workspace secret.
|
|
1402
|
-
* If a new value is provided, it will be encrypted client-side.
|
|
1403
|
-
* @param {string} key - The secret key to update.
|
|
1404
|
-
* @param {Object} data - The update data.
|
|
1405
|
-
* @param {string} [data.value] - New plaintext value to encrypt.
|
|
1406
|
-
* @param {string} [data.description] - New description.
|
|
1407
|
-
* @param {number|null} [data.expires_at] - New expiry timestamp.
|
|
1408
|
-
* @returns {Promise<IWorkspaceSecret>} The updated secret.
|
|
1409
|
-
*/
|
|
1410
|
-
update: (key: string, data: {
|
|
1411
|
-
value?: string;
|
|
1412
|
-
description?: string;
|
|
1413
|
-
expires_at?: number | null;
|
|
1414
|
-
}) => Promise<IWorkspaceSecret>;
|
|
1415
|
-
/**
|
|
1416
|
-
* Deletes a workspace secret.
|
|
1417
|
-
* @param {string} key - The secret key to delete.
|
|
1418
|
-
* @returns {Promise<boolean>} True if deleted successfully.
|
|
1419
|
-
*/
|
|
1420
|
-
delete: (key: string) => Promise<boolean>;
|
|
1421
|
-
};
|
|
1422
2389
|
private initUserAuth;
|
|
1423
2390
|
private createNewLogger;
|
|
1424
|
-
private createNewDatabaseService;
|
|
1425
|
-
private createNewGraphService;
|
|
1426
2391
|
private createNewProductBuilder;
|
|
1427
2392
|
private createNewProcessor;
|
|
1428
2393
|
private createNewImporter;
|
|
1429
2394
|
private createNewAppBuilder;
|
|
2395
|
+
/**
|
|
2396
|
+
* Create a new DatabaseService instance with authenticated config
|
|
2397
|
+
* @returns DatabaseService instance
|
|
2398
|
+
*/
|
|
2399
|
+
private createNewDatabaseService;
|
|
2400
|
+
/**
|
|
2401
|
+
* Create a new GraphService instance with authenticated config
|
|
2402
|
+
* @returns GraphService instance
|
|
2403
|
+
*/
|
|
2404
|
+
private createNewGraphService;
|
|
2405
|
+
/**
|
|
2406
|
+
* Create a new WorkflowService instance with authenticated config
|
|
2407
|
+
* @returns WorkflowService instance
|
|
2408
|
+
*/
|
|
2409
|
+
private createNewWorkflowService;
|
|
2410
|
+
/**
|
|
2411
|
+
* Create a new AgentsService instance with authenticated config
|
|
2412
|
+
* @returns AgentsService instance
|
|
2413
|
+
*/
|
|
2414
|
+
private createNewAgentsService;
|
|
2415
|
+
/**
|
|
2416
|
+
* Create a new ModelService instance with authenticated config
|
|
2417
|
+
* @returns ModelService instance
|
|
2418
|
+
*/
|
|
2419
|
+
private createNewModelService;
|
|
2420
|
+
/**
|
|
2421
|
+
* Create a new VectorDatabaseService instance with authenticated config
|
|
2422
|
+
* @returns VectorDatabaseService instance
|
|
2423
|
+
*/
|
|
2424
|
+
private createNewVectorService;
|
|
2425
|
+
/**
|
|
2426
|
+
* Create a new CacheService instance with authenticated config
|
|
2427
|
+
* @returns CacheService instance
|
|
2428
|
+
*/
|
|
2429
|
+
private createNewCacheService;
|
|
2430
|
+
/**
|
|
2431
|
+
* Create a new JobsService instance with authenticated config
|
|
2432
|
+
* @returns JobsService instance
|
|
2433
|
+
*/
|
|
2434
|
+
private createNewJobsService;
|
|
2435
|
+
private createNewSecretsService;
|
|
2436
|
+
/**
|
|
2437
|
+
* Create a new SessionsService instance with authenticated config
|
|
2438
|
+
* @returns SessionsService instance
|
|
2439
|
+
*/
|
|
2440
|
+
private createNewSessionsService;
|
|
2441
|
+
/**
|
|
2442
|
+
* Create a new StorageService instance with authenticated config
|
|
2443
|
+
* @returns StorageService instance
|
|
2444
|
+
*/
|
|
2445
|
+
private createNewStorageService;
|
|
2446
|
+
/**
|
|
2447
|
+
* Create a new BrokersService instance with authenticated config
|
|
2448
|
+
* @returns BrokersService instance
|
|
2449
|
+
*/
|
|
2450
|
+
private createNewBrokersService;
|
|
2451
|
+
/**
|
|
2452
|
+
* Create a new QuotaService instance with authenticated config
|
|
2453
|
+
* @returns QuotaService instance
|
|
2454
|
+
*/
|
|
2455
|
+
private createNewQuotaService;
|
|
2456
|
+
/**
|
|
2457
|
+
* Create a new FallbackService instance with authenticated config
|
|
2458
|
+
* @returns FallbackService instance
|
|
2459
|
+
*/
|
|
2460
|
+
private createNewFallbackService;
|
|
1430
2461
|
private fetchSession;
|
|
1431
2462
|
private validateWorkspace;
|
|
1432
2463
|
private createNewAppBuilderSession;
|
|
@@ -1436,6 +2467,5 @@ export default class Ductape implements IDuctape {
|
|
|
1436
2467
|
/**
|
|
1437
2468
|
* Fetches the latest healthcheck status for a product/env from Redis cache via processor service.
|
|
1438
2469
|
*/
|
|
1439
|
-
getHealthcheckStatus(
|
|
2470
|
+
getHealthcheckStatus(product: string, envSlug: string): Promise<any>;
|
|
1440
2471
|
}
|
|
1441
|
-
export type { IWorkspaceSecret } from './api/services/workspaceSecretsApi.service';
|