@seedprotocol/sdk 0.4.32 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/BasePathResolver-BDgc7c4T.js +485 -0
  2. package/dist/BasePathResolver-BDgc7c4T.js.map +1 -0
  3. package/dist/{ModelProperty-e_hXSFvf.js → ModelProperty-D-ysg8zA.js} +37 -43
  4. package/dist/ModelProperty-D-ysg8zA.js.map +1 -0
  5. package/dist/{Schema-DonRkUOJ.js → Schema-CyCftnKI.js} +40 -40
  6. package/dist/{Schema-DonRkUOJ.js.map → Schema-CyCftnKI.js.map} +1 -1
  7. package/dist/{SchemaValidationService-DcmfhQae.js → SchemaValidationService-POM6jHbJ.js} +9 -5
  8. package/dist/{SchemaValidationService-DcmfhQae.js.map → SchemaValidationService-POM6jHbJ.js.map} +1 -1
  9. package/dist/{backfillMetadataPropertyIds-CKTfvFgQ.js → backfillMetadataPropertyIds-DzZw57iJ.js} +3 -11
  10. package/dist/{backfillMetadataPropertyIds-CKTfvFgQ.js.map → backfillMetadataPropertyIds-DzZw57iJ.js.map} +1 -1
  11. package/dist/cjs/{ModelProperty-BQYU5hPQ.js → ModelProperty-CmuGJvyi.js} +25 -26
  12. package/dist/cjs/{ModelProperty-BQYU5hPQ.js.map → ModelProperty-CmuGJvyi.js.map} +1 -1
  13. package/dist/cjs/{Schema-BcRHcQ0W.js → Schema-gpFnZMhB.js} +28 -29
  14. package/dist/cjs/{Schema-BcRHcQ0W.js.map → Schema-gpFnZMhB.js.map} +1 -1
  15. package/dist/cjs/{SchemaValidationService-CQNDgyZl.js → SchemaValidationService-E3xTSRai.js} +9 -10
  16. package/dist/cjs/{SchemaValidationService-CQNDgyZl.js.map → SchemaValidationService-E3xTSRai.js.map} +1 -1
  17. package/dist/cjs/{backfillMetadataPropertyIds-Dn4oVmEv.js → backfillMetadataPropertyIds-_bivrvRs.js} +11 -12
  18. package/dist/cjs/{backfillMetadataPropertyIds-Dn4oVmEv.js.map → backfillMetadataPropertyIds-_bivrvRs.js.map} +1 -1
  19. package/dist/cjs/eas-BwDKJmlb.js +112 -0
  20. package/dist/cjs/eas-BwDKJmlb.js.map +1 -0
  21. package/dist/cjs/{getItem-DpnPrzl3.js → getItem-MShQw3sz.js} +11 -12
  22. package/dist/cjs/{getItem-DpnPrzl3.js.map → getItem-MShQw3sz.js.map} +1 -1
  23. package/dist/cjs/{getPublishPayload-CGKMEL3H.js → getPublishPayload-C1nOOXp_.js} +93 -83
  24. package/dist/cjs/getPublishPayload-C1nOOXp_.js.map +1 -0
  25. package/dist/cjs/{getPublishUploads-DeI0f2UN.js → getPublishUploads-BjgxgrKD.js} +17 -18
  26. package/dist/cjs/{getPublishUploads-DeI0f2UN.js.map → getPublishUploads-BjgxgrKD.js.map} +1 -1
  27. package/dist/cjs/{getSegmentedItemProperties-BgS_FhAx.js → getSegmentedItemProperties-Cuw7wcxb.js} +64 -15
  28. package/dist/cjs/getSegmentedItemProperties-Cuw7wcxb.js.map +1 -0
  29. package/dist/cjs/{index-BnAqr2le.js → index-9Z2FOvLD.js} +12 -13
  30. package/dist/cjs/index-9Z2FOvLD.js.map +1 -0
  31. package/dist/cjs/{index-ByozbTn_.js → index-vk2DeF2D.js} +1237 -3235
  32. package/dist/cjs/index-vk2DeF2D.js.map +1 -0
  33. package/dist/cjs/index.browser-BSf8HpnU.js +22 -0
  34. package/dist/cjs/index.browser-BSf8HpnU.js.map +1 -0
  35. package/dist/cjs/{ownership-CsWuaNfH.js → ownership-DhWda0J9.js} +11 -25
  36. package/dist/cjs/{ownership-CsWuaNfH.js.map → ownership-DhWda0J9.js.map} +1 -1
  37. package/dist/cjs/{property-CeR45LMx.js → property-D3Ww2_Qh.js} +13 -14
  38. package/dist/cjs/{property-CeR45LMx.js.map → property-D3Ww2_Qh.js.map} +1 -1
  39. package/dist/cjs/{syncDbWithEas-CA2Lum5V.js → syncDbWithEas-Dht3_7UD.js} +26 -39
  40. package/dist/cjs/syncDbWithEas-Dht3_7UD.js.map +1 -0
  41. package/dist/configurePlatform-R5neRbQ9.js +27 -0
  42. package/dist/configurePlatform-R5neRbQ9.js.map +1 -0
  43. package/dist/constants-B5S5JPDK.js +660 -0
  44. package/dist/constants-B5S5JPDK.js.map +1 -0
  45. package/dist/constants-DMHTYMgJ.js +120 -0
  46. package/dist/constants-DMHTYMgJ.js.map +1 -0
  47. package/dist/db-Cvh84NY7.js +1972 -0
  48. package/dist/db-Cvh84NY7.js.map +1 -0
  49. package/dist/eas-D9b7z2Wn.js +68 -0
  50. package/dist/eas-D9b7z2Wn.js.map +1 -0
  51. package/dist/{getItem-GOXWo_Iy.js → getItem-B81V3m4S.js} +10 -6
  52. package/dist/{getItem-GOXWo_Iy.js.map → getItem-B81V3m4S.js.map} +1 -1
  53. package/dist/{getPublishPayload-D16enahU.js → getPublishPayload-CNYsn8-6.js} +87 -74
  54. package/dist/getPublishPayload-CNYsn8-6.js.map +1 -0
  55. package/dist/{getPublishUploads-wGqH19UY.js → getPublishUploads-D9rPHkB7.js} +14 -10
  56. package/dist/{getPublishUploads-wGqH19UY.js.map → getPublishUploads-D9rPHkB7.js.map} +1 -1
  57. package/dist/{getSegmentedItemProperties-Be3kYWY3.js → getSegmentedItemProperties-Bg3_b-b1.js} +18 -15
  58. package/dist/getSegmentedItemProperties-Bg3_b-b1.js.map +1 -0
  59. package/dist/{index-BcXKZQpX.js → index--F3Wolt5.js} +1171 -5452
  60. package/dist/index--F3Wolt5.js.map +1 -0
  61. package/dist/{index-BFyMxc7e.js → index-QMrBK-L3.js} +2 -2
  62. package/dist/index-QMrBK-L3.js.map +1 -0
  63. package/dist/index-oi4roUVf.js +22 -0
  64. package/dist/index-oi4roUVf.js.map +1 -0
  65. package/dist/index.node-Bow8kHew.js +503 -0
  66. package/dist/index.node-Bow8kHew.js.map +1 -0
  67. package/dist/main.cjs +16 -15
  68. package/dist/main.cjs.map +1 -1
  69. package/dist/main.js +31 -22
  70. package/dist/main.js.map +1 -1
  71. package/dist/node.js +37 -363
  72. package/dist/node.js.map +1 -1
  73. package/dist/{ownership-C17YhE7J.js → ownership-BF_ZUKIp.js} +13 -9
  74. package/dist/{ownership-C17YhE7J.js.map → ownership-BF_ZUKIp.js.map} +1 -1
  75. package/dist/platform.browser.js +3499 -0
  76. package/dist/platform.browser.js.map +1 -0
  77. package/dist/platform.node.js +19 -0
  78. package/dist/platform.node.js.map +1 -0
  79. package/dist/{property-CRAau-Q-.js → property-BdyDfcSc.js} +14 -11
  80. package/dist/property-BdyDfcSc.js.map +1 -0
  81. package/dist/src/Item/Item.d.ts.map +1 -1
  82. package/dist/src/Item/service/actors/fetchDataFromEas.d.ts.map +1 -1
  83. package/dist/src/Model/service/actors/createModelProperties.d.ts.map +1 -1
  84. package/dist/src/Model/service/modelMachine.d.ts +1 -1
  85. package/dist/src/browser/db/Db.d.ts +17 -18
  86. package/dist/src/browser/db/Db.d.ts.map +1 -1
  87. package/dist/src/browser/helpers/ArweaveClient.d.ts +10 -27
  88. package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
  89. package/dist/src/browser/helpers/EasClient.d.ts +6 -4
  90. package/dist/src/browser/helpers/EasClient.d.ts.map +1 -1
  91. package/dist/src/browser/helpers/FileManager.d.ts +27 -26
  92. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  93. package/dist/src/browser/helpers/PathResolver.d.ts +6 -5
  94. package/dist/src/browser/helpers/PathResolver.d.ts.map +1 -1
  95. package/dist/src/browser/helpers/QueryClient.d.ts +6 -5
  96. package/dist/src/browser/helpers/QueryClient.d.ts.map +1 -1
  97. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
  98. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
  99. package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
  100. package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
  101. package/dist/src/db/Db/BaseDb.d.ts +6 -26
  102. package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
  103. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  104. package/dist/src/db/write/createMetadata.d.ts.map +1 -1
  105. package/dist/src/db/write/updateMetadata.d.ts.map +1 -1
  106. package/dist/src/eas.d.ts +4 -37
  107. package/dist/src/eas.d.ts.map +1 -1
  108. package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts +1 -101
  109. package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts.map +1 -1
  110. package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts +1 -51
  111. package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts.map +1 -1
  112. package/dist/src/helpers/ArweaveClient/index.d.ts +2 -2
  113. package/dist/src/helpers/ArweaveClient/index.d.ts.map +1 -1
  114. package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts +1 -15
  115. package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts.map +1 -1
  116. package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +1 -22
  117. package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts.map +1 -1
  118. package/dist/src/helpers/EasClient/BaseEasClient.d.ts +1 -9
  119. package/dist/src/helpers/EasClient/BaseEasClient.d.ts.map +1 -1
  120. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +4 -2
  121. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  122. package/dist/src/helpers/FileManager/IFileManager.d.ts +44 -0
  123. package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -0
  124. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +16 -12
  125. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +1 -1
  126. package/dist/src/helpers/PathResolver/IPathResolver.d.ts +16 -0
  127. package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +1 -0
  128. package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts +1 -6
  129. package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts.map +1 -1
  130. package/dist/src/helpers/constants.d.ts +4 -22
  131. package/dist/src/helpers/constants.d.ts.map +1 -1
  132. package/dist/src/helpers/db.d.ts.map +1 -1
  133. package/dist/src/helpers/easPropertyCanonical.d.ts +1 -14
  134. package/dist/src/helpers/easPropertyCanonical.d.ts.map +1 -1
  135. package/dist/src/helpers/easRevokedFilter.d.ts +1 -9
  136. package/dist/src/helpers/easRevokedFilter.d.ts.map +1 -1
  137. package/dist/src/helpers/easUid.d.ts +1 -12
  138. package/dist/src/helpers/easUid.d.ts.map +1 -1
  139. package/dist/src/helpers/ethereumUtils.d.ts +5 -0
  140. package/dist/src/helpers/ethereumUtils.d.ts.map +1 -0
  141. package/dist/src/helpers/file/fetchAll/index.d.ts +1 -1
  142. package/dist/src/helpers/file/fetchAll/index.d.ts.map +1 -1
  143. package/dist/src/helpers/gateway/gatewayState.d.ts +2 -0
  144. package/dist/src/helpers/gateway/gatewayState.d.ts.map +1 -0
  145. package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts +2 -0
  146. package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts.map +1 -0
  147. package/dist/src/helpers/gateway/seedGatewayConfig.d.ts +2 -0
  148. package/dist/src/helpers/gateway/seedGatewayConfig.d.ts.map +1 -0
  149. package/dist/src/helpers/generateId.d.ts +2 -0
  150. package/dist/src/helpers/generateId.d.ts.map +1 -0
  151. package/dist/src/helpers/getSchemaForItemProperty.d.ts +1 -1
  152. package/dist/src/helpers/getSchemaForItemProperty.d.ts.map +1 -1
  153. package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
  154. package/dist/src/helpers/index.d.ts +15 -10
  155. package/dist/src/helpers/index.d.ts.map +1 -1
  156. package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts +7 -0
  157. package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts.map +1 -0
  158. package/dist/src/helpers/mediaRef.d.ts.map +1 -1
  159. package/dist/src/helpers/property/index.d.ts.map +1 -1
  160. package/dist/src/index.d.ts +9 -7
  161. package/dist/src/index.d.ts.map +1 -1
  162. package/dist/src/interfaces/IDb.d.ts +11 -0
  163. package/dist/src/interfaces/IDb.d.ts.map +1 -1
  164. package/dist/src/node/db/Db.d.ts +22 -37
  165. package/dist/src/node/db/Db.d.ts.map +1 -1
  166. package/dist/src/node/helpers/ArweaveClient.d.ts +4 -30
  167. package/dist/src/node/helpers/ArweaveClient.d.ts.map +1 -1
  168. package/dist/src/node/helpers/EasClient.d.ts +4 -6
  169. package/dist/src/node/helpers/EasClient.d.ts.map +1 -1
  170. package/dist/src/node/helpers/FileManager.d.ts +26 -25
  171. package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
  172. package/dist/src/node/helpers/PathResolver.d.ts +6 -5
  173. package/dist/src/node/helpers/PathResolver.d.ts.map +1 -1
  174. package/dist/src/node/helpers/QueryClient.d.ts +4 -6
  175. package/dist/src/node/helpers/QueryClient.d.ts.map +1 -1
  176. package/dist/src/node/helpers/scripts.d.ts +5 -7
  177. package/dist/src/node/helpers/scripts.d.ts.map +1 -1
  178. package/dist/src/node/index.d.ts +2 -9
  179. package/dist/src/node/index.d.ts.map +1 -1
  180. package/dist/src/node/webpack/index.d.ts +1 -1
  181. package/dist/src/node/webpack/index.d.ts.map +1 -1
  182. package/dist/src/platform/configurePlatform.d.ts +6 -0
  183. package/dist/src/platform/configurePlatform.d.ts.map +1 -0
  184. package/dist/src/platform/index.browser.d.ts +3 -0
  185. package/dist/src/platform/index.browser.d.ts.map +1 -0
  186. package/dist/src/platform/index.d.ts +9 -0
  187. package/dist/src/platform/index.d.ts.map +1 -0
  188. package/dist/src/platform/index.node.d.ts +3 -0
  189. package/dist/src/platform/index.node.d.ts.map +1 -0
  190. package/dist/src/platform/types.d.ts +14 -0
  191. package/dist/src/platform/types.d.ts.map +1 -0
  192. package/dist/src/stores/eas.d.ts +1 -18
  193. package/dist/src/stores/eas.d.ts.map +1 -1
  194. package/dist/src/testing/platformTestHandle.d.ts +8 -0
  195. package/dist/src/testing/platformTestHandle.d.ts.map +1 -0
  196. package/dist/src/types/gateway.d.ts +2 -0
  197. package/dist/src/types/gateway.d.ts.map +1 -0
  198. package/dist/src/types/index.d.ts +5 -0
  199. package/dist/src/types/index.d.ts.map +1 -1
  200. package/dist/src/types/item.d.ts +1 -1
  201. package/dist/src/types/item.d.ts.map +1 -1
  202. package/dist/src/types/machines.d.ts +10 -0
  203. package/dist/src/types/machines.d.ts.map +1 -1
  204. package/dist/src/types/seedProtocol.d.ts +1 -1
  205. package/dist/src/types/seedProtocol.d.ts.map +1 -1
  206. package/dist/src/vite/index.d.ts +2 -47
  207. package/dist/src/vite/index.d.ts.map +1 -1
  208. package/dist/{syncDbWithEas-CB5aXPtf.js → syncDbWithEas-DMOJHtkP.js} +20 -15
  209. package/dist/syncDbWithEas-DMOJHtkP.js.map +1 -0
  210. package/dist/{updateSeedRevokedAt-BIu5Q4Po.js → updateSeedRevokedAt-Ba0OhDQj.js} +2 -2
  211. package/dist/{updateSeedRevokedAt-BIu5Q4Po.js.map → updateSeedRevokedAt-Ba0OhDQj.js.map} +1 -1
  212. package/dist/vite.cjs +5 -481
  213. package/dist/vite.cjs.map +1 -1
  214. package/dist/vite.js +1 -483
  215. package/dist/vite.js.map +1 -1
  216. package/package.json +42 -37
  217. package/dist/ArweaveClient-CZpZgmR2.js +0 -204
  218. package/dist/ArweaveClient-CZpZgmR2.js.map +0 -1
  219. package/dist/ArweaveClient-Cs7AL9dp.js +0 -204
  220. package/dist/ArweaveClient-Cs7AL9dp.js.map +0 -1
  221. package/dist/Db-CF6R7HIy.js +0 -2098
  222. package/dist/Db-CF6R7HIy.js.map +0 -1
  223. package/dist/Db-CZkONsdT.js +0 -248
  224. package/dist/Db-CZkONsdT.js.map +0 -1
  225. package/dist/EasClient-PXOzSzPG.js +0 -29
  226. package/dist/EasClient-PXOzSzPG.js.map +0 -1
  227. package/dist/EasClient-qfTiM2we.js +0 -29
  228. package/dist/EasClient-qfTiM2we.js.map +0 -1
  229. package/dist/FileManager-5GkHtxF7.js +0 -1256
  230. package/dist/FileManager-5GkHtxF7.js.map +0 -1
  231. package/dist/FileManager-jORQ8Bb6.js +0 -177
  232. package/dist/FileManager-jORQ8Bb6.js.map +0 -1
  233. package/dist/ModelProperty-e_hXSFvf.js.map +0 -1
  234. package/dist/PathResolver-B4_X69Rd.js +0 -204
  235. package/dist/PathResolver-B4_X69Rd.js.map +0 -1
  236. package/dist/PathResolver-Dz0RVGIz.js +0 -78
  237. package/dist/PathResolver-Dz0RVGIz.js.map +0 -1
  238. package/dist/QueryClient-CXHZ239d.js +0 -51
  239. package/dist/QueryClient-CXHZ239d.js.map +0 -1
  240. package/dist/QueryClient-D_UK4YLm.js +0 -35
  241. package/dist/QueryClient-D_UK4YLm.js.map +0 -1
  242. package/dist/arweave-default-shim.js +0 -6
  243. package/dist/cjs/getPublishPayload-CGKMEL3H.js.map +0 -1
  244. package/dist/cjs/getSegmentedItemProperties-BgS_FhAx.js.map +0 -1
  245. package/dist/cjs/index-BnAqr2le.js.map +0 -1
  246. package/dist/cjs/index-ByozbTn_.js.map +0 -1
  247. package/dist/cjs/syncDbWithEas-CA2Lum5V.js.map +0 -1
  248. package/dist/debug-default-shim.js +0 -27
  249. package/dist/getPublishPayload-D16enahU.js.map +0 -1
  250. package/dist/getSegmentedItemProperties-Be3kYWY3.js.map +0 -1
  251. package/dist/index-BFyMxc7e.js.map +0 -1
  252. package/dist/index-BcXKZQpX.js.map +0 -1
  253. package/dist/index-C9p-skT3.js +0 -18
  254. package/dist/index-C9p-skT3.js.map +0 -1
  255. package/dist/property-CRAau-Q-.js.map +0 -1
  256. package/dist/queries-Ct7CcQ3g.js +0 -16
  257. package/dist/queries-Ct7CcQ3g.js.map +0 -1
  258. package/dist/src/Item/queries.d.ts +0 -27
  259. package/dist/src/Item/queries.d.ts.map +0 -1
  260. package/dist/src/graphql/fragments/Attestation.d.ts +0 -2
  261. package/dist/src/graphql/fragments/Attestation.d.ts.map +0 -1
  262. package/dist/src/graphql/fragments/Schema.d.ts +0 -2
  263. package/dist/src/graphql/fragments/Schema.d.ts.map +0 -1
  264. package/dist/src/graphql/fragments/index.d.ts +0 -3
  265. package/dist/src/graphql/fragments/index.d.ts.map +0 -1
  266. package/dist/src/graphql/gql/fragment-masking.d.ts +0 -20
  267. package/dist/src/graphql/gql/fragment-masking.d.ts.map +0 -1
  268. package/dist/src/graphql/gql/gql.d.ts +0 -107
  269. package/dist/src/graphql/gql/gql.d.ts.map +0 -1
  270. package/dist/src/graphql/gql/graphql.d.ts +0 -2969
  271. package/dist/src/graphql/gql/graphql.d.ts.map +0 -1
  272. package/dist/src/graphql/gql/index.d.ts +0 -3
  273. package/dist/src/graphql/gql/index.d.ts.map +0 -1
  274. package/dist/src/helpers/ArweaveClient/queries.d.ts +0 -13
  275. package/dist/src/helpers/ArweaveClient/queries.d.ts.map +0 -1
  276. package/dist/src/helpers/file/queries.d.ts +0 -9
  277. package/dist/src/helpers/file/queries.d.ts.map +0 -1
  278. package/dist/src/helpers/image/queries.d.ts +0 -7
  279. package/dist/src/helpers/image/queries.d.ts.map +0 -1
  280. package/dist/src/node/codegen/drizzle.d.ts +0 -5
  281. package/dist/src/node/codegen/drizzle.d.ts.map +0 -1
  282. package/dist/src/node/codegen/index.d.ts +0 -2
  283. package/dist/src/node/codegen/index.d.ts.map +0 -1
  284. package/dist/src/node/codegen/ts-to-proto.d.ts +0 -9
  285. package/dist/src/node/codegen/ts-to-proto.d.ts.map +0 -1
  286. package/dist/src/node/db/node.app.db.config.d.ts +0 -4
  287. package/dist/src/node/db/node.app.db.config.d.ts.map +0 -1
  288. package/dist/src/node/helpers/index.d.ts +0 -3
  289. package/dist/src/node/helpers/index.d.ts.map +0 -1
  290. package/dist/src/vite/arweave-default-shim.d.ts +0 -4
  291. package/dist/src/vite/arweave-default-shim.d.ts.map +0 -1
  292. package/dist/src/vite/debug-default-shim.d.ts +0 -3
  293. package/dist/src/vite/debug-default-shim.d.ts.map +0 -1
  294. package/dist/src/vite/easFix.d.ts +0 -2
  295. package/dist/src/vite/easFix.d.ts.map +0 -1
  296. package/dist/syncDbWithEas-CB5aXPtf.js.map +0 -1
  297. /package/dist/db/drizzle/{drizzle/0000_married_malice.sql → 0000_married_malice.sql} +0 -0
  298. /package/dist/db/drizzle/{drizzle/0001_sweet_bruce_banner.sql → 0001_sweet_bruce_banner.sql} +0 -0
  299. /package/dist/db/drizzle/{drizzle/0002_bitter_proudstar.sql → 0002_bitter_proudstar.sql} +0 -0
  300. /package/dist/db/drizzle/{drizzle/0003_cultured_senator_kelly.sql → 0003_cultured_senator_kelly.sql} +0 -0
  301. /package/dist/db/drizzle/{drizzle/0004_add_publisher_to_seeds.sql → 0004_add_publisher_to_seeds.sql} +0 -0
  302. /package/dist/db/drizzle/{drizzle/0005_bright_lily_hollister.sql → 0005_bright_lily_hollister.sql} +0 -0
  303. /package/dist/db/drizzle/{drizzle/0006_add_publisher_to_versions_and_metadata.sql → 0006_add_publisher_to_versions_and_metadata.sql} +0 -0
  304. /package/dist/db/drizzle/{drizzle/0007_add_required_to_properties.sql → 0007_add_required_to_properties.sql} +0 -0
  305. /package/dist/db/drizzle/{drizzle/0008_add_revoked_at_to_seeds.sql → 0008_add_revoked_at_to_seeds.sql} +0 -0
  306. /package/dist/db/drizzle/{drizzle/0009_happy_namor.sql → 0009_happy_namor.sql} +0 -0
  307. /package/dist/db/drizzle/{drizzle/0010_add_arweave_l1_finalize_jobs.sql → 0010_add_arweave_l1_finalize_jobs.sql} +0 -0
  308. /package/dist/db/drizzle/{drizzle/0011_normalize_placeholder_uids.sql → 0011_normalize_placeholder_uids.sql} +0 -0
  309. /package/dist/db/drizzle/{drizzle/0012_html_embedded_image_co_publish.sql → 0012_html_embedded_image_co_publish.sql} +0 -0
  310. /package/dist/db/drizzle/{drizzle/0013_eas_sync_processes.sql → 0013_eas_sync_processes.sql} +0 -0
  311. /package/dist/db/drizzle/{drizzle/meta → meta}/0000_snapshot.json +0 -0
  312. /package/dist/db/drizzle/{drizzle/meta → meta}/0001_snapshot.json +0 -0
  313. /package/dist/db/drizzle/{drizzle/meta → meta}/0002_snapshot.json +0 -0
  314. /package/dist/db/drizzle/{drizzle/meta → meta}/0003_snapshot.json +0 -0
  315. /package/dist/db/drizzle/{drizzle/meta → meta}/0004_snapshot.json +0 -0
  316. /package/dist/db/drizzle/{drizzle/meta → meta}/0005_snapshot.json +0 -0
  317. /package/dist/db/drizzle/{drizzle/meta → meta}/0006_snapshot.json +0 -0
  318. /package/dist/db/drizzle/{drizzle/meta → meta}/0007_snapshot.json +0 -0
  319. /package/dist/db/drizzle/{drizzle/meta → meta}/0008_snapshot.json +0 -0
  320. /package/dist/db/drizzle/{drizzle/meta → meta}/0009_snapshot.json +0 -0
  321. /package/dist/db/drizzle/{drizzle/meta → meta}/0010_snapshot.json +0 -0
  322. /package/dist/db/drizzle/{drizzle/meta → meta}/0013_snapshot.json +0 -0
  323. /package/dist/db/drizzle/{drizzle/meta → meta}/_journal.json +0 -0
