@ductape/sdk 0.0.4-v59 → 0.0.4-v60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agents.service.d.ts +8 -2
- package/dist/agents/agents.service.js +5 -0
- package/dist/agents/agents.service.js.map +1 -1
- package/dist/agents/types/agents.types.d.ts +2 -0
- package/dist/agents/types/agents.types.js.map +1 -1
- package/dist/agents/vector-store-adapter.js +5 -5
- package/dist/agents/vector-store-adapter.js.map +1 -1
- package/dist/api/services/appApi.service.d.ts +3 -3
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +1 -1
- package/dist/api/services/productsApi.service.js +20 -13
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/secretsApi.service.d.ts +12 -0
- package/dist/api/services/secretsApi.service.js +30 -2
- package/dist/api/services/secretsApi.service.js.map +1 -1
- package/dist/api/services/workspaceApi.service.d.ts +8 -0
- package/dist/api/services/workspaceApi.service.js +20 -0
- package/dist/api/services/workspaceApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +2 -0
- package/dist/api/urls.js +10 -15
- package/dist/api/urls.js.map +1 -1
- package/dist/api/utils/auth.utils.d.ts +1 -3
- package/dist/api/utils/auth.utils.js.map +1 -1
- package/dist/apps/utils/oauth-manager.js +27 -3
- package/dist/apps/utils/oauth-manager.js.map +1 -1
- package/dist/brokers/brokers.service.d.ts +8 -0
- package/dist/brokers/brokers.service.js +50 -4
- package/dist/brokers/brokers.service.js.map +1 -1
- package/dist/brokers/types/index.d.ts +26 -0
- package/dist/brokers/utils/providers/kafka.service.d.ts +7 -0
- package/dist/brokers/utils/providers/kafka.service.js +102 -23
- package/dist/brokers/utils/providers/kafka.service.js.map +1 -1
- package/dist/brokers/utils/providers/rabbitmq.service.d.ts +2 -1
- package/dist/brokers/utils/providers/rabbitmq.service.js +99 -15
- package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -1
- package/dist/database/adapters/cassandra.adapter.d.ts +1 -0
- package/dist/database/adapters/cassandra.adapter.js +100 -44
- package/dist/database/adapters/cassandra.adapter.js.map +1 -1
- package/dist/database/adapters/dynamodb.adapter.d.ts +1 -0
- package/dist/database/adapters/dynamodb.adapter.js +89 -20
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -1
- package/dist/database/adapters/mongodb.adapter.d.ts +1 -0
- package/dist/database/adapters/mongodb.adapter.js +123 -45
- package/dist/database/adapters/mongodb.adapter.js.map +1 -1
- package/dist/database/adapters/mysql.adapter.d.ts +1 -0
- package/dist/database/adapters/mysql.adapter.js +125 -48
- package/dist/database/adapters/mysql.adapter.js.map +1 -1
- package/dist/database/adapters/postgresql.adapter.d.ts +5 -0
- package/dist/database/adapters/postgresql.adapter.js +151 -50
- package/dist/database/adapters/postgresql.adapter.js.map +1 -1
- package/dist/database/databases.service.d.ts +15 -1
- package/dist/database/databases.service.js +143 -2
- package/dist/database/databases.service.js.map +1 -1
- package/dist/database/operators/aggregation-builder.d.ts +11 -8
- package/dist/database/operators/aggregation-builder.js +184 -89
- package/dist/database/operators/aggregation-builder.js.map +1 -1
- package/dist/database/operators/query-builder.d.ts +23 -19
- package/dist/database/operators/query-builder.js +77 -45
- package/dist/database/operators/query-builder.js.map +1 -1
- package/dist/database/types/aggregation.interface.d.ts +21 -15
- package/dist/database/types/query.interface.d.ts +27 -21
- package/dist/database/types/write.interface.d.ts +20 -12
- package/dist/graph/adapters/arangodb.adapter.js +61 -22
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -1
- package/dist/graph/adapters/memgraph.adapter.js +22 -16
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -1
- package/dist/graph/adapters/neo4j.adapter.js +51 -21
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -1
- package/dist/graph/adapters/neptune.adapter.js +32 -16
- package/dist/graph/adapters/neptune.adapter.js.map +1 -1
- package/dist/graph/graphs.service.d.ts +24 -2
- package/dist/graph/graphs.service.js +238 -28
- package/dist/graph/graphs.service.js.map +1 -1
- package/dist/graph/types/connection.interface.d.ts +8 -0
- package/dist/graph/types/query.interface.d.ts +21 -14
- package/dist/index.d.ts +367 -20
- package/dist/index.js +510 -48
- package/dist/index.js.map +1 -1
- package/dist/inputs/inputs.service.d.ts +1 -1
- package/dist/notifications/notifications.service.d.ts +7 -2
- package/dist/notifications/notifications.service.js +2 -0
- package/dist/notifications/notifications.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +5 -1
- package/dist/processor/services/processor.service.js +35 -2
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.d.ts +76 -2
- package/dist/products/services/products.service.js +984 -27
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +52 -4
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +2 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +1 -7
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.js +4 -4
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +2 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -1
- package/dist/resilience/fallback.service.d.ts +4 -1
- package/dist/resilience/fallback.service.js +8 -10
- package/dist/resilience/fallback.service.js.map +1 -1
- package/dist/resilience/healthcheck.service.d.ts +6 -1
- package/dist/resilience/healthcheck.service.js +9 -0
- package/dist/resilience/healthcheck.service.js.map +1 -1
- package/dist/resilience/quota.service.d.ts +4 -1
- package/dist/resilience/quota.service.js +2 -0
- package/dist/resilience/quota.service.js.map +1 -1
- package/dist/resilience/resilience.service.d.ts +4 -1
- package/dist/resilience/resilience.service.js.map +1 -1
- package/dist/secrets/secrets.service.d.ts +11 -1
- package/dist/secrets/secrets.service.js +109 -10
- package/dist/secrets/secrets.service.js.map +1 -1
- package/dist/storage/storage.service.d.ts +4 -1
- package/dist/storage/storage.service.js +6 -1
- package/dist/storage/storage.service.js.map +1 -1
- package/dist/test/index.js +1 -3
- package/dist/test/index.js.map +1 -1
- package/dist/test/test.broker.kafka.d.ts +1 -0
- package/dist/test/test.broker.kafka.js +172 -0
- package/dist/test/test.broker.kafka.js.map +1 -0
- package/dist/test/test.broker.nats.d.ts +1 -0
- package/dist/test/test.broker.nats.js +193 -0
- package/dist/test/test.broker.nats.js.map +1 -0
- package/dist/test/test.broker.pubsub.d.ts +1 -0
- package/dist/test/test.broker.pubsub.js +171 -0
- package/dist/test/test.broker.pubsub.js.map +1 -0
- package/dist/test/test.broker.rabbitmq.d.ts +1 -0
- package/dist/test/test.broker.rabbitmq.js +164 -0
- package/dist/test/test.broker.rabbitmq.js.map +1 -0
- package/dist/test/test.broker.redis.d.ts +1 -0
- package/dist/test/test.broker.redis.js +168 -0
- package/dist/test/test.broker.redis.js.map +1 -0
- package/dist/test/test.broker.sqs.d.ts +1 -0
- package/dist/test/test.broker.sqs.js +158 -0
- package/dist/test/test.broker.sqs.js.map +1 -0
- package/dist/test/test.caches.d.ts +1 -0
- package/dist/test/test.caches.js +231 -0
- package/dist/test/test.caches.js.map +1 -0
- package/dist/test/test.database.dynamo.d.ts +1 -0
- package/dist/test/test.database.dynamo.js +265 -0
- package/dist/test/test.database.dynamo.js.map +1 -0
- package/dist/test/test.database.js +2 -2
- package/dist/test/test.database.js.map +1 -1
- package/dist/test/test.database.mongo.d.ts +1 -0
- package/dist/test/test.database.mongo.js +371 -0
- package/dist/test/test.database.mongo.js.map +1 -0
- package/dist/test/test.database.mysql.d.ts +1 -0
- package/dist/test/test.database.mysql.js +415 -0
- package/dist/test/test.database.mysql.js.map +1 -0
- package/dist/test/test.database.postgres.d.ts +1 -0
- package/dist/test/test.database.postgres.js +412 -0
- package/dist/test/test.database.postgres.js.map +1 -0
- package/dist/test/test.email.brevo.d.ts +1 -0
- package/dist/test/test.email.brevo.js +326 -0
- package/dist/test/test.email.brevo.js.map +1 -0
- package/dist/test/test.email.mailgun.d.ts +1 -0
- package/dist/test/test.email.mailgun.js +352 -0
- package/dist/test/test.email.mailgun.js.map +1 -0
- package/dist/test/test.email.postmark.d.ts +1 -0
- package/dist/test/test.email.postmark.js +316 -0
- package/dist/test/test.email.postmark.js.map +1 -0
- package/dist/test/test.email.sendgrid.d.ts +1 -0
- package/dist/test/test.email.sendgrid.js +365 -0
- package/dist/test/test.email.sendgrid.js.map +1 -0
- package/dist/test/test.email.smtp.d.ts +1 -0
- package/dist/test/test.email.smtp.js +323 -0
- package/dist/test/test.email.smtp.js.map +1 -0
- package/dist/test/test.graph.arangodb.d.ts +1 -0
- package/dist/test/test.graph.arangodb.js +358 -0
- package/dist/test/test.graph.arangodb.js.map +1 -0
- package/dist/test/test.graph.memgraph.d.ts +1 -0
- package/dist/test/test.graph.memgraph.js +320 -0
- package/dist/test/test.graph.memgraph.js.map +1 -0
- package/dist/test/test.graph.neo4j.d.ts +1 -0
- package/dist/test/test.graph.neo4j.js +218 -0
- package/dist/test/test.graph.neo4j.js.map +1 -0
- package/dist/test/test.graph.neptune.d.ts +1 -0
- package/dist/test/test.graph.neptune.js +331 -0
- package/dist/test/test.graph.neptune.js.map +1 -0
- package/dist/test/test.notifications.d.ts +1 -0
- package/dist/test/test.notifications.js +198 -0
- package/dist/test/test.notifications.js.map +1 -0
- package/dist/test/test.push.expo.d.ts +1 -0
- package/dist/test/test.push.expo.js +442 -0
- package/dist/test/test.push.expo.js.map +1 -0
- package/dist/test/test.push.firebase.d.ts +1 -0
- package/dist/test/test.push.firebase.js +409 -0
- package/dist/test/test.push.firebase.js.map +1 -0
- package/dist/test/test.session.d.ts +1 -0
- package/dist/test/test.session.js +299 -0
- package/dist/test/test.session.js.map +1 -0
- package/dist/test/test.sms.nexmo.d.ts +1 -0
- package/dist/test/test.sms.nexmo.js +278 -0
- package/dist/test/test.sms.nexmo.js.map +1 -0
- package/dist/test/test.sms.twilio.d.ts +1 -0
- package/dist/test/test.sms.twilio.js +275 -0
- package/dist/test/test.sms.twilio.js.map +1 -0
- package/dist/test/test.storage.js +169 -299
- package/dist/test/test.storage.js.map +1 -1
- package/dist/test/test.vector.pinecone.d.ts +1 -0
- package/dist/test/test.vector.pinecone.js +238 -0
- package/dist/test/test.vector.pinecone.js.map +1 -0
- package/dist/test/test.vector.qdrant.d.ts +1 -0
- package/dist/test/test.vector.qdrant.js +307 -0
- package/dist/test/test.vector.qdrant.js.map +1 -0
- package/dist/test/test.vector.weaviate.d.ts +1 -0
- package/dist/test/test.vector.weaviate.js +325 -0
- package/dist/test/test.vector.weaviate.js.map +1 -0
- package/dist/types/appBuilder.types.d.ts +6 -2
- package/dist/types/enums.d.ts +2 -0
- package/dist/types/enums.js +2 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.types.d.ts +2 -4
- package/dist/types/index.types.js +0 -1
- package/dist/types/index.types.js.map +1 -1
- package/dist/types/processor.types.d.ts +18 -0
- package/dist/types/productsBuilder.types.d.ts +19 -15
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/types/requests.types.d.ts +2 -0
- package/dist/utils/index.js +23 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/vector/adapters/base.adapter.d.ts +1 -1
- package/dist/vector/adapters/memory.adapter.d.ts +1 -1
- package/dist/vector/adapters/memory.adapter.js +1 -1
- package/dist/vector/adapters/memory.adapter.js.map +1 -1
- package/dist/vector/adapters/pinecone.adapter.d.ts +1 -1
- package/dist/vector/adapters/pinecone.adapter.js +1 -1
- package/dist/vector/adapters/pinecone.adapter.js.map +1 -1
- package/dist/vector/adapters/qdrant.adapter.d.ts +1 -1
- package/dist/vector/adapters/qdrant.adapter.js +1 -1
- package/dist/vector/adapters/qdrant.adapter.js.map +1 -1
- package/dist/vector/adapters/weaviate.adapter.d.ts +1 -1
- package/dist/vector/adapters/weaviate.adapter.js +1 -1
- package/dist/vector/adapters/weaviate.adapter.js.map +1 -1
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/vector/utils/vector-error.js +0 -1
- package/dist/vector/utils/vector-error.js.map +1 -1
- package/dist/vector/vector-database.service.d.ts +9 -6
- package/dist/vector/vector-database.service.js +7 -6
- package/dist/vector/vector-database.service.js.map +1 -1
- package/dist/vector/vector.service.d.ts +3 -3
- package/dist/vector/vector.service.js +12 -9
- package/dist/vector/vector.service.js.map +1 -1
- package/dist/workflows/workflow-executor.d.ts +4 -1
- package/dist/workflows/workflow-executor.js +10 -2
- package/dist/workflows/workflow-executor.js.map +1 -1
- package/dist/workflows/workflows.service.d.ts +8 -2
- package/dist/workflows/workflows.service.js +66 -41
- package/dist/workflows/workflows.service.js.map +1 -1
- package/package.json +29 -4
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { PublicStates } from './types/enums';
|
|
|
4
4
|
import { DatabaseService, IActionCreateOptions, IActionUpdateOptions, ISimpleSchemaDefinition, ISimpleCreateOptions, ISimpleDropOptions, ISimpleFieldDefinition, SimpleFieldType, ISimpleIndexOptions, ISchemaOperationResult, IIndexFieldDefinition, ITableSchema, IIndexInfo } from './database';
|
|
5
5
|
import { IConstraintDefinition as IMigrationConstraintDefinition } from './database/types/migration.interface';
|
|
6
6
|
import { IDBActionDispatchInput } from './types/processor.types';
|
|
7
|
-
import { GraphService } from './graph';
|
|
7
|
+
import { GraphService, IGraphConfig } from './graph';
|
|
8
8
|
import { WorkflowService } from './workflows';
|
|
9
9
|
import { IHealthcheckDefineOptions, IDefinedHealthcheck, IQuotaDefineOptions, IDefinedQuota, IFallbackDefineOptions, IDefinedFallback } from './resilience';
|
|
10
10
|
import { AgentsService } from './agents';
|
|
11
11
|
import { ModelService } from './models';
|
|
12
|
-
import { VectorDatabaseService } from './vector';
|
|
12
|
+
import { ICreateVectorDbOptions, VectorDatabaseService } from './vector';
|
|
13
13
|
import { IShareCredentialsConfig } from './apps/utils/credential-manager';
|
|
14
14
|
import { IOAuthConfig } from './apps/utils/oauth-manager';
|
|
15
15
|
import { JobsService, JobStatus, IJobListOptions, ICancelOptions, IRetryOptions, IRescheduleOptions, IJobWebhookConfig } from './jobs';
|
|
@@ -258,7 +258,7 @@ export interface IDuctape {
|
|
|
258
258
|
export default class Ductape implements IDuctape {
|
|
259
259
|
private user_id;
|
|
260
260
|
private workspace_id;
|
|
261
|
-
private
|
|
261
|
+
private accessKey;
|
|
262
262
|
private public_key;
|
|
263
263
|
private session;
|
|
264
264
|
private token;
|
|
@@ -279,6 +279,7 @@ export default class Ductape implements IDuctape {
|
|
|
279
279
|
private _cacheService;
|
|
280
280
|
private _jobsService;
|
|
281
281
|
private _secretsService;
|
|
282
|
+
private _privateKey;
|
|
282
283
|
private _quotaService;
|
|
283
284
|
private _fallbackService;
|
|
284
285
|
private _healthcheckService;
|
|
@@ -294,7 +295,7 @@ export default class Ductape implements IDuctape {
|
|
|
294
295
|
healthCheckWorker: any;
|
|
295
296
|
healthCheckUpdaterWorker: any;
|
|
296
297
|
private loadRedis;
|
|
297
|
-
constructor({
|
|
298
|
+
constructor({ accessKey, env_type, redis_url }: IDuctapeInit);
|
|
298
299
|
private loadBullMQ;
|
|
299
300
|
/**
|
|
300
301
|
* Connects to Redis and initializes job and health check queues and workers.
|
|
@@ -828,7 +829,14 @@ export default class Ductape implements IDuctape {
|
|
|
828
829
|
* @param {IProductStorage} data - The storage data.
|
|
829
830
|
* @returns {Promise<void>} Resolves when the storage is created. Throws on error.
|
|
830
831
|
*/
|
|
831
|
-
create: (
|
|
832
|
+
create: (data: IProductStorage & {
|
|
833
|
+
product: string;
|
|
834
|
+
}) => Promise<void>;
|
|
835
|
+
/**
|
|
836
|
+
* Creates a storage for a product (alternative method).
|
|
837
|
+
const builder = await this.getProductBuilder(product);
|
|
838
|
+
return builder.createStorage(data);
|
|
839
|
+
},
|
|
832
840
|
/**
|
|
833
841
|
* Fetches all storages for a product.
|
|
834
842
|
* @param {string} product - The product tag.
|
|
@@ -1014,14 +1022,16 @@ export default class Ductape implements IDuctape {
|
|
|
1014
1022
|
/**
|
|
1015
1023
|
* Events-related operations for managing product events (message brokers).
|
|
1016
1024
|
*/
|
|
1017
|
-
|
|
1025
|
+
messaging: {
|
|
1018
1026
|
/**
|
|
1019
1027
|
* Creates a message broker for a product.
|
|
1020
1028
|
* @param {string} product - The product tag.
|
|
1021
1029
|
* @param {Partial<IProductMessageBroker>} data - The message broker data.
|
|
1022
1030
|
* @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
|
|
1023
1031
|
*/
|
|
1024
|
-
create: (
|
|
1032
|
+
create: (data: Partial<IProductMessageBroker> & {
|
|
1033
|
+
product: string;
|
|
1034
|
+
}) => Promise<void>;
|
|
1025
1035
|
/**
|
|
1026
1036
|
* Fetches all message brokers for a product.
|
|
1027
1037
|
* @param {string} product - The product tag.
|
|
@@ -1093,25 +1103,25 @@ export default class Ductape implements IDuctape {
|
|
|
1093
1103
|
* message: { orderId: '123', status: 'pending' }
|
|
1094
1104
|
* });
|
|
1095
1105
|
*/
|
|
1096
|
-
|
|
1106
|
+
produce: (data: {
|
|
1097
1107
|
product: string;
|
|
1098
1108
|
env: string;
|
|
1099
1109
|
event: string;
|
|
1100
1110
|
message: Record<string, unknown>;
|
|
1101
1111
|
}) => Promise<import("./brokers").IPublishResult>;
|
|
1102
1112
|
/**
|
|
1103
|
-
*
|
|
1113
|
+
* consume to a message broker topic.
|
|
1104
1114
|
* @param data - The subscribe input.
|
|
1105
1115
|
* @returns The result of the subscribe operation.
|
|
1106
1116
|
* @example
|
|
1107
|
-
* await ductape.events.
|
|
1117
|
+
* await ductape.events.consume({
|
|
1108
1118
|
* product: 'my-product',
|
|
1109
1119
|
* env: 'production',
|
|
1110
1120
|
* event: 'broker-tag:topic-tag',
|
|
1111
1121
|
* callback: async (message) => console.log(message)
|
|
1112
1122
|
* });
|
|
1113
1123
|
*/
|
|
1114
|
-
|
|
1124
|
+
consume: (data: {
|
|
1115
1125
|
product: string;
|
|
1116
1126
|
env: string;
|
|
1117
1127
|
event: string;
|
|
@@ -1551,28 +1561,30 @@ export default class Ductape implements IDuctape {
|
|
|
1551
1561
|
* @param {string} [productTag] - The product tag.
|
|
1552
1562
|
* @returns {Promise<void>} Resolves when the graph is created.
|
|
1553
1563
|
*/
|
|
1554
|
-
create: (graphConfig:
|
|
1564
|
+
create: (graphConfig: IGraphConfig & {
|
|
1565
|
+
product: string;
|
|
1566
|
+
}) => Promise<void>;
|
|
1555
1567
|
/**
|
|
1556
1568
|
* Fetches a graph configuration by tag.
|
|
1557
|
-
* @param {string} graphTag - The graph tag.
|
|
1558
1569
|
* @param {string} [productTag] - The product tag.
|
|
1570
|
+
* @param {string} graphTag - The graph tag.
|
|
1559
1571
|
* @returns {Promise<any>} The fetched graph configuration.
|
|
1560
1572
|
*/
|
|
1561
|
-
fetch: (
|
|
1573
|
+
fetch: (productTag: string, graphTag: string) => Promise<IGraphConfig>;
|
|
1562
1574
|
/**
|
|
1563
1575
|
* Fetches all graph configurations for a product.
|
|
1564
1576
|
* @param {string} [productTag] - The product tag.
|
|
1565
1577
|
* @returns {Promise<any[]>} The list of graph configurations.
|
|
1566
1578
|
*/
|
|
1567
|
-
list: (productTag?: string) => Promise<
|
|
1579
|
+
list: (productTag?: string) => Promise<IGraphConfig[]>;
|
|
1568
1580
|
/**
|
|
1569
1581
|
* Updates a graph configuration by tag.
|
|
1582
|
+
* @param {string} [productTag] - The product tag.
|
|
1570
1583
|
* @param {string} graphTag - The graph tag.
|
|
1571
1584
|
* @param {any} updates - The updates to apply.
|
|
1572
|
-
* @param {string} [productTag] - The product tag.
|
|
1573
1585
|
* @returns {Promise<void>} Resolves when the graph is updated.
|
|
1574
1586
|
*/
|
|
1575
|
-
update: (
|
|
1587
|
+
update: (productTag: string, graphTag: string, updates: Partial<IGraphConfig>) => Promise<void>;
|
|
1576
1588
|
/**
|
|
1577
1589
|
* Deletes a graph configuration by tag.
|
|
1578
1590
|
* @param {string} graphTag - The graph tag.
|
|
@@ -1965,9 +1977,342 @@ export default class Ductape implements IDuctape {
|
|
|
1965
1977
|
*/
|
|
1966
1978
|
vector: {
|
|
1967
1979
|
/**
|
|
1968
|
-
* Get the underlying VectorDatabaseService instance
|
|
1980
|
+
* Get the underlying VectorDatabaseService instance for advanced operations.
|
|
1981
|
+
* @returns {Promise<VectorDatabaseService>} The vector database service instance.
|
|
1969
1982
|
*/
|
|
1970
1983
|
getService: () => Promise<VectorDatabaseService>;
|
|
1984
|
+
/**
|
|
1985
|
+
* Creates a vector database configuration for a product.
|
|
1986
|
+
* @param {ICreateVectorDbOptions} options - The vector configuration options.
|
|
1987
|
+
* @returns {Promise<void>} Resolves when the vector config is created.
|
|
1988
|
+
*/
|
|
1989
|
+
create: (options: ICreateVectorDbOptions) => Promise<void>;
|
|
1990
|
+
/**
|
|
1991
|
+
* Fetches a vector database configuration by tag.
|
|
1992
|
+
* @param {IFetchVectorOptions} options - The fetch options.
|
|
1993
|
+
* @returns {Promise<IProductVector | null>} The fetched vector configuration.
|
|
1994
|
+
*/
|
|
1995
|
+
fetch: (options: import("./vector/vector-database.service").IFetchVectorOptions) => Promise<import("./types").IProductVector>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Fetches all vector database configurations for a product.
|
|
1998
|
+
* @param {object} options - The fetch options containing product tag.
|
|
1999
|
+
* @returns {Promise<IProductVector[]>} The list of vector configurations.
|
|
2000
|
+
*/
|
|
2001
|
+
list: (options: {
|
|
2002
|
+
product: string;
|
|
2003
|
+
}) => Promise<import("./types").IProductVector[]>;
|
|
2004
|
+
/**
|
|
2005
|
+
* Updates a vector database configuration.
|
|
2006
|
+
* @param {IUpdateVectorDbOptions} options - The update options.
|
|
2007
|
+
* @returns {Promise<void>} Resolves when the vector config is updated.
|
|
2008
|
+
*/
|
|
2009
|
+
update: (options: import("./vector/vector-database.service").IUpdateVectorDbOptions) => Promise<void>;
|
|
2010
|
+
/**
|
|
2011
|
+
* Deletes a vector database configuration.
|
|
2012
|
+
* @param {IDeleteVectorConfigOptions} options - The delete options.
|
|
2013
|
+
* @returns {Promise<void>} Resolves when the vector config is deleted.
|
|
2014
|
+
*/
|
|
2015
|
+
delete: (options: import("./vector/vector-database.service").IDeleteVectorConfigOptions) => Promise<void>;
|
|
2016
|
+
/**
|
|
2017
|
+
* Connects to a vector database.
|
|
2018
|
+
* @param {object} options - Connection options with product, env, and vector.
|
|
2019
|
+
* @returns {Promise<VectorService>} The connected vector service.
|
|
2020
|
+
*/
|
|
2021
|
+
connect: (options: {
|
|
2022
|
+
product: string;
|
|
2023
|
+
env: string;
|
|
2024
|
+
vector: string;
|
|
2025
|
+
}) => Promise<import("./vector").VectorService>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Disconnects from a specific vector database.
|
|
2028
|
+
* @param {object} options - Disconnect options with product, env, and vector.
|
|
2029
|
+
* @returns {Promise<void>} Resolves when disconnected.
|
|
2030
|
+
*/
|
|
2031
|
+
disconnect: (options: {
|
|
2032
|
+
product: string;
|
|
2033
|
+
env: string;
|
|
2034
|
+
vector: string;
|
|
2035
|
+
}) => Promise<void>;
|
|
2036
|
+
/**
|
|
2037
|
+
* Disconnects all cached vector database connections.
|
|
2038
|
+
* @returns {Promise<void>} Resolves when all connections are closed.
|
|
2039
|
+
*/
|
|
2040
|
+
disconnectAll: () => Promise<void>;
|
|
2041
|
+
/**
|
|
2042
|
+
* Query vectors by similarity.
|
|
2043
|
+
* @param {IProductVectorQueryOptions} options - The query options.
|
|
2044
|
+
* @returns {Promise<IQueryVectorsResult>} The query results.
|
|
2045
|
+
*/
|
|
2046
|
+
query: (options: import("./vector/vector-database.service").IProductVectorQueryOptions) => Promise<import("./vector").IQueryVectorsResult>;
|
|
2047
|
+
/**
|
|
2048
|
+
* Upsert vectors (insert or update).
|
|
2049
|
+
* @param {IProductVectorUpsertOptions} options - The upsert options.
|
|
2050
|
+
* @returns {Promise<IUpsertVectorsResult>} The upsert result.
|
|
2051
|
+
*/
|
|
2052
|
+
upsert: (options: import("./vector/vector-database.service").IProductVectorUpsertOptions) => Promise<import("./vector").IUpsertVectorsResult>;
|
|
2053
|
+
/**
|
|
2054
|
+
* Fetch vectors by IDs.
|
|
2055
|
+
* @param {IProductVectorFetchOptions} options - The fetch options.
|
|
2056
|
+
* @returns {Promise<IFetchVectorsResult>} The fetched vectors.
|
|
2057
|
+
*/
|
|
2058
|
+
fetchVectors: (options: import("./vector/vector-database.service").IProductVectorFetchOptions) => Promise<import("./vector").IFetchVectorsResult>;
|
|
2059
|
+
/**
|
|
2060
|
+
* Delete vectors by IDs.
|
|
2061
|
+
* @param {IProductVectorDeleteOptions} options - The delete options.
|
|
2062
|
+
* @returns {Promise<IDeleteVectorsResult>} The delete result.
|
|
2063
|
+
*/
|
|
2064
|
+
deleteVectors: (options: import("./vector/vector-database.service").IProductVectorDeleteOptions) => Promise<import("./vector").IDeleteVectorsResult>;
|
|
2065
|
+
/**
|
|
2066
|
+
* Find similar vectors to a given vector.
|
|
2067
|
+
* @param {object} options - Find similar options with product, env, tag, vector, and topK.
|
|
2068
|
+
* @returns {Promise<IQueryVectorsResult>} The similar vectors.
|
|
2069
|
+
*/
|
|
2070
|
+
findSimilar: (options: {
|
|
2071
|
+
product: string;
|
|
2072
|
+
env: string;
|
|
2073
|
+
vector: string;
|
|
2074
|
+
values: number[];
|
|
2075
|
+
topK?: number;
|
|
2076
|
+
filter?: any;
|
|
2077
|
+
namespace?: string;
|
|
2078
|
+
includeValues?: boolean;
|
|
2079
|
+
includeMetadata?: boolean;
|
|
2080
|
+
}) => Promise<import("./vector").IQueryVectorsResult>;
|
|
2081
|
+
/**
|
|
2082
|
+
* Upsert a single vector.
|
|
2083
|
+
* @param {object} options - Single vector upsert options.
|
|
2084
|
+
* @returns {Promise<IUpsertVectorsResult>} The upsert result.
|
|
2085
|
+
*/
|
|
2086
|
+
upsertOne: (options: {
|
|
2087
|
+
product: string;
|
|
2088
|
+
env: string;
|
|
2089
|
+
tag: string;
|
|
2090
|
+
id: string;
|
|
2091
|
+
values: number[];
|
|
2092
|
+
metadata?: Record<string, unknown>;
|
|
2093
|
+
namespace?: string;
|
|
2094
|
+
}) => Promise<import("./vector").IUpsertVectorsResult>;
|
|
2095
|
+
/**
|
|
2096
|
+
* Fetch a single vector by ID.
|
|
2097
|
+
* @param {object} options - Single vector fetch options.
|
|
2098
|
+
* @returns {Promise<IVector | null>} The fetched vector or null.
|
|
2099
|
+
*/
|
|
2100
|
+
fetchOne: (options: {
|
|
2101
|
+
product: string;
|
|
2102
|
+
env: string;
|
|
2103
|
+
vector: string;
|
|
2104
|
+
id: string;
|
|
2105
|
+
namespace?: string;
|
|
2106
|
+
}) => Promise<import("./vector").IVector>;
|
|
2107
|
+
/**
|
|
2108
|
+
* Update a single vector.
|
|
2109
|
+
* @param {object} options - Update options.
|
|
2110
|
+
* @returns {Promise<IUpdateVectorResult>} The update result.
|
|
2111
|
+
*/
|
|
2112
|
+
updateVector: (options: {
|
|
2113
|
+
product: string;
|
|
2114
|
+
env: string;
|
|
2115
|
+
vector: string;
|
|
2116
|
+
id: string;
|
|
2117
|
+
values?: number[];
|
|
2118
|
+
setMetadata?: Record<string, unknown>;
|
|
2119
|
+
mergeMetadata?: Record<string, unknown>;
|
|
2120
|
+
namespace?: string;
|
|
2121
|
+
}) => Promise<import("./vector").IUpdateVectorResult>;
|
|
2122
|
+
/**
|
|
2123
|
+
* Update vector metadata.
|
|
2124
|
+
* @param {object} options - Update metadata options.
|
|
2125
|
+
* @returns {Promise<IUpdateVectorResult>} The update result.
|
|
2126
|
+
*/
|
|
2127
|
+
updateMetadata: (options: {
|
|
2128
|
+
product: string;
|
|
2129
|
+
env: string;
|
|
2130
|
+
vector: string;
|
|
2131
|
+
id: string;
|
|
2132
|
+
metadata: Record<string, unknown>;
|
|
2133
|
+
merge?: boolean;
|
|
2134
|
+
namespace?: string;
|
|
2135
|
+
}) => Promise<import("./vector").IUpdateVectorResult>;
|
|
2136
|
+
/**
|
|
2137
|
+
* Delete vectors by IDs (convenience method).
|
|
2138
|
+
* @param {object} options - Delete by IDs options.
|
|
2139
|
+
* @returns {Promise<IDeleteVectorsResult>} The delete result.
|
|
2140
|
+
*/
|
|
2141
|
+
deleteByIds: (options: {
|
|
2142
|
+
product: string;
|
|
2143
|
+
env: string;
|
|
2144
|
+
vector: string;
|
|
2145
|
+
ids: string[];
|
|
2146
|
+
namespace?: string;
|
|
2147
|
+
}) => Promise<import("./vector").IDeleteVectorsResult>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Delete all vectors in a namespace.
|
|
2150
|
+
* @param {object} options - Delete all options.
|
|
2151
|
+
* @returns {Promise<IDeleteVectorsResult>} The delete result.
|
|
2152
|
+
*/
|
|
2153
|
+
deleteAll: (options: {
|
|
2154
|
+
product: string;
|
|
2155
|
+
env: string;
|
|
2156
|
+
vector: string;
|
|
2157
|
+
namespace?: string;
|
|
2158
|
+
}) => Promise<import("./vector").IDeleteVectorsResult>;
|
|
2159
|
+
/**
|
|
2160
|
+
* List vector IDs.
|
|
2161
|
+
* @param {object} options - List options.
|
|
2162
|
+
* @returns {Promise<IListVectorsResult>} The list result.
|
|
2163
|
+
*/
|
|
2164
|
+
listVectors: (options: {
|
|
2165
|
+
product: string;
|
|
2166
|
+
env: string;
|
|
2167
|
+
vector: string;
|
|
2168
|
+
namespace?: string;
|
|
2169
|
+
prefix?: string;
|
|
2170
|
+
limit?: number;
|
|
2171
|
+
cursor?: string;
|
|
2172
|
+
}) => Promise<import("./vector").IListVectorsResult>;
|
|
2173
|
+
/**
|
|
2174
|
+
* List all vector IDs (paginated).
|
|
2175
|
+
* @param {object} options - List all options.
|
|
2176
|
+
* @returns {Promise<string[]>} All vector IDs.
|
|
2177
|
+
*/
|
|
2178
|
+
listAllVectors: (options: {
|
|
2179
|
+
product: string;
|
|
2180
|
+
env: string;
|
|
2181
|
+
vector: string;
|
|
2182
|
+
namespace?: string;
|
|
2183
|
+
prefix?: string;
|
|
2184
|
+
}) => Promise<string[]>;
|
|
2185
|
+
/**
|
|
2186
|
+
* List available namespaces.
|
|
2187
|
+
* @param {object} options - Namespace list options.
|
|
2188
|
+
* @returns {Promise<IListNamespacesResult>} The namespaces.
|
|
2189
|
+
*/
|
|
2190
|
+
listNamespaces: (options: {
|
|
2191
|
+
product: string;
|
|
2192
|
+
env: string;
|
|
2193
|
+
vector: string;
|
|
2194
|
+
}) => Promise<import("./vector").IListNamespacesResult>;
|
|
2195
|
+
/**
|
|
2196
|
+
* Delete a namespace.
|
|
2197
|
+
* @param {object} options - Namespace delete options.
|
|
2198
|
+
* @returns {Promise<void>} Resolves when deleted.
|
|
2199
|
+
*/
|
|
2200
|
+
deleteNamespace: (options: {
|
|
2201
|
+
product: string;
|
|
2202
|
+
env: string;
|
|
2203
|
+
vector: string;
|
|
2204
|
+
namespace: string;
|
|
2205
|
+
}) => Promise<void>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Describe the current index.
|
|
2208
|
+
* @param {object} options - Index describe options.
|
|
2209
|
+
* @returns {Promise<IVectorIndexInfo>} The index info.
|
|
2210
|
+
*/
|
|
2211
|
+
describeIndex: (options: {
|
|
2212
|
+
product: string;
|
|
2213
|
+
env: string;
|
|
2214
|
+
vector: string;
|
|
2215
|
+
}) => Promise<import("./vector").IVectorIndexInfo>;
|
|
2216
|
+
/**
|
|
2217
|
+
* Get index statistics.
|
|
2218
|
+
* @param {object} options - Stats options.
|
|
2219
|
+
* @returns {Promise<IVectorIndexStats>} The index stats.
|
|
2220
|
+
*/
|
|
2221
|
+
getStats: (options: {
|
|
2222
|
+
product: string;
|
|
2223
|
+
env: string;
|
|
2224
|
+
vector: string;
|
|
2225
|
+
}) => Promise<import("./vector").IVectorIndexStats>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Create a new index.
|
|
2228
|
+
* @param {object} options - Create index options.
|
|
2229
|
+
* @returns {Promise<ICreateIndexResult>} The create result.
|
|
2230
|
+
*/
|
|
2231
|
+
createIndex: (options: {
|
|
2232
|
+
product: string;
|
|
2233
|
+
env: string;
|
|
2234
|
+
vector: string;
|
|
2235
|
+
name: string;
|
|
2236
|
+
dimensions: number;
|
|
2237
|
+
metric?: import("./vector").DistanceMetric;
|
|
2238
|
+
replicas?: number;
|
|
2239
|
+
shards?: number;
|
|
2240
|
+
}) => Promise<import("./vector").ICreateIndexResult>;
|
|
2241
|
+
/**
|
|
2242
|
+
* Delete an index.
|
|
2243
|
+
* @param {object} options - Delete index options.
|
|
2244
|
+
* @returns {Promise<IDeleteIndexResult>} The delete result.
|
|
2245
|
+
*/
|
|
2246
|
+
deleteIndex: (options: {
|
|
2247
|
+
product: string;
|
|
2248
|
+
env: string;
|
|
2249
|
+
vector: string;
|
|
2250
|
+
name: string;
|
|
2251
|
+
}) => Promise<import("./vector").IDeleteIndexResult>;
|
|
2252
|
+
/**
|
|
2253
|
+
* List all indexes.
|
|
2254
|
+
* @param {object} options - List indexes options.
|
|
2255
|
+
* @returns {Promise<IVectorIndexInfo[]>} The list of indexes.
|
|
2256
|
+
*/
|
|
2257
|
+
listIndexes: (options: {
|
|
2258
|
+
product: string;
|
|
2259
|
+
env: string;
|
|
2260
|
+
vector: string;
|
|
2261
|
+
}) => Promise<import("./vector").IVectorIndexInfo[]>;
|
|
2262
|
+
/**
|
|
2263
|
+
* Count vectors in the index.
|
|
2264
|
+
* @param {object} options - Count options.
|
|
2265
|
+
* @returns {Promise<number>} The vector count.
|
|
2266
|
+
*/
|
|
2267
|
+
count: (options: {
|
|
2268
|
+
product: string;
|
|
2269
|
+
env: string;
|
|
2270
|
+
vector: string;
|
|
2271
|
+
namespace?: string;
|
|
2272
|
+
}) => Promise<number>;
|
|
2273
|
+
/**
|
|
2274
|
+
* Check if a vector exists.
|
|
2275
|
+
* @param {object} options - Exists check options.
|
|
2276
|
+
* @returns {Promise<boolean>} True if exists.
|
|
2277
|
+
*/
|
|
2278
|
+
exists: (options: {
|
|
2279
|
+
product: string;
|
|
2280
|
+
env: string;
|
|
2281
|
+
vector: string;
|
|
2282
|
+
id: string;
|
|
2283
|
+
namespace?: string;
|
|
2284
|
+
}) => Promise<boolean>;
|
|
2285
|
+
/**
|
|
2286
|
+
* Test connection to a vector database.
|
|
2287
|
+
* @param {object} options - Test connection options.
|
|
2288
|
+
* @returns {Promise<boolean>} True if connection is healthy.
|
|
2289
|
+
*/
|
|
2290
|
+
testConnection: (options: {
|
|
2291
|
+
product: string;
|
|
2292
|
+
env: string;
|
|
2293
|
+
vector: string;
|
|
2294
|
+
}) => Promise<boolean>;
|
|
2295
|
+
/**
|
|
2296
|
+
* Check if a feature is supported.
|
|
2297
|
+
* @param {object} options - Feature check options.
|
|
2298
|
+
* @returns {Promise<boolean>} True if supported.
|
|
2299
|
+
*/
|
|
2300
|
+
supportsFeature: (options: {
|
|
2301
|
+
product: string;
|
|
2302
|
+
env: string;
|
|
2303
|
+
vector: string;
|
|
2304
|
+
feature: import("./vector").VectorFeature;
|
|
2305
|
+
}) => Promise<boolean>;
|
|
2306
|
+
/**
|
|
2307
|
+
* Get all supported features.
|
|
2308
|
+
* @param {object} options - Get features options.
|
|
2309
|
+
* @returns {Promise<VectorFeature[]>} The supported features.
|
|
2310
|
+
*/
|
|
2311
|
+
getSupportedFeatures: (options: {
|
|
2312
|
+
product: string;
|
|
2313
|
+
env: string;
|
|
2314
|
+
vector: string;
|
|
2315
|
+
}) => Promise<import("./vector").VectorFeature[]>;
|
|
1971
2316
|
};
|
|
1972
2317
|
/**
|
|
1973
2318
|
* Job-related operations for managing product jobs.
|
|
@@ -2212,7 +2557,7 @@ export default class Ductape implements IDuctape {
|
|
|
2212
2557
|
* const secrets = await ductape.secrets.fetchAll();
|
|
2213
2558
|
* secrets.forEach(s => console.log(s.key, s.description));
|
|
2214
2559
|
*/
|
|
2215
|
-
|
|
2560
|
+
list: () => Promise<ISecretMetadata[]>;
|
|
2216
2561
|
/**
|
|
2217
2562
|
* Fetch a single secret with its decrypted value
|
|
2218
2563
|
* @param key - The secret key
|
|
@@ -2307,7 +2652,9 @@ export default class Ductape implements IDuctape {
|
|
|
2307
2652
|
* @param {IProductCache} data - The cache data.
|
|
2308
2653
|
* @returns {Promise<void>} Resolves when the cache is created. Throws on error.
|
|
2309
2654
|
*/
|
|
2310
|
-
create: (
|
|
2655
|
+
create: (data: IProductCache & {
|
|
2656
|
+
product: string;
|
|
2657
|
+
}) => Promise<void>;
|
|
2311
2658
|
/**
|
|
2312
2659
|
* Fetches all caches for a product.
|
|
2313
2660
|
* @param {string} product - The product tag.
|