@seedprotocol/sdk 0.7.8 → 0.7.9-next.1177.ga3e08ed

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 (419) hide show
  1. package/README.md +1 -1
  2. package/dist/{ClientManager-B1r_8P5Z.js → ClientManager-GZfXErDX.js} +187 -1451
  3. package/dist/ClientManager-GZfXErDX.js.map +1 -0
  4. package/dist/{Item-CjTEShfk.js → Item-0oDoTPhi.js} +175 -238
  5. package/dist/Item-0oDoTPhi.js.map +1 -0
  6. package/dist/{ModelProperty-C3749Wjq.js → ModelProperty-i5flwzQG.js} +41 -40
  7. package/dist/ModelProperty-i5flwzQG.js.map +1 -0
  8. package/dist/{Schema-CX9CTtho.js → Schema-PFZwG9Nl.js} +88 -1623
  9. package/dist/Schema-PFZwG9Nl.js.map +1 -0
  10. package/dist/{SchemaValidationService-T5mqnY8q.js → SchemaValidationService-DnGKel4V.js} +7 -6
  11. package/dist/{SchemaValidationService-T5mqnY8q.js.map → SchemaValidationService-DnGKel4V.js.map} +1 -1
  12. package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js → backfillMetadataPropertyIds-BbxgavEQ.js} +4 -4
  13. package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js.map → backfillMetadataPropertyIds-BbxgavEQ.js.map} +1 -1
  14. package/dist/{changeFeed-DcsZ7deG.js → changeFeed-DKdVlUmt.js} +8 -7
  15. package/dist/changeFeed-DKdVlUmt.js.map +1 -0
  16. package/dist/configurePlatform-CrMafpMW.js +29 -0
  17. package/dist/configurePlatform-CrMafpMW.js.map +1 -0
  18. package/dist/db/drizzle/0024_merge_republished_ghost_seeds.sql +29 -0
  19. package/dist/db/drizzle/meta/0024_snapshot.json +1645 -0
  20. package/dist/db/drizzle/meta/_journal.json +7 -0
  21. package/dist/{detachRowsBeforeDelete-Bo_pky-R.js → detachRowsBeforeDelete-DXFYSHRR.js} +2 -3
  22. package/dist/{detachRowsBeforeDelete-Bo_pky-R.js.map → detachRowsBeforeDelete-DXFYSHRR.js.map} +1 -1
  23. package/dist/dist/{ClientManager-B1r_8P5Z.d.ts → ClientManager-GZfXErDX.d.ts} +323 -406
  24. package/dist/dist/ClientManager-GZfXErDX.d.ts.map +1 -0
  25. package/dist/dist/{Item-CjTEShfk.d.ts → Item-0oDoTPhi.d.ts} +85 -91
  26. package/dist/dist/Item-0oDoTPhi.d.ts.map +1 -0
  27. package/dist/dist/{ModelProperty-C3749Wjq.d.ts → ModelProperty-i5flwzQG.d.ts} +1 -1
  28. package/dist/dist/{ModelProperty-C3749Wjq.d.ts.map → ModelProperty-i5flwzQG.d.ts.map} +1 -1
  29. package/dist/dist/{Schema-CX9CTtho.d.ts → Schema-PFZwG9Nl.d.ts} +7 -183
  30. package/dist/dist/Schema-PFZwG9Nl.d.ts.map +1 -0
  31. package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts → SchemaValidationService-DnGKel4V.d.ts} +1 -1
  32. package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts.map → SchemaValidationService-DnGKel4V.d.ts.map} +1 -1
  33. package/dist/dist/{backfillMetadataPropertyIds-DWWkh-Ex.d.ts → backfillMetadataPropertyIds-BbxgavEQ.d.ts} +1 -1
  34. package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts.map +1 -0
  35. package/dist/dist/{changeFeed-DcsZ7deG.d.ts → changeFeed-DKdVlUmt.d.ts} +17 -20
  36. package/dist/dist/changeFeed-DKdVlUmt.d.ts.map +1 -0
  37. package/dist/dist/configurePlatform-CrMafpMW.d.ts +5 -0
  38. package/dist/dist/configurePlatform-CrMafpMW.d.ts.map +1 -0
  39. package/dist/dist/{detachRowsBeforeDelete-Bo_pky-R.d.ts → detachRowsBeforeDelete-DXFYSHRR.d.ts} +1 -1
  40. package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts.map +1 -0
  41. package/dist/dist/{eas--9vtNkma.d.ts → eas-dyepi5jz.d.ts} +1 -1
  42. package/dist/dist/eas-dyepi5jz.d.ts.map +1 -0
  43. package/dist/dist/{errors-Do7v6RKu.d.ts → errors-C1qUEZ7A.d.ts} +5 -2
  44. package/dist/dist/errors-C1qUEZ7A.d.ts.map +1 -0
  45. package/dist/dist/{errors-rIWK7gwJ.d.ts → errors-D1zHAqjr.d.ts} +1 -1
  46. package/dist/dist/{errors-rIWK7gwJ.d.ts.map → errors-D1zHAqjr.d.ts.map} +1 -1
  47. package/dist/dist/eventBus-7vxTCc3a.d.ts +18 -0
  48. package/dist/dist/eventBus-7vxTCc3a.d.ts.map +1 -0
  49. package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts +13 -0
  50. package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts.map +1 -0
  51. package/dist/dist/{getItem-5j22EWWE.d.ts → getItem-Bhjecbia.d.ts} +1 -1
  52. package/dist/dist/getItem-Bhjecbia.d.ts.map +1 -0
  53. package/dist/dist/{getPublishPayload-BGl2SaGK.d.ts → getPublishPayload-DH4rMqXG.d.ts} +1 -1
  54. package/dist/dist/getPublishPayload-DH4rMqXG.d.ts.map +1 -0
  55. package/dist/dist/{getPublishUploads-DVsDx6Xf.d.ts → getPublishUploads-BzUIDA2G.d.ts} +5 -5
  56. package/dist/dist/getPublishUploads-BzUIDA2G.d.ts.map +1 -0
  57. package/dist/dist/index-CkYb3wcU.d.ts +14 -0
  58. package/dist/dist/index-CkYb3wcU.d.ts.map +1 -0
  59. package/dist/dist/{index-Dp4uyZYx.d.ts → index-DJmWkVIK.d.ts} +5 -5
  60. package/dist/dist/index-DJmWkVIK.d.ts.map +1 -0
  61. package/dist/dist/{index-C0SetTd1.d.ts → index-Dx_GTdyQ.d.ts} +1457 -1513
  62. package/dist/dist/index-Dx_GTdyQ.d.ts.map +1 -0
  63. package/dist/dist/{index-CZQrNqvq.d.ts → index-PbnKw2es.d.ts} +1 -1
  64. package/dist/dist/{index-CZQrNqvq.d.ts.map → index-PbnKw2es.d.ts.map} +1 -1
  65. package/dist/dist/{index.browser-Ll71Y_Dl.d.ts → index.browser-i9uPJice.d.ts} +13 -40
  66. package/dist/dist/{index.browser-Ll71Y_Dl.d.ts.map → index.browser-i9uPJice.d.ts.map} +1 -1
  67. package/dist/dist/{index.node-CgltN0cC.d.ts → index.node-CzMwMr_d.d.ts} +2 -45
  68. package/dist/dist/{index.node-CgltN0cC.d.ts.map → index.node-CzMwMr_d.d.ts.map} +1 -1
  69. package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +9 -0
  70. package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +1 -0
  71. package/dist/dist/{modelPropertyRecordSchemas-C_lYTzMr.d.ts → modelPropertyRecordSchemas-C5lW9aA-.d.ts} +1 -1
  72. package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts.map +1 -0
  73. package/dist/dist/platform.browser.d.ts +2 -2
  74. package/dist/dist/platform.node.d.ts +2 -2
  75. package/dist/dist/{property-pcDxNEpy.d.ts → property-BwYtg5Q_.d.ts} +3 -3
  76. package/dist/dist/property-BwYtg5Q_.d.ts.map +1 -0
  77. package/dist/dist/{propertyValidationRules-BEjN0f3-.d.ts → propertyValidationRules-CyHdpcPP.d.ts} +1 -1
  78. package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts.map +1 -0
  79. package/dist/dist/{publishDraftGraph-I5yKe1Xz.d.ts → publishDraftGraph-C5F6b7GK.d.ts} +23 -6
  80. package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts.map +1 -0
  81. package/dist/dist/{resolveModelForSyncedSeed-C5KXn6ex.d.ts → resolveModelForSyncedSeed-4gO9Hfn2.d.ts} +1 -1
  82. package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts.map +1 -0
  83. package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts +13 -0
  84. package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts.map +1 -0
  85. package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts → tolerantWebAccess-DecKDGen.d.ts} +1 -1
  86. package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts.map → tolerantWebAccess-DecKDGen.d.ts.map} +1 -1
  87. package/dist/dist/{updateSeedRevokedAt-CR4zwn-6.d.ts → updateSeedRevokedAt-CP606vKs.d.ts} +1 -1
  88. package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts.map +1 -0
  89. package/dist/{eas--9vtNkma.js → eas-dyepi5jz.js} +3 -4
  90. package/dist/eas-dyepi5jz.js.map +1 -0
  91. package/dist/{errors-Do7v6RKu.js → errors-C1qUEZ7A.js} +12 -6
  92. package/dist/errors-C1qUEZ7A.js.map +1 -0
  93. package/dist/{errors-rIWK7gwJ.js → errors-D1zHAqjr.js} +46 -98
  94. package/dist/errors-D1zHAqjr.js.map +1 -0
  95. package/dist/eventBus-7vxTCc3a.js +64 -0
  96. package/dist/eventBus-7vxTCc3a.js.map +1 -0
  97. package/dist/findSeedRowsByUid-CT3sOXXw.js +47 -0
  98. package/dist/findSeedRowsByUid-CT3sOXXw.js.map +1 -0
  99. package/dist/{getItem-5j22EWWE.js → getItem-Bhjecbia.js} +5 -5
  100. package/dist/{getItem-5j22EWWE.js.map → getItem-Bhjecbia.js.map} +1 -1
  101. package/dist/{getPublishPayload-BGl2SaGK.js → getPublishPayload-DH4rMqXG.js} +27 -27
  102. package/dist/getPublishPayload-DH4rMqXG.js.map +1 -0
  103. package/dist/{getPublishUploads-DVsDx6Xf.js → getPublishUploads-BzUIDA2G.js} +64 -95
  104. package/dist/getPublishUploads-BzUIDA2G.js.map +1 -0
  105. package/dist/{index-CJK3F_MK.js → index-CkYb3wcU.js} +9 -8
  106. package/dist/index-CkYb3wcU.js.map +1 -0
  107. package/dist/{index-Dp4uyZYx.js → index-DJmWkVIK.js} +9 -8
  108. package/dist/index-DJmWkVIK.js.map +1 -0
  109. package/dist/{index-C0SetTd1.js → index-Dx_GTdyQ.js} +27 -463
  110. package/dist/index-Dx_GTdyQ.js.map +1 -0
  111. package/dist/{index-CZQrNqvq.js → index-PbnKw2es.js} +2 -2
  112. package/dist/index-PbnKw2es.js.map +1 -0
  113. package/dist/{index.browser-Ll71Y_Dl.js → index.browser-i9uPJice.js} +239 -179
  114. package/dist/index.browser-i9uPJice.js.map +1 -0
  115. package/dist/{index.node-CgltN0cC.js → index.node-CzMwMr_d.js} +51 -216
  116. package/dist/index.node-CzMwMr_d.js.map +1 -0
  117. package/dist/main.js +165 -241
  118. package/dist/main.js.map +1 -1
  119. package/dist/minimumUpgradeVersion-BDhHvHtr.js +81 -0
  120. package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +1 -0
  121. package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js → modelPropertyRecordSchemas-C5lW9aA-.js} +5 -5
  122. package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js.map → modelPropertyRecordSchemas-C5lW9aA-.js.map} +1 -1
  123. package/dist/node.js +14 -221
  124. package/dist/node.js.map +1 -1
  125. package/dist/platform.browser.js +8 -7
  126. package/dist/platform.browser.js.map +1 -1
  127. package/dist/platform.node.js +7 -7
  128. package/dist/{property-pcDxNEpy.js → property-BwYtg5Q_.js} +8 -9
  129. package/dist/property-BwYtg5Q_.js.map +1 -0
  130. package/dist/{propertyValidationRules-BEjN0f3-.js → propertyValidationRules-CyHdpcPP.js} +10 -10
  131. package/dist/{propertyValidationRules-BEjN0f3-.js.map → propertyValidationRules-CyHdpcPP.js.map} +1 -1
  132. package/dist/{publishDraftGraph-I5yKe1Xz.js → publishDraftGraph-C5F6b7GK.js} +104 -35
  133. package/dist/publishDraftGraph-C5F6b7GK.js.map +1 -0
  134. package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js → resolveModelForSyncedSeed-4gO9Hfn2.js} +3 -2
  135. package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js.map → resolveModelForSyncedSeed-4gO9Hfn2.js.map} +1 -1
  136. package/dist/seedSchema/PendingWriteSchema.ts +3 -2
  137. package/dist/src/Item/Item.d.ts +1 -0
  138. package/dist/src/Item/Item.d.ts.map +1 -1
  139. package/dist/src/Item/service/actors/runPublish.d.ts.map +1 -1
  140. package/dist/src/ItemProperty/ItemProperty.d.ts +2 -2
  141. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  142. package/dist/src/ItemProperty/service/propertyMachine.d.ts +1 -1
  143. package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
  144. package/dist/src/Model/Model.d.ts.map +1 -1
  145. package/dist/src/Model/service/modelMachine.d.ts +0 -20
  146. package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
  147. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +0 -20
  148. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
  149. package/dist/src/Schema/service/schemaMachine.d.ts +1 -107
  150. package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
  151. package/dist/src/Schema/validation.d.ts +0 -1
  152. package/dist/src/Schema/validation.d.ts.map +1 -1
  153. package/dist/src/browser/db/Db.d.ts +8 -3
  154. package/dist/src/browser/db/Db.d.ts.map +1 -1
  155. package/dist/src/browser/db/createSqlocalDrizzle.d.ts +20 -2
  156. package/dist/src/browser/db/createSqlocalDrizzle.d.ts.map +1 -1
  157. package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
  158. package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
  159. package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
  160. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
  161. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
  162. package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -1
  163. package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
  164. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
  165. package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
  166. package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
  167. package/dist/src/client/constants.d.ts +0 -51
  168. package/dist/src/client/constants.d.ts.map +1 -1
  169. package/dist/src/db/minimumUpgradeVersion.d.ts +33 -0
  170. package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -0
  171. package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts +2 -1
  172. package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts.map +1 -1
  173. package/dist/src/db/read/findSeedRowsByUid.d.ts +13 -0
  174. package/dist/src/db/read/findSeedRowsByUid.d.ts.map +1 -0
  175. package/dist/src/db/read/getItemData.d.ts.map +1 -1
  176. package/dist/src/db/read/getLatestPublishedVersionRow.d.ts +2 -1
  177. package/dist/src/db/read/getLatestPublishedVersionRow.d.ts.map +1 -1
  178. package/dist/src/db/read/getLatestVersionRow.d.ts +1 -1
  179. package/dist/src/db/read/getLatestVersionRow.d.ts.map +1 -1
  180. package/dist/src/db/read/getPublishPayload.d.ts +4 -0
  181. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  182. package/dist/src/db/read/getPublishUploads.d.ts +1 -3
  183. package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
  184. package/dist/src/db/read/getRelatedItemsForPublish.d.ts +2 -0
  185. package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
  186. package/dist/src/db/read/itemLoads.d.ts +20 -0
  187. package/dist/src/db/read/itemLoads.d.ts.map +1 -0
  188. package/dist/src/db/read/publishDraftGraph.d.ts +7 -0
  189. package/dist/src/db/read/publishDraftGraph.d.ts.map +1 -1
  190. package/dist/src/db/read/resolveRelatedSeedRef.d.ts +4 -4
  191. package/dist/src/db/read/resolveRelatedSeedRef.d.ts.map +1 -1
  192. package/dist/src/db/read/subqueries/latestVersion.d.ts +14 -0
  193. package/dist/src/db/read/subqueries/latestVersion.d.ts.map +1 -0
  194. package/dist/src/db/read/subqueries/versionData.d.ts +2 -2
  195. package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -1
  196. package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
  197. package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +6 -0
  198. package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -1
  199. package/dist/src/db/write/easSyncProcess.d.ts +1 -1
  200. package/dist/src/db/write/easSyncProcess.d.ts.map +1 -1
  201. package/dist/src/db/write/updateVersionUid.d.ts +2 -2
  202. package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
  203. package/dist/src/events/files/download.d.ts +1 -10
  204. package/dist/src/events/files/download.d.ts.map +1 -1
  205. package/dist/src/events/item/easSyncManager.d.ts +0 -1
  206. package/dist/src/events/item/easSyncManager.d.ts.map +1 -1
  207. package/dist/src/events/item/index.d.ts.map +1 -1
  208. package/dist/src/events/item/syncDbWithEas.d.ts +0 -10
  209. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  210. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +1 -1
  211. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  212. package/dist/src/helpers/FileManager/IFileManager.d.ts +7 -0
  213. package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
  214. package/dist/src/helpers/FileManager/errors.d.ts +4 -1
  215. package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
  216. package/dist/src/helpers/arweaveContentTags.d.ts +1 -2
  217. package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -1
  218. package/dist/src/helpers/constants.d.ts +3 -12
  219. package/dist/src/helpers/constants.d.ts.map +1 -1
  220. package/dist/src/helpers/db.d.ts +3 -28
  221. package/dist/src/helpers/db.d.ts.map +1 -1
  222. package/dist/src/helpers/ethereumUtils.d.ts +0 -2
  223. package/dist/src/helpers/ethereumUtils.d.ts.map +1 -1
  224. package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +2 -1
  225. package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
  226. package/dist/src/helpers/index.d.ts +0 -7
  227. package/dist/src/helpers/index.d.ts.map +1 -1
  228. package/dist/src/helpers/itemStorageFile.d.ts +2 -2
  229. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +2 -1
  230. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -1
  231. package/dist/src/helpers/schema.d.ts +0 -73
  232. package/dist/src/helpers/schema.d.ts.map +1 -1
  233. package/dist/src/helpers/updateSchema.d.ts +0 -46
  234. package/dist/src/helpers/updateSchema.d.ts.map +1 -1
  235. package/dist/src/imports/index.d.ts +0 -1
  236. package/dist/src/imports/index.d.ts.map +1 -1
  237. package/dist/src/imports/json.d.ts +2 -1
  238. package/dist/src/imports/json.d.ts.map +1 -1
  239. package/dist/src/index.d.ts +4 -6
  240. package/dist/src/index.d.ts.map +1 -1
  241. package/dist/src/node/db/Db.d.ts.map +1 -1
  242. package/dist/src/node/helpers/dotSeedDir.d.ts +7 -0
  243. package/dist/src/node/helpers/dotSeedDir.d.ts.map +1 -0
  244. package/dist/src/node/index.d.ts +0 -5
  245. package/dist/src/node/index.d.ts.map +1 -1
  246. package/dist/src/outbox/index.d.ts +1 -1
  247. package/dist/src/outbox/index.d.ts.map +1 -1
  248. package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
  249. package/dist/src/outbox/outbox.d.ts +3 -19
  250. package/dist/src/outbox/outbox.d.ts.map +1 -1
  251. package/dist/src/platform/configurePlatform.d.ts.map +1 -1
  252. package/dist/src/platform/index.browser.d.ts.map +1 -1
  253. package/dist/src/platform/index.node.d.ts.map +1 -1
  254. package/dist/src/platform/types.d.ts +0 -2
  255. package/dist/src/platform/types.d.ts.map +1 -1
  256. package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
  257. package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -1
  258. package/dist/src/services/write/actors/validateEntity.d.ts +1 -1
  259. package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -1
  260. package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -1
  261. package/dist/src/services/write/writeProcessMachine.d.ts +1 -23
  262. package/dist/src/services/write/writeProcessMachine.d.ts.map +1 -1
  263. package/dist/src/stores/eas.d.ts +0 -1
  264. package/dist/src/stores/eas.d.ts.map +1 -1
  265. package/dist/src/types/index.d.ts +1 -18
  266. package/dist/src/types/index.d.ts.map +1 -1
  267. package/dist/src/types/machines.d.ts +1 -32
  268. package/dist/src/types/machines.d.ts.map +1 -1
  269. package/dist/{syncDbWithEas-b4fESZ7C.js → syncDbWithEas-DUu_wjUG.js} +37 -105
  270. package/dist/syncDbWithEas-DUu_wjUG.js.map +1 -0
  271. package/dist/{tolerantWebAccess-CIpS7RLk.js → tolerantWebAccess-DecKDGen.js} +9 -8
  272. package/dist/{tolerantWebAccess-CIpS7RLk.js.map → tolerantWebAccess-DecKDGen.js.map} +1 -1
  273. package/dist/{updateSeedRevokedAt-CR4zwn-6.js → updateSeedRevokedAt-CP606vKs.js} +3 -3
  274. package/dist/{updateSeedRevokedAt-CR4zwn-6.js.map → updateSeedRevokedAt-CP606vKs.js.map} +1 -1
  275. package/package.json +6 -8
  276. package/dist/ClientManager-B1r_8P5Z.js.map +0 -1
  277. package/dist/Item-CjTEShfk.js.map +0 -1
  278. package/dist/ModelProperty-C3749Wjq.js.map +0 -1
  279. package/dist/Schema-CX9CTtho.js.map +0 -1
  280. package/dist/changeFeed-DcsZ7deG.js.map +0 -1
  281. package/dist/configurePlatform-AWild9o4.js +0 -81
  282. package/dist/configurePlatform-AWild9o4.js.map +0 -1
  283. package/dist/dist/ClientManager-B1r_8P5Z.d.ts.map +0 -1
  284. package/dist/dist/Item-CjTEShfk.d.ts.map +0 -1
  285. package/dist/dist/Schema-CX9CTtho.d.ts.map +0 -1
  286. package/dist/dist/backfillMetadataPropertyIds-DWWkh-Ex.d.ts.map +0 -1
  287. package/dist/dist/changeFeed-DcsZ7deG.d.ts.map +0 -1
  288. package/dist/dist/configurePlatform-AWild9o4.d.ts +0 -30
  289. package/dist/dist/configurePlatform-AWild9o4.d.ts.map +0 -1
  290. package/dist/dist/detachRowsBeforeDelete-Bo_pky-R.d.ts.map +0 -1
  291. package/dist/dist/eas--9vtNkma.d.ts.map +0 -1
  292. package/dist/dist/errors-Do7v6RKu.d.ts.map +0 -1
  293. package/dist/dist/getItem-5j22EWWE.d.ts.map +0 -1
  294. package/dist/dist/getPublishPayload-BGl2SaGK.d.ts.map +0 -1
  295. package/dist/dist/getPublishUploads-DVsDx6Xf.d.ts.map +0 -1
  296. package/dist/dist/index-C0SetTd1.d.ts.map +0 -1
  297. package/dist/dist/index-CJK3F_MK.d.ts +0 -14
  298. package/dist/dist/index-CJK3F_MK.d.ts.map +0 -1
  299. package/dist/dist/index-Dp4uyZYx.d.ts.map +0 -1
  300. package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.d.ts.map +0 -1
  301. package/dist/dist/property-pcDxNEpy.d.ts.map +0 -1
  302. package/dist/dist/propertyValidationRules-BEjN0f3-.d.ts.map +0 -1
  303. package/dist/dist/publishDraftGraph-I5yKe1Xz.d.ts.map +0 -1
  304. package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts +0 -17
  305. package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts.map +0 -1
  306. package/dist/dist/resolveModelForSyncedSeed-C5KXn6ex.d.ts.map +0 -1
  307. package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts +0 -22
  308. package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts.map +0 -1
  309. package/dist/dist/updateSeedRevokedAt-CR4zwn-6.d.ts.map +0 -1
  310. package/dist/eas--9vtNkma.js.map +0 -1
  311. package/dist/errors-Do7v6RKu.js.map +0 -1
  312. package/dist/errors-rIWK7gwJ.js.map +0 -1
  313. package/dist/getPublishPayload-BGl2SaGK.js.map +0 -1
  314. package/dist/getPublishUploads-DVsDx6Xf.js.map +0 -1
  315. package/dist/index-C0SetTd1.js.map +0 -1
  316. package/dist/index-CJK3F_MK.js.map +0 -1
  317. package/dist/index-CZQrNqvq.js.map +0 -1
  318. package/dist/index-Dp4uyZYx.js.map +0 -1
  319. package/dist/index.browser-Ll71Y_Dl.js.map +0 -1
  320. package/dist/index.node-CgltN0cC.js.map +0 -1
  321. package/dist/property-pcDxNEpy.js.map +0 -1
  322. package/dist/publishDraftGraph-I5yKe1Xz.js.map +0 -1
  323. package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js +0 -98
  324. package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js.map +0 -1
  325. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +0 -5
  326. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +0 -1
  327. package/dist/src/browser/db/sqlWasmClient.d.ts +0 -1
  328. package/dist/src/browser/db/sqlWasmClient.d.ts.map +0 -1
  329. package/dist/src/browser/helpers/PathResolver.d.ts +0 -41
  330. package/dist/src/browser/helpers/PathResolver.d.ts.map +0 -1
  331. package/dist/src/browser/index.d.ts +0 -3
  332. package/dist/src/browser/index.d.ts.map +0 -1
  333. package/dist/src/browser/seed.d.ts +0 -21
  334. package/dist/src/browser/seed.d.ts.map +0 -1
  335. package/dist/src/browser/workers/content-hash.d.ts +0 -2
  336. package/dist/src/browser/workers/content-hash.d.ts.map +0 -1
  337. package/dist/src/browser/workers/dbWorker.d.ts +0 -1
  338. package/dist/src/browser/workers/dbWorker.d.ts.map +0 -1
  339. package/dist/src/client/BaseClientManager.d.ts +0 -7
  340. package/dist/src/client/BaseClientManager.d.ts.map +0 -1
  341. package/dist/src/client/actions/setAddresses.d.ts +0 -2
  342. package/dist/src/client/actions/setAddresses.d.ts.map +0 -1
  343. package/dist/src/db/alignRowPublishers.d.ts +0 -25
  344. package/dist/src/db/alignRowPublishers.d.ts.map +0 -1
  345. package/dist/src/db/clearStoredDisplayUrls.d.ts +0 -18
  346. package/dist/src/db/clearStoredDisplayUrls.d.ts.map +0 -1
  347. package/dist/src/db/migrateLegacyItemStorageRows.d.ts +0 -57
  348. package/dist/src/db/migrateLegacyItemStorageRows.d.ts.map +0 -1
  349. package/dist/src/db/read/getExistingItem.d.ts +0 -12
  350. package/dist/src/db/read/getExistingItem.d.ts.map +0 -1
  351. package/dist/src/db/read/getModels.d.ts +0 -5
  352. package/dist/src/db/read/getModels.d.ts.map +0 -1
  353. package/dist/src/db/read/getVersionsForVersionUids.d.ts +0 -10
  354. package/dist/src/db/read/getVersionsForVersionUids.d.ts.map +0 -1
  355. package/dist/src/db/removeForeignAttestationRows.d.ts +0 -27
  356. package/dist/src/db/removeForeignAttestationRows.d.ts.map +0 -1
  357. package/dist/src/db/resetAmbiguousLegacyItemData.d.ts +0 -17
  358. package/dist/src/db/resetAmbiguousLegacyItemData.d.ts.map +0 -1
  359. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +0 -14
  360. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +0 -1
  361. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts +0 -44
  362. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts.map +0 -1
  363. package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts +0 -18
  364. package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +0 -1
  365. package/dist/src/db/write/saveAppState.d.ts +0 -2
  366. package/dist/src/db/write/saveAppState.d.ts.map +0 -1
  367. package/dist/src/eslint-rules/align-imports.d.ts +0 -12
  368. package/dist/src/eslint-rules/align-imports.d.ts.map +0 -1
  369. package/dist/src/events/files/index.d.ts +0 -4
  370. package/dist/src/events/files/index.d.ts.map +0 -1
  371. package/dist/src/events/index.d.ts +0 -13
  372. package/dist/src/events/index.d.ts.map +0 -1
  373. package/dist/src/events/services/allItems.d.ts +0 -6
  374. package/dist/src/events/services/allItems.d.ts.map +0 -1
  375. package/dist/src/events/services/index.d.ts +0 -3
  376. package/dist/src/events/services/index.d.ts.map +0 -1
  377. package/dist/src/helpers/ArweaveClient/index.d.ts +0 -30
  378. package/dist/src/helpers/ArweaveClient/index.d.ts.map +0 -1
  379. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +0 -26
  380. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +0 -1
  381. package/dist/src/helpers/PathResolver/IPathResolver.d.ts +0 -16
  382. package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +0 -1
  383. package/dist/src/helpers/easRevokedFilter.d.ts +0 -2
  384. package/dist/src/helpers/easRevokedFilter.d.ts.map +0 -1
  385. package/dist/src/helpers/file/fetchAll/actors.d.ts +0 -16
  386. package/dist/src/helpers/file/fetchAll/actors.d.ts.map +0 -1
  387. package/dist/src/helpers/file/fetchAll/index.d.ts +0 -58
  388. package/dist/src/helpers/file/fetchAll/index.d.ts.map +0 -1
  389. package/dist/src/helpers/files.d.ts +0 -10
  390. package/dist/src/helpers/files.d.ts.map +0 -1
  391. package/dist/src/helpers/updateMachineContext.d.ts +0 -7
  392. package/dist/src/helpers/updateMachineContext.d.ts.map +0 -1
  393. package/dist/src/imports/markdown.d.ts +0 -40
  394. package/dist/src/imports/markdown.d.ts.map +0 -1
  395. package/dist/src/node/constants.d.ts +0 -2
  396. package/dist/src/node/constants.d.ts.map +0 -1
  397. package/dist/src/node/db/index.d.ts +0 -5
  398. package/dist/src/node/db/index.d.ts.map +0 -1
  399. package/dist/src/node/helpers/PathResolver.d.ts +0 -44
  400. package/dist/src/node/helpers/PathResolver.d.ts.map +0 -1
  401. package/dist/src/node/helpers/scripts.d.ts +0 -14
  402. package/dist/src/node/helpers/scripts.d.ts.map +0 -1
  403. package/dist/src/node/seed.d.ts +0 -1
  404. package/dist/src/node/seed.d.ts.map +0 -1
  405. package/dist/src/node/webpack/fs-proxy.d.ts +0 -4
  406. package/dist/src/node/webpack/fs-proxy.d.ts.map +0 -1
  407. package/dist/src/node/webpack/index.d.ts +0 -7
  408. package/dist/src/node/webpack/index.d.ts.map +0 -1
  409. package/dist/src/services/events.d.ts +0 -2
  410. package/dist/src/services/events.d.ts.map +0 -1
  411. package/dist/src/testing/platformTestHandle.d.ts +0 -8
  412. package/dist/src/testing/platformTestHandle.d.ts.map +0 -1
  413. package/dist/src/types/browser.d.ts +0 -24
  414. package/dist/src/types/browser.d.ts.map +0 -1
  415. package/dist/src/types/seedProtocol.d.ts +0 -16
  416. package/dist/src/types/seedProtocol.d.ts.map +0 -1
  417. package/dist/src/types/services.d.ts +0 -1
  418. package/dist/src/types/services.d.ts.map +0 -1
  419. package/dist/syncDbWithEas-b4fESZ7C.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { fromCallback, fromPromise, setup, assign, createActor } from 'xstate';