package/dist/node.js CHANGED
@@ -1,43 +1,42 @@
1
1
  import { enableMapSet } from 'immer';
2
2
  import 'reflect-metadata';
3
- import { b as ModelPropertyDataTypes, P as Property, aF as addModelsToDb, a2 as BasePathResolver, K as modelPropertiesToObject, aG as SCHEMA_NJK } from './index-BcXKZQpX.js';
4
- export { B as Boolean, D as Date, aJ as INIT_SCRIPT_SUCCESS_MESSAGE, I as Image, u as Item, aH as ItemProperty, J as Json, L as List, M as Model, N as Number, R as Relation, aK as SCHEMA_TS, k as Text, a1 as appState, aI as client, a9 as config, aw as eventEmitter, Q as getCorrectId, aL as getRefValueType, aM as importJsonSchema, aN as loadSchemaFromFile, ab as metadata, ae as modelUids, A as models, aO as readJsonImportFile, s as seeds, aP as syncSchemaFromSource, aQ as transformImportToSchemaFile, am as versions } from './index-BcXKZQpX.js';
5
- import pluralize from 'pluralize';
3
+ export { I as Item, h as ItemProperty, M as Model, C as client, i as eventEmitter, j as getRefValueType, k as importJsonSchema, l as loadSchemaFromFile, n as readJsonImportFile, s as syncSchemaFromSource, t as transformImportToSchemaFile } from './index--F3Wolt5.js';
4
+ import { M as ModelPropertyDataTypes, P as Property } from './constants-B5S5JPDK.js';
5
+ export { B as Boolean, D as Date, I as Image, J as Json, L as List, N as Number, R as Relation, h as Text, l as getCorrectId } from './constants-B5S5JPDK.js';
6
+ import 'pluralize';
7
+ import { B as BaseDb } from './BasePathResolver-BDgc7c4T.js';
8
+ export { t as BasePathResolver, b as appState, d as config, f as metadata, j as modelUids, m as models, s as seeds, v as versions } from './BasePathResolver-BDgc7c4T.js';
6
9
  import 'drizzle-orm';
