@payloadcms/db-postgres 3.0.0-canary.f83d96a → 3.0.0-canary.ff8c8fd

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) 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/index.d.ts +2 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +32 -67
  7. package/dist/index.js.map +1 -1
  8. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +5 -4
  9. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
  10. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +1 -1
  11. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -1
  12. package/dist/predefinedMigrations/v2-v3/index.d.ts +2 -2
  13. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
  14. package/dist/predefinedMigrations/v2-v3/index.js +2 -2
  15. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -1
  16. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +5 -4
  17. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
  18. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -1
  19. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +3 -2
  20. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
  21. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -1
  22. package/dist/types.d.ts +42 -78
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js.map +1 -1
  25. package/package.json +10 -10
  26. package/dist/count.d.ts +0 -3
  27. package/dist/count.d.ts.map +0 -1
  28. package/dist/count.js +0 -41
  29. package/dist/count.js.map +0 -1
  30. package/dist/create.d.ts +0 -3
  31. package/dist/create.d.ts.map +0 -1
  32. package/dist/create.js +0 -19
  33. package/dist/create.js.map +0 -1
  34. package/dist/createGlobal.d.ts +0 -4
  35. package/dist/createGlobal.d.ts.map +0 -1
  36. package/dist/createGlobal.js +0 -19
  37. package/dist/createGlobal.js.map +0 -1
  38. package/dist/createGlobalVersion.d.ts +0 -5
  39. package/dist/createGlobalVersion.d.ts.map +0 -1
  40. package/dist/createGlobalVersion.js +0 -33
  41. package/dist/createGlobalVersion.js.map +0 -1
  42. package/dist/createMigration.d.ts +0 -3
  43. package/dist/createMigration.d.ts.map +0 -1
  44. package/dist/createMigration.js +0 -102
  45. package/dist/createMigration.js.map +0 -1
  46. package/dist/createVersion.d.ts +0 -4
  47. package/dist/createVersion.d.ts.map +0 -1
  48. package/dist/createVersion.js +0 -40
  49. package/dist/createVersion.js.map +0 -1
  50. package/dist/deleteMany.d.ts +0 -3
  51. package/dist/deleteMany.d.ts.map +0 -1
  52. package/dist/deleteMany.js +0 -28
  53. package/dist/deleteMany.js.map +0 -1
  54. package/dist/deleteOne.d.ts +0 -3
  55. package/dist/deleteOne.d.ts.map +0 -1
  56. package/dist/deleteOne.js +0 -59
  57. package/dist/deleteOne.js.map +0 -1
  58. package/dist/deleteVersions.d.ts +0 -3
  59. package/dist/deleteVersions.d.ts.map +0 -1
  60. package/dist/deleteVersions.js +0 -31
  61. package/dist/deleteVersions.js.map +0 -1
  62. package/dist/destroy.d.ts +0 -3
  63. package/dist/destroy.d.ts.map +0 -1
  64. package/dist/destroy.js +0 -15
  65. package/dist/destroy.js.map +0 -1
  66. package/dist/find/buildFindManyArgs.d.ts +0 -17
  67. package/dist/find/buildFindManyArgs.d.ts.map +0 -1
  68. package/dist/find/buildFindManyArgs.js +0 -65
  69. package/dist/find/buildFindManyArgs.js.map +0 -1
  70. package/dist/find/chainMethods.d.ts +0 -16
  71. package/dist/find/chainMethods.d.ts.map +0 -1
  72. package/dist/find/chainMethods.js +0 -12
  73. package/dist/find/chainMethods.js.map +0 -1
  74. package/dist/find/findMany.d.ts +0 -21
  75. package/dist/find/findMany.d.ts.map +0 -1
  76. package/dist/find/findMany.js +0 -152
  77. package/dist/find/findMany.js.map +0 -1
  78. package/dist/find/traverseFields.d.ts +0 -17
  79. package/dist/find/traverseFields.d.ts.map +0 -1
  80. package/dist/find/traverseFields.js +0 -156
  81. package/dist/find/traverseFields.js.map +0 -1
  82. package/dist/find.d.ts +0 -3
  83. package/dist/find.d.ts.map +0 -1
  84. package/dist/find.js +0 -21
  85. package/dist/find.js.map +0 -1
  86. package/dist/findGlobal.d.ts +0 -3
  87. package/dist/findGlobal.d.ts.map +0 -1
  88. package/dist/findGlobal.js +0 -23
  89. package/dist/findGlobal.js.map +0 -1
  90. package/dist/findGlobalVersions.d.ts +0 -3
  91. package/dist/findGlobalVersions.d.ts.map +0 -1
  92. package/dist/findGlobalVersions.js +0 -24
  93. package/dist/findGlobalVersions.js.map +0 -1
  94. package/dist/findOne.d.ts +0 -4
  95. package/dist/findOne.d.ts.map +0 -1
  96. package/dist/findOne.js +0 -21
  97. package/dist/findOne.js.map +0 -1
  98. package/dist/findVersions.d.ts +0 -3
  99. package/dist/findVersions.d.ts.map +0 -1
  100. package/dist/findVersions.js +0 -24
  101. package/dist/findVersions.js.map +0 -1
  102. package/dist/init.d.ts +0 -3
  103. package/dist/init.d.ts.map +0 -1
  104. package/dist/init.js +0 -91
  105. package/dist/init.js.map +0 -1
  106. package/dist/migrate.d.ts +0 -3
  107. package/dist/migrate.d.ts.map +0 -1
  108. package/dist/migrate.js +0 -99
  109. package/dist/migrate.js.map +0 -1
  110. package/dist/migrateDown.d.ts +0 -3
  111. package/dist/migrateDown.d.ts.map +0 -1
  112. package/dist/migrateDown.js +0 -63
  113. package/dist/migrateDown.js.map +0 -1
  114. package/dist/migrateFresh.d.ts +0 -8
  115. package/dist/migrateFresh.d.ts.map +0 -1
  116. package/dist/migrateFresh.js +0 -72
  117. package/dist/migrateFresh.js.map +0 -1
  118. package/dist/migrateRefresh.d.ts +0 -6
  119. package/dist/migrateRefresh.d.ts.map +0 -1
  120. package/dist/migrateRefresh.js +0 -102
  121. package/dist/migrateRefresh.js.map +0 -1
  122. package/dist/migrateReset.d.ts +0 -6
  123. package/dist/migrateReset.d.ts.map +0 -1
  124. package/dist/migrateReset.js +0 -82
  125. package/dist/migrateReset.js.map +0 -1
  126. package/dist/migrateStatus.d.ts +0 -3
  127. package/dist/migrateStatus.d.ts.map +0 -1
  128. package/dist/migrateStatus.js +0 -44
  129. package/dist/migrateStatus.js.map +0 -1
  130. package/dist/queries/buildAndOrConditions.d.ts +0 -16
  131. package/dist/queries/buildAndOrConditions.d.ts.map +0 -1
  132. package/dist/queries/buildAndOrConditions.js +0 -28
  133. package/dist/queries/buildAndOrConditions.js.map +0 -1
  134. package/dist/queries/buildQuery.d.ts +0 -30
  135. package/dist/queries/buildQuery.d.ts.map +0 -1
  136. package/dist/queries/buildQuery.js +0 -72
  137. package/dist/queries/buildQuery.js.map +0 -1
  138. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +0 -2
  139. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +0 -1
  140. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +0 -14
  141. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +0 -1
  142. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +0 -2
  143. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +0 -1
  144. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +0 -5
  145. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +0 -1
  146. package/dist/queries/createJSONQuery/index.d.ts +0 -10
  147. package/dist/queries/createJSONQuery/index.d.ts.map +0 -1
  148. package/dist/queries/createJSONQuery/index.js +0 -54
  149. package/dist/queries/createJSONQuery/index.js.map +0 -1
  150. package/dist/queries/getTableColumnFromPath.d.ts +0 -50
  151. package/dist/queries/getTableColumnFromPath.d.ts.map +0 -1
  152. package/dist/queries/getTableColumnFromPath.js +0 -516
  153. package/dist/queries/getTableColumnFromPath.js.map +0 -1
  154. package/dist/queries/operatorMap.d.ts +0 -18
  155. package/dist/queries/operatorMap.d.ts.map +0 -1
  156. package/dist/queries/operatorMap.js +0 -24
  157. package/dist/queries/operatorMap.js.map +0 -1
  158. package/dist/queries/parseParams.d.ts +0 -16
  159. package/dist/queries/parseParams.d.ts.map +0 -1
  160. package/dist/queries/parseParams.js +0 -183
  161. package/dist/queries/parseParams.js.map +0 -1
  162. package/dist/queries/sanitizeQueryValue.d.ts +0 -15
  163. package/dist/queries/sanitizeQueryValue.d.ts.map +0 -1
  164. package/dist/queries/sanitizeQueryValue.js +0 -89
  165. package/dist/queries/sanitizeQueryValue.js.map +0 -1
  166. package/dist/queries/selectDistinct.d.ts +0 -22
  167. package/dist/queries/selectDistinct.d.ts.map +0 -1
  168. package/dist/queries/selectDistinct.js +0 -30
  169. package/dist/queries/selectDistinct.js.map +0 -1
  170. package/dist/queryDrafts.d.ts +0 -3
  171. package/dist/queryDrafts.d.ts.map +0 -1
  172. package/dist/queryDrafts.js +0 -40
  173. package/dist/queryDrafts.js.map +0 -1
  174. package/dist/schema/build.d.ts +0 -34
  175. package/dist/schema/build.d.ts.map +0 -1
  176. package/dist/schema/build.js +0 -369
  177. package/dist/schema/build.js.map +0 -1
  178. package/dist/schema/createIndex.d.ts +0 -12
  179. package/dist/schema/createIndex.d.ts.map +0 -1
  180. package/dist/schema/createIndex.js +0 -18
  181. package/dist/schema/createIndex.js.map +0 -1
  182. package/dist/schema/createTableName.d.ts +0 -30
  183. package/dist/schema/createTableName.d.ts.map +0 -1
  184. package/dist/schema/createTableName.js +0 -31
  185. package/dist/schema/createTableName.js.map +0 -1
  186. package/dist/schema/idToUUID.d.ts +0 -3
  187. package/dist/schema/idToUUID.d.ts.map +0 -1
  188. package/dist/schema/idToUUID.js +0 -11
  189. package/dist/schema/idToUUID.js.map +0 -1
  190. package/dist/schema/parentIDColumnMap.d.ts +0 -4
  191. package/dist/schema/parentIDColumnMap.d.ts.map +0 -1
  192. package/dist/schema/parentIDColumnMap.js +0 -9
  193. package/dist/schema/parentIDColumnMap.js.map +0 -1
  194. package/dist/schema/setColumnID.d.ts +0 -11
  195. package/dist/schema/setColumnID.d.ts.map +0 -1
  196. package/dist/schema/setColumnID.js +0 -24
  197. package/dist/schema/setColumnID.js.map +0 -1
  198. package/dist/schema/traverseFields.d.ts +0 -36
  199. package/dist/schema/traverseFields.d.ts.map +0 -1
  200. package/dist/schema/traverseFields.js +0 -614
  201. package/dist/schema/traverseFields.js.map +0 -1
  202. package/dist/schema/validateExistingBlockIsIdentical.d.ts +0 -12
  203. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +0 -1
  204. package/dist/schema/validateExistingBlockIsIdentical.js +0 -76
  205. package/dist/schema/validateExistingBlockIsIdentical.js.map +0 -1
  206. package/dist/transactions/beginTransaction.d.ts +0 -3
  207. package/dist/transactions/beginTransaction.d.ts.map +0 -1
  208. package/dist/transactions/beginTransaction.js +0 -51
  209. package/dist/transactions/beginTransaction.js.map +0 -1
  210. package/dist/transactions/commitTransaction.d.ts +0 -3
  211. package/dist/transactions/commitTransaction.d.ts.map +0 -1
  212. package/dist/transactions/commitTransaction.js +0 -14
  213. package/dist/transactions/commitTransaction.js.map +0 -1
  214. package/dist/transactions/rollbackTransaction.d.ts +0 -3
  215. package/dist/transactions/rollbackTransaction.d.ts.map +0 -1
  216. package/dist/transactions/rollbackTransaction.js +0 -13
  217. package/dist/transactions/rollbackTransaction.js.map +0 -1
  218. package/dist/transform/read/hasManyNumber.d.ts +0 -10
  219. package/dist/transform/read/hasManyNumber.d.ts.map +0 -1
  220. package/dist/transform/read/hasManyNumber.js +0 -10
  221. package/dist/transform/read/hasManyNumber.js.map +0 -1
  222. package/dist/transform/read/hasManyText.d.ts +0 -10
  223. package/dist/transform/read/hasManyText.d.ts.map +0 -1
  224. package/dist/transform/read/hasManyText.js +0 -10
  225. package/dist/transform/read/hasManyText.js.map +0 -1
  226. package/dist/transform/read/index.d.ts +0 -13
  227. package/dist/transform/read/index.d.ts.map +0 -1
  228. package/dist/transform/read/index.js +0 -44
  229. package/dist/transform/read/index.js.map +0 -1
  230. package/dist/transform/read/relationship.d.ts +0 -10
  231. package/dist/transform/read/relationship.d.ts.map +0 -1
  232. package/dist/transform/read/relationship.js +0 -60
  233. package/dist/transform/read/relationship.js.map +0 -1
  234. package/dist/transform/read/traverseFields.d.ts +0 -57
  235. package/dist/transform/read/traverseFields.d.ts.map +0 -1
  236. package/dist/transform/read/traverseFields.js +0 -435
  237. package/dist/transform/read/traverseFields.js.map +0 -1
  238. package/dist/transform/write/array.d.ts +0 -26
  239. package/dist/transform/write/array.d.ts.map +0 -1
  240. package/dist/transform/write/array.js +0 -58
  241. package/dist/transform/write/array.js.map +0 -1
  242. package/dist/transform/write/blocks.d.ts +0 -25
  243. package/dist/transform/write/blocks.d.ts.map +0 -1
  244. package/dist/transform/write/blocks.js +0 -54
  245. package/dist/transform/write/blocks.js.map +0 -1
  246. package/dist/transform/write/index.d.ts +0 -13
  247. package/dist/transform/write/index.d.ts.map +0 -1
  248. package/dist/transform/write/index.js +0 -41
  249. package/dist/transform/write/index.js.map +0 -1
  250. package/dist/transform/write/numbers.d.ts +0 -8
  251. package/dist/transform/write/numbers.d.ts.map +0 -1
  252. package/dist/transform/write/numbers.js +0 -11
  253. package/dist/transform/write/numbers.js.map +0 -1
  254. package/dist/transform/write/relationships.d.ts +0 -10
  255. package/dist/transform/write/relationships.d.ts.map +0 -1
  256. package/dist/transform/write/relationships.js +0 -23
  257. package/dist/transform/write/relationships.js.map +0 -1
  258. package/dist/transform/write/selects.d.ts +0 -8
  259. package/dist/transform/write/selects.d.ts.map +0 -1
  260. package/dist/transform/write/selects.js +0 -20
  261. package/dist/transform/write/selects.js.map +0 -1
  262. package/dist/transform/write/texts.d.ts +0 -8
  263. package/dist/transform/write/texts.d.ts.map +0 -1
  264. package/dist/transform/write/texts.js +0 -11
  265. package/dist/transform/write/texts.js.map +0 -1
  266. package/dist/transform/write/traverseFields.d.ts +0 -50
  267. package/dist/transform/write/traverseFields.d.ts.map +0 -1
  268. package/dist/transform/write/traverseFields.js +0 -445
  269. package/dist/transform/write/traverseFields.js.map +0 -1
  270. package/dist/transform/write/types.d.ts +0 -43
  271. package/dist/transform/write/types.d.ts.map +0 -1
  272. package/dist/transform/write/types.js +0 -3
  273. package/dist/transform/write/types.js.map +0 -1
  274. package/dist/update.d.ts +0 -3
  275. package/dist/update.d.ts.map +0 -1
  276. package/dist/update.js +0 -54
  277. package/dist/update.js.map +0 -1
  278. package/dist/updateGlobal.d.ts +0 -4
  279. package/dist/updateGlobal.d.ts.map +0 -1
  280. package/dist/updateGlobal.js +0 -25
  281. package/dist/updateGlobal.js.map +0 -1
  282. package/dist/updateGlobalVersion.d.ts +0 -4
  283. package/dist/updateGlobalVersion.d.ts.map +0 -1
  284. package/dist/updateGlobalVersion.js +0 -36
  285. package/dist/updateGlobalVersion.js.map +0 -1
  286. package/dist/updateVersion.d.ts +0 -4
  287. package/dist/updateVersion.d.ts.map +0 -1
  288. package/dist/updateVersion.js +0 -36
  289. package/dist/updateVersion.js.map +0 -1
  290. package/dist/upsertRow/deleteExistingArrayRows.d.ts +0 -10
  291. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +0 -1
  292. package/dist/upsertRow/deleteExistingArrayRows.js +0 -10
  293. package/dist/upsertRow/deleteExistingArrayRows.js.map +0 -1
  294. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +0 -14
  295. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +0 -1
  296. package/dist/upsertRow/deleteExistingRowsByPath.js +0 -33
  297. package/dist/upsertRow/deleteExistingRowsByPath.js.map +0 -1
  298. package/dist/upsertRow/index.d.ts +0 -4
  299. package/dist/upsertRow/index.d.ts.map +0 -1
  300. package/dist/upsertRow/index.js +0 -281
  301. package/dist/upsertRow/index.js.map +0 -1
  302. package/dist/upsertRow/insertArrays.d.ts +0 -13
  303. package/dist/upsertRow/insertArrays.d.ts.map +0 -1
  304. package/dist/upsertRow/insertArrays.js +0 -68
  305. package/dist/upsertRow/insertArrays.js.map +0 -1
  306. package/dist/upsertRow/types.d.ts +0 -32
  307. package/dist/upsertRow/types.d.ts.map +0 -1
  308. package/dist/upsertRow/types.js +0 -3
  309. package/dist/upsertRow/types.js.map +0 -1
  310. package/dist/utilities/appendPrefixToKeys.d.ts +0 -2
  311. package/dist/utilities/appendPrefixToKeys.d.ts.map +0 -1
  312. package/dist/utilities/appendPrefixToKeys.js +0 -6
  313. package/dist/utilities/appendPrefixToKeys.js.map +0 -1
  314. package/dist/utilities/createBlocksMap.d.ts +0 -5
  315. package/dist/utilities/createBlocksMap.d.ts.map +0 -1
  316. package/dist/utilities/createBlocksMap.js +0 -29
  317. package/dist/utilities/createBlocksMap.js.map +0 -1
  318. package/dist/utilities/createMigrationTable.d.ts +0 -3
  319. package/dist/utilities/createMigrationTable.d.ts.map +0 -1
  320. package/dist/utilities/createMigrationTable.js +0 -13
  321. package/dist/utilities/createMigrationTable.js.map +0 -1
  322. package/dist/utilities/createRelationshipMap.d.ts +0 -2
  323. package/dist/utilities/createRelationshipMap.d.ts.map +0 -1
  324. package/dist/utilities/createRelationshipMap.js +0 -19
  325. package/dist/utilities/createRelationshipMap.js.map +0 -1
  326. package/dist/utilities/hasLocalesTable.d.ts +0 -3
  327. package/dist/utilities/hasLocalesTable.d.ts.map +0 -1
  328. package/dist/utilities/hasLocalesTable.js +0 -11
  329. package/dist/utilities/hasLocalesTable.js.map +0 -1
  330. package/dist/utilities/isArrayOfRows.d.ts +0 -2
  331. package/dist/utilities/isArrayOfRows.d.ts.map +0 -1
  332. package/dist/utilities/isArrayOfRows.js +0 -5
  333. package/dist/utilities/isArrayOfRows.js.map +0 -1
  334. package/dist/utilities/migrationTableExists.d.ts +0 -3
  335. package/dist/utilities/migrationTableExists.d.ts.map +0 -1
  336. package/dist/utilities/migrationTableExists.js +0 -9
  337. package/dist/utilities/migrationTableExists.js.map +0 -1
  338. package/dist/utilities/parseError.d.ts +0 -5
  339. package/dist/utilities/parseError.d.ts.map +0 -1
  340. package/dist/utilities/parseError.js +0 -17
  341. package/dist/utilities/parseError.js.map +0 -1
  342. package/dist/utilities/pushDevSchema.d.ts +0 -9
  343. package/dist/utilities/pushDevSchema.d.ts.map +0 -1
  344. package/dist/utilities/pushDevSchema.js +0 -58
  345. package/dist/utilities/pushDevSchema.js.map +0 -1
@@ -1,25 +0,0 @@
1
- import type { BlockField } from 'payload';
2
- import type { PostgresAdapter } from '../../types.js';
3
- import type { BlockRowToInsert, RelationshipToDelete } from './types.js';
4
- type Args = {
5
- adapter: PostgresAdapter;
6
- baseTableName: string;
7
- blocks: {
8
- [blockType: string]: BlockRowToInsert[];
9
- };
10
- blocksToDelete: Set<string>;
11
- data: Record<string, unknown>[];
12
- field: BlockField;
13
- locale?: string;
14
- numbers: Record<string, unknown>[];
15
- path: string;
16
- relationships: Record<string, unknown>[];
17
- relationshipsToDelete: RelationshipToDelete[];
18
- selects: {
19
- [tableName: string]: Record<string, unknown>[];
20
- };
21
- texts: Record<string, unknown>[];
22
- };
23
- export declare const transformBlocks: ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts, }: Args) => void;
24
- export {};
25
- //# sourceMappingURL=blocks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/transform/write/blocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAIxE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,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,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,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;AACD,eAAO,MAAM,eAAe,kJAczB,IAAI,SAyDN,CAAA"}
@@ -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"],"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"],"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"],"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"],"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"],"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"],"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"}