@payloadcms/db-postgres 3.0.0-canary.92e4997 → 3.0.0-canary.a0b06af

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) 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 +12 -7
  5. package/dist/connect.js.map +1 -1
  6. package/dist/count.d.ts +1 -1
  7. package/dist/count.d.ts.map +1 -1
  8. package/dist/count.js +2 -11
  9. package/dist/count.js.map +1 -1
  10. package/dist/create.d.ts +1 -1
  11. package/dist/create.d.ts.map +1 -1
  12. package/dist/create.js +1 -1
  13. package/dist/create.js.map +1 -1
  14. package/dist/createGlobal.d.ts +2 -3
  15. package/dist/createGlobal.d.ts.map +1 -1
  16. package/dist/createGlobal.js +1 -1
  17. package/dist/createGlobal.js.map +1 -1
  18. package/dist/createGlobalVersion.d.ts +2 -4
  19. package/dist/createGlobalVersion.d.ts.map +1 -1
  20. package/dist/createGlobalVersion.js +2 -2
  21. package/dist/createGlobalVersion.js.map +1 -1
  22. package/dist/createMigration.d.ts +1 -1
  23. package/dist/createMigration.d.ts.map +1 -1
  24. package/dist/createMigration.js +56 -35
  25. package/dist/createMigration.js.map +1 -1
  26. package/dist/createVersion.d.ts +1 -2
  27. package/dist/createVersion.d.ts.map +1 -1
  28. package/dist/createVersion.js +4 -8
  29. package/dist/createVersion.js.map +1 -1
  30. package/dist/deleteMany.d.ts +1 -1
  31. package/dist/deleteMany.d.ts.map +1 -1
  32. package/dist/deleteMany.js +1 -1
  33. package/dist/deleteMany.js.map +1 -1
  34. package/dist/deleteOne.d.ts +1 -1
  35. package/dist/deleteOne.d.ts.map +1 -1
  36. package/dist/deleteOne.js +3 -3
  37. package/dist/deleteOne.js.map +1 -1
  38. package/dist/deleteVersions.d.ts +1 -1
  39. package/dist/deleteVersions.d.ts.map +1 -1
  40. package/dist/deleteVersions.js +2 -2
  41. package/dist/deleteVersions.js.map +1 -1
  42. package/dist/destroy.d.ts +1 -1
  43. package/dist/destroy.d.ts.map +1 -1
  44. package/dist/destroy.js +4 -0
  45. package/dist/destroy.js.map +1 -1
  46. package/dist/exports/migration-utils.d.ts +2 -0
  47. package/dist/exports/migration-utils.d.ts.map +1 -0
  48. package/dist/exports/migration-utils.js +3 -0
  49. package/dist/exports/migration-utils.js.map +1 -0
  50. package/dist/find/buildFindManyArgs.d.ts +6 -2
  51. package/dist/find/buildFindManyArgs.d.ts.map +1 -1
  52. package/dist/find/buildFindManyArgs.js +2 -1
  53. package/dist/find/buildFindManyArgs.js.map +1 -1
  54. package/dist/find/chainMethods.d.ts.map +1 -1
  55. package/dist/find/chainMethods.js.map +1 -1
  56. package/dist/find/findMany.d.ts +1 -2
  57. package/dist/find/findMany.d.ts.map +1 -1
  58. package/dist/find/findMany.js +5 -16
  59. package/dist/find/findMany.js.map +1 -1
  60. package/dist/find/traverseFields.d.ts +4 -3
  61. package/dist/find/traverseFields.d.ts.map +1 -1
  62. package/dist/find/traverseFields.js +23 -5
  63. package/dist/find/traverseFields.js.map +1 -1
  64. package/dist/find.d.ts +1 -1
  65. package/dist/find.d.ts.map +1 -1
  66. package/dist/find.js.map +1 -1
  67. package/dist/findGlobal.d.ts +1 -1
  68. package/dist/findGlobal.d.ts.map +1 -1
  69. package/dist/findGlobal.js.map +1 -1
  70. package/dist/findGlobalVersions.d.ts +1 -1
  71. package/dist/findGlobalVersions.d.ts.map +1 -1
  72. package/dist/findGlobalVersions.js +1 -1
  73. package/dist/findGlobalVersions.js.map +1 -1
  74. package/dist/findOne.d.ts +1 -2
  75. package/dist/findOne.d.ts.map +1 -1
  76. package/dist/findOne.js.map +1 -1
  77. package/dist/findVersions.d.ts +1 -1
  78. package/dist/findVersions.d.ts.map +1 -1
  79. package/dist/findVersions.js +1 -1
  80. package/dist/findVersions.js.map +1 -1
  81. package/dist/index.d.ts +1 -1
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +10 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/init.d.ts +1 -1
  86. package/dist/init.d.ts.map +1 -1
  87. package/dist/init.js +15 -20
  88. package/dist/init.js.map +1 -1
  89. package/dist/migrate.d.ts.map +1 -1
  90. package/dist/migrate.js +1 -1
  91. package/dist/migrate.js.map +1 -1
  92. package/dist/migrateDown.js +1 -1
  93. package/dist/migrateDown.js.map +1 -1
  94. package/dist/migrateFresh.d.ts.map +1 -1
  95. package/dist/migrateFresh.js +1 -1
  96. package/dist/migrateFresh.js.map +1 -1
  97. package/dist/migrateRefresh.js +1 -1
  98. package/dist/migrateRefresh.js.map +1 -1
  99. package/dist/migrateReset.js +1 -1
  100. package/dist/migrateReset.js.map +1 -1
  101. package/dist/migrateStatus.js +1 -1
  102. package/dist/migrateStatus.js.map +1 -1
  103. package/dist/predefinedMigrations/relationships-v2-v3.d.ts +4 -0
  104. package/dist/predefinedMigrations/relationships-v2-v3.d.ts.map +1 -0
  105. package/dist/predefinedMigrations/relationships-v2-v3.js.map +1 -0
  106. package/dist/predefinedMigrations/relationships-v2-v3.mjs +11 -0
  107. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +19 -0
  108. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -0
  109. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +169 -0
  110. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -0
  111. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts +11 -0
  112. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -0
  113. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js +191 -0
  114. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -0
  115. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts +3 -0
  116. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -0
  117. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js +56 -0
  118. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js.map +1 -0
  119. package/dist/predefinedMigrations/v2-v3/index.d.ts +23 -0
  120. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -0
  121. package/dist/predefinedMigrations/v2-v3/index.js +211 -0
  122. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -0
  123. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +19 -0
  124. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -0
  125. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js +57 -0
  126. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -0
  127. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +22 -0
  128. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -0
  129. package/dist/predefinedMigrations/v2-v3/traverseFields.js +85 -0
  130. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -0
  131. package/dist/predefinedMigrations/v2-v3/types.d.ts +9 -0
  132. package/dist/predefinedMigrations/v2-v3/types.d.ts.map +1 -0
  133. package/dist/predefinedMigrations/v2-v3/types.js +6 -0
  134. package/dist/predefinedMigrations/v2-v3/types.js.map +1 -0
  135. package/dist/queries/buildAndOrConditions.d.ts +4 -5
  136. package/dist/queries/buildAndOrConditions.d.ts.map +1 -1
  137. package/dist/queries/buildAndOrConditions.js +1 -2
  138. package/dist/queries/buildAndOrConditions.js.map +1 -1
  139. package/dist/queries/buildQuery.d.ts +2 -3
  140. package/dist/queries/buildQuery.d.ts.map +1 -1
  141. package/dist/queries/buildQuery.js +1 -5
  142. package/dist/queries/buildQuery.js.map +1 -1
  143. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +1 -1
  144. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +1 -1
  145. package/dist/queries/createJSONQuery/index.js.map +1 -1
  146. package/dist/queries/getTableColumnFromPath.d.ts +4 -5
  147. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
  148. package/dist/queries/getTableColumnFromPath.js +170 -99
  149. package/dist/queries/getTableColumnFromPath.js.map +1 -1
  150. package/dist/queries/operatorMap.js.map +1 -1
  151. package/dist/queries/parseParams.d.ts +4 -5
  152. package/dist/queries/parseParams.d.ts.map +1 -1
  153. package/dist/queries/parseParams.js +9 -8
  154. package/dist/queries/parseParams.js.map +1 -1
  155. package/dist/queries/sanitizeQueryValue.d.ts +1 -1
  156. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  157. package/dist/queries/sanitizeQueryValue.js +2 -3
  158. package/dist/queries/sanitizeQueryValue.js.map +1 -1
  159. package/dist/queries/selectDistinct.d.ts +3 -4
  160. package/dist/queries/selectDistinct.d.ts.map +1 -1
  161. package/dist/queries/selectDistinct.js +3 -14
  162. package/dist/queries/selectDistinct.js.map +1 -1
  163. package/dist/queryDrafts.d.ts +1 -1
  164. package/dist/queryDrafts.d.ts.map +1 -1
  165. package/dist/queryDrafts.js +1 -2
  166. package/dist/queryDrafts.js.map +1 -1
  167. package/dist/schema/build.d.ts +9 -5
  168. package/dist/schema/build.d.ts.map +1 -1
  169. package/dist/schema/build.js +161 -112
  170. package/dist/schema/build.js.map +1 -1
  171. package/dist/schema/createIndex.js.map +1 -1
  172. package/dist/schema/createTableName.d.ts +1 -1
  173. package/dist/schema/createTableName.d.ts.map +1 -1
  174. package/dist/schema/createTableName.js +1 -1
  175. package/dist/schema/createTableName.js.map +1 -1
  176. package/dist/schema/idToUUID.d.ts +1 -1
  177. package/dist/schema/idToUUID.d.ts.map +1 -1
  178. package/dist/schema/idToUUID.js.map +1 -1
  179. package/dist/schema/parentIDColumnMap.js.map +1 -1
  180. package/dist/schema/setColumnID.d.ts +1 -1
  181. package/dist/schema/setColumnID.d.ts.map +1 -1
  182. package/dist/schema/setColumnID.js +2 -2
  183. package/dist/schema/setColumnID.js.map +1 -1
  184. package/dist/schema/traverseFields.d.ts +5 -7
  185. package/dist/schema/traverseFields.d.ts.map +1 -1
  186. package/dist/schema/traverseFields.js +105 -42
  187. package/dist/schema/traverseFields.js.map +1 -1
  188. package/dist/schema/validateExistingBlockIsIdentical.d.ts +1 -1
  189. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -1
  190. package/dist/schema/validateExistingBlockIsIdentical.js +2 -2
  191. package/dist/schema/validateExistingBlockIsIdentical.js.map +1 -1
  192. package/dist/transactions/beginTransaction.d.ts +1 -1
  193. package/dist/transactions/beginTransaction.d.ts.map +1 -1
  194. package/dist/transactions/beginTransaction.js +4 -0
  195. package/dist/transactions/beginTransaction.js.map +1 -1
  196. package/dist/transactions/commitTransaction.d.ts +1 -1
  197. package/dist/transactions/commitTransaction.d.ts.map +1 -1
  198. package/dist/transactions/commitTransaction.js +1 -0
  199. package/dist/transactions/commitTransaction.js.map +1 -1
  200. package/dist/transactions/rollbackTransaction.d.ts +1 -1
  201. package/dist/transactions/rollbackTransaction.d.ts.map +1 -1
  202. package/dist/transactions/rollbackTransaction.js +5 -4
  203. package/dist/transactions/rollbackTransaction.js.map +1 -1
  204. package/dist/transform/read/hasManyNumber.d.ts +1 -1
  205. package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
  206. package/dist/transform/read/hasManyNumber.js.map +1 -1
  207. package/dist/transform/read/hasManyText.d.ts +1 -1
  208. package/dist/transform/read/hasManyText.d.ts.map +1 -1
  209. package/dist/transform/read/hasManyText.js.map +1 -1
  210. package/dist/transform/read/index.d.ts +4 -3
  211. package/dist/transform/read/index.d.ts.map +1 -1
  212. package/dist/transform/read/index.js +2 -1
  213. package/dist/transform/read/index.js.map +1 -1
  214. package/dist/transform/read/relationship.d.ts +1 -1
  215. package/dist/transform/read/relationship.d.ts.map +1 -1
  216. package/dist/transform/read/relationship.js +0 -4
  217. package/dist/transform/read/relationship.js.map +1 -1
  218. package/dist/transform/read/traverseFields.d.ts +8 -3
  219. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  220. package/dist/transform/read/traverseFields.js +70 -56
  221. package/dist/transform/read/traverseFields.js.map +1 -1
  222. package/dist/transform/write/array.d.ts +1 -1
  223. package/dist/transform/write/array.d.ts.map +1 -1
  224. package/dist/transform/write/array.js.map +1 -1
  225. package/dist/transform/write/blocks.d.ts +1 -1
  226. package/dist/transform/write/blocks.d.ts.map +1 -1
  227. package/dist/transform/write/blocks.js.map +1 -1
  228. package/dist/transform/write/index.d.ts +1 -1
  229. package/dist/transform/write/index.d.ts.map +1 -1
  230. package/dist/transform/write/index.js.map +1 -1
  231. package/dist/transform/write/numbers.js.map +1 -1
  232. package/dist/transform/write/relationships.d.ts +1 -1
  233. package/dist/transform/write/relationships.d.ts.map +1 -1
  234. package/dist/transform/write/relationships.js +1 -1
  235. package/dist/transform/write/relationships.js.map +1 -1
  236. package/dist/transform/write/selects.js.map +1 -1
  237. package/dist/transform/write/texts.js.map +1 -1
  238. package/dist/transform/write/traverseFields.d.ts +1 -1
  239. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  240. package/dist/transform/write/traverseFields.js +21 -4
  241. package/dist/transform/write/traverseFields.js.map +1 -1
  242. package/dist/transform/write/types.js.map +1 -1
  243. package/dist/types.d.ts +6 -5
  244. package/dist/types.d.ts.map +1 -1
  245. package/dist/types.js.map +1 -1
  246. package/dist/update.d.ts +1 -1
  247. package/dist/update.d.ts.map +1 -1
  248. package/dist/update.js +2 -3
  249. package/dist/update.js.map +1 -1
  250. package/dist/updateGlobal.d.ts +2 -3
  251. package/dist/updateGlobal.d.ts.map +1 -1
  252. package/dist/updateGlobal.js +1 -1
  253. package/dist/updateGlobal.js.map +1 -1
  254. package/dist/updateGlobalVersion.d.ts +1 -2
  255. package/dist/updateGlobalVersion.d.ts.map +1 -1
  256. package/dist/updateGlobalVersion.js +2 -2
  257. package/dist/updateGlobalVersion.js.map +1 -1
  258. package/dist/updateVersion.d.ts +1 -2
  259. package/dist/updateVersion.d.ts.map +1 -1
  260. package/dist/updateVersion.js +2 -2
  261. package/dist/updateVersion.js.map +1 -1
  262. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -1
  263. package/dist/upsertRow/deleteExistingArrayRows.js.map +1 -1
  264. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -1
  265. package/dist/upsertRow/deleteExistingRowsByPath.js.map +1 -1
  266. package/dist/upsertRow/index.d.ts +2 -2
  267. package/dist/upsertRow/index.d.ts.map +1 -1
  268. package/dist/upsertRow/index.js +12 -8
  269. package/dist/upsertRow/index.js.map +1 -1
  270. package/dist/upsertRow/insertArrays.d.ts.map +1 -1
  271. package/dist/upsertRow/insertArrays.js.map +1 -1
  272. package/dist/upsertRow/types.d.ts +7 -2
  273. package/dist/upsertRow/types.d.ts.map +1 -1
  274. package/dist/upsertRow/types.js.map +1 -1
  275. package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -1
  276. package/dist/utilities/appendPrefixToKeys.js.map +1 -1
  277. package/dist/utilities/createBlocksMap.d.ts.map +1 -1
  278. package/dist/utilities/createBlocksMap.js.map +1 -1
  279. package/dist/utilities/createMigrationTable.d.ts.map +1 -1
  280. package/dist/utilities/createMigrationTable.js.map +1 -1
  281. package/dist/utilities/createRelationshipMap.d.ts.map +1 -1
  282. package/dist/utilities/createRelationshipMap.js.map +1 -1
  283. package/dist/utilities/hasLocalesTable.d.ts +1 -1
  284. package/dist/utilities/hasLocalesTable.d.ts.map +1 -1
  285. package/dist/utilities/hasLocalesTable.js +1 -1
  286. package/dist/utilities/hasLocalesTable.js.map +1 -1
  287. package/dist/utilities/isArrayOfRows.js.map +1 -1
  288. package/dist/utilities/migrationTableExists.d.ts.map +1 -1
  289. package/dist/utilities/migrationTableExists.js.map +1 -1
  290. package/dist/utilities/parseError.js.map +1 -1
  291. package/dist/utilities/pushDevSchema.d.ts.map +1 -1
  292. package/dist/utilities/pushDevSchema.js +1 -1
  293. package/dist/utilities/pushDevSchema.js.map +1 -1
  294. package/package.json +21 -12
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/createRelationshipMap.ts"],"sourcesContent":["// Flatten rows to object with path keys\n// for easier retrieval\nexport const createPathMap = (rows: unknown): Record<string, Record<string, unknown>[]> => {\n let rowsByPath = {}\n\n if (Array.isArray(rows)) {\n rowsByPath = rows.reduce((res, row) => {\n const formattedRow = {\n ...row,\n }\n\n delete formattedRow.path\n\n if (!res[row.path]) res[row.path] = []\n res[row.path].push(row)\n\n return res\n }, {})\n }\n\n return rowsByPath\n}\n"],"names":["createPathMap","rows","rowsByPath","Array","isArray","reduce","res","row","formattedRow","path","push"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,wCAAwC;AACxC,uBAAuB;AACvB,OAAO,MAAMA,gBAAgB,CAACC;IAC5B,IAAIC,aAAa,CAAC;IAElB,IAAIC,MAAMC,OAAO,CAACH,OAAO;QACvBC,aAAaD,KAAKI,MAAM,CAAC,CAACC,KAAKC;YAC7B,MAAMC,eAAe;gBACnB,GAAGD,GAAG;YACR;YAEA,OAAOC,aAAaC,IAAI;YAExB,IAAI,CAACH,GAAG,CAACC,IAAIE,IAAI,CAAC,EAAEH,GAAG,CAACC,IAAIE,IAAI,CAAC,GAAG,EAAE;YACtCH,GAAG,CAACC,IAAIE,IAAI,CAAC,CAACC,IAAI,CAACH;YAEnB,OAAOD;QACT,GAAG,CAAC;IACN;IAEA,OAAOJ;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/createRelationshipMap.ts"],"sourcesContent":["// Flatten rows to object with path keys\n// for easier retrieval\nexport const createPathMap = (rows: unknown): Record<string, Record<string, unknown>[]> => {\n let rowsByPath = {}\n\n if (Array.isArray(rows)) {\n rowsByPath = rows.reduce((res, row) => {\n const formattedRow = {\n ...row,\n }\n\n delete formattedRow.path\n\n if (!res[row.path]) res[row.path] = []\n res[row.path].push(row)\n\n return res\n }, {})\n }\n\n return rowsByPath\n}\n"],"names":["createPathMap","rows","rowsByPath","Array","isArray","reduce","res","row","formattedRow","path","push"],"mappings":"AAAA,wCAAwC;AACxC,uBAAuB;AACvB,OAAO,MAAMA,gBAAgB,CAACC;IAC5B,IAAIC,aAAa,CAAC;IAElB,IAAIC,MAAMC,OAAO,CAACH,OAAO;QACvBC,aAAaD,KAAKI,MAAM,CAAC,CAACC,KAAKC;YAC7B,MAAMC,eAAe;gBACnB,GAAGD,GAAG;YACR;YAEA,OAAOC,aAAaC,IAAI;YAExB,IAAI,CAACH,GAAG,CAACC,IAAIE,IAAI,CAAC,EAAEH,GAAG,CAACC,IAAIE,IAAI,CAAC,GAAG,EAAE;YACtCH,GAAG,CAACC,IAAIE,IAAI,CAAC,CAACC,IAAI,CAACH;YAEnB,OAAOD;QACT,GAAG,CAAC;IACN;IAEA,OAAOJ;AACT,EAAC"}
@@ -1,3 +1,3 @@
1
- import type { Field } from 'payload/types';
1
+ import type { Field } from 'payload';
2
2
  export declare const hasLocalesTable: (fields: Field[]) => boolean;