7
- export { FileManager } from './FileManager-jORQ8Bb6.js';
8
- export { Db } from './Db-CZkONsdT.js';
10
+ import { c as createPlatformServices } from './index.node-Bow8kHew.js';
11
+ export { D as Db, F as FileManager, P as PathResolver, r as resolveSdkDrizzleMigrationsDir } from './index.node-Bow8kHew.js';
9
12
  import yaml from 'js-yaml';
10
13
  import fs__default, { readFileSync } from 'fs';
11
- export { PathResolver } from './PathResolver-B4_X69Rd.js';
12
- import * as tsImport from 'ts-import';
13
- import { LoadMode } from 'ts-import';
14
- import path from 'path';
15
- import 'glob';
16
- import 'rimraf';
17
- import debug from 'debug';
14
+ import { addModelsToDb } from './db-Cvh84NY7.js';
15
+ export { withSeed } from '@seedprotocol/webpack';
18
16
  import { execSync } from 'child_process';
19
- import { fileURLToPath } from 'url';
20
- import { drizzle } from 'drizzle-orm/libsql';
21
- import { pushSQLiteSchema } from 'drizzle-kit/api';
22
- import { s as schema } from './index-BFyMxc7e.js';
23
- import { createClient } from '@libsql/client';
24
- import { camelCase, snakeCase } from 'lodash-es';
25
- import './EasClient-qfTiM2we.js';
26
- import './QueryClient-D_UK4YLm.js';
27
- import './ArweaveClient-Cs7AL9dp.js';
17
+ import path from 'path';
18
+ export { INIT_SCRIPT_SUCCESS_MESSAGE, SCHEMA_TS } from './constants-DMHTYMgJ.js';
19
+ import { configurePlatform } from './configurePlatform-R5neRbQ9.js';
28
20
  import 'xstate';
29
- import 'drizzle-orm/sqlite-core';
21
+ import 'debug';
30
22
  import 'nanoid';
31
23
  import 'nanoid-dictionary';
32
- import 'ethers';
33
- import '@sinclair/typebox';
34
- import 'drizzle-orm/casing';
24
+ import '@seedprotocol/eas';
35
25
  import 'rxjs';
36
- import 'arweave';
26
+ import 'lodash-es';
27
+ import 'drizzle-orm/casing';
28
+ import '@seedprotocol/arweave';
37
29
  import 'js-sha3';
30
+ import '@sinclair/typebox';
31
+ import 'drizzle-orm/sqlite-core';
38
32
  import 'fs/promises';
39
- import 'graphql-request';
40
- import './queries-Ct7CcQ3g.js';
33
+ import 'node:url';
34
+ import './index-QMrBK-L3.js';
35
+ import '@libsql/client';
36
+ import 'drizzle-orm/libsql';
37
+ import 'drizzle-orm/libsql/migrator';
38
+ import '@seedprotocol/arweave/node';
39
+ import '@seedprotocol/eas/node';
41
40
 
