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

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 (334) 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/ReadonlySchemaCollection.d.ts +17 -0
  78. package/dist/collections/SchemaCollection.d.ts +10 -0
  79. package/dist/collections/TagCollection.d.ts +15 -0
  80. package/dist/collections/TagCollection.test.d.ts +1 -0
  81. package/{src/collections/index.ts → dist/collections/index.d.ts} +2 -1
  82. package/dist/collections/index.js +717 -0
  83. package/dist/collections/index.js.map +1 -0
  84. package/dist/errors/SchemaError.d.ts +3 -0
  85. package/dist/errors/index.d.ts +1 -0
  86. package/dist/errors/index.js +90 -0
  87. package/dist/errors/index.js.map +1 -0
  88. package/{src/expressions/index.ts → dist/expressions/index.d.ts} +1 -1
  89. package/{src/expressions/parser.ts → dist/expressions/index.js} +387 -205
  90. package/dist/expressions/index.js.map +1 -0
  91. package/dist/expressions/parser.d.ts +4 -0
  92. package/dist/expressions/parser.test.d.ts +1 -0
  93. package/{src/expressions/types.ts → dist/expressions/types.d.ts} +42 -99
  94. package/dist/expressions/utils.d.ts +10 -0
  95. package/dist/expressions/utils.test.d.ts +1 -0
  96. package/{src/index.ts → dist/index.d.ts} +1 -1
  97. package/dist/index.js +8589 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/performance/index.d.ts +5 -0
  100. package/dist/performance/index.js +65 -0
  101. package/dist/performance/index.js.map +1 -0
  102. package/dist/pipeline/SyncronousQueue.d.ts +7 -0
  103. package/dist/pipeline/SyncronousQueue.test.d.ts +1 -0
  104. package/dist/pipeline/TrampolinePipeline.d.ts +36 -0
  105. package/dist/pipeline/TrampolinePipeline.test.d.ts +1 -0
  106. package/dist/pipeline/index.d.ts +2 -0
  107. package/{src/pipeline/TrampolinePipeline.ts → dist/pipeline/index.js} +297 -140
  108. package/dist/pipeline/index.js.map +1 -0
  109. package/dist/plugins/EphemeralDataPlugin.d.ts +13 -0
  110. package/dist/plugins/capabilities/DbPluginCapability.d.ts +23 -0
  111. package/{src/plugins/capabilities/index.ts → dist/plugins/capabilities/index.d.ts} +1 -1
  112. package/dist/plugins/capabilities/logging/DbPluginLoggingCapability.d.ts +28 -0
  113. package/dist/plugins/capabilities/logging/index.d.ts +1 -0
  114. package/{src/plugins/index.ts → dist/plugins/index.d.ts} +1 -1
  115. package/dist/plugins/index.js +2332 -0
  116. package/dist/plugins/index.js.map +1 -0
  117. package/dist/plugins/query/Query.d.ts +13 -0
  118. package/dist/plugins/query/QueryOptionsCollection.d.ts +27 -0
  119. package/dist/plugins/query/QueryOptionsCollection.test.d.ts +1 -0
  120. package/{src/plugins/query/index.ts → dist/plugins/query/index.d.ts} +1 -1
  121. package/{src/plugins/query/types.ts → dist/plugins/query/types.d.ts} +29 -20
  122. package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +21 -0
  123. package/dist/plugins/replication/ReplicationDbPlugin.d.ts +21 -0
  124. package/{src/plugins/replication/index.ts → dist/plugins/replication/index.d.ts} +1 -1
  125. package/{src/plugins/replication/types.ts → dist/plugins/replication/types.d.ts} +1 -2
  126. package/dist/plugins/translators/DataTranslator.d.ts +18 -0
  127. package/dist/plugins/translators/JsonTranslator.d.ts +17 -0
  128. package/dist/plugins/translators/JsonTranslator.test.d.ts +1 -0
  129. package/dist/plugins/translators/SqlTranslator.d.ts +14 -0
  130. package/{src/plugins/translators/index.ts → dist/plugins/translators/index.d.ts} +1 -1
  131. package/{src/plugins/types.ts → dist/plugins/types.d.ts} +13 -26
  132. package/dist/results/Result.d.ts +29 -0
  133. package/{src/results/index.ts → dist/results/index.d.ts} +1 -1
  134. package/dist/results/index.js +192 -0
  135. package/dist/results/index.js.map +1 -0
  136. package/{src/results/types.ts → dist/results/types.d.ts} +18 -7
  137. package/dist/results/utils.d.ts +2 -0
  138. package/dist/schema/PropertyInfo.d.ts +132 -0
  139. package/dist/schema/PropertyInfo.test.d.ts +1 -0
  140. package/dist/schema/SchemaDefinition.d.ts +17 -0
  141. package/dist/schema/builder.d.ts +17 -0
  142. package/dist/schema/communication/broadcast.d.ts +11 -0
  143. package/{src/schema/index.ts → dist/schema/index.d.ts} +1 -1
  144. package/dist/schema/index.js +4929 -0
  145. package/dist/schema/index.js.map +1 -0
  146. package/dist/schema/property/base/SchemaBase.d.ts +23 -0
  147. package/dist/schema/property/base/index.d.ts +1 -0
  148. package/dist/schema/property/modifiers/SchemaDefault.d.ts +13 -0
  149. package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +11 -0
  150. package/dist/schema/property/modifiers/SchemaDistinct.d.ts +7 -0
  151. package/dist/schema/property/modifiers/SchemaFrom.d.ts +23 -0
  152. package/dist/schema/property/modifiers/SchemaIdentity.d.ts +7 -0
  153. package/dist/schema/property/modifiers/SchemaIndex.d.ts +23 -0
  154. package/dist/schema/property/modifiers/SchemaKey.d.ts +13 -0
  155. package/dist/schema/property/modifiers/SchemaNullable.d.ts +9 -0
  156. package/dist/schema/property/modifiers/SchemaOptional.d.ts +9 -0
  157. package/dist/schema/property/modifiers/SchemaReadonly.d.ts +15 -0
  158. package/dist/schema/property/modifiers/SchemaSerialize.d.ts +9 -0
  159. package/dist/schema/property/modifiers/SchemaTracked.d.ts +7 -0
  160. package/{src/schema/property/modifiers/index.ts → dist/schema/property/modifiers/index.d.ts} +1 -1
  161. package/dist/schema/property/types/SchemaArray.d.ts +23 -0
  162. package/dist/schema/property/types/SchemaBoolean.d.ts +27 -0
  163. package/dist/schema/property/types/SchemaDate.d.ts +27 -0
  164. package/dist/schema/property/types/SchemaNumber.d.ts +31 -0
  165. package/dist/schema/property/types/SchemaObject.d.ts +20 -0
  166. package/dist/schema/property/types/SchemaString.d.ts +31 -0
  167. package/{src/schema/property/types/index.ts → dist/schema/property/types/index.d.ts} +1 -1
  168. package/dist/schema/table/SchemaComputed.d.ts +10 -0
  169. package/dist/schema/table/SchemaFunction.d.ts +8 -0
  170. package/{src/schema/table/index.ts → dist/schema/table/index.d.ts} +1 -1
  171. package/{src/schema/types.ts → dist/schema/types.d.ts} +61 -101
  172. package/{src/types/index.ts → dist/types/index.d.ts} +1 -2
  173. package/dist/types/index.js +25 -0
  174. package/dist/types/index.js.map +1 -0
  175. package/dist/utilities/arrays.d.ts +1 -0
  176. package/dist/utilities/arrays.test.d.ts +1 -0
  177. package/dist/utilities/dates.d.ts +1 -0
  178. package/dist/utilities/dates.test.d.ts +1 -0
  179. package/dist/utilities/dbPluginEventUtils.d.ts +14 -0
  180. package/dist/utilities/functions.d.ts +1 -0
  181. package/{src/utilities/index.ts → dist/utilities/index.d.ts} +2 -1
  182. package/dist/utilities/index.js +571 -0
  183. package/dist/utilities/index.js.map +1 -0
  184. package/dist/utilities/objects.d.ts +2 -0
  185. package/dist/utilities/queryOptionsCollection.d.ts +2 -0
  186. package/dist/utilities/replication.d.ts +3 -0
  187. package/dist/utilities/runtime.d.ts +1 -0
  188. package/dist/utilities/strings.d.ts +1 -0
  189. package/dist/utilities/types.d.ts +4 -0
  190. package/dist/utilities/uuid.d.ts +2 -0
  191. package/package.json +6 -1
  192. package/readme.md +95 -0
  193. package/CHANGELOG.md +0 -8
  194. package/rspack.config.mjs +0 -65
  195. package/src/assertions/index.ts +0 -37
  196. package/src/codegen/SlotPath.ts +0 -20
  197. package/src/codegen/blocks.ts +0 -578
  198. package/src/codegen/handlers/CloneHandlerBuilder.ts +0 -13
  199. package/src/codegen/handlers/CompareHandlerBuilder.ts +0 -13
  200. package/src/codegen/handlers/DeserializeHandlerBuilder.ts +0 -20
  201. package/src/codegen/handlers/EnableChangeTrackingHandlerBuilder.ts +0 -13
  202. package/src/codegen/handlers/EnrichmentHandlerBuilder.ts +0 -28
  203. package/src/codegen/handlers/FreezeHandlerBuilder.ts +0 -13
  204. package/src/codegen/handlers/HashHandlerBuilder.ts +0 -25
  205. package/src/codegen/handlers/HashTypeHandlerBuilder.ts +0 -11
  206. package/src/codegen/handlers/IdSelectorHandlerBuilder.ts +0 -10
  207. package/src/codegen/handlers/MergeHandlerBuilder.ts +0 -19
  208. package/src/codegen/handlers/PrepareHandlerBuilder.ts +0 -23
  209. package/src/codegen/handlers/SerializeHandlerBuilder.ts +0 -15
  210. package/src/codegen/handlers/StripHandlerBuilder.ts +0 -18
  211. package/src/codegen/handlers/clone/CloneObjectHandler.ts +0 -29
  212. package/src/codegen/handlers/clone/CloneValueHandler.ts +0 -33
  213. package/src/codegen/handlers/compare/CompareObjectHandler.ts +0 -15
  214. package/src/codegen/handlers/compare/CompareValueHandler.ts +0 -27
  215. package/src/codegen/handlers/deserialize/DeserializeComputedValueHandler.ts +0 -16
  216. package/src/codegen/handlers/deserialize/DeserializeDateHandler.ts +0 -45
  217. package/src/codegen/handlers/deserialize/DeserializeFunctionHandler.ts +0 -16
  218. package/src/codegen/handlers/deserialize/DeserializeObjectHandler.ts +0 -29
  219. package/src/codegen/handlers/deserialize/DeserializeValueHandler.ts +0 -33
  220. package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingObjectHandler.ts +0 -20
  221. package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler.ts +0 -15
  222. package/src/codegen/handlers/enrichment/EnrichmentComputedValueHandler.ts +0 -37
  223. package/src/codegen/handlers/enrichment/EnrichmentDefaultFunctionHandler.ts +0 -50
  224. package/src/codegen/handlers/enrichment/EnrichmentDefaultValueHandler.ts +0 -18
  225. package/src/codegen/handlers/enrichment/EnrichmentFunctionHandler.ts +0 -38
  226. package/src/codegen/handlers/enrichment/EnrichmentNullableObjectHandler.ts +0 -44
  227. package/src/codegen/handlers/enrichment/EnrichmentObjectHandler.ts +0 -29
  228. package/src/codegen/handlers/enrichment/EnrichmentObjectIdentityHandler.ts +0 -16
  229. package/src/codegen/handlers/enrichment/EnrichmentPrimitiveHandler.ts +0 -13
  230. package/src/codegen/handlers/enrichment/EnrichmentPrimitiveIdentityHandler.ts +0 -21
  231. package/src/codegen/handlers/freeze/FreezeObjectHandler.ts +0 -20
  232. package/src/codegen/handlers/freeze/FreezePrimitiveValueHandler.ts +0 -15
  233. package/src/codegen/handlers/hash/HashComputedValueHandler.ts +0 -15
  234. package/src/codegen/handlers/hash/HashDateHandler.ts +0 -26
  235. package/src/codegen/handlers/hash/HashFunctionHandler.ts +0 -16
  236. package/src/codegen/handlers/hash/HashIdentityHandler.ts +0 -15
  237. package/src/codegen/handlers/hash/HashKeyHandler.ts +0 -26
  238. package/src/codegen/handlers/hash/HashValueHandler.ts +0 -26
  239. package/src/codegen/handlers/hashType/HashTypeValueHandler.ts +0 -20
  240. package/src/codegen/handlers/idSelector/IdSelectorValueHandler.ts +0 -28
  241. package/src/codegen/handlers/merge/MergeComputedValueHandler.ts +0 -37
  242. package/src/codegen/handlers/merge/MergeDefaultFunctionHandler.ts +0 -40
  243. package/src/codegen/handlers/merge/MergeDefaultValueHandler.ts +0 -32
  244. package/src/codegen/handlers/merge/MergeFunctionHandler.ts +0 -16
  245. package/src/codegen/handlers/merge/MergePrimitiveHandler.ts +0 -21
  246. package/src/codegen/handlers/prepare/PrepareComputedValueHandler.ts +0 -16
  247. package/src/codegen/handlers/prepare/PrepareFunctionHandler.ts +0 -16
  248. package/src/codegen/handlers/prepare/PrepareIdentityHandler.ts +0 -21
  249. package/src/codegen/handlers/prepare/PrepareKeyHandler.ts +0 -21
  250. package/src/codegen/handlers/prepare/PrepareObjectHandler.ts +0 -38
  251. package/src/codegen/handlers/prepare/PrepareValueHandler.ts +0 -36
  252. package/src/codegen/handlers/serialize/SerializeDateHandler.ts +0 -45
  253. package/src/codegen/handlers/serialize/SerializeObjectHandler.ts +0 -28
  254. package/src/codegen/handlers/serialize/SerializeValueHandler.ts +0 -33
  255. package/src/codegen/handlers/strip/StripIdentityHandler.ts +0 -15
  256. package/src/codegen/handlers/strip/StripKeyHandler.ts +0 -15
  257. package/src/codegen/handlers/strip/StripObjectHandler.ts +0 -35
  258. package/src/codegen/handlers/strip/StripValueHandler.ts +0 -36
  259. package/src/codegen/handlers/types.ts +0 -119
  260. package/src/codegen/types.ts +0 -2
  261. package/src/codegen/utils.ts +0 -74
  262. package/src/collections/Changes.test.ts +0 -337
  263. package/src/collections/Changes.ts +0 -177
  264. package/src/collections/IdSet.ts +0 -28
  265. package/src/collections/MemoryDataCollection.test.ts +0 -424
  266. package/src/collections/MemoryDataCollection.ts +0 -134
  267. package/src/collections/SchemaCollection.ts +0 -22
  268. package/src/collections/TagCollection.test.ts +0 -443
  269. package/src/collections/TagCollection.ts +0 -62
  270. package/src/errors/SchemaError.ts +0 -6
  271. package/src/errors/index.ts +0 -1
  272. package/src/expressions/parser.test.ts +0 -913
  273. package/src/expressions/utils.test.ts +0 -346
  274. package/src/expressions/utils.ts +0 -59
  275. package/src/performance/index.ts +0 -26
  276. package/src/pipeline/SyncronousQueue.test.ts +0 -269
  277. package/src/pipeline/SyncronousQueue.ts +0 -30
  278. package/src/pipeline/TrampolinePipeline.test.ts +0 -374
  279. package/src/pipeline/index.ts +0 -2
  280. package/src/plugins/EphemeralDataPlugin.ts +0 -132
  281. package/src/plugins/capabilities/DbPluginCapability.ts +0 -111
  282. package/src/plugins/capabilities/logging/DbPluginLoggingCapability.ts +0 -261
  283. package/src/plugins/capabilities/logging/index.ts +0 -1
  284. package/src/plugins/query/Query.ts +0 -67
  285. package/src/plugins/query/QueryOptionsCollection.test.ts +0 -86
  286. package/src/plugins/query/QueryOptionsCollection.ts +0 -154
  287. package/src/plugins/replication/OptimisticReplicationDbPlugin.ts +0 -202
  288. package/src/plugins/replication/ReplicationDbPlugin.ts +0 -137
  289. package/src/plugins/translators/DataTranslator.ts +0 -46
  290. package/src/plugins/translators/JsonTranslator.test.ts +0 -618
  291. package/src/plugins/translators/JsonTranslator.ts +0 -211
  292. package/src/plugins/translators/SqlTranslator.ts +0 -45
  293. package/src/results/Result.ts +0 -91
  294. package/src/results/utils.ts +0 -15
  295. package/src/schema/PropertyInfo.test.ts +0 -479
  296. package/src/schema/PropertyInfo.ts +0 -374
  297. package/src/schema/SchemaDefinition.ts +0 -626
  298. package/src/schema/builder.ts +0 -18
  299. package/src/schema/property/base/SchemaBase.ts +0 -49
  300. package/src/schema/property/base/index.ts +0 -1
  301. package/src/schema/property/modifiers/SchemaDefault.ts +0 -29
  302. package/src/schema/property/modifiers/SchemaDeserialize.ts +0 -23
  303. package/src/schema/property/modifiers/SchemaDistinct.ts +0 -14
  304. package/src/schema/property/modifiers/SchemaFrom.ts +0 -54
  305. package/src/schema/property/modifiers/SchemaIdentity.ts +0 -13
  306. package/src/schema/property/modifiers/SchemaIndex.ts +0 -60
  307. package/src/schema/property/modifiers/SchemaKey.ts +0 -28
  308. package/src/schema/property/modifiers/SchemaNullable.ts +0 -18
  309. package/src/schema/property/modifiers/SchemaOptional.ts +0 -19
  310. package/src/schema/property/modifiers/SchemaReadonly.ts +0 -34
  311. package/src/schema/property/modifiers/SchemaSerialize.ts +0 -18
  312. package/src/schema/property/modifiers/SchemaTracked.ts +0 -14
  313. package/src/schema/property/types/SchemaArray.ts +0 -50
  314. package/src/schema/property/types/SchemaBoolean.ts +0 -59
  315. package/src/schema/property/types/SchemaDate.ts +0 -58
  316. package/src/schema/property/types/SchemaNumber.ts +0 -69
  317. package/src/schema/property/types/SchemaObject.ts +0 -44
  318. package/src/schema/property/types/SchemaString.ts +0 -69
  319. package/src/schema/table/SchemaComputed.ts +0 -20
  320. package/src/schema/table/SchemaFunction.ts +0 -15
  321. package/src/utilities/arrays.test.ts +0 -312
  322. package/src/utilities/arrays.ts +0 -12
  323. package/src/utilities/dates.test.ts +0 -388
  324. package/src/utilities/dates.ts +0 -11
  325. package/src/utilities/dbPluginEventUtils.ts +0 -44
  326. package/src/utilities/objects.ts +0 -7
  327. package/src/utilities/queryOptionsCollection.ts +0 -16
  328. package/src/utilities/replication.ts +0 -23
  329. package/src/utilities/runtime.ts +0 -3
  330. package/src/utilities/strings.ts +0 -18
  331. package/src/utilities/types.ts +0 -1
  332. package/src/utilities/uuid.ts +0 -56
  333. package/tsconfig.json +0 -28
  334. package/vitest.config.ts +0 -11
