@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,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base database adapter interface
|
|
3
|
+
* All database-specific adapters must implement this interface
|
|
4
|
+
*/
|
|
5
|
+
import { DatabaseType, IConnection, IDatabaseConfig, ITransaction, ISavepoint, ITransactionOptions } from '../types/database.types';
|
|
6
|
+
import { IQueryOptions, IInsertOptions, IUpdateOptions, IDeleteOptions, IUpsertOptions, IRawQueryOptions } from '../types/query.types';
|
|
7
|
+
import { ICountOptions, ISumOptions, IAvgOptions, IMinOptions, IMaxOptions, IGroupByOptions, IAggregateOptions, IGroupByResult } from '../types/aggregation.types';
|
|
8
|
+
import { ITableSchema, IColumnAlteration, ICreateTableOptions, IAlterTableOptions } from '../types/schema.types';
|
|
9
|
+
import { ICreateIndexOptions, IDropIndexOptions, IListIndexesOptions, IIndexInfo, IIndexStatistics } from '../types/index.types';
|
|
10
|
+
import { IMigrationDefinition, IMigrationExecutionOptions, IMigrationHistory, IMigrationResult } from '../types/migration.types';
|
|
11
|
+
import { IQueryResult, IInsertResult, IUpdateResult, IDeleteResult, IUpsertResult, ISchemaOperationResult, IIndexOperationResult, IRawQueryResult, IConnectionTestResult } from '../types/result.types';
|
|
12
|
+
/**
|
|
13
|
+
* Base database adapter abstract class
|
|
14
|
+
* Provides common functionality and defines required methods
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class BaseDatabaseAdapter {
|
|
17
|
+
/** Database type this adapter handles */
|
|
18
|
+
abstract readonly type: DatabaseType;
|
|
19
|
+
/**
|
|
20
|
+
* Create and establish a database connection
|
|
21
|
+
*/
|
|
22
|
+
abstract connect(config: IDatabaseConfig): Promise<IConnection>;
|
|
23
|
+
/**
|
|
24
|
+
* Close a database connection
|
|
25
|
+
*/
|
|
26
|
+
abstract disconnect(connection: IConnection): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Test database connection
|
|
29
|
+
*/
|
|
30
|
+
abstract testConnection(connection: IConnection): Promise<IConnectionTestResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Begin a new transaction
|
|
33
|
+
*/
|
|
34
|
+
abstract beginTransaction(connection: IConnection, options?: ITransactionOptions): Promise<ITransaction>;
|
|
35
|
+
/**
|
|
36
|
+
* Commit a transaction
|
|
37
|
+
*/
|
|
38
|
+
abstract commitTransaction(connection: IConnection, transaction: ITransaction): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Rollback a transaction
|
|
41
|
+
*/
|
|
42
|
+
abstract rollbackTransaction(connection: IConnection, transaction: ITransaction): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a savepoint within a transaction
|
|
45
|
+
*/
|
|
46
|
+
abstract createSavepoint(connection: IConnection, transaction: ITransaction, savepointName: string): Promise<ISavepoint>;
|
|
47
|
+
/**
|
|
48
|
+
* Rollback to a savepoint
|
|
49
|
+
*/
|
|
50
|
+
abstract rollbackToSavepoint(connection: IConnection, transaction: ITransaction, savepoint: ISavepoint): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Release a savepoint
|
|
53
|
+
*/
|
|
54
|
+
abstract releaseSavepoint(connection: IConnection, transaction: ITransaction, savepoint: ISavepoint): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Execute a callback within a transaction
|
|
57
|
+
* Automatically commits on success or rolls back on error
|
|
58
|
+
*/
|
|
59
|
+
executeTransaction<T>(connection: IConnection, callback: (transaction: ITransaction) => Promise<T>, options?: ITransactionOptions): Promise<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Execute a select query
|
|
62
|
+
*/
|
|
63
|
+
abstract query<T = any>(connection: IConnection, options: IQueryOptions): Promise<IQueryResult<T>>;
|
|
64
|
+
/**
|
|
65
|
+
* Insert records
|
|
66
|
+
*/
|
|
67
|
+
abstract insert<T = any>(connection: IConnection, options: IInsertOptions): Promise<IInsertResult<T>>;
|
|
68
|
+
/**
|
|
69
|
+
* Update records
|
|
70
|
+
*/
|
|
71
|
+
abstract update<T = any>(connection: IConnection, options: IUpdateOptions): Promise<IUpdateResult<T>>;
|
|
72
|
+
/**
|
|
73
|
+
* Delete records
|
|
74
|
+
*/
|
|
75
|
+
abstract delete<T = any>(connection: IConnection, options: IDeleteOptions): Promise<IDeleteResult<T>>;
|
|
76
|
+
/**
|
|
77
|
+
* Upsert records (insert or update)
|
|
78
|
+
*/
|
|
79
|
+
abstract upsert<T = any>(connection: IConnection, options: IUpsertOptions): Promise<IUpsertResult<T>>;
|
|
80
|
+
/**
|
|
81
|
+
* Execute raw SQL/query
|
|
82
|
+
*/
|
|
83
|
+
abstract executeRaw<T = any>(connection: IConnection, options: IRawQueryOptions): Promise<IRawQueryResult<T>>;
|
|
84
|
+
/**
|
|
85
|
+
* Count records
|
|
86
|
+
*/
|
|
87
|
+
abstract count(connection: IConnection, options: ICountOptions): Promise<number>;
|
|
88
|
+
/**
|
|
89
|
+
* Sum column values
|
|
90
|
+
*/
|
|
91
|
+
abstract sum(connection: IConnection, options: ISumOptions): Promise<number>;
|
|
92
|
+
/**
|
|
93
|
+
* Get average of column values
|
|
94
|
+
*/
|
|
95
|
+
abstract avg(connection: IConnection, options: IAvgOptions): Promise<number>;
|
|
96
|
+
/**
|
|
97
|
+
* Get minimum value
|
|
98
|
+
*/
|
|
99
|
+
abstract min(connection: IConnection, options: IMinOptions): Promise<number | string>;
|
|
100
|
+
/**
|
|
101
|
+
* Get maximum value
|
|
102
|
+
*/
|
|
103
|
+
abstract max(connection: IConnection, options: IMaxOptions): Promise<number | string>;
|
|
104
|
+
/**
|
|
105
|
+
* Group by and aggregate
|
|
106
|
+
*/
|
|
107
|
+
abstract groupBy(connection: IConnection, options: IGroupByOptions): Promise<IGroupByResult[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Multiple aggregations in one query
|
|
110
|
+
*/
|
|
111
|
+
abstract aggregate(connection: IConnection, options: IAggregateOptions): Promise<Record<string, any>>;
|
|
112
|
+
/**
|
|
113
|
+
* Create a table/collection
|
|
114
|
+
*/
|
|
115
|
+
abstract createTable(connection: IConnection, schema: ITableSchema, options?: ICreateTableOptions): Promise<ISchemaOperationResult>;
|
|
116
|
+
/**
|
|
117
|
+
* Drop a table/collection
|
|
118
|
+
*/
|
|
119
|
+
abstract dropTable(connection: IConnection, tableName: string): Promise<ISchemaOperationResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Alter table (add/modify/drop columns)
|
|
122
|
+
*/
|
|
123
|
+
abstract alterTable(connection: IConnection, tableName: string, alterations: IColumnAlteration[], options?: IAlterTableOptions): Promise<ISchemaOperationResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Get table schema
|
|
126
|
+
*/
|
|
127
|
+
abstract getTableSchema(connection: IConnection, tableName: string): Promise<ITableSchema>;
|
|
128
|
+
/**
|
|
129
|
+
* List all tables/collections
|
|
130
|
+
*/
|
|
131
|
+
abstract listTables(connection: IConnection): Promise<string[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Check if table exists
|
|
134
|
+
*/
|
|
135
|
+
abstract tableExists(connection: IConnection, tableName: string): Promise<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Create an index
|
|
138
|
+
*/
|
|
139
|
+
abstract createIndex(connection: IConnection, options: ICreateIndexOptions): Promise<IIndexOperationResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Drop an index
|
|
142
|
+
*/
|
|
143
|
+
abstract dropIndex(connection: IConnection, options: IDropIndexOptions): Promise<IIndexOperationResult>;
|
|
144
|
+
/**
|
|
145
|
+
* List indexes for a table
|
|
146
|
+
*/
|
|
147
|
+
abstract listIndexes(connection: IConnection, options: IListIndexesOptions): Promise<IIndexInfo[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Get index statistics
|
|
150
|
+
*/
|
|
151
|
+
abstract getIndexStatistics(connection: IConnection, tableName: string, indexName?: string): Promise<IIndexStatistics[]>;
|
|
152
|
+
/**
|
|
153
|
+
* Run a migration
|
|
154
|
+
*/
|
|
155
|
+
abstract runMigration(connection: IConnection, migration: IMigrationDefinition, options: IMigrationExecutionOptions): Promise<IMigrationResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Rollback a migration
|
|
158
|
+
*/
|
|
159
|
+
abstract rollbackMigration(connection: IConnection, migration: IMigrationDefinition, options: IMigrationExecutionOptions): Promise<IMigrationResult>;
|
|
160
|
+
/**
|
|
161
|
+
* Get migration history
|
|
162
|
+
*/
|
|
163
|
+
abstract getMigrationHistory(connection: IConnection, options: IMigrationExecutionOptions): Promise<IMigrationHistory[]>;
|
|
164
|
+
/**
|
|
165
|
+
* Escape identifier (table/column name)
|
|
166
|
+
*/
|
|
167
|
+
abstract escapeIdentifier(identifier: string): string;
|
|
168
|
+
/**
|
|
169
|
+
* Escape value
|
|
170
|
+
*/
|
|
171
|
+
abstract escapeValue(value: any): string;
|
|
172
|
+
/**
|
|
173
|
+
* Get database version
|
|
174
|
+
*/
|
|
175
|
+
abstract getDatabaseVersion(connection: IConnection): Promise<string>;
|
|
176
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Base database adapter interface
|
|
4
|
+
* All database-specific adapters must implement this interface
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.BaseDatabaseAdapter = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Base database adapter abstract class
|
|
10
|
+
* Provides common functionality and defines required methods
|
|
11
|
+
*/
|
|
12
|
+
class BaseDatabaseAdapter {
|
|
13
|
+
/**
|
|
14
|
+
* Execute a callback within a transaction
|
|
15
|
+
* Automatically commits on success or rolls back on error
|
|
16
|
+
*/
|
|
17
|
+
async executeTransaction(connection, callback, options) {
|
|
18
|
+
const transaction = await this.beginTransaction(connection, options);
|
|
19
|
+
try {
|
|
20
|
+
const result = await callback(transaction);
|
|
21
|
+
await this.commitTransaction(connection, transaction);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
await this.rollbackTransaction(connection, transaction);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.BaseDatabaseAdapter = BaseDatabaseAdapter;
|
|
31
|
+
//# sourceMappingURL=base.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.adapter.js","sourceRoot":"","sources":["../../../src/database/adapters/base.adapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2DH;;;GAGG;AACH,MAAsB,mBAAmB;IAoEvC;;;OAGG;IACH,KAAK,CAAC,kBAAkB,CACtB,UAAuB,EACvB,QAAmD,EACnD,OAA6B;QAE7B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAErE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC3C,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YACtD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YACxD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CAmOF;AA1TD,kDA0TC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DynamoDB Database Adapter
|
|
3
|
+
* Implements database operations for Amazon DynamoDB
|
|
4
|
+
*/
|
|
5
|
+
import { BaseDatabaseAdapter } from './base.adapter';
|
|
6
|
+
import { DatabaseType, IConnection, IDatabaseConfig, ITransaction, ISavepoint, ITransactionOptions } from '../types/database.types';
|
|
7
|
+
import { IQueryOptions, IInsertOptions, IUpdateOptions, IDeleteOptions, IUpsertOptions, IRawQueryOptions } from '../types/query.types';
|
|
8
|
+
import { ICountOptions, ISumOptions, IAvgOptions, IMinOptions, IMaxOptions, IGroupByOptions, IAggregateOptions, IGroupByResult } from '../types/aggregation.types';
|
|
9
|
+
import { ITableSchema, IColumnAlteration, ICreateTableOptions, IAlterTableOptions } from '../types/schema.types';
|
|
10
|
+
import { ICreateIndexOptions, IDropIndexOptions, IListIndexesOptions, IIndexInfo, IIndexStatistics } from '../types/index.types';
|
|
11
|
+
import { IMigrationDefinition, IMigrationExecutionOptions, IMigrationHistory, IMigrationResult } from '../types/migration.types';
|
|
12
|
+
import { IQueryResult, IInsertResult, IUpdateResult, IDeleteResult, IUpsertResult, ISchemaOperationResult, IIndexOperationResult, IRawQueryResult, IConnectionTestResult } from '../types/result.types';
|
|
13
|
+
/**
|
|
14
|
+
* DynamoDB Database Adapter
|
|
15
|
+
*/
|
|
16
|
+
export declare class DynamoDBAdapter extends BaseDatabaseAdapter {
|
|
17
|
+
readonly type = DatabaseType.DYNAMODB;
|
|
18
|
+
connect(config: IDatabaseConfig): Promise<IConnection>;
|
|
19
|
+
disconnect(connection: IConnection): Promise<void>;
|
|
20
|
+
testConnection(connection: IConnection): Promise<IConnectionTestResult>;
|
|
21
|
+
beginTransaction(connection: IConnection, options?: ITransactionOptions): Promise<ITransaction>;
|
|
22
|
+
commitTransaction(_connection: IConnection, transaction: ITransaction): Promise<void>;
|
|
23
|
+
rollbackTransaction(_connection: IConnection, transaction: ITransaction): Promise<void>;
|
|
24
|
+
createSavepoint(_connection: IConnection, _transaction: ITransaction, _savepointName: string): Promise<ISavepoint>;
|
|
25
|
+
rollbackToSavepoint(_connection: IConnection, _transaction: ITransaction, _savepoint: ISavepoint): Promise<void>;
|
|
26
|
+
releaseSavepoint(_connection: IConnection, _transaction: ITransaction, _savepoint: ISavepoint): Promise<void>;
|
|
27
|
+
query<T = any>(connection: IConnection, options: IQueryOptions): Promise<IQueryResult<T>>;
|
|
28
|
+
insert<T = any>(connection: IConnection, options: IInsertOptions): Promise<IInsertResult<T>>;
|
|
29
|
+
update<T = any>(connection: IConnection, options: IUpdateOptions): Promise<IUpdateResult<T>>;
|
|
30
|
+
delete<T = any>(connection: IConnection, options: IDeleteOptions): Promise<IDeleteResult<T>>;
|
|
31
|
+
upsert<T = any>(connection: IConnection, options: IUpsertOptions): Promise<IUpsertResult<T>>;
|
|
32
|
+
executeRaw<T = any>(connection: IConnection, options: IRawQueryOptions): Promise<IRawQueryResult<T>>;
|
|
33
|
+
count(connection: IConnection, options: ICountOptions): Promise<number>;
|
|
34
|
+
sum(connection: IConnection, options: ISumOptions): Promise<number>;
|
|
35
|
+
avg(connection: IConnection, options: IAvgOptions): Promise<number>;
|
|
36
|
+
min(connection: IConnection, options: IMinOptions): Promise<number | string>;
|
|
37
|
+
max(connection: IConnection, options: IMaxOptions): Promise<number | string>;
|
|
38
|
+
groupBy(connection: IConnection, options: IGroupByOptions): Promise<IGroupByResult[]>;
|
|
39
|
+
aggregate(connection: IConnection, options: IAggregateOptions): Promise<Record<string, any>>;
|
|
40
|
+
createTable(connection: IConnection, schema: ITableSchema, options?: ICreateTableOptions): Promise<ISchemaOperationResult>;
|
|
41
|
+
dropTable(connection: IConnection, tableName: string): Promise<ISchemaOperationResult>;
|
|
42
|
+
alterTable(connection: IConnection, tableName: string, alterations: IColumnAlteration[], options?: IAlterTableOptions): Promise<ISchemaOperationResult>;
|
|
43
|
+
getTableSchema(connection: IConnection, tableName: string): Promise<ITableSchema>;
|
|
44
|
+
listTables(connection: IConnection): Promise<string[]>;
|
|
45
|
+
tableExists(connection: IConnection, tableName: string): Promise<boolean>;
|
|
46
|
+
createIndex(connection: IConnection, options: ICreateIndexOptions): Promise<IIndexOperationResult>;
|
|
47
|
+
dropIndex(connection: IConnection, options: IDropIndexOptions): Promise<IIndexOperationResult>;
|
|
48
|
+
listIndexes(connection: IConnection, options: IListIndexesOptions): Promise<IIndexInfo[]>;
|
|
49
|
+
getIndexStatistics(connection: IConnection, tableName: string, indexName?: string): Promise<IIndexStatistics[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Execute a migration operation
|
|
52
|
+
* Note: DynamoDB is schema-less, so column operations are skipped
|
|
53
|
+
*/
|
|
54
|
+
private executeMigrationOperation;
|
|
55
|
+
runMigration(connection: IConnection, migration: IMigrationDefinition, options: IMigrationExecutionOptions): Promise<IMigrationResult>;
|
|
56
|
+
rollbackMigration(connection: IConnection, migration: IMigrationDefinition, options: IMigrationExecutionOptions): Promise<IMigrationResult>;
|
|
57
|
+
getMigrationHistory(connection: IConnection, options: IMigrationExecutionOptions): Promise<IMigrationHistory[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Ensure migration tracking table exists
|
|
60
|
+
*/
|
|
61
|
+
private ensureMigrationTable;
|
|
62
|
+
/**
|
|
63
|
+
* Record migration execution
|
|
64
|
+
*/
|
|
65
|
+
private recordMigration;
|
|
66
|
+
/**
|
|
67
|
+
* Remove migration from history
|
|
68
|
+
*/
|
|
69
|
+
private removeMigration;
|
|
70
|
+
private hasPartitionKeyInWhere;
|
|
71
|
+
private buildQueryParams;
|
|
72
|
+
private buildScanParams;
|
|
73
|
+
/**
|
|
74
|
+
* Build DynamoDB key condition expression (for Query operations)
|
|
75
|
+
* Supports both simplified syntax (GT, LT, etc.) and legacy $ prefix operators
|
|
76
|
+
*/
|
|
77
|
+
private buildKeyConditionExpression;
|
|
78
|
+
/**
|
|
79
|
+
* Build DynamoDB filter expression (for Scan and Query operations)
|
|
80
|
+
* Supports both simplified syntax (GT, LT, AND, OR, etc.) and legacy $ prefix operators
|
|
81
|
+
*/
|
|
82
|
+
private buildFilterExpression;
|
|
83
|
+
private buildUpdateExpression;
|
|
84
|
+
private extractKeyFromWhere;
|
|
85
|
+
private chunkArray;
|
|
86
|
+
private mapColumnTypeToDynamoDB;
|
|
87
|
+
private mapDynamoDBTypeToColumnType;
|
|
88
|
+
escapeIdentifier(identifier: string): string;
|
|
89
|
+
escapeValue(value: any): string;
|
|
90
|
+
getDatabaseVersion(connection: IConnection): Promise<string>;
|
|
91
|
+
}
|