@payloadcms/db-postgres 3.0.0-canary.6041f49 → 3.0.0-canary.690108d

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) 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 +22 -13
  5. package/dist/connect.js.map +1 -1
  6. package/dist/exports/migration-utils.d.ts +2 -0
  7. package/dist/exports/migration-utils.d.ts.map +1 -0
  8. package/dist/exports/migration-utils.js +3 -0
  9. package/dist/exports/migration-utils.js.map +1 -0
  10. package/dist/index.d.ts +1 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +40 -67
  13. package/dist/index.js.map +1 -1
  14. package/dist/predefinedMigrations/relationships-v2-v3.d.ts +4 -0
  15. package/dist/predefinedMigrations/relationships-v2-v3.d.ts.map +1 -0
  16. package/dist/predefinedMigrations/relationships-v2-v3.js.map +1 -0
  17. package/dist/predefinedMigrations/relationships-v2-v3.mjs +11 -0
  18. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +20 -0
  19. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -0
  20. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +169 -0
  21. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -0
  22. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts +11 -0
  23. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -0
  24. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js +191 -0
  25. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -0
  26. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts +3 -0
  27. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -0
  28. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js +56 -0
  29. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js.map +1 -0
  30. package/dist/predefinedMigrations/v2-v3/index.d.ts +23 -0
  31. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -0
  32. package/dist/predefinedMigrations/v2-v3/index.js +211 -0
  33. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -0
  34. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +20 -0
  35. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -0
  36. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js +57 -0
  37. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -0
  38. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +23 -0
  39. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -0
  40. package/dist/predefinedMigrations/v2-v3/traverseFields.js +85 -0
  41. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -0
  42. package/dist/predefinedMigrations/v2-v3/types.d.ts +9 -0
  43. package/dist/predefinedMigrations/v2-v3/types.d.ts.map +1 -0
  44. package/dist/predefinedMigrations/v2-v3/types.js +6 -0
  45. package/dist/predefinedMigrations/v2-v3/types.js.map +1 -0
  46. package/dist/types.d.ts +42 -77
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/types.js.map +1 -1
  49. package/package.json +24 -15
  50. package/dist/count.d.ts +0 -3
  51. package/dist/count.d.ts.map +0 -1
  52. package/dist/count.js +0 -50
  53. package/dist/count.js.map +0 -1
  54. package/dist/create.d.ts +0 -3
  55. package/dist/create.d.ts.map +0 -1
  56. package/dist/create.js +0 -19
  57. package/dist/create.js.map +0 -1
  58. package/dist/createGlobal.d.ts +0 -5
  59. package/dist/createGlobal.d.ts.map +0 -1
  60. package/dist/createGlobal.js +0 -19
  61. package/dist/createGlobal.js.map +0 -1
  62. package/dist/createGlobalVersion.d.ts +0 -6
  63. package/dist/createGlobalVersion.d.ts.map +0 -1
  64. package/dist/createGlobalVersion.js +0 -33
  65. package/dist/createGlobalVersion.js.map +0 -1
  66. package/dist/createMigration.d.ts +0 -3
  67. package/dist/createMigration.d.ts.map +0 -1
  68. package/dist/createMigration.js +0 -81
  69. package/dist/createMigration.js.map +0 -1
  70. package/dist/createVersion.d.ts +0 -5
  71. package/dist/createVersion.d.ts.map +0 -1
  72. package/dist/createVersion.js +0 -44
  73. package/dist/createVersion.js.map +0 -1
  74. package/dist/deleteMany.d.ts +0 -3
  75. package/dist/deleteMany.d.ts.map +0 -1
  76. package/dist/deleteMany.js +0 -28
  77. package/dist/deleteMany.js.map +0 -1
  78. package/dist/deleteOne.d.ts +0 -3
  79. package/dist/deleteOne.d.ts.map +0 -1
  80. package/dist/deleteOne.js +0 -59
  81. package/dist/deleteOne.js.map +0 -1
  82. package/dist/deleteVersions.d.ts +0 -3
  83. package/dist/deleteVersions.d.ts.map +0 -1
  84. package/dist/deleteVersions.js +0 -31
  85. package/dist/deleteVersions.js.map +0 -1
  86. package/dist/destroy.d.ts +0 -3
  87. package/dist/destroy.d.ts.map +0 -1
  88. package/dist/destroy.js +0 -11
  89. package/dist/destroy.js.map +0 -1
  90. package/dist/find/buildFindManyArgs.d.ts +0 -13
  91. package/dist/find/buildFindManyArgs.d.ts.map +0 -1
  92. package/dist/find/buildFindManyArgs.js +0 -64
  93. package/dist/find/buildFindManyArgs.js.map +0 -1
  94. package/dist/find/chainMethods.d.ts +0 -16
  95. package/dist/find/chainMethods.d.ts.map +0 -1
  96. package/dist/find/chainMethods.js +0 -12
  97. package/dist/find/chainMethods.js.map +0 -1
  98. package/dist/find/findMany.d.ts +0 -22
  99. package/dist/find/findMany.d.ts.map +0 -1
  100. package/dist/find/findMany.js +0 -163
  101. package/dist/find/findMany.js.map +0 -1
  102. package/dist/find/traverseFields.d.ts +0 -16
  103. package/dist/find/traverseFields.d.ts.map +0 -1
  104. package/dist/find/traverseFields.js +0 -138
  105. package/dist/find/traverseFields.js.map +0 -1
  106. package/dist/find.d.ts +0 -3
  107. package/dist/find.d.ts.map +0 -1
  108. package/dist/find.js +0 -21
  109. package/dist/find.js.map +0 -1
  110. package/dist/findGlobal.d.ts +0 -3
  111. package/dist/findGlobal.d.ts.map +0 -1
  112. package/dist/findGlobal.js +0 -23
  113. package/dist/findGlobal.js.map +0 -1
  114. package/dist/findGlobalVersions.d.ts +0 -3
  115. package/dist/findGlobalVersions.d.ts.map +0 -1
  116. package/dist/findGlobalVersions.js +0 -24
  117. package/dist/findGlobalVersions.js.map +0 -1
  118. package/dist/findOne.d.ts +0 -5
  119. package/dist/findOne.d.ts.map +0 -1
  120. package/dist/findOne.js +0 -21
  121. package/dist/findOne.js.map +0 -1
  122. package/dist/findVersions.d.ts +0 -3
  123. package/dist/findVersions.d.ts.map +0 -1
  124. package/dist/findVersions.js +0 -24
  125. package/dist/findVersions.js.map +0 -1
  126. package/dist/init.d.ts +0 -3
  127. package/dist/init.d.ts.map +0 -1
  128. package/dist/init.js +0 -96
  129. package/dist/init.js.map +0 -1
  130. package/dist/migrate.d.ts +0 -3
  131. package/dist/migrate.d.ts.map +0 -1
  132. package/dist/migrate.js +0 -99
  133. package/dist/migrate.js.map +0 -1
  134. package/dist/migrateDown.d.ts +0 -3
  135. package/dist/migrateDown.d.ts.map +0 -1
  136. package/dist/migrateDown.js +0 -63
  137. package/dist/migrateDown.js.map +0 -1
  138. package/dist/migrateFresh.d.ts +0 -8
  139. package/dist/migrateFresh.d.ts.map +0 -1
  140. package/dist/migrateFresh.js +0 -72
  141. package/dist/migrateFresh.js.map +0 -1
  142. package/dist/migrateRefresh.d.ts +0 -6
  143. package/dist/migrateRefresh.d.ts.map +0 -1
  144. package/dist/migrateRefresh.js +0 -102
  145. package/dist/migrateRefresh.js.map +0 -1
  146. package/dist/migrateReset.d.ts +0 -6
  147. package/dist/migrateReset.d.ts.map +0 -1
  148. package/dist/migrateReset.js +0 -82
  149. package/dist/migrateReset.js.map +0 -1
  150. package/dist/migrateStatus.d.ts +0 -3
  151. package/dist/migrateStatus.d.ts.map +0 -1
  152. package/dist/migrateStatus.js +0 -44
  153. package/dist/migrateStatus.js.map +0 -1
  154. package/dist/queries/buildAndOrConditions.d.ts +0 -17
  155. package/dist/queries/buildAndOrConditions.d.ts.map +0 -1
  156. package/dist/queries/buildAndOrConditions.js +0 -29
  157. package/dist/queries/buildAndOrConditions.js.map +0 -1
  158. package/dist/queries/buildQuery.d.ts +0 -31
  159. package/dist/queries/buildQuery.d.ts.map +0 -1
  160. package/dist/queries/buildQuery.js +0 -76
  161. package/dist/queries/buildQuery.js.map +0 -1
  162. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +0 -2
  163. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +0 -1
  164. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +0 -14
  165. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +0 -1
  166. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +0 -2
  167. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +0 -1
  168. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +0 -5
  169. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +0 -1
  170. package/dist/queries/createJSONQuery/index.d.ts +0 -10
  171. package/dist/queries/createJSONQuery/index.d.ts.map +0 -1
  172. package/dist/queries/createJSONQuery/index.js +0 -54
  173. package/dist/queries/createJSONQuery/index.js.map +0 -1
  174. package/dist/queries/getTableColumnFromPath.d.ts +0 -51
  175. package/dist/queries/getTableColumnFromPath.d.ts.map +0 -1
  176. package/dist/queries/getTableColumnFromPath.js +0 -445
  177. package/dist/queries/getTableColumnFromPath.js.map +0 -1
  178. package/dist/queries/operatorMap.d.ts +0 -18
  179. package/dist/queries/operatorMap.d.ts.map +0 -1
  180. package/dist/queries/operatorMap.js +0 -24
  181. package/dist/queries/operatorMap.js.map +0 -1
  182. package/dist/queries/parseParams.d.ts +0 -17
  183. package/dist/queries/parseParams.d.ts.map +0 -1
  184. package/dist/queries/parseParams.js +0 -182
  185. package/dist/queries/parseParams.js.map +0 -1
  186. package/dist/queries/sanitizeQueryValue.d.ts +0 -15
  187. package/dist/queries/sanitizeQueryValue.d.ts.map +0 -1
  188. package/dist/queries/sanitizeQueryValue.js +0 -90
  189. package/dist/queries/sanitizeQueryValue.js.map +0 -1
  190. package/dist/queries/selectDistinct.d.ts +0 -23
  191. package/dist/queries/selectDistinct.d.ts.map +0 -1
  192. package/dist/queries/selectDistinct.js +0 -41
  193. package/dist/queries/selectDistinct.js.map +0 -1
  194. package/dist/queryDrafts.d.ts +0 -3
  195. package/dist/queryDrafts.d.ts.map +0 -1
  196. package/dist/queryDrafts.js +0 -41
  197. package/dist/queryDrafts.js.map +0 -1
  198. package/dist/schema/build.d.ts +0 -30
  199. package/dist/schema/build.d.ts.map +0 -1
  200. package/dist/schema/build.js +0 -320
  201. package/dist/schema/build.js.map +0 -1
  202. package/dist/schema/createIndex.d.ts +0 -12
  203. package/dist/schema/createIndex.d.ts.map +0 -1
  204. package/dist/schema/createIndex.js +0 -18
  205. package/dist/schema/createIndex.js.map +0 -1
  206. package/dist/schema/createTableName.d.ts +0 -30
  207. package/dist/schema/createTableName.d.ts.map +0 -1
  208. package/dist/schema/createTableName.js +0 -31
  209. package/dist/schema/createTableName.js.map +0 -1
  210. package/dist/schema/idToUUID.d.ts +0 -3
  211. package/dist/schema/idToUUID.d.ts.map +0 -1
  212. package/dist/schema/idToUUID.js +0 -11
  213. package/dist/schema/idToUUID.js.map +0 -1
  214. package/dist/schema/parentIDColumnMap.d.ts +0 -4
  215. package/dist/schema/parentIDColumnMap.d.ts.map +0 -1
  216. package/dist/schema/parentIDColumnMap.js +0 -9
  217. package/dist/schema/parentIDColumnMap.js.map +0 -1
  218. package/dist/schema/setColumnID.d.ts +0 -11
  219. package/dist/schema/setColumnID.d.ts.map +0 -1
  220. package/dist/schema/setColumnID.js +0 -24
  221. package/dist/schema/setColumnID.js.map +0 -1
  222. package/dist/schema/traverseFields.d.ts +0 -38
  223. package/dist/schema/traverseFields.d.ts.map +0 -1
  224. package/dist/schema/traverseFields.js +0 -551
  225. package/dist/schema/traverseFields.js.map +0 -1
  226. package/dist/schema/validateExistingBlockIsIdentical.d.ts +0 -12
  227. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +0 -1
  228. package/dist/schema/validateExistingBlockIsIdentical.js +0 -76
  229. package/dist/schema/validateExistingBlockIsIdentical.js.map +0 -1
  230. package/dist/transactions/beginTransaction.d.ts +0 -3
  231. package/dist/transactions/beginTransaction.d.ts.map +0 -1
  232. package/dist/transactions/beginTransaction.js +0 -47
  233. package/dist/transactions/beginTransaction.js.map +0 -1
  234. package/dist/transactions/commitTransaction.d.ts +0 -3
  235. package/dist/transactions/commitTransaction.d.ts.map +0 -1
  236. package/dist/transactions/commitTransaction.js +0 -14
  237. package/dist/transactions/commitTransaction.js.map +0 -1
  238. package/dist/transactions/rollbackTransaction.d.ts +0 -3
  239. package/dist/transactions/rollbackTransaction.d.ts.map +0 -1
  240. package/dist/transactions/rollbackTransaction.js +0 -13
  241. package/dist/transactions/rollbackTransaction.js.map +0 -1
  242. package/dist/transform/read/hasManyNumber.d.ts +0 -10
  243. package/dist/transform/read/hasManyNumber.d.ts.map +0 -1
  244. package/dist/transform/read/hasManyNumber.js +0 -10
  245. package/dist/transform/read/hasManyNumber.js.map +0 -1
  246. package/dist/transform/read/hasManyText.d.ts +0 -10
  247. package/dist/transform/read/hasManyText.d.ts.map +0 -1
  248. package/dist/transform/read/hasManyText.js +0 -10
  249. package/dist/transform/read/hasManyText.js.map +0 -1
  250. package/dist/transform/read/index.d.ts +0 -12
  251. package/dist/transform/read/index.d.ts.map +0 -1
  252. package/dist/transform/read/index.js +0 -43
  253. package/dist/transform/read/index.js.map +0 -1
  254. package/dist/transform/read/relationship.d.ts +0 -10
  255. package/dist/transform/read/relationship.d.ts.map +0 -1
  256. package/dist/transform/read/relationship.js +0 -64
  257. package/dist/transform/read/relationship.js.map +0 -1
  258. package/dist/transform/read/traverseFields.d.ts +0 -52
  259. package/dist/transform/read/traverseFields.d.ts.map +0 -1
  260. package/dist/transform/read/traverseFields.js +0 -421
  261. package/dist/transform/read/traverseFields.js.map +0 -1
  262. package/dist/transform/write/array.d.ts +0 -26
  263. package/dist/transform/write/array.d.ts.map +0 -1
  264. package/dist/transform/write/array.js +0 -58
  265. package/dist/transform/write/array.js.map +0 -1
  266. package/dist/transform/write/blocks.d.ts +0 -25
  267. package/dist/transform/write/blocks.d.ts.map +0 -1
  268. package/dist/transform/write/blocks.js +0 -54
  269. package/dist/transform/write/blocks.js.map +0 -1
  270. package/dist/transform/write/index.d.ts +0 -13
  271. package/dist/transform/write/index.d.ts.map +0 -1
  272. package/dist/transform/write/index.js +0 -41
  273. package/dist/transform/write/index.js.map +0 -1
  274. package/dist/transform/write/numbers.d.ts +0 -8
  275. package/dist/transform/write/numbers.d.ts.map +0 -1
  276. package/dist/transform/write/numbers.js +0 -11
  277. package/dist/transform/write/numbers.js.map +0 -1
  278. package/dist/transform/write/relationships.d.ts +0 -10
  279. package/dist/transform/write/relationships.d.ts.map +0 -1
  280. package/dist/transform/write/relationships.js +0 -23
  281. package/dist/transform/write/relationships.js.map +0 -1
  282. package/dist/transform/write/selects.d.ts +0 -8
  283. package/dist/transform/write/selects.d.ts.map +0 -1
  284. package/dist/transform/write/selects.js +0 -20
  285. package/dist/transform/write/selects.js.map +0 -1
  286. package/dist/transform/write/texts.d.ts +0 -8
  287. package/dist/transform/write/texts.d.ts.map +0 -1
  288. package/dist/transform/write/texts.js +0 -11
  289. package/dist/transform/write/texts.js.map +0 -1
  290. package/dist/transform/write/traverseFields.d.ts +0 -50
  291. package/dist/transform/write/traverseFields.d.ts.map +0 -1
  292. package/dist/transform/write/traverseFields.js +0 -428
  293. package/dist/transform/write/traverseFields.js.map +0 -1
  294. package/dist/transform/write/types.d.ts +0 -43
  295. package/dist/transform/write/types.d.ts.map +0 -1
  296. package/dist/transform/write/types.js +0 -3
  297. package/dist/transform/write/types.js.map +0 -1
  298. package/dist/update.d.ts +0 -3
  299. package/dist/update.d.ts.map +0 -1
  300. package/dist/update.js +0 -55
  301. package/dist/update.js.map +0 -1
  302. package/dist/updateGlobal.d.ts +0 -5
  303. package/dist/updateGlobal.d.ts.map +0 -1
  304. package/dist/updateGlobal.js +0 -25
  305. package/dist/updateGlobal.js.map +0 -1
  306. package/dist/updateGlobalVersion.d.ts +0 -5
  307. package/dist/updateGlobalVersion.d.ts.map +0 -1
  308. package/dist/updateGlobalVersion.js +0 -36
  309. package/dist/updateGlobalVersion.js.map +0 -1
  310. package/dist/updateVersion.d.ts +0 -5
  311. package/dist/updateVersion.d.ts.map +0 -1
  312. package/dist/updateVersion.js +0 -36
  313. package/dist/updateVersion.js.map +0 -1
  314. package/dist/upsertRow/deleteExistingArrayRows.d.ts +0 -10
  315. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +0 -1
  316. package/dist/upsertRow/deleteExistingArrayRows.js +0 -10
  317. package/dist/upsertRow/deleteExistingArrayRows.js.map +0 -1
  318. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +0 -14
  319. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +0 -1
  320. package/dist/upsertRow/deleteExistingRowsByPath.js +0 -33
  321. package/dist/upsertRow/deleteExistingRowsByPath.js.map +0 -1
  322. package/dist/upsertRow/index.d.ts +0 -4
  323. package/dist/upsertRow/index.d.ts.map +0 -1
  324. package/dist/upsertRow/index.js +0 -277
  325. package/dist/upsertRow/index.js.map +0 -1
  326. package/dist/upsertRow/insertArrays.d.ts +0 -13
  327. package/dist/upsertRow/insertArrays.d.ts.map +0 -1
  328. package/dist/upsertRow/insertArrays.js +0 -68
  329. package/dist/upsertRow/insertArrays.js.map +0 -1
  330. package/dist/upsertRow/types.d.ts +0 -27
  331. package/dist/upsertRow/types.d.ts.map +0 -1
  332. package/dist/upsertRow/types.js +0 -3
  333. package/dist/upsertRow/types.js.map +0 -1
  334. package/dist/utilities/appendPrefixToKeys.d.ts +0 -2
  335. package/dist/utilities/appendPrefixToKeys.d.ts.map +0 -1
  336. package/dist/utilities/appendPrefixToKeys.js +0 -6
  337. package/dist/utilities/appendPrefixToKeys.js.map +0 -1
  338. package/dist/utilities/createBlocksMap.d.ts +0 -5
  339. package/dist/utilities/createBlocksMap.d.ts.map +0 -1
  340. package/dist/utilities/createBlocksMap.js +0 -29
  341. package/dist/utilities/createBlocksMap.js.map +0 -1
  342. package/dist/utilities/createMigrationTable.d.ts +0 -3
  343. package/dist/utilities/createMigrationTable.d.ts.map +0 -1
  344. package/dist/utilities/createMigrationTable.js +0 -13
  345. package/dist/utilities/createMigrationTable.js.map +0 -1
  346. package/dist/utilities/createRelationshipMap.d.ts +0 -2
  347. package/dist/utilities/createRelationshipMap.d.ts.map +0 -1
  348. package/dist/utilities/createRelationshipMap.js +0 -19
  349. package/dist/utilities/createRelationshipMap.js.map +0 -1
  350. package/dist/utilities/hasLocalesTable.d.ts +0 -3
  351. package/dist/utilities/hasLocalesTable.d.ts.map +0 -1
  352. package/dist/utilities/hasLocalesTable.js +0 -11
  353. package/dist/utilities/hasLocalesTable.js.map +0 -1
  354. package/dist/utilities/isArrayOfRows.d.ts +0 -2
  355. package/dist/utilities/isArrayOfRows.d.ts.map +0 -1
  356. package/dist/utilities/isArrayOfRows.js +0 -5
  357. package/dist/utilities/isArrayOfRows.js.map +0 -1
  358. package/dist/utilities/migrationTableExists.d.ts +0 -3
  359. package/dist/utilities/migrationTableExists.d.ts.map +0 -1
  360. package/dist/utilities/migrationTableExists.js +0 -9
  361. package/dist/utilities/migrationTableExists.js.map +0 -1
  362. package/dist/utilities/parseError.d.ts +0 -5
  363. package/dist/utilities/parseError.d.ts.map +0 -1
  364. package/dist/utilities/parseError.js +0 -17
  365. package/dist/utilities/parseError.js.map +0 -1
  366. package/dist/utilities/pushDevSchema.d.ts +0 -9
  367. package/dist/utilities/pushDevSchema.d.ts.map +0 -1
  368. package/dist/utilities/pushDevSchema.js +0 -58
  369. package/dist/utilities/pushDevSchema.js.map +0 -1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C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,iBAAiB,EAAE,OAAO,CAAA;IAC1B,2BAA2B,EAAE,OAAO,CAAA;IACpC,yBAAyB,EAAE,OAAO,CAAA;IAClC,6BAA6B,EAAE,OAAO,CAAA;IACtC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,cAAc,sUAuBxB,IAAI,KAAG,MAsnBT,CAAA"}