42
41
  /**
43
42
  * Parses markdown frontmatter from a file
@@ -173,156 +172,6 @@ const saveModelsFromMarkdown = async (filePath, db) => {
173
172
  return modelDefinitions;
174
173
  };
175
174
 
176
- // import path from "path";
177
- // import { fileURLToPath } from "url";
178
- // const __filename = fileURLToPath(import.meta.url);
179
- // const __dirname = path.dirname(__filename);
180
- const withSeed = (config, webpack, isServer) => {
181
- // If you need to include directories outside of the project root
182
- // config.module.rules.push({
183
- // test: /\.ts$/,
184
- // include: [path.resolve(process.cwd(), 'schema.ts')],
185
- // use: 'ts-loader',
186
- // })
187
- config.plugins.push(
188
- // new webpack.DefinePlugin({
189
- // __dirname: JSON.stringify(__dirname),
190
- // }),
191
- new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
192
- resource.request = resource.request.replace(/^node:/, '');
193
- }));
194
- // config.externals.push({
195
- // 'fsevents': 'commonjs2 fsevents',
196
- // })
197
- // console.log('__dirname:', __dirname)
198
- // console.log('process.cwd():', process.cwd())
199
- // console.log('crypto-browserify exists:', fs.existsSync(path.resolve(process.cwd(), './node_modules/crypto-browserify')))
200
- // console.log('path-browserify exists:', fs.existsSync(path.resolve(process.cwd(), './node_modules/path-browserify')))
201
- if (!isServer) {
202
- // config.plugins.push(
203
- // new webpack.NormalModuleReplacementPlugin(/node:/, (resource: any) => {
204
- // resource.request = resource.request.replace(/^node:/, '')
205
- // }),
206
- // )
207
- // config.plugins.push(
208
- // new webpack.NormalModuleReplacementPlugin(
209
- // /^(node:)?fs$/,
210
- // (resource: any) => {
211
- // resource.request = '@zenfs/core';
212
- // }
213
- // )
214
- // )
215
- // config.module.rules.push({
216
- // test: /\.js$/,
217
- // exclude: '/node_modules/@seedprotocol/sdk/node', // Exclude the 'node-files' directory
218
- // use: {
219
- // loader: 'babel-loader',
220
- // options: {
221
- // presets: ['next/babel'],
222
- // },
223
- // },
224
- // });
225
- // config.resolve.alias['fs/promises'] = '@zenfs/core/promises';
226
- config.resolve.alias['fs'] = '@zenfs/core';
227
- config.resolve.alias['node:fs'] = '@zenfs/core';
228
- config.resolve.alias['node:path'] = 'path-browserify';
229
- config.resolve.alias['path'] = 'path-browserify';
230
- // config.resolve.alias['fs'] = path.resolve(
231
- // process.cwd(),
232
- // './node_modules/@zenfs/core',
233
- // )
234
- // config.resolve.alias['node:fs'] = path.resolve(
235
- // process.cwd(),
236
- // './node_modules/@zenfs/core',
237
- // )
238
- // config.resolve.alias['@schema'] = path.resolve(process.cwd(), 'schema.ts')
239
- // // config.resolve.alias['crypto'] = path.resolve(process.cwd(), './node_modules/crypto-browserify')
240
- // // config.resolve.alias['node:crypto'] = path.resolve(process.cwd(), './node_modules/crypto-browserify')
241
- // config.resolve.alias['node:path'] = path.resolve(
242
- // process.cwd(),
243
- // './node_modules/path-browserify',
244
- // )
245
- // config.resolve.alias['path'] = path.resolve(
246
- // process.cwd(),
247
- // './node_modules/path-browserify',
248
- // )
249
- }
250
- if (isServer) {
251
- config.externals.push('@sqlite.org/sqlite-wasm');
252
- config.externals.push('nunjucks');
253
- config.externals.push('chokidar');
254
- config.externals.push('arweave');
255
- }
256
- // config.module.rules.push({
257
- // test: /seed\.config\.mjs$/,
258
- // use: [
259
- // {
260
- // loader: 'babel-loader',
261
- // options: {
262
- // plugins: ['@babel/plugin-syntax-dynamic-import'],
263
- // },
264
- // },
265
- // ],
266
- // })
267
- return config;
268
- };
269
-
270
- const logger$1 = debug('seedSdk:helpers');
271
- const getTsImport = async (filePath) => {
272
- // Check if the config file exists
273
- if (!fs__default.existsSync(filePath)) {
274
- logger$1(`Typescript file not found at ${filePath}`);
275
- throw new Error(`Typescript file not found at ${filePath}`);
276
- }
277
- let result;
278
- try {
279
- // Read the file content and transform relative imports to absolute paths
280
- // This fixes the issue where ts-import compiles to .mjs in cache and relative
281
- // imports resolve from the cache location instead of the original file location
282
- let fileContent = fs__default.readFileSync(filePath, 'utf-8');
283
- const fileDir = path.dirname(path.resolve(filePath));
284
- // Replace relative imports with absolute paths
285
- // Match: from '../../../../src/schema' or from '../../../something'
286
- const relativeImportRegex = /from\s+['"](\.\.\/.*?)['"]/g;
287
- fileContent = fileContent.replace(relativeImportRegex, (match, importPath) => {
288
- const absolutePath = path.resolve(fileDir, importPath);
289
- // Convert to file:// URL for ESM compatibility, or use absolute path
290
- return `from '${absolutePath}'`;
291
- });
292
- // Write to a temporary file and load that instead
293
- const tempFile = path.join(fileDir, `.temp.${path.basename(filePath)}`);
294
- fs__default.writeFileSync(tempFile, fileContent);
295
- try {
296
- result = await tsImport.load(tempFile, {
297
- mode: LoadMode.Compile,
298
- compileOptions: {
299
- compilerOptions: {
300
- experimentalDecorators: true,
301
- emitDecoratorMetadata: true,
302
- },
303
- },
304
- }).catch((e) => {
305
- logger$1('Error loading ts file:', e);
306
- throw e;
307
- });
308
- }
309
- finally {
310
- // Clean up temp file
311
- if (fs__default.existsSync(tempFile)) {
312
- fs__default.unlinkSync(tempFile);
313
- }
314
- }
315
- }
316
- catch (e) {
317
- console.error(e);
318
- }
319
- return result;
320
- };
321
-
322
- // Get the directory of this file to resolve relative paths
323
- // @ts-ignore - rollup plugin-typescript doesn't recognize import.meta with module: "preserve"
324
- const __filename$1 = fileURLToPath(import.meta.url);
325
- path.dirname(__filename$1);
326
175
  const commandExists = (command) => {
327
176
  try {
328
177
  execSync(`which ${command}`, { stdio: 'ignore' });
@@ -338,11 +187,9 @@ const commandExists = (command) => {
338
187
  */
