@payloadcms/db-postgres 3.0.0-beta.7 → 3.0.0-beta.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. package/README.md +1 -1
  2. package/dist/connect.d.ts +1 -1
  3. package/dist/connect.d.ts.map +1 -1
  4. package/dist/connect.js +16 -13
  5. package/dist/connect.js.map +1 -1
  6. package/dist/countDistinct.d.ts +3 -0
  7. package/dist/countDistinct.d.ts.map +1 -0
  8. package/dist/countDistinct.js +24 -0
  9. package/dist/countDistinct.js.map +1 -0
  10. package/dist/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -0
  11. package/dist/createJSONQuery/convertPathToJSONTraversal.js.map +1 -0
  12. package/dist/createJSONQuery/formatJSONPathSegment.d.ts.map +1 -0
  13. package/dist/createJSONQuery/formatJSONPathSegment.js.map +1 -0
  14. package/dist/createJSONQuery/index.d.ts.map +1 -0
  15. package/dist/createJSONQuery/index.js.map +1 -0
  16. package/dist/createMigration.d.ts +1 -1
  17. package/dist/createMigration.d.ts.map +1 -1
  18. package/dist/createMigration.js +56 -57
  19. package/dist/createMigration.js.map +1 -1
  20. package/dist/defaultSnapshot.d.ts +3 -0
  21. package/dist/defaultSnapshot.d.ts.map +1 -0
  22. package/dist/defaultSnapshot.js +16 -0
  23. package/dist/defaultSnapshot.js.map +1 -0
  24. package/dist/deleteWhere.d.ts +3 -0
  25. package/dist/deleteWhere.d.ts.map +1 -0
  26. package/dist/deleteWhere.js +6 -0
  27. package/dist/deleteWhere.js.map +1 -0
  28. package/dist/dropDatabase.d.ts +3 -0
  29. package/dist/dropDatabase.d.ts.map +1 -0
  30. package/dist/dropDatabase.js +9 -0
  31. package/dist/dropDatabase.js.map +1 -0
  32. package/dist/execute.d.ts +3 -0
  33. package/dist/execute.d.ts.map +1 -0
  34. package/dist/execute.js +11 -0
  35. package/dist/execute.js.map +1 -0
  36. package/dist/exports/migration-utils.d.ts +2 -0
  37. package/dist/exports/migration-utils.d.ts.map +1 -0
  38. package/dist/exports/migration-utils.js +3 -0
  39. package/dist/exports/migration-utils.js.map +1 -0
  40. package/dist/getMigrationTemplate.d.ts +3 -0
  41. package/dist/getMigrationTemplate.d.ts.map +1 -0
  42. package/dist/getMigrationTemplate.js +12 -0
  43. package/dist/getMigrationTemplate.js.map +1 -0
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +44 -71
  47. package/dist/index.js.map +1 -1
  48. package/dist/init.d.ts +1 -1
  49. package/dist/init.d.ts.map +1 -1
  50. package/dist/init.js +21 -24
  51. package/dist/init.js.map +1 -1
  52. package/dist/insert.d.ts +3 -0
  53. package/dist/insert.d.ts.map +1 -0
  54. package/dist/insert.js +12 -0
  55. package/dist/insert.js.map +1 -0
  56. package/dist/predefinedMigrations/relationships-v2-v3.d.ts +4 -0
  57. package/dist/predefinedMigrations/relationships-v2-v3.d.ts.map +1 -0
  58. package/dist/predefinedMigrations/relationships-v2-v3.js.map +1 -0
  59. package/dist/predefinedMigrations/relationships-v2-v3.mjs +11 -0
  60. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +20 -0
  61. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -0
  62. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +169 -0
  63. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -0
  64. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts +11 -0
  65. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -0
  66. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js +191 -0
  67. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -0
  68. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts +3 -0
  69. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -0
  70. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js +56 -0
  71. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js.map +1 -0
  72. package/dist/predefinedMigrations/v2-v3/index.d.ts +23 -0
  73. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -0
  74. package/dist/predefinedMigrations/v2-v3/index.js +211 -0
  75. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -0
  76. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +20 -0
  77. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -0
  78. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js +57 -0
  79. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -0
  80. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +23 -0
  81. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -0
  82. package/dist/predefinedMigrations/v2-v3/traverseFields.js +85 -0
  83. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -0
  84. package/dist/predefinedMigrations/v2-v3/types.d.ts +9 -0
  85. package/dist/predefinedMigrations/v2-v3/types.d.ts.map +1 -0
  86. package/dist/predefinedMigrations/v2-v3/types.js +6 -0
  87. package/dist/predefinedMigrations/v2-v3/types.js.map +1 -0
  88. package/dist/requireDrizzleKit.d.ts +3 -0
  89. package/dist/requireDrizzleKit.d.ts.map +1 -0
  90. package/dist/requireDrizzleKit.js +5 -0
  91. package/dist/requireDrizzleKit.js.map +1 -0
  92. package/dist/schema/build.d.ts +12 -7
  93. package/dist/schema/build.d.ts.map +1 -1
  94. package/dist/schema/build.js +209 -125
  95. package/dist/schema/build.js.map +1 -1
  96. package/dist/schema/createIndex.js.map +1 -1
  97. package/dist/schema/idToUUID.d.ts +1 -1
  98. package/dist/schema/idToUUID.d.ts.map +1 -1
  99. package/dist/schema/idToUUID.js.map +1 -1
  100. package/dist/schema/parentIDColumnMap.js.map +1 -1
  101. package/dist/schema/setColumnID.d.ts +1 -1
  102. package/dist/schema/setColumnID.d.ts.map +1 -1
  103. package/dist/schema/setColumnID.js +2 -2
  104. package/dist/schema/setColumnID.js.map +1 -1
  105. package/dist/schema/traverseFields.d.ts +5 -7
  106. package/dist/schema/traverseFields.d.ts.map +1 -1
  107. package/dist/schema/traverseFields.js +148 -66
  108. package/dist/schema/traverseFields.js.map +1 -1
  109. package/dist/types.d.ts +76 -34
  110. package/dist/types.d.ts.map +1 -1
  111. package/dist/types.js.map +1 -1
  112. package/package.json +35 -30
  113. package/dist/create.d.ts +0 -3
  114. package/dist/create.d.ts.map +0 -1
  115. package/dist/create.js +0 -21
  116. package/dist/create.js.map +0 -1
  117. package/dist/createGlobal.d.ts +0 -5
  118. package/dist/createGlobal.d.ts.map +0 -1
  119. package/dist/createGlobal.js +0 -21
  120. package/dist/createGlobal.js.map +0 -1
  121. package/dist/createGlobalVersion.d.ts +0 -6
  122. package/dist/createGlobalVersion.d.ts.map +0 -1
  123. package/dist/createGlobalVersion.js +0 -37
  124. package/dist/createGlobalVersion.js.map +0 -1
  125. package/dist/createVersion.d.ts +0 -5
  126. package/dist/createVersion.d.ts.map +0 -1
  127. package/dist/createVersion.js +0 -48
  128. package/dist/createVersion.js.map +0 -1
  129. package/dist/deleteMany.d.ts +0 -3
  130. package/dist/deleteMany.d.ts.map +0 -1
  131. package/dist/deleteMany.js +0 -31
  132. package/dist/deleteMany.js.map +0 -1
  133. package/dist/deleteOne.d.ts +0 -3
  134. package/dist/deleteOne.d.ts.map +0 -1
  135. package/dist/deleteOne.js +0 -62
  136. package/dist/deleteOne.js.map +0 -1
  137. package/dist/deleteVersions.d.ts +0 -3
  138. package/dist/deleteVersions.d.ts.map +0 -1
  139. package/dist/deleteVersions.js +0 -35
  140. package/dist/deleteVersions.js.map +0 -1
  141. package/dist/destroy.d.ts +0 -3
  142. package/dist/destroy.d.ts.map +0 -1
  143. package/dist/destroy.js +0 -11
  144. package/dist/destroy.js.map +0 -1
  145. package/dist/find/buildFindManyArgs.d.ts +0 -13
  146. package/dist/find/buildFindManyArgs.d.ts.map +0 -1
  147. package/dist/find/buildFindManyArgs.js +0 -64
  148. package/dist/find/buildFindManyArgs.js.map +0 -1
  149. package/dist/find/chainMethods.d.ts +0 -16
  150. package/dist/find/chainMethods.d.ts.map +0 -1
  151. package/dist/find/chainMethods.js +0 -12
  152. package/dist/find/chainMethods.js.map +0 -1
  153. package/dist/find/findMany.d.ts +0 -22
  154. package/dist/find/findMany.d.ts.map +0 -1
  155. package/dist/find/findMany.js +0 -163
  156. package/dist/find/findMany.js.map +0 -1
  157. package/dist/find/traverseFields.d.ts +0 -16
  158. package/dist/find/traverseFields.d.ts.map +0 -1
  159. package/dist/find/traverseFields.js +0 -154
  160. package/dist/find/traverseFields.js.map +0 -1
  161. package/dist/find.d.ts +0 -3
  162. package/dist/find.d.ts.map +0 -1
  163. package/dist/find.js +0 -24
  164. package/dist/find.js.map +0 -1
  165. package/dist/findGlobal.d.ts +0 -3
  166. package/dist/findGlobal.d.ts.map +0 -1
  167. package/dist/findGlobal.js +0 -26
  168. package/dist/findGlobal.js.map +0 -1
  169. package/dist/findGlobalVersions.d.ts +0 -3
  170. package/dist/findGlobalVersions.d.ts.map +0 -1
  171. package/dist/findGlobalVersions.js +0 -28
  172. package/dist/findGlobalVersions.js.map +0 -1
  173. package/dist/findOne.d.ts +0 -5
  174. package/dist/findOne.d.ts.map +0 -1
  175. package/dist/findOne.js +0 -24
  176. package/dist/findOne.js.map +0 -1
  177. package/dist/findVersions.d.ts +0 -3
  178. package/dist/findVersions.d.ts.map +0 -1
  179. package/dist/findVersions.js +0 -28
  180. package/dist/findVersions.js.map +0 -1
  181. package/dist/migrate.d.ts +0 -3
  182. package/dist/migrate.d.ts.map +0 -1
  183. package/dist/migrate.js +0 -99
  184. package/dist/migrate.js.map +0 -1
  185. package/dist/migrateDown.d.ts +0 -3
  186. package/dist/migrateDown.d.ts.map +0 -1
  187. package/dist/migrateDown.js +0 -63
  188. package/dist/migrateDown.js.map +0 -1
  189. package/dist/migrateFresh.d.ts +0 -8
  190. package/dist/migrateFresh.d.ts.map +0 -1
  191. package/dist/migrateFresh.js +0 -72
  192. package/dist/migrateFresh.js.map +0 -1
  193. package/dist/migrateRefresh.d.ts +0 -6
  194. package/dist/migrateRefresh.d.ts.map +0 -1
  195. package/dist/migrateRefresh.js +0 -102
  196. package/dist/migrateRefresh.js.map +0 -1
  197. package/dist/migrateReset.d.ts +0 -6
  198. package/dist/migrateReset.d.ts.map +0 -1
  199. package/dist/migrateReset.js +0 -82
  200. package/dist/migrateReset.js.map +0 -1
  201. package/dist/migrateStatus.d.ts +0 -3
  202. package/dist/migrateStatus.d.ts.map +0 -1
  203. package/dist/migrateStatus.js +0 -44
  204. package/dist/migrateStatus.js.map +0 -1
  205. package/dist/queries/buildAndOrConditions.d.ts +0 -17
  206. package/dist/queries/buildAndOrConditions.d.ts.map +0 -1
  207. package/dist/queries/buildAndOrConditions.js +0 -29
  208. package/dist/queries/buildAndOrConditions.js.map +0 -1
  209. package/dist/queries/buildQuery.d.ts +0 -31
  210. package/dist/queries/buildQuery.d.ts.map +0 -1
  211. package/dist/queries/buildQuery.js +0 -76
  212. package/dist/queries/buildQuery.js.map +0 -1
  213. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +0 -1
  214. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +0 -1
  215. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +0 -1
  216. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +0 -1
  217. package/dist/queries/createJSONQuery/index.d.ts.map +0 -1
  218. package/dist/queries/createJSONQuery/index.js.map +0 -1
  219. package/dist/queries/getTableColumnFromPath.d.ts +0 -51
  220. package/dist/queries/getTableColumnFromPath.d.ts.map +0 -1
  221. package/dist/queries/getTableColumnFromPath.js +0 -412
  222. package/dist/queries/getTableColumnFromPath.js.map +0 -1
  223. package/dist/queries/operatorMap.d.ts +0 -18
  224. package/dist/queries/operatorMap.d.ts.map +0 -1
  225. package/dist/queries/operatorMap.js +0 -24
  226. package/dist/queries/operatorMap.js.map +0 -1
  227. package/dist/queries/parseParams.d.ts +0 -17
  228. package/dist/queries/parseParams.d.ts.map +0 -1
  229. package/dist/queries/parseParams.js +0 -182
  230. package/dist/queries/parseParams.js.map +0 -1
  231. package/dist/queries/sanitizeQueryValue.d.ts +0 -15
  232. package/dist/queries/sanitizeQueryValue.d.ts.map +0 -1
  233. package/dist/queries/sanitizeQueryValue.js +0 -90
  234. package/dist/queries/sanitizeQueryValue.js.map +0 -1
  235. package/dist/queries/selectDistinct.d.ts +0 -23
  236. package/dist/queries/selectDistinct.d.ts.map +0 -1
  237. package/dist/queries/selectDistinct.js +0 -41
  238. package/dist/queries/selectDistinct.js.map +0 -1
  239. package/dist/queryDrafts.d.ts +0 -3
  240. package/dist/queryDrafts.d.ts.map +0 -1
  241. package/dist/queryDrafts.js +0 -45
  242. package/dist/queryDrafts.js.map +0 -1
  243. package/dist/schema/getTableName.d.ts +0 -32
  244. package/dist/schema/getTableName.d.ts.map +0 -1
  245. package/dist/schema/getTableName.js +0 -31
  246. package/dist/schema/getTableName.js.map +0 -1
  247. package/dist/schema/validateExistingBlockIsIdentical.d.ts +0 -11
  248. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +0 -1
  249. package/dist/schema/validateExistingBlockIsIdentical.js +0 -70
  250. package/dist/schema/validateExistingBlockIsIdentical.js.map +0 -1
  251. package/dist/transactions/beginTransaction.d.ts +0 -3
  252. package/dist/transactions/beginTransaction.d.ts.map +0 -1
  253. package/dist/transactions/beginTransaction.js +0 -47
  254. package/dist/transactions/beginTransaction.js.map +0 -1
  255. package/dist/transactions/commitTransaction.d.ts +0 -3
  256. package/dist/transactions/commitTransaction.d.ts.map +0 -1
  257. package/dist/transactions/commitTransaction.js +0 -14
  258. package/dist/transactions/commitTransaction.js.map +0 -1
  259. package/dist/transactions/rollbackTransaction.d.ts +0 -3
  260. package/dist/transactions/rollbackTransaction.d.ts.map +0 -1
  261. package/dist/transactions/rollbackTransaction.js +0 -13
  262. package/dist/transactions/rollbackTransaction.js.map +0 -1
  263. package/dist/transform/read/hasManyNumber.d.ts +0 -10
  264. package/dist/transform/read/hasManyNumber.d.ts.map +0 -1
  265. package/dist/transform/read/hasManyNumber.js +0 -10
  266. package/dist/transform/read/hasManyNumber.js.map +0 -1
  267. package/dist/transform/read/hasManyText.d.ts +0 -10
  268. package/dist/transform/read/hasManyText.d.ts.map +0 -1
  269. package/dist/transform/read/hasManyText.js +0 -10
  270. package/dist/transform/read/hasManyText.js.map +0 -1
  271. package/dist/transform/read/index.d.ts +0 -12
  272. package/dist/transform/read/index.d.ts.map +0 -1
  273. package/dist/transform/read/index.js +0 -43
  274. package/dist/transform/read/index.js.map +0 -1
  275. package/dist/transform/read/relationship.d.ts +0 -10
  276. package/dist/transform/read/relationship.d.ts.map +0 -1
  277. package/dist/transform/read/relationship.js +0 -64
  278. package/dist/transform/read/relationship.js.map +0 -1
  279. package/dist/transform/read/traverseFields.d.ts +0 -52
  280. package/dist/transform/read/traverseFields.d.ts.map +0 -1
  281. package/dist/transform/read/traverseFields.js +0 -421
  282. package/dist/transform/read/traverseFields.js.map +0 -1
  283. package/dist/transform/write/array.d.ts +0 -26
  284. package/dist/transform/write/array.d.ts.map +0 -1
  285. package/dist/transform/write/array.js +0 -58
  286. package/dist/transform/write/array.js.map +0 -1
  287. package/dist/transform/write/blocks.d.ts +0 -25
  288. package/dist/transform/write/blocks.d.ts.map +0 -1
  289. package/dist/transform/write/blocks.js +0 -54
  290. package/dist/transform/write/blocks.js.map +0 -1
  291. package/dist/transform/write/index.d.ts +0 -13
  292. package/dist/transform/write/index.d.ts.map +0 -1
  293. package/dist/transform/write/index.js +0 -41
  294. package/dist/transform/write/index.js.map +0 -1
  295. package/dist/transform/write/numbers.d.ts +0 -8
  296. package/dist/transform/write/numbers.d.ts.map +0 -1
  297. package/dist/transform/write/numbers.js +0 -11
  298. package/dist/transform/write/numbers.js.map +0 -1
  299. package/dist/transform/write/relationships.d.ts +0 -10
  300. package/dist/transform/write/relationships.d.ts.map +0 -1
  301. package/dist/transform/write/relationships.js +0 -23
  302. package/dist/transform/write/relationships.js.map +0 -1
  303. package/dist/transform/write/selects.d.ts +0 -8
  304. package/dist/transform/write/selects.d.ts.map +0 -1
  305. package/dist/transform/write/selects.js +0 -20
  306. package/dist/transform/write/selects.js.map +0 -1
  307. package/dist/transform/write/texts.d.ts +0 -8
  308. package/dist/transform/write/texts.d.ts.map +0 -1
  309. package/dist/transform/write/texts.js +0 -11
  310. package/dist/transform/write/texts.js.map +0 -1
  311. package/dist/transform/write/traverseFields.d.ts +0 -50
  312. package/dist/transform/write/traverseFields.d.ts.map +0 -1
  313. package/dist/transform/write/traverseFields.js +0 -428
  314. package/dist/transform/write/traverseFields.js.map +0 -1
  315. package/dist/transform/write/types.d.ts +0 -43
  316. package/dist/transform/write/types.d.ts.map +0 -1
  317. package/dist/transform/write/types.js +0 -3
  318. package/dist/transform/write/types.js.map +0 -1
  319. package/dist/update.d.ts +0 -3
  320. package/dist/update.d.ts.map +0 -1
  321. package/dist/update.js +0 -58
  322. package/dist/update.js.map +0 -1
  323. package/dist/updateGlobal.d.ts +0 -5
  324. package/dist/updateGlobal.d.ts.map +0 -1
  325. package/dist/updateGlobal.js +0 -28
  326. package/dist/updateGlobal.js.map +0 -1
  327. package/dist/updateGlobalVersion.d.ts +0 -5
  328. package/dist/updateGlobalVersion.d.ts.map +0 -1
  329. package/dist/updateGlobalVersion.js +0 -40
  330. package/dist/updateGlobalVersion.js.map +0 -1
  331. package/dist/updateVersion.d.ts +0 -5
  332. package/dist/updateVersion.d.ts.map +0 -1
  333. package/dist/updateVersion.js +0 -40
  334. package/dist/updateVersion.js.map +0 -1
  335. package/dist/upsertRow/deleteExistingArrayRows.d.ts +0 -10
  336. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +0 -1
  337. package/dist/upsertRow/deleteExistingArrayRows.js +0 -10
  338. package/dist/upsertRow/deleteExistingArrayRows.js.map +0 -1
  339. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +0 -14
  340. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +0 -1
  341. package/dist/upsertRow/deleteExistingRowsByPath.js +0 -33
  342. package/dist/upsertRow/deleteExistingRowsByPath.js.map +0 -1
  343. package/dist/upsertRow/index.d.ts +0 -4
  344. package/dist/upsertRow/index.d.ts.map +0 -1
  345. package/dist/upsertRow/index.js +0 -276
  346. package/dist/upsertRow/index.js.map +0 -1
  347. package/dist/upsertRow/insertArrays.d.ts +0 -13
  348. package/dist/upsertRow/insertArrays.d.ts.map +0 -1
  349. package/dist/upsertRow/insertArrays.js +0 -68
  350. package/dist/upsertRow/insertArrays.js.map +0 -1
  351. package/dist/upsertRow/types.d.ts +0 -27
  352. package/dist/upsertRow/types.d.ts.map +0 -1
  353. package/dist/upsertRow/types.js +0 -3
  354. package/dist/upsertRow/types.js.map +0 -1
  355. package/dist/utilities/appendPrefixToKeys.d.ts +0 -2
  356. package/dist/utilities/appendPrefixToKeys.d.ts.map +0 -1
  357. package/dist/utilities/appendPrefixToKeys.js +0 -6
  358. package/dist/utilities/appendPrefixToKeys.js.map +0 -1
  359. package/dist/utilities/createBlocksMap.d.ts +0 -5
  360. package/dist/utilities/createBlocksMap.d.ts.map +0 -1
  361. package/dist/utilities/createBlocksMap.js +0 -29
  362. package/dist/utilities/createBlocksMap.js.map +0 -1
  363. package/dist/utilities/createMigrationTable.d.ts +0 -3
  364. package/dist/utilities/createMigrationTable.d.ts.map +0 -1
  365. package/dist/utilities/createMigrationTable.js +0 -13
  366. package/dist/utilities/createMigrationTable.js.map +0 -1
  367. package/dist/utilities/createRelationshipMap.d.ts +0 -2
  368. package/dist/utilities/createRelationshipMap.d.ts.map +0 -1
  369. package/dist/utilities/createRelationshipMap.js +0 -19
  370. package/dist/utilities/createRelationshipMap.js.map +0 -1
  371. package/dist/utilities/hasLocalesTable.d.ts +0 -3
  372. package/dist/utilities/hasLocalesTable.d.ts.map +0 -1
  373. package/dist/utilities/hasLocalesTable.js +0 -11
  374. package/dist/utilities/hasLocalesTable.js.map +0 -1
  375. package/dist/utilities/isArrayOfRows.d.ts +0 -2
  376. package/dist/utilities/isArrayOfRows.d.ts.map +0 -1
  377. package/dist/utilities/isArrayOfRows.js +0 -5
  378. package/dist/utilities/isArrayOfRows.js.map +0 -1
  379. package/dist/utilities/migrationTableExists.d.ts +0 -3
  380. package/dist/utilities/migrationTableExists.d.ts.map +0 -1
  381. package/dist/utilities/migrationTableExists.js +0 -9
  382. package/dist/utilities/migrationTableExists.js.map +0 -1
  383. package/dist/utilities/parseError.d.ts +0 -5
  384. package/dist/utilities/parseError.d.ts.map +0 -1
  385. package/dist/utilities/parseError.js +0 -17
  386. package/dist/utilities/parseError.js.map +0 -1
  387. package/dist/utilities/pushDevSchema.d.ts +0 -9
  388. package/dist/utilities/pushDevSchema.d.ts.map +0 -1
  389. package/dist/utilities/pushDevSchema.js +0 -58
  390. package/dist/utilities/pushDevSchema.js.map +0 -1
  391. package/src/index.ts +0 -156
  392. /package/dist/{queries/createJSONQuery → createJSONQuery}/convertPathToJSONTraversal.d.ts +0 -0
  393. /package/dist/{queries/createJSONQuery → createJSONQuery}/convertPathToJSONTraversal.js +0 -0
  394. /package/dist/{queries/createJSONQuery → createJSONQuery}/formatJSONPathSegment.d.ts +0 -0
  395. /package/dist/{queries/createJSONQuery → createJSONQuery}/formatJSONPathSegment.js +0 -0
  396. /package/dist/{queries/createJSONQuery → createJSONQuery}/index.d.ts +0 -0
  397. /package/dist/{queries/createJSONQuery → createJSONQuery}/index.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/createGlobal.ts"],"sourcesContent":["import type { CreateGlobalArgs } from 'payload/database'\nimport type { PayloadRequest, TypeWithID } from 'payload/types'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { getTableName } from './schema/getTableName.js'\nimport { upsertRow } from './upsertRow/index.js'\n\nexport async function createGlobal<T extends TypeWithID>(\n this: PostgresAdapter,\n { slug, data, req = {} as PayloadRequest }: CreateGlobalArgs,\n): Promise<T> {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const globalConfig = this.payload.globals.config.find((config) => config.slug === slug)\n\n const result = await upsertRow<T>({\n adapter: this,\n data,\n db,\n fields: globalConfig.fields,\n operation: 'create',\n req,\n tableName: getTableName({\n adapter: this,\n config: globalConfig,\n }),\n })\n\n return result\n}\n"],"names":["getTableName","upsertRow","createGlobal","slug","data","req","db","sessions","transactionID","drizzle","globalConfig","payload","globals","config","find","result","adapter","fields","operation","tableName"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,YAAY,QAAQ,2BAA0B;AACvD,SAASC,SAAS,QAAQ,uBAAsB;AAEhD,OAAO,eAAeC,aAEpB,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,CAAC,CAAmB,EAAoB;IAE5D,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACF,IAAIG,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMC,eAAe,IAAI,CAACC,OAAO,CAACC,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAACD,SAAWA,OAAOV,IAAI,KAAKA;IAElF,MAAMY,SAAS,MAAMd,UAAa;QAChCe,SAAS,IAAI;QACbZ;QACAE;QACAW,QAAQP,aAAaO,MAAM;QAC3BC,WAAW;QACXb;QACAc,WAAWnB,aAAa;YACtBgB,SAAS,IAAI;YACbH,QAAQH;QACV;IACF;IAEA,OAAOK;AACT"}
