@ductape/sdk 0.0.4-v5 → 0.0.4-v51
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/api/services/appApi.service.d.ts +48 -2
- package/dist/api/services/appApi.service.js +101 -2
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/pricingApi.service.d.ts +10 -0
- package/dist/api/services/pricingApi.service.js +34 -0
- package/dist/api/services/pricingApi.service.js.map +1 -0
- package/dist/api/services/processorApi.service.d.ts +12 -2
- package/dist/api/services/processorApi.service.js +12 -2
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +40 -1
- package/dist/api/services/productsApi.service.js +105 -1
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/userApi.service.js +1 -0
- package/dist/api/services/userApi.service.js.map +1 -1
- package/dist/api/services/workspaceApi.service.js +1 -0
- package/dist/api/services/workspaceApi.service.js.map +1 -1
- package/dist/api/services/workspaceSecretsApi.service.d.ts +75 -0
- package/dist/api/services/workspaceSecretsApi.service.js +62 -0
- package/dist/api/services/workspaceSecretsApi.service.js.map +1 -0
- package/dist/api/urls.d.ts +6 -1
- package/dist/api/urls.js +12 -2
- package/dist/api/urls.js.map +1 -1
- package/dist/api/utils/cache.utils.d.ts +1 -1
- package/dist/api/utils/cache.utils.js +10 -4
- package/dist/api/utils/cache.utils.js.map +1 -1
- package/dist/api/utils/strings.utils.d.ts +2 -0
- package/dist/api/utils/strings.utils.js +14 -0
- package/dist/api/utils/strings.utils.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +51 -33
- package/dist/apps/services/app.service.js +488 -244
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +21 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +34 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
- package/dist/clients/pricing.client.d.ts +3 -0
- package/dist/clients/pricing.client.js +33 -0
- package/dist/clients/pricing.client.js.map +1 -0
- package/dist/database/adapters/base.adapter.d.ts +176 -0
- package/dist/database/adapters/base.adapter.js +31 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +91 -0
- package/dist/database/adapters/dynamodb.adapter.js +1608 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +71 -0
- package/dist/database/adapters/mongodb.adapter.js +1072 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +146 -0
- package/dist/database/adapters/mysql.adapter.js +1492 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +147 -0
- package/dist/database/adapters/postgresql.adapter.js +1603 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/database.service.d.ts +232 -0
- package/dist/database/database.service.js +802 -0
- package/dist/database/database.service.js.map +1 -0
- package/dist/database/index.d.ts +18 -0
- package/dist/database/index.js +98 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/types/aggregation.types.d.ts +261 -0
- package/dist/database/types/aggregation.types.js +21 -0
- package/dist/database/types/aggregation.types.js.map +1 -0
- package/dist/database/types/connection.types.d.ts +132 -0
- package/dist/database/types/connection.types.js +6 -0
- package/dist/database/types/connection.types.js.map +1 -0
- package/dist/database/types/database.types.d.ts +175 -0
- package/dist/database/types/database.types.js +75 -0
- package/dist/database/types/database.types.js.map +1 -0
- package/dist/database/types/index.d.ts +12 -0
- package/dist/database/types/index.js +37 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/index.types.d.ts +220 -0
- package/dist/database/types/index.types.js +27 -0
- package/dist/database/types/index.types.js.map +1 -0
- package/dist/database/types/migration.types.d.ts +205 -0
- package/dist/database/types/migration.types.js +44 -0
- package/dist/database/types/migration.types.js.map +1 -0
- package/dist/database/types/query.types.d.ts +305 -0
- package/dist/database/types/query.types.js +57 -0
- package/dist/database/types/query.types.js.map +1 -0
- package/dist/database/types/result.types.d.ts +220 -0
- package/dist/database/types/result.types.js +6 -0
- package/dist/database/types/result.types.js.map +1 -0
- package/dist/database/types/schema.types.d.ts +190 -0
- package/dist/database/types/schema.types.js +69 -0
- package/dist/database/types/schema.types.js.map +1 -0
- package/dist/database/utils/helpers.d.ts +66 -0
- package/dist/database/utils/helpers.js +501 -0
- package/dist/database/utils/helpers.js.map +1 -0
- package/dist/database/utils/migration.utils.d.ts +151 -0
- package/dist/database/utils/migration.utils.js +476 -0
- package/dist/database/utils/migration.utils.js.map +1 -0
- package/dist/database/utils/transaction.d.ts +64 -0
- package/dist/database/utils/transaction.js +130 -0
- package/dist/database/utils/transaction.js.map +1 -0
- package/dist/database/validators/connection.validator.d.ts +20 -0
- package/dist/database/validators/connection.validator.js +267 -0
- package/dist/database/validators/connection.validator.js.map +1 -0
- package/dist/database/validators/query.validator.d.ts +31 -0
- package/dist/database/validators/query.validator.js +305 -0
- package/dist/database/validators/query.validator.js.map +1 -0
- package/dist/database/validators/schema.validator.d.ts +31 -0
- package/dist/database/validators/schema.validator.js +334 -0
- package/dist/database/validators/schema.validator.js.map +1 -0
- package/dist/graph/adapters/arangodb.adapter.d.ts +80 -0
- package/dist/graph/adapters/arangodb.adapter.js +1393 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +228 -0
- package/dist/graph/adapters/base.adapter.js +38 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +10 -0
- package/dist/graph/adapters/index.js +23 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +85 -0
- package/dist/graph/adapters/memgraph.adapter.js +1491 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +88 -0
- package/dist/graph/adapters/neo4j.adapter.js +1861 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +87 -0
- package/dist/graph/adapters/neptune.adapter.js +1430 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graph.service.d.ts +278 -0
- package/dist/graph/graph.service.js +687 -0
- package/dist/graph/graph.service.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.js +42 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/types/connection.types.d.ts +158 -0
- package/dist/graph/types/connection.types.js +43 -0
- package/dist/graph/types/connection.types.js.map +1 -0
- package/dist/graph/types/graph.types.d.ts +144 -0
- package/dist/graph/types/graph.types.js +84 -0
- package/dist/graph/types/graph.types.js.map +1 -0
- package/dist/graph/types/index.d.ts +11 -0
- package/dist/graph/types/index.js +35 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.types.d.ts +193 -0
- package/dist/graph/types/node.types.js +49 -0
- package/dist/graph/types/node.types.js.map +1 -0
- package/dist/graph/types/path.types.d.ts +224 -0
- package/dist/graph/types/path.types.js +38 -0
- package/dist/graph/types/path.types.js.map +1 -0
- package/dist/graph/types/query.types.d.ts +247 -0
- package/dist/graph/types/query.types.js +23 -0
- package/dist/graph/types/query.types.js.map +1 -0
- package/dist/graph/types/relationship.types.d.ts +224 -0
- package/dist/graph/types/relationship.types.js +35 -0
- package/dist/graph/types/relationship.types.js.map +1 -0
- package/dist/graph/types/result.types.d.ts +237 -0
- package/dist/graph/types/result.types.js +7 -0
- package/dist/graph/types/result.types.js.map +1 -0
- package/dist/graph/validators/index.d.ts +81 -0
- package/dist/graph/validators/index.js +243 -0
- package/dist/graph/validators/index.js.map +1 -0
- package/dist/imports/imports.service.d.ts +3 -3
- package/dist/imports/imports.service.js +7 -7
- package/dist/imports/imports.service.js.map +1 -1
- package/dist/imports/imports.types.d.ts +8 -0
- package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
- package/dist/imports/repos/postmanV21.repo.js +29 -2
- package/dist/imports/repos/postmanV21.repo.js.map +1 -1
- package/dist/index.d.ts +1244 -150
- package/dist/index.js +1309 -209
- package/dist/index.js.map +1 -1
- package/dist/inputs/inputs.service.js +2 -2
- package/dist/inputs/inputs.service.js.map +1 -1
- package/dist/inputs/utils/inputs.utils.create.js +1 -1
- package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
- package/dist/logs/logs.types.d.ts +5 -0
- package/dist/logs/logs.types.js +1 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +27 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
- package/dist/parsers/pipelines/postman.pipelines.js +103 -0
- package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
- package/dist/parsers/types/postman.types.d.ts +200 -0
- package/dist/parsers/types/postman.types.js +3 -0
- package/dist/parsers/types/postman.types.js.map +1 -0
- package/dist/parsers/utils/postman.utils.d.ts +12 -0
- package/dist/parsers/utils/postman.utils.js +116 -0
- package/dist/parsers/utils/postman.utils.js.map +1 -0
- package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
- package/dist/parsers/validators/postman-auth.validators.js +127 -0
- package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
- package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-request.validators.js +139 -0
- package/dist/parsers/validators/postman-request.validators.js.map +1 -0
- package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-response.validators.js +150 -0
- package/dist/parsers/validators/postman-response.validators.js.map +1 -0
- package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
- package/dist/parsers/validators/postman-variable.validators.js +163 -0
- package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +1 -0
- package/dist/pricing/pricing.repo.js.map +1 -0
- package/dist/pricing/pricing.service.d.ts +24 -0
- package/dist/pricing/pricing.service.js +51 -0
- package/dist/pricing/pricing.service.js.map +1 -0
- package/dist/pricing/pricing.types.d.ts +76 -0
- package/dist/pricing/pricing.types.js +21 -0
- package/dist/pricing/pricing.types.js.map +1 -0
- package/dist/pricing/utils/string.utils.d.ts +1 -0
- package/dist/pricing/utils/string.utils.js +9 -0
- package/dist/pricing/utils/string.utils.js.map +1 -0
- package/dist/processor/repos/sms.repo.d.ts +4 -4
- package/dist/processor/repos/sms.repo.js +23 -10
- package/dist/processor/repos/sms.repo.js.map +1 -1
- package/dist/processor/services/messagebrokers/kafka.service.js +0 -2
- package/dist/processor/services/messagebrokers/kafka.service.js.map +1 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +9 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.js +40 -11
- package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +38 -10
- package/dist/processor/services/processor.service.js +533 -248
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/services/request.service.d.ts +36 -0
- package/dist/processor/services/request.service.js +304 -0
- package/dist/processor/services/request.service.js.map +1 -0
- package/dist/processor/types/request.types.d.ts +14 -0
- package/dist/processor/types/request.types.js +3 -0
- package/dist/processor/types/request.types.js.map +1 -0
- package/dist/processor/utils/processor.utils.d.ts +3 -0
- package/dist/processor/utils/processor.utils.js +84 -22
- package/dist/processor/utils/processor.utils.js.map +1 -1
- package/dist/processor/utils/request.utils.d.ts +20 -0
- package/dist/processor/utils/request.utils.js +113 -0
- package/dist/processor/utils/request.utils.js.map +1 -0
- package/dist/products/services/products.service.d.ts +114 -77
- package/dist/products/services/products.service.js +805 -362
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/services/utils/crypt.utils.d.ts +1 -0
- package/dist/products/services/utils/crypt.utils.js +17 -0
- package/dist/products/services/utils/crypt.utils.js.map +1 -0
- package/dist/products/services/utils/functions.utils.d.ts +13 -0
- package/dist/products/services/utils/functions.utils.js +289 -0
- package/dist/products/services/utils/functions.utils.js.map +1 -0
- package/dist/products/services/utils/objects.utils.d.ts +13 -0
- package/dist/products/services/utils/objects.utils.js +89 -0
- package/dist/products/services/utils/objects.utils.js.map +1 -0
- package/dist/products/services/utils/string.utils.d.ts +12 -0
- package/dist/products/services/utils/string.utils.js +168 -0
- package/dist/products/services/utils/string.utils.js.map +1 -0
- package/dist/products/utils/string.utils.d.ts +1 -1
- package/dist/products/utils/string.utils.js +14 -2
- package/dist/products/utils/string.utils.js.map +1 -1
- package/dist/products/validators/index.d.ts +4 -1
- package/dist/products/validators/index.js +7 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +15 -4
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +501 -109
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +82 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +14 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +696 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +9 -4
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +5 -2
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +6 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +28 -26
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +87 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +7 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +72 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -1
- package/dist/test/test.health.d.ts +1 -0
- package/dist/test/test.health.js +49 -0
- package/dist/test/test.health.js.map +1 -0
- package/dist/test/test.import.js +51 -4
- package/dist/test/test.import.js.map +1 -1
- package/dist/test/test.imports.js +22 -7
- package/dist/test/test.imports.js.map +1 -1
- package/dist/test/test.notifiers.d.ts +1 -0
- package/dist/test/test.notifiers.js +85 -0
- package/dist/test/test.notifiers.js.map +1 -0
- package/dist/test/test.processor.js +30 -115
- package/dist/test/test.processor.js.map +1 -1
- package/dist/test/test.products.d.ts +1 -0
- package/dist/test/test.products.js +49 -0
- package/dist/test/test.products.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/appBuilder.types.d.ts +5 -12
- package/dist/types/enums.d.ts +4 -1
- package/dist/types/enums.js +3 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.types.d.ts +4 -0
- package/dist/types/pricing.types.d.ts +4 -0
- package/dist/types/pricing.types.js +3 -0
- package/dist/types/pricing.types.js.map +1 -0
- package/dist/types/processor.types.d.ts +67 -11
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +132 -14
- package/dist/types/productsBuilder.types.js +69 -4
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +1 -0
- package/dist/types/request-tracker.interface.js.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/constants.js.map +1 -0
- package/package.json +17 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,240 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabaseService } from './database/database.service';
|
|
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';
|
|
2
4
|
import { IDuctapeInit } from './types/index.types';
|
|
3
5
|
import { PublicStates } from './types/enums';
|
|
6
|
+
import { IWorkspaceSecret } from './api/services/workspaceSecretsApi.service';
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {Object} IProduct
|
|
9
|
+
* @property {string} tag - Unique product tag.
|
|
10
|
+
* @property {string} name - Product name.
|
|
11
|
+
* @property {string} [description] - Optional product description.
|
|
12
|
+
* @property {Array<IProductApp>} [apps] - Associated apps.
|
|
13
|
+
* @property {Array<IProductSession>} [sessions] - Product sessions.
|
|
14
|
+
* @property {Array<IProductFeature>} [features] - Product features.
|
|
15
|
+
* @property {Array<IProductQuota>} [quotas] - Product quotas.
|
|
16
|
+
* @property {Array<IProductFallback>} [fallbacks] - Product fallbacks.
|
|
17
|
+
* @property {Array<IProductEnv>} [environments] - Product environments.
|
|
18
|
+
* @property {Array<IProductStorage>} [storages] - Product storages.
|
|
19
|
+
* @property {Array<IProductMessageBroker>} [messageBrokers] - Product message brokers.
|
|
20
|
+
* @property {Array<IProductNotification>} [notifications] - Product notifications.
|
|
21
|
+
* @property {Array<IProductDatabase>} [databases] - Product databases.
|
|
22
|
+
* @property {Array<IProductJobs>} [jobs] - Product jobs.
|
|
23
|
+
* @property {Array<IProductCache>} [caches] - Product caches.
|
|
24
|
+
* @property {Array<IProductFunction>} [functions] - Product functions.
|
|
25
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} IApp
|
|
29
|
+
* @property {string} tag - Unique app tag.
|
|
30
|
+
* @property {string} name - App name.
|
|
31
|
+
* @property {string} [description] - Optional app description.
|
|
32
|
+
* @property {Array<IAppVariables>} [variables] - App variables.
|
|
33
|
+
* @property {Array<IAppConstants>} [constants] - App constants.
|
|
34
|
+
* @property {Array<IAppWebhook>} [webhooks] - App webhooks.
|
|
35
|
+
* @property {Array<IAppEnv>} [environments] - App environments.
|
|
36
|
+
* @property {Array<IAppAction>} [actions] - App actions.
|
|
37
|
+
* @property {Array<IAppAuth>} [auths] - App authentication configs.
|
|
38
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @typedef {Object} IProductSession
|
|
42
|
+
* @property {string} tag - Session tag.
|
|
43
|
+
* @property {string} token - Session token.
|
|
44
|
+
* @property {string} [user_id] - Associated user ID.
|
|
45
|
+
* @property {string} [product_tag] - Associated product tag.
|
|
46
|
+
* @property {Record<string, unknown>} [data] - Session data.
|
|
47
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {Object} IProductApp
|
|
51
|
+
* @property {string} tag - App tag.
|
|
52
|
+
* @property {string} name - App name.
|
|
53
|
+
* @property {string} [description] - App description.
|
|
54
|
+
* @property {Array<IAppEnv>} [environments] - App environments.
|
|
55
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {Object} IProductFeature
|
|
59
|
+
* @property {string} tag - Feature tag.
|
|
60
|
+
* @property {string} name - Feature name.
|
|
61
|
+
* @property {string} [description] - Feature description.
|
|
62
|
+
* @property {Array<any>} [actions] - Feature actions.
|
|
63
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {Object} IProductQuota
|
|
67
|
+
* @property {string} tag - Quota tag.
|
|
68
|
+
* @property {string} name - Quota name.
|
|
69
|
+
* @property {number} [limit] - Quota limit.
|
|
70
|
+
* @property {string} [period] - Quota period.
|
|
71
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* @typedef {Object} IProductFallback
|
|
75
|
+
* @property {string} tag - Fallback tag.
|
|
76
|
+
* @property {string} name - Fallback name.
|
|
77
|
+
* @property {string} [description] - Fallback description.
|
|
78
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* @typedef {Object} IProductEnv
|
|
82
|
+
* @property {string} slug - Environment slug.
|
|
83
|
+
* @property {string} [name] - Environment name.
|
|
84
|
+
* @property {string} [description] - Environment description.
|
|
85
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* @typedef {Object} IProductStorage
|
|
89
|
+
* @property {string} tag - Storage tag.
|
|
90
|
+
* @property {string} name - Storage name.
|
|
91
|
+
* @property {string} [description] - Storage description.
|
|
92
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* @typedef {Object} IProductMessageBroker
|
|
96
|
+
* @property {string} tag - Message broker tag.
|
|
97
|
+
* @property {string} name - Message broker name.
|
|
98
|
+
* @property {string} [description] - Message broker description.
|
|
99
|
+
* @property {Array<IProductMessageBrokerTopic>} [topics] - Message broker topics.
|
|
100
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* @typedef {Object} IProductNotification
|
|
104
|
+
* @property {string} tag - Notification tag.
|
|
105
|
+
* @property {string} name - Notification name.
|
|
106
|
+
* @property {string} [description] - Notification description.
|
|
107
|
+
* @property {Array<IProductNotificationTemplate>} [messages] - Notification messages.
|
|
108
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @typedef {Object} IProductDatabase
|
|
112
|
+
* @property {string} tag - Database tag.
|
|
113
|
+
* @property {string} name - Database name.
|
|
114
|
+
* @property {string} [description] - Database description.
|
|
115
|
+
* @property {Array<IProductDatabaseAction>} [actions] - Database actions.
|
|
116
|
+
* @property {Array<IProductDatabaseMigration>} [migrations] - Database migrations.
|
|
117
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
118
|
+
*/
|
|
119
|
+
/**
|
|
120
|
+
* @typedef {Object} IProductJobs
|
|
121
|
+
* @property {string} tag - Job tag.
|
|
122
|
+
* @property {string} name - Job name.
|
|
123
|
+
* @property {string} [description] - Job description.
|
|
124
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
125
|
+
*/
|
|
126
|
+
/**
|
|
127
|
+
* @typedef {Object} IProductCache
|
|
128
|
+
* @property {string} tag - Cache tag.
|
|
129
|
+
* @property {string} name - Cache name.
|
|
130
|
+
* @property {string} [description] - Cache description.
|
|
131
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* @typedef {Object} IProductFunction
|
|
135
|
+
* @property {string} tag - Function tag.
|
|
136
|
+
* @property {string} name - Function name.
|
|
137
|
+
* @property {string} [description] - Function description.
|
|
138
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* @typedef {Object} IAppVariables
|
|
142
|
+
* @property {string} tag - Variable tag.
|
|
143
|
+
* @property {string} name - Variable name.
|
|
144
|
+
* @property {string} [description] - Variable description.
|
|
145
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* @typedef {Object} IAppConstants
|
|
149
|
+
* @property {string} tag - Constant tag.
|
|
150
|
+
* @property {string} name - Constant name.
|
|
151
|
+
* @property {string} [description] - Constant description.
|
|
152
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
* @typedef {Object} IAppWebhook
|
|
156
|
+
* @property {string} tag - Webhook tag.
|
|
157
|
+
* @property {string} url - Webhook URL.
|
|
158
|
+
* @property {string} [description] - Webhook description.
|
|
159
|
+
* @property {Array<IAppWebhookEvent>} [events] - Webhook events.
|
|
160
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* @typedef {Object} IAppWebhookEvent
|
|
164
|
+
* @property {string} tag - Webhook event tag.
|
|
165
|
+
* @property {string} name - Webhook event name.
|
|
166
|
+
* @property {string} [description] - Webhook event description.
|
|
167
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
168
|
+
*/
|
|
169
|
+
/**
|
|
170
|
+
* @typedef {Object} IAppEnv
|
|
171
|
+
* @property {string} slug - Environment slug.
|
|
172
|
+
* @property {string} [name] - Environment name.
|
|
173
|
+
* @property {string} [description] - Environment description.
|
|
174
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
175
|
+
*/
|
|
176
|
+
/**
|
|
177
|
+
* @typedef {Object} IAppAction
|
|
178
|
+
* @property {string} tag - Action tag.
|
|
179
|
+
* @property {string} name - Action name.
|
|
180
|
+
* @property {string} [description] - Action description.
|
|
181
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* @typedef {Object} IAppAuth
|
|
185
|
+
* @property {string} tag - Auth tag.
|
|
186
|
+
* @property {string} name - Auth name.
|
|
187
|
+
* @property {string} [description] - Auth description.
|
|
188
|
+
* @see ts/src/types/appBuilder.types.ts
|
|
189
|
+
*/
|
|
190
|
+
/**
|
|
191
|
+
* @typedef {Object} IProductAppHealth
|
|
192
|
+
* @property {string} name - Health check name.
|
|
193
|
+
* @property {string} description - Health check description.
|
|
194
|
+
* @property {string} tag - Health check tag.
|
|
195
|
+
* @property {string} app - App access tag.
|
|
196
|
+
* @property {string} action - Action to execute for health check.
|
|
197
|
+
* @property {number} checkIntervals - Interval between health checks in milliseconds.
|
|
198
|
+
* @property {number} retries - Number of retry attempts.
|
|
199
|
+
* @property {Array<CheckEnvStatus>} envs - Environment-specific health check configurations.
|
|
200
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
201
|
+
*/
|
|
202
|
+
/**
|
|
203
|
+
* @typedef {Object} CheckEnvStatus
|
|
204
|
+
* @property {string} slug - Environment slug.
|
|
205
|
+
* @property {string} [status] - Current health status.
|
|
206
|
+
* @property {string} [lastAvailable] - Last available timestamp.
|
|
207
|
+
* @property {string} [lastChecked] - Last check timestamp.
|
|
208
|
+
* @property {string} [lastLatency] - Last response latency.
|
|
209
|
+
* @property {string} [averageLatency] - Average response latency.
|
|
210
|
+
* @property {any} input - Health check input data.
|
|
211
|
+
* @see ts/src/types/productsBuilder.types.ts
|
|
212
|
+
*/
|
|
213
|
+
export interface IDuctapeSecrets {
|
|
214
|
+
_privateKey: string | null;
|
|
215
|
+
fetchPrivateKey(): Promise<string>;
|
|
216
|
+
create(data: {
|
|
217
|
+
key: string;
|
|
218
|
+
value: string;
|
|
219
|
+
description?: string;
|
|
220
|
+
token_type?: string;
|
|
221
|
+
scope?: string[];
|
|
222
|
+
envs?: string[];
|
|
223
|
+
expires_at?: number | null;
|
|
224
|
+
}): Promise<IWorkspaceSecret>;
|
|
225
|
+
fetchAll(): Promise<IWorkspaceSecret[]>;
|
|
226
|
+
fetch(key: string): Promise<IWorkspaceSecret & {
|
|
227
|
+
value: string;
|
|
228
|
+
}>;
|
|
229
|
+
update(key: string, data: {
|
|
230
|
+
value?: string;
|
|
231
|
+
description?: string;
|
|
232
|
+
expires_at?: number | null;
|
|
233
|
+
}): Promise<IWorkspaceSecret>;
|
|
234
|
+
delete(key: string): Promise<boolean>;
|
|
235
|
+
}
|
|
4
236
|
export interface IDuctape {
|
|
237
|
+
secrets: IDuctapeSecrets;
|
|
5
238
|
}
|
|
6
239
|
export default class Ductape implements IDuctape {
|
|
7
240
|
private user_id;
|
|
@@ -16,202 +249,1047 @@ export default class Ductape implements IDuctape {
|
|
|
16
249
|
private appApi;
|
|
17
250
|
private productsApi;
|
|
18
251
|
private workspaceApi;
|
|
252
|
+
private secretsApi;
|
|
19
253
|
private productBuilder;
|
|
20
254
|
private loggerService;
|
|
21
255
|
private appBuilder;
|
|
22
256
|
private importService;
|
|
257
|
+
private databaseService;
|
|
258
|
+
private graphService;
|
|
23
259
|
private productInit;
|
|
24
260
|
private appInit;
|
|
25
261
|
private environment;
|
|
26
262
|
private redis_url;
|
|
27
263
|
private redisClient?;
|
|
264
|
+
private jobsQueue;
|
|
265
|
+
private healthCheckQueue;
|
|
266
|
+
private healthCheckUpdaterQueue;
|
|
267
|
+
jobsWorker: any;
|
|
268
|
+
healthCheckWorker: any;
|
|
269
|
+
healthCheckUpdaterWorker: any;
|
|
28
270
|
private loadRedis;
|
|
29
271
|
constructor({ workspace_id, private_key, user_id, env_type, redis_url }: IDuctapeInit);
|
|
30
|
-
|
|
272
|
+
private loadBullMQ;
|
|
273
|
+
/**
|
|
274
|
+
* Connects to Redis and initializes job and health check queues and workers.
|
|
275
|
+
* @throws {Error} If called in a browser environment or if Redis URL is missing.
|
|
276
|
+
* @returns {Promise<void>} Resolves when Redis and queues are initialized.
|
|
277
|
+
*/
|
|
278
|
+
monitor(): Promise<void>;
|
|
279
|
+
/**
|
|
280
|
+
* Schedules all healthcheck jobs for all products and environments.
|
|
281
|
+
*/
|
|
282
|
+
private scheduleAllHealthcheckJobs;
|
|
283
|
+
/**
|
|
284
|
+
* Schedules a single healthcheck job with the given interval (ms).
|
|
285
|
+
* If interval is not provided, defaults to 60s.
|
|
286
|
+
*/
|
|
287
|
+
private scheduleHealthcheckJob;
|
|
288
|
+
/**
|
|
289
|
+
* Sets the authentication token for API requests.
|
|
290
|
+
* @param {string} token - The authentication token.
|
|
291
|
+
*/
|
|
31
292
|
setToken(token: string): void;
|
|
293
|
+
/**
|
|
294
|
+
* Sets the public key for API requests.
|
|
295
|
+
* @param {string} public_key - The public key.
|
|
296
|
+
*/
|
|
32
297
|
setPublicKey(public_key: string): void;
|
|
33
298
|
private initProduct;
|
|
34
299
|
private initApp;
|
|
35
300
|
private checkProductInit;
|
|
36
301
|
private checkAppInit;
|
|
302
|
+
/**
|
|
303
|
+
* Product-related operations for managing products, sessions, apps, quotas, and fallbacks.
|
|
304
|
+
*/
|
|
37
305
|
product: {
|
|
306
|
+
/**
|
|
307
|
+
* Creates a new product.
|
|
308
|
+
* @param {IProduct} data - The product data.
|
|
309
|
+
* @returns {Promise<void>} Resolves when the product is created. Throws on error.
|
|
310
|
+
*/
|
|
38
311
|
create: (data: IProduct) => Promise<void>;
|
|
312
|
+
/**
|
|
313
|
+
* Fetches a product by tag.
|
|
314
|
+
* @param {string} tag - The product tag.
|
|
315
|
+
* @returns {Promise<IProduct|null>} The fetched product, or null if not found.
|
|
316
|
+
*/
|
|
39
317
|
fetch: (tag: string) => Promise<IProduct>;
|
|
318
|
+
/**
|
|
319
|
+
* Updates a product by tag.
|
|
320
|
+
* @param {string} tag - The product tag.
|
|
321
|
+
* @param {Partial<IProduct>} data - The product data to update.
|
|
322
|
+
* @returns {Promise<void>} Resolves when the product is updated. Throws on error.
|
|
323
|
+
*/
|
|
40
324
|
update: (tag: string, data: Partial<IProduct>) => Promise<void>;
|
|
325
|
+
/**
|
|
326
|
+
* Initializes a product by tag.
|
|
327
|
+
* @param {string} productTag - The product tag.
|
|
328
|
+
* @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
|
|
329
|
+
*/
|
|
41
330
|
init: (productTag: string) => Promise<void>;
|
|
42
331
|
sessions: {
|
|
332
|
+
/**
|
|
333
|
+
* Creates a new product session.
|
|
334
|
+
* @param {IProductSession} payload - The session payload.
|
|
335
|
+
* @returns {Promise<void>} Resolves when the session is created. Throws on error.
|
|
336
|
+
*/
|
|
43
337
|
create: (payload: IProductSession) => Promise<void>;
|
|
338
|
+
/**
|
|
339
|
+
* Updates a product session by tag.
|
|
340
|
+
* @param {string} tag - The session tag.
|
|
341
|
+
* @param {Partial<IProductSession>} payload - The session data to update.
|
|
342
|
+
* @returns {Promise<void>} Resolves when the session is updated. Throws on error.
|
|
343
|
+
*/
|
|
44
344
|
update: (tag: string, payload: Partial<IProductSession>) => Promise<void>;
|
|
45
|
-
|
|
46
|
-
|
|
345
|
+
/**
|
|
346
|
+
* Fetches all product sessions.
|
|
347
|
+
* @returns {IProductSession[]} The list of sessions.
|
|
348
|
+
*/
|
|
349
|
+
fetchAll: () => Promise<IProductSession[]>;
|
|
350
|
+
/**
|
|
351
|
+
* Fetches a product session by tag.
|
|
352
|
+
* @param {string} tag - The session tag.
|
|
353
|
+
* @returns {IProductSession|null} The fetched session, or null if not found.
|
|
354
|
+
*/
|
|
355
|
+
fetch: (tag: string) => Promise<IProductSession>;
|
|
356
|
+
/**
|
|
357
|
+
* Fetches users for a session.
|
|
358
|
+
* @param {IFetchUsersPayload} data - The user fetch payload.
|
|
359
|
+
* @returns {Promise<any[]>} The users for the session.
|
|
360
|
+
*/
|
|
361
|
+
users: (data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
|
|
47
362
|
};
|
|
48
363
|
apps: {
|
|
364
|
+
/**
|
|
365
|
+
* Connects an app to a product by app tag.
|
|
366
|
+
* @param {string} appTag - The app tag.
|
|
367
|
+
* @returns {Promise<IAppAccess>} The result of the connection.
|
|
368
|
+
*/
|
|
49
369
|
connect: (appTag: string) => Promise<import("./types").IAppAccess>;
|
|
370
|
+
/**
|
|
371
|
+
* Adds an app to a product.
|
|
372
|
+
* @param {IProductApp} app - The app data.
|
|
373
|
+
* @returns {Promise<void>} Resolves when the app is added. Throws on error.
|
|
374
|
+
*/
|
|
50
375
|
add: (app: IProductApp) => Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* Fetches all apps for a product.
|
|
378
|
+
* @returns {IProductApp[]} The list of apps.
|
|
379
|
+
*/
|
|
51
380
|
fetchAll: () => Promise<IProductApp[]>;
|
|
381
|
+
/**
|
|
382
|
+
* Fetches an app by tag.
|
|
383
|
+
* @param {string} tag - The app tag.
|
|
384
|
+
* @returns {IProductApp|null} The fetched app, or null if not found.
|
|
385
|
+
*/
|
|
52
386
|
fetch: (tag: string) => Promise<IProductApp>;
|
|
387
|
+
/**
|
|
388
|
+
* Updates an app by access tag.
|
|
389
|
+
* @param {string} accessTag - The app access tag.
|
|
390
|
+
* @param {Partial<IProductApp>} data - The app data to update.
|
|
391
|
+
* @returns {Promise<void>} Resolves when the app is updated. Throws on error.
|
|
392
|
+
*/
|
|
53
393
|
update: (accessTag: string, data: Partial<IProductApp>) => Promise<void>;
|
|
54
394
|
webhooks: {
|
|
395
|
+
/**
|
|
396
|
+
* Fetches all webhooks for an app by access tag.
|
|
397
|
+
* @param {string} accessTag - The app access tag.
|
|
398
|
+
* @returns {Promise<IAppWebhook[]>} The list of webhooks.
|
|
399
|
+
*/
|
|
55
400
|
fetchAll: (accessTag: string) => Promise<IAppWebhook[]>;
|
|
56
|
-
|
|
401
|
+
/**
|
|
402
|
+
* Generates a webhook link for an app.
|
|
403
|
+
* @param {IGenerateWebhookLink} data - The webhook link data.
|
|
404
|
+
* @returns {Promise<string>} The generated webhook link.
|
|
405
|
+
*/
|
|
57
406
|
generateLink: (data: IGenerateWebhookLink) => Promise<string>;
|
|
58
407
|
};
|
|
408
|
+
health: {
|
|
409
|
+
/**
|
|
410
|
+
* Creates a health check for an app.
|
|
411
|
+
* @param {Partial<IProductAppHealth>} data - The health check data.
|
|
412
|
+
* @returns {Promise<void>} Resolves when the health check is created. Throws on error.
|
|
413
|
+
*/
|
|
414
|
+
create: (data: Partial<IProductAppHealth>) => Promise<void>;
|
|
415
|
+
/**
|
|
416
|
+
* Updates a health check by tag.
|
|
417
|
+
* @param {string} tag - The health check tag.
|
|
418
|
+
* @param {Partial<IProductAppHealth>} data - The health check data to update.
|
|
419
|
+
* @returns {Promise<void>} Resolves when the health check is updated. Throws on error.
|
|
420
|
+
*/
|
|
421
|
+
update: (tag: string, data: Partial<IProductAppHealth>) => Promise<void>;
|
|
422
|
+
/**
|
|
423
|
+
* Fetches a health check by access tag and tag.
|
|
424
|
+
* @param {string} access_tag - The app access tag.
|
|
425
|
+
* @param {string} tag - The health check tag.
|
|
426
|
+
* @returns {Promise<IProductAppHealth|null>} The fetched health check, or null if not found.
|
|
427
|
+
*/
|
|
428
|
+
fetch: (access_tag: string, tag: string) => Promise<IProductAppHealth>;
|
|
429
|
+
/**
|
|
430
|
+
* Fetches all health checks for an app by access tag.
|
|
431
|
+
* @param {string} access_tag - The app access tag.
|
|
432
|
+
* @returns {Promise<IProductAppHealth[]>} The list of health checks.
|
|
433
|
+
*/
|
|
434
|
+
fetchAll: (access_tag: string) => Promise<IProductAppHealth[]>;
|
|
435
|
+
};
|
|
59
436
|
};
|
|
437
|
+
/**
|
|
438
|
+
* Creates a quota for a product.
|
|
439
|
+
* @param {Partial<IProductQuota>} data - The quota data.
|
|
440
|
+
* @returns {Promise<void>} Resolves when the quota is created. Throws on error.
|
|
441
|
+
*/
|
|
60
442
|
quota: {
|
|
61
443
|
create: (data: Partial<IProductQuota>) => Promise<void>;
|
|
62
|
-
|
|
63
|
-
|
|
444
|
+
/**
|
|
445
|
+
* Fetches a quota by tag.
|
|
446
|
+
* @param {string} tag - The quota tag.
|
|
447
|
+
* @returns {IProductQuota|null} The fetched quota, or null if not found.
|
|
448
|
+
*/
|
|
449
|
+
fetch: (tag: string) => Promise<IProductQuota>;
|
|
450
|
+
/**
|
|
451
|
+
* Fetches all quotas for a product.
|
|
452
|
+
* @returns {IProductQuota[]} The list of quotas.
|
|
453
|
+
*/
|
|
454
|
+
fetchAll: () => Promise<IProductQuota[]>;
|
|
455
|
+
/**
|
|
456
|
+
* Updates a quota by tag.
|
|
457
|
+
* @param {string} tag - The quota tag.
|
|
458
|
+
* @param {Partial<IProductQuota>} data - The quota data to update.
|
|
459
|
+
* @returns {Promise<void>} Resolves when the quota is updated. Throws on error.
|
|
460
|
+
*/
|
|
64
461
|
update: (tag: string, data: Partial<IProductQuota>) => Promise<void>;
|
|
65
462
|
};
|
|
463
|
+
/**
|
|
464
|
+
* Creates a fallback for a product.
|
|
465
|
+
* @param {Partial<IProductFallback>} data - The fallback data.
|
|
466
|
+
* @returns {Promise<void>} Resolves when the fallback is created. Throws on error.
|
|
467
|
+
*/
|
|
66
468
|
fallback: {
|
|
67
469
|
create: (data: Partial<IProductFallback>) => Promise<void>;
|
|
68
|
-
|
|
69
|
-
|
|
470
|
+
/**
|
|
471
|
+
* Fetches a fallback by tag.
|
|
472
|
+
* @param {string} tag - The fallback tag.
|
|
473
|
+
* @returns {IProductFallback|null} The fetched fallback, or null if not found.
|
|
474
|
+
*/
|
|
475
|
+
fetch: (tag: string) => Promise<IProductFallback>;
|
|
476
|
+
/**
|
|
477
|
+
* Fetches all fallbacks for a product.
|
|
478
|
+
* @returns {IProductFallback[]} The list of fallbacks.
|
|
479
|
+
*/
|
|
480
|
+
fetchAll: () => Promise<IProductFallback[]>;
|
|
481
|
+
/**
|
|
482
|
+
* Updates a fallback by tag.
|
|
483
|
+
* @param {string} tag - The fallback tag.
|
|
484
|
+
* @param {Partial<IProductFallback>} data - The fallback data to update.
|
|
485
|
+
* @returns {Promise<void>} Resolves when the fallback is updated. Throws on error.
|
|
486
|
+
*/
|
|
70
487
|
update: (tag: string, data: Partial<IProductFallback>) => Promise<void>;
|
|
71
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* Updates data validation for a product.
|
|
491
|
+
* @param {string} tag - The product tag.
|
|
492
|
+
* @param {Partial<IParsedSample>} update - The update data.
|
|
493
|
+
* @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
|
|
494
|
+
*/
|
|
72
495
|
updateValidation: (tag: string, update: Partial<IParsedSample>) => Promise<boolean>;
|
|
73
496
|
environments: {
|
|
497
|
+
/**
|
|
498
|
+
* Creates an environment for a product.
|
|
499
|
+
* @param {IProductEnv} data - The environment data.
|
|
500
|
+
* @returns {Promise<void>} Resolves when the environment is created. Throws on error.
|
|
501
|
+
*/
|
|
74
502
|
create: (data: IProductEnv) => Promise<void>;
|
|
75
|
-
|
|
76
|
-
|
|
503
|
+
/**
|
|
504
|
+
* Fetches all environments for a product.
|
|
505
|
+
* @returns {IAppEnv[]} The list of environments.
|
|
506
|
+
*/
|
|
507
|
+
fetchAll: () => Promise<IProductEnv[]>;
|
|
508
|
+
/**
|
|
509
|
+
* Fetches an environment by slug.
|
|
510
|
+
* @param {string} slug - The environment slug.
|
|
511
|
+
* @returns {IAppEnv|null} The fetched environment, or null if not found.
|
|
512
|
+
*/
|
|
513
|
+
fetch: (slug: string) => Promise<IProductEnv>;
|
|
514
|
+
/**
|
|
515
|
+
* Updates an environment by slug.
|
|
516
|
+
* @param {string} slug - The environment slug.
|
|
517
|
+
* @param {Partial<IProductEnv>} data - The environment data to update.
|
|
518
|
+
* @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
|
|
519
|
+
*/
|
|
77
520
|
update: (slug: string, data: Partial<IProductEnv>) => Promise<void>;
|
|
78
521
|
};
|
|
79
522
|
storage: {
|
|
523
|
+
/**
|
|
524
|
+
* Creates a storage for a product.
|
|
525
|
+
* @param {IProductStorage} data - The storage data.
|
|
526
|
+
* @returns {Promise<void>} Resolves when the storage is created. Throws on error.
|
|
527
|
+
*/
|
|
80
528
|
create: (data: IProductStorage) => Promise<void>;
|
|
81
|
-
|
|
82
|
-
|
|
529
|
+
/**
|
|
530
|
+
* Fetches all storages for a product.
|
|
531
|
+
* @returns {IProductStorage[]} The list of storages.
|
|
532
|
+
*/
|
|
533
|
+
fetchAll: () => Promise<IProductStorage[]>;
|
|
534
|
+
/**
|
|
535
|
+
* Fetches a storage by tag.
|
|
536
|
+
* @param {string} tag - The storage tag.
|
|
537
|
+
* @returns {IProductStorage|null} The fetched storage, or null if not found.
|
|
538
|
+
*/
|
|
539
|
+
fetch: (tag: string) => Promise<IProductStorage>;
|
|
540
|
+
/**
|
|
541
|
+
* Updates a storage by tag.
|
|
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.
|
|
545
|
+
*/
|
|
83
546
|
update: (tag: string, data: Partial<IProductStorage>) => Promise<void>;
|
|
84
|
-
|
|
547
|
+
/**
|
|
548
|
+
* Fetches storage files for a product.
|
|
549
|
+
* @param {IFetchFilesPayload} data - The fetch files payload.
|
|
550
|
+
* @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
|
|
551
|
+
*/
|
|
552
|
+
files: (data: IFetchFilesPayload) => Promise<import("./types").IFileURLPayload[]>;
|
|
85
553
|
};
|
|
86
554
|
messageBrokers: {
|
|
555
|
+
/**
|
|
556
|
+
* Creates a message broker for a product.
|
|
557
|
+
* @param {Partial<IProductMessageBroker>} data - The message broker data.
|
|
558
|
+
* @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
|
|
559
|
+
*/
|
|
87
560
|
create: (data: Partial<IProductMessageBroker>) => Promise<void>;
|
|
88
|
-
|
|
89
|
-
|
|
561
|
+
/**
|
|
562
|
+
* Fetches all message brokers for a product.
|
|
563
|
+
* @returns {IProductMessageBroker[]} The list of message brokers.
|
|
564
|
+
*/
|
|
565
|
+
fetchAll: () => Promise<IProductMessageBroker[]>;
|
|
566
|
+
/**
|
|
567
|
+
* Fetches a message broker by tag.
|
|
568
|
+
* @param {string} tag - The message broker tag.
|
|
569
|
+
* @returns {IProductMessageBroker|null} The fetched message broker, or null if not found.
|
|
570
|
+
*/
|
|
571
|
+
fetch: (tag: string) => Promise<IProductMessageBroker>;
|
|
572
|
+
/**
|
|
573
|
+
* Updates a message broker by tag.
|
|
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.
|
|
577
|
+
*/
|
|
90
578
|
update: (tag: string, data: Partial<IProductMessageBroker>) => Promise<void>;
|
|
91
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
|
+
*/
|
|
92
585
|
create: (data: IProductMessageBrokerTopic) => Promise<void>;
|
|
93
|
-
|
|
94
|
-
|
|
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
|
+
*/
|
|
95
604
|
update: (tag: string, data: Partial<IProductMessageBrokerTopic>) => Promise<void>;
|
|
96
605
|
};
|
|
97
606
|
};
|
|
98
607
|
notifications: {
|
|
608
|
+
/**
|
|
609
|
+
* Creates a notification for a product.
|
|
610
|
+
* @param {IProductNotification} data - The notification data.
|
|
611
|
+
* @returns {Promise<void>} Resolves when the notification is created. Throws on error.
|
|
612
|
+
*/
|
|
99
613
|
create: (data: IProductNotification) => Promise<void>;
|
|
100
|
-
|
|
101
|
-
|
|
614
|
+
/**
|
|
615
|
+
* Fetches all notifications for a product.
|
|
616
|
+
* @returns {IProductNotification[]} The list of notifications.
|
|
617
|
+
*/
|
|
618
|
+
fetchAll: () => Promise<IProductNotification[]>;
|
|
619
|
+
/**
|
|
620
|
+
* Fetches a notification by tag.
|
|
621
|
+
* @param {string} tag - The notification tag.
|
|
622
|
+
* @returns {IProductNotification|null} The fetched notification, or null if not found.
|
|
623
|
+
*/
|
|
624
|
+
fetch: (tag: string) => Promise<IProductNotification>;
|
|
625
|
+
/**
|
|
626
|
+
* Updates a notification by tag.
|
|
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.
|
|
630
|
+
*/
|
|
102
631
|
update: (tag: string, data: Partial<IProductNotification>) => Promise<void>;
|
|
103
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
|
+
*/
|
|
104
638
|
create: (data: IProductNotificationTemplate) => Promise<void>;
|
|
105
|
-
|
|
106
|
-
|
|
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
|
+
*/
|
|
107
657
|
update: (tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
|
|
108
658
|
};
|
|
109
659
|
};
|
|
110
660
|
databases: {
|
|
661
|
+
/**
|
|
662
|
+
* Creates a database for a product.
|
|
663
|
+
* @param {IProductDatabase} data - The database data.
|
|
664
|
+
* @returns {Promise<void>} Resolves when the database is created. Throws on error.
|
|
665
|
+
*/
|
|
111
666
|
create: (data: IProductDatabase) => Promise<void>;
|
|
112
|
-
|
|
113
|
-
|
|
667
|
+
/**
|
|
668
|
+
* Fetches all databases for a product.
|
|
669
|
+
* @returns {IProductDatabase[]} The list of databases.
|
|
670
|
+
*/
|
|
671
|
+
fetchAll: () => Promise<IProductDatabase[]>;
|
|
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
|
+
*/
|
|
114
684
|
update: (tag: string, data: Partial<IProductDatabase>) => Promise<void>;
|
|
115
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
|
+
*/
|
|
116
691
|
create: (data: IProductDatabaseAction) => Promise<void>;
|
|
117
|
-
|
|
118
|
-
|
|
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
|
+
*/
|
|
119
710
|
update: (tag: string, data: Partial<IProductDatabaseAction>) => Promise<void>;
|
|
120
711
|
};
|
|
121
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
|
+
*/
|
|
122
718
|
create: (data: IProductDatabaseMigration) => Promise<void>;
|
|
123
|
-
|
|
124
|
-
|
|
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
|
+
*/
|
|
125
737
|
update: (tag: string, data: Partial<IProductDatabaseMigration>) => Promise<void>;
|
|
126
738
|
};
|
|
127
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
|
+
};
|
|
128
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
|
+
*/
|
|
129
772
|
create: (data: Partial<IProductJobs>) => Promise<void>;
|
|
130
|
-
|
|
131
|
-
|
|
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
|
+
*/
|
|
132
790
|
update: (tag: string, data: Partial<IProductJobs>) => Promise<void>;
|
|
133
791
|
};
|
|
134
792
|
caches: {
|
|
793
|
+
/**
|
|
794
|
+
* Creates a cache for a product.
|
|
795
|
+
* @param {IProductCache} data - The cache data.
|
|
796
|
+
* @returns {Promise<void>} Resolves when the cache is created. Throws on error.
|
|
797
|
+
*/
|
|
135
798
|
create: (data: IProductCache) => Promise<void>;
|
|
136
|
-
|
|
137
|
-
|
|
799
|
+
/**
|
|
800
|
+
* Fetches all caches for a product.
|
|
801
|
+
* @returns {IProductCache[]} The list of caches.
|
|
802
|
+
*/
|
|
803
|
+
fetchAll: () => Promise<IProductCache[]>;
|
|
804
|
+
/**
|
|
805
|
+
* Fetches a cache by tag.
|
|
806
|
+
* @param {string} tag - The cache tag.
|
|
807
|
+
* @returns {IProductCache|null} The fetched cache, or null if not found.
|
|
808
|
+
*/
|
|
809
|
+
fetch: (tag: string) => Promise<IProductCache>;
|
|
810
|
+
/**
|
|
811
|
+
* Updates a cache by tag.
|
|
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.
|
|
815
|
+
*/
|
|
138
816
|
update: (tag: string, data: Partial<IProductCache>) => Promise<void>;
|
|
139
817
|
values: (data: FetchRemoteCachePayload) => Promise<import("./types").IRemoteCache[]>;
|
|
140
818
|
};
|
|
141
819
|
features: {
|
|
820
|
+
/**
|
|
821
|
+
* Creates a feature for a product.
|
|
822
|
+
* @param {Partial<IProductFeature>} data - The feature data.
|
|
823
|
+
* @returns {Promise<void>} Resolves when the feature is created. Throws on error.
|
|
824
|
+
*/
|
|
142
825
|
create: (data: Partial<IProductFeature>) => Promise<void>;
|
|
143
|
-
|
|
144
|
-
|
|
826
|
+
/**
|
|
827
|
+
* Fetches all features for a product.
|
|
828
|
+
* @returns {IProductFeature[]} The list of features.
|
|
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
|
+
*/
|
|
145
843
|
update: (tag: string, data: Partial<IProductCache>) => Promise<void>;
|
|
146
844
|
};
|
|
147
845
|
};
|
|
846
|
+
/**
|
|
847
|
+
* App-related operations for managing apps, variables, constants, actions, auths, webhooks, environments, and validation.
|
|
848
|
+
*/
|
|
148
849
|
app: {
|
|
850
|
+
/**
|
|
851
|
+
* Creates a new app.
|
|
852
|
+
* @param {ICreateAppBuilder} data - The app data.
|
|
853
|
+
* @returns {Promise<{ app_id: string }>} The ID of the created app.
|
|
854
|
+
*/
|
|
149
855
|
create: (data: ICreateAppBuilder) => Promise<{
|
|
150
856
|
app_id: string;
|
|
151
857
|
}>;
|
|
858
|
+
/**
|
|
859
|
+
* Fetches an app by tag.
|
|
860
|
+
* @param {string} tag - The app tag.
|
|
861
|
+
* @returns {Promise<IApp|null>} The fetched app, or null if not found.
|
|
862
|
+
*/
|
|
152
863
|
fetch: (tag: string) => Promise<IApp>;
|
|
864
|
+
/**
|
|
865
|
+
* Updates an app by tag.
|
|
866
|
+
* @param {string} tag - The app tag.
|
|
867
|
+
* @param {Partial<IApp>} data - The app data to update.
|
|
868
|
+
* @returns {Promise<void>} Resolves when the app is updated. Throws on error.
|
|
869
|
+
*/
|
|
153
870
|
update: (tag: string, data: Partial<IApp>) => Promise<void>;
|
|
871
|
+
/**
|
|
872
|
+
* Initializes an app by tag.
|
|
873
|
+
* @param {string} appTag - The app tag.
|
|
874
|
+
* @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
|
|
875
|
+
*/
|
|
154
876
|
init: (appTag: string) => Promise<void>;
|
|
155
877
|
variables: {
|
|
878
|
+
/**
|
|
879
|
+
* Creates a variable for an app.
|
|
880
|
+
* @param {IAppVariables} data - The variable data.
|
|
881
|
+
* @returns {Promise<void>} Resolves when the variable is created. Throws on error.
|
|
882
|
+
*/
|
|
156
883
|
create: (data: IAppVariables) => Promise<void>;
|
|
157
|
-
|
|
158
|
-
|
|
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
|
+
*/
|
|
159
901
|
update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
160
902
|
};
|
|
161
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
|
+
*/
|
|
162
909
|
create: (data: IAppConstants) => Promise<void>;
|
|
163
|
-
|
|
164
|
-
|
|
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
|
+
*/
|
|
165
927
|
update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
|
|
166
928
|
};
|
|
167
929
|
actions: {
|
|
168
|
-
|
|
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, }: {
|
|
169
941
|
file: Buffer;
|
|
170
942
|
type: ImportDocsTypes;
|
|
171
943
|
version: string;
|
|
172
944
|
appTag?: string;
|
|
173
945
|
updateIfExists?: boolean;
|
|
946
|
+
isAdminImport?: boolean;
|
|
174
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
|
+
*/
|
|
175
954
|
update: (tag: string, data: Partial<IActionUpdate>) => Promise<void>;
|
|
176
|
-
|
|
177
|
-
|
|
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>;
|
|
178
991
|
};
|
|
179
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
|
+
*/
|
|
180
998
|
create: (data: IAppAuth) => Promise<void>;
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
*/
|
|
183
1016
|
update: (tag: string, data: Partial<IAppAuth>) => Promise<void>;
|
|
184
1017
|
};
|
|
185
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
|
+
*/
|
|
186
1024
|
create: (data: Partial<IAppWebhook>) => Promise<void>;
|
|
187
|
-
|
|
188
|
-
|
|
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
|
+
*/
|
|
189
1042
|
update: (tag: string, data: Partial<IAppWebhook>) => Promise<void>;
|
|
190
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
|
+
*/
|
|
191
1049
|
create: (data: IAppWebhookEvent) => Promise<void>;
|
|
192
|
-
|
|
193
|
-
|
|
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
|
+
*/
|
|
194
1068
|
update: (tag: string, data: Partial<IAppWebhookEvent>) => Promise<void>;
|
|
195
1069
|
};
|
|
196
1070
|
};
|
|
197
1071
|
environments: {
|
|
1072
|
+
/**
|
|
1073
|
+
* Creates an environment for an app.
|
|
1074
|
+
* @param {IAppEnv} data - The environment data.
|
|
1075
|
+
* @returns {Promise<void>} Resolves when the environment is created. Throws on error.
|
|
1076
|
+
*/
|
|
198
1077
|
create: (data: IAppEnv) => Promise<void>;
|
|
199
|
-
|
|
200
|
-
|
|
1078
|
+
/**
|
|
1079
|
+
* Fetches all environments for an app.
|
|
1080
|
+
* @returns {IAppEnv[]} The list of environments.
|
|
1081
|
+
*/
|
|
1082
|
+
fetchAll: () => Promise<IAppEnv[]>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Fetches an environment by slug.
|
|
1085
|
+
* @param {string} slug - The environment slug.
|
|
1086
|
+
* @returns {IAppEnv|null} The fetched environment, or null if not found.
|
|
1087
|
+
*/
|
|
1088
|
+
fetch: (slug: string) => Promise<IAppEnv>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Updates an environment by slug.
|
|
1091
|
+
* @param {string} slug - The environment slug.
|
|
1092
|
+
* @param {Partial<IAppEnv>} data - The environment data to update.
|
|
1093
|
+
* @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
|
|
1094
|
+
*/
|
|
201
1095
|
update: (slug: string, data: Partial<IAppEnv>) => Promise<void>;
|
|
202
1096
|
};
|
|
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
|
+
*/
|
|
203
1103
|
validation: (selector: string, update: Partial<IParsedSample>) => Promise<void>;
|
|
204
1104
|
};
|
|
1105
|
+
/**
|
|
1106
|
+
* Job-related operations for scheduling jobs.
|
|
1107
|
+
*/
|
|
1108
|
+
job: {
|
|
1109
|
+
/**
|
|
1110
|
+
* Schedules a job for a product.
|
|
1111
|
+
* @param {IProduct} data - The product data.
|
|
1112
|
+
* @returns {Promise<any>} The result of the job scheduling.
|
|
1113
|
+
*/
|
|
1114
|
+
schedule: (data: IProduct) => Promise<void>;
|
|
1115
|
+
};
|
|
1116
|
+
/**
|
|
1117
|
+
* Action-related operations for running actions.
|
|
1118
|
+
*/
|
|
1119
|
+
action: {
|
|
1120
|
+
/**
|
|
1121
|
+
* Runs an action processor.
|
|
1122
|
+
* @param {IActionProcessorInput} data - The action processor input.
|
|
1123
|
+
* @returns {Promise<any>} The result of the action processing.
|
|
1124
|
+
*/
|
|
1125
|
+
run: (data: IActionProcessorInput) => Promise<any>;
|
|
1126
|
+
};
|
|
1127
|
+
/**
|
|
1128
|
+
* Session-related operations for creating, validating, and refreshing sessions.
|
|
1129
|
+
*/
|
|
1130
|
+
sessions: {
|
|
1131
|
+
/**
|
|
1132
|
+
* Starts a new session.
|
|
1133
|
+
* @param {ISessionInput} data - The session input data.
|
|
1134
|
+
* @returns {Promise<any>} The result of the session generation.
|
|
1135
|
+
*/
|
|
1136
|
+
create: (data: ISessionInput) => Promise<import("./types").ISessionOutput>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Decrypts a session.
|
|
1139
|
+
* @param {ISessionPayload} data - The session payload.
|
|
1140
|
+
* @returns {Promise<any>} The decrypted session.
|
|
1141
|
+
*/
|
|
1142
|
+
validate: (data: ISessionPayload) => Promise<any>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Refreshes a session.
|
|
1145
|
+
* @param {ISessionRefreshPayload} data - The session refresh payload.
|
|
1146
|
+
* @returns {Promise<any>} The refreshed session.
|
|
1147
|
+
*/
|
|
1148
|
+
refresh: (data: ISessionRefreshPayload) => Promise<import("./types").ISessionOutput>;
|
|
1149
|
+
};
|
|
1150
|
+
/**
|
|
1151
|
+
* Feature-related operations for running, replaying, and resuming features.
|
|
1152
|
+
*/
|
|
1153
|
+
feature: {
|
|
1154
|
+
/**
|
|
1155
|
+
* Runs a feature processor.
|
|
1156
|
+
* @param {IProcessorInput} data - The feature processor input.
|
|
1157
|
+
* @returns {Promise<any>} The result of the feature processing.
|
|
1158
|
+
*/
|
|
1159
|
+
run: (data: IProcessorInput) => Promise<{
|
|
1160
|
+
process_id: string;
|
|
1161
|
+
}>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Generates output for a process by ID.
|
|
1164
|
+
* @param {string} process_id - The process ID.
|
|
1165
|
+
* @returns {Promise<any>} The generated output.
|
|
1166
|
+
*/
|
|
1167
|
+
output: (process_id: string) => Promise<{
|
|
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
|
+
}>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Replays a process by ID.
|
|
1185
|
+
* @param {string} process_id - The process ID.
|
|
1186
|
+
* @returns {Promise<any>} The result of the replay.
|
|
1187
|
+
*/
|
|
1188
|
+
replay: (process_id: string) => Promise<{
|
|
1189
|
+
process_id: string;
|
|
1190
|
+
}>;
|
|
1191
|
+
/**
|
|
1192
|
+
* Resumes a process by ID.
|
|
1193
|
+
* @param {string} process_id - The process ID.
|
|
1194
|
+
* @returns {Promise<any>} The result of the resume.
|
|
1195
|
+
*/
|
|
1196
|
+
resume: (process_id: string) => Promise<{
|
|
1197
|
+
process_id: string;
|
|
1198
|
+
}>;
|
|
1199
|
+
};
|
|
1200
|
+
/**
|
|
1201
|
+
* Quota-related operations for running quota processors.
|
|
1202
|
+
*/
|
|
1203
|
+
quota: {
|
|
1204
|
+
/**
|
|
1205
|
+
* Runs a quota processor.
|
|
1206
|
+
* @param {IProcessorInput} data - The quota processor input.
|
|
1207
|
+
* @returns {Promise<any>} The result of the quota processing.
|
|
1208
|
+
*/
|
|
1209
|
+
run: (data: IProcessorInput) => Promise<any>;
|
|
1210
|
+
};
|
|
1211
|
+
/**
|
|
1212
|
+
* Fallback-related operations for running fallback processors.
|
|
1213
|
+
*/
|
|
1214
|
+
fallback: {
|
|
1215
|
+
/**
|
|
1216
|
+
* Runs a fallback processor.
|
|
1217
|
+
* @param {IProcessorInput} data - The fallback processor input.
|
|
1218
|
+
* @returns {Promise<any>} The result of the fallback processing.
|
|
1219
|
+
*/
|
|
1220
|
+
run: (data: IProcessorInput) => Promise<any>;
|
|
1221
|
+
};
|
|
1222
|
+
/**
|
|
1223
|
+
* Notification-related operations for sending notifications.
|
|
1224
|
+
*/
|
|
1225
|
+
notification: {
|
|
1226
|
+
/**
|
|
1227
|
+
* Sends a notification using the notification processor.
|
|
1228
|
+
* @param {INotificationProcessorInput} data - The notification processor input.
|
|
1229
|
+
* @returns {Promise<any>} The result of the notification processing.
|
|
1230
|
+
*/
|
|
1231
|
+
send: (data: INotificationProcessorInput) => Promise<{
|
|
1232
|
+
process_id: string;
|
|
1233
|
+
}>;
|
|
1234
|
+
};
|
|
1235
|
+
/**
|
|
1236
|
+
* Storage-related operations for reading and saving files.
|
|
1237
|
+
*/
|
|
1238
|
+
storage: {
|
|
1239
|
+
/**
|
|
1240
|
+
* Reads a file from storage.
|
|
1241
|
+
* @param {string} path - The file path.
|
|
1242
|
+
* @returns {Promise<IFileReadResult>} The file read result.
|
|
1243
|
+
*/
|
|
1244
|
+
read: (path: string) => Promise<IFileReadResult>;
|
|
1245
|
+
/**
|
|
1246
|
+
* Saves data to storage using the storage processor.
|
|
1247
|
+
* @param {IStorageProcessorInput} data - The storage processor input.
|
|
1248
|
+
* @returns {Promise<any>} The result of the storage processing.
|
|
1249
|
+
*/
|
|
1250
|
+
save: (data: IStorageProcessorInput) => Promise<any>;
|
|
1251
|
+
};
|
|
1252
|
+
/**
|
|
1253
|
+
* Message broker-related operations for publishing and subscribing to topics.
|
|
1254
|
+
*/
|
|
1255
|
+
broker: {
|
|
1256
|
+
/**
|
|
1257
|
+
* Publishes a message using the message broker processor.
|
|
1258
|
+
* @param {IMessageBrokerPublishInput} data - The publish input.
|
|
1259
|
+
* @returns {Promise<any>} The result of the publish operation.
|
|
1260
|
+
*/
|
|
1261
|
+
publish: (data: IMessageBrokerPublishInput) => Promise<void | {
|
|
1262
|
+
process_id: string;
|
|
1263
|
+
}>;
|
|
1264
|
+
/**
|
|
1265
|
+
* Subscribes to a message broker topic.
|
|
1266
|
+
* @param {IMessageBrokerSubscribeInput} data - The subscribe input.
|
|
1267
|
+
* @returns {Promise<any>} The result of the subscribe operation.
|
|
1268
|
+
*/
|
|
1269
|
+
subcribe: (data: IMessageBrokerSubscribeInput) => Promise<void | {
|
|
1270
|
+
process_id: string;
|
|
1271
|
+
}>;
|
|
1272
|
+
};
|
|
1273
|
+
/**
|
|
1274
|
+
* Processor-related operations for database actions only.
|
|
1275
|
+
*/
|
|
205
1276
|
processor: {
|
|
206
|
-
job: {
|
|
207
|
-
schedule: (data: IProduct) => Promise<void>;
|
|
208
|
-
};
|
|
209
|
-
action: {
|
|
210
|
-
run: (data: IActionProcessorInput) => Promise<any>;
|
|
211
|
-
};
|
|
212
1277
|
db: {
|
|
1278
|
+
/**
|
|
1279
|
+
* Executes a database action processor.
|
|
1280
|
+
* @param {IDBActionProcessorInput} data - The database action processor input.
|
|
1281
|
+
* @returns {Promise<any>} The result of the database action processing.
|
|
1282
|
+
*/
|
|
213
1283
|
execute: (data: IDBActionProcessorInput) => Promise<any>;
|
|
214
1284
|
migration: {
|
|
1285
|
+
/**
|
|
1286
|
+
* Runs a database migration.
|
|
1287
|
+
* @param {Object} params - The migration parameters.
|
|
1288
|
+
* @param {string} params.migration - The migration name.
|
|
1289
|
+
* @param {string} params.env - The environment.
|
|
1290
|
+
* @param {string} params.product - The product name.
|
|
1291
|
+
* @returns {Promise<any>} The result of the migration.
|
|
1292
|
+
*/
|
|
215
1293
|
run: ({ migration, env, product }: {
|
|
216
1294
|
migration: string;
|
|
217
1295
|
env: string;
|
|
@@ -219,6 +1297,14 @@ export default class Ductape implements IDuctape {
|
|
|
219
1297
|
}) => Promise<{
|
|
220
1298
|
process_id: string;
|
|
221
1299
|
}>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Rolls back a database migration.
|
|
1302
|
+
* @param {Object} params - The migration parameters.
|
|
1303
|
+
* @param {string} params.migration - The migration name.
|
|
1304
|
+
* @param {string} params.env - The environment.
|
|
1305
|
+
* @param {string} params.product - The product name.
|
|
1306
|
+
* @returns {Promise<any>} The result of the rollback.
|
|
1307
|
+
*/
|
|
222
1308
|
rollback: ({ migration, env, product }: {
|
|
223
1309
|
migration: string;
|
|
224
1310
|
env: string;
|
|
@@ -228,112 +1314,115 @@ export default class Ductape implements IDuctape {
|
|
|
228
1314
|
}>;
|
|
229
1315
|
};
|
|
230
1316
|
};
|
|
231
|
-
sessions: {
|
|
232
|
-
generate: (data: ISessionInput) => Promise<import("./types").ISessionOutput>;
|
|
233
|
-
};
|
|
234
|
-
feature: {
|
|
235
|
-
run: (data: IProcessorInput) => Promise<{
|
|
236
|
-
process_id: string;
|
|
237
|
-
}>;
|
|
238
|
-
output: (process_id: string) => Promise<{
|
|
239
|
-
process_id: string;
|
|
240
|
-
status: import("./types").LogEventStatus;
|
|
241
|
-
data: Record<string, unknown>;
|
|
242
|
-
errors?: undefined;
|
|
243
|
-
} | {
|
|
244
|
-
process_id: string;
|
|
245
|
-
status: import("./types").LogEventStatus;
|
|
246
|
-
errors: string[];
|
|
247
|
-
data?: undefined;
|
|
248
|
-
} | {
|
|
249
|
-
process_id: string;
|
|
250
|
-
status: import("./types").LogEventStatus;
|
|
251
|
-
data?: undefined;
|
|
252
|
-
errors?: undefined;
|
|
253
|
-
}>;
|
|
254
|
-
replay: (process_id: string) => Promise<{
|
|
255
|
-
process_id: string;
|
|
256
|
-
}>;
|
|
257
|
-
resume: (process_id: string) => Promise<{
|
|
258
|
-
process_id: string;
|
|
259
|
-
}>;
|
|
260
|
-
};
|
|
261
|
-
quota: {
|
|
262
|
-
run: (data: IProcessorInput) => Promise<any>;
|
|
263
|
-
};
|
|
264
|
-
fallback: {
|
|
265
|
-
run: (data: IProcessorInput) => Promise<any>;
|
|
266
|
-
};
|
|
267
|
-
notification: {
|
|
268
|
-
send: (data: INotificationProcessorInput) => Promise<{
|
|
269
|
-
process_id: string;
|
|
270
|
-
}>;
|
|
271
|
-
};
|
|
272
|
-
storage: {
|
|
273
|
-
readFile: (path: string) => Promise<IFileReadResult>;
|
|
274
|
-
save: (data: IStorageProcessorInput) => Promise<any>;
|
|
275
|
-
};
|
|
276
|
-
messageBroker: {
|
|
277
|
-
publish: (data: IMessageBrokerPublishInput) => Promise<void | {
|
|
278
|
-
process_id: string;
|
|
279
|
-
}>;
|
|
280
|
-
subcribe: (data: IMessageBrokerSubscribeInput) => Promise<void | {
|
|
281
|
-
process_id: string;
|
|
282
|
-
}>;
|
|
283
|
-
};
|
|
284
1317
|
};
|
|
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
|
+
/**
|
|
1329
|
+
* Logs-related operations for initializing and fetching logs.
|
|
1330
|
+
*/
|
|
285
1331
|
logs: {
|
|
1332
|
+
/**
|
|
1333
|
+
* Initializes the logger service for a product or app.
|
|
1334
|
+
* @param {string} [productTag] - The product tag (optional).
|
|
1335
|
+
* @param {string} [appTag] - The app tag (optional).
|
|
1336
|
+
* @throws {Error} If neither productTag nor appTag is provided.
|
|
1337
|
+
* @returns {Promise<void>} Resolves when logger is initialized.
|
|
1338
|
+
*/
|
|
286
1339
|
init: (productTag?: string, appTag?: string) => Promise<void>;
|
|
287
1340
|
add: () => Promise<void>;
|
|
288
1341
|
/**
|
|
289
|
-
* Fetches logs based on
|
|
290
|
-
*
|
|
291
|
-
* @
|
|
292
|
-
* @param params.type - Optional. Type of analysis ('apps', 'process', 'feature', 'integrations', etc.)
|
|
293
|
-
* @param params.groupBy - Optional. Time period for grouping ('day', 'week', 'month', 'year')
|
|
294
|
-
* @param params.search - Optional. Search term for filtering logs
|
|
295
|
-
* @param params.page - Optional. Page number for pagination (≥ 1)
|
|
296
|
-
* @param params.limit - Optional. Number of items per page (≥ 1)
|
|
297
|
-
* @param params.status - Optional. Filter by status ('success', 'processing', 'fail')
|
|
298
|
-
*
|
|
299
|
-
* For component='app':
|
|
300
|
-
* @param params.tag - Optional. Tag identifier (only valid when type='actions')
|
|
301
|
-
* @param params.env - Optional. Environment filter
|
|
302
|
-
* @param params.name - Optional. Name filter
|
|
303
|
-
* @param params.action - Optional. Specific action filter
|
|
304
|
-
*
|
|
305
|
-
* For component='product':
|
|
306
|
-
* @param params.env - Optional. Environment filter
|
|
307
|
-
* @param params.name - Optional. Name filter
|
|
308
|
-
* @param params.action - Optional. Specific action filter
|
|
309
|
-
*
|
|
310
|
-
* @throws {Error} If logger service is not initialized
|
|
311
|
-
* @throws {Error} If required parameters are missing or invalid
|
|
312
|
-
* @throws {Error} If API request fails
|
|
313
|
-
*
|
|
314
|
-
* @returns {Promise<any>} The fetched log data
|
|
315
|
-
*
|
|
316
|
-
* @example
|
|
317
|
-
* // Fetch app logs
|
|
318
|
-
* const appLogs = await logs.fetch({
|
|
319
|
-
* component: 'app',
|
|
320
|
-
* type: 'actions',
|
|
321
|
-
* groupBy: 'day',
|
|
322
|
-
* limit: 20
|
|
323
|
-
* });
|
|
324
|
-
*
|
|
325
|
-
* // Fetch product logs
|
|
326
|
-
* const productLogs = await logs.fetch({
|
|
327
|
-
* component: 'product',
|
|
328
|
-
* type: 'database',
|
|
329
|
-
* status: 'success'
|
|
330
|
-
* });
|
|
1342
|
+
* Fetches logs based on provided query parameters.
|
|
1343
|
+
* @param {LogQueryParams} params - The log query parameters.
|
|
1344
|
+
* @returns {Promise<any>} The fetched log data.
|
|
331
1345
|
*/
|
|
332
1346
|
fetch: (params: LogQueryParams) => Promise<any>;
|
|
333
1347
|
publish: () => Promise<void>;
|
|
334
1348
|
};
|
|
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
|
+
};
|
|
335
1422
|
private initUserAuth;
|
|
336
1423
|
private createNewLogger;
|
|
1424
|
+
private createNewDatabaseService;
|
|
1425
|
+
private createNewGraphService;
|
|
337
1426
|
private createNewProductBuilder;
|
|
338
1427
|
private createNewProcessor;
|
|
339
1428
|
private createNewImporter;
|
|
@@ -344,4 +1433,9 @@ export default class Ductape implements IDuctape {
|
|
|
344
1433
|
private refreshUserAccessToken;
|
|
345
1434
|
fetchWorkspaceApps(status: PublicStates): Promise<Array<IApp>>;
|
|
346
1435
|
fetchWorkspaceProjects(status: PublicStates): Promise<Array<IProduct>>;
|
|
1436
|
+
/**
|
|
1437
|
+
* Fetches the latest healthcheck status for a product/env from Redis cache via processor service.
|
|
1438
|
+
*/
|
|
1439
|
+
getHealthcheckStatus(productTag: string, envSlug: string): Promise<any>;
|
|
347
1440
|
}
|
|
1441
|
+
export type { IWorkspaceSecret } from './api/services/workspaceSecretsApi.service';
|