@routier/core 0.0.1-alpha.1 → 0.0.1-alpha.2

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 (331) hide show
  1. package/dist/assertions/index.d.ts +5 -0
  2. package/dist/assertions/index.js +131 -0
  3. package/dist/assertions/index.js.map +1 -0
  4. package/dist/codegen/SlotPath.d.ts +7 -0
  5. package/dist/codegen/blocks.d.ts +130 -0
  6. package/dist/codegen/handlers/CloneHandlerBuilder.d.ts +4 -0
  7. package/dist/codegen/handlers/CompareHandlerBuilder.d.ts +4 -0
  8. package/dist/codegen/handlers/DeserializeHandlerBuilder.d.ts +4 -0
  9. package/dist/codegen/handlers/EnableChangeTrackingHandlerBuilder.d.ts +4 -0
  10. package/dist/codegen/handlers/EnrichmentHandlerBuilder.d.ts +4 -0
  11. package/dist/codegen/handlers/FreezeHandlerBuilder.d.ts +4 -0
  12. package/dist/codegen/handlers/HashHandlerBuilder.d.ts +4 -0
  13. package/dist/codegen/handlers/HashTypeHandlerBuilder.d.ts +4 -0
  14. package/dist/codegen/handlers/IdSelectorHandlerBuilder.d.ts +4 -0
  15. package/dist/codegen/handlers/MergeHandlerBuilder.d.ts +4 -0
  16. package/dist/codegen/handlers/PrepareHandlerBuilder.d.ts +4 -0
  17. package/dist/codegen/handlers/SerializeHandlerBuilder.d.ts +4 -0
  18. package/dist/codegen/handlers/StripHandlerBuilder.d.ts +4 -0
  19. package/dist/codegen/handlers/clone/CloneObjectHandler.d.ts +6 -0
  20. package/dist/codegen/handlers/clone/CloneValueHandler.d.ts +6 -0
  21. package/dist/codegen/handlers/compare/CompareObjectHandler.d.ts +6 -0
  22. package/dist/codegen/handlers/compare/CompareValueHandler.d.ts +6 -0
  23. package/dist/codegen/handlers/deserialize/DeserializeComputedValueHandler.d.ts +6 -0
  24. package/dist/codegen/handlers/deserialize/DeserializeDateHandler.d.ts +9 -0
  25. package/dist/codegen/handlers/deserialize/DeserializeFunctionHandler.d.ts +6 -0
  26. package/dist/codegen/handlers/deserialize/DeserializeObjectHandler.d.ts +6 -0
  27. package/dist/codegen/handlers/deserialize/DeserializeValueHandler.d.ts +6 -0
  28. package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingObjectHandler.d.ts +6 -0
  29. package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler.d.ts +6 -0
  30. package/dist/codegen/handlers/enrichment/EnrichmentComputedValueHandler.d.ts +6 -0
  31. package/dist/codegen/handlers/enrichment/EnrichmentDefaultFunctionHandler.d.ts +6 -0
  32. package/dist/codegen/handlers/enrichment/EnrichmentDefaultValueHandler.d.ts +6 -0
  33. package/dist/codegen/handlers/enrichment/EnrichmentFunctionHandler.d.ts +6 -0
  34. package/dist/codegen/handlers/enrichment/EnrichmentNullableObjectHandler.d.ts +6 -0
  35. package/dist/codegen/handlers/enrichment/EnrichmentObjectHandler.d.ts +6 -0
  36. package/dist/codegen/handlers/enrichment/EnrichmentObjectIdentityHandler.d.ts +6 -0
  37. package/dist/codegen/handlers/enrichment/EnrichmentPrimitiveHandler.d.ts +6 -0
  38. package/dist/codegen/handlers/enrichment/EnrichmentPrimitiveIdentityHandler.d.ts +6 -0
  39. package/dist/codegen/handlers/freeze/FreezeObjectHandler.d.ts +6 -0
  40. package/dist/codegen/handlers/freeze/FreezePrimitiveValueHandler.d.ts +6 -0
  41. package/dist/codegen/handlers/hash/HashComputedValueHandler.d.ts +6 -0
  42. package/dist/codegen/handlers/hash/HashDateHandler.d.ts +6 -0
  43. package/dist/codegen/handlers/hash/HashFunctionHandler.d.ts +6 -0
  44. package/dist/codegen/handlers/hash/HashIdentityHandler.d.ts +6 -0
  45. package/dist/codegen/handlers/hash/HashKeyHandler.d.ts +6 -0
  46. package/dist/codegen/handlers/hash/HashValueHandler.d.ts +6 -0
  47. package/dist/codegen/handlers/hashType/HashTypeValueHandler.d.ts +6 -0
  48. package/dist/codegen/handlers/idSelector/IdSelectorValueHandler.d.ts +6 -0
  49. package/{src/codegen/handlers/index.ts → dist/codegen/handlers/index.d.ts} +1 -1
  50. package/dist/codegen/handlers/merge/MergeComputedValueHandler.d.ts +6 -0
  51. package/dist/codegen/handlers/merge/MergeDefaultFunctionHandler.d.ts +6 -0
  52. package/dist/codegen/handlers/merge/MergeDefaultValueHandler.d.ts +6 -0
  53. package/dist/codegen/handlers/merge/MergeFunctionHandler.d.ts +6 -0
  54. package/dist/codegen/handlers/merge/MergePrimitiveHandler.d.ts +6 -0
  55. package/dist/codegen/handlers/prepare/PrepareComputedValueHandler.d.ts +6 -0
  56. package/dist/codegen/handlers/prepare/PrepareFunctionHandler.d.ts +6 -0
  57. package/dist/codegen/handlers/prepare/PrepareIdentityHandler.d.ts +6 -0
  58. package/dist/codegen/handlers/prepare/PrepareKeyHandler.d.ts +6 -0
  59. package/dist/codegen/handlers/prepare/PrepareObjectHandler.d.ts +6 -0
  60. package/dist/codegen/handlers/prepare/PrepareValueHandler.d.ts +6 -0
  61. package/dist/codegen/handlers/serialize/SerializeDateHandler.d.ts +9 -0
  62. package/dist/codegen/handlers/serialize/SerializeObjectHandler.d.ts +6 -0
  63. package/dist/codegen/handlers/serialize/SerializeValueHandler.d.ts +6 -0
  64. package/dist/codegen/handlers/strip/StripIdentityHandler.d.ts +6 -0
  65. package/dist/codegen/handlers/strip/StripKeyHandler.d.ts +6 -0
  66. package/dist/codegen/handlers/strip/StripObjectHandler.d.ts +6 -0
  67. package/dist/codegen/handlers/strip/StripValueHandler.d.ts +6 -0
  68. package/dist/codegen/handlers/types.d.ts +18 -0
  69. package/{src/codegen/index.ts → dist/codegen/index.d.ts} +1 -1
  70. package/dist/codegen/types.d.ts +9 -0
  71. package/dist/codegen/utils.d.ts +22 -0
  72. package/dist/collections/Changes.d.ts +51 -0
  73. package/dist/collections/Changes.test.d.ts +1 -0
  74. package/dist/collections/IdSet.d.ts +7 -0
  75. package/dist/collections/MemoryDataCollection.d.ts +22 -0
  76. package/dist/collections/MemoryDataCollection.test.d.ts +1 -0
  77. package/dist/collections/SchemaCollection.d.ts +8 -0
  78. package/dist/collections/TagCollection.d.ts +15 -0
  79. package/dist/collections/TagCollection.test.d.ts +1 -0
  80. package/{src/collections/index.ts → dist/collections/index.d.ts} +1 -1
  81. package/dist/collections/index.js +659 -0
  82. package/dist/collections/index.js.map +1 -0
  83. package/dist/errors/SchemaError.d.ts +3 -0
  84. package/dist/errors/index.d.ts +1 -0
  85. package/dist/errors/index.js +90 -0
  86. package/dist/errors/index.js.map +1 -0
  87. package/{src/expressions/index.ts → dist/expressions/index.d.ts} +1 -1
  88. package/{src/expressions/parser.ts → dist/expressions/index.js} +387 -205
  89. package/dist/expressions/index.js.map +1 -0
  90. package/dist/expressions/parser.d.ts +4 -0
  91. package/dist/expressions/parser.test.d.ts +1 -0
  92. package/{src/expressions/types.ts → dist/expressions/types.d.ts} +42 -99
  93. package/dist/expressions/utils.d.ts +10 -0
  94. package/dist/expressions/utils.test.d.ts +1 -0
  95. package/{src/index.ts → dist/index.d.ts} +1 -1
  96. package/dist/index.js +8434 -0
  97. package/dist/index.js.map +1 -0
  98. package/dist/performance/index.d.ts +5 -0
  99. package/dist/performance/index.js +65 -0
  100. package/dist/performance/index.js.map +1 -0
  101. package/dist/pipeline/SyncronousQueue.d.ts +7 -0
  102. package/dist/pipeline/SyncronousQueue.test.d.ts +1 -0
  103. package/dist/pipeline/TrampolinePipeline.d.ts +36 -0
  104. package/dist/pipeline/TrampolinePipeline.test.d.ts +1 -0
  105. package/dist/pipeline/index.d.ts +2 -0
  106. package/{src/pipeline/TrampolinePipeline.ts → dist/pipeline/index.js} +297 -140
  107. package/dist/pipeline/index.js.map +1 -0
  108. package/dist/plugins/EphemeralDataPlugin.d.ts +13 -0
  109. package/dist/plugins/capabilities/DbPluginCapability.d.ts +23 -0
  110. package/{src/plugins/capabilities/index.ts → dist/plugins/capabilities/index.d.ts} +1 -1
  111. package/dist/plugins/capabilities/logging/DbPluginLoggingCapability.d.ts +28 -0
  112. package/dist/plugins/capabilities/logging/index.d.ts +1 -0
  113. package/{src/plugins/index.ts → dist/plugins/index.d.ts} +1 -1
  114. package/dist/plugins/index.js +2328 -0
  115. package/dist/plugins/index.js.map +1 -0
  116. package/dist/plugins/query/Query.d.ts +13 -0
  117. package/dist/plugins/query/QueryOptionsCollection.d.ts +27 -0
  118. package/dist/plugins/query/QueryOptionsCollection.test.d.ts +1 -0
  119. package/{src/plugins/query/index.ts → dist/plugins/query/index.d.ts} +1 -1
  120. package/{src/plugins/query/types.ts → dist/plugins/query/types.d.ts} +29 -20
  121. package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +21 -0
  122. package/dist/plugins/replication/ReplicationDbPlugin.d.ts +21 -0
  123. package/{src/plugins/replication/index.ts → dist/plugins/replication/index.d.ts} +1 -1
  124. package/{src/plugins/replication/types.ts → dist/plugins/replication/types.d.ts} +1 -2
  125. package/dist/plugins/translators/DataTranslator.d.ts +18 -0
  126. package/dist/plugins/translators/JsonTranslator.d.ts +17 -0
  127. package/dist/plugins/translators/JsonTranslator.test.d.ts +1 -0
  128. package/dist/plugins/translators/SqlTranslator.d.ts +14 -0
  129. package/{src/plugins/translators/index.ts → dist/plugins/translators/index.d.ts} +1 -1
  130. package/{src/plugins/types.ts → dist/plugins/types.d.ts} +11 -26
  131. package/dist/results/Result.d.ts +29 -0
  132. package/{src/results/index.ts → dist/results/index.d.ts} +1 -1
  133. package/dist/results/index.js +192 -0
  134. package/dist/results/index.js.map +1 -0
  135. package/{src/results/types.ts → dist/results/types.d.ts} +18 -7
  136. package/dist/results/utils.d.ts +2 -0
  137. package/dist/schema/PropertyInfo.d.ts +132 -0
  138. package/dist/schema/PropertyInfo.test.d.ts +1 -0
  139. package/dist/schema/SchemaDefinition.d.ts +17 -0
  140. package/dist/schema/builder.d.ts +17 -0
  141. package/{src/schema/index.ts → dist/schema/index.d.ts} +1 -1
  142. package/dist/schema/index.js +4822 -0
  143. package/dist/schema/index.js.map +1 -0
  144. package/dist/schema/property/base/SchemaBase.d.ts +23 -0
  145. package/dist/schema/property/base/index.d.ts +1 -0
  146. package/dist/schema/property/modifiers/SchemaDefault.d.ts +13 -0
  147. package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +11 -0
  148. package/dist/schema/property/modifiers/SchemaDistinct.d.ts +7 -0
  149. package/dist/schema/property/modifiers/SchemaFrom.d.ts +23 -0
  150. package/dist/schema/property/modifiers/SchemaIdentity.d.ts +7 -0
  151. package/dist/schema/property/modifiers/SchemaIndex.d.ts +23 -0
  152. package/dist/schema/property/modifiers/SchemaKey.d.ts +13 -0
  153. package/dist/schema/property/modifiers/SchemaNullable.d.ts +9 -0
  154. package/dist/schema/property/modifiers/SchemaOptional.d.ts +9 -0
  155. package/dist/schema/property/modifiers/SchemaReadonly.d.ts +15 -0
  156. package/dist/schema/property/modifiers/SchemaSerialize.d.ts +9 -0
  157. package/dist/schema/property/modifiers/SchemaTracked.d.ts +7 -0
  158. package/{src/schema/property/modifiers/index.ts → dist/schema/property/modifiers/index.d.ts} +1 -1
  159. package/dist/schema/property/types/SchemaArray.d.ts +23 -0
  160. package/dist/schema/property/types/SchemaBoolean.d.ts +27 -0
  161. package/dist/schema/property/types/SchemaDate.d.ts +27 -0
  162. package/dist/schema/property/types/SchemaNumber.d.ts +31 -0
  163. package/dist/schema/property/types/SchemaObject.d.ts +20 -0
  164. package/dist/schema/property/types/SchemaString.d.ts +31 -0
  165. package/{src/schema/property/types/index.ts → dist/schema/property/types/index.d.ts} +1 -1
  166. package/dist/schema/table/SchemaComputed.d.ts +10 -0
  167. package/dist/schema/table/SchemaFunction.d.ts +8 -0
  168. package/{src/schema/table/index.ts → dist/schema/table/index.d.ts} +1 -1
  169. package/{src/schema/types.ts → dist/schema/types.d.ts} +59 -99
  170. package/{src/types/index.ts → dist/types/index.d.ts} +1 -2
  171. package/dist/types/index.js +25 -0
  172. package/dist/types/index.js.map +1 -0
  173. package/dist/utilities/arrays.d.ts +1 -0
  174. package/dist/utilities/arrays.test.d.ts +1 -0
  175. package/dist/utilities/dates.d.ts +1 -0
  176. package/dist/utilities/dates.test.d.ts +1 -0
  177. package/dist/utilities/dbPluginEventUtils.d.ts +14 -0
  178. package/{src/utilities/index.ts → dist/utilities/index.d.ts} +1 -1
  179. package/dist/utilities/index.js +554 -0
  180. package/dist/utilities/index.js.map +1 -0
  181. package/dist/utilities/objects.d.ts +2 -0
  182. package/dist/utilities/queryOptionsCollection.d.ts +2 -0
  183. package/dist/utilities/replication.d.ts +3 -0
  184. package/dist/utilities/runtime.d.ts +1 -0
  185. package/dist/utilities/strings.d.ts +1 -0
  186. package/dist/utilities/types.d.ts +1 -0
  187. package/dist/utilities/uuid.d.ts +2 -0
  188. package/package.json +6 -1
  189. package/readme.md +95 -0
  190. package/CHANGELOG.md +0 -8
  191. package/rspack.config.mjs +0 -65
  192. package/src/assertions/index.ts +0 -37
  193. package/src/codegen/SlotPath.ts +0 -20
  194. package/src/codegen/blocks.ts +0 -578
  195. package/src/codegen/handlers/CloneHandlerBuilder.ts +0 -13
  196. package/src/codegen/handlers/CompareHandlerBuilder.ts +0 -13
  197. package/src/codegen/handlers/DeserializeHandlerBuilder.ts +0 -20
  198. package/src/codegen/handlers/EnableChangeTrackingHandlerBuilder.ts +0 -13
  199. package/src/codegen/handlers/EnrichmentHandlerBuilder.ts +0 -28
  200. package/src/codegen/handlers/FreezeHandlerBuilder.ts +0 -13
  201. package/src/codegen/handlers/HashHandlerBuilder.ts +0 -25
  202. package/src/codegen/handlers/HashTypeHandlerBuilder.ts +0 -11
  203. package/src/codegen/handlers/IdSelectorHandlerBuilder.ts +0 -10
  204. package/src/codegen/handlers/MergeHandlerBuilder.ts +0 -19
  205. package/src/codegen/handlers/PrepareHandlerBuilder.ts +0 -23
  206. package/src/codegen/handlers/SerializeHandlerBuilder.ts +0 -15
  207. package/src/codegen/handlers/StripHandlerBuilder.ts +0 -18
  208. package/src/codegen/handlers/clone/CloneObjectHandler.ts +0 -29
  209. package/src/codegen/handlers/clone/CloneValueHandler.ts +0 -33
  210. package/src/codegen/handlers/compare/CompareObjectHandler.ts +0 -15
  211. package/src/codegen/handlers/compare/CompareValueHandler.ts +0 -27
  212. package/src/codegen/handlers/deserialize/DeserializeComputedValueHandler.ts +0 -16
  213. package/src/codegen/handlers/deserialize/DeserializeDateHandler.ts +0 -45
  214. package/src/codegen/handlers/deserialize/DeserializeFunctionHandler.ts +0 -16
  215. package/src/codegen/handlers/deserialize/DeserializeObjectHandler.ts +0 -29
  216. package/src/codegen/handlers/deserialize/DeserializeValueHandler.ts +0 -33
  217. package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingObjectHandler.ts +0 -20
  218. package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler.ts +0 -15
  219. package/src/codegen/handlers/enrichment/EnrichmentComputedValueHandler.ts +0 -37
  220. package/src/codegen/handlers/enrichment/EnrichmentDefaultFunctionHandler.ts +0 -50
  221. package/src/codegen/handlers/enrichment/EnrichmentDefaultValueHandler.ts +0 -18
  222. package/src/codegen/handlers/enrichment/EnrichmentFunctionHandler.ts +0 -38
  223. package/src/codegen/handlers/enrichment/EnrichmentNullableObjectHandler.ts +0 -44
  224. package/src/codegen/handlers/enrichment/EnrichmentObjectHandler.ts +0 -29
  225. package/src/codegen/handlers/enrichment/EnrichmentObjectIdentityHandler.ts +0 -16
  226. package/src/codegen/handlers/enrichment/EnrichmentPrimitiveHandler.ts +0 -13
  227. package/src/codegen/handlers/enrichment/EnrichmentPrimitiveIdentityHandler.ts +0 -21
  228. package/src/codegen/handlers/freeze/FreezeObjectHandler.ts +0 -20
  229. package/src/codegen/handlers/freeze/FreezePrimitiveValueHandler.ts +0 -15
  230. package/src/codegen/handlers/hash/HashComputedValueHandler.ts +0 -15
  231. package/src/codegen/handlers/hash/HashDateHandler.ts +0 -26
  232. package/src/codegen/handlers/hash/HashFunctionHandler.ts +0 -16
  233. package/src/codegen/handlers/hash/HashIdentityHandler.ts +0 -15
  234. package/src/codegen/handlers/hash/HashKeyHandler.ts +0 -26
  235. package/src/codegen/handlers/hash/HashValueHandler.ts +0 -26
  236. package/src/codegen/handlers/hashType/HashTypeValueHandler.ts +0 -20
  237. package/src/codegen/handlers/idSelector/IdSelectorValueHandler.ts +0 -28
  238. package/src/codegen/handlers/merge/MergeComputedValueHandler.ts +0 -37
  239. package/src/codegen/handlers/merge/MergeDefaultFunctionHandler.ts +0 -40
  240. package/src/codegen/handlers/merge/MergeDefaultValueHandler.ts +0 -32
  241. package/src/codegen/handlers/merge/MergeFunctionHandler.ts +0 -16
  242. package/src/codegen/handlers/merge/MergePrimitiveHandler.ts +0 -21
  243. package/src/codegen/handlers/prepare/PrepareComputedValueHandler.ts +0 -16
  244. package/src/codegen/handlers/prepare/PrepareFunctionHandler.ts +0 -16
  245. package/src/codegen/handlers/prepare/PrepareIdentityHandler.ts +0 -21
  246. package/src/codegen/handlers/prepare/PrepareKeyHandler.ts +0 -21
  247. package/src/codegen/handlers/prepare/PrepareObjectHandler.ts +0 -38
  248. package/src/codegen/handlers/prepare/PrepareValueHandler.ts +0 -36
  249. package/src/codegen/handlers/serialize/SerializeDateHandler.ts +0 -45
  250. package/src/codegen/handlers/serialize/SerializeObjectHandler.ts +0 -28
  251. package/src/codegen/handlers/serialize/SerializeValueHandler.ts +0 -33
  252. package/src/codegen/handlers/strip/StripIdentityHandler.ts +0 -15
  253. package/src/codegen/handlers/strip/StripKeyHandler.ts +0 -15
  254. package/src/codegen/handlers/strip/StripObjectHandler.ts +0 -35
  255. package/src/codegen/handlers/strip/StripValueHandler.ts +0 -36
  256. package/src/codegen/handlers/types.ts +0 -119
  257. package/src/codegen/types.ts +0 -2
  258. package/src/codegen/utils.ts +0 -74
  259. package/src/collections/Changes.test.ts +0 -337
  260. package/src/collections/Changes.ts +0 -177
  261. package/src/collections/IdSet.ts +0 -28
  262. package/src/collections/MemoryDataCollection.test.ts +0 -424
  263. package/src/collections/MemoryDataCollection.ts +0 -134
  264. package/src/collections/SchemaCollection.ts +0 -22
  265. package/src/collections/TagCollection.test.ts +0 -443
  266. package/src/collections/TagCollection.ts +0 -62
  267. package/src/errors/SchemaError.ts +0 -6
  268. package/src/errors/index.ts +0 -1
  269. package/src/expressions/parser.test.ts +0 -913
  270. package/src/expressions/utils.test.ts +0 -346
  271. package/src/expressions/utils.ts +0 -59
  272. package/src/performance/index.ts +0 -26
  273. package/src/pipeline/SyncronousQueue.test.ts +0 -269
  274. package/src/pipeline/SyncronousQueue.ts +0 -30
  275. package/src/pipeline/TrampolinePipeline.test.ts +0 -374
  276. package/src/pipeline/index.ts +0 -2
  277. package/src/plugins/EphemeralDataPlugin.ts +0 -132
  278. package/src/plugins/capabilities/DbPluginCapability.ts +0 -111
  279. package/src/plugins/capabilities/logging/DbPluginLoggingCapability.ts +0 -261
  280. package/src/plugins/capabilities/logging/index.ts +0 -1
  281. package/src/plugins/query/Query.ts +0 -67
  282. package/src/plugins/query/QueryOptionsCollection.test.ts +0 -86
  283. package/src/plugins/query/QueryOptionsCollection.ts +0 -154
  284. package/src/plugins/replication/OptimisticReplicationDbPlugin.ts +0 -202
  285. package/src/plugins/replication/ReplicationDbPlugin.ts +0 -137
  286. package/src/plugins/translators/DataTranslator.ts +0 -46
  287. package/src/plugins/translators/JsonTranslator.test.ts +0 -618
  288. package/src/plugins/translators/JsonTranslator.ts +0 -211
  289. package/src/plugins/translators/SqlTranslator.ts +0 -45
  290. package/src/results/Result.ts +0 -91
  291. package/src/results/utils.ts +0 -15
  292. package/src/schema/PropertyInfo.test.ts +0 -479
  293. package/src/schema/PropertyInfo.ts +0 -374
  294. package/src/schema/SchemaDefinition.ts +0 -626
  295. package/src/schema/builder.ts +0 -18
  296. package/src/schema/property/base/SchemaBase.ts +0 -49
  297. package/src/schema/property/base/index.ts +0 -1
  298. package/src/schema/property/modifiers/SchemaDefault.ts +0 -29
  299. package/src/schema/property/modifiers/SchemaDeserialize.ts +0 -23
  300. package/src/schema/property/modifiers/SchemaDistinct.ts +0 -14
  301. package/src/schema/property/modifiers/SchemaFrom.ts +0 -54
  302. package/src/schema/property/modifiers/SchemaIdentity.ts +0 -13
  303. package/src/schema/property/modifiers/SchemaIndex.ts +0 -60
  304. package/src/schema/property/modifiers/SchemaKey.ts +0 -28
  305. package/src/schema/property/modifiers/SchemaNullable.ts +0 -18
  306. package/src/schema/property/modifiers/SchemaOptional.ts +0 -19
  307. package/src/schema/property/modifiers/SchemaReadonly.ts +0 -34
  308. package/src/schema/property/modifiers/SchemaSerialize.ts +0 -18
  309. package/src/schema/property/modifiers/SchemaTracked.ts +0 -14
  310. package/src/schema/property/types/SchemaArray.ts +0 -50
  311. package/src/schema/property/types/SchemaBoolean.ts +0 -59
  312. package/src/schema/property/types/SchemaDate.ts +0 -58
  313. package/src/schema/property/types/SchemaNumber.ts +0 -69
  314. package/src/schema/property/types/SchemaObject.ts +0 -44
  315. package/src/schema/property/types/SchemaString.ts +0 -69
  316. package/src/schema/table/SchemaComputed.ts +0 -20
  317. package/src/schema/table/SchemaFunction.ts +0 -15
  318. package/src/utilities/arrays.test.ts +0 -312
  319. package/src/utilities/arrays.ts +0 -12
  320. package/src/utilities/dates.test.ts +0 -388
  321. package/src/utilities/dates.ts +0 -11
  322. package/src/utilities/dbPluginEventUtils.ts +0 -44
  323. package/src/utilities/objects.ts +0 -7
  324. package/src/utilities/queryOptionsCollection.ts +0 -16
  325. package/src/utilities/replication.ts +0 -23
  326. package/src/utilities/runtime.ts +0 -3
  327. package/src/utilities/strings.ts +0 -18
  328. package/src/utilities/types.ts +0 -1
  329. package/src/utilities/uuid.ts +0 -56
  330. package/tsconfig.json +0 -28
  331. package/vitest.config.ts +0 -11