2
- import { G as BaseDb, t as models, w as properties, aj as generateId, aN as isInternalSchema, aO as writeModelToDb, aP as writePropertyToDb, aQ as addSchemaToDb, r as modelSchemas, B as schemas, I as AmbiguousModelError, aR as renameModelInDb, aS as currentNameMatchLevels, a as TProperty } from './index-C0SetTd1.js';
2
+ import { L as BaseDb, p as models, E as properties, ad as generateId, aF as isInternalSchema, aG as writeModelToDb, aH as writePropertyToDb, z as modelSchemas, J as schemas, A as AmbiguousModelError, aI as renameModelInDb, aJ as currentNameMatchLevels, a as TProperty } from './index-Dx_GTdyQ.js';
3
3
  import { eq, and, isNull, or } from 'drizzle-orm';
4
4
  import debug from 'debug';
5
- import { P as isActorStopped, ak as ActorKeyedState, C as waitForEntityIdle, Q as DEFAULT_READY_TIMEOUT_MS, R as createReactiveProxy, T as findEntity, X as ClientManagerState, I as Item, al as clearDestroySubscriptions, U as forceRemoveFromCaches, am as unloadEntity, V as runDestroyLifecycle } from './Item-CjTEShfk.js';
6
- import { z as getClient } from './ClientManager-B1r_8P5Z.js';
5
+ import { L as isActorStopped, aj as ActorKeyedState, B as waitForEntityIdle, N as DEFAULT_READY_TIMEOUT_MS, P as createReactiveProxy, R as findEntity, W as ClientManagerState, I as Item, ak as clearDestroySubscriptions, S as forceRemoveFromCaches, al as unloadEntity, T as runDestroyLifecycle } from './Item-0oDoTPhi.js';
6
+ import { v as getClient } from './ClientManager-GZfXErDX.js';
7
7
  import { modelPropertiesToObject } from './model-oHA3YhOd.js';
