@payloadcms/db-postgres 3.0.0-canary.0d307b1 → 3.0.0-canary.12a836c

Sign up to get free protection for your applications and to get access to all the features.
Files changed (378) hide show
  1. package/dist/connect.d.ts.map +1 -1
  2. package/dist/connect.js +10 -6
  3. package/dist/connect.js.map +1 -1
  4. package/dist/countDistinct.d.ts +3 -0
  5. package/dist/countDistinct.d.ts.map +1 -0
  6. package/dist/countDistinct.js +24 -0
  7. package/dist/countDistinct.js.map +1 -0
  8. package/dist/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -0
  9. package/dist/createJSONQuery/convertPathToJSONTraversal.js.map +1 -0
  10. package/dist/createJSONQuery/formatJSONPathSegment.d.ts.map +1 -0
  11. package/dist/createJSONQuery/formatJSONPathSegment.js.map +1 -0
  12. package/dist/createJSONQuery/index.d.ts.map +1 -0
  13. package/dist/createJSONQuery/index.js.map +1 -0
  14. package/dist/createMigration.d.ts.map +1 -1
  15. package/dist/createMigration.js +20 -31
  16. package/dist/createMigration.js.map +1 -1
  17. package/dist/defaultSnapshot.d.ts +3 -0
  18. package/dist/defaultSnapshot.d.ts.map +1 -0
  19. package/dist/defaultSnapshot.js +17 -0
  20. package/dist/defaultSnapshot.js.map +1 -0
  21. package/dist/deleteWhere.d.ts +3 -0
  22. package/dist/deleteWhere.d.ts.map +1 -0
  23. package/dist/deleteWhere.js +6 -0
  24. package/dist/deleteWhere.js.map +1 -0
  25. package/dist/dropDatabase.d.ts +3 -0
  26. package/dist/dropDatabase.d.ts.map +1 -0
  27. package/dist/dropDatabase.js +9 -0
  28. package/dist/dropDatabase.js.map +1 -0
  29. package/dist/execute.d.ts +3 -0
  30. package/dist/execute.d.ts.map +1 -0
  31. package/dist/execute.js +11 -0
  32. package/dist/execute.js.map +1 -0
  33. package/dist/exports/migration-utils.js.map +1 -1
  34. package/dist/getMigrationTemplate.d.ts +4 -0
  35. package/dist/getMigrationTemplate.d.ts.map +1 -0
  36. package/dist/getMigrationTemplate.js +13 -0
  37. package/dist/getMigrationTemplate.js.map +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +39 -64
  40. package/dist/index.js.map +1 -1
  41. package/dist/init.d.ts.map +1 -1
  42. package/dist/init.js +14 -10
  43. package/dist/init.js.map +1 -1
  44. package/dist/insert.d.ts +3 -0
  45. package/dist/insert.d.ts.map +1 -0
  46. package/dist/insert.js +12 -0
  47. package/dist/insert.js.map +1 -0
  48. package/dist/predefinedMigrations/relationships-v2-v3.js.map +1 -1
  49. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +5 -4
  50. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
  51. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +1 -2
  52. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -1
  53. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -1
  54. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js.map +1 -1
  55. package/dist/predefinedMigrations/v2-v3/index.d.ts +2 -2
  56. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
  57. package/dist/predefinedMigrations/v2-v3/index.js +2 -2
  58. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -1
  59. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +5 -4
  60. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
  61. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -1
  62. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +3 -2
  63. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
  64. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -1
  65. package/dist/predefinedMigrations/v2-v3/types.js.map +1 -1
  66. package/dist/requireDrizzleKit.d.ts +3 -0
  67. package/dist/requireDrizzleKit.d.ts.map +1 -0
  68. package/dist/requireDrizzleKit.js +5 -0
  69. package/dist/requireDrizzleKit.js.map +1 -0
  70. package/dist/schema/build.d.ts +4 -0
  71. package/dist/schema/build.d.ts.map +1 -1
  72. package/dist/schema/build.js +2 -2
  73. package/dist/schema/build.js.map +1 -1
  74. package/dist/schema/createIndex.d.ts.map +1 -1
  75. package/dist/schema/createIndex.js +1 -1
  76. package/dist/schema/createIndex.js.map +1 -1
  77. package/dist/schema/idToUUID.js.map +1 -1
  78. package/dist/schema/parentIDColumnMap.js.map +1 -1
  79. package/dist/schema/setColumnID.js.map +1 -1
  80. package/dist/schema/traverseFields.d.ts.map +1 -1
  81. package/dist/schema/traverseFields.js +13 -14
  82. package/dist/schema/traverseFields.js.map +1 -1
  83. package/dist/schema/withDefault.d.ts +4 -0
  84. package/dist/schema/withDefault.d.ts.map +1 -0
  85. package/dist/schema/withDefault.js +10 -0
  86. package/dist/schema/withDefault.js.map +1 -0
  87. package/dist/types.d.ts +97 -35
  88. package/dist/types.d.ts.map +1 -1
  89. package/dist/types.js.map +1 -1
  90. package/package.json +10 -10
  91. package/dist/count.d.ts +0 -3
  92. package/dist/count.d.ts.map +0 -1
  93. package/dist/count.js +0 -41
  94. package/dist/count.js.map +0 -1
  95. package/dist/create.d.ts +0 -3
  96. package/dist/create.d.ts.map +0 -1
  97. package/dist/create.js +0 -19
  98. package/dist/create.js.map +0 -1
  99. package/dist/createGlobal.d.ts +0 -4
  100. package/dist/createGlobal.d.ts.map +0 -1
  101. package/dist/createGlobal.js +0 -19
  102. package/dist/createGlobal.js.map +0 -1
  103. package/dist/createGlobalVersion.d.ts +0 -5
  104. package/dist/createGlobalVersion.d.ts.map +0 -1
  105. package/dist/createGlobalVersion.js +0 -33
  106. package/dist/createGlobalVersion.js.map +0 -1
  107. package/dist/createVersion.d.ts +0 -4
  108. package/dist/createVersion.d.ts.map +0 -1
  109. package/dist/createVersion.js +0 -40
  110. package/dist/createVersion.js.map +0 -1
  111. package/dist/deleteMany.d.ts +0 -3
  112. package/dist/deleteMany.d.ts.map +0 -1
  113. package/dist/deleteMany.js +0 -28
  114. package/dist/deleteMany.js.map +0 -1
  115. package/dist/deleteOne.d.ts +0 -3
  116. package/dist/deleteOne.d.ts.map +0 -1
  117. package/dist/deleteOne.js +0 -59
  118. package/dist/deleteOne.js.map +0 -1
  119. package/dist/deleteVersions.d.ts +0 -3
  120. package/dist/deleteVersions.d.ts.map +0 -1
  121. package/dist/deleteVersions.js +0 -31
  122. package/dist/deleteVersions.js.map +0 -1
  123. package/dist/destroy.d.ts +0 -3
  124. package/dist/destroy.d.ts.map +0 -1
  125. package/dist/destroy.js +0 -15
  126. package/dist/destroy.js.map +0 -1
  127. package/dist/find/buildFindManyArgs.d.ts +0 -17
  128. package/dist/find/buildFindManyArgs.d.ts.map +0 -1
  129. package/dist/find/buildFindManyArgs.js +0 -65
  130. package/dist/find/buildFindManyArgs.js.map +0 -1
  131. package/dist/find/chainMethods.d.ts +0 -16
  132. package/dist/find/chainMethods.d.ts.map +0 -1
  133. package/dist/find/chainMethods.js +0 -12
  134. package/dist/find/chainMethods.js.map +0 -1
  135. package/dist/find/findMany.d.ts +0 -21
  136. package/dist/find/findMany.d.ts.map +0 -1
  137. package/dist/find/findMany.js +0 -152
  138. package/dist/find/findMany.js.map +0 -1
  139. package/dist/find/traverseFields.d.ts +0 -17
  140. package/dist/find/traverseFields.d.ts.map +0 -1
  141. package/dist/find/traverseFields.js +0 -156
  142. package/dist/find/traverseFields.js.map +0 -1
  143. package/dist/find.d.ts +0 -3
  144. package/dist/find.d.ts.map +0 -1
  145. package/dist/find.js +0 -21
  146. package/dist/find.js.map +0 -1
  147. package/dist/findGlobal.d.ts +0 -3
  148. package/dist/findGlobal.d.ts.map +0 -1
  149. package/dist/findGlobal.js +0 -23
  150. package/dist/findGlobal.js.map +0 -1
  151. package/dist/findGlobalVersions.d.ts +0 -3
  152. package/dist/findGlobalVersions.d.ts.map +0 -1
  153. package/dist/findGlobalVersions.js +0 -24
  154. package/dist/findGlobalVersions.js.map +0 -1
  155. package/dist/findOne.d.ts +0 -4
  156. package/dist/findOne.d.ts.map +0 -1
  157. package/dist/findOne.js +0 -21
  158. package/dist/findOne.js.map +0 -1
  159. package/dist/findVersions.d.ts +0 -3
  160. package/dist/findVersions.d.ts.map +0 -1
  161. package/dist/findVersions.js +0 -24
  162. package/dist/findVersions.js.map +0 -1
  163. package/dist/migrate.d.ts +0 -3
  164. package/dist/migrate.d.ts.map +0 -1
  165. package/dist/migrate.js +0 -99
  166. package/dist/migrate.js.map +0 -1
  167. package/dist/migrateDown.d.ts +0 -3
  168. package/dist/migrateDown.d.ts.map +0 -1
  169. package/dist/migrateDown.js +0 -63
  170. package/dist/migrateDown.js.map +0 -1
  171. package/dist/migrateFresh.d.ts +0 -8
  172. package/dist/migrateFresh.d.ts.map +0 -1
  173. package/dist/migrateFresh.js +0 -72
  174. package/dist/migrateFresh.js.map +0 -1
  175. package/dist/migrateRefresh.d.ts +0 -6
  176. package/dist/migrateRefresh.d.ts.map +0 -1
  177. package/dist/migrateRefresh.js +0 -102
  178. package/dist/migrateRefresh.js.map +0 -1
  179. package/dist/migrateReset.d.ts +0 -6
  180. package/dist/migrateReset.d.ts.map +0 -1
  181. package/dist/migrateReset.js +0 -82
  182. package/dist/migrateReset.js.map +0 -1
  183. package/dist/migrateStatus.d.ts +0 -3
  184. package/dist/migrateStatus.d.ts.map +0 -1
  185. package/dist/migrateStatus.js +0 -44
  186. package/dist/migrateStatus.js.map +0 -1
  187. package/dist/queries/buildAndOrConditions.d.ts +0 -16
  188. package/dist/queries/buildAndOrConditions.d.ts.map +0 -1
  189. package/dist/queries/buildAndOrConditions.js +0 -28
  190. package/dist/queries/buildAndOrConditions.js.map +0 -1
  191. package/dist/queries/buildQuery.d.ts +0 -30
  192. package/dist/queries/buildQuery.d.ts.map +0 -1
  193. package/dist/queries/buildQuery.js +0 -72
  194. package/dist/queries/buildQuery.js.map +0 -1
  195. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +0 -1
  196. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +0 -1
  197. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +0 -1
  198. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +0 -1
  199. package/dist/queries/createJSONQuery/index.d.ts.map +0 -1
  200. package/dist/queries/createJSONQuery/index.js.map +0 -1
  201. package/dist/queries/getTableColumnFromPath.d.ts +0 -50
  202. package/dist/queries/getTableColumnFromPath.d.ts.map +0 -1
  203. package/dist/queries/getTableColumnFromPath.js +0 -516
  204. package/dist/queries/getTableColumnFromPath.js.map +0 -1
  205. package/dist/queries/operatorMap.d.ts +0 -18
  206. package/dist/queries/operatorMap.d.ts.map +0 -1
  207. package/dist/queries/operatorMap.js +0 -24
  208. package/dist/queries/operatorMap.js.map +0 -1
  209. package/dist/queries/parseParams.d.ts +0 -16
  210. package/dist/queries/parseParams.d.ts.map +0 -1
  211. package/dist/queries/parseParams.js +0 -183
  212. package/dist/queries/parseParams.js.map +0 -1
  213. package/dist/queries/sanitizeQueryValue.d.ts +0 -15
  214. package/dist/queries/sanitizeQueryValue.d.ts.map +0 -1
  215. package/dist/queries/sanitizeQueryValue.js +0 -89
  216. package/dist/queries/sanitizeQueryValue.js.map +0 -1
  217. package/dist/queries/selectDistinct.d.ts +0 -22
  218. package/dist/queries/selectDistinct.d.ts.map +0 -1
  219. package/dist/queries/selectDistinct.js +0 -30
  220. package/dist/queries/selectDistinct.js.map +0 -1
  221. package/dist/queryDrafts.d.ts +0 -3
  222. package/dist/queryDrafts.d.ts.map +0 -1
  223. package/dist/queryDrafts.js +0 -40
  224. package/dist/queryDrafts.js.map +0 -1
  225. package/dist/schema/createTableName.d.ts +0 -30
  226. package/dist/schema/createTableName.d.ts.map +0 -1
  227. package/dist/schema/createTableName.js +0 -31
  228. package/dist/schema/createTableName.js.map +0 -1
  229. package/dist/schema/validateExistingBlockIsIdentical.d.ts +0 -12
  230. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +0 -1
  231. package/dist/schema/validateExistingBlockIsIdentical.js +0 -76
  232. package/dist/schema/validateExistingBlockIsIdentical.js.map +0 -1
  233. package/dist/transactions/beginTransaction.d.ts +0 -3
  234. package/dist/transactions/beginTransaction.d.ts.map +0 -1
  235. package/dist/transactions/beginTransaction.js +0 -51
  236. package/dist/transactions/beginTransaction.js.map +0 -1
  237. package/dist/transactions/commitTransaction.d.ts +0 -3
  238. package/dist/transactions/commitTransaction.d.ts.map +0 -1
  239. package/dist/transactions/commitTransaction.js +0 -14
  240. package/dist/transactions/commitTransaction.js.map +0 -1
  241. package/dist/transactions/rollbackTransaction.d.ts +0 -3
  242. package/dist/transactions/rollbackTransaction.d.ts.map +0 -1
  243. package/dist/transactions/rollbackTransaction.js +0 -13
  244. package/dist/transactions/rollbackTransaction.js.map +0 -1
  245. package/dist/transform/read/hasManyNumber.d.ts +0 -10
  246. package/dist/transform/read/hasManyNumber.d.ts.map +0 -1
  247. package/dist/transform/read/hasManyNumber.js +0 -10
  248. package/dist/transform/read/hasManyNumber.js.map +0 -1
  249. package/dist/transform/read/hasManyText.d.ts +0 -10
  250. package/dist/transform/read/hasManyText.d.ts.map +0 -1
  251. package/dist/transform/read/hasManyText.js +0 -10
  252. package/dist/transform/read/hasManyText.js.map +0 -1
  253. package/dist/transform/read/index.d.ts +0 -14
  254. package/dist/transform/read/index.d.ts.map +0 -1
  255. package/dist/transform/read/index.js +0 -44
  256. package/dist/transform/read/index.js.map +0 -1
  257. package/dist/transform/read/relationship.d.ts +0 -10
  258. package/dist/transform/read/relationship.d.ts.map +0 -1
  259. package/dist/transform/read/relationship.js +0 -60
  260. package/dist/transform/read/relationship.js.map +0 -1
  261. package/dist/transform/read/traverseFields.d.ts +0 -57
  262. package/dist/transform/read/traverseFields.d.ts.map +0 -1
  263. package/dist/transform/read/traverseFields.js +0 -435
  264. package/dist/transform/read/traverseFields.js.map +0 -1
  265. package/dist/transform/write/array.d.ts +0 -26
  266. package/dist/transform/write/array.d.ts.map +0 -1
  267. package/dist/transform/write/array.js +0 -58
  268. package/dist/transform/write/array.js.map +0 -1
  269. package/dist/transform/write/blocks.d.ts +0 -25
  270. package/dist/transform/write/blocks.d.ts.map +0 -1
  271. package/dist/transform/write/blocks.js +0 -54
  272. package/dist/transform/write/blocks.js.map +0 -1
  273. package/dist/transform/write/index.d.ts +0 -13
  274. package/dist/transform/write/index.d.ts.map +0 -1
  275. package/dist/transform/write/index.js +0 -41
  276. package/dist/transform/write/index.js.map +0 -1
  277. package/dist/transform/write/numbers.d.ts +0 -8
  278. package/dist/transform/write/numbers.d.ts.map +0 -1
  279. package/dist/transform/write/numbers.js +0 -11
  280. package/dist/transform/write/numbers.js.map +0 -1
  281. package/dist/transform/write/relationships.d.ts +0 -10
  282. package/dist/transform/write/relationships.d.ts.map +0 -1
  283. package/dist/transform/write/relationships.js +0 -23
  284. package/dist/transform/write/relationships.js.map +0 -1
  285. package/dist/transform/write/selects.d.ts +0 -8
  286. package/dist/transform/write/selects.d.ts.map +0 -1
  287. package/dist/transform/write/selects.js +0 -20
  288. package/dist/transform/write/selects.js.map +0 -1
  289. package/dist/transform/write/texts.d.ts +0 -8
  290. package/dist/transform/write/texts.d.ts.map +0 -1
  291. package/dist/transform/write/texts.js +0 -11
  292. package/dist/transform/write/texts.js.map +0 -1
  293. package/dist/transform/write/traverseFields.d.ts +0 -50
  294. package/dist/transform/write/traverseFields.d.ts.map +0 -1
  295. package/dist/transform/write/traverseFields.js +0 -445
  296. package/dist/transform/write/traverseFields.js.map +0 -1
  297. package/dist/transform/write/types.d.ts +0 -43
  298. package/dist/transform/write/types.d.ts.map +0 -1
  299. package/dist/transform/write/types.js +0 -3
  300. package/dist/transform/write/types.js.map +0 -1
  301. package/dist/update.d.ts +0 -3
  302. package/dist/update.d.ts.map +0 -1
  303. package/dist/update.js +0 -54
  304. package/dist/update.js.map +0 -1
  305. package/dist/updateGlobal.d.ts +0 -4
  306. package/dist/updateGlobal.d.ts.map +0 -1
  307. package/dist/updateGlobal.js +0 -25
  308. package/dist/updateGlobal.js.map +0 -1
  309. package/dist/updateGlobalVersion.d.ts +0 -4
  310. package/dist/updateGlobalVersion.d.ts.map +0 -1
  311. package/dist/updateGlobalVersion.js +0 -36
  312. package/dist/updateGlobalVersion.js.map +0 -1
  313. package/dist/updateVersion.d.ts +0 -4
  314. package/dist/updateVersion.d.ts.map +0 -1
  315. package/dist/updateVersion.js +0 -36
  316. package/dist/updateVersion.js.map +0 -1
  317. package/dist/upsertRow/deleteExistingArrayRows.d.ts +0 -10
  318. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +0 -1
  319. package/dist/upsertRow/deleteExistingArrayRows.js +0 -10
  320. package/dist/upsertRow/deleteExistingArrayRows.js.map +0 -1
  321. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +0 -14
  322. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +0 -1
  323. package/dist/upsertRow/deleteExistingRowsByPath.js +0 -33
  324. package/dist/upsertRow/deleteExistingRowsByPath.js.map +0 -1
  325. package/dist/upsertRow/index.d.ts +0 -4
  326. package/dist/upsertRow/index.d.ts.map +0 -1
  327. package/dist/upsertRow/index.js +0 -279
  328. package/dist/upsertRow/index.js.map +0 -1
  329. package/dist/upsertRow/insertArrays.d.ts +0 -13
  330. package/dist/upsertRow/insertArrays.d.ts.map +0 -1
  331. package/dist/upsertRow/insertArrays.js +0 -68
  332. package/dist/upsertRow/insertArrays.js.map +0 -1
  333. package/dist/upsertRow/types.d.ts +0 -32
  334. package/dist/upsertRow/types.d.ts.map +0 -1
  335. package/dist/upsertRow/types.js +0 -3
  336. package/dist/upsertRow/types.js.map +0 -1
  337. package/dist/utilities/appendPrefixToKeys.d.ts +0 -2
  338. package/dist/utilities/appendPrefixToKeys.d.ts.map +0 -1
  339. package/dist/utilities/appendPrefixToKeys.js +0 -6
  340. package/dist/utilities/appendPrefixToKeys.js.map +0 -1
  341. package/dist/utilities/createBlocksMap.d.ts +0 -5
  342. package/dist/utilities/createBlocksMap.d.ts.map +0 -1
  343. package/dist/utilities/createBlocksMap.js +0 -29
  344. package/dist/utilities/createBlocksMap.js.map +0 -1
  345. package/dist/utilities/createMigrationTable.d.ts +0 -3
  346. package/dist/utilities/createMigrationTable.d.ts.map +0 -1
  347. package/dist/utilities/createMigrationTable.js +0 -13
  348. package/dist/utilities/createMigrationTable.js.map +0 -1
  349. package/dist/utilities/createRelationshipMap.d.ts +0 -2
  350. package/dist/utilities/createRelationshipMap.d.ts.map +0 -1
  351. package/dist/utilities/createRelationshipMap.js +0 -19
  352. package/dist/utilities/createRelationshipMap.js.map +0 -1
  353. package/dist/utilities/hasLocalesTable.d.ts +0 -3
  354. package/dist/utilities/hasLocalesTable.d.ts.map +0 -1
  355. package/dist/utilities/hasLocalesTable.js +0 -11
  356. package/dist/utilities/hasLocalesTable.js.map +0 -1
  357. package/dist/utilities/isArrayOfRows.d.ts +0 -2
  358. package/dist/utilities/isArrayOfRows.d.ts.map +0 -1
  359. package/dist/utilities/isArrayOfRows.js +0 -5
  360. package/dist/utilities/isArrayOfRows.js.map +0 -1
  361. package/dist/utilities/migrationTableExists.d.ts +0 -3
  362. package/dist/utilities/migrationTableExists.d.ts.map +0 -1
  363. package/dist/utilities/migrationTableExists.js +0 -9
  364. package/dist/utilities/migrationTableExists.js.map +0 -1
  365. package/dist/utilities/parseError.d.ts +0 -5
  366. package/dist/utilities/parseError.d.ts.map +0 -1
  367. package/dist/utilities/parseError.js +0 -17
  368. package/dist/utilities/parseError.js.map +0 -1
  369. package/dist/utilities/pushDevSchema.d.ts +0 -9
  370. package/dist/utilities/pushDevSchema.d.ts.map +0 -1
  371. package/dist/utilities/pushDevSchema.js +0 -58
  372. package/dist/utilities/pushDevSchema.js.map +0 -1
  373. /package/dist/{queries/createJSONQuery → createJSONQuery}/convertPathToJSONTraversal.d.ts +0 -0
  374. /package/dist/{queries/createJSONQuery → createJSONQuery}/convertPathToJSONTraversal.js +0 -0
  375. /package/dist/{queries/createJSONQuery → createJSONQuery}/formatJSONPathSegment.d.ts +0 -0
  376. /package/dist/{queries/createJSONQuery → createJSONQuery}/formatJSONPathSegment.js +0 -0
  377. /package/dist/{queries/createJSONQuery → createJSONQuery}/index.d.ts +0 -0
  378. /package/dist/{queries/createJSONQuery → createJSONQuery}/index.js +0 -0