3
3
  //# sourceMappingURL=hasLocalesTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hasLocalesTable.d.ts","sourceRoot":"","sources":["../../src/utilities/hasLocalesTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAI1C,eAAO,MAAM,eAAe,WAAY,KAAK,EAAE,KAAG,OAOjD,CAAA"}
1
+ {"version":3,"file":"hasLocalesTable.d.ts","sourceRoot":"","sources":["../../src/utilities/hasLocalesTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,eAAe,WAAY,KAAK,EAAE,KAAG,OAOjD,CAAA"}
@@ -1,4 +1,4 @@
1
- import { fieldAffectsData, fieldHasSubFields } from 'payload/types';
1
+ import { fieldAffectsData, fieldHasSubFields } from 'payload/shared';
2
2
  export const hasLocalesTable = (fields)=>{
3
3
  return fields.some((field)=>{
4
4
  if (fieldAffectsData(field) && field.localized) return true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/hasLocalesTable.ts"],"sourcesContent":["import type { Field } from 'payload/types'\n\nimport { fieldAffectsData, fieldHasSubFields } from 'payload/types'\n\nexport const hasLocalesTable = (fields: Field[]): boolean => {\n return fields.some((field) => {\n if (fieldAffectsData(field) && field.localized) return true\n if (fieldHasSubFields(field) && field.type !== 'array') return hasLocalesTable(field.fields)\n if (field.type === 'tabs') return field.tabs.some((tab) => hasLocalesTable(tab.fields))\n return false\n })\n}\n"],"names":["fieldAffectsData","fieldHasSubFields","hasLocalesTable","fields","some","field","localized","type","tabs","tab"],"rangeMappings":";;;;;;;;","mappings":"AAEA,SAASA,gBAAgB,EAAEC,iBAAiB,QAAQ,gBAAe;AAEnE,OAAO,MAAMC,kBAAkB,CAACC;IAC9B,OAAOA,OAAOC,IAAI,CAAC,CAACC;QAClB,IAAIL,iBAAiBK,UAAUA,MAAMC,SAAS,EAAE,OAAO;QACvD,IAAIL,kBAAkBI,UAAUA,MAAME,IAAI,KAAK,SAAS,OAAOL,gBAAgBG,MAAMF,MAAM;QAC3F,IAAIE,MAAME,IAAI,KAAK,QAAQ,OAAOF,MAAMG,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAQP,gBAAgBO,IAAIN,MAAM;QACrF,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/hasLocalesTable.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { fieldAffectsData, fieldHasSubFields } from 'payload/shared'\n\nexport const hasLocalesTable = (fields: Field[]): boolean => {\n return fields.some((field) => {\n if (fieldAffectsData(field) && field.localized) return true\n if (fieldHasSubFields(field) && field.type !== 'array') return hasLocalesTable(field.fields)\n if (field.type === 'tabs') return field.tabs.some((tab) => hasLocalesTable(tab.fields))\n return false\n })\n}\n"],"names":["fieldAffectsData","fieldHasSubFields","hasLocalesTable","fields","some","field","localized","type","tabs","tab"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,iBAAiB,QAAQ,iBAAgB;AAEpE,OAAO,MAAMC,kBAAkB,CAACC;IAC9B,OAAOA,OAAOC,IAAI,CAAC,CAACC;QAClB,IAAIL,iBAAiBK,UAAUA,MAAMC,SAAS,EAAE,OAAO;QACvD,IAAIL,kBAAkBI,UAAUA,MAAME,IAAI,KAAK,SAAS,OAAOL,gBAAgBG,MAAMF,MAAM;QAC3F,IAAIE,MAAME,IAAI,KAAK,QAAQ,OAAOF,MAAMG,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAQP,gBAAgBO,IAAIN,MAAM;QACrF,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/isArrayOfRows.ts"],"sourcesContent":["export function isArrayOfRows(data: unknown): data is Record<string, unknown>[] {\n return Array.isArray(data)\n}\n"],"names":["isArrayOfRows","data","Array","isArray"],"rangeMappings":";;","mappings":"AAAA,OAAO,SAASA,cAAcC,IAAa;IACzC,OAAOC,MAAMC,OAAO,CAACF;AACvB"}
1
+ {"version":3,"sources":["../../src/utilities/isArrayOfRows.ts"],"sourcesContent":["export function isArrayOfRows(data: unknown): data is Record<string, unknown>[] {\n return Array.isArray(data)\n}\n"],"names":["isArrayOfRows","data","Array","isArray"],"mappings":"AAAA,OAAO,SAASA,cAAcC,IAAa;IACzC,OAAOC,MAAMC,OAAO,CAACF;AACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,eAAO,MAAM,oBAAoB,qBAA0B,QAAQ,OAAO,CAMzE,CAAA"}
1
+ {"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,eAAO,MAAM,oBAAoB,OAAc,SAAS,KAAG,OAAO,CAAC,OAAO,CAMzE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/migrationTableExists.ts"],"sourcesContent":["import { sql } from 'drizzle-orm'\n\nimport type { DrizzleDB } from '../types.js'\n\nexport const migrationTableExists = async (db: DrizzleDB): Promise<boolean> => {\n const queryRes = await db.execute(sql`SELECT to_regclass('public.payload_migrations');`)\n\n // Returns table name 'payload_migrations' or null\n const exists = queryRes.rows?.[0]?.to_regclass === 'payload_migrations'\n return exists\n}\n"],"names":["sql","migrationTableExists","db","queryRes","execute","exists","rows","to_regclass"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,cAAa;AAIjC,OAAO,MAAMC,uBAAuB,OAAOC;IACzC,MAAMC,WAAW,MAAMD,GAAGE,OAAO,CAACJ,GAAG,CAAC,gDAAgD,CAAC;IAEvF,kDAAkD;IAClD,MAAMK,SAASF,SAASG,IAAI,EAAE,CAAC,EAAE,EAAEC,gBAAgB;IACnD,OAAOF;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/migrationTableExists.ts"],"sourcesContent":["import { sql } from 'drizzle-orm'\n\nimport type { DrizzleDB } from '../types.js'\n\nexport const migrationTableExists = async (db: DrizzleDB): Promise<boolean> => {\n const queryRes = await db.execute(sql`SELECT to_regclass('public.payload_migrations');`)\n\n // Returns table name 'payload_migrations' or null\n const exists = queryRes.rows?.[0]?.to_regclass === 'payload_migrations'\n return exists\n}\n"],"names":["sql","migrationTableExists","db","queryRes","execute","exists","rows","to_regclass"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAa;AAIjC,OAAO,MAAMC,uBAAuB,OAAOC;IACzC,MAAMC,WAAW,MAAMD,GAAGE,OAAO,CAACJ,GAAG,CAAC,gDAAgD,CAAC;IAEvF,kDAAkD;IAClD,MAAMK,SAASF,SAASG,IAAI,EAAE,CAAC,EAAE,EAAEC,gBAAgB;IACnD,OAAOF;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/parseError.ts"],"sourcesContent":["import pg from 'pg'\nconst { DatabaseError } = pg\n\n/**\n * Format error message with hint if available\n */\nexport const parseError = (err: unknown, msg: string): string => {\n let formattedMsg = `${msg}`\n if (err instanceof Error) {\n formattedMsg += ` ${err.message}.`\n if (err instanceof DatabaseError) {\n msg += `: ${err.message}`\n if (err.hint) msg += ` ${err.hint}.`\n }\n }\n return formattedMsg\n}\n"],"names":["pg","DatabaseError","parseError","err","msg","formattedMsg","Error","message","hint"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAE1B;;CAEC,GACD,OAAO,MAAME,aAAa,CAACC,KAAcC;IACvC,IAAIC,eAAe,CAAC,EAAED,IAAI,CAAC;IAC3B,IAAID,eAAeG,OAAO;QACxBD,gBAAgB,CAAC,CAAC,EAAEF,IAAII,OAAO,CAAC,CAAC,CAAC;QAClC,IAAIJ,eAAeF,eAAe;YAChCG,OAAO,CAAC,EAAE,EAAED,IAAII,OAAO,CAAC,CAAC;YACzB,IAAIJ,IAAIK,IAAI,EAAEJ,OAAO,CAAC,CAAC,EAAED,IAAIK,IAAI,CAAC,CAAC,CAAC;QACtC;IACF;IACA,OAAOH;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/parseError.ts"],"sourcesContent":["import pg from 'pg'\nconst { DatabaseError } = pg\n\n/**\n * Format error message with hint if available\n */\nexport const parseError = (err: unknown, msg: string): string => {\n let formattedMsg = `${msg}`\n if (err instanceof Error) {\n formattedMsg += ` ${err.message}.`\n if (err instanceof DatabaseError) {\n msg += `: ${err.message}`\n if (err.hint) msg += ` ${err.hint}.`\n }\n }\n return formattedMsg\n}\n"],"names":["pg","DatabaseError","parseError","err","msg","formattedMsg","Error","message","hint"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAE1B;;CAEC,GACD,OAAO,MAAME,aAAa,CAACC,KAAcC;IACvC,IAAIC,eAAe,CAAC,EAAED,IAAI,CAAC;IAC3B,IAAID,eAAeG,OAAO;QACxBD,gBAAgB,CAAC,CAAC,EAAEF,IAAII,OAAO,CAAC,CAAC,CAAC;QAClC,IAAIJ,eAAeF,eAAe;YAChCG,OAAO,CAAC,EAAE,EAAED,IAAII,OAAO,CAAC,CAAC;YACzB,IAAIJ,IAAIK,IAAI,EAAEJ,OAAO,CAAC,CAAC,EAAED,IAAIK,IAAI,CAAC,CAAC,CAAC;QACtC;IACF;IACA,OAAOH;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,OAAc,eAAe,kBAmEtD,CAAA"}
1
+ {"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,OAAc,eAAe,kBAgEtD,CAAA"}
@@ -11,7 +11,7 @@ const require = createRequire(import.meta.url);
11
11
  */ export const pushDevSchema = async (db)=>{
12
12
  const { pushSchema } = require('drizzle-kit/payload');
13
13
  // This will prompt if clarifications are needed for Drizzle to push new schema
14
- const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(db.schema, db.drizzle);
14
+ const { apply, hasDataLoss, warnings } = await pushSchema(db.schema, db.drizzle);
15
15
  if (warnings.length) {
16
16
  let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
17
17
  if (hasDataLoss) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/pushDevSchema.ts"],"sourcesContent":["import { eq } from 'drizzle-orm'\nimport { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'\nimport { createRequire } from 'module'\nimport prompts from 'prompts'\n\nimport type { PostgresAdapter } from '../types.js'\n\nconst require = createRequire(import.meta.url)\n\n/**\n * Pushes the development schema to the database using Drizzle.\n *\n * @param {PostgresAdapter} db - The PostgresAdapter instance connected to the database.\n * @returns {Promise<void>} - A promise that resolves once the schema push is complete.\n */\nexport const pushDevSchema = async (db: PostgresAdapter) => {\n const { pushSchema } = require('drizzle-kit/payload')\n\n // This will prompt if clarifications are needed for Drizzle to push new schema\n const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(\n db.schema,\n db.drizzle,\n )\n\n if (warnings.length) {\n let message = `Warnings detected during schema push: \\n\\n${warnings.join('\\n')}\\n\\n`\n\n if (hasDataLoss) {\n message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\\n\\n`\n }\n\n message += `Accept warnings and push schema to database?`\n\n const { confirm: acceptWarnings } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n // Exit if user does not accept warnings.\n // Q: Is this the right type of exit for this interaction?\n if (!acceptWarnings) {\n process.exit(0)\n }\n }\n\n await apply()\n\n // Migration table def in order to use query using drizzle\n const migrationsSchema = db.pgSchema.table('payload_migrations', {\n name: varchar('name'),\n batch: numeric('batch'),\n created_at: timestamp('created_at'),\n updated_at: timestamp('updated_at'),\n })\n\n const devPush = await db.drizzle\n .select()\n .from(migrationsSchema)\n .where(eq(migrationsSchema.batch, '-1'))\n\n if (!devPush.length) {\n await db.drizzle.insert(migrationsSchema).values({\n name: 'dev',\n batch: '-1',\n })\n } else {\n await db.drizzle\n .update(migrationsSchema)\n .set({\n updated_at: new Date(),\n })\n .where(eq(migrationsSchema.batch, '-1'))\n }\n}\n"],"names":["eq","numeric","timestamp","varchar","createRequire","prompts","require","url","pushDevSchema","db","pushSchema","apply","hasDataLoss","statementsToExecute","warnings","schema","drizzle","length","message","join","confirm","acceptWarnings","name","type","initial","onCancel","process","exit","migrationsSchema","pgSchema","table","batch","created_at","updated_at","devPush","select","from","where","insert","values","update","set","Date"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,EAAE,QAAQ,cAAa;AAChC,SAASC,OAAO,EAAEC,SAAS,EAAEC,OAAO,QAAQ,sBAAqB;AACjE,SAASC,aAAa,QAAQ,SAAQ;AACtC,OAAOC,aAAa,UAAS;AAI7B,MAAMC,UAAUF,cAAc,YAAYG,GAAG;AAE7C;;;;;CAKC,GACD,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGJ,QAAQ;IAE/B,+EAA+E;IAC/E,MAAM,EAAEK,KAAK,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,QAAQ,EAAE,GAAG,MAAMJ,WAClED,GAAGM,MAAM,EACTN,GAAGO,OAAO;IAGZ,IAAIF,SAASG,MAAM,EAAE;QACnB,IAAIC,UAAU,CAAC,0CAA0C,EAAEJ,SAASK,IAAI,CAAC,MAAM,IAAI,CAAC;QAEpF,IAAIP,aAAa;YACfM,WAAW,CAAC,uEAAuE,CAAC;QACtF;QAEAA,WAAW,CAAC,4CAA4C,CAAC;QAEzD,MAAM,EAAEE,SAASC,cAAc,EAAE,GAAG,MAAMhB,QACxC;YACEiB,MAAM;YACNC,MAAM;YACNC,SAAS;YACTN;QACF,GACA;YACEO,UAAU;gBACRC,QAAQC,IAAI,CAAC;YACf;QACF;QAGF,yCAAyC;QACzC,0DAA0D;QAC1D,IAAI,CAACN,gBAAgB;YACnBK,QAAQC,IAAI,CAAC;QACf;IACF;IAEA,MAAMhB;IAEN,0DAA0D;IAC1D,MAAMiB,mBAAmBnB,GAAGoB,QAAQ,CAACC,KAAK,CAAC,sBAAsB;QAC/DR,MAAMnB,QAAQ;QACd4B,OAAO9B,QAAQ;QACf+B,YAAY9B,UAAU;QACtB+B,YAAY/B,UAAU;IACxB;IAEA,MAAMgC,UAAU,MAAMzB,GAAGO,OAAO,CAC7BmB,MAAM,GACNC,IAAI,CAACR,kBACLS,KAAK,CAACrC,GAAG4B,iBAAiBG,KAAK,EAAE;IAEpC,IAAI,CAACG,QAAQjB,MAAM,EAAE;QACnB,MAAMR,GAAGO,OAAO,CAACsB,MAAM,CAACV,kBAAkBW,MAAM,CAAC;YAC/CjB,MAAM;YACNS,OAAO;QACT;IACF,OAAO;QACL,MAAMtB,GAAGO,OAAO,CACbwB,MAAM,CAACZ,kBACPa,GAAG,CAAC;YACHR,YAAY,IAAIS;QAClB,GACCL,KAAK,CAACrC,GAAG4B,iBAAiBG,KAAK,EAAE;IACtC;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/pushDevSchema.ts"],"sourcesContent":["import { eq } from 'drizzle-orm'\nimport { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'\nimport { createRequire } from 'module'\nimport prompts from 'prompts'\n\nimport type { PostgresAdapter } from '../types.js'\n\nconst require = createRequire(import.meta.url)\n\n/**\n * Pushes the development schema to the database using Drizzle.\n *\n * @param {PostgresAdapter} db - The PostgresAdapter instance connected to the database.\n * @returns {Promise<void>} - A promise that resolves once the schema push is complete.\n */\nexport const pushDevSchema = async (db: PostgresAdapter) => {\n const { pushSchema } = require('drizzle-kit/payload')\n\n // This will prompt if clarifications are needed for Drizzle to push new schema\n const { apply, hasDataLoss, warnings } = await pushSchema(db.schema, db.drizzle)\n\n if (warnings.length) {\n let message = `Warnings detected during schema push: \\n\\n${warnings.join('\\n')}\\n\\n`\n\n if (hasDataLoss) {\n message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\\n\\n`\n }\n\n message += `Accept warnings and push schema to database?`\n\n const { confirm: acceptWarnings } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n // Exit if user does not accept warnings.\n // Q: Is this the right type of exit for this interaction?\n if (!acceptWarnings) {\n process.exit(0)\n }\n }\n\n await apply()\n\n // Migration table def in order to use query using drizzle\n const migrationsSchema = db.pgSchema.table('payload_migrations', {\n name: varchar('name'),\n batch: numeric('batch'),\n created_at: timestamp('created_at'),\n updated_at: timestamp('updated_at'),\n })\n\n const devPush = await db.drizzle\n .select()\n .from(migrationsSchema)\n .where(eq(migrationsSchema.batch, '-1'))\n\n if (!devPush.length) {\n await db.drizzle.insert(migrationsSchema).values({\n name: 'dev',\n batch: '-1',\n })\n } else {\n await db.drizzle\n .update(migrationsSchema)\n .set({\n updated_at: new Date(),\n })\n .where(eq(migrationsSchema.batch, '-1'))\n }\n}\n"],"names":["eq","numeric","timestamp","varchar","createRequire","prompts","require","url","pushDevSchema","db","pushSchema","apply","hasDataLoss","warnings","schema","drizzle","length","message","join","confirm","acceptWarnings","name","type","initial","onCancel","process","exit","migrationsSchema","pgSchema","table","batch","created_at","updated_at","devPush","select","from","where","insert","values","update","set","Date"],"mappings":"AAAA,SAASA,EAAE,QAAQ,cAAa;AAChC,SAASC,OAAO,EAAEC,SAAS,EAAEC,OAAO,QAAQ,sBAAqB;AACjE,SAASC,aAAa,QAAQ,SAAQ;AACtC,OAAOC,aAAa,UAAS;AAI7B,MAAMC,UAAUF,cAAc,YAAYG,GAAG;AAE7C;;;;;CAKC,GACD,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGJ,QAAQ;IAE/B,+EAA+E;IAC/E,MAAM,EAAEK,KAAK,EAAEC,WAAW,EAAEC,QAAQ,EAAE,GAAG,MAAMH,WAAWD,GAAGK,MAAM,EAAEL,GAAGM,OAAO;IAE/E,IAAIF,SAASG,MAAM,EAAE;QACnB,IAAIC,UAAU,CAAC,0CAA0C,EAAEJ,SAASK,IAAI,CAAC,MAAM,IAAI,CAAC;QAEpF,IAAIN,aAAa;YACfK,WAAW,CAAC,uEAAuE,CAAC;QACtF;QAEAA,WAAW,CAAC,4CAA4C,CAAC;QAEzD,MAAM,EAAEE,SAASC,cAAc,EAAE,GAAG,MAAMf,QACxC;YACEgB,MAAM;YACNC,MAAM;YACNC,SAAS;YACTN;QACF,GACA;YACEO,UAAU;gBACRC,QAAQC,IAAI,CAAC;YACf;QACF;QAGF,yCAAyC;QACzC,0DAA0D;QAC1D,IAAI,CAACN,gBAAgB;YACnBK,QAAQC,IAAI,CAAC;QACf;IACF;IAEA,MAAMf;IAEN,0DAA0D;IAC1D,MAAMgB,mBAAmBlB,GAAGmB,QAAQ,CAACC,KAAK,CAAC,sBAAsB;QAC/DR,MAAMlB,QAAQ;QACd2B,OAAO7B,QAAQ;QACf8B,YAAY7B,UAAU;QACtB8B,YAAY9B,UAAU;IACxB;IAEA,MAAM+B,UAAU,MAAMxB,GAAGM,OAAO,CAC7BmB,MAAM,GACNC,IAAI,CAACR,kBACLS,KAAK,CAACpC,GAAG2B,iBAAiBG,KAAK,EAAE;IAEpC,IAAI,CAACG,QAAQjB,MAAM,EAAE;QACnB,MAAMP,GAAGM,OAAO,CAACsB,MAAM,CAACV,kBAAkBW,MAAM,CAAC;YAC/CjB,MAAM;YACNS,OAAO;QACT;IACF,OAAO;QACL,MAAMrB,GAAGM,OAAO,CACbwB,MAAM,CAACZ,kBACPa,GAAG,CAAC;YACHR,YAAY,IAAIS;QAClB,GACCL,KAAK,CAACpC,GAAG2B,iBAAiBG,KAAK,EAAE;IACtC;AACF,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-postgres",
3
- "version": "3.0.0-canary.92e4997",
3
+ "version": "3.0.0-canary.a0b06af",
4
4
  "description": "The officially supported Postgres database adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -14,13 +14,18 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "import": "./dist/index.js",
17
- "require": "./dist/index.js",
18
- "types": "./dist/index.d.ts"
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
19
  },
20
20
  "./types": {
21
21
  "import": "./dist/types.js",
22
- "require": "./dist/types.js",
23
- "types": "./dist/types.d.ts"
22
+ "types": "./dist/types.d.ts",
23
+ "default": "./dist/types.js"
24
+ },
25
+ "./migration-utils": {
26
+ "import": "./dist/exports/migration-utils.js",
27
+ "types": "./dist/exports/migration-utils.d.ts",
28
+ "default": "./dist/exports/migration-utils.js"
24
29
  }
25
30
  },
26
31
  "main": "./dist/index.js",
@@ -37,21 +42,25 @@
37
42
  "pg": "8.11.3",
38
43
  "prompts": "2.4.2",
39
44
  "to-snake-case": "1.0.0",
40
- "uuid": "9.0.0"
45
+ "uuid": "10.0.0"
41
46
  },
42
47
  "devDependencies": {
48
+ "@hyrious/esbuild-plugin-commonjs": "^0.2.4",
43
49
  "@types/pg": "8.10.2",
44
50
  "@types/to-snake-case": "1.0.0",
45
- "@payloadcms/eslint-config": "1.1.1",
46
- "payload": "3.0.0-canary.92e4997"
51
+ "esbuild": "0.23.0",
52
+ "@payloadcms/eslint-config": "3.0.0-beta.59",
53
+ "payload": "3.0.0-canary.a0b06af"
47
54
  },
48
55
  "peerDependencies": {
49
- "payload": "3.0.0-canary.92e4997"
56
+ "payload": "3.0.0-canary.a0b06af"
50
57
  },
51
58
  "scripts": {
52
- "build": "pnpm build:swc && pnpm build:types",
53
- "build:swc": "swc ./src -d ./dist --config-file .swcrc",
59
+ "build": "rimraf .dist && rimraf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm renamePredefinedMigrations",
60
+ "build:esbuild": "echo skipping esbuild",
61
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
54
62
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
55
- "clean": "rimraf {dist,*.tsbuildinfo}"
63
+ "clean": "rimraf {dist,*.tsbuildinfo}",
64
+ "renamePredefinedMigrations": "tsx ./scripts/renamePredefinedMigrations.ts"
56
65
  }
57
66
  }