@ductape/sdk 0.0.4-v6 → 0.0.4-v61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent-context.d.ts +98 -0
- package/dist/agents/agent-context.js +588 -0
- package/dist/agents/agent-context.js.map +1 -0
- package/dist/agents/agent-executor.d.ts +180 -0
- package/dist/agents/agent-executor.js +715 -0
- package/dist/agents/agent-executor.js.map +1 -0
- package/dist/agents/agents.service.d.ts +310 -0
- package/dist/agents/agents.service.js +1249 -0
- package/dist/agents/agents.service.js.map +1 -0
- package/dist/agents/index.d.ts +55 -0
- package/dist/agents/index.js +110 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/memory-manager.d.ts +182 -0
- package/dist/agents/memory-manager.js +383 -0
- package/dist/agents/memory-manager.js.map +1 -0
- package/dist/agents/tool-registry.d.ts +141 -0
- package/dist/agents/tool-registry.js +355 -0
- package/dist/agents/tool-registry.js.map +1 -0
- package/dist/agents/types/agents.types.d.ts +1227 -0
- package/dist/agents/types/agents.types.js +12 -0
- package/dist/agents/types/agents.types.js.map +1 -0
- package/dist/agents/types/index.d.ts +6 -0
- package/dist/agents/types/index.js +23 -0
- package/dist/agents/types/index.js.map +1 -0
- package/dist/agents/vector-store-adapter.d.ts +108 -0
- package/dist/agents/vector-store-adapter.js +213 -0
- package/dist/agents/vector-store-adapter.js.map +1 -0
- package/dist/api/services/appApi.service.d.ts +51 -5
- package/dist/api/services/appApi.service.js +101 -3
- 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 +334 -2
- package/dist/api/services/processorApi.service.js +264 -2
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +108 -1
- package/dist/api/services/productsApi.service.js +150 -3
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/resilienceApi.service.d.ts +106 -0
- package/dist/api/services/resilienceApi.service.js +224 -0
- package/dist/api/services/resilienceApi.service.js.map +1 -0
- package/dist/api/services/secretsApi.service.d.ts +50 -0
- package/dist/api/services/secretsApi.service.js +124 -0
- package/dist/api/services/secretsApi.service.js.map +1 -0
- package/dist/api/services/workflowApi.service.d.ts +199 -0
- package/dist/api/services/workflowApi.service.js +183 -0
- package/dist/api/services/workflowApi.service.js.map +1 -0
- package/dist/api/services/workspaceApi.service.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 +65 -1
- package/dist/api/urls.js +90 -18
- 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/api/utils/cache.utils.d.ts +1 -1
- package/dist/api/utils/cache.utils.js +2 -2
- 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 +41 -33
- package/dist/apps/services/app.service.js +472 -184
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/utils/auth-context-manager.d.ts +137 -0
- package/dist/apps/utils/auth-context-manager.js +248 -0
- package/dist/apps/utils/auth-context-manager.js.map +1 -0
- package/dist/apps/utils/credential-manager.d.ts +128 -0
- package/dist/apps/utils/credential-manager.js +199 -0
- package/dist/apps/utils/credential-manager.js.map +1 -0
- package/dist/apps/utils/index.d.ts +10 -0
- package/dist/apps/utils/index.js +54 -0
- package/dist/apps/utils/index.js.map +1 -0
- package/dist/apps/utils/input-helpers.d.ts +67 -0
- package/dist/apps/utils/input-helpers.js +185 -0
- package/dist/apps/utils/input-helpers.js.map +1 -0
- package/dist/apps/utils/input-resolver.d.ts +165 -0
- package/dist/apps/utils/input-resolver.js +477 -0
- package/dist/apps/utils/input-resolver.js.map +1 -0
- package/dist/apps/utils/oauth-manager.d.ts +196 -0
- package/dist/apps/utils/oauth-manager.js +429 -0
- package/dist/apps/utils/oauth-manager.js.map +1 -0
- 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/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/bin.d.ts +26 -0
- package/dist/bin.js +28 -0
- package/dist/bin.js.map +1 -0
- package/dist/brokers/brokers.service.d.ts +289 -0
- package/dist/brokers/brokers.service.js +722 -0
- package/dist/brokers/brokers.service.js.map +1 -0
- package/dist/brokers/index.d.ts +46 -0
- package/dist/brokers/index.js +83 -0
- package/dist/brokers/index.js.map +1 -0
- package/dist/brokers/types/index.d.ts +314 -0
- package/dist/brokers/types/index.js +8 -0
- package/dist/brokers/types/index.js.map +1 -0
- package/dist/brokers/utils/broker.util.d.ts +33 -0
- package/dist/brokers/utils/broker.util.js +125 -0
- package/dist/brokers/utils/broker.util.js.map +1 -0
- package/dist/brokers/utils/providers/aws-sqs.service.d.ts +16 -0
- package/dist/brokers/utils/providers/aws-sqs.service.js +71 -0
- package/dist/brokers/utils/providers/aws-sqs.service.js.map +1 -0
- package/dist/brokers/utils/providers/google-pubsub.service.d.ts +16 -0
- package/dist/brokers/utils/providers/google-pubsub.service.js +43 -0
- package/dist/brokers/utils/providers/google-pubsub.service.js.map +1 -0
- package/dist/brokers/utils/providers/index.d.ts +6 -0
- package/dist/brokers/utils/providers/index.js +16 -0
- package/dist/brokers/utils/providers/index.js.map +1 -0
- package/dist/brokers/utils/providers/kafka.service.d.ts +23 -0
- package/dist/brokers/utils/providers/kafka.service.js +131 -0
- package/dist/brokers/utils/providers/kafka.service.js.map +1 -0
- package/dist/brokers/utils/providers/nats.service.d.ts +18 -0
- package/dist/brokers/utils/providers/nats.service.js +63 -0
- package/dist/brokers/utils/providers/nats.service.js.map +1 -0
- package/dist/brokers/utils/providers/rabbitmq.service.d.ts +15 -0
- package/dist/brokers/utils/providers/rabbitmq.service.js +151 -0
- package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -0
- package/dist/brokers/utils/providers/redis.service.d.ts +18 -0
- package/dist/brokers/utils/providers/redis.service.js +93 -0
- package/dist/brokers/utils/providers/redis.service.js.map +1 -0
- package/dist/cache/cache.manager.d.ts +159 -0
- package/dist/cache/cache.manager.js +265 -0
- package/dist/cache/cache.manager.js.map +1 -0
- package/dist/cache/cache.service.d.ts +186 -0
- package/dist/cache/cache.service.js +437 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cache/index.d.ts +52 -0
- package/dist/cache/index.js +79 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/types/index.d.ts +106 -0
- package/dist/cache/types/index.js +6 -0
- package/dist/cache/types/index.js.map +1 -0
- package/dist/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/actions/action-manager.d.ts +170 -0
- package/dist/database/actions/action-manager.js +465 -0
- package/dist/database/actions/action-manager.js.map +1 -0
- package/dist/database/actions/index.d.ts +6 -0
- package/dist/database/actions/index.js +13 -0
- package/dist/database/actions/index.js.map +1 -0
- package/dist/database/adapters/adapter.factory.d.ts +62 -0
- package/dist/database/adapters/adapter.factory.js +97 -0
- package/dist/database/adapters/adapter.factory.js.map +1 -0
- package/dist/database/adapters/base.adapter.d.ts +393 -0
- package/dist/database/adapters/base.adapter.js +150 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/cassandra.adapter.d.ts +91 -0
- package/dist/database/adapters/cassandra.adapter.js +1075 -0
- package/dist/database/adapters/cassandra.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +109 -0
- package/dist/database/adapters/dynamodb.adapter.js +1534 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/index.d.ts +11 -0
- package/dist/database/adapters/index.js +27 -0
- package/dist/database/adapters/index.js.map +1 -0
- package/dist/database/adapters/mariadb.adapter.d.ts +100 -0
- package/dist/database/adapters/mariadb.adapter.js +247 -0
- package/dist/database/adapters/mariadb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +120 -0
- package/dist/database/adapters/mongodb.adapter.js +1253 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +85 -0
- package/dist/database/adapters/mysql.adapter.js +1313 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +88 -0
- package/dist/database/adapters/postgresql.adapter.js +1434 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/databases.service.d.ts +1388 -0
- package/dist/database/databases.service.js +2821 -0
- package/dist/database/databases.service.js.map +1 -0
- package/dist/database/index.d.ts +46 -0
- package/dist/database/index.js +109 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/migrations/index.d.ts +6 -0
- package/dist/database/migrations/index.js +12 -0
- package/dist/database/migrations/index.js.map +1 -0
- package/dist/database/migrations/migration-engine.d.ts +132 -0
- package/dist/database/migrations/migration-engine.js +1356 -0
- package/dist/database/migrations/migration-engine.js.map +1 -0
- package/dist/database/operators/aggregation-builder.d.ts +67 -0
- package/dist/database/operators/aggregation-builder.js +841 -0
- package/dist/database/operators/aggregation-builder.js.map +1 -0
- package/dist/database/operators/index.d.ts +7 -0
- package/dist/database/operators/index.js +15 -0
- package/dist/database/operators/index.js.map +1 -0
- package/dist/database/operators/query-builder.d.ts +59 -0
- package/dist/database/operators/query-builder.js +397 -0
- package/dist/database/operators/query-builder.js.map +1 -0
- package/dist/database/presave/decrypt.d.ts +25 -0
- package/dist/database/presave/decrypt.js +146 -0
- package/dist/database/presave/decrypt.js.map +1 -0
- package/dist/database/presave/index.d.ts +9 -0
- package/dist/database/presave/index.js +18 -0
- package/dist/database/presave/index.js.map +1 -0
- package/dist/database/presave/presave-processor.d.ts +148 -0
- package/dist/database/presave/presave-processor.js +702 -0
- package/dist/database/presave/presave-processor.js.map +1 -0
- package/dist/database/schema/index.d.ts +7 -0
- package/dist/database/schema/index.js +13 -0
- package/dist/database/schema/index.js.map +1 -0
- package/dist/database/schema/schema-manager.d.ts +258 -0
- package/dist/database/schema/schema-manager.js +637 -0
- package/dist/database/schema/schema-manager.js.map +1 -0
- package/dist/database/transactions/index.d.ts +6 -0
- package/dist/database/transactions/index.js +13 -0
- package/dist/database/transactions/index.js.map +1 -0
- package/dist/database/transactions/transaction-manager.d.ts +113 -0
- package/dist/database/transactions/transaction-manager.js +344 -0
- package/dist/database/transactions/transaction-manager.js.map +1 -0
- package/dist/database/triggers/index.d.ts +7 -0
- package/dist/database/triggers/index.js +14 -0
- package/dist/database/triggers/index.js.map +1 -0
- package/dist/database/triggers/trigger-processor.d.ts +239 -0
- package/dist/database/triggers/trigger-processor.js +1034 -0
- package/dist/database/triggers/trigger-processor.js.map +1 -0
- package/dist/database/types/action.interface.d.ts +148 -0
- package/dist/database/types/action.interface.js +6 -0
- package/dist/database/types/action.interface.js.map +1 -0
- package/dist/database/types/aggregation.interface.d.ts +185 -0
- package/dist/database/types/aggregation.interface.js +6 -0
- package/dist/database/types/aggregation.interface.js.map +1 -0
- package/dist/database/types/connection.interface.d.ts +137 -0
- package/dist/database/types/connection.interface.js +6 -0
- package/dist/database/types/connection.interface.js.map +1 -0
- package/dist/database/types/enums.d.ts +195 -0
- package/dist/database/types/enums.js +244 -0
- package/dist/database/types/enums.js.map +1 -0
- package/dist/database/types/index.d.ts +14 -0
- package/dist/database/types/index.js +31 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/migration.interface.d.ts +686 -0
- package/dist/database/types/migration.interface.js +9 -0
- package/dist/database/types/migration.interface.js.map +1 -0
- package/dist/database/types/presave.interface.d.ts +292 -0
- package/dist/database/types/presave.interface.js +60 -0
- package/dist/database/types/presave.interface.js.map +1 -0
- package/dist/database/types/query.interface.d.ts +205 -0
- package/dist/database/types/query.interface.js +6 -0
- package/dist/database/types/query.interface.js.map +1 -0
- package/dist/database/types/schema.interface.d.ts +398 -0
- package/dist/database/types/schema.interface.js +6 -0
- package/dist/database/types/schema.interface.js.map +1 -0
- package/dist/database/types/transaction.interface.d.ts +84 -0
- package/dist/database/types/transaction.interface.js +6 -0
- package/dist/database/types/transaction.interface.js.map +1 -0
- package/dist/database/types/trigger.interface.d.ts +612 -0
- package/dist/database/types/trigger.interface.js +121 -0
- package/dist/database/types/trigger.interface.js.map +1 -0
- package/dist/database/types/write.interface.d.ts +216 -0
- package/dist/database/types/write.interface.js +6 -0
- package/dist/database/types/write.interface.js.map +1 -0
- package/dist/database/utils/database-error.d.ts +96 -0
- package/dist/database/utils/database-error.js +221 -0
- package/dist/database/utils/database-error.js.map +1 -0
- package/dist/database/utils/index.d.ts +6 -0
- package/dist/database/utils/index.js +11 -0
- package/dist/database/utils/index.js.map +1 -0
- package/dist/graph/adapters/adapter.factory.d.ts +47 -0
- package/dist/graph/adapters/adapter.factory.js +77 -0
- package/dist/graph/adapters/adapter.factory.js.map +1 -0
- package/dist/graph/adapters/arangodb.adapter.d.ts +86 -0
- package/dist/graph/adapters/arangodb.adapter.js +1522 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +245 -0
- package/dist/graph/adapters/base.adapter.js +64 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +11 -0
- package/dist/graph/adapters/index.js +21 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +110 -0
- package/dist/graph/adapters/memgraph.adapter.js +1345 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +81 -0
- package/dist/graph/adapters/neo4j.adapter.js +1198 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +82 -0
- package/dist/graph/adapters/neptune.adapter.js +1313 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graphs.service.d.ts +546 -0
- package/dist/graph/graphs.service.js +1893 -0
- package/dist/graph/graphs.service.js.map +1 -0
- package/dist/graph/index.d.ts +57 -0
- package/dist/graph/index.js +77 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/transactions/index.d.ts +4 -0
- package/dist/graph/transactions/index.js +9 -0
- package/dist/graph/transactions/index.js.map +1 -0
- package/dist/graph/transactions/transaction-manager.d.ts +61 -0
- package/dist/graph/transactions/transaction-manager.js +126 -0
- package/dist/graph/transactions/transaction-manager.js.map +1 -0
- package/dist/graph/types/connection.interface.d.ts +149 -0
- package/dist/graph/types/connection.interface.js +9 -0
- package/dist/graph/types/connection.interface.js.map +1 -0
- package/dist/graph/types/enums.d.ts +101 -0
- package/dist/graph/types/enums.js +114 -0
- package/dist/graph/types/enums.js.map +1 -0
- package/dist/graph/types/index.d.ts +13 -0
- package/dist/graph/types/index.js +20 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.interface.d.ts +248 -0
- package/dist/graph/types/node.interface.js +9 -0
- package/dist/graph/types/node.interface.js.map +1 -0
- package/dist/graph/types/query.interface.d.ts +175 -0
- package/dist/graph/types/query.interface.js +9 -0
- package/dist/graph/types/query.interface.js.map +1 -0
- package/dist/graph/types/relationship.interface.d.ts +207 -0
- package/dist/graph/types/relationship.interface.js +9 -0
- package/dist/graph/types/relationship.interface.js.map +1 -0
- package/dist/graph/types/schema.interface.d.ts +295 -0
- package/dist/graph/types/schema.interface.js +9 -0
- package/dist/graph/types/schema.interface.js.map +1 -0
- package/dist/graph/types/transaction.interface.d.ts +55 -0
- package/dist/graph/types/transaction.interface.js +9 -0
- package/dist/graph/types/transaction.interface.js.map +1 -0
- package/dist/graph/types/traversal.interface.d.ts +181 -0
- package/dist/graph/types/traversal.interface.js +9 -0
- package/dist/graph/types/traversal.interface.js.map +1 -0
- package/dist/graph/utils/graph-error.d.ts +71 -0
- package/dist/graph/utils/graph-error.js +142 -0
- package/dist/graph/utils/graph-error.js.map +1 -0
- package/dist/graph/utils/index.d.ts +4 -0
- package/dist/graph/utils/index.js +9 -0
- package/dist/graph/utils/index.js.map +1 -0
- package/dist/imports/imports.service.d.ts +3 -3
- package/dist/imports/imports.service.js +8 -7
- package/dist/imports/imports.service.js.map +1 -1
- package/dist/imports/imports.types.d.ts +8 -0
- package/dist/imports/repos/openApi.repo.d.ts +1 -1
- package/dist/imports/repos/openApi.repo.js +414 -47
- package/dist/imports/repos/openApi.repo.js.map +1 -1
- package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
- package/dist/imports/repos/postmanV21.repo.js +126 -83
- package/dist/imports/repos/postmanV21.repo.js.map +1 -1
- package/dist/index.d.ts +3241 -285
- package/dist/index.js +4711 -687
- package/dist/index.js.map +1 -1
- package/dist/init.interface.d.ts +407 -0
- package/dist/init.interface.js +3 -0
- package/dist/init.interface.js.map +1 -0
- package/dist/inputs/inputs.service.d.ts +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/jobs/index.d.ts +38 -0
- package/dist/jobs/index.js +50 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/jobs.service.d.ts +154 -0
- package/dist/jobs/jobs.service.js +491 -0
- package/dist/jobs/jobs.service.js.map +1 -0
- package/dist/jobs/jobs.state.d.ts +113 -0
- package/dist/jobs/jobs.state.js +447 -0
- package/dist/jobs/jobs.state.js.map +1 -0
- package/dist/jobs/types.d.ts +449 -0
- package/dist/jobs/types.js +74 -0
- package/dist/jobs/types.js.map +1 -0
- package/dist/logs/logs.types.d.ts +16 -1
- package/dist/logs/logs.types.js +5 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/models.service.d.ts +137 -0
- package/dist/models/models.service.js +195 -0
- package/dist/models/models.service.js.map +1 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.js +26 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/notifications.service.d.ts +257 -0
- package/dist/notifications/notifications.service.js +656 -0
- package/dist/notifications/notifications.service.js.map +1 -0
- package/dist/notifications/types/index.d.ts +4 -0
- package/dist/notifications/types/index.js +21 -0
- package/dist/notifications/types/index.js.map +1 -0
- package/dist/notifications/types/notifications.types.d.ts +400 -0
- package/dist/notifications/types/notifications.types.js +49 -0
- package/dist/notifications/types/notifications.types.js.map +1 -0
- package/dist/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.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/services/processor.service.d.ts +120 -73
- package/dist/processor/services/processor.service.js +1705 -1294
- 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 +87 -21
- 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 +330 -77
- package/dist/products/services/products.service.js +2586 -397
- package/dist/products/services/products.service.js.map +1 -1
- 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 +7 -1
- package/dist/products/validators/index.js +16 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +266 -0
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +5 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.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.js +89 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +81 -25
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productModel.validator.js +132 -0
- package/dist/products/validators/joi-validators/create.productModel.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +133 -45
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +77 -18
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js +135 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.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.productDatabase.validator.js +5 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.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.js +88 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/resilience/fallback.service.d.ts +140 -0
- package/dist/resilience/fallback.service.js +764 -0
- package/dist/resilience/fallback.service.js.map +1 -0
- package/dist/resilience/healthcheck.service.d.ts +159 -0
- package/dist/resilience/healthcheck.service.js +943 -0
- package/dist/resilience/healthcheck.service.js.map +1 -0
- package/dist/resilience/index.d.ts +104 -0
- package/dist/resilience/index.js +140 -0
- package/dist/resilience/index.js.map +1 -0
- package/dist/resilience/quota.service.d.ts +82 -0
- package/dist/resilience/quota.service.js +516 -0
- package/dist/resilience/quota.service.js.map +1 -0
- package/dist/resilience/resilience.service.d.ts +98 -0
- package/dist/resilience/resilience.service.js +560 -0
- package/dist/resilience/resilience.service.js.map +1 -0
- package/dist/resilience/types/index.d.ts +513 -0
- package/dist/resilience/types/index.js +29 -0
- package/dist/resilience/types/index.js.map +1 -0
- package/dist/secrets/index.d.ts +10 -0
- package/dist/secrets/index.js +33 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/secrets/secrets.resolver.d.ts +52 -0
- package/dist/secrets/secrets.resolver.js +233 -0
- package/dist/secrets/secrets.resolver.js.map +1 -0
- package/dist/secrets/secrets.service.d.ts +93 -0
- package/dist/secrets/secrets.service.js +258 -0
- package/dist/secrets/secrets.service.js.map +1 -0
- package/dist/secrets/secrets.types.d.ts +188 -0
- package/dist/secrets/secrets.types.js +87 -0
- package/dist/secrets/secrets.types.js.map +1 -0
- package/dist/sessions/index.d.ts +50 -0
- package/dist/sessions/index.js +93 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/sessions/sessions.helper.d.ts +68 -0
- package/dist/sessions/sessions.helper.js +116 -0
- package/dist/sessions/sessions.helper.js.map +1 -0
- package/dist/sessions/sessions.resolver.d.ts +150 -0
- package/dist/sessions/sessions.resolver.js +356 -0
- package/dist/sessions/sessions.resolver.js.map +1 -0
- package/dist/sessions/sessions.service.d.ts +170 -0
- package/dist/sessions/sessions.service.js +736 -0
- package/dist/sessions/sessions.service.js.map +1 -0
- package/dist/sessions/types/index.d.ts +290 -0
- package/dist/sessions/types/index.js +6 -0
- package/dist/sessions/types/index.js.map +1 -0
- package/dist/storage/index.d.ts +66 -0
- package/dist/storage/index.js +98 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/storage.service.d.ts +151 -0
- package/dist/storage/storage.service.js +522 -0
- package/dist/storage/storage.service.js.map +1 -0
- package/dist/storage/types/index.d.ts +207 -0
- package/dist/storage/types/index.js +6 -0
- package/dist/storage/types/index.js.map +1 -0
- package/dist/storage/utils/storage.util.d.ts +51 -0
- package/dist/storage/utils/storage.util.js +402 -0
- package/dist/storage/utils/storage.util.js.map +1 -0
- package/dist/test/index.d.ts +3 -0
- package/dist/test/index.js +11 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/test.appBuilder.d.ts +0 -1
- package/dist/test/test.appBuilder.js +0 -15
- package/dist/test/test.appBuilder.js.map +1 -1
- package/dist/test/test.broker.kafka.js +172 -0
- package/dist/test/test.broker.kafka.js.map +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.js +171 -0
- package/dist/test/test.broker.pubsub.js.map +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.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.d.ts +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 +140 -0
- package/dist/test/test.database.js.map +1 -0
- 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.health.js +1 -0
- package/dist/test/test.health.js.map +1 -0
- package/dist/test/test.import.d.ts +0 -1
- package/dist/test/test.import.js +0 -1459
- package/dist/test/test.import.js.map +1 -1
- package/dist/test/test.import.openapi.d.ts +0 -1
- package/dist/test/test.import.openapi.js +0 -75
- package/dist/test/test.import.openapi.js.map +1 -1
- package/dist/test/test.imports.js +14 -55
- package/dist/test/test.imports.js.map +1 -1
- package/dist/test/test.logs.d.ts +0 -1
- package/dist/test/test.logs.js +0 -17
- package/dist/test/test.logs.js.map +1 -1
- package/dist/test/test.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.notifiers.js +1 -0
- package/dist/test/test.notifiers.js.map +1 -0
- package/dist/test/test.processor.d.ts +0 -1
- package/dist/test/test.processor.js +0 -122
- package/dist/test/test.processor.js.map +1 -1
- package/dist/test/test.productBuilder.d.ts +0 -1
- package/dist/test/test.productBuilder.js +0 -660
- package/dist/test/test.productBuilder.js.map +1 -1
- package/dist/test/test.products.js +1 -0
- package/dist/test/test.products.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.d.ts +1 -0
- package/dist/test/test.storage.js +202 -0
- package/dist/test/test.storage.js.map +1 -0
- package/dist/test/test.triggers.d.ts +1 -0
- package/dist/test/test.triggers.js +314 -0
- package/dist/test/test.triggers.js.map +1 -0
- 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 +10 -13
- package/dist/types/enums.d.ts +11 -1
- package/dist/types/enums.js +10 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.types.d.ts +6 -4
- package/dist/types/index.types.js +0 -1
- package/dist/types/index.types.js.map +1 -1
- 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 +245 -20
- package/dist/types/processor.types.js +9 -1
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +906 -24
- package/dist/types/productsBuilder.types.js +173 -2
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/types/request-tracker.interface.js +1 -0
- package/dist/types/request-tracker.interface.js.map +1 -0
- package/dist/types/requests.types.d.ts +2 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +24 -52
- package/dist/utils/index.js.map +1 -1
- package/dist/vector/adapters/base.adapter.d.ts +152 -0
- package/dist/vector/adapters/base.adapter.js +137 -0
- package/dist/vector/adapters/base.adapter.js.map +1 -0
- package/dist/vector/adapters/index.d.ts +10 -0
- package/dist/vector/adapters/index.js +19 -0
- package/dist/vector/adapters/index.js.map +1 -0
- package/dist/vector/adapters/memory.adapter.d.ts +85 -0
- package/dist/vector/adapters/memory.adapter.js +505 -0
- package/dist/vector/adapters/memory.adapter.js.map +1 -0
- package/dist/vector/adapters/pinecone.adapter.d.ts +52 -0
- package/dist/vector/adapters/pinecone.adapter.js +400 -0
- package/dist/vector/adapters/pinecone.adapter.js.map +1 -0
- package/dist/vector/adapters/qdrant.adapter.d.ts +56 -0
- package/dist/vector/adapters/qdrant.adapter.js +392 -0
- package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
- package/dist/vector/adapters/weaviate.adapter.d.ts +64 -0
- package/dist/vector/adapters/weaviate.adapter.js +478 -0
- package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
- package/dist/vector/index.d.ts +47 -0
- package/dist/vector/index.js +72 -0
- package/dist/vector/index.js.map +1 -0
- package/dist/vector/types/connection.interface.d.ts +151 -0
- package/dist/vector/types/connection.interface.js +8 -0
- package/dist/vector/types/connection.interface.js.map +1 -0
- package/dist/vector/types/embedding.interface.d.ts +144 -0
- package/dist/vector/types/embedding.interface.js +8 -0
- package/dist/vector/types/embedding.interface.js.map +1 -0
- package/dist/vector/types/enums.d.ts +104 -0
- package/dist/vector/types/enums.js +113 -0
- package/dist/vector/types/enums.js.map +1 -0
- package/dist/vector/types/index.d.ts +9 -0
- package/dist/vector/types/index.js +16 -0
- package/dist/vector/types/index.js.map +1 -0
- package/dist/vector/types/vector.interface.d.ts +315 -0
- package/dist/vector/types/vector.interface.js +8 -0
- package/dist/vector/types/vector.interface.js.map +1 -0
- package/dist/vector/utils/index.d.ts +6 -0
- package/dist/vector/utils/index.js +11 -0
- package/dist/vector/utils/index.js.map +1 -0
- package/dist/vector/utils/vector-error.d.ts +69 -0
- package/dist/vector/utils/vector-error.js +116 -0
- package/dist/vector/utils/vector-error.js.map +1 -0
- package/dist/vector/vector-database.service.d.ts +408 -0
- package/dist/vector/vector-database.service.js +545 -0
- package/dist/vector/vector-database.service.js.map +1 -0
- package/dist/vector/vector.service.d.ts +245 -0
- package/dist/vector/vector.service.js +384 -0
- package/dist/vector/vector.service.js.map +1 -0
- package/dist/workflows/index.d.ts +30 -0
- package/dist/workflows/index.js +64 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/types/index.d.ts +6 -0
- package/dist/workflows/types/index.js +23 -0
- package/dist/workflows/types/index.js.map +1 -0
- package/dist/workflows/types/workflows.types.d.ts +1035 -0
- package/dist/workflows/types/workflows.types.js +13 -0
- package/dist/workflows/types/workflows.types.js.map +1 -0
- package/dist/workflows/workflow-builder.d.ts +70 -0
- package/dist/workflows/workflow-builder.js +338 -0
- package/dist/workflows/workflow-builder.js.map +1 -0
- package/dist/workflows/workflow-executor.d.ts +208 -0
- package/dist/workflows/workflow-executor.js +1194 -0
- package/dist/workflows/workflow-executor.js.map +1 -0
- package/dist/workflows/workflows.service.d.ts +404 -0
- package/dist/workflows/workflows.service.js +1620 -0
- package/dist/workflows/workflows.service.js.map +1 -0
- package/package.json +54 -11
- package/dist/actions/actions.repo.js +0 -13
- package/dist/actions/actions.repo.js.map +0 -1
- package/dist/actions/actions.service.js +0 -24
- package/dist/actions/actions.service.js.map +0 -1
- package/dist/actions/utils/actions.util.read.js +0 -427
- package/dist/actions/utils/actions.util.read.js.map +0 -1
- package/dist/api/services/integrationsApi.service.d.ts +0 -18
- package/dist/api/services/integrationsApi.service.js +0 -80
- package/dist/api/services/integrationsApi.service.js.map +0 -1
- package/dist/appBuilder/services/app.service.d.ts +0 -111
- package/dist/appBuilder/services/app.service.js +0 -737
- package/dist/appBuilder/services/app.service.js.map +0 -1
- package/dist/appBuilder/services/appBuilder.service.d.ts +0 -111
- package/dist/appBuilder/services/appBuilder.service.js +0 -662
- package/dist/appBuilder/services/appBuilder.service.js.map +0 -1
- package/dist/appBuilder/utils/objects.utils.d.ts +0 -3
- package/dist/appBuilder/utils/objects.utils.js +0 -9
- package/dist/appBuilder/utils/objects.utils.js.map +0 -1
- package/dist/appBuilder/utils/string.utils.d.ts +0 -2
- package/dist/appBuilder/utils/string.utils.js +0 -57
- package/dist/appBuilder/utils/string.utils.js.map +0 -1
- package/dist/appBuilder/validators/index.d.ts +0 -19
- package/dist/appBuilder/validators/index.js +0 -40
- package/dist/appBuilder/validators/index.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.app.validator.js +0 -10
- package/dist/appBuilder/validators/joi-validators/create.app.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js +0 -20
- package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js +0 -44
- package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js +0 -31
- package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js +0 -11
- package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js +0 -12
- package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js +0 -17
- package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js +0 -30
- package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js +0 -14
- package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/sample.validator.d.ts +0 -5
- package/dist/appBuilder/validators/joi-validators/sample.validator.js +0 -26
- package/dist/appBuilder/validators/joi-validators/sample.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.app.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.app.validator.js +0 -34
- package/dist/appBuilder/validators/joi-validators/update.app.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js +0 -23
- package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js +0 -21
- package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js +0 -19
- package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js +0 -12
- package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js +0 -17
- package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js +0 -16
- package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js +0 -14
- package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js.map +0 -1
- package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js +0 -27
- package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
- package/dist/apps/validators/joi-validators/create.appEvent.validator.js +0 -30
- package/dist/apps/validators/joi-validators/create.appEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appEvent.validator.js +0 -16
- package/dist/apps/validators/joi-validators/update.appEvent.validator.js.map +0 -1
- package/dist/clients/integrations.client.d.ts +0 -2
- package/dist/clients/integrations.client.js +0 -26
- package/dist/clients/integrations.client.js.map +0 -1
- package/dist/integrationsBuilder/services/integration.service.d.ts +0 -138
- package/dist/integrationsBuilder/services/integration.service.js +0 -1148
- package/dist/integrationsBuilder/services/integration.service.js.map +0 -1
- package/dist/integrationsBuilder/services/integrationBuilder.service.d.ts +0 -130
- package/dist/integrationsBuilder/services/integrationBuilder.service.js +0 -1017
- package/dist/integrationsBuilder/services/integrationBuilder.service.js.map +0 -1
- package/dist/integrationsBuilder/utils/objects.utils.d.ts +0 -2
- package/dist/integrationsBuilder/utils/objects.utils.js +0 -48
- package/dist/integrationsBuilder/utils/objects.utils.js.map +0 -1
- package/dist/integrationsBuilder/utils/string.utils.d.ts +0 -1
- package/dist/integrationsBuilder/utils/string.utils.js +0 -9
- package/dist/integrationsBuilder/utils/string.utils.js.map +0 -1
- package/dist/integrationsBuilder/validators/index.d.ts +0 -18
- package/dist/integrationsBuilder/validators/index.js +0 -38
- package/dist/integrationsBuilder/validators/index.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js +0 -10
- package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.d.ts +0 -4
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js +0 -26
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js +0 -10
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js +0 -60
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js +0 -9
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js.map +0 -1
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.d.ts +0 -3
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js +0 -8
- package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js.map +0 -1
- package/dist/postman.d.ts +0 -1
- package/dist/postman.js +0 -21674
- package/dist/postman.js.map +0 -1
- package/dist/processor/utils/mongo.util.js +0 -152
- package/dist/processor/utils/mongo.util.js.map +0 -1
- package/dist/processor/utils/postgres.util.d.ts +0 -14
- package/dist/processor/utils/postgres.util.js +0 -83
- package/dist/processor/utils/postgres.util.js.map +0 -1
- package/dist/products/validators/joi-validators/create.product.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.product.validator.js +0 -10
- package/dist/products/validators/joi-validators/create.product.validator.js.map +0 -1
- package/dist/test.appBuilder.js +0 -14
- package/dist/test.appBuilder.js.map +0 -1
- package/dist/test.import.js +0 -24
- package/dist/test.import.js.map +0 -1
- package/dist/test.imports.js +0 -28
- package/dist/test.imports.js.map +0 -1
- package/dist/test.integrationBuilder.js +0 -276
- package/dist/test.integrationBuilder.js.map +0 -1
- package/dist/test.processor.js +0 -23
- package/dist/test.processor.js.map +0 -1
- package/dist/test.utils.js +0 -25
- package/dist/test.utils.js.map +0 -1
- package/dist/types/integrationsBuilder.types.d.ts +0 -276
- package/dist/types/integrationsBuilder.types.js +0 -51
- package/dist/types/integrationsBuilder.types.js.map +0 -1
- /package/dist/{actions/actions.repo.d.ts → pricing/pricing.repo.d.ts} +0 -0
- /package/dist/{appBuilder/validators/joi-validators/create.app.validator.d.ts → products/validators/joi-validators/create.productGraph.validator.d.ts} +0 -0
- /package/dist/{appBuilder/validators/joi-validators/update.validation.entityData.validator.d.ts → products/validators/joi-validators/update.productGraph.validator.d.ts} +0 -0
- /package/dist/{test.appBuilder.d.ts → test/test.broker.kafka.d.ts} +0 -0
- /package/dist/{test.imports.d.ts → test/test.broker.nats.d.ts} +0 -0
- /package/dist/{test.integrationBuilder.d.ts → test/test.broker.pubsub.d.ts} +0 -0
- /package/dist/{test.processor.d.ts → test/test.broker.rabbitmq.d.ts} +0 -0
- /package/dist/{test.utils.d.ts → test/test.broker.redis.d.ts} +0 -0
- /package/dist/{actions/actions.service.d.ts → test/test.health.d.ts} +0 -0
- /package/dist/{actions/utils/actions.util.read.d.ts → test/test.notifiers.d.ts} +0 -0
- /package/dist/{processor/utils/mongo.util.d.ts → test/test.products.d.ts} +0 -0
- /package/dist/{test.import.d.ts → types/request-tracker.interface.d.ts} +0 -0
|
@@ -0,0 +1,1198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Neo4j Graph Adapter
|
|
4
|
+
*
|
|
5
|
+
* Adapter implementation for Neo4j graph database
|
|
6
|
+
* Uses the official neo4j-driver package
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.Neo4jAdapter = void 0;
|
|
43
|
+
const enums_1 = require("../types/enums");
|
|
44
|
+
const base_adapter_1 = require("./base.adapter");
|
|
45
|
+
const graph_error_1 = require("../utils/graph-error");
|
|
46
|
+
/**
|
|
47
|
+
* Neo4j adapter implementation
|
|
48
|
+
*/
|
|
49
|
+
class Neo4jAdapter extends base_adapter_1.BaseGraphAdapter {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
this.graphType = enums_1.GraphType.NEO4J;
|
|
53
|
+
this.supportedFeatures = new Set([
|
|
54
|
+
enums_1.GraphFeature.TRANSACTIONS,
|
|
55
|
+
enums_1.GraphFeature.SCHEMA_INDEXES,
|
|
56
|
+
enums_1.GraphFeature.FULL_TEXT_SEARCH,
|
|
57
|
+
enums_1.GraphFeature.GRAPH_ALGORITHMS,
|
|
58
|
+
enums_1.GraphFeature.GEOSPATIAL,
|
|
59
|
+
]);
|
|
60
|
+
this.driver = null;
|
|
61
|
+
this.session = null;
|
|
62
|
+
}
|
|
63
|
+
// ==================== CONNECTION MANAGEMENT ====================
|
|
64
|
+
async connect(options) {
|
|
65
|
+
try {
|
|
66
|
+
const neo4j = await Promise.resolve().then(() => __importStar(require('neo4j-driver')));
|
|
67
|
+
// Use auth credentials from options, fallback to defaults for backwards compatibility
|
|
68
|
+
const auth = options.auth
|
|
69
|
+
? neo4j.auth.basic(options.auth.username, options.auth.password)
|
|
70
|
+
: neo4j.auth.basic('neo4j', 'neo4j');
|
|
71
|
+
this.driver = neo4j.driver(options.connectionUrl, auth, options.options);
|
|
72
|
+
// Verify connection
|
|
73
|
+
await this.driver.verifyConnectivity();
|
|
74
|
+
this.connected = true;
|
|
75
|
+
this.connectionUrl = options.connectionUrl;
|
|
76
|
+
return {
|
|
77
|
+
connected: true,
|
|
78
|
+
type: enums_1.GraphType.NEO4J,
|
|
79
|
+
latency: 0,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
this.connected = false;
|
|
84
|
+
throw graph_error_1.GraphError.connectionError(`Failed to connect to Neo4j: ${error.message}`, error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async testConnection(options) {
|
|
88
|
+
var _a;
|
|
89
|
+
try {
|
|
90
|
+
const neo4j = await Promise.resolve().then(() => __importStar(require('neo4j-driver')));
|
|
91
|
+
const startTime = Date.now();
|
|
92
|
+
// Use auth credentials from options, fallback to defaults for backwards compatibility
|
|
93
|
+
const auth = options.auth
|
|
94
|
+
? neo4j.auth.basic(options.auth.username, options.auth.password)
|
|
95
|
+
: neo4j.auth.basic('neo4j', 'neo4j');
|
|
96
|
+
const testDriver = neo4j.driver(options.connectionUrl, auth, Object.assign(Object.assign({}, options.options), { connectionTimeout: 5000 }));
|
|
97
|
+
await testDriver.verifyConnectivity();
|
|
98
|
+
const serverInfo = await testDriver.getServerInfo();
|
|
99
|
+
await testDriver.close();
|
|
100
|
+
return {
|
|
101
|
+
connected: true,
|
|
102
|
+
type: enums_1.GraphType.NEO4J,
|
|
103
|
+
version: (_a = serverInfo === null || serverInfo === void 0 ? void 0 : serverInfo.protocolVersion) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
104
|
+
latency: Date.now() - startTime,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return {
|
|
109
|
+
connected: false,
|
|
110
|
+
type: enums_1.GraphType.NEO4J,
|
|
111
|
+
error: error.message,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async disconnect() {
|
|
116
|
+
if (this.session) {
|
|
117
|
+
await this.session.close();
|
|
118
|
+
this.session = null;
|
|
119
|
+
}
|
|
120
|
+
if (this.driver) {
|
|
121
|
+
await this.driver.close();
|
|
122
|
+
this.driver = null;
|
|
123
|
+
}
|
|
124
|
+
this.connected = false;
|
|
125
|
+
}
|
|
126
|
+
getSession(transaction) {
|
|
127
|
+
if (transaction === null || transaction === void 0 ? void 0 : transaction.client) {
|
|
128
|
+
return transaction.client;
|
|
129
|
+
}
|
|
130
|
+
if (!this.session) {
|
|
131
|
+
this.session = this.driver.session();
|
|
132
|
+
}
|
|
133
|
+
return this.session;
|
|
134
|
+
}
|
|
135
|
+
// ==================== NODE OPERATIONS ====================
|
|
136
|
+
async createNode(options, transaction) {
|
|
137
|
+
const labels = options.labels.join(':');
|
|
138
|
+
const query = `CREATE (n:${labels} $props) RETURN n`;
|
|
139
|
+
const session = this.getSession(transaction);
|
|
140
|
+
const result = await session.run(query, { props: options.properties });
|
|
141
|
+
const record = result.records[0];
|
|
142
|
+
const node = record.get('n');
|
|
143
|
+
return {
|
|
144
|
+
node: this.mapNeo4jNode(node),
|
|
145
|
+
created: true,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
async findNodes(options, transaction) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
const labels = ((_a = options.labels) === null || _a === void 0 ? void 0 : _a.join(':')) || '';
|
|
151
|
+
const labelClause = labels ? `:${labels}` : '';
|
|
152
|
+
let query = `MATCH (n${labelClause})`;
|
|
153
|
+
const params = {};
|
|
154
|
+
if (options.where) {
|
|
155
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'n');
|
|
156
|
+
query += ` WHERE ${clause}`;
|
|
157
|
+
Object.assign(params, whereParams);
|
|
158
|
+
}
|
|
159
|
+
query += ' RETURN n';
|
|
160
|
+
if ((_b = options.orderBy) === null || _b === void 0 ? void 0 : _b.length) {
|
|
161
|
+
const orderClauses = options.orderBy.map(o => `n.${o.property} ${o.direction.toUpperCase()}`);
|
|
162
|
+
query += ` ORDER BY ${orderClauses.join(', ')}`;
|
|
163
|
+
}
|
|
164
|
+
if (options.offset) {
|
|
165
|
+
query += ` SKIP ${options.offset}`;
|
|
166
|
+
}
|
|
167
|
+
if (options.limit) {
|
|
168
|
+
query += ` LIMIT ${options.limit}`;
|
|
169
|
+
}
|
|
170
|
+
const session = this.getSession(transaction);
|
|
171
|
+
const result = await session.run(query, params);
|
|
172
|
+
const nodes = result.records.map((record) => this.mapNeo4jNode(record.get('n')));
|
|
173
|
+
return {
|
|
174
|
+
nodes,
|
|
175
|
+
count: nodes.length,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
async findNodeById(id, transaction) {
|
|
179
|
+
const query = `MATCH (n) WHERE elementId(n) = $id OR id(n) = $idNum RETURN n`;
|
|
180
|
+
const session = this.getSession(transaction);
|
|
181
|
+
const result = await session.run(query, {
|
|
182
|
+
id: String(id),
|
|
183
|
+
idNum: typeof id === 'number' ? id : parseInt(id, 10) || -1
|
|
184
|
+
});
|
|
185
|
+
if (result.records.length === 0) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
return this.mapNeo4jNode(result.records[0].get('n'));
|
|
189
|
+
}
|
|
190
|
+
async updateNode(options, transaction) {
|
|
191
|
+
var _a;
|
|
192
|
+
let query;
|
|
193
|
+
const params = { props: options.properties };
|
|
194
|
+
if (options.id) {
|
|
195
|
+
query = `MATCH (n) WHERE elementId(n) = $id OR id(n) = $idNum SET n += $props RETURN n`;
|
|
196
|
+
params.id = String(options.id);
|
|
197
|
+
params.idNum = typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
const labels = ((_a = options.labels) === null || _a === void 0 ? void 0 : _a.join(':')) || '';
|
|
201
|
+
const labelClause = labels ? `:${labels}` : '';
|
|
202
|
+
query = `MATCH (n${labelClause})`;
|
|
203
|
+
if (options.where) {
|
|
204
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'n');
|
|
205
|
+
query += ` WHERE ${clause}`;
|
|
206
|
+
Object.assign(params, whereParams);
|
|
207
|
+
}
|
|
208
|
+
query += ' SET n += $props RETURN n';
|
|
209
|
+
}
|
|
210
|
+
const session = this.getSession(transaction);
|
|
211
|
+
const result = await session.run(query, params);
|
|
212
|
+
const nodes = result.records.map((record) => this.mapNeo4jNode(record.get('n')));
|
|
213
|
+
return {
|
|
214
|
+
node: nodes.length === 1 ? nodes[0] : undefined,
|
|
215
|
+
nodes: nodes.length > 1 ? nodes : undefined,
|
|
216
|
+
updatedCount: nodes.length,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
async deleteNode(options, transaction) {
|
|
220
|
+
var _a, _b, _c;
|
|
221
|
+
let query;
|
|
222
|
+
const params = {};
|
|
223
|
+
const detach = options.detach ? 'DETACH ' : '';
|
|
224
|
+
if (options.id) {
|
|
225
|
+
query = `MATCH (n) WHERE elementId(n) = $id OR id(n) = $idNum ${detach}DELETE n RETURN count(n) as count`;
|
|
226
|
+
params.id = String(options.id);
|
|
227
|
+
params.idNum = typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
const labels = ((_a = options.labels) === null || _a === void 0 ? void 0 : _a.join(':')) || '';
|
|
231
|
+
const labelClause = labels ? `:${labels}` : '';
|
|
232
|
+
query = `MATCH (n${labelClause})`;
|
|
233
|
+
if (options.where) {
|
|
234
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'n');
|
|
235
|
+
query += ` WHERE ${clause}`;
|
|
236
|
+
Object.assign(params, whereParams);
|
|
237
|
+
}
|
|
238
|
+
query += ` ${detach}DELETE n RETURN count(n) as count`;
|
|
239
|
+
}
|
|
240
|
+
const session = this.getSession(transaction);
|
|
241
|
+
const result = await session.run(query, params);
|
|
242
|
+
const count = ((_c = (_b = result.records[0]) === null || _b === void 0 ? void 0 : _b.get('count')) === null || _c === void 0 ? void 0 : _c.toNumber()) || 0;
|
|
243
|
+
return {
|
|
244
|
+
deleted: count > 0,
|
|
245
|
+
deletedCount: count,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
async mergeNode(options, transaction) {
|
|
249
|
+
const labels = options.labels.join(':');
|
|
250
|
+
const matchProps = Object.entries(options.matchProperties)
|
|
251
|
+
.map(([key]) => `${key}: $match_${key}`)
|
|
252
|
+
.join(', ');
|
|
253
|
+
let query = `MERGE (n:${labels} {${matchProps}})`;
|
|
254
|
+
const params = {};
|
|
255
|
+
// Add match properties to params
|
|
256
|
+
Object.entries(options.matchProperties).forEach(([key, value]) => {
|
|
257
|
+
params[`match_${key}`] = value;
|
|
258
|
+
});
|
|
259
|
+
if (options.onCreate) {
|
|
260
|
+
query += ' ON CREATE SET n += $onCreateProps';
|
|
261
|
+
params.onCreateProps = options.onCreate;
|
|
262
|
+
}
|
|
263
|
+
if (options.onMatch) {
|
|
264
|
+
query += ' ON MATCH SET n += $onMatchProps';
|
|
265
|
+
params.onMatchProps = options.onMatch;
|
|
266
|
+
}
|
|
267
|
+
query += ' RETURN n, EXISTS((n)--()) as existed';
|
|
268
|
+
const session = this.getSession(transaction);
|
|
269
|
+
const result = await session.run(query, params);
|
|
270
|
+
const record = result.records[0];
|
|
271
|
+
const node = this.mapNeo4jNode(record.get('n'));
|
|
272
|
+
return {
|
|
273
|
+
node,
|
|
274
|
+
created: !record.get('existed'),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
// ==================== LABEL MANAGEMENT ====================
|
|
278
|
+
async addLabels(options, transaction) {
|
|
279
|
+
const labels = options.labels.map(l => `:\`${l}\``).join('');
|
|
280
|
+
const query = `
|
|
281
|
+
MATCH (n)
|
|
282
|
+
WHERE elementId(n) = $id OR id(n) = $idNum
|
|
283
|
+
SET n${labels}
|
|
284
|
+
RETURN n, labels(n) as newLabels
|
|
285
|
+
`;
|
|
286
|
+
const params = {
|
|
287
|
+
id: String(options.id),
|
|
288
|
+
idNum: typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1,
|
|
289
|
+
};
|
|
290
|
+
const session = this.getSession(transaction);
|
|
291
|
+
const result = await session.run(query, params);
|
|
292
|
+
if (result.records.length === 0) {
|
|
293
|
+
throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
|
|
294
|
+
}
|
|
295
|
+
const record = result.records[0];
|
|
296
|
+
const node = this.mapNeo4jNode(record.get('n'));
|
|
297
|
+
return {
|
|
298
|
+
node,
|
|
299
|
+
addedLabels: options.labels,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
async removeLabels(options, transaction) {
|
|
303
|
+
const labels = options.labels.map(l => `:\`${l}\``).join('');
|
|
304
|
+
const query = `
|
|
305
|
+
MATCH (n)
|
|
306
|
+
WHERE elementId(n) = $id OR id(n) = $idNum
|
|
307
|
+
REMOVE n${labels}
|
|
308
|
+
RETURN n, labels(n) as newLabels
|
|
309
|
+
`;
|
|
310
|
+
const params = {
|
|
311
|
+
id: String(options.id),
|
|
312
|
+
idNum: typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1,
|
|
313
|
+
};
|
|
314
|
+
const session = this.getSession(transaction);
|
|
315
|
+
const result = await session.run(query, params);
|
|
316
|
+
if (result.records.length === 0) {
|
|
317
|
+
throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
|
|
318
|
+
}
|
|
319
|
+
const record = result.records[0];
|
|
320
|
+
const node = this.mapNeo4jNode(record.get('n'));
|
|
321
|
+
return {
|
|
322
|
+
node,
|
|
323
|
+
removedLabels: options.labels,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
async setLabels(options, transaction) {
|
|
327
|
+
// First get current labels
|
|
328
|
+
const getQuery = `
|
|
329
|
+
MATCH (n)
|
|
330
|
+
WHERE elementId(n) = $id OR id(n) = $idNum
|
|
331
|
+
RETURN labels(n) as currentLabels
|
|
332
|
+
`;
|
|
333
|
+
const params = {
|
|
334
|
+
id: String(options.id),
|
|
335
|
+
idNum: typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1,
|
|
336
|
+
};
|
|
337
|
+
const session = this.getSession(transaction);
|
|
338
|
+
const getResult = await session.run(getQuery, params);
|
|
339
|
+
if (getResult.records.length === 0) {
|
|
340
|
+
throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
|
|
341
|
+
}
|
|
342
|
+
const previousLabels = getResult.records[0].get('currentLabels');
|
|
343
|
+
// Remove all existing labels and add new ones
|
|
344
|
+
const removeLabels = previousLabels.map(l => `:\`${l}\``).join('');
|
|
345
|
+
const addLabels = options.labels.map(l => `:\`${l}\``).join('');
|
|
346
|
+
const setQuery = `
|
|
347
|
+
MATCH (n)
|
|
348
|
+
WHERE elementId(n) = $id OR id(n) = $idNum
|
|
349
|
+
REMOVE n${removeLabels}
|
|
350
|
+
SET n${addLabels}
|
|
351
|
+
RETURN n
|
|
352
|
+
`;
|
|
353
|
+
const result = await session.run(setQuery, params);
|
|
354
|
+
const node = this.mapNeo4jNode(result.records[0].get('n'));
|
|
355
|
+
return {
|
|
356
|
+
node,
|
|
357
|
+
previousLabels,
|
|
358
|
+
newLabels: options.labels,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
// ==================== RELATIONSHIP OPERATIONS ====================
|
|
362
|
+
async createRelationship(options, transaction) {
|
|
363
|
+
const query = `
|
|
364
|
+
MATCH (a), (b)
|
|
365
|
+
WHERE (elementId(a) = $startId OR id(a) = $startIdNum)
|
|
366
|
+
AND (elementId(b) = $endId OR id(b) = $endIdNum)
|
|
367
|
+
CREATE (a)-[r:${options.type} $props]->(b)
|
|
368
|
+
RETURN r, elementId(a) as startId, elementId(b) as endId
|
|
369
|
+
`;
|
|
370
|
+
const params = {
|
|
371
|
+
startId: String(options.startNodeId),
|
|
372
|
+
startIdNum: typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1,
|
|
373
|
+
endId: String(options.endNodeId),
|
|
374
|
+
endIdNum: typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1,
|
|
375
|
+
props: options.properties || {},
|
|
376
|
+
};
|
|
377
|
+
const session = this.getSession(transaction);
|
|
378
|
+
const result = await session.run(query, params);
|
|
379
|
+
const record = result.records[0];
|
|
380
|
+
const rel = record.get('r');
|
|
381
|
+
return {
|
|
382
|
+
relationship: this.mapNeo4jRelationship(rel, record.get('startId'), record.get('endId')),
|
|
383
|
+
created: true,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
async findRelationships(options, transaction) {
|
|
387
|
+
const types = options.type
|
|
388
|
+
? (Array.isArray(options.type) ? options.type.join('|') : options.type)
|
|
389
|
+
: '';
|
|
390
|
+
const typeClause = types ? `:${types}` : '';
|
|
391
|
+
let query = `MATCH (a)-[r${typeClause}]->(b)`;
|
|
392
|
+
const params = {};
|
|
393
|
+
const conditions = [];
|
|
394
|
+
if (options.startNodeId) {
|
|
395
|
+
conditions.push('(elementId(a) = $startId OR id(a) = $startIdNum)');
|
|
396
|
+
params.startId = String(options.startNodeId);
|
|
397
|
+
params.startIdNum = typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1;
|
|
398
|
+
}
|
|
399
|
+
if (options.endNodeId) {
|
|
400
|
+
conditions.push('(elementId(b) = $endId OR id(b) = $endIdNum)');
|
|
401
|
+
params.endId = String(options.endNodeId);
|
|
402
|
+
params.endIdNum = typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1;
|
|
403
|
+
}
|
|
404
|
+
if (options.where) {
|
|
405
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'r');
|
|
406
|
+
conditions.push(clause);
|
|
407
|
+
Object.assign(params, whereParams);
|
|
408
|
+
}
|
|
409
|
+
if (conditions.length > 0) {
|
|
410
|
+
query += ` WHERE ${conditions.join(' AND ')}`;
|
|
411
|
+
}
|
|
412
|
+
query += ' RETURN r, elementId(a) as startId, elementId(b) as endId';
|
|
413
|
+
if (options.offset) {
|
|
414
|
+
query += ` SKIP ${options.offset}`;
|
|
415
|
+
}
|
|
416
|
+
if (options.limit) {
|
|
417
|
+
query += ` LIMIT ${options.limit}`;
|
|
418
|
+
}
|
|
419
|
+
const session = this.getSession(transaction);
|
|
420
|
+
const result = await session.run(query, params);
|
|
421
|
+
const relationships = result.records.map((record) => this.mapNeo4jRelationship(record.get('r'), record.get('startId'), record.get('endId')));
|
|
422
|
+
return {
|
|
423
|
+
relationships,
|
|
424
|
+
count: relationships.length,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
async findRelationshipById(id, transaction) {
|
|
428
|
+
const query = `
|
|
429
|
+
MATCH (a)-[r]->(b)
|
|
430
|
+
WHERE elementId(r) = $id OR id(r) = $idNum
|
|
431
|
+
RETURN r, elementId(a) as startId, elementId(b) as endId
|
|
432
|
+
`;
|
|
433
|
+
const session = this.getSession(transaction);
|
|
434
|
+
const result = await session.run(query, {
|
|
435
|
+
id: String(id),
|
|
436
|
+
idNum: typeof id === 'number' ? id : parseInt(id, 10) || -1,
|
|
437
|
+
});
|
|
438
|
+
if (result.records.length === 0) {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
const record = result.records[0];
|
|
442
|
+
return this.mapNeo4jRelationship(record.get('r'), record.get('startId'), record.get('endId'));
|
|
443
|
+
}
|
|
444
|
+
async updateRelationship(options, transaction) {
|
|
445
|
+
let query;
|
|
446
|
+
const params = { props: options.properties };
|
|
447
|
+
if (options.id) {
|
|
448
|
+
query = `
|
|
449
|
+
MATCH (a)-[r]->(b)
|
|
450
|
+
WHERE elementId(r) = $id OR id(r) = $idNum
|
|
451
|
+
SET r += $props
|
|
452
|
+
RETURN r, elementId(a) as startId, elementId(b) as endId
|
|
453
|
+
`;
|
|
454
|
+
params.id = String(options.id);
|
|
455
|
+
params.idNum = typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1;
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
const typeClause = options.type ? `:${options.type}` : '';
|
|
459
|
+
query = `MATCH (a)-[r${typeClause}]->(b)`;
|
|
460
|
+
if (options.where) {
|
|
461
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'r');
|
|
462
|
+
query += ` WHERE ${clause}`;
|
|
463
|
+
Object.assign(params, whereParams);
|
|
464
|
+
}
|
|
465
|
+
query += ' SET r += $props RETURN r, elementId(a) as startId, elementId(b) as endId';
|
|
466
|
+
}
|
|
467
|
+
const session = this.getSession(transaction);
|
|
468
|
+
const result = await session.run(query, params);
|
|
469
|
+
const relationships = result.records.map((record) => this.mapNeo4jRelationship(record.get('r'), record.get('startId'), record.get('endId')));
|
|
470
|
+
return {
|
|
471
|
+
relationship: relationships.length === 1 ? relationships[0] : undefined,
|
|
472
|
+
relationships: relationships.length > 1 ? relationships : undefined,
|
|
473
|
+
updatedCount: relationships.length,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
async deleteRelationship(options, transaction) {
|
|
477
|
+
var _a, _b;
|
|
478
|
+
let query;
|
|
479
|
+
const params = {};
|
|
480
|
+
if (options.id) {
|
|
481
|
+
query = `MATCH ()-[r]->() WHERE elementId(r) = $id OR id(r) = $idNum DELETE r RETURN count(r) as count`;
|
|
482
|
+
params.id = String(options.id);
|
|
483
|
+
params.idNum = typeof options.id === 'number' ? options.id : parseInt(options.id, 10) || -1;
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
const typeClause = options.type ? `:${options.type}` : '';
|
|
487
|
+
query = `MATCH (a)-[r${typeClause}]->(b)`;
|
|
488
|
+
const conditions = [];
|
|
489
|
+
if (options.startNodeId) {
|
|
490
|
+
conditions.push('(elementId(a) = $startId OR id(a) = $startIdNum)');
|
|
491
|
+
params.startId = String(options.startNodeId);
|
|
492
|
+
params.startIdNum = typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1;
|
|
493
|
+
}
|
|
494
|
+
if (options.endNodeId) {
|
|
495
|
+
conditions.push('(elementId(b) = $endId OR id(b) = $endIdNum)');
|
|
496
|
+
params.endId = String(options.endNodeId);
|
|
497
|
+
params.endIdNum = typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1;
|
|
498
|
+
}
|
|
499
|
+
if (options.where) {
|
|
500
|
+
const { clause, params: whereParams } = this.buildWhereClause(options.where, 'r');
|
|
501
|
+
conditions.push(clause);
|
|
502
|
+
Object.assign(params, whereParams);
|
|
503
|
+
}
|
|
504
|
+
if (conditions.length > 0) {
|
|
505
|
+
query += ` WHERE ${conditions.join(' AND ')}`;
|
|
506
|
+
}
|
|
507
|
+
query += ' DELETE r RETURN count(r) as count';
|
|
508
|
+
}
|
|
509
|
+
const session = this.getSession(transaction);
|
|
510
|
+
const result = await session.run(query, params);
|
|
511
|
+
const count = ((_b = (_a = result.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber()) || 0;
|
|
512
|
+
return {
|
|
513
|
+
deleted: count > 0,
|
|
514
|
+
deletedCount: count,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
async mergeRelationship(options, transaction) {
|
|
518
|
+
let query = `
|
|
519
|
+
MATCH (a), (b)
|
|
520
|
+
WHERE (elementId(a) = $startId OR id(a) = $startIdNum)
|
|
521
|
+
AND (elementId(b) = $endId OR id(b) = $endIdNum)
|
|
522
|
+
MERGE (a)-[r:${options.type}]->(b)
|
|
523
|
+
`;
|
|
524
|
+
const params = {
|
|
525
|
+
startId: String(options.startNodeId),
|
|
526
|
+
startIdNum: typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1,
|
|
527
|
+
endId: String(options.endNodeId),
|
|
528
|
+
endIdNum: typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1,
|
|
529
|
+
};
|
|
530
|
+
if (options.onCreate) {
|
|
531
|
+
query += ' ON CREATE SET r += $onCreateProps';
|
|
532
|
+
params.onCreateProps = options.onCreate;
|
|
533
|
+
}
|
|
534
|
+
if (options.onMatch) {
|
|
535
|
+
query += ' ON MATCH SET r += $onMatchProps';
|
|
536
|
+
params.onMatchProps = options.onMatch;
|
|
537
|
+
}
|
|
538
|
+
query += ' RETURN r, elementId(a) as startId, elementId(b) as endId';
|
|
539
|
+
const session = this.getSession(transaction);
|
|
540
|
+
const result = await session.run(query, params);
|
|
541
|
+
const record = result.records[0];
|
|
542
|
+
const relationship = this.mapNeo4jRelationship(record.get('r'), record.get('startId'), record.get('endId'));
|
|
543
|
+
// Check if relationship was created (no properties existed before)
|
|
544
|
+
const created = Object.keys(record.get('r').properties || {}).length === 0;
|
|
545
|
+
return {
|
|
546
|
+
relationship,
|
|
547
|
+
created,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
// ==================== TRAVERSAL OPERATIONS ====================
|
|
551
|
+
async traverse(options, transaction) {
|
|
552
|
+
var _a;
|
|
553
|
+
const direction = this.getDirectionArrow(options.direction);
|
|
554
|
+
const relTypes = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.join('|')) || '';
|
|
555
|
+
const relClause = relTypes ? `:${relTypes}` : '';
|
|
556
|
+
const depthClause = `*1..${options.maxDepth || 3}`;
|
|
557
|
+
const query = `
|
|
558
|
+
MATCH path = (start)${direction.left}[${relClause}${depthClause}]${direction.right}(end)
|
|
559
|
+
WHERE elementId(start) = $startId OR id(start) = $startIdNum
|
|
560
|
+
RETURN path
|
|
561
|
+
${options.limit ? `LIMIT ${options.limit}` : ''}
|
|
562
|
+
`;
|
|
563
|
+
const params = {
|
|
564
|
+
startId: String(options.startNodeId),
|
|
565
|
+
startIdNum: typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1,
|
|
566
|
+
};
|
|
567
|
+
const session = this.getSession(transaction);
|
|
568
|
+
const result = await session.run(query, params);
|
|
569
|
+
const paths = result.records.map((record) => this.mapNeo4jPath(record.get('path')));
|
|
570
|
+
return {
|
|
571
|
+
paths,
|
|
572
|
+
count: paths.length,
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
async shortestPath(options, transaction) {
|
|
576
|
+
var _a;
|
|
577
|
+
const relTypes = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.join('|')) || '';
|
|
578
|
+
const relClause = relTypes ? `:${relTypes}` : '';
|
|
579
|
+
const maxDepth = options.maxDepth || 15;
|
|
580
|
+
const query = `
|
|
581
|
+
MATCH (start), (end)
|
|
582
|
+
WHERE (elementId(start) = $startId OR id(start) = $startIdNum)
|
|
583
|
+
AND (elementId(end) = $endId OR id(end) = $endIdNum)
|
|
584
|
+
MATCH path = shortestPath((start)-[${relClause}*..${maxDepth}]-(end))
|
|
585
|
+
RETURN path
|
|
586
|
+
`;
|
|
587
|
+
const params = {
|
|
588
|
+
startId: String(options.startNodeId),
|
|
589
|
+
startIdNum: typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1,
|
|
590
|
+
endId: String(options.endNodeId),
|
|
591
|
+
endIdNum: typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1,
|
|
592
|
+
};
|
|
593
|
+
const session = this.getSession(transaction);
|
|
594
|
+
const result = await session.run(query, params);
|
|
595
|
+
if (result.records.length === 0) {
|
|
596
|
+
return { path: null };
|
|
597
|
+
}
|
|
598
|
+
const path = this.mapNeo4jPath(result.records[0].get('path'));
|
|
599
|
+
return {
|
|
600
|
+
path,
|
|
601
|
+
totalWeight: options.weightProperty
|
|
602
|
+
? path.relationships.reduce((sum, r) => sum + (r.properties[options.weightProperty] || 0), 0)
|
|
603
|
+
: undefined,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
async allPaths(options, transaction) {
|
|
607
|
+
var _a;
|
|
608
|
+
const relTypes = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.join('|')) || '';
|
|
609
|
+
const relClause = relTypes ? `:${relTypes}` : '';
|
|
610
|
+
const minDepth = options.minDepth || 1;
|
|
611
|
+
const maxDepth = options.maxDepth || 5;
|
|
612
|
+
const query = `
|
|
613
|
+
MATCH (start), (end)
|
|
614
|
+
WHERE (elementId(start) = $startId OR id(start) = $startIdNum)
|
|
615
|
+
AND (elementId(end) = $endId OR id(end) = $endIdNum)
|
|
616
|
+
MATCH path = (start)-[${relClause}*${minDepth}..${maxDepth}]-(end)
|
|
617
|
+
RETURN path
|
|
618
|
+
${options.limit ? `LIMIT ${options.limit}` : ''}
|
|
619
|
+
`;
|
|
620
|
+
const params = {
|
|
621
|
+
startId: String(options.startNodeId),
|
|
622
|
+
startIdNum: typeof options.startNodeId === 'number' ? options.startNodeId : parseInt(options.startNodeId, 10) || -1,
|
|
623
|
+
endId: String(options.endNodeId),
|
|
624
|
+
endIdNum: typeof options.endNodeId === 'number' ? options.endNodeId : parseInt(options.endNodeId, 10) || -1,
|
|
625
|
+
};
|
|
626
|
+
const session = this.getSession(transaction);
|
|
627
|
+
const result = await session.run(query, params);
|
|
628
|
+
const paths = result.records.map((record) => this.mapNeo4jPath(record.get('path')));
|
|
629
|
+
return {
|
|
630
|
+
paths,
|
|
631
|
+
count: paths.length,
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
async getNeighborhood(options, transaction) {
|
|
635
|
+
var _a;
|
|
636
|
+
const direction = this.getDirectionArrow(options.direction);
|
|
637
|
+
const relTypes = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.join('|')) || '';
|
|
638
|
+
const relClause = relTypes ? `:${relTypes}` : '';
|
|
639
|
+
const depth = options.depth || 1;
|
|
640
|
+
const query = `
|
|
641
|
+
MATCH (start)
|
|
642
|
+
WHERE elementId(start) = $nodeId OR id(start) = $nodeIdNum
|
|
643
|
+
MATCH path = (start)${direction.left}[r${relClause}*1..${depth}]${direction.right}(neighbor)
|
|
644
|
+
RETURN DISTINCT neighbor, r
|
|
645
|
+
`;
|
|
646
|
+
const params = {
|
|
647
|
+
nodeId: String(options.nodeId),
|
|
648
|
+
nodeIdNum: typeof options.nodeId === 'number' ? options.nodeId : parseInt(options.nodeId, 10) || -1,
|
|
649
|
+
};
|
|
650
|
+
const session = this.getSession(transaction);
|
|
651
|
+
const result = await session.run(query, params);
|
|
652
|
+
const nodesMap = new Map();
|
|
653
|
+
const relationshipsSet = [];
|
|
654
|
+
result.records.forEach((record) => {
|
|
655
|
+
const neighbor = record.get('neighbor');
|
|
656
|
+
const nodeId = neighbor.elementId || neighbor.identity.toString();
|
|
657
|
+
if (!nodesMap.has(nodeId)) {
|
|
658
|
+
nodesMap.set(nodeId, this.mapNeo4jNode(neighbor));
|
|
659
|
+
}
|
|
660
|
+
const rels = record.get('r');
|
|
661
|
+
if (Array.isArray(rels)) {
|
|
662
|
+
rels.forEach((rel) => {
|
|
663
|
+
relationshipsSet.push(this.mapNeo4jRelationship(rel, rel.startNodeElementId || rel.start.toString(), rel.endNodeElementId || rel.end.toString()));
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
return {
|
|
668
|
+
nodes: Array.from(nodesMap.values()),
|
|
669
|
+
relationships: relationshipsSet,
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
async findConnectedComponents(options, transaction) {
|
|
673
|
+
var _a, _b;
|
|
674
|
+
// Note: This requires APOC or GDS library for efficient implementation
|
|
675
|
+
// Basic implementation using Cypher
|
|
676
|
+
const labels = ((_a = options.labels) === null || _a === void 0 ? void 0 : _a.join(':')) || '';
|
|
677
|
+
const labelClause = labels ? `:${labels}` : '';
|
|
678
|
+
const relTypes = ((_b = options.relationshipTypes) === null || _b === void 0 ? void 0 : _b.join('|')) || '';
|
|
679
|
+
const relClause = relTypes ? `:${relTypes}` : '';
|
|
680
|
+
const query = `
|
|
681
|
+
MATCH (n${labelClause})
|
|
682
|
+
WITH collect(n) as nodes
|
|
683
|
+
UNWIND nodes as node
|
|
684
|
+
MATCH path = (node)-[${relClause}*]-(connected)
|
|
685
|
+
WITH node, collect(DISTINCT connected) as component
|
|
686
|
+
RETURN component
|
|
687
|
+
`;
|
|
688
|
+
const session = this.getSession(transaction);
|
|
689
|
+
const result = await session.run(query, {});
|
|
690
|
+
const components = result.records.map((record) => ({
|
|
691
|
+
nodes: record.get('component').map((n) => this.mapNeo4jNode(n)),
|
|
692
|
+
size: record.get('component').length,
|
|
693
|
+
}));
|
|
694
|
+
return {
|
|
695
|
+
components,
|
|
696
|
+
count: components.length,
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
// ==================== AGGREGATION OPERATIONS ====================
|
|
700
|
+
async countNodes(labels, where, transaction) {
|
|
701
|
+
var _a, _b;
|
|
702
|
+
const labelClause = (labels === null || labels === void 0 ? void 0 : labels.length) ? `:${labels.join(':')}` : '';
|
|
703
|
+
let query = `MATCH (n${labelClause})`;
|
|
704
|
+
const params = {};
|
|
705
|
+
if (where) {
|
|
706
|
+
const { clause, params: whereParams } = this.buildWhereClause(where, 'n');
|
|
707
|
+
query += ` WHERE ${clause}`;
|
|
708
|
+
Object.assign(params, whereParams);
|
|
709
|
+
}
|
|
710
|
+
query += ' RETURN count(n) as count';
|
|
711
|
+
const session = this.getSession(transaction);
|
|
712
|
+
const result = await session.run(query, params);
|
|
713
|
+
return {
|
|
714
|
+
count: ((_b = (_a = result.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber()) || 0,
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
async countRelationships(types, where, transaction) {
|
|
718
|
+
var _a, _b;
|
|
719
|
+
const typeClause = (types === null || types === void 0 ? void 0 : types.length) ? `:${types.join('|')}` : '';
|
|
720
|
+
let query = `MATCH ()-[r${typeClause}]->()`;
|
|
721
|
+
const params = {};
|
|
722
|
+
if (where) {
|
|
723
|
+
const { clause, params: whereParams } = this.buildWhereClause(where, 'r');
|
|
724
|
+
query += ` WHERE ${clause}`;
|
|
725
|
+
Object.assign(params, whereParams);
|
|
726
|
+
}
|
|
727
|
+
query += ' RETURN count(r) as count';
|
|
728
|
+
const session = this.getSession(transaction);
|
|
729
|
+
const result = await session.run(query, params);
|
|
730
|
+
return {
|
|
731
|
+
count: ((_b = (_a = result.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber()) || 0,
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
async getStatistics(transaction) {
|
|
735
|
+
var _a, _b, _c, _d;
|
|
736
|
+
const session = this.getSession(transaction);
|
|
737
|
+
const nodeCountResult = await session.run('MATCH (n) RETURN count(n) as count');
|
|
738
|
+
const relCountResult = await session.run('MATCH ()-[r]->() RETURN count(r) as count');
|
|
739
|
+
return {
|
|
740
|
+
nodeCount: ((_b = (_a = nodeCountResult.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber()) || 0,
|
|
741
|
+
relationshipCount: ((_d = (_c = relCountResult.records[0]) === null || _c === void 0 ? void 0 : _c.get('count')) === null || _d === void 0 ? void 0 : _d.toNumber()) || 0,
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
// ==================== SEARCH OPERATIONS ====================
|
|
745
|
+
async fullTextSearch(options, transaction) {
|
|
746
|
+
const query = `
|
|
747
|
+
CALL db.index.fulltext.queryNodes($indexName, $searchQuery)
|
|
748
|
+
YIELD node, score
|
|
749
|
+
RETURN node, score
|
|
750
|
+
${options.limit ? `LIMIT ${options.limit}` : ''}
|
|
751
|
+
`;
|
|
752
|
+
const session = this.getSession(transaction);
|
|
753
|
+
const result = await session.run(query, {
|
|
754
|
+
indexName: options.indexName,
|
|
755
|
+
searchQuery: options.query,
|
|
756
|
+
});
|
|
757
|
+
const nodes = result.records.map((r) => this.mapNeo4jNode(r.get('node')));
|
|
758
|
+
const scores = result.records.map((r) => r.get('score'));
|
|
759
|
+
return { nodes, scores };
|
|
760
|
+
}
|
|
761
|
+
async vectorSearch(options, transaction) {
|
|
762
|
+
// Vector search requires Neo4j 5.13+ with vector index
|
|
763
|
+
const query = `
|
|
764
|
+
CALL db.index.vector.queryNodes($indexName, $topK, $vector)
|
|
765
|
+
YIELD node, score
|
|
766
|
+
RETURN node, score
|
|
767
|
+
`;
|
|
768
|
+
const session = this.getSession(transaction);
|
|
769
|
+
const result = await session.run(query, {
|
|
770
|
+
indexName: options.indexName,
|
|
771
|
+
topK: options.topK || 10,
|
|
772
|
+
vector: options.vector,
|
|
773
|
+
});
|
|
774
|
+
const nodes = result.records.map((r) => this.mapNeo4jNode(r.get('node')));
|
|
775
|
+
const scores = result.records.map((r) => r.get('score'));
|
|
776
|
+
return { nodes, scores };
|
|
777
|
+
}
|
|
778
|
+
// ==================== RAW QUERY ====================
|
|
779
|
+
async query(options, transaction) {
|
|
780
|
+
var _a, _b, _c, _d, _e, _f;
|
|
781
|
+
const session = this.getSession(transaction);
|
|
782
|
+
const result = await session.run(options.query, options.params || {});
|
|
783
|
+
return {
|
|
784
|
+
records: result.records.map((r) => r.toObject()),
|
|
785
|
+
summary: {
|
|
786
|
+
resultAvailableAfter: (_b = (_a = result.summary) === null || _a === void 0 ? void 0 : _a.resultAvailableAfter) === null || _b === void 0 ? void 0 : _b.toNumber(),
|
|
787
|
+
resultConsumedAfter: (_d = (_c = result.summary) === null || _c === void 0 ? void 0 : _c.resultConsumedAfter) === null || _d === void 0 ? void 0 : _d.toNumber(),
|
|
788
|
+
database: (_f = (_e = result.summary) === null || _e === void 0 ? void 0 : _e.database) === null || _f === void 0 ? void 0 : _f.name,
|
|
789
|
+
},
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
// ==================== SCHEMA OPERATIONS ====================
|
|
793
|
+
async createNodeIndex(options) {
|
|
794
|
+
const properties = options.properties.map(p => `n.${p}`).join(', ');
|
|
795
|
+
const unique = options.unique ? 'UNIQUE' : '';
|
|
796
|
+
const query = `CREATE ${unique} INDEX ${options.name} IF NOT EXISTS FOR (n:${options.label}) ON (${properties})`;
|
|
797
|
+
const session = this.getSession();
|
|
798
|
+
await session.run(query);
|
|
799
|
+
return { created: true, name: options.name };
|
|
800
|
+
}
|
|
801
|
+
async createNodeConstraint(options) {
|
|
802
|
+
let query;
|
|
803
|
+
switch (options.type) {
|
|
804
|
+
case 'UNIQUE':
|
|
805
|
+
query = `CREATE CONSTRAINT ${options.name} IF NOT EXISTS FOR (n:${options.label}) REQUIRE n.${options.property} IS UNIQUE`;
|
|
806
|
+
break;
|
|
807
|
+
case 'EXISTS':
|
|
808
|
+
query = `CREATE CONSTRAINT ${options.name} IF NOT EXISTS FOR (n:${options.label}) REQUIRE n.${options.property} IS NOT NULL`;
|
|
809
|
+
break;
|
|
810
|
+
default:
|
|
811
|
+
throw graph_error_1.GraphError.validationError(`Unsupported constraint type: ${options.type}`);
|
|
812
|
+
}
|
|
813
|
+
const session = this.getSession();
|
|
814
|
+
await session.run(query);
|
|
815
|
+
return { created: true, name: options.name };
|
|
816
|
+
}
|
|
817
|
+
async createRelationshipIndex(options) {
|
|
818
|
+
const properties = options.properties.map(p => `r.${p}`).join(', ');
|
|
819
|
+
const query = `CREATE INDEX ${options.name} IF NOT EXISTS FOR ()-[r:${options.type}]-() ON (${properties})`;
|
|
820
|
+
const session = this.getSession();
|
|
821
|
+
await session.run(query);
|
|
822
|
+
return { created: true, name: options.name };
|
|
823
|
+
}
|
|
824
|
+
async listIndexes() {
|
|
825
|
+
const query = 'SHOW INDEXES';
|
|
826
|
+
const session = this.getSession();
|
|
827
|
+
const result = await session.run(query);
|
|
828
|
+
const indexes = result.records.map((r) => {
|
|
829
|
+
var _a;
|
|
830
|
+
return ({
|
|
831
|
+
name: r.get('name'),
|
|
832
|
+
labelOrType: ((_a = r.get('labelsOrTypes')) === null || _a === void 0 ? void 0 : _a[0]) || '',
|
|
833
|
+
properties: r.get('properties') || [],
|
|
834
|
+
unique: r.get('uniqueness') === 'UNIQUE',
|
|
835
|
+
type: r.get('type'),
|
|
836
|
+
state: r.get('state'),
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
return { indexes };
|
|
840
|
+
}
|
|
841
|
+
async listConstraints() {
|
|
842
|
+
const query = 'SHOW CONSTRAINTS';
|
|
843
|
+
const session = this.getSession();
|
|
844
|
+
const result = await session.run(query);
|
|
845
|
+
const constraints = result.records.map((r) => {
|
|
846
|
+
var _a, _b;
|
|
847
|
+
return ({
|
|
848
|
+
name: r.get('name'),
|
|
849
|
+
label: ((_a = r.get('labelsOrTypes')) === null || _a === void 0 ? void 0 : _a[0]) || '',
|
|
850
|
+
property: ((_b = r.get('properties')) === null || _b === void 0 ? void 0 : _b[0]) || '',
|
|
851
|
+
type: r.get('type'),
|
|
852
|
+
});
|
|
853
|
+
});
|
|
854
|
+
return { constraints };
|
|
855
|
+
}
|
|
856
|
+
async dropIndex(name) {
|
|
857
|
+
const query = `DROP INDEX ${name} IF EXISTS`;
|
|
858
|
+
const session = this.getSession();
|
|
859
|
+
await session.run(query);
|
|
860
|
+
return { dropped: true };
|
|
861
|
+
}
|
|
862
|
+
async dropConstraint(name) {
|
|
863
|
+
const query = `DROP CONSTRAINT ${name} IF EXISTS`;
|
|
864
|
+
const session = this.getSession();
|
|
865
|
+
await session.run(query);
|
|
866
|
+
return { dropped: true };
|
|
867
|
+
}
|
|
868
|
+
// ==================== SCHEMA INTROSPECTION ====================
|
|
869
|
+
async listLabels() {
|
|
870
|
+
var _a, _b, _c, _d;
|
|
871
|
+
const session = this.getSession();
|
|
872
|
+
// Get all labels
|
|
873
|
+
const labelsResult = await session.run('CALL db.labels()');
|
|
874
|
+
const labelNames = labelsResult.records.map((r) => r.get('label'));
|
|
875
|
+
const labels = [];
|
|
876
|
+
for (const labelName of labelNames) {
|
|
877
|
+
// Get count for each label
|
|
878
|
+
const countResult = await session.run(`MATCH (n:\`${labelName}\`) RETURN count(n) as count`);
|
|
879
|
+
const count = ((_c = (_b = (_a = countResult.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber) === null || _c === void 0 ? void 0 : _c.call(_b)) ||
|
|
880
|
+
((_d = countResult.records[0]) === null || _d === void 0 ? void 0 : _d.get('count')) || 0;
|
|
881
|
+
// Get properties for a sample of nodes with this label
|
|
882
|
+
const propsResult = await session.run(`MATCH (n:\`${labelName}\`) WITH n LIMIT 100
|
|
883
|
+
UNWIND keys(n) as key
|
|
884
|
+
WITH key, n[key] as value
|
|
885
|
+
RETURN DISTINCT key,
|
|
886
|
+
CASE
|
|
887
|
+
WHEN value IS NULL THEN 'unknown'
|
|
888
|
+
WHEN toInteger(value) IS NOT NULL THEN 'number'
|
|
889
|
+
WHEN toFloat(value) IS NOT NULL THEN 'number'
|
|
890
|
+
WHEN value =~ '.*' THEN 'string'
|
|
891
|
+
WHEN value = true OR value = false THEN 'boolean'
|
|
892
|
+
WHEN date(value) IS NOT NULL THEN 'date'
|
|
893
|
+
WHEN datetime(value) IS NOT NULL THEN 'datetime'
|
|
894
|
+
WHEN point(value) IS NOT NULL THEN 'point'
|
|
895
|
+
WHEN value IS :: LIST THEN 'array'
|
|
896
|
+
ELSE 'unknown'
|
|
897
|
+
END as type`);
|
|
898
|
+
const properties = propsResult.records.map((r) => ({
|
|
899
|
+
name: r.get('key'),
|
|
900
|
+
type: this.mapNeo4jTypeToPropertyType(r.get('type')),
|
|
901
|
+
}));
|
|
902
|
+
labels.push({
|
|
903
|
+
name: labelName,
|
|
904
|
+
count: typeof count === 'number' ? count : Number(count),
|
|
905
|
+
properties,
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
return { labels };
|
|
909
|
+
}
|
|
910
|
+
async listRelationshipTypes() {
|
|
911
|
+
var _a, _b, _c, _d;
|
|
912
|
+
const session = this.getSession();
|
|
913
|
+
// Get all relationship types
|
|
914
|
+
const typesResult = await session.run('CALL db.relationshipTypes()');
|
|
915
|
+
const typeNames = typesResult.records.map((r) => r.get('relationshipType'));
|
|
916
|
+
const types = [];
|
|
917
|
+
for (const typeName of typeNames) {
|
|
918
|
+
// Get count for each type
|
|
919
|
+
const countResult = await session.run(`MATCH ()-[r:\`${typeName}\`]->() RETURN count(r) as count`);
|
|
920
|
+
const count = ((_c = (_b = (_a = countResult.records[0]) === null || _a === void 0 ? void 0 : _a.get('count')) === null || _b === void 0 ? void 0 : _b.toNumber) === null || _c === void 0 ? void 0 : _c.call(_b)) ||
|
|
921
|
+
((_d = countResult.records[0]) === null || _d === void 0 ? void 0 : _d.get('count')) || 0;
|
|
922
|
+
// Get source and target label information
|
|
923
|
+
const endpointsResult = await session.run(`MATCH (a)-[r:\`${typeName}\`]->(b)
|
|
924
|
+
WITH labels(a) as fromLabels, labels(b) as toLabels
|
|
925
|
+
RETURN DISTINCT fromLabels[0] as fromLabel, toLabels[0] as toLabel
|
|
926
|
+
LIMIT 10`);
|
|
927
|
+
const fromLabelsArray = endpointsResult.records
|
|
928
|
+
.map((r) => r.get('fromLabel'))
|
|
929
|
+
.filter((l) => Boolean(l));
|
|
930
|
+
const fromLabels = [...new Set(fromLabelsArray)];
|
|
931
|
+
const toLabelsArray = endpointsResult.records
|
|
932
|
+
.map((r) => r.get('toLabel'))
|
|
933
|
+
.filter((l) => Boolean(l));
|
|
934
|
+
const toLabels = [...new Set(toLabelsArray)];
|
|
935
|
+
// Get properties for relationships of this type
|
|
936
|
+
const propsResult = await session.run(`MATCH ()-[r:\`${typeName}\`]->() WITH r LIMIT 100
|
|
937
|
+
UNWIND keys(r) as key
|
|
938
|
+
RETURN DISTINCT key`);
|
|
939
|
+
const properties = propsResult.records.map((r) => ({
|
|
940
|
+
name: r.get('key'),
|
|
941
|
+
type: 'unknown',
|
|
942
|
+
}));
|
|
943
|
+
types.push({
|
|
944
|
+
type: typeName,
|
|
945
|
+
count: typeof count === 'number' ? count : Number(count),
|
|
946
|
+
fromLabels,
|
|
947
|
+
toLabels,
|
|
948
|
+
properties: properties.length > 0 ? properties : undefined,
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
return { types };
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Map Neo4j type string to GraphPropertyType
|
|
955
|
+
*/
|
|
956
|
+
mapNeo4jTypeToPropertyType(typeStr) {
|
|
957
|
+
switch (typeStr === null || typeStr === void 0 ? void 0 : typeStr.toLowerCase()) {
|
|
958
|
+
case 'number':
|
|
959
|
+
case 'integer':
|
|
960
|
+
case 'float':
|
|
961
|
+
return 'number';
|
|
962
|
+
case 'string':
|
|
963
|
+
return 'string';
|
|
964
|
+
case 'boolean':
|
|
965
|
+
return 'boolean';
|
|
966
|
+
case 'date':
|
|
967
|
+
return 'date';
|
|
968
|
+
case 'datetime':
|
|
969
|
+
return 'datetime';
|
|
970
|
+
case 'point':
|
|
971
|
+
return 'point';
|
|
972
|
+
case 'array':
|
|
973
|
+
case 'list':
|
|
974
|
+
return 'array';
|
|
975
|
+
default:
|
|
976
|
+
return 'unknown';
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
// ==================== TRANSACTION OPERATIONS ====================
|
|
980
|
+
async beginTransaction(options) {
|
|
981
|
+
const session = this.driver.session();
|
|
982
|
+
const tx = session.beginTransaction();
|
|
983
|
+
return {
|
|
984
|
+
id: `tx_${Date.now()}`,
|
|
985
|
+
status: enums_1.GraphTransactionStatus.ACTIVE,
|
|
986
|
+
client: tx,
|
|
987
|
+
commit: async () => {
|
|
988
|
+
await tx.commit();
|
|
989
|
+
await session.close();
|
|
990
|
+
},
|
|
991
|
+
rollback: async () => {
|
|
992
|
+
await tx.rollback();
|
|
993
|
+
await session.close();
|
|
994
|
+
},
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
async commitTransaction(transaction) {
|
|
998
|
+
await transaction.commit();
|
|
999
|
+
}
|
|
1000
|
+
async rollbackTransaction(transaction) {
|
|
1001
|
+
await transaction.rollback();
|
|
1002
|
+
}
|
|
1003
|
+
// ==================== UTILITY METHODS ====================
|
|
1004
|
+
buildWhereClause(where, alias = 'n') {
|
|
1005
|
+
const conditions = [];
|
|
1006
|
+
const params = {};
|
|
1007
|
+
let paramIndex = 0;
|
|
1008
|
+
const processCondition = (key, value, prefix = '') => {
|
|
1009
|
+
const fullKey = prefix ? `${prefix}_${key}` : key;
|
|
1010
|
+
const paramName = `param_${paramIndex++}`;
|
|
1011
|
+
// Normalize key to lowercase for logical operators (support both cases for backwards compatibility)
|
|
1012
|
+
const normalizedKey = key.toLowerCase();
|
|
1013
|
+
if (normalizedKey === '$and') {
|
|
1014
|
+
const entries = Array.isArray(value) ? value : Object.entries(value).map(([k, v]) => ({ [k]: v }));
|
|
1015
|
+
const subConditions = entries.map((entry) => {
|
|
1016
|
+
if (typeof entry === 'object' && !Array.isArray(entry)) {
|
|
1017
|
+
Object.entries(entry).forEach(([k, v]) => processCondition(k, v, fullKey));
|
|
1018
|
+
}
|
|
1019
|
+
return conditions.pop();
|
|
1020
|
+
});
|
|
1021
|
+
conditions.push(`(${subConditions.join(' AND ')})`);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
if (normalizedKey === '$or') {
|
|
1025
|
+
const entries = Array.isArray(value) ? value : Object.entries(value).map(([k, v]) => ({ [k]: v }));
|
|
1026
|
+
const subConditions = entries.map((entry) => {
|
|
1027
|
+
if (typeof entry === 'object' && !Array.isArray(entry)) {
|
|
1028
|
+
Object.entries(entry).forEach(([k, v]) => processCondition(k, v, fullKey));
|
|
1029
|
+
}
|
|
1030
|
+
return conditions.pop();
|
|
1031
|
+
});
|
|
1032
|
+
conditions.push(`(${subConditions.join(' OR ')})`);
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
if (normalizedKey === '$not') {
|
|
1036
|
+
Object.entries(value).forEach(([k, v]) => processCondition(k, v, fullKey));
|
|
1037
|
+
const innerCondition = conditions.pop();
|
|
1038
|
+
conditions.push(`NOT (${innerCondition})`);
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
1042
|
+
Object.entries(value).forEach(([op, opValue]) => {
|
|
1043
|
+
const opParamName = `${paramName}_${op.toLowerCase()}`;
|
|
1044
|
+
// Normalize operator to lowercase (support both cases for backwards compatibility)
|
|
1045
|
+
const normalizedOp = op.toLowerCase();
|
|
1046
|
+
switch (normalizedOp) {
|
|
1047
|
+
case '$gt':
|
|
1048
|
+
conditions.push(`${alias}.${key} > $${opParamName}`);
|
|
1049
|
+
params[opParamName] = opValue;
|
|
1050
|
+
break;
|
|
1051
|
+
case '$gte':
|
|
1052
|
+
conditions.push(`${alias}.${key} >= $${opParamName}`);
|
|
1053
|
+
params[opParamName] = opValue;
|
|
1054
|
+
break;
|
|
1055
|
+
case '$lt':
|
|
1056
|
+
conditions.push(`${alias}.${key} < $${opParamName}`);
|
|
1057
|
+
params[opParamName] = opValue;
|
|
1058
|
+
break;
|
|
1059
|
+
case '$lte':
|
|
1060
|
+
conditions.push(`${alias}.${key} <= $${opParamName}`);
|
|
1061
|
+
params[opParamName] = opValue;
|
|
1062
|
+
break;
|
|
1063
|
+
case '$ne':
|
|
1064
|
+
conditions.push(`${alias}.${key} <> $${opParamName}`);
|
|
1065
|
+
params[opParamName] = opValue;
|
|
1066
|
+
break;
|
|
1067
|
+
case '$in':
|
|
1068
|
+
conditions.push(`${alias}.${key} IN $${opParamName}`);
|
|
1069
|
+
params[opParamName] = opValue;
|
|
1070
|
+
break;
|
|
1071
|
+
case '$nin':
|
|
1072
|
+
case '$not_in':
|
|
1073
|
+
conditions.push(`NOT ${alias}.${key} IN $${opParamName}`);
|
|
1074
|
+
params[opParamName] = opValue;
|
|
1075
|
+
break;
|
|
1076
|
+
case '$contains':
|
|
1077
|
+
conditions.push(`${alias}.${key} CONTAINS $${opParamName}`);
|
|
1078
|
+
params[opParamName] = opValue;
|
|
1079
|
+
break;
|
|
1080
|
+
case '$startswith':
|
|
1081
|
+
case '$starts_with':
|
|
1082
|
+
conditions.push(`${alias}.${key} STARTS WITH $${opParamName}`);
|
|
1083
|
+
params[opParamName] = opValue;
|
|
1084
|
+
break;
|
|
1085
|
+
case '$endswith':
|
|
1086
|
+
case '$ends_with':
|
|
1087
|
+
conditions.push(`${alias}.${key} ENDS WITH $${opParamName}`);
|
|
1088
|
+
params[opParamName] = opValue;
|
|
1089
|
+
break;
|
|
1090
|
+
case '$exists':
|
|
1091
|
+
if (opValue) {
|
|
1092
|
+
conditions.push(`${alias}.${key} IS NOT NULL`);
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
conditions.push(`${alias}.${key} IS NULL`);
|
|
1096
|
+
}
|
|
1097
|
+
break;
|
|
1098
|
+
case '$regex':
|
|
1099
|
+
conditions.push(`${alias}.${key} =~ $${opParamName}`);
|
|
1100
|
+
params[opParamName] = opValue;
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
else {
|
|
1106
|
+
conditions.push(`${alias}.${key} = $${paramName}`);
|
|
1107
|
+
params[paramName] = value;
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
Object.entries(where).forEach(([key, value]) => {
|
|
1111
|
+
processCondition(key, value);
|
|
1112
|
+
});
|
|
1113
|
+
return {
|
|
1114
|
+
clause: conditions.join(' AND ') || 'true',
|
|
1115
|
+
params,
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
parseError(error) {
|
|
1119
|
+
return graph_error_1.GraphError.wrap(error);
|
|
1120
|
+
}
|
|
1121
|
+
// ==================== PRIVATE HELPER METHODS ====================
|
|
1122
|
+
mapNeo4jNode(node) {
|
|
1123
|
+
var _a;
|
|
1124
|
+
return {
|
|
1125
|
+
id: node.elementId || ((_a = node.identity) === null || _a === void 0 ? void 0 : _a.toString()) || '',
|
|
1126
|
+
labels: node.labels || [],
|
|
1127
|
+
properties: this.convertNeo4jProperties(node.properties || {}),
|
|
1128
|
+
elementId: node.elementId,
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
mapNeo4jRelationship(rel, startId, endId) {
|
|
1132
|
+
var _a;
|
|
1133
|
+
return {
|
|
1134
|
+
id: rel.elementId || ((_a = rel.identity) === null || _a === void 0 ? void 0 : _a.toString()) || '',
|
|
1135
|
+
type: rel.type,
|
|
1136
|
+
startNodeId: startId,
|
|
1137
|
+
endNodeId: endId,
|
|
1138
|
+
properties: this.convertNeo4jProperties(rel.properties || {}),
|
|
1139
|
+
elementId: rel.elementId,
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
mapNeo4jPath(path) {
|
|
1143
|
+
const nodes = path.segments.reduce((acc, segment, index) => {
|
|
1144
|
+
if (index === 0) {
|
|
1145
|
+
acc.push(this.mapNeo4jNode(segment.start));
|
|
1146
|
+
}
|
|
1147
|
+
acc.push(this.mapNeo4jNode(segment.end));
|
|
1148
|
+
return acc;
|
|
1149
|
+
}, []);
|
|
1150
|
+
const relationships = path.segments.map((segment) => this.mapNeo4jRelationship(segment.relationship, segment.start.elementId || segment.start.identity.toString(), segment.end.elementId || segment.end.identity.toString()));
|
|
1151
|
+
return {
|
|
1152
|
+
nodes,
|
|
1153
|
+
relationships,
|
|
1154
|
+
length: relationships.length,
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
convertNeo4jProperties(props) {
|
|
1158
|
+
const result = {};
|
|
1159
|
+
for (const [key, value] of Object.entries(props)) {
|
|
1160
|
+
result[key] = this.convertNeo4jValue(value);
|
|
1161
|
+
}
|
|
1162
|
+
return result;
|
|
1163
|
+
}
|
|
1164
|
+
convertNeo4jValue(value) {
|
|
1165
|
+
var _a, _b;
|
|
1166
|
+
if (value === null || value === undefined) {
|
|
1167
|
+
return value;
|
|
1168
|
+
}
|
|
1169
|
+
// Handle Neo4j Integer type
|
|
1170
|
+
if (typeof value === 'object' && ((_a = value.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Integer') {
|
|
1171
|
+
return value.toNumber();
|
|
1172
|
+
}
|
|
1173
|
+
// Handle Neo4j Date types
|
|
1174
|
+
if (typeof value === 'object' && ((_b = value.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'Date') {
|
|
1175
|
+
return new Date(value.toString());
|
|
1176
|
+
}
|
|
1177
|
+
if (Array.isArray(value)) {
|
|
1178
|
+
return value.map(v => this.convertNeo4jValue(v));
|
|
1179
|
+
}
|
|
1180
|
+
return value;
|
|
1181
|
+
}
|
|
1182
|
+
getDirectionArrow(direction) {
|
|
1183
|
+
switch (direction) {
|
|
1184
|
+
case enums_1.TraversalDirection.OUTGOING:
|
|
1185
|
+
case 'OUTGOING':
|
|
1186
|
+
return { left: '-', right: '->' };
|
|
1187
|
+
case enums_1.TraversalDirection.INCOMING:
|
|
1188
|
+
case 'INCOMING':
|
|
1189
|
+
return { left: '<-', right: '-' };
|
|
1190
|
+
case enums_1.TraversalDirection.BOTH:
|
|
1191
|
+
case 'BOTH':
|
|
1192
|
+
default:
|
|
1193
|
+
return { left: '-', right: '-' };
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
exports.Neo4jAdapter = Neo4jAdapter;
|
|
1198
|
+
//# sourceMappingURL=neo4j.adapter.js.map
|