@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.
Files changed (338) hide show
  1. package/README.md +1 -1
  2. package/dist/api/services/appApi.service.d.ts +48 -2
  3. package/dist/api/services/appApi.service.js +101 -2
  4. package/dist/api/services/appApi.service.js.map +1 -1
  5. package/dist/api/services/pricingApi.service.d.ts +10 -0
  6. package/dist/api/services/pricingApi.service.js +34 -0
  7. package/dist/api/services/pricingApi.service.js.map +1 -0
  8. package/dist/api/services/processorApi.service.d.ts +12 -2
  9. package/dist/api/services/processorApi.service.js +12 -2
  10. package/dist/api/services/processorApi.service.js.map +1 -1
  11. package/dist/api/services/productsApi.service.d.ts +40 -1
  12. package/dist/api/services/productsApi.service.js +105 -1
  13. package/dist/api/services/productsApi.service.js.map +1 -1
  14. package/dist/api/services/userApi.service.js +1 -0
  15. package/dist/api/services/userApi.service.js.map +1 -1
  16. package/dist/api/services/workspaceApi.service.js +1 -0
  17. package/dist/api/services/workspaceApi.service.js.map +1 -1
  18. package/dist/api/services/workspaceSecretsApi.service.d.ts +75 -0
  19. package/dist/api/services/workspaceSecretsApi.service.js +62 -0
  20. package/dist/api/services/workspaceSecretsApi.service.js.map +1 -0
  21. package/dist/api/urls.d.ts +6 -1
  22. package/dist/api/urls.js +12 -2
  23. package/dist/api/urls.js.map +1 -1
  24. package/dist/api/utils/cache.utils.d.ts +1 -1
  25. package/dist/api/utils/cache.utils.js +10 -4
  26. package/dist/api/utils/cache.utils.js.map +1 -1
  27. package/dist/api/utils/strings.utils.d.ts +2 -0
  28. package/dist/api/utils/strings.utils.js +14 -0
  29. package/dist/api/utils/strings.utils.js.map +1 -1
  30. package/dist/apps/services/app.service.d.ts +51 -33
  31. package/dist/apps/services/app.service.js +488 -244
  32. package/dist/apps/services/app.service.js.map +1 -1
  33. package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
  34. package/dist/apps/validators/joi-validators/create.appAction.validator.js +21 -2
  35. package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
  36. package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
  37. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
  38. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
  39. package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -1
  40. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
  41. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +1 -1
  42. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +34 -1
  43. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -1
  44. package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
  45. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
  46. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
  47. package/dist/clients/pricing.client.d.ts +3 -0
  48. package/dist/clients/pricing.client.js +33 -0
  49. package/dist/clients/pricing.client.js.map +1 -0
  50. package/dist/database/adapters/base.adapter.d.ts +176 -0
  51. package/dist/database/adapters/base.adapter.js +31 -0
  52. package/dist/database/adapters/base.adapter.js.map +1 -0
  53. package/dist/database/adapters/dynamodb.adapter.d.ts +91 -0
  54. package/dist/database/adapters/dynamodb.adapter.js +1608 -0
  55. package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
  56. package/dist/database/adapters/mongodb.adapter.d.ts +71 -0
  57. package/dist/database/adapters/mongodb.adapter.js +1072 -0
  58. package/dist/database/adapters/mongodb.adapter.js.map +1 -0
  59. package/dist/database/adapters/mysql.adapter.d.ts +146 -0
  60. package/dist/database/adapters/mysql.adapter.js +1492 -0
  61. package/dist/database/adapters/mysql.adapter.js.map +1 -0
  62. package/dist/database/adapters/postgresql.adapter.d.ts +147 -0
  63. package/dist/database/adapters/postgresql.adapter.js +1603 -0
  64. package/dist/database/adapters/postgresql.adapter.js.map +1 -0
  65. package/dist/database/database.service.d.ts +232 -0
  66. package/dist/database/database.service.js +802 -0
  67. package/dist/database/database.service.js.map +1 -0
  68. package/dist/database/index.d.ts +18 -0
  69. package/dist/database/index.js +98 -0
  70. package/dist/database/index.js.map +1 -0
  71. package/dist/database/types/aggregation.types.d.ts +261 -0
  72. package/dist/database/types/aggregation.types.js +21 -0
  73. package/dist/database/types/aggregation.types.js.map +1 -0
  74. package/dist/database/types/connection.types.d.ts +132 -0
  75. package/dist/database/types/connection.types.js +6 -0
  76. package/dist/database/types/connection.types.js.map +1 -0
  77. package/dist/database/types/database.types.d.ts +175 -0
  78. package/dist/database/types/database.types.js +75 -0
  79. package/dist/database/types/database.types.js.map +1 -0
  80. package/dist/database/types/index.d.ts +12 -0
  81. package/dist/database/types/index.js +37 -0
  82. package/dist/database/types/index.js.map +1 -0
  83. package/dist/database/types/index.types.d.ts +220 -0
  84. package/dist/database/types/index.types.js +27 -0
  85. package/dist/database/types/index.types.js.map +1 -0
  86. package/dist/database/types/migration.types.d.ts +205 -0
  87. package/dist/database/types/migration.types.js +44 -0
  88. package/dist/database/types/migration.types.js.map +1 -0
  89. package/dist/database/types/query.types.d.ts +305 -0
  90. package/dist/database/types/query.types.js +57 -0
  91. package/dist/database/types/query.types.js.map +1 -0
  92. package/dist/database/types/result.types.d.ts +220 -0
  93. package/dist/database/types/result.types.js +6 -0
  94. package/dist/database/types/result.types.js.map +1 -0
  95. package/dist/database/types/schema.types.d.ts +190 -0
  96. package/dist/database/types/schema.types.js +69 -0
  97. package/dist/database/types/schema.types.js.map +1 -0
  98. package/dist/database/utils/helpers.d.ts +66 -0
  99. package/dist/database/utils/helpers.js +501 -0
  100. package/dist/database/utils/helpers.js.map +1 -0
  101. package/dist/database/utils/migration.utils.d.ts +151 -0
  102. package/dist/database/utils/migration.utils.js +476 -0
  103. package/dist/database/utils/migration.utils.js.map +1 -0
  104. package/dist/database/utils/transaction.d.ts +64 -0
  105. package/dist/database/utils/transaction.js +130 -0
  106. package/dist/database/utils/transaction.js.map +1 -0
  107. package/dist/database/validators/connection.validator.d.ts +20 -0
  108. package/dist/database/validators/connection.validator.js +267 -0
  109. package/dist/database/validators/connection.validator.js.map +1 -0
  110. package/dist/database/validators/query.validator.d.ts +31 -0
  111. package/dist/database/validators/query.validator.js +305 -0
  112. package/dist/database/validators/query.validator.js.map +1 -0
  113. package/dist/database/validators/schema.validator.d.ts +31 -0
  114. package/dist/database/validators/schema.validator.js +334 -0
  115. package/dist/database/validators/schema.validator.js.map +1 -0
  116. package/dist/graph/adapters/arangodb.adapter.d.ts +80 -0
  117. package/dist/graph/adapters/arangodb.adapter.js +1393 -0
  118. package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
  119. package/dist/graph/adapters/base.adapter.d.ts +228 -0
  120. package/dist/graph/adapters/base.adapter.js +38 -0
  121. package/dist/graph/adapters/base.adapter.js.map +1 -0
  122. package/dist/graph/adapters/index.d.ts +10 -0
  123. package/dist/graph/adapters/index.js +23 -0
  124. package/dist/graph/adapters/index.js.map +1 -0
  125. package/dist/graph/adapters/memgraph.adapter.d.ts +85 -0
  126. package/dist/graph/adapters/memgraph.adapter.js +1491 -0
  127. package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
  128. package/dist/graph/adapters/neo4j.adapter.d.ts +88 -0
  129. package/dist/graph/adapters/neo4j.adapter.js +1861 -0
  130. package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
  131. package/dist/graph/adapters/neptune.adapter.d.ts +87 -0
  132. package/dist/graph/adapters/neptune.adapter.js +1430 -0
  133. package/dist/graph/adapters/neptune.adapter.js.map +1 -0
  134. package/dist/graph/graph.service.d.ts +278 -0
  135. package/dist/graph/graph.service.js +687 -0
  136. package/dist/graph/graph.service.js.map +1 -0
  137. package/dist/graph/index.d.ts +11 -0
  138. package/dist/graph/index.js +42 -0
  139. package/dist/graph/index.js.map +1 -0
  140. package/dist/graph/types/connection.types.d.ts +158 -0
  141. package/dist/graph/types/connection.types.js +43 -0
  142. package/dist/graph/types/connection.types.js.map +1 -0
  143. package/dist/graph/types/graph.types.d.ts +144 -0
  144. package/dist/graph/types/graph.types.js +84 -0
  145. package/dist/graph/types/graph.types.js.map +1 -0
  146. package/dist/graph/types/index.d.ts +11 -0
  147. package/dist/graph/types/index.js +35 -0
  148. package/dist/graph/types/index.js.map +1 -0
  149. package/dist/graph/types/node.types.d.ts +193 -0
  150. package/dist/graph/types/node.types.js +49 -0
  151. package/dist/graph/types/node.types.js.map +1 -0
  152. package/dist/graph/types/path.types.d.ts +224 -0
  153. package/dist/graph/types/path.types.js +38 -0
  154. package/dist/graph/types/path.types.js.map +1 -0
  155. package/dist/graph/types/query.types.d.ts +247 -0
  156. package/dist/graph/types/query.types.js +23 -0
  157. package/dist/graph/types/query.types.js.map +1 -0
  158. package/dist/graph/types/relationship.types.d.ts +224 -0
  159. package/dist/graph/types/relationship.types.js +35 -0
  160. package/dist/graph/types/relationship.types.js.map +1 -0
  161. package/dist/graph/types/result.types.d.ts +237 -0
  162. package/dist/graph/types/result.types.js +7 -0
  163. package/dist/graph/types/result.types.js.map +1 -0
  164. package/dist/graph/validators/index.d.ts +81 -0
  165. package/dist/graph/validators/index.js +243 -0
  166. package/dist/graph/validators/index.js.map +1 -0
  167. package/dist/imports/imports.service.d.ts +3 -3
  168. package/dist/imports/imports.service.js +7 -7
  169. package/dist/imports/imports.service.js.map +1 -1
  170. package/dist/imports/imports.types.d.ts +8 -0
  171. package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
  172. package/dist/imports/repos/postmanV21.repo.js +29 -2
  173. package/dist/imports/repos/postmanV21.repo.js.map +1 -1
  174. package/dist/index.d.ts +1244 -150
  175. package/dist/index.js +1309 -209
  176. package/dist/index.js.map +1 -1
  177. package/dist/inputs/inputs.service.js +2 -2
  178. package/dist/inputs/inputs.service.js.map +1 -1
  179. package/dist/inputs/utils/inputs.utils.create.js +1 -1
  180. package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
  181. package/dist/logs/logs.types.d.ts +5 -0
  182. package/dist/logs/logs.types.js +1 -0
  183. package/dist/logs/logs.types.js.map +1 -1
  184. package/dist/parsers/index.d.ts +3 -0
  185. package/dist/parsers/index.js +27 -0
  186. package/dist/parsers/index.js.map +1 -0
  187. package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
  188. package/dist/parsers/pipelines/postman.pipelines.js +103 -0
  189. package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
  190. package/dist/parsers/types/postman.types.d.ts +200 -0
  191. package/dist/parsers/types/postman.types.js +3 -0
  192. package/dist/parsers/types/postman.types.js.map +1 -0
  193. package/dist/parsers/utils/postman.utils.d.ts +12 -0
  194. package/dist/parsers/utils/postman.utils.js +116 -0
  195. package/dist/parsers/utils/postman.utils.js.map +1 -0
  196. package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
  197. package/dist/parsers/validators/postman-auth.validators.js +127 -0
  198. package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
  199. package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
  200. package/dist/parsers/validators/postman-request.validators.js +139 -0
  201. package/dist/parsers/validators/postman-request.validators.js.map +1 -0
  202. package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
  203. package/dist/parsers/validators/postman-response.validators.js +150 -0
  204. package/dist/parsers/validators/postman-response.validators.js.map +1 -0
  205. package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
  206. package/dist/parsers/validators/postman-variable.validators.js +163 -0
  207. package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
  208. package/dist/pricing/pricing.repo.d.ts +0 -0
  209. package/dist/pricing/pricing.repo.js +1 -0
  210. package/dist/pricing/pricing.repo.js.map +1 -0
  211. package/dist/pricing/pricing.service.d.ts +24 -0
  212. package/dist/pricing/pricing.service.js +51 -0
  213. package/dist/pricing/pricing.service.js.map +1 -0
  214. package/dist/pricing/pricing.types.d.ts +76 -0
  215. package/dist/pricing/pricing.types.js +21 -0
  216. package/dist/pricing/pricing.types.js.map +1 -0
  217. package/dist/pricing/utils/string.utils.d.ts +1 -0
  218. package/dist/pricing/utils/string.utils.js +9 -0
  219. package/dist/pricing/utils/string.utils.js.map +1 -0
  220. package/dist/processor/repos/sms.repo.d.ts +4 -4
  221. package/dist/processor/repos/sms.repo.js +23 -10
  222. package/dist/processor/repos/sms.repo.js.map +1 -1
  223. package/dist/processor/services/messagebrokers/kafka.service.js +0 -2
  224. package/dist/processor/services/messagebrokers/kafka.service.js.map +1 -1
  225. package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +9 -1
  226. package/dist/processor/services/messagebrokers/rabbitmq.service.js +40 -11
  227. package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +1 -1
  228. package/dist/processor/services/processor.service.d.ts +38 -10
  229. package/dist/processor/services/processor.service.js +533 -248
  230. package/dist/processor/services/processor.service.js.map +1 -1
  231. package/dist/processor/services/request.service.d.ts +36 -0
  232. package/dist/processor/services/request.service.js +304 -0
  233. package/dist/processor/services/request.service.js.map +1 -0
  234. package/dist/processor/types/request.types.d.ts +14 -0
  235. package/dist/processor/types/request.types.js +3 -0
  236. package/dist/processor/types/request.types.js.map +1 -0
  237. package/dist/processor/utils/processor.utils.d.ts +3 -0
  238. package/dist/processor/utils/processor.utils.js +84 -22
  239. package/dist/processor/utils/processor.utils.js.map +1 -1
  240. package/dist/processor/utils/request.utils.d.ts +20 -0
  241. package/dist/processor/utils/request.utils.js +113 -0
  242. package/dist/processor/utils/request.utils.js.map +1 -0
  243. package/dist/products/services/products.service.d.ts +114 -77
  244. package/dist/products/services/products.service.js +805 -362
  245. package/dist/products/services/products.service.js.map +1 -1
  246. package/dist/products/services/utils/crypt.utils.d.ts +1 -0
  247. package/dist/products/services/utils/crypt.utils.js +17 -0
  248. package/dist/products/services/utils/crypt.utils.js.map +1 -0
  249. package/dist/products/services/utils/functions.utils.d.ts +13 -0
  250. package/dist/products/services/utils/functions.utils.js +289 -0
  251. package/dist/products/services/utils/functions.utils.js.map +1 -0
  252. package/dist/products/services/utils/objects.utils.d.ts +13 -0
  253. package/dist/products/services/utils/objects.utils.js +89 -0
  254. package/dist/products/services/utils/objects.utils.js.map +1 -0
  255. package/dist/products/services/utils/string.utils.d.ts +12 -0
  256. package/dist/products/services/utils/string.utils.js +168 -0
  257. package/dist/products/services/utils/string.utils.js.map +1 -0
  258. package/dist/products/utils/string.utils.d.ts +1 -1
  259. package/dist/products/utils/string.utils.js +14 -2
  260. package/dist/products/utils/string.utils.js.map +1 -1
  261. package/dist/products/validators/index.d.ts +4 -1
  262. package/dist/products/validators/index.js +7 -1
  263. package/dist/products/validators/index.js.map +1 -1
  264. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +15 -4
  265. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +501 -109
  266. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
  267. package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
  268. package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
  269. package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
  270. package/dist/products/validators/joi-validators/create.productGraph.validator.js +82 -0
  271. package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
  272. package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +14 -0
  273. package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +696 -0
  274. package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +1 -0
  275. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
  276. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
  277. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
  278. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
  279. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
  280. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +9 -4
  281. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
  282. package/dist/products/validators/joi-validators/create.productNotification.validator.js +5 -2
  283. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
  284. package/dist/products/validators/joi-validators/create.userAuth.validator.js +1 -0
  285. package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -1
  286. package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
  287. package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
  288. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +6 -0
  289. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +28 -26
  290. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
  291. package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
  292. package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
  293. package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
  294. package/dist/products/validators/joi-validators/update.productGraph.validator.js +87 -0
  295. package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
  296. package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +7 -0
  297. package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +72 -0
  298. package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +1 -0
  299. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +1 -0
  300. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -1
  301. package/dist/products/validators/joi-validators/update.userAuth.validator.js +1 -0
  302. package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -1
  303. package/dist/test/test.health.d.ts +1 -0
  304. package/dist/test/test.health.js +49 -0
  305. package/dist/test/test.health.js.map +1 -0
  306. package/dist/test/test.import.js +51 -4
  307. package/dist/test/test.import.js.map +1 -1
  308. package/dist/test/test.imports.js +22 -7
  309. package/dist/test/test.imports.js.map +1 -1
  310. package/dist/test/test.notifiers.d.ts +1 -0
  311. package/dist/test/test.notifiers.js +85 -0
  312. package/dist/test/test.notifiers.js.map +1 -0
  313. package/dist/test/test.processor.js +30 -115
  314. package/dist/test/test.processor.js.map +1 -1
  315. package/dist/test/test.products.d.ts +1 -0
  316. package/dist/test/test.products.js +49 -0
  317. package/dist/test/test.products.js.map +1 -0
  318. package/dist/tsconfig.tsbuildinfo +1 -0
  319. package/dist/types/appBuilder.types.d.ts +5 -12
  320. package/dist/types/enums.d.ts +4 -1
  321. package/dist/types/enums.js +3 -0
  322. package/dist/types/enums.js.map +1 -1
  323. package/dist/types/index.types.d.ts +4 -0
  324. package/dist/types/pricing.types.d.ts +4 -0
  325. package/dist/types/pricing.types.js +3 -0
  326. package/dist/types/pricing.types.js.map +1 -0
  327. package/dist/types/processor.types.d.ts +67 -11
  328. package/dist/types/processor.types.js.map +1 -1
  329. package/dist/types/productsBuilder.types.d.ts +132 -14
  330. package/dist/types/productsBuilder.types.js +69 -4
  331. package/dist/types/productsBuilder.types.js.map +1 -1
  332. package/dist/types/request-tracker.interface.d.ts +0 -0
  333. package/dist/types/request-tracker.interface.js +1 -0
  334. package/dist/types/request-tracker.interface.js.map +1 -0
  335. package/dist/utils/constants.d.ts +1 -0
  336. package/dist/utils/constants.js +5 -0
  337. package/dist/utils/constants.js.map +1 -0
  338. package/package.json +17 -3