8
8
  import { localNamesInBestMatchTier } from '@seedprotocol/eas';
9
9
  import { Type } from '@sinclair/typebox';
@@ -19,7 +19,7 @@ const createPropertyInstances = async (propertyFileIds) => {
19
19
  return;
20
20
  }
21
21
  try {
22
- const mod = await import('./ModelProperty-C3749Wjq.js');
22
+ const mod = await import('./ModelProperty-i5flwzQG.js');
23
23
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
24
24
  if (!ModelProperty) {
25
25
  logger$7('createPropertyInstances: ModelProperty not available from dynamic import');
@@ -85,11 +85,11 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
85
85
  if (!modelRecord) {
86
86
  // Model names are only unique per schema: prefer this schema's row, and otherwise only
87
87
  // consider same-name rows that no schema claims yet (never another schema's model).
88
- const _mod_0 = await import('./index-C0SetTd1.js');
89
- const _ns_0 = _mod_0.bm;
88
+ const _mod_0 = await import('./index-Dx_GTdyQ.js');
89
+ const _ns_0 = _mod_0.bd;
90
90
  const { modelSchemas } = _ns_0;
91
- const _mod_1 = await import('./index-C0SetTd1.js');
92
- const _ns_1 = _mod_1.bl;
91
+ const _mod_1 = await import('./index-Dx_GTdyQ.js');
92
+ const _ns_1 = _mod_1.bc;
93
93
  const { schemas: schemasTable } = _ns_1;
94
94
  let dbModels = await db
95
95
  .select({
@@ -236,8 +236,8 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
236
236
  // Step 2: Fallback to Schema context (only if database doesn't have the model)
237
237
  // This handles the case where model exists in schema file but not yet in database
238
238
  try {
239
- const _mod_2 = await import('./Schema-CX9CTtho.js');
240
- const _ns_2 = _mod_2.b;
239
+ const _mod_2 = await import('./Schema-PFZwG9Nl.js');
240
+ const _ns_2 = _mod_2.a;
241
241
  const schemaMod = _ns_2;
242
242
  const { Schema } = schemaMod;
243
243
  // Stopped meanwhile (unloaded, or evicted with its schema): don't load the schema again
@@ -387,12 +387,12 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
387
387
  }
388
388
  // Also check database for models (in case they're persisted but not in Schema context)
389
389
  if (db) {
390
- const _mod_3 = await import('./index-C0SetTd1.js');
391
- const _ns_3 = _mod_3.bm;
390
+ const _mod_3 = await import('./index-Dx_GTdyQ.js');
391
+ const _ns_3 = _mod_3.bd;
392
392
  const modelSchemaSchemaMod = _ns_3;
393
393
  const { modelSchemas } = modelSchemaSchemaMod;
394
- const _mod_4 = await import('./index-C0SetTd1.js');
395
- const _ns_4 = _mod_4.bl;
394
+ const _mod_4 = await import('./index-Dx_GTdyQ.js');
395
+ const _ns_4 = _mod_4.bc;
396
396
  const schemaSchemaMod = _ns_4;
397
397
  const { schemas: schemasTable } = schemaSchemaMod;
398
398
  // Query all models for this schema to check for duplicates (case-insensitive)
@@ -487,8 +487,8 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
487
487
  }
488
488
  // Mark schema as draft when a new model is created so saveNewVersion() can persist it
489
489
  try {
490
- const _mod_5 = await import('./Schema-CX9CTtho.js');
491
- const _ns_5 = _mod_5.b;
490
+ const _mod_5 = await import('./Schema-PFZwG9Nl.js');
491
+ const _ns_5 = _mod_5.a;
492
492
  const schemaMod = _ns_5;
493
493
  const { Schema } = schemaMod;
494
494
  if (!isActorStopped(self)) {
@@ -535,11 +535,11 @@ const validateModel = fromCallback(({ sendBack, input: { context }, self }) => {
535
535
  const _validateModel = async () => {
536
536
  try {
537
537
  // Use dynamic imports to break circular dependencies
538
- const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
538
+ const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
539
539
  const { SchemaValidationService } = validationServiceMod;
540
540
  const validationService = new SchemaValidationService();
541
- const _mod_6 = await import('./Schema-CX9CTtho.js');
542
- const _ns_6 = _mod_6.b;
541
+ const _mod_6 = await import('./Schema-PFZwG9Nl.js');
542
+ const _ns_6 = _mod_6.a;
543
543
  const schemaMod = _ns_6;
544
544
  const { Schema } = schemaMod;
545
545
  // Validate model structure
@@ -655,7 +655,7 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
655
655
  return;
656
656
  }
657
657
  logger$5(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
658
- const mod = await import('./ModelProperty-C3749Wjq.js');
658
+ const mod = await import('./ModelProperty-i5flwzQG.js');
659
659
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
660
660
  if (!ModelProperty) {
661
661
  logger$5('ModelProperty not available from dynamic import');
@@ -680,8 +680,8 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
680
680
  : undefined;
681
681
  // Otherwise use provided ID or generate a random one
682
682
  // IDs should be generated in the import process before creating properties
683
- const _mod_7 = await import('./index-C0SetTd1.js');
684
- const _ns_7 = _mod_7.bq;
683
+ const _mod_7 = await import('./index-Dx_GTdyQ.js');
684
+ const _ns_7 = _mod_7.bh;
685
685
  const { generateId } = _ns_7;
686
686
  const propertyFileId = propData.id || propertyRecord?.schemaFileId || generateId();
687
687
  logger$5(`Creating property "${propName}" with fileId "${propertyFileId}"`);
@@ -698,8 +698,8 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
698
698
  }
699
699
  else if (refModelName) {
700
700
  // Fallback: resolve the ref by name within this model's schema
701
- const _mod_8 = await import('./index-C0SetTd1.js');
702
- const _ns_8 = _mod_8.bn;
701
+ const _mod_8 = await import('./index-Dx_GTdyQ.js');
702
+ const _ns_8 = _mod_8.be;
703
703
  const { resolveModelRecord } = _ns_8;
704
704
  const refModelRecord = await resolveModelRecord(refModelName, { schemaName }, db);
705
705
  if (refModelRecord?.id) {
@@ -869,8 +869,8 @@ const validateEntity = fromPromise(async ({ input }) => {
869
869
  const evictionEpoch = currentEvictionEpoch();
870
870
  /** The schema to validate against; throws (validation then skips the schema check) once it was evicted. */
871
871
  const schemaForValidation = async (schemaName) => {
872
- const _mod_9 = await import('./Schema-CX9CTtho.js');
873
- const _ns_9 = _mod_9.b;
872
+ const _mod_9 = await import('./Schema-PFZwG9Nl.js');
873
+ const _ns_9 = _mod_9.a;
874
874
  const { Schema } = _ns_9;
875
875
  if (schemaEvictedSince(schemaName, evictionEpoch)) {
876
876
  throw new Error(`Schema "${schemaName}" was evicted during validation`);
@@ -887,7 +887,7 @@ const validateEntity = fromPromise(async ({ input }) => {
887
887
  const structureMsg = `[validateEntity] Validating model structure`;
888
888
  logger$4(structureMsg);
889
889
  // Use existing Model validation
890
- const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
890
+ const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
891
891
  const { SchemaValidationService } = validationServiceMod;
892
892
  const validationService = new SchemaValidationService();
893
893
  // Validate model structure
@@ -937,7 +937,7 @@ const validateEntity = fromPromise(async ({ input }) => {
937
937
  }
938
938
  else if (entityInput.entityType === 'modelProperty') {
939
939
  // Use existing ModelProperty validation
940
- const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
940
+ const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
941
941
  const { SchemaValidationService } = validationServiceMod;
942
942
  const validationService = new SchemaValidationService();
943
943
  // Validate property structure
@@ -975,19 +975,6 @@ const validateEntity = fromPromise(async ({ input }) => {
975
975
  }
976
976
  }
977
977
  }
978
- else if (entityInput.entityType === 'schema') {
979
- // Schema validation - use existing validation
980
- const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
981
- const { SchemaValidationService } = validationServiceMod;
982
- const validationService = new SchemaValidationService();
983
- const schemaResult = validationService.validateSchema(entityInput.entityData);
984
- if (!schemaResult.isValid) {
985
- result = {
986
- isValid: false,
987
- errors: schemaResult.errors,
988
- };
989
- }
990
- }
991
978
  // Return the result - fromPromise will automatically put this in event.output
992
979
  const completeMsg = `[validateEntity] Validation complete: isValid=${result.isValid}, errors=${result.errors?.length || 0}`;
993
980
  logger$4(completeMsg);
@@ -1065,7 +1052,7 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
1065
1052
  // initial write completes is not overwritten by the stale requestWrite payload.
1066
1053
  let dataToWrite = input.entityData;
1067
1054
  try {
1068
- const mod = await import('./ModelProperty-C3749Wjq.js');
1055
+ const mod = await import('./ModelProperty-i5flwzQG.js');
1069
1056
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
1070
1057
  if (ModelProperty && typeof ModelProperty.getById === 'function') {
1071
1058
  const instance = ModelProperty.getById(input.entityId);
@@ -1093,11 +1080,6 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
1093
1080
  await writePropertyToDb(input.entityId, dataToWrite);
1094
1081
  output = input.entityData;
1095
1082
  }
1096
- else if (input.entityType === 'schema') {
1097
- const schemaRecord = await addSchemaToDb(input.entityData, input.entityId, // schemaFileId (string)
1098
- input.entityData.schemaData, input.entityData.isDraft);
1099
- output = { ...input.entityData, _dbId: schemaRecord.id }; // Store as _dbId (database integer ID)
1100
- }
1101
1083
  else {
1102
1084
  throw new Error(`Unknown entity type: ${input.entityType}`);
1103
1085
  }
@@ -1154,9 +1136,7 @@ const writeProcessMachine = setup({
1154
1136
  entityId: input.entityId,
1155
1137
  entityData: input.entityData || {},
1156
1138
  validationErrors: [],
1157
- writeStatus: 'idle',
1158
1139
  error: null,
1159
- retryCount: 0,
1160
1140
  pendingWrite: null,
1161
1141
  }),
1162
1142
  states: {
@@ -1170,7 +1150,6 @@ const writeProcessMachine = setup({
1170
1150
  data: event.data,
1171
1151
  timestamp: Date.now(),
1172
1152
  }),
1173
- writeStatus: 'validating',
1174
1153
  }),
1175
1154
  ({ event, context }) => {
1176
1155
  logger$2(`[startWrite] Received startWrite for ${context.entityType} "${context.entityId}"`);
@@ -1225,7 +1204,6 @@ const writeProcessMachine = setup({
1225
1204
  actions: [
1226
1205
  assign({
1227
1206
  validationErrors: [],
1228
- writeStatus: 'writing',
1229
1207
  }),
1230
1208
  ({ context }) => {
1231
1209
  const msg = `[validating] Validation passed, transitioning to writing for ${context.entityType} "${context.entityId}"`;
@@ -1241,7 +1219,6 @@ const writeProcessMachine = setup({
1241
1219
  const result = event.output;
1242
1220
  return result.errors || [];
1243
1221
  },
1244
- writeStatus: 'error',
1245
1222
  error: ({ event }) => {
1246
1223
  const result = event.output;
1247
1224
  return new Error(`Validation failed: ${result.errors.map(e => e.message).join(', ')}`);
@@ -1259,7 +1236,6 @@ const writeProcessMachine = setup({
1259
1236
  actions: [
1260
1237
  assign({
1261
1238
  error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),
1262
- writeStatus: 'error',
1263
1239
  }),
1264
1240
  ({ context, event }) => {
1265
1241
  const errorMsg = `[validating] Validation error for ${context.entityType} "${context.entityId}": ${event.error}`;
@@ -1269,9 +1245,6 @@ const writeProcessMachine = setup({
1269
1245
  ],
1270
1246
  },
1271
1247
  },
1272
- on: {
1273
- reset: 'idle',
1274
- },
1275
1248
  },
1276
1249
  writing: {
1277
1250
  invoke: {
@@ -1292,7 +1265,6 @@ const writeProcessMachine = setup({
1292
1265
  target: 'success',
1293
1266
  actions: [
1294
1267
  assign({
1295
- writeStatus: 'success',
1296
1268
  pendingWrite: null,
1297
1269
  entityData: ({ context, event }) => {
1298
1270
  // Update entityData with any returned data from write
@@ -1309,8 +1281,6 @@ const writeProcessMachine = setup({
1309
1281
  actions: [
1310
1282
  assign({
1311
1283
  error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),
1312
- writeStatus: 'error',
1313
- retryCount: ({ context }) => context.retryCount + 1,
1314
1284
  }),
1315
1285
  ({ context, event }) => {
1316
1286
  const errorMsg = `[writing] Write error for ${context.entityType} "${context.entityId}": ${event.error}`;
@@ -1320,40 +1290,14 @@ const writeProcessMachine = setup({
1320
1290
  },
1321
1291
  ],
1322
1292
  },
1323
- reset: 'idle',
1324
1293
  },
1325
1294
  },
1326
1295
  success: {
1327
1296
  after: {
1328
1297
  2000: { target: 'idle' }, // Auto-reset after 2s
1329
1298
  },
1330
- on: {
1331
- reset: 'idle',
1332
- },
1333
- entry: assign({
1334
- writeStatus: 'success',
1335
- }),
1336
- },
1337
- error: {
1338
- on: {
1339
- retry: {
1340
- target: 'validating',
1341
- guard: ({ context }) => context.retryCount < 3,
1342
- actions: assign({
1343
- error: null,
1344
- }),
1345
- },
1346
- revert: {
1347
- target: 'idle',
1348
- actions: assign({
1349
- pendingWrite: null,
1350
- writeStatus: 'idle',
1351
- error: null,
1352
- }),
1353
- },
1354
- reset: 'idle',
1355
- },
1356
1299
  },
1300
+ error: {},
1357
1301
  },
1358
1302
  });
1359
1303
 
@@ -1459,7 +1403,7 @@ const modelMachine = setup({
1459
1403
  // Create ModelProperty instances for any new property IDs
1460
1404
  if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
1461
1405
  // Import and create instances asynchronously (fire-and-forget)
1462
- import('./ModelProperty-C3749Wjq.js').then(({ ModelProperty }) => {
1406
+ import('./ModelProperty-i5flwzQG.js').then(({ ModelProperty }) => {
1463
1407
  if (self.getSnapshot().status === 'stopped')
1464
1408
  return;
1465
1409
  const createPromises = newPropertyIds.map(async (propertyFileId) => {
@@ -1996,7 +1940,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
1996
1940
  // Lazy import cache for ModelProperty to avoid circular dependency
1997
1941
  // Eagerly start loading to minimize delay on first access
1998
1942
  let ModelPropertyClass = null;
1999
- const modelPropertyImportPromise = import('./ModelProperty-C3749Wjq.js')
1943
+ const modelPropertyImportPromise = import('./ModelProperty-i5flwzQG.js')
2000
1944
  .then(module => {
2001
1945
  ModelPropertyClass = module.ModelProperty;
2002
1946
  return ModelPropertyClass;
@@ -2475,9 +2419,13 @@ class Model {
2475
2419
  // If schema provided, trigger write process instead of registration
2476
2420
  // When schemaName is passed as string (e.g. useCreateModel), we must trigger write so runtime-created
2477
2421
  // models get persisted to DB and show up in useModels (which queries the database).
2422
+ const hasProperties = !!options?.properties && Object.keys(options.properties).length > 0;
2478
2423
  const shouldTriggerWrite = (registerWithSchema && schemaInstance) ||
2479
- (options?.properties && Object.keys(options.properties).length > 0) ||
2424
+ hasProperties ||
2480
2425
  typeof schemaNameOrSchema === 'string';
2426
+ // Every DB load (createById, getByNameAsync, ...) also passes a string schema and no properties.
2427
+ // Such a model adopts its existing row: writing it again rewrote each property row and cleared is_edited.
2428
+ const adoptExistingRow = !!options?.persistedBy || (typeof schemaNameOrSchema === 'string' && !hasProperties);
2481
2429
  if (shouldTriggerWrite) {
2482
2430
  queueMicrotask(async () => {
2483
2431
  try {
@@ -2506,7 +2454,7 @@ class Model {
2506
2454
  failPropertyCreation('the model was unloaded');
2507
2455
  return;
2508
2456
  }
2509
- if (options?.persistedBy && (await Model.adoptPersistedRow(proxiedInstance))) {
2457
+ if (adoptExistingRow && (await Model.adoptPersistedRow(proxiedInstance))) {
2510
2458
  return;
2511
2459
  }
2512
2460
  // Only write if validation passed (model is in idle state, not error)
@@ -2973,8 +2921,8 @@ class Model {
2973
2921
  const evictionEpoch = options?.evictionEpoch ?? currentEvictionEpoch();
2974
2922
  try {
2975
2923
  // Query model by name (throws AmbiguousModelError when several schemas define it)
2976
- const _mod_10 = await import('./index-C0SetTd1.js');
2977
- const _ns_10 = _mod_10.bn;
2924
+ const _mod_10 = await import('./index-Dx_GTdyQ.js');
2925
+ const _ns_10 = _mod_10.be;
2978
2926
  const { resolveModelRecord } = _ns_10;
2979
2927
  const resolved = await resolveModelRecord(modelName, {}, db);
2980
2928
  if (!resolved?.schemaFileId) {
@@ -3733,7 +3681,7 @@ class Model {
3733
3681
  .limit(1);
3734
3682
  if (modelRecords.length > 0) {
3735
3683
  const modelId = modelRecords[0].id;
3736
- const { detachModelRows } = await import('./detachRowsBeforeDelete-Bo_pky-R.js');
3684
+ const { detachModelRows } = await import('./detachRowsBeforeDelete-DXFYSHRR.js');
3737
3685
  await detachModelRows(db, [typeof modelId === 'string' ? parseInt(modelId, 10) : modelId]);
3738
3686
  await db.delete(modelSchemas).where(eq(modelSchemas.modelId, modelId));
3739
3687
  await db
@@ -3744,8 +3692,8 @@ class Model {
3744
3692
  }
3745
3693
  if (schemaName && modelName) {
3746
3694
  // Imported here, not at module load: Model and Schema import each other.
3747
- const _mod_11 = await import('./Schema-CX9CTtho.js');
3748
- const _ns_11 = _mod_11.b;
3695
+ const _mod_11 = await import('./Schema-PFZwG9Nl.js');
3696
+ const _ns_11 = _mod_11.a;
3749
3697
  const { Schema } = _ns_11;
3750
3698
  const schema = Schema.create(schemaName, { waitForReady: false, hold: false });
3751
3699
  const schemaContext = schema.getService().getSnapshot().context;
@@ -3788,8 +3736,8 @@ class Model {
3788
3736
  return undefined;
3789
3737
  }
3790
3738
  // Model names are only unique per schema: find this model's row by its id (schemaFileId).
3791
- const _mod_12 = await import('./index-C0SetTd1.js');
3792
- const _ns_12 = _mod_12.bn;
3739
+ const _mod_12 = await import('./index-Dx_GTdyQ.js');
3740
+ const _ns_12 = _mod_12.be;
3793
3741
  const { resolveModelRecord } = _ns_12;
3794
3742
  const modelRecord = await resolveModelRecord(modelName, { modelFileId: context.id, schemaName: context.schemaName }, db);
3795
3743
  if (!modelRecord?.id) {
@@ -4055,4 +4003,4 @@ var errors = /*#__PURE__*/Object.freeze({
4055
4003
  });
4056
4004
 
4057
4005
  export { ConflictError as C, ItemCreateValidationError as I, Model as M, TModelSchema as T, UnknownModelError as U, TModelValues as a, anyEvictionSince as b, currentEvictionEpoch as c, ItemCreateError as d, setupEntityLiveQuery as e, finishSchemaDestroy as f, getDraftSaveError as g, writeToDatabase$1 as h, Model$1 as i, errors as j, recordSchemaDestroy as r, schemaEvictedSince as s, trackDraftSave as t, writeProcessMachine as w };
4058
- //# sourceMappingURL=errors-rIWK7gwJ.js.map
4006
+ //# sourceMappingURL=errors-D1zHAqjr.js.map