@@ -1,551 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import { relations } from 'drizzle-orm';
2
- import { PgNumericBuilder, PgUUIDBuilder, PgVarcharBuilder, boolean, foreignKey, index, integer, jsonb, numeric, pgEnum, text, timestamp, varchar } from 'drizzle-orm/pg-core';
3
- import { InvalidConfiguration } from 'payload/errors';
4
- import { fieldAffectsData, optionIsObject } from 'payload/types';
5
- import toSnakeCase from 'to-snake-case';
6
- import { hasLocalesTable } from '../utilities/hasLocalesTable.js';
7
- import { buildTable } from './build.js';
8
- import { createIndex } from './createIndex.js';
9
- import { createTableName } from './createTableName.js';
10
- import { idToUUID } from './idToUUID.js';
11
- import { parentIDColumnMap } from './parentIDColumnMap.js';
12
- import { validateExistingBlockIsIdentical } from './validateExistingBlockIsIdentical.js';
13
- export const traverseFields = ({ adapter, buildNumbers, buildRelationships, buildTexts, columnPrefix, columns, disableNotNull, disableUnique = false, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName, versions })=>{
14
- const throwValidationError = true;
15
- let hasLocalizedField = false;
16
- let hasLocalizedRelationshipField = false;
17
- let hasManyTextField = false;
18
- let hasLocalizedManyTextField = false;
19
- let hasManyNumberField = false;
20
- let hasLocalizedManyNumberField = false;
21
- let parentIDColType = 'integer';
22
- if (columns.id instanceof PgUUIDBuilder) parentIDColType = 'uuid';
23
- if (columns.id instanceof PgNumericBuilder) parentIDColType = 'numeric';
24
- if (columns.id instanceof PgVarcharBuilder) parentIDColType = 'varchar';
25
- fields.forEach((field)=>{
26
- if ('name' in field && field.name === 'id') return;
27
- let columnName;
28
- let fieldName;
29
- let targetTable = columns;
30
- let targetIndexes = indexes;
31
- if (fieldAffectsData(field)) {
32
- columnName = `${columnPrefix || ''}${field.name[0] === '_' ? '_' : ''}${toSnakeCase(field.name)}`;
33
- fieldName = `${fieldPrefix?.replace('.', '_') || ''}${field.name}`;
34
- // If field is localized,
35
- // add the column to the locale table instead of main table
36
- if (adapter.payload.config.localization && (field.localized || forceLocalized)) {
37
- hasLocalizedField = true;
38
- targetTable = localesColumns;
39
- targetIndexes = localesIndexes;
40
- }
41
- if ((field.unique || field.index) && ![
42
- 'array',
43
- 'blocks',
44
- 'group',
45
- 'point',
46
- 'relationship',
47
- 'upload'
48
- ].includes(field.type) && !('hasMany' in field && field.hasMany === true)) {
49
- const unique = disableUnique !== true && field.unique;
50
- if (unique) {
51
- const constraintValue = `${fieldPrefix || ''}${field.name}`;
52
- if (!adapter.fieldConstraints?.[rootTableName]) {
53
- adapter.fieldConstraints[rootTableName] = {};
54
- }
55
- adapter.fieldConstraints[rootTableName][`${columnName}_idx`] = constraintValue;
56
- }
57
- targetIndexes[`${newTableName}_${field.name}Idx`] = createIndex({
58
- name: fieldName,
59
- columnName,
60
- tableName: newTableName,
61
- unique
62
- });
63
- }
64
- }
65
- switch(field.type){
66
- case 'text':
67
- {
68
- if (field.hasMany) {
69
- if (field.localized) {
70
- hasLocalizedManyTextField = true;
71
- }
72
- if (field.index) {
73
- hasManyTextField = 'index';
74
- } else if (!hasManyTextField) {
75
- hasManyTextField = true;
76
- }
77
- if (field.unique) {
78
- throw new InvalidConfiguration('Unique is not supported in Postgres for hasMany text fields.');
79
- }
80
- } else {
81
- targetTable[fieldName] = varchar(columnName);
82
- }
83
- break;
84
- }
85
- case 'email':
86
- case 'code':
87
- case 'textarea':
88
- {
89
- targetTable[fieldName] = varchar(columnName);
90
- break;
91
- }
92
- case 'number':
93
- {
94
- if (field.hasMany) {
95
- if (field.localized) {
96
- hasLocalizedManyNumberField = true;
97
- }
98
- if (field.index) {
99
- hasManyNumberField = 'index';
100
- } else if (!hasManyNumberField) {
101
- hasManyNumberField = true;
102
- }
103
- if (field.unique) {
104
- throw new InvalidConfiguration('Unique is not supported in Postgres for hasMany number fields.');
105
- }
106
- } else {
107
- targetTable[fieldName] = numeric(columnName);
108
- }
109
- break;
110
- }
111
- case 'richText':
112
- case 'json':
113
- {
114
- targetTable[fieldName] = jsonb(columnName);
115
- break;
116
- }
117
- case 'date':
118
- {
119
- targetTable[fieldName] = timestamp(columnName, {
120
- mode: 'string',
121
- precision: 3,
122
- withTimezone: true
123
- });
124
- break;
125
- }
126
- case 'point':
127
- {
128
- break;
129
- }
130
- case 'radio':
131
- case 'select':
132
- {
133
- const enumName = createTableName({
134
- adapter,
135
- config: field,
136
- parentTableName: newTableName,
137
- prefix: `enum_${newTableName}_`,
138
- target: 'enumName',
139
- throwValidationError
140
- });
141
- adapter.enums[enumName] = pgEnum(enumName, field.options.map((option)=>{
142
- if (optionIsObject(option)) {
143
- return option.value;
144
- }
145
- return option;
146
- }));
147
- if (field.type === 'select' && field.hasMany) {
148
- const selectTableName = createTableName({
149
- adapter,
150
- config: field,
151
- parentTableName: newTableName,
152
- prefix: `${newTableName}_`,
153
- throwValidationError
154
- });
155
- const baseColumns = {
156
- order: integer('order').notNull(),
157
- parent: parentIDColumnMap[parentIDColType]('parent_id').notNull(),
158
- value: adapter.enums[enumName]('value')
159
- };
160
- const baseExtraConfig = {
161
- orderIdx: (cols)=>index(`${selectTableName}_order_idx`).on(cols.order),
162
- parentFk: (cols)=>foreignKey({
163
- name: `${selectTableName}_parent_fk`,
164
- columns: [
165
- cols.parent
166
- ],
167
- foreignColumns: [
168
- adapter.tables[parentTableName].id
169
- ]
170
- }),
171
- parentIdx: (cols)=>index(`${selectTableName}_parent_idx`).on(cols.parent)
172
- };
173
- if (field.localized) {
174
- baseColumns.locale = adapter.enums.enum__locales('locale').notNull();
175
- baseExtraConfig.localeIdx = (cols)=>index(`${selectTableName}_locale_idx`).on(cols.locale);
176
- }
177
- if (field.index) {
178
- baseExtraConfig.value = (cols)=>index(`${selectTableName}_value_idx`).on(cols.value);
179
- }
180
- buildTable({
181
- adapter,
182
- baseColumns,
183
- baseExtraConfig,
184
- disableNotNull,
185
- disableUnique,
186
- fields: [],
187
- tableName: selectTableName,
188
- versions
189
- });
190
- relationsToBuild.set(fieldName, selectTableName);
191
- const selectTableRelations = relations(adapter.tables[selectTableName], ({ one })=>{
192
- const result = {
193
- parent: one(adapter.tables[parentTableName], {
194
- fields: [
195
- adapter.tables[selectTableName].parent
196
- ],
197
- references: [
198
- adapter.tables[parentTableName].id
199
- ]
200
- })
201
- };
202
- return result;
203
- });
204
- adapter.relations[`relation_${selectTableName}`] = selectTableRelations;
205
- } else {
206
- targetTable[fieldName] = adapter.enums[enumName](fieldName);
207
- }
208
- break;
209
- }
210
- case 'checkbox':
211
- {
212
- targetTable[fieldName] = boolean(columnName);
213
- break;
214
- }
215
- case 'array':
216
- {
217
- const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
218
- const arrayTableName = createTableName({
219
- adapter,
220
- config: field,
221
- parentTableName: newTableName,
222
- prefix: `${newTableName}_`,
223
- throwValidationError,
224
- versionsCustomName: versions
225
- });
226
- const baseColumns = {
227
- _order: integer('_order').notNull(),
228
- _parentID: parentIDColumnMap[parentIDColType]('_parent_id').notNull()
229
- };
230
- const baseExtraConfig = {
231
- _orderIdx: (cols)=>index(`${arrayTableName}_order_idx`).on(cols._order),
232
- _parentIDFk: (cols)=>foreignKey({
233
- name: `${arrayTableName}_parent_id_fk`,
234
- columns: [
235
- cols['_parentID']
236
- ],
237
- foreignColumns: [
238
- adapter.tables[parentTableName].id
239
- ]
240
- }).onDelete('cascade'),
241
- _parentIDIdx: (cols)=>index(`${arrayTableName}_parent_id_idx`).on(cols._parentID)
242
- };
243
- if (field.localized && adapter.payload.config.localization) {
244
- baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
245
- baseExtraConfig._localeIdx = (cols)=>index(`${arrayTableName}_locale_idx`).on(cols._locale);
246
- }
247
- const { hasManyNumberField: subHasManyNumberField, hasManyTextField: subHasManyTextField, relationsToBuild: subRelationsToBuild } = buildTable({
248
- adapter,
249
- baseColumns,
250
- baseExtraConfig,
251
- disableNotNull: disableNotNullFromHere,
252
- disableUnique,
253
- fields: disableUnique ? idToUUID(field.fields) : field.fields,
254
- rootRelationsToBuild,
255
- rootRelationships: relationships,
256
- rootTableIDColType,
257
- rootTableName,
258
- tableName: arrayTableName,
259
- versions
260
- });
261
- if (subHasManyTextField) {
262
- if (!hasManyTextField || subHasManyTextField === 'index') hasManyTextField = subHasManyTextField;
263
- }
264
- if (subHasManyNumberField) {
265
- if (!hasManyNumberField || subHasManyNumberField === 'index') hasManyNumberField = subHasManyNumberField;
266
- }
267
- relationsToBuild.set(fieldName, arrayTableName);
268
- const arrayTableRelations = relations(adapter.tables[arrayTableName], ({ many, one })=>{
269
- const result = {
270
- _parentID: one(adapter.tables[parentTableName], {
271
- fields: [
272
- adapter.tables[arrayTableName]._parentID
273
- ],
274
- references: [
275
- adapter.tables[parentTableName].id
276
- ]
277
- })
278
- };
279
- if (hasLocalesTable(field.fields)) {
280
- result._locales = many(adapter.tables[`${arrayTableName}${adapter.localesSuffix}`]);
281
- }
282
- subRelationsToBuild.forEach((val, key)=>{
283
- result[key] = many(adapter.tables[val]);
284
- });
285
- return result;
286
- });
287
- adapter.relations[`relations_${arrayTableName}`] = arrayTableRelations;
288
- break;
289
- }
290
- case 'blocks':
291
- {
292
- const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
293
- field.blocks.forEach((block)=>{
294
- const blockTableName = createTableName({
295
- adapter,
296
- config: block,
297
- parentTableName: rootTableName,
298
- prefix: `${rootTableName}_blocks_`,
299
- throwValidationError,
300
- versionsCustomName: versions
301
- });
302
- if (!adapter.tables[blockTableName]) {
303
- const baseColumns = {
304
- _order: integer('_order').notNull(),
305
- _parentID: parentIDColumnMap[rootTableIDColType]('_parent_id').notNull(),
306
- _path: text('_path').notNull()
307
- };
308
- const baseExtraConfig = {
309
- _orderIdx: (cols)=>index(`${blockTableName}_order_idx`).on(cols._order),
310
- _parentIDIdx: (cols)=>index(`${blockTableName}_parent_id_idx`).on(cols._parentID),
311
- _parentIdFk: (cols)=>foreignKey({
312
- name: `${blockTableName}_parent_id_fk`,
313
- columns: [
314
- cols._parentID
315
- ],
316
- foreignColumns: [
317
- adapter.tables[rootTableName].id
318
- ]
319
- }).onDelete('cascade'),
320
- _pathIdx: (cols)=>index(`${blockTableName}_path_idx`).on(cols._path)
321
- };
322
- if (field.localized && adapter.payload.config.localization) {
323
- baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
324
- baseExtraConfig._localeIdx = (cols)=>index(`${blockTableName}_locale_idx`).on(cols._locale);
325
- }
326
- const { hasManyNumberField: subHasManyNumberField, hasManyTextField: subHasManyTextField, relationsToBuild: subRelationsToBuild } = buildTable({
327
- adapter,
328
- baseColumns,
329
- baseExtraConfig,
330
- disableNotNull: disableNotNullFromHere,
331
- disableUnique,
332
- fields: disableUnique ? idToUUID(block.fields) : block.fields,
333
- rootRelationsToBuild,
334
- rootRelationships: relationships,
335
- rootTableIDColType,
336
- rootTableName,
337
- tableName: blockTableName,
338
- versions
339
- });
340
- if (subHasManyTextField) {
341
- if (!hasManyTextField || subHasManyTextField === 'index') hasManyTextField = subHasManyTextField;
342
- }
343
- if (subHasManyNumberField) {
344
- if (!hasManyNumberField || subHasManyNumberField === 'index') hasManyNumberField = subHasManyNumberField;
345
- }
346
- const blockTableRelations = relations(adapter.tables[blockTableName], ({ many, one })=>{
347
- const result = {
348
- _parentID: one(adapter.tables[rootTableName], {
349
- fields: [
350
- adapter.tables[blockTableName]._parentID
351
- ],
352
- references: [
353
- adapter.tables[rootTableName].id
354
- ]
355
- })
356
- };
357
- if (hasLocalesTable(block.fields)) {
358
- result._locales = many(adapter.tables[`${blockTableName}${adapter.localesSuffix}`]);
359
- }
360
- subRelationsToBuild.forEach((val, key)=>{
361
- result[key] = many(adapter.tables[val]);
362
- });
363
- return result;
364
- });
365
- adapter.relations[`relations_${blockTableName}`] = blockTableRelations;
366
- } else if (process.env.NODE_ENV !== 'production' && !versions) {
367
- validateExistingBlockIsIdentical({
368
- block,
369
- localized: field.localized,
370
- rootTableName,
371
- table: adapter.tables[blockTableName],
372
- tableLocales: adapter.tables[`${blockTableName}${adapter.localesSuffix}`]
373
- });
374
- }
375
- rootRelationsToBuild.set(`_blocks_${block.slug}`, blockTableName);
376
- });
377
- break;
378
- }
379
- case 'tab':
380
- case 'group':
381
- {
382
- if (!('name' in field)) {
383
- const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedManyTextField: groupHasLocalizedManyTextField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyNumberField: groupHasManyNumberField, hasManyTextField: groupHasManyTextField } = traverseFields({
384
- adapter,
385
- buildNumbers,
386
- buildRelationships,
387
- buildTexts,
388
- columnPrefix,
389
- columns,
390
- disableNotNull,
391
- disableUnique,
392
- fieldPrefix,
393
- fields: field.fields,
394
- forceLocalized,
395
- indexes,
396
- localesColumns,
397
- localesIndexes,
398
- newTableName,
399
- parentTableName,
400
- relationsToBuild,
401
- relationships,
402
- rootRelationsToBuild,
403
- rootTableIDColType,
404
- rootTableName,
405
- versions
406
- });
407
- if (groupHasLocalizedField) hasLocalizedField = true;
408
- if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
409
- if (groupHasManyTextField) hasManyTextField = true;
410
- if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true;
411
- if (groupHasManyNumberField) hasManyNumberField = true;
412
- if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
413
- break;
414
- }
415
- const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
416
- const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedManyTextField: groupHasLocalizedManyTextField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyNumberField: groupHasManyNumberField, hasManyTextField: groupHasManyTextField } = traverseFields({
417
- adapter,
418
- buildNumbers,
419
- buildRelationships,
420
- buildTexts,
421
- columnPrefix: `${columnName}_`,
422
- columns,
423
- disableNotNull: disableNotNullFromHere,
424
- disableUnique,
425
- fieldPrefix: `${fieldName}.`,
426
- fields: field.fields,
427
- forceLocalized: field.localized,
428
- indexes,
429
- localesColumns,
430
- localesIndexes,
431
- newTableName: `${parentTableName}_${columnName}`,
432
- parentTableName,
433
- relationsToBuild,
434
- relationships,
435
- rootRelationsToBuild,
436
- rootTableIDColType,
437
- rootTableName,
438
- versions
439
- });
440
- if (groupHasLocalizedField) hasLocalizedField = true;
441
- if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
442
- if (groupHasManyTextField) hasManyTextField = true;
443
- if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true;
444
- if (groupHasManyNumberField) hasManyNumberField = true;
445
- if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
446
- break;
447
- }
448
- case 'tabs':
449
- {
450
- const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
451
- const { hasLocalizedField: tabHasLocalizedField, hasLocalizedManyNumberField: tabHasLocalizedManyNumberField, hasLocalizedManyTextField: tabHasLocalizedManyTextField, hasLocalizedRelationshipField: tabHasLocalizedRelationshipField, hasManyNumberField: tabHasManyNumberField, hasManyTextField: tabHasManyTextField } = traverseFields({
452
- adapter,
453
- buildNumbers,
454
- buildRelationships,
455
- buildTexts,
456
- columnPrefix,
457
- columns,
458
- disableNotNull: disableNotNullFromHere,
459
- disableUnique,
460
- fieldPrefix,
461
- fields: field.tabs.map((tab)=>({
462
- ...tab,
463
- type: 'tab'
464
- })),
465
- forceLocalized,
466
- indexes,
467
- localesColumns,
468
- localesIndexes,
469
- newTableName,
470
- parentTableName,
471
- relationsToBuild,
472
- relationships,
473
- rootRelationsToBuild,
474
- rootTableIDColType,
475
- rootTableName,
476
- versions
477
- });
478
- if (tabHasLocalizedField) hasLocalizedField = true;
479
- if (tabHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
480
- if (tabHasManyTextField) hasManyTextField = true;
481
- if (tabHasLocalizedManyTextField) hasLocalizedManyTextField = true;
482
- if (tabHasManyNumberField) hasManyNumberField = true;
483
- if (tabHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
484
- break;
485
- }
486
- case 'row':
487
- case 'collapsible':
488
- {
489
- const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
490
- const { hasLocalizedField: rowHasLocalizedField, hasLocalizedManyNumberField: rowHasLocalizedManyNumberField, hasLocalizedManyTextField: rowHasLocalizedManyTextField, hasLocalizedRelationshipField: rowHasLocalizedRelationshipField, hasManyNumberField: rowHasManyNumberField, hasManyTextField: rowHasManyTextField } = traverseFields({
491
- adapter,
492
- buildNumbers,
493
- buildRelationships,
494
- buildTexts,
495
- columnPrefix,
496
- columns,
497
- disableNotNull: disableNotNullFromHere,
498
- disableUnique,
499
- fieldPrefix,
500
- fields: field.fields,
501
- forceLocalized,
502
- indexes,
503
- localesColumns,
504
- localesIndexes,
505
- newTableName,
506
- parentTableName,
507
- relationsToBuild,
508
- relationships,
509
- rootRelationsToBuild,
510
- rootTableIDColType,
511
- rootTableName,
512
- versions
513
- });
514
- if (rowHasLocalizedField) hasLocalizedField = true;
515
- if (rowHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
516
- if (rowHasManyTextField) hasManyTextField = true;
517
- if (rowHasLocalizedManyTextField) hasLocalizedManyTextField = true;
518
- if (rowHasManyNumberField) hasManyNumberField = true;
519
- if (rowHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
520
- break;
521
- }
522
- case 'relationship':
523
- case 'upload':
524
- if (Array.isArray(field.relationTo)) {
525
- field.relationTo.forEach((relation)=>relationships.add(relation));
526
- } else {
527
- relationships.add(field.relationTo);
528
- }
529
- if (field.localized && adapter.payload.config.localization) {
530
- hasLocalizedRelationshipField = true;
531
- }
532
- break;
533
- default:
534
- break;
535
- }
536
- const condition = field.admin && field.admin.condition;
537
- if (!disableNotNull && targetTable[fieldName] && 'required' in field && field.required && !condition) {
538
- targetTable[fieldName].notNull();
539
- }
540
- });
541
- return {
542
- hasLocalizedField,
543
- hasLocalizedManyNumberField,
544
- hasLocalizedManyTextField,
545
- hasLocalizedRelationshipField,
546
- hasManyNumberField,
547
- hasManyTextField
548
- };
549
- };
550
-
551
- //# sourceMappingURL=traverseFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/traverseFields.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { Relation } from 'drizzle-orm'\nimport type { IndexBuilder, PgColumnBuilder } from 'drizzle-orm/pg-core'\nimport type { Field, TabAsField } from 'payload/types'\n\nimport { relations } from 'drizzle-orm'\nimport {\n PgNumericBuilder,\n PgUUIDBuilder,\n PgVarcharBuilder,\n boolean,\n foreignKey,\n index,\n integer,\n jsonb,\n numeric,\n pgEnum,\n text,\n timestamp,\n varchar,\n} from 'drizzle-orm/pg-core'\nimport { InvalidConfiguration } from 'payload/errors'\nimport { fieldAffectsData, optionIsObject } from 'payload/types'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { GenericColumns, IDType, PostgresAdapter } from '../types.js'\nimport type { BaseExtraConfig } from './build.js'\n\nimport { hasLocalesTable } from '../utilities/hasLocalesTable.js'\nimport { buildTable } from './build.js'\nimport { createIndex } from './createIndex.js'\nimport { createTableName } from './createTableName.js'\nimport { idToUUID } from './idToUUID.js'\nimport { parentIDColumnMap } from './parentIDColumnMap.js'\nimport { validateExistingBlockIsIdentical } from './validateExistingBlockIsIdentical.js'\n\ntype Args = {\n adapter: PostgresAdapter\n buildNumbers: boolean\n buildRelationships: boolean\n buildTexts: boolean\n columnPrefix?: string\n columns: Record<string, PgColumnBuilder>\n disableNotNull: boolean\n disableUnique?: boolean\n fieldPrefix?: string\n fields: (Field | TabAsField)[]\n forceLocalized?: boolean\n indexes: Record<string, (cols: GenericColumns) => IndexBuilder>\n localesColumns: Record<string, PgColumnBuilder>\n localesIndexes: Record<string, (cols: GenericColumns) => IndexBuilder>\n newTableName: string\n parentTableName: string\n relationsToBuild: Map<string, string>\n relationships: Set<string>\n rootRelationsToBuild?: Map<string, string>\n rootTableIDColType: string\n rootTableName: string\n versions: boolean\n}\n\ntype Result = {\n hasLocalizedField: boolean\n hasLocalizedManyNumberField: boolean\n hasLocalizedManyTextField: boolean\n hasLocalizedRelationshipField: boolean\n hasManyNumberField: 'index' | boolean\n hasManyTextField: 'index' | boolean\n}\n\nexport const traverseFields = ({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columnPrefix,\n columns,\n disableNotNull,\n disableUnique = false,\n fieldPrefix,\n fields,\n forceLocalized,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName,\n parentTableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild,\n rootTableIDColType,\n rootTableName,\n versions,\n}: Args): Result => {\n const throwValidationError = true\n let hasLocalizedField = false\n let hasLocalizedRelationshipField = false\n let hasManyTextField: 'index' | boolean = false\n let hasLocalizedManyTextField = false\n let hasManyNumberField: 'index' | boolean = false\n let hasLocalizedManyNumberField = false\n\n let parentIDColType: IDType = 'integer'\n if (columns.id instanceof PgUUIDBuilder) parentIDColType = 'uuid'\n if (columns.id instanceof PgNumericBuilder) parentIDColType = 'numeric'\n if (columns.id instanceof PgVarcharBuilder) parentIDColType = 'varchar'\n\n fields.forEach((field) => {\n if ('name' in field && field.name === 'id') return\n let columnName: string\n let fieldName: string\n\n let targetTable = columns\n let targetIndexes = indexes\n\n if (fieldAffectsData(field)) {\n columnName = `${columnPrefix || ''}${field.name[0] === '_' ? '_' : ''}${toSnakeCase(\n field.name,\n )}`\n fieldName = `${fieldPrefix?.replace('.', '_') || ''}${field.name}`\n\n // If field is localized,\n // add the column to the locale table instead of main table\n if (adapter.payload.config.localization && (field.localized || forceLocalized)) {\n hasLocalizedField = true\n targetTable = localesColumns\n targetIndexes = localesIndexes\n }\n\n if (\n (field.unique || field.index) &&\n !['array', 'blocks', 'group', 'point', 'relationship', 'upload'].includes(field.type) &&\n !('hasMany' in field && field.hasMany === true)\n ) {\n const unique = disableUnique !== true && field.unique\n if (unique) {\n const constraintValue = `${fieldPrefix || ''}${field.name}`\n if (!adapter.fieldConstraints?.[rootTableName]) {\n adapter.fieldConstraints[rootTableName] = {}\n }\n adapter.fieldConstraints[rootTableName][`${columnName}_idx`] = constraintValue\n }\n targetIndexes[`${newTableName}_${field.name}Idx`] = createIndex({\n name: fieldName,\n columnName,\n tableName: newTableName,\n unique,\n })\n }\n }\n\n switch (field.type) {\n case 'text': {\n if (field.hasMany) {\n if (field.localized) {\n hasLocalizedManyTextField = true\n }\n\n if (field.index) {\n hasManyTextField = 'index'\n } else if (!hasManyTextField) {\n hasManyTextField = true\n }\n\n if (field.unique) {\n throw new InvalidConfiguration(\n 'Unique is not supported in Postgres for hasMany text fields.',\n )\n }\n } else {\n targetTable[fieldName] = varchar(columnName)\n }\n break\n }\n case 'email':\n case 'code':\n case 'textarea': {\n targetTable[fieldName] = varchar(columnName)\n break\n }\n\n case 'number': {\n if (field.hasMany) {\n if (field.localized) {\n hasLocalizedManyNumberField = true\n }\n\n if (field.index) {\n hasManyNumberField = 'index'\n } else if (!hasManyNumberField) {\n hasManyNumberField = true\n }\n\n if (field.unique) {\n throw new InvalidConfiguration(\n 'Unique is not supported in Postgres for hasMany number fields.',\n )\n }\n } else {\n targetTable[fieldName] = numeric(columnName)\n }\n break\n }\n\n case 'richText':\n case 'json': {\n targetTable[fieldName] = jsonb(columnName)\n break\n }\n\n case 'date': {\n targetTable[fieldName] = timestamp(columnName, {\n mode: 'string',\n precision: 3,\n withTimezone: true,\n })\n break\n }\n\n case 'point': {\n break\n }\n\n case 'radio':\n case 'select': {\n const enumName = createTableName({\n adapter,\n config: field,\n parentTableName: newTableName,\n prefix: `enum_${newTableName}_`,\n target: 'enumName',\n throwValidationError,\n })\n\n adapter.enums[enumName] = pgEnum(\n enumName,\n field.options.map((option) => {\n if (optionIsObject(option)) {\n return option.value\n }\n\n return option\n }) as [string, ...string[]],\n )\n\n if (field.type === 'select' && field.hasMany) {\n const selectTableName = createTableName({\n adapter,\n config: field,\n parentTableName: newTableName,\n prefix: `${newTableName}_`,\n throwValidationError,\n })\n const baseColumns: Record<string, PgColumnBuilder> = {\n order: integer('order').notNull(),\n parent: parentIDColumnMap[parentIDColType]('parent_id').notNull(),\n value: adapter.enums[enumName]('value'),\n }\n\n const baseExtraConfig: BaseExtraConfig = {\n orderIdx: (cols) => index(`${selectTableName}_order_idx`).on(cols.order),\n parentFk: (cols) =>\n foreignKey({\n name: `${selectTableName}_parent_fk`,\n columns: [cols.parent],\n foreignColumns: [adapter.tables[parentTableName].id],\n }),\n parentIdx: (cols) => index(`${selectTableName}_parent_idx`).on(cols.parent),\n }\n\n if (field.localized) {\n baseColumns.locale = adapter.enums.enum__locales('locale').notNull()\n baseExtraConfig.localeIdx = (cols) =>\n index(`${selectTableName}_locale_idx`).on(cols.locale)\n }\n\n if (field.index) {\n baseExtraConfig.value = (cols) => index(`${selectTableName}_value_idx`).on(cols.value)\n }\n\n buildTable({\n adapter,\n baseColumns,\n baseExtraConfig,\n disableNotNull,\n disableUnique,\n fields: [],\n tableName: selectTableName,\n versions,\n })\n\n relationsToBuild.set(fieldName, selectTableName)\n\n const selectTableRelations = relations(adapter.tables[selectTableName], ({ one }) => {\n const result: Record<string, Relation<string>> = {\n parent: one(adapter.tables[parentTableName], {\n fields: [adapter.tables[selectTableName].parent],\n references: [adapter.tables[parentTableName].id],\n }),\n }\n\n return result\n })\n\n adapter.relations[`relation_${selectTableName}`] = selectTableRelations\n } else {\n targetTable[fieldName] = adapter.enums[enumName](fieldName)\n }\n break\n }\n\n case 'checkbox': {\n targetTable[fieldName] = boolean(columnName)\n break\n }\n\n case 'array': {\n const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull\n\n const arrayTableName = createTableName({\n adapter,\n config: field,\n parentTableName: newTableName,\n prefix: `${newTableName}_`,\n throwValidationError,\n versionsCustomName: versions,\n })\n\n const baseColumns: Record<string, PgColumnBuilder> = {\n _order: integer('_order').notNull(),\n _parentID: parentIDColumnMap[parentIDColType]('_parent_id').notNull(),\n }\n\n const baseExtraConfig: BaseExtraConfig = {\n _orderIdx: (cols) => index(`${arrayTableName}_order_idx`).on(cols._order),\n _parentIDFk: (cols) =>\n foreignKey({\n name: `${arrayTableName}_parent_id_fk`,\n columns: [cols['_parentID']],\n foreignColumns: [adapter.tables[parentTableName].id],\n }).onDelete('cascade'),\n _parentIDIdx: (cols) => index(`${arrayTableName}_parent_id_idx`).on(cols._parentID),\n }\n\n if (field.localized && adapter.payload.config.localization) {\n baseColumns._locale = adapter.enums.enum__locales('_locale').notNull()\n baseExtraConfig._localeIdx = (cols) =>\n index(`${arrayTableName}_locale_idx`).on(cols._locale)\n }\n\n const {\n hasManyNumberField: subHasManyNumberField,\n hasManyTextField: subHasManyTextField,\n relationsToBuild: subRelationsToBuild,\n } = buildTable({\n adapter,\n baseColumns,\n baseExtraConfig,\n disableNotNull: disableNotNullFromHere,\n disableUnique,\n fields: disableUnique ? idToUUID(field.fields) : field.fields,\n rootRelationsToBuild,\n rootRelationships: relationships,\n rootTableIDColType,\n rootTableName,\n tableName: arrayTableName,\n versions,\n })\n\n if (subHasManyTextField) {\n if (!hasManyTextField || subHasManyTextField === 'index')\n hasManyTextField = subHasManyTextField\n }\n if (subHasManyNumberField) {\n if (!hasManyNumberField || subHasManyNumberField === 'index')\n hasManyNumberField = subHasManyNumberField\n }\n\n relationsToBuild.set(fieldName, arrayTableName)\n\n const arrayTableRelations = relations(adapter.tables[arrayTableName], ({ many, one }) => {\n const result: Record<string, Relation<string>> = {\n _parentID: one(adapter.tables[parentTableName], {\n fields: [adapter.tables[arrayTableName]._parentID],\n references: [adapter.tables[parentTableName].id],\n }),\n }\n\n if (hasLocalesTable(field.fields)) {\n result._locales = many(adapter.tables[`${arrayTableName}${adapter.localesSuffix}`])\n }\n\n subRelationsToBuild.forEach((val, key) => {\n result[key] = many(adapter.tables[val])\n })\n\n return result\n })\n\n adapter.relations[`relations_${arrayTableName}`] = arrayTableRelations\n\n break\n }\n\n case 'blocks': {\n const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull\n\n field.blocks.forEach((block) => {\n const blockTableName = createTableName({\n adapter,\n config: block,\n parentTableName: rootTableName,\n prefix: `${rootTableName}_blocks_`,\n throwValidationError,\n versionsCustomName: versions,\n })\n if (!adapter.tables[blockTableName]) {\n const baseColumns: Record<string, PgColumnBuilder> = {\n _order: integer('_order').notNull(),\n _parentID: parentIDColumnMap[rootTableIDColType]('_parent_id').notNull(),\n _path: text('_path').notNull(),\n }\n\n const baseExtraConfig: BaseExtraConfig = {\n _orderIdx: (cols) => index(`${blockTableName}_order_idx`).on(cols._order),\n _parentIDIdx: (cols) => index(`${blockTableName}_parent_id_idx`).on(cols._parentID),\n _parentIdFk: (cols) =>\n foreignKey({\n name: `${blockTableName}_parent_id_fk`,\n columns: [cols._parentID],\n foreignColumns: [adapter.tables[rootTableName].id],\n }).onDelete('cascade'),\n _pathIdx: (cols) => index(`${blockTableName}_path_idx`).on(cols._path),\n }\n\n if (field.localized && adapter.payload.config.localization) {\n baseColumns._locale = adapter.enums.enum__locales('_locale').notNull()\n baseExtraConfig._localeIdx = (cols) =>\n index(`${blockTableName}_locale_idx`).on(cols._locale)\n }\n\n const {\n hasManyNumberField: subHasManyNumberField,\n hasManyTextField: subHasManyTextField,\n relationsToBuild: subRelationsToBuild,\n } = buildTable({\n adapter,\n baseColumns,\n baseExtraConfig,\n disableNotNull: disableNotNullFromHere,\n disableUnique,\n fields: disableUnique ? idToUUID(block.fields) : block.fields,\n rootRelationsToBuild,\n rootRelationships: relationships,\n rootTableIDColType,\n rootTableName,\n tableName: blockTableName,\n versions,\n })\n\n if (subHasManyTextField) {\n if (!hasManyTextField || subHasManyTextField === 'index')\n hasManyTextField = subHasManyTextField\n }\n\n if (subHasManyNumberField) {\n if (!hasManyNumberField || subHasManyNumberField === 'index')\n hasManyNumberField = subHasManyNumberField\n }\n\n const blockTableRelations = relations(\n adapter.tables[blockTableName],\n ({ many, one }) => {\n const result: Record<string, Relation<string>> = {\n _parentID: one(adapter.tables[rootTableName], {\n fields: [adapter.tables[blockTableName]._parentID],\n references: [adapter.tables[rootTableName].id],\n }),\n }\n\n if (hasLocalesTable(block.fields)) {\n result._locales = many(\n adapter.tables[`${blockTableName}${adapter.localesSuffix}`],\n )\n }\n\n subRelationsToBuild.forEach((val, key) => {\n result[key] = many(adapter.tables[val])\n })\n\n return result\n },\n )\n\n adapter.relations[`relations_${blockTableName}`] = blockTableRelations\n } else if (process.env.NODE_ENV !== 'production' && !versions) {\n validateExistingBlockIsIdentical({\n block,\n localized: field.localized,\n rootTableName,\n table: adapter.tables[blockTableName],\n tableLocales: adapter.tables[`${blockTableName}${adapter.localesSuffix}`],\n })\n }\n rootRelationsToBuild.set(`_blocks_${block.slug}`, blockTableName)\n })\n\n break\n }\n\n case 'tab':\n case 'group': {\n if (!('name' in field)) {\n const {\n hasLocalizedField: groupHasLocalizedField,\n hasLocalizedManyNumberField: groupHasLocalizedManyNumberField,\n hasLocalizedManyTextField: groupHasLocalizedManyTextField,\n hasLocalizedRelationshipField: groupHasLocalizedRelationshipField,\n hasManyNumberField: groupHasManyNumberField,\n hasManyTextField: groupHasManyTextField,\n } = traverseFields({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columnPrefix,\n columns,\n disableNotNull,\n disableUnique,\n fieldPrefix,\n fields: field.fields,\n forceLocalized,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName,\n parentTableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild,\n rootTableIDColType,\n rootTableName,\n versions,\n })\n\n if (groupHasLocalizedField) hasLocalizedField = true\n if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true\n if (groupHasManyTextField) hasManyTextField = true\n if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true\n if (groupHasManyNumberField) hasManyNumberField = true\n if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true\n break\n }\n\n const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull\n\n const {\n hasLocalizedField: groupHasLocalizedField,\n hasLocalizedManyNumberField: groupHasLocalizedManyNumberField,\n hasLocalizedManyTextField: groupHasLocalizedManyTextField,\n hasLocalizedRelationshipField: groupHasLocalizedRelationshipField,\n hasManyNumberField: groupHasManyNumberField,\n hasManyTextField: groupHasManyTextField,\n } = traverseFields({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columnPrefix: `${columnName}_`,\n columns,\n disableNotNull: disableNotNullFromHere,\n disableUnique,\n fieldPrefix: `${fieldName}.`,\n fields: field.fields,\n forceLocalized: field.localized,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName: `${parentTableName}_${columnName}`,\n parentTableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild,\n rootTableIDColType,\n rootTableName,\n versions,\n })\n\n if (groupHasLocalizedField) hasLocalizedField = true\n if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true\n if (groupHasManyTextField) hasManyTextField = true\n if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true\n if (groupHasManyNumberField) hasManyNumberField = true\n if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true\n break\n }\n\n case 'tabs': {\n const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull\n\n const {\n hasLocalizedField: tabHasLocalizedField,\n hasLocalizedManyNumberField: tabHasLocalizedManyNumberField,\n hasLocalizedManyTextField: tabHasLocalizedManyTextField,\n hasLocalizedRelationshipField: tabHasLocalizedRelationshipField,\n hasManyNumberField: tabHasManyNumberField,\n hasManyTextField: tabHasManyTextField,\n } = traverseFields({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columnPrefix,\n columns,\n disableNotNull: disableNotNullFromHere,\n disableUnique,\n fieldPrefix,\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n forceLocalized,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName,\n parentTableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild,\n rootTableIDColType,\n rootTableName,\n versions,\n })\n\n if (tabHasLocalizedField) hasLocalizedField = true\n if (tabHasLocalizedRelationshipField) hasLocalizedRelationshipField = true\n if (tabHasManyTextField) hasManyTextField = true\n if (tabHasLocalizedManyTextField) hasLocalizedManyTextField = true\n if (tabHasManyNumberField) hasManyNumberField = true\n if (tabHasLocalizedManyNumberField) hasLocalizedManyNumberField = true\n break\n }\n\n case 'row':\n case 'collapsible': {\n const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull\n const {\n hasLocalizedField: rowHasLocalizedField,\n hasLocalizedManyNumberField: rowHasLocalizedManyNumberField,\n hasLocalizedManyTextField: rowHasLocalizedManyTextField,\n hasLocalizedRelationshipField: rowHasLocalizedRelationshipField,\n hasManyNumberField: rowHasManyNumberField,\n hasManyTextField: rowHasManyTextField,\n } = traverseFields({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columnPrefix,\n columns,\n disableNotNull: disableNotNullFromHere,\n disableUnique,\n fieldPrefix,\n fields: field.fields,\n forceLocalized,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName,\n parentTableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild,\n rootTableIDColType,\n rootTableName,\n versions,\n })\n\n if (rowHasLocalizedField) hasLocalizedField = true\n if (rowHasLocalizedRelationshipField) hasLocalizedRelationshipField = true\n if (rowHasManyTextField) hasManyTextField = true\n if (rowHasLocalizedManyTextField) hasLocalizedManyTextField = true\n if (rowHasManyNumberField) hasManyNumberField = true\n if (rowHasLocalizedManyNumberField) hasLocalizedManyNumberField = true\n break\n }\n\n case 'relationship':\n case 'upload':\n if (Array.isArray(field.relationTo)) {\n field.relationTo.forEach((relation) => relationships.add(relation))\n } else {\n relationships.add(field.relationTo)\n }\n\n if (field.localized && adapter.payload.config.localization) {\n hasLocalizedRelationshipField = true\n }\n break\n\n default:\n break\n }\n\n const condition = field.admin && field.admin.condition\n\n if (\n !disableNotNull &&\n targetTable[fieldName] &&\n 'required' in field &&\n field.required &&\n !condition\n ) {\n targetTable[fieldName].notNull()\n }\n })\n\n return {\n hasLocalizedField,\n hasLocalizedManyNumberField,\n hasLocalizedManyTextField,\n hasLocalizedRelationshipField,\n hasManyNumberField,\n hasManyTextField,\n }\n}\n"],"names":["relations","PgNumericBuilder","PgUUIDBuilder","PgVarcharBuilder","boolean","foreignKey","index","integer","jsonb","numeric","pgEnum","text","timestamp","varchar","InvalidConfiguration","fieldAffectsData","optionIsObject","toSnakeCase","hasLocalesTable","buildTable","createIndex","createTableName","idToUUID","parentIDColumnMap","validateExistingBlockIsIdentical","traverseFields","adapter","buildNumbers","buildRelationships","buildTexts","columnPrefix","columns","disableNotNull","disableUnique","fieldPrefix","fields","forceLocalized","indexes","localesColumns","localesIndexes","newTableName","parentTableName","relationsToBuild","relationships","rootRelationsToBuild","rootTableIDColType","rootTableName","versions","throwValidationError","hasLocalizedField","hasLocalizedRelationshipField","hasManyTextField","hasLocalizedManyTextField","hasManyNumberField","hasLocalizedManyNumberField","parentIDColType","id","forEach","field","name","columnName","fieldName","targetTable","targetIndexes","replace","payload","config","localization","localized","unique","includes","type","hasMany","constraintValue","fieldConstraints","tableName","mode","precision","withTimezone","enumName","prefix","target","enums","options","map","option","value","selectTableName","baseColumns","order","notNull","parent","baseExtraConfig","orderIdx","cols","on","parentFk","foreignColumns","tables","parentIdx","locale","enum__locales","localeIdx","set","selectTableRelations","one","result","references","disableNotNullFromHere","Boolean","admin","condition","arrayTableName","versionsCustomName","_order","_parentID","_orderIdx","_parentIDFk","onDelete","_parentIDIdx","_locale","_localeIdx","subHasManyNumberField","subHasManyTextField","subRelationsToBuild","rootRelationships","arrayTableRelations","many","_locales","localesSuffix","val","key","blocks","block","blockTableName","_path","_parentIdFk","_pathIdx","blockTableRelations","process","env","NODE_ENV","table","tableLocales","slug","groupHasLocalizedField","groupHasLocalizedManyNumberField","groupHasLocalizedManyTextField","groupHasLocalizedRelationshipField","groupHasManyNumberField","groupHasManyTextField","tabHasLocalizedField","tabHasLocalizedManyNumberField","tabHasLocalizedManyTextField","tabHasLocalizedRelationshipField","tabHasManyNumberField","tabHasManyTextField","tabs","tab","rowHasLocalizedField","rowHasLocalizedManyNumberField","rowHasLocalizedManyTextField","rowHasLocalizedRelationshipField","rowHasManyNumberField","rowHasManyTextField","Array","isArray","relationTo","relation","add","required"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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