@@ -1,54 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import toSnakeCase from 'to-snake-case';
2
- import { traverseFields } from './traverseFields.js';
3
- export const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts })=>{
4
- data.forEach((blockRow, i)=>{
5
- if (typeof blockRow.blockType !== 'string') return;
6
- const matchedBlock = field.blocks.find(({ slug })=>slug === blockRow.blockType);
7
- if (!matchedBlock) return;
8
- const blockType = toSnakeCase(blockRow.blockType);
9
- if (!blocks[blockType]) blocks[blockType] = [];
10
- const newRow = {
11
- arrays: {},
12
- locales: {},
13
- row: {
14
- _order: i + 1,
15
- _path: `${path}${field.name}`
16
- }
17
- };
18
- if (field.localized && locale) newRow.row._locale = locale;
19
- const blockTableName = adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`);
20
- const hasUUID = adapter.tables[blockTableName]._uuid;
21
- // If we have declared a _uuid field on arrays,
22
- // that means the ID has to be unique,
23
- // and our ids within arrays are not unique.
24
- // So move the ID to a uuid field for storage
25
- // and allow the database to generate a serial id automatically
26
- if (hasUUID) {
27
- newRow.row._uuid = blockRow.id;
28
- delete blockRow.id;
29
- }
30
- traverseFields({
31
- adapter,
32
- arrays: newRow.arrays,
33
- baseTableName,
34
- blocks,
35
- blocksToDelete,
36
- columnPrefix: '',
37
- data: blockRow,
38
- fieldPrefix: '',
39
- fields: matchedBlock.fields,
40
- locales: newRow.locales,
41
- numbers,
42
- parentTableName: blockTableName,
43
- path: `${path || ''}${field.name}.${i}.`,
44
- relationships,
45
- relationshipsToDelete,
46
- row: newRow.row,
47
- selects,
48
- texts
49
- });
50
- blocks[blockType].push(newRow);
51
- });
52
- };
53
-
54
- //# sourceMappingURL=blocks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/blocks.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { BlockField } from 'payload'\n\nimport toSnakeCase from 'to-snake-case'\n\nimport type { PostgresAdapter } from '../../types.js'\nimport type { BlockRowToInsert, RelationshipToDelete } from './types.js'\n\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: PostgresAdapter\n baseTableName: string\n blocks: {\n [blockType: string]: BlockRowToInsert[]\n }\n blocksToDelete: Set<string>\n data: Record<string, unknown>[]\n field: BlockField\n locale?: string\n numbers: Record<string, unknown>[]\n path: string\n relationships: Record<string, unknown>[]\n relationshipsToDelete: RelationshipToDelete[]\n selects: {\n [tableName: string]: Record<string, unknown>[]\n }\n texts: Record<string, unknown>[]\n}\nexport const transformBlocks = ({\n adapter,\n baseTableName,\n blocks,\n blocksToDelete,\n data,\n field,\n locale,\n numbers,\n path,\n relationships,\n relationshipsToDelete,\n selects,\n texts,\n}: Args) => {\n data.forEach((blockRow, i) => {\n if (typeof blockRow.blockType !== 'string') return\n const matchedBlock = field.blocks.find(({ slug }) => slug === blockRow.blockType)\n if (!matchedBlock) return\n const blockType = toSnakeCase(blockRow.blockType)\n\n if (!blocks[blockType]) blocks[blockType] = []\n\n const newRow: BlockRowToInsert = {\n arrays: {},\n locales: {},\n row: {\n _order: i + 1,\n _path: `${path}${field.name}`,\n },\n }\n\n if (field.localized && locale) newRow.row._locale = locale\n\n const blockTableName = adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`)\n\n const hasUUID = adapter.tables[blockTableName]._uuid\n\n // If we have declared a _uuid field on arrays,\n // that means the ID has to be unique,\n // and our ids within arrays are not unique.\n // So move the ID to a uuid field for storage\n // and allow the database to generate a serial id automatically\n if (hasUUID) {\n newRow.row._uuid = blockRow.id\n delete blockRow.id\n }\n\n traverseFields({\n adapter,\n arrays: newRow.arrays,\n baseTableName,\n blocks,\n blocksToDelete,\n columnPrefix: '',\n data: blockRow,\n fieldPrefix: '',\n fields: matchedBlock.fields,\n locales: newRow.locales,\n numbers,\n parentTableName: blockTableName,\n path: `${path || ''}${field.name}.${i}.`,\n relationships,\n relationshipsToDelete,\n row: newRow.row,\n selects,\n texts,\n })\n\n blocks[blockType].push(newRow)\n })\n}\n"],"names":["toSnakeCase","traverseFields","transformBlocks","adapter","baseTableName","blocks","blocksToDelete","data","field","locale","numbers","path","relationships","relationshipsToDelete","selects","texts","forEach","blockRow","i","blockType","matchedBlock","find","slug","newRow","arrays","locales","row","_order","_path","name","localized","_locale","blockTableName","tableNameMap","get","hasUUID","tables","_uuid","id","columnPrefix","fieldPrefix","fields","parentTableName","push"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GAGpC,OAAOA,iBAAiB,gBAAe;AAKvC,SAASC,cAAc,QAAQ,sBAAqB;AAqBpD,OAAO,MAAMC,kBAAkB,CAAC,EAC9BC,OAAO,EACPC,aAAa,EACbC,MAAM,EACNC,cAAc,EACdC,IAAI,EACJC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,aAAa,EACbC,qBAAqB,EACrBC,OAAO,EACPC,KAAK,EACA;IACLR,KAAKS,OAAO,CAAC,CAACC,UAAUC;QACtB,IAAI,OAAOD,SAASE,SAAS,KAAK,UAAU;QAC5C,MAAMC,eAAeZ,MAAMH,MAAM,CAACgB,IAAI,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA,SAASL,SAASE,SAAS;QAChF,IAAI,CAACC,cAAc;QACnB,MAAMD,YAAYnB,YAAYiB,SAASE,SAAS;QAEhD,IAAI,CAACd,MAAM,CAACc,UAAU,EAAEd,MAAM,CAACc,UAAU,GAAG,EAAE;QAE9C,MAAMI,SAA2B;YAC/BC,QAAQ,CAAC;YACTC,SAAS,CAAC;YACVC,KAAK;gBACHC,QAAQT,IAAI;gBACZU,OAAO,CAAC,EAAEjB,KAAK,EAAEH,MAAMqB,IAAI,CAAC,CAAC;YAC/B;QACF;QAEA,IAAIrB,MAAMsB,SAAS,IAAIrB,QAAQc,OAAOG,GAAG,CAACK,OAAO,GAAGtB;QAEpD,MAAMuB,iBAAiB7B,QAAQ8B,YAAY,CAACC,GAAG,CAAC,CAAC,EAAE9B,cAAc,QAAQ,EAAEe,UAAU,CAAC;QAEtF,MAAMgB,UAAUhC,QAAQiC,MAAM,CAACJ,eAAe,CAACK,KAAK;QAEpD,+CAA+C;QAC/C,sCAAsC;QACtC,4CAA4C;QAC5C,6CAA6C;QAC7C,+DAA+D;QAC/D,IAAIF,SAAS;YACXZ,OAAOG,GAAG,CAACW,KAAK,GAAGpB,SAASqB,EAAE;YAC9B,OAAOrB,SAASqB,EAAE;QACpB;QAEArC,eAAe;YACbE;YACAqB,QAAQD,OAAOC,MAAM;YACrBpB;YACAC;YACAC;YACAiC,cAAc;YACdhC,MAAMU;YACNuB,aAAa;YACbC,QAAQrB,aAAaqB,MAAM;YAC3BhB,SAASF,OAAOE,OAAO;YACvBf;YACAgC,iBAAiBV;YACjBrB,MAAM,CAAC,EAAEA,QAAQ,GAAG,EAAEH,MAAMqB,IAAI,CAAC,CAAC,EAAEX,EAAE,CAAC,CAAC;YACxCN;YACAC;YACAa,KAAKH,OAAOG,GAAG;YACfZ;YACAC;QACF;QAEAV,MAAM,CAACc,UAAU,CAACwB,IAAI,CAACpB;IACzB;AACF,EAAC"}
@@ -1,13 +0,0 @@
1
- import type { Field } from 'payload';
2
- import type { PostgresAdapter } from '../../types.js';
3
- import type { RowToInsert } from './types.js';
4
- type Args = {
5
- adapter: PostgresAdapter;
6
- data: Record<string, unknown>;
7
- fields: Field[];
8
- path?: string;
9
- tableName: string;
10
- };
11
- export declare const transformForWrite: ({ adapter, data, fields, path, tableName, }: Args) => RowToInsert;
12
- export {};
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/write/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,gDAM3B,IAAI,KAAG,WAuCT,CAAA"}
@@ -1,41 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import { traverseFields } from './traverseFields.js';
2
- export const transformForWrite = ({ adapter, data, fields, path = '', tableName })=>{
3
- // Split out the incoming data into rows to insert / delete
4
- const rowToInsert = {
5
- arrays: {},
6
- blocks: {},
7
- blocksToDelete: new Set(),
8
- locales: {},
9
- numbers: [],
10
- relationships: [],
11
- relationshipsToDelete: [],
12
- row: {},
13
- selects: {},
14
- texts: []
15
- };
16
- // This function is responsible for building up the
17
- // above rowToInsert
18
- traverseFields({
19
- adapter,
20
- arrays: rowToInsert.arrays,
21
- baseTableName: tableName,
22
- blocks: rowToInsert.blocks,
23
- blocksToDelete: rowToInsert.blocksToDelete,
24
- columnPrefix: '',
25
- data,
26
- fieldPrefix: '',
27
- fields,
28
- locales: rowToInsert.locales,
29
- numbers: rowToInsert.numbers,
30
- parentTableName: tableName,
31
- path,
32
- relationships: rowToInsert.relationships,
33
- relationshipsToDelete: rowToInsert.relationshipsToDelete,
34
- row: rowToInsert.row,
35
- selects: rowToInsert.selects,
36
- texts: rowToInsert.texts
37
- });
38
- return rowToInsert;
39
- };
40
-
41
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/index.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { Field } from 'payload'\n\nimport type { PostgresAdapter } from '../../types.js'\nimport type { RowToInsert } from './types.js'\n\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: PostgresAdapter\n data: Record<string, unknown>\n fields: Field[]\n path?: string\n tableName: string\n}\n\nexport const transformForWrite = ({\n adapter,\n data,\n fields,\n path = '',\n tableName,\n}: Args): RowToInsert => {\n // Split out the incoming data into rows to insert / delete\n const rowToInsert: RowToInsert = {\n arrays: {},\n blocks: {},\n blocksToDelete: new Set(),\n locales: {},\n numbers: [],\n relationships: [],\n relationshipsToDelete: [],\n row: {},\n selects: {},\n texts: [],\n }\n\n // This function is responsible for building up the\n // above rowToInsert\n traverseFields({\n adapter,\n arrays: rowToInsert.arrays,\n baseTableName: tableName,\n blocks: rowToInsert.blocks,\n blocksToDelete: rowToInsert.blocksToDelete,\n columnPrefix: '',\n data,\n fieldPrefix: '',\n fields,\n locales: rowToInsert.locales,\n numbers: rowToInsert.numbers,\n parentTableName: tableName,\n path,\n relationships: rowToInsert.relationships,\n relationshipsToDelete: rowToInsert.relationshipsToDelete,\n row: rowToInsert.row,\n selects: rowToInsert.selects,\n texts: rowToInsert.texts,\n })\n\n return rowToInsert\n}\n"],"names":["traverseFields","transformForWrite","adapter","data","fields","path","tableName","rowToInsert","arrays","blocks","blocksToDelete","Set","locales","numbers","relationships","relationshipsToDelete","row","selects","texts","baseTableName","columnPrefix","fieldPrefix","parentTableName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GAMpC,SAASA,cAAc,QAAQ,sBAAqB;AAUpD,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,OAAO,EACPC,IAAI,EACJC,MAAM,EACNC,OAAO,EAAE,EACTC,SAAS,EACJ;IACL,2DAA2D;IAC3D,MAAMC,cAA2B;QAC/BC,QAAQ,CAAC;QACTC,QAAQ,CAAC;QACTC,gBAAgB,IAAIC;QACpBC,SAAS,CAAC;QACVC,SAAS,EAAE;QACXC,eAAe,EAAE;QACjBC,uBAAuB,EAAE;QACzBC,KAAK,CAAC;QACNC,SAAS,CAAC;QACVC,OAAO,EAAE;IACX;IAEA,mDAAmD;IACnD,oBAAoB;IACpBlB,eAAe;QACbE;QACAM,QAAQD,YAAYC,MAAM;QAC1BW,eAAeb;QACfG,QAAQF,YAAYE,MAAM;QAC1BC,gBAAgBH,YAAYG,cAAc;QAC1CU,cAAc;QACdjB;QACAkB,aAAa;QACbjB;QACAQ,SAASL,YAAYK,OAAO;QAC5BC,SAASN,YAAYM,OAAO;QAC5BS,iBAAiBhB;QACjBD;QACAS,eAAeP,YAAYO,aAAa;QACxCC,uBAAuBR,YAAYQ,qBAAqB;QACxDC,KAAKT,YAAYS,GAAG;QACpBC,SAASV,YAAYU,OAAO;QAC5BC,OAAOX,YAAYW,KAAK;IAC1B;IAEA,OAAOX;AACT,EAAC"}
@@ -1,8 +0,0 @@
1
- type Args = {
2
- baseRow: Record<string, unknown>;
3
- data: unknown[];
4
- numbers: Record<string, unknown>[];
5
- };
6
- export declare const transformNumbers: ({ baseRow, data, numbers }: Args) => void;
7
- export {};
8
- //# sourceMappingURL=numbers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../../src/transform/write/numbers.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,gBAAgB,+BAAgC,IAAI,SAQhE,CAAA"}
@@ -1,11 +0,0 @@
1
- export const transformNumbers = ({ baseRow, data, numbers })=>{
2
- data.forEach((val, i)=>{
3
- numbers.push({
4
- ...baseRow,
5
- number: val,
6
- order: i + 1
7
- });
8
- });
9
- };
10
-
11
- //# sourceMappingURL=numbers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/numbers.ts"],"sourcesContent":["type Args = {\n baseRow: Record<string, unknown>\n data: unknown[]\n numbers: Record<string, unknown>[]\n}\n\nexport const transformNumbers = ({ baseRow, data, numbers }: Args) => {\n data.forEach((val, i) => {\n numbers.push({\n ...baseRow,\n number: val,\n order: i + 1,\n })\n })\n}\n"],"names":["transformNumbers","baseRow","data","numbers","forEach","val","i","push","number","order"],"rangeMappings":";;;;;;;;","mappings":"AAMA,OAAO,MAAMA,mBAAmB,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAQ;IAC/DD,KAAKE,OAAO,CAAC,CAACC,KAAKC;QACjBH,QAAQI,IAAI,CAAC;YACX,GAAGN,OAAO;YACVO,QAAQH;YACRI,OAAOH,IAAI;QACb;IACF;AACF,EAAC"}
@@ -1,10 +0,0 @@
1
- import type { RelationshipField, UploadField } from 'payload';
2
- type Args = {
3
- baseRow: Record<string, unknown>;
4
- data: unknown;
5
- field: RelationshipField | UploadField;
6
- relationships: Record<string, unknown>[];
7
- };
8
- export declare const transformRelationship: ({ baseRow, data, field, relationships }: Args) => void;
9
- export {};
10
- //# sourceMappingURL=relationships.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../src/transform/write/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI7D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAA;IACtC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,qBAAqB,4CAA6C,IAAI,SAiBlF,CAAA"}
@@ -1,23 +0,0 @@
1
- import { valueIsValueWithRelation } from 'payload/shared';
2
- export const transformRelationship = ({ baseRow, data, field, relationships })=>{
3
- const relations = Array.isArray(data) ? data : [
4
- data
5
- ];
6
- relations.forEach((relation, i)=>{
7
- if (relation) {
8
- const relationRow = {
9
- ...baseRow
10
- };
11
- if ('hasMany' in field && field.hasMany) relationRow.order = i + 1;
12
- if (Array.isArray(field.relationTo) && valueIsValueWithRelation(relation)) {
13
- relationRow[`${relation.relationTo}ID`] = relation.value;
14
- relationships.push(relationRow);
15
- } else {
16
- relationRow[`${field.relationTo}ID`] = relation;
17
- if (relation) relationships.push(relationRow);
18
- }
19
- }
20
- });
21
- };
22
-
23
- //# sourceMappingURL=relationships.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/relationships.ts"],"sourcesContent":["import type { RelationshipField, UploadField } from 'payload'\n\nimport { valueIsValueWithRelation } from 'payload/shared'\n\ntype Args = {\n baseRow: Record<string, unknown>\n data: unknown\n field: RelationshipField | UploadField\n relationships: Record<string, unknown>[]\n}\n\nexport const transformRelationship = ({ baseRow, data, field, relationships }: Args) => {\n const relations = Array.isArray(data) ? data : [data]\n\n relations.forEach((relation, i) => {\n if (relation) {\n const relationRow = { ...baseRow }\n if ('hasMany' in field && field.hasMany) relationRow.order = i + 1\n\n if (Array.isArray(field.relationTo) && valueIsValueWithRelation(relation)) {\n relationRow[`${relation.relationTo}ID`] = relation.value\n relationships.push(relationRow)\n } else {\n relationRow[`${field.relationTo}ID`] = relation\n if (relation) relationships.push(relationRow)\n }\n }\n })\n}\n"],"names":["valueIsValueWithRelation","transformRelationship","baseRow","data","field","relationships","relations","Array","isArray","forEach","relation","i","relationRow","hasMany","order","relationTo","value","push"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,wBAAwB,QAAQ,iBAAgB;AASzD,OAAO,MAAMC,wBAAwB,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,aAAa,EAAQ;IACjF,MAAMC,YAAYC,MAAMC,OAAO,CAACL,QAAQA,OAAO;QAACA;KAAK;IAErDG,UAAUG,OAAO,CAAC,CAACC,UAAUC;QAC3B,IAAID,UAAU;YACZ,MAAME,cAAc;gBAAE,GAAGV,OAAO;YAAC;YACjC,IAAI,aAAaE,SAASA,MAAMS,OAAO,EAAED,YAAYE,KAAK,GAAGH,IAAI;YAEjE,IAAIJ,MAAMC,OAAO,CAACJ,MAAMW,UAAU,KAAKf,yBAAyBU,WAAW;gBACzEE,WAAW,CAAC,CAAC,EAAEF,SAASK,UAAU,CAAC,EAAE,CAAC,CAAC,GAAGL,SAASM,KAAK;gBACxDX,cAAcY,IAAI,CAACL;YACrB,OAAO;gBACLA,WAAW,CAAC,CAAC,EAAER,MAAMW,UAAU,CAAC,EAAE,CAAC,CAAC,GAAGL;gBACvC,IAAIA,UAAUL,cAAcY,IAAI,CAACL;YACnC;QACF;IACF;AACF,EAAC"}
@@ -1,8 +0,0 @@
1
- type Args = {
2
- data: unknown;
3
- id?: unknown;
4
- locale?: string;
5
- };
6
- export declare const transformSelects: ({ id, data, locale }: Args) => Record<string, unknown>[];
7
- export {};
8
- //# sourceMappingURL=selects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selects.d.ts","sourceRoot":"","sources":["../../../src/transform/write/selects.ts"],"names":[],"mappings":"AAGA,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,gBAAgB,yBAA0B,IAAI,8BAoB1D,CAAA"}
@@ -1,20 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import { isArrayOfRows } from '../../utilities/isArrayOfRows.js';
2
- export const transformSelects = ({ id, data, locale })=>{
3
- const newRows = [];
4
- if (isArrayOfRows(data)) {
5
- data.forEach((value, i)=>{
6
- const newRow = {
7
- order: i + 1,
8
- parent: id,
9
- value
10
- };
11
- if (locale) {
12
- newRow.locale = locale;
13
- }
14
- newRows.push(newRow);
15
- });
16
- }
17
- return newRows;
18
- };
19
-
20
- //# sourceMappingURL=selects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/selects.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport { isArrayOfRows } from '../../utilities/isArrayOfRows.js'\n\ntype Args = {\n data: unknown\n id?: unknown\n locale?: string\n}\n\nexport const transformSelects = ({ id, data, locale }: Args) => {\n const newRows: Record<string, unknown>[] = []\n\n if (isArrayOfRows(data)) {\n data.forEach((value, i) => {\n const newRow: Record<string, unknown> = {\n order: i + 1,\n parent: id,\n value,\n }\n\n if (locale) {\n newRow.locale = locale\n }\n\n newRows.push(newRow)\n })\n }\n\n return newRows\n}\n"],"names":["isArrayOfRows","transformSelects","id","data","locale","newRows","forEach","value","i","newRow","order","parent","push"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GACpC,SAASA,aAAa,QAAQ,mCAAkC;AAQhE,OAAO,MAAMC,mBAAmB,CAAC,EAAEC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAQ;IACzD,MAAMC,UAAqC,EAAE;IAE7C,IAAIL,cAAcG,OAAO;QACvBA,KAAKG,OAAO,CAAC,CAACC,OAAOC;YACnB,MAAMC,SAAkC;gBACtCC,OAAOF,IAAI;gBACXG,QAAQT;gBACRK;YACF;YAEA,IAAIH,QAAQ;gBACVK,OAAOL,MAAM,GAAGA;YAClB;YAEAC,QAAQO,IAAI,CAACH;QACf;IACF;IAEA,OAAOJ;AACT,EAAC"}
@@ -1,8 +0,0 @@
1
- type Args = {
2
- baseRow: Record<string, unknown>;
3
- data: unknown[];
4
- texts: Record<string, unknown>[];
5
- };
6
- export declare const transformTexts: ({ baseRow, data, texts }: Args) => void;
7
- export {};
8
- //# sourceMappingURL=texts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../../../src/transform/write/texts.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,cAAc,6BAA8B,IAAI,SAQ5D,CAAA"}
@@ -1,11 +0,0 @@
1
- export const transformTexts = ({ baseRow, data, texts })=>{
2
- data.forEach((val, i)=>{
3
- texts.push({
4
- ...baseRow,
5
- order: i + 1,
6
- text: val
7
- });
8
- });
9
- };
10
-
11
- //# sourceMappingURL=texts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transform/write/texts.ts"],"sourcesContent":["type Args = {\n baseRow: Record<string, unknown>\n data: unknown[]\n texts: Record<string, unknown>[]\n}\n\nexport const transformTexts = ({ baseRow, data, texts }: Args) => {\n data.forEach((val, i) => {\n texts.push({\n ...baseRow,\n order: i + 1,\n text: val,\n })\n })\n}\n"],"names":["transformTexts","baseRow","data","texts","forEach","val","i","push","order","text"],"rangeMappings":";;;;;;;;","mappings":"AAMA,OAAO,MAAMA,iBAAiB,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAQ;IAC3DD,KAAKE,OAAO,CAAC,CAACC,KAAKC;QACjBH,MAAMI,IAAI,CAAC;YACT,GAAGN,OAAO;YACVO,OAAOF,IAAI;YACXG,MAAMJ;QACR;IACF;AACF,EAAC"}
@@ -1,50 +0,0 @@
1
- import type { Field } from 'payload';
2
- import type { PostgresAdapter } from '../../types.js';
3
- import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.js';
4
- type Args = {
5
- adapter: PostgresAdapter;
6
- arrays: {
7
- [tableName: string]: ArrayRowToInsert[];
8
- };
9
- /**
10
- * This is the name of the base table
11
- */
12
- baseTableName: string;
13
- blocks: {
14
- [blockType: string]: BlockRowToInsert[];
15
- };
16
- blocksToDelete: Set<string>;
17
- /**
18
- * A snake-case field prefix, representing prior fields
19
- * Ex: my_group_my_named_tab_
20
- */
21
- columnPrefix: string;
22
- data: Record<string, unknown>;
23
- existingLocales?: Record<string, unknown>[];
24
- /**
25
- * A prefix that will retain camel-case formatting, representing prior fields
26
- * Ex: myGroup_myNamedTab_
27
- */
28
- fieldPrefix: string;
29
- fields: Field[];
30
- forcedLocale?: string;
31
- locales: {
32
- [locale: string]: Record<string, unknown>;
33
- };
34
- numbers: Record<string, unknown>[];
35
- /**
36
- * This is the name of the parent table
37
- */
38
- parentTableName: string;
39
- path: string;
40
- relationships: Record<string, unknown>[];
41
- relationshipsToDelete: RelationshipToDelete[];
42
- row: Record<string, unknown>;
43
- selects: {
44
- [tableName: string]: Record<string, unknown>[];
45
- };
46
- texts: Record<string, unknown>[];
47
- };
48
- export declare const traverseFields: ({ adapter, arrays, baseTableName, blocks, blocksToDelete, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, texts, }: Args) => void;
49
- export {};
50
- //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/write/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAU1F,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC3C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC1C,CAAA;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,cAAc,4OAqBxB,IAAI,SA0dN,CAAA"}