@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,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core database type definitions for the Ductape Database ORM
|
|
3
|
+
* Provides unified interface for SQL and NoSQL databases
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Supported database types
|
|
7
|
+
*/
|
|
8
|
+
export declare enum DatabaseType {
|
|
9
|
+
POSTGRESQL = "postgresql",
|
|
10
|
+
MYSQL = "mysql",
|
|
11
|
+
MONGODB = "mongodb",
|
|
12
|
+
DYNAMODB = "dynamodb",
|
|
13
|
+
SQLITE = "sqlite"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Database connection status
|
|
17
|
+
*/
|
|
18
|
+
export declare enum ConnectionStatus {
|
|
19
|
+
DISCONNECTED = "disconnected",
|
|
20
|
+
CONNECTING = "connecting",
|
|
21
|
+
CONNECTED = "connected",
|
|
22
|
+
ERROR = "error"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Base database configuration
|
|
26
|
+
*/
|
|
27
|
+
export interface IDatabaseConfig {
|
|
28
|
+
/** Database type */
|
|
29
|
+
type: DatabaseType;
|
|
30
|
+
/** Environment slug */
|
|
31
|
+
env: string;
|
|
32
|
+
/** Optional connection tag for reusing existing connections */
|
|
33
|
+
connectionTag?: string;
|
|
34
|
+
/** Optional database name */
|
|
35
|
+
database?: string;
|
|
36
|
+
/** Custom connection options */
|
|
37
|
+
options?: Record<string, any>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Database connection interface
|
|
41
|
+
*/
|
|
42
|
+
export interface IConnection {
|
|
43
|
+
/** Unique connection ID */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Database type */
|
|
46
|
+
type: DatabaseType;
|
|
47
|
+
/** Connection status */
|
|
48
|
+
status: ConnectionStatus;
|
|
49
|
+
/** Connect to database */
|
|
50
|
+
connect(): Promise<void>;
|
|
51
|
+
/** Disconnect from database */
|
|
52
|
+
disconnect(): Promise<void>;
|
|
53
|
+
/** Check if connected */
|
|
54
|
+
isConnected(): boolean;
|
|
55
|
+
/** Get native client */
|
|
56
|
+
getClient<T = any>(): T;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Base database adapter interface
|
|
60
|
+
* All database-specific adapters must implement this interface
|
|
61
|
+
*/
|
|
62
|
+
export interface IDatabaseAdapter {
|
|
63
|
+
/** Database type this adapter handles */
|
|
64
|
+
readonly type: DatabaseType;
|
|
65
|
+
/** Create a connection */
|
|
66
|
+
createConnection(config: IDatabaseConfig): Promise<IConnection>;
|
|
67
|
+
/** Close a connection */
|
|
68
|
+
closeConnection(connection: IConnection): Promise<void>;
|
|
69
|
+
/** Execute a query */
|
|
70
|
+
executeQuery(connection: IConnection, query: string, params?: any[]): Promise<any>;
|
|
71
|
+
/** Begin transaction */
|
|
72
|
+
beginTransaction(connection: IConnection): Promise<any>;
|
|
73
|
+
/** Commit transaction */
|
|
74
|
+
commitTransaction(connection: IConnection, transaction: any): Promise<void>;
|
|
75
|
+
/** Rollback transaction */
|
|
76
|
+
rollbackTransaction(connection: IConnection, transaction: any): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Database error types
|
|
80
|
+
*/
|
|
81
|
+
export declare enum DatabaseErrorType {
|
|
82
|
+
CONNECTION_ERROR = "connection_error",
|
|
83
|
+
QUERY_ERROR = "query_error",
|
|
84
|
+
VALIDATION_ERROR = "validation_error",
|
|
85
|
+
MIGRATION_ERROR = "migration_error",
|
|
86
|
+
SCHEMA_ERROR = "schema_error",
|
|
87
|
+
INDEX_ERROR = "index_error",
|
|
88
|
+
TRANSACTION_ERROR = "transaction_error",
|
|
89
|
+
NOT_SUPPORTED = "not_supported"
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Database error class
|
|
93
|
+
*/
|
|
94
|
+
export declare class DatabaseError extends Error {
|
|
95
|
+
type: DatabaseErrorType;
|
|
96
|
+
originalError?: Error;
|
|
97
|
+
constructor(type: DatabaseErrorType, message: string, originalError?: Error);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Transaction isolation levels
|
|
101
|
+
*/
|
|
102
|
+
export declare enum TransactionIsolationLevel {
|
|
103
|
+
READ_UNCOMMITTED = "READ_UNCOMMITTED",
|
|
104
|
+
READ_COMMITTED = "READ_COMMITTED",
|
|
105
|
+
REPEATABLE_READ = "REPEATABLE_READ",
|
|
106
|
+
SERIALIZABLE = "SERIALIZABLE"
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Transaction status
|
|
110
|
+
*/
|
|
111
|
+
export declare enum TransactionStatus {
|
|
112
|
+
ACTIVE = "active",
|
|
113
|
+
COMMITTED = "committed",
|
|
114
|
+
ROLLED_BACK = "rolled_back",
|
|
115
|
+
FAILED = "failed"
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Transaction interface
|
|
119
|
+
*/
|
|
120
|
+
export interface ITransaction {
|
|
121
|
+
/** Unique transaction ID */
|
|
122
|
+
id: string;
|
|
123
|
+
/** Connection this transaction belongs to */
|
|
124
|
+
connection: IConnection;
|
|
125
|
+
/** Transaction status */
|
|
126
|
+
status: TransactionStatus;
|
|
127
|
+
/** Isolation level */
|
|
128
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
129
|
+
/** Parent transaction (for nested transactions) */
|
|
130
|
+
parent?: ITransaction;
|
|
131
|
+
/** Created timestamp */
|
|
132
|
+
createdAt: Date;
|
|
133
|
+
/** Native transaction object */
|
|
134
|
+
native: any;
|
|
135
|
+
/** Commit the transaction */
|
|
136
|
+
commit(): Promise<void>;
|
|
137
|
+
/** Rollback the transaction */
|
|
138
|
+
rollback(): Promise<void>;
|
|
139
|
+
/** Create a savepoint (for nested transactions) */
|
|
140
|
+
savepoint(name: string): Promise<ISavepoint>;
|
|
141
|
+
/** Check if transaction is active */
|
|
142
|
+
isActive(): boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Savepoint interface
|
|
146
|
+
*/
|
|
147
|
+
export interface ISavepoint {
|
|
148
|
+
/** Savepoint name */
|
|
149
|
+
name: string;
|
|
150
|
+
/** Transaction this savepoint belongs to */
|
|
151
|
+
transaction: ITransaction;
|
|
152
|
+
/** Created timestamp */
|
|
153
|
+
createdAt: Date;
|
|
154
|
+
/** Rollback to this savepoint */
|
|
155
|
+
rollback(): Promise<void>;
|
|
156
|
+
/** Release this savepoint */
|
|
157
|
+
release(): Promise<void>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Transaction options
|
|
161
|
+
*/
|
|
162
|
+
export interface ITransactionOptions {
|
|
163
|
+
/** Isolation level */
|
|
164
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
165
|
+
/** Read only transaction */
|
|
166
|
+
readOnly?: boolean;
|
|
167
|
+
/** Timeout in milliseconds */
|
|
168
|
+
timeout?: number;
|
|
169
|
+
/** Deferrable (PostgreSQL) */
|
|
170
|
+
deferrable?: boolean;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Transaction callback function
|
|
174
|
+
*/
|
|
175
|
+
export type TransactionCallback<T> = (transaction: ITransaction) => Promise<T>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Core database type definitions for the Ductape Database ORM
|
|
4
|
+
* Provides unified interface for SQL and NoSQL databases
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TransactionStatus = exports.TransactionIsolationLevel = exports.DatabaseError = exports.DatabaseErrorType = exports.ConnectionStatus = exports.DatabaseType = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Supported database types
|
|
10
|
+
*/
|
|
11
|
+
var DatabaseType;
|
|
12
|
+
(function (DatabaseType) {
|
|
13
|
+
DatabaseType["POSTGRESQL"] = "postgresql";
|
|
14
|
+
DatabaseType["MYSQL"] = "mysql";
|
|
15
|
+
DatabaseType["MONGODB"] = "mongodb";
|
|
16
|
+
DatabaseType["DYNAMODB"] = "dynamodb";
|
|
17
|
+
DatabaseType["SQLITE"] = "sqlite";
|
|
18
|
+
})(DatabaseType || (exports.DatabaseType = DatabaseType = {}));
|
|
19
|
+
/**
|
|
20
|
+
* Database connection status
|
|
21
|
+
*/
|
|
22
|
+
var ConnectionStatus;
|
|
23
|
+
(function (ConnectionStatus) {
|
|
24
|
+
ConnectionStatus["DISCONNECTED"] = "disconnected";
|
|
25
|
+
ConnectionStatus["CONNECTING"] = "connecting";
|
|
26
|
+
ConnectionStatus["CONNECTED"] = "connected";
|
|
27
|
+
ConnectionStatus["ERROR"] = "error";
|
|
28
|
+
})(ConnectionStatus || (exports.ConnectionStatus = ConnectionStatus = {}));
|
|
29
|
+
/**
|
|
30
|
+
* Database error types
|
|
31
|
+
*/
|
|
32
|
+
var DatabaseErrorType;
|
|
33
|
+
(function (DatabaseErrorType) {
|
|
34
|
+
DatabaseErrorType["CONNECTION_ERROR"] = "connection_error";
|
|
35
|
+
DatabaseErrorType["QUERY_ERROR"] = "query_error";
|
|
36
|
+
DatabaseErrorType["VALIDATION_ERROR"] = "validation_error";
|
|
37
|
+
DatabaseErrorType["MIGRATION_ERROR"] = "migration_error";
|
|
38
|
+
DatabaseErrorType["SCHEMA_ERROR"] = "schema_error";
|
|
39
|
+
DatabaseErrorType["INDEX_ERROR"] = "index_error";
|
|
40
|
+
DatabaseErrorType["TRANSACTION_ERROR"] = "transaction_error";
|
|
41
|
+
DatabaseErrorType["NOT_SUPPORTED"] = "not_supported";
|
|
42
|
+
})(DatabaseErrorType || (exports.DatabaseErrorType = DatabaseErrorType = {}));
|
|
43
|
+
/**
|
|
44
|
+
* Database error class
|
|
45
|
+
*/
|
|
46
|
+
class DatabaseError extends Error {
|
|
47
|
+
constructor(type, message, originalError) {
|
|
48
|
+
super(message);
|
|
49
|
+
this.type = type;
|
|
50
|
+
this.originalError = originalError;
|
|
51
|
+
this.name = 'DatabaseError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DatabaseError = DatabaseError;
|
|
55
|
+
/**
|
|
56
|
+
* Transaction isolation levels
|
|
57
|
+
*/
|
|
58
|
+
var TransactionIsolationLevel;
|
|
59
|
+
(function (TransactionIsolationLevel) {
|
|
60
|
+
TransactionIsolationLevel["READ_UNCOMMITTED"] = "READ_UNCOMMITTED";
|
|
61
|
+
TransactionIsolationLevel["READ_COMMITTED"] = "READ_COMMITTED";
|
|
62
|
+
TransactionIsolationLevel["REPEATABLE_READ"] = "REPEATABLE_READ";
|
|
63
|
+
TransactionIsolationLevel["SERIALIZABLE"] = "SERIALIZABLE";
|
|
64
|
+
})(TransactionIsolationLevel || (exports.TransactionIsolationLevel = TransactionIsolationLevel = {}));
|
|
65
|
+
/**
|
|
66
|
+
* Transaction status
|
|
67
|
+
*/
|
|
68
|
+
var TransactionStatus;
|
|
69
|
+
(function (TransactionStatus) {
|
|
70
|
+
TransactionStatus["ACTIVE"] = "active";
|
|
71
|
+
TransactionStatus["COMMITTED"] = "committed";
|
|
72
|
+
TransactionStatus["ROLLED_BACK"] = "rolled_back";
|
|
73
|
+
TransactionStatus["FAILED"] = "failed";
|
|
74
|
+
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
|
75
|
+
//# sourceMappingURL=database.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.types.js","sourceRoot":"","sources":["../../../src/database/types/database.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;AACnB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;IACvB,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAiED;;GAEG;AACH,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,gDAA2B,CAAA;IAC3B,0DAAqC,CAAA;IACrC,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;IAC3B,4DAAuC,CAAA;IACvC,oDAA+B,CAAA;AACjC,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IACtC,YACS,IAAuB,EAC9B,OAAe,EACR,aAAqB;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAmB;QAEvB,kBAAa,GAAb,aAAa,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AATD,sCASC;AAED;;GAEG;AACH,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,kEAAqC,CAAA;IACrC,8DAAiC,CAAA;IACjC,gEAAmC,CAAA;IACnC,0DAA6B,CAAA;AAC/B,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAED;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database types index
|
|
3
|
+
* Exports all type definitions for the Ductape Database ORM
|
|
4
|
+
*/
|
|
5
|
+
export * from './database.types';
|
|
6
|
+
export * from './connection.types';
|
|
7
|
+
export * from './schema.types';
|
|
8
|
+
export * from './migration.types';
|
|
9
|
+
export * from './query.types';
|
|
10
|
+
export * from './aggregation.types';
|
|
11
|
+
export * from './result.types';
|
|
12
|
+
export * from './index.types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Database types index
|
|
4
|
+
* Exports all type definitions for the Ductape Database ORM
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
// Core database types
|
|
22
|
+
__exportStar(require("./database.types"), exports);
|
|
23
|
+
// Connection types
|
|
24
|
+
__exportStar(require("./connection.types"), exports);
|
|
25
|
+
// Schema types
|
|
26
|
+
__exportStar(require("./schema.types"), exports);
|
|
27
|
+
// Migration types
|
|
28
|
+
__exportStar(require("./migration.types"), exports);
|
|
29
|
+
// Query types
|
|
30
|
+
__exportStar(require("./query.types"), exports);
|
|
31
|
+
// Aggregation types
|
|
32
|
+
__exportStar(require("./aggregation.types"), exports);
|
|
33
|
+
// Result types
|
|
34
|
+
__exportStar(require("./result.types"), exports);
|
|
35
|
+
// Index types
|
|
36
|
+
__exportStar(require("./index.types"), exports);
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/database/types/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,sBAAsB;AACtB,mDAAiC;AAEjC,mBAAmB;AACnB,qDAAmC;AAEnC,eAAe;AACf,iDAA+B;AAE/B,kBAAkB;AAClB,oDAAkC;AAElC,cAAc;AACd,gDAA8B;AAE9B,oBAAoB;AACpB,sDAAoC;AAEpC,eAAe;AACf,iDAA+B;AAE/B,cAAc;AACd,gDAA8B"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index type definitions for database indexes
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Index type
|
|
6
|
+
*/
|
|
7
|
+
export declare enum IndexType {
|
|
8
|
+
/** B-Tree index (default for most databases) */
|
|
9
|
+
BTREE = "btree",
|
|
10
|
+
/** Hash index */
|
|
11
|
+
HASH = "hash",
|
|
12
|
+
/** GIN (Generalized Inverted Index) - PostgreSQL */
|
|
13
|
+
GIN = "gin",
|
|
14
|
+
/** GiST (Generalized Search Tree) - PostgreSQL */
|
|
15
|
+
GIST = "gist",
|
|
16
|
+
/** Full-text index */
|
|
17
|
+
FULLTEXT = "fulltext",
|
|
18
|
+
/** Spatial index */
|
|
19
|
+
SPATIAL = "spatial",
|
|
20
|
+
/** Unique index */
|
|
21
|
+
UNIQUE = "unique"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Index column definition
|
|
25
|
+
*/
|
|
26
|
+
export interface IIndexColumn {
|
|
27
|
+
/** Column name */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Sort order */
|
|
30
|
+
order?: 'ASC' | 'DESC';
|
|
31
|
+
/** Length (for partial indexes on string columns) */
|
|
32
|
+
length?: number;
|
|
33
|
+
/** Expression (for expression-based indexes) */
|
|
34
|
+
expression?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Index definition
|
|
38
|
+
*/
|
|
39
|
+
export interface IIndexDefinition {
|
|
40
|
+
/** Index name */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Table name */
|
|
43
|
+
table: string;
|
|
44
|
+
/** Columns in the index */
|
|
45
|
+
columns: IIndexColumn[];
|
|
46
|
+
/** Index type */
|
|
47
|
+
type?: IndexType;
|
|
48
|
+
/** Is unique index */
|
|
49
|
+
unique?: boolean;
|
|
50
|
+
/** Partial index condition (WHERE clause) */
|
|
51
|
+
where?: string;
|
|
52
|
+
/** Index method (database-specific) */
|
|
53
|
+
method?: string;
|
|
54
|
+
/** Include columns (PostgreSQL covering indexes) */
|
|
55
|
+
include?: string[];
|
|
56
|
+
/** Comment */
|
|
57
|
+
comment?: string;
|
|
58
|
+
/** Storage parameters */
|
|
59
|
+
storageParams?: Record<string, any>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create index options
|
|
63
|
+
*/
|
|
64
|
+
export interface ICreateIndexOptions {
|
|
65
|
+
/** Table name */
|
|
66
|
+
table: string;
|
|
67
|
+
/** Environment slug (optional if connection is already established) */
|
|
68
|
+
env?: string;
|
|
69
|
+
/** Product tag (optional if connection is already established) */
|
|
70
|
+
product?: string;
|
|
71
|
+
/** Database tag (optional if connection is already established) */
|
|
72
|
+
database?: string;
|
|
73
|
+
/** Index definition */
|
|
74
|
+
index: IIndexDefinition;
|
|
75
|
+
/** Create if not exists */
|
|
76
|
+
ifNotExists?: boolean;
|
|
77
|
+
/** Create concurrently (PostgreSQL - doesn't lock table) */
|
|
78
|
+
concurrent?: boolean;
|
|
79
|
+
/** Generate migration */
|
|
80
|
+
generateMigration?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Drop index options
|
|
84
|
+
*/
|
|
85
|
+
export interface IDropIndexOptions {
|
|
86
|
+
/** Index name */
|
|
87
|
+
indexName: string;
|
|
88
|
+
/** Table name */
|
|
89
|
+
table: string;
|
|
90
|
+
/** Environment slug (optional if connection is already established) */
|
|
91
|
+
env?: string;
|
|
92
|
+
/** Product tag (optional if connection is already established) */
|
|
93
|
+
product?: string;
|
|
94
|
+
/** Database tag (optional if connection is already established) */
|
|
95
|
+
database?: string;
|
|
96
|
+
/** Drop if exists */
|
|
97
|
+
ifExists?: boolean;
|
|
98
|
+
/** Drop concurrently (PostgreSQL) */
|
|
99
|
+
concurrent?: boolean;
|
|
100
|
+
/** Cascade drop (also drop dependent objects) */
|
|
101
|
+
cascade?: boolean;
|
|
102
|
+
/** Generate migration */
|
|
103
|
+
generateMigration?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* List indexes options
|
|
107
|
+
*/
|
|
108
|
+
export interface IListIndexesOptions {
|
|
109
|
+
/** Table name */
|
|
110
|
+
table: string;
|
|
111
|
+
/** Environment slug (optional if connection is already established) */
|
|
112
|
+
env?: string;
|
|
113
|
+
/** Product tag (optional if connection is already established) */
|
|
114
|
+
product?: string;
|
|
115
|
+
/** Database tag (optional if connection is already established) */
|
|
116
|
+
database?: string;
|
|
117
|
+
/** Include system indexes */
|
|
118
|
+
includeSystem?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Index info (returned when listing indexes)
|
|
122
|
+
*/
|
|
123
|
+
export interface IIndexInfo {
|
|
124
|
+
/** Index name */
|
|
125
|
+
name: string;
|
|
126
|
+
/** Table name */
|
|
127
|
+
table: string;
|
|
128
|
+
/** Column names */
|
|
129
|
+
columns: string[];
|
|
130
|
+
/** Column definitions with details */
|
|
131
|
+
columnDetails: IIndexColumn[];
|
|
132
|
+
/** Is unique */
|
|
133
|
+
unique: boolean;
|
|
134
|
+
/** Is primary key */
|
|
135
|
+
primaryKey: boolean;
|
|
136
|
+
/** Index type */
|
|
137
|
+
type: string;
|
|
138
|
+
/** Index size (in bytes, if available) */
|
|
139
|
+
size?: number;
|
|
140
|
+
/** Number of rows in index */
|
|
141
|
+
rowCount?: number;
|
|
142
|
+
/** Partial index condition */
|
|
143
|
+
where?: string;
|
|
144
|
+
/** Comment */
|
|
145
|
+
comment?: string;
|
|
146
|
+
/** Additional metadata */
|
|
147
|
+
metadata?: Record<string, any>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Index statistics
|
|
151
|
+
*/
|
|
152
|
+
export interface IIndexStatistics {
|
|
153
|
+
/** Index name */
|
|
154
|
+
indexName: string;
|
|
155
|
+
/** Table name */
|
|
156
|
+
table: string;
|
|
157
|
+
/** Number of index scans */
|
|
158
|
+
scans?: number;
|
|
159
|
+
/** Number of tuples/rows read */
|
|
160
|
+
tuplesRead?: number;
|
|
161
|
+
/** Number of tuples fetched */
|
|
162
|
+
tuplesFetched?: number;
|
|
163
|
+
/** Index size in bytes */
|
|
164
|
+
size: number;
|
|
165
|
+
/** Index size (human-readable) */
|
|
166
|
+
sizeFormatted?: string;
|
|
167
|
+
/** Last used timestamp */
|
|
168
|
+
lastUsed?: Date | string;
|
|
169
|
+
/** Is index bloated */
|
|
170
|
+
bloated?: boolean;
|
|
171
|
+
/** Bloat percentage */
|
|
172
|
+
bloatPercentage?: number;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Analyze index options
|
|
176
|
+
*/
|
|
177
|
+
export interface IAnalyzeIndexOptions {
|
|
178
|
+
/** Index name */
|
|
179
|
+
indexName?: string;
|
|
180
|
+
/** Table name */
|
|
181
|
+
table: string;
|
|
182
|
+
/** Environment slug (optional if connection is already established) */
|
|
183
|
+
env?: string;
|
|
184
|
+
/** Product tag (optional if connection is already established) */
|
|
185
|
+
product?: string;
|
|
186
|
+
/** Database tag (optional if connection is already established) */
|
|
187
|
+
database?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Rebuild index options
|
|
191
|
+
*/
|
|
192
|
+
export interface IRebuildIndexOptions {
|
|
193
|
+
/** Index name */
|
|
194
|
+
indexName: string;
|
|
195
|
+
/** Table name */
|
|
196
|
+
table: string;
|
|
197
|
+
/** Environment slug (optional if connection is already established) */
|
|
198
|
+
env?: string;
|
|
199
|
+
/** Product tag (optional if connection is already established) */
|
|
200
|
+
product?: string;
|
|
201
|
+
/** Database tag (optional if connection is already established) */
|
|
202
|
+
database?: string;
|
|
203
|
+
/** Rebuild concurrently (PostgreSQL) */
|
|
204
|
+
concurrent?: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Index recommendation
|
|
208
|
+
*/
|
|
209
|
+
export interface IIndexRecommendation {
|
|
210
|
+
/** Recommended index definition */
|
|
211
|
+
index: IIndexDefinition;
|
|
212
|
+
/** Reason for recommendation */
|
|
213
|
+
reason: string;
|
|
214
|
+
/** Estimated performance impact */
|
|
215
|
+
impact: 'high' | 'medium' | 'low';
|
|
216
|
+
/** Query patterns that would benefit */
|
|
217
|
+
affectedQueries?: string[];
|
|
218
|
+
/** Estimated index size */
|
|
219
|
+
estimatedSize?: number;
|
|
220
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Index type definitions for database indexes
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IndexType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Index type
|
|
9
|
+
*/
|
|
10
|
+
var IndexType;
|
|
11
|
+
(function (IndexType) {
|
|
12
|
+
/** B-Tree index (default for most databases) */
|
|
13
|
+
IndexType["BTREE"] = "btree";
|
|
14
|
+
/** Hash index */
|
|
15
|
+
IndexType["HASH"] = "hash";
|
|
16
|
+
/** GIN (Generalized Inverted Index) - PostgreSQL */
|
|
17
|
+
IndexType["GIN"] = "gin";
|
|
18
|
+
/** GiST (Generalized Search Tree) - PostgreSQL */
|
|
19
|
+
IndexType["GIST"] = "gist";
|
|
20
|
+
/** Full-text index */
|
|
21
|
+
IndexType["FULLTEXT"] = "fulltext";
|
|
22
|
+
/** Spatial index */
|
|
23
|
+
IndexType["SPATIAL"] = "spatial";
|
|
24
|
+
/** Unique index */
|
|
25
|
+
IndexType["UNIQUE"] = "unique";
|
|
26
|
+
})(IndexType || (exports.IndexType = IndexType = {}));
|
|
27
|
+
//# sourceMappingURL=index.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../../src/database/types/index.types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,IAAY,SAeX;AAfD,WAAY,SAAS;IACnB,gDAAgD;IAChD,4BAAe,CAAA;IACf,iBAAiB;IACjB,0BAAa,CAAA;IACb,oDAAoD;IACpD,wBAAW,CAAA;IACX,kDAAkD;IAClD,0BAAa,CAAA;IACb,sBAAsB;IACtB,kCAAqB,CAAA;IACrB,oBAAoB;IACpB,gCAAmB,CAAA;IACnB,mBAAmB;IACnB,8BAAiB,CAAA;AACnB,CAAC,EAfW,SAAS,yBAAT,SAAS,QAepB"}
|