prostgles-server 4.2.344 → 4.2.346

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 (496) hide show
  1. package/dist/Auth/AuthHandler.d.ts +3 -4
  2. package/dist/Auth/AuthHandler.d.ts.map +1 -1
  3. package/dist/Auth/AuthHandler.js +3 -11
  4. package/dist/Auth/AuthHandler.js.map +1 -1
  5. package/dist/Auth/AuthTypes.d.ts +8 -7
  6. package/dist/Auth/AuthTypes.d.ts.map +1 -1
  7. package/dist/Auth/AuthTypes.js.map +1 -1
  8. package/dist/Auth/endpoints/setCatchAllRequestHandler.d.ts +2 -2
  9. package/dist/Auth/endpoints/setCatchAllRequestHandler.d.ts.map +1 -1
  10. package/dist/Auth/endpoints/setCatchAllRequestHandler.js +4 -3
  11. package/dist/Auth/endpoints/setCatchAllRequestHandler.js.map +1 -1
  12. package/dist/Auth/endpoints/setLoginRequestHandler.d.ts +4 -3
  13. package/dist/Auth/endpoints/setLoginRequestHandler.d.ts.map +1 -1
  14. package/dist/Auth/endpoints/setLoginRequestHandler.js.map +1 -1
  15. package/dist/Auth/endpoints/setLogoutRequestHandler.d.ts +2 -2
  16. package/dist/Auth/endpoints/setLogoutRequestHandler.d.ts.map +1 -1
  17. package/dist/Auth/endpoints/setLogoutRequestHandler.js.map +1 -1
  18. package/dist/Auth/endpoints/setMagicLinkOrOTPRequestHandler.d.ts +3 -3
  19. package/dist/Auth/endpoints/setMagicLinkOrOTPRequestHandler.d.ts.map +1 -1
  20. package/dist/Auth/endpoints/setMagicLinkOrOTPRequestHandler.js.map +1 -1
  21. package/dist/Auth/endpoints/setOAuthRequestHandlers.d.ts +3 -3
  22. package/dist/Auth/endpoints/setOAuthRequestHandlers.d.ts.map +1 -1
  23. package/dist/Auth/endpoints/setOAuthRequestHandlers.js.map +1 -1
  24. package/dist/Auth/endpoints/setRegisterRequestHandler.d.ts +1 -1
  25. package/dist/Auth/endpoints/setRegisterRequestHandler.d.ts.map +1 -1
  26. package/dist/Auth/endpoints/setRegisterRequestHandler.js.map +1 -1
  27. package/dist/Auth/getClientAuth.d.ts +3 -3
  28. package/dist/Auth/getClientAuth.d.ts.map +1 -1
  29. package/dist/Auth/getClientAuth.js.map +1 -1
  30. package/dist/Auth/login.d.ts +4 -3
  31. package/dist/Auth/login.d.ts.map +1 -1
  32. package/dist/Auth/login.js.map +1 -1
  33. package/dist/Auth/sendEmail.d.ts +2 -2
  34. package/dist/Auth/sendEmail.d.ts.map +1 -1
  35. package/dist/Auth/setupAuthRoutes.d.ts +1 -1
  36. package/dist/Auth/setupAuthRoutes.d.ts.map +1 -1
  37. package/dist/Auth/setupAuthRoutes.js.map +1 -1
  38. package/dist/Auth/utils/getClientRequestIPsInfo.d.ts +2 -2
  39. package/dist/Auth/utils/getClientRequestIPsInfo.d.ts.map +1 -1
  40. package/dist/Auth/utils/getReturnUrl.d.ts +1 -1
  41. package/dist/Auth/utils/getReturnUrl.d.ts.map +1 -1
  42. package/dist/Auth/utils/getSidAndUserFromRequest.d.ts +2 -2
  43. package/dist/Auth/utils/getSidAndUserFromRequest.d.ts.map +1 -1
  44. package/dist/Auth/utils/handleGetUser.d.ts +1 -1
  45. package/dist/Auth/utils/handleGetUser.d.ts.map +1 -1
  46. package/dist/Auth/utils/handleGetUser.js.map +1 -1
  47. package/dist/Auth/utils/matchesRoute.d.ts +2 -0
  48. package/dist/Auth/utils/matchesRoute.d.ts.map +1 -0
  49. package/dist/Auth/utils/matchesRoute.js +13 -0
  50. package/dist/Auth/utils/matchesRoute.js.map +1 -0
  51. package/dist/Auth/utils/removeExpressRoute.d.ts +1 -1
  52. package/dist/Auth/utils/removeExpressRoute.d.ts.map +1 -1
  53. package/dist/Auth/utils/removeExpressRoute.js +2 -2
  54. package/dist/Auth/utils/removeExpressRoute.js.map +1 -1
  55. package/dist/Auth/utils/setCookieAndGoToReturnURLIFSet.d.ts.map +1 -1
  56. package/dist/Auth/utils/setCookieAndGoToReturnURLIFSet.js +2 -1
  57. package/dist/Auth/utils/setCookieAndGoToReturnURLIFSet.js.map +1 -1
  58. package/dist/Auth/utils/upsertNamedExpressMiddleware.d.ts +3 -1
  59. package/dist/Auth/utils/upsertNamedExpressMiddleware.d.ts.map +1 -1
  60. package/dist/Auth/utils/upsertNamedExpressMiddleware.js +14 -3
  61. package/dist/Auth/utils/upsertNamedExpressMiddleware.js.map +1 -1
  62. package/dist/DBEventsManager.d.ts +2 -2
  63. package/dist/DBEventsManager.d.ts.map +1 -1
  64. package/dist/DBEventsManager.js.map +1 -1
  65. package/dist/{DBSchemaBuilder.d.ts → DBSchemaBuilder/DBSchemaBuilder.d.ts} +9 -5
  66. package/dist/DBSchemaBuilder/DBSchemaBuilder.d.ts.map +1 -0
  67. package/dist/DBSchemaBuilder/DBSchemaBuilder.js +35 -0
  68. package/dist/DBSchemaBuilder/DBSchemaBuilder.js.map +1 -0
  69. package/dist/DBSchemaBuilder/DBSchemaBuilder.spec.d.ts +2 -0
  70. package/dist/DBSchemaBuilder/DBSchemaBuilder.spec.d.ts.map +1 -0
  71. package/dist/DBSchemaBuilder/DBSchemaBuilder.spec.js +98 -0
  72. package/dist/DBSchemaBuilder/DBSchemaBuilder.spec.js.map +1 -0
  73. package/dist/DBSchemaBuilder/getColumnTypescriptDefinition.d.ts +15 -0
  74. package/dist/DBSchemaBuilder/getColumnTypescriptDefinition.d.ts.map +1 -0
  75. package/dist/DBSchemaBuilder/getColumnTypescriptDefinition.js +80 -0
  76. package/dist/DBSchemaBuilder/getColumnTypescriptDefinition.js.map +1 -0
  77. package/dist/DboBuilder/DboBuilder.d.ts +9 -8
  78. package/dist/DboBuilder/DboBuilder.d.ts.map +1 -1
  79. package/dist/DboBuilder/DboBuilder.js +10 -6
  80. package/dist/DboBuilder/DboBuilder.js.map +1 -1
  81. package/dist/DboBuilder/DboBuilderTypes.d.ts +7 -7
  82. package/dist/DboBuilder/DboBuilderTypes.d.ts.map +1 -1
  83. package/dist/DboBuilder/QueryBuilder/Functions/COMPUTED_FIELDS.d.ts +3 -0
  84. package/dist/DboBuilder/QueryBuilder/Functions/COMPUTED_FIELDS.d.ts.map +1 -0
  85. package/dist/DboBuilder/QueryBuilder/Functions/COMPUTED_FIELDS.js +35 -0
  86. package/dist/DboBuilder/QueryBuilder/Functions/COMPUTED_FIELDS.js.map +1 -0
  87. package/dist/DboBuilder/QueryBuilder/{Functions.d.ts → Functions/Functions.d.ts} +1 -8
  88. package/dist/DboBuilder/QueryBuilder/Functions/Functions.d.ts.map +1 -0
  89. package/dist/DboBuilder/QueryBuilder/{Functions.js → Functions/Functions.js} +48 -123
  90. package/dist/DboBuilder/QueryBuilder/Functions/Functions.js.map +1 -0
  91. package/dist/DboBuilder/QueryBuilder/Functions/parseFunction.d.ts +8 -0
  92. package/dist/DboBuilder/QueryBuilder/Functions/parseFunction.d.ts.map +1 -0
  93. package/dist/DboBuilder/QueryBuilder/Functions/parseFunction.js +51 -0
  94. package/dist/DboBuilder/QueryBuilder/Functions/parseFunction.js.map +1 -0
  95. package/dist/DboBuilder/QueryBuilder/QueryBuilder.d.ts +5 -6
  96. package/dist/DboBuilder/QueryBuilder/QueryBuilder.d.ts.map +1 -1
  97. package/dist/DboBuilder/QueryBuilder/QueryBuilder.js +8 -14
  98. package/dist/DboBuilder/QueryBuilder/QueryBuilder.js.map +1 -1
  99. package/dist/DboBuilder/QueryBuilder/getJoinQuery.d.ts +3 -2
  100. package/dist/DboBuilder/QueryBuilder/getJoinQuery.d.ts.map +1 -1
  101. package/dist/DboBuilder/QueryBuilder/getJoinQuery.js +4 -4
  102. package/dist/DboBuilder/QueryBuilder/getJoinQuery.js.map +1 -1
  103. package/dist/DboBuilder/QueryBuilder/getNewQuery.d.ts +5 -5
  104. package/dist/DboBuilder/QueryBuilder/getNewQuery.d.ts.map +1 -1
  105. package/dist/DboBuilder/QueryBuilder/getNewQuery.js +3 -2
  106. package/dist/DboBuilder/QueryBuilder/getNewQuery.js.map +1 -1
  107. package/dist/DboBuilder/QueryBuilder/getSelectQuery.d.ts +2 -2
  108. package/dist/DboBuilder/QueryBuilder/getSelectQuery.d.ts.map +1 -1
  109. package/dist/DboBuilder/QueryStreamer.d.ts +6 -6
  110. package/dist/DboBuilder/QueryStreamer.d.ts.map +1 -1
  111. package/dist/DboBuilder/QueryStreamer.js.map +1 -1
  112. package/dist/DboBuilder/TableHandler/DataValidator.d.ts +5 -5
  113. package/dist/DboBuilder/TableHandler/DataValidator.d.ts.map +1 -1
  114. package/dist/DboBuilder/TableHandler/DataValidator.js.map +1 -1
  115. package/dist/DboBuilder/TableHandler/TableHandler.d.ts +8 -7
  116. package/dist/DboBuilder/TableHandler/TableHandler.d.ts.map +1 -1
  117. package/dist/DboBuilder/TableHandler/TableHandler.js +3 -2
  118. package/dist/DboBuilder/TableHandler/TableHandler.js.map +1 -1
  119. package/dist/DboBuilder/TableHandler/delete.d.ts +4 -4
  120. package/dist/DboBuilder/TableHandler/delete.d.ts.map +1 -1
  121. package/dist/DboBuilder/TableHandler/delete.js.map +1 -1
  122. package/dist/DboBuilder/TableHandler/insert/insert.d.ts +4 -4
  123. package/dist/DboBuilder/TableHandler/insert/insert.d.ts.map +1 -1
  124. package/dist/DboBuilder/TableHandler/insert/insert.js +0 -9
  125. package/dist/DboBuilder/TableHandler/insert/insert.js.map +1 -1
  126. package/dist/DboBuilder/TableHandler/insert/insertNestedRecords.d.ts +6 -5
  127. package/dist/DboBuilder/TableHandler/insert/insertNestedRecords.d.ts.map +1 -1
  128. package/dist/DboBuilder/TableHandler/insert/insertNestedRecords.js.map +1 -1
  129. package/dist/DboBuilder/TableHandler/insertTest.d.ts +4 -4
  130. package/dist/DboBuilder/TableHandler/insertTest.d.ts.map +1 -1
  131. package/dist/DboBuilder/TableHandler/insertTest.js.map +1 -1
  132. package/dist/DboBuilder/TableHandler/onDeleteFromFileTable.d.ts +3 -3
  133. package/dist/DboBuilder/TableHandler/onDeleteFromFileTable.d.ts.map +1 -1
  134. package/dist/DboBuilder/TableHandler/onDeleteFromFileTable.js.map +1 -1
  135. package/dist/DboBuilder/TableHandler/runInsertUpdateQuery.d.ts +4 -4
  136. package/dist/DboBuilder/TableHandler/runInsertUpdateQuery.d.ts.map +1 -1
  137. package/dist/DboBuilder/TableHandler/runInsertUpdateQuery.js.map +1 -1
  138. package/dist/DboBuilder/TableHandler/update.d.ts +4 -4
  139. package/dist/DboBuilder/TableHandler/update.d.ts.map +1 -1
  140. package/dist/DboBuilder/TableHandler/update.js.map +1 -1
  141. package/dist/DboBuilder/TableHandler/updateBatch.d.ts +4 -4
  142. package/dist/DboBuilder/TableHandler/updateBatch.d.ts.map +1 -1
  143. package/dist/DboBuilder/TableHandler/updateBatch.js.map +1 -1
  144. package/dist/DboBuilder/TableHandler/updateFile.d.ts +4 -4
  145. package/dist/DboBuilder/TableHandler/updateFile.d.ts.map +1 -1
  146. package/dist/DboBuilder/TableHandler/updateFile.js.map +1 -1
  147. package/dist/DboBuilder/TableHandler/upsert.d.ts +4 -4
  148. package/dist/DboBuilder/TableHandler/upsert.d.ts.map +1 -1
  149. package/dist/DboBuilder/TableRules/getValidatedRules.d.ts.map +1 -1
  150. package/dist/DboBuilder/TableRules/getValidatedRules.js +4 -4
  151. package/dist/DboBuilder/TableRules/getValidatedRules.js.map +1 -1
  152. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +10 -10
  153. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts.map +1 -1
  154. package/dist/DboBuilder/ViewHandler/ViewHandler.js +2 -1
  155. package/dist/DboBuilder/ViewHandler/ViewHandler.js.map +1 -1
  156. package/dist/DboBuilder/ViewHandler/count.d.ts +4 -4
  157. package/dist/DboBuilder/ViewHandler/count.d.ts.map +1 -1
  158. package/dist/DboBuilder/ViewHandler/find.d.ts +6 -6
  159. package/dist/DboBuilder/ViewHandler/find.d.ts.map +1 -1
  160. package/dist/DboBuilder/ViewHandler/find.js.map +1 -1
  161. package/dist/DboBuilder/ViewHandler/getExistsCondition.d.ts +2 -2
  162. package/dist/DboBuilder/ViewHandler/getExistsCondition.d.ts.map +1 -1
  163. package/dist/DboBuilder/ViewHandler/getExistsCondition.js.map +1 -1
  164. package/dist/DboBuilder/ViewHandler/getExistsFilters.d.ts +2 -2
  165. package/dist/DboBuilder/ViewHandler/getExistsFilters.d.ts.map +1 -1
  166. package/dist/DboBuilder/ViewHandler/getExistsFilters.js.map +1 -1
  167. package/dist/DboBuilder/ViewHandler/getInfo.d.ts +4 -4
  168. package/dist/DboBuilder/ViewHandler/getInfo.d.ts.map +1 -1
  169. package/dist/DboBuilder/ViewHandler/getTableJoinQuery.d.ts +1 -1
  170. package/dist/DboBuilder/ViewHandler/getTableJoinQuery.d.ts.map +1 -1
  171. package/dist/DboBuilder/ViewHandler/parseComplexFilter.d.ts +2 -2
  172. package/dist/DboBuilder/ViewHandler/parseComplexFilter.d.ts.map +1 -1
  173. package/dist/DboBuilder/ViewHandler/parseComplexFilter.js +5 -3
  174. package/dist/DboBuilder/ViewHandler/parseComplexFilter.js.map +1 -1
  175. package/dist/DboBuilder/ViewHandler/parseFieldFilter.d.ts +1 -1
  176. package/dist/DboBuilder/ViewHandler/parseFieldFilter.d.ts.map +1 -1
  177. package/dist/DboBuilder/ViewHandler/parseFieldFilter.js +10 -5
  178. package/dist/DboBuilder/ViewHandler/parseFieldFilter.js.map +1 -1
  179. package/dist/DboBuilder/ViewHandler/parseJoinPath.d.ts +2 -2
  180. package/dist/DboBuilder/ViewHandler/parseJoinPath.d.ts.map +1 -1
  181. package/dist/DboBuilder/ViewHandler/parseJoinPath.js.map +1 -1
  182. package/dist/DboBuilder/ViewHandler/prepareSortItems.d.ts +3 -3
  183. package/dist/DboBuilder/ViewHandler/prepareSortItems.d.ts.map +1 -1
  184. package/dist/DboBuilder/ViewHandler/prepareSortItems.js +2 -2
  185. package/dist/DboBuilder/ViewHandler/prepareSortItems.js.map +1 -1
  186. package/dist/DboBuilder/ViewHandler/prepareWhere.d.ts +4 -4
  187. package/dist/DboBuilder/ViewHandler/prepareWhere.d.ts.map +1 -1
  188. package/dist/DboBuilder/ViewHandler/prepareWhere.js.map +1 -1
  189. package/dist/DboBuilder/ViewHandler/size.d.ts +4 -4
  190. package/dist/DboBuilder/ViewHandler/size.d.ts.map +1 -1
  191. package/dist/DboBuilder/ViewHandler/subscribe.d.ts +4 -4
  192. package/dist/DboBuilder/ViewHandler/subscribe.d.ts.map +1 -1
  193. package/dist/DboBuilder/ViewHandler/subscribe.js.map +1 -1
  194. package/dist/DboBuilder/ViewHandler/validateViewRules.d.ts +3 -3
  195. package/dist/DboBuilder/ViewHandler/validateViewRules.d.ts.map +1 -1
  196. package/dist/DboBuilder/dboBuilderUtils.d.ts +6 -13
  197. package/dist/DboBuilder/dboBuilderUtils.d.ts.map +1 -1
  198. package/dist/DboBuilder/dboBuilderUtils.js +3 -33
  199. package/dist/DboBuilder/dboBuilderUtils.js.map +1 -1
  200. package/dist/DboBuilder/getColumns.d.ts +5 -5
  201. package/dist/DboBuilder/getColumns.d.ts.map +1 -1
  202. package/dist/DboBuilder/getColumns.js +1 -1
  203. package/dist/DboBuilder/getColumns.js.map +1 -1
  204. package/dist/DboBuilder/getCondition.d.ts +3 -3
  205. package/dist/DboBuilder/getCondition.d.ts.map +1 -1
  206. package/dist/DboBuilder/getCondition.js +1 -1
  207. package/dist/DboBuilder/getCondition.js.map +1 -1
  208. package/dist/DboBuilder/getSubscribeRelatedTables.d.ts +6 -6
  209. package/dist/DboBuilder/getSubscribeRelatedTables.d.ts.map +1 -1
  210. package/dist/DboBuilder/getSubscribeRelatedTables.js.map +1 -1
  211. package/dist/DboBuilder/parseUpdateRules.d.ts +5 -4
  212. package/dist/DboBuilder/parseUpdateRules.d.ts.map +1 -1
  213. package/dist/DboBuilder/parseUpdateRules.js.map +1 -1
  214. package/dist/DboBuilder/prepareShortestJoinPaths.d.ts +4 -4
  215. package/dist/DboBuilder/prepareShortestJoinPaths.d.ts.map +1 -1
  216. package/dist/DboBuilder/prepareShortestJoinPaths.js.map +1 -1
  217. package/dist/DboBuilder/runSQL.d.ts +5 -5
  218. package/dist/DboBuilder/runSQL.d.ts.map +1 -1
  219. package/dist/DboBuilder/runSQL.js +2 -1
  220. package/dist/DboBuilder/runSQL.js.map +1 -1
  221. package/dist/DboBuilder/schema/getMaterialViews.d.ts +2 -2
  222. package/dist/DboBuilder/schema/getMaterialViews.d.ts.map +1 -1
  223. package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.d.ts +3 -3
  224. package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.d.ts.map +1 -1
  225. package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.js +1 -1
  226. package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.js.map +1 -1
  227. package/dist/DboBuilder/uploadFile.d.ts +4 -4
  228. package/dist/DboBuilder/uploadFile.d.ts.map +1 -1
  229. package/dist/DboBuilder/uploadFile.js.map +1 -1
  230. package/dist/FileManager/FileManager.d.ts +3 -5
  231. package/dist/FileManager/FileManager.d.ts.map +1 -1
  232. package/dist/FileManager/FileManager.js +1 -13
  233. package/dist/FileManager/FileManager.js.map +1 -1
  234. package/dist/FileManager/getValidatedFileType.d.ts +2 -2
  235. package/dist/FileManager/getValidatedFileType.d.ts.map +1 -1
  236. package/dist/FileManager/getValidatedFileType.js.map +1 -1
  237. package/dist/FileManager/initFileManager.d.ts +2 -2
  238. package/dist/FileManager/initFileManager.d.ts.map +1 -1
  239. package/dist/FileManager/initFileManager.js.map +1 -1
  240. package/dist/FileManager/upload.d.ts +1 -1
  241. package/dist/FileManager/upload.d.ts.map +1 -1
  242. package/dist/FileManager/uploadStream.d.ts +1 -1
  243. package/dist/FileManager/uploadStream.d.ts.map +1 -1
  244. package/dist/Filtering.d.ts +1 -1
  245. package/dist/Filtering.d.ts.map +1 -1
  246. package/dist/Filtering.js.map +1 -1
  247. package/dist/Logging.d.ts +3 -3
  248. package/dist/Logging.d.ts.map +1 -1
  249. package/dist/PostgresNotifListenManager.d.ts +3 -3
  250. package/dist/PostgresNotifListenManager.d.ts.map +1 -1
  251. package/dist/Prostgles.d.ts +7 -6
  252. package/dist/Prostgles.d.ts.map +1 -1
  253. package/dist/Prostgles.js.map +1 -1
  254. package/dist/ProstglesTypes.d.ts +17 -16
  255. package/dist/ProstglesTypes.d.ts.map +1 -1
  256. package/dist/ProstglesTypes.js.map +1 -1
  257. package/dist/PubSubManager/PubSubManager.d.ts +8 -7
  258. package/dist/PubSubManager/PubSubManager.d.ts.map +1 -1
  259. package/dist/PubSubManager/PubSubManager.js.map +1 -1
  260. package/dist/PubSubManager/PubSubManagerUtils.d.ts +1 -1
  261. package/dist/PubSubManager/PubSubManagerUtils.d.ts.map +1 -1
  262. package/dist/PubSubManager/addSub.d.ts +3 -3
  263. package/dist/PubSubManager/addSub.d.ts.map +1 -1
  264. package/dist/PubSubManager/addSync.d.ts +1 -1
  265. package/dist/PubSubManager/addSync.d.ts.map +1 -1
  266. package/dist/PubSubManager/addTrigger.d.ts +3 -2
  267. package/dist/PubSubManager/addTrigger.d.ts.map +1 -1
  268. package/dist/PubSubManager/addTrigger.js.map +1 -1
  269. package/dist/PubSubManager/deleteOrphanedTriggers.d.ts +1 -1
  270. package/dist/PubSubManager/deleteOrphanedTriggers.d.ts.map +1 -1
  271. package/dist/PubSubManager/getCreatePubSubManagerError.d.ts +1 -1
  272. package/dist/PubSubManager/getCreatePubSubManagerError.d.ts.map +1 -1
  273. package/dist/PubSubManager/init/getPubSubManagerInitQuery.d.ts +1 -1
  274. package/dist/PubSubManager/init/getPubSubManagerInitQuery.d.ts.map +1 -1
  275. package/dist/PubSubManager/notifListener.d.ts +1 -1
  276. package/dist/PubSubManager/notifListener.d.ts.map +1 -1
  277. package/dist/PubSubManager/pushSubData.d.ts +2 -1
  278. package/dist/PubSubManager/pushSubData.d.ts.map +1 -1
  279. package/dist/PubSubManager/pushSubData.js.map +1 -1
  280. package/dist/PublishParser/PublishParser.d.ts +6 -5
  281. package/dist/PublishParser/PublishParser.d.ts.map +1 -1
  282. package/dist/PublishParser/PublishParser.js.map +1 -1
  283. package/dist/PublishParser/getFileTableRules.d.ts +3 -3
  284. package/dist/PublishParser/getFileTableRules.d.ts.map +1 -1
  285. package/dist/PublishParser/getFileTableRules.js.map +1 -1
  286. package/dist/PublishParser/getSchemaFromPublish.d.ts +4 -3
  287. package/dist/PublishParser/getSchemaFromPublish.d.ts.map +1 -1
  288. package/dist/PublishParser/getSchemaFromPublish.js.map +1 -1
  289. package/dist/PublishParser/getTableRulesWithoutFileTable.d.ts +4 -3
  290. package/dist/PublishParser/getTableRulesWithoutFileTable.d.ts.map +1 -1
  291. package/dist/PublishParser/getTableRulesWithoutFileTable.js.map +1 -1
  292. package/dist/PublishParser/publishTypesAndUtils.d.ts +7 -7
  293. package/dist/PublishParser/publishTypesAndUtils.d.ts.map +1 -1
  294. package/dist/PublishParser/publishTypesAndUtils.js.map +1 -1
  295. package/dist/RestApi.d.ts +4 -4
  296. package/dist/RestApi.d.ts.map +1 -1
  297. package/dist/SchemaWatch/SchemaWatch.d.ts +1 -1
  298. package/dist/SchemaWatch/SchemaWatch.d.ts.map +1 -1
  299. package/dist/SchemaWatch/SchemaWatch.js.map +1 -1
  300. package/dist/SchemaWatch/getValidatedWatchSchemaType.d.ts +1 -1
  301. package/dist/SchemaWatch/getValidatedWatchSchemaType.d.ts.map +1 -1
  302. package/dist/SchemaWatch/getWatchSchemaTagList.d.ts +1 -1
  303. package/dist/SchemaWatch/getWatchSchemaTagList.d.ts.map +1 -1
  304. package/dist/SyncReplication.d.ts +2 -2
  305. package/dist/SyncReplication.d.ts.map +1 -1
  306. package/dist/SyncReplication.js.map +1 -1
  307. package/dist/TableConfig/TableConfig.d.ts +5 -5
  308. package/dist/TableConfig/TableConfig.d.ts.map +1 -1
  309. package/dist/TableConfig/TableConfig.js.map +1 -1
  310. package/dist/TableConfig/getColumnConfig.d.ts +3 -0
  311. package/dist/TableConfig/getColumnConfig.d.ts.map +1 -0
  312. package/dist/TableConfig/getColumnConfig.js +12 -0
  313. package/dist/TableConfig/getColumnConfig.js.map +1 -0
  314. package/dist/TableConfig/{getColumnDefinitionQuery.d.ts → getColumnSQLDefinitionQuery.d.ts} +5 -5
  315. package/dist/TableConfig/getColumnSQLDefinitionQuery.d.ts.map +1 -0
  316. package/dist/TableConfig/{getColumnDefinitionQuery.js → getColumnSQLDefinitionQuery.js} +4 -4
  317. package/dist/TableConfig/getColumnSQLDefinitionQuery.js.map +1 -0
  318. package/dist/TableConfig/getConstraintDefinitionQueries.d.ts +3 -3
  319. package/dist/TableConfig/getConstraintDefinitionQueries.d.ts.map +1 -1
  320. package/dist/TableConfig/getFutureTableSchema.d.ts +3 -3
  321. package/dist/TableConfig/getFutureTableSchema.d.ts.map +1 -1
  322. package/dist/TableConfig/getFutureTableSchema.js +2 -2
  323. package/dist/TableConfig/getFutureTableSchema.js.map +1 -1
  324. package/dist/TableConfig/getPGIndexes.d.ts +1 -1
  325. package/dist/TableConfig/getPGIndexes.d.ts.map +1 -1
  326. package/dist/TableConfig/getTableColumnQueries.d.ts +2 -2
  327. package/dist/TableConfig/getTableColumnQueries.d.ts.map +1 -1
  328. package/dist/TableConfig/getTableColumnQueries.js +3 -3
  329. package/dist/TableConfig/getTableColumnQueries.js.map +1 -1
  330. package/dist/TableConfig/getTableConfigSchemaQueries.d.ts +1 -1
  331. package/dist/TableConfig/getTableConfigSchemaQueries.d.ts.map +1 -1
  332. package/dist/TableConfig/getTableConfigSchemaQueries.js +2 -2
  333. package/dist/TableConfig/getTableConfigSchemaQueries.js.map +1 -1
  334. package/dist/TableConfig/initTableConfig.d.ts +1 -1
  335. package/dist/TableConfig/initTableConfig.d.ts.map +1 -1
  336. package/dist/WebsocketAPI/getClientHandlers.d.ts +1 -1
  337. package/dist/WebsocketAPI/getClientHandlers.d.ts.map +1 -1
  338. package/dist/WebsocketAPI/getClientSchema.d.ts +1 -1
  339. package/dist/WebsocketAPI/getClientSchema.d.ts.map +1 -1
  340. package/dist/WebsocketAPI/onSocketConnected.d.ts +2 -2
  341. package/dist/WebsocketAPI/onSocketConnected.d.ts.map +1 -1
  342. package/dist/WebsocketAPI/onSocketConnected.js.map +1 -1
  343. package/dist/WebsocketAPI/pushSocketSchema.d.ts +1 -1
  344. package/dist/WebsocketAPI/pushSocketSchema.d.ts.map +1 -1
  345. package/dist/index.d.ts +2 -2
  346. package/dist/index.d.ts.map +1 -1
  347. package/dist/initProstgles.d.ts +6 -5
  348. package/dist/initProstgles.d.ts.map +1 -1
  349. package/dist/initProstgles.js +1 -1
  350. package/dist/initProstgles.js.map +1 -1
  351. package/dist/runClientRequest.d.ts +4 -3
  352. package/dist/runClientRequest.d.ts.map +1 -1
  353. package/dist/runClientRequest.js.map +1 -1
  354. package/dist/utils/asNameAlias.d.ts +2 -0
  355. package/dist/utils/asNameAlias.d.ts.map +1 -0
  356. package/dist/utils/asNameAlias.js +12 -0
  357. package/dist/utils/asNameAlias.js.map +1 -0
  358. package/dist/{utils.d.ts → utils/utils.d.ts} +1 -0
  359. package/dist/utils/utils.d.ts.map +1 -0
  360. package/dist/utils/utils.js +34 -0
  361. package/dist/utils/utils.js.map +1 -0
  362. package/eslint.config.mjs +1 -0
  363. package/lib/Auth/AuthHandler.ts +6 -11
  364. package/lib/Auth/AuthTypes.ts +8 -7
  365. package/lib/Auth/endpoints/setCatchAllRequestHandler.ts +8 -5
  366. package/lib/Auth/endpoints/setLoginRequestHandler.ts +7 -4
  367. package/lib/Auth/endpoints/setLogoutRequestHandler.ts +5 -3
  368. package/lib/Auth/endpoints/setMagicLinkOrOTPRequestHandler.ts +8 -6
  369. package/lib/Auth/endpoints/setOAuthRequestHandlers.ts +6 -5
  370. package/lib/Auth/endpoints/setRegisterRequestHandler.ts +3 -2
  371. package/lib/Auth/getClientAuth.ts +8 -5
  372. package/lib/Auth/login.ts +6 -4
  373. package/lib/Auth/sendEmail.ts +2 -2
  374. package/lib/Auth/setupAuthRoutes.ts +3 -2
  375. package/lib/Auth/utils/getClientRequestIPsInfo.ts +2 -2
  376. package/lib/Auth/utils/getReturnUrl.ts +1 -1
  377. package/lib/Auth/utils/getSidAndUserFromRequest.ts +2 -2
  378. package/lib/Auth/utils/handleGetUser.ts +3 -2
  379. package/lib/Auth/utils/matchesRoute.ts +6 -0
  380. package/lib/Auth/utils/removeExpressRoute.ts +2 -2
  381. package/lib/Auth/utils/setCookieAndGoToReturnURLIFSet.ts +2 -7
  382. package/lib/Auth/utils/upsertNamedExpressMiddleware.ts +13 -2
  383. package/lib/DBEventsManager.ts +4 -3
  384. package/lib/DBSchemaBuilder/DBSchemaBuilder.spec.ts +128 -0
  385. package/lib/DBSchemaBuilder/DBSchemaBuilder.ts +100 -0
  386. package/lib/DBSchemaBuilder/getColumnTypescriptDefinition.ts +118 -0
  387. package/lib/DboBuilder/DboBuilder.ts +20 -15
  388. package/lib/DboBuilder/DboBuilderTypes.ts +7 -7
  389. package/lib/DboBuilder/QueryBuilder/Functions/COMPUTED_FIELDS.ts +35 -0
  390. package/lib/DboBuilder/QueryBuilder/{Functions.ts → Functions/Functions.ts} +7 -103
  391. package/lib/DboBuilder/QueryBuilder/Functions/parseFunction.ts +65 -0
  392. package/lib/DboBuilder/QueryBuilder/QueryBuilder.ts +9 -15
  393. package/lib/DboBuilder/QueryBuilder/getJoinQuery.ts +6 -9
  394. package/lib/DboBuilder/QueryBuilder/getNewQuery.ts +10 -10
  395. package/lib/DboBuilder/QueryBuilder/getSelectQuery.ts +2 -2
  396. package/lib/DboBuilder/QueryStreamer.ts +10 -9
  397. package/lib/DboBuilder/TableHandler/DataValidator.ts +8 -6
  398. package/lib/DboBuilder/TableHandler/TableHandler.ts +12 -16
  399. package/lib/DboBuilder/TableHandler/delete.ts +7 -6
  400. package/lib/DboBuilder/TableHandler/insert/insert.ts +6 -14
  401. package/lib/DboBuilder/TableHandler/insert/insertNestedRecords.ts +7 -6
  402. package/lib/DboBuilder/TableHandler/insertTest.ts +6 -4
  403. package/lib/DboBuilder/TableHandler/onDeleteFromFileTable.ts +5 -3
  404. package/lib/DboBuilder/TableHandler/runInsertUpdateQuery.ts +7 -4
  405. package/lib/DboBuilder/TableHandler/update.ts +6 -5
  406. package/lib/DboBuilder/TableHandler/updateBatch.ts +6 -5
  407. package/lib/DboBuilder/TableHandler/updateFile.ts +5 -4
  408. package/lib/DboBuilder/TableHandler/upsert.ts +4 -4
  409. package/lib/DboBuilder/TableRules/getValidatedRules.ts +4 -3
  410. package/lib/DboBuilder/ViewHandler/ViewHandler.ts +14 -20
  411. package/lib/DboBuilder/ViewHandler/count.ts +4 -4
  412. package/lib/DboBuilder/ViewHandler/find.ts +9 -7
  413. package/lib/DboBuilder/ViewHandler/getExistsCondition.ts +6 -5
  414. package/lib/DboBuilder/ViewHandler/getExistsFilters.ts +4 -3
  415. package/lib/DboBuilder/ViewHandler/getInfo.ts +4 -4
  416. package/lib/DboBuilder/ViewHandler/getTableJoinQuery.ts +1 -1
  417. package/lib/DboBuilder/ViewHandler/parseComplexFilter.ts +7 -4
  418. package/lib/DboBuilder/ViewHandler/parseFieldFilter.ts +19 -6
  419. package/lib/DboBuilder/ViewHandler/parseJoinPath.ts +4 -3
  420. package/lib/DboBuilder/ViewHandler/prepareSortItems.ts +4 -3
  421. package/lib/DboBuilder/ViewHandler/prepareWhere.ts +5 -4
  422. package/lib/DboBuilder/ViewHandler/size.ts +4 -4
  423. package/lib/DboBuilder/ViewHandler/subscribe.ts +8 -7
  424. package/lib/DboBuilder/ViewHandler/validateViewRules.ts +3 -3
  425. package/lib/DboBuilder/dboBuilderUtils.ts +9 -46
  426. package/lib/DboBuilder/getColumns.ts +9 -12
  427. package/lib/DboBuilder/getCondition.ts +6 -5
  428. package/lib/DboBuilder/getSubscribeRelatedTables.ts +11 -9
  429. package/lib/DboBuilder/parseUpdateRules.ts +7 -5
  430. package/lib/DboBuilder/prepareShortestJoinPaths.ts +7 -5
  431. package/lib/DboBuilder/runSQL.ts +10 -6
  432. package/lib/DboBuilder/schema/getMaterialViews.ts +2 -2
  433. package/lib/DboBuilder/schema/getTablesForSchemaPostgresSQL.ts +5 -5
  434. package/lib/DboBuilder/uploadFile.ts +5 -4
  435. package/lib/FileManager/FileManager.ts +6 -22
  436. package/lib/FileManager/getValidatedFileType.ts +4 -2
  437. package/lib/FileManager/initFileManager.ts +4 -3
  438. package/lib/FileManager/upload.ts +1 -1
  439. package/lib/FileManager/uploadStream.ts +1 -1
  440. package/lib/Filtering.ts +3 -2
  441. package/lib/Logging.ts +3 -3
  442. package/lib/PostgresNotifListenManager.ts +3 -3
  443. package/lib/Prostgles.ts +8 -6
  444. package/lib/ProstglesTypes.ts +20 -19
  445. package/lib/PubSubManager/PubSubManager.ts +11 -9
  446. package/lib/PubSubManager/PubSubManagerUtils.ts +1 -1
  447. package/lib/PubSubManager/addSub.ts +3 -3
  448. package/lib/PubSubManager/addSync.ts +1 -1
  449. package/lib/PubSubManager/addTrigger.ts +3 -2
  450. package/lib/PubSubManager/deleteOrphanedTriggers.ts +1 -1
  451. package/lib/PubSubManager/getCreatePubSubManagerError.ts +1 -1
  452. package/lib/PubSubManager/init/getPubSubManagerInitQuery.ts +1 -1
  453. package/lib/PubSubManager/notifListener.ts +1 -1
  454. package/lib/PubSubManager/pushSubData.ts +3 -2
  455. package/lib/PublishParser/PublishParser.ts +10 -8
  456. package/lib/PublishParser/getFileTableRules.ts +5 -4
  457. package/lib/PublishParser/getSchemaFromPublish.ts +8 -6
  458. package/lib/PublishParser/getTableRulesWithoutFileTable.ts +9 -8
  459. package/lib/PublishParser/publishTypesAndUtils.ts +11 -11
  460. package/lib/RestApi.ts +4 -4
  461. package/lib/SchemaWatch/SchemaWatch.ts +2 -1
  462. package/lib/SchemaWatch/getValidatedWatchSchemaType.ts +1 -1
  463. package/lib/SchemaWatch/getWatchSchemaTagList.ts +1 -1
  464. package/lib/SyncReplication.ts +4 -3
  465. package/lib/TableConfig/TableConfig.ts +8 -7
  466. package/lib/TableConfig/getColumnConfig.ts +13 -0
  467. package/lib/TableConfig/{getColumnDefinitionQuery.ts → getColumnSQLDefinitionQuery.ts} +4 -4
  468. package/lib/TableConfig/getConstraintDefinitionQueries.ts +3 -3
  469. package/lib/TableConfig/getFutureTableSchema.ts +5 -3
  470. package/lib/TableConfig/getPGIndexes.ts +1 -1
  471. package/lib/TableConfig/getTableColumnQueries.ts +5 -5
  472. package/lib/TableConfig/getTableConfigSchemaQueries.ts +3 -3
  473. package/lib/TableConfig/initTableConfig.ts +1 -1
  474. package/lib/WebsocketAPI/getClientHandlers.ts +1 -1
  475. package/lib/WebsocketAPI/getClientSchema.ts +1 -1
  476. package/lib/WebsocketAPI/onSocketConnected.ts +4 -3
  477. package/lib/WebsocketAPI/pushSocketSchema.ts +1 -1
  478. package/lib/index.ts +2 -2
  479. package/lib/initProstgles.ts +8 -6
  480. package/lib/runClientRequest.ts +9 -7
  481. package/lib/typeTests/dboTypeCheck.ts +4 -4
  482. package/lib/utils/asNameAlias.ts +7 -0
  483. package/lib/utils/utils.ts +27 -0
  484. package/package.json +5 -3
  485. package/dist/DBSchemaBuilder.d.ts.map +0 -1
  486. package/dist/DBSchemaBuilder.js +0 -181
  487. package/dist/DBSchemaBuilder.js.map +0 -1
  488. package/dist/DboBuilder/QueryBuilder/Functions.d.ts.map +0 -1
  489. package/dist/DboBuilder/QueryBuilder/Functions.js.map +0 -1
  490. package/dist/TableConfig/getColumnDefinitionQuery.d.ts.map +0 -1
  491. package/dist/TableConfig/getColumnDefinitionQuery.js.map +0 -1
  492. package/dist/utils.d.ts.map +0 -1
  493. package/dist/utils.js +0 -19
  494. package/dist/utils.js.map +0 -1
  495. package/lib/DBSchemaBuilder.ts +0 -279
  496. package/lib/utils.ts +0 -14
