@ductape/sdk 0.0.4-v5 → 0.0.4-v51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/services/appApi.service.d.ts +48 -2
- package/dist/api/services/appApi.service.js +101 -2
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/pricingApi.service.d.ts +10 -0
- package/dist/api/services/pricingApi.service.js +34 -0
- package/dist/api/services/pricingApi.service.js.map +1 -0
- package/dist/api/services/processorApi.service.d.ts +12 -2
- package/dist/api/services/processorApi.service.js +12 -2
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +40 -1
- package/dist/api/services/productsApi.service.js +105 -1
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/userApi.service.js +1 -0
- package/dist/api/services/userApi.service.js.map +1 -1
- package/dist/api/services/workspaceApi.service.js +1 -0
- package/dist/api/services/workspaceApi.service.js.map +1 -1
- package/dist/api/services/workspaceSecretsApi.service.d.ts +75 -0
- package/dist/api/services/workspaceSecretsApi.service.js +62 -0
- package/dist/api/services/workspaceSecretsApi.service.js.map +1 -0
- package/dist/api/urls.d.ts +6 -1
- package/dist/api/urls.js +12 -2
- package/dist/api/urls.js.map +1 -1
- package/dist/api/utils/cache.utils.d.ts +1 -1
- package/dist/api/utils/cache.utils.js +10 -4
- package/dist/api/utils/cache.utils.js.map +1 -1
- package/dist/api/utils/strings.utils.d.ts +2 -0
- package/dist/api/utils/strings.utils.js +14 -0
- package/dist/api/utils/strings.utils.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +51 -33
- package/dist/apps/services/app.service.js +488 -244
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +21 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +34 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
- package/dist/clients/pricing.client.d.ts +3 -0
- package/dist/clients/pricing.client.js +33 -0
- package/dist/clients/pricing.client.js.map +1 -0
- package/dist/database/adapters/base.adapter.d.ts +176 -0
- package/dist/database/adapters/base.adapter.js +31 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +91 -0
- package/dist/database/adapters/dynamodb.adapter.js +1608 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +71 -0
- package/dist/database/adapters/mongodb.adapter.js +1072 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +146 -0
- package/dist/database/adapters/mysql.adapter.js +1492 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +147 -0
- package/dist/database/adapters/postgresql.adapter.js +1603 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/database.service.d.ts +232 -0
- package/dist/database/database.service.js +802 -0
- package/dist/database/database.service.js.map +1 -0
- package/dist/database/index.d.ts +18 -0
- package/dist/database/index.js +98 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/types/aggregation.types.d.ts +261 -0
- package/dist/database/types/aggregation.types.js +21 -0
- package/dist/database/types/aggregation.types.js.map +1 -0
- package/dist/database/types/connection.types.d.ts +132 -0
- package/dist/database/types/connection.types.js +6 -0
- package/dist/database/types/connection.types.js.map +1 -0
- package/dist/database/types/database.types.d.ts +175 -0
- package/dist/database/types/database.types.js +75 -0
- package/dist/database/types/database.types.js.map +1 -0
- package/dist/database/types/index.d.ts +12 -0
- package/dist/database/types/index.js +37 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/index.types.d.ts +220 -0
- package/dist/database/types/index.types.js +27 -0
- package/dist/database/types/index.types.js.map +1 -0
- package/dist/database/types/migration.types.d.ts +205 -0
- package/dist/database/types/migration.types.js +44 -0
- package/dist/database/types/migration.types.js.map +1 -0
- package/dist/database/types/query.types.d.ts +305 -0
- package/dist/database/types/query.types.js +57 -0
- package/dist/database/types/query.types.js.map +1 -0
- package/dist/database/types/result.types.d.ts +220 -0
- package/dist/database/types/result.types.js +6 -0
- package/dist/database/types/result.types.js.map +1 -0
- package/dist/database/types/schema.types.d.ts +190 -0
- package/dist/database/types/schema.types.js +69 -0
- package/dist/database/types/schema.types.js.map +1 -0
- package/dist/database/utils/helpers.d.ts +66 -0
- package/dist/database/utils/helpers.js +501 -0
- package/dist/database/utils/helpers.js.map +1 -0
- package/dist/database/utils/migration.utils.d.ts +151 -0
- package/dist/database/utils/migration.utils.js +476 -0
- package/dist/database/utils/migration.utils.js.map +1 -0
- package/dist/database/utils/transaction.d.ts +64 -0
- package/dist/database/utils/transaction.js +130 -0
- package/dist/database/utils/transaction.js.map +1 -0
- package/dist/database/validators/connection.validator.d.ts +20 -0
- package/dist/database/validators/connection.validator.js +267 -0
- package/dist/database/validators/connection.validator.js.map +1 -0
- package/dist/database/validators/query.validator.d.ts +31 -0
- package/dist/database/validators/query.validator.js +305 -0
- package/dist/database/validators/query.validator.js.map +1 -0
- package/dist/database/validators/schema.validator.d.ts +31 -0
- package/dist/database/validators/schema.validator.js +334 -0
- package/dist/database/validators/schema.validator.js.map +1 -0
- package/dist/graph/adapters/arangodb.adapter.d.ts +80 -0
- package/dist/graph/adapters/arangodb.adapter.js +1393 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +228 -0
- package/dist/graph/adapters/base.adapter.js +38 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +10 -0
- package/dist/graph/adapters/index.js +23 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +85 -0
- package/dist/graph/adapters/memgraph.adapter.js +1491 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +88 -0
- package/dist/graph/adapters/neo4j.adapter.js +1861 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +87 -0
- package/dist/graph/adapters/neptune.adapter.js +1430 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graph.service.d.ts +278 -0
- package/dist/graph/graph.service.js +687 -0
- package/dist/graph/graph.service.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.js +42 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/types/connection.types.d.ts +158 -0
- package/dist/graph/types/connection.types.js +43 -0
- package/dist/graph/types/connection.types.js.map +1 -0
- package/dist/graph/types/graph.types.d.ts +144 -0
- package/dist/graph/types/graph.types.js +84 -0
- package/dist/graph/types/graph.types.js.map +1 -0
- package/dist/graph/types/index.d.ts +11 -0
- package/dist/graph/types/index.js +35 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.types.d.ts +193 -0
- package/dist/graph/types/node.types.js +49 -0
- package/dist/graph/types/node.types.js.map +1 -0
- package/dist/graph/types/path.types.d.ts +224 -0
- package/dist/graph/types/path.types.js +38 -0
- package/dist/graph/types/path.types.js.map +1 -0
- package/dist/graph/types/query.types.d.ts +247 -0
- package/dist/graph/types/query.types.js +23 -0
- package/dist/graph/types/query.types.js.map +1 -0
- package/dist/graph/types/relationship.types.d.ts +224 -0
- package/dist/graph/types/relationship.types.js +35 -0
- package/dist/graph/types/relationship.types.js.map +1 -0
- package/dist/graph/types/result.types.d.ts +237 -0
- package/dist/graph/types/result.types.js +7 -0
- package/dist/graph/types/result.types.js.map +1 -0
- package/dist/graph/validators/index.d.ts +81 -0
- package/dist/graph/validators/index.js +243 -0
- package/dist/graph/validators/index.js.map +1 -0
- package/dist/imports/imports.service.d.ts +3 -3
- package/dist/imports/imports.service.js +7 -7
- package/dist/imports/imports.service.js.map +1 -1
- package/dist/imports/imports.types.d.ts +8 -0
- package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
- package/dist/imports/repos/postmanV21.repo.js +29 -2
- package/dist/imports/repos/postmanV21.repo.js.map +1 -1
- package/dist/index.d.ts +1244 -150
- package/dist/index.js +1309 -209
- package/dist/index.js.map +1 -1
- package/dist/inputs/inputs.service.js +2 -2
- package/dist/inputs/inputs.service.js.map +1 -1
- package/dist/inputs/utils/inputs.utils.create.js +1 -1
- package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
- package/dist/logs/logs.types.d.ts +5 -0
- package/dist/logs/logs.types.js +1 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +27 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
- package/dist/parsers/pipelines/postman.pipelines.js +103 -0
- package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
- package/dist/parsers/types/postman.types.d.ts +200 -0
- package/dist/parsers/types/postman.types.js +3 -0
- package/dist/parsers/types/postman.types.js.map +1 -0
- package/dist/parsers/utils/postman.utils.d.ts +12 -0
- package/dist/parsers/utils/postman.utils.js +116 -0
- package/dist/parsers/utils/postman.utils.js.map +1 -0
- package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
- package/dist/parsers/validators/postman-auth.validators.js +127 -0
- package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
- package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-request.validators.js +139 -0
- package/dist/parsers/validators/postman-request.validators.js.map +1 -0
- package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-response.validators.js +150 -0
- package/dist/parsers/validators/postman-response.validators.js.map +1 -0
- package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
- package/dist/parsers/validators/postman-variable.validators.js +163 -0
- package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +1 -0
- package/dist/pricing/pricing.repo.js.map +1 -0
- package/dist/pricing/pricing.service.d.ts +24 -0
- package/dist/pricing/pricing.service.js +51 -0
- package/dist/pricing/pricing.service.js.map +1 -0
- package/dist/pricing/pricing.types.d.ts +76 -0
- package/dist/pricing/pricing.types.js +21 -0
- package/dist/pricing/pricing.types.js.map +1 -0
- package/dist/pricing/utils/string.utils.d.ts +1 -0
- package/dist/pricing/utils/string.utils.js +9 -0
- package/dist/pricing/utils/string.utils.js.map +1 -0
- package/dist/processor/repos/sms.repo.d.ts +4 -4
- package/dist/processor/repos/sms.repo.js +23 -10
- package/dist/processor/repos/sms.repo.js.map +1 -1
- package/dist/processor/services/messagebrokers/kafka.service.js +0 -2
- package/dist/processor/services/messagebrokers/kafka.service.js.map +1 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +9 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.js +40 -11
- package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +38 -10
- package/dist/processor/services/processor.service.js +533 -248
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/services/request.service.d.ts +36 -0
- package/dist/processor/services/request.service.js +304 -0
- package/dist/processor/services/request.service.js.map +1 -0
- package/dist/processor/types/request.types.d.ts +14 -0
- package/dist/processor/types/request.types.js +3 -0
- package/dist/processor/types/request.types.js.map +1 -0
- package/dist/processor/utils/processor.utils.d.ts +3 -0
- package/dist/processor/utils/processor.utils.js +84 -22
- package/dist/processor/utils/processor.utils.js.map +1 -1
- package/dist/processor/utils/request.utils.d.ts +20 -0
- package/dist/processor/utils/request.utils.js +113 -0
- package/dist/processor/utils/request.utils.js.map +1 -0
- package/dist/products/services/products.service.d.ts +114 -77
- package/dist/products/services/products.service.js +805 -362
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/services/utils/crypt.utils.d.ts +1 -0
- package/dist/products/services/utils/crypt.utils.js +17 -0
- package/dist/products/services/utils/crypt.utils.js.map +1 -0
- package/dist/products/services/utils/functions.utils.d.ts +13 -0
- package/dist/products/services/utils/functions.utils.js +289 -0
- package/dist/products/services/utils/functions.utils.js.map +1 -0
- package/dist/products/services/utils/objects.utils.d.ts +13 -0
- package/dist/products/services/utils/objects.utils.js +89 -0
- package/dist/products/services/utils/objects.utils.js.map +1 -0
- package/dist/products/services/utils/string.utils.d.ts +12 -0
- package/dist/products/services/utils/string.utils.js +168 -0
- package/dist/products/services/utils/string.utils.js.map +1 -0
- package/dist/products/utils/string.utils.d.ts +1 -1
- package/dist/products/utils/string.utils.js +14 -2
- package/dist/products/utils/string.utils.js.map +1 -1
- package/dist/products/validators/index.d.ts +4 -1
- package/dist/products/validators/index.js +7 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +15 -4
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +501 -109
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +82 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +14 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +696 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +9 -4
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +5 -2
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +6 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +28 -26
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +87 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +7 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +72 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -1
- package/dist/test/test.health.d.ts +1 -0
- package/dist/test/test.health.js +49 -0
- package/dist/test/test.health.js.map +1 -0
- package/dist/test/test.import.js +51 -4
- package/dist/test/test.import.js.map +1 -1
- package/dist/test/test.imports.js +22 -7
- package/dist/test/test.imports.js.map +1 -1
- package/dist/test/test.notifiers.d.ts +1 -0
- package/dist/test/test.notifiers.js +85 -0
- package/dist/test/test.notifiers.js.map +1 -0
- package/dist/test/test.processor.js +30 -115
- package/dist/test/test.processor.js.map +1 -1
- package/dist/test/test.products.d.ts +1 -0
- package/dist/test/test.products.js +49 -0
- package/dist/test/test.products.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/appBuilder.types.d.ts +5 -12
- package/dist/types/enums.d.ts +4 -1
- package/dist/types/enums.js +3 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.types.d.ts +4 -0
- package/dist/types/pricing.types.d.ts +4 -0
- package/dist/types/pricing.types.js +3 -0
- package/dist/types/pricing.types.js.map +1 -0
- package/dist/types/processor.types.d.ts +67 -11
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +132 -14
- package/dist/types/productsBuilder.types.js +69 -4
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +1 -0
- package/dist/types/request-tracker.interface.js.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/constants.js.map +1 -0
- package/package.json +17 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result Types
|
|
3
|
+
* Defines interfaces for graph operation results
|
|
4
|
+
*/
|
|
5
|
+
import { INode, NodeProperties } from './node.types';
|
|
6
|
+
import { IRelationship, RelationshipProperties } from './relationship.types';
|
|
7
|
+
import { IPath, IWeightedPath, ISubgraph, IConnectedComponent } from './path.types';
|
|
8
|
+
import { IQueryMetadata, IQueryStatistics } from './query.types';
|
|
9
|
+
/**
|
|
10
|
+
* Base result interface
|
|
11
|
+
*/
|
|
12
|
+
export interface IBaseGraphResult {
|
|
13
|
+
success: boolean;
|
|
14
|
+
executionTime: number;
|
|
15
|
+
metadata?: IQueryMetadata;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Raw query result
|
|
19
|
+
*/
|
|
20
|
+
export interface IGraphQueryResult<T = any> extends IBaseGraphResult {
|
|
21
|
+
data: T[];
|
|
22
|
+
columns?: string[];
|
|
23
|
+
count?: number;
|
|
24
|
+
statistics?: IQueryStatistics;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Node operation results
|
|
28
|
+
*/
|
|
29
|
+
export interface ICreateNodeResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
30
|
+
node?: INode<T>;
|
|
31
|
+
created: boolean;
|
|
32
|
+
statistics?: IQueryStatistics;
|
|
33
|
+
}
|
|
34
|
+
export interface IFindNodesResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
35
|
+
nodes: INode<T>[];
|
|
36
|
+
count: number;
|
|
37
|
+
hasMore?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface IUpdateNodeResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
40
|
+
node?: INode<T>;
|
|
41
|
+
updated: boolean;
|
|
42
|
+
matchedCount: number;
|
|
43
|
+
modifiedCount: number;
|
|
44
|
+
statistics?: IQueryStatistics;
|
|
45
|
+
}
|
|
46
|
+
export interface IDeleteNodeResult extends IBaseGraphResult {
|
|
47
|
+
deletedCount: number;
|
|
48
|
+
deletedRelationshipsCount?: number;
|
|
49
|
+
statistics?: IQueryStatistics;
|
|
50
|
+
}
|
|
51
|
+
export interface IMergeNodeResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
52
|
+
node?: INode<T>;
|
|
53
|
+
created: boolean;
|
|
54
|
+
matched: boolean;
|
|
55
|
+
statistics?: IQueryStatistics;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Relationship operation results
|
|
59
|
+
*/
|
|
60
|
+
export interface ICreateRelationshipResult<T extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
61
|
+
relationship?: IRelationship<T>;
|
|
62
|
+
created: boolean;
|
|
63
|
+
statistics?: IQueryStatistics;
|
|
64
|
+
}
|
|
65
|
+
export interface IFindRelationshipsResult<T extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
66
|
+
relationships: IRelationship<T>[];
|
|
67
|
+
count: number;
|
|
68
|
+
hasMore?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface IUpdateRelationshipResult<T extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
71
|
+
relationship?: IRelationship<T>;
|
|
72
|
+
updated: boolean;
|
|
73
|
+
matchedCount: number;
|
|
74
|
+
modifiedCount: number;
|
|
75
|
+
statistics?: IQueryStatistics;
|
|
76
|
+
}
|
|
77
|
+
export interface IDeleteRelationshipResult extends IBaseGraphResult {
|
|
78
|
+
deletedCount: number;
|
|
79
|
+
statistics?: IQueryStatistics;
|
|
80
|
+
}
|
|
81
|
+
export interface IMergeRelationshipResult<T extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
82
|
+
relationship?: IRelationship<T>;
|
|
83
|
+
created: boolean;
|
|
84
|
+
matched: boolean;
|
|
85
|
+
statistics?: IQueryStatistics;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Path and traversal results
|
|
89
|
+
*/
|
|
90
|
+
export interface ITraverseResult<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
91
|
+
paths?: IPath<N, R>[];
|
|
92
|
+
nodes?: INode<N>[];
|
|
93
|
+
relationships?: IRelationship<R>[];
|
|
94
|
+
count: number;
|
|
95
|
+
}
|
|
96
|
+
export interface IShortestPathResult<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
97
|
+
path?: IPath<N, R> | IWeightedPath<N, R>;
|
|
98
|
+
paths?: IPath<N, R>[] | IWeightedPath<N, R>[];
|
|
99
|
+
found: boolean;
|
|
100
|
+
length?: number;
|
|
101
|
+
totalWeight?: number;
|
|
102
|
+
}
|
|
103
|
+
export interface IAllPathsResult<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
104
|
+
paths: IPath<N, R>[];
|
|
105
|
+
count: number;
|
|
106
|
+
}
|
|
107
|
+
export interface IPatternMatchResult extends IBaseGraphResult {
|
|
108
|
+
matches: Record<string, any>[];
|
|
109
|
+
count: number;
|
|
110
|
+
hasMore?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface ISubgraphResult<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
113
|
+
subgraph: ISubgraph<N, R>;
|
|
114
|
+
}
|
|
115
|
+
export interface INeighborhoodResult<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IBaseGraphResult {
|
|
116
|
+
nodes: INode<N>[];
|
|
117
|
+
relationships: IRelationship<R>[];
|
|
118
|
+
levels: Map<number, INode<N>[]>;
|
|
119
|
+
}
|
|
120
|
+
export interface IConnectedComponentsResult<N extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
121
|
+
components: IConnectedComponent<N>[];
|
|
122
|
+
count: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Aggregation results
|
|
126
|
+
*/
|
|
127
|
+
export interface ICountResult extends IBaseGraphResult {
|
|
128
|
+
count: number;
|
|
129
|
+
}
|
|
130
|
+
export interface IAggregationResult extends IBaseGraphResult {
|
|
131
|
+
value: number | null;
|
|
132
|
+
}
|
|
133
|
+
export interface IGroupByResult extends IBaseGraphResult {
|
|
134
|
+
groups: Array<{
|
|
135
|
+
key: Record<string, any>;
|
|
136
|
+
values: Record<string, any>;
|
|
137
|
+
}>;
|
|
138
|
+
count: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Search results
|
|
142
|
+
*/
|
|
143
|
+
export interface IFullTextSearchResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
144
|
+
nodes: Array<INode<T> & {
|
|
145
|
+
score?: number;
|
|
146
|
+
}>;
|
|
147
|
+
count: number;
|
|
148
|
+
hasMore?: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface IVectorSearchResult<T extends NodeProperties = NodeProperties> extends IBaseGraphResult {
|
|
151
|
+
nodes: Array<INode<T> & {
|
|
152
|
+
similarity: number;
|
|
153
|
+
}>;
|
|
154
|
+
count: number;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Schema operation results
|
|
158
|
+
*/
|
|
159
|
+
export interface ICreateConstraintResult extends IBaseGraphResult {
|
|
160
|
+
name: string;
|
|
161
|
+
created: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface IDropConstraintResult extends IBaseGraphResult {
|
|
164
|
+
name: string;
|
|
165
|
+
dropped: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface IListConstraintsResult extends IBaseGraphResult {
|
|
168
|
+
constraints: Array<{
|
|
169
|
+
name: string;
|
|
170
|
+
type: string;
|
|
171
|
+
entityType: 'NODE' | 'RELATIONSHIP';
|
|
172
|
+
labelsOrTypes: string[];
|
|
173
|
+
properties: string[];
|
|
174
|
+
ownedIndex?: string;
|
|
175
|
+
}>;
|
|
176
|
+
}
|
|
177
|
+
export interface ICreateIndexResult extends IBaseGraphResult {
|
|
178
|
+
name: string;
|
|
179
|
+
created: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface IDropIndexResult extends IBaseGraphResult {
|
|
182
|
+
name: string;
|
|
183
|
+
dropped: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface IListIndexesResult extends IBaseGraphResult {
|
|
186
|
+
indexes: Array<{
|
|
187
|
+
name: string;
|
|
188
|
+
type: string;
|
|
189
|
+
entityType: 'NODE' | 'RELATIONSHIP';
|
|
190
|
+
labelsOrTypes: string[];
|
|
191
|
+
properties: string[];
|
|
192
|
+
state: string;
|
|
193
|
+
uniqueness?: string;
|
|
194
|
+
provider?: string;
|
|
195
|
+
}>;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Batch operation results
|
|
199
|
+
*/
|
|
200
|
+
export interface IBatchResult extends IBaseGraphResult {
|
|
201
|
+
results: IBaseGraphResult[];
|
|
202
|
+
successCount: number;
|
|
203
|
+
failureCount: number;
|
|
204
|
+
errors?: Array<{
|
|
205
|
+
index: number;
|
|
206
|
+
error: string;
|
|
207
|
+
}>;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Transaction result
|
|
211
|
+
*/
|
|
212
|
+
export interface ITransactionResult extends IBaseGraphResult {
|
|
213
|
+
transactionId: string;
|
|
214
|
+
committed: boolean;
|
|
215
|
+
rolledBack: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Database info result
|
|
219
|
+
*/
|
|
220
|
+
export interface IDatabaseInfoResult extends IBaseGraphResult {
|
|
221
|
+
name?: string;
|
|
222
|
+
type: string;
|
|
223
|
+
version: string;
|
|
224
|
+
edition?: string;
|
|
225
|
+
status: string;
|
|
226
|
+
features?: string[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Graph statistics result
|
|
230
|
+
*/
|
|
231
|
+
export interface IGraphStatisticsResult extends IBaseGraphResult {
|
|
232
|
+
nodeCount: number;
|
|
233
|
+
relationshipCount: number;
|
|
234
|
+
labelCounts: Record<string, number>;
|
|
235
|
+
relationshipTypeCounts: Record<string, number>;
|
|
236
|
+
propertyCounts?: Record<string, number>;
|
|
237
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.types.js","sourceRoot":"","sources":["../../../src/graph/types/result.types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Validators
|
|
3
|
+
* Validation utilities for graph operations
|
|
4
|
+
*/
|
|
5
|
+
import { GraphDatabaseType, GraphQueryLanguage } from '../types/graph.types';
|
|
6
|
+
import { GraphConnectionConfig, INeo4jConfig, INeptuneConfig, IArangoDBConfig, IMemgraphConfig } from '../types/connection.types';
|
|
7
|
+
import { ICreateNodeOptions, IFindNodesOptions, IUpdateNodeOptions, IDeleteNodeOptions, NodeProperties } from '../types/node.types';
|
|
8
|
+
import { ICreateRelationshipOptions, RelationshipProperties } from '../types/relationship.types';
|
|
9
|
+
/**
|
|
10
|
+
* Validate connection configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateConnectionConfig(config: GraphConnectionConfig): void;
|
|
13
|
+
/**
|
|
14
|
+
* Validate Neo4j configuration
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateNeo4jConfig(config: INeo4jConfig): void;
|
|
17
|
+
/**
|
|
18
|
+
* Validate Neptune configuration
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateNeptuneConfig(config: INeptuneConfig): void;
|
|
21
|
+
/**
|
|
22
|
+
* Validate ArangoDB configuration
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateArangoDBConfig(config: IArangoDBConfig): void;
|
|
25
|
+
/**
|
|
26
|
+
* Validate Memgraph configuration
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateMemgraphConfig(config: IMemgraphConfig): void;
|
|
29
|
+
/**
|
|
30
|
+
* Validate create node options
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateCreateNodeOptions<T extends NodeProperties>(options: ICreateNodeOptions<T>): void;
|
|
33
|
+
/**
|
|
34
|
+
* Validate find nodes options
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateFindNodesOptions(options: IFindNodesOptions): void;
|
|
37
|
+
/**
|
|
38
|
+
* Validate update node options
|
|
39
|
+
*/
|
|
40
|
+
export declare function validateUpdateNodeOptions(options: IUpdateNodeOptions): void;
|
|
41
|
+
/**
|
|
42
|
+
* Validate delete node options
|
|
43
|
+
*/
|
|
44
|
+
export declare function validateDeleteNodeOptions(options: IDeleteNodeOptions): void;
|
|
45
|
+
/**
|
|
46
|
+
* Validate create relationship options
|
|
47
|
+
*/
|
|
48
|
+
export declare function validateCreateRelationshipOptions<T extends RelationshipProperties>(options: ICreateRelationshipOptions<T>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Validate query language compatibility
|
|
51
|
+
*/
|
|
52
|
+
export declare function validateQueryLanguage(databaseType: GraphDatabaseType, queryLanguage: GraphQueryLanguage): void;
|
|
53
|
+
/**
|
|
54
|
+
* Validate property value types
|
|
55
|
+
*/
|
|
56
|
+
export declare function validatePropertyValue(value: any, propertyName: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Validate label format
|
|
59
|
+
*/
|
|
60
|
+
export declare function validateLabel(label: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Validate relationship type format
|
|
63
|
+
*/
|
|
64
|
+
export declare function validateRelationshipType(type: string): void;
|
|
65
|
+
declare const _default: {
|
|
66
|
+
validateConnectionConfig: typeof validateConnectionConfig;
|
|
67
|
+
validateNeo4jConfig: typeof validateNeo4jConfig;
|
|
68
|
+
validateNeptuneConfig: typeof validateNeptuneConfig;
|
|
69
|
+
validateArangoDBConfig: typeof validateArangoDBConfig;
|
|
70
|
+
validateMemgraphConfig: typeof validateMemgraphConfig;
|
|
71
|
+
validateCreateNodeOptions: typeof validateCreateNodeOptions;
|
|
72
|
+
validateFindNodesOptions: typeof validateFindNodesOptions;
|
|
73
|
+
validateUpdateNodeOptions: typeof validateUpdateNodeOptions;
|
|
74
|
+
validateDeleteNodeOptions: typeof validateDeleteNodeOptions;
|
|
75
|
+
validateCreateRelationshipOptions: typeof validateCreateRelationshipOptions;
|
|
76
|
+
validateQueryLanguage: typeof validateQueryLanguage;
|
|
77
|
+
validatePropertyValue: typeof validatePropertyValue;
|
|
78
|
+
validateLabel: typeof validateLabel;
|
|
79
|
+
validateRelationshipType: typeof validateRelationshipType;
|
|
80
|
+
};
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Graph Validators
|
|
4
|
+
* Validation utilities for graph operations
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.validateConnectionConfig = validateConnectionConfig;
|
|
8
|
+
exports.validateNeo4jConfig = validateNeo4jConfig;
|
|
9
|
+
exports.validateNeptuneConfig = validateNeptuneConfig;
|
|
10
|
+
exports.validateArangoDBConfig = validateArangoDBConfig;
|
|
11
|
+
exports.validateMemgraphConfig = validateMemgraphConfig;
|
|
12
|
+
exports.validateCreateNodeOptions = validateCreateNodeOptions;
|
|
13
|
+
exports.validateFindNodesOptions = validateFindNodesOptions;
|
|
14
|
+
exports.validateUpdateNodeOptions = validateUpdateNodeOptions;
|
|
15
|
+
exports.validateDeleteNodeOptions = validateDeleteNodeOptions;
|
|
16
|
+
exports.validateCreateRelationshipOptions = validateCreateRelationshipOptions;
|
|
17
|
+
exports.validateQueryLanguage = validateQueryLanguage;
|
|
18
|
+
exports.validatePropertyValue = validatePropertyValue;
|
|
19
|
+
exports.validateLabel = validateLabel;
|
|
20
|
+
exports.validateRelationshipType = validateRelationshipType;
|
|
21
|
+
const graph_types_1 = require("../types/graph.types");
|
|
22
|
+
/**
|
|
23
|
+
* Validate connection configuration
|
|
24
|
+
*/
|
|
25
|
+
function validateConnectionConfig(config) {
|
|
26
|
+
if (!config.type) {
|
|
27
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Connection config must have a type');
|
|
28
|
+
}
|
|
29
|
+
if (!Object.values(graph_types_1.GraphDatabaseType).includes(config.type)) {
|
|
30
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, `Invalid database type: ${config.type}`);
|
|
31
|
+
}
|
|
32
|
+
switch (config.type) {
|
|
33
|
+
case graph_types_1.GraphDatabaseType.NEO4J:
|
|
34
|
+
validateNeo4jConfig(config);
|
|
35
|
+
break;
|
|
36
|
+
case graph_types_1.GraphDatabaseType.NEPTUNE:
|
|
37
|
+
validateNeptuneConfig(config);
|
|
38
|
+
break;
|
|
39
|
+
case graph_types_1.GraphDatabaseType.ARANGODB:
|
|
40
|
+
validateArangoDBConfig(config);
|
|
41
|
+
break;
|
|
42
|
+
case graph_types_1.GraphDatabaseType.MEMGRAPH:
|
|
43
|
+
validateMemgraphConfig(config);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validate Neo4j configuration
|
|
49
|
+
*/
|
|
50
|
+
function validateNeo4jConfig(config) {
|
|
51
|
+
if (!config.uri) {
|
|
52
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neo4j config requires a uri');
|
|
53
|
+
}
|
|
54
|
+
if (!config.username) {
|
|
55
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neo4j config requires a username');
|
|
56
|
+
}
|
|
57
|
+
if (!config.password) {
|
|
58
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neo4j config requires a password');
|
|
59
|
+
}
|
|
60
|
+
// Validate URI format
|
|
61
|
+
if (!config.uri.startsWith('bolt://') &&
|
|
62
|
+
!config.uri.startsWith('bolt+s://') &&
|
|
63
|
+
!config.uri.startsWith('neo4j://') &&
|
|
64
|
+
!config.uri.startsWith('neo4j+s://')) {
|
|
65
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neo4j uri must start with bolt://, bolt+s://, neo4j://, or neo4j+s://');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Validate Neptune configuration
|
|
70
|
+
*/
|
|
71
|
+
function validateNeptuneConfig(config) {
|
|
72
|
+
if (!config.endpoint) {
|
|
73
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neptune config requires an endpoint');
|
|
74
|
+
}
|
|
75
|
+
if (!config.region) {
|
|
76
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neptune config requires a region');
|
|
77
|
+
}
|
|
78
|
+
if (!config.queryLanguage) {
|
|
79
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neptune config requires a queryLanguage (GREMLIN or OPENCYPHER)');
|
|
80
|
+
}
|
|
81
|
+
if (config.useIAM) {
|
|
82
|
+
if (!config.accessKeyId) {
|
|
83
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neptune config with IAM requires accessKeyId');
|
|
84
|
+
}
|
|
85
|
+
if (!config.secretAccessKey) {
|
|
86
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Neptune config with IAM requires secretAccessKey');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Validate ArangoDB configuration
|
|
92
|
+
*/
|
|
93
|
+
function validateArangoDBConfig(config) {
|
|
94
|
+
if (!config.url) {
|
|
95
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'ArangoDB config requires a url');
|
|
96
|
+
}
|
|
97
|
+
if (!config.database) {
|
|
98
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'ArangoDB config requires a database name');
|
|
99
|
+
}
|
|
100
|
+
// Must have either token or username/password
|
|
101
|
+
if (!config.token && !config.username) {
|
|
102
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'ArangoDB config requires either a token or username/password');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Validate Memgraph configuration
|
|
107
|
+
*/
|
|
108
|
+
function validateMemgraphConfig(config) {
|
|
109
|
+
if (!config.host) {
|
|
110
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Memgraph config requires a host');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Validate create node options
|
|
115
|
+
*/
|
|
116
|
+
function validateCreateNodeOptions(options) {
|
|
117
|
+
if (!options.labels) {
|
|
118
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Create node requires at least one label');
|
|
119
|
+
}
|
|
120
|
+
const labels = Array.isArray(options.labels) ? options.labels : [options.labels];
|
|
121
|
+
if (labels.length === 0) {
|
|
122
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Create node requires at least one label');
|
|
123
|
+
}
|
|
124
|
+
if (!options.properties || Object.keys(options.properties).length === 0) {
|
|
125
|
+
// Properties can be empty, just a warning
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validate find nodes options
|
|
130
|
+
*/
|
|
131
|
+
function validateFindNodesOptions(options) {
|
|
132
|
+
if (options.limit !== undefined && options.limit < 0) {
|
|
133
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Limit must be a positive number');
|
|
134
|
+
}
|
|
135
|
+
if (options.skip !== undefined && options.skip < 0) {
|
|
136
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Skip must be a positive number');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Validate update node options
|
|
141
|
+
*/
|
|
142
|
+
function validateUpdateNodeOptions(options) {
|
|
143
|
+
if (options.id === undefined && !options.labels && !options.where) {
|
|
144
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Update node requires id, labels, or where clause');
|
|
145
|
+
}
|
|
146
|
+
if (!options.set &&
|
|
147
|
+
!options.remove &&
|
|
148
|
+
!options.addLabels &&
|
|
149
|
+
!options.removeLabels) {
|
|
150
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Update node requires at least one update operation (set, remove, addLabels, or removeLabels)');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Validate delete node options
|
|
155
|
+
*/
|
|
156
|
+
function validateDeleteNodeOptions(options) {
|
|
157
|
+
if (options.id === undefined && !options.labels && !options.where) {
|
|
158
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Delete node requires id, labels, or where clause');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Validate create relationship options
|
|
163
|
+
*/
|
|
164
|
+
function validateCreateRelationshipOptions(options) {
|
|
165
|
+
if (!options.type) {
|
|
166
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Create relationship requires a type');
|
|
167
|
+
}
|
|
168
|
+
if (!options.fromNode) {
|
|
169
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Create relationship requires fromNode');
|
|
170
|
+
}
|
|
171
|
+
if (!options.toNode) {
|
|
172
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Create relationship requires toNode');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Validate query language compatibility
|
|
177
|
+
*/
|
|
178
|
+
function validateQueryLanguage(databaseType, queryLanguage) {
|
|
179
|
+
const compatibilityMap = {
|
|
180
|
+
[graph_types_1.GraphDatabaseType.NEO4J]: [graph_types_1.GraphQueryLanguage.CYPHER],
|
|
181
|
+
[graph_types_1.GraphDatabaseType.NEPTUNE]: [graph_types_1.GraphQueryLanguage.GREMLIN, graph_types_1.GraphQueryLanguage.OPENCYPHER],
|
|
182
|
+
[graph_types_1.GraphDatabaseType.ARANGODB]: [graph_types_1.GraphQueryLanguage.AQL],
|
|
183
|
+
[graph_types_1.GraphDatabaseType.MEMGRAPH]: [graph_types_1.GraphQueryLanguage.CYPHER],
|
|
184
|
+
};
|
|
185
|
+
const supportedLanguages = compatibilityMap[databaseType];
|
|
186
|
+
if (!supportedLanguages.includes(queryLanguage)) {
|
|
187
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, `Query language ${queryLanguage} is not supported by ${databaseType}. Supported: ${supportedLanguages.join(', ')}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Validate property value types
|
|
192
|
+
*/
|
|
193
|
+
function validatePropertyValue(value, propertyName) {
|
|
194
|
+
if (value === undefined) {
|
|
195
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, `Property '${propertyName}' cannot be undefined. Use null instead.`);
|
|
196
|
+
}
|
|
197
|
+
// Check for circular references in objects
|
|
198
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value) && !(value instanceof Date)) {
|
|
199
|
+
try {
|
|
200
|
+
JSON.stringify(value);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, `Property '${propertyName}' contains circular reference or invalid value`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Validate label format
|
|
209
|
+
*/
|
|
210
|
+
function validateLabel(label) {
|
|
211
|
+
if (!label || label.trim().length === 0) {
|
|
212
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Label cannot be empty');
|
|
213
|
+
}
|
|
214
|
+
// Neo4j/Cypher label rules (also apply to Memgraph)
|
|
215
|
+
if (/^\d/.test(label)) {
|
|
216
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, `Label '${label}' cannot start with a number`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Validate relationship type format
|
|
221
|
+
*/
|
|
222
|
+
function validateRelationshipType(type) {
|
|
223
|
+
if (!type || type.trim().length === 0) {
|
|
224
|
+
throw new graph_types_1.GraphError(graph_types_1.GraphErrorType.VALIDATION_ERROR, 'Relationship type cannot be empty');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exports.default = {
|
|
228
|
+
validateConnectionConfig,
|
|
229
|
+
validateNeo4jConfig,
|
|
230
|
+
validateNeptuneConfig,
|
|
231
|
+
validateArangoDBConfig,
|
|
232
|
+
validateMemgraphConfig,
|
|
233
|
+
validateCreateNodeOptions,
|
|
234
|
+
validateFindNodesOptions,
|
|
235
|
+
validateUpdateNodeOptions,
|
|
236
|
+
validateDeleteNodeOptions,
|
|
237
|
+
validateCreateRelationshipOptions,
|
|
238
|
+
validateQueryLanguage,
|
|
239
|
+
validatePropertyValue,
|
|
240
|
+
validateLabel,
|
|
241
|
+
validateRelationshipType,
|
|
242
|
+
};
|
|
243
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/validators/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAiCH,4DA6BC;AAKD,kDAgCC;AAKD,sDAoCC;AAKD,wDAsBC;AAKD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,EAC/B,UAAU,KAAK,8BAA8B,CAC9C,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,IAAY;IACnD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,wBAAU,CAClB,4BAAc,CAAC,gBAAgB,EAC/B,mCAAmC,CACpC,CAAC;IACJ,CAAC;AACH,CAAC;AAED,kBAAe;IACb,wBAAwB;IACxB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;IACxB,yBAAyB;IACzB,yBAAyB;IACzB,iCAAiC;IACjC,qBAAqB;IACrB,qBAAqB;IACrB,aAAa;IACb,wBAAwB;CACzB,CAAC"}
|
|
@@ -15,9 +15,9 @@ export default class ImportService implements IImportService {
|
|
|
15
15
|
private postmanV21Repo;
|
|
16
16
|
private openAPIV3Repo;
|
|
17
17
|
constructor({ workspace_id, public_key, user_id, token, env_type }: IBuilderInit);
|
|
18
|
-
importApp(file: Buffer, type: ImportDocsTypes, version?: string, updateIfExists?: boolean, app_id?: string): Promise<void>;
|
|
19
|
-
importPostmanV21(file: Buffer, type: ImportDocsTypes, version: string, updateIfExists?: boolean, app_id?: string): Promise<void>;
|
|
20
|
-
importOpenAPIV3(file: Buffer, type: ImportDocsTypes, version: string, updateIfExists?: boolean, app_id?: string): Promise<void>;
|
|
18
|
+
importApp(file: Buffer, type: ImportDocsTypes, version?: string, updateIfExists?: boolean, app_id?: string, isAdminImport?: boolean): Promise<void>;
|
|
19
|
+
importPostmanV21(file: Buffer, type: ImportDocsTypes, version: string, updateIfExists?: boolean, app_id?: string, isAdminImport?: boolean): Promise<void>;
|
|
20
|
+
importOpenAPIV3(file: Buffer, type: ImportDocsTypes, version: string, updateIfExists?: boolean, app_id?: string, isAdminImport?: boolean): Promise<void>;
|
|
21
21
|
private splitAndWriteBulkInChunks;
|
|
22
22
|
private getUserAccess;
|
|
23
23
|
}
|
|
@@ -22,25 +22,25 @@ class ImportService {
|
|
|
22
22
|
this.workspaceApi = new workspaceApi_service_1.WorkspaceApiService(env_type);
|
|
23
23
|
this.appApi = new appApi_service_1.AppApiService(env_type);
|
|
24
24
|
}
|
|
25
|
-
async importApp(file, type, version = '0.0.1', updateIfExists = false, app_id = null) {
|
|
25
|
+
async importApp(file, type, version = '0.0.1', updateIfExists = false, app_id = null, isAdminImport = false) {
|
|
26
26
|
if (type === imports_types_1.ImportDocsTypes.postmanV21) {
|
|
27
|
-
await this.importPostmanV21(file, type, version, updateIfExists, app_id);
|
|
27
|
+
await this.importPostmanV21(file, type, version, updateIfExists, app_id, isAdminImport);
|
|
28
28
|
}
|
|
29
29
|
else if (type === imports_types_1.ImportDocsTypes.openApiV30) {
|
|
30
|
-
await this.importOpenAPIV3(file, type, version, updateIfExists, app_id);
|
|
30
|
+
await this.importOpenAPIV3(file, type, version, updateIfExists, app_id, isAdminImport);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
async importPostmanV21(file, type, version, updateIfExists = false, app_id = null) {
|
|
33
|
+
async importPostmanV21(file, type, version, updateIfExists = false, app_id = null, isAdminImport = false) {
|
|
34
34
|
try {
|
|
35
|
-
await this.appApi.importApp(app_id, type, file, version, updateIfExists, this.getUserAccess());
|
|
35
|
+
await this.appApi.importApp(app_id, type, file, version, updateIfExists, this.getUserAccess(), isAdminImport);
|
|
36
36
|
}
|
|
37
37
|
catch (e) {
|
|
38
38
|
throw e;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
async importOpenAPIV3(file, type, version, updateIfExists = false, app_id = null) {
|
|
41
|
+
async importOpenAPIV3(file, type, version, updateIfExists = false, app_id = null, isAdminImport = false) {
|
|
42
42
|
try {
|
|
43
|
-
await this.appApi.importApp(app_id, type, file, version, updateIfExists, this.getUserAccess());
|
|
43
|
+
await this.appApi.importApp(app_id, type, file, version, updateIfExists, this.getUserAccess(), isAdminImport);
|
|
44
44
|
}
|
|
45
45
|
catch (e) {
|
|
46
46
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.service.js","sourceRoot":"","sources":["../../src/imports/imports.service.ts"],"names":[],"mappings":";;;;;AAAA,+EAAqF;AAGrF,mDAAqE;AACrE,0CAA8D;AAG9D,mEAA+E;AAC/E,+EAAiG;AACjG,6DAA0E;AAI1E,uDAAqE;AAoBrE,MAAqB,aAAa;IAWhC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAgB;QAC9E,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,cAAc,GAAG,gCAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,4BAAa,CAAC;QAEnC,IAAI,CAAC,UAAU,GAAG,IAAI,qBAAiB,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAEhG,IAAI,CAAC,YAAY,GAAG,IAAI,0CAAmB,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,IAAI,8BAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,SAAS,CACb,IAAY,EACZ,IAAqB,EACrB,UAAkB,OAAO,EACzB,iBAA0B,KAAK,EAC/B,SAAiB,IAAI;
|
|
1
|
+
{"version":3,"file":"imports.service.js","sourceRoot":"","sources":["../../src/imports/imports.service.ts"],"names":[],"mappings":";;;;;AAAA,+EAAqF;AAGrF,mDAAqE;AACrE,0CAA8D;AAG9D,mEAA+E;AAC/E,+EAAiG;AACjG,6DAA0E;AAI1E,uDAAqE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AC;IAEO,aAAa;QACnB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;CACF;AA/FD,gCA+FC"}
|
|
@@ -340,3 +340,11 @@ export interface OpenAPIV3ExternalDocumentation {
|
|
|
340
340
|
export interface OpenAPIV3Reference {
|
|
341
341
|
$ref: string;
|
|
342
342
|
}
|
|
343
|
+
export interface ParsedImportFile {
|
|
344
|
+
item?: any[];
|
|
345
|
+
[key: string]: any;
|
|
346
|
+
}
|
|
347
|
+
export interface ImportFileInput {
|
|
348
|
+
buffer: Buffer;
|
|
349
|
+
originalname: string;
|
|
350
|
+
}
|
|
@@ -6,7 +6,7 @@ export interface IPostmanV21Repo {
|
|
|
6
6
|
fetchParsedItems(items: Array<PostmanFoldersV21>, appService: IAppBuilderService, parent_id?: string | null, level?: number): Promise<IFoldersAndActions>;
|
|
7
7
|
fetchParsedActions(folder_id: string, appService: IAppBuilderService, folder_level: number, items: PostmanFoldersV21): Promise<Omit<IAppAction, 'tag'>>;
|
|
8
8
|
fetchParsedBody(body: PostmanRequestV21, request_type: DataFormats, appService: IAppBuilderService): Promise<ISample>;
|
|
9
|
-
fetchParsedHeaders(headers: Array<KeyValuePair>, auth: any, appService: IAppBuilderService): Promise<ISample>;
|
|
9
|
+
fetchParsedHeaders(headers: Array<KeyValuePair>, auth: any, appService: IAppBuilderService, responses: PostmanResponseV21[]): Promise<ISample>;
|
|
10
10
|
fetchParsedQuery(query: Array<KeyValuePair>, appService: IAppBuilderService): Promise<ISample>;
|
|
11
11
|
fetchParsedParams(url: string, appService: IAppBuilderService): Promise<ISample>;
|
|
12
12
|
fetchParsedResponses(responses: PostmanResponseV21[], appService: IAppBuilderService): Promise<IAppActionResponseInfo[]>;
|