@@ -1,6 +0,0 @@
1
- import type { TypeWithVersion } from 'payload/database';
2
- import type { TypeWithID } from 'payload/types';
3
- import { type CreateGlobalVersionArgs } from 'payload/database';
4
- import type { PostgresAdapter } from './types.js';
5
- export declare function createGlobalVersion<T extends TypeWithID>(this: PostgresAdapter, { autosave, globalSlug, req, versionData }: CreateGlobalVersionArgs): Promise<TypeWithVersion<T>>;
6
- //# sourceMappingURL=createGlobalVersion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createGlobalVersion.d.ts","sourceRoot":"","sources":["../src/createGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAKjD,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC5D,IAAI,EAAE,eAAe,EACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,GAA0B,EAAE,WAAW,EAAE,EAAE,uBAAuB,+BAmC3F"}
@@ -1,37 +0,0 @@
1
- import { sql } from 'drizzle-orm';
2
- import { buildVersionGlobalFields } from 'payload/versions';
3
- import { getTableName } from './schema/getTableName.js';
4
- import { upsertRow } from './upsertRow/index.js';
5
- export async function createGlobalVersion({ autosave, globalSlug, req = {}, versionData }) {
6
- const db = this.sessions[req.transactionID]?.db || this.drizzle;
7
- const global = this.payload.globals.config.find(({ slug })=>slug === globalSlug);
8
- const tableName = getTableName({
9
- adapter: this,
10
- config: global,
11
- versions: true
12
- });
13
- const result = await upsertRow({
14
- adapter: this,
15
- data: {
16
- autosave,
17
- latest: true,
18
- version: versionData
19
- },
20
- db,
21
- fields: buildVersionGlobalFields(global),
22
- operation: 'create',
23
- req,
24
- tableName
25
- });
26
- const table = this.tables[tableName];
27
- if (global.versions.drafts) {
28
- await db.execute(sql`
29
- UPDATE ${table}
30
- SET latest = false
31
- WHERE ${table.id} != ${result.id};
32
- `);
33
- }
34
- return result;
35
- }
36
-
37
- //# sourceMappingURL=createGlobalVersion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/createGlobalVersion.ts"],"sourcesContent":["import type { TypeWithVersion } from 'payload/database'\nimport type { PayloadRequest, TypeWithID } from 'payload/types'\n\nimport { sql } from 'drizzle-orm'\nimport { type CreateGlobalVersionArgs } from 'payload/database'\nimport { buildVersionGlobalFields } from 'payload/versions'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { getTableName } from './schema/getTableName.js'\nimport { upsertRow } from './upsertRow/index.js'\n\nexport async function createGlobalVersion<T extends TypeWithID>(\n this: PostgresAdapter,\n { autosave, globalSlug, req = {} as PayloadRequest, versionData }: CreateGlobalVersionArgs,\n) {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const global = this.payload.globals.config.find(({ slug }) => slug === globalSlug)\n const tableName = getTableName({\n adapter: this,\n config: global,\n versions: true,\n })\n\n const result = await upsertRow<TypeWithVersion<T>>({\n adapter: this,\n data: {\n autosave,\n latest: true,\n version: versionData,\n },\n db,\n fields: buildVersionGlobalFields(global),\n operation: 'create',\n req,\n tableName,\n })\n\n const table = this.tables[tableName]\n\n if (global.versions.drafts) {\n await db.execute(sql`\n UPDATE ${table}\n SET latest = false\n WHERE ${table.id} != ${result.id};\n `)\n }\n\n return result\n}\n"],"names":["sql","buildVersionGlobalFields","getTableName","upsertRow","createGlobalVersion","autosave","globalSlug","req","versionData","db","sessions","transactionID","drizzle","global","payload","globals","config","find","slug","tableName","adapter","versions","result","data","latest","version","fields","operation","table","tables","drafts","execute","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,GAAG,QAAQ,cAAa;AAEjC,SAASC,wBAAwB,QAAQ,mBAAkB;AAI3D,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,SAAS,QAAQ,uBAAsB;AAEhD,OAAO,eAAeC,oBAEpB,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,CAAC,CAAmB,EAAEC,WAAW,EAA2B;IAE1F,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACH,IAAII,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMC,SAAS,IAAI,CAACC,OAAO,CAACC,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA,SAASZ;IACvE,MAAMa,YAAYjB,aAAa;QAC7BkB,SAAS,IAAI;QACbJ,QAAQH;QACRQ,UAAU;IACZ;IAEA,MAAMC,SAAS,MAAMnB,UAA8B;QACjDiB,SAAS,IAAI;QACbG,MAAM;YACJlB;YACAmB,QAAQ;YACRC,SAASjB;QACX;QACAC;QACAiB,QAAQzB,yBAAyBY;QACjCc,WAAW;QACXpB;QACAY;IACF;IAEA,MAAMS,QAAQ,IAAI,CAACC,MAAM,CAACV,UAAU;IAEpC,IAAIN,OAAOQ,QAAQ,CAACS,MAAM,EAAE;QAC1B,MAAMrB,GAAGsB,OAAO,CAAC/B,GAAG,CAAC;aACZ,EAAE4B,MAAM;;YAET,EAAEA,MAAMI,EAAE,CAAC,IAAI,EAAEV,OAAOU,EAAE,CAAC;IACnC,CAAC;IACH;IAEA,OAAOV;AACT"}
@@ -1,5 +0,0 @@
1
- import type { CreateVersionArgs, TypeWithVersion } from 'payload/database';
2
- import type { TypeWithID } from 'payload/types';
3
- import type { PostgresAdapter } from './types.js';
4
- export declare function createVersion<T extends TypeWithID>(this: PostgresAdapter, { autosave, collectionSlug, parent, req, versionData, }: CreateVersionArgs<T>): Promise<TypeWithVersion<T>>;
5
- //# sourceMappingURL=createVersion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createVersion.d.ts","sourceRoot":"","sources":["../src/createVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAKjD,wBAAsB,aAAa,CAAC,CAAC,SAAS,UAAU,EACtD,IAAI,EAAE,eAAe,EACrB,EACE,QAAQ,EACR,cAAc,EACd,MAAM,EACN,GAA0B,EAC1B,WAAW,GACZ,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAiDxB"}
@@ -1,48 +0,0 @@
1
- import { sql } from 'drizzle-orm';
2
- import { buildVersionCollectionFields } from 'payload/versions';
3
- import { getTableName } from './schema/getTableName.js';
4
- import { upsertRow } from './upsertRow/index.js';
5
- export async function createVersion({ autosave, collectionSlug, parent, req = {}, versionData }) {
6
- const db = this.sessions[req.transactionID]?.db || this.drizzle;
7
- const collection = this.payload.collections[collectionSlug].config;
8
- const tableName = getTableName({
9
- adapter: this,
10
- config: collection,
11
- versions: true
12
- });
13
- const result = await upsertRow({
14
- adapter: this,
15
- data: {
16
- autosave,
17
- latest: true,
18
- parent,
19
- version: versionData
20
- },
21
- db,
22
- fields: buildVersionCollectionFields(collection),
23
- operation: 'create',
24
- req,
25
- tableName
26
- });
27
- const table = this.tables[tableName];
28
- const relationshipsTable = this.tables[getTableName({
29
- adapter: this,
30
- config: collection,
31
- relationships: true,
32
- versions: true
33
- })];
34
- if (collection.versions.drafts) {
35
- await db.execute(sql`
36
- UPDATE ${table}
37
- SET latest = false
38
- FROM ${relationshipsTable}
39
- WHERE ${table.id} = ${relationshipsTable.parent}
40
- AND ${relationshipsTable.path} = ${'parent'}
41
- AND ${relationshipsTable[`${collectionSlug}ID`]} = ${parent}
42
- AND ${table.id} != ${result.id};
43
- `);
44
- }
45
- return result;
46
- }
47
-
48
- //# sourceMappingURL=createVersion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/createVersion.ts"],"sourcesContent":["import type { CreateVersionArgs, TypeWithVersion } from 'payload/database'\nimport type { PayloadRequest, TypeWithID } from 'payload/types'\n\nimport { sql } from 'drizzle-orm'\nimport { buildVersionCollectionFields } from 'payload/versions'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { getTableName } from './schema/getTableName.js'\nimport { upsertRow } from './upsertRow/index.js'\n\nexport async function createVersion<T extends TypeWithID>(\n this: PostgresAdapter,\n {\n autosave,\n collectionSlug,\n parent,\n req = {} as PayloadRequest,\n versionData,\n }: CreateVersionArgs<T>,\n) {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const collection = this.payload.collections[collectionSlug].config\n const tableName = getTableName({\n adapter: this,\n config: collection,\n versions: true,\n })\n\n const result = await upsertRow<TypeWithVersion<T>>({\n adapter: this,\n data: {\n autosave,\n latest: true,\n parent,\n version: versionData,\n },\n db,\n fields: buildVersionCollectionFields(collection),\n operation: 'create',\n req,\n tableName,\n })\n\n const table = this.tables[tableName]\n const relationshipsTable =\n this.tables[\n getTableName({\n adapter: this,\n config: collection,\n relationships: true,\n versions: true,\n })\n ]\n\n if (collection.versions.drafts) {\n await db.execute(sql`\n UPDATE ${table}\n SET latest = false\n FROM ${relationshipsTable}\n WHERE ${table.id} = ${relationshipsTable.parent}\n AND ${relationshipsTable.path} = ${'parent'}\n AND ${relationshipsTable[`${collectionSlug}ID`]} = ${parent}\n AND ${table.id} != ${result.id};\n `)\n }\n\n return result\n}\n"],"names":["sql","buildVersionCollectionFields","getTableName","upsertRow","createVersion","autosave","collectionSlug","parent","req","versionData","db","sessions","transactionID","drizzle","collection","payload","collections","config","tableName","adapter","versions","result","data","latest","version","fields","operation","table","tables","relationshipsTable","relationships","drafts","execute","id","path"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,GAAG,QAAQ,cAAa;AACjC,SAASC,4BAA4B,QAAQ,mBAAkB;AAI/D,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,SAAS,QAAQ,uBAAsB;AAEhD,OAAO,eAAeC,cAEpB,EACEC,QAAQ,EACRC,cAAc,EACdC,MAAM,EACNC,MAAM,CAAC,CAAmB,EAC1BC,WAAW,EACU;IAEvB,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACH,IAAII,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMC,aAAa,IAAI,CAACC,OAAO,CAACC,WAAW,CAACV,eAAe,CAACW,MAAM;IAClE,MAAMC,YAAYhB,aAAa;QAC7BiB,SAAS,IAAI;QACbF,QAAQH;QACRM,UAAU;IACZ;IAEA,MAAMC,SAAS,MAAMlB,UAA8B;QACjDgB,SAAS,IAAI;QACbG,MAAM;YACJjB;YACAkB,QAAQ;YACRhB;YACAiB,SAASf;QACX;QACAC;QACAe,QAAQxB,6BAA6Ba;QACrCY,WAAW;QACXlB;QACAU;IACF;IAEA,MAAMS,QAAQ,IAAI,CAACC,MAAM,CAACV,UAAU;IACpC,MAAMW,qBACJ,IAAI,CAACD,MAAM,CACT1B,aAAa;QACXiB,SAAS,IAAI;QACbF,QAAQH;QACRgB,eAAe;QACfV,UAAU;IACZ,GACD;IAEH,IAAIN,WAAWM,QAAQ,CAACW,MAAM,EAAE;QAC9B,MAAMrB,GAAGsB,OAAO,CAAChC,GAAG,CAAC;aACZ,EAAE2B,MAAM;;WAEV,EAAEE,mBAAmB;YACpB,EAAEF,MAAMM,EAAE,CAAC,GAAG,EAAEJ,mBAAmBtB,MAAM,CAAC;YAC1C,EAAEsB,mBAAmBK,IAAI,CAAC,GAAG,EAAE,SAAS;YACxC,EAAEL,kBAAkB,CAAC,CAAC,EAAEvB,eAAe,EAAE,CAAC,CAAC,CAAC,GAAG,EAAEC,OAAO;YACxD,EAAEoB,MAAMM,EAAE,CAAC,IAAI,EAAEZ,OAAOY,EAAE,CAAC;IACnC,CAAC;IACH;IAEA,OAAOZ;AACT"}
@@ -1,3 +0,0 @@
1
- import type { DeleteMany } from 'payload/database';
2
- export declare const deleteMany: DeleteMany;
3
- //# sourceMappingURL=deleteMany.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteMany.d.ts","sourceRoot":"","sources":["../src/deleteMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAUlD,eAAO,MAAM,UAAU,EAAE,UA6BxB,CAAA"}
@@ -1,31 +0,0 @@
1
- import { inArray } from 'drizzle-orm';
2
- import { findMany } from './find/findMany.js';
3
- import { getTableName } from './schema/getTableName.js';
4
- export const deleteMany = async function deleteMany({ collection, req = {}, where }) {
5
- const db = this.sessions[req.transactionID]?.db || this.drizzle;
6
- const collectionConfig = this.payload.collections[collection].config;
7
- const tableName = getTableName({
8
- adapter: this,
9
- config: collectionConfig
10
- });
11
- const result = await findMany({
12
- adapter: this,
13
- fields: collectionConfig.fields,
14
- limit: 0,
15
- locale: req.locale,
16
- page: 1,
17
- pagination: false,
18
- req,
19
- tableName,
20
- where
21
- });
22
- const ids = [];
23
- result.docs.forEach((data)=>{
24
- ids.push(data.id);
25
- });
26
- if (ids.length > 0) {
27
- await db.delete(this.tables[tableName]).where(inArray(this.tables[tableName].id, ids));
28
- }
29
- };
30
-
31
- //# sourceMappingURL=deleteMany.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deleteMany.ts"],"sourcesContent":["import type { DeleteMany } from 'payload/database'\nimport type { PayloadRequest } from 'payload/types'\n\nimport { inArray } from 'drizzle-orm'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { findMany } from './find/findMany.js'\nimport { getTableName } from './schema/getTableName.js'\n\nexport const deleteMany: DeleteMany = async function deleteMany(\n this: PostgresAdapter,\n { collection, req = {} as PayloadRequest, where },\n) {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const collectionConfig = this.payload.collections[collection].config\n const tableName = getTableName({ adapter: this, config: collectionConfig })\n\n const result = await findMany({\n adapter: this,\n fields: collectionConfig.fields,\n limit: 0,\n locale: req.locale,\n page: 1,\n pagination: false,\n req,\n tableName,\n where,\n })\n\n const ids = []\n\n result.docs.forEach((data) => {\n ids.push(data.id)\n })\n\n if (ids.length > 0) {\n await db.delete(this.tables[tableName]).where(inArray(this.tables[tableName].id, ids))\n }\n}\n"],"names":["inArray","findMany","getTableName","deleteMany","collection","req","where","db","sessions","transactionID","drizzle","collectionConfig","payload","collections","config","tableName","adapter","result","fields","limit","locale","page","pagination","ids","docs","forEach","data","push","id","length","delete","tables"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,OAAO,QAAQ,cAAa;AAIrC,SAASC,QAAQ,QAAQ,qBAAoB;AAC7C,SAASC,YAAY,QAAQ,2BAA0B;AAEvD,OAAO,MAAMC,aAAyB,eAAeA,WAEnD,EAAEC,UAAU,EAAEC,MAAM,CAAC,CAAmB,EAAEC,KAAK,EAAE;IAEjD,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACH,IAAII,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMC,mBAAmB,IAAI,CAACC,OAAO,CAACC,WAAW,CAACT,WAAW,CAACU,MAAM;IACpE,MAAMC,YAAYb,aAAa;QAAEc,SAAS,IAAI;QAAEF,QAAQH;IAAiB;IAEzE,MAAMM,SAAS,MAAMhB,SAAS;QAC5Be,SAAS,IAAI;QACbE,QAAQP,iBAAiBO,MAAM;QAC/BC,OAAO;QACPC,QAAQf,IAAIe,MAAM;QAClBC,MAAM;QACNC,YAAY;QACZjB;QACAU;QACAT;IACF;IAEA,MAAMiB,MAAM,EAAE;IAEdN,OAAOO,IAAI,CAACC,OAAO,CAAC,CAACC;QACnBH,IAAII,IAAI,CAACD,KAAKE,EAAE;IAClB;IAEA,IAAIL,IAAIM,MAAM,GAAG,GAAG;QAClB,MAAMtB,GAAGuB,MAAM,CAAC,IAAI,CAACC,MAAM,CAAChB,UAAU,EAAET,KAAK,CAACN,QAAQ,IAAI,CAAC+B,MAAM,CAAChB,UAAU,CAACa,EAAE,EAAEL;IACnF;AACF,EAAC"}
@@ -1,3 +0,0 @@
1
- import type { DeleteOne } from 'payload/database';
2
- export declare const deleteOne: DeleteOne;
3
- //# sourceMappingURL=deleteOne.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../src/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAajD,eAAO,MAAM,SAAS,EAAE,SAyDvB,CAAA"}
package/dist/deleteOne.js DELETED
@@ -1,62 +0,0 @@
1
- import { eq } from 'drizzle-orm';
2
- import { buildFindManyArgs } from './find/buildFindManyArgs.js';
3
- import buildQuery from './queries/buildQuery.js';
4
- import { selectDistinct } from './queries/selectDistinct.js';
5
- import { getTableName } from './schema/getTableName.js';
6
- import { transform } from './transform/read/index.js';
7
- export const deleteOne = async function deleteOne({ collection: collectionSlug, req = {}, where: whereArg }) {
8
- const db = this.sessions[req.transactionID]?.db || this.drizzle;
9
- const collection = this.payload.collections[collectionSlug].config;
10
- const tableName = getTableName({
11
- adapter: this,
12
- config: collection
13
- });
14
- let docToDelete;
15
- const { joinAliases, joins, selectFields, where } = await buildQuery({
16
- adapter: this,
17
- fields: collection.fields,
18
- locale: req.locale,
19
- tableName,
20
- where: whereArg
21
- });
22
- const selectDistinctResult = await selectDistinct({
23
- adapter: this,
24
- chainedMethods: [
25
- {
26
- args: [
27
- 1
28
- ],
29
- method: 'limit'
30
- }
31
- ],
32
- db,
33
- joinAliases,
34
- joins,
35
- selectFields,
36
- tableName,
37
- where
38
- });
39
- if (selectDistinctResult?.[0]?.id) {
40
- docToDelete = await db.query[tableName].findFirst({
41
- where: eq(this.tables[tableName].id, selectDistinctResult[0].id)
42
- });
43
- } else {
44
- const findManyArgs = buildFindManyArgs({
45
- adapter: this,
46
- depth: 0,
47
- fields: collection.fields,
48
- tableName
49
- });
50
- findManyArgs.where = where;
51
- docToDelete = await db.query[tableName].findFirst(findManyArgs);
52
- }
53
- const result = transform({
54
- config: this.payload.config,
55
- data: docToDelete,
56
- fields: collection.fields
57
- });
58
- await db.delete(this.tables[tableName]).where(eq(this.tables[tableName].id, docToDelete.id));
59
- return result;
60
- };
61
-
62
- //# sourceMappingURL=deleteOne.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deleteOne.ts"],"sourcesContent":["import type { DeleteOne } from 'payload/database'\nimport type { PayloadRequest } from 'payload/types'\n\nimport { eq } from 'drizzle-orm'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { buildFindManyArgs } from './find/buildFindManyArgs.js'\nimport buildQuery from './queries/buildQuery.js'\nimport { selectDistinct } from './queries/selectDistinct.js'\nimport { getTableName } from './schema/getTableName.js'\nimport { transform } from './transform/read/index.js'\n\nexport const deleteOne: DeleteOne = async function deleteOne(\n this: PostgresAdapter,\n { collection: collectionSlug, req = {} as PayloadRequest, where: whereArg },\n) {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const collection = this.payload.collections[collectionSlug].config\n const tableName = getTableName({\n adapter: this,\n config: collection,\n })\n let docToDelete: Record<string, unknown>\n\n const { joinAliases, joins, selectFields, where } = await buildQuery({\n adapter: this,\n fields: collection.fields,\n locale: req.locale,\n tableName,\n where: whereArg,\n })\n\n const selectDistinctResult = await selectDistinct({\n adapter: this,\n chainedMethods: [{ args: [1], method: 'limit' }],\n db,\n joinAliases,\n joins,\n selectFields,\n tableName,\n where,\n })\n\n if (selectDistinctResult?.[0]?.id) {\n docToDelete = await db.query[tableName].findFirst({\n where: eq(this.tables[tableName].id, selectDistinctResult[0].id),\n })\n } else {\n const findManyArgs = buildFindManyArgs({\n adapter: this,\n depth: 0,\n fields: collection.fields,\n tableName,\n })\n\n findManyArgs.where = where\n\n docToDelete = await db.query[tableName].findFirst(findManyArgs)\n }\n\n const result = transform({\n config: this.payload.config,\n data: docToDelete,\n fields: collection.fields,\n })\n\n await db.delete(this.tables[tableName]).where(eq(this.tables[tableName].id, docToDelete.id))\n\n return result\n}\n"],"names":["eq","buildFindManyArgs","buildQuery","selectDistinct","getTableName","transform","deleteOne","collection","collectionSlug","req","where","whereArg","db","sessions","transactionID","drizzle","payload","collections","config","tableName","adapter","docToDelete","joinAliases","joins","selectFields","fields","locale","selectDistinctResult","chainedMethods","args","method","id","query","findFirst","tables","findManyArgs","depth","result","data","delete"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,EAAE,QAAQ,cAAa;AAIhC,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,OAAOC,gBAAgB,0BAAyB;AAChD,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,SAAS,QAAQ,4BAA2B;AAErD,OAAO,MAAMC,YAAuB,eAAeA,UAEjD,EAAEC,YAAYC,cAAc,EAAEC,MAAM,CAAC,CAAmB,EAAEC,OAAOC,QAAQ,EAAE;IAE3E,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACJ,IAAIK,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMR,aAAa,IAAI,CAACS,OAAO,CAACC,WAAW,CAACT,eAAe,CAACU,MAAM;IAClE,MAAMC,YAAYf,aAAa;QAC7BgB,SAAS,IAAI;QACbF,QAAQX;IACV;IACA,IAAIc;IAEJ,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,YAAY,EAAEd,KAAK,EAAE,GAAG,MAAMR,WAAW;QACnEkB,SAAS,IAAI;QACbK,QAAQlB,WAAWkB,MAAM;QACzBC,QAAQjB,IAAIiB,MAAM;QAClBP;QACAT,OAAOC;IACT;IAEA,MAAMgB,uBAAuB,MAAMxB,eAAe;QAChDiB,SAAS,IAAI;QACbQ,gBAAgB;YAAC;gBAAEC,MAAM;oBAAC;iBAAE;gBAAEC,QAAQ;YAAQ;SAAE;QAChDlB;QACAU;QACAC;QACAC;QACAL;QACAT;IACF;IAEA,IAAIiB,sBAAsB,CAAC,EAAE,EAAEI,IAAI;QACjCV,cAAc,MAAMT,GAAGoB,KAAK,CAACb,UAAU,CAACc,SAAS,CAAC;YAChDvB,OAAOV,GAAG,IAAI,CAACkC,MAAM,CAACf,UAAU,CAACY,EAAE,EAAEJ,oBAAoB,CAAC,EAAE,CAACI,EAAE;QACjE;IACF,OAAO;QACL,MAAMI,eAAelC,kBAAkB;YACrCmB,SAAS,IAAI;YACbgB,OAAO;YACPX,QAAQlB,WAAWkB,MAAM;YACzBN;QACF;QAEAgB,aAAazB,KAAK,GAAGA;QAErBW,cAAc,MAAMT,GAAGoB,KAAK,CAACb,UAAU,CAACc,SAAS,CAACE;IACpD;IAEA,MAAME,SAAShC,UAAU;QACvBa,QAAQ,IAAI,CAACF,OAAO,CAACE,MAAM;QAC3BoB,MAAMjB;QACNI,QAAQlB,WAAWkB,MAAM;IAC3B;IAEA,MAAMb,GAAG2B,MAAM,CAAC,IAAI,CAACL,MAAM,CAACf,UAAU,EAAET,KAAK,CAACV,GAAG,IAAI,CAACkC,MAAM,CAACf,UAAU,CAACY,EAAE,EAAEV,YAAYU,EAAE;IAE1F,OAAOM;AACT,EAAC"}
@@ -1,3 +0,0 @@
1
- import type { DeleteVersions } from 'payload/database';
2
- export declare const deleteVersions: DeleteVersions;
3
- //# sourceMappingURL=deleteVersions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteVersions.d.ts","sourceRoot":"","sources":["../src/deleteVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAWtD,eAAO,MAAM,cAAc,EAAE,cAqC5B,CAAA"}
@@ -1,35 +0,0 @@
1
- import { inArray } from 'drizzle-orm';
2
- import { buildVersionCollectionFields } from 'payload/versions';
3
- import { findMany } from './find/findMany.js';
4
- import { getTableName } from './schema/getTableName.js';
5
- export const deleteVersions = async function deleteVersion({ collection, locale, req = {}, where: where }) {
6
- const db = this.sessions[req.transactionID]?.db || this.drizzle;
7
- const collectionConfig = this.payload.collections[collection].config;
8
- const tableName = getTableName({
9
- adapter: this,
10
- config: collectionConfig,
11
- versions: true
12
- });
13
- const fields = buildVersionCollectionFields(collectionConfig);
14
- const { docs } = await findMany({
15
- adapter: this,
16
- fields,
17
- limit: 0,
18
- locale,
19
- page: 1,
20
- pagination: false,
21
- req,
22
- tableName,
23
- where
24
- });
25
- const ids = [];
26
- docs.forEach((doc)=>{
27
- ids.push(doc.id);
28
- });
29
- if (ids.length > 0) {
30
- await db.delete(this.tables[tableName]).where(inArray(this.tables[tableName].id, ids));
31
- }
32
- return docs;
33
- };
34
-
35
- //# sourceMappingURL=deleteVersions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/deleteVersions.ts"],"sourcesContent":["import type { DeleteVersions } from 'payload/database'\nimport type { PayloadRequest, SanitizedCollectionConfig } from 'payload/types'\n\nimport { inArray } from 'drizzle-orm'\nimport { buildVersionCollectionFields } from 'payload/versions'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { findMany } from './find/findMany.js'\nimport { getTableName } from './schema/getTableName.js'\n\nexport const deleteVersions: DeleteVersions = async function deleteVersion(\n this: PostgresAdapter,\n { collection, locale, req = {} as PayloadRequest, where: where },\n) {\n const db = this.sessions[req.transactionID]?.db || this.drizzle\n const collectionConfig: SanitizedCollectionConfig = this.payload.collections[collection].config\n\n const tableName = getTableName({\n adapter: this,\n config: collectionConfig,\n versions: true,\n })\n const fields = buildVersionCollectionFields(collectionConfig)\n\n const { docs } = await findMany({\n adapter: this,\n fields,\n limit: 0,\n locale,\n page: 1,\n pagination: false,\n req,\n tableName,\n where,\n })\n\n const ids = []\n\n docs.forEach((doc) => {\n ids.push(doc.id)\n })\n\n if (ids.length > 0) {\n await db.delete(this.tables[tableName]).where(inArray(this.tables[tableName].id, ids))\n }\n\n return docs\n}\n"],"names":["inArray","buildVersionCollectionFields","findMany","getTableName","deleteVersions","deleteVersion","collection","locale","req","where","db","sessions","transactionID","drizzle","collectionConfig","payload","collections","config","tableName","adapter","versions","fields","docs","limit","page","pagination","ids","forEach","doc","push","id","length","delete","tables"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,OAAO,QAAQ,cAAa;AACrC,SAASC,4BAA4B,QAAQ,mBAAkB;AAI/D,SAASC,QAAQ,QAAQ,qBAAoB;AAC7C,SAASC,YAAY,QAAQ,2BAA0B;AAEvD,OAAO,MAAMC,iBAAiC,eAAeC,cAE3D,EAAEC,UAAU,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAAmB,EAAEC,OAAOA,KAAK,EAAE;IAEhE,MAAMC,KAAK,IAAI,CAACC,QAAQ,CAACH,IAAII,aAAa,CAAC,EAAEF,MAAM,IAAI,CAACG,OAAO;IAC/D,MAAMC,mBAA8C,IAAI,CAACC,OAAO,CAACC,WAAW,CAACV,WAAW,CAACW,MAAM;IAE/F,MAAMC,YAAYf,aAAa;QAC7BgB,SAAS,IAAI;QACbF,QAAQH;QACRM,UAAU;IACZ;IACA,MAAMC,SAASpB,6BAA6Ba;IAE5C,MAAM,EAAEQ,IAAI,EAAE,GAAG,MAAMpB,SAAS;QAC9BiB,SAAS,IAAI;QACbE;QACAE,OAAO;QACPhB;QACAiB,MAAM;QACNC,YAAY;QACZjB;QACAU;QACAT;IACF;IAEA,MAAMiB,MAAM,EAAE;IAEdJ,KAAKK,OAAO,CAAC,CAACC;QACZF,IAAIG,IAAI,CAACD,IAAIE,EAAE;IACjB;IAEA,IAAIJ,IAAIK,MAAM,GAAG,GAAG;QAClB,MAAMrB,GAAGsB,MAAM,CAAC,IAAI,CAACC,MAAM,CAACf,UAAU,EAAET,KAAK,CAACT,QAAQ,IAAI,CAACiC,MAAM,CAACf,UAAU,CAACY,EAAE,EAAEJ;IACnF;IAEA,OAAOJ;AACT,EAAC"}
package/dist/destroy.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Destroy } from 'payload/database';
2
- export declare const destroy: Destroy;
3
- //# sourceMappingURL=destroy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../src/destroy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAM/C,eAAO,MAAM,OAAO,EAAE,OAOrB,CAAA"}
package/dist/destroy.js DELETED
@@ -1,11 +0,0 @@
1
- import { pushDevSchema } from './utilities/pushDevSchema.js';
2
- export const destroy = async function destroy() {
3
- if (process.env.NODE_ENV !== 'production') {
4
- await pushDevSchema(this);
5
- } else {
6
- // TODO: this hangs test suite for some reason
7
- // await this.pool.end()
8
- }
9
- };
10
-
11
- //# sourceMappingURL=destroy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/destroy.ts"],"sourcesContent":["import type { Destroy } from 'payload/database'\n\nimport type { PostgresAdapter } from './types.js'\n\nimport { pushDevSchema } from './utilities/pushDevSchema.js'\n\nexport const destroy: Destroy = async function destroy(this: PostgresAdapter) {\n if (process.env.NODE_ENV !== 'production') {\n await pushDevSchema(this)\n } else {\n // TODO: this hangs test suite for some reason\n // await this.pool.end()\n }\n}\n"],"names":["pushDevSchema","destroy","process","env","NODE_ENV"],"rangeMappings":";;;;;;;;","mappings":"AAIA,SAASA,aAAa,QAAQ,+BAA8B;AAE5D,OAAO,MAAMC,UAAmB,eAAeA;IAC7C,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,MAAMJ,cAAc,IAAI;IAC1B,OAAO;IACL,8CAA8C;IAC9C,wBAAwB;IAC1B;AACF,EAAC"}
@@ -1,13 +0,0 @@
1
- import type { DBQueryConfig } from 'drizzle-orm';
2
- import type { Field } from 'payload/types';
3
- import type { PostgresAdapter } from '../types.js';
4
- type BuildFindQueryArgs = {
5
- adapter: PostgresAdapter;
6
- depth: number;
7
- fields: Field[];
8
- tableName: string;
9
- };
10
- export type Result = DBQueryConfig<'many', true, any, any>;
11
- export declare const buildFindManyArgs: ({ adapter, depth, fields, tableName, }: BuildFindQueryArgs) => Record<string, unknown>;
12
- export {};
13
- //# sourceMappingURL=buildFindManyArgs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"buildFindManyArgs.d.ts","sourceRoot":"","sources":["../../src/find/buildFindManyArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAI1D,eAAO,MAAM,iBAAiB,2CAK3B,kBAAkB,KAAG,OAAO,MAAM,EAAE,OAAO,CA2D7C,CAAA"}
@@ -1,64 +0,0 @@
1
- import { traverseFields } from './traverseFields.js';
2
- // Generate the Drizzle query for findMany based on
3
- // a collection field structure
4
- export const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
5
- const result = {
6
- with: {}
7
- };
8
- const _locales = {
9
- columns: {
10
- id: false,
11
- _parentID: false
12
- }
13
- };
14
- if (adapter.tables[`${tableName}_texts`]) {
15
- result.with._texts = {
16
- columns: {
17
- id: false,
18
- parent: false
19
- },
20
- orderBy: ({ order }, { asc: ASC })=>[
21
- ASC(order)
22
- ]
23
- };
24
- }
25
- if (adapter.tables[`${tableName}_numbers`]) {
26
- result.with._numbers = {
27
- columns: {
28
- id: false,
29
- parent: false
30
- },
31
- orderBy: ({ order }, { asc: ASC })=>[
32
- ASC(order)
33
- ]
34
- };
35
- }
36
- if (adapter.tables[`${tableName}_rels`]) {
37
- result.with._rels = {
38
- columns: {
39
- id: false,
40
- parent: false
41
- },
42
- orderBy: ({ order }, { asc: ASC })=>[
43
- ASC(order)
44
- ]
45
- };
46
- }
47
- if (adapter.tables[`${tableName}_locales`]) {
48
- result.with._locales = _locales;
49
- }
50
- traverseFields({
51
- _locales,
52
- adapter,
53
- currentArgs: result,
54
- currentTableName: tableName,
55
- depth,
56
- fields,
57
- path: '',
58
- topLevelArgs: result,
59
- topLevelTableName: tableName
60
- });
61
- return result;
62
- };
63
-
64
- //# sourceMappingURL=buildFindManyArgs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/find/buildFindManyArgs.ts"],"sourcesContent":["import type { DBQueryConfig } from 'drizzle-orm'\nimport type { Field } from 'payload/types'\n\nimport type { PostgresAdapter } from '../types.js'\n\nimport { traverseFields } from './traverseFields.js'\n\ntype BuildFindQueryArgs = {\n adapter: PostgresAdapter\n depth: number\n fields: Field[]\n tableName: string\n}\n\nexport type Result = DBQueryConfig<'many', true, any, any>\n\n// Generate the Drizzle query for findMany based on\n// a collection field structure\nexport const buildFindManyArgs = ({\n adapter,\n depth,\n fields,\n tableName,\n}: BuildFindQueryArgs): Record<string, unknown> => {\n const result: Result = {\n with: {},\n }\n\n const _locales: Result = {\n columns: {\n id: false,\n _parentID: false,\n },\n }\n\n if (adapter.tables[`${tableName}_texts`]) {\n result.with._texts = {\n columns: {\n id: false,\n parent: false,\n },\n orderBy: ({ order }, { asc: ASC }) => [ASC(order)],\n }\n }\n\n if (adapter.tables[`${tableName}_numbers`]) {\n result.with._numbers = {\n columns: {\n id: false,\n parent: false,\n },\n orderBy: ({ order }, { asc: ASC }) => [ASC(order)],\n }\n }\n\n if (adapter.tables[`${tableName}_rels`]) {\n result.with._rels = {\n columns: {\n id: false,\n parent: false,\n },\n orderBy: ({ order }, { asc: ASC }) => [ASC(order)],\n }\n }\n\n if (adapter.tables[`${tableName}_locales`]) {\n result.with._locales = _locales\n }\n\n traverseFields({\n _locales,\n adapter,\n currentArgs: result,\n currentTableName: tableName,\n depth,\n fields,\n path: '',\n topLevelArgs: result,\n topLevelTableName: tableName,\n })\n\n return result\n}\n"],"names":["traverseFields","buildFindManyArgs","adapter","depth","fields","tableName","result","with","_locales","columns","id","_parentID","tables","_texts","parent","orderBy","order","asc","ASC","_numbers","_rels","currentArgs","currentTableName","path","topLevelArgs","topLevelTableName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,cAAc,QAAQ,sBAAqB;AAWpD,mDAAmD;AACnD,+BAA+B;AAC/B,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,OAAO,EACPC,KAAK,EACLC,MAAM,EACNC,SAAS,EACU;IACnB,MAAMC,SAAiB;QACrBC,MAAM,CAAC;IACT;IAEA,MAAMC,WAAmB;QACvBC,SAAS;YACPC,IAAI;YACJC,WAAW;QACb;IACF;IAEA,IAAIT,QAAQU,MAAM,CAAC,CAAC,EAAEP,UAAU,MAAM,CAAC,CAAC,EAAE;QACxCC,OAAOC,IAAI,CAACM,MAAM,GAAG;YACnBJ,SAAS;gBACPC,IAAI;gBACJI,QAAQ;YACV;YACAC,SAAS,CAAC,EAAEC,KAAK,EAAE,EAAE,EAAEC,KAAKC,GAAG,EAAE,GAAK;oBAACA,IAAIF;iBAAO;QACpD;IACF;IAEA,IAAId,QAAQU,MAAM,CAAC,CAAC,EAAEP,UAAU,QAAQ,CAAC,CAAC,EAAE;QAC1CC,OAAOC,IAAI,CAACY,QAAQ,GAAG;YACrBV,SAAS;gBACPC,IAAI;gBACJI,QAAQ;YACV;YACAC,SAAS,CAAC,EAAEC,KAAK,EAAE,EAAE,EAAEC,KAAKC,GAAG,EAAE,GAAK;oBAACA,IAAIF;iBAAO;QACpD;IACF;IAEA,IAAId,QAAQU,MAAM,CAAC,CAAC,EAAEP,UAAU,KAAK,CAAC,CAAC,EAAE;QACvCC,OAAOC,IAAI,CAACa,KAAK,GAAG;YAClBX,SAAS;gBACPC,IAAI;gBACJI,QAAQ;YACV;YACAC,SAAS,CAAC,EAAEC,KAAK,EAAE,EAAE,EAAEC,KAAKC,GAAG,EAAE,GAAK;oBAACA,IAAIF;iBAAO;QACpD;IACF;IAEA,IAAId,QAAQU,MAAM,CAAC,CAAC,EAAEP,UAAU,QAAQ,CAAC,CAAC,EAAE;QAC1CC,OAAOC,IAAI,CAACC,QAAQ,GAAGA;IACzB;IAEAR,eAAe;QACbQ;QACAN;QACAmB,aAAaf;QACbgB,kBAAkBjB;QAClBF;QACAC;QACAmB,MAAM;QACNC,cAAclB;QACdmB,mBAAmBpB;IACrB;IAEA,OAAOC;AACT,EAAC"}
@@ -1,16 +0,0 @@
1
- import type { QueryPromise } from 'drizzle-orm';
2
- export type ChainedMethods = {
3
- args: unknown[];
4
- method: string;
5
- }[];
6
- /**
7
- * Call and returning methods that would normally be chained together but cannot be because of control logic
8
- * @param methods
9
- * @param query
10
- */
11
- declare const chainMethods: <T>({ methods, query }: {
12
- methods: any;
13
- query: any;
14
- }) => QueryPromise<T>;
15
- export { chainMethods };
16
- //# sourceMappingURL=chainMethods.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chainMethods.d.ts","sourceRoot":"","sources":["../../src/find/chainMethods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,EAAE,CAAA;AAEH;;;;GAIG;AACH,QAAA,MAAM,YAAY;;;MAA4B,aAAa,CAAC,CAI3D,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Call and returning methods that would normally be chained together but cannot be because of control logic
3
- * @param methods
4
- * @param query
5
- */ const chainMethods = ({ methods, query })=>{
6
- return methods.reduce((query, { args, method })=>{
7
- return query[method](...args);
8
- }, query);
9
- };
10
- export { chainMethods };
11
-
12
- //# sourceMappingURL=chainMethods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/find/chainMethods.ts"],"sourcesContent":["import type { QueryPromise } from 'drizzle-orm'\n\nexport type ChainedMethods = {\n args: unknown[]\n method: string\n}[]\n\n/**\n * Call and returning methods that would normally be chained together but cannot be because of control logic\n * @param methods\n * @param query\n */\nconst chainMethods = <T>({ methods, query }): QueryPromise<T> => {\n return methods.reduce((query, { args, method }) => {\n return query[method](...args)\n }, query)\n}\n\nexport { chainMethods }\n"],"names":["chainMethods","methods","query","reduce","args","method"],"rangeMappings":";;;;;;;;;","mappings":"AAOA;;;;CAIC,GACD,MAAMA,eAAe,CAAI,EAAEC,OAAO,EAAEC,KAAK,EAAE;IACzC,OAAOD,QAAQE,MAAM,CAAC,CAACD,OAAO,EAAEE,IAAI,EAAEC,MAAM,EAAE;QAC5C,OAAOH,KAAK,CAACG,OAAO,IAAID;IAC1B,GAAGF;AACL;AAEA,SAASF,YAAY,GAAE"}
@@ -1,22 +0,0 @@
1
- import type { FindArgs } from 'payload/database';
2
- import type { Field } from 'payload/types';
3
- import type { PostgresAdapter } from '../types.js';
4
- type Args = Omit<FindArgs, 'collection'> & {
5
- adapter: PostgresAdapter;
6
- fields: Field[];
7
- tableName: string;
8
- };
9
- export declare const findMany: ({ adapter, fields, limit: limitArg, locale, page, pagination, req, skip, sort, tableName, where: whereArg, }: Args) => Promise<{
10
- docs: any;
11
- hasNextPage: boolean;
12
- hasPrevPage: boolean;
13
- limit: number;
14
- nextPage: number;
15
- page: number;
16
- pagingCounter: number;
17
- prevPage: number;
18
- totalDocs: number;
19
- totalPages: number;
20
- }>;
21
- export {};
22
- //# sourceMappingURL=findMany.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findMany.d.ts","sourceRoot":"","sources":["../../src/find/findMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAA;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AASlD,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG;IACzC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,QAAQ,iHAYlB,IAAI;;;;;;;;;;;EAgKN,CAAA"}