@@ -1,8 +1,10 @@
1
- import { AnyObject, asName, FieldFilter, FullFilter } from "prostgles-types";
2
- import { LocalParams, pgp } from "../DboBuilder";
3
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
1
+ import type { AnyObject, FieldFilter, FullFilter } from "prostgles-types";
2
+ import { asName } from "prostgles-types";
3
+ import type { LocalParams} from "../DboBuilder";
4
+ import { pgp } from "../DboBuilder";
5
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
4
6
  import { asValue } from "../../PubSubManager/PubSubManagerUtils";
5
- import { TableHandler } from "./TableHandler";
7
+ import type { TableHandler } from "./TableHandler";
6
8
 
7
9
  type InsertTestArgs = {
8
10
  tableRules: ParsedTableRule | undefined;
@@ -1,6 +1,8 @@
1
- import { AnyObject, asName, pickKeys } from "prostgles-types";
2
- import { LocalParams, type Media } from "../DboBuilder";
3
- import { TableHandler } from "./TableHandler";
1
+ import type { AnyObject} from "prostgles-types";
2
+ import { asName, pickKeys } from "prostgles-types";
3
+ import type { LocalParams} from "../DboBuilder";
4
+ import { type Media } from "../DboBuilder";
5
+ import type { TableHandler } from "./TableHandler";
4
6
 
5
7
  type OnDeleteFromFileTableArgs = {
6
8
  localParams: LocalParams | undefined;
@@ -1,7 +1,10 @@
1
- import { AnyObject, asName, FieldFilter, InsertParams, UpdateParams } from "prostgles-types";
2
- import { InsertRule, UpdateRule } from "../../PublishParser/PublishParser";
3
- import { getClientErrorFromPGError, LocalParams, withUserRLS } from "../DboBuilder";
4
- import { getSelectItemQuery, TableHandler } from "./TableHandler";
1
+ import type { AnyObject, FieldFilter, InsertParams, UpdateParams } from "prostgles-types";
2
+ import { asName } from "prostgles-types";
3
+ import type { InsertRule, UpdateRule } from "../../PublishParser/PublishParser";
4
+ import type { LocalParams} from "../DboBuilder";
5
+ import { getClientErrorFromPGError, withUserRLS } from "../DboBuilder";
6
+ import type { TableHandler } from "./TableHandler";
7
+ import { getSelectItemQuery } from "./TableHandler";
5
8
 
6
9
  type RunInsertUpdateQueryArgs = {
7
10
  tableHandler: TableHandler;
@@ -1,8 +1,9 @@
1
- import { AnyObject, UpdateParams } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import {
1
+ import type { AnyObject, UpdateParams } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
3
+ import type {
4
4
  Filter,
5
- LocalParams,
5
+ LocalParams} from "../DboBuilder";
6
+ import {
6
7
  getErrorAsObject,
7
8
  getSerializedClientErrorFromPGError,
8
9
  withUserRLS,
@@ -10,7 +11,7 @@ import {
10
11
  import { prepareNewData } from "./DataValidator";
11
12
  import { getInsertTableRules, getReferenceColumnInserts } from "./insert/insertNestedRecords";
12
13
  import { runInsertUpdateQuery } from "./runInsertUpdateQuery";
13
- import { TableHandler } from "./TableHandler";
14
+ import type { TableHandler } from "./TableHandler";
14
15
  import { updateFile } from "./updateFile";
15
16
 
16
17
  export async function update(
@@ -1,14 +1,15 @@
1
- import { AnyObject, UpdateParams } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import {
1
+ import type { AnyObject, UpdateParams } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
3
+ import type {
4
4
  Filter,
5
- LocalParams,
5
+ LocalParams} from "../DboBuilder";
6
+ import {
6
7
  getClientErrorFromPGError,
7
8
  getErrorAsObject,
8
9
  getSerializedClientErrorFromPGError,
9
10
  withUserRLS,
10
11
  } from "../DboBuilder";
11
- import { TableHandler } from "./TableHandler";
12
+ import type { TableHandler } from "./TableHandler";
12
13
 
13
14
  export async function updateBatch(
14
15
  this: TableHandler,
@@ -1,8 +1,9 @@
1
- import { AnyObject, getJSONBObjectSchemaValidationError, omitKeys } from "prostgles-types";
2
- import { ParsedTableRule, ValidateRowBasic } from "../../PublishParser/PublishParser";
3
- import { LocalParams, Media } from "../DboBuilder";
1
+ import type { AnyObject} from "prostgles-types";
2
+ import { getJSONBObjectSchemaValidationError, omitKeys } from "prostgles-types";
3
+ import type { ParsedTableRule, ValidateRowBasic } from "../../PublishParser/PublishParser";
4
+ import type { LocalParams, Media } from "../DboBuilder";
4
5
  import { isFile, uploadFile } from "../uploadFile";
5
- import { TableHandler } from "./TableHandler";
6
+ import type { TableHandler } from "./TableHandler";
6
7
 
7
8
  type Args = {
8
9
  newData: AnyObject;
@@ -1,8 +1,8 @@
1
- import { AnyObject, UpdateParams } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
- import { Filter, LocalParams } from "../DboBuilderTypes";
1
+ import type { AnyObject, UpdateParams } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
+ import type { Filter, LocalParams } from "../DboBuilderTypes";
4
4
  import { getErrorAsObject, getSerializedClientErrorFromPGError } from "../dboBuilderUtils";
5
- import { TableHandler } from "./TableHandler";
5
+ import type { TableHandler } from "./TableHandler";
6
6
 
7
7
  export const upsert = async function (
8
8
  this: TableHandler,
@@ -1,9 +1,10 @@
1
1
  import { isEmpty, type FieldFilter } from "prostgles-types";
2
- import type { ParsedTableRule, TableRule } from "../../PublishParser/publishTypesAndUtils";
2
+ import type { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
3
  import type { LocalParams, ValidatedTableRules } from "../DboBuilderTypes";
4
- import { COMPUTED_FIELDS, type FieldSpec } from "../QueryBuilder/Functions";
5
- import { asNameAlias } from "../QueryBuilder/QueryBuilder";
4
+ import type { FieldSpec } from "../QueryBuilder/Functions/Functions";
6
5
  import type { ViewHandler } from "../ViewHandler/ViewHandler";
6
+ import { COMPUTED_FIELDS } from "../QueryBuilder/Functions/COMPUTED_FIELDS";
7
+ import { asNameAlias } from "../../utils/asNameAlias";
7
8
 
8
9
  export function getValidatedRules(
9
10
  this: ViewHandler,
@@ -1,28 +1,20 @@
1
- import * as pgPromise from "pg-promise";
2
- import {
1
+ import type * as pgPromise from "pg-promise";
2
+ import type {
3
3
  AnyObject,
4
4
  ColumnInfo,
5
5
  FieldFilter,
6
6
  SelectParams,
7
7
  SubscribeParams,
8
- asName,
9
- isObject,
10
8
  } from "prostgles-types";
11
- import { TableEvent } from "../../Logging";
12
- import { DB } from "../../Prostgles";
13
- import { Join } from "../../ProstglesTypes";
14
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
15
- import { Graph } from "../../shortestPath";
16
- import {
17
- DboBuilder,
18
- Filter,
19
- LocalParams,
20
- TableHandlers,
21
- escapeTSNames,
22
- getSerializedClientErrorFromPGError,
23
- postgresToTsType,
24
- } from "../DboBuilder";
25
- import { TableSchema } from "../DboBuilderTypes";
9
+ import { asName, isObject, postgresToTsType } from "prostgles-types";
10
+ import type { TableEvent } from "../../Logging";
11
+ import type { DB } from "../../Prostgles";
12
+ import type { Join } from "../../ProstglesTypes";
13
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
14
+ import type { Graph } from "../../shortestPath";
15
+ import type { DboBuilder, Filter, LocalParams, TableHandlers } from "../DboBuilder";
16
+ import { getSerializedClientErrorFromPGError } from "../DboBuilder";
17
+ import type { TableSchema } from "../DboBuilderTypes";
26
18
  import { getValidatedRules } from "../TableRules/getValidatedRules";
27
19
  import { getColumns } from "../getColumns";
28
20
  import { count } from "./count";
@@ -31,8 +23,10 @@ import { getInfo } from "./getInfo";
31
23
  import { parseFieldFilter } from "./parseFieldFilter";
32
24
  import { prepareWhere } from "./prepareWhere";
33
25
  import { size } from "./size";
34
- import { LocalFuncs, subscribe } from "./subscribe";
26
+ import type { LocalFuncs } from "./subscribe";
27
+ import { subscribe } from "./subscribe";
35
28
  import { validateViewRules } from "./validateViewRules";
29
+ import { escapeTSNames } from "../../utils/utils";
36
30
 
37
31
  export type JoinPaths = {
38
32
  t1: string;
@@ -1,12 +1,12 @@
1
- import { SelectParams } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
- import { Filter, LocalParams } from "../DboBuilder";
1
+ import type { SelectParams } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
+ import type { Filter, LocalParams } from "../DboBuilder";
4
4
  import {
5
5
  getErrorAsObject,
6
6
  getSerializedClientErrorFromPGError,
7
7
  withUserRLS,
8
8
  } from "../dboBuilderUtils";
9
- import { ViewHandler } from "./ViewHandler";
9
+ import type { ViewHandler } from "./ViewHandler";
10
10
 
11
11
  export async function count(
12
12
  this: ViewHandler,
@@ -1,8 +1,10 @@
1
- import { SelectParams, isObject } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import {
1
+ import type { SelectParams} from "prostgles-types";
2
+ import { isObject } from "prostgles-types";
3
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
4
+ import type {
4
5
  Filter,
5
- LocalParams,
6
+ LocalParams} from "../DboBuilder";
7
+ import {
6
8
  getClientErrorFromPGError,
7
9
  getErrorAsObject,
8
10
  getSerializedClientErrorFromPGError,
@@ -10,10 +12,10 @@ import {
10
12
  } from "../DboBuilder";
11
13
  import { getNewQuery } from "../QueryBuilder/getNewQuery";
12
14
  import { getSelectQuery } from "../QueryBuilder/getSelectQuery";
13
- import { NewQuery } from "../QueryBuilder/QueryBuilder";
15
+ import type { NewQuery } from "../QueryBuilder/QueryBuilder";
14
16
  import { canRunSQL } from "../runSQL";
15
- import { TableHandler } from "../TableHandler/TableHandler";
16
- import { ViewHandler } from "./ViewHandler";
17
+ import type { TableHandler } from "../TableHandler/TableHandler";
18
+ import type { ViewHandler } from "./ViewHandler";
17
19
 
18
20
  export const find = async function (
19
21
  this: ViewHandler,
@@ -1,8 +1,9 @@
1
- import { AnyObject, EXISTS_KEY, EXISTS_KEYS, FieldFilter, asName } from "prostgles-types";
2
- import { LocalParams, ExistsFilterConfig } from "../DboBuilder";
3
- import { ViewHandler } from "./ViewHandler";
4
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
5
- import { TableHandler } from "../TableHandler/TableHandler";
1
+ import type { AnyObject, EXISTS_KEY, FieldFilter} from "prostgles-types";
2
+ import { EXISTS_KEYS, asName } from "prostgles-types";
3
+ import type { LocalParams, ExistsFilterConfig } from "../DboBuilder";
4
+ import type { ViewHandler } from "./ViewHandler";
5
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
6
+ import type { TableHandler } from "../TableHandler/TableHandler";
6
7
  import { getTableJoinQuery } from "./getTableJoinQuery";
7
8
 
8
9
  export async function getExistsCondition(
@@ -1,6 +1,7 @@
1
- import { EXISTS_KEY, EXISTS_KEYS, getKeys } from "prostgles-types";
2
- import { ExistsFilterConfig } from "../DboBuilder";
3
- import { ViewHandler } from "./ViewHandler";
1
+ import type { EXISTS_KEY} from "prostgles-types";
2
+ import { EXISTS_KEYS, getKeys } from "prostgles-types";
3
+ import type { ExistsFilterConfig } from "../DboBuilder";
4
+ import type { ViewHandler } from "./ViewHandler";
4
5
  import { parseJoinPath } from "./parseJoinPath";
5
6
 
6
7
  export const getExistsFilters = (
@@ -1,7 +1,7 @@
1
- import { TableInfo as TInfo } from "prostgles-types/dist";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import { LocalParams } from "../DboBuilder";
4
- import { ViewHandler } from "./ViewHandler";
1
+ import type { TableInfo as TInfo } from "prostgles-types/dist";
2
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
3
+ import type { LocalParams } from "../DboBuilder";
4
+ import type { ViewHandler } from "./ViewHandler";
5
5
 
6
6
  export async function getInfo(
7
7
  this: ViewHandler,
@@ -1,5 +1,5 @@
1
1
  import { asName } from "prostgles-types";
2
- import { ParsedJoinPath } from "./parseJoinPath";
2
+ import type { ParsedJoinPath } from "./parseJoinPath";
3
3
 
4
4
  type getTableJoinsArgs = {
5
5
  rootTableAlias: string;
@@ -1,13 +1,16 @@
1
- import { AnyObject, isObject } from "prostgles-types";
1
+ import type { AnyObject } from "prostgles-types";
2
+ import { isObject } from "prostgles-types";
2
3
  import {
3
4
  FILTER_OPERANDS,
4
5
  FILTER_OPERAND_TO_SQL_OPERAND,
5
6
  parseFilterRightValue,
6
7
  } from "../../Filtering";
7
- import { FUNCTIONS, parseFunction } from "../QueryBuilder/Functions";
8
- import { asNameAlias, parseFunctionObject } from "../QueryBuilder/QueryBuilder";
9
- import { TableSchemaColumn } from "../DboBuilderTypes";
8
+ import { FUNCTIONS } from "../QueryBuilder/Functions/Functions";
9
+ import { parseFunctionObject } from "../QueryBuilder/QueryBuilder";
10
+ import type { TableSchemaColumn } from "../DboBuilderTypes";
10
11
  import { asValue } from "../../PubSubManager/PubSubManagerUtils";
12
+ import { parseFunction } from "../QueryBuilder/Functions/parseFunction";
13
+ import { asNameAlias } from "../../utils/asNameAlias";
11
14
 
12
15
  const allowedComparators = FILTER_OPERANDS; //[">", "<", "=", "<=", ">=", "<>", "!="]
13
16
  type Args = {
@@ -1,5 +1,5 @@
1
- import { FieldFilter, getKeys } from "prostgles-types";
2
- import { isPlainObject } from "../DboBuilder";
1
+ import type { FieldFilter } from "prostgles-types";
2
+ import { getKeys, includes, isObject } from "prostgles-types";
3
3
 
4
4
  /**
5
5
  * Filter string array
@@ -23,7 +23,14 @@ export const parseFieldFilter = <AllowedKeys extends string[]>(
23
23
  }
24
24
 
25
25
  /* string[] */
26
- if (Array.isArray(fieldParams) && !fieldParams.find((f) => typeof f !== "string")) {
26
+ if (Array.isArray(fieldParams)) {
27
+ if (fieldParams.find((f) => typeof f !== "string")) {
28
+ throw (
29
+ " Invalid field filter array.\nExpecting array of strings. \n Received -> " +
30
+ initialParams
31
+ );
32
+ }
33
+
27
34
  /*
28
35
  ["*"]
29
36
  */
@@ -50,9 +57,9 @@ export const parseFieldFilter = <AllowedKeys extends string[]>(
50
57
  { field1: true, field2: true } = only field1 and field2
51
58
  { field1: false, field2: false } = all fields except field1 and field2
52
59
  */
53
- } else if (isPlainObject(fieldParams)) {
60
+ } else if (isObject(fieldParams)) {
54
61
  if (!getKeys(fieldParams as Record<string, any>).length) {
55
- return [] as unknown as typeof all_cols; //all_fields.slice(0) as typeof all_fields;
62
+ return [] as unknown as typeof all_cols;
56
63
  }
57
64
 
58
65
  const keys = getKeys(
@@ -72,7 +79,13 @@ export const parseFieldFilter = <AllowedKeys extends string[]>(
72
79
 
73
80
  keys.forEach((key) => {
74
81
  const allowedVals = [true, false, 0, 1];
75
- if (!allowedVals.includes((fieldParams as any)[key]))
82
+ if (
83
+ !includes(
84
+ allowedVals,
85
+ //@ts-ignore
86
+ fieldParams[key]
87
+ )
88
+ )
76
89
  throw `Invalid field selection value for: { ${key}: ${(fieldParams as any)[key]} }. \n Allowed values: ${allowedVals.join(" OR ")}`;
77
90
  });
78
91
 
@@ -1,5 +1,6 @@
1
- import { JoinPath, RawJoinPath, reverseJoinOn } from "prostgles-types";
2
- import { ViewHandler } from "./ViewHandler";
1
+ import type { JoinPath, RawJoinPath} from "prostgles-types";
2
+ import { reverseJoinOn } from "prostgles-types";
3
+ import type { ViewHandler } from "./ViewHandler";
3
4
 
4
5
  type parseJoinPathArgs = {
5
6
  rawPath: RawJoinPath;
@@ -69,7 +70,7 @@ export const parseJoinPath = ({
69
70
  return result;
70
71
  };
71
72
 
72
- import { JoinInfo } from "../DboBuilder";
73
+ import type { JoinInfo } from "../DboBuilder";
73
74
 
74
75
  type Opts = {
75
76
  allowMultiOrJoin?: boolean;
@@ -1,13 +1,14 @@
1
+ import type { OrderBy } from "prostgles-types/dist";
1
2
  import {
2
- OrderBy,
3
3
  asName,
4
4
  getJSONBObjectSchemaValidationError,
5
5
  isDefined,
6
6
  isEmpty,
7
7
  isObject,
8
8
  } from "prostgles-types/dist";
9
- import { SortItem } from "../DboBuilder";
10
- import { NewQueryJoin, SelectItemValidated, asNameAlias } from "../QueryBuilder/QueryBuilder";
9
+ import type { SortItem } from "../DboBuilder";
10
+ import type { NewQueryJoin, SelectItemValidated } from "../QueryBuilder/QueryBuilder";
11
+ import { asNameAlias } from "../../utils/asNameAlias";
11
12
 
12
13
  /* This relates only to SELECT */
13
14
  export const prepareSortItems = (
@@ -1,9 +1,10 @@
1
- import { AnyObject, FieldFilter, getKeys, isDefined, isObject } from "prostgles-types/dist";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import { ExistsFilterConfig, Filter, LocalParams } from "../DboBuilder";
1
+ import type { AnyObject, FieldFilter} from "prostgles-types/dist";
2
+ import { getKeys, isDefined, isObject } from "prostgles-types/dist";
3
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
4
+ import type { ExistsFilterConfig, Filter, LocalParams } from "../DboBuilder";
4
5
  import { getCondition } from "../getCondition";
5
6
  import { type SelectItemValidated } from "../QueryBuilder/QueryBuilder";
6
- import { ViewHandler } from "./ViewHandler";
7
+ import type { ViewHandler } from "./ViewHandler";
7
8
 
8
9
  export type PrepareWhereParams = {
9
10
  filter?: Filter;
@@ -1,12 +1,12 @@
1
- import { SelectParams } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
- import { Filter, LocalParams } from "../DboBuilderTypes";
1
+ import type { SelectParams } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/publishTypesAndUtils";
3
+ import type { Filter, LocalParams } from "../DboBuilderTypes";
4
4
  import {
5
5
  getErrorAsObject,
6
6
  getSerializedClientErrorFromPGError,
7
7
  withUserRLS,
8
8
  } from "../dboBuilderUtils";
9
- import { ViewHandler } from "./ViewHandler";
9
+ import type { ViewHandler } from "./ViewHandler";
10
10
  export async function size(
11
11
  this: ViewHandler,
12
12
  _filter?: Filter,
@@ -1,14 +1,15 @@
1
- import { AnyObject, SubscribeParams, SubscriptionChannels } from "prostgles-types";
2
- import { ParsedTableRule } from "../../PublishParser/PublishParser";
3
- import {
1
+ import type { AnyObject, SubscribeParams, SubscriptionChannels } from "prostgles-types";
2
+ import type { ParsedTableRule } from "../../PublishParser/PublishParser";
3
+ import type {
4
4
  Filter,
5
+ LocalParams} from "../DboBuilder";
6
+ import {
5
7
  getErrorAsObject,
6
- getSerializedClientErrorFromPGError,
7
- LocalParams,
8
+ getSerializedClientErrorFromPGError
8
9
  } from "../DboBuilder";
9
10
  import { getSubscribeRelatedTables } from "../getSubscribeRelatedTables";
10
- import { NewQuery } from "../QueryBuilder/QueryBuilder";
11
- import { ViewHandler } from "./ViewHandler";
11
+ import type { NewQuery } from "../QueryBuilder/QueryBuilder";
12
+ import type { ViewHandler } from "./ViewHandler";
12
13
  import { getValidatedSubscribeOptions } from "./getValidatedSubscribeOptions";
13
14
 
14
15
  type OnData = (items: AnyObject[]) => any;
@@ -1,6 +1,6 @@
1
- import { AnyObject, FieldFilter } from "prostgles-types/dist";
2
- import { UpdateRule } from "../../PublishParser/PublishParser";
3
- import { ViewHandler } from "./ViewHandler";
1
+ import type { AnyObject, FieldFilter } from "prostgles-types/dist";
2
+ import type { UpdateRule } from "../../PublishParser/PublishParser";
3
+ import type { ViewHandler } from "./ViewHandler";
4
4
 
5
5
  export async function validateViewRules(
6
6
  this: ViewHandler,
@@ -3,31 +3,18 @@
3
3
  * Licensed under the MIT License. See LICENSE in the project root for license information.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
 
6
- import {
7
- AnyObject,
8
- PG_COLUMN_UDT_DATA_TYPE,
9
- ProstglesError,
10
- TS_PG_Types,
11
- getKeys,
12
- isObject,
13
- omitKeys,
14
- pickKeys,
15
- } from "prostgles-types";
16
- import { DB } from "../Prostgles";
17
- import { LocalParams, SortItem, pgp } from "./DboBuilderTypes";
18
- import { asNameAlias } from "./QueryBuilder/QueryBuilder";
19
- import { ViewHandler } from "./ViewHandler/ViewHandler";
6
+ import type { AnyObject, ProstglesError } from "prostgles-types";
7
+ import { asNameAlias } from "../utils/asNameAlias";
8
+ import { isObject, omitKeys, pickKeys } from "prostgles-types";
9
+ import type { DB } from "../Prostgles";
10
+ import type { LocalParams, SortItem } from "./DboBuilderTypes";
11
+ import { pgp } from "./DboBuilderTypes";
20
12
  import { getSchemaFilter } from "./schema/getTablesForSchemaPostgresSQL";
13
+ import type { ViewHandler } from "./ViewHandler/ViewHandler";
21
14
 
22
- import { ProstglesInitOptions } from "../ProstglesTypes";
15
+ import type { ProstglesInitOptions } from "../ProstglesTypes";
23
16
  import { sqlErrCodeToMsg } from "./sqlErrCodeToMsg";
24
- import { TableHandler } from "./TableHandler/TableHandler";
25
- export function escapeTSNames(str: string, capitalize = false): string {
26
- let res = str;
27
- res = (capitalize ? str[0]?.toUpperCase() : str[0]) + str.slice(1);
28
- if (canBeUsedAsIsInTypescript(res)) return res;
29
- return JSON.stringify(res);
30
- }
17
+ import type { TableHandler } from "./TableHandler/TableHandler";
31
18
 
32
19
  const safeStringify = (obj: AnyObject) => {
33
20
  const seen = new WeakSet();
@@ -214,23 +201,6 @@ export const getConstraints = async (
214
201
  );
215
202
  };
216
203
 
217
- /**
218
- * @deprecated
219
- * use isObject
220
- */
221
- export function isPlainObject(o: any): o is Record<string, any> {
222
- return Object(o) === o && Object.getPrototypeOf(o) === Object.prototype;
223
- }
224
-
225
- export function postgresToTsType(udt_data_type: PG_COLUMN_UDT_DATA_TYPE): keyof typeof TS_PG_Types {
226
- return (
227
- getKeys(TS_PG_Types).find((k) => {
228
- // @ts-ignore
229
- return TS_PG_Types[k].includes(udt_data_type);
230
- }) ?? "any"
231
- );
232
- }
233
-
234
204
  export const prepareOrderByQuery = (items: SortItem[], tableAlias?: string): string[] => {
235
205
  if (!items.length) return [];
236
206
  return [
@@ -269,10 +239,3 @@ export const withUserRLS = (localParams: LocalParams | undefined, query: string)
269
239
 
270
240
  return [firstQuery, query].join("\n");
271
241
  };
272
-
273
- function canBeUsedAsIsInTypescript(str: string): boolean {
274
- if (!str) return false;
275
- const isAlphaNumericOrUnderline = str.match(/^[a-z0-9_]+$/i);
276
- const startsWithCharOrUnderscore = str[0]?.match(/^[a-z_]+$/i);
277
- return Boolean(isAlphaNumericOrUnderline && startsWithCharOrUnderscore);
278
- }
@@ -1,21 +1,18 @@
1
- import {
1
+ import type {
2
2
  AnyObject,
3
- PG_COLUMN_UDT_DATA_TYPE,
4
- ValidatedColumnInfo,
3
+ ValidatedColumnInfo} from "prostgles-types";
4
+ import {
5
5
  _PG_geometric,
6
6
  isDefined,
7
7
  isObject,
8
8
  omitKeys,
9
- } from "prostgles-types";
10
- import { ParsedTableRule } from "../PublishParser/PublishParser";
11
- import {
12
- LocalParams,
13
- getErrorAsObject,
14
- getSerializedClientErrorFromPGError,
15
9
  postgresToTsType,
16
- } from "./DboBuilder";
17
- import { TableHandler } from "./TableHandler/TableHandler";
18
- import { ViewHandler } from "./ViewHandler/ViewHandler";
10
+ } from "prostgles-types";
11
+ import type { ParsedTableRule } from "../PublishParser/PublishParser";
12
+ import type { LocalParams} from "./DboBuilder";
13
+ import { getErrorAsObject, getSerializedClientErrorFromPGError } from "./DboBuilder";
14
+ import type { TableHandler } from "./TableHandler/TableHandler";
15
+ import type { ViewHandler } from "./ViewHandler/ViewHandler";
19
16
 
20
17
  export const isTableHandler = (v: any): v is TableHandler => "parseUpdateRules" in v;
21
18
 
@@ -1,10 +1,11 @@
1
1
  import { pickKeys } from "prostgles-types";
2
2
  import { parseFilterItem } from "../Filtering";
3
- import { ParsedTableRule } from "../PublishParser/PublishParser";
4
- import { ExistsFilterConfig, LocalParams, pgp } from "./DboBuilder";
5
- import { FUNCTIONS } from "./QueryBuilder/Functions";
6
- import { SelectItem, type SelectItemValidated } from "./QueryBuilder/QueryBuilder";
7
- import { ViewHandler } from "./ViewHandler/ViewHandler";
3
+ import type { ParsedTableRule } from "../PublishParser/PublishParser";
4
+ import type { ExistsFilterConfig, LocalParams} from "./DboBuilder";
5
+ import { pgp } from "./DboBuilder";
6
+ import { FUNCTIONS } from "./QueryBuilder/Functions/Functions";
7
+ import { type SelectItemValidated } from "./QueryBuilder/QueryBuilder";
8
+ import type { ViewHandler } from "./ViewHandler/ViewHandler";
8
9
  import { getExistsCondition } from "./ViewHandler/getExistsCondition";
9
10
  import { getExistsFilters } from "./ViewHandler/getExistsFilters";
10
11
  import { parseComplexFilter } from "./ViewHandler/parseComplexFilter";
@@ -1,15 +1,17 @@
1
- import {
1
+ import type {
2
2
  AnyObject,
3
- asName,
4
3
  ParsedJoinPath,
5
- reverseParsedPath,
6
- SubscribeParams,
4
+ SubscribeParams} from "prostgles-types";
5
+ import {
6
+ asName,
7
+ reverseParsedPath
7
8
  } from "prostgles-types";
8
- import { ParsedTableRule } from "../PublishParser/PublishParser";
9
- import { ViewSubscriptionOptions } from "../PubSubManager/PubSubManager";
10
- import { Filter, getSerializedClientErrorFromPGError, LocalParams } from "./DboBuilder";
11
- import { NewQuery } from "./QueryBuilder/QueryBuilder";
12
- import { ViewHandler } from "./ViewHandler/ViewHandler";
9
+ import type { ParsedTableRule } from "../PublishParser/PublishParser";
10
+ import type { ViewSubscriptionOptions } from "../PubSubManager/PubSubManager";
11
+ import type { Filter, LocalParams } from "./DboBuilder";
12
+ import { getSerializedClientErrorFromPGError } from "./DboBuilder";
13
+ import type { NewQuery } from "./QueryBuilder/QueryBuilder";
14
+ import type { ViewHandler } from "./ViewHandler/ViewHandler";
13
15
  import { log } from "../PubSubManager/PubSubManagerUtils";
14
16
 
15
17
  type Args = {