@@ -0,0 +1,220 @@
1
+ /**
2
+ * Result type definitions for database operations
3
+ */
4
+ /**
5
+ * Query result
6
+ */
7
+ export interface IQueryResult<T = any> {
8
+ /** Result rows/documents */
9
+ data: T[];
10
+ /** Total count (if available) */
11
+ count?: number;
12
+ /** Execution time in milliseconds */
13
+ executionTime?: number;
14
+ /** Database type that executed the query */
15
+ databaseType?: string;
16
+ }
17
+ /**
18
+ * Insert result
19
+ */
20
+ export interface IInsertResult<T = any> {
21
+ /** Number of rows inserted */
22
+ insertedCount: number;
23
+ /** Inserted row IDs */
24
+ insertedIds?: (string | number)[];
25
+ /** Inserted rows (if returning option was used) */
26
+ data?: T[];
27
+ /** Execution time in milliseconds */
28
+ executionTime?: number;
29
+ /** Success flag */
30
+ success: boolean;
31
+ }
32
+ /**
33
+ * Update result
34
+ */
35
+ export interface IUpdateResult<T = any> {
36
+ /** Number of rows updated */
37
+ updatedCount: number;
38
+ /** Number of rows matched by the where clause */
39
+ matchedCount?: number;
40
+ /** Updated rows (if returning option was used) */
41
+ data?: T[];
42
+ /** Execution time in milliseconds */
43
+ executionTime?: number;
44
+ /** Success flag */
45
+ success: boolean;
46
+ }
47
+ /**
48
+ * Delete result
49
+ */
50
+ export interface IDeleteResult<T = any> {
51
+ /** Number of rows deleted */
52
+ deletedCount: number;
53
+ /** Deleted rows (if returning option was used) */
54
+ data?: T[];
55
+ /** Execution time in milliseconds */
56
+ executionTime?: number;
57
+ /** Success flag */
58
+ success: boolean;
59
+ }
60
+ /**
61
+ * Upsert result
62
+ */
63
+ export interface IUpsertResult<T = any> {
64
+ /** Number of rows inserted */
65
+ insertedCount: number;
66
+ /** Number of rows updated */
67
+ updatedCount: number;
68
+ /** Total affected rows */
69
+ affectedCount: number;
70
+ /** Operation performed ('insert' or 'update') - only applicable for single-row upserts */
71
+ operation?: 'insert' | 'update';
72
+ /** Upserted rows (if returning option was used) */
73
+ data?: T[];
74
+ /** Execution time in milliseconds */
75
+ executionTime?: number;
76
+ /** Success flag */
77
+ success: boolean;
78
+ }
79
+ /**
80
+ * Bulk operation result
81
+ */
82
+ export interface IBulkOperationResult {
83
+ /** Number of successful operations */
84
+ successCount: number;
85
+ /** Number of failed operations */
86
+ failedCount: number;
87
+ /** Total operations */
88
+ totalCount: number;
89
+ /** Errors (if any) */
90
+ errors?: Array<{
91
+ index: number;
92
+ error: string;
93
+ }>;
94
+ /** Execution time in milliseconds */
95
+ executionTime?: number;
96
+ /** Success flag */
97
+ success: boolean;
98
+ }
99
+ /**
100
+ * Transaction result
101
+ */
102
+ export interface ITransactionResult {
103
+ /** Transaction ID */
104
+ transactionId?: string;
105
+ /** Operations executed */
106
+ operationsCount: number;
107
+ /** Success flag */
108
+ success: boolean;
109
+ /** Error message (if failed) */
110
+ error?: string;
111
+ /** Execution time in milliseconds */
112
+ executionTime?: number;
113
+ }
114
+ /**
115
+ * Schema operation result
116
+ */
117
+ export interface ISchemaOperationResult {
118
+ /** Success flag */
119
+ success: boolean;
120
+ /** Operation type */
121
+ operation: 'create' | 'alter' | 'drop' | 'rename';
122
+ /** Table/Collection name */
123
+ table: string;
124
+ /** Error message (if failed) */
125
+ error?: string;
126
+ /** Migration generated (if applicable) */
127
+ migration?: {
128
+ tag: string;
129
+ name: string;
130
+ };
131
+ /** Execution time in milliseconds */
132
+ executionTime?: number;
133
+ }
134
+ /**
135
+ * Index operation result
136
+ */
137
+ export interface IIndexOperationResult {
138
+ /** Success flag */
139
+ success: boolean;
140
+ /** Operation type */
141
+ operation: 'create' | 'drop';
142
+ /** Index name */
143
+ indexName: string;
144
+ /** Table name */
145
+ table: string;
146
+ /** Error message (if failed) */
147
+ error?: string;
148
+ /** Execution time in milliseconds */
149
+ executionTime?: number;
150
+ }
151
+ /**
152
+ * Raw query result
153
+ */
154
+ export interface IRawQueryResult<T = any> {
155
+ /** Result rows/documents */
156
+ rows: T[];
157
+ /** Row count */
158
+ rowCount: number;
159
+ /** Fields/columns info */
160
+ fields?: Array<{
161
+ name: string;
162
+ type: string;
163
+ }>;
164
+ /** Execution time in milliseconds */
165
+ executionTime?: number;
166
+ }
167
+ /**
168
+ * Paginated result
169
+ */
170
+ export interface IPaginatedResult<T = any> {
171
+ /** Current page data */
172
+ data: T[];
173
+ /** Pagination metadata */
174
+ pagination: {
175
+ /** Current page number */
176
+ page: number;
177
+ /** Page size */
178
+ pageSize: number;
179
+ /** Total records */
180
+ totalRecords: number;
181
+ /** Total pages */
182
+ totalPages: number;
183
+ /** Has next page */
184
+ hasNext: boolean;
185
+ /** Has previous page */
186
+ hasPrevious: boolean;
187
+ };
188
+ /** Execution time in milliseconds */
189
+ executionTime?: number;
190
+ }
191
+ /**
192
+ * Batch operation result item
193
+ */
194
+ export interface IBatchOperationResultItem {
195
+ /** Operation index */
196
+ index: number;
197
+ /** Success flag */
198
+ success: boolean;
199
+ /** Result data */
200
+ result?: any;
201
+ /** Error (if failed) */
202
+ error?: string;
203
+ }
204
+ /**
205
+ * Connection test result
206
+ */
207
+ export interface IConnectionTestResult {
208
+ /** Is connection successful */
209
+ connected: boolean;
210
+ /** Connection message */
211
+ message: string;
212
+ /** Database type */
213
+ databaseType: string;
214
+ /** Database version */
215
+ version?: string;
216
+ /** Response time in milliseconds */
217
+ responseTime: number;
218
+ /** Error (if failed) */
219
+ error?: string;
220
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Result type definitions for database operations
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=result.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.types.js","sourceRoot":"","sources":["../../../src/database/types/result.types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Schema type definitions for tables, columns, and data types
3
+ * Provides unified interface for SQL and NoSQL schema operations
4
+ */
5
+ import type { IIndexDefinition } from './index.types';
6
+ /**
7
+ * Column data types (unified across SQL and NoSQL)
8
+ */
9
+ export declare enum ColumnType {
10
+ STRING = "string",
11
+ TEXT = "text",
12
+ VARCHAR = "varchar",
13
+ CHAR = "char",
14
+ INTEGER = "integer",
15
+ BIGINT = "bigint",
16
+ SMALLINT = "smallint",
17
+ DECIMAL = "decimal",
18
+ NUMERIC = "numeric",
19
+ FLOAT = "float",
20
+ DOUBLE = "double",
21
+ REAL = "real",
22
+ BOOLEAN = "boolean",
23
+ DATE = "date",
24
+ TIME = "time",
25
+ DATETIME = "datetime",
26
+ TIMESTAMP = "timestamp",
27
+ JSON = "json",
28
+ JSONB = "jsonb",
29
+ OBJECT = "object",
30
+ ARRAY = "array",
31
+ BINARY = "binary",
32
+ BLOB = "blob",
33
+ UUID = "uuid",
34
+ ENUM = "enum"
35
+ }
36
+ /**
37
+ * Column constraint types
38
+ */
39
+ export declare enum ConstraintType {
40
+ PRIMARY_KEY = "primary_key",
41
+ FOREIGN_KEY = "foreign_key",
42
+ UNIQUE = "unique",
43
+ NOT_NULL = "not_null",
44
+ DEFAULT = "default",
45
+ CHECK = "check",
46
+ INDEX = "index"
47
+ }
48
+ /**
49
+ * Column definition
50
+ */
51
+ export interface IColumnDefinition {
52
+ /** Column name */
53
+ name: string;
54
+ /** Column type */
55
+ type: ColumnType;
56
+ /** Is column nullable */
57
+ nullable?: boolean;
58
+ /** Default value */
59
+ defaultValue?: any;
60
+ /** Is primary key */
61
+ primaryKey?: boolean;
62
+ /** Is unique */
63
+ unique?: boolean;
64
+ /** Is auto-increment */
65
+ autoIncrement?: boolean;
66
+ /** Column length (for string types) */
67
+ length?: number;
68
+ /** Precision (for decimal/numeric) */
69
+ precision?: number;
70
+ /** Scale (for decimal/numeric) */
71
+ scale?: number;
72
+ /** Enum values (for enum type) */
73
+ enumValues?: string[];
74
+ /** Foreign key reference */
75
+ foreignKey?: IForeignKeyDefinition;
76
+ /** Check constraint */
77
+ check?: string;
78
+ /** Comment */
79
+ comment?: string;
80
+ /** For nested objects (NoSQL) */
81
+ nested?: INestedFieldDefinition;
82
+ }
83
+ /**
84
+ * Foreign key definition
85
+ */
86
+ export interface IForeignKeyDefinition {
87
+ /** Referenced table */
88
+ table: string;
89
+ /** Referenced column */
90
+ column: string;
91
+ /** On delete action */
92
+ onDelete?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
93
+ /** On update action */
94
+ onUpdate?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
95
+ }
96
+ /**
97
+ * Nested field definition (for NoSQL/JSON columns)
98
+ */
99
+ export interface INestedFieldDefinition {
100
+ /** Nested field type */
101
+ type: ColumnType;
102
+ /** Is array of values */
103
+ isArray?: boolean;
104
+ /** Child fields (for nested objects) */
105
+ fields?: Record<string, INestedFieldDefinition>;
106
+ }
107
+ /**
108
+ * Table schema definition
109
+ */
110
+ export interface ITableSchema {
111
+ /** Table/Collection name */
112
+ name: string;
113
+ /** Column definitions */
114
+ columns: IColumnDefinition[];
115
+ /** Primary key columns (composite keys) */
116
+ primaryKeys?: string[];
117
+ /** Indexes */
118
+ indexes?: IIndexDefinition[];
119
+ /** Unique constraints */
120
+ uniqueConstraints?: string[][];
121
+ /** Check constraints */
122
+ checkConstraints?: Array<{
123
+ name: string;
124
+ expression: string;
125
+ }>;
126
+ /** Table comment */
127
+ comment?: string;
128
+ /** Table options (engine, charset, etc.) */
129
+ options?: Record<string, any>;
130
+ }
131
+ /**
132
+ * Column alteration types
133
+ */
134
+ export declare enum ColumnAlterationType {
135
+ ADD = "add",
136
+ MODIFY = "modify",
137
+ DROP = "drop",
138
+ RENAME = "rename"
139
+ }
140
+ /**
141
+ * Column alteration operation
142
+ */
143
+ export interface IColumnAlteration {
144
+ /** Type of alteration */
145
+ type: ColumnAlterationType;
146
+ /** Column definition (for ADD/MODIFY) */
147
+ column?: IColumnDefinition;
148
+ /** Old column name (for RENAME) */
149
+ oldName?: string;
150
+ /** New column name (for RENAME) */
151
+ newName?: string;
152
+ }
153
+ /**
154
+ * Schema validation result
155
+ */
156
+ export interface ISchemaValidationResult {
157
+ /** Is schema valid */
158
+ valid: boolean;
159
+ /** Validation errors */
160
+ errors: Array<{
161
+ field: string;
162
+ message: string;
163
+ }>;
164
+ }
165
+ /**
166
+ * Table creation options
167
+ */
168
+ export interface ICreateTableOptions {
169
+ /** Create if not exists */
170
+ ifNotExists?: boolean;
171
+ /** Table comment */
172
+ comment?: string;
173
+ /** Table engine (MySQL) */
174
+ engine?: string;
175
+ /** Character set (MySQL) */
176
+ charset?: string;
177
+ /** Collation */
178
+ collate?: string;
179
+ /** Additional options */
180
+ options?: Record<string, any>;
181
+ }
182
+ /**
183
+ * Table alteration options
184
+ */
185
+ export interface IAlterTableOptions {
186
+ /** Generate migration */
187
+ generateMigration?: boolean;
188
+ /** Migration name */
189
+ migrationName?: string;
190
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /**
3
+ * Schema type definitions for tables, columns, and data types
4
+ * Provides unified interface for SQL and NoSQL schema operations
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ColumnAlterationType = exports.ConstraintType = exports.ColumnType = void 0;
8
+ /**
9
+ * Column data types (unified across SQL and NoSQL)
10
+ */
11
+ var ColumnType;
12
+ (function (ColumnType) {
13
+ // String types
14
+ ColumnType["STRING"] = "string";
15
+ ColumnType["TEXT"] = "text";
16
+ ColumnType["VARCHAR"] = "varchar";
17
+ ColumnType["CHAR"] = "char";
18
+ // Number types
19
+ ColumnType["INTEGER"] = "integer";
20
+ ColumnType["BIGINT"] = "bigint";
21
+ ColumnType["SMALLINT"] = "smallint";
22
+ ColumnType["DECIMAL"] = "decimal";
23
+ ColumnType["NUMERIC"] = "numeric";
24
+ ColumnType["FLOAT"] = "float";
25
+ ColumnType["DOUBLE"] = "double";
26
+ ColumnType["REAL"] = "real";
27
+ // Boolean
28
+ ColumnType["BOOLEAN"] = "boolean";
29
+ // Date/Time types
30
+ ColumnType["DATE"] = "date";
31
+ ColumnType["TIME"] = "time";
32
+ ColumnType["DATETIME"] = "datetime";
33
+ ColumnType["TIMESTAMP"] = "timestamp";
34
+ // JSON/Object types
35
+ ColumnType["JSON"] = "json";
36
+ ColumnType["JSONB"] = "jsonb";
37
+ ColumnType["OBJECT"] = "object";
38
+ ColumnType["ARRAY"] = "array";
39
+ // Binary
40
+ ColumnType["BINARY"] = "binary";
41
+ ColumnType["BLOB"] = "blob";
42
+ // Special types
43
+ ColumnType["UUID"] = "uuid";
44
+ ColumnType["ENUM"] = "enum";
45
+ })(ColumnType || (exports.ColumnType = ColumnType = {}));
46
+ /**
47
+ * Column constraint types
48
+ */
49
+ var ConstraintType;
50
+ (function (ConstraintType) {
51
+ ConstraintType["PRIMARY_KEY"] = "primary_key";
52
+ ConstraintType["FOREIGN_KEY"] = "foreign_key";
53
+ ConstraintType["UNIQUE"] = "unique";
54
+ ConstraintType["NOT_NULL"] = "not_null";
55
+ ConstraintType["DEFAULT"] = "default";
56
+ ConstraintType["CHECK"] = "check";
57
+ ConstraintType["INDEX"] = "index";
58
+ })(ConstraintType || (exports.ConstraintType = ConstraintType = {}));
59
+ /**
60
+ * Column alteration types
61
+ */
62
+ var ColumnAlterationType;
63
+ (function (ColumnAlterationType) {
64
+ ColumnAlterationType["ADD"] = "add";
65
+ ColumnAlterationType["MODIFY"] = "modify";
66
+ ColumnAlterationType["DROP"] = "drop";
67
+ ColumnAlterationType["RENAME"] = "rename";
68
+ })(ColumnAlterationType || (exports.ColumnAlterationType = ColumnAlterationType = {}));
69
+ //# sourceMappingURL=schema.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.types.js","sourceRoot":"","sources":["../../../src/database/types/schema.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,UAuCX;AAvCD,WAAY,UAAU;IACpB,eAAe;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IAEb,eAAe;IACf,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IAEb,UAAU;IACV,iCAAmB,CAAA;IAEnB,kBAAkB;IAClB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IAEvB,oBAAoB;IACpB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IAEf,SAAS;IACT,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IAEb,gBAAgB;IAChB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAvCW,UAAU,0BAAV,UAAU,QAuCrB;AAED;;GAEG;AACH,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAyFD;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Database Helper Utilities
3
+ * Type mapping, query building, and error handling utilities
4
+ */
5
+ import { ColumnType } from '../types/schema.types';
6
+ import { DatabaseType } from '../types/database.types';
7
+ import { WhereClause } from '../types/query.types';
8
+ /**
9
+ * Map generic column types to database-specific types
10
+ */
11
+ export declare function mapColumnTypeToNative(type: ColumnType, dbType: DatabaseType): string;
12
+ /**
13
+ * Build WHERE clause string for SQL databases from WhereClause
14
+ */
15
+ export declare function buildWhereClause(where: WhereClause, paramIndex?: number): {
16
+ sql: string;
17
+ params: any[];
18
+ };
19
+ /**
20
+ * Build MongoDB query from WhereClause
21
+ */
22
+ export declare function buildMongoQuery(where: WhereClause): any;
23
+ /**
24
+ * Escape identifier (table/column name) for SQL
25
+ */
26
+ export declare function escapeIdentifier(identifier: string, dbType: DatabaseType): string;
27
+ /**
28
+ * Escape string value for SQL
29
+ */
30
+ export declare function escapeValue(value: any): string;
31
+ /**
32
+ * Format error message with context
33
+ */
34
+ export declare function formatDatabaseError(error: any, operation: string, tableName?: string): Error;
35
+ /**
36
+ * Check if error is a connection error
37
+ */
38
+ export declare function isConnectionError(error: any): boolean;
39
+ /**
40
+ * Check if error is a duplicate key error
41
+ */
42
+ export declare function isDuplicateKeyError(error: any): boolean;
43
+ /**
44
+ * Check if error is a foreign key constraint error
45
+ */
46
+ export declare function isForeignKeyError(error: any): boolean;
47
+ /**
48
+ * Retry a database operation with exponential backoff
49
+ */
50
+ export declare function retryOperation<T>(operation: () => Promise<T>, maxRetries?: number, initialDelay?: number): Promise<T>;
51
+ /**
52
+ * Sanitize table name to prevent SQL injection
53
+ */
54
+ export declare function sanitizeTableName(tableName: string): string;
55
+ /**
56
+ * Convert camelCase to snake_case
57
+ */
58
+ export declare function camelToSnake(str: string): string;
59
+ /**
60
+ * Convert snake_case to camelCase
61
+ */
62
+ export declare function snakeToCamel(str: string): string;
63
+ /**
64
+ * Deep clone an object
65
+ */
66
+ export declare function deepClone<T>(obj: T): T;