339
188
  const findSeedBinary = () => {
340
189
  const cwd = process.cwd();
341
- // Try common locations for the seed binary
342
190
  const possiblePaths = [
343
191
  path.join(cwd, 'node_modules', '.bin', 'seed'),
344
192
  path.join(cwd, 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),
345
- // Try parent directories (for monorepos or nested projects)
346
193
  path.join(cwd, '..', 'node_modules', '.bin', 'seed'),
347
194
  path.join(cwd, '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),
348
195
  path.join(cwd, '..', '..', 'node_modules', '.bin', 'seed'),
@@ -356,193 +203,20 @@ const findSeedBinary = () => {
356
203
  return null;
357
204
  };
358
205
  /**
359
- * Runs seed init programmatically, trying multiple methods:
360
- * 1. Try to dynamically import and call the CLI package's init function (prefers local monorepo version)
361
- * 2. Try to find and execute the seed binary
362
- * 3. Fall back to using npx
363
- * @param schemaFileDir - Optional path to schema file directory
364
- * @param appFilesDirPath - Optional path to app files directory
206
+ * Ensures the Node app DB exists and SDK migrations are applied.
207
+ * (Formerly `runSeedInit`; CLI spawn / npx fallbacks archived under docs/archive/commented/.)
365
208
  */
366
- const runSeedInit = async (schemaFileDir, appFilesDirPath) => {
367
- const dbDirExists = fs__default.existsSync(`${appFilesDirPath}/db`);
368
- if (!dbDirExists) {
369
- fs__default.mkdirSync(`${appFilesDirPath}/db`, { recursive: true });
370
- }
371
- const dbUrl = `file:${appFilesDirPath}/db/seed.db`;
372
- const client = createClient({ url: dbUrl });
373
- const db = drizzle(client, { schema });
374
- const { apply, hasDataLoss, warnings, statementsToExecute } = await pushSQLiteSchema(schema, db);
375
- // You can inspect what will happen before applying
376
- await apply();
377
- // // First, try to dynamically import the CLI package's init function
378
- // // This prefers local monorepo version in development, falls back to published package
379
- // try {
380
- // const cliModule = await importCliPackage()
381
- // if (cliModule && typeof cliModule.init === 'function') {
382
- // await cliModule.init(schemaFileDir, appFilesDirPath)
383
- // return
384
- // }
385
- // } catch (importError: any) {
386
- // // CLI package not available, continue to other methods
387
- // console.log('[seedInit] CLI package not available, trying binary execution')
388
- // }
389
- // // Try to find and execute the binary
390
- // const seedBinary = findSeedBinary()
391
- // if (seedBinary) {
392
- // // Binary found, execute it directly
393
- // const args = ['init']
394
- // if (schemaFileDir) {
395
- // args.push(schemaFileDir)
396
- // }
397
- // if (appFilesDirPath) {
398
- // args.push(appFilesDirPath)
399
- // }
400
- // try {
401
- // execSync(`node "${seedBinary}" ${args.join(' ')}`, {
402
- // stdio: 'inherit',
403
- // cwd: process.cwd(),
404
- // })
405
- // return
406
- // } catch (error: any) {
407
- // console.warn(`[seedInit] Failed to execute binary at ${seedBinary}: ${error.message}`)
408
- // // Continue to npx fallback
409
- // }
410
- // }
411
- // // Final fallback: use npx
412
- // const args = ['seed', 'init']
413
- // if (schemaFileDir) {
414
- // args.push(schemaFileDir)
415
- // }
416
- // if (appFilesDirPath) {
417
- // args.push(appFilesDirPath)
418
- // }
419
- // try {
420
- // execSync(`npx ${args.join(' ')}`, {
421
- // stdio: 'inherit',
422
- // cwd: process.cwd(),
423
- // })
424
- // } catch (error: any) {
425
- // throw new Error(
426
- // `Failed to run seed init command. ` +
427
- // `Tried: CLI package import, binary execution, and npx. ` +
428
- // `Please ensure @seedprotocol/cli is installed: ${error.message}`
429
- // )
430
- // }
431
- };
432
-
433
- const logger = debug('seedSdk:codegen:drizzle');
434
- // Lazy load nunjucks to avoid bundling issues when only PathResolver is used
435
- let nunjucksEnv = null;
436
- const getNunjucksEnv = async () => {
437
- if (!nunjucksEnv) {
438
- const nunjucks = await import('nunjucks');
439
- const TemplateLoader = {
440
- getSource: (name) => {
441
- const pathResolver = BasePathResolver.getInstance();
442
- const { templatePath } = pathResolver.getAppPaths();
443
- let templateFilePath = templatePath;
444
- if (name.includes(templatePath)) {
445
- templateFilePath = name;
446
- }
447
- else {
448
- templateFilePath = path.join(templatePath, path.basename(name));
449
- }
450
- const src = fs__default.readFileSync(templateFilePath, 'utf-8');
451
- return {
452
- path: name,
453
- src,
454
- noCache: false,
455
- };
456
- },
457
- };
458
- // Configure Nunjucks
459
- nunjucksEnv = new nunjucks.Environment(TemplateLoader);
460
- nunjucksEnv.addFilter('camelCase', camelCase);
461
- nunjucksEnv.addFilter('snakeCase', snakeCase);
462
- nunjucksEnv.addFilter('pluralize', pluralize);
463
- }
464
- return nunjucksEnv;
465
- };
466
- const refNamesToExcludeFromRelations = [
467
- ModelPropertyDataTypes.Text,
468
- ModelPropertyDataTypes.Number,
469
- ModelPropertyDataTypes.Boolean,
470
- ModelPropertyDataTypes.Date,
471
- ];
472
- const generateDrizzleSchemaCode = async (modelName, model) => {
473
- const properties = model.properties || [];
474
- if (properties.length === 0) {
475
- throw new Error(`Model ${modelName} has no properties`);
476
- }
477
- const schema = modelPropertiesToObject(properties);
478
- // Only list-of-relations (ref present) go to relations; list-of-primitives are stored as JSON in metadata
479
- const listProperties = Object.entries(schema).filter(([key, propertyDef]) => propertyDef?.dataType === ModelPropertyDataTypes.List &&
480
- propertyDef?.ref &&
481
- !refNamesToExcludeFromRelations.includes(propertyDef.ref));
482
- const pathResolver = BasePathResolver.getInstance();
483
- const { templatePath } = pathResolver.getAppPaths();
484
- const filePath = path.join(templatePath, SCHEMA_NJK);
485
- const env = await getNunjucksEnv();
486
- const schemaCode = env.render(filePath, {
487
- modelName,
488
- modelClass: model, // Keep modelClass name for template compatibility
489
- listProperties,
490
- });
491
- return schemaCode;
492
- };
493
- const createDrizzleSchemaFilesFromConfig = async (configFilePath, outputDirPath) => {
494
- const pathResolver = BasePathResolver.getInstance();
495
- const { dotSeedDir, appSchemaDir } = pathResolver.getAppPaths();
496
- // Use provided config file path or find the config file in the project root
497
- const schemaFilePath = configFilePath || pathResolver.findConfigFile() || path.join(dotSeedDir, 'seed.config.ts');
498
- const { models, } = await getTsImport(schemaFilePath);
499
- const writeToDir = outputDirPath || appSchemaDir;
500
- for (const [modelName, modelClass] of Object.entries(models)) {
501
- const code = await generateDrizzleSchemaCode(modelName, modelClass);
502
- if (!fs__default.existsSync(writeToDir)) {
503
- fs__default.mkdirSync(writeToDir);
504
- }
505
- const filePath = path.join(writeToDir, `${modelName}Schema.ts`);
506
- await fs__default.promises.writeFile(filePath, code).catch((e) => console.error(e));
507
- }
508
- };
509
- // Helper to determine TypeScript type based on property type
510
- const seedTypeToJsType = (propertyType) => {
511
- switch (propertyType) {
512
- case ModelPropertyDataTypes.Text:
513
- return 'string';
514
- case ModelPropertyDataTypes.Number:
515
- return 'number';
516
- case ModelPropertyDataTypes.Boolean:
517
- return 'boolean';
518
- case ModelPropertyDataTypes.Date:
519
- return 'string';
520
- case ModelPropertyDataTypes.List:
521
- return 'string[]';
522
- case ModelPropertyDataTypes.Relation:
523
- return 'string';
524
- case ModelPropertyDataTypes.Image:
525
- return 'string';
526
- case ModelPropertyDataTypes.File:
527
- return 'string';
528
- default:
529
- return 'any';
530
- }
531
- };
532
- const generateModelCode = async (values) => {
533
- const { modelName, properties } = values;
534
- const pathResolver = BasePathResolver.getInstance();
535
- const { templatePath } = pathResolver.getAppPaths();
536
- if (modelName === ModelPropertyDataTypes.Text || modelName === 'TestModel') {
537
- logger(`Model name is ${modelName}.`);
209
+ const ensureNodeDbSchema = async (_schemaFileDir, appFilesDirPath) => {
210
+ if (!appFilesDirPath) {
211
+ throw new Error('ensureNodeDbSchema requires appFilesDirPath');
538
212
  }
539
- const nunjucks = await import('nunjucks');
540
- const njkEnv = new nunjucks.Environment(new nunjucks.FileSystemLoader(templatePath));
541
- njkEnv.addFilter('seedTypeToJsType', seedTypeToJsType);
542
- return njkEnv.render('model.njk', { modelName, properties });
213
+ await BaseDb.prepareDb(appFilesDirPath);
543
214
  };
215
+ /** @deprecated Use ensureNodeDbSchema */
216
+ const runSeedInit = ensureNodeDbSchema;
544
217
 
218
+ configurePlatform(createPlatformServices());
545
219
  enableMapSet();
546
220
 
547
- export { BasePathResolver, Property, commandExists, createDrizzleSchemaFilesFromConfig, findSeedBinary, generateModelCode, getTsImport, parseMarkdownFrontmatter, processSeedConfig, runSeedInit, saveModelsFromMarkdown, withSeed };
221
+ export { Property, commandExists, ensureNodeDbSchema, findSeedBinary, parseMarkdownFrontmatter, processSeedConfig, runSeedInit, saveModelsFromMarkdown };
548
222
  //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sources":["../../src/imports/markdown.ts","../../src/node/webpack/index.ts","../../src/node/helpers/index.ts","../../src/node/helpers/scripts.ts","../../src/node/codegen/drizzle.ts","../../src/node/index.ts"],"sourcesContent":["import yaml from 'js-yaml'\nimport { readFileSync } from 'fs'\nimport { Property, ModelPropertyDataTypes } from '@/Schema'\nimport { ModelDefinitions } from '@/types'\nimport { addModelsToDb } from '../helpers/db'\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'\nimport { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy'\nimport type { Model } from '@/Model/Model'\n\n/**\n * Configuration structure expected in markdown frontmatter\n */\ntype SeedConfig = {\n seed: {\n model: string\n properties: {\n [propertyName: string]: {\n type: string\n target?: string\n /** For List: element type when primitive (e.g. 'Text', 'Number'). Use target for list of relations. */\n itemsType?: string\n }\n }\n }\n}\n\n/**\n * Parses markdown frontmatter from a file\n * @param filePath Path to the markdown file\n * @returns The parsed frontmatter as an object, or null if no frontmatter found\n */\nexport const parseMarkdownFrontmatter = (\n filePath: string,\n): Record<string, any> | null => {\n const content = readFileSync(filePath, 'utf-8')\n \n // Check for frontmatter delimiters (more flexible regex)\n // Matches --- at start, optional whitespace, content, ---, optional whitespace\n const frontmatterRegex = /^---\\s*\\n([\\s\\S]*?)\\n---(\\s*\\n|$)/\n const match = content.match(frontmatterRegex)\n \n if (!match) {\n return null\n }\n \n const frontmatterYaml = match[1]\n \n try {\n const frontmatter = yaml.load(frontmatterYaml) as Record<string, any>\n return frontmatter\n } catch (error) {\n throw new Error(\n `Failed to parse YAML frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Converts a seed config from frontmatter to ModelDefinitions format\n * @param config The seed configuration from frontmatter\n * @returns ModelDefinitions object ready to be saved to database\n */\nexport const processSeedConfig = (config: SeedConfig): ModelDefinitions => {\n if (!config.seed) {\n throw new Error('No seed configuration found in frontmatter')\n }\n \n const { model: modelName, properties: propertiesConfig } = config.seed\n \n if (!modelName) {\n throw new Error('Model name is required in seed configuration')\n }\n \n if (!propertiesConfig || Object.keys(propertiesConfig).length === 0) {\n throw new Error('Properties are required in seed configuration')\n }\n \n // Convert property configs to Property definitions\n const schema: Record<string, any> = {}\n \n for (const [propertyName, propertyConfig] of Object.entries(propertiesConfig)) {\n const { type, target, itemsType } = propertyConfig\n \n if (!type) {\n throw new Error(`Property type is required for ${propertyName}`)\n }\n \n // Map the type to Property constructor\n switch (type) {\n case ModelPropertyDataTypes.Text:\n schema[propertyName] = Property.Text()\n break\n case ModelPropertyDataTypes.Number:\n schema[propertyName] = Property.Number()\n break\n case ModelPropertyDataTypes.Boolean:\n schema[propertyName] = Property.Boolean()\n break\n case ModelPropertyDataTypes.Date:\n schema[propertyName] = Property.Date()\n break\n case ModelPropertyDataTypes.Image:\n schema[propertyName] = Property.Image()\n break\n case ModelPropertyDataTypes.Json:\n schema[propertyName] = Property.Json()\n break\n case ModelPropertyDataTypes.File:\n schema[propertyName] = Property.File()\n break\n case ModelPropertyDataTypes.Relation:\n if (!target) {\n throw new Error(\n `Target model is required for Relation property ${propertyName}`,\n )\n }\n schema[propertyName] = Property.Relation(target)\n break\n case ModelPropertyDataTypes.List:\n if (itemsType) {\n // List of primitives: itemsType = 'Text', 'Number', etc.\n if (itemsType === ModelPropertyDataTypes.Relation && target) {\n schema[propertyName] = Property.List('Relation', target)\n } else if (itemsType !== ModelPropertyDataTypes.Relation) {\n schema[propertyName] = Property.List(itemsType as any)\n } else {\n throw new Error(\n `List of relations requires target model for property ${propertyName}`,\n )\n }\n } else if (target) {\n // Backward compat: target = model name for list of relations\n schema[propertyName] = Property.List('Relation', target)\n } else {\n throw new Error(\n `List property ${propertyName} requires either itemsType (e.g. 'Text') or target (model name for list of relations)`,\n )\n }\n break\n default:\n throw new Error(\n `Unknown property type: ${type} for property ${propertyName}`,\n )\n }\n }\n \n // Create a mock ModelClass structure that matches ModelDefinitions\n // This is a simplified version that works with addModelsToInternalDb\n const modelClass = {\n schema,\n create: async () => {\n throw new Error('Model.create() should not be called directly')\n },\n originalConstructor: class {},\n }\n \n return {\n [modelName]: modelClass as any as Model,\n }\n}\n\n/**\n * Reads a markdown file, parses frontmatter, and saves models/properties to database\n * @param filePath Path to the markdown file\n * @param db Database instance (BetterSQLite3Database or SqliteRemoteDatabase)\n * @returns The created ModelDefinitions\n */\nexport const saveModelsFromMarkdown = async (\n filePath: string,\n db: BetterSQLite3Database<any> | SqliteRemoteDatabase<any>,\n): Promise<ModelDefinitions> => {\n // Parse frontmatter\n const frontmatter = parseMarkdownFrontmatter(filePath)\n \n if (!frontmatter) {\n throw new Error(`No frontmatter found in ${filePath}`)\n }\n \n // Validate and process seed config\n const seedConfig = frontmatter as SeedConfig\n const modelDefinitions = processSeedConfig(seedConfig)\n \n // Save to database\n await addModelsToDb(modelDefinitions, undefined, undefined, undefined)\n \n return modelDefinitions\n}\n","// import path from \"path\";\n// import { fileURLToPath } from \"url\";\n\n// const __filename = fileURLToPath(import.meta.url);\n// const __dirname = path.dirname(__filename);\n\nexport const withSeed = (config: any, webpack: any, isServer: boolean) => {\n // If you need to include directories outside of the project root\n // config.module.rules.push({\n // test: /\\.ts$/,\n // include: [path.resolve(process.cwd(), 'schema.ts')],\n // use: 'ts-loader',\n // })\n\n config.plugins.push(\n // new webpack.DefinePlugin({\n // __dirname: JSON.stringify(__dirname),\n // }),\n new webpack.NormalModuleReplacementPlugin(/node:/, (resource: { request: string }) => {\n resource.request = resource.request.replace(/^node:/, '')\n }),\n )\n\n // config.externals.push({\n // 'fsevents': 'commonjs2 fsevents',\n // })\n\n // console.log('__dirname:', __dirname)\n // console.log('process.cwd():', process.cwd())\n\n // console.log('crypto-browserify exists:', fs.existsSync(path.resolve(process.cwd(), './node_modules/crypto-browserify')))\n // console.log('path-browserify exists:', fs.existsSync(path.resolve(process.cwd(), './node_modules/path-browserify')))\n\n if (!isServer) {\n // config.plugins.push(\n // new webpack.NormalModuleReplacementPlugin(/node:/, (resource: any) => {\n // resource.request = resource.request.replace(/^node:/, '')\n // }),\n // )\n // config.plugins.push(\n // new webpack.NormalModuleReplacementPlugin(\n // /^(node:)?fs$/,\n // (resource: any) => {\n // resource.request = '@zenfs/core';\n // }\n // )\n // )\n\n // config.module.rules.push({\n // test: /\\.js$/,\n // exclude: '/node_modules/@seedprotocol/sdk/node', // Exclude the 'node-files' directory\n // use: {\n // loader: 'babel-loader',\n // options: {\n // presets: ['next/babel'],\n // },\n // },\n // });\n\n\n // config.resolve.alias['fs/promises'] = '@zenfs/core/promises';\n\n config.resolve.alias['fs'] = '@zenfs/core'\n config.resolve.alias['node:fs'] = '@zenfs/core'\n config.resolve.alias['node:path'] = 'path-browserify'\n config.resolve.alias['path'] = 'path-browserify'\n\n // config.resolve.alias['fs'] = path.resolve(\n // process.cwd(),\n // './node_modules/@zenfs/core',\n // )\n // config.resolve.alias['node:fs'] = path.resolve(\n // process.cwd(),\n // './node_modules/@zenfs/core',\n // )\n // config.resolve.alias['@schema'] = path.resolve(process.cwd(), 'schema.ts')\n // // config.resolve.alias['crypto'] = path.resolve(process.cwd(), './node_modules/crypto-browserify')\n // // config.resolve.alias['node:crypto'] = path.resolve(process.cwd(), './node_modules/crypto-browserify')\n // config.resolve.alias['node:path'] = path.resolve(\n // process.cwd(),\n // './node_modules/path-browserify',\n // )\n // config.resolve.alias['path'] = path.resolve(\n // process.cwd(),\n // './node_modules/path-browserify',\n // )\n }\n\n if (isServer) {\n config.externals.push('@sqlite.org/sqlite-wasm')\n config.externals.push('nunjucks')\n config.externals.push('chokidar')\n config.externals.push('arweave')\n }\n\n // config.module.rules.push({\n // test: /seed\\.config\\.mjs$/,\n // use: [\n // {\n // loader: 'babel-loader',\n // options: {\n // plugins: ['@babel/plugin-syntax-dynamic-import'],\n // },\n // },\n // ],\n // })\n\n return config\n}\n","import fs from 'fs'\nimport * as tsImport from 'ts-import'\nimport { LoadMode } from 'ts-import'\nimport path from 'path'\nimport { glob } from 'glob'\nimport { rimraf } from 'rimraf'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:helpers')\n\nexport const getTsImport = async <T>(filePath: string): Promise<T> => {\n // Check if the config file exists\n if (!fs.existsSync(filePath)) {\n logger(`Typescript file not found at ${filePath}`)\n throw new Error(`Typescript file not found at ${filePath}`)\n }\n\n let result\n\n try {\n // Read the file content and transform relative imports to absolute paths\n // This fixes the issue where ts-import compiles to .mjs in cache and relative\n // imports resolve from the cache location instead of the original file location\n let fileContent = fs.readFileSync(filePath, 'utf-8')\n const fileDir = path.dirname(path.resolve(filePath))\n \n // Replace relative imports with absolute paths\n // Match: from '../../../../src/schema' or from '../../../something'\n const relativeImportRegex = /from\\s+['\"](\\.\\.\\/.*?)['\"]/g\n fileContent = fileContent.replace(relativeImportRegex, (match, importPath) => {\n const absolutePath = path.resolve(fileDir, importPath)\n // Convert to file:// URL for ESM compatibility, or use absolute path\n return `from '${absolutePath}'`\n })\n\n // Write to a temporary file and load that instead\n const tempFile = path.join(fileDir, `.temp.${path.basename(filePath)}`)\n fs.writeFileSync(tempFile, fileContent)\n \n try {\n result = await tsImport.load(tempFile, {\n mode: LoadMode.Compile,\n compileOptions: {\n compilerOptions: {\n experimentalDecorators: true,\n emitDecoratorMetadata: true,\n },\n },\n }).catch((e) => {\n logger('Error loading ts file:', e)\n throw e\n })\n } finally {\n // Clean up temp file\n if (fs.existsSync(tempFile)) {\n fs.unlinkSync(tempFile)\n }\n }\n\n } catch ( e ) {\n console.error(e)\n }\n\n\n return result\n}\n\nexport const deleteFilesWithExtension = async (\n dir: string,\n extension: string,\n) => {\n const pattern = path.join(dir, `**/*${extension}`)\n try {\n const files = await glob(pattern)\n for (const file of files) {\n try {\n await rimraf(file)\n logger(`Deleted: ${file}`)\n } catch (err) {\n logger('Error deleting file:', err)\n }\n }\n } catch (err) {\n logger('Error finding files:', err)\n }\n}\n","import { execSync } from 'child_process'\nimport path from 'path'\nimport fs from 'fs'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport { drizzle } from 'drizzle-orm/libsql'\nimport { generateSQLiteDrizzleJson, generateSQLiteMigration, generateMigration, pushSQLiteSchema } from 'drizzle-kit/api'\nimport * as schema from '@/seedSchema'\nimport { createClient } from '@libsql/client'\n\n// Get the directory of this file to resolve relative paths\n// @ts-ignore - rollup plugin-typescript doesn't recognize import.meta with module: \"preserve\"\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nexport const commandExists = (command: string): boolean => {\n try {\n execSync(`which ${command}`, { stdio: 'ignore' })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Finds the seed binary path, trying multiple locations\n * @returns The path to the seed binary, or null if not found\n */\nexport const findSeedBinary = (): string | null => {\n const cwd = process.cwd()\n \n // Try common locations for the seed binary\n const possiblePaths = [\n path.join(cwd, 'node_modules', '.bin', 'seed'),\n path.join(cwd, 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n // Try parent directories (for monorepos or nested projects)\n path.join(cwd, '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n ]\n \n for (const binPath of possiblePaths) {\n if (fs.existsSync(binPath)) {\n return binPath\n }\n }\n \n return null\n}\n\n/**\n * Checks if we're running in the monorepo by looking for the CLI package directory\n * @returns The path to the monorepo root, or null if not in monorepo\n */\nfunction getMonorepoRoot(): string | null {\n // Start from this file's location and walk up to find packages/cli\n let currentDir = __dirname\n \n // Walk up the directory tree looking for packages/cli\n for (let i = 0; i < 10; i++) { // Limit to 10 levels to avoid infinite loops\n const packagesDir = path.join(currentDir, 'packages')\n const cliDir = path.join(packagesDir, 'cli')\n \n if (fs.existsSync(cliDir) && fs.existsSync(path.join(cliDir, 'package.json'))) {\n // Found packages/cli, return the monorepo root (parent of packages)\n return path.dirname(packagesDir)\n }\n \n const parentDir = path.dirname(currentDir)\n if (parentDir === currentDir) {\n // Reached filesystem root\n break\n }\n currentDir = parentDir\n }\n \n return null\n}\n\n/**\n * Attempts to import the CLI package, preferring local monorepo version over published package\n * @returns The CLI module or null if not found\n */\nasync function importCliPackage(): Promise<any> {\n // First, try to import from local monorepo CLI (for development)\n const monorepoRoot = getMonorepoRoot()\n \n if (monorepoRoot) {\n const localCliDistPath = path.join(monorepoRoot, 'packages', 'cli', 'dist', 'index.js')\n const localCliSrcPath = path.join(monorepoRoot, 'packages', 'cli', 'src', 'index.ts')\n \n // Try built dist first (most reliable)\n if (fs.existsSync(localCliDistPath)) {\n try {\n const localCliDistUrl = pathToFileURL(localCliDistPath).href\n const cliModule = await import(localCliDistUrl)\n if (cliModule && typeof cliModule.init === 'function') {\n return cliModule\n }\n } catch (error: any) {\n // Dist import failed, try source\n }\n }\n \n // Try source (for development with tsx/ts-node)\n if (fs.existsSync(localCliSrcPath)) {\n try {\n const localCliSrcUrl = pathToFileURL(localCliSrcPath).href\n const cliModule = await import(localCliSrcUrl)\n if (cliModule && typeof cliModule.init === 'function') {\n return cliModule\n }\n } catch (error: any) {\n // Source import failed (TypeScript not compiled or not using tsx)\n }\n }\n }\n \n // Fall back to published package (for production/consumers)\n // Note: @seedprotocol/cli is not a dependency of the SDK to avoid circular dependencies\n // This is a dynamic import that may not be available in all environments\n try {\n // @ts-ignore - Dynamic import of optional CLI package\n // Using template literal to prevent Vite from statically analyzing this import\n const cliPackageName = '@seedprotocol/cli'\n const cliModule = await import(cliPackageName)\n if (cliModule && typeof cliModule.init === 'function') {\n return cliModule\n }\n } catch (importError: any) {\n // Published package not available\n return null\n }\n \n return null\n}\n\n/**\n * Runs seed init programmatically, trying multiple methods:\n * 1. Try to dynamically import and call the CLI package's init function (prefers local monorepo version)\n * 2. Try to find and execute the seed binary\n * 3. Fall back to using npx\n * @param schemaFileDir - Optional path to schema file directory\n * @param appFilesDirPath - Optional path to app files directory\n */\nexport const runSeedInit = async (\n schemaFileDir?: string,\n appFilesDirPath?: string\n): Promise<void> => {\n\n const dbDirExists = fs.existsSync(`${appFilesDirPath}/db`)\n if (!dbDirExists) {\n fs.mkdirSync(`${appFilesDirPath}/db`, { recursive: true })\n }\n\n const dbUrl = `file:${appFilesDirPath}/db/seed.db`\n const client = createClient({ url: dbUrl })\n\n const db = drizzle(client, {schema})\n\n const { apply, hasDataLoss, warnings, statementsToExecute } = await pushSQLiteSchema(schema, db);\n \n // You can inspect what will happen before applying\n \n await apply();\n\n\n // // First, try to dynamically import the CLI package's init function\n // // This prefers local monorepo version in development, falls back to published package\n // try {\n // const cliModule = await importCliPackage()\n // if (cliModule && typeof cliModule.init === 'function') {\n // await cliModule.init(schemaFileDir, appFilesDirPath)\n // return\n // }\n // } catch (importError: any) {\n // // CLI package not available, continue to other methods\n // console.log('[seedInit] CLI package not available, trying binary execution')\n // }\n \n // // Try to find and execute the binary\n // const seedBinary = findSeedBinary()\n \n // if (seedBinary) {\n // // Binary found, execute it directly\n // const args = ['init']\n // if (schemaFileDir) {\n // args.push(schemaFileDir)\n // }\n // if (appFilesDirPath) {\n // args.push(appFilesDirPath)\n // }\n \n // try {\n // execSync(`node \"${seedBinary}\" ${args.join(' ')}`, {\n // stdio: 'inherit',\n // cwd: process.cwd(),\n // })\n // return\n // } catch (error: any) {\n // console.warn(`[seedInit] Failed to execute binary at ${seedBinary}: ${error.message}`)\n // // Continue to npx fallback\n // }\n // }\n \n // // Final fallback: use npx\n // const args = ['seed', 'init']\n // if (schemaFileDir) {\n // args.push(schemaFileDir)\n // }\n // if (appFilesDirPath) {\n // args.push(appFilesDirPath)\n // }\n \n // try {\n // execSync(`npx ${args.join(' ')}`, {\n // stdio: 'inherit',\n // cwd: process.cwd(),\n // })\n // } catch (error: any) {\n // throw new Error(\n // `Failed to run seed init command. ` +\n // `Tried: CLI package import, binary execution, and npx. ` +\n // `Please ensure @seedprotocol/cli is installed: ${error.message}`\n // )\n // }\n}\n\n","import path from 'path'\nimport pluralize from 'pluralize'\nimport { camelCase, snakeCase } from 'lodash-es'\nimport { Model } from '@/Model/Model'\nimport { ModelPropertyDataTypes } from '@/Schema'\nimport { modelPropertiesToObject } from '@/helpers/model'\n\n// Define ILoader type locally to avoid importing from nunjucks (prevents bundling issues)\ntype ILoader = {\n getSource(name: string): { path: string; src: string; noCache: boolean }\n}\nimport { SCHEMA_NJK } from '@/helpers/constants'\nimport { getTsImport } from '@/node/helpers'\nimport fs from 'fs'\nimport { BasePathResolver } from '@/helpers/PathResolver/BasePathResolver'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:codegen:drizzle')\n\n// Lazy load nunjucks to avoid bundling issues when only PathResolver is used\nlet nunjucksEnv: any = null\n\nconst getNunjucksEnv = async () => {\n if (!nunjucksEnv) {\n const nunjucks = await import('nunjucks')\n \n const TemplateLoader: ILoader = {\n getSource: (name: string) => {\n const pathResolver = BasePathResolver.getInstance()\n const { templatePath } = pathResolver.getAppPaths()\n let templateFilePath = templatePath\n if (name.includes(templatePath)) {\n templateFilePath = name\n } else {\n templateFilePath = path.join(templatePath, path.basename(name))\n }\n const src = fs.readFileSync(templateFilePath, 'utf-8')\n\n return {\n path: name,\n src,\n noCache: false,\n }\n },\n }\n\n // Configure Nunjucks\n nunjucksEnv = new nunjucks.Environment(TemplateLoader)\n\n nunjucksEnv.addFilter('camelCase', camelCase)\n nunjucksEnv.addFilter('snakeCase', snakeCase)\n nunjucksEnv.addFilter('pluralize', pluralize)\n }\n return nunjucksEnv\n}\n\nconst refNamesToExcludeFromRelations = [\n ModelPropertyDataTypes.Text,\n ModelPropertyDataTypes.Number,\n ModelPropertyDataTypes.Boolean,\n ModelPropertyDataTypes.Date,\n]\n\nexport const generateDrizzleSchemaCode = async (\n modelName: string,\n model: Model,\n): Promise<string> => {\n const properties = model.properties || []\n if (properties.length === 0) {\n throw new Error(`Model ${modelName} has no properties`)\n }\n const schema = modelPropertiesToObject(properties)\n // Only list-of-relations (ref present) go to relations; list-of-primitives are stored as JSON in metadata\n const listProperties = Object.entries(schema).filter(\n ([key, propertyDef]) =>\n propertyDef?.dataType === ModelPropertyDataTypes.List &&\n propertyDef?.ref &&\n !refNamesToExcludeFromRelations.includes(propertyDef.ref),\n )\n\n const pathResolver = BasePathResolver.getInstance()\n const { templatePath } = pathResolver.getAppPaths()\n const filePath = path.join(templatePath, SCHEMA_NJK)\n\n const env = await getNunjucksEnv()\n const schemaCode = env.render(filePath, {\n modelName,\n modelClass: model, // Keep modelClass name for template compatibility\n listProperties,\n })\n\n return schemaCode\n}\n\nexport const createDrizzleSchemaFilesFromConfig = async (\n configFilePath: string | undefined,\n outputDirPath: string | undefined,\n) => {\n const pathResolver = BasePathResolver.getInstance()\n const { dotSeedDir, appSchemaDir } = pathResolver.getAppPaths()\n\n // Use provided config file path or find the config file in the project root\n const schemaFilePath = configFilePath || pathResolver.findConfigFile() || path.join(dotSeedDir, 'seed.config.ts')\n\n const { models, } = await getTsImport<{\n models: Record<string, Model>\n }>(schemaFilePath)\n\n const writeToDir = outputDirPath || appSchemaDir\n\n for (const [modelName, modelClass] of Object.entries(models)) {\n const code = await generateDrizzleSchemaCode(modelName, modelClass)\n\n if (!fs.existsSync(writeToDir)) {\n fs.mkdirSync(writeToDir)\n }\n\n const filePath = path.join(writeToDir, `${modelName}Schema.ts`)\n\n await fs.promises.writeFile(filePath, code).catch((e) => console.error(e))\n }\n}\n\n // Helper to determine TypeScript type based on property type\n const seedTypeToJsType = (propertyType: string): string => {\n switch (propertyType) {\n case ModelPropertyDataTypes.Text:\n return 'string';\n case ModelPropertyDataTypes.Number:\n return 'number';\n case ModelPropertyDataTypes.Boolean:\n return 'boolean';\n case ModelPropertyDataTypes.Date:\n return 'string';\n case ModelPropertyDataTypes.List:\n return 'string[]';\n case ModelPropertyDataTypes.Relation:\n return 'string';\n case ModelPropertyDataTypes.Image:\n return 'string';\n case ModelPropertyDataTypes.File:\n return 'string';\n default:\n return 'any';\n }\n};\n\n\nexport const generateModelCode = async (values: Record<string, any>): Promise<string> => {\n const { modelName, properties } = values;\n const pathResolver = BasePathResolver.getInstance()\n const { templatePath } = pathResolver.getAppPaths()\n\n if (modelName === ModelPropertyDataTypes.Text || modelName === 'TestModel') {\n logger(`Model name is ${modelName}.`)\n }\n\n const nunjucks = await import('nunjucks')\n const njkEnv = new nunjucks.Environment(new nunjucks.FileSystemLoader(templatePath))\n njkEnv.addFilter('seedTypeToJsType', seedTypeToJsType)\n return njkEnv.render('model.njk', { modelName, properties })\n};\n","import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport {\n Model,\n Property,\n Image,\n List,\n Text,\n Json,\n Relation,\n Boolean,\n Number,\n Date,\n} from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty } from '../ItemProperty/ItemProperty'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Webpack helper\nexport { withSeed } from './webpack'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\n\n// CLI exports\nexport { PathResolver } from './helpers/PathResolver'\nexport { BasePathResolver } from '../helpers/PathResolver/BasePathResolver'\nexport { getTsImport } from './helpers'\nexport { commandExists, runSeedInit, findSeedBinary } from './helpers/scripts'\nexport { INIT_SCRIPT_SUCCESS_MESSAGE, SCHEMA_TS } from '../helpers/constants'\n// Codegen functions exported for CLI usage (Node.js only, so bundling concerns don't apply)\nexport { createDrizzleSchemaFilesFromConfig, generateModelCode } from './codegen/drizzle'\n\n// Side effect imports for CLI\nimport './helpers/EasClient'\nimport './helpers/QueryClient'\nimport './helpers/FileManager'\nimport './helpers/ArweaveClient'\nimport './helpers/PathResolver'\n\nenableMapSet() "],"names":["logger","fs","__filename"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;AAIG;AACI,MAAM,wBAAwB,GAAG,CACtC,QAAgB,KACc;IAC9B,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;;;IAI/C,MAAM,gBAAgB,GAAG,mCAAmC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAE7C,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;AAEhC,IAAA,IAAI;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAwB;AACrE,QAAA,OAAO,WAAW;IACpB;IAAE,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,CAAA,oCAAA,EAAuC,QAAQ,KAAK,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,CAAE,CAC7G;IACH;AACF;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,UAAU,CAAC;AACzC,IAAA,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACpF,IAAA,MAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;AACtD,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC9D;;AC5FA,YAAY,EAAE;;;;"}
1
+ {"version":3,"file":"node.js","sources":["../../src/imports/markdown.ts","../../src/node/helpers/scripts.ts","../../src/node/index.ts"],"sourcesContent":["import yaml from 'js-yaml'\nimport { readFileSync } from 'fs'\nimport { Property, ModelPropertyDataTypes } from '@/Schema'\nimport { ModelDefinitions } from '@/types'\nimport { addModelsToDb } from '../helpers/db'\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'\nimport { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy'\nimport type { Model } from '@/Model/Model'\n\n/**\n * Configuration structure expected in markdown frontmatter\n */\ntype SeedConfig = {\n seed: {\n model: string\n properties: {\n [propertyName: string]: {\n type: string\n target?: string\n /** For List: element type when primitive (e.g. 'Text', 'Number'). Use target for list of relations. */\n itemsType?: string\n }\n }\n }\n}\n\n/**\n * Parses markdown frontmatter from a file\n * @param filePath Path to the markdown file\n * @returns The parsed frontmatter as an object, or null if no frontmatter found\n */\nexport const parseMarkdownFrontmatter = (\n filePath: string,\n): Record<string, any> | null => {\n const content = readFileSync(filePath, 'utf-8')\n \n // Check for frontmatter delimiters (more flexible regex)\n // Matches --- at start, optional whitespace, content, ---, optional whitespace\n const frontmatterRegex = /^---\\s*\\n([\\s\\S]*?)\\n---(\\s*\\n|$)/\n const match = content.match(frontmatterRegex)\n \n if (!match) {\n return null\n }\n \n const frontmatterYaml = match[1]\n \n try {\n const frontmatter = yaml.load(frontmatterYaml) as Record<string, any>\n return frontmatter\n } catch (error) {\n throw new Error(\n `Failed to parse YAML frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Converts a seed config from frontmatter to ModelDefinitions format\n * @param config The seed configuration from frontmatter\n * @returns ModelDefinitions object ready to be saved to database\n */\nexport const processSeedConfig = (config: SeedConfig): ModelDefinitions => {\n if (!config.seed) {\n throw new Error('No seed configuration found in frontmatter')\n }\n \n const { model: modelName, properties: propertiesConfig } = config.seed\n \n if (!modelName) {\n throw new Error('Model name is required in seed configuration')\n }\n \n if (!propertiesConfig || Object.keys(propertiesConfig).length === 0) {\n throw new Error('Properties are required in seed configuration')\n }\n \n // Convert property configs to Property definitions\n const schema: Record<string, any> = {}\n \n for (const [propertyName, propertyConfig] of Object.entries(propertiesConfig)) {\n const { type, target, itemsType } = propertyConfig\n \n if (!type) {\n throw new Error(`Property type is required for ${propertyName}`)\n }\n \n // Map the type to Property constructor\n switch (type) {\n case ModelPropertyDataTypes.Text:\n schema[propertyName] = Property.Text()\n break\n case ModelPropertyDataTypes.Number:\n schema[propertyName] = Property.Number()\n break\n case ModelPropertyDataTypes.Boolean:\n schema[propertyName] = Property.Boolean()\n break\n case ModelPropertyDataTypes.Date:\n schema[propertyName] = Property.Date()\n break\n case ModelPropertyDataTypes.Image:\n schema[propertyName] = Property.Image()\n break\n case ModelPropertyDataTypes.Json:\n schema[propertyName] = Property.Json()\n break\n case ModelPropertyDataTypes.File:\n schema[propertyName] = Property.File()\n break\n case ModelPropertyDataTypes.Relation:\n if (!target) {\n throw new Error(\n `Target model is required for Relation property ${propertyName}`,\n )\n }\n schema[propertyName] = Property.Relation(target)\n break\n case ModelPropertyDataTypes.List:\n if (itemsType) {\n // List of primitives: itemsType = 'Text', 'Number', etc.\n if (itemsType === ModelPropertyDataTypes.Relation && target) {\n schema[propertyName] = Property.List('Relation', target)\n } else if (itemsType !== ModelPropertyDataTypes.Relation) {\n schema[propertyName] = Property.List(itemsType as any)\n } else {\n throw new Error(\n `List of relations requires target model for property ${propertyName}`,\n )\n }\n } else if (target) {\n // Backward compat: target = model name for list of relations\n schema[propertyName] = Property.List('Relation', target)\n } else {\n throw new Error(\n `List property ${propertyName} requires either itemsType (e.g. 'Text') or target (model name for list of relations)`,\n )\n }\n break\n default:\n throw new Error(\n `Unknown property type: ${type} for property ${propertyName}`,\n )\n }\n }\n \n // Create a mock ModelClass structure that matches ModelDefinitions\n // This is a simplified version that works with addModelsToInternalDb\n const modelClass = {\n schema,\n create: async () => {\n throw new Error('Model.create() should not be called directly')\n },\n originalConstructor: class {},\n }\n \n return {\n [modelName]: modelClass as any as Model,\n }\n}\n\n/**\n * Reads a markdown file, parses frontmatter, and saves models/properties to database\n * @param filePath Path to the markdown file\n * @param db Database instance (BetterSQLite3Database or SqliteRemoteDatabase)\n * @returns The created ModelDefinitions\n */\nexport const saveModelsFromMarkdown = async (\n filePath: string,\n db: BetterSQLite3Database<any> | SqliteRemoteDatabase<any>,\n): Promise<ModelDefinitions> => {\n // Parse frontmatter\n const frontmatter = parseMarkdownFrontmatter(filePath)\n \n if (!frontmatter) {\n throw new Error(`No frontmatter found in ${filePath}`)\n }\n \n // Validate and process seed config\n const seedConfig = frontmatter as SeedConfig\n const modelDefinitions = processSeedConfig(seedConfig)\n \n // Save to database\n await addModelsToDb(modelDefinitions, undefined, undefined, undefined)\n \n return modelDefinitions\n}\n","import { execSync } from 'child_process'\nimport path from 'path'\nimport fs from 'fs'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nexport const commandExists = (command: string): boolean => {\n try {\n execSync(`which ${command}`, { stdio: 'ignore' })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Finds the seed binary path, trying multiple locations\n * @returns The path to the seed binary, or null if not found\n */\nexport const findSeedBinary = (): string | null => {\n const cwd = process.cwd()\n\n const possiblePaths = [\n path.join(cwd, 'node_modules', '.bin', 'seed'),\n path.join(cwd, 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n ]\n\n for (const binPath of possiblePaths) {\n if (fs.existsSync(binPath)) {\n return binPath\n }\n }\n\n return null\n}\n\n/**\n * Ensures the Node app DB exists and SDK migrations are applied.\n * (Formerly `runSeedInit`; CLI spawn / npx fallbacks archived under docs/archive/commented/.)\n */\nexport const ensureNodeDbSchema = async (\n _schemaFileDir?: string,\n appFilesDirPath?: string\n): Promise<void> => {\n if (!appFilesDirPath) {\n throw new Error('ensureNodeDbSchema requires appFilesDirPath')\n }\n\n await BaseDb.prepareDb(appFilesDirPath)\n}\n\n/** @deprecated Use ensureNodeDbSchema */\nexport const runSeedInit = ensureNodeDbSchema\n","import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport {\n Model,\n Property,\n Image,\n List,\n Text,\n Json,\n Relation,\n Boolean,\n Number,\n Date,\n} from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty } from '../ItemProperty/ItemProperty'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Webpack helper\nexport { withSeed } from './webpack'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\n\n// CLI exports\nexport { PathResolver } from './helpers/PathResolver'\nexport { BasePathResolver } from '../helpers/PathResolver/BasePathResolver'\nexport {\n commandExists,\n ensureNodeDbSchema,\n runSeedInit,\n findSeedBinary,\n} from './helpers/scripts'\nexport { INIT_SCRIPT_SUCCESS_MESSAGE, SCHEMA_TS } from '../helpers/constants'\n\n// Side effect imports for CLI — register platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":["fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;AAIG;AACI,MAAM,wBAAwB,GAAG,CACtC,QAAgB,KACc;IAC9B,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;;;IAI/C,MAAM,gBAAgB,GAAG,mCAAmC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAE7C,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;AAEhC,IAAA,IAAI;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAwB;AACrE,QAAA,OAAO,WAAW;IACpB;IAAE,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,CAAA,oCAAA,EAAuC,QAAQ,KAAK,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,CAAE,CAC7G;IACH;AACF;AAEA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAkB,KAAsB;AACxE,IAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AAChB,QAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;IAC/D;AAEA,IAAA,MAAM,EAAE,KAAK,EAAE,SAAS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AAC;AACpD,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;AAC9E,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC;AAC1D,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;KACrF;AAED,IAAA,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE;AACnC,QAAA,IAAIA,WAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAC1B,YAAA,OAAO,OAAO;QAChB;IACF;AAEA,IAAA,OAAO,IAAI;AACb;AAEA;;;AAGG;AACI,MAAM,kBAAkB,GAAG,OAChC,cAAuB,EACvB,eAAwB,KACP;IACjB,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;IAChE;AAEA,IAAA,MAAM,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;AACzC;AAEA;AACO,MAAM,WAAW,GAAG;;ACY3B,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE;;;;"}
@@ -1,17 +1,21 @@
1
- import { o as getOwnedAddressesFromDb, p as BaseDb, s as seeds, q as getGetAdditionalSyncAddresses } from './index-BcXKZQpX.js';
1
+ import { B as BaseDb, s as seeds } from './BasePathResolver-BDgc7c4T.js';
2
2
  import { eq, or } from 'drizzle-orm';
3
- import 'xstate';
3
+ import { getOwnedAddressesFromDb } from './db-Cvh84NY7.js';
4
+ import { g as getGetAdditionalSyncAddresses } from './index--F3Wolt5.js';
4
5
  import 'drizzle-orm/sqlite-core';
5
- import 'nanoid';
6
- import 'nanoid-dictionary';
6
+ import 'drizzle-orm/casing';
7
+ import 'lodash-es';
7
8
  import 'debug';
8
- import 'ethers';
9
+ import 'xstate';
10
+ import './constants-B5S5JPDK.js';
11
+ import '@seedprotocol/arweave';
12
+ import '@seedprotocol/eas';
9
13
  import 'pluralize';
10
14
  import '@sinclair/typebox';
11
- import 'drizzle-orm/casing';
12
- import 'lodash-es';
15
+ import 'nanoid';
16
+ import 'nanoid-dictionary';
17
+ import './constants-DMHTYMgJ.js';
13
18
  import 'rxjs';
14
- import 'arweave';
15
19
  import 'js-sha3';
16
20
 
17
21
  const READ_ONLY_ERROR = 'Item is read-only: you do not own this item';
@@ -98,4 +102,4 @@ async function assertItemOwned(item) {
98
102
  }
99
103
 
100
104
  export { assertItemOwned, isItemOwned };
101
- //# sourceMappingURL=ownership-C17YhE7J.js.map
105
+ //# sourceMappingURL=ownership-BF_ZUKIp.js.map