@@ -1,578 +0,0 @@
1
- import { uuid } from "../utilities";
2
- import { CreateBlockOptions } from "./types";
3
-
4
- type Line = string | Block;
5
-
6
- type Param = { name: string, value: any };
7
- type GenericParam = { name: string, callName: string };
8
-
9
-
10
- export abstract class Block {
11
- readonly name: string;
12
- protected _lines: Line[] = [];
13
- protected _indent: string = "";
14
- protected _parent?: Block;
15
-
16
- constructor(name?: string, parentIndent: string = "", parent?: Block) {
17
- this.name = name != null ? name : uuid();
18
- this._indent = parentIndent;
19
- this._parent = parent;
20
- }
21
-
22
- indexOf(name: string) {
23
- return this._lines.findIndex(w => typeof w !== "string" && w.name === name);
24
- }
25
-
26
- getOrDefault<T extends Block>(name: string): T | undefined {
27
-
28
- if (name.includes('.') === false) {
29
- return this._lines.find(w => typeof w !== "string" && w.name === name) as T | undefined;
30
- }
31
-
32
- const split = name.match(/(\[[^\]]+\]|[^.]+)/g);
33
- let result: Block = this;
34
-
35
- for (const item of split) {
36
- const found = result._lines.find(w => typeof w !== "string" && w.name === item) as Block;
37
-
38
- if (found == null) {
39
-
40
- if ("getValue" in result && result.getValue instanceof Block && result.getValue.name === item) {
41
- result = result.getValue;
42
- continue;
43
- }
44
-
45
- return undefined;
46
- }
47
-
48
- result = found;
49
- }
50
-
51
- return result as T;
52
- }
53
-
54
- get<T extends Block>(name: string): T {
55
- const found = this.getOrDefault(name);
56
-
57
- if (found == null) {
58
- throw new Error(`Error finding code block for given path. Path: ${name}`)
59
- }
60
-
61
- return found as T;
62
- }
63
-
64
- has(name: string) {
65
- return this._lines.some(w => typeof w !== "string" && w.name === name);
66
- }
67
-
68
- protected push(line: Line) {
69
- this._lines.push(line);
70
- }
71
-
72
- protected unshift(line: Line) {
73
- this._lines.unshift(line);
74
- }
75
-
76
- protected indent(text: string): string {
77
- return this._indent + text;
78
- }
79
-
80
-
81
- abstract toString(): string;
82
- }
83
-
84
- export abstract class ContainerBlock extends Block {
85
- if(condition: string, options?: CreateBlockOptions): IfBuilder {
86
- const builder = new IfBuilder(condition, options?.name, this._indent + " ", this);
87
- if (options?.unshift === true) {
88
- this.unshift(builder);
89
- } else {
90
- this.push(builder);
91
- }
92
-
93
- return builder;
94
- }
95
-
96
- raw(raw: string, options?: CreateBlockOptions): RawBuilder {
97
- const builder = new RawBuilder(raw, options?.name, this._indent + " ", this);
98
- this.push(builder);
99
- return builder;
100
- }
101
-
102
- function(name?: string, options?: CreateBlockOptions): FunctionBuilder {
103
- const builder = new FunctionBuilder(name, options?.name, this._indent + " ", this);
104
- this.push(builder);
105
- return builder;
106
- }
107
-
108
- factory(name?: string, options?: CreateBlockOptions): FunctionFactoryBuilder {
109
- const builder = new FunctionFactoryBuilder(name, options?.name, this._indent + " ", this);
110
- this.push(builder);
111
- return builder;
112
- }
113
-
114
- variable(declaration: string, options?: CreateBlockOptions): VariableBuilder {
115
- const builder = new VariableBuilder(declaration, options?.name, this._indent + " ", this);
116
- this.push(builder);
117
- return builder;
118
- }
119
-
120
- assign(variableName: string, options?: CreateBlockOptions): AssignmentBuilder {
121
- const builder = new AssignmentBuilder(variableName, options?.name, this._indent + " ", this);
122
- this.push(builder);
123
- return builder;
124
- }
125
-
126
- object(options?: CreateBlockOptions): ObjectBuilder {
127
- const builder = new ObjectBuilder(options?.name, this._indent + " ", this);
128
- this.push(builder);
129
- return builder;
130
- }
131
-
132
- slot(name: string) {
133
- const builder = new SlotBlock(name, this._indent + " ", this);
134
- this.push(builder);
135
- return builder;
136
- }
137
-
138
- array(accessor: string, options?: CreateBlockOptions) {
139
- const builder = new ArrayBuilder(accessor, options?.name, this._indent + " ", this);
140
- this.push(builder);
141
- return builder;
142
- }
143
- }
144
-
145
- export type StringType = "template" | "default";
146
-
147
- export class StringBuilder extends Block {
148
-
149
- private _type: StringType;
150
-
151
- constructor(type: StringType, name?: string, parentIndent: string = "", parent?: Block) {
152
- super(name, parentIndent, parent);
153
- this._type = type;
154
- }
155
-
156
- append(value: string) {
157
- this._lines.push(value);
158
- return this;
159
- }
160
-
161
- toString() {
162
- if (this._type === "template") {
163
- return "`" + this._lines.join("") + "`";
164
- }
165
-
166
- return `"${this._lines.join("")}"`;
167
- }
168
- }
169
-
170
- export class SlotBlock extends ContainerBlock {
171
-
172
- constructor(name: string, parentIndent: string = "", parent?: Block) {
173
- super(name, parentIndent, parent);
174
- }
175
-
176
- insert(line: string | Block) {
177
- this.push(line);
178
- }
179
-
180
- toString(): string {
181
- return this._lines.map(line =>
182
- typeof line === 'string'
183
- ? this.indent(line)
184
- : line.toString()
185
- ).join('\n\n');
186
- }
187
- }
188
-
189
- export class AssignmentBuilder extends ContainerBlock {
190
- protected _variableName: string;
191
- protected _value?: string | Block;
192
- protected _functionName?: string;
193
-
194
- get getValue() {
195
- return this._value;
196
- }
197
-
198
- constructor(variableName: string, name?: string, parentIndent: string = "", parent?: Block) {
199
- super(name, parentIndent, parent);
200
- this._variableName = variableName;
201
- }
202
-
203
- value(value: string): this {
204
- this._value = value;
205
- return this;
206
- }
207
-
208
- and(and: string, options?: CreateBlockOptions): this {
209
- this._value = new AndBuilder(and, options?.name, this._indent, this);
210
- return this;
211
- }
212
-
213
- object(options?: CreateBlockOptions): ObjectBuilder {
214
- const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);
215
-
216
- this._value = objectBuilder;
217
-
218
- return objectBuilder;
219
- }
220
-
221
- call(functionName: string, options?: CreateBlockOptions): ObjectBuilder {
222
- this._functionName = functionName;
223
- const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);
224
-
225
- this._value = objectBuilder;
226
-
227
- return objectBuilder;
228
- }
229
-
230
- string(type: StringType, options?: CreateBlockOptions) {
231
- const stringBuilder = new StringBuilder(type, options?.name, this._indent, this);
232
-
233
- this._value = stringBuilder;
234
-
235
- return stringBuilder;
236
- }
237
-
238
- toString(): string {
239
-
240
- if (this._value == null) {
241
- throw new Error("Value cannot be null for AssignmentBuilder Builder")
242
- }
243
-
244
- if (this._functionName != null) {
245
- return this.indent(`${this._variableName} = ${this._functionName}(${this._value.toString()});`);
246
- }
247
-
248
- return this.indent(`${this._variableName} = ${this._value.toString()};`);
249
- }
250
- }
251
-
252
- export class AndBuilder extends ContainerBlock {
253
-
254
- constructor(and: string, name?: string, parentIndent: string = "", parent?: Block) {
255
- super(name, parentIndent, parent);
256
- this._lines.push(and);
257
- }
258
-
259
- and(and: string) {
260
- this._lines.push(and);
261
- }
262
-
263
- toString() {
264
- return this._lines.join(" && ")
265
- }
266
- }
267
-
268
- export class VariableBuilder extends Block {
269
- protected _declaration: string;
270
- protected _value?: string | Block;
271
-
272
- get getValue() {
273
- return this._value;
274
- }
275
-
276
- constructor(declaration: string, name?: string, parentIndent: string = "", parent?: Block) {
277
- super(name, parentIndent, parent);
278
- this._declaration = declaration;
279
- }
280
-
281
- value(value: string): this {
282
- this._value = value;
283
- return this;
284
- }
285
-
286
- object(options?: CreateBlockOptions): ObjectBuilder {
287
- const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);
288
-
289
- this._value = objectBuilder;
290
-
291
- return objectBuilder;
292
- }
293
-
294
- array(accessor: string, options?: CreateBlockOptions): ArrayBuilder {
295
- const arrayBuilder = new ArrayBuilder(accessor, options?.name, this._indent, this);
296
-
297
- this._value = arrayBuilder;
298
-
299
- return arrayBuilder;
300
- }
301
-
302
- toString(): string {
303
-
304
- if (this._value == null) {
305
- throw new Error("Value cannot be null for Variable Builder")
306
- }
307
-
308
- return this.indent(`const ${this._declaration} = ${this._value.toString()};`);
309
- }
310
- }
311
-
312
- export class RawBuilder extends ContainerBlock {
313
- private _raw: string;
314
-
315
- constructor(raw: string, name?: string, parentIndent: string = "", parent?: Block) {
316
- super(name, parentIndent, parent);
317
- this._raw = raw;
318
- }
319
-
320
- toString(): string {
321
- return `${this._raw}\n`;
322
- }
323
- }
324
-
325
- export class ObjectBuilder extends Block {
326
-
327
- property(line: string) {
328
- // Add comma to previous line if it exists and isn't a brace
329
- if (this._lines.length > 0) {
330
- const lastLine = this._lines[this._lines.length - 1];
331
- if (typeof lastLine === 'string' && !lastLine.endsWith("{")) {
332
- this._lines[this._lines.length - 1] = lastLine + ",";
333
- }
334
- }
335
- this.push(line);
336
- return this;
337
- }
338
-
339
- nested(propertyName: string, name?: string) {
340
- const builder = new ObjectBuilder(name, this._indent + " ", this);
341
- // Add comma to previous line if it exists and isn't a brace
342
- if (this._lines.length > 0) {
343
- const lastLine = this._lines[this._lines.length - 1];
344
- if (typeof lastLine === 'string' && !lastLine.endsWith("{")) {
345
- this._lines[this._lines.length - 1] = lastLine + ",";
346
- }
347
- }
348
- // Add the property name and opening brace
349
- this.push(`${propertyName}: {`);
350
- // Add the nested builder
351
- this.push(builder);
352
- // Add the closing brace
353
- this.push("}");
354
- return builder;
355
- }
356
-
357
- toString(): string {
358
- // Check if this is a nested object's content
359
- const isNestedContent = this._parent instanceof ObjectBuilder;
360
-
361
- if (isNestedContent) {
362
- // For nested object contents, just return the lines
363
- return this._lines.map(line =>
364
- typeof line === 'string'
365
- ? this.indent(" " + line)
366
- : line.toString()
367
- ).join('\n');
368
- }
369
-
370
- // For root objects, include the braces
371
- const lines = [
372
- "{",
373
- ...this._lines.map(line =>
374
- typeof line === 'string'
375
- ? this.indent(" " + line)
376
- : line.toString()
377
- ),
378
- this.indent("}")
379
- ];
380
-
381
- return lines.join('\n');
382
- }
383
- }
384
-
385
- export class FunctionFactoryBuilder extends ContainerBlock {
386
- private _functionName?: string;
387
- private _params: Param[] = [];
388
- private _return: boolean = false;
389
-
390
- constructor(functionName?: string, sectionName?: string, parentIndent: string = "", parent?: Block) {
391
- super(sectionName, parentIndent, parent);
392
- this._functionName = functionName;
393
- }
394
-
395
- getParameters() {
396
- return [...this._params];
397
- }
398
-
399
- createParameter(value: any): Param {
400
- const name = `injection${this._params.length}`;
401
- return {
402
- name,
403
- value
404
- }
405
- }
406
-
407
- parameters(...params: Param[]): this {
408
- this._params.push(...params);
409
- return this;
410
- }
411
-
412
- return() {
413
- this._return = true;
414
- return this;
415
- }
416
-
417
- appendBody(line: string): this {
418
- this.push(line);
419
- return this;
420
- }
421
-
422
- invoke() {
423
- const body = this.toString();
424
- const parameterNames = this._getParameterNames();
425
- const parameterValues = this._getParameterValues();
426
-
427
- return Function(...parameterNames, body)(...parameterValues)
428
- }
429
-
430
- private _getParameterNames() {
431
- return this._params.map(w => w.name).join(", ")
432
- }
433
-
434
- private _getParameterValues() {
435
- return this._params.map(w => w.value);
436
- }
437
-
438
- toString(): string {
439
- const r = this._return === true ? "return " : "";
440
- const signature = this._functionName
441
- ? `${r}function ${this._functionName}(${this._getParameterNames()})`
442
- : `${r}function(${this._getParameterNames()})`;
443
-
444
- const lines = [
445
- this.indent(signature + " {"),
446
- ...this._lines.map(line =>
447
- typeof line === 'string'
448
- ? this.indent(" " + line)
449
- : line.toString()
450
- ),
451
- this.indent("}")
452
- ];
453
-
454
- return lines.join('\n');
455
- }
456
- }
457
-
458
- export class FunctionBuilder extends ContainerBlock {
459
- private _functionName?: string;
460
- private _params: (string | GenericParam)[] = [];
461
- private _return: boolean = false;
462
-
463
- constructor(functionName?: string, sectionName?: string, parentIndent: string = "", parent?: Block) {
464
- super(sectionName, parentIndent, parent);
465
- this._functionName = functionName;
466
- }
467
-
468
- parameters(...params: (string | GenericParam)[]): this {
469
- this._params.push(...params);
470
- return this;
471
- }
472
-
473
- return() {
474
- this._return = true;
475
- return this;
476
- }
477
-
478
- appendBody(line: string): this {
479
- this.push(line);
480
- return this;
481
- }
482
-
483
- private _getParameterKeys() {
484
- return this._params.map(w => typeof w === "object" ? w.name : w).join(", ")
485
- }
486
-
487
- toCallable() {
488
- return `${this._functionName}(${this._params.map(w => typeof w === "object" ? w.callName : w).join(", ")})`
489
- }
490
-
491
- toString(): string {
492
- const r = this._return === true ? "return " : "";
493
- const signature = this._functionName
494
- ? `${r}function ${this._functionName}(${this._getParameterKeys()})`
495
- : `${r}function(${this._getParameterKeys()})`;
496
-
497
- const lines = [
498
- this.indent(signature + " {"),
499
- ...this._lines.map(line =>
500
- typeof line === 'string'
501
- ? this.indent(" " + line)
502
- : line.toString()
503
- ),
504
- this.indent("}")
505
- ];
506
-
507
- return lines.join('\n');
508
- }
509
- }
510
-
511
- export class ArrayBuilder extends Block {
512
- constructor(accessor: string, name?: string, parentIndent: string = "", parent?: Block) {
513
- super(name, parentIndent, parent);
514
- this._lines.push(accessor);
515
- }
516
-
517
- append(accessor: string) {
518
- this._lines.push(accessor);
519
- return this;
520
- }
521
-
522
- toString() {
523
- return `[${this._lines.join(",")}]`
524
- }
525
- }
526
-
527
- export class IfBuilder extends ContainerBlock {
528
- private _condition: string;
529
-
530
- constructor(condition: string, name?: string, parentIndent: string = "", parent?: Block) {
531
- super(name, parentIndent, parent);
532
- this._condition = condition;
533
- }
534
-
535
- appendBody(line: string): this {
536
- this.push(line);
537
- return this;
538
- }
539
-
540
- unshiftBody(line: string): this {
541
- this.unshift(line);
542
- return this;
543
- }
544
-
545
- private stringifyLine(line: Line) {
546
- if (typeof line === 'string') {
547
- return this.indent(" " + line);
548
- }
549
-
550
- if (Array.isArray(line)) {
551
- return line.join("\r\n")
552
- }
553
-
554
- return line.toString();
555
- }
556
-
557
- toString(): string {
558
- // need to join with \r\n because we are not an object
559
- const lines = [
560
- this.indent(`if (${this._condition}) {`),
561
- this._lines.map(x => this.stringifyLine(x)).join("\r\n"),
562
- this.indent("}")
563
- ]
564
-
565
- return lines.join("\n\n");
566
- }
567
- }
568
-
569
- export class CodeBuilder extends ContainerBlock {
570
-
571
- toString(): string {
572
- return this._lines.map(line =>
573
- typeof line === 'string'
574
- ? this.indent(line)
575
- : line.toString()
576
- ).join('\n\n');
577
- }
578
- }
@@ -1,13 +0,0 @@
1
- import { CloneObjectHandler } from "./clone/CloneObjectHandler";
2
- import { CloneValueHandler } from "./clone/CloneValueHandler";
3
-
4
- /// Purpose:
5
- export class CloneHandlerBuilder {
6
-
7
- build() {
8
- const handler = new CloneObjectHandler();
9
- handler.setNext(new CloneValueHandler());
10
-
11
- return handler;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { CompareObjectHandler } from "./compare/CompareObjectHandler";
2
- import { CompareValueHandler } from "./compare/CompareValueHandler";
3
-
4
- /// Purpose:
5
- export class CompareHandlerBuilder {
6
-
7
- build() {
8
- const handler = new CompareObjectHandler();
9
- handler.setNext(new CompareValueHandler());
10
-
11
- return handler;
12
- }
13
- }
@@ -1,20 +0,0 @@
1
- import { DeserializeObjectHandler } from "./deserialize/DeserializeObjectHandler";
2
- import { DeserializeValueHandler } from "./deserialize/DeserializeValueHandler";
3
- import { DeserializeDateHandler } from "./deserialize/DeserializeDateHandler";
4
- import { DeserializeComputedValueHandler } from "./deserialize/DeserializeComputedValueHandler";
5
- import { DeserializeFunctionHandler } from "./deserialize/DeserializeFunctionHandler";
6
-
7
- /// Purpose:
8
- export class DeserializeHandlerBuilder {
9
-
10
- build() {
11
- const handler = new DeserializeObjectHandler();
12
- handler
13
- .setNext(new DeserializeComputedValueHandler())
14
- .setNext(new DeserializeFunctionHandler())
15
- .setNext(new DeserializeValueHandler())
16
- .setNext(new DeserializeDateHandler());
17
-
18
- return handler;
19
- }
20
- }
@@ -1,13 +0,0 @@
1
- import { EnableChangeTrackingObjectHandler } from "./enableChangeTracking/EnableChangeTrackingObjectHandler";
2
- import { EnableChangeTrackingPrimitiveValueHandler } from "./enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler";
3
-
4
- /// Purpose:
5
- export class EnableChangeTrackingHandlerBuilder {
6
-
7
- build() {
8
- const handler = new EnableChangeTrackingObjectHandler();
9
- handler.setNext(new EnableChangeTrackingPrimitiveValueHandler());
10
-
11
- return handler;
12
- }
13
- }
@@ -1,28 +0,0 @@
1
- import { EnrichmentNullableObjectHandler } from "./enrichment/EnrichmentNullableObjectHandler";
2
- import { EnrichmentObjectHandler } from "./enrichment/EnrichmentObjectHandler";
3
- import { EnrichmentObjectIdentityHandler } from "./enrichment/EnrichmentObjectIdentityHandler";
4
- import { EnrichmentPrimitiveIdentityHandler } from "./enrichment/EnrichmentPrimitiveIdentityHandler";
5
- import { EnrichmentPrimitiveHandler } from './enrichment/EnrichmentPrimitiveHandler';
6
- import { EnrichmentFunctionHandler } from './enrichment/EnrichmentFunctionHandler';
7
- import { EnrichmentDefaultValueHandler } from './enrichment/EnrichmentDefaultValueHandler';
8
- import { EnrichmentDefaultFunctionHandler } from './enrichment/EnrichmentDefaultFunctionHandler';
9
- import { EnrichmentComputedValueHandler } from './enrichment/EnrichmentComputedValueHandler';
10
-
11
- /// Purpose:
12
- export class EnrichmentHandlerBuilder {
13
-
14
- build() {
15
- const handler = new EnrichmentPrimitiveIdentityHandler();
16
-
17
- handler.setNext(new EnrichmentObjectIdentityHandler())
18
- .setNext(new EnrichmentObjectHandler())
19
- .setNext(new EnrichmentNullableObjectHandler())
20
- .setNext(new EnrichmentFunctionHandler())
21
- .setNext(new EnrichmentDefaultValueHandler())
22
- .setNext(new EnrichmentDefaultFunctionHandler())
23
- .setNext(new EnrichmentComputedValueHandler())
24
- .setNext(new EnrichmentPrimitiveHandler());
25
-
26
- return handler;
27
- }
28
- }
@@ -1,13 +0,0 @@
1
- import { FreezePrimitiveValueHandler } from "./freeze/FreezePrimitiveValueHandler";
2
- import { FreezeObjectHandler } from "./freeze/FreezeObjectHandler";
3
-
4
- /// Purpose:
5
- export class FreezeHandlerBuilder {
6
-
7
- build() {
8
- const handler = new FreezeObjectHandler();
9
- handler.setNext(new FreezePrimitiveValueHandler());
10
-
11
- return handler;
12
- }
13
- }
@@ -1,25 +0,0 @@
1
- import { HashKeyHandler } from "./hash/HashKeyHandler";
2
- import { HashValueHandler } from "./hash/HashValueHandler";
3
- import { HashDateHandler } from "./hash/HashDateHandler";
4
- import { HashIdentityHandler } from "./hash/HashIdentityHandler";
5
- import { HashFunctionHandler } from "./hash/HashFunctionHandler";
6
- import { HashComputedValueHandler } from "./hash/HashComputedValueHandler";
7
-
8
- /// Purpose:
9
- // Should ignore Id's and Identities for type Object because we want
10
- // to comare a new addition with what was saved in the database
11
- export class HashHandlerBuilder {
12
-
13
- build() {
14
- const handler = new HashKeyHandler();
15
-
16
- handler
17
- .setNext(new HashComputedValueHandler())
18
- .setNext(new HashFunctionHandler())
19
- .setNext(new HashIdentityHandler())
20
- .setNext(new HashDateHandler())
21
- .setNext(new HashValueHandler());
22
-
23
- return handler;
24
- }
25
- }