@@ -1,5 +1,15 @@
1
- import { CompiledSchema, SchemaTypes } from "../schema";
2
- import { Expression, OperatorExpression, ComparatorExpression, ValueExpression, PropertyExpression, Filter, ParamsFilter, Operator } from "./types";
1
+ var __webpack_modules__ = ({
2
+ "./src/expressions/parser.ts":
3
+ /*!***********************************!*\
4
+ !*** ./src/expressions/parser.ts ***!
5
+ \***********************************/
6
+ (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7
+ __webpack_require__.r(__webpack_exports__);
8
+ __webpack_require__.d(__webpack_exports__, {
9
+ combineExpressions: () => (combineExpressions),
10
+ toExpression: () => (toExpression)
11
+ });
12
+ /* ESM import */var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./src/expressions/types.ts");
3
13
 
4
14
  // Pre-compiled regex patterns for better performance
5
15
  const METHOD_REGEX = /([a-zA-Z0-9_.]+)\.(startsWith|endsWith|includes)\(([^)]+)\)(\s*(===|==|!==|!=)\s*(true|false))?/;
@@ -7,142 +17,124 @@ const TRANSFORM_METHOD_REGEX = /([a-zA-Z0-9_.]+)\.(toLowerCase|toUpperCase|toLoc
7
17
  const EQUALITY_REGEX = /([^=!<>]+?)\s*(===|==|!==|!=)\s*(.+)/;
8
18
  const COMPARISON_REGEX = /([^=!<>]+?)\s*(>=|<=|>|<)\s*(.+)/;
9
19
  const PARAM_PATH_REGEX = /^([a-zA-Z0-9_.]+)/;
10
-
11
20
  // Pre-compiled regex patterns for comment removal
12
21
  const SINGLE_LINE_COMMENT_REGEX = /\/\/.*$/gm;
13
22
  const MULTI_LINE_COMMENT_REGEX = /\/\*[\s\S]*?\*\//g;
14
23
  const WHITESPACE_REGEX = /\s+/g;
15
-
16
24
  // need to have negated + strict
17
- const comparators: Record<string, ComparatorExpression> = {
18
- startsWith: new ComparatorExpression({
25
+ const comparators = {
26
+ startsWith: new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
19
27
  comparator: "starts-with",
20
28
  negated: false,
21
29
  strict: false
22
30
  }),
23
- endsWith: new ComparatorExpression({
31
+ endsWith: new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
24
32
  comparator: "ends-with",
25
33
  negated: false,
26
34
  strict: false
27
35
  }),
28
- includes: new ComparatorExpression({
36
+ includes: new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
29
37
  comparator: "includes",
30
38
  negated: false,
31
39
  strict: false
32
40
  }),
33
- "==": new ComparatorExpression({
41
+ "==": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
34
42
  comparator: "equals",
35
43
  negated: false,
36
44
  strict: false
37
45
  }),
38
- "===": new ComparatorExpression({
46
+ "===": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
39
47
  comparator: "equals",
40
48
  negated: false,
41
49
  strict: true
42
50
  }),
43
- "!=": new ComparatorExpression({
51
+ "!=": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
44
52
  comparator: "equals",
45
53
  negated: true,
46
54
  strict: false
47
55
  }),
48
- "!==": new ComparatorExpression({
56
+ "!==": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
49
57
  comparator: "equals",
50
58
  negated: true,
51
59
  strict: true
52
60
  }),
53
- ">=": new ComparatorExpression({
61
+ ">=": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
54
62
  comparator: "greater-than-equals",
55
63
  negated: false,
56
64
  strict: false
57
65
  }),
58
- ">==": new ComparatorExpression({
66
+ ">==": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
59
67
  comparator: "greater-than-equals",
60
68
  negated: false,
61
69
  strict: true
62
70
  }),
63
- "<=": new ComparatorExpression({
71
+ "<=": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
64
72
  comparator: "less-than-equals",
65
73
  negated: false,
66
74
  strict: false
67
75
  }),
68
- "<==": new ComparatorExpression({
76
+ "<==": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
69
77
  comparator: "less-than-equals",
70
78
  negated: false,
71
79
  strict: true
72
80
  }),
73
- ">": new ComparatorExpression({
81
+ ">": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
74
82
  comparator: "greater-than",
75
83
  negated: false,
76
84
  strict: false
77
85
  }),
78
- "<": new ComparatorExpression({
86
+ "<": new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
79
87
  comparator: "less-than",
80
88
  negated: false,
81
89
  strict: false
82
90
  })
83
- } as const;
84
-
91
+ };
85
92
  // Optimized comparator lookup using Map
86
93
  const COMPARATOR_MAP = new Map(Object.entries(comparators));
87
-
88
94
  // Error message constants
89
95
  const ERROR_MESSAGES = {
90
- COMPARATOR_NOT_FOUND: (value: string) => `Cannot find comparator: ${value}`,
91
- PROPERTY_NOT_FOUND: (path: string) => `Error parsing query, could not find PropertyInfo for path: ${path}`,
92
- PARAM_PATH_NOT_FOUND: (value: string, params: any) => `Cannot find path in params for .where(). Make sure parameters are not used inline.\r\nPath: ${value}, Params: ${JSON.stringify(params)}`
96
+ COMPARATOR_NOT_FOUND: (value) => `Cannot find comparator: ${value}`,
97
+ PROPERTY_NOT_FOUND: (path) => `Error parsing query, could not find PropertyInfo for path: ${path}`,
98
+ PARAM_PATH_NOT_FOUND: (value, params) => `Cannot find path in params for .where(). Make sure parameters are not used inline.\r\nPath: ${value}, Params: ${JSON.stringify(params)}`
93
99
  };
94
-
95
- export const combineExpressions = (...expressions: Expression[]): Expression => {
96
-
100
+ const combineExpressions = (...expressions) => {
97
101
  if (expressions.length === 0) {
98
102
  throw new Error("combineExpressions requires at least 1 expression");
99
103
  }
100
-
101
-
102
104
  if (expressions.length === 1) {
103
105
  return expressions[0];
104
106
  }
105
-
106
107
  // Start with the first expression
107
108
  let result = expressions[0];
108
-
109
109
  // Loop through remaining expressions and combine them
110
110
  for (let i = 1; i < expressions.length; i++) {
111
- result = new OperatorExpression({
111
+ result = new _types__WEBPACK_IMPORTED_MODULE_0__.OperatorExpression({
112
112
  operator: "&&",
113
113
  left: result,
114
114
  right: expressions[i]
115
115
  });
116
116
  }
117
-
118
117
  return result;
119
118
  };
120
-
121
- export const toExpression = <T extends any, P extends any>(schema: CompiledSchema<any>, fn: Filter<T> | ParamsFilter<T, P>, params?: P) => {
119
+ const toExpression = (schema, fn, params) => {
122
120
  try {
123
-
124
121
  const stringifiedFunction = fn.toString();
125
-
126
122
  // Optimized string parsing
127
123
  const arrowIndex = stringifiedFunction.indexOf('=>');
128
124
  if (arrowIndex === -1) {
129
125
  throw new Error("Invalid Function");
130
126
  }
131
-
132
127
  const parameterNames = stringifiedFunction.substring(0, arrowIndex).trim();
133
128
  let expression = stringifiedFunction.substring(arrowIndex + 2).trim();
134
-
135
129
  // Remove JavaScript comments from the expression
136
130
  expression = expression
137
131
  .replace(SINGLE_LINE_COMMENT_REGEX, '') // Remove single-line comments
138
132
  .replace(MULTI_LINE_COMMENT_REGEX, '') // Remove multi-line comments
139
133
  .replace(WHITESPACE_REGEX, ' ') // Normalize whitespace
140
134
  .trim();
141
-
142
- let parameterData: { name: string, data: P } | undefined = undefined;
143
-
135
+ let parameterData = undefined;
144
136
  if (params != null) {
145
- let name: string;
137
+ let name;
146
138
  if (parameterNames.includes("[") && parameterNames.includes("]")) {
147
139
  // Optimized parameter name extraction
148
140
  const commaIndex = parameterNames.indexOf(",");
@@ -153,23 +145,20 @@ export const toExpression = <T extends any, P extends any>(schema: CompiledSchem
153
145
  }
154
146
  }
155
147
  }
156
-
157
148
  parameterData = {
158
149
  name,
159
150
  data: params
160
151
  };
161
152
  }
162
-
163
153
  return parseExpressionToTree(schema, expression, parameterData);
164
- } catch (e) {
154
+ }
155
+ catch (e) {
165
156
  console.warn("Error parsing expression", e);
166
- return Expression.NOT_PARSABLE;
157
+ return _types__WEBPACK_IMPORTED_MODULE_0__.Expression.NOT_PARSABLE;
167
158
  }
168
- }
169
-
170
- const parseExpressionToTree = <P extends any>(schema: CompiledSchema<any>, expression: string, params?: { name: string, data: P }) => {
171
-
172
- const parse = (exp: string): Expression => {
159
+ };
160
+ const parseExpressionToTree = (schema, expression, params) => {
161
+ const parse = (exp) => {
173
162
  // Remove any wrapping parentheses
174
163
  exp = exp.trim();
175
164
  if (exp.startsWith('(') && exp.endsWith(')')) {
@@ -179,9 +168,11 @@ const parseExpressionToTree = <P extends any>(schema: CompiledSchema<any>, expre
179
168
  const char = exp[i];
180
169
  if (char === '(') {
181
170
  depth++;
182
- } else if (char === ')') {
171
+ }
172
+ else if (char === ')') {
183
173
  depth--;
184
- if (depth < 0) break; // Early exit for invalid parentheses
174
+ if (depth < 0)
175
+ break; // Early exit for invalid parentheses
185
176
  }
186
177
  // Early exit if we find a closing parenthesis that's not the last character
187
178
  if (depth === 0 && i !== exp.length - 1) {
@@ -198,57 +189,48 @@ const parseExpressionToTree = <P extends any>(schema: CompiledSchema<any>, expre
198
189
  exp = exp.slice(1, -1).trim();
199
190
  }
200
191
  }
201
-
202
192
  // Parse based on the operator precedence
203
- let operator: Operator | null = null, splitIndex = -1, depth = 0;
204
-
193
+ let operator = null, splitIndex = -1, depth = 0;
205
194
  for (let i = 0; i < exp.length - 1; i++) {
206
195
  const char = exp[i];
207
- if (char === '(') depth++;
208
- else if (char === ')') depth--;
196
+ if (char === '(')
197
+ depth++;
198
+ else if (char === ')')
199
+ depth--;
209
200
  else if (depth === 0) {
210
201
  // Optimized operator detection using character comparison
211
202
  if (char === '&' && exp[i + 1] === '&') {
212
203
  operator = '&&';
213
204
  splitIndex = i;
214
205
  break; // AND takes precedence over OR
215
- } else if (operator === null && char === '|' && exp[i + 1] === '|') {
206
+ }
207
+ else if (operator === null && char === '|' && exp[i + 1] === '|') {
216
208
  operator = '||';
217
209
  splitIndex = i;
218
210
  }
219
211
  }
220
212
  }
221
-
222
213
  if (operator) {
223
214
  const left = exp.slice(0, splitIndex).trim();
224
215
  const right = exp.slice(splitIndex + 2).trim();
225
-
226
- return new OperatorExpression({
216
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.OperatorExpression({
227
217
  operator,
228
218
  left: parse(left),
229
219
  right: parse(right)
230
220
  });
231
221
  }
232
-
233
222
  // If no operator, try to parse as a condition
234
223
  return parseCondition(schema, exp, params);
235
- }
236
-
224
+ };
237
225
  return parse(expression);
238
- }
239
-
240
- const convertAndAssignValue = (valueExpression: unknown, propertyPathExpression: unknown) => {
241
-
226
+ };
227
+ const convertAndAssignValue = (valueExpression, propertyPathExpression) => {
242
228
  assertIsPropertyPathExpression(propertyPathExpression);
243
-
244
- assertIsValueExpression(valueExpression)
245
-
229
+ assertIsValueExpression(valueExpression);
246
230
  const propertyType = propertyPathExpression.property.type;
247
-
248
231
  valueExpression.value = converters[propertyType](valueExpression.value);
249
- }
250
-
251
- const converters: Record<SchemaTypes, (value: unknown) => unknown> = {
232
+ };
233
+ const converters = {
252
234
  Array: v => v,
253
235
  Boolean: v => v == null ? v : Boolean(v),
254
236
  Computed: v => v,
@@ -259,43 +241,33 @@ const converters: Record<SchemaTypes, (value: unknown) => unknown> = {
259
241
  Object: v => v,
260
242
  String: v => v == null ? v : String(v)
261
243
  };
262
-
263
- const isExpression = (value: unknown): value is Expression => {
244
+ const isExpression = (value) => {
264
245
  return typeof value === "object" && value !== null && "type" in value;
265
- }
266
-
267
- function assertIsExpression(value: unknown): asserts value is Expression {
246
+ };
247
+ function assertIsExpression(value) {
268
248
  if (isExpression(value) === false) {
269
- throw new Error("Assertion Failed: Value is not a Expression")
249
+ throw new Error("Assertion Failed: Value is not a Expression");
270
250
  }
271
251
  }
272
-
273
- function assertIsPropertyPathExpression(value: unknown): asserts value is PropertyExpression {
274
-
252
+ function assertIsPropertyPathExpression(value) {
275
253
  assertIsExpression(value);
276
-
277
254
  if (!("property" in value)) {
278
- throw new Error("Assertion Failed: Value is not a PropertyPathExpression")
255
+ throw new Error("Assertion Failed: Value is not a PropertyPathExpression");
279
256
  }
280
257
  }
281
-
282
- function assertIsValueExpression(value: unknown): asserts value is ValueExpression {
283
-
258
+ function assertIsValueExpression(value) {
284
259
  assertIsExpression(value);
285
-
286
260
  if (!("value" in value)) {
287
- throw new Error("Assertion Failed: Value is not a ValueExpression")
261
+ throw new Error("Assertion Failed: Value is not a ValueExpression");
288
262
  }
289
263
  }
290
-
291
264
  // Helper function to detect if a string is a property path
292
- const isPropertyPath = (value: string): boolean => {
265
+ const isPropertyPath = (value) => {
293
266
  return value.includes('.') && value.match(/^[a-zA-Z0-9_.]+$/) !== null;
294
267
  };
295
-
296
268
  // Helper function to determine if we need to swap the operator for reversed comparisons
297
- const getSwappedOperator = (operator: string): string => {
298
- const swapMap: Record<string, string> = {
269
+ const getSwappedOperator = (operator) => {
270
+ const swapMap = {
299
271
  '>': '<',
300
272
  '<': '>',
301
273
  '>=': '<=',
@@ -303,71 +275,59 @@ const getSwappedOperator = (operator: string): string => {
303
275
  };
304
276
  return swapMap[operator] || operator;
305
277
  };
306
-
307
- const parseCondition = <P extends any>(schema: CompiledSchema<any>, expression: string, params?: { name: string, data: P }): Expression => {
308
-
278
+ const parseCondition = (schema, expression, params) => {
309
279
  // Optimized string operations - single trim operation
310
280
  const trimmed = expression.trim();
311
281
  const isNegation = trimmed.startsWith('!');
312
282
  const finalExpression = isNegation ? trimmed.slice(1).trim() : trimmed;
313
-
314
283
  // Enhanced pattern matching for complex expressions
315
284
  const methodMatch = finalExpression.match(METHOD_REGEX);
316
285
  const transformMethodMatch = finalExpression.match(TRANSFORM_METHOD_REGEX);
317
286
  const equalityMatch = finalExpression.match(EQUALITY_REGEX);
318
287
  const comparisonMatch = finalExpression.match(COMPARISON_REGEX);
319
-
320
288
  if (methodMatch) {
321
289
  // Handle .startsWith or .endsWith
322
290
  const comparator = getComparator(methodMatch[2]);
323
-
324
291
  if (isNegation) {
325
292
  comparator.negated = isNegation;
326
293
  }
327
-
328
294
  // Check if the left side is a parameter path
329
295
  const leftSide = methodMatch[1];
330
296
  const rightSide = methodMatch[3];
331
-
332
297
  if (params && leftSide.startsWith(params.name)) {
333
298
  // This is a parameter path on the left side (e.g., params.distinctPlayers.includes(entity.playerId))
334
299
  // For includes method, we need to swap left and right sides
335
300
  if (methodMatch[2] === 'includes') {
336
301
  comparator.left = getValue(leftSide, params);
337
302
  comparator.right = getProperty(schema, rightSide);
338
- } else {
303
+ }
304
+ else {
339
305
  // For other methods, return NOT_PARSABLE for now
340
- return Expression.NOT_PARSABLE;
306
+ return _types__WEBPACK_IMPORTED_MODULE_0__.Expression.NOT_PARSABLE;
341
307
  }
342
- } else {
308
+ }
309
+ else {
343
310
  // Normal case: property on left, value on right
344
311
  comparator.left = getProperty(schema, leftSide);
345
312
  comparator.right = getValue(rightSide, params);
346
313
  }
347
-
348
314
  // If the comparison is explicitly to false, mark it as negated
349
315
  if (methodMatch[6] === "false") {
350
316
  comparator.negated = true;
351
317
  }
352
-
353
318
  return comparator;
354
319
  }
355
-
356
320
  // Check for transformations on the value side (right side of comparison) - check this FIRST
357
321
  const valueTransformMatch = finalExpression.match(/([^=!<>]+?)\s*(===|==|!==|!=)\s*([^)]+)\.(toLowerCase|toUpperCase|toLocaleLowerCase|toLocaleUpperCase)\(\)/);
358
322
  if (valueTransformMatch) {
359
323
  const comparator = getComparator(valueTransformMatch[2]);
360
-
361
324
  if (isNegation) {
362
325
  comparator.negated = isNegation;
363
326
  }
364
-
365
327
  // Create the property expression for the left side (no transformer)
366
328
  const propertyExpression = getProperty(schema, valueTransformMatch[1].trim());
367
-
368
329
  // Create a ValueExpression for the right side with transformer
369
330
  const valueExpression = getValue(valueTransformMatch[3], params);
370
-
371
331
  // Set transformer and locale based on the method
372
332
  const method = valueTransformMatch[4];
373
333
  if (method === 'toLowerCase' || method === 'toLocaleLowerCase') {
@@ -375,30 +335,25 @@ const parseCondition = <P extends any>(schema: CompiledSchema<any>, expression:
375
335
  if (method === 'toLocaleLowerCase') {
376
336
  valueExpression.locale = 'en-US';
377
337
  }
378
- } else {
338
+ }
339
+ else {
379
340
  valueExpression.transformer = 'to-upper-case';
380
341
  if (method === 'toLocaleUpperCase') {
381
342
  valueExpression.locale = 'en-US';
382
343
  }
383
344
  }
384
-
385
345
  comparator.left = propertyExpression;
386
346
  comparator.right = valueExpression;
387
-
388
347
  return comparator;
389
348
  }
390
-
391
349
  if (transformMethodMatch) {
392
350
  // Handle .toLowerCase or .toUpperCase on the property side
393
351
  const comparator = getComparator(transformMethodMatch[3]); // e.g., startsWith, endsWith, includes
394
-
395
352
  if (isNegation) {
396
353
  comparator.negated = isNegation;
397
354
  }
398
-
399
355
  // Create the property expression for the left side with transformer
400
356
  const propertyExpression = getProperty(schema, transformMethodMatch[1]);
401
-
402
357
  // Set transformer and locale based on the method
403
358
  const method = transformMethodMatch[2];
404
359
  if (method === 'toLowerCase' || method === 'toLocaleLowerCase') {
@@ -406,25 +361,22 @@ const parseCondition = <P extends any>(schema: CompiledSchema<any>, expression:
406
361
  if (method === 'toLocaleLowerCase') {
407
362
  propertyExpression.locale = 'en-US'; // Default locale, could be extracted from method call
408
363
  }
409
- } else {
364
+ }
365
+ else {
410
366
  propertyExpression.transformer = 'to-upper-case';
411
367
  if (method === 'toLocaleUpperCase') {
412
368
  propertyExpression.locale = 'en-US'; // Default locale, could be extracted from method call
413
369
  }
414
370
  }
415
-
416
371
  // Create a ValueExpression for the right side
417
372
  let valueExpression = getValue(transformMethodMatch[4], params);
418
-
419
373
  // Check if the value also has a transformation (but only if it's not already handled by value-side check)
420
374
  const valueTransformMatch = transformMethodMatch[4].match(/^([^)]+)\.(toLowerCase|toUpperCase|toLocaleLowerCase|toLocaleUpperCase)\(\)$/);
421
-
422
375
  if (valueTransformMatch) {
423
376
  // Create a new ValueExpression with the base value and transformer
424
- valueExpression = new ValueExpression({
377
+ valueExpression = new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({
425
378
  value: valueTransformMatch[1].replace(/^["']|["']$/g, '') // Remove quotes
426
379
  });
427
-
428
380
  // Set transformer and locale based on the method
429
381
  const valueMethod = valueTransformMatch[2];
430
382
  if (valueMethod === 'toLowerCase' || valueMethod === 'toLocaleLowerCase') {
@@ -432,163 +384,135 @@ const parseCondition = <P extends any>(schema: CompiledSchema<any>, expression:
432
384
  if (valueMethod === 'toLocaleLowerCase') {
433
385
  valueExpression.locale = 'en-US'; // Default locale
434
386
  }
435
- } else {
387
+ }
388
+ else {
436
389
  valueExpression.transformer = 'to-upper-case';
437
390
  if (valueMethod === 'toLocaleUpperCase') {
438
391
  valueExpression.locale = 'en-US'; // Default locale
439
392
  }
440
393
  }
441
394
  }
442
-
443
395
  comparator.left = propertyExpression;
444
396
  comparator.right = valueExpression;
445
-
446
397
  // If the comparison is explicitly to false, mark it as negated
447
398
  if (transformMethodMatch[7] === "false") {
448
399
  comparator.negated = true;
449
400
  }
450
-
451
401
  return comparator;
452
402
  }
453
-
454
403
  if (equalityMatch) {
455
404
  const left = equalityMatch[1].trim();
456
405
  const operator = equalityMatch[2];
457
406
  const right = equalityMatch[3].trim();
458
-
459
407
  const leftIsProperty = isPropertyPath(left);
460
408
  const rightIsProperty = isPropertyPath(right);
461
-
462
409
  // Determine which side is the property and which is the value
463
- let propertySide: string, valueSide: string, finalOperator: string;
464
-
410
+ let propertySide, valueSide, finalOperator;
465
411
  if (leftIsProperty && !rightIsProperty) {
466
412
  // Normal case: property === value
467
413
  propertySide = left;
468
414
  valueSide = right;
469
415
  finalOperator = operator;
470
- } else if (!leftIsProperty && rightIsProperty) {
416
+ }
417
+ else if (!leftIsProperty && rightIsProperty) {
471
418
  // Reversed case: value === property
472
419
  propertySide = right;
473
420
  valueSide = left;
474
421
  finalOperator = operator;
475
- } else {
422
+ }
423
+ else {
476
424
  // Both sides look like properties or neither does - assume left is property
477
425
  propertySide = left;
478
426
  valueSide = right;
479
427
  finalOperator = operator;
480
428
  }
481
-
482
429
  const comparator = getComparator(finalOperator);
483
-
484
430
  if (isNegation) {
485
431
  comparator.negated = isNegation;
486
432
  }
487
-
488
433
  comparator.left = getProperty(schema, propertySide);
489
434
  comparator.right = getValue(valueSide, params);
490
-
491
435
  convertAndAssignValue(comparator.right, comparator.left);
492
-
493
436
  return comparator;
494
437
  }
495
-
496
438
  if (comparisonMatch) {
497
439
  const left = comparisonMatch[1].trim();
498
440
  const operator = comparisonMatch[2];
499
441
  const right = comparisonMatch[3].trim();
500
-
501
442
  const leftIsProperty = isPropertyPath(left);
502
443
  const rightIsProperty = isPropertyPath(right);
503
-
504
444
  // Determine which side is the property and which is the value
505
- let propertySide: string, valueSide: string, finalOperator: string;
506
-
445
+ let propertySide, valueSide, finalOperator;
507
446
  if (leftIsProperty && !rightIsProperty) {
508
447
  // Normal case: property > value
509
448
  propertySide = left;
510
449
  valueSide = right;
511
450
  finalOperator = operator;
512
- } else if (!leftIsProperty && rightIsProperty) {
451
+ }
452
+ else if (!leftIsProperty && rightIsProperty) {
513
453
  // Reversed case: value > property -> property < value
514
454
  propertySide = right;
515
455
  valueSide = left;
516
456
  finalOperator = getSwappedOperator(operator);
517
- } else {
457
+ }
458
+ else {
518
459
  // Both sides look like properties or neither does - assume left is property
519
460
  propertySide = left;
520
461
  valueSide = right;
521
462
  finalOperator = operator;
522
463
  }
523
-
524
464
  const comparator = getComparator(finalOperator);
525
-
526
465
  if (isNegation) {
527
466
  comparator.negated = isNegation;
528
467
  }
529
-
530
468
  comparator.left = getProperty(schema, propertySide);
531
469
  comparator.right = getValue(valueSide, params);
532
-
533
470
  convertAndAssignValue(comparator.right, comparator.left);
534
-
535
471
  return comparator;
536
472
  }
537
-
538
473
  // If we get here, the expression is too complex for the current parser
539
474
  // This is expected for complex real-world expressions
540
475
  throw new Error(`Unsupported expression format: ${finalExpression}`);
541
- }
542
-
543
- const getComparator = (value: string): ComparatorExpression => {
544
-
476
+ };
477
+ const getComparator = (value) => {
545
478
  const comparator = COMPARATOR_MAP.get(value);
546
-
547
479
  if (comparator == null) {
548
- throw new Error(ERROR_MESSAGES.COMPARATOR_NOT_FOUND(value))
480
+ throw new Error(ERROR_MESSAGES.COMPARATOR_NOT_FOUND(value));
549
481
  }
550
-
551
482
  // Return a new instance to avoid modifying the cached one
552
- return new ComparatorExpression({
483
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ComparatorExpression({
553
484
  comparator: comparator.comparator,
554
485
  negated: comparator.negated,
555
486
  strict: comparator.strict
556
487
  });
557
- }
558
-
559
- const getValue = <P extends any>(value: string, params?: { name: string, data: P }): ValueExpression => {
560
-
488
+ };
489
+ const getValue = (value, params) => {
561
490
  // Early return for string literals
562
491
  if (value.startsWith("\'") || value.startsWith("\"")) {
563
- return new ValueExpression({
492
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({
564
493
  value: value.replace(/\"|\'/g, "")
565
494
  });
566
495
  }
567
-
568
496
  // Early return for null/undefined
569
497
  if (value === "null") {
570
- return new ValueExpression({ value: null });
498
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({ value: null });
571
499
  }
572
-
573
500
  if (value === "undefined" || value === "void 0") {
574
- return new ValueExpression({ value: undefined });
501
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({ value: undefined });
575
502
  }
576
-
577
503
  // Optimized number parsing with early return
578
504
  const numValue = +value;
579
505
  if (!isNaN(numValue) && isFinite(numValue)) {
580
- return new ValueExpression({ value: numValue });
506
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({ value: numValue });
581
507
  }
582
-
583
508
  // Handle parameter paths if params are provided
584
509
  if (params != null) {
585
510
  // Check if this is a parameter path (starts with params.name)
586
511
  if (value.startsWith(params.name)) {
587
- return new ValueExpression({
512
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({
588
513
  value: getValueFromParams(value, params)
589
514
  });
590
515
  }
591
-
592
516
  // Check if this is a parameter path without the params prefix
593
517
  if (value.includes('.')) {
594
518
  // Try to extract the parameter path
@@ -597,65 +521,323 @@ const getValue = <P extends any>(value: string, params?: { name: string, data: P
597
521
  const potentialParamPath = paramMatch[1];
598
522
  try {
599
523
  const paramValue = getValueFromParams(`${params.name}.${potentialParamPath}`, params);
600
- return new ValueExpression({ value: paramValue });
601
- } catch (e) {
524
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({ value: paramValue });
525
+ }
526
+ catch (e) {
602
527
  // Not a parameter path, continue with normal parsing
603
528
  }
604
529
  }
605
530
  }
606
531
  }
607
-
608
532
  // Default case: return as-is
609
- return new ValueExpression({ value });
610
- }
611
-
612
- const getValueFromParams = <P extends any>(value: string, params: { name: string, data: P }) => {
613
-
533
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.ValueExpression({ value });
534
+ };
535
+ const getValueFromParams = (value, params) => {
614
536
  const split = value.split('.');
615
-
616
537
  // Early exit for invalid paths
617
538
  if (split.length === 1) {
618
- throw new Error(ERROR_MESSAGES.PARAM_PATH_NOT_FOUND(value, params.data))
539
+ throw new Error(ERROR_MESSAGES.PARAM_PATH_NOT_FOUND(value, params.data));
619
540
  }
620
-
621
- let result = params.data as any;
622
-
541
+ let result = params.data;
623
542
  // For nested params - start from index 1 to skip the params prefix
624
543
  for (let i = 1; i < split.length; i++) {
625
544
  const name = split[i];
626
-
627
545
  if (name in result) {
628
546
  result = result[name];
629
547
  continue;
630
548
  }
631
-
632
- throw new Error(ERROR_MESSAGES.PARAM_PATH_NOT_FOUND(value, params.data))
549
+ throw new Error(ERROR_MESSAGES.PARAM_PATH_NOT_FOUND(value, params.data));
633
550
  }
634
-
635
551
  return result;
636
- }
637
-
638
- const getProperty = (schema: CompiledSchema<any>, value: string): PropertyExpression => {
552
+ };
553
+ const getProperty = (schema, value) => {
639
554
  // Optimized string splitting - only split if we have the expected pattern
640
555
  if (!value.includes('.')) {
641
556
  throw new Error(ERROR_MESSAGES.PROPERTY_NOT_FOUND(value));
642
557
  }
643
-
644
558
  const pathSplit = value.split(/[?!.]/g).slice(1);
645
559
  const pathString = pathSplit.join(".");
646
-
647
560
  // Early exit if no path found
648
561
  if (!pathString) {
649
562
  throw new Error(ERROR_MESSAGES.PROPERTY_NOT_FOUND(value));
650
563
  }
651
-
652
564
  const found = schema.properties.find(w => w.getAssignmentPath() == pathString);
653
-
654
565
  if (found == null) {
655
566
  throw new Error(ERROR_MESSAGES.PROPERTY_NOT_FOUND(value));
656
567
  }
568
+ return new _types__WEBPACK_IMPORTED_MODULE_0__.PropertyExpression({ property: found });
569
+ };
570
+
657
571
 
658
- return new PropertyExpression({ property: found });
572
+ }),
573
+ "./src/expressions/types.ts":
574
+ /*!**********************************!*\
575
+ !*** ./src/expressions/types.ts ***!
576
+ \**********************************/
577
+ (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
578
+ __webpack_require__.r(__webpack_exports__);
579
+ __webpack_require__.d(__webpack_exports__, {
580
+ ComparatorExpression: () => (ComparatorExpression),
581
+ EmptyExpression: () => (EmptyExpression),
582
+ Expression: () => (Expression),
583
+ NotParsableExpression: () => (NotParsableExpression),
584
+ OperatorExpression: () => (OperatorExpression),
585
+ PropertyExpression: () => (PropertyExpression),
586
+ ValueExpression: () => (ValueExpression)
587
+ });
588
+ /**
589
+ * The base class for all expression types.
590
+ */
591
+ class Expression {
592
+ /** The left-hand side of the expression (if applicable). */
593
+ left;
594
+ /** The right-hand side of the expression (if applicable). */
595
+ right;
596
+ constructor(left, right) {
597
+ this.left = left;
598
+ this.right = right;
599
+ }
600
+ static get EMPTY() {
601
+ return new EmptyExpression();
602
+ }
603
+ static get NOT_PARSABLE() {
604
+ return new NotParsableExpression();
605
+ }
606
+ static isEmpty(expression) {
607
+ return expression.type === "empty" || expression instanceof EmptyExpression;
608
+ }
609
+ static isNotParsable(expression) {
610
+ return expression.type === "not-parsable" || expression instanceof NotParsableExpression;
611
+ }
612
+ }
613
+ class EmptyExpression extends Expression {
614
+ type = "empty";
615
+ }
616
+ class NotParsableExpression extends Expression {
617
+ type = "not-parsable";
618
+ }
619
+ /**
620
+ * A class representing a comparison operation (e.g., equals, greater-than).
621
+ */
622
+ class ComparatorExpression extends Expression {
623
+ /** The type of the expression (always 'comparator'). */
624
+ type = "comparator";
625
+ /** The comparator operation (e.g., equals, greater-than). */
626
+ comparator;
627
+ /** Whether the comparison is negated (e.g., not equals). */
628
+ negated;
629
+ /** Whether the comparison is strict (type-sensitive). */
630
+ strict;
631
+ constructor(options) {
632
+ super(options.left, options.right);
633
+ this.comparator = options.comparator;
634
+ this.negated = options.negated;
635
+ this.strict = options.strict;
636
+ }
637
+ }
638
+ /**
639
+ * A class representing a logical operator (e.g., &&, ||).
640
+ */
641
+ class OperatorExpression extends Expression {
642
+ /** The type of the expression (always 'operator'). */
643
+ type = "operator";
644
+ /** The logical operator. */
645
+ operator;
646
+ constructor(options) {
647
+ super(options.left, options.right);
648
+ this.operator = options.operator;
649
+ }
650
+ }
651
+ /**
652
+ * A class representing a property path.
653
+ */
654
+ class PropertyExpression extends Expression {
655
+ /** The type of the expression (always 'property'). */
656
+ type = "property";
657
+ /** The property info for the path. */
658
+ property;
659
+ transformer = null;
660
+ locale = null;
661
+ constructor(options) {
662
+ super();
663
+ this.property = options.property;
664
+ }
665
+ }
666
+ /**
667
+ * A class representing a literal value.
668
+ */
669
+ class ValueExpression extends Expression {
670
+ /** The type of the expression (always 'value'). */
671
+ type = "value";
672
+ /** The literal value. */
673
+ value;
674
+ transformer = null;
675
+ locale = null;
676
+ constructor(options) {
677
+ super();
678
+ this.value = options.value;
679
+ }
659
680
  }
660
681
 
661
682
 
683
+ }),
684
+ "./src/expressions/utils.ts":
685
+ /*!**********************************!*\
686
+ !*** ./src/expressions/utils.ts ***!
687
+ \**********************************/
688
+ (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
689
+ __webpack_require__.r(__webpack_exports__);
690
+ __webpack_require__.d(__webpack_exports__, {
691
+ forEach: () => (forEach),
692
+ getProperties: () => (getProperties),
693
+ isPropertyExpression: () => (isPropertyExpression)
694
+ });
695
+ /**
696
+ * Extracts all properties referenced in an expression
697
+ * @param expression The expression to analyze
698
+ * @returns Array of PropertyInfo objects referenced in the expression
699
+ */
700
+ function getProperties(expression) {
701
+ const properties = [];
702
+ function traverse(expr) {
703
+ // If this is a property expression, add it to our collection
704
+ if (expr.type === "property") {
705
+ properties.push(expr.property);
706
+ }
707
+ // Traverse left and right expressions if they exist
708
+ if (expr.left) {
709
+ traverse(expr.left);
710
+ }
711
+ if (expr.right) {
712
+ traverse(expr.right);
713
+ }
714
+ }
715
+ traverse(expression);
716
+ return properties;
717
+ }
718
+ function isPropertyExpression(expression) {
719
+ return expression.type === "property";
720
+ }
721
+ function forEach(expression, callback) {
722
+ function traverse(expr) {
723
+ // Call the callback for this expression
724
+ // If callback returns false, stop traversing
725
+ if (!callback(expr)) {
726
+ return false;
727
+ }
728
+ // Traverse left and right expressions if they exist
729
+ if (expr.left) {
730
+ if (!traverse(expr.left)) {
731
+ return false;
732
+ }
733
+ }
734
+ if (expr.right) {
735
+ if (!traverse(expr.right)) {
736
+ return false;
737
+ }
738
+ }
739
+ return true;
740
+ }
741
+ traverse(expression);
742
+ }
743
+
744
+
745
+ }),
746
+
747
+ });
748
+ /************************************************************************/
749
+ // The module cache
750
+ var __webpack_module_cache__ = {};
751
+
752
+ // The require function
753
+ function __webpack_require__(moduleId) {
754
+
755
+ // Check if module is in cache
756
+ var cachedModule = __webpack_module_cache__[moduleId];
757
+ if (cachedModule !== undefined) {
758
+ return cachedModule.exports;
759
+ }
760
+ // Create a new module (and put it into the cache)
761
+ var module = (__webpack_module_cache__[moduleId] = {
762
+ exports: {}
763
+ });
764
+ // Execute the module function
765
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
766
+
767
+ // Return the exports of the module
768
+ return module.exports;
769
+
770
+ }
771
+
772
+ /************************************************************************/
773
+ // webpack/runtime/define_property_getters
774
+ (() => {
775
+ __webpack_require__.d = (exports, definition) => {
776
+ for(var key in definition) {
777
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
778
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
779
+ }
780
+ }
781
+ };
782
+ })();
783
+ // webpack/runtime/has_own_property
784
+ (() => {
785
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
786
+ })();
787
+ // webpack/runtime/make_namespace_object
788
+ (() => {
789
+ // define __esModule on exports
790
+ __webpack_require__.r = (exports) => {
791
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
792
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
793
+ }
794
+ Object.defineProperty(exports, '__esModule', { value: true });
795
+ };
796
+ })();
797
+ /************************************************************************/
798
+ var __webpack_exports__ = {};
799
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
800
+ (() => {
801
+
802
+ /*!**********************************!*\
803
+ !*** ./src/expressions/index.ts ***!
804
+ \**********************************/
805
+ __webpack_require__.r(__webpack_exports__);
806
+ __webpack_require__.d(__webpack_exports__, {
807
+ ComparatorExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.ComparatorExpression),
808
+ EmptyExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.EmptyExpression),
809
+ Expression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.Expression),
810
+ NotParsableExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.NotParsableExpression),
811
+ OperatorExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.OperatorExpression),
812
+ PropertyExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.PropertyExpression),
813
+ ValueExpression: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_1__.ValueExpression),
814
+ combineExpressions: () => (/* reexport safe */ _parser__WEBPACK_IMPORTED_MODULE_0__.combineExpressions),
815
+ forEach: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.forEach),
816
+ getProperties: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.getProperties),
817
+ isPropertyExpression: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.isPropertyExpression),
818
+ toExpression: () => (/* reexport safe */ _parser__WEBPACK_IMPORTED_MODULE_0__.toExpression)
819
+ });
820
+ /* ESM import */var _parser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parser */ "./src/expressions/parser.ts");
821
+ /* ESM import */var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./src/expressions/types.ts");
822
+ /* ESM import */var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./src/expressions/utils.ts");
823
+
824
+
825
+
826
+
827
+ })();
828
+
829
+ var __webpack_exports__ComparatorExpression = __webpack_exports__.ComparatorExpression;
830
+ var __webpack_exports__EmptyExpression = __webpack_exports__.EmptyExpression;
831
+ var __webpack_exports__Expression = __webpack_exports__.Expression;
832
+ var __webpack_exports__NotParsableExpression = __webpack_exports__.NotParsableExpression;
833
+ var __webpack_exports__OperatorExpression = __webpack_exports__.OperatorExpression;
834
+ var __webpack_exports__PropertyExpression = __webpack_exports__.PropertyExpression;
835
+ var __webpack_exports__ValueExpression = __webpack_exports__.ValueExpression;
836
+ var __webpack_exports__combineExpressions = __webpack_exports__.combineExpressions;
837
+ var __webpack_exports__forEach = __webpack_exports__.forEach;
838
+ var __webpack_exports__getProperties = __webpack_exports__.getProperties;
839
+ var __webpack_exports__isPropertyExpression = __webpack_exports__.isPropertyExpression;
840
+ var __webpack_exports__toExpression = __webpack_exports__.toExpression;
841
+ export { __webpack_exports__ComparatorExpression as ComparatorExpression, __webpack_exports__EmptyExpression as EmptyExpression, __webpack_exports__Expression as Expression, __webpack_exports__NotParsableExpression as NotParsableExpression, __webpack_exports__OperatorExpression as OperatorExpression, __webpack_exports__PropertyExpression as PropertyExpression, __webpack_exports__ValueExpression as ValueExpression, __webpack_exports__combineExpressions as combineExpressions, __webpack_exports__forEach as forEach, __webpack_exports__getProperties as getProperties, __webpack_exports__isPropertyExpression as isPropertyExpression, __webpack_exports__toExpression as toExpression };
842
+
843
+ //# sourceMappingURL=index.js.map