@seedprotocol/sdk 0.4.7 → 0.4.9

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 (966) hide show
  1. package/dist/ArweaveClient-DFqnm5Kj.js +202 -0
  2. package/dist/ArweaveClient-DFqnm5Kj.js.map +1 -0
  3. package/dist/ArweaveClient-sN5h2FvY.js +202 -0
  4. package/dist/ArweaveClient-sN5h2FvY.js.map +1 -0
  5. package/dist/Db-DIythELU.js +246 -0
  6. package/dist/Db-DIythELU.js.map +1 -0
  7. package/dist/Db-Dz17KxVs.js +1530 -0
  8. package/dist/Db-Dz17KxVs.js.map +1 -0
  9. package/dist/EasClient-BadfcFDk.js +29 -0
  10. package/dist/EasClient-BadfcFDk.js.map +1 -0
  11. package/dist/EasClient-DosbWaZN.js +29 -0
  12. package/dist/EasClient-DosbWaZN.js.map +1 -0
  13. package/dist/FileManager-BHuVNWT3.js +174 -0
  14. package/dist/FileManager-BHuVNWT3.js.map +1 -0
  15. package/dist/FileManager-Wthr5yHO.js +1142 -0
  16. package/dist/FileManager-Wthr5yHO.js.map +1 -0
  17. package/dist/ModelProperty-B9Z2DRxI.js +1731 -0
  18. package/dist/ModelProperty-B9Z2DRxI.js.map +1 -0
  19. package/dist/PathResolver-Cd1PZDLG.js +204 -0
  20. package/dist/PathResolver-Cd1PZDLG.js.map +1 -0
  21. package/dist/PathResolver-NEpTSgQK.js +78 -0
  22. package/dist/PathResolver-NEpTSgQK.js.map +1 -0
  23. package/dist/QueryClient-C9U8oZUe.js +34 -0
  24. package/dist/QueryClient-C9U8oZUe.js.map +1 -0
  25. package/dist/QueryClient-ndmA8MYL.js +47 -0
  26. package/dist/QueryClient-ndmA8MYL.js.map +1 -0
  27. package/dist/Schema-D1-HjT8z.js +6521 -0
  28. package/dist/Schema-D1-HjT8z.js.map +1 -0
  29. package/dist/SchemaValidationService-CIXKzSpb.js +654 -0
  30. package/dist/SchemaValidationService-CIXKzSpb.js.map +1 -0
  31. package/dist/cjs/ModelProperty-09hNvSBl.js +1725 -0
  32. package/dist/cjs/ModelProperty-09hNvSBl.js.map +1 -0
  33. package/dist/cjs/Schema-BcwvUABB.js +5967 -0
  34. package/dist/cjs/Schema-BcwvUABB.js.map +1 -0
  35. package/dist/cjs/SchemaValidationService-zty4nfCu.js +670 -0
  36. package/dist/cjs/SchemaValidationService-zty4nfCu.js.map +1 -0
  37. package/dist/cjs/getItem-Dlb5YSQn.js +55 -0
  38. package/dist/cjs/getItem-Dlb5YSQn.js.map +1 -0
  39. package/dist/cjs/getPublishPayload-BqL06sEI.js +520 -0
  40. package/dist/cjs/getPublishPayload-BqL06sEI.js.map +1 -0
  41. package/dist/cjs/getPublishUploads-oukGI2N6.js +282 -0
  42. package/dist/cjs/getPublishUploads-oukGI2N6.js.map +1 -0
  43. package/dist/cjs/getSegmentedItemProperties-JT984OOp.js +71 -0
  44. package/dist/cjs/getSegmentedItemProperties-JT984OOp.js.map +1 -0
  45. package/dist/cjs/index-BLETlVgA.js +17614 -0
  46. package/dist/cjs/index-BLETlVgA.js.map +1 -0
  47. package/dist/cjs/index-jubgGeM2.js +58 -0
  48. package/dist/cjs/index-jubgGeM2.js.map +1 -0
  49. package/dist/cjs/ownership-vfvyz3KJ.js +103 -0
  50. package/dist/cjs/ownership-vfvyz3KJ.js.map +1 -0
  51. package/dist/getItem-f9rNUz7I.js +38 -0
  52. package/dist/getItem-f9rNUz7I.js.map +1 -0
  53. package/dist/getPublishPayload-BBI_j9I2.js +503 -0
  54. package/dist/getPublishPayload-BBI_j9I2.js.map +1 -0
  55. package/dist/getPublishUploads-BFM94w5S.js +246 -0
  56. package/dist/getPublishUploads-BFM94w5S.js.map +1 -0
  57. package/dist/getSegmentedItemProperties-Di9vevKz.js +69 -0
  58. package/dist/getSegmentedItemProperties-Di9vevKz.js.map +1 -0
  59. package/dist/index-CSAVWKeA.js +18 -0
  60. package/dist/index-CSAVWKeA.js.map +1 -0
  61. package/dist/index-ajj6SHkh.js +23 -0
  62. package/dist/index-ajj6SHkh.js.map +1 -0
  63. package/dist/index-j8WN8W6V.js +16296 -0
  64. package/dist/index-j8WN8W6V.js.map +1 -0
  65. package/dist/main.cjs +1 -1
  66. package/dist/main.js +152 -534
  67. package/dist/main.js.map +1 -1
  68. package/dist/node.js +33 -15
  69. package/dist/node.js.map +1 -1
  70. package/dist/ownership-DLNI17NE.js +85 -0
  71. package/dist/ownership-DLNI17NE.js.map +1 -0
  72. package/dist/property-C6qoOzLG.js +264 -0
  73. package/dist/property-C6qoOzLG.js.map +1 -0
  74. package/dist/queries-jMaUn86w.js +16 -0
  75. package/dist/queries-jMaUn86w.js.map +1 -0
  76. package/dist/seedSchema/SEEDPROTOCOL_Seed_Protocol_v1.json +38 -1
  77. package/dist/src/Item/Item.d.ts +141 -0
  78. package/dist/src/Item/Item.d.ts.map +1 -0
  79. package/dist/src/Item/queries.d.ts.map +1 -0
  80. package/dist/src/Item/service/actors/fetchDataFromEas.d.ts.map +1 -0
  81. package/dist/src/Item/service/actors/hydrateExistingItem.d.ts.map +1 -0
  82. package/dist/src/Item/service/actors/hydrateNewItem.d.ts.map +1 -0
  83. package/dist/src/Item/service/actors/initialize.d.ts.map +1 -0
  84. package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +1 -0
  85. package/dist/src/Item/service/actors/reload.d.ts.map +1 -0
  86. package/dist/src/Item/service/actors/runPublish.d.ts.map +1 -0
  87. package/dist/src/Item/service/actors/saveDataToDb.d.ts.map +1 -0
  88. package/dist/src/Item/service/actors/waitForDb.d.ts.map +1 -0
  89. package/dist/src/Item/service/itemMachineSingle.d.ts.map +1 -0
  90. package/dist/src/ItemProperty/ItemProperty.d.ts +126 -0
  91. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -0
  92. package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -0
  93. package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -0
  94. package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -0
  95. package/dist/src/ItemProperty/service/actors/resolveRelatedValue.d.ts.map +1 -0
  96. package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.d.ts.map +1 -0
  97. package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -0
  98. package/dist/src/ItemProperty/service/actors/saveValueToDb/index.d.ts +7 -0
  99. package/dist/src/ItemProperty/service/actors/saveValueToDb/index.d.ts.map +1 -0
  100. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts +5 -0
  101. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +1 -0
  102. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts +5 -0
  103. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts.map +1 -0
  104. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +1 -0
  105. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -0
  106. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts.map +1 -0
  107. package/dist/src/ItemProperty/service/actors/waitForDb.d.ts.map +1 -0
  108. package/dist/src/ItemProperty/service/propertyMachine.d.ts +78 -0
  109. package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -0
  110. package/dist/src/Model/Model.d.ts.map +1 -0
  111. package/dist/src/Model/index.d.ts.map +1 -0
  112. package/dist/src/Model/service/actors/createModelProperties.d.ts.map +1 -0
  113. package/dist/src/Model/service/actors/loadOrCreateModel.d.ts.map +1 -0
  114. package/dist/src/Model/service/actors/validateModel.d.ts.map +1 -0
  115. package/dist/src/Model/service/modelMachine.d.ts +222 -0
  116. package/dist/src/Model/service/modelMachine.d.ts.map +1 -0
  117. package/dist/src/ModelProperty/ModelProperty.d.ts +148 -0
  118. package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -0
  119. package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -0
  120. package/dist/src/ModelProperty/service/actors/saveToSchema.d.ts.map +1 -0
  121. package/dist/src/ModelProperty/service/actors/validateProperty.d.ts.map +1 -0
  122. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -0
  123. package/dist/src/Schema/Schema.d.ts.map +1 -0
  124. package/dist/src/Schema/errors.d.ts.map +1 -0
  125. package/dist/src/Schema/index.d.ts.map +1 -0
  126. package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -0
  127. package/dist/src/Schema/service/actors/createModelInstances.d.ts.map +1 -0
  128. package/dist/src/Schema/service/actors/createPropertyInstances.d.ts.map +1 -0
  129. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -0
  130. package/dist/src/Schema/service/actors/validateSchema.d.ts.map +1 -0
  131. package/dist/src/Schema/service/actors/verifyModelInstancesInCache.d.ts.map +1 -0
  132. package/dist/src/Schema/service/actors/verifyModelsInDb.d.ts.map +1 -0
  133. package/dist/src/Schema/service/actors/verifyPropertiesInDb.d.ts.map +1 -0
  134. package/dist/src/Schema/service/actors/verifyPropertyInstancesInCache.d.ts.map +1 -0
  135. package/dist/src/Schema/service/actors/verifySchemaInDb.d.ts.map +1 -0
  136. package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +1 -0
  137. package/dist/src/Schema/service/actors/writePropertiesToDb.d.ts.map +1 -0
  138. package/dist/src/Schema/service/actors/writeSchemaToDb.d.ts.map +1 -0
  139. package/dist/src/Schema/service/addModelsMachine.d.ts +123 -0
  140. package/dist/src/Schema/service/addModelsMachine.d.ts.map +1 -0
  141. package/dist/src/Schema/service/schemaMachine.d.ts +526 -0
  142. package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -0
  143. package/dist/src/Schema/service/validation/SchemaValidationService.d.ts.map +1 -0
  144. package/dist/src/Schema/validation.d.ts.map +1 -0
  145. package/dist/src/browser/db/Db.d.ts.map +1 -0
  146. package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -0
  147. package/dist/src/browser/db/sqlWasmClient.d.ts.map +1 -0
  148. package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -0
  149. package/dist/src/browser/helpers/EasClient.d.ts.map +1 -0
  150. package/dist/src/browser/helpers/FileManager.d.ts +42 -0
  151. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -0
  152. package/dist/src/browser/helpers/PathResolver.d.ts.map +1 -0
  153. package/dist/src/browser/helpers/QueryClient.d.ts.map +1 -0
  154. package/dist/src/browser/helpers/index.d.ts.map +1 -0
  155. package/dist/src/browser/index.d.ts.map +1 -0
  156. package/dist/src/browser/react/OPFSImage.d.ts.map +1 -0
  157. package/dist/src/browser/react/SeedImage.d.ts.map +1 -0
  158. package/dist/src/browser/react/SeedProvider.d.ts.map +1 -0
  159. package/dist/src/browser/react/client.d.ts.map +1 -0
  160. package/dist/src/browser/react/db.d.ts.map +1 -0
  161. package/dist/src/browser/react/index.d.ts +14 -0
  162. package/dist/src/browser/react/index.d.ts.map +1 -0
  163. package/dist/src/browser/react/item.d.ts.map +1 -0
  164. package/dist/src/browser/react/itemProperty.d.ts.map +1 -0
  165. package/dist/src/browser/react/liveQuery.d.ts.map +1 -0
  166. package/dist/src/browser/react/model.d.ts.map +1 -0
  167. package/dist/src/browser/react/modelProperty.d.ts.map +1 -0
  168. package/dist/src/browser/react/queryClient.d.ts.map +1 -0
  169. package/dist/src/browser/react/schema.d.ts.map +1 -0
  170. package/dist/src/browser/react/services.d.ts.map +1 -0
  171. package/dist/src/browser/react/trash.d.ts.map +1 -0
  172. package/dist/src/browser/react/useImageFiles.d.ts +19 -0
  173. package/dist/src/browser/react/useImageFiles.d.ts.map +1 -0
  174. package/dist/src/browser/seed.d.ts.map +1 -0
  175. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -0
  176. package/dist/src/browser/workers/ImageResizer.d.ts.map +1 -0
  177. package/dist/src/browser/workers/content-hash.d.ts.map +1 -0
  178. package/dist/src/browser/workers/dbWorker.d.ts.map +1 -0
  179. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -0
  180. package/dist/src/browser/workers/imageResize.d.ts.map +1 -0
  181. package/dist/src/client/BaseClientManager.d.ts.map +1 -0
  182. package/dist/src/client/ClientManager.d.ts.map +1 -0
  183. package/dist/src/client/actions/setAddresses.d.ts.map +1 -0
  184. package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -0
  185. package/dist/src/client/actors/addModelsToStore.d.ts.map +1 -0
  186. package/dist/src/client/actors/dbInit.d.ts.map +1 -0
  187. package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -0
  188. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -0
  189. package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -0
  190. package/dist/src/client/actors/saveAppState.d.ts.map +1 -0
  191. package/dist/src/client/actors/saveConfig.d.ts.map +1 -0
  192. package/dist/src/client/clientManagerMachine.d.ts.map +1 -0
  193. package/dist/src/client/constants.d.ts.map +1 -0
  194. package/dist/src/client/index.d.ts.map +1 -0
  195. package/dist/src/db/Db/BaseDb.d.ts.map +1 -0
  196. package/dist/src/db/configs/dev.schema.config.d.ts.map +1 -0
  197. package/dist/src/db/read/getExistingItem.d.ts.map +1 -0
  198. package/dist/src/db/read/getItem.d.ts.map +1 -0
  199. package/dist/src/db/read/getItemData.d.ts.map +1 -0
  200. package/dist/src/db/read/getItemProperties.d.ts.map +1 -0
  201. package/dist/src/db/read/getItemProperty.d.ts.map +1 -0
  202. package/dist/src/db/read/getItems.d.ts.map +1 -0
  203. package/dist/src/db/read/getMetadata.d.ts.map +1 -0
  204. package/dist/src/db/read/getModelPropertiesData.d.ts.map +1 -0
  205. package/dist/src/db/read/getModelSchemas.d.ts.map +1 -0
  206. package/dist/src/db/read/getModels.d.ts.map +1 -0
  207. package/dist/src/db/read/getModelsData.d.ts.map +1 -0
  208. package/dist/src/db/read/getPropertyData.d.ts.map +1 -0
  209. package/dist/src/db/read/getPublishPayload.d.ts +36 -0
  210. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -0
  211. package/dist/src/db/read/getPublishUploads.d.ts +10 -0
  212. package/dist/src/db/read/getPublishUploads.d.ts.map +1 -0
  213. package/dist/src/db/read/getRelatedItemsForPublish.d.ts +8 -0
  214. package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -0
  215. package/dist/src/db/read/getRelationValueData.d.ts.map +1 -0
  216. package/dist/src/db/read/getSchemaUidForModel.d.ts +2 -0
  217. package/dist/src/db/read/getSchemaUidForModel.d.ts.map +1 -0
  218. package/dist/src/db/read/getSeedData.d.ts.map +1 -0
  219. package/dist/src/db/read/getStorageTransactionIdForSeedUid.d.ts.map +1 -0
  220. package/dist/src/db/read/getVersionData.d.ts.map +1 -0
  221. package/dist/src/db/read/getVersionsForVersionUids.d.ts.map +1 -0
  222. package/dist/src/db/read/subqueries/metadataLatest.d.ts.map +1 -0
  223. package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -0
  224. package/dist/src/db/write/createMetadata.d.ts.map +1 -0
  225. package/dist/src/db/write/createNewItem.d.ts.map +1 -0
  226. package/dist/src/db/write/createSeed.d.ts.map +1 -0
  227. package/dist/src/db/write/createSeeds.d.ts.map +1 -0
  228. package/dist/src/db/write/createVersion.d.ts.map +1 -0
  229. package/dist/src/db/write/deleteItem.d.ts.map +1 -0
  230. package/dist/src/db/write/recoverDeletedItem.d.ts.map +1 -0
  231. package/dist/src/db/write/saveAppState.d.ts.map +1 -0
  232. package/dist/src/db/write/saveMetadata.d.ts.map +1 -0
  233. package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -0
  234. package/dist/src/db/write/updateMetadata.d.ts.map +1 -0
  235. package/dist/src/db/write/updateSeedUid.d.ts.map +1 -0
  236. package/dist/src/eas.d.ts +26 -0
  237. package/dist/src/eas.d.ts.map +1 -0
  238. package/dist/src/eslint-rules/align-imports.d.ts.map +1 -0
  239. package/dist/src/eventBus.d.ts.map +1 -0
  240. package/dist/src/events/files/download.d.ts.map +1 -0
  241. package/dist/src/events/files/index.d.ts.map +1 -0
  242. package/dist/src/events/index.d.ts.map +1 -0
  243. package/dist/src/events/item/index.d.ts.map +1 -0
  244. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -0
  245. package/dist/src/events/services/allItems.d.ts.map +1 -0
  246. package/dist/src/events/services/index.d.ts.map +1 -0
  247. package/dist/src/graphql/fragments/Attestation.d.ts.map +1 -0
  248. package/dist/src/graphql/fragments/Schema.d.ts.map +1 -0
  249. package/dist/src/graphql/fragments/index.d.ts.map +1 -0
  250. package/dist/src/graphql/gql/fragment-masking.d.ts.map +1 -0
  251. package/dist/src/graphql/gql/gql.d.ts.map +1 -0
  252. package/dist/src/graphql/gql/graphql.d.ts.map +1 -0
  253. package/dist/src/graphql/gql/index.d.ts.map +1 -0
  254. package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts.map +1 -0
  255. package/dist/src/helpers/ArweaveClient/index.d.ts.map +1 -0
  256. package/dist/src/helpers/ArweaveClient/queries.d.ts.map +1 -0
  257. package/dist/src/helpers/EasClient/BaseEasClient.d.ts.map +1 -0
  258. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +41 -0
  259. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -0
  260. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +1 -0
  261. package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts.map +1 -0
  262. package/dist/src/helpers/addresses.d.ts.map +1 -0
  263. package/dist/src/helpers/constants.d.ts +71 -0
  264. package/dist/src/helpers/constants.d.ts.map +1 -0
  265. package/dist/src/helpers/crypto.d.ts.map +1 -0
  266. package/dist/src/helpers/db.d.ts +143 -0
  267. package/dist/src/helpers/db.d.ts.map +1 -0
  268. package/dist/src/helpers/entity/entityCache.d.ts.map +1 -0
  269. package/dist/src/helpers/entity/entityCommon.d.ts.map +1 -0
  270. package/dist/src/helpers/entity/entityDestroy.d.ts.map +1 -0
  271. package/dist/src/helpers/entity/entityFind.d.ts.map +1 -0
  272. package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -0
  273. package/dist/src/helpers/entity/entityUnload.d.ts +54 -0
  274. package/dist/src/helpers/entity/entityUnload.d.ts.map +1 -0
  275. package/dist/src/helpers/entity/index.d.ts.map +1 -0
  276. package/dist/src/helpers/environment.d.ts.map +1 -0
  277. package/dist/src/helpers/file/download/actors.d.ts.map +1 -0
  278. package/dist/src/helpers/file/download/index.d.ts.map +1 -0
  279. package/dist/src/helpers/file/fetchAll/actors.d.ts.map +1 -0
  280. package/dist/src/helpers/file/fetchAll/index.d.ts.map +1 -0
  281. package/dist/src/helpers/file/queries.d.ts.map +1 -0
  282. package/dist/src/helpers/files.d.ts.map +1 -0
  283. package/dist/src/helpers/getSchemaForItemProperty.d.ts +15 -0
  284. package/dist/src/helpers/getSchemaForItemProperty.d.ts.map +1 -0
  285. package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -0
  286. package/dist/src/helpers/image/queries.d.ts.map +1 -0
  287. package/dist/src/helpers/index.d.ts +30 -0
  288. package/dist/src/helpers/index.d.ts.map +1 -0
  289. package/dist/src/helpers/model.d.ts.map +1 -0
  290. package/dist/src/helpers/ownership.d.ts.map +1 -0
  291. package/dist/src/helpers/property/index.d.ts +304 -0
  292. package/dist/src/helpers/property/index.d.ts.map +1 -0
  293. package/dist/src/helpers/property.d.ts.map +1 -0
  294. package/dist/src/helpers/publishConfig.d.ts +18 -0
  295. package/dist/src/helpers/publishConfig.d.ts.map +1 -0
  296. package/dist/src/helpers/reactiveProxy.d.ts.map +1 -0
  297. package/dist/src/helpers/schema.d.ts.map +1 -0
  298. package/dist/src/helpers/updateMachineContext.d.ts.map +1 -0
  299. package/dist/src/helpers/updateSchema.d.ts +128 -0
  300. package/dist/src/helpers/updateSchema.d.ts.map +1 -0
  301. package/dist/src/helpers/waitForEntityIdle.d.ts.map +1 -0
  302. package/dist/src/imports/index.d.ts.map +1 -0
  303. package/dist/src/imports/json.d.ts.map +1 -0
  304. package/dist/src/imports/markdown.d.ts +40 -0
  305. package/dist/src/imports/markdown.d.ts.map +1 -0
  306. package/dist/src/index.d.ts +30 -0
  307. package/dist/src/index.d.ts.map +1 -0
  308. package/dist/src/interfaces/IDb.d.ts.map +1 -0
  309. package/dist/src/interfaces/IEasClient.d.ts.map +1 -0
  310. package/dist/src/interfaces/IItem.d.ts.map +1 -0
  311. package/dist/src/interfaces/IItemProperty.d.ts.map +1 -0
  312. package/dist/src/interfaces/IQueryClient.d.ts.map +1 -0
  313. package/dist/src/interfaces/index.d.ts.map +1 -0
  314. package/dist/src/node/codegen/drizzle.d.ts.map +1 -0
  315. package/dist/src/node/codegen/index.d.ts.map +1 -0
  316. package/dist/src/node/codegen/ts-to-proto.d.ts.map +1 -0
  317. package/dist/src/node/constants.d.ts.map +1 -0
  318. package/dist/src/node/db/Db.d.ts.map +1 -0
  319. package/dist/src/node/db/index.d.ts.map +1 -0
  320. package/dist/src/node/db/node.app.db.config.d.ts.map +1 -0
  321. package/dist/src/node/helpers/ArweaveClient.d.ts.map +1 -0
  322. package/dist/src/node/helpers/EasClient.d.ts.map +1 -0
  323. package/dist/src/node/helpers/FileManager.d.ts +27 -0
  324. package/dist/src/node/helpers/FileManager.d.ts.map +1 -0
  325. package/dist/src/node/helpers/PathResolver.d.ts.map +1 -0
  326. package/dist/src/node/helpers/QueryClient.d.ts.map +1 -0
  327. package/dist/src/node/helpers/index.d.ts.map +1 -0
  328. package/dist/src/node/helpers/scripts.d.ts.map +1 -0
  329. package/dist/src/node/index.d.ts.map +1 -0
  330. package/dist/src/node/seed.d.ts.map +1 -0
  331. package/dist/src/node/webpack/fs-proxy.d.ts.map +1 -0
  332. package/dist/src/node/webpack/index.d.ts.map +1 -0
  333. package/dist/src/seedSchema/AppStateSchema.d.ts.map +1 -0
  334. package/dist/src/seedSchema/ConfigSchema.d.ts.map +1 -0
  335. package/dist/src/seedSchema/MetadataSchema.d.ts.map +1 -0
  336. package/dist/src/seedSchema/ModelSchema.d.ts.map +1 -0
  337. package/dist/src/seedSchema/ModelSchemaSchema.d.ts.map +1 -0
  338. package/dist/src/seedSchema/ModelUidSchema.d.ts.map +1 -0
  339. package/dist/src/seedSchema/PropertyUidSchema.d.ts.map +1 -0
  340. package/dist/src/seedSchema/SchemaSchema.d.ts.map +1 -0
  341. package/dist/src/seedSchema/SeedSchema.d.ts.map +1 -0
  342. package/dist/src/seedSchema/VersionSchema.d.ts.map +1 -0
  343. package/dist/src/seedSchema/index.d.ts.map +1 -0
  344. package/dist/src/services/events.d.ts.map +1 -0
  345. package/dist/src/services/publish/actors/createPublishAttempt.d.ts.map +1 -0
  346. package/dist/src/services/publish/actors/preparePublishRequestData.d.ts.map +1 -0
  347. package/dist/src/services/publish/actors/upload.d.ts.map +1 -0
  348. package/dist/src/services/publish/actors/validateItemData.d.ts.map +1 -0
  349. package/dist/src/services/publish/publishMachine.d.ts.map +1 -0
  350. package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -0
  351. package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -0
  352. package/dist/src/services/write/writeProcessMachine.d.ts.map +1 -0
  353. package/dist/src/stores/eas.d.ts +20 -0
  354. package/dist/src/stores/eas.d.ts.map +1 -0
  355. package/dist/src/types/arweave.d.ts.map +1 -0
  356. package/dist/src/types/browser.d.ts.map +1 -0
  357. package/dist/src/types/db.d.ts.map +1 -0
  358. package/dist/src/types/fileManager.d.ts.map +1 -0
  359. package/dist/src/types/helpers.d.ts.map +1 -0
  360. package/dist/src/types/import.d.ts.map +1 -0
  361. package/dist/src/types/index.d.ts +66 -0
  362. package/dist/src/types/index.d.ts.map +1 -0
  363. package/dist/src/types/item.d.ts.map +1 -0
  364. package/dist/src/types/machines.d.ts +53 -0
  365. package/dist/src/types/machines.d.ts.map +1 -0
  366. package/dist/src/types/model.d.ts.map +1 -0
  367. package/dist/src/types/property.d.ts.map +1 -0
  368. package/dist/src/types/publish.d.ts.map +1 -0
  369. package/dist/src/types/seedProtocol.d.ts.map +1 -0
  370. package/dist/src/types/services.d.ts.map +1 -0
  371. package/dist/src/vite/easFix.d.ts.map +1 -0
  372. package/dist/src/vite/index.d.ts.map +1 -0
  373. package/dist/vite.cjs +0 -5
  374. package/dist/vite.cjs.map +1 -1
  375. package/dist/vite.js +0 -5
  376. package/dist/vite.js.map +1 -1
  377. package/package.json +18 -104
  378. package/README.md +0 -67
  379. package/dist/ArweaveClient-BdQaTOZ4.js +0 -202
  380. package/dist/ArweaveClient-BdQaTOZ4.js.map +0 -1
  381. package/dist/ArweaveClient-nrTU_rhU.js +0 -202
  382. package/dist/ArweaveClient-nrTU_rhU.js.map +0 -1
  383. package/dist/Db-CWKaeNQH.js +0 -246
  384. package/dist/Db-CWKaeNQH.js.map +0 -1
  385. package/dist/Db-Cq4q88X_.js +0 -1530
  386. package/dist/Db-Cq4q88X_.js.map +0 -1
  387. package/dist/EasClient-Du9_TULE.js +0 -29
  388. package/dist/EasClient-Du9_TULE.js.map +0 -1
  389. package/dist/EasClient-ZCIE6UQq.js +0 -29
  390. package/dist/EasClient-ZCIE6UQq.js.map +0 -1
  391. package/dist/FileManager-Cub9icdd.js +0 -1153
  392. package/dist/FileManager-Cub9icdd.js.map +0 -1
  393. package/dist/FileManager-HSFEess-.js +0 -165
  394. package/dist/FileManager-HSFEess-.js.map +0 -1
  395. package/dist/Item/Item.d.ts +0 -136
  396. package/dist/Item/Item.d.ts.map +0 -1
  397. package/dist/Item/queries.d.ts.map +0 -1
  398. package/dist/Item/service/actors/fetchDataFromEas.d.ts.map +0 -1
  399. package/dist/Item/service/actors/hydrateExistingItem.d.ts.map +0 -1
  400. package/dist/Item/service/actors/hydrateNewItem.d.ts.map +0 -1
  401. package/dist/Item/service/actors/initialize.d.ts.map +0 -1
  402. package/dist/Item/service/actors/loadOrCreateItem.d.ts.map +0 -1
  403. package/dist/Item/service/actors/reload.d.ts.map +0 -1
  404. package/dist/Item/service/actors/runPublish.d.ts.map +0 -1
  405. package/dist/Item/service/actors/saveDataToDb.d.ts.map +0 -1
  406. package/dist/Item/service/actors/waitForDb.d.ts.map +0 -1
  407. package/dist/Item/service/itemMachineSingle.d.ts.map +0 -1
  408. package/dist/ItemProperty/ItemProperty.d.ts +0 -118
  409. package/dist/ItemProperty/ItemProperty.d.ts.map +0 -1
  410. package/dist/ItemProperty/service/actors/hydrateFromDb.d.ts.map +0 -1
  411. package/dist/ItemProperty/service/actors/initialize.d.ts.map +0 -1
  412. package/dist/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +0 -1
  413. package/dist/ItemProperty/service/actors/resolveRelatedValue.d.ts.map +0 -1
  414. package/dist/ItemProperty/service/actors/resolveRemoteStorage.d.ts.map +0 -1
  415. package/dist/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +0 -1
  416. package/dist/ItemProperty/service/actors/saveValueToDb/index.d.ts +0 -5
  417. package/dist/ItemProperty/service/actors/saveValueToDb/index.d.ts.map +0 -1
  418. package/dist/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +0 -1
  419. package/dist/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +0 -1
  420. package/dist/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts.map +0 -1
  421. package/dist/ItemProperty/service/actors/waitForDb.d.ts.map +0 -1
  422. package/dist/ItemProperty/service/propertyMachine.d.ts +0 -68
  423. package/dist/ItemProperty/service/propertyMachine.d.ts.map +0 -1
  424. package/dist/Model/Model.d.ts.map +0 -1
  425. package/dist/Model/index.d.ts.map +0 -1
  426. package/dist/Model/service/actors/createModelProperties.d.ts.map +0 -1
  427. package/dist/Model/service/actors/loadOrCreateModel.d.ts.map +0 -1
  428. package/dist/Model/service/actors/validateModel.d.ts.map +0 -1
  429. package/dist/Model/service/modelMachine.d.ts +0 -222
  430. package/dist/Model/service/modelMachine.d.ts.map +0 -1
  431. package/dist/ModelProperty/ModelProperty.d.ts +0 -146
  432. package/dist/ModelProperty/ModelProperty.d.ts.map +0 -1
  433. package/dist/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +0 -1
  434. package/dist/ModelProperty/service/actors/saveToSchema.d.ts.map +0 -1
  435. package/dist/ModelProperty/service/actors/validateProperty.d.ts.map +0 -1
  436. package/dist/ModelProperty/service/modelPropertyMachine.d.ts.map +0 -1
  437. package/dist/ModelProperty-D4zaeIOT.js +0 -1784
  438. package/dist/ModelProperty-D4zaeIOT.js.map +0 -1
  439. package/dist/PathResolver-DVLBs_qi.js +0 -191
  440. package/dist/PathResolver-DVLBs_qi.js.map +0 -1
  441. package/dist/PathResolver-T1yEDECb.js +0 -78
  442. package/dist/PathResolver-T1yEDECb.js.map +0 -1
  443. package/dist/QueryClient-DcKDQuwz.js +0 -34
  444. package/dist/QueryClient-DcKDQuwz.js.map +0 -1
  445. package/dist/QueryClient-Vs9KN5kS.js +0 -47
  446. package/dist/QueryClient-Vs9KN5kS.js.map +0 -1
  447. package/dist/Schema/Schema.d.ts.map +0 -1
  448. package/dist/Schema/errors.d.ts.map +0 -1
  449. package/dist/Schema/index.d.ts.map +0 -1
  450. package/dist/Schema/service/actors/checkExistingSchema.d.ts.map +0 -1
  451. package/dist/Schema/service/actors/createModelInstances.d.ts.map +0 -1
  452. package/dist/Schema/service/actors/createPropertyInstances.d.ts.map +0 -1
  453. package/dist/Schema/service/actors/loadOrCreateSchema.d.ts.map +0 -1
  454. package/dist/Schema/service/actors/validateSchema.d.ts.map +0 -1
  455. package/dist/Schema/service/actors/verifyModelInstancesInCache.d.ts.map +0 -1
  456. package/dist/Schema/service/actors/verifyModelsInDb.d.ts.map +0 -1
  457. package/dist/Schema/service/actors/verifyPropertiesInDb.d.ts.map +0 -1
  458. package/dist/Schema/service/actors/verifyPropertyInstancesInCache.d.ts.map +0 -1
  459. package/dist/Schema/service/actors/verifySchemaInDb.d.ts.map +0 -1
  460. package/dist/Schema/service/actors/writeModelsToDb.d.ts.map +0 -1
  461. package/dist/Schema/service/actors/writePropertiesToDb.d.ts.map +0 -1
  462. package/dist/Schema/service/actors/writeSchemaToDb.d.ts.map +0 -1
  463. package/dist/Schema/service/addModelsMachine.d.ts +0 -123
  464. package/dist/Schema/service/addModelsMachine.d.ts.map +0 -1
  465. package/dist/Schema/service/schemaMachine.d.ts +0 -526
  466. package/dist/Schema/service/schemaMachine.d.ts.map +0 -1
  467. package/dist/Schema/service/validation/SchemaValidationService.d.ts.map +0 -1
  468. package/dist/Schema/validation.d.ts.map +0 -1
  469. package/dist/Schema-SbwqmoMM.js +0 -6593
  470. package/dist/Schema-SbwqmoMM.js.map +0 -1
  471. package/dist/SchemaValidationService-DHGIw4Nx.js +0 -563
  472. package/dist/SchemaValidationService-DHGIw4Nx.js.map +0 -1
  473. package/dist/browser/db/Db.d.ts.map +0 -1
  474. package/dist/browser/db/drizzleFiles.d.ts.map +0 -1
  475. package/dist/browser/db/sqlWasmClient.d.ts.map +0 -1
  476. package/dist/browser/helpers/ArweaveClient.d.ts.map +0 -1
  477. package/dist/browser/helpers/EasClient.d.ts.map +0 -1
  478. package/dist/browser/helpers/FileManager.d.ts +0 -41
  479. package/dist/browser/helpers/FileManager.d.ts.map +0 -1
  480. package/dist/browser/helpers/PathResolver.d.ts.map +0 -1
  481. package/dist/browser/helpers/QueryClient.d.ts.map +0 -1
  482. package/dist/browser/helpers/index.d.ts.map +0 -1
  483. package/dist/browser/index.d.ts.map +0 -1
  484. package/dist/browser/react/OPFSImage.d.ts.map +0 -1
  485. package/dist/browser/react/SeedImage.d.ts.map +0 -1
  486. package/dist/browser/react/SeedProvider.d.ts.map +0 -1
  487. package/dist/browser/react/client.d.ts.map +0 -1
  488. package/dist/browser/react/db.d.ts.map +0 -1
  489. package/dist/browser/react/index.d.ts +0 -13
  490. package/dist/browser/react/index.d.ts.map +0 -1
  491. package/dist/browser/react/item.d.ts.map +0 -1
  492. package/dist/browser/react/itemProperty.d.ts.map +0 -1
  493. package/dist/browser/react/liveQuery.d.ts.map +0 -1
  494. package/dist/browser/react/model.d.ts.map +0 -1
  495. package/dist/browser/react/modelProperty.d.ts.map +0 -1
  496. package/dist/browser/react/queryClient.d.ts.map +0 -1
  497. package/dist/browser/react/schema.d.ts.map +0 -1
  498. package/dist/browser/react/services.d.ts.map +0 -1
  499. package/dist/browser/react/trash.d.ts.map +0 -1
  500. package/dist/browser/seed.d.ts.map +0 -1
  501. package/dist/browser/workers/FileDownloader.d.ts.map +0 -1
  502. package/dist/browser/workers/ImageResizer.d.ts.map +0 -1
  503. package/dist/browser/workers/content-hash.d.ts.map +0 -1
  504. package/dist/browser/workers/dbWorker.d.ts.map +0 -1
  505. package/dist/browser/workers/filesDownload.d.ts.map +0 -1
  506. package/dist/browser/workers/imageResize.d.ts.map +0 -1
  507. package/dist/cjs/ModelProperty-DpjD0o0E.js +0 -1780
  508. package/dist/cjs/ModelProperty-DpjD0o0E.js.map +0 -1
  509. package/dist/cjs/Schema-DkSBMBwz.js +0 -6217
  510. package/dist/cjs/Schema-DkSBMBwz.js.map +0 -1
  511. package/dist/cjs/SchemaValidationService-O3FCMROl.js +0 -579
  512. package/dist/cjs/SchemaValidationService-O3FCMROl.js.map +0 -1
  513. package/dist/cjs/getItem-BeAVMk54.js +0 -55
  514. package/dist/cjs/getItem-BeAVMk54.js.map +0 -1
  515. package/dist/cjs/getPublishPayload-CoLriAMV.js +0 -340
  516. package/dist/cjs/getPublishPayload-CoLriAMV.js.map +0 -1
  517. package/dist/cjs/getPublishUploads-DDsT9zZ6.js +0 -229
  518. package/dist/cjs/getPublishUploads-DDsT9zZ6.js.map +0 -1
  519. package/dist/cjs/getSegmentedItemProperties-DGR0utR5.js +0 -61
  520. package/dist/cjs/getSegmentedItemProperties-DGR0utR5.js.map +0 -1
  521. package/dist/cjs/index-B95Ng80C.js +0 -16950
  522. package/dist/cjs/index-B95Ng80C.js.map +0 -1
  523. package/dist/cjs/index-CvcOtzbi.js +0 -57
  524. package/dist/cjs/index-CvcOtzbi.js.map +0 -1
  525. package/dist/cjs/ownership-Dm5ER1nI.js +0 -103
  526. package/dist/cjs/ownership-Dm5ER1nI.js.map +0 -1
  527. package/dist/client/BaseClientManager.d.ts.map +0 -1
  528. package/dist/client/ClientManager.d.ts.map +0 -1
  529. package/dist/client/actions/setAddresses.d.ts.map +0 -1
  530. package/dist/client/actors/addModelsToDb.d.ts.map +0 -1
  531. package/dist/client/actors/addModelsToStore.d.ts.map +0 -1
  532. package/dist/client/actors/dbInit.d.ts.map +0 -1
  533. package/dist/client/actors/fileSystemInit.d.ts.map +0 -1
  534. package/dist/client/actors/platformClassesInit.d.ts.map +0 -1
  535. package/dist/client/actors/processSchemaFiles.d.ts.map +0 -1
  536. package/dist/client/actors/saveAppState.d.ts.map +0 -1
  537. package/dist/client/actors/saveConfig.d.ts.map +0 -1
  538. package/dist/client/clientManagerMachine.d.ts.map +0 -1
  539. package/dist/client/constants.d.ts.map +0 -1
  540. package/dist/client/index.d.ts.map +0 -1
  541. package/dist/db/Db/BaseDb.d.ts.map +0 -1
  542. package/dist/db/configs/dev.schema.config.d.ts.map +0 -1
  543. package/dist/db/read/getExistingItem.d.ts.map +0 -1
  544. package/dist/db/read/getItem.d.ts.map +0 -1
  545. package/dist/db/read/getItemData.d.ts.map +0 -1
  546. package/dist/db/read/getItemProperties.d.ts.map +0 -1
  547. package/dist/db/read/getItemProperty.d.ts.map +0 -1
  548. package/dist/db/read/getItems.d.ts.map +0 -1
  549. package/dist/db/read/getMetadata.d.ts.map +0 -1
  550. package/dist/db/read/getModelPropertiesData.d.ts.map +0 -1
  551. package/dist/db/read/getModelSchemas.d.ts.map +0 -1
  552. package/dist/db/read/getModels.d.ts.map +0 -1
  553. package/dist/db/read/getModelsData.d.ts.map +0 -1
  554. package/dist/db/read/getPropertyData.d.ts.map +0 -1
  555. package/dist/db/read/getPublishPayload.d.ts +0 -23
  556. package/dist/db/read/getPublishPayload.d.ts.map +0 -1
  557. package/dist/db/read/getPublishUploads.d.ts +0 -10
  558. package/dist/db/read/getPublishUploads.d.ts.map +0 -1
  559. package/dist/db/read/getRelationValueData.d.ts.map +0 -1
  560. package/dist/db/read/getSchemaUidForModel.d.ts +0 -2
  561. package/dist/db/read/getSchemaUidForModel.d.ts.map +0 -1
  562. package/dist/db/read/getSeedData.d.ts.map +0 -1
  563. package/dist/db/read/getStorageTransactionIdForSeedUid.d.ts.map +0 -1
  564. package/dist/db/read/getVersionData.d.ts.map +0 -1
  565. package/dist/db/read/getVersionsForVersionUids.d.ts.map +0 -1
  566. package/dist/db/read/subqueries/metadataLatest.d.ts.map +0 -1
  567. package/dist/db/read/subqueries/versionData.d.ts.map +0 -1
  568. package/dist/db/write/createMetadata.d.ts.map +0 -1
  569. package/dist/db/write/createNewItem.d.ts.map +0 -1
  570. package/dist/db/write/createSeed.d.ts.map +0 -1
  571. package/dist/db/write/createSeeds.d.ts.map +0 -1
  572. package/dist/db/write/createVersion.d.ts.map +0 -1
  573. package/dist/db/write/deleteItem.d.ts.map +0 -1
  574. package/dist/db/write/recoverDeletedItem.d.ts.map +0 -1
  575. package/dist/db/write/saveAppState.d.ts.map +0 -1
  576. package/dist/db/write/saveMetadata.d.ts.map +0 -1
  577. package/dist/db/write/updateItemPropertyValue.d.ts.map +0 -1
  578. package/dist/db/write/updateMetadata.d.ts.map +0 -1
  579. package/dist/db/write/updateSeedUid.d.ts.map +0 -1
  580. package/dist/eas.d.ts +0 -26
  581. package/dist/eas.d.ts.map +0 -1
  582. package/dist/eslint-rules/align-imports.d.ts.map +0 -1
  583. package/dist/eventBus.d.ts.map +0 -1
  584. package/dist/events/files/download.d.ts.map +0 -1
  585. package/dist/events/files/index.d.ts.map +0 -1
  586. package/dist/events/index.d.ts.map +0 -1
  587. package/dist/events/item/index.d.ts.map +0 -1
  588. package/dist/events/item/syncDbWithEas.d.ts.map +0 -1
  589. package/dist/events/services/allItems.d.ts.map +0 -1
  590. package/dist/events/services/index.d.ts.map +0 -1
  591. package/dist/feed.d.ts +0 -2
  592. package/dist/feed.d.ts.map +0 -1
  593. package/dist/getItem-CqrJt-Ee.js +0 -38
  594. package/dist/getItem-CqrJt-Ee.js.map +0 -1
  595. package/dist/getPublishPayload-BRgULCf3.js +0 -324
  596. package/dist/getPublishPayload-BRgULCf3.js.map +0 -1
  597. package/dist/getPublishUploads-B0WArDfp.js +0 -193
  598. package/dist/getPublishUploads-B0WArDfp.js.map +0 -1
  599. package/dist/getSegmentedItemProperties-DZL9Ymd4.js +0 -59
  600. package/dist/getSegmentedItemProperties-DZL9Ymd4.js.map +0 -1
  601. package/dist/graphql/fragments/Attestation.d.ts.map +0 -1
  602. package/dist/graphql/fragments/Schema.d.ts.map +0 -1
  603. package/dist/graphql/fragments/index.d.ts.map +0 -1
  604. package/dist/graphql/gql/fragment-masking.d.ts.map +0 -1
  605. package/dist/graphql/gql/gql.d.ts.map +0 -1
  606. package/dist/graphql/gql/graphql.d.ts.map +0 -1
  607. package/dist/graphql/gql/index.d.ts.map +0 -1
  608. package/dist/helpers/ArweaveClient/BaseArweaveClient.d.ts.map +0 -1
  609. package/dist/helpers/ArweaveClient/index.d.ts.map +0 -1
  610. package/dist/helpers/ArweaveClient/queries.d.ts.map +0 -1
  611. package/dist/helpers/EasClient/BaseEasClient.d.ts.map +0 -1
  612. package/dist/helpers/FileManager/BaseFileManager.d.ts +0 -29
  613. package/dist/helpers/FileManager/BaseFileManager.d.ts.map +0 -1
  614. package/dist/helpers/PathResolver/BasePathResolver.d.ts.map +0 -1
  615. package/dist/helpers/QueryClient/BaseQueryClient.d.ts.map +0 -1
  616. package/dist/helpers/addresses.d.ts.map +0 -1
  617. package/dist/helpers/constants.d.ts +0 -67
  618. package/dist/helpers/constants.d.ts.map +0 -1
  619. package/dist/helpers/crypto.d.ts.map +0 -1
  620. package/dist/helpers/db.d.ts +0 -142
  621. package/dist/helpers/db.d.ts.map +0 -1
  622. package/dist/helpers/entity/entityCache.d.ts.map +0 -1
  623. package/dist/helpers/entity/entityCommon.d.ts.map +0 -1
  624. package/dist/helpers/entity/entityDestroy.d.ts.map +0 -1
  625. package/dist/helpers/entity/entityFind.d.ts.map +0 -1
  626. package/dist/helpers/entity/entityLiveQuery.d.ts.map +0 -1
  627. package/dist/helpers/entity/entityUnload.d.ts +0 -50
  628. package/dist/helpers/entity/entityUnload.d.ts.map +0 -1
  629. package/dist/helpers/entity/index.d.ts.map +0 -1
  630. package/dist/helpers/environment.d.ts.map +0 -1
  631. package/dist/helpers/file/download/actors.d.ts.map +0 -1
  632. package/dist/helpers/file/download/index.d.ts.map +0 -1
  633. package/dist/helpers/file/fetchAll/actors.d.ts.map +0 -1
  634. package/dist/helpers/file/fetchAll/index.d.ts.map +0 -1
  635. package/dist/helpers/file/queries.d.ts.map +0 -1
  636. package/dist/helpers/files.d.ts.map +0 -1
  637. package/dist/helpers/getSchemaForItemProperty.d.ts +0 -15
  638. package/dist/helpers/getSchemaForItemProperty.d.ts.map +0 -1
  639. package/dist/helpers/getSegmentedItemProperties.d.ts.map +0 -1
  640. package/dist/helpers/image/queries.d.ts.map +0 -1
  641. package/dist/helpers/index.d.ts +0 -29
  642. package/dist/helpers/index.d.ts.map +0 -1
  643. package/dist/helpers/model.d.ts.map +0 -1
  644. package/dist/helpers/ownership.d.ts.map +0 -1
  645. package/dist/helpers/property/index.d.ts +0 -298
  646. package/dist/helpers/property/index.d.ts.map +0 -1
  647. package/dist/helpers/property.d.ts.map +0 -1
  648. package/dist/helpers/reactiveProxy.d.ts.map +0 -1
  649. package/dist/helpers/schema.d.ts.map +0 -1
  650. package/dist/helpers/updateMachineContext.d.ts.map +0 -1
  651. package/dist/helpers/updateSchema.d.ts +0 -118
  652. package/dist/helpers/updateSchema.d.ts.map +0 -1
  653. package/dist/helpers/waitForEntityIdle.d.ts.map +0 -1
  654. package/dist/imports/index.d.ts.map +0 -1
  655. package/dist/imports/json.d.ts.map +0 -1
  656. package/dist/imports/markdown.d.ts +0 -38
  657. package/dist/imports/markdown.d.ts.map +0 -1
  658. package/dist/index-BIPPEMVY.js +0 -23
  659. package/dist/index-BIPPEMVY.js.map +0 -1
  660. package/dist/index-BnF3MRZ8.js +0 -18
  661. package/dist/index-BnF3MRZ8.js.map +0 -1
  662. package/dist/index-zsq08F5p.js +0 -15670
  663. package/dist/index-zsq08F5p.js.map +0 -1
  664. package/dist/index.d.ts +0 -22
  665. package/dist/index.d.ts.map +0 -1
  666. package/dist/interfaces/IDb.d.ts.map +0 -1
  667. package/dist/interfaces/IEasClient.d.ts.map +0 -1
  668. package/dist/interfaces/IItem.d.ts.map +0 -1
  669. package/dist/interfaces/IItemProperty.d.ts.map +0 -1
  670. package/dist/interfaces/IQueryClient.d.ts.map +0 -1
  671. package/dist/interfaces/index.d.ts.map +0 -1
  672. package/dist/node/codegen/drizzle.d.ts.map +0 -1
  673. package/dist/node/codegen/index.d.ts.map +0 -1
  674. package/dist/node/codegen/ts-to-proto.d.ts.map +0 -1
  675. package/dist/node/constants.d.ts.map +0 -1
  676. package/dist/node/db/Db.d.ts.map +0 -1
  677. package/dist/node/db/index.d.ts.map +0 -1
  678. package/dist/node/db/node.app.db.config.d.ts.map +0 -1
  679. package/dist/node/helpers/ArweaveClient.d.ts.map +0 -1
  680. package/dist/node/helpers/EasClient.d.ts.map +0 -1
  681. package/dist/node/helpers/FileManager.d.ts +0 -26
  682. package/dist/node/helpers/FileManager.d.ts.map +0 -1
  683. package/dist/node/helpers/PathResolver.d.ts.map +0 -1
  684. package/dist/node/helpers/QueryClient.d.ts.map +0 -1
  685. package/dist/node/helpers/index.d.ts.map +0 -1
  686. package/dist/node/helpers/scripts.d.ts.map +0 -1
  687. package/dist/node/index.d.ts.map +0 -1
  688. package/dist/node/seed.d.ts.map +0 -1
  689. package/dist/node/webpack/fs-proxy.d.ts.map +0 -1
  690. package/dist/node/webpack/index.d.ts.map +0 -1
  691. package/dist/ownership-CSsweVap.js +0 -85
  692. package/dist/ownership-CSsweVap.js.map +0 -1
  693. package/dist/property-Cqh_o0zx.js +0 -282
  694. package/dist/property-Cqh_o0zx.js.map +0 -1
  695. package/dist/queries-DSBgjcJJ.js +0 -16
  696. package/dist/queries-DSBgjcJJ.js.map +0 -1
  697. package/dist/seedSchema/AppStateSchema.d.ts.map +0 -1
  698. package/dist/seedSchema/ConfigSchema.d.ts.map +0 -1
  699. package/dist/seedSchema/MetadataSchema.d.ts.map +0 -1
  700. package/dist/seedSchema/ModelSchema.d.ts.map +0 -1
  701. package/dist/seedSchema/ModelSchemaSchema.d.ts.map +0 -1
  702. package/dist/seedSchema/ModelUidSchema.d.ts.map +0 -1
  703. package/dist/seedSchema/PropertyUidSchema.d.ts.map +0 -1
  704. package/dist/seedSchema/SchemaSchema.d.ts.map +0 -1
  705. package/dist/seedSchema/SeedSchema.d.ts.map +0 -1
  706. package/dist/seedSchema/VersionSchema.d.ts.map +0 -1
  707. package/dist/seedSchema/index.d.ts.map +0 -1
  708. package/dist/services/events.d.ts.map +0 -1
  709. package/dist/services/publish/actors/createPublishAttempt.d.ts.map +0 -1
  710. package/dist/services/publish/actors/preparePublishRequestData.d.ts.map +0 -1
  711. package/dist/services/publish/actors/upload.d.ts.map +0 -1
  712. package/dist/services/publish/actors/validateItemData.d.ts.map +0 -1
  713. package/dist/services/publish/publishMachine.d.ts.map +0 -1
  714. package/dist/services/write/actors/validateEntity.d.ts.map +0 -1
  715. package/dist/services/write/actors/writeToDatabase.d.ts.map +0 -1
  716. package/dist/services/write/writeProcessMachine.d.ts.map +0 -1
  717. package/dist/stores/eas.d.ts +0 -14
  718. package/dist/stores/eas.d.ts.map +0 -1
  719. package/dist/types/arweave.d.ts.map +0 -1
  720. package/dist/types/browser.d.ts.map +0 -1
  721. package/dist/types/db.d.ts.map +0 -1
  722. package/dist/types/fileManager.d.ts.map +0 -1
  723. package/dist/types/helpers.d.ts.map +0 -1
  724. package/dist/types/import.d.ts.map +0 -1
  725. package/dist/types/index.d.ts +0 -64
  726. package/dist/types/index.d.ts.map +0 -1
  727. package/dist/types/item.d.ts.map +0 -1
  728. package/dist/types/machines.d.ts +0 -52
  729. package/dist/types/machines.d.ts.map +0 -1
  730. package/dist/types/model.d.ts.map +0 -1
  731. package/dist/types/property.d.ts.map +0 -1
  732. package/dist/types/publish.d.ts.map +0 -1
  733. package/dist/types/seedProtocol.d.ts.map +0 -1
  734. package/dist/types/services.d.ts.map +0 -1
  735. package/dist/vite/easFix.d.ts.map +0 -1
  736. package/dist/vite/index.d.ts.map +0 -1
  737. /package/dist/{Item → src/Item}/queries.d.ts +0 -0
  738. /package/dist/{Item → src/Item}/service/actors/fetchDataFromEas.d.ts +0 -0
  739. /package/dist/{Item → src/Item}/service/actors/hydrateExistingItem.d.ts +0 -0
  740. /package/dist/{Item → src/Item}/service/actors/hydrateNewItem.d.ts +0 -0
  741. /package/dist/{Item → src/Item}/service/actors/initialize.d.ts +0 -0
  742. /package/dist/{Item → src/Item}/service/actors/loadOrCreateItem.d.ts +0 -0
  743. /package/dist/{Item → src/Item}/service/actors/reload.d.ts +0 -0
  744. /package/dist/{Item → src/Item}/service/actors/runPublish.d.ts +0 -0
  745. /package/dist/{Item → src/Item}/service/actors/saveDataToDb.d.ts +0 -0
  746. /package/dist/{Item → src/Item}/service/actors/waitForDb.d.ts +0 -0
  747. /package/dist/{Item → src/Item}/service/itemMachineSingle.d.ts +0 -0
  748. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/hydrateFromDb.d.ts +0 -0
  749. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/initialize.d.ts +0 -0
  750. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/loadOrCreateProperty.d.ts +0 -0
  751. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/resolveRelatedValue.d.ts +0 -0
  752. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/resolveRemoteStorage.d.ts +0 -0
  753. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/saveValueToDb/analyzeInput.d.ts +0 -0
  754. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/saveValueToDb/saveImage.d.ts +0 -0
  755. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/saveValueToDb/saveItemStorage.d.ts +0 -0
  756. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/saveValueToDb/saveRelation.d.ts +0 -0
  757. /package/dist/{ItemProperty → src/ItemProperty}/service/actors/waitForDb.d.ts +0 -0
  758. /package/dist/{Model → src/Model}/Model.d.ts +0 -0
  759. /package/dist/{Model → src/Model}/index.d.ts +0 -0
  760. /package/dist/{Model → src/Model}/service/actors/createModelProperties.d.ts +0 -0
  761. /package/dist/{Model → src/Model}/service/actors/loadOrCreateModel.d.ts +0 -0
  762. /package/dist/{Model → src/Model}/service/actors/validateModel.d.ts +0 -0
  763. /package/dist/{ModelProperty → src/ModelProperty}/service/actors/compareAndMarkDraft.d.ts +0 -0
  764. /package/dist/{ModelProperty → src/ModelProperty}/service/actors/saveToSchema.d.ts +0 -0
  765. /package/dist/{ModelProperty → src/ModelProperty}/service/actors/validateProperty.d.ts +0 -0
  766. /package/dist/{ModelProperty → src/ModelProperty}/service/modelPropertyMachine.d.ts +0 -0
  767. /package/dist/{Schema → src/Schema}/Schema.d.ts +0 -0
  768. /package/dist/{Schema → src/Schema}/errors.d.ts +0 -0
  769. /package/dist/{Schema → src/Schema}/index.d.ts +0 -0
  770. /package/dist/{Schema → src/Schema}/service/actors/checkExistingSchema.d.ts +0 -0
  771. /package/dist/{Schema → src/Schema}/service/actors/createModelInstances.d.ts +0 -0
  772. /package/dist/{Schema → src/Schema}/service/actors/createPropertyInstances.d.ts +0 -0
  773. /package/dist/{Schema → src/Schema}/service/actors/loadOrCreateSchema.d.ts +0 -0
  774. /package/dist/{Schema → src/Schema}/service/actors/validateSchema.d.ts +0 -0
  775. /package/dist/{Schema → src/Schema}/service/actors/verifyModelInstancesInCache.d.ts +0 -0
  776. /package/dist/{Schema → src/Schema}/service/actors/verifyModelsInDb.d.ts +0 -0
  777. /package/dist/{Schema → src/Schema}/service/actors/verifyPropertiesInDb.d.ts +0 -0
  778. /package/dist/{Schema → src/Schema}/service/actors/verifyPropertyInstancesInCache.d.ts +0 -0
  779. /package/dist/{Schema → src/Schema}/service/actors/verifySchemaInDb.d.ts +0 -0
  780. /package/dist/{Schema → src/Schema}/service/actors/writeModelsToDb.d.ts +0 -0
  781. /package/dist/{Schema → src/Schema}/service/actors/writePropertiesToDb.d.ts +0 -0
  782. /package/dist/{Schema → src/Schema}/service/actors/writeSchemaToDb.d.ts +0 -0
  783. /package/dist/{Schema → src/Schema}/service/validation/SchemaValidationService.d.ts +0 -0
  784. /package/dist/{Schema → src/Schema}/validation.d.ts +0 -0
  785. /package/dist/{browser → src/browser}/db/Db.d.ts +0 -0
  786. /package/dist/{browser → src/browser}/db/drizzleFiles.d.ts +0 -0
  787. /package/dist/{browser → src/browser}/db/sqlWasmClient.d.ts +0 -0
  788. /package/dist/{browser → src/browser}/helpers/ArweaveClient.d.ts +0 -0
  789. /package/dist/{browser → src/browser}/helpers/EasClient.d.ts +0 -0
  790. /package/dist/{browser → src/browser}/helpers/PathResolver.d.ts +0 -0
  791. /package/dist/{browser → src/browser}/helpers/QueryClient.d.ts +0 -0
  792. /package/dist/{browser → src/browser}/helpers/index.d.ts +0 -0
  793. /package/dist/{browser → src/browser}/index.d.ts +0 -0
  794. /package/dist/{browser → src/browser}/react/OPFSImage.d.ts +0 -0
  795. /package/dist/{browser → src/browser}/react/SeedImage.d.ts +0 -0
  796. /package/dist/{browser → src/browser}/react/SeedProvider.d.ts +0 -0
  797. /package/dist/{browser → src/browser}/react/client.d.ts +0 -0
  798. /package/dist/{browser → src/browser}/react/db.d.ts +0 -0
  799. /package/dist/{browser → src/browser}/react/item.d.ts +0 -0
  800. /package/dist/{browser → src/browser}/react/itemProperty.d.ts +0 -0
  801. /package/dist/{browser → src/browser}/react/liveQuery.d.ts +0 -0
  802. /package/dist/{browser → src/browser}/react/model.d.ts +0 -0
  803. /package/dist/{browser → src/browser}/react/modelProperty.d.ts +0 -0
  804. /package/dist/{browser → src/browser}/react/queryClient.d.ts +0 -0
  805. /package/dist/{browser → src/browser}/react/schema.d.ts +0 -0
  806. /package/dist/{browser → src/browser}/react/services.d.ts +0 -0
  807. /package/dist/{browser → src/browser}/react/trash.d.ts +0 -0
  808. /package/dist/{browser → src/browser}/seed.d.ts +0 -0
  809. /package/dist/{browser → src/browser}/workers/FileDownloader.d.ts +0 -0
  810. /package/dist/{browser → src/browser}/workers/ImageResizer.d.ts +0 -0
  811. /package/dist/{browser → src/browser}/workers/content-hash.d.ts +0 -0
  812. /package/dist/{browser → src/browser}/workers/dbWorker.d.ts +0 -0
  813. /package/dist/{browser → src/browser}/workers/filesDownload.d.ts +0 -0
  814. /package/dist/{browser → src/browser}/workers/imageResize.d.ts +0 -0
  815. /package/dist/{client → src/client}/BaseClientManager.d.ts +0 -0
  816. /package/dist/{client → src/client}/ClientManager.d.ts +0 -0
  817. /package/dist/{client → src/client}/actions/setAddresses.d.ts +0 -0
  818. /package/dist/{client → src/client}/actors/addModelsToDb.d.ts +0 -0
  819. /package/dist/{client → src/client}/actors/addModelsToStore.d.ts +0 -0
  820. /package/dist/{client → src/client}/actors/dbInit.d.ts +0 -0
  821. /package/dist/{client → src/client}/actors/fileSystemInit.d.ts +0 -0
  822. /package/dist/{client → src/client}/actors/platformClassesInit.d.ts +0 -0
  823. /package/dist/{client → src/client}/actors/processSchemaFiles.d.ts +0 -0
  824. /package/dist/{client → src/client}/actors/saveAppState.d.ts +0 -0
  825. /package/dist/{client → src/client}/actors/saveConfig.d.ts +0 -0
  826. /package/dist/{client → src/client}/clientManagerMachine.d.ts +0 -0
  827. /package/dist/{client → src/client}/constants.d.ts +0 -0
  828. /package/dist/{client → src/client}/index.d.ts +0 -0
  829. /package/dist/{db → src/db}/Db/BaseDb.d.ts +0 -0
  830. /package/dist/{db → src/db}/configs/dev.schema.config.d.ts +0 -0
  831. /package/dist/{db → src/db}/read/getExistingItem.d.ts +0 -0
  832. /package/dist/{db → src/db}/read/getItem.d.ts +0 -0
  833. /package/dist/{db → src/db}/read/getItemData.d.ts +0 -0
  834. /package/dist/{db → src/db}/read/getItemProperties.d.ts +0 -0
  835. /package/dist/{db → src/db}/read/getItemProperty.d.ts +0 -0
  836. /package/dist/{db → src/db}/read/getItems.d.ts +0 -0
  837. /package/dist/{db → src/db}/read/getMetadata.d.ts +0 -0
  838. /package/dist/{db → src/db}/read/getModelPropertiesData.d.ts +0 -0
  839. /package/dist/{db → src/db}/read/getModelSchemas.d.ts +0 -0
  840. /package/dist/{db → src/db}/read/getModels.d.ts +0 -0
  841. /package/dist/{db → src/db}/read/getModelsData.d.ts +0 -0
  842. /package/dist/{db → src/db}/read/getPropertyData.d.ts +0 -0
  843. /package/dist/{db → src/db}/read/getRelationValueData.d.ts +0 -0
  844. /package/dist/{db → src/db}/read/getSeedData.d.ts +0 -0
  845. /package/dist/{db → src/db}/read/getStorageTransactionIdForSeedUid.d.ts +0 -0
  846. /package/dist/{db → src/db}/read/getVersionData.d.ts +0 -0
  847. /package/dist/{db → src/db}/read/getVersionsForVersionUids.d.ts +0 -0
  848. /package/dist/{db → src/db}/read/subqueries/metadataLatest.d.ts +0 -0
  849. /package/dist/{db → src/db}/read/subqueries/versionData.d.ts +0 -0
  850. /package/dist/{db → src/db}/write/createMetadata.d.ts +0 -0
  851. /package/dist/{db → src/db}/write/createNewItem.d.ts +0 -0
  852. /package/dist/{db → src/db}/write/createSeed.d.ts +0 -0
  853. /package/dist/{db → src/db}/write/createSeeds.d.ts +0 -0
  854. /package/dist/{db → src/db}/write/createVersion.d.ts +0 -0
  855. /package/dist/{db → src/db}/write/deleteItem.d.ts +0 -0
  856. /package/dist/{db → src/db}/write/recoverDeletedItem.d.ts +0 -0
  857. /package/dist/{db → src/db}/write/saveAppState.d.ts +0 -0
  858. /package/dist/{db → src/db}/write/saveMetadata.d.ts +0 -0
  859. /package/dist/{db → src/db}/write/updateItemPropertyValue.d.ts +0 -0
  860. /package/dist/{db → src/db}/write/updateMetadata.d.ts +0 -0
  861. /package/dist/{db → src/db}/write/updateSeedUid.d.ts +0 -0
  862. /package/dist/{eslint-rules → src/eslint-rules}/align-imports.d.ts +0 -0
  863. /package/dist/{eventBus.d.ts → src/eventBus.d.ts} +0 -0
  864. /package/dist/{events → src/events}/files/download.d.ts +0 -0
  865. /package/dist/{events → src/events}/files/index.d.ts +0 -0
  866. /package/dist/{events → src/events}/index.d.ts +0 -0
  867. /package/dist/{events → src/events}/item/index.d.ts +0 -0
  868. /package/dist/{events → src/events}/item/syncDbWithEas.d.ts +0 -0
  869. /package/dist/{events → src/events}/services/allItems.d.ts +0 -0
  870. /package/dist/{events → src/events}/services/index.d.ts +0 -0
  871. /package/dist/{graphql → src/graphql}/fragments/Attestation.d.ts +0 -0
  872. /package/dist/{graphql → src/graphql}/fragments/Schema.d.ts +0 -0
  873. /package/dist/{graphql → src/graphql}/fragments/index.d.ts +0 -0
  874. /package/dist/{graphql → src/graphql}/gql/fragment-masking.d.ts +0 -0
  875. /package/dist/{graphql → src/graphql}/gql/gql.d.ts +0 -0
  876. /package/dist/{graphql → src/graphql}/gql/graphql.d.ts +0 -0
  877. /package/dist/{graphql → src/graphql}/gql/index.d.ts +0 -0
  878. /package/dist/{helpers → src/helpers}/ArweaveClient/BaseArweaveClient.d.ts +0 -0
  879. /package/dist/{helpers → src/helpers}/ArweaveClient/index.d.ts +0 -0
  880. /package/dist/{helpers → src/helpers}/ArweaveClient/queries.d.ts +0 -0
  881. /package/dist/{helpers → src/helpers}/EasClient/BaseEasClient.d.ts +0 -0
  882. /package/dist/{helpers → src/helpers}/PathResolver/BasePathResolver.d.ts +0 -0
  883. /package/dist/{helpers → src/helpers}/QueryClient/BaseQueryClient.d.ts +0 -0
  884. /package/dist/{helpers → src/helpers}/addresses.d.ts +0 -0
  885. /package/dist/{helpers → src/helpers}/crypto.d.ts +0 -0
  886. /package/dist/{helpers → src/helpers}/entity/entityCache.d.ts +0 -0
  887. /package/dist/{helpers → src/helpers}/entity/entityCommon.d.ts +0 -0
  888. /package/dist/{helpers → src/helpers}/entity/entityDestroy.d.ts +0 -0
  889. /package/dist/{helpers → src/helpers}/entity/entityFind.d.ts +0 -0
  890. /package/dist/{helpers → src/helpers}/entity/entityLiveQuery.d.ts +0 -0
  891. /package/dist/{helpers → src/helpers}/entity/index.d.ts +0 -0
  892. /package/dist/{helpers → src/helpers}/environment.d.ts +0 -0
  893. /package/dist/{helpers → src/helpers}/file/download/actors.d.ts +0 -0
  894. /package/dist/{helpers → src/helpers}/file/download/index.d.ts +0 -0
  895. /package/dist/{helpers → src/helpers}/file/fetchAll/actors.d.ts +0 -0
  896. /package/dist/{helpers → src/helpers}/file/fetchAll/index.d.ts +0 -0
  897. /package/dist/{helpers → src/helpers}/file/queries.d.ts +0 -0
  898. /package/dist/{helpers → src/helpers}/files.d.ts +0 -0
  899. /package/dist/{helpers → src/helpers}/getSegmentedItemProperties.d.ts +0 -0
  900. /package/dist/{helpers → src/helpers}/image/queries.d.ts +0 -0
  901. /package/dist/{helpers → src/helpers}/model.d.ts +0 -0
  902. /package/dist/{helpers → src/helpers}/ownership.d.ts +0 -0
  903. /package/dist/{helpers → src/helpers}/property.d.ts +0 -0
  904. /package/dist/{helpers → src/helpers}/reactiveProxy.d.ts +0 -0
  905. /package/dist/{helpers → src/helpers}/schema.d.ts +0 -0
  906. /package/dist/{helpers → src/helpers}/updateMachineContext.d.ts +0 -0
  907. /package/dist/{helpers → src/helpers}/waitForEntityIdle.d.ts +0 -0
  908. /package/dist/{imports → src/imports}/index.d.ts +0 -0
  909. /package/dist/{imports → src/imports}/json.d.ts +0 -0
  910. /package/dist/{interfaces → src/interfaces}/IDb.d.ts +0 -0
  911. /package/dist/{interfaces → src/interfaces}/IEasClient.d.ts +0 -0
  912. /package/dist/{interfaces → src/interfaces}/IItem.d.ts +0 -0
  913. /package/dist/{interfaces → src/interfaces}/IItemProperty.d.ts +0 -0
  914. /package/dist/{interfaces → src/interfaces}/IQueryClient.d.ts +0 -0
  915. /package/dist/{interfaces → src/interfaces}/index.d.ts +0 -0
  916. /package/dist/{node → src/node}/codegen/drizzle.d.ts +0 -0
  917. /package/dist/{node → src/node}/codegen/index.d.ts +0 -0
  918. /package/dist/{node → src/node}/codegen/ts-to-proto.d.ts +0 -0
  919. /package/dist/{node → src/node}/constants.d.ts +0 -0
  920. /package/dist/{node → src/node}/db/Db.d.ts +0 -0
  921. /package/dist/{node → src/node}/db/index.d.ts +0 -0
  922. /package/dist/{node → src/node}/db/node.app.db.config.d.ts +0 -0
  923. /package/dist/{node → src/node}/helpers/ArweaveClient.d.ts +0 -0
  924. /package/dist/{node → src/node}/helpers/EasClient.d.ts +0 -0
  925. /package/dist/{node → src/node}/helpers/PathResolver.d.ts +0 -0
  926. /package/dist/{node → src/node}/helpers/QueryClient.d.ts +0 -0
  927. /package/dist/{node → src/node}/helpers/index.d.ts +0 -0
  928. /package/dist/{node → src/node}/helpers/scripts.d.ts +0 -0
  929. /package/dist/{node → src/node}/index.d.ts +0 -0
  930. /package/dist/{node → src/node}/seed.d.ts +0 -0
  931. /package/dist/{node → src/node}/webpack/fs-proxy.d.ts +0 -0
  932. /package/dist/{node → src/node}/webpack/index.d.ts +0 -0
  933. /package/dist/{seedSchema → src/seedSchema}/AppStateSchema.d.ts +0 -0
  934. /package/dist/{seedSchema → src/seedSchema}/ConfigSchema.d.ts +0 -0
  935. /package/dist/{seedSchema → src/seedSchema}/MetadataSchema.d.ts +0 -0
  936. /package/dist/{seedSchema → src/seedSchema}/ModelSchema.d.ts +0 -0
  937. /package/dist/{seedSchema → src/seedSchema}/ModelSchemaSchema.d.ts +0 -0
  938. /package/dist/{seedSchema → src/seedSchema}/ModelUidSchema.d.ts +0 -0
  939. /package/dist/{seedSchema → src/seedSchema}/PropertyUidSchema.d.ts +0 -0
  940. /package/dist/{seedSchema → src/seedSchema}/SchemaSchema.d.ts +0 -0
  941. /package/dist/{seedSchema → src/seedSchema}/SeedSchema.d.ts +0 -0
  942. /package/dist/{seedSchema → src/seedSchema}/VersionSchema.d.ts +0 -0
  943. /package/dist/{seedSchema → src/seedSchema}/index.d.ts +0 -0
  944. /package/dist/{services → src/services}/events.d.ts +0 -0
  945. /package/dist/{services → src/services}/publish/actors/createPublishAttempt.d.ts +0 -0
  946. /package/dist/{services → src/services}/publish/actors/preparePublishRequestData.d.ts +0 -0
  947. /package/dist/{services → src/services}/publish/actors/upload.d.ts +0 -0
  948. /package/dist/{services → src/services}/publish/actors/validateItemData.d.ts +0 -0
  949. /package/dist/{services → src/services}/publish/publishMachine.d.ts +0 -0
  950. /package/dist/{services → src/services}/write/actors/validateEntity.d.ts +0 -0
  951. /package/dist/{services → src/services}/write/actors/writeToDatabase.d.ts +0 -0
  952. /package/dist/{services → src/services}/write/writeProcessMachine.d.ts +0 -0
  953. /package/dist/{types → src/types}/arweave.d.ts +0 -0
  954. /package/dist/{types → src/types}/browser.d.ts +0 -0
  955. /package/dist/{types → src/types}/db.d.ts +0 -0
  956. /package/dist/{types → src/types}/fileManager.d.ts +0 -0
  957. /package/dist/{types → src/types}/helpers.d.ts +0 -0
  958. /package/dist/{types → src/types}/import.d.ts +0 -0
  959. /package/dist/{types → src/types}/item.d.ts +0 -0
  960. /package/dist/{types → src/types}/model.d.ts +0 -0
  961. /package/dist/{types → src/types}/property.d.ts +0 -0
  962. /package/dist/{types → src/types}/publish.d.ts +0 -0
  963. /package/dist/{types → src/types}/seedProtocol.d.ts +0 -0
  964. /package/dist/{types → src/types}/services.d.ts +0 -0
  965. /package/dist/{vite → src/vite}/easFix.d.ts +0 -0
  966. /package/dist/{vite → src/vite}/index.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-B95Ng80C.js","sources":["../../src/db/Db/BaseDb.ts","../../src/seedSchema/ModelSchema.ts","../../src/helpers/FileManager/BaseFileManager.ts","../../src/helpers/ArweaveClient/BaseArweaveClient.ts","../../src/helpers/EasClient/BaseEasClient.ts","../../src/helpers/QueryClient/BaseQueryClient.ts","../../src/helpers/waitForEntityIdle.ts","../../src/helpers/index.ts","../../src/Model/service/actors/loadOrCreateModel.ts","../../src/Model/service/actors/validateModel.ts","../../src/Model/service/actors/createModelProperties.ts","../../src/services/write/actors/validateEntity.ts","../../src/seedSchema/SeedSchema.ts","../../src/seedSchema/VersionSchema.ts","../../src/seedSchema/MetadataSchema.ts","../../src/seedSchema/AppStateSchema.ts","../../src/seedSchema/ModelUidSchema.ts","../../src/seedSchema/PropertyUidSchema.ts","../../src/seedSchema/ConfigSchema.ts","../../src/seedSchema/SchemaSchema.ts","../../src/seedSchema/ModelSchemaSchema.ts","../../src/helpers/db.ts","../../src/services/write/actors/writeToDatabase.ts","../../src/services/write/writeProcessMachine.ts","../../src/Model/service/modelMachine.ts","../../src/client/constants.ts","../../src/Item/service/actors/waitForDb.ts","../../src/db/read/getExistingItem.ts","../../src/Item/service/actors/initialize.ts","../../src/Item/service/actors/hydrateExistingItem.ts","../../src/graphql/gql/graphql.ts","../../src/graphql/gql/gql.ts","../../src/Item/queries.ts","../../src/db/read/getSchemaUidForModel.ts","../../src/db/write/createSeed.ts","../../src/db/write/createVersion.ts","../../src/Item/service/actors/hydrateNewItem.ts","../../src/helpers/model.ts","../../src/Item/service/actors/fetchDataFromEas.ts","../../src/Item/service/actors/reload.ts","../../src/db/read/subqueries/versionData.ts","../../src/Item/service/actors/loadOrCreateItem.ts","../../src/Item/service/actors/runPublish.ts","../../src/Item/service/itemMachineSingle.ts","../../src/helpers/constants.ts","../../src/db/read/subqueries/metadataLatest.ts","../../src/db/read/getItemProperties.ts","../../src/db/read/getSeedData.ts","../../src/db/read/getItemData.ts","../../src/db/read/getItems.ts","../../src/ItemProperty/service/actors/resolveRemoteStorage.ts","../../src/ItemProperty/service/actors/waitForDb.ts","../../src/eas.ts","../../src/helpers/getSchemaForItemProperty.ts","../../src/stores/eas.ts","../../src/ItemProperty/service/actors/initialize.ts","../../src/db/read/getStorageTransactionIdForSeedUid.ts","../../src/db/read/getRelationValueData.ts","../../src/ItemProperty/service/actors/resolveRelatedValue.ts","../../src/db/write/updateMetadata.ts","../../src/ItemProperty/service/actors/hydrateFromDb.ts","../../src/ItemProperty/service/actors/loadOrCreateProperty.ts","../../src/db/read/getVersionData.ts","../../src/db/write/updateItemPropertyValue.ts","../../src/ItemProperty/service/actors/saveValueToDb/analyzeInput.ts","../../src/db/write/createMetadata.ts","../../src/eventBus.ts","../../src/ItemProperty/service/actors/saveValueToDb/saveImage.ts","../../src/ItemProperty/service/actors/saveValueToDb/saveRelation.ts","../../src/db/read/getItemProperty.ts","../../src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.ts","../../src/ItemProperty/service/propertyMachine.ts","../../src/db/read/getPropertyData.ts","../../src/helpers/entity/entityUnload.ts","../../src/helpers/entity/entityDestroy.ts","../../src/helpers/reactiveProxy.ts","../../src/ItemProperty/ItemProperty.ts","../../src/db/write/createNewItem.ts","../../src/helpers/entity/entityFind.ts","../../src/db/write/deleteItem.ts","../../src/db/write/updateSeedUid.ts","../../src/Item/Item.ts","../../src/Schema/errors.ts","../../src/helpers/addresses.ts","../../src/helpers/environment.ts","../../src/helpers/ArweaveClient/index.ts","../../src/services/events.ts","../../src/db/read/getModelSchemas.ts","../../src/db/write/createSeeds.ts","../../src/events/item/syncDbWithEas.ts","../../src/events/item/index.ts","../../src/events/services/allItems.ts","../../src/events/services/index.ts","../../src/helpers/PathResolver/BasePathResolver.ts","../../src/client/actors/platformClassesInit.ts","../../src/client/actors/saveAppState.ts","../../src/helpers/file/queries.ts","../../src/db/read/getMetadata.ts","../../src/db/write/saveMetadata.ts","../../src/db/write/saveAppState.ts","../../src/events/files/download.ts","../../src/events/files/index.ts","../../src/client/actors/fileSystemInit.ts","../../src/client/actors/dbInit.ts","../../src/client/actors/addModelsToStore.ts","../../src/client/actors/addModelsToDb.ts","../../src/client/actors/saveConfig.ts","../../src/helpers/schema.ts","../../src/imports/json.ts","../../src/client/actors/processSchemaFiles.ts","../../src/client/clientManagerMachine.ts","../../src/client/ClientManager.ts","../../src/helpers/entity/entityLiveQuery.ts","../../src/db/read/getModelsData.ts","../../src/Model/Model.ts","../../src/Schema/validation.ts","../../src/helpers/property/index.ts","../../src/Model/index.ts","../../src/node/helpers/FileManager.ts","../../src/node/db/Db.ts","../../src/imports/markdown.ts","../../src/node/webpack/index.ts","../../src/node/helpers/PathResolver.ts","../../src/node/helpers/index.ts","../../src/node/helpers/scripts.ts","../../src/node/codegen/drizzle.ts","../../src/node/helpers/EasClient.ts","../../src/node/helpers/QueryClient.ts","../../src/helpers/ArweaveClient/queries.ts","../../src/node/helpers/ArweaveClient.ts","../../src/node/index.ts"],"sourcesContent":["import { IDb } from '@/interfaces/IDb'\nimport { Observable } from 'rxjs'\n\nexport abstract class BaseDb implements IDb {\n\n static filesDir: string | undefined\n\n constructor() {\n }\n\n static PlatformClass: typeof BaseDb\n\n static setPlatformClass(platformClass: typeof BaseDb) {\n this.PlatformClass = platformClass\n }\n\n static getAppDb(): any {\n return this.PlatformClass.getAppDb()\n }\n\n static prepareDb(filesDir: string): Promise<any> {\n return this.PlatformClass.prepareDb(filesDir)\n }\n\n static isAppDbReady(): boolean {\n return this.PlatformClass.isAppDbReady()\n }\n\n static connectToDb(pathToDir: string,): Promise<unknown> {\n return this.PlatformClass.connectToDb(pathToDir,)\n }\n\n static async migrate(pathToDbDir: string, dbName: string, dbId: string): Promise<void> {\n return this.PlatformClass.migrate(pathToDbDir, dbName, dbId)\n }\n\n /**\n * Execute a reactive query that emits new results whenever the underlying data changes.\n * \n * Supports two usage patterns:\n * 1. SQL tag function: liveQuery((sql) => sql`SELECT * FROM models`)\n * 2. Drizzle query builder (browser only): liveQuery(db.select().from(models))\n * \n * @param query - SQL query function or Drizzle query builder\n * @returns Observable that emits arrays of query results\n * \n * @example\n * ```typescript\n * // Using SQL tag function\n * const models$ = BaseDb.liveQuery<ModelRow>(\n * (sql) => sql`SELECT * FROM models WHERE schema_file_id = ${schemaId}`\n * )\n * \n * // Using Drizzle query builder (browser only)\n * const models$ = BaseDb.liveQuery<ModelRow>(\n * appDb.select().from(models).where(eq(models.schemaFileId, schemaId))\n * )\n * \n * models$.subscribe(models => {\n * console.log('Models updated:', models)\n * })\n * ```\n */\n static liveQuery<T>(query: ((sql: any) => any) | any): Observable<T[]> {\n return this.PlatformClass.liveQuery<T>(query)\n }\n\n}","import { integer, sqliteTable, text, unique } from 'drizzle-orm/sqlite-core'\nimport { relations } from 'drizzle-orm'\nimport { InferInsertModel, InferSelectModel } from 'drizzle-orm'\n\n\nexport const models = sqliteTable(\n 'models',\n {\n id: integer('id').primaryKey({ autoIncrement: true }),\n name: text('name').notNull(),\n schemaFileId: text('schema_file_id'), // ID from JSON file for change tracking - must be unique\n isEdited: integer('is_edited', { mode: 'boolean' }), // true if model has been edited locally, false if matches schema file\n },\n (table) => {\n return {\n uniqueSchemaFileId: unique('unique_schema_file_id').on(table.schemaFileId),\n }\n }\n)\n\nexport const modelsRelations = relations(models, ({ many }) => ({\n properties: many(properties),\n}))\n\nexport type NewModelRecord = typeof models.$inferInsert\nexport type ModelRecordType = typeof models.$inferSelect\n\nexport const properties = sqliteTable(\n 'properties',\n {\n id: integer('id').primaryKey({ autoIncrement: true }),\n name: text('name').notNull(),\n dataType: text('data_type').notNull(),\n modelId: integer('model_id')\n .notNull()\n .references(() => models.id),\n refModelId: integer('ref_model_id').references(() => models.id),\n refValueType: text('ref_value_type'),\n schemaFileId: text('schema_file_id'), // ID from JSON file for change tracking\n isEdited: integer('is_edited', { mode: 'boolean' }), // true if property has been edited locally, false if matches schema file\n },\n (table) => {\n return {\n uniqueNameModelId: unique('unique_name_model_id').on(\n table.name,\n table.modelId,\n ),\n uniqueSchemaFileId: unique('unique_property_schema_file_id').on(table.schemaFileId),\n }\n },\n)\n\nexport const propertiesRelations = relations(properties, ({ one }) => ({\n model: one(models),\n refModel: one(models),\n}))\n\nexport type NewPropertyRecord = InferInsertModel<typeof properties>\nexport type PropertyType = InferSelectModel<typeof properties>\n","export abstract class BaseFileManager {\n private static fileSystemInitialized = false\n private static initializing = false\n private static workingDir: string | undefined\n\n static PlatformClass: typeof BaseFileManager\n\n static setPlatformClass( platformClass: typeof BaseFileManager ) {\n if (!platformClass) {\n throw new Error('Cannot set PlatformClass to undefined or null. Ensure the platform-specific FileManager is properly imported.')\n }\n if (platformClass === BaseFileManager) {\n throw new Error('Cannot set PlatformClass to BaseFileManager itself. Use a platform-specific implementation (e.g., node/FileManager or browser/FileManager).')\n }\n this.PlatformClass = platformClass\n }\n\n static async initializeFileSystem(workingDir?: string): Promise<void> {\n if (this.initializing || this.fileSystemInitialized) {\n return Promise.resolve()\n }\n this.initializing = true\n console.log('PlatformClass.initializeFileSystem initializing', workingDir)\n await this.PlatformClass.initializeFileSystem(workingDir)\n console.log('PlatformClass.initializeFileSystem success')\n this.fileSystemInitialized = true\n this.initializing = false\n this.workingDir = workingDir\n }\n\n static getWorkingDir(): string {\n if (!this.workingDir) {\n throw new Error('Working directory is not set')\n }\n return this.workingDir\n }\n\n static getContentUrlFromPath( path: string ): Promise<string | undefined> {\n return this.PlatformClass.getContentUrlFromPath(path)\n }\n\n static downloadAllFiles( {\n transactionIds,\n arweaveHost,\n excludedTransactions,\n }: DownloadAllFilesParams ): Promise<void> {\n return this.PlatformClass.downloadAllFiles({ transactionIds, arweaveHost, excludedTransactions })\n }\n\n static resizeImage( { filePath, width, height }: ResizeImageParams ): Promise<void> {\n return this.PlatformClass.resizeImage({ filePath, width, height })\n }\n\n static resizeAllImages( { width, height }: ResizeAllImagesParams ): Promise<void> {\n return this.PlatformClass.resizeAllImages({ width, height })\n }\n\n static pathExists(filePath: string): Promise<boolean> {\n return this.PlatformClass.pathExists(filePath)\n }\n\n static createDirIfNotExists(filePath: string): Promise<void> {\n return this.PlatformClass.createDirIfNotExists(filePath)\n }\n\n static async waitForFile(filePath: string): Promise<boolean> {\n return this.PlatformClass.waitForFile(filePath)\n }\n\n static async waitForFileWithContent(filePath: string, interval?: number, timeout?: number): Promise<boolean> {\n return this.PlatformClass.waitForFileWithContent(filePath, interval, timeout)\n }\n\n static async saveFile(filePath: string, content: string | Blob | ArrayBuffer): Promise<void> {\n return this.PlatformClass.saveFile(filePath, content)\n }\n\n static saveFileSync(filePath: string, content: string | Blob | ArrayBuffer): void {\n return this.PlatformClass.saveFileSync(filePath, content)\n }\n\n static async readFile(filePath: string): Promise<File> {\n return this.PlatformClass.readFile(filePath)\n }\n\n static readFileSync(filePath: string): File {\n return this.PlatformClass.readFileSync(filePath)\n }\n\n static async readFileAsBuffer(filePath: string): Promise<Buffer | Blob> {\n return this.PlatformClass.readFileAsBuffer(filePath)\n }\n\n static async readFileAsString(filePath: string): Promise<string> {\n return this.PlatformClass.readFileAsString(filePath)\n }\n\n static async getFs(): Promise<any> {\n if (!this.PlatformClass) {\n throw new Error('PlatformClass not set. Call setPlatformClass() first.')\n }\n if (this.PlatformClass === BaseFileManager) {\n throw new Error('Circular reference detected: PlatformClass is set to BaseFileManager')\n }\n // Check if the getFs method is the same as BaseFileManager.getFs (catches cases where\n // PlatformClass doesn't properly override getFs or bundling causes method sharing)\n if (this.PlatformClass.getFs === BaseFileManager.getFs) {\n throw new Error('Circular reference detected: PlatformClass.getFs is the same as BaseFileManager.getFs')\n }\n // Check if we're calling ourselves recursively (more reliable than function reference comparison)\n // This will catch actual infinite recursion regardless of how the code is bundled/transpiled\n const stack = new Error().stack || ''\n const getFsCalls = (stack.match(/getFs/g) || []).length\n if (getFsCalls > 10) {\n throw new Error('Infinite recursion detected in getFs')\n }\n return this.PlatformClass.getFs()\n }\n\n static getFsSync(): any {\n if (!this.PlatformClass) {\n throw new Error('PlatformClass not set. Call setPlatformClass() first.')\n }\n if (this.PlatformClass === BaseFileManager) {\n throw new Error('Circular reference detected: PlatformClass is set to BaseFileManager')\n }\n // Check if getFsSync method exists on platform class\n if (typeof this.PlatformClass.getFsSync !== 'function') {\n throw new Error('PlatformClass does not implement getFsSync()')\n }\n return this.PlatformClass.getFsSync()\n }\n\n static getPathModule(): any {\n return this.PlatformClass.getPathModule()\n }\n\n static getParentDirPath(filePath: string): string {\n return this.PlatformClass.getParentDirPath(filePath)\n }\n\n static getFilenameFromPath(filePath: string): string {\n return this.PlatformClass.getFilenameFromPath(filePath)\n }\n}\n","import { GraphQLClient } from 'graphql-request'\nimport type {\n TransactionStatus,\n TransactionTag,\n GetDataOptions,\n DownloadFilesParams,\n DownloadResult,\n CreateTransactionOptions,\n} from '@/types/arweave'\n\n// Default configuration\nconst DEFAULT_HOST = 'arweave.net'\n\n// Internal state\nlet _host = DEFAULT_HOST\nlet _hostExplicitlySet = false\n\nexport abstract class BaseArweaveClient {\n static PlatformClass: typeof BaseArweaveClient\n\n static setPlatformClass(platformClass: typeof BaseArweaveClient) {\n this.PlatformClass = platformClass\n }\n\n // ============================================\n // Configuration Methods\n // ============================================\n\n /**\n * Get the current Arweave host\n * @returns The Arweave host (e.g., 'arweave.net')\n */\n static getHost(): string {\n // Check for environment variable override in production\n if (process.env.NODE_ENV === 'production') {\n const envHost = typeof process !== 'undefined' && process.env\n ? process.env.NEXT_PUBLIC_ARWEAVE_HOST || process.env.ARWEAVE_HOST\n : undefined\n if (envHost && !_hostExplicitlySet) {\n return envHost\n }\n }\n return _host\n }\n\n /**\n * Set the Arweave host\n * @param host - The new host to use (e.g., 'arweave.net')\n */\n static setHost(host: string): void {\n _host = host\n _hostExplicitlySet = true\n }\n\n /**\n * Get the GraphQL endpoint URL\n * @returns The full GraphQL endpoint URL\n */\n static getEndpoint(): string {\n return `https://${this.getHost()}/graphql`\n }\n\n /**\n * Get the raw data URL for a transaction\n * @param transactionId - The Arweave transaction ID\n * @returns The full URL to access raw transaction data\n */\n static getRawUrl(transactionId: string): string {\n return `https://${this.getHost()}/raw/${transactionId}`\n }\n\n /**\n * Get the transaction status URL\n * @param transactionId - The Arweave transaction ID\n * @returns The full URL to check transaction status\n */\n static getStatusUrl(transactionId: string): string {\n return `https://${this.getHost()}/tx/${transactionId}/status`\n }\n\n // ============================================\n // GraphQL Client\n // ============================================\n\n /**\n * Get the GraphQL client for Arweave queries\n * @returns GraphQL client instance\n */\n static getArweaveClient(): GraphQLClient {\n return this.PlatformClass.getArweaveClient()\n }\n\n // ============================================\n // Transaction Operations (delegated to platform)\n // ============================================\n\n /**\n * Get the status of a transaction\n * @param transactionId - The Arweave transaction ID\n * @returns Transaction status including confirmation details\n */\n static getTransactionStatus(transactionId: string): Promise<TransactionStatus> {\n return this.PlatformClass.getTransactionStatus(transactionId)\n }\n\n /**\n * Get transaction data\n * @param transactionId - The Arweave transaction ID\n * @param options - Options for data retrieval (decode, string)\n * @returns Transaction data as Uint8Array or string\n */\n static getTransactionData(\n transactionId: string,\n options?: GetDataOptions\n ): Promise<Uint8Array | string> {\n return this.PlatformClass.getTransactionData(transactionId, options)\n }\n\n /**\n * Get transaction tags\n * @param transactionId - The Arweave transaction ID\n * @returns Array of transaction tags\n */\n static getTransactionTags(transactionId: string): Promise<TransactionTag[]> {\n return this.PlatformClass.getTransactionTags(transactionId)\n }\n\n /**\n * Create a new unsigned transaction\n * @param data - Transaction data (string or Uint8Array)\n * @param options - Options including tags\n * @returns The created transaction object\n */\n static createTransaction(\n data: string | Uint8Array,\n options?: CreateTransactionOptions\n ): Promise<any> {\n return this.PlatformClass.createTransaction(data, options)\n }\n\n // ============================================\n // Bulk Operations\n // ============================================\n\n /**\n * Download multiple files from Arweave\n * @param params - Download parameters including transaction IDs\n * @returns Array of download results\n */\n static downloadFiles(params: DownloadFilesParams): Promise<DownloadResult[]> {\n return this.PlatformClass.downloadFiles(params)\n }\n}","import { GraphQLClient } from 'graphql-request'\nimport { Attestation } from '@/graphql/gql/graphql'\n\nexport abstract class BaseEasClient {\n static PlatformClass: typeof BaseEasClient\n protected static easClient: GraphQLClient\n\n static setPlatformClass(platformClass: typeof BaseEasClient) {\n if (!platformClass) {\n throw new Error('Cannot set PlatformClass to undefined or null. Ensure the platform-specific EasClient is properly imported.')\n }\n if (platformClass === BaseEasClient) {\n throw new Error('Cannot set PlatformClass to BaseEasClient itself. Use a platform-specific implementation (e.g., node/EasClient or browser/EasClient).')\n }\n this.PlatformClass = platformClass\n }\n\n static getEasClient(): GraphQLClient {\n return this.PlatformClass.getEasClient()\n }\n\n static async getSeedsBySchemaName(schemaName: string): Promise<Attestation[]> {\n return this.PlatformClass.getSeedsBySchemaName(schemaName)\n }\n} \n","import { IQueryClient } from \"@/interfaces/IQueryClient\"\n\nexport abstract class BaseQueryClient {\n static PlatformClass: typeof BaseQueryClient\n\n static setPlatformClass(platformClass: typeof BaseQueryClient) {\n this.PlatformClass = platformClass\n }\n\n static getQueryClient(): IQueryClient {\n return this.PlatformClass.getQueryClient()\n }\n} ","import { waitFor } from 'xstate'\n\n/** Any entity that exposes an xstate actor via getService(). Loosely typed so Schema/Model/Item/ModelProperty (different machine contexts) are all accepted. */\ninterface EntityWithService {\n getService(): any\n}\n\n/**\n * Wait for an entity's state machine to reach 'idle' state\n * @param entity - Entity instance with getService() method\n * @param options - Configuration options\n * @returns Promise that resolves when entity reaches idle, or rejects on error/timeout\n */\nexport async function waitForEntityIdle(\n entity: EntityWithService,\n options: {\n timeout?: number\n throwOnError?: boolean\n } = {}\n): Promise<void> {\n const { timeout = 5000, throwOnError = true } = options\n const service = entity.getService()\n const currentSnapshot = service.getSnapshot()\n\n // Check current state first - if already idle, return immediately\n if ('value' in currentSnapshot && currentSnapshot.value === 'idle') {\n return\n }\n\n if ('value' in currentSnapshot && currentSnapshot.value === 'error') {\n if (throwOnError) {\n throw new Error('Entity failed to load')\n }\n return\n }\n\n try {\n await waitFor(\n service,\n (snapshot) => {\n if ('value' in snapshot && snapshot.value === 'error') {\n if (throwOnError) {\n throw new Error('Entity failed to load')\n }\n return true // Accept error state if not throwing\n }\n return 'value' in snapshot && snapshot.value === 'idle'\n },\n { timeout }\n )\n } catch (error: any) {\n if (error.message === 'Entity failed to load') {\n throw error\n }\n throw new Error(`Entity loading timeout after ${timeout}ms`)\n }\n}\n","import { customAlphabet } from 'nanoid'\nimport * as nanoIdDictionary from 'nanoid-dictionary'\nimport debug from 'debug'\nimport { GetCorrectId } from '@/types/helpers'\nimport { GetCorrectIdReturn } from '@/types/helpers'\nimport { BaseFileManager } from './FileManager/BaseFileManager'\nimport { BaseArweaveClient } from './ArweaveClient/BaseArweaveClient'\nexport * from './ArweaveClient/BaseArweaveClient'\nexport * from './EasClient/BaseEasClient'\nexport * from './QueryClient/BaseQueryClient'\nexport * from './FileManager/BaseFileManager'\nexport { waitForEntityIdle } from './waitForEntityIdle'\nconst logger = debug('seedSdk:shared:helpers')\n\nconst { alphanumeric } = nanoIdDictionary\n\nexport const generateId = (): string => {\n return customAlphabet(alphanumeric, 10)()\n}\n\nexport const toSnakeCase = (str: string) => {\n return str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()\n}\n\nexport const identifyString = (str: string) => {\n try {\n JSON.parse(str)\n return 'json'\n } catch (e) {\n // Not JSON\n }\n\n if (!str) {\n return\n }\n\n if (str.trim().startsWith('<') && str.trim().endsWith('>')) {\n return 'html'\n }\n\n // Simple markdown checks (very naive)\n if (/^#{1,6}\\s|^-{3,}|\\*{3,}|^-{1,2}\\s|\\*\\s/.test(str)) {\n return 'markdown'\n }\n\n if (/^data:image\\/[a-zA-Z]+;base64,[A-Za-z0-9+/]+={0,2}$/.test(str)) {\n return 'base64'\n }\n\n // Default to plain text if unsure\n return 'text'\n}\n\nexport const getMimeType = (base64: string) => {\n if (!base64) {\n return null\n }\n const result = base64.match(/^data:([a-zA-Z0-9]+\\/[a-zA-Z0-9-.+]+).*,/)\n\n if (result && result.length > 1) {\n return result[1]\n } else {\n return null // MIME type could not be determined\n }\n}\n\nexport const getCorrectId: GetCorrectId = (localIdOrUid: string) => {\n const id: GetCorrectIdReturn = {\n localId: undefined,\n uid: undefined,\n }\n if (!localIdOrUid) {\n return id\n }\n if (localIdOrUid.length === 10) {\n id.localId = localIdOrUid\n }\n if (localIdOrUid.startsWith('0x') && localIdOrUid.length === 66) {\n id.uid = localIdOrUid\n }\n return id\n}\n\nexport const getDataTypeFromString = (\n data: string,\n): 'imageBase64' | 'base64' | 'url' | null => {\n const nonImageBase64Regex =\n /^(?!data:image\\/(?:jpeg|png|gif|bmp|webp);base64,)[A-Za-z0-9+/=]+$/\n\n if (nonImageBase64Regex.test(data)) {\n return 'base64'\n }\n\n // Regular expression for base64 (simple version, checking for base64 format)\n const imageBase64Regex = /^data:image\\/[a-zA-Z]+;base64,[A-Za-z0-9+/]+={0,2}$/\n\n if (imageBase64Regex.test(data)) {\n return 'imageBase64'\n }\n\n // Regular expression for URL (simple version, checking for common URL format)\n const urlRegex =\n /^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$/\n\n if (urlRegex.test(data)) {\n return 'url'\n }\n\n return null\n}\n\nexport const convertTxIdToImage = async (\n txId: string,\n): Promise<string | undefined> => {\n const imageFilePath = `/files/images/${txId}`\n const fileExists = await BaseFileManager.pathExists(imageFilePath)\n if (!fileExists) {\n logger(`[ItemView] [updateImage] ${imageFilePath} does not exist`)\n return\n }\n const buffer = await BaseFileManager.readFileAsBuffer(imageFilePath)\n\n // Convert Blob to ArrayBuffer if needed, or use Buffer directly\n let arrayBuffer: ArrayBuffer\n if (buffer instanceof Blob) {\n arrayBuffer = await buffer.arrayBuffer()\n } else if (buffer instanceof ArrayBuffer) {\n arrayBuffer = buffer\n } else {\n // Node.js Buffer\n const sliced = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n // Handle SharedArrayBuffer case by creating a new ArrayBuffer\n if (sliced instanceof SharedArrayBuffer) {\n const uint8Array = new Uint8Array(sliced)\n arrayBuffer = uint8Array.buffer.slice(0) as unknown as ArrayBuffer\n } else {\n arrayBuffer = sliced as ArrayBuffer\n }\n }\n\n const uint = new Uint8Array(arrayBuffer)\n\n const imageBlob = new Blob([uint])\n\n return URL.createObjectURL(imageBlob)\n}\n\n/**\n * Constructs an Arweave URL for a storage transaction ID\n * @param storageTransactionId - The Arweave transaction ID\n * @returns The full URL to access the transaction data on Arweave (e.g., https://arweave.net/raw/{transactionId})\n * @deprecated Use BaseArweaveClient.getRawUrl() instead for better consistency and testability\n */\nexport const getArweaveUrlForTransaction = (storageTransactionId: string): string => {\n return BaseArweaveClient.getRawUrl(storageTransactionId)\n}\n\nexport const getExecutionTime = async (task: (...args: any[]) => Promise<any>, args: any[]) => {\n const start = Date.now()\n await task(...args)\n return Date.now() - start\n}\n\nexport const capitalizeFirstLetter = (string: string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nexport const parseEasRelationPropertyName = (easPropertyName: string) => {\n // Split the input string on the first underscore\n const [singularProperty, modelName, idSegment] = easPropertyName.split('_')\n\n // If there are any other parts, assume it is a list (e.g., has 'ids' or other suffix)\n const isList = idSegment === 'ids'\n\n // Create the final property name by pluralizing the singular part\n const propertyName = singularProperty.endsWith('s')\n ? singularProperty\n : singularProperty + 's'\n\n return {\n propertyName, // Plural form of the property name\n modelName, // Model name extracted from the second part\n isList, // True if the property is a list (e.g., 'ids' is present)\n }\n}\n\n\nexport const isBinary = (arrayBuffer: ArrayBuffer): boolean => {\n const view = new Uint8Array(arrayBuffer);\n\n let nonTextCount = 0;\n const threshold = 0.2; // Adjust as needed (e.g., 20% non-text implies binary)\n\n for (let i = 0; i < view.length; i++) {\n const byte = view[i];\n\n // ASCII printable characters (32-126) and common whitespace (9, 10, 13)\n if (\n (byte >= 32 && byte <= 126) || // Printable ASCII\n byte === 9 || byte === 10 || byte === 13 // Tab, LF, CR\n ) {\n continue;\n }\n\n nonTextCount++;\n if (nonTextCount / view.length > threshold) {\n return true; // More than threshold are non-text bytes\n }\n }\n\n return false; // Fewer than threshold are non-text bytes\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types'\nimport { ModelMachineContext } from '../modelMachine'\n// Dynamic import to break circular dependency: Model.ts -> modelMachine -> loadOrCreateModel -> Schema.ts -> Model.ts\n// import { Schema } from '@/Schema/Schema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models as modelsTable, properties as propertiesTable } from '@/seedSchema/ModelSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { generateId } from '@/helpers'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:model:actors:loadOrCreateModel')\n\n/**\n * Create ModelProperty instances for all property IDs to ensure they're cached\n * This ensures that ModelProperty.getById() in Model.properties getter will find the instances\n * @param propertyFileIds - Array of property file IDs to create instances for\n */\nconst createPropertyInstances = async (propertyFileIds: string[]): Promise<void> => {\n if (propertyFileIds.length === 0) {\n return\n }\n\n try {\n const mod = await import('../../../ModelProperty/ModelProperty')\n const ModelProperty = mod?.ModelProperty ?? (mod as { default?: unknown })?.default\n if (!ModelProperty) {\n logger('createPropertyInstances: ModelProperty not available from dynamic import')\n return\n }\n\n // Create instances for all property IDs in parallel\n // ModelProperty.createById() will check cache first, then query DB and create if needed\n const createPromises = propertyFileIds.map(async (propertyFileId) => {\n try {\n const property = await ModelProperty.createById(propertyFileId)\n if (property) {\n logger(`Created/cached ModelProperty instance for propertyFileId \"${propertyFileId}\"`)\n } else {\n logger(`ModelProperty.createById returned undefined for propertyFileId \"${propertyFileId}\" (may not exist in DB yet)`)\n }\n } catch (error) {\n logger(`Error creating ModelProperty instance for propertyFileId \"${propertyFileId}\": ${error}`)\n // Don't throw - continue with other properties\n }\n })\n \n await Promise.all(createPromises)\n logger(`Finished creating/caching ${propertyFileIds.length} ModelProperty instances`)\n } catch (error) {\n logger(`Error in createPropertyInstances: ${error}`)\n // Don't throw - this is best-effort to pre-populate cache\n }\n}\n\nexport const loadOrCreateModel = fromCallback<\n EventObject,\n FromCallbackInput<ModelMachineContext>\n>(({ sendBack, input: { context } }) => {\n const _loadOrCreateModel = async (): Promise<void> => {\n const { modelName, schemaName, id, _idFromSchema } = context // id is now the schemaFileId (string)\n\n console.log('loadOrCreateModel called for', modelName, 'with schemaName', schemaName, 'and id', id)\n\n if (!modelName || !schemaName) {\n throw new Error('Model name and schema name are required')\n }\n\n // CRITICAL: Model instances load their data from database, not from Schema context.\n // Schema is read-only with respect to Model instances.\n\n const db = BaseDb.getAppDb()\n let schemaFileId = id // id is now the schemaFileId (string)\n let modelRecord: any = null\n let foundBySchemaFileId = false // Track if model was found by schemaFileId\n let existingNumbersFromSchemaContext: Set<number> | null = null // When we fall through (same name, different id), schema model occupies base name\n\n console.log('has db', !!db)\n\n // Step 1: Load from database FIRST (primary source of truth)\n if (db) {\n try {\n // Try to find model by schemaFileId if provided\n if (schemaFileId) {\n const dbModels = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, schemaFileId))\n .limit(1)\n \n if (dbModels.length > 0) {\n modelRecord = dbModels[0]\n foundBySchemaFileId = true\n logger(`Found model \"${modelName}\" in database by schemaFileId \"${schemaFileId}\"`)\n }\n }\n \n console.log('modelRecord', modelRecord)\n\n // If not found by ID, try by name\n // But if we have a schemaFileId and the model found by name has a different schemaFileId,\n // don't use it - we're creating a new model from a schema file with a specific ID\n if (!modelRecord) {\n const dbModels = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n\n console.log('dbModels.length', dbModels.length)\n \n if (dbModels.length > 0) {\n const foundModel = dbModels[0]\n const dbSchemaFileId = foundModel.schemaFileId\n \n // CRITICAL: If we found a model in the database by name, check if there's already a cached instance\n // with that schemaFileId. If so, we should use that instance's schemaFileId for the current instance.\n // This handles the case where Model.create was called with a generated ID, but the model\n // already exists in the database with a different ID. By updating the current instance's\n // schemaFileId to match the database, both will point to the same cached instance.\n if (dbSchemaFileId) {\n try {\n const modelMod = await import('../../../Model/Model')\n const { Model } = modelMod\n // Access instanceCacheById via type assertion since it's protected\n const cacheById = (Model as any).instanceCacheById as Map<string, any>\n if (cacheById.has(dbSchemaFileId)) {\n logger(`Model \"${modelName}\" found in database by name with schemaFileId \"${dbSchemaFileId}\", and a cached instance already exists. Updating current instance to use the same schemaFileId.`)\n // Update the current instance's schemaFileId to match the database\n // This ensures both instances point to the same cached instance\n modelRecord = foundModel\n schemaFileId = dbSchemaFileId\n logger(`Using existing cached instance with schemaFileId \"${schemaFileId}\" for model \"${modelName}\"`)\n }\n } catch (error) {\n logger(`Error checking Model cache for schemaFileId \"${dbSchemaFileId}\": ${error}`)\n // Fall through to normal processing\n }\n }\n \n // If we have a schemaFileId and it doesn't match the found model's schemaFileId,\n // this is a new model - don't use the existing model (will be renamed if duplicate)\n // UNLESS we found a cached instance above (in which case modelRecord is already set)\n if (!modelRecord && schemaFileId && dbSchemaFileId && schemaFileId !== dbSchemaFileId) {\n logger(`Model \"${modelName}\" found by name but has different schemaFileId (provided: \"${schemaFileId}\", db: \"${dbSchemaFileId}\"). Creating new model (will check for duplicates).`)\n // Don't set modelRecord - we'll create a new model with potentially renamed name\n } else if (!modelRecord && schemaFileId && !dbSchemaFileId) {\n // We have a schemaFileId but the found model doesn't have one - this is a new model\n // Don't reuse the existing model, create a new one (will be renamed if duplicate)\n logger(`Model \"${modelName}\" found by name but found model has no schemaFileId. Creating new model with schemaFileId \"${schemaFileId}\" (will check for duplicates).`)\n // Don't set modelRecord - we'll create a new model\n } else if (!modelRecord) {\n // Only reuse existing model if:\n // 1. No schemaFileId was provided (loading existing model), OR\n // 2. schemaFileId matches (same model)\n logger(`Model \"${modelName}\" found by name, reusing existing model (schemaFileId: provided=\"${schemaFileId}\", db=\"${dbSchemaFileId}\")`)\n modelRecord = foundModel\n // Only use database schemaFileId if no id was explicitly provided\n // If an id was provided, we should use it (it might be creating a new model with a specific ID)\n if (!id && dbSchemaFileId) {\n schemaFileId = dbSchemaFileId\n logger(`Using database schemaFileId \"${schemaFileId}\" for model \"${modelName}\" (no ID was provided)`)\n } else if (id) {\n logger(`Preserving provided id (schemaFileId) \"${schemaFileId}\" for model \"${modelName}\" (ignoring database schemaFileId \"${dbSchemaFileId}\")`)\n }\n logger(`Found model \"${modelName}\" in database by name, schemaFileId: \"${schemaFileId}\"`)\n }\n }\n }\n\n // If we found the model record, load its properties from database\n if (modelRecord && modelRecord.id) {\n const propertyRecords = await db\n .select()\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, modelRecord.id))\n\n console.log('propertyRecords.length', propertyRecords.length)\n\n // Properties are now loaded via liveQuery, not passed through context\n // The property records are used by liveQuery to populate ModelProperty instances\n\n // Pre-create ModelProperty instances for all property IDs to ensure they're cached\n // This ensures that ModelProperty.getById() in Model.properties getter will find the instances\n const propertyFileIds = propertyRecords\n .map((record: { schemaFileId: string | null }) => record.schemaFileId)\n .filter((id: string | null | undefined): id is string => id !== null && id !== undefined)\n\n if (propertyFileIds.length > 0) {\n await createPropertyInstances(propertyFileIds)\n }\n\n // Generate schemaFileId if not set\n if (!schemaFileId) {\n schemaFileId = generateId()\n logger(`Generated id (schemaFileId) \"${schemaFileId}\" for model \"${modelName}\"`)\n }\n\n // Include _dbId from database record so properties can be created if needed\n // Even if we found an existing model, we may still need to create properties\n // if _pendingPropertyDefinitions are provided\n \n // Track conflict detection metadata\n const loadedAt = Date.now()\n // Note: models table doesn't have updatedAt or version, so we use loadedAt for _dbUpdatedAt\n // In the future, if models table gets these fields, we should use them\n const dbUpdatedAt = loadedAt\n \n // CRITICAL: Include _liveQueryPropertyIds in loadOrCreateModelSuccess event\n // This ensures the properties getter works immediately, even before _setupLiveQuerySubscription runs\n // We already have the property IDs from the database query, so include them now\n sendBack({\n type: 'loadOrCreateModelSuccess',\n model: {\n id: schemaFileId, // schemaFileId (string) - public ID\n _dbId: modelRecord.id, // Database integer ID - internal only\n _liveQueryPropertyIds: propertyFileIds, // Property IDs from database query\n _propertiesUpdated: Date.now(), // Timestamp for tracking\n _isEdited: modelRecord.isEdited ?? false, // Load isEdited from database\n _loadedAt: loadedAt,\n _dbUpdatedAt: dbUpdatedAt,\n },\n })\n return\n }\n } catch (error) {\n logger(`Error loading model from database: ${error}`)\n // Fall through to create new model\n }\n }\n\n // Step 2: Fallback to Schema context (only if database doesn't have the model)\n // This handles the case where model exists in schema file but not yet in database\n try {\n const schemaMod = await import('../../../Schema/Schema')\n const { Schema } = schemaMod\n const schema = Schema.create(schemaName, { waitForReady: false }) as import('../../../Schema/Schema').Schema\n const schemaSnapshot = schema.getService().getSnapshot()\n \n // Wait for schema to load if it's still loading\n // Check if state is a loading state object (XState v5 nested states)\n const isLoading = typeof schemaSnapshot.value === 'object' && 'loading' in schemaSnapshot.value\n if (isLoading) {\n await new Promise<void>((resolve, reject) => {\n const subscription = schema.getService().subscribe((snapshot) => {\n if (snapshot.value === 'idle' || snapshot.value === 'error') {\n subscription.unsubscribe()\n if (snapshot.value === 'error') {\n reject(new Error('Schema failed to load'))\n } else {\n resolve()\n }\n }\n })\n })\n }\n\n const schemaContext = schema.getService().getSnapshot().context\n // Check by name first; also check by schemaFileId so we recognize the schema model even when context is keyed differently or not yet updated\n if (schemaContext.models) {\n const byName = schemaContext.models[modelName] as { id?: string; properties?: Record<string, unknown> } | undefined\n const schemaModelId = byName?.id ?? null\n if (schemaFileId === schemaModelId) {\n logger(`Found model \"${modelName}\" in Schema context (database fallback)`)\n if (!schemaFileId) {\n schemaFileId = generateId()\n logger(`Generated id (schemaFileId) \"${schemaFileId}\" for model \"${modelName}\"`)\n }\n sendBack({\n type: 'loadOrCreateModelSuccess',\n model: { id: schemaFileId },\n })\n return\n }\n // Same name but different id: runtime create colliding with schema model name; fall through\n if (byName) {\n existingNumbersFromSchemaContext = new Set([0])\n } else if (schemaFileId) {\n // Schema context may not have model by name yet (e.g. still loading). If our id appears in any schema model, we're the schema model.\n for (const def of Object.values(schemaContext.models)) {\n if ((def as any)?.id === schemaFileId) {\n logger(`Found model in Schema context by id \"${schemaFileId}\" (database fallback)`)\n sendBack({\n type: 'loadOrCreateModelSuccess',\n model: { id: schemaFileId },\n })\n return\n }\n }\n }\n }\n } catch (error) {\n logger(`Error loading model from Schema context: ${error}`)\n // Fall through to create new model\n }\n\n // Step 3: Check for duplicate names in database before creating new model\n // Skip duplicate check only if we found a model record to use (modelRecord is set)\n // OR if the model was found by schemaFileId (preserving original name from schema file)\n // OR if this is an internal schema (Seed Protocol) - internal schemas should preserve original names\n // Otherwise, check for duplicates when creating a new model\n // NOTE: We should NOT skip duplicate check just because schemaFileId exists - that could be a newly generated ID\n // for a new model that needs to be renamed if it's a duplicate\n let finalModelName = modelName\n if (db) {\n // Check if this is an internal schema (Seed Protocol)\n const constantsMod = await import('../../../helpers/constants')\n const { isInternalSchema } = constantsMod\n const isInternal = isInternalSchema(schemaName)\n \n // Only skip duplicate check if:\n // 1. We found a model record to use (modelRecord is set), OR\n // 2. The model was found by schemaFileId (preserving original name from schema file), OR\n // 3. This is an internal schema (internal schemas should preserve original names from schema files), OR\n // 4. This instance was created with modelFileId from schema (_idFromSchema) - schema models keep their name\n const shouldSkipDuplicateCheck = modelRecord !== null || foundBySchemaFileId || isInternal || !!_idFromSchema\n \n logger(`Duplicate check: modelRecord=${modelRecord !== null}, foundBySchemaFileId=${foundBySchemaFileId}, isInternal=${isInternal}, _idFromSchema=${!!_idFromSchema}, schemaFileId=${schemaFileId}, shouldSkip=${shouldSkipDuplicateCheck}`)\n \n if (!shouldSkipDuplicateCheck) {\n try {\n const lowerModelName = modelName.toLowerCase()\n const existingNumbers = new Set<number>(existingNumbersFromSchemaContext ?? [])\n \n // First, check Model cache for models (includes models from imported schemas that may not be in DB yet)\n try {\n const modelMod = await import('../../../Model/Model')\n const { Model } = modelMod\n\n // Check name-based cache for this schema\n // Skip the current model (context.id): Model.create() adds the new instance to the cache\n // before this callback runs, so we must not count it as a duplicate.\n logger(`Checking Model cache for duplicates in schema \"${schemaName}\"`)\n const currentModelFileId = schemaFileId ?? null\n const cacheByName = (Model as any).instanceCacheByName as Map<string, string>\n for (const [nameKey, cachedModelFileId] of cacheByName.entries()) {\n if (currentModelFileId && cachedModelFileId === currentModelFileId) continue // skip self\n const [cachedSchemaName, cachedModelName] = nameKey.split(':', 2)\n if (cachedSchemaName === schemaName && cachedModelName) {\n const lowerCachedName = cachedModelName.toLowerCase()\n if (lowerCachedName === lowerModelName) {\n existingNumbers.add(0) // Base name exists\n logger(`Found duplicate in Model cache: \"${cachedModelName}\" matches \"${modelName}\"`)\n } else if (lowerCachedName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerCachedName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n logger(`Found numbered variant in Model cache: \"${cachedModelName}\" (number: ${number})`)\n }\n }\n }\n }\n \n // Also check legacy cache (skip current model by id)\n const legacyCache = (Model as any).instanceCache as Map<string, { instance: { _getSnapshotContext?: () => { id?: string } }; refCount: number }> | undefined\n for (const [nameKey, entry] of legacyCache?.entries() || []) {\n const legacyId = entry?.instance?._getSnapshotContext?.()?.id\n if (currentModelFileId && legacyId === currentModelFileId) continue // skip self\n const [cachedSchemaName, cachedModelName] = nameKey.split(':', 2)\n if (cachedSchemaName === schemaName && cachedModelName) {\n const lowerCachedName = cachedModelName.toLowerCase()\n if (lowerCachedName === lowerModelName) {\n existingNumbers.add(0) // Base name exists\n logger(`Found duplicate in Model legacy cache: \"${cachedModelName}\" matches \"${modelName}\"`)\n } else if (lowerCachedName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerCachedName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n logger(`Found numbered variant in Model legacy cache: \"${cachedModelName}\" (number: ${number})`)\n }\n }\n }\n }\n } catch (error) {\n logger(`Error checking Model cache for duplicates: ${error}`)\n // Continue with database check\n }\n \n // Also check database for models (in case they're persisted but not in Schema context)\n if (db) {\n const modelSchemaSchemaMod = await import('../../../seedSchema/ModelSchemaSchema')\n const { modelSchemas } = modelSchemaSchemaMod\n const schemaSchemaMod = await import('../../../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n \n // Query all models for this schema to check for duplicates (case-insensitive)\n logger(`Checking database for duplicate model names in schema \"${schemaName}\"`)\n const allModelsForSchema = await db\n .select({\n name: modelsTable.name,\n })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(eq(schemasTable.name, schemaName))\n \n logger(`Found ${allModelsForSchema.length} models in database for schema \"${schemaName}\": ${allModelsForSchema.map((m: { name: string | null }) => m.name).join(', ')}`)\n if (allModelsForSchema.length === 0 && modelName.includes('Shared')) {\n logger(`[DEBUG] No models found in database for schema \"${schemaName}\" when checking for duplicate \"${modelName}\"`)\n }\n \n // Check for exact match (case-insensitive) or matches with number suffix\n for (const dbModel of allModelsForSchema) {\n const lowerDbName = dbModel.name.toLowerCase()\n if (lowerDbName === lowerModelName) {\n existingNumbers.add(0) // Base name exists\n logger(`Found duplicate in database: \"${dbModel.name}\" matches \"${modelName}\"`)\n } else if (lowerDbName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerDbName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n logger(`Found numbered variant in database: \"${dbModel.name}\" (number: ${number})`)\n }\n }\n }\n }\n \n // If duplicates found, generate unique name\n logger(`Duplicate check results: existingNumbers=${Array.from(existingNumbers).join(', ')}, hasBaseName=${existingNumbers.has(0)}`)\n if (existingNumbers.has(0)) {\n let nextNumber = 1\n while (existingNumbers.has(nextNumber)) {\n nextNumber++\n }\n finalModelName = `${modelName} ${nextNumber}`\n logger(`Found duplicate model name \"${modelName}\" in schema \"${schemaName}\", using unique name \"${finalModelName}\"`)\n } else {\n logger(`No duplicate found for model name \"${modelName}\" in schema \"${schemaName}\"`)\n }\n } catch (error) {\n logger(`Error checking for duplicate model names: ${error}`)\n // Continue with original name if check fails\n }\n } else {\n if (foundBySchemaFileId) {\n logger(`Preserving original model name \"${modelName}\" for model found by schemaFileId (schemaFileId: ${schemaFileId})`)\n } else if (modelRecord) {\n logger(`Using existing model name \"${modelName}\" from database (modelRecord found)`)\n } else if (isInternal) {\n logger(`Preserving original model name \"${modelName}\" for internal schema \"${schemaName}\" (skipping duplicate check)`)\n }\n }\n }\n \n // Step 4: Create new empty model (not found in database or Schema context)\n logger(`Creating new model \"${finalModelName}\" in schema \"${schemaName}\"`)\n \n // Generate schemaFileId for new model\n if (!schemaFileId) {\n schemaFileId = generateId()\n logger(`Generated id (schemaFileId) \"${schemaFileId}\" for new model \"${finalModelName}\"`)\n }\n \n // Runtime creates use a placeholder cache key in Model.create; move it to the final name. Skip when schema model (_idFromSchema).\n if (!_idFromSchema) {\n const modelMod = await import('../../../Model/Model')\n const { Model } = modelMod\n Model.updateNameIndex('__pending__' + schemaFileId, finalModelName, schemaName, schemaFileId)\n }\n\n // If model name was changed, store it in a temporary internal field so loadOrCreateModelSuccess can apply it\n // This avoids the issue where updateContext with modelName triggers validation and state transition\n // We use _pendingModelName (internal field) which won't trigger validation\n if (finalModelName !== modelName) {\n logger(`Model name changed from \"${modelName}\" to \"${finalModelName}\", storing in _pendingModelName for loadOrCreateModelSuccess`)\n // Store the final name in a temporary internal field that will be picked up by loadOrCreateModelSuccess\n sendBack({\n type: 'updateContext',\n _pendingModelName: finalModelName,\n })\n } else {\n logger(`Model name unchanged: \"${modelName}\"`)\n }\n\n // Mark schema as draft when a new model is created so saveNewVersion() can persist it\n try {\n const schemaMod = await import('../../../Schema/Schema')\n const { Schema } = schemaMod\n const schema = Schema.create(schemaName, { waitForReady: false }) as import('../../../Schema/Schema').Schema\n schema.getService().send({ type: 'markAsDraft', propertyKey: 'schema:models' })\n } catch (err) {\n logger(`Failed to mark schema as draft after creating model: ${err}`)\n }\n\n sendBack({\n type: 'loadOrCreateModelSuccess',\n model: {\n id: schemaFileId, // schemaFileId (string) - public ID\n },\n })\n }\n\n _loadOrCreateModel().catch((error) => {\n logger('Error loading or creating model:', error)\n sendBack({ type: 'loadOrCreateModelError', error })\n })\n})\n\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types'\nimport { ModelMachineContext } from '../modelMachine'\n// Dynamic imports to break circular dependencies:\n// - schema/index -> ... -> validateModel -> SchemaValidationService -> schema/index\n// - Model.ts -> ... -> validateModel -> Schema.ts -> Model.ts\n// import { SchemaValidationService } from '@/Schema/service/validation/SchemaValidationService'\n// import { Schema } from '@/Schema/Schema'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:model:actors:validateModel')\n\n// Validation timeout in milliseconds (10 seconds)\nconst VALIDATION_TIMEOUT_MS = 10000\n\nexport const validateModel = fromCallback<\n EventObject,\n FromCallbackInput<ModelMachineContext>\n>(({ sendBack, input: { context } }) => {\n let hasResponded = false\n \n // Timeout handler to ensure we always respond\n const timeoutId = setTimeout(() => {\n if (!hasResponded) {\n hasResponded = true\n sendBack({\n type: 'validationError',\n errors: [{\n field: 'model',\n message: `Model validation timed out after ${VALIDATION_TIMEOUT_MS}ms`,\n code: 'validation_timeout',\n severity: 'error' as const,\n }],\n })\n }\n }, VALIDATION_TIMEOUT_MS)\n\n const _validateModel = async (): Promise<void> => {\n try {\n // Use dynamic imports to break circular dependencies\n const validationServiceMod = await import('../../../Schema/service/validation/SchemaValidationService')\n const { SchemaValidationService } = validationServiceMod\n const validationService = new SchemaValidationService()\n const schemaMod = await import('../../../Schema/Schema')\n const { Schema } = schemaMod\n \n // Validate model structure\n const structureResult = validationService.validateModelStructure(context)\n \n if (!structureResult.isValid) {\n if (!hasResponded) {\n hasResponded = true\n clearTimeout(timeoutId)\n sendBack({ type: 'validationError', errors: structureResult.errors })\n }\n return\n }\n\n // If we have schema name, validate against schema\n // CRITICAL: Use validateModelAgainstSchema which doesn't require the model to be in schema context\n // This allows validation BEFORE registration, preventing update loops\n if (context.schemaName) {\n try {\n const schema = Schema.create(context.schemaName, {\n waitForReady: false,\n }) as import('@/Schema/Schema').Schema\n const schemaSnapshot = schema.getService().getSnapshot()\n const schemaStatus = schemaSnapshot.value\n \n // Only validate against schema if it's loaded (in idle state)\n if (schemaStatus === 'idle') {\n const schemaContext = schemaSnapshot.context\n \n // Use validateModelAgainstSchema which validates the model data directly\n // without requiring it to be in schema.models. This prevents loops because:\n // 1. Model validates against schema (model NOT in schema context yet)\n // 2. If valid, model gets registered with schema\n // 3. No need for manual updates because model is already correct (liveQuery handles updates)\n const schemaResult = validationService.validateModelAgainstSchema(\n schemaContext,\n context.modelName,\n context\n )\n \n if (!schemaResult.isValid) {\n if (!hasResponded) {\n hasResponded = true\n clearTimeout(timeoutId)\n sendBack({ type: 'validationError', errors: schemaResult.errors })\n }\n return\n }\n } else {\n logger(`Schema is in ${schemaStatus} state, skipping schema validation`)\n // Continue with structure validation only\n }\n } catch (error) {\n logger('Error validating model against schema:', error)\n // Continue with structure validation only\n }\n }\n\n // All validations passed\n if (!hasResponded) {\n hasResponded = true\n clearTimeout(timeoutId)\n sendBack({ type: 'validationSuccess', errors: [] })\n }\n } catch (error) {\n if (!hasResponded) {\n hasResponded = true\n clearTimeout(timeoutId)\n logger('Error in validateModel:', error)\n sendBack({\n type: 'validationError',\n errors: [{\n field: 'model',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n })\n }\n }\n }\n\n _validateModel().catch((error) => {\n if (!hasResponded) {\n hasResponded = true\n clearTimeout(timeoutId)\n logger('Error in validateModel:', error)\n sendBack({\n type: 'validationError',\n errors: [{\n field: 'model',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n })\n }\n })\n\n return () => {\n // Cleanup function - clear timeout if actor is stopped\n clearTimeout(timeoutId)\n }\n})\n\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types'\nimport { ModelMachineContext } from '../modelMachine'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models as modelsTable, properties as propertiesTable } from '@/seedSchema/ModelSchema'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:model:actors:createModelProperties')\n\nexport const createModelProperties = fromCallback<\n EventObject,\n FromCallbackInput<ModelMachineContext> & { propertyDefinitions: { [name: string]: any } }\n>(({ sendBack, input }) => {\n const _createProperties = async (): Promise<void> => {\n const { context, propertyDefinitions } = input\n const { id, _dbId, modelName } = context\n\n console.log('createModelProperties called for', modelName, 'with id (schemaFileId)', id, 'and _dbId', _dbId)\n console.log('propertyDefinitions', propertyDefinitions)\n \n if (!id || !_dbId || !modelName) {\n throw new Error('Model ID, file ID, and name are required to create properties')\n }\n \n if (!propertyDefinitions || Object.keys(propertyDefinitions).length === 0) {\n logger('No property definitions provided, skipping property creation')\n sendBack({ type: 'createModelPropertiesSuccess' })\n return\n }\n \n logger(`Creating ${Object.keys(propertyDefinitions).length} properties for model \"${modelName}\" (id: ${_dbId})`)\n \n const mod = await import('../../../ModelProperty/ModelProperty')\n const ModelProperty = mod?.ModelProperty ?? (mod as { default?: unknown })?.default\n if (!ModelProperty) {\n logger('ModelProperty not available from dynamic import')\n sendBack({ type: 'createModelPropertiesError', error: new Error('ModelProperty not available') })\n return\n }\n const drizzleMod = await import('drizzle-orm')\n const { eq } = drizzleMod\n const db = BaseDb.getAppDb()\n \n for (const [propName, propData] of Object.entries(propertyDefinitions)) {\n // Use provided ID or generate a random one\n // IDs should be generated in the import process before creating properties\n const helpersMod = await import('../../../helpers')\n const { generateId } = helpersMod\n const propertyFileId = propData.id || generateId()\n \n logger(`Creating property \"${propName}\" with fileId \"${propertyFileId}\"`)\n \n // Query database to get refModelId if the property has ref/refModelName\n // The property should already be in DB from addModelsToDb\n let refModelId: number | undefined = propData.refModelId\n if (!refModelId && (propData.ref || propData.refModelName) && db) {\n try {\n const refModelName = propData.refModelName || propData.ref\n // First try to get refModelId from the property record in the database\n const propertyRecords = await db\n .select()\n .from(propertiesTable)\n .where(eq(propertiesTable.schemaFileId, propertyFileId))\n .limit(1)\n \n if (propertyRecords.length > 0 && propertyRecords[0].refModelId) {\n refModelId = propertyRecords[0].refModelId\n logger(`Found refModelId ${refModelId} from database for property \"${propName}\"`)\n } else if (refModelName) {\n // Fallback: query models table directly by name\n const refModelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, refModelName))\n .limit(1)\n \n if (refModelRecords.length > 0 && refModelRecords[0].id) {\n refModelId = refModelRecords[0].id\n logger(`Resolved refModelId ${refModelId} from model name \"${refModelName}\" for property \"${propName}\"`)\n }\n }\n } catch (error) {\n logger(`Error fetching refModelId for property \"${propName}\":`, error)\n // Continue without refModelId - it will be resolved later in _initializeOriginalValues\n }\n }\n \n // Create ModelProperty instance\n // This will load from DB if it exists, or create new instance\n // The property should already be in DB from writeModelToDb\n // Note: propertyFileId is the schemaFileId (string), not the database ID (number)\n // We pass it as _propertyFileId so getById() can find the instance\n await ModelProperty.create({\n name: propName,\n modelName,\n modelId: _dbId,\n dataType: propData.dataType,\n ref: propData.ref,\n refModelName: propData.refModelName,\n refModelId,\n refValueType: propData.refValueType,\n storageType: propData.storageType,\n localStorageDir: propData.localStorageDir,\n filenameSuffix: propData.filenameSuffix,\n _propertyFileId: propertyFileId, // Store schemaFileId for getById() lookups\n } as any) // Use 'as any' because _propertyFileId is not in TProperty type\n }\n \n logger(`Successfully created all properties for model \"${modelName}\"`)\n sendBack({ type: 'createModelPropertiesSuccess' })\n }\n \n _createProperties().catch((error) => {\n logger(`Error creating model properties: ${error}`)\n sendBack({ \n type: 'createModelPropertiesError', \n error: error instanceof Error ? error : new Error(String(error))\n })\n })\n \n return () => {\n // Cleanup function (optional)\n }\n})\n\n","import { fromPromise } from 'xstate'\nimport { ValidationError } from '@/Schema/validation'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:write:validateEntity')\n\nexport type ValidateEntityInput = {\n entityType: 'model' | 'modelProperty' | 'schema'\n entityData: any\n}\n\ntype ValidateEntityOutput = {\n isValid: boolean\n errors: ValidationError[]\n}\n\n// XState v5 type inference bug: fromPromise types are inverted\n// We use type assertion to work around this\nexport const validateEntity = fromPromise<\n ValidateEntityInput,\n ValidateEntityOutput\n// @ts-ignore - XState v5 type inference bug: fromPromise incorrectly expects output type to match input type\n>(async ({ input }) => {\n // Type assertion to fix XState v5 type inference bug\n // Convert through unknown to avoid type overlap error\n const entityInput = input as unknown as ValidateEntityInput\n \n const _validate = async (): Promise<ValidateEntityOutput> => {\n try {\n const msg = `[validateEntity] Starting validation for ${entityInput.entityType}`\n logger(msg)\n console.log(msg) // Always log to console\n logger(`[validateEntity] Entity data:`, entityInput.entityData)\n let result: ValidateEntityOutput = { isValid: true, errors: [] }\n\n if (entityInput.entityType === 'model') {\n const structureMsg = `[validateEntity] Validating model structure`\n logger(structureMsg)\n console.log(structureMsg) // Always log to console\n // Use existing Model validation\n const validationServiceMod = await import('../../../Schema/service/validation/SchemaValidationService')\n const { SchemaValidationService } = validationServiceMod\n const validationService = new SchemaValidationService()\n \n // Validate model structure\n const structureResult = validationService.validateModelStructure(entityInput.entityData)\n const structureResultMsg = `[validateEntity] Structure validation result: isValid=${structureResult.isValid}, errors=${structureResult.errors?.length || 0}`\n logger(structureResultMsg)\n console.log(structureResultMsg) // Always log to console\n \n if (!structureResult.isValid) {\n result = {\n isValid: false,\n errors: structureResult.errors,\n }\n } else {\n // If schema name provided, validate against schema\n if (entityInput.entityData.schemaName) {\n try {\n logger(`[validateEntity] Validating model against schema \"${entityInput.entityData.schemaName}\"`)\n const schemaMod = await import('../../../Schema/Schema')\n const { Schema } = schemaMod\n const schema = Schema.create(entityInput.entityData.schemaName, {\n waitForReady: false,\n }) as import('../../../Schema/Schema').Schema\n const schemaSnapshot = schema.getService().getSnapshot()\n const schemaStatus = schemaSnapshot.value\n logger(`[validateEntity] Schema status: ${schemaStatus}`)\n \n if (schemaStatus === 'idle') {\n const schemaContext = schemaSnapshot.context\n logger(`[validateEntity] Running validateModelAgainstSchema`)\n const schemaResult = validationService.validateModelAgainstSchema(\n schemaContext,\n entityInput.entityData.modelName,\n entityInput.entityData\n )\n logger(`[validateEntity] Schema validation result:`, schemaResult)\n \n if (!schemaResult.isValid) {\n result = {\n isValid: false,\n errors: schemaResult.errors,\n }\n }\n } else {\n logger(`[validateEntity] Schema not in idle state (${schemaStatus}), skipping schema validation`)\n }\n } catch (error) {\n logger('Error validating model against schema:', error)\n // Continue with structure validation only\n }\n } else {\n logger(`[validateEntity] No schemaName provided, skipping schema validation`)\n }\n }\n } else if (entityInput.entityType === 'modelProperty') {\n // Use existing ModelProperty validation\n const validationServiceMod = await import('../../../Schema/service/validation/SchemaValidationService')\n const { SchemaValidationService } = validationServiceMod\n const validationService = new SchemaValidationService()\n \n // Validate property structure\n const structureResult = validationService.validatePropertyStructure(entityInput.entityData)\n \n if (!structureResult.isValid) {\n result = {\n isValid: false,\n errors: structureResult.errors,\n }\n } else {\n // If schema name and model name provided, validate against schema\n if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {\n try {\n const schemaMod = await import('../../../Schema/Schema')\n const { Schema } = schemaMod\n const schema = Schema.create(entityInput.entityData._schemaName, {\n waitForReady: false,\n }) as import('@/Schema/Schema').Schema\n const schemaSnapshot = schema.getService().getSnapshot()\n const schemaStatus = schemaSnapshot.value\n \n if (schemaStatus === 'idle') {\n const schemaContext = schemaSnapshot.context\n \n if (schemaContext.models && Object.keys(schemaContext.models).length > 0) {\n const schemaResult = validationService.validateProperty(\n schemaContext,\n entityInput.entityData.modelName,\n entityInput.entityData.name || '',\n entityInput.entityData\n )\n \n if (!schemaResult.isValid) {\n result = {\n isValid: false,\n errors: schemaResult.errors,\n }\n }\n }\n }\n } catch (error) {\n logger('Error validating property against schema:', error)\n // Continue with structure validation only\n }\n }\n }\n } else if (entityInput.entityType === 'schema') {\n // Schema validation - use existing validation\n const validationServiceMod = await import('../../../Schema/service/validation/SchemaValidationService')\n const { SchemaValidationService } = validationServiceMod\n const validationService = new SchemaValidationService()\n \n const schemaResult = validationService.validateSchema(entityInput.entityData)\n \n if (!schemaResult.isValid) {\n result = {\n isValid: false,\n errors: schemaResult.errors,\n }\n }\n }\n\n // Return the result - fromPromise will automatically put this in event.output\n const completeMsg = `[validateEntity] Validation complete: isValid=${result.isValid}, errors=${result.errors?.length || 0}`\n logger(completeMsg)\n console.log(completeMsg) // Always log to console\n logger(`[validateEntity] Validation complete:`, result)\n console.log(`[validateEntity] Returning result:`, result)\n return result\n } catch (error) {\n const errorMsg = `[validateEntity] Error in validateEntity: ${error instanceof Error ? error.message : String(error)}`\n logger(errorMsg)\n console.error(errorMsg, error) // Always log to console\n logger('Error in validateEntity:', error)\n // Throw error - fromPromise will automatically create error.platform event\n throw error\n }\n }\n\n return await _validate()\n// @ts-ignore - XState v5 type inference bug: fromPromise incorrectly expects output type to match input type\n}) as any\n\n","import { InferSelectModel } from 'drizzle-orm'\nimport { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\n\nexport const seeds = sqliteTable(\n 'seeds',\n {\n localId: text('local_id').unique(),\n uid: text('uid'),\n schemaUid: text('schema_uid'),\n type: text('type'),\n publisher: text('publisher'),\n attestationRaw: text('attestation_raw'),\n attestationCreatedAt: int('attestation_created_at'),\n createdAt: int('created_at'),\n updatedAt: int('updated_at'),\n _markedForDeletion: int('_marked_for_deletion'),\n },\n // {\n // triggers: [\n // sql<string>`CREATE TRIGGER IF NOT EXISTS seeds_created_at_trigger\n // BEFORE INSERT\n // ON seeds\n // FOR EACH ROW\n // BEGIN\n // SELECT strftime('%s', 'now') * 1000 INTO NEW.created_at;\n // END;`,\n // ],\n // },\n)\n\nexport type SeedType = InferSelectModel<typeof seeds>\n","import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\nimport { InferSelectModel } from 'drizzle-orm'\n\nexport const versions = sqliteTable('versions', {\n localId: text('local_id').unique(),\n uid: text('uid'),\n seedLocalId: text('seed_local_id'),\n seedUid: text('seed_uid'),\n seedType: text('seed_type'),\n note: text('note'),\n createdAt: int('created_at'),\n updatedAt: int('updated_at'),\n attestationCreatedAt: int('attestation_created_at'),\n attestationRaw: text('attestation_raw'),\n})\n\nexport type VersionsType = InferSelectModel<typeof versions>\n","import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\nimport { InferSelectModel } from 'drizzle-orm'\n\nexport const metadata = sqliteTable('metadata', {\n localId: text('local_id').unique(),\n uid: text('uid'),\n propertyName: text('property_name'),\n propertyValue: text('property_value'),\n schemaUid: text('schema_uid'),\n modelType: text('model_type'),\n seedLocalId: text('seed_local_id'),\n seedUid: text('seed_uid'),\n versionLocalId: text('version_local_id'),\n versionUid: text('version_uid'),\n easDataType: text('eas_data_type'),\n refValueType: text('ref_value_type'),\n refModelUid: text('ref_schema_uid'),\n refSeedType: text('ref_seed_type'),\n refResolvedValue: text('ref_resolved_value'),\n refResolvedDisplayValue: text('ref_resolved_display_value'),\n localStorageDir: text('local_storage_dir'),\n attestationRaw: text('attestation_raw'),\n attestationCreatedAt: int('attestation_created_at'),\n contentHash: text('content_hash'),\n createdAt: int('created_at'),\n updatedAt: int('updated_at'),\n})\n\nexport type MetadataType = InferSelectModel<typeof metadata>\n","import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\nimport { InferSelectModel } from 'drizzle-orm'\nexport const appState = sqliteTable('appState', {\n key: text('key').unique(),\n value: text('value'),\n createdAt: int('created_at'),\n updatedAt: int('updated_at'),\n})\n\nexport type appStateType = InferSelectModel<typeof appState>\n","import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\nimport { relations } from 'drizzle-orm'\nimport { models } from './ModelSchema'\n\nexport const modelUids = sqliteTable('model_uids', {\n id: int('id').primaryKey({ autoIncrement: true }),\n uid: text('uid').notNull(),\n modelId: int('model_id')\n .notNull()\n .unique()\n .references(() => models.id),\n})\n\nexport const modelRelations = relations(modelUids, ({ one }) => ({\n model: one(models),\n}))\n","import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'\nimport { relations } from 'drizzle-orm'\nimport { models, properties } from './ModelSchema'\n\nexport const propertyUids = sqliteTable('property_uids', {\n id: int('id').primaryKey({ autoIncrement: true }),\n uid: text('uid').notNull(),\n propertyId: int('property_id')\n .notNull()\n .unique()\n .references(() => models.id),\n})\n\nexport const propertyUidRelations = relations(propertyUids, ({ one }) => ({\n property: one(properties),\n}))\n","import { integer, sqliteTable, text, blob, } from 'drizzle-orm/sqlite-core'\nimport { InferSelectModel } from 'drizzle-orm'\n\nexport const config = sqliteTable(\n 'config',\n {\n id: integer('id').primaryKey({ autoIncrement: true }),\n key: text('key').notNull(),\n text: text('text'),\n json: text('json'),\n blob: blob('blob'),\n }\n)\n\nexport type configType = InferSelectModel<typeof config>","import { InferSelectModel, } from 'drizzle-orm'\nimport { int, sqliteTable, text, integer, unique } from 'drizzle-orm/sqlite-core'\n\n\nexport const schemas = sqliteTable(\n 'schemas',\n {\n id: integer('id').primaryKey({ autoIncrement: true }),\n name: text('name').notNull(),\n version: integer('version').notNull(),\n schemaFileId: text('schema_file_id'), // ID from JSON file for change tracking - must be unique\n schemaData: text('schema_data'), // Full JSON schema content (SchemaFileFormat as JSON string)\n isDraft: integer('is_draft', { mode: 'boolean' }), // true if schema is in draft/editing state, false if published to file\n isEdited: integer('is_edited', { mode: 'boolean' }), // true if schema has been edited locally, false if matches schema file\n createdAt: int('created_at'),\n updatedAt: int('updated_at'),\n },\n (table) => {\n return {\n uniqueSchemaFileId: unique('unique_schema_schema_file_id').on(table.schemaFileId),\n }\n }\n)\n\nexport type SchemaType = InferSelectModel<typeof schemas>","import { integer, sqliteTable } from 'drizzle-orm/sqlite-core';\nimport { InferSelectModel } from 'drizzle-orm';\nimport { schemas } from './SchemaSchema';\nimport { models } from './ModelSchema';\n\nexport const modelSchemas = sqliteTable('model_schemas', {\n id: integer('id').primaryKey({ autoIncrement: true }),\n modelId: integer('model_id').references(() => models.id),\n schemaId: integer('schema_id').references(() => schemas.id),\n})\n\nexport type ModelSchemaType = InferSelectModel<typeof modelSchemas>","import {\n appState,\n models as modelsTable,\n NewModelRecord,\n NewPropertyRecord,\n properties,\n PropertyType,\n} from '@/seedSchema'\nimport { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy'\nimport { DbQueryResult, ModelDefinitions, ResultObject } from '@/types'\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'\nimport { SQLiteTableWithColumns } from 'drizzle-orm/sqlite-core'\nimport { and, eq, isNull, SQL } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { SchemaType, schemas } from '@/seedSchema/SchemaSchema'\nimport { modelSchemas, ModelSchemaType } from '@/seedSchema/ModelSchemaSchema'\nimport { InferInsertModel } from 'drizzle-orm'\nimport { ModelPropertyMachineContext } from '@/ModelProperty/service/modelPropertyMachine'\n// Dynamic import to break circular dependency: Model -> ... -> helpers/db -> ModelProperty -> ... -> Model\n// import { ModelProperty } from '@/ModelProperty/ModelProperty'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:helpers:db')\n\nexport const escapeSqliteString = (value: string): string => {\n if (typeof value !== 'string') {\n throw new Error(\n `Value must be a string, instead got: ${JSON.stringify(value)}`,\n )\n }\n return value.replace(/'/g, \"''\")\n}\nexport const getObjectForRow = (row: any): ResultObject => {\n const obj: ResultObject = {}\n\n row.columnNames.forEach((colName: string, index: number) => {\n const value = row.row[index]\n if (typeof value !== 'string') {\n obj[colName] = row.row[index]\n return\n }\n\n // Try to parse the value as JSON\n try {\n obj[colName] = JSON.parse(value)\n } catch (e) {\n // If it fails, just set the value as a string\n obj[colName] = value\n }\n })\n\n return obj\n}\nexport const getSqlResultObject = (\n queryResult: DbQueryResult,\n): ResultObject | ResultObject[] | undefined => {\n if (!queryResult || !queryResult.rows || queryResult.rows.length === 0) {\n return\n }\n\n let obj: ResultObject | ResultObject[] | undefined\n\n if (queryResult.rows.length === 1) {\n obj = getObjectForRow(queryResult.rows[0])\n }\n\n if (queryResult.rows.length > 1) {\n obj = queryResult.rows.reduce((acc: ResultObject[], row: any) => {\n const rowObj = getObjectForRow(row)\n\n acc.push(rowObj)\n return acc\n }, [] as ResultObject[])\n }\n\n return obj\n}\nexport const createOrUpdate = async <T>(\n db: BetterSQLite3Database | SqliteRemoteDatabase,\n table: SQLiteTableWithColumns<any>,\n values: Partial<Record<keyof T, T[keyof T]>>,\n) => {\n const startTime = Date.now()\n\n const valueFilters: SQL[] = []\n\n const propertiesToExcludeFromDb = ['ref']\n\n const safeValues = Object.keys(values).reduce(\n (acc, key) => {\n if (!propertiesToExcludeFromDb.includes(key)) {\n acc[key] = values[key as string & keyof T]\n }\n return acc\n },\n {} as Record<string, unknown>,\n )\n\n for (const [key, value] of Object.entries(safeValues)) {\n let finalValue = value\n if (key === 'TObject') {\n continue\n }\n if (typeof value === 'object') {\n finalValue = JSON.stringify(value)\n }\n const column = table[key]\n if (!column) {\n throw new Error(`Column not found for ${key}`)\n }\n if (typeof finalValue === 'undefined') {\n finalValue = null\n }\n if (finalValue === null) {\n valueFilters.push(isNull(table[key]))\n continue\n }\n valueFilters.push(eq(table[key], finalValue))\n }\n\n const doneWithFilters = Date.now()\n\n // console.log('valueFilters:', valueFilters)\n\n // for ( const filter of valueFilters ) {\n // console.log('filter:', Object.keys(filter))\n // }\n\n // Build a query to find the record based on properties\n const existingRecords = await db\n .select()\n .from(table)\n .where(and(...valueFilters))\n\n const doneWithExistingRecords = Date.now()\n\n if (existingRecords.length > 1) {\n throw new Error('Multiple records found')\n }\n\n if (existingRecords.length > 0) {\n // If record exists, update it\n await db\n .update(table)\n .set(safeValues)\n .where(and(...valueFilters))\n\n const doneWithUpdate = Date.now()\n\n return existingRecords[0] as T\n } else {\n // If no record exists, create a new one\n const newRecord = await db.insert(table).values(safeValues).returning()\n return newRecord[0] as T\n }\n}\n\n/**\n * Searches the database for an existing schema by schemaFileId (preferred) or name and creates it if it doesn't exist\n * @param schema - The schema to add to the database\n * @param schemaFileId - Optional schemaFileId from JSON file for change tracking\n * @param schemaData - Optional full schema content as JSON string (SchemaFileFormat)\n * @param isDraft - Optional flag indicating if schema is in draft state (default: false)\n * @param isEdited - Optional flag indicating if schema has been edited locally (default: false)\n * @returns The schema record (either existing or newly created)\n */\nexport const addSchemaToDb = async (\n schema: Omit<SchemaType, 'id' | 'schemaFileId' | 'schemaData' | 'isDraft' | 'isEdited'>,\n schemaFileId?: string,\n schemaData?: string,\n isDraft?: boolean,\n isEdited?: boolean,\n): Promise<typeof schemas.$inferSelect> => {\n const db = BaseDb.getAppDb()\n\n if (!db) {\n throw new Error('Database not found')\n }\n\n // First, try to find existing schema by schemaFileId (preferred for change tracking)\n if (schemaFileId) {\n const existingByFileId = await db\n .select()\n .from(schemas)\n .where(eq(schemas.schemaFileId, schemaFileId))\n .limit(1)\n\n if (existingByFileId.length > 0) {\n // Update fields if provided\n const updates: Partial<typeof schemas.$inferInsert> = {}\n if (schemaFileId && !existingByFileId[0].schemaFileId) {\n updates.schemaFileId = schemaFileId\n }\n // Always update name if it's different (handles name changes)\n if (schema.name && existingByFileId[0].name !== schema.name) {\n updates.name = schema.name\n }\n if (schemaData !== undefined) {\n updates.schemaData = schemaData\n }\n if (schema.version !== undefined && existingByFileId[0].version !== schema.version) {\n updates.version = schema.version\n }\n if (isDraft !== undefined && existingByFileId[0].isDraft !== isDraft) {\n updates.isDraft = isDraft\n }\n if (isEdited !== undefined && existingByFileId[0].isEdited !== isEdited) {\n updates.isEdited = isEdited\n }\n if (schema.updatedAt && existingByFileId[0].updatedAt !== schema.updatedAt) {\n updates.updatedAt = schema.updatedAt\n }\n if (Object.keys(updates).length > 0) {\n await db\n .update(schemas)\n .set(updates)\n .where(eq(schemas.id, existingByFileId[0].id!))\n return { ...existingByFileId[0], ...updates }\n }\n return existingByFileId[0]\n }\n }\n\n // For drafts, check if there's an existing draft by name (not by schemaFileId)\n if (isDraft === true) {\n const existingDrafts = await db\n .select()\n .from(schemas)\n .where(eq(schemas.name, schema.name))\n .limit(1)\n\n if (existingDrafts.length > 0 && existingDrafts[0].isDraft === true) {\n // Update existing draft\n const updates: Partial<typeof schemas.$inferInsert> = {}\n // Update schemaFileId if provided and different from existing\n if (schemaFileId && existingDrafts[0].schemaFileId !== schemaFileId) {\n updates.schemaFileId = schemaFileId\n }\n if (schemaData !== undefined) {\n updates.schemaData = schemaData\n }\n if (schema.version !== undefined) {\n updates.version = schema.version\n }\n updates.updatedAt = schema.updatedAt || Date.now()\n \n if (Object.keys(updates).length > 0) {\n await db\n .update(schemas)\n .set(updates)\n .where(eq(schemas.id, existingDrafts[0].id!))\n return { ...existingDrafts[0], ...updates }\n }\n return existingDrafts[0]\n }\n }\n\n // Fallback: Search for existing schema by name\n // BUT: If we have a schemaFileId, also check if any record with that schemaFileId exists\n // (in case the name changed but we're looking up by the new name)\n if (schemaFileId) {\n // Double-check by schemaFileId - maybe the name changed and we're looking up by new name\n const doubleCheckByFileId = await db\n .select()\n .from(schemas)\n .where(eq(schemas.schemaFileId, schemaFileId))\n .limit(1)\n \n if (doubleCheckByFileId.length > 0) {\n // Found by schemaFileId - update it (name might have changed)\n const updates: Partial<typeof schemas.$inferInsert> = {}\n // Always update name if it's different (handles name changes)\n if (schema.name && doubleCheckByFileId[0].name !== schema.name) {\n updates.name = schema.name\n }\n if (schemaData !== undefined) {\n updates.schemaData = schemaData\n }\n if (schema.version !== undefined && doubleCheckByFileId[0].version !== schema.version) {\n updates.version = schema.version\n }\n if (isDraft !== undefined && doubleCheckByFileId[0].isDraft !== isDraft) {\n updates.isDraft = isDraft\n }\n if (isEdited !== undefined && doubleCheckByFileId[0].isEdited !== isEdited) {\n updates.isEdited = isEdited\n }\n if (schema.updatedAt && doubleCheckByFileId[0].updatedAt !== schema.updatedAt) {\n updates.updatedAt = schema.updatedAt\n }\n if (Object.keys(updates).length > 0) {\n await db\n .update(schemas)\n .set(updates)\n .where(eq(schemas.id, doubleCheckByFileId[0].id!))\n return { ...doubleCheckByFileId[0], ...updates }\n }\n return doubleCheckByFileId[0]\n }\n }\n \n // Final fallback: Search by name (only if no schemaFileId or schemaFileId lookup failed)\n // If isDraft is explicitly false, first try to find non-draft, but also check for drafts\n // to handle the case where a draft exists and we're loading a non-draft version\n let existingSchemas = await db\n .select()\n .from(schemas)\n .where(\n isDraft === false\n ? and(eq(schemas.name, schema.name), eq(schemas.isDraft, false))\n : eq(schemas.name, schema.name)\n )\n .limit(1)\n\n // If isDraft is false and we didn't find a non-draft, check for a draft with the same name\n // This handles the case where a draft was created first and we're now loading the non-draft version\n if (isDraft === false && existingSchemas.length === 0) {\n const draftSchemas = await db\n .select()\n .from(schemas)\n .where(and(eq(schemas.name, schema.name), eq(schemas.isDraft, true)))\n .limit(1)\n \n if (draftSchemas.length > 0) {\n // Found a draft - we'll update it to non-draft below\n logger(`Found draft schema \"${schema.name}\" with schemaFileId \"${draftSchemas[0].schemaFileId}\", will update to non-draft with schemaFileId \"${schemaFileId}\"`)\n existingSchemas = draftSchemas\n }\n }\n\n if (existingSchemas.length > 0) {\n // Update fields if provided\n const updates: Partial<typeof schemas.$inferInsert> = {}\n // Update schemaFileId if provided and different from existing (or if existing doesn't have one or is null)\n // This is important for preserving IDs from schema files when drafts exist\n // BUT: Don't overwrite a non-draft schema's schemaFileId with a new generated one\n // This prevents loadOrCreateSchema from overwriting correct IDs from fixture files\n if (schemaFileId && existingSchemas[0].schemaFileId !== schemaFileId) {\n // Only update if:\n // 1. Existing schema is a draft (can be updated)\n // 2. Existing schema has no schemaFileId (should be set)\n // 3. We're explicitly setting isDraft to false (updating from draft to non-draft)\n const shouldUpdate = existingSchemas[0].isDraft === true || \n !existingSchemas[0].schemaFileId || \n (isDraft === false && existingSchemas[0].isDraft === true)\n \n if (shouldUpdate) {\n logger(`Updating schemaFileId from \"${existingSchemas[0].schemaFileId}\" to \"${schemaFileId}\" for schema \"${schema.name}\"`)\n updates.schemaFileId = schemaFileId\n } else {\n logger(`Preserving existing schemaFileId \"${existingSchemas[0].schemaFileId}\" for non-draft schema \"${schema.name}\" (new schemaFileId \"${schemaFileId}\" would overwrite it)`)\n }\n }\n // Always update name if it's different (handles name changes)\n if (schema.name && existingSchemas[0].name !== schema.name) {\n updates.name = schema.name\n }\n if (schemaData !== undefined) {\n updates.schemaData = schemaData\n }\n if (schema.version !== undefined && existingSchemas[0].version !== schema.version) {\n updates.version = schema.version\n }\n // If isDraft is explicitly false and we found a draft, update it to non-draft\n if (isDraft === false && existingSchemas[0].isDraft === true) {\n updates.isDraft = false\n } else if (isDraft !== undefined && existingSchemas[0].isDraft !== isDraft) {\n updates.isDraft = isDraft\n }\n if (isEdited !== undefined && existingSchemas[0].isEdited !== isEdited) {\n updates.isEdited = isEdited\n }\n if (schema.updatedAt && existingSchemas[0].updatedAt !== schema.updatedAt) {\n updates.updatedAt = schema.updatedAt\n }\n if (Object.keys(updates).length > 0) {\n logger(`Applying updates to schema \"${schema.name}\" (id: ${existingSchemas[0].id}):`, Object.keys(updates))\n await db\n .update(schemas)\n .set(updates)\n .where(eq(schemas.id, existingSchemas[0].id!))\n const updated = { ...existingSchemas[0], ...updates }\n logger(`Schema \"${schema.name}\" updated. New schemaFileId: \"${updated.schemaFileId}\", isDraft: ${updated.isDraft}`)\n return updated\n }\n logger(`No updates needed for schema \"${schema.name}\" (id: ${existingSchemas[0].id})`)\n return existingSchemas[0]\n }\n\n // Create schema if it doesn't exist\n type NewSchemaRecord = InferInsertModel<typeof schemas>\n const newSchema = await db.insert(schemas).values({\n name: schema.name,\n version: schema.version,\n schemaFileId: schemaFileId || null,\n schemaData: schemaData || null,\n isDraft: isDraft ?? false,\n isEdited: isEdited ?? false,\n createdAt: schema.createdAt,\n updatedAt: schema.updatedAt,\n } as NewSchemaRecord).returning()\n\n return newSchema[0]\n}\n\n/**\n * Rename a model in the database\n * Updates the model name and all properties that reference it\n * @param oldName - The current model name\n * @param newName - The new model name\n * @returns The updated model record\n */\nexport const renameModelInDb = async (\n oldName: string,\n newName: string,\n): Promise<NewModelRecord> => {\n const db = BaseDb.getAppDb()\n\n if (!db) {\n throw new Error('Database not found')\n }\n\n // Find the model by old name\n const existingModels = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, oldName))\n .limit(1)\n\n if (existingModels.length === 0) {\n // Model doesn't exist, create it with new name\n const newModel = await db.insert(modelsTable).values({ name: newName }).returning()\n return newModel[0] as NewModelRecord\n }\n\n const modelToRename = existingModels[0]\n\n // Check if a model with the new name already exists\n const existingWithNewName = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, newName))\n .limit(1)\n\n if (existingWithNewName.length > 0) {\n // New name already exists, return it\n return existingWithNewName[0] as NewModelRecord\n }\n\n // Update the model name\n await db\n .update(modelsTable)\n .set({ name: newName })\n .where(eq(modelsTable.id, modelToRename.id!))\n\n return { ...modelToRename, name: newName } as NewModelRecord\n}\n\n/**\n * Check if a property has been locally edited (has unsaved changes)\n * This checks both the in-memory cache (for current session) and the database\n * (for persistence across reloads) by comparing database values with schema file values.\n * @param modelName - The name of the model\n * @param propertyName - The name of the property\n * @param schemaFileValue - Optional schema file value to compare against database\n * @returns true if the property is marked as edited, false otherwise\n */\nasync function checkIfPropertyIsEdited(\n modelName: string,\n propertyName: string,\n schemaFileValue?: { dataType?: string; ref?: string; refValueType?: string },\n): Promise<boolean> {\n try {\n const cacheKey = `${modelName}:${propertyName}`\n \n // First, check the in-memory cache (for current session edits)\n // Robust dynamic import for consumer re-bundling (named or default export)\n const mod = await import('../ModelProperty/ModelProperty')\n const ModelProperty = mod?.ModelProperty ?? (mod as { default?: unknown })?.default\n if (!ModelProperty) {\n logger('ModelProperty not available from dynamic import')\n return false\n }\n type ModelPropertyInstance = InstanceType<typeof ModelProperty>\n const ModelPropertyClass = ModelProperty as typeof ModelProperty & {\n instanceCache: Map<string, { instance: ModelPropertyInstance; refCount: number }>\n }\n \n const cachedInstance = ModelPropertyClass.instanceCache.get(cacheKey)\n \n if (cachedInstance) {\n const modelProperty = cachedInstance.instance\n const context = modelProperty.getService().getSnapshot().context\n \n // Check if the property is marked as edited in memory\n if (context._isEdited === true) {\n return true\n }\n }\n \n // If not in cache, check the database by comparing with schema file value\n if (schemaFileValue) {\n const db = BaseDb.getAppDb()\n if (db) {\n // Find the model\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n \n if (modelRecords.length > 0) {\n const modelRecord = modelRecords[0]\n \n // Find the property in the database\n const propertyRecords = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, propertyName),\n eq(properties.modelId, modelRecord.id!),\n ),\n )\n .limit(1)\n \n if (propertyRecords.length > 0) {\n const dbProperty = propertyRecords[0]\n \n // Compare database value with schema file value\n // If they differ, the property has been edited\n if (dbProperty.dataType !== schemaFileValue.dataType) {\n logger(`Property ${modelName}:${propertyName} has been edited (dataType differs: DB=${dbProperty.dataType}, Schema=${schemaFileValue.dataType})`)\n return true\n }\n \n // Check refModelId if it's a relation\n if (schemaFileValue.ref) {\n const refModelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, schemaFileValue.ref))\n .limit(1)\n \n if (refModelRecords.length > 0) {\n const expectedRefModelId = refModelRecords[0].id\n if (dbProperty.refModelId !== expectedRefModelId) {\n logger(`Property ${modelName}:${propertyName} has been edited (refModelId differs)`)\n return true\n }\n }\n } else if (dbProperty.refModelId !== null) {\n // Schema file has no ref, but DB has one\n logger(`Property ${modelName}:${propertyName} has been edited (refModelId differs)`)\n return true\n }\n \n // Check refValueType\n if (dbProperty.refValueType !== (schemaFileValue.refValueType || null)) {\n logger(`Property ${modelName}:${propertyName} has been edited (refValueType differs)`)\n return true\n }\n }\n }\n }\n }\n \n return false\n } catch (error) {\n // If we can't check, assume it's not edited to be safe\n logger('Error checking if property is edited:', error)\n return false\n }\n}\n\n/**\n * Adds models and their properties to the database.\n * Optionally connects models to a schema via join records.\n * @param models - The model definitions to add\n * @param schema - Optional schema to connect models to\n * @param modelRenames - Optional map of old model names to new model names for handling renames\n * @param schemaFileData - Optional object containing schemaFileId mappings from JSON file: { schemaFileId, modelFileIds: Map<modelName, id>, propertyFileIds: Map<modelName, Map<propertyName, id>> }\n */\nexport const addModelsToDb = async (\n models: ModelDefinitions,\n schema?: SchemaType,\n modelRenames?: Map<string, string>,\n schemaFileData?: {\n schemaFileId?: string\n modelFileIds?: Map<string, string>\n propertyFileIds?: Map<string, Map<string, string>>\n },\n) => {\n const db = BaseDb.getAppDb()\n\n if (!db) {\n throw new Error('Database not found')\n }\n\n console.log('[addModelsToDb] models', models)\n\n // If schema is provided, add it to the database\n // Note: schema might already be a database record (with id) if passed from importJsonSchema\n let schemaRecord: typeof schemas.$inferSelect | undefined\n if (schema) {\n // Check if schema already has an id (it's already a database record)\n // SchemaType includes id, so check if it's set\n if (schema.id !== null && schema.id !== undefined) {\n schemaRecord = schema\n logger(`Using existing schema record with id: ${schemaRecord.id}`)\n } else {\n schemaRecord = await addSchemaToDb(schema, schemaFileData?.schemaFileId)\n logger(`Created/found schema record with id: ${schemaRecord.id}`)\n }\n }\n\n // Handle model renames first if provided\n if (modelRenames) {\n for (const [oldName, newName] of modelRenames.entries()) {\n await renameModelInDb(oldName, newName)\n }\n }\n\n // Search for all models by schemaFileId (preferred) or name and create them if they don't exist\n const modelRecords = new Map<string, NewModelRecord>()\n const modelProcessingErrors: Array<{ modelName: string; error: string }> = []\n \n console.log(`[addModelsToDb] Starting to process ${Object.keys(models).length} models: ${Object.keys(models).join(', ')}`)\n \n for (const [modelName, modelClass] of Object.entries(models)) {\n try {\n const modelFileId = schemaFileData?.modelFileIds?.get(modelName)\n \n // First try to find by schemaFileId if available\n let modelRecord: NewModelRecord | undefined\n if (modelFileId) {\n const existingByFileId = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (existingByFileId.length > 0) {\n modelRecord = existingByFileId[0] as NewModelRecord\n // Update name if it changed\n if (modelRecord.name !== modelName) {\n await db\n .update(modelsTable)\n .set({ name: modelName })\n .where(eq(modelsTable.id, modelRecord.id!))\n modelRecord = { ...modelRecord, name: modelName }\n }\n }\n }\n \n // Fallback to finding by name, but ONLY if we don't have a modelFileId\n // If we have a modelFileId, we should create a new record with it (don't reuse existing by name)\n if (!modelRecord) {\n if (modelFileId) {\n // We have a modelFileId but no existing record - create new with the correct schemaFileId\n // Double-check before insert to avoid race conditions\n const doubleCheck = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (doubleCheck.length > 0) {\n modelRecord = doubleCheck[0] as NewModelRecord\n logger(`Model with schemaFileId \"${modelFileId}\" was created by another process, using existing record`)\n } else {\n try {\n const newModel = await db.insert(modelsTable).values({\n name: modelName,\n schemaFileId: modelFileId,\n isEdited: false, // Set isEdited = false when loading from schema file\n }).returning()\n modelRecord = newModel[0] as NewModelRecord\n logger(`Created new model \"${modelName}\" with schemaFileId \"${modelFileId}\"`)\n } catch (error: any) {\n // Handle unique constraint violation\n if (error?.code === 'SQLITE_CONSTRAINT_UNIQUE' || error?.message?.includes('UNIQUE constraint')) {\n logger(`Unique constraint violation for schemaFileId \"${modelFileId}\", attempting to find existing model`)\n const existing = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n if (existing.length > 0) {\n modelRecord = existing[0] as NewModelRecord\n logger(`Found existing model with schemaFileId \"${modelFileId}\" (id: ${modelRecord.id}) after constraint violation`)\n } else {\n throw new Error(`Failed to create or find model \"${modelName}\" with schemaFileId \"${modelFileId}\": ${error.message}`)\n }\n } else {\n throw error\n }\n }\n }\n } else {\n // No modelFileId - use createOrUpdate (finds by name or creates)\n modelRecord = await createOrUpdate<NewModelRecord>(db, modelsTable, {\n name: modelName,\n })\n }\n }\n \n // Update schemaFileId if we have it and it's not set (or if it's different)\n if (modelFileId && modelRecord.schemaFileId !== modelFileId) {\n // Check if another model already has this schemaFileId\n const existingWithFileId = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (existingWithFileId.length > 0 && existingWithFileId[0].id !== modelRecord.id) {\n logger(`WARNING: Model \"${modelName}\" (id: ${modelRecord.id}) conflicts with existing model \"${existingWithFileId[0].name}\" (id: ${existingWithFileId[0].id}) both trying to use schemaFileId \"${modelFileId}\"`)\n // Don't update - keep existing assignment to avoid conflicts\n } else {\n await db\n .update(modelsTable)\n .set({ schemaFileId: modelFileId })\n .where(eq(modelsTable.id, modelRecord.id!))\n modelRecord = { ...modelRecord, schemaFileId: modelFileId }\n }\n }\n \n modelRecords.set(modelName, modelRecord)\n console.log(`[addModelsToDb] Successfully processed model \"${modelName}\" (id: ${modelRecord.id}, schemaFileId: ${modelRecord.schemaFileId || 'none'})`)\n\n // Get all existing properties for this model upfront to handle renamed properties\n const allDbProperties = await db\n .select()\n .from(properties)\n .where(eq(properties.modelId, modelRecord.id!))\n \n // Track which DB properties have been matched to schema properties\n const matchedDbPropertyIds = new Set<number>()\n \n // Get properties from Model context (where they're stored as an object when Model is created)\n // modelClass.properties returns ModelProperty instances from DB, but we need the context properties\n // which are stored as an object when Model.create() is called with properties\n const modelContext = (modelClass as any)._getSnapshotContext?.() || {}\n const contextProperties = modelContext.properties || {}\n // When models are created from JSON, properties are stored as _pendingPropertyDefinitions\n const pendingProperties = modelContext._pendingPropertyDefinitions || {}\n \n // If context properties are empty, try modelClass.properties (for backward compatibility)\n // but convert ModelProperty instances to object format\n let schema: { [propertyName: string]: any } = {}\n if (Object.keys(contextProperties).length > 0) {\n schema = contextProperties\n } else if (Object.keys(pendingProperties).length > 0) {\n // Use pending property definitions (from JSON import)\n schema = pendingProperties\n } else {\n const modelHelpersMod = await import('./model')\n const { modelPropertiesToObject } = modelHelpersMod\n const modelProperties = modelClass.properties || []\n schema = modelPropertiesToObject(modelProperties)\n }\n const schemaPropertyNames = new Set(Object.keys(schema))\n\n // Search for all properties and create them if they don't exist\n // Properties are unique by name + modelId, so we search using both\n const schemaEntries = Object.entries(schema)\n console.log(`[addModelsToDb] Processing ${schemaEntries.length} properties for model ${modelName}`)\n for (let index = 0; index < schemaEntries.length; index++) {\n const [propertyName, propertyValues] = schemaEntries[index]\n console.log(`[addModelsToDb] Processing property ${modelName}:${propertyName}`, JSON.stringify(propertyValues, null, 2))\n \n if (!propertyValues) {\n throw new Error(`Property values not found for ${propertyName}`)\n }\n \n // Get property schemaFileId if available\n let propertyFileId = schemaFileData?.propertyFileIds?.get(modelName)?.get(propertyName)\n \n // If no propertyFileId from map, generate a random ID\n // IDs should be generated in the import process before calling addModelsToDb\n if (!propertyFileId) {\n const helpersIndexMod = await import('./index')\n const { generateId } = helpersIndexMod\n propertyFileId = generateId()\n logger(`Generated propertyFileId \"${propertyFileId}\" for property \"${modelName}:${propertyName}\" (not found in propertyFileIds map)`)\n }\n \n // First, try to find by schemaFileId (preferred for change tracking)\n let existingProperty: PropertyType | undefined\n if (propertyFileId) {\n existingProperty = allDbProperties.find(\n (p: PropertyType) => p.schemaFileId === propertyFileId && !matchedDbPropertyIds.has(p.id!)\n )\n }\n \n // Fallback: check if property exists by name + modelId\n if (!existingProperty) {\n existingProperty = allDbProperties.find(\n (p: PropertyType) => p.name === propertyName && !matchedDbPropertyIds.has(p.id!)\n )\n }\n\n // Prepare property values\n const propertyData: Partial<NewPropertyRecord> = {\n name: propertyName,\n modelId: modelRecord.id!,\n dataType: propertyValues.dataType,\n schemaFileId: propertyFileId || null,\n }\n\n // Handle ref property - create ref model if needed\n // Check both ref and refModelName (refModelName is set by createModelFromJson)\n let expectedRefModelId: number | null = null\n const refModelName = propertyValues.ref || propertyValues.refModelName\n if (refModelName) {\n console.log(`[addModelsToDb] Property ${modelName}:${propertyName} has ref: ${refModelName}`)\n const refModel = await createOrUpdate<NewModelRecord>(\n db,\n modelsTable,\n {\n name: refModelName,\n },\n )\n propertyData.refModelId = refModel.id ?? null\n expectedRefModelId = refModel.id ?? null\n console.log(`[addModelsToDb] Resolved refModelId ${propertyData.refModelId} for refModelName ${refModelName}`)\n } else {\n // If it's not a Relation type, ensure refModelId is null\n propertyData.refModelId = null\n console.log(`[addModelsToDb] Property ${modelName}:${propertyName} has no ref (dataType: ${propertyValues.dataType})`)\n }\n\n if (propertyValues.refValueType) {\n propertyData.refValueType = propertyValues.refValueType\n } else {\n // If refValueType is not set, ensure it's null\n propertyData.refValueType = null\n }\n\n // If not found by name, try to find by position/characteristics (for renamed properties)\n if (!existingProperty) {\n // Look for unmatched DB properties that could be this renamed property\n // Match by: same dataType, same refModelId (if applicable), and not matching any schema property name\n const potentialMatches = allDbProperties.filter((p: PropertyType) => \n !matchedDbPropertyIds.has(p.id!) &&\n !schemaPropertyNames.has(p.name) && // This DB property doesn't match any schema property name\n p.dataType === propertyValues.dataType &&\n (expectedRefModelId === null \n ? p.refModelId === null \n : p.refModelId === expectedRefModelId) &&\n (propertyValues.refValueType \n ? p.refValueType === propertyValues.refValueType \n : p.refValueType === null)\n )\n \n // If we find exactly one match, or if we're at the same position index, use it\n // For now, use the first match (could be enhanced to use position more precisely)\n if (potentialMatches.length > 0) {\n const matchedProperty = potentialMatches[0]\n existingProperty = matchedProperty\n logger(\n `Found renamed property: ${modelName}:${matchedProperty.name} -> ${propertyName} (matched by characteristics)`,\n )\n }\n }\n\n if (existingProperty) {\n // Mark this DB property as matched\n matchedDbPropertyIds.add(existingProperty.id!)\n \n // Property exists - check if it's been locally edited before updating\n // Pass the schema file value for comparison\n const isPropertyEdited = await checkIfPropertyIsEdited(\n modelName,\n existingProperty.name, // Use the DB property name for checking\n {\n dataType: propertyValues.dataType,\n ref: propertyValues.ref,\n refValueType: propertyValues.refValueType,\n },\n )\n \n if (isPropertyEdited) {\n // Property has been locally edited - skip update to preserve local changes\n logger(\n `Skipping update for property ${modelName}:${existingProperty.name} -> ${propertyName} - it has been locally edited and will be preserved`,\n )\n continue\n }\n \n // Property exists (possibly with different name) - update it with new values from schema file\n // This handles both regular updates and renames\n // Ensure schemaFileId is updated if we have it\n // Preserve existing isEdited value if it was true (local edits take precedence)\n const updateData = { ...propertyData }\n if (existingProperty.isEdited === true) {\n // Preserve isEdited = true if property was locally edited\n // Don't overwrite it with false from schema file\n delete updateData.isEdited\n } else {\n // Set isEdited = false when loading from schema file\n updateData.isEdited = false\n }\n await db\n .update(properties)\n .set(updateData)\n .where(eq(properties.id, existingProperty.id!))\n } else {\n // Property doesn't exist, create it with schemaFileId\n // Set isEdited = false when loading from schema file\n const propertyDataWithIsEdited = {\n ...propertyData,\n isEdited: false,\n }\n logger(`Creating new property ${modelName}:${propertyName} with schemaFileId: ${propertyData.schemaFileId}`)\n console.log(`[addModelsToDb] Creating new property ${modelName}:${propertyName} with schemaFileId: ${propertyData.schemaFileId}`)\n const result = await db.insert(properties).values(propertyDataWithIsEdited)\n console.log(`[addModelsToDb] Inserted property ${modelName}:${propertyName}, result:`, result)\n }\n }\n } catch (error: any) {\n const errorMessage = error?.message || String(error)\n console.error(`[addModelsToDb] Error processing model \"${modelName}\":`, errorMessage)\n logger(`Error processing model \"${modelName}\": ${errorMessage}`)\n modelProcessingErrors.push({ modelName, error: errorMessage })\n // Continue processing other models even if one fails\n }\n }\n \n if (modelProcessingErrors.length > 0) {\n console.warn(`[addModelsToDb] Errors occurred while processing ${modelProcessingErrors.length} model(s):`, modelProcessingErrors.map(e => `${e.modelName}: ${e.error}`).join('; '))\n logger(`Errors processing models: ${modelProcessingErrors.map(e => e.modelName).join(', ')}`)\n }\n \n console.log(`[addModelsToDb] Finished processing models. Successfully processed: ${modelRecords.size}/${Object.keys(models).length}`)\n\n // If schema was provided, create modelSchema join records to connect models to the schema\n if (schemaRecord && schemaRecord.id) {\n // Check for existing records first since there's no unique constraint\n const createdJoinEntries: string[] = []\n const existingJoinEntries: string[] = []\n \n for (const [modelName, modelRecord] of modelRecords.entries()) {\n if (!modelRecord.id) {\n logger(`Skipping join table entry for ${modelName}: model record has no id`)\n continue\n }\n \n const existingJoinRecords = await db\n .select()\n .from(modelSchemas)\n .where(\n and(\n eq(modelSchemas.modelId, modelRecord.id),\n eq(modelSchemas.schemaId, schemaRecord.id),\n ),\n )\n .limit(1)\n\n if (existingJoinRecords.length === 0) {\n console.log(`[addModelsToDb] Creating join table entry for model \"${modelName}\" (id: ${modelRecord.id}) to schema (id: ${schemaRecord.id})`)\n // Only provide modelId and schemaId - id is auto-increment and should not be included\n // Don't use type cast - let Drizzle infer the correct type without id\n await db.insert(modelSchemas).values({\n modelId: modelRecord.id,\n schemaId: schemaRecord.id,\n })\n logger(`Created join table entry for model ${modelName} (id: ${modelRecord.id}) to schema (id: ${schemaRecord.id})`)\n createdJoinEntries.push(modelName)\n } else {\n logger(`Join table entry already exists for model ${modelName} to schema (id: ${schemaRecord.id})`)\n existingJoinEntries.push(modelName)\n }\n }\n \n console.log(`[addModelsToDb] Join table entries - Created: ${createdJoinEntries.join(', ') || 'none'}, Already existed: ${existingJoinEntries.join(', ') || 'none'}, Total models processed: ${modelRecords.size}`)\n \n // Verify all models are linked (important for debugging)\n const allLinkedModels = await db\n .select({\n modelId: modelSchemas.modelId,\n modelName: modelsTable.name,\n })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaRecord.id))\n \n const linkedModelNames = allLinkedModels.map((m: any) => m.modelName).filter(Boolean)\n console.log(`[addModelsToDb] After processing, schema (id: ${schemaRecord.id}) has ${allLinkedModels.length} models linked: ${linkedModelNames.join(', ')}`)\n } else if (schemaRecord && !schemaRecord.id) {\n logger(`Warning: schemaRecord provided but has no id, cannot create join table entries`)\n }\n}\n\n/**\n * Loads models from the database for a given schema by querying the model_schemas join table.\n * This ensures that models added to the database (via model_schemas) are included even if\n * they're not in the schemaData JSON.\n * @param schemaId - The ID of the schema record in the database\n * @returns A map of model names to model data (compatible with SchemaFileFormat.models)\n */\nexport const loadModelsFromDbForSchema = async (\n schemaId: number,\n): Promise<{ [modelName: string]: any }> => {\n const db = BaseDb.getAppDb()\n if (!db) {\n logger('Database not found, cannot load models from DB')\n return {}\n }\n\n try {\n // Query model_schemas join table to find all models linked to this schema\n const modelSchemaRecords = await db\n .select({\n modelId: modelSchemas.modelId,\n modelName: modelsTable.name,\n })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaId))\n\n const models: { [modelName: string]: any } = {}\n\n // For each model, load its properties\n for (const { modelId, modelName } of modelSchemaRecords) {\n if (!modelId || !modelName) continue\n\n // Get all properties for this model\n const propertyRecords = await db\n .select()\n .from(properties)\n .where(eq(properties.modelId, modelId))\n\n // Reconstruct properties object\n const modelProperties: { [propertyName: string]: any } = {}\n \n for (const prop of propertyRecords) {\n // Build a basic property structure from database fields\n // Note: This is a simplified reconstruction - full property schemas\n // (like Relation details, List configs, etc.) should come from schemaData\n const propertyData: any = {\n dataType: prop.dataType,\n }\n\n // Add ref information if it's a relation\n if (prop.refModelId) {\n // Get the referenced model name\n const refModelRecords = await db\n .select({ name: modelsTable.name })\n .from(modelsTable)\n .where(eq(modelsTable.id, prop.refModelId))\n .limit(1)\n \n if (refModelRecords.length > 0) {\n propertyData.ref = refModelRecords[0].name\n }\n }\n\n if (prop.refValueType) {\n propertyData.refValueType = prop.refValueType\n }\n\n modelProperties[prop.name] = propertyData\n }\n\n // Create model structure\n models[modelName] = {\n properties: modelProperties,\n // Note: description would need to be stored separately\n // or reconstructed from schemaData if available\n }\n }\n\n logger(`Loaded ${Object.keys(models).length} models from database for schema ${schemaId}`)\n return models\n } catch (error) {\n logger(`Error loading models from database for schema ${schemaId}:`, error)\n return {}\n }\n}\n\n/**\n * Returns model name by database model ID.\n */\nexport async function getModelNameByModelId(modelId: number): Promise<string | undefined> {\n const db = BaseDb.getAppDb()\n if (!db) return undefined\n try {\n const rows = await db\n .select({ name: modelsTable.name })\n .from(modelsTable)\n .where(eq(modelsTable.id, modelId))\n .limit(1)\n return rows.length > 0 ? rows[0].name : undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Resolves modelName and dataType for a property by its schemaFileId (e.g. context.id).\n * Used when machine context lacks these (e.g. just-created property renamed before full context is set).\n */\nexport async function getPropertyModelNameAndDataType(\n schemaFileId: string,\n): Promise<{ modelName: string; dataType: string } | undefined> {\n const db = BaseDb.getAppDb()\n if (!db || !schemaFileId) return undefined\n try {\n const rows = await db\n .select({\n dataType: properties.dataType,\n modelId: properties.modelId,\n })\n .from(properties)\n .where(eq(properties.schemaFileId, schemaFileId))\n .limit(1)\n if (rows.length === 0) return undefined\n const modelRows = await db\n .select({ name: modelsTable.name })\n .from(modelsTable)\n .where(eq(modelsTable.id, rows[0].modelId))\n .limit(1)\n if (modelRows.length === 0) return undefined\n return {\n modelName: modelRows[0].name,\n dataType: rows[0].dataType ?? '',\n }\n } catch {\n return undefined\n }\n}\n\n/**\n * Saves a property's changes to the database without updating the JSON schema file.\n * This is used when properties are edited but the schema hasn't been saved as a new version yet.\n * @param property - The ModelPropertyMachineContext with updated values\n */\nexport const savePropertyToDb = async (\n property: ModelPropertyMachineContext,\n): Promise<void> => {\n const db = BaseDb.getAppDb()\n\n if (!db) {\n throw new Error('Database not found')\n }\n\n if (!property.modelName || !property.name) {\n throw new Error('Model name and property name are required')\n }\n\n // Find the model\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, property.modelName))\n .limit(1)\n\n if (modelRecords.length === 0) {\n throw new Error(`Model ${property.modelName} not found in database`)\n }\n\n const modelRecord = modelRecords[0]\n\n // Find existing property - try multiple strategies to handle name changes\n // 1. First try by schemaFileId (most reliable - doesn't change when name changes)\n // Use _propertyFileId first (from getPropertySchema), then id if it's a string (schemaFileId)\n const schemaFileId = property._propertyFileId || (typeof property.id === 'string' ? property.id : undefined)\n let existingProperties: any[] = []\n \n logger(`[savePropertyToDb] Looking for property ${property.modelName}:${property.name} (schemaFileId: ${schemaFileId}, originalName: ${property._originalValues?.name})`)\n \n if (schemaFileId) {\n existingProperties = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.schemaFileId, schemaFileId),\n eq(properties.modelId, modelRecord.id!),\n ),\n )\n .limit(1)\n logger(`[savePropertyToDb] Found ${existingProperties.length} properties by schemaFileId`)\n }\n \n // 2. If not found by schemaFileId, try by original name (if name was changed)\n if (existingProperties.length === 0 && property._originalValues?.name && property._originalValues.name !== property.name) {\n logger(`[savePropertyToDb] Trying to find by original name: ${property._originalValues.name}`)\n existingProperties = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, property._originalValues.name),\n eq(properties.modelId, modelRecord.id!),\n ),\n )\n .limit(1)\n logger(`[savePropertyToDb] Found ${existingProperties.length} properties by original name`)\n }\n \n // 3. Fallback: try by current name\n if (existingProperties.length === 0) {\n logger(`[savePropertyToDb] Trying to find by current name: ${property.name}`)\n existingProperties = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, property.name),\n eq(properties.modelId, modelRecord.id!),\n ),\n )\n .limit(1)\n logger(`[savePropertyToDb] Found ${existingProperties.length} properties by current name`)\n }\n\n // Prepare property data\n const propertyData: Partial<NewPropertyRecord> = {\n name: property.name,\n modelId: modelRecord.id!,\n dataType: property.dataType || '',\n }\n \n // Preserve schemaFileId if we have it\n if (schemaFileId) {\n propertyData.schemaFileId = schemaFileId\n }\n\n // Handle ref property - create ref model if needed\n if (property.refModelName) {\n const refModel = await createOrUpdate<NewModelRecord>(\n db,\n modelsTable,\n {\n name: property.refModelName,\n },\n )\n propertyData.refModelId = refModel.id\n } else if (property.refModelId) {\n propertyData.refModelId = property.refModelId\n } else {\n // If it's not a Relation type, ensure refModelId is null\n propertyData.refModelId = null\n }\n\n if (property.refValueType) {\n propertyData.refValueType = property.refValueType\n } else {\n // If refValueType is not set, ensure it's null\n propertyData.refValueType = null\n }\n\n if (existingProperties.length > 0) {\n // Property exists, update it with new values (including new name)\n // Set isEdited = true when property is edited\n const existingProperty = existingProperties[0]\n await db\n .update(properties)\n .set({\n ...propertyData,\n isEdited: true, // Mark as edited when saving changes\n })\n .where(eq(properties.id, existingProperty.id!))\n logger(`Updated property ${property.modelName}:${property._originalValues?.name || 'unknown'} -> ${property.name} in database`)\n } else {\n // Property doesn't exist, create it\n // Set isEdited = true for runtime-created properties\n await db.insert(properties).values({\n ...propertyData,\n isEdited: true, // Runtime-created properties are edited\n })\n logger(`Created property ${property.modelName}:${property.name} in database`)\n }\n}\n\ntype NormalizedAddressConfig = { owned: string[]; watched: string[] }\n\nfunction parseAddressConfig(value: string | null): NormalizedAddressConfig | null {\n if (!value) return null\n try {\n const parsed = JSON.parse(value)\n if (Array.isArray(parsed)) {\n return { owned: parsed, watched: [] }\n }\n if (parsed && typeof parsed === 'object' && Array.isArray(parsed.owned)) {\n return {\n owned: parsed.owned,\n watched: Array.isArray(parsed.watched) ? parsed.watched : [],\n }\n }\n return null\n } catch {\n return null\n }\n}\n\nexport const getOwnedAddressesFromDb = async (): Promise<string[]> => {\n const config = await getAddressConfigFromDb()\n return config?.owned ?? []\n}\n\nexport const getWatchedAddressesFromDb = async (): Promise<string[]> => {\n const config = await getAddressConfigFromDb()\n return config?.watched ?? []\n}\n\n/**\n * Returns owned + watched addresses. Use for EAS sync and file download.\n */\nexport const getAllAddressesFromDb = async (): Promise<string[]> => {\n const config = await getAddressConfigFromDb()\n if (!config) return []\n return [...config.owned, ...config.watched]\n}\n\nasync function getAddressConfigFromDb(): Promise<NormalizedAddressConfig | null> {\n const appDb = BaseDb.getAppDb()\n\n if (!appDb) {\n return new Promise((resolve) => {\n setTimeout(async () => {\n resolve(await getAddressConfigFromDb())\n }, 500)\n })\n }\n\n const appStatesRecords = await appDb\n .select()\n .from(appState)\n .where(eq(appState.key, 'addresses'))\n .limit(1)\n\n if (!appStatesRecords || appStatesRecords.length === 0) {\n return null\n }\n\n const addressArrayString = appStatesRecords[0].value\n return parseAddressConfig(addressArrayString)\n}\n\nexport const getAddressesFromDb = async (): Promise<string[]> => {\n const config = await getAddressConfigFromDb()\n if (!config || config.owned.length === 0) {\n throw new Error('No addresses found')\n }\n return config.owned\n}\n\n/**\n * Like getAddressesFromDb but returns [] instead of throwing when no addresses are configured.\n * Returns owned addresses. Use getAllAddressesFromDb for sync (owned + watched).\n */\nexport const getAddressesFromDbOptional = async (): Promise<string[]> => {\n const config = await getAddressConfigFromDb()\n return config?.owned ?? []\n}\n\n/**\n * Write model to database and create model_schemas join entry\n * @param modelFileId - The model file ID (schema_file_id)\n * @param data - Model data including modelName, schemaId, and optional properties\n */\nexport async function writeModelToDb(\n modelFileId: string,\n data: {\n modelName: string\n schemaId: number\n properties?: { [name: string]: any }\n }\n): Promise<void> {\n const db = BaseDb.getAppDb()\n if (!db) throw new Error('Database not available')\n \n // Find or create model record\n let modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n let modelId: number\n \n if (modelRecords.length === 0) {\n // Create new model record\n // Check again right before insert to avoid race conditions\n const doubleCheck = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (doubleCheck.length > 0) {\n // Another process created it, use existing\n modelId = doubleCheck[0].id!\n logger(`Model with schemaFileId \"${modelFileId}\" was created by another process, using existing record (id: ${modelId})`)\n } else {\n try {\n const newModel = await db.insert(modelsTable).values({\n name: data.modelName,\n schemaFileId: modelFileId,\n isEdited: true, // Runtime-created models are edited\n }).returning()\n modelId = newModel[0].id!\n } catch (error: any) {\n // Handle unique constraint violation\n if (error?.code === 'SQLITE_CONSTRAINT_UNIQUE' || error?.message?.includes('UNIQUE constraint')) {\n logger(`Unique constraint violation for schemaFileId \"${modelFileId}\", attempting to find existing model`)\n const existing = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n if (existing.length > 0) {\n modelId = existing[0].id!\n logger(`Found existing model with schemaFileId \"${modelFileId}\" (id: ${modelId}) after constraint violation`)\n } else {\n throw error\n }\n } else {\n throw error\n }\n }\n }\n } else {\n // Update existing model record\n modelId = modelRecords[0].id!\n const updates: Partial<NewModelRecord> = {}\n if (data.modelName !== modelRecords[0].name) {\n updates.name = data.modelName\n }\n if (Object.keys(updates).length > 0) {\n await db\n .update(modelsTable)\n .set(updates)\n .where(eq(modelsTable.id, modelId))\n }\n }\n \n // Validate that modelId and schemaId are valid before creating join entry\n if (!modelId || !Number.isInteger(modelId) || modelId <= 0) {\n throw new Error(`Invalid modelId: ${modelId}. Model record must be created successfully before creating join entry.`)\n }\n \n if (!data.schemaId || !Number.isInteger(data.schemaId) || data.schemaId <= 0) {\n throw new Error(`Invalid schemaId: ${data.schemaId}. Schema record must exist before creating join entry.`)\n }\n \n // Create model_schemas join entry\n // CRITICAL: This must happen AFTER the model record is fully saved and committed\n // The modelId comes from .returning() which ensures the record is committed\n const existingJoin = await db\n .select()\n .from(modelSchemas)\n .where(\n and(\n eq(modelSchemas.modelId, modelId),\n eq(modelSchemas.schemaId, data.schemaId)\n )\n )\n .limit(1)\n\n if (existingJoin.length === 0) {\n // Only provide modelId and schemaId - id is auto-increment and should not be included\n // Don't use type cast - let Drizzle infer the correct type without id\n \n // Verify both modelId and schemaId exist before inserting join record\n try {\n // Verify modelId exists\n const modelCheck = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .where(eq(modelsTable.id, modelId))\n .limit(1)\n \n if (modelCheck.length === 0) {\n throw new Error(`Model with id ${modelId} does not exist in database. Cannot create join record.`)\n }\n \n // Verify schemaId exists and get name/fileId for invalidation broadcast\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n const schemaCheck = await db\n .select({\n id: schemasTable.id,\n name: schemasTable.name,\n schemaFileId: schemasTable.schemaFileId,\n })\n .from(schemasTable)\n .where(eq(schemasTable.id, data.schemaId))\n .limit(1)\n \n if (schemaCheck.length === 0) {\n throw new Error(`Schema with id ${data.schemaId} does not exist in database. Cannot create join record.`)\n }\n \n logger(`Creating join record: modelId=${modelId}, schemaId=${data.schemaId} (both verified to exist)`)\n \n await db.insert(modelSchemas).values({\n modelId,\n schemaId: data.schemaId,\n })\n // Notify React useModels so it can invalidate; live query over join often doesn't re-run when model_schemas is inserted.\n // Yield so the insert is visible to the refetch that will run when the broadcast is received.\n if (typeof BroadcastChannel !== 'undefined') {\n await new Promise((r) => setTimeout(r, 10))\n const row = schemaCheck[0]\n try {\n new BroadcastChannel('seed-models-invalidate').postMessage({\n schemaName: row.name ?? undefined,\n schemaFileId: row.schemaFileId ?? undefined,\n })\n } catch (_) {}\n }\n logger(`Successfully created join record for model ${data.modelName} (id: ${modelId}) to schema (id: ${data.schemaId})`)\n } catch (error: any) {\n if (error?.code === 'SQLITE_CONSTRAINT_FOREIGNKEY') {\n logger(`FOREIGN KEY constraint failed when creating join record for model \"${data.modelName}\"`)\n logger(`modelId: ${modelId}, schemaId: ${data.schemaId}`)\n logger(`Error details:`, error)\n // Re-throw with more context\n throw new Error(`FOREIGN KEY constraint failed when creating join record for model \"${data.modelName}\" (modelId: ${modelId}, schemaId: ${data.schemaId}). ${error.message}`)\n }\n throw error\n }\n }\n \n // Write properties if provided\n if (data.properties) {\n for (const [propName, propData] of Object.entries(data.properties)) {\n // Check if property already exists in database\n const existingProps = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, propName),\n eq(properties.modelId, modelId)\n )\n )\n .limit(1)\n \n let propertyFileId: string\n if (existingProps.length > 0 && existingProps[0].schemaFileId) {\n // Use existing property's schemaFileId\n propertyFileId = existingProps[0].schemaFileId\n logger(`Using existing propertyFileId \"${propertyFileId}\" for property \"${data.modelName}:${propName}\"`)\n } else if (propData.id) {\n // Use provided ID\n propertyFileId = propData.id\n } else {\n // Generate random propertyFileId\n // IDs should be generated in the import process before calling writeModelToDb\n const helpersIndexMod = await import('./index')\n const { generateId } = helpersIndexMod\n propertyFileId = generateId()\n logger(`Generated propertyFileId \"${propertyFileId}\" for property \"${data.modelName}:${propName}\"`)\n }\n \n await writePropertyToDb(propertyFileId, {\n modelId,\n name: propName,\n ...propData,\n })\n }\n }\n \n logger(`Wrote model ${data.modelName} (${modelFileId}) to database`)\n}\n\n/**\n * Write property to database\n * @param propertyFileId - The property file ID (schema_file_id)\n * @param data - Property data including modelId, name, dataType, and other property fields\n * @param isEdited - Optional flag indicating if property has been edited locally (default: false)\n */\nexport async function writePropertyToDb(\n propertyFileId: string,\n data: {\n modelId: number\n name: string\n dataType: string\n refModelName?: string\n refModelId?: number\n refValueType?: string\n storageType?: string\n localStorageDir?: string\n filenameSuffix?: string\n [key: string]: any\n },\n isEdited: boolean = false\n): Promise<void> {\n const db = BaseDb.getAppDb()\n if (!db) throw new Error('Database not available')\n \n // Find existing property by schemaFileId first (preferred for uniqueness)\n let existingProperties = await db\n .select()\n .from(properties)\n .where(eq(properties.schemaFileId, propertyFileId))\n .limit(1)\n \n // Fallback: find by modelId and name if not found by schemaFileId\n if (existingProperties.length === 0) {\n existingProperties = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, data.name),\n eq(properties.modelId, data.modelId),\n ),\n )\n .limit(1)\n }\n \n // Prepare property data\n const propertyData: Partial<NewPropertyRecord> = {\n name: data.name,\n modelId: data.modelId,\n dataType: data.dataType || '',\n schemaFileId: propertyFileId,\n isEdited: isEdited, // Persist isEdited flag\n }\n \n // Handle ref property - create ref model if needed\n // Check refModelName first, then ref (for backwards compatibility with schema files)\n const refModelName = data.refModelName || data.ref\n if (refModelName) {\n const refModel = await createOrUpdate<NewModelRecord>(\n db,\n modelsTable,\n {\n name: refModelName,\n },\n )\n propertyData.refModelId = refModel.id\n } else if (data.refModelId) {\n propertyData.refModelId = data.refModelId\n } else {\n // If it's not a Relation type, ensure refModelId is null\n propertyData.refModelId = null\n }\n \n if (data.refValueType) {\n propertyData.refValueType = data.refValueType\n } else {\n // If refValueType is not set, ensure it's null\n propertyData.refValueType = null\n }\n \n // Note: Additional property fields like storageType, localStorageDir, filenameSuffix\n // are not stored in the properties table but may be in the schema JSON\n \n if (existingProperties.length > 0) {\n // Property exists, update it with new values\n await db\n .update(properties)\n .set(propertyData)\n .where(\n and(\n eq(properties.name, data.name),\n eq(properties.modelId, data.modelId),\n ),\n )\n logger(`Updated property ${data.name} (${propertyFileId}) in database`)\n } else {\n // Property doesn't exist, create it\n // Double-check before insert to avoid race conditions\n const doubleCheck = await db\n .select()\n .from(properties)\n .where(eq(properties.schemaFileId, propertyFileId))\n .limit(1)\n \n if (doubleCheck.length > 0) {\n // Another process created it, update it instead\n await db\n .update(properties)\n .set(propertyData)\n .where(eq(properties.id, doubleCheck[0].id!))\n logger(`Property with schemaFileId \"${propertyFileId}\" was created by another process, updated existing record`)\n } else {\n try {\n await db.insert(properties).values(propertyData)\n logger(`Created property ${data.name} (${propertyFileId}) in database`)\n } catch (error: any) {\n // Handle unique constraint violation\n if (error?.code === 'SQLITE_CONSTRAINT_UNIQUE' || error?.message?.includes('UNIQUE constraint')) {\n logger(`Unique constraint violation for property schemaFileId \"${propertyFileId}\", attempting to find existing property`)\n const existing = await db\n .select()\n .from(properties)\n .where(eq(properties.schemaFileId, propertyFileId))\n .limit(1)\n if (existing.length > 0) {\n await db\n .update(properties)\n .set(propertyData)\n .where(eq(properties.id, existing[0].id!))\n logger(`Found existing property with schemaFileId \"${propertyFileId}\" (id: ${existing[0].id}) after constraint violation, updated it`)\n } else {\n throw new Error(`Failed to create or find property \"${data.name}\" with schemaFileId \"${propertyFileId}\": ${error.message}`)\n }\n } else {\n throw error\n }\n }\n }\n }\n}\n\n/**\n * Get schema database ID from schema name or schemaFileId\n * @param schemaNameOrFileId - Schema name (string) or schemaFileId (string)\n * @returns Schema database ID\n * @throws Error if schema not found\n */\nexport async function getSchemaId(\n schemaNameOrFileId: string\n): Promise<number> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, desc } = drizzleMod\n\n // Try to find by schemaFileId first (more reliable)\n let records = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.schemaFileId, schemaNameOrFileId))\n .orderBy(desc(schemasTable.version))\n .limit(1)\n\n // If not found by schemaFileId, try by name\n if (records.length === 0) {\n records = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.name, schemaNameOrFileId))\n .orderBy(desc(schemasTable.version))\n .limit(1)\n }\n\n if (records.length === 0) {\n throw new Error(`Schema \"${schemaNameOrFileId}\" not found in database`)\n }\n\n return records[0].id\n}\n\n/**\n * Get schema database ID from schemaFileId\n * @param schemaFileId - The schema file ID\n * @returns Schema database ID\n * @throws Error if schema not found\n */\nexport async function getSchemaIdByFileId(schemaFileId: string): Promise<number> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, desc } = drizzleMod\n\n const records = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.schemaFileId, schemaFileId))\n .orderBy(desc(schemasTable.version))\n .limit(1)\n\n if (records.length === 0) {\n throw new Error(`Schema with file ID \"${schemaFileId}\" not found in database`)\n }\n\n return records[0].id\n}\n\n/**\n * Get model database ID from model name or modelFileId\n * @param modelNameOrFileId - Model name (string) or modelFileId (string)\n * @param schemaNameOrId - Optional schema name or ID to narrow search\n * @returns Model database ID\n * @throws Error if model not found\n */\nexport async function getModelId(\n modelNameOrFileId: string,\n schemaNameOrId?: string | number\n): Promise<number> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n const modelSchemaMod = await import('../seedSchema/ModelSchema')\n const { models: modelsTable } = modelSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, and, or } = drizzleMod\n\n // Try to find by modelFileId first (more reliable)\n let records = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelNameOrFileId))\n .limit(1)\n\n // If not found by modelFileId, try by name\n if (records.length === 0) {\n const conditions = [eq(modelsTable.name, modelNameOrFileId)]\n \n // If schema is provided, narrow the search\n if (schemaNameOrId !== undefined) {\n const modelSchemaSchemaMod = await import('../seedSchema/ModelSchemaSchema')\n const { modelSchemas } = modelSchemaSchemaMod\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n \n if (typeof schemaNameOrId === 'number') {\n // schemaNameOrId is schemaId\n records = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .where(\n and(\n eq(modelsTable.name, modelNameOrFileId),\n eq(modelSchemas.schemaId, schemaNameOrId)\n )\n )\n .limit(1)\n } else {\n // schemaNameOrId is schemaName\n records = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(\n and(\n eq(modelsTable.name, modelNameOrFileId),\n eq(schemasTable.name, schemaNameOrId)\n )\n )\n .limit(1)\n }\n } else {\n // No schema filter, just search by name\n records = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, modelNameOrFileId))\n .limit(1)\n }\n }\n\n if (records.length === 0) {\n const schemaInfo = schemaNameOrId ? ` in schema \"${schemaNameOrId}\"` : ''\n throw new Error(`Model \"${modelNameOrFileId}\"${schemaInfo} not found in database`)\n }\n\n return records[0].id\n}\n\n/**\n * Get model database ID from modelFileId\n * @param modelFileId - The model file ID (schema_file_id)\n * @returns Model database ID\n * @throws Error if model not found\n */\nexport async function getModelIdByFileId(modelFileId: string): Promise<number> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n const modelSchemaMod = await import('../seedSchema/ModelSchema')\n const { models: modelsTable } = modelSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq } = drizzleMod\n\n const records = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n\n if (records.length === 0) {\n throw new Error(`Model with file ID \"${modelFileId}\" not found in database`)\n }\n\n return records[0].id\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { addSchemaToDb, writeModelToDb, writePropertyToDb } from '@/helpers/db'\nimport { models as modelsTable } from '@/seedSchema/ModelSchema'\nimport { eq } from 'drizzle-orm'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:write:writeToDatabase')\n\ntype WriteToDatabaseInput = {\n entityType: 'model' | 'modelProperty' | 'schema'\n entityId: string\n entityData: any\n}\n\nexport const writeToDatabase = fromCallback<\n EventObject,\n WriteToDatabaseInput\n>(({ sendBack, input }) => {\n const _write = async (): Promise<void> => {\n try {\n const db = BaseDb.getAppDb()\n \n if (!db) {\n throw new Error('Database not available')\n }\n\n let output: any = input.entityData\n\n if (input.entityType === 'model') {\n const writeMsg = `Writing model to database: ${input.entityData.modelName} (schemaId: ${input.entityData.schemaId})`\n logger(writeMsg)\n console.log(writeMsg) // Always log to console\n logger(`Writing model to database:`, {\n modelFileId: input.entityId,\n modelName: input.entityData.modelName,\n schemaId: input.entityData.schemaId,\n })\n await writeModelToDb(input.entityId, input.entityData)\n \n // Get _dbId from database after write\n const db = BaseDb.getAppDb()\n if (db) {\n const modelRecords = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, input.entityId)) // entityId is now the schemaFileId (string)\n .limit(1)\n \n if (modelRecords.length > 0 && modelRecords[0].id) {\n output = { ...input.entityData, _dbId: modelRecords[0].id } // Store as _dbId (database integer ID)\n } else {\n output = input.entityData\n }\n } else {\n output = input.entityData\n }\n \n const successMsg = `Successfully wrote model \"${input.entityData.modelName}\" to database`\n logger(successMsg)\n console.log(successMsg) // Always log to console\n } else if (input.entityType === 'modelProperty') {\n // Use current ModelProperty context when available so a user rename before the\n // initial write completes is not overwritten by the stale requestWrite payload.\n let dataToWrite = input.entityData\n try {\n const mod = await import('../../../ModelProperty/ModelProperty')\n const ModelProperty = mod?.ModelProperty ?? (mod as { default?: unknown })?.default\n if (ModelProperty && typeof ModelProperty.getById === 'function') {\n const instance = ModelProperty.getById(input.entityId)\n if (instance && typeof (instance as any)._getSnapshotContext === 'function') {\n const ctx = (instance as any)._getSnapshotContext()\n dataToWrite = {\n ...input.entityData,\n name: ctx.name ?? input.entityData.name,\n dataType: ctx.dataType ?? input.entityData.dataType,\n refModelId: ctx.refModelId ?? input.entityData.refModelId,\n refValueType: ctx.refValueType ?? input.entityData.refValueType,\n refModelName: ctx.refModelName ?? input.entityData.refModelName,\n storageType: ctx.storageType ?? input.entityData.storageType,\n localStorageDir: ctx.localStorageDir ?? input.entityData.localStorageDir,\n filenameSuffix: ctx.filenameSuffix ?? input.entityData.filenameSuffix,\n }\n }\n }\n } catch (_) {\n // Fall back to input.entityData if instance not available\n }\n await writePropertyToDb(input.entityId, dataToWrite)\n output = input.entityData\n } else if (input.entityType === 'schema') {\n const schemaRecord = await addSchemaToDb(\n input.entityData,\n input.entityId, // schemaFileId (string)\n input.entityData.schemaData,\n input.entityData.isDraft\n )\n output = { ...input.entityData, _dbId: schemaRecord.id } // Store as _dbId (database integer ID)\n } else {\n throw new Error(`Unknown entity type: ${input.entityType}`)\n }\n\n // Send success event explicitly - callback actors don't trigger onDone\n sendBack({\n type: 'writeSuccess',\n output,\n })\n } catch (error) {\n logger('Error in writeToDatabase:', error)\n sendBack({\n type: 'writeError',\n error: error instanceof Error ? error : new Error(String(error)),\n })\n }\n }\n\n _write().catch((error) => {\n logger('Error in writeToDatabase promise:', error)\n sendBack({\n type: 'writeError',\n error: error instanceof Error ? error : new Error(String(error)),\n })\n })\n\n return () => {\n // Cleanup function (optional)\n }\n})\n\n","import { assign, setup } from 'xstate'\nimport { EventObject } from 'xstate'\nimport { ValidationError } from '@/Schema/validation'\nimport { validateEntity, type ValidateEntityInput } from './actors/validateEntity'\nimport { writeToDatabase } from './actors/writeToDatabase'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:write:writeProcessMachine')\n\nexport type WriteProcessContext = {\n entityType: 'model' | 'modelProperty' | 'schema'\n entityId: string\n entityData: any\n validationErrors: ValidationError[]\n writeStatus: 'idle' | 'validating' | 'writing' | 'success' | 'error'\n error: Error | null\n retryCount: number\n pendingWrite: {\n data: any\n timestamp: number\n } | null\n}\n\nexport type WriteProcessEvent = \n | { type: 'startWrite'; data: any }\n | { type: 'validate' }\n | { type: 'write' }\n | { type: 'writeSuccess'; output?: any }\n | { type: 'writeError'; error: Error }\n | { type: 'retry' }\n | { type: 'revert' }\n | { type: 'reset' }\n\nexport const writeProcessMachine = setup({\n types: {\n context: {} as WriteProcessContext,\n input: {} as Partial<WriteProcessContext>,\n events: {} as WriteProcessEvent,\n },\n actors: {\n validateEntity,\n writeToDatabase,\n },\n}).createMachine({\n id: 'writeProcess',\n initial: 'idle',\n context: ({ input }) => ({\n entityType: input.entityType!,\n entityId: input.entityId!,\n entityData: input.entityData || {},\n validationErrors: [],\n writeStatus: 'idle',\n error: null,\n retryCount: 0,\n pendingWrite: null,\n }),\n states: {\n idle: {\n on: {\n startWrite: {\n target: 'validating',\n actions: [\n assign({\n pendingWrite: ({ event }) => ({\n data: event.data,\n timestamp: Date.now(),\n }),\n writeStatus: 'validating',\n }),\n ({ event, context }) => {\n logger(`[startWrite] Received startWrite for ${context.entityType} \"${context.entityId}\"`)\n logger(`[startWrite] Data:`, event.data)\n },\n ],\n },\n },\n },\n validating: {\n entry: ({ context }) => {\n const msg = `[validating] Entering validating state for ${context.entityType} \"${context.entityId}\"`\n logger(msg)\n console.log(msg) // Always log to console\n logger(`[validating] Entity data:`, context.pendingWrite?.data || context.entityData)\n },\n invoke: {\n src: 'validateEntity',\n input: ({ context }: { context: WriteProcessContext }): ValidateEntityInput => {\n const entityData = context.pendingWrite?.data || context.entityData\n logger(`[validating] Invoking validateEntity with:`, { entityType: context.entityType, entityData })\n return {\n entityType: context.entityType,\n entityData,\n }\n },\n onDone: [\n {\n target: 'writing',\n guard: ({ event }) => {\n console.log(`[validating] onDone handler called, event:`, event)\n console.log(`[validating] event.output:`, event.output)\n // The output might be the result directly, or it might be wrapped in an event\n let result: { isValid: boolean; errors: ValidationError[] }\n if (event.output && typeof event.output === 'object' && 'isValid' in event.output) {\n result = event.output as unknown as { isValid: boolean; errors: ValidationError[] }\n } else if (event.output && typeof event.output === 'object' && 'type' in event.output) {\n // If it's wrapped in an event, extract the result\n result = event.output as any\n } else {\n console.error(`[validating] Unexpected event.output format! Event:`, event)\n return false\n }\n if (!result || typeof result.isValid !== 'boolean') {\n console.error(`[validating] Invalid result format! Result:`, result)\n return false\n }\n const resultMsg = `[validating] Validation result: isValid=${result.isValid}, errors=${result.errors?.length || 0}`\n logger(resultMsg)\n console.log(resultMsg) // Always log to console\n logger(`[validating] Validation result:`, result)\n return result.isValid\n },\n actions: [\n assign({\n validationErrors: [],\n writeStatus: 'writing',\n }),\n ({ context }) => {\n const msg = `[validating] Validation passed, transitioning to writing for ${context.entityType} \"${context.entityId}\"`\n logger(msg)\n console.log(msg) // Always log to console\n },\n ],\n },\n {\n target: 'error',\n actions: [\n assign({\n validationErrors: ({ event }) => {\n const result = event.output as unknown as { isValid: boolean; errors: ValidationError[] }\n return result.errors || []\n },\n writeStatus: 'error',\n error: ({ event }) => {\n const result = event.output as unknown as { isValid: boolean; errors: ValidationError[] }\n return new Error(`Validation failed: ${result.errors.map(e => e.message).join(', ')}`)\n },\n }),\n ({ context, event }) => {\n const result = event.output as unknown as { isValid: boolean; errors: ValidationError[] }\n logger(`[validating] Validation failed for ${context.entityType} \"${context.entityId}\":`, result.errors)\n },\n ],\n },\n ],\n onError: {\n target: 'error',\n actions: [\n assign({\n error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),\n writeStatus: 'error',\n }),\n ({ context, event }) => {\n const errorMsg = `[validating] Validation error for ${context.entityType} \"${context.entityId}\": ${event.error}`\n logger(errorMsg)\n console.error(errorMsg, event.error) // Always log to console\n },\n ],\n },\n },\n on: {\n reset: 'idle',\n },\n },\n writing: {\n invoke: {\n src: 'writeToDatabase',\n input: ({ context }) => {\n const entityData = context.pendingWrite?.data || context.entityData\n logger(`[writing] Calling writeToDatabase for ${context.entityType} \"${context.entityId}\"`)\n logger(`[writing] Entity data:`, entityData)\n return {\n entityType: context.entityType,\n entityId: context.entityId,\n entityData,\n }\n },\n },\n on: {\n writeSuccess: {\n target: 'success',\n actions: [\n assign({\n writeStatus: 'success',\n pendingWrite: null,\n entityData: ({ context, event }) => {\n // Update entityData with any returned data from write\n return event.output || context.entityData\n },\n }),\n ({ context }) => {\n logger(`[writing] Write successful for ${context.entityType} \"${context.entityId}\"`)\n },\n ],\n },\n writeError: {\n target: 'error',\n actions: [\n assign({\n error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),\n writeStatus: 'error',\n retryCount: ({ context }) => context.retryCount + 1,\n }),\n ({ context, event }) => {\n logger(`[writing] Write error for ${context.entityType} \"${context.entityId}\":`, event.error)\n },\n ],\n },\n reset: 'idle',\n },\n },\n success: {\n after: {\n 2000: { target: 'idle' }, // Auto-reset after 2s\n },\n on: {\n reset: 'idle',\n },\n entry: assign({\n writeStatus: 'success',\n }),\n },\n error: {\n on: {\n retry: {\n target: 'validating',\n guard: ({ context }) => context.retryCount < 3,\n actions: assign({\n error: null,\n }),\n },\n revert: {\n target: 'idle',\n actions: assign({\n pendingWrite: null,\n writeStatus: 'idle',\n error: null,\n }),\n },\n reset: 'idle',\n },\n },\n },\n})\n\n","import { assign, setup, ActorRefFrom } from 'xstate'\nimport { loadOrCreateModel } from './actors/loadOrCreateModel'\nimport { validateModel } from './actors/validateModel'\nimport { createModelProperties } from './actors/createModelProperties'\nimport { ValidationError } from '@/Schema/validation'\nimport { writeProcessMachine } from '@/services/write/writeProcessMachine'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:model:modelMachine')\n\nexport type ModelMachineContext = {\n id?: string // schemaFileId (string) - public ID\n _dbId?: number // Database integer ID - internal only\n modelName: string\n schemaName: string\n _isEdited?: boolean\n _editedProperties?: Set<string>\n _validationErrors?: ValidationError[]\n // Store original values from the JSON schema file\n _originalValues?: {\n properties?: { [propertyName: string]: any } // Serialized snapshot for comparison only\n }\n writeProcess?: ActorRefFrom<typeof writeProcessMachine> | null\n _liveQueryPropertyIds?: string[] // Property file IDs from liveQuery (like Schema._liveQueryModelIds)\n _pendingPropertyDefinitions?: { [propertyName: string]: any } // Temporary storage for properties to create\n _modelFileId?: string // Model file ID (string) - used for tracking model instances\n // Conflict detection metadata - track when data was loaded from DB\n _loadedAt?: number // Timestamp when data was loaded from DB\n _dbVersion?: number // DB version at load time\n _dbUpdatedAt?: number // DB updatedAt timestamp at load time (milliseconds)\n _idFromSchema?: boolean // True when Model.create was called with modelFileId (schema model); skip duplicate-name rename\n // Destroy lifecycle (for destroy hooks)\n _destroyInProgress?: boolean\n _destroyError?: { message: string; name?: string } | null\n}\n\nexport const modelMachine = setup({\n types: {\n context: {} as ModelMachineContext,\n input: {} as Pick<ModelMachineContext, 'modelName' | 'schemaName' | 'id' | '_pendingPropertyDefinitions' | '_idFromSchema'>,\n events: {} as\n | { type: 'updateContext'; [key: string]: any }\n | { type: 'loadOrCreateModel' }\n | { type: 'loadOrCreateModelSuccess'; model: Omit<ModelMachineContext, 'modelName' | 'schemaName' | '_isEdited' | '_editedProperties' | '_validationErrors' | '_loadedAt' | '_dbVersion' | '_dbUpdatedAt'> & Partial<Pick<ModelMachineContext, '_loadedAt' | '_dbVersion' | '_dbUpdatedAt'>> }\n | { type: 'loadOrCreateModelError'; error: Error }\n | { type: 'initializeOriginalValues'; originalValues: Partial<ModelMachineContext>; isEdited?: boolean }\n | { type: 'markAsDraft'; propertyKey: string }\n | { type: 'clearDraft' }\n | { type: 'validateModel' }\n | { type: 'validationSuccess'; errors: ValidationError[] }\n | { type: 'validationError'; errors: ValidationError[] }\n | { type: 'reloadFromDb' }\n | { type: 'requestWrite'; data: any }\n | { type: 'writeSuccess'; output: any }\n | { type: 'createModelPropertiesSuccess' }\n | { type: 'createModelPropertiesError'; error: Error }\n | { type: 'refreshProperties' }\n | { type: 'destroyStarted' }\n | { type: 'destroyDone' }\n | { type: 'destroyError'; error: unknown }\n | { type: 'clearDestroyError' },\n },\n actors: {\n loadOrCreateModel,\n validateModel,\n createModelProperties,\n writeProcessMachine,\n },\n guards: {\n isModelValid: ({ context }) => {\n return !context._validationErrors || context._validationErrors.length === 0\n },\n hasValidationErrors: ({ context }) => {\n return !!context._validationErrors && context._validationErrors.length > 0\n },\n },\n actions: {\n assignValidationErrors: assign(({ context, event }) => {\n if (event.type === 'validationError') {\n return {\n ...context,\n _validationErrors: event.errors,\n }\n }\n return context\n }),\n },\n}).createMachine({\n id: 'model',\n initial: 'loading',\n context: ({ input }) => ({\n id: input.id,\n _dbId: undefined,\n modelName: input.modelName,\n schemaName: input.schemaName,\n _pendingPropertyDefinitions: input._pendingPropertyDefinitions,\n _idFromSchema: input._idFromSchema,\n _isDraft: false,\n _editedProperties: new Set<string>(),\n _validationErrors: undefined,\n writeProcess: undefined,\n _liveQueryPropertyIds: [], // Initialize empty array\n }),\n on: {\n updateContext: [\n {\n // Always update context first (no guard, always runs)\n actions: [\n assign(({ context, event }) => {\n const newContext = { ...context } as any\n\n // Check if this is only updating internal fields\n const onlyInternalFields = Object.keys(event).every((key: string) => {\n return key === 'type' || key.startsWith('_')\n })\n\n // Update the context with new values\n for (let i = 0; i < Object.keys(event).length; i++) {\n const key = Object.keys(event)[i] as string\n if (key === 'type') {\n continue\n }\n const eventValue = (event as any)[key]\n // Ensure arrays are properly copied (create new reference)\n newContext[key] = Array.isArray(eventValue) ? [...eventValue] : eventValue\n }\n \n // Log _liveQueryPropertyIds updates for debugging\n if ((event as any)._liveQueryPropertyIds !== undefined) {\n const ids = newContext._liveQueryPropertyIds\n console.log(`[modelMachine] updateContext: Set _liveQueryPropertyIds for \"${context.modelName}\" to:`, Array.isArray(ids) ? `[${ids.length} items: ${ids.join(', ')}]` : ids)\n console.log(`[modelMachine] updateContext: Returning newContext with _liveQueryPropertyIds:`, Array.isArray(newContext._liveQueryPropertyIds) ? `[${newContext._liveQueryPropertyIds.length} items: ${newContext._liveQueryPropertyIds.join(', ')}]` : newContext._liveQueryPropertyIds)\n }\n\n // Compare with original values and set _isEdited flag (only for non-internal updates)\n // Note: properties are not in context - they're computed from ModelProperty instances\n // Property changes are tracked via ModelProperty._isEdited flags\n if (!onlyInternalFields && context._originalValues) {\n const hasChanges = Object.keys(event).some((key: string) => {\n if (key === 'type' || key.startsWith('_') || key === 'properties') return false\n const newValue = newContext[key]\n const oldValue = (context._originalValues as any)?.[key]\n \n // Deep comparison for objects/arrays\n if (typeof newValue === 'object' && typeof oldValue === 'object') {\n return JSON.stringify(newValue) !== JSON.stringify(oldValue)\n }\n return newValue !== oldValue\n })\n newContext._isEdited = hasChanges\n }\n\n // Clear validation errors on context update (will be re-validated if needed)\n newContext._validationErrors = undefined\n\n return newContext\n }),\n // Verify the context was updated and create property instances if needed\n ({ context, event, self }) => {\n if ((event as any)._liveQueryPropertyIds !== undefined) {\n const newPropertyIds = (event as any)._liveQueryPropertyIds as string[]\n // Use setTimeout to check after assign has been applied\n setTimeout(() => {\n const snapshot = self.getSnapshot()\n console.log(`[modelMachine] updateContext: After assign, snapshot.context._liveQueryPropertyIds for \"${context.modelName}\":`, Array.isArray(snapshot.context._liveQueryPropertyIds) ? `[${snapshot.context._liveQueryPropertyIds.length} items: ${snapshot.context._liveQueryPropertyIds.join(', ')}]` : snapshot.context._liveQueryPropertyIds)\n \n // Create ModelProperty instances for any new property IDs\n if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {\n // Import and create instances asynchronously (fire-and-forget)\n import('@/ModelProperty/ModelProperty').then(({ ModelProperty }) => {\n const createPromises = newPropertyIds.map(async (propertyFileId) => {\n try {\n const property = await ModelProperty.createById(propertyFileId)\n if (property) {\n logger(`[modelMachine] Created/cached ModelProperty instance for propertyFileId \"${propertyFileId}\" after _liveQueryPropertyIds update`)\n }\n } catch (error) {\n logger(`[modelMachine] Error creating ModelProperty instance for propertyFileId \"${propertyFileId}\": ${error}`)\n }\n })\n Promise.all(createPromises).catch((error) => {\n logger(`[modelMachine] Error creating property instances: ${error}`)\n })\n }).catch((error) => {\n logger(`[modelMachine] Error importing ModelProperty: ${error}`)\n })\n }\n }, 0)\n }\n },\n ],\n // Don't transition - stay in current state, context will be updated\n },\n {\n // Conditionally trigger validation for non-internal updates\n guard: ({ event }: { event: any }) => {\n return !Object.keys(event).every((key: string) => {\n return key === 'type' || key.startsWith('_')\n })\n },\n target: '.validating',\n },\n ],\n validateModel: {\n target: '.validating',\n },\n validationSuccess: {\n actions: assign(({ context, event }) => ({\n ...context,\n _validationErrors: [],\n })),\n },\n validationError: {\n actions: 'assignValidationErrors',\n },\n initializeOriginalValues: {\n actions: assign(({ context, event }) => ({\n ...context,\n _originalValues: event.originalValues as { properties?: { [propertyName: string]: any } },\n _isEdited: event.isEdited ?? false,\n _validationErrors: undefined,\n })),\n },\n markAsDraft: {\n actions: assign(({ context, event }) => ({\n ...context,\n _isEdited: true,\n _editedProperties: new Set([\n ...(context._editedProperties || []),\n event.propertyKey,\n ]),\n })),\n },\n clearDraft: {\n actions: assign(({ context }) => ({\n ...context,\n _isEdited: false,\n _editedProperties: new Set<string>(),\n _originalValues: {\n // Properties are not stored in context - they're computed from ModelProperty instances\n // Properties serialization happens separately when initializing original values\n },\n })),\n },\n destroyStarted: {\n actions: assign({ _destroyInProgress: true, _destroyError: null }),\n },\n destroyDone: {\n actions: assign({ _destroyInProgress: false }),\n },\n destroyError: {\n actions: assign(({ event }) => ({\n _destroyInProgress: false,\n _destroyError:\n event.error instanceof Error\n ? { message: event.error.message, name: event.error.name }\n : { message: String(event.error) },\n })),\n },\n clearDestroyError: {\n actions: assign({ _destroyError: null }),\n },\n },\n states: {\n loading: {\n on: {\n loadOrCreateModelSuccess: {\n target: 'idle',\n actions: assign(({ context, event }) => {\n const hasPendingProps = !!(context._pendingPropertyDefinitions && Object.keys(context._pendingPropertyDefinitions).length > 0)\n logger(`[loadOrCreateModelSuccess] Preserving _pendingPropertyDefinitions: ${hasPendingProps} (${Object.keys(context._pendingPropertyDefinitions || {}).length} properties)`)\n \n // Check if there's a pending model name update (set before this event to avoid validation trigger)\n const finalModelName = (context as any)._pendingModelName || context.modelName\n if ((context as any)._pendingModelName) {\n logger(`[loadOrCreateModelSuccess] Applying pending model name: \"${context.modelName}\" -> \"${finalModelName}\"`)\n }\n \n return {\n ...context,\n id: event.model.id, // schemaFileId (string)\n _dbId: event.model._dbId, // Database integer ID\n _isEdited: (event.model as any)._isEdited ?? false, // Load isEdited from database\n _editedProperties: new Set<string>(),\n _validationErrors: undefined,\n // Use final model name (may have been set via _pendingModelName to avoid validation trigger)\n modelName: finalModelName,\n // Clear the temporary field\n _pendingModelName: undefined,\n // Preserve _pendingPropertyDefinitions if it exists\n _pendingPropertyDefinitions: context._pendingPropertyDefinitions,\n // Preserve _liveQueryPropertyIds if provided (set by loadOrCreateModel when loading from DB)\n _liveQueryPropertyIds: (event.model as any)._liveQueryPropertyIds ?? context._liveQueryPropertyIds ?? [],\n // Preserve conflict detection metadata if provided\n _loadedAt: event.model._loadedAt,\n _dbVersion: event.model._dbVersion,\n _dbUpdatedAt: event.model._dbUpdatedAt,\n _originalValues: {\n // Properties are not stored in context - they're computed from ModelProperty instances\n // Properties will be loaded via liveQuery after model creation\n },\n }\n }),\n },\n loadOrCreateModelError: {\n target: 'error',\n },\n },\n invoke: {\n src: 'loadOrCreateModel',\n input: ({ context }) => ({ context }),\n },\n },\n idle: {\n entry: assign({\n writeProcess: ({ context, spawn }) => {\n if (!context.writeProcess && context.id) {\n logger(`[idle entry] Spawning writeProcess for model \"${context.modelName}\" (${context.id})`)\n return spawn(writeProcessMachine, {\n input: {\n entityType: 'model',\n entityId: context.id,\n entityData: {\n modelName: context.modelName,\n schemaName: context.schemaName,\n // Properties are not stored in context - they'll be provided via requestWrite event\n },\n },\n })\n }\n return context.writeProcess\n },\n }),\n on: {\n refreshProperties: {\n actions: ({ self }) => {\n // This event will be handled by the Model instance's subscription\n // The Model will call _refreshPropertiesFromDb when it receives this event\n logger(`[idle] refreshProperties event received, will be handled by Model instance`)\n },\n },\n validateModel: {\n target: 'validating',\n },\n reloadFromDb: {\n target: 'loading',\n },\n requestWrite: {\n actions: ({ context, event }) => {\n if (context.writeProcess) {\n logger(`[requestWrite] Sending startWrite to writeProcess with data:`, event.data)\n context.writeProcess.send({\n type: 'startWrite',\n data: event.data,\n })\n } else {\n logger(`[requestWrite] ERROR: writeProcess not available for model \"${context.modelName}\" (${context.id})`)\n }\n },\n },\n writeSuccess: [\n {\n guard: ({ context }) => {\n // If we have pending property definitions, transition to creatingProperties\n const hasPending = !!(context._pendingPropertyDefinitions && Object.keys(context._pendingPropertyDefinitions).length > 0)\n logger(`[writeSuccess guard] hasPending: ${hasPending}, _pendingPropertyDefinitions keys: ${context._pendingPropertyDefinitions ? Object.keys(context._pendingPropertyDefinitions).length : 0}`)\n return hasPending\n },\n target: 'creatingProperties',\n actions: assign(({ context, event }) => {\n logger(`[writeSuccess] Transitioning to creatingProperties for model \"${context.modelName}\"`)\n // Update _dbId from write output if available\n const newContext = { ...context }\n if (event.output?.id) {\n newContext._dbId = event.output.id\n logger(`[writeSuccess] Updated _dbId to ${event.output.id}`)\n }\n return newContext\n }),\n },\n {\n target: 'idle',\n actions: assign(({ context, event }) => {\n // Update _dbId from write output if available\n const newContext = { ...context }\n if (event.output?.id) {\n newContext._dbId = event.output.id\n }\n return newContext\n }),\n },\n ],\n },\n always: {\n guard: 'hasValidationErrors',\n target: 'validating',\n },\n },\n validating: {\n on: {\n validationSuccess: {\n target: 'idle',\n actions: assign(({ context, event }) => ({\n ...context,\n _validationErrors: [],\n })),\n },\n validationError: {\n target: 'idle',\n actions: 'assignValidationErrors',\n },\n },\n invoke: {\n src: 'validateModel',\n input: ({ context }) => ({ context }),\n },\n },\n creatingProperties: {\n entry: ({ context }) => {\n logger(`[creatingProperties entry] Starting property creation for model \"${context.modelName}\" with ${Object.keys(context._pendingPropertyDefinitions || {}).length} properties`)\n },\n invoke: {\n src: 'createModelProperties',\n input: ({ context }) => {\n logger(`[creatingProperties invoke] Invoking createModelProperties with ${Object.keys(context._pendingPropertyDefinitions || {}).length} property definitions`)\n return {\n context,\n propertyDefinitions: context._pendingPropertyDefinitions || {},\n }\n },\n },\n on: {\n createModelPropertiesSuccess: {\n target: 'idle',\n actions: [\n assign(({ context }) => {\n // Only clear _pendingPropertyDefinitions, preserve everything else including _liveQueryPropertyIds\n console.log(`[modelMachine] creatingProperties createModelPropertiesSuccess: Context before assign - _liveQueryPropertyIds:`, context._liveQueryPropertyIds)\n const newContext = {\n ...context,\n _pendingPropertyDefinitions: undefined,\n }\n console.log(`[modelMachine] creatingProperties createModelPropertiesSuccess: Preserving _liveQueryPropertyIds:`, newContext._liveQueryPropertyIds)\n return newContext\n }),\n ({ context, self }) => {\n // Trigger property refresh after properties are created\n // This ensures _liveQueryPropertyIds is updated in Node.js where liveQuery isn't available\n setTimeout(() => {\n self.send({ type: 'refreshProperties' })\n }, 100) // Small delay to ensure properties are written to DB\n },\n ],\n },\n createModelPropertiesError: {\n target: 'error',\n actions: ({ event }) => {\n logger('Error creating model properties:', event.error)\n },\n },\n },\n },\n error: {},\n },\n})\n\n","const ENV = (typeof process !== 'undefined' && process.env) \n ? process.env \n : (typeof window !== 'undefined' && (window as any).env) \n ? (window as any).env \n : {};\n\nconst MACHINE_ID_SCOPE = '@seedSdk'\n\nexport enum MachineIds {\n CLIENT_MANAGER = `${MACHINE_ID_SCOPE}/clientManager`,\n GLOBAL = `${MACHINE_ID_SCOPE}/global`,\n INTERNAL = `${MACHINE_ID_SCOPE}/internal`,\n EAS = `${MACHINE_ID_SCOPE}/eas`,\n ITEM = `${MACHINE_ID_SCOPE}/item`,\n ALL_ITEMS = `${MACHINE_ID_SCOPE}/allItems`,\n MODEL = `${MACHINE_ID_SCOPE}/model`,\n FILE_SYSTEM = `${MACHINE_ID_SCOPE}/fileSystem`,\n}\n\nconst { INTERNAL, GLOBAL, EAS, MODEL } = MachineIds\n\nexport enum ClientManagerState {\n UNINITIALIZED = 'uninitialized',\n PLATFORM_CLASSES_INIT = 'platformClassesInit',\n FILE_SYSTEM_INIT = 'fileSystemInit',\n DB_INIT = 'dbInit',\n SAVE_CONFIG = 'saveConfig',\n ADD_MODELS_TO_STORE = 'addModelsToStore',\n ADD_MODELS_TO_DB = 'addModelsToDb',\n PROCESS_SCHEMA_FILES = 'processSchemaFiles',\n IDLE = 'idle',\n}\n\nexport enum ClientManagerEvents {\n UPDATE_CONTEXT = 'updateContext',\n PLATFORM_CLASSES_READY = 'platformClassesReady',\n FILE_SYSTEM_READY = 'fileSystemReady',\n DB_READY = 'dbReady',\n SAVE_CONFIG_SUCCESS = 'saveConfigSuccess',\n SAVE_APP_STATE_SUCCESS = 'saveAppStateSuccess',\n SET_ADDRESSES = 'setAddresses',\n ADD_MODELS_TO_STORE_SUCCESS = 'addModelsToStoreSuccess',\n ADD_MODELS_TO_DB_SUCCESS = 'addModelsToDbSuccess',\n PROCESS_SCHEMA_FILES_SUCCESS = 'processSchemaFilesSuccess',\n}\n\nexport enum GlobalState {\n UNINITIALIZED = 'uninitialized',\n INITIALIZING = 'initializing',\n INITIALIZED = 'initialized',\n PUBLISHING_ITEM = 'publishingItem',\n ADDING_MODELS_TO_DB = 'addingModelsToDb',\n}\n\nconst {\n UNINITIALIZED: GLOBAL_UNINITIALIZED,\n INITIALIZING,\n INITIALIZED,\n PUBLISHING_ITEM,\n ADDING_MODELS_TO_DB,\n } = GlobalState\n\nexport enum InternalState {\n IDLE = 'idle',\n INITIALIZING = 'initializing',\n VALIDATING_INPUT = 'validatingInput',\n CONFIGURING_FS = 'configuringFs',\n LOADING_SEED_DB = 'loadingSeedDb',\n SAVING_CONFIG = 'savingConfig',\n LOADING_APP_DB = 'loadingAppDb',\n LOADING_SDK_DB = 'loadingSdkDb',\n}\n\nconst { VALIDATING_INPUT, CONFIGURING_FS, LOADING_SEED_DB, LOADING_APP_DB } =\n InternalState\n\nexport enum PublishMachineStates {\n VALIDATING_ITEM_DATA = 'validatingItemData',\n CREATING_PUBLISH_ATTEMPT = 'creatingPublishAttempt',\n UPLOADING = 'uploading',\n PREPARING_PUBLISH_REQUEST_DATA = 'preparingPublishRequestData',\n PUBLISHING = 'publishing',\n IDLE = 'idle',\n}\n\nexport const INTERNAL_VALIDATING_INPUT_SUCCESS = `${INTERNAL}.${VALIDATING_INPUT}.success`\n\nexport const INTERNAL_CONFIGURING_FS_SUCCESS = `${INTERNAL}.${CONFIGURING_FS}.success`\nexport const INTERNAL_CONFIGURING_FS_FAILURE = `${INTERNAL}.${CONFIGURING_FS}.failure`\n\nexport const INTERNAL_LOADING_SEED_DB_SUCCESS = `${INTERNAL}.${LOADING_SEED_DB}.success`\nexport const INTERNAL_LOADING_SEED_DB_FAILURE = `${INTERNAL}.${LOADING_SEED_DB}.failure`\n\nexport const INTERNAL_LOADING_APP_DB_SUCCESS = `${INTERNAL}.${LOADING_APP_DB}.success`\nexport const INTERNAL_LOADING_APP_DB_FAILURE = `${INTERNAL}.${LOADING_APP_DB}.failure`\n\nexport const INTERNAL_SAVING_CONFIG_SUCCESS = `${INTERNAL}.savingConfig.success`\nexport const INTERNAL_SAVING_CONFIG_FAILURE = `${INTERNAL}.savingConfig.failure`\n\nexport const GLOBAL_GETTING_SEED_CLASS_SUCCESS = `${GLOBAL}.${PUBLISHING_ITEM}.success`\nexport const GLOBAL_INITIALIZING_SEND_CONFIG = `${GLOBAL}.${INITIALIZING}.sendConfig`\nexport const GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY = `${GLOBAL}.${INITIALIZING}.internalServiceReady`\nexport const GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES = `${GLOBAL}.${INITIALIZING}.createAllItemsServices`\nexport const GLOBAL_ADDING_MODELS_TO_DB_SUCCESS = `${GLOBAL}.${ADDING_MODELS_TO_DB}.success`\n\nexport const CHILD_SNAPSHOT = 'childSnapshot'\n\nexport const INTERNAL_SERVICE_SNAPSHOT = 'internalServiceSnapshot'\n\nexport const BROWSER_FS_TOP_DIR = 'app-files'\n\nexport const EAS_ENDPOINT =\n ENV.NEXT_PUBLIC_EAS_ENDPOINT ||\n ENV.EAS_ENDPOINT ||\n 'https://optimism-sepolia.easscan.org/graphql'\n\n/**\n * @deprecated Use BaseArweaveClient.getHost() instead.\n * This constant is kept for backward compatibility but will be removed in a future version.\n * Migration: import { BaseArweaveClient } from '@/helpers' and use BaseArweaveClient.getHost()\n */\nexport const ARWEAVE_HOST =\n ENV.NEXT_PUBLIC_ARWEAVE_HOST || 'arweave.net'\n\n/**\n * @deprecated Use BaseArweaveClient.getEndpoint() instead.\n * This constant is kept for backward compatibility but will be removed in a future version.\n * Migration: import { BaseArweaveClient } from '@/helpers' and use BaseArweaveClient.getEndpoint()\n */\nexport const ARWEAVE_ENDPOINT = `https://${ARWEAVE_HOST}/graphql`\n\n","import { EventObject, fromCallback } from 'xstate'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { FromCallbackInput, ItemMachineContext } from '@/types'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:item:service:actors:waitForDb')\n\nexport const waitForDb = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack }) => {\n const _waitForDb = new Promise<void>((resolve) => {\n const interval = setInterval(() => {\n const appDb = BaseDb.getAppDb()\n if (appDb) {\n clearInterval(interval)\n resolve()\n }\n }, 100)\n })\n\n _waitForDb.then(() => {\n sendBack({ type: 'waitForDbSuccess' })\n })\n },\n)\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { seeds } from '@/seedSchema'\nimport { and, eq, isNotNull, not, or } from 'drizzle-orm'\n\ntype GetExistingItemProps = {\n seedLocalId?: string\n seedUid?: string\n}\n\ntype GetExistingItemReturn = {\n seedLocalId: string\n seedUid: string\n createdAt: string\n}\n\nexport const getExistingItem = async ({\n seedLocalId,\n seedUid,\n}: GetExistingItemProps): Promise<GetExistingItemReturn | undefined> => {\n const appDb = BaseDb.getAppDb()\n\n if (!seedLocalId && !seedUid) {\n return undefined\n }\n\n const conditions = []\n \n if (seedUid) {\n conditions.push(\n and(\n isNotNull(seeds.uid),\n not(eq(seeds.uid, '')),\n not(eq(seeds.uid, 'undefined')),\n not(eq(seeds.uid, 'null')),\n not(eq(seeds.uid, 'false')),\n not(eq(seeds.uid, '0')),\n eq(seeds.uid, seedUid)\n )\n )\n }\n \n if (seedLocalId) {\n conditions.push(\n and(\n isNotNull(seeds.localId),\n not(eq(seeds.localId, '')),\n not(eq(seeds.localId, 'undefined')),\n not(eq(seeds.localId, 'null')),\n not(eq(seeds.localId, 'false')),\n not(eq(seeds.localId, '0')),\n eq(seeds.localId, seedLocalId)\n )\n )\n }\n\n const rows = await appDb\n .select({\n seedLocalId: seeds.localId,\n seedUid: seeds.uid,\n createdAt: seeds.createdAt,\n })\n .from(seeds)\n .where(conditions.length > 0 ? or(...conditions) : undefined)\n\n if (!rows || rows.length === 0) {\n return undefined\n }\n\n const matchingRow = rows.find((row: GetExistingItemReturn) => row.seedUid === seedUid) ||\n rows.find((row: GetExistingItemReturn) => row.seedLocalId === seedLocalId)\n\n return matchingRow\n} ","import { EventObject, fromCallback } from 'xstate'\nimport pluralize from 'pluralize'\nimport { getExistingItem } from '@/db/read/getExistingItem'\nimport { FromCallbackInput, ItemMachineContext } from '@/types'\n\nexport const initialize = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(\n ({ sendBack, input: { context } }) => {\n const { seedLocalId, seedUid, modelName: contextModelName, ModelClass } = context\n\n // Prefer modelName from context, fall back to ModelClass if available\n let modelName = contextModelName\n if (!modelName && ModelClass) {\n // If ModelClass is a Model instance, use its modelName property\n modelName = (ModelClass as any)?.modelName || (ModelClass as any)?.originalConstructor?.name\n }\n \n if (!modelName) {\n throw new Error('modelName is required in context')\n }\n const modelNamePlural = pluralize(modelName)\n const modelTableName = modelNamePlural.toLowerCase()\n\n const _intialize = async (): Promise<void> => {\n const existingItem = await getExistingItem({ seedUid: seedUid || undefined, seedLocalId: seedLocalId || undefined })\n\n if (existingItem) {\n sendBack({\n type: 'hasExistingItem',\n modelName,\n modelTableName,\n modelNamePlural,\n existingItem,\n })\n return\n }\n\n sendBack({\n type: 'isNewItem',\n modelName,\n modelTableName,\n modelNamePlural,\n })\n }\n\n _intialize()\n .then(() => {\n sendBack({ type: 'initializeSuccess' })\n })\n .catch((error) => {\n sendBack({\n type: 'initializeError',\n error: error instanceof Error ? error : new Error(String(error)),\n })\n })\n },\n)\n","import { EventObject, fromCallback } from 'xstate'\nimport {\n FromCallbackInput,\n HydrateExistingItemEvent,\n ItemMachineContext,\n} from '@/types'\n\nexport const hydrateExistingItem = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>, HydrateExistingItemEvent>\n>(({ sendBack, input: { event, context } }) => {\n const { existingItem } = event!\n const { seedUid, seedLocalId, modelName: contextModelName, ModelClass } = context\n\n // Prefer modelName from context, fall back to ModelClass if available\n let modelName = contextModelName\n if (!modelName && ModelClass) {\n // If ModelClass is a Model instance, use its modelName property\n modelName = (ModelClass as any)?.modelName || (ModelClass as any)?.originalConstructor?.name\n }\n \n if (!modelName) {\n throw new Error('modelName is required in context')\n }\n\n const _checkForItemOnAllItemsService = async (): Promise<boolean> => {\n if (!existingItem.seedLocalId && !existingItem.seedUid) {\n console.warn(\n '[singleItemActors] [hydrateExistingItem] No seedLocalId or seedUid found on existingItem',\n )\n return false\n }\n\n if (!seedUid && !seedLocalId) {\n return false\n }\n\n // Note: Removed waitForEvent call - item.request handler is commented out and never resolves\n // Item hydration now happens directly via XState without event bus\n return true\n }\n\n _checkForItemOnAllItemsService().then((shouldContinue) => {\n if (!shouldContinue) {\n sendBack({ type: 'hydrateExistingItemFailure' })\n return\n }\n // for (const [key, value] of Object.entries(existingItem)) {\n // sendBack({\n // type: 'updateValue',\n // propertyName: key,\n // propertyValue: value,\n // source: 'db',\n // })\n // }\n\n sendBack({ type: 'hydrateExistingItemSuccess' })\n })\n})\n","/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = T | null | undefined;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AffectedRowsOutput = {\n __typename?: 'AffectedRowsOutput';\n count: Scalars['Int']['output'];\n};\n\nexport type AggregateAttestation = {\n __typename?: 'AggregateAttestation';\n _avg?: Maybe<AttestationAvgAggregate>;\n _count?: Maybe<AttestationCountAggregate>;\n _max?: Maybe<AttestationMaxAggregate>;\n _min?: Maybe<AttestationMinAggregate>;\n _sum?: Maybe<AttestationSumAggregate>;\n};\n\nexport type AggregateEnsName = {\n __typename?: 'AggregateEnsName';\n _avg?: Maybe<EnsNameAvgAggregate>;\n _count?: Maybe<EnsNameCountAggregate>;\n _max?: Maybe<EnsNameMaxAggregate>;\n _min?: Maybe<EnsNameMinAggregate>;\n _sum?: Maybe<EnsNameSumAggregate>;\n};\n\nexport type AggregateOffchainRevocation = {\n __typename?: 'AggregateOffchainRevocation';\n _avg?: Maybe<OffchainRevocationAvgAggregate>;\n _count?: Maybe<OffchainRevocationCountAggregate>;\n _max?: Maybe<OffchainRevocationMaxAggregate>;\n _min?: Maybe<OffchainRevocationMinAggregate>;\n _sum?: Maybe<OffchainRevocationSumAggregate>;\n};\n\nexport type AggregateSchema = {\n __typename?: 'AggregateSchema';\n _avg?: Maybe<SchemaAvgAggregate>;\n _count?: Maybe<SchemaCountAggregate>;\n _max?: Maybe<SchemaMaxAggregate>;\n _min?: Maybe<SchemaMinAggregate>;\n _sum?: Maybe<SchemaSumAggregate>;\n};\n\nexport type AggregateSchemaName = {\n __typename?: 'AggregateSchemaName';\n _avg?: Maybe<SchemaNameAvgAggregate>;\n _count?: Maybe<SchemaNameCountAggregate>;\n _max?: Maybe<SchemaNameMaxAggregate>;\n _min?: Maybe<SchemaNameMinAggregate>;\n _sum?: Maybe<SchemaNameSumAggregate>;\n};\n\nexport type AggregateServiceStat = {\n __typename?: 'AggregateServiceStat';\n _count?: Maybe<ServiceStatCountAggregate>;\n _max?: Maybe<ServiceStatMaxAggregate>;\n _min?: Maybe<ServiceStatMinAggregate>;\n};\n\nexport type AggregateTimestamp = {\n __typename?: 'AggregateTimestamp';\n _avg?: Maybe<TimestampAvgAggregate>;\n _count?: Maybe<TimestampCountAggregate>;\n _max?: Maybe<TimestampMaxAggregate>;\n _min?: Maybe<TimestampMinAggregate>;\n _sum?: Maybe<TimestampSumAggregate>;\n};\n\n/** Representation of a value transfer between wallets, in both winson and ar. */\nexport type Amount = {\n __typename?: 'Amount';\n /** Amount as an AR string e.g. \\`\"0.000000000001\"\\`. */\n ar: Scalars['String']['output'];\n /** Amount as a winston string e.g. \\`\"1000000000000\"\\`. */\n winston: Scalars['String']['output'];\n};\n\nexport type Attestation = {\n __typename?: 'Attestation';\n attester: Scalars['String']['output'];\n data: Scalars['String']['output'];\n decodedDataJson: Scalars['String']['output'];\n expirationTime: Scalars['Int']['output'];\n id: Scalars['String']['output'];\n ipfsHash: Scalars['String']['output'];\n isOffchain: Scalars['Boolean']['output'];\n recipient: Scalars['String']['output'];\n refUID: Scalars['String']['output'];\n revocable: Scalars['Boolean']['output'];\n revocationTime: Scalars['Int']['output'];\n revoked: Scalars['Boolean']['output'];\n schema: Schema;\n schemaId: Scalars['String']['output'];\n time: Scalars['Int']['output'];\n timeCreated: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n};\n\nexport type AttestationAvgAggregate = {\n __typename?: 'AttestationAvgAggregate';\n expirationTime?: Maybe<Scalars['Float']['output']>;\n revocationTime?: Maybe<Scalars['Float']['output']>;\n time?: Maybe<Scalars['Float']['output']>;\n timeCreated?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type AttestationAvgOrderByAggregateInput = {\n expirationTime?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationCountAggregate = {\n __typename?: 'AttestationCountAggregate';\n _all: Scalars['Int']['output'];\n attester: Scalars['Int']['output'];\n data: Scalars['Int']['output'];\n decodedDataJson: Scalars['Int']['output'];\n expirationTime: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n ipfsHash: Scalars['Int']['output'];\n isOffchain: Scalars['Int']['output'];\n recipient: Scalars['Int']['output'];\n refUID: Scalars['Int']['output'];\n revocable: Scalars['Int']['output'];\n revocationTime: Scalars['Int']['output'];\n revoked: Scalars['Int']['output'];\n schemaId: Scalars['Int']['output'];\n time: Scalars['Int']['output'];\n timeCreated: Scalars['Int']['output'];\n txid: Scalars['Int']['output'];\n};\n\nexport type AttestationCountOrderByAggregateInput = {\n attester?: InputMaybe<SortOrder>;\n data?: InputMaybe<SortOrder>;\n decodedDataJson?: InputMaybe<SortOrder>;\n expirationTime?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n ipfsHash?: InputMaybe<SortOrder>;\n isOffchain?: InputMaybe<SortOrder>;\n recipient?: InputMaybe<SortOrder>;\n refUID?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n revoked?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationCreateInput = {\n attester: Scalars['String']['input'];\n data: Scalars['String']['input'];\n decodedDataJson?: InputMaybe<Scalars['String']['input']>;\n expirationTime: Scalars['Int']['input'];\n id: Scalars['String']['input'];\n ipfsHash: Scalars['String']['input'];\n isOffchain: Scalars['Boolean']['input'];\n recipient: Scalars['String']['input'];\n refUID: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n revocationTime: Scalars['Int']['input'];\n revoked: Scalars['Boolean']['input'];\n schema: SchemaCreateNestedOneWithoutAttestationsInput;\n time: Scalars['Int']['input'];\n timeCreated: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type AttestationCreateManyInput = {\n attester: Scalars['String']['input'];\n data: Scalars['String']['input'];\n decodedDataJson?: InputMaybe<Scalars['String']['input']>;\n expirationTime: Scalars['Int']['input'];\n id: Scalars['String']['input'];\n ipfsHash: Scalars['String']['input'];\n isOffchain: Scalars['Boolean']['input'];\n recipient: Scalars['String']['input'];\n refUID: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n revocationTime: Scalars['Int']['input'];\n revoked: Scalars['Boolean']['input'];\n schemaId: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n timeCreated: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type AttestationCreateManySchemaInput = {\n attester: Scalars['String']['input'];\n data: Scalars['String']['input'];\n decodedDataJson?: InputMaybe<Scalars['String']['input']>;\n expirationTime: Scalars['Int']['input'];\n id: Scalars['String']['input'];\n ipfsHash: Scalars['String']['input'];\n isOffchain: Scalars['Boolean']['input'];\n recipient: Scalars['String']['input'];\n refUID: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n revocationTime: Scalars['Int']['input'];\n revoked: Scalars['Boolean']['input'];\n time: Scalars['Int']['input'];\n timeCreated: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type AttestationCreateManySchemaInputEnvelope = {\n data: Array<AttestationCreateManySchemaInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\nexport type AttestationCreateNestedManyWithoutSchemaInput = {\n connect?: InputMaybe<Array<AttestationWhereUniqueInput>>;\n connectOrCreate?: InputMaybe<Array<AttestationCreateOrConnectWithoutSchemaInput>>;\n create?: InputMaybe<Array<AttestationCreateWithoutSchemaInput>>;\n createMany?: InputMaybe<AttestationCreateManySchemaInputEnvelope>;\n};\n\nexport type AttestationCreateOrConnectWithoutSchemaInput = {\n create: AttestationCreateWithoutSchemaInput;\n where: AttestationWhereUniqueInput;\n};\n\nexport type AttestationCreateWithoutSchemaInput = {\n attester: Scalars['String']['input'];\n data: Scalars['String']['input'];\n decodedDataJson?: InputMaybe<Scalars['String']['input']>;\n expirationTime: Scalars['Int']['input'];\n id: Scalars['String']['input'];\n ipfsHash: Scalars['String']['input'];\n isOffchain: Scalars['Boolean']['input'];\n recipient: Scalars['String']['input'];\n refUID: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n revocationTime: Scalars['Int']['input'];\n revoked: Scalars['Boolean']['input'];\n time: Scalars['Int']['input'];\n timeCreated: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type AttestationGroupBy = {\n __typename?: 'AttestationGroupBy';\n _avg?: Maybe<AttestationAvgAggregate>;\n _count?: Maybe<AttestationCountAggregate>;\n _max?: Maybe<AttestationMaxAggregate>;\n _min?: Maybe<AttestationMinAggregate>;\n _sum?: Maybe<AttestationSumAggregate>;\n attester: Scalars['String']['output'];\n data: Scalars['String']['output'];\n decodedDataJson: Scalars['String']['output'];\n expirationTime: Scalars['Int']['output'];\n id: Scalars['String']['output'];\n ipfsHash: Scalars['String']['output'];\n isOffchain: Scalars['Boolean']['output'];\n recipient: Scalars['String']['output'];\n refUID: Scalars['String']['output'];\n revocable: Scalars['Boolean']['output'];\n revocationTime: Scalars['Int']['output'];\n revoked: Scalars['Boolean']['output'];\n schemaId: Scalars['String']['output'];\n time: Scalars['Int']['output'];\n timeCreated: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n};\n\nexport type AttestationListRelationFilter = {\n every?: InputMaybe<AttestationWhereInput>;\n none?: InputMaybe<AttestationWhereInput>;\n some?: InputMaybe<AttestationWhereInput>;\n};\n\nexport type AttestationMaxAggregate = {\n __typename?: 'AttestationMaxAggregate';\n attester?: Maybe<Scalars['String']['output']>;\n data?: Maybe<Scalars['String']['output']>;\n decodedDataJson?: Maybe<Scalars['String']['output']>;\n expirationTime?: Maybe<Scalars['Int']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n ipfsHash?: Maybe<Scalars['String']['output']>;\n isOffchain?: Maybe<Scalars['Boolean']['output']>;\n recipient?: Maybe<Scalars['String']['output']>;\n refUID?: Maybe<Scalars['String']['output']>;\n revocable?: Maybe<Scalars['Boolean']['output']>;\n revocationTime?: Maybe<Scalars['Int']['output']>;\n revoked?: Maybe<Scalars['Boolean']['output']>;\n schemaId?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n timeCreated?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type AttestationMaxOrderByAggregateInput = {\n attester?: InputMaybe<SortOrder>;\n data?: InputMaybe<SortOrder>;\n decodedDataJson?: InputMaybe<SortOrder>;\n expirationTime?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n ipfsHash?: InputMaybe<SortOrder>;\n isOffchain?: InputMaybe<SortOrder>;\n recipient?: InputMaybe<SortOrder>;\n refUID?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n revoked?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationMinAggregate = {\n __typename?: 'AttestationMinAggregate';\n attester?: Maybe<Scalars['String']['output']>;\n data?: Maybe<Scalars['String']['output']>;\n decodedDataJson?: Maybe<Scalars['String']['output']>;\n expirationTime?: Maybe<Scalars['Int']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n ipfsHash?: Maybe<Scalars['String']['output']>;\n isOffchain?: Maybe<Scalars['Boolean']['output']>;\n recipient?: Maybe<Scalars['String']['output']>;\n refUID?: Maybe<Scalars['String']['output']>;\n revocable?: Maybe<Scalars['Boolean']['output']>;\n revocationTime?: Maybe<Scalars['Int']['output']>;\n revoked?: Maybe<Scalars['Boolean']['output']>;\n schemaId?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n timeCreated?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type AttestationMinOrderByAggregateInput = {\n attester?: InputMaybe<SortOrder>;\n data?: InputMaybe<SortOrder>;\n decodedDataJson?: InputMaybe<SortOrder>;\n expirationTime?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n ipfsHash?: InputMaybe<SortOrder>;\n isOffchain?: InputMaybe<SortOrder>;\n recipient?: InputMaybe<SortOrder>;\n refUID?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n revoked?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationOrderByRelationAggregateInput = {\n _count?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationOrderByWithAggregationInput = {\n _avg?: InputMaybe<AttestationAvgOrderByAggregateInput>;\n _count?: InputMaybe<AttestationCountOrderByAggregateInput>;\n _max?: InputMaybe<AttestationMaxOrderByAggregateInput>;\n _min?: InputMaybe<AttestationMinOrderByAggregateInput>;\n _sum?: InputMaybe<AttestationSumOrderByAggregateInput>;\n attester?: InputMaybe<SortOrder>;\n data?: InputMaybe<SortOrder>;\n decodedDataJson?: InputMaybe<SortOrder>;\n expirationTime?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n ipfsHash?: InputMaybe<SortOrder>;\n isOffchain?: InputMaybe<SortOrder>;\n recipient?: InputMaybe<SortOrder>;\n refUID?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n revoked?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationOrderByWithRelationInput = {\n attester?: InputMaybe<SortOrder>;\n data?: InputMaybe<SortOrder>;\n decodedDataJson?: InputMaybe<SortOrder>;\n expirationTime?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n ipfsHash?: InputMaybe<SortOrder>;\n isOffchain?: InputMaybe<SortOrder>;\n recipient?: InputMaybe<SortOrder>;\n refUID?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n revoked?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SchemaOrderByWithRelationInput>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport enum AttestationScalarFieldEnum {\n Attester = 'attester',\n Data = 'data',\n DecodedDataJson = 'decodedDataJson',\n ExpirationTime = 'expirationTime',\n Id = 'id',\n IpfsHash = 'ipfsHash',\n IsOffchain = 'isOffchain',\n Recipient = 'recipient',\n RefUid = 'refUID',\n Revocable = 'revocable',\n RevocationTime = 'revocationTime',\n Revoked = 'revoked',\n SchemaId = 'schemaId',\n Time = 'time',\n TimeCreated = 'timeCreated',\n Txid = 'txid'\n}\n\nexport type AttestationScalarWhereInput = {\n AND?: InputMaybe<Array<AttestationScalarWhereInput>>;\n NOT?: InputMaybe<Array<AttestationScalarWhereInput>>;\n OR?: InputMaybe<Array<AttestationScalarWhereInput>>;\n attester?: InputMaybe<StringFilter>;\n data?: InputMaybe<StringFilter>;\n decodedDataJson?: InputMaybe<StringFilter>;\n expirationTime?: InputMaybe<IntFilter>;\n id?: InputMaybe<StringFilter>;\n ipfsHash?: InputMaybe<StringFilter>;\n isOffchain?: InputMaybe<BoolFilter>;\n recipient?: InputMaybe<StringFilter>;\n refUID?: InputMaybe<StringFilter>;\n revocable?: InputMaybe<BoolFilter>;\n revocationTime?: InputMaybe<IntFilter>;\n revoked?: InputMaybe<BoolFilter>;\n schemaId?: InputMaybe<StringFilter>;\n time?: InputMaybe<IntFilter>;\n timeCreated?: InputMaybe<IntFilter>;\n txid?: InputMaybe<StringFilter>;\n};\n\nexport type AttestationScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<AttestationScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<AttestationScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<AttestationScalarWhereWithAggregatesInput>>;\n attester?: InputMaybe<StringWithAggregatesFilter>;\n data?: InputMaybe<StringWithAggregatesFilter>;\n decodedDataJson?: InputMaybe<StringWithAggregatesFilter>;\n expirationTime?: InputMaybe<IntWithAggregatesFilter>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n ipfsHash?: InputMaybe<StringWithAggregatesFilter>;\n isOffchain?: InputMaybe<BoolWithAggregatesFilter>;\n recipient?: InputMaybe<StringWithAggregatesFilter>;\n refUID?: InputMaybe<StringWithAggregatesFilter>;\n revocable?: InputMaybe<BoolWithAggregatesFilter>;\n revocationTime?: InputMaybe<IntWithAggregatesFilter>;\n revoked?: InputMaybe<BoolWithAggregatesFilter>;\n schemaId?: InputMaybe<StringWithAggregatesFilter>;\n time?: InputMaybe<IntWithAggregatesFilter>;\n timeCreated?: InputMaybe<IntWithAggregatesFilter>;\n txid?: InputMaybe<StringWithAggregatesFilter>;\n};\n\nexport type AttestationSumAggregate = {\n __typename?: 'AttestationSumAggregate';\n expirationTime?: Maybe<Scalars['Int']['output']>;\n revocationTime?: Maybe<Scalars['Int']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n timeCreated?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type AttestationSumOrderByAggregateInput = {\n expirationTime?: InputMaybe<SortOrder>;\n revocationTime?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n timeCreated?: InputMaybe<SortOrder>;\n};\n\nexport type AttestationUpdateInput = {\n attester?: InputMaybe<StringFieldUpdateOperationsInput>;\n data?: InputMaybe<StringFieldUpdateOperationsInput>;\n decodedDataJson?: InputMaybe<StringFieldUpdateOperationsInput>;\n expirationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n ipfsHash?: InputMaybe<StringFieldUpdateOperationsInput>;\n isOffchain?: InputMaybe<BoolFieldUpdateOperationsInput>;\n recipient?: InputMaybe<StringFieldUpdateOperationsInput>;\n refUID?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n revocationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n revoked?: InputMaybe<BoolFieldUpdateOperationsInput>;\n schema?: InputMaybe<SchemaUpdateOneRequiredWithoutAttestationsNestedInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n timeCreated?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type AttestationUpdateManyMutationInput = {\n attester?: InputMaybe<StringFieldUpdateOperationsInput>;\n data?: InputMaybe<StringFieldUpdateOperationsInput>;\n decodedDataJson?: InputMaybe<StringFieldUpdateOperationsInput>;\n expirationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n ipfsHash?: InputMaybe<StringFieldUpdateOperationsInput>;\n isOffchain?: InputMaybe<BoolFieldUpdateOperationsInput>;\n recipient?: InputMaybe<StringFieldUpdateOperationsInput>;\n refUID?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n revocationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n revoked?: InputMaybe<BoolFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n timeCreated?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type AttestationUpdateManyWithWhereWithoutSchemaInput = {\n data: AttestationUpdateManyMutationInput;\n where: AttestationScalarWhereInput;\n};\n\nexport type AttestationUpdateManyWithoutSchemaNestedInput = {\n connect?: InputMaybe<Array<AttestationWhereUniqueInput>>;\n connectOrCreate?: InputMaybe<Array<AttestationCreateOrConnectWithoutSchemaInput>>;\n create?: InputMaybe<Array<AttestationCreateWithoutSchemaInput>>;\n createMany?: InputMaybe<AttestationCreateManySchemaInputEnvelope>;\n delete?: InputMaybe<Array<AttestationWhereUniqueInput>>;\n deleteMany?: InputMaybe<Array<AttestationScalarWhereInput>>;\n disconnect?: InputMaybe<Array<AttestationWhereUniqueInput>>;\n set?: InputMaybe<Array<AttestationWhereUniqueInput>>;\n update?: InputMaybe<Array<AttestationUpdateWithWhereUniqueWithoutSchemaInput>>;\n updateMany?: InputMaybe<Array<AttestationUpdateManyWithWhereWithoutSchemaInput>>;\n upsert?: InputMaybe<Array<AttestationUpsertWithWhereUniqueWithoutSchemaInput>>;\n};\n\nexport type AttestationUpdateWithWhereUniqueWithoutSchemaInput = {\n data: AttestationUpdateWithoutSchemaInput;\n where: AttestationWhereUniqueInput;\n};\n\nexport type AttestationUpdateWithoutSchemaInput = {\n attester?: InputMaybe<StringFieldUpdateOperationsInput>;\n data?: InputMaybe<StringFieldUpdateOperationsInput>;\n decodedDataJson?: InputMaybe<StringFieldUpdateOperationsInput>;\n expirationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n ipfsHash?: InputMaybe<StringFieldUpdateOperationsInput>;\n isOffchain?: InputMaybe<BoolFieldUpdateOperationsInput>;\n recipient?: InputMaybe<StringFieldUpdateOperationsInput>;\n refUID?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n revocationTime?: InputMaybe<IntFieldUpdateOperationsInput>;\n revoked?: InputMaybe<BoolFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n timeCreated?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type AttestationUpsertWithWhereUniqueWithoutSchemaInput = {\n create: AttestationCreateWithoutSchemaInput;\n update: AttestationUpdateWithoutSchemaInput;\n where: AttestationWhereUniqueInput;\n};\n\nexport type AttestationWhereInput = {\n AND?: InputMaybe<Array<AttestationWhereInput>>;\n NOT?: InputMaybe<Array<AttestationWhereInput>>;\n OR?: InputMaybe<Array<AttestationWhereInput>>;\n attester?: InputMaybe<StringFilter>;\n data?: InputMaybe<StringFilter>;\n decodedDataJson?: InputMaybe<StringFilter>;\n expirationTime?: InputMaybe<IntFilter>;\n id?: InputMaybe<StringFilter>;\n ipfsHash?: InputMaybe<StringFilter>;\n isOffchain?: InputMaybe<BoolFilter>;\n recipient?: InputMaybe<StringFilter>;\n refUID?: InputMaybe<StringFilter>;\n revocable?: InputMaybe<BoolFilter>;\n revocationTime?: InputMaybe<IntFilter>;\n revoked?: InputMaybe<BoolFilter>;\n schema?: InputMaybe<SchemaRelationFilter>;\n schemaId?: InputMaybe<StringFilter>;\n time?: InputMaybe<IntFilter>;\n timeCreated?: InputMaybe<IntFilter>;\n txid?: InputMaybe<StringFilter>;\n};\n\nexport type AttestationWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\n/** Block Schema */\nexport type Block = {\n __typename?: 'Block';\n /** The block height. */\n height: Scalars['Int']['output'];\n /** The block ID. */\n id?: Maybe<Scalars['ID']['output']>;\n /** The previous block ID. */\n previous?: Maybe<Scalars['ID']['output']>;\n /** The block timestamp (UTC). */\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\n/**\n * Paginated result set using the GraphQL cursor spec,\n * see: https://relay.dev/graphql/connections.htm.\n */\nexport type BlockConnection = {\n __typename?: 'BlockConnection';\n edges: Array<BlockEdge>;\n pageInfo: PageInfo;\n};\n\n/** Paginated result set using the GraphQL cursor spec. */\nexport type BlockEdge = {\n __typename?: 'BlockEdge';\n /**\n * The cursor value for fetching the next page.\n *\n * Pass this to the after parameter in blocks(after: $cursor), the next page will start from the next item after this.\n */\n cursor: Scalars['String']['output'];\n /** A block object. */\n node: Block;\n};\n\nexport type BoolFieldUpdateOperationsInput = {\n set?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\nexport type BoolFilter = {\n equals?: InputMaybe<Scalars['Boolean']['input']>;\n not?: InputMaybe<NestedBoolFilter>;\n};\n\nexport type BoolWithAggregatesFilter = {\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedBoolFilter>;\n _min?: InputMaybe<NestedBoolFilter>;\n equals?: InputMaybe<Scalars['Boolean']['input']>;\n not?: InputMaybe<NestedBoolWithAggregatesFilter>;\n};\n\n/**\n * The data bundle containing the current data item.\n * See: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md.\n */\nexport type Bundle = {\n __typename?: 'Bundle';\n /** ID of the containing data bundle. */\n id: Scalars['ID']['output'];\n};\n\nexport enum CacheControlScope {\n Private = 'PRIVATE',\n Public = 'PUBLIC'\n}\n\nexport type EnsName = {\n __typename?: 'EnsName';\n id: Scalars['String']['output'];\n name: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n};\n\nexport type EnsNameAvgAggregate = {\n __typename?: 'EnsNameAvgAggregate';\n timestamp?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type EnsNameAvgOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameCountAggregate = {\n __typename?: 'EnsNameCountAggregate';\n _all: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n name: Scalars['Int']['output'];\n timestamp: Scalars['Int']['output'];\n};\n\nexport type EnsNameCountOrderByAggregateInput = {\n id?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameCreateInput = {\n id: Scalars['String']['input'];\n name: Scalars['String']['input'];\n timestamp: Scalars['Int']['input'];\n};\n\nexport type EnsNameCreateManyInput = {\n id: Scalars['String']['input'];\n name: Scalars['String']['input'];\n timestamp: Scalars['Int']['input'];\n};\n\nexport type EnsNameGroupBy = {\n __typename?: 'EnsNameGroupBy';\n _avg?: Maybe<EnsNameAvgAggregate>;\n _count?: Maybe<EnsNameCountAggregate>;\n _max?: Maybe<EnsNameMaxAggregate>;\n _min?: Maybe<EnsNameMinAggregate>;\n _sum?: Maybe<EnsNameSumAggregate>;\n id: Scalars['String']['output'];\n name: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n};\n\nexport type EnsNameMaxAggregate = {\n __typename?: 'EnsNameMaxAggregate';\n id?: Maybe<Scalars['String']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type EnsNameMaxOrderByAggregateInput = {\n id?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameMinAggregate = {\n __typename?: 'EnsNameMinAggregate';\n id?: Maybe<Scalars['String']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type EnsNameMinOrderByAggregateInput = {\n id?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameOrderByWithAggregationInput = {\n _avg?: InputMaybe<EnsNameAvgOrderByAggregateInput>;\n _count?: InputMaybe<EnsNameCountOrderByAggregateInput>;\n _max?: InputMaybe<EnsNameMaxOrderByAggregateInput>;\n _min?: InputMaybe<EnsNameMinOrderByAggregateInput>;\n _sum?: InputMaybe<EnsNameSumOrderByAggregateInput>;\n id?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameOrderByWithRelationInput = {\n id?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport enum EnsNameScalarFieldEnum {\n Id = 'id',\n Name = 'name',\n Timestamp = 'timestamp'\n}\n\nexport type EnsNameScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<EnsNameScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<EnsNameScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<EnsNameScalarWhereWithAggregatesInput>>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n name?: InputMaybe<StringWithAggregatesFilter>;\n timestamp?: InputMaybe<IntWithAggregatesFilter>;\n};\n\nexport type EnsNameSumAggregate = {\n __typename?: 'EnsNameSumAggregate';\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type EnsNameSumOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type EnsNameUpdateInput = {\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n};\n\nexport type EnsNameUpdateManyMutationInput = {\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n};\n\nexport type EnsNameWhereInput = {\n AND?: InputMaybe<Array<EnsNameWhereInput>>;\n NOT?: InputMaybe<Array<EnsNameWhereInput>>;\n OR?: InputMaybe<Array<EnsNameWhereInput>>;\n id?: InputMaybe<StringFilter>;\n name?: InputMaybe<StringFilter>;\n timestamp?: InputMaybe<IntFilter>;\n};\n\nexport type EnsNameWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type IntFieldUpdateOperationsInput = {\n decrement?: InputMaybe<Scalars['Int']['input']>;\n divide?: InputMaybe<Scalars['Int']['input']>;\n increment?: InputMaybe<Scalars['Int']['input']>;\n multiply?: InputMaybe<Scalars['Int']['input']>;\n set?: InputMaybe<Scalars['Int']['input']>;\n};\n\nexport type IntFilter = {\n equals?: InputMaybe<Scalars['Int']['input']>;\n gt?: InputMaybe<Scalars['Int']['input']>;\n gte?: InputMaybe<Scalars['Int']['input']>;\n in?: InputMaybe<Array<Scalars['Int']['input']>>;\n lt?: InputMaybe<Scalars['Int']['input']>;\n lte?: InputMaybe<Scalars['Int']['input']>;\n not?: InputMaybe<NestedIntFilter>;\n notIn?: InputMaybe<Array<Scalars['Int']['input']>>;\n};\n\nexport type IntWithAggregatesFilter = {\n _avg?: InputMaybe<NestedFloatFilter>;\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedIntFilter>;\n _min?: InputMaybe<NestedIntFilter>;\n _sum?: InputMaybe<NestedIntFilter>;\n equals?: InputMaybe<Scalars['Int']['input']>;\n gt?: InputMaybe<Scalars['Int']['input']>;\n gte?: InputMaybe<Scalars['Int']['input']>;\n in?: InputMaybe<Array<Scalars['Int']['input']>>;\n lt?: InputMaybe<Scalars['Int']['input']>;\n lte?: InputMaybe<Scalars['Int']['input']>;\n not?: InputMaybe<NestedIntWithAggregatesFilter>;\n notIn?: InputMaybe<Array<Scalars['Int']['input']>>;\n};\n\n/** Basic metadata about the transaction data payload. */\nexport type MetaData = {\n __typename?: 'MetaData';\n /** Size of the associated data in bytes. */\n size: Scalars['String']['output'];\n /** Type is derived from the \\`content-type\\` tag on a transaction. */\n type?: Maybe<Scalars['String']['output']>;\n};\n\nexport type Mutation = {\n __typename?: 'Mutation';\n createManyAttestation: AffectedRowsOutput;\n createManyEnsName: AffectedRowsOutput;\n createManyOffchainRevocation: AffectedRowsOutput;\n createManySchema: AffectedRowsOutput;\n createManySchemaName: AffectedRowsOutput;\n createManyServiceStat: AffectedRowsOutput;\n createManyTimestamp: AffectedRowsOutput;\n createOneAttestation: Attestation;\n createOneEnsName: EnsName;\n createOneOffchainRevocation: OffchainRevocation;\n createOneSchema: Schema;\n createOneSchemaName: SchemaName;\n createOneServiceStat: ServiceStat;\n createOneTimestamp: Timestamp;\n deleteManyAttestation: AffectedRowsOutput;\n deleteManyEnsName: AffectedRowsOutput;\n deleteManyOffchainRevocation: AffectedRowsOutput;\n deleteManySchema: AffectedRowsOutput;\n deleteManySchemaName: AffectedRowsOutput;\n deleteManyServiceStat: AffectedRowsOutput;\n deleteManyTimestamp: AffectedRowsOutput;\n deleteOneAttestation?: Maybe<Attestation>;\n deleteOneEnsName?: Maybe<EnsName>;\n deleteOneOffchainRevocation?: Maybe<OffchainRevocation>;\n deleteOneSchema?: Maybe<Schema>;\n deleteOneSchemaName?: Maybe<SchemaName>;\n deleteOneServiceStat?: Maybe<ServiceStat>;\n deleteOneTimestamp?: Maybe<Timestamp>;\n updateManyAttestation: AffectedRowsOutput;\n updateManyEnsName: AffectedRowsOutput;\n updateManyOffchainRevocation: AffectedRowsOutput;\n updateManySchema: AffectedRowsOutput;\n updateManySchemaName: AffectedRowsOutput;\n updateManyServiceStat: AffectedRowsOutput;\n updateManyTimestamp: AffectedRowsOutput;\n updateOneAttestation?: Maybe<Attestation>;\n updateOneEnsName?: Maybe<EnsName>;\n updateOneOffchainRevocation?: Maybe<OffchainRevocation>;\n updateOneSchema?: Maybe<Schema>;\n updateOneSchemaName?: Maybe<SchemaName>;\n updateOneServiceStat?: Maybe<ServiceStat>;\n updateOneTimestamp?: Maybe<Timestamp>;\n upsertOneAttestation: Attestation;\n upsertOneEnsName: EnsName;\n upsertOneOffchainRevocation: OffchainRevocation;\n upsertOneSchema: Schema;\n upsertOneSchemaName: SchemaName;\n upsertOneServiceStat: ServiceStat;\n upsertOneTimestamp: Timestamp;\n};\n\n\nexport type MutationCreateManyAttestationArgs = {\n data: Array<AttestationCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManyEnsNameArgs = {\n data: Array<EnsNameCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManyOffchainRevocationArgs = {\n data: Array<OffchainRevocationCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManySchemaArgs = {\n data: Array<SchemaCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManySchemaNameArgs = {\n data: Array<SchemaNameCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManyServiceStatArgs = {\n data: Array<ServiceStatCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateManyTimestampArgs = {\n data: Array<TimestampCreateManyInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\n\nexport type MutationCreateOneAttestationArgs = {\n data: AttestationCreateInput;\n};\n\n\nexport type MutationCreateOneEnsNameArgs = {\n data: EnsNameCreateInput;\n};\n\n\nexport type MutationCreateOneOffchainRevocationArgs = {\n data: OffchainRevocationCreateInput;\n};\n\n\nexport type MutationCreateOneSchemaArgs = {\n data: SchemaCreateInput;\n};\n\n\nexport type MutationCreateOneSchemaNameArgs = {\n data: SchemaNameCreateInput;\n};\n\n\nexport type MutationCreateOneServiceStatArgs = {\n data: ServiceStatCreateInput;\n};\n\n\nexport type MutationCreateOneTimestampArgs = {\n data: TimestampCreateInput;\n};\n\n\nexport type MutationDeleteManyAttestationArgs = {\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type MutationDeleteManyEnsNameArgs = {\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type MutationDeleteManyOffchainRevocationArgs = {\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type MutationDeleteManySchemaArgs = {\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type MutationDeleteManySchemaNameArgs = {\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type MutationDeleteManyServiceStatArgs = {\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type MutationDeleteManyTimestampArgs = {\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type MutationDeleteOneAttestationArgs = {\n where: AttestationWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneEnsNameArgs = {\n where: EnsNameWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneOffchainRevocationArgs = {\n where: OffchainRevocationWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneSchemaArgs = {\n where: SchemaWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneSchemaNameArgs = {\n where: SchemaNameWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneServiceStatArgs = {\n where: ServiceStatWhereUniqueInput;\n};\n\n\nexport type MutationDeleteOneTimestampArgs = {\n where: TimestampWhereUniqueInput;\n};\n\n\nexport type MutationUpdateManyAttestationArgs = {\n data: AttestationUpdateManyMutationInput;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type MutationUpdateManyEnsNameArgs = {\n data: EnsNameUpdateManyMutationInput;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type MutationUpdateManyOffchainRevocationArgs = {\n data: OffchainRevocationUpdateManyMutationInput;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type MutationUpdateManySchemaArgs = {\n data: SchemaUpdateManyMutationInput;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type MutationUpdateManySchemaNameArgs = {\n data: SchemaNameUpdateManyMutationInput;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type MutationUpdateManyServiceStatArgs = {\n data: ServiceStatUpdateManyMutationInput;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type MutationUpdateManyTimestampArgs = {\n data: TimestampUpdateManyMutationInput;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type MutationUpdateOneAttestationArgs = {\n data: AttestationUpdateInput;\n where: AttestationWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneEnsNameArgs = {\n data: EnsNameUpdateInput;\n where: EnsNameWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneOffchainRevocationArgs = {\n data: OffchainRevocationUpdateInput;\n where: OffchainRevocationWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneSchemaArgs = {\n data: SchemaUpdateInput;\n where: SchemaWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneSchemaNameArgs = {\n data: SchemaNameUpdateInput;\n where: SchemaNameWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneServiceStatArgs = {\n data: ServiceStatUpdateInput;\n where: ServiceStatWhereUniqueInput;\n};\n\n\nexport type MutationUpdateOneTimestampArgs = {\n data: TimestampUpdateInput;\n where: TimestampWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneAttestationArgs = {\n create: AttestationCreateInput;\n update: AttestationUpdateInput;\n where: AttestationWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneEnsNameArgs = {\n create: EnsNameCreateInput;\n update: EnsNameUpdateInput;\n where: EnsNameWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneOffchainRevocationArgs = {\n create: OffchainRevocationCreateInput;\n update: OffchainRevocationUpdateInput;\n where: OffchainRevocationWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneSchemaArgs = {\n create: SchemaCreateInput;\n update: SchemaUpdateInput;\n where: SchemaWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneSchemaNameArgs = {\n create: SchemaNameCreateInput;\n update: SchemaNameUpdateInput;\n where: SchemaNameWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneServiceStatArgs = {\n create: ServiceStatCreateInput;\n update: ServiceStatUpdateInput;\n where: ServiceStatWhereUniqueInput;\n};\n\n\nexport type MutationUpsertOneTimestampArgs = {\n create: TimestampCreateInput;\n update: TimestampUpdateInput;\n where: TimestampWhereUniqueInput;\n};\n\nexport type NestedBoolFilter = {\n equals?: InputMaybe<Scalars['Boolean']['input']>;\n not?: InputMaybe<NestedBoolFilter>;\n};\n\nexport type NestedBoolWithAggregatesFilter = {\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedBoolFilter>;\n _min?: InputMaybe<NestedBoolFilter>;\n equals?: InputMaybe<Scalars['Boolean']['input']>;\n not?: InputMaybe<NestedBoolWithAggregatesFilter>;\n};\n\nexport type NestedFloatFilter = {\n equals?: InputMaybe<Scalars['Float']['input']>;\n gt?: InputMaybe<Scalars['Float']['input']>;\n gte?: InputMaybe<Scalars['Float']['input']>;\n in?: InputMaybe<Array<Scalars['Float']['input']>>;\n lt?: InputMaybe<Scalars['Float']['input']>;\n lte?: InputMaybe<Scalars['Float']['input']>;\n not?: InputMaybe<NestedFloatFilter>;\n notIn?: InputMaybe<Array<Scalars['Float']['input']>>;\n};\n\nexport type NestedIntFilter = {\n equals?: InputMaybe<Scalars['Int']['input']>;\n gt?: InputMaybe<Scalars['Int']['input']>;\n gte?: InputMaybe<Scalars['Int']['input']>;\n in?: InputMaybe<Array<Scalars['Int']['input']>>;\n lt?: InputMaybe<Scalars['Int']['input']>;\n lte?: InputMaybe<Scalars['Int']['input']>;\n not?: InputMaybe<NestedIntFilter>;\n notIn?: InputMaybe<Array<Scalars['Int']['input']>>;\n};\n\nexport type NestedIntWithAggregatesFilter = {\n _avg?: InputMaybe<NestedFloatFilter>;\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedIntFilter>;\n _min?: InputMaybe<NestedIntFilter>;\n _sum?: InputMaybe<NestedIntFilter>;\n equals?: InputMaybe<Scalars['Int']['input']>;\n gt?: InputMaybe<Scalars['Int']['input']>;\n gte?: InputMaybe<Scalars['Int']['input']>;\n in?: InputMaybe<Array<Scalars['Int']['input']>>;\n lt?: InputMaybe<Scalars['Int']['input']>;\n lte?: InputMaybe<Scalars['Int']['input']>;\n not?: InputMaybe<NestedIntWithAggregatesFilter>;\n notIn?: InputMaybe<Array<Scalars['Int']['input']>>;\n};\n\nexport type NestedStringFilter = {\n contains?: InputMaybe<Scalars['String']['input']>;\n endsWith?: InputMaybe<Scalars['String']['input']>;\n equals?: InputMaybe<Scalars['String']['input']>;\n gt?: InputMaybe<Scalars['String']['input']>;\n gte?: InputMaybe<Scalars['String']['input']>;\n in?: InputMaybe<Array<Scalars['String']['input']>>;\n lt?: InputMaybe<Scalars['String']['input']>;\n lte?: InputMaybe<Scalars['String']['input']>;\n not?: InputMaybe<NestedStringFilter>;\n notIn?: InputMaybe<Array<Scalars['String']['input']>>;\n startsWith?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type NestedStringWithAggregatesFilter = {\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedStringFilter>;\n _min?: InputMaybe<NestedStringFilter>;\n contains?: InputMaybe<Scalars['String']['input']>;\n endsWith?: InputMaybe<Scalars['String']['input']>;\n equals?: InputMaybe<Scalars['String']['input']>;\n gt?: InputMaybe<Scalars['String']['input']>;\n gte?: InputMaybe<Scalars['String']['input']>;\n in?: InputMaybe<Array<Scalars['String']['input']>>;\n lt?: InputMaybe<Scalars['String']['input']>;\n lte?: InputMaybe<Scalars['String']['input']>;\n not?: InputMaybe<NestedStringWithAggregatesFilter>;\n notIn?: InputMaybe<Array<Scalars['String']['input']>>;\n startsWith?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type OffchainRevocation = {\n __typename?: 'OffchainRevocation';\n from: Scalars['String']['output'];\n id: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n uid: Scalars['String']['output'];\n};\n\nexport type OffchainRevocationAvgAggregate = {\n __typename?: 'OffchainRevocationAvgAggregate';\n timestamp?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type OffchainRevocationAvgOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationCountAggregate = {\n __typename?: 'OffchainRevocationCountAggregate';\n _all: Scalars['Int']['output'];\n from: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n timestamp: Scalars['Int']['output'];\n txid: Scalars['Int']['output'];\n uid: Scalars['Int']['output'];\n};\n\nexport type OffchainRevocationCountOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n uid?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationCreateInput = {\n from: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n timestamp: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n uid: Scalars['String']['input'];\n};\n\nexport type OffchainRevocationCreateManyInput = {\n from: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n timestamp: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n uid: Scalars['String']['input'];\n};\n\nexport type OffchainRevocationGroupBy = {\n __typename?: 'OffchainRevocationGroupBy';\n _avg?: Maybe<OffchainRevocationAvgAggregate>;\n _count?: Maybe<OffchainRevocationCountAggregate>;\n _max?: Maybe<OffchainRevocationMaxAggregate>;\n _min?: Maybe<OffchainRevocationMinAggregate>;\n _sum?: Maybe<OffchainRevocationSumAggregate>;\n from: Scalars['String']['output'];\n id: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n uid: Scalars['String']['output'];\n};\n\nexport type OffchainRevocationMaxAggregate = {\n __typename?: 'OffchainRevocationMaxAggregate';\n from?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n uid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type OffchainRevocationMaxOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n uid?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationMinAggregate = {\n __typename?: 'OffchainRevocationMinAggregate';\n from?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n uid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type OffchainRevocationMinOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n uid?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationOrderByWithAggregationInput = {\n _avg?: InputMaybe<OffchainRevocationAvgOrderByAggregateInput>;\n _count?: InputMaybe<OffchainRevocationCountOrderByAggregateInput>;\n _max?: InputMaybe<OffchainRevocationMaxOrderByAggregateInput>;\n _min?: InputMaybe<OffchainRevocationMinOrderByAggregateInput>;\n _sum?: InputMaybe<OffchainRevocationSumOrderByAggregateInput>;\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n uid?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationOrderByWithRelationInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n uid?: InputMaybe<SortOrder>;\n};\n\nexport enum OffchainRevocationScalarFieldEnum {\n From = 'from',\n Id = 'id',\n Timestamp = 'timestamp',\n Txid = 'txid',\n Uid = 'uid'\n}\n\nexport type OffchainRevocationScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<OffchainRevocationScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<OffchainRevocationScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<OffchainRevocationScalarWhereWithAggregatesInput>>;\n from?: InputMaybe<StringWithAggregatesFilter>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n timestamp?: InputMaybe<IntWithAggregatesFilter>;\n txid?: InputMaybe<StringWithAggregatesFilter>;\n uid?: InputMaybe<StringWithAggregatesFilter>;\n};\n\nexport type OffchainRevocationSumAggregate = {\n __typename?: 'OffchainRevocationSumAggregate';\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type OffchainRevocationSumOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type OffchainRevocationUpdateInput = {\n from?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n uid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type OffchainRevocationUpdateManyMutationInput = {\n from?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n uid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type OffchainRevocationWhereInput = {\n AND?: InputMaybe<Array<OffchainRevocationWhereInput>>;\n NOT?: InputMaybe<Array<OffchainRevocationWhereInput>>;\n OR?: InputMaybe<Array<OffchainRevocationWhereInput>>;\n from?: InputMaybe<StringFilter>;\n id?: InputMaybe<StringFilter>;\n timestamp?: InputMaybe<IntFilter>;\n txid?: InputMaybe<StringFilter>;\n uid?: InputMaybe<StringFilter>;\n};\n\nexport type OffchainRevocationWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\n/** Representation of a transaction owner. */\nexport type Owner = {\n __typename?: 'Owner';\n /** The owner's wallet address. */\n address: Scalars['String']['output'];\n /** The owner's public key as a base64url encoded string. */\n key: Scalars['String']['output'];\n};\n\n/** Paginated page info using the GraphQL cursor spec. */\nexport type PageInfo = {\n __typename?: 'PageInfo';\n hasNextPage: Scalars['Boolean']['output'];\n};\n\n/**\n * The parent transaction for bundled transactions,\n * see: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md.\n */\nexport type Parent = {\n __typename?: 'Parent';\n id: Scalars['ID']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n aggregateAttestation: AggregateAttestation;\n aggregateEnsName: AggregateEnsName;\n aggregateOffchainRevocation: AggregateOffchainRevocation;\n aggregateSchema: AggregateSchema;\n aggregateSchemaName: AggregateSchemaName;\n aggregateServiceStat: AggregateServiceStat;\n aggregateTimestamp: AggregateTimestamp;\n attestation?: Maybe<Attestation>;\n attestations: Array<Attestation>;\n block?: Maybe<Block>;\n blocks: BlockConnection;\n ensName?: Maybe<EnsName>;\n ensNames: Array<EnsName>;\n findFirstAttestation?: Maybe<Attestation>;\n findFirstAttestationOrThrow?: Maybe<Attestation>;\n findFirstEnsName?: Maybe<EnsName>;\n findFirstEnsNameOrThrow?: Maybe<EnsName>;\n findFirstOffchainRevocation?: Maybe<OffchainRevocation>;\n findFirstOffchainRevocationOrThrow?: Maybe<OffchainRevocation>;\n findFirstSchema?: Maybe<Schema>;\n findFirstSchemaName?: Maybe<SchemaName>;\n findFirstSchemaNameOrThrow?: Maybe<SchemaName>;\n findFirstSchemaOrThrow?: Maybe<Schema>;\n findFirstServiceStat?: Maybe<ServiceStat>;\n findFirstServiceStatOrThrow?: Maybe<ServiceStat>;\n findFirstTimestamp?: Maybe<Timestamp>;\n findFirstTimestampOrThrow?: Maybe<Timestamp>;\n getAttestation?: Maybe<Attestation>;\n getEnsName?: Maybe<EnsName>;\n getOffchainRevocation?: Maybe<OffchainRevocation>;\n getSchema?: Maybe<Schema>;\n getSchemaName?: Maybe<SchemaName>;\n getServiceStat?: Maybe<ServiceStat>;\n getTimestamp?: Maybe<Timestamp>;\n groupByAttestation: Array<AttestationGroupBy>;\n groupByEnsName: Array<EnsNameGroupBy>;\n groupByOffchainRevocation: Array<OffchainRevocationGroupBy>;\n groupBySchema: Array<SchemaGroupBy>;\n groupBySchemaName: Array<SchemaNameGroupBy>;\n groupByServiceStat: Array<ServiceStatGroupBy>;\n groupByTimestamp: Array<TimestampGroupBy>;\n offchainRevocation?: Maybe<OffchainRevocation>;\n offchainRevocations: Array<OffchainRevocation>;\n schema?: Maybe<Schema>;\n schemaName?: Maybe<SchemaName>;\n schemaNames: Array<SchemaName>;\n schemata: Array<Schema>;\n serviceStat?: Maybe<ServiceStat>;\n serviceStats: Array<ServiceStat>;\n timestamp?: Maybe<Timestamp>;\n timestamps: Array<Timestamp>;\n /** Get a transaction by its id */\n transaction?: Maybe<Transaction>;\n /** Get a paginated set of matching transactions using filters. */\n transactions: TransactionConnection;\n};\n\n\nexport type QueryAggregateAttestationArgs = {\n cursor?: InputMaybe<AttestationWhereUniqueInput>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type QueryAggregateEnsNameArgs = {\n cursor?: InputMaybe<EnsNameWhereUniqueInput>;\n orderBy?: InputMaybe<Array<EnsNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type QueryAggregateOffchainRevocationArgs = {\n cursor?: InputMaybe<OffchainRevocationWhereUniqueInput>;\n orderBy?: InputMaybe<Array<OffchainRevocationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type QueryAggregateSchemaArgs = {\n cursor?: InputMaybe<SchemaWhereUniqueInput>;\n orderBy?: InputMaybe<Array<SchemaOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type QueryAggregateSchemaNameArgs = {\n cursor?: InputMaybe<SchemaNameWhereUniqueInput>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type QueryAggregateServiceStatArgs = {\n cursor?: InputMaybe<ServiceStatWhereUniqueInput>;\n orderBy?: InputMaybe<Array<ServiceStatOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type QueryAggregateTimestampArgs = {\n cursor?: InputMaybe<TimestampWhereUniqueInput>;\n orderBy?: InputMaybe<Array<TimestampOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type QueryAttestationArgs = {\n where: AttestationWhereUniqueInput;\n};\n\n\nexport type QueryAttestationsArgs = {\n cursor?: InputMaybe<AttestationWhereUniqueInput>;\n distinct?: InputMaybe<Array<AttestationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type QueryBlockArgs = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\n\nexport type QueryBlocksArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n height?: InputMaybe<RangeFilter>;\n ids?: InputMaybe<Array<Scalars['ID']['input']>>;\n sort?: InputMaybe<SortOrder>;\n};\n\n\nexport type QueryEnsNameArgs = {\n where: EnsNameWhereUniqueInput;\n};\n\n\nexport type QueryEnsNamesArgs = {\n cursor?: InputMaybe<EnsNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<EnsNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<EnsNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type QueryFindFirstAttestationArgs = {\n cursor?: InputMaybe<AttestationWhereUniqueInput>;\n distinct?: InputMaybe<Array<AttestationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type QueryFindFirstAttestationOrThrowArgs = {\n cursor?: InputMaybe<AttestationWhereUniqueInput>;\n distinct?: InputMaybe<Array<AttestationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type QueryFindFirstEnsNameArgs = {\n cursor?: InputMaybe<EnsNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<EnsNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<EnsNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type QueryFindFirstEnsNameOrThrowArgs = {\n cursor?: InputMaybe<EnsNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<EnsNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<EnsNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type QueryFindFirstOffchainRevocationArgs = {\n cursor?: InputMaybe<OffchainRevocationWhereUniqueInput>;\n distinct?: InputMaybe<Array<OffchainRevocationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<OffchainRevocationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type QueryFindFirstOffchainRevocationOrThrowArgs = {\n cursor?: InputMaybe<OffchainRevocationWhereUniqueInput>;\n distinct?: InputMaybe<Array<OffchainRevocationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<OffchainRevocationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type QueryFindFirstSchemaArgs = {\n cursor?: InputMaybe<SchemaWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type QueryFindFirstSchemaNameArgs = {\n cursor?: InputMaybe<SchemaNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type QueryFindFirstSchemaNameOrThrowArgs = {\n cursor?: InputMaybe<SchemaNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type QueryFindFirstSchemaOrThrowArgs = {\n cursor?: InputMaybe<SchemaWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type QueryFindFirstServiceStatArgs = {\n cursor?: InputMaybe<ServiceStatWhereUniqueInput>;\n distinct?: InputMaybe<Array<ServiceStatScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<ServiceStatOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type QueryFindFirstServiceStatOrThrowArgs = {\n cursor?: InputMaybe<ServiceStatWhereUniqueInput>;\n distinct?: InputMaybe<Array<ServiceStatScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<ServiceStatOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type QueryFindFirstTimestampArgs = {\n cursor?: InputMaybe<TimestampWhereUniqueInput>;\n distinct?: InputMaybe<Array<TimestampScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<TimestampOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type QueryFindFirstTimestampOrThrowArgs = {\n cursor?: InputMaybe<TimestampWhereUniqueInput>;\n distinct?: InputMaybe<Array<TimestampScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<TimestampOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type QueryGetAttestationArgs = {\n where: AttestationWhereUniqueInput;\n};\n\n\nexport type QueryGetEnsNameArgs = {\n where: EnsNameWhereUniqueInput;\n};\n\n\nexport type QueryGetOffchainRevocationArgs = {\n where: OffchainRevocationWhereUniqueInput;\n};\n\n\nexport type QueryGetSchemaArgs = {\n where: SchemaWhereUniqueInput;\n};\n\n\nexport type QueryGetSchemaNameArgs = {\n where: SchemaNameWhereUniqueInput;\n};\n\n\nexport type QueryGetServiceStatArgs = {\n where: ServiceStatWhereUniqueInput;\n};\n\n\nexport type QueryGetTimestampArgs = {\n where: TimestampWhereUniqueInput;\n};\n\n\nexport type QueryGroupByAttestationArgs = {\n by: Array<AttestationScalarFieldEnum>;\n having?: InputMaybe<AttestationScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type QueryGroupByEnsNameArgs = {\n by: Array<EnsNameScalarFieldEnum>;\n having?: InputMaybe<EnsNameScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<EnsNameOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<EnsNameWhereInput>;\n};\n\n\nexport type QueryGroupByOffchainRevocationArgs = {\n by: Array<OffchainRevocationScalarFieldEnum>;\n having?: InputMaybe<OffchainRevocationScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<OffchainRevocationOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type QueryGroupBySchemaArgs = {\n by: Array<SchemaScalarFieldEnum>;\n having?: InputMaybe<SchemaScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<SchemaOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type QueryGroupBySchemaNameArgs = {\n by: Array<SchemaNameScalarFieldEnum>;\n having?: InputMaybe<SchemaNameScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type QueryGroupByServiceStatArgs = {\n by: Array<ServiceStatScalarFieldEnum>;\n having?: InputMaybe<ServiceStatScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<ServiceStatOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type QueryGroupByTimestampArgs = {\n by: Array<TimestampScalarFieldEnum>;\n having?: InputMaybe<TimestampScalarWhereWithAggregatesInput>;\n orderBy?: InputMaybe<Array<TimestampOrderByWithAggregationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type QueryOffchainRevocationArgs = {\n where: OffchainRevocationWhereUniqueInput;\n};\n\n\nexport type QueryOffchainRevocationsArgs = {\n cursor?: InputMaybe<OffchainRevocationWhereUniqueInput>;\n distinct?: InputMaybe<Array<OffchainRevocationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<OffchainRevocationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<OffchainRevocationWhereInput>;\n};\n\n\nexport type QuerySchemaArgs = {\n where: SchemaWhereUniqueInput;\n};\n\n\nexport type QuerySchemaNameArgs = {\n where: SchemaNameWhereUniqueInput;\n};\n\n\nexport type QuerySchemaNamesArgs = {\n cursor?: InputMaybe<SchemaNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\n\nexport type QuerySchemataArgs = {\n cursor?: InputMaybe<SchemaWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaWhereInput>;\n};\n\n\nexport type QueryServiceStatArgs = {\n where: ServiceStatWhereUniqueInput;\n};\n\n\nexport type QueryServiceStatsArgs = {\n cursor?: InputMaybe<ServiceStatWhereUniqueInput>;\n distinct?: InputMaybe<Array<ServiceStatScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<ServiceStatOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<ServiceStatWhereInput>;\n};\n\n\nexport type QueryTimestampArgs = {\n where: TimestampWhereUniqueInput;\n};\n\n\nexport type QueryTimestampsArgs = {\n cursor?: InputMaybe<TimestampWhereUniqueInput>;\n distinct?: InputMaybe<Array<TimestampScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<TimestampOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<TimestampWhereInput>;\n};\n\n\nexport type QueryTransactionArgs = {\n id: Scalars['ID']['input'];\n};\n\n\nexport type QueryTransactionsArgs = {\n after?: InputMaybe<Scalars['String']['input']>;\n block?: InputMaybe<RangeFilter>;\n bundledIn?: InputMaybe<Array<Scalars['ID']['input']>>;\n first?: InputMaybe<Scalars['Int']['input']>;\n ids?: InputMaybe<Array<Scalars['ID']['input']>>;\n ingested_at?: InputMaybe<RangeFilter>;\n owners?: InputMaybe<Array<Scalars['String']['input']>>;\n recipients?: InputMaybe<Array<Scalars['String']['input']>>;\n sort?: InputMaybe<SortOrder>;\n tags?: InputMaybe<Array<TagFilter>>;\n};\n\nexport enum QueryMode {\n Default = 'default',\n Insensitive = 'insensitive'\n}\n\n/** Filter with a min and max */\nexport type RangeFilter = {\n /** Maximum integer to filter to */\n max?: InputMaybe<Scalars['Int']['input']>;\n /** Minimum integer to filter from */\n min?: InputMaybe<Scalars['Int']['input']>;\n};\n\nexport type Schema = {\n __typename?: 'Schema';\n _count?: Maybe<SchemaCount>;\n attestations: Array<Attestation>;\n creator: Scalars['String']['output'];\n id: Scalars['String']['output'];\n index: Scalars['String']['output'];\n resolver: Scalars['String']['output'];\n revocable: Scalars['Boolean']['output'];\n schema: Scalars['String']['output'];\n schemaNames: Array<SchemaName>;\n time: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n};\n\n\nexport type SchemaAttestationsArgs = {\n cursor?: InputMaybe<AttestationWhereUniqueInput>;\n distinct?: InputMaybe<Array<AttestationScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<AttestationOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<AttestationWhereInput>;\n};\n\n\nexport type SchemaSchemaNamesArgs = {\n cursor?: InputMaybe<SchemaNameWhereUniqueInput>;\n distinct?: InputMaybe<Array<SchemaNameScalarFieldEnum>>;\n orderBy?: InputMaybe<Array<SchemaNameOrderByWithRelationInput>>;\n skip?: InputMaybe<Scalars['Int']['input']>;\n take?: InputMaybe<Scalars['Int']['input']>;\n where?: InputMaybe<SchemaNameWhereInput>;\n};\n\nexport type SchemaAvgAggregate = {\n __typename?: 'SchemaAvgAggregate';\n time?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type SchemaAvgOrderByAggregateInput = {\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaCount = {\n __typename?: 'SchemaCount';\n attestations: Scalars['Int']['output'];\n schemaNames: Scalars['Int']['output'];\n};\n\nexport type SchemaCountAggregate = {\n __typename?: 'SchemaCountAggregate';\n _all: Scalars['Int']['output'];\n creator: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n index: Scalars['Int']['output'];\n resolver: Scalars['Int']['output'];\n revocable: Scalars['Int']['output'];\n schema: Scalars['Int']['output'];\n time: Scalars['Int']['output'];\n txid: Scalars['Int']['output'];\n};\n\nexport type SchemaCountOrderByAggregateInput = {\n creator?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n index?: InputMaybe<SortOrder>;\n resolver?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaCreateInput = {\n attestations?: InputMaybe<AttestationCreateNestedManyWithoutSchemaInput>;\n creator: Scalars['String']['input'];\n id: Scalars['String']['input'];\n index: Scalars['String']['input'];\n resolver: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n schema: Scalars['String']['input'];\n schemaNames?: InputMaybe<SchemaNameCreateNestedManyWithoutSchemaInput>;\n time: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type SchemaCreateManyInput = {\n creator: Scalars['String']['input'];\n id: Scalars['String']['input'];\n index: Scalars['String']['input'];\n resolver: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n schema: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type SchemaCreateNestedOneWithoutAttestationsInput = {\n connect?: InputMaybe<SchemaWhereUniqueInput>;\n connectOrCreate?: InputMaybe<SchemaCreateOrConnectWithoutAttestationsInput>;\n create?: InputMaybe<SchemaCreateWithoutAttestationsInput>;\n};\n\nexport type SchemaCreateNestedOneWithoutSchemaNamesInput = {\n connect?: InputMaybe<SchemaWhereUniqueInput>;\n connectOrCreate?: InputMaybe<SchemaCreateOrConnectWithoutSchemaNamesInput>;\n create?: InputMaybe<SchemaCreateWithoutSchemaNamesInput>;\n};\n\nexport type SchemaCreateOrConnectWithoutAttestationsInput = {\n create: SchemaCreateWithoutAttestationsInput;\n where: SchemaWhereUniqueInput;\n};\n\nexport type SchemaCreateOrConnectWithoutSchemaNamesInput = {\n create: SchemaCreateWithoutSchemaNamesInput;\n where: SchemaWhereUniqueInput;\n};\n\nexport type SchemaCreateWithoutAttestationsInput = {\n creator: Scalars['String']['input'];\n id: Scalars['String']['input'];\n index: Scalars['String']['input'];\n resolver: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n schema: Scalars['String']['input'];\n schemaNames?: InputMaybe<SchemaNameCreateNestedManyWithoutSchemaInput>;\n time: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type SchemaCreateWithoutSchemaNamesInput = {\n attestations?: InputMaybe<AttestationCreateNestedManyWithoutSchemaInput>;\n creator: Scalars['String']['input'];\n id: Scalars['String']['input'];\n index: Scalars['String']['input'];\n resolver: Scalars['String']['input'];\n revocable: Scalars['Boolean']['input'];\n schema: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n txid: Scalars['String']['input'];\n};\n\nexport type SchemaGroupBy = {\n __typename?: 'SchemaGroupBy';\n _avg?: Maybe<SchemaAvgAggregate>;\n _count?: Maybe<SchemaCountAggregate>;\n _max?: Maybe<SchemaMaxAggregate>;\n _min?: Maybe<SchemaMinAggregate>;\n _sum?: Maybe<SchemaSumAggregate>;\n creator: Scalars['String']['output'];\n id: Scalars['String']['output'];\n index: Scalars['String']['output'];\n resolver: Scalars['String']['output'];\n revocable: Scalars['Boolean']['output'];\n schema: Scalars['String']['output'];\n time: Scalars['Int']['output'];\n txid: Scalars['String']['output'];\n};\n\nexport type SchemaMaxAggregate = {\n __typename?: 'SchemaMaxAggregate';\n creator?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n index?: Maybe<Scalars['String']['output']>;\n resolver?: Maybe<Scalars['String']['output']>;\n revocable?: Maybe<Scalars['Boolean']['output']>;\n schema?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type SchemaMaxOrderByAggregateInput = {\n creator?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n index?: InputMaybe<SortOrder>;\n resolver?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaMinAggregate = {\n __typename?: 'SchemaMinAggregate';\n creator?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n index?: Maybe<Scalars['String']['output']>;\n resolver?: Maybe<Scalars['String']['output']>;\n revocable?: Maybe<Scalars['Boolean']['output']>;\n schema?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type SchemaMinOrderByAggregateInput = {\n creator?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n index?: InputMaybe<SortOrder>;\n resolver?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaName = {\n __typename?: 'SchemaName';\n attesterAddress: Scalars['String']['output'];\n id: Scalars['String']['output'];\n isCreator: Scalars['Boolean']['output'];\n name: Scalars['String']['output'];\n schema: Schema;\n schemaId: Scalars['String']['output'];\n time: Scalars['Int']['output'];\n};\n\nexport type SchemaNameAvgAggregate = {\n __typename?: 'SchemaNameAvgAggregate';\n time?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type SchemaNameAvgOrderByAggregateInput = {\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameCountAggregate = {\n __typename?: 'SchemaNameCountAggregate';\n _all: Scalars['Int']['output'];\n attesterAddress: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n isCreator: Scalars['Int']['output'];\n name: Scalars['Int']['output'];\n schemaId: Scalars['Int']['output'];\n time: Scalars['Int']['output'];\n};\n\nexport type SchemaNameCountOrderByAggregateInput = {\n attesterAddress?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n isCreator?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameCreateInput = {\n attesterAddress: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n isCreator: Scalars['Boolean']['input'];\n name: Scalars['String']['input'];\n schema: SchemaCreateNestedOneWithoutSchemaNamesInput;\n time: Scalars['Int']['input'];\n};\n\nexport type SchemaNameCreateManyInput = {\n attesterAddress: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n isCreator: Scalars['Boolean']['input'];\n name: Scalars['String']['input'];\n schemaId: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n};\n\nexport type SchemaNameCreateManySchemaInput = {\n attesterAddress: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n isCreator: Scalars['Boolean']['input'];\n name: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n};\n\nexport type SchemaNameCreateManySchemaInputEnvelope = {\n data: Array<SchemaNameCreateManySchemaInput>;\n skipDuplicates?: InputMaybe<Scalars['Boolean']['input']>;\n};\n\nexport type SchemaNameCreateNestedManyWithoutSchemaInput = {\n connect?: InputMaybe<Array<SchemaNameWhereUniqueInput>>;\n connectOrCreate?: InputMaybe<Array<SchemaNameCreateOrConnectWithoutSchemaInput>>;\n create?: InputMaybe<Array<SchemaNameCreateWithoutSchemaInput>>;\n createMany?: InputMaybe<SchemaNameCreateManySchemaInputEnvelope>;\n};\n\nexport type SchemaNameCreateOrConnectWithoutSchemaInput = {\n create: SchemaNameCreateWithoutSchemaInput;\n where: SchemaNameWhereUniqueInput;\n};\n\nexport type SchemaNameCreateWithoutSchemaInput = {\n attesterAddress: Scalars['String']['input'];\n id?: InputMaybe<Scalars['String']['input']>;\n isCreator: Scalars['Boolean']['input'];\n name: Scalars['String']['input'];\n time: Scalars['Int']['input'];\n};\n\nexport type SchemaNameGroupBy = {\n __typename?: 'SchemaNameGroupBy';\n _avg?: Maybe<SchemaNameAvgAggregate>;\n _count?: Maybe<SchemaNameCountAggregate>;\n _max?: Maybe<SchemaNameMaxAggregate>;\n _min?: Maybe<SchemaNameMinAggregate>;\n _sum?: Maybe<SchemaNameSumAggregate>;\n attesterAddress: Scalars['String']['output'];\n id: Scalars['String']['output'];\n isCreator: Scalars['Boolean']['output'];\n name: Scalars['String']['output'];\n schemaId: Scalars['String']['output'];\n time: Scalars['Int']['output'];\n};\n\nexport type SchemaNameListRelationFilter = {\n every?: InputMaybe<SchemaNameWhereInput>;\n none?: InputMaybe<SchemaNameWhereInput>;\n some?: InputMaybe<SchemaNameWhereInput>;\n};\n\nexport type SchemaNameMaxAggregate = {\n __typename?: 'SchemaNameMaxAggregate';\n attesterAddress?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n isCreator?: Maybe<Scalars['Boolean']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n schemaId?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type SchemaNameMaxOrderByAggregateInput = {\n attesterAddress?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n isCreator?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameMinAggregate = {\n __typename?: 'SchemaNameMinAggregate';\n attesterAddress?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n isCreator?: Maybe<Scalars['Boolean']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n schemaId?: Maybe<Scalars['String']['output']>;\n time?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type SchemaNameMinOrderByAggregateInput = {\n attesterAddress?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n isCreator?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameOrderByRelationAggregateInput = {\n _count?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameOrderByWithAggregationInput = {\n _avg?: InputMaybe<SchemaNameAvgOrderByAggregateInput>;\n _count?: InputMaybe<SchemaNameCountOrderByAggregateInput>;\n _max?: InputMaybe<SchemaNameMaxOrderByAggregateInput>;\n _min?: InputMaybe<SchemaNameMinOrderByAggregateInput>;\n _sum?: InputMaybe<SchemaNameSumOrderByAggregateInput>;\n attesterAddress?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n isCreator?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameOrderByWithRelationInput = {\n attesterAddress?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n isCreator?: InputMaybe<SortOrder>;\n name?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SchemaOrderByWithRelationInput>;\n schemaId?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n};\n\nexport enum SchemaNameScalarFieldEnum {\n AttesterAddress = 'attesterAddress',\n Id = 'id',\n IsCreator = 'isCreator',\n Name = 'name',\n SchemaId = 'schemaId',\n Time = 'time'\n}\n\nexport type SchemaNameScalarWhereInput = {\n AND?: InputMaybe<Array<SchemaNameScalarWhereInput>>;\n NOT?: InputMaybe<Array<SchemaNameScalarWhereInput>>;\n OR?: InputMaybe<Array<SchemaNameScalarWhereInput>>;\n attesterAddress?: InputMaybe<StringFilter>;\n id?: InputMaybe<StringFilter>;\n isCreator?: InputMaybe<BoolFilter>;\n name?: InputMaybe<StringFilter>;\n schemaId?: InputMaybe<StringFilter>;\n time?: InputMaybe<IntFilter>;\n};\n\nexport type SchemaNameScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<SchemaNameScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<SchemaNameScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<SchemaNameScalarWhereWithAggregatesInput>>;\n attesterAddress?: InputMaybe<StringWithAggregatesFilter>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n isCreator?: InputMaybe<BoolWithAggregatesFilter>;\n name?: InputMaybe<StringWithAggregatesFilter>;\n schemaId?: InputMaybe<StringWithAggregatesFilter>;\n time?: InputMaybe<IntWithAggregatesFilter>;\n};\n\nexport type SchemaNameSumAggregate = {\n __typename?: 'SchemaNameSumAggregate';\n time?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type SchemaNameSumOrderByAggregateInput = {\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaNameUpdateInput = {\n attesterAddress?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n isCreator?: InputMaybe<BoolFieldUpdateOperationsInput>;\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n schema?: InputMaybe<SchemaUpdateOneRequiredWithoutSchemaNamesNestedInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n};\n\nexport type SchemaNameUpdateManyMutationInput = {\n attesterAddress?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n isCreator?: InputMaybe<BoolFieldUpdateOperationsInput>;\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n};\n\nexport type SchemaNameUpdateManyWithWhereWithoutSchemaInput = {\n data: SchemaNameUpdateManyMutationInput;\n where: SchemaNameScalarWhereInput;\n};\n\nexport type SchemaNameUpdateManyWithoutSchemaNestedInput = {\n connect?: InputMaybe<Array<SchemaNameWhereUniqueInput>>;\n connectOrCreate?: InputMaybe<Array<SchemaNameCreateOrConnectWithoutSchemaInput>>;\n create?: InputMaybe<Array<SchemaNameCreateWithoutSchemaInput>>;\n createMany?: InputMaybe<SchemaNameCreateManySchemaInputEnvelope>;\n delete?: InputMaybe<Array<SchemaNameWhereUniqueInput>>;\n deleteMany?: InputMaybe<Array<SchemaNameScalarWhereInput>>;\n disconnect?: InputMaybe<Array<SchemaNameWhereUniqueInput>>;\n set?: InputMaybe<Array<SchemaNameWhereUniqueInput>>;\n update?: InputMaybe<Array<SchemaNameUpdateWithWhereUniqueWithoutSchemaInput>>;\n updateMany?: InputMaybe<Array<SchemaNameUpdateManyWithWhereWithoutSchemaInput>>;\n upsert?: InputMaybe<Array<SchemaNameUpsertWithWhereUniqueWithoutSchemaInput>>;\n};\n\nexport type SchemaNameUpdateWithWhereUniqueWithoutSchemaInput = {\n data: SchemaNameUpdateWithoutSchemaInput;\n where: SchemaNameWhereUniqueInput;\n};\n\nexport type SchemaNameUpdateWithoutSchemaInput = {\n attesterAddress?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n isCreator?: InputMaybe<BoolFieldUpdateOperationsInput>;\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n};\n\nexport type SchemaNameUpsertWithWhereUniqueWithoutSchemaInput = {\n create: SchemaNameCreateWithoutSchemaInput;\n update: SchemaNameUpdateWithoutSchemaInput;\n where: SchemaNameWhereUniqueInput;\n};\n\nexport type SchemaNameWhereInput = {\n AND?: InputMaybe<Array<SchemaNameWhereInput>>;\n NOT?: InputMaybe<Array<SchemaNameWhereInput>>;\n OR?: InputMaybe<Array<SchemaNameWhereInput>>;\n attesterAddress?: InputMaybe<StringFilter>;\n id?: InputMaybe<StringFilter>;\n isCreator?: InputMaybe<BoolFilter>;\n name?: InputMaybe<StringFilter>;\n schema?: InputMaybe<SchemaRelationFilter>;\n schemaId?: InputMaybe<StringFilter>;\n time?: InputMaybe<IntFilter>;\n};\n\nexport type SchemaNameWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type SchemaOrderByWithAggregationInput = {\n _avg?: InputMaybe<SchemaAvgOrderByAggregateInput>;\n _count?: InputMaybe<SchemaCountOrderByAggregateInput>;\n _max?: InputMaybe<SchemaMaxOrderByAggregateInput>;\n _min?: InputMaybe<SchemaMinOrderByAggregateInput>;\n _sum?: InputMaybe<SchemaSumOrderByAggregateInput>;\n creator?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n index?: InputMaybe<SortOrder>;\n resolver?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SortOrder>;\n time?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaOrderByWithRelationInput = {\n attestations?: InputMaybe<AttestationOrderByRelationAggregateInput>;\n creator?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n index?: InputMaybe<SortOrder>;\n resolver?: InputMaybe<SortOrder>;\n revocable?: InputMaybe<SortOrder>;\n schema?: InputMaybe<SortOrder>;\n schemaNames?: InputMaybe<SchemaNameOrderByRelationAggregateInput>;\n time?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaRelationFilter = {\n is?: InputMaybe<SchemaWhereInput>;\n isNot?: InputMaybe<SchemaWhereInput>;\n};\n\nexport enum SchemaScalarFieldEnum {\n Creator = 'creator',\n Id = 'id',\n Index = 'index',\n Resolver = 'resolver',\n Revocable = 'revocable',\n Schema = 'schema',\n Time = 'time',\n Txid = 'txid'\n}\n\nexport type SchemaScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<SchemaScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<SchemaScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<SchemaScalarWhereWithAggregatesInput>>;\n creator?: InputMaybe<StringWithAggregatesFilter>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n index?: InputMaybe<StringWithAggregatesFilter>;\n resolver?: InputMaybe<StringWithAggregatesFilter>;\n revocable?: InputMaybe<BoolWithAggregatesFilter>;\n schema?: InputMaybe<StringWithAggregatesFilter>;\n time?: InputMaybe<IntWithAggregatesFilter>;\n txid?: InputMaybe<StringWithAggregatesFilter>;\n};\n\nexport type SchemaSumAggregate = {\n __typename?: 'SchemaSumAggregate';\n time?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type SchemaSumOrderByAggregateInput = {\n time?: InputMaybe<SortOrder>;\n};\n\nexport type SchemaUpdateInput = {\n attestations?: InputMaybe<AttestationUpdateManyWithoutSchemaNestedInput>;\n creator?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n index?: InputMaybe<StringFieldUpdateOperationsInput>;\n resolver?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n schema?: InputMaybe<StringFieldUpdateOperationsInput>;\n schemaNames?: InputMaybe<SchemaNameUpdateManyWithoutSchemaNestedInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type SchemaUpdateManyMutationInput = {\n creator?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n index?: InputMaybe<StringFieldUpdateOperationsInput>;\n resolver?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n schema?: InputMaybe<StringFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type SchemaUpdateOneRequiredWithoutAttestationsNestedInput = {\n connect?: InputMaybe<SchemaWhereUniqueInput>;\n connectOrCreate?: InputMaybe<SchemaCreateOrConnectWithoutAttestationsInput>;\n create?: InputMaybe<SchemaCreateWithoutAttestationsInput>;\n update?: InputMaybe<SchemaUpdateWithoutAttestationsInput>;\n upsert?: InputMaybe<SchemaUpsertWithoutAttestationsInput>;\n};\n\nexport type SchemaUpdateOneRequiredWithoutSchemaNamesNestedInput = {\n connect?: InputMaybe<SchemaWhereUniqueInput>;\n connectOrCreate?: InputMaybe<SchemaCreateOrConnectWithoutSchemaNamesInput>;\n create?: InputMaybe<SchemaCreateWithoutSchemaNamesInput>;\n update?: InputMaybe<SchemaUpdateWithoutSchemaNamesInput>;\n upsert?: InputMaybe<SchemaUpsertWithoutSchemaNamesInput>;\n};\n\nexport type SchemaUpdateWithoutAttestationsInput = {\n creator?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n index?: InputMaybe<StringFieldUpdateOperationsInput>;\n resolver?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n schema?: InputMaybe<StringFieldUpdateOperationsInput>;\n schemaNames?: InputMaybe<SchemaNameUpdateManyWithoutSchemaNestedInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type SchemaUpdateWithoutSchemaNamesInput = {\n attestations?: InputMaybe<AttestationUpdateManyWithoutSchemaNestedInput>;\n creator?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n index?: InputMaybe<StringFieldUpdateOperationsInput>;\n resolver?: InputMaybe<StringFieldUpdateOperationsInput>;\n revocable?: InputMaybe<BoolFieldUpdateOperationsInput>;\n schema?: InputMaybe<StringFieldUpdateOperationsInput>;\n time?: InputMaybe<IntFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type SchemaUpsertWithoutAttestationsInput = {\n create: SchemaCreateWithoutAttestationsInput;\n update: SchemaUpdateWithoutAttestationsInput;\n};\n\nexport type SchemaUpsertWithoutSchemaNamesInput = {\n create: SchemaCreateWithoutSchemaNamesInput;\n update: SchemaUpdateWithoutSchemaNamesInput;\n};\n\nexport type SchemaWhereInput = {\n AND?: InputMaybe<Array<SchemaWhereInput>>;\n NOT?: InputMaybe<Array<SchemaWhereInput>>;\n OR?: InputMaybe<Array<SchemaWhereInput>>;\n attestations?: InputMaybe<AttestationListRelationFilter>;\n creator?: InputMaybe<StringFilter>;\n id?: InputMaybe<StringFilter>;\n index?: InputMaybe<StringFilter>;\n resolver?: InputMaybe<StringFilter>;\n revocable?: InputMaybe<BoolFilter>;\n schema?: InputMaybe<StringFilter>;\n schemaNames?: InputMaybe<SchemaNameListRelationFilter>;\n time?: InputMaybe<IntFilter>;\n txid?: InputMaybe<StringFilter>;\n};\n\nexport type SchemaWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type ServiceStat = {\n __typename?: 'ServiceStat';\n name: Scalars['String']['output'];\n value: Scalars['String']['output'];\n};\n\nexport type ServiceStatCountAggregate = {\n __typename?: 'ServiceStatCountAggregate';\n _all: Scalars['Int']['output'];\n name: Scalars['Int']['output'];\n value: Scalars['Int']['output'];\n};\n\nexport type ServiceStatCountOrderByAggregateInput = {\n name?: InputMaybe<SortOrder>;\n value?: InputMaybe<SortOrder>;\n};\n\nexport type ServiceStatCreateInput = {\n name: Scalars['String']['input'];\n value: Scalars['String']['input'];\n};\n\nexport type ServiceStatCreateManyInput = {\n name: Scalars['String']['input'];\n value: Scalars['String']['input'];\n};\n\nexport type ServiceStatGroupBy = {\n __typename?: 'ServiceStatGroupBy';\n _count?: Maybe<ServiceStatCountAggregate>;\n _max?: Maybe<ServiceStatMaxAggregate>;\n _min?: Maybe<ServiceStatMinAggregate>;\n name: Scalars['String']['output'];\n value: Scalars['String']['output'];\n};\n\nexport type ServiceStatMaxAggregate = {\n __typename?: 'ServiceStatMaxAggregate';\n name?: Maybe<Scalars['String']['output']>;\n value?: Maybe<Scalars['String']['output']>;\n};\n\nexport type ServiceStatMaxOrderByAggregateInput = {\n name?: InputMaybe<SortOrder>;\n value?: InputMaybe<SortOrder>;\n};\n\nexport type ServiceStatMinAggregate = {\n __typename?: 'ServiceStatMinAggregate';\n name?: Maybe<Scalars['String']['output']>;\n value?: Maybe<Scalars['String']['output']>;\n};\n\nexport type ServiceStatMinOrderByAggregateInput = {\n name?: InputMaybe<SortOrder>;\n value?: InputMaybe<SortOrder>;\n};\n\nexport type ServiceStatOrderByWithAggregationInput = {\n _count?: InputMaybe<ServiceStatCountOrderByAggregateInput>;\n _max?: InputMaybe<ServiceStatMaxOrderByAggregateInput>;\n _min?: InputMaybe<ServiceStatMinOrderByAggregateInput>;\n name?: InputMaybe<SortOrder>;\n value?: InputMaybe<SortOrder>;\n};\n\nexport type ServiceStatOrderByWithRelationInput = {\n name?: InputMaybe<SortOrder>;\n value?: InputMaybe<SortOrder>;\n};\n\nexport enum ServiceStatScalarFieldEnum {\n Name = 'name',\n Value = 'value'\n}\n\nexport type ServiceStatScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<ServiceStatScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<ServiceStatScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<ServiceStatScalarWhereWithAggregatesInput>>;\n name?: InputMaybe<StringWithAggregatesFilter>;\n value?: InputMaybe<StringWithAggregatesFilter>;\n};\n\nexport type ServiceStatUpdateInput = {\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n value?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type ServiceStatUpdateManyMutationInput = {\n name?: InputMaybe<StringFieldUpdateOperationsInput>;\n value?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type ServiceStatWhereInput = {\n AND?: InputMaybe<Array<ServiceStatWhereInput>>;\n NOT?: InputMaybe<Array<ServiceStatWhereInput>>;\n OR?: InputMaybe<Array<ServiceStatWhereInput>>;\n name?: InputMaybe<StringFilter>;\n value?: InputMaybe<StringFilter>;\n};\n\nexport type ServiceStatWhereUniqueInput = {\n name?: InputMaybe<Scalars['String']['input']>;\n};\n\n/** Optionally reverse the result sort order from `HEIGHT_DESC` (default) to `HEIGHT_ASC`. */\nexport enum SortOrder {\n /** Results are sorted by the transaction block height in ascending order, with the oldest transactions appearing first, and the most recent and pending/unconfirmed appearing last. */\n HeightAsc = 'HEIGHT_ASC',\n /** Results are sorted by the transaction block height in descending order, with the most recent and unconfirmed/pending transactions appearing first. */\n HeightDesc = 'HEIGHT_DESC',\n /** Results are sorted by the transaction ingestion time in ascending order, with the oldest ingested transactions appearing first. */\n IngestedAtAsc = 'INGESTED_AT_ASC',\n /** Results are sorted by the transaction ingestion time in descending order, with the most recently ingested transactions appearing first. */\n IngestedAtDesc = 'INGESTED_AT_DESC',\n Asc = 'asc',\n Desc = 'desc'\n}\n\nexport type StringFieldUpdateOperationsInput = {\n set?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type StringFilter = {\n contains?: InputMaybe<Scalars['String']['input']>;\n endsWith?: InputMaybe<Scalars['String']['input']>;\n equals?: InputMaybe<Scalars['String']['input']>;\n gt?: InputMaybe<Scalars['String']['input']>;\n gte?: InputMaybe<Scalars['String']['input']>;\n in?: InputMaybe<Array<Scalars['String']['input']>>;\n lt?: InputMaybe<Scalars['String']['input']>;\n lte?: InputMaybe<Scalars['String']['input']>;\n mode?: InputMaybe<QueryMode>;\n not?: InputMaybe<NestedStringFilter>;\n notIn?: InputMaybe<Array<Scalars['String']['input']>>;\n startsWith?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type StringWithAggregatesFilter = {\n _count?: InputMaybe<NestedIntFilter>;\n _max?: InputMaybe<NestedStringFilter>;\n _min?: InputMaybe<NestedStringFilter>;\n contains?: InputMaybe<Scalars['String']['input']>;\n endsWith?: InputMaybe<Scalars['String']['input']>;\n equals?: InputMaybe<Scalars['String']['input']>;\n gt?: InputMaybe<Scalars['String']['input']>;\n gte?: InputMaybe<Scalars['String']['input']>;\n in?: InputMaybe<Array<Scalars['String']['input']>>;\n lt?: InputMaybe<Scalars['String']['input']>;\n lte?: InputMaybe<Scalars['String']['input']>;\n mode?: InputMaybe<QueryMode>;\n not?: InputMaybe<NestedStringWithAggregatesFilter>;\n notIn?: InputMaybe<Array<Scalars['String']['input']>>;\n startsWith?: InputMaybe<Scalars['String']['input']>;\n};\n\n/** Tag Schema */\nexport type Tag = {\n __typename?: 'Tag';\n /** UTF-8 tag name */\n name: Scalars['String']['output'];\n /** UTF-8 tag value */\n value: Scalars['String']['output'];\n};\n\n/** Find transactions with the following tag name and value */\nexport type TagFilter = {\n /** How tag names and values are matched. Defaults to EXACT. */\n match?: TagMatch;\n /** The tag name */\n name?: InputMaybe<Scalars['String']['input']>;\n /** The operator to apply to to the tag filter. Defaults to EQ (equal). */\n op?: TagOperator;\n /**\n * An array of values to match against. If multiple values are passed then transactions with _any_ matching tag value from the set will be returned.\n *\n * e.g.\n *\n * `{name: \"app-name\", values: [\"app-1\"]}`\n *\n * Returns all transactions where the `app-name` tag has a value of `app-1`.\n *\n * `{name: \"app-name\", values: [\"app-1\", \"app-2\", \"app-3\"]}`\n *\n * Returns all transactions where the `app-name` tag has a value of either `app-1` _or_ `app-2` _or_ `app-3`.\n */\n values?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n/** The method used to determine if tags match. */\nexport enum TagMatch {\n /** An exact match */\n Exact = 'EXACT',\n /** Fuzzy match containing all search terms */\n FuzzyAnd = 'FUZZY_AND',\n /** Fuzzy match containing at least one search term */\n FuzzyOr = 'FUZZY_OR',\n /** A wildcard match */\n Wildcard = 'WILDCARD'\n}\n\n/** The operator to apply to a tag value. */\nexport enum TagOperator {\n /** Equal */\n Eq = 'EQ',\n /** Not equal */\n Neq = 'NEQ'\n}\n\nexport type Timestamp = {\n __typename?: 'Timestamp';\n from: Scalars['String']['output'];\n id: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n tree: Scalars['String']['output'];\n txid: Scalars['String']['output'];\n};\n\nexport type TimestampAvgAggregate = {\n __typename?: 'TimestampAvgAggregate';\n timestamp?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type TimestampAvgOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampCountAggregate = {\n __typename?: 'TimestampCountAggregate';\n _all: Scalars['Int']['output'];\n from: Scalars['Int']['output'];\n id: Scalars['Int']['output'];\n timestamp: Scalars['Int']['output'];\n tree: Scalars['Int']['output'];\n txid: Scalars['Int']['output'];\n};\n\nexport type TimestampCountOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n tree?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampCreateInput = {\n from: Scalars['String']['input'];\n id: Scalars['String']['input'];\n timestamp: Scalars['Int']['input'];\n tree?: InputMaybe<Scalars['String']['input']>;\n txid: Scalars['String']['input'];\n};\n\nexport type TimestampCreateManyInput = {\n from: Scalars['String']['input'];\n id: Scalars['String']['input'];\n timestamp: Scalars['Int']['input'];\n tree?: InputMaybe<Scalars['String']['input']>;\n txid: Scalars['String']['input'];\n};\n\nexport type TimestampGroupBy = {\n __typename?: 'TimestampGroupBy';\n _avg?: Maybe<TimestampAvgAggregate>;\n _count?: Maybe<TimestampCountAggregate>;\n _max?: Maybe<TimestampMaxAggregate>;\n _min?: Maybe<TimestampMinAggregate>;\n _sum?: Maybe<TimestampSumAggregate>;\n from: Scalars['String']['output'];\n id: Scalars['String']['output'];\n timestamp: Scalars['Int']['output'];\n tree: Scalars['String']['output'];\n txid: Scalars['String']['output'];\n};\n\nexport type TimestampMaxAggregate = {\n __typename?: 'TimestampMaxAggregate';\n from?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n tree?: Maybe<Scalars['String']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type TimestampMaxOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n tree?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampMinAggregate = {\n __typename?: 'TimestampMinAggregate';\n from?: Maybe<Scalars['String']['output']>;\n id?: Maybe<Scalars['String']['output']>;\n timestamp?: Maybe<Scalars['Int']['output']>;\n tree?: Maybe<Scalars['String']['output']>;\n txid?: Maybe<Scalars['String']['output']>;\n};\n\nexport type TimestampMinOrderByAggregateInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n tree?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampOrderByWithAggregationInput = {\n _avg?: InputMaybe<TimestampAvgOrderByAggregateInput>;\n _count?: InputMaybe<TimestampCountOrderByAggregateInput>;\n _max?: InputMaybe<TimestampMaxOrderByAggregateInput>;\n _min?: InputMaybe<TimestampMinOrderByAggregateInput>;\n _sum?: InputMaybe<TimestampSumOrderByAggregateInput>;\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n tree?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampOrderByWithRelationInput = {\n from?: InputMaybe<SortOrder>;\n id?: InputMaybe<SortOrder>;\n timestamp?: InputMaybe<SortOrder>;\n tree?: InputMaybe<SortOrder>;\n txid?: InputMaybe<SortOrder>;\n};\n\nexport enum TimestampScalarFieldEnum {\n From = 'from',\n Id = 'id',\n Timestamp = 'timestamp',\n Tree = 'tree',\n Txid = 'txid'\n}\n\nexport type TimestampScalarWhereWithAggregatesInput = {\n AND?: InputMaybe<Array<TimestampScalarWhereWithAggregatesInput>>;\n NOT?: InputMaybe<Array<TimestampScalarWhereWithAggregatesInput>>;\n OR?: InputMaybe<Array<TimestampScalarWhereWithAggregatesInput>>;\n from?: InputMaybe<StringWithAggregatesFilter>;\n id?: InputMaybe<StringWithAggregatesFilter>;\n timestamp?: InputMaybe<IntWithAggregatesFilter>;\n tree?: InputMaybe<StringWithAggregatesFilter>;\n txid?: InputMaybe<StringWithAggregatesFilter>;\n};\n\nexport type TimestampSumAggregate = {\n __typename?: 'TimestampSumAggregate';\n timestamp?: Maybe<Scalars['Int']['output']>;\n};\n\nexport type TimestampSumOrderByAggregateInput = {\n timestamp?: InputMaybe<SortOrder>;\n};\n\nexport type TimestampUpdateInput = {\n from?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n tree?: InputMaybe<StringFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type TimestampUpdateManyMutationInput = {\n from?: InputMaybe<StringFieldUpdateOperationsInput>;\n id?: InputMaybe<StringFieldUpdateOperationsInput>;\n timestamp?: InputMaybe<IntFieldUpdateOperationsInput>;\n tree?: InputMaybe<StringFieldUpdateOperationsInput>;\n txid?: InputMaybe<StringFieldUpdateOperationsInput>;\n};\n\nexport type TimestampWhereInput = {\n AND?: InputMaybe<Array<TimestampWhereInput>>;\n NOT?: InputMaybe<Array<TimestampWhereInput>>;\n OR?: InputMaybe<Array<TimestampWhereInput>>;\n from?: InputMaybe<StringFilter>;\n id?: InputMaybe<StringFilter>;\n timestamp?: InputMaybe<IntFilter>;\n tree?: InputMaybe<StringFilter>;\n txid?: InputMaybe<StringFilter>;\n};\n\nexport type TimestampWhereUniqueInput = {\n id?: InputMaybe<Scalars['String']['input']>;\n};\n\n/** Transaction Structure */\nexport type Transaction = {\n __typename?: 'Transaction';\n anchor: Scalars['String']['output'];\n /** Transactions with a null block are recent and unconfirmed, if they aren't mined into a block within 60 minutes they will be removed from results. */\n block?: Maybe<Block>;\n /**\n * For bundled data items this references the containing bundle ID.\n * See: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md\n */\n bundledIn?: Maybe<Bundle>;\n data: MetaData;\n fee: Amount;\n id: Scalars['ID']['output'];\n /** When this transaction was made available for querying */\n ingested_at?: Maybe<Scalars['Int']['output']>;\n owner: Owner;\n /**\n * @deprecated Don't use, kept for backwards compatability only!\n * @deprecated Use `bundledIn`\n */\n parent?: Maybe<Parent>;\n quantity: Amount;\n recipient: Scalars['String']['output'];\n signature: Scalars['String']['output'];\n tags: Array<Tag>;\n};\n\n/**\n * Paginated result set using the GraphQL cursor spec,\n * see: https://relay.dev/graphql/connections.htm.\n */\nexport type TransactionConnection = {\n __typename?: 'TransactionConnection';\n /** The number of transactions that match this query. */\n count?: Maybe<Scalars['String']['output']>;\n edges: Array<TransactionEdge>;\n pageInfo: PageInfo;\n};\n\n/** Paginated result set using the GraphQL cursor spec. */\nexport type TransactionEdge = {\n __typename?: 'TransactionEdge';\n /**\n * The cursor value for fetching the next page.\n *\n * Pass this to the `after` parameter in ` transactions(after: $cursor)`, the next page will start from the next item after this.\n */\n cursor: Scalars['String']['output'];\n /** A transaction object. */\n node: Transaction;\n};\n\nexport type GetSchemasQueryVariables = Exact<{\n where: SchemaWhereInput;\n}>;\n\n\nexport type GetSchemasQuery = { __typename?: 'Query', schemas: Array<{ __typename?: 'Schema', id: string, schema: string, schemaNames: Array<{ __typename?: 'SchemaName', name: string }> }> };\n\nexport type GetSchemaByNameQueryVariables = Exact<{\n where: SchemaWhereInput;\n}>;\n\n\nexport type GetSchemaByNameQuery = { __typename?: 'Query', schemas: Array<{ __typename?: 'Schema', id: string, schema: string, schemaNames: Array<{ __typename?: 'SchemaName', name: string }> }> };\n\nexport type GetSeedsQueryVariables = Exact<{\n where: AttestationWhereInput;\n take?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GetSeedsQuery = { __typename?: 'Query', itemSeeds: Array<{ __typename?: 'Attestation', id: string, decodedDataJson: string, attester: string, refUID: string, revoked: boolean, schemaId: string, timeCreated: number, isOffchain: boolean, schema: { __typename?: 'Schema', schemaNames: Array<{ __typename?: 'SchemaName', name: string }> } }> };\n\nexport type GetSeedIdsQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetSeedIdsQuery = { __typename?: 'Query', itemSeedIds: Array<{ __typename?: 'Attestation', id: string }> };\n\nexport type GetStorageTransactionIdQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetStorageTransactionIdQuery = { __typename?: 'Query', storageTransactionId: Array<{ __typename?: 'Attestation', id: string, decodedDataJson: string }> };\n\nexport type GetVersionsQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetVersionsQuery = { __typename?: 'Query', itemVersions: Array<(\n { __typename?: 'Attestation' }\n & { ' $fragmentRefs'?: { 'AttestationFieldsFragment': AttestationFieldsFragment } }\n )> };\n\nexport type GetPropertiesQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetPropertiesQuery = { __typename?: 'Query', itemProperties: Array<(\n { __typename?: 'Attestation' }\n & { ' $fragmentRefs'?: { 'AttestationFieldsFragment': AttestationFieldsFragment } }\n )> };\n\nexport type GetAllPropertiesForAllVersionsQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetAllPropertiesForAllVersionsQuery = { __typename?: 'Query', allProperties: Array<(\n { __typename?: 'Attestation' }\n & { ' $fragmentRefs'?: { 'AttestationFieldsFragment': AttestationFieldsFragment } }\n )> };\n\nexport type AttestationFieldsFragment = { __typename?: 'Attestation', id: string, decodedDataJson: string, attester: string, refUID: string, revoked: boolean, schemaId: string, txid: string, timeCreated: number, time: number, isOffchain: boolean, schema: { __typename?: 'Schema', schemaNames: Array<{ __typename?: 'SchemaName', name: string }> } } & { ' $fragmentName'?: 'AttestationFieldsFragment' };\n\nexport type SchemaFieldsFragment = { __typename?: 'Schema', id: string, resolver: string, revocable: boolean, schema: string, index: string, time: number, txid: string, creator: string, schemaNames: Array<{ __typename?: 'SchemaName', name: string }> } & { ' $fragmentName'?: 'SchemaFieldsFragment' };\n\nexport type GetTransactionTagsQueryVariables = Exact<{\n transactionId: Scalars['ID']['input'];\n}>;\n\n\nexport type GetTransactionTagsQuery = { __typename?: 'Query', tags?: { __typename?: 'Transaction', id: string, tags: Array<{ __typename?: 'Tag', name: string, value: string }> } | null };\n\nexport type GetFilesMetadataQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetFilesMetadataQuery = { __typename?: 'Query', filesMetadata: Array<(\n { __typename?: 'Attestation' }\n & { ' $fragmentRefs'?: { 'AttestationFieldsFragment': AttestationFieldsFragment } }\n )> };\n\nexport type GetArweaveTransactionsQueryVariables = Exact<{\n owners?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;\n first?: InputMaybe<Scalars['Int']['input']>;\n after?: InputMaybe<Scalars['String']['input']>;\n}>;\n\n\nexport type GetArweaveTransactionsQuery = { __typename?: 'Query', transactions: { __typename?: 'TransactionConnection', edges: Array<{ __typename?: 'TransactionEdge', cursor: string, node: { __typename?: 'Transaction', id: string, anchor: string, signature: string, block?: { __typename?: 'Block', id?: string | null, height: number } | null, data: { __typename?: 'MetaData', size: string, type?: string | null }, tags: Array<{ __typename?: 'Tag', name: string, value: string }> } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean } } };\n\nexport type GetImageSeedsQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetImageSeedsQuery = { __typename?: 'Query', imageSeeds: Array<{ __typename?: 'Attestation', id: string, decodedDataJson: string, attester: string, refUID: string, revoked: boolean, schemaId: string, txid: string, timeCreated: number, time: number, isOffchain: boolean, schema: { __typename?: 'Schema', schemaNames: Array<{ __typename?: 'SchemaName', name: string }> } }> };\n\nexport type GetImageVersionsQueryVariables = Exact<{\n where: AttestationWhereInput;\n}>;\n\n\nexport type GetImageVersionsQuery = { __typename?: 'Query', imageVersions: Array<(\n { __typename?: 'Attestation' }\n & { ' $fragmentRefs'?: { 'AttestationFieldsFragment': AttestationFieldsFragment } }\n )> };\n\nexport type GetSchemaUidsQueryVariables = Exact<{\n where: SchemaWhereInput;\n}>;\n\n\nexport type GetSchemaUidsQuery = { __typename?: 'Query', schemaUids: Array<{ __typename?: 'Schema', id: string, schema: string, schemaNames: Array<{ __typename?: 'SchemaName', name: string }> }> };\n\nexport const AttestationFieldsFragmentDoc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<AttestationFieldsFragment, unknown>;\nexport const SchemaFieldsFragmentDoc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Schema\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"resolver\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revocable\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"index\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"creator\"}}]}}]} as unknown as DocumentNode<SchemaFieldsFragment, unknown>;\nexport const GetSchemasDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetSchemas\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SchemaWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"schemas\"},\"name\":{\"kind\":\"Name\",\"value\":\"schemata\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}}]}}]} as unknown as DocumentNode<GetSchemasQuery, GetSchemasQueryVariables>;\nexport const GetSchemaByNameDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetSchemaByName\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SchemaWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"schemas\"},\"name\":{\"kind\":\"Name\",\"value\":\"schemata\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}}]}}]} as unknown as DocumentNode<GetSchemaByNameQuery, GetSchemaByNameQueryVariables>;\nexport const GetSeedsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetSeeds\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"take\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"itemSeeds\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"take\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"take\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]}}]} as unknown as DocumentNode<GetSeedsQuery, GetSeedsQueryVariables>;\nexport const GetSeedIdsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetSeedIds\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"itemSeedIds\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}}]}}]}}]} as unknown as DocumentNode<GetSeedIdsQuery, GetSeedIdsQueryVariables>;\nexport const GetStorageTransactionIdDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetStorageTransactionId\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"storageTransactionId\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}}]}}]}}]} as unknown as DocumentNode<GetStorageTransactionIdQuery, GetStorageTransactionIdQueryVariables>;\nexport const GetVersionsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetVersions\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"itemVersions\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"FragmentSpread\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"}}]}}]}},{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<GetVersionsQuery, GetVersionsQueryVariables>;\nexport const GetPropertiesDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetProperties\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"itemProperties\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"FragmentSpread\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"}}]}}]}},{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<GetPropertiesQuery, GetPropertiesQueryVariables>;\nexport const GetAllPropertiesForAllVersionsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetAllPropertiesForAllVersions\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"allProperties\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"FragmentSpread\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"}}]}}]}},{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<GetAllPropertiesForAllVersionsQuery, GetAllPropertiesForAllVersionsQueryVariables>;\nexport const GetTransactionTagsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetTransactionTags\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"transactionId\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ID\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"tags\"},\"name\":{\"kind\":\"Name\",\"value\":\"transaction\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"transactionId\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"tags\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"value\"}}]}}]}}]}}]} as unknown as DocumentNode<GetTransactionTagsQuery, GetTransactionTagsQueryVariables>;\nexport const GetFilesMetadataDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetFilesMetadata\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"filesMetadata\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"FragmentSpread\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"}}]}}]}},{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<GetFilesMetadataQuery, GetFilesMetadataQueryVariables>;\nexport const GetArweaveTransactionsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetArweaveTransactions\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"owners\"}},\"type\":{\"kind\":\"ListType\",\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"after\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"transactions\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"owners\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"owners\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"after\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"after\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"edges\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"cursor\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"node\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"anchor\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"signature\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"block\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"height\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"data\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"size\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"tags\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"value\"}}]}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"pageInfo\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"hasNextPage\"}}]}}]}}]}}]} as unknown as DocumentNode<GetArweaveTransactionsQuery, GetArweaveTransactionsQueryVariables>;\nexport const GetImageSeedsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetImageSeeds\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"imageSeeds\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]}}]} as unknown as DocumentNode<GetImageSeedsQuery, GetImageSeedsQueryVariables>;\nexport const GetImageVersionsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetImageVersions\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AttestationWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"imageVersions\"},\"name\":{\"kind\":\"Name\",\"value\":\"attestations\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"ListValue\",\"values\":[{\"kind\":\"ObjectValue\",\"fields\":[{\"kind\":\"ObjectField\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"},\"value\":{\"kind\":\"EnumValue\",\"value\":\"desc\"}}]}]}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"FragmentSpread\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"}}]}}]}},{\"kind\":\"FragmentDefinition\",\"name\":{\"kind\":\"Name\",\"value\":\"attestationFields\"},\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Attestation\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"decodedDataJson\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"attester\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"refUID\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"revoked\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"txid\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"timeCreated\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"isOffchain\"}}]}}]} as unknown as DocumentNode<GetImageVersionsQuery, GetImageVersionsQueryVariables>;\nexport const GetSchemaUidsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetSchemaUids\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SchemaWhereInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"alias\":{\"kind\":\"Name\",\"value\":\"schemaUids\"},\"name\":{\"kind\":\"Name\",\"value\":\"schemata\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"where\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schema\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"schemaNames\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}}]}}]}}]} as unknown as DocumentNode<GetSchemaUidsQuery, GetSchemaUidsQueryVariables>;","/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query GetSchemas($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": typeof types.GetSchemasDocument,\n \"\\n query GetSchemaByName($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": typeof types.GetSchemaByNameDocument,\n \"\\n query GetSeeds($where: AttestationWhereInput!, $take: Int) {\\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n timeCreated\\n isOffchain\\n }\\n }\\n\": typeof types.GetSeedsDocument,\n \"\\n query GetSeedIds($where: AttestationWhereInput!) {\\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n }\\n }\\n\": typeof types.GetSeedIdsDocument,\n \"\\n query GetStorageTransactionId($where: AttestationWhereInput!) {\\n storageTransactionId: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n id\\n decodedDataJson\\n }\\n }\\n\": typeof types.GetStorageTransactionIdDocument,\n \"\\n query GetVersions($where: AttestationWhereInput!) {\\n itemVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": typeof types.GetVersionsDocument,\n \"\\n query GetProperties($where: AttestationWhereInput!) {\\n itemProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": typeof types.GetPropertiesDocument,\n \"\\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\\n allProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": typeof types.GetAllPropertiesForAllVersionsDocument,\n \"\\n fragment attestationFields on Attestation {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n\": typeof types.AttestationFieldsFragmentDoc,\n \"\\n fragment schemaFields on Schema {\\n id\\n resolver\\n revocable\\n schema\\n index\\n schemaNames {\\n name\\n }\\n time\\n txid\\n creator\\n }\\n\": typeof types.SchemaFieldsFragmentDoc,\n \"\\n query GetTransactionTags($transactionId: ID!) {\\n tags: transaction(id: $transactionId) {\\n id\\n tags {\\n name\\n value\\n }\\n }\\n }\\n\": typeof types.GetTransactionTagsDocument,\n \"\\n query GetFilesMetadata($where: AttestationWhereInput!) {\\n filesMetadata: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": typeof types.GetFilesMetadataDocument,\n \"\\n query GetArweaveTransactions(\\n $owners: [String!]\\n $first: Int\\n $after: String\\n ) {\\n transactions(owners: $owners, first: $first, after: $after) {\\n edges {\\n cursor\\n node {\\n id\\n anchor\\n signature\\n block {\\n id\\n height\\n }\\n data {\\n size\\n type\\n }\\n tags {\\n name\\n value\\n }\\n }\\n }\\n pageInfo {\\n hasNextPage\\n }\\n }\\n }\\n\": typeof types.GetArweaveTransactionsDocument,\n \"\\n query GetImageSeeds($where: AttestationWhereInput!) {\\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n }\\n\": typeof types.GetImageSeedsDocument,\n \"\\n query GetImageVersions($where: AttestationWhereInput!) {\\n imageVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": typeof types.GetImageVersionsDocument,\n \"\\n query GetSchemaUids($where: SchemaWhereInput!) {\\n schemaUids: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": typeof types.GetSchemaUidsDocument,\n};\nconst documents: Documents = {\n \"\\n query GetSchemas($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": types.GetSchemasDocument,\n \"\\n query GetSchemaByName($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": types.GetSchemaByNameDocument,\n \"\\n query GetSeeds($where: AttestationWhereInput!, $take: Int) {\\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n timeCreated\\n isOffchain\\n }\\n }\\n\": types.GetSeedsDocument,\n \"\\n query GetSeedIds($where: AttestationWhereInput!) {\\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n }\\n }\\n\": types.GetSeedIdsDocument,\n \"\\n query GetStorageTransactionId($where: AttestationWhereInput!) {\\n storageTransactionId: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n id\\n decodedDataJson\\n }\\n }\\n\": types.GetStorageTransactionIdDocument,\n \"\\n query GetVersions($where: AttestationWhereInput!) {\\n itemVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": types.GetVersionsDocument,\n \"\\n query GetProperties($where: AttestationWhereInput!) {\\n itemProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": types.GetPropertiesDocument,\n \"\\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\\n allProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": types.GetAllPropertiesForAllVersionsDocument,\n \"\\n fragment attestationFields on Attestation {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n\": types.AttestationFieldsFragmentDoc,\n \"\\n fragment schemaFields on Schema {\\n id\\n resolver\\n revocable\\n schema\\n index\\n schemaNames {\\n name\\n }\\n time\\n txid\\n creator\\n }\\n\": types.SchemaFieldsFragmentDoc,\n \"\\n query GetTransactionTags($transactionId: ID!) {\\n tags: transaction(id: $transactionId) {\\n id\\n tags {\\n name\\n value\\n }\\n }\\n }\\n\": types.GetTransactionTagsDocument,\n \"\\n query GetFilesMetadata($where: AttestationWhereInput!) {\\n filesMetadata: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": types.GetFilesMetadataDocument,\n \"\\n query GetArweaveTransactions(\\n $owners: [String!]\\n $first: Int\\n $after: String\\n ) {\\n transactions(owners: $owners, first: $first, after: $after) {\\n edges {\\n cursor\\n node {\\n id\\n anchor\\n signature\\n block {\\n id\\n height\\n }\\n data {\\n size\\n type\\n }\\n tags {\\n name\\n value\\n }\\n }\\n }\\n pageInfo {\\n hasNextPage\\n }\\n }\\n }\\n\": types.GetArweaveTransactionsDocument,\n \"\\n query GetImageSeeds($where: AttestationWhereInput!) {\\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n }\\n\": types.GetImageSeedsDocument,\n \"\\n query GetImageVersions($where: AttestationWhereInput!) {\\n imageVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\": types.GetImageVersionsDocument,\n \"\\n query GetSchemaUids($where: SchemaWhereInput!) {\\n schemaUids: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\": types.GetSchemaUidsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetSchemas($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetSchemas($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetSchemaByName($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetSchemaByName($where: SchemaWhereInput!) {\\n schemas: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetSeeds($where: AttestationWhereInput!, $take: Int) {\\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n timeCreated\\n isOffchain\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetSeeds($where: AttestationWhereInput!, $take: Int) {\\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n timeCreated\\n isOffchain\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetSeedIds($where: AttestationWhereInput!) {\\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetSeedIds($where: AttestationWhereInput!) {\\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetStorageTransactionId($where: AttestationWhereInput!) {\\n storageTransactionId: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n id\\n decodedDataJson\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetStorageTransactionId($where: AttestationWhereInput!) {\\n storageTransactionId: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n id\\n decodedDataJson\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetVersions($where: AttestationWhereInput!) {\\n itemVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetVersions($where: AttestationWhereInput!) {\\n itemVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetProperties($where: AttestationWhereInput!) {\\n itemProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetProperties($where: AttestationWhereInput!) {\\n itemProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\\n allProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\\n allProperties: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n fragment attestationFields on Attestation {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n\"): (typeof documents)[\"\\n fragment attestationFields on Attestation {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n fragment schemaFields on Schema {\\n id\\n resolver\\n revocable\\n schema\\n index\\n schemaNames {\\n name\\n }\\n time\\n txid\\n creator\\n }\\n\"): (typeof documents)[\"\\n fragment schemaFields on Schema {\\n id\\n resolver\\n revocable\\n schema\\n index\\n schemaNames {\\n name\\n }\\n time\\n txid\\n creator\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetTransactionTags($transactionId: ID!) {\\n tags: transaction(id: $transactionId) {\\n id\\n tags {\\n name\\n value\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetTransactionTags($transactionId: ID!) {\\n tags: transaction(id: $transactionId) {\\n id\\n tags {\\n name\\n value\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetFilesMetadata($where: AttestationWhereInput!) {\\n filesMetadata: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetFilesMetadata($where: AttestationWhereInput!) {\\n filesMetadata: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetArweaveTransactions(\\n $owners: [String!]\\n $first: Int\\n $after: String\\n ) {\\n transactions(owners: $owners, first: $first, after: $after) {\\n edges {\\n cursor\\n node {\\n id\\n anchor\\n signature\\n block {\\n id\\n height\\n }\\n data {\\n size\\n type\\n }\\n tags {\\n name\\n value\\n }\\n }\\n }\\n pageInfo {\\n hasNextPage\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetArweaveTransactions(\\n $owners: [String!]\\n $first: Int\\n $after: String\\n ) {\\n transactions(owners: $owners, first: $first, after: $after) {\\n edges {\\n cursor\\n node {\\n id\\n anchor\\n signature\\n block {\\n id\\n height\\n }\\n data {\\n size\\n type\\n }\\n tags {\\n name\\n value\\n }\\n }\\n }\\n pageInfo {\\n hasNextPage\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetImageSeeds($where: AttestationWhereInput!) {\\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetImageSeeds($where: AttestationWhereInput!) {\\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\\n id\\n decodedDataJson\\n attester\\n schema {\\n schemaNames {\\n name\\n }\\n }\\n refUID\\n revoked\\n schemaId\\n txid\\n timeCreated\\n time\\n isOffchain\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetImageVersions($where: AttestationWhereInput!) {\\n imageVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetImageVersions($where: AttestationWhereInput!) {\\n imageVersions: attestations(\\n where: $where\\n orderBy: [{ timeCreated: desc }]\\n ) {\\n ...attestationFields\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetSchemaUids($where: SchemaWhereInput!) {\\n schemaUids: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetSchemaUids($where: SchemaWhereInput!) {\\n schemaUids: schemata(where: $where) {\\n id\\n schema\\n schemaNames {\\n name\\n }\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;","import { graphql } from '@/graphql/gql'\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core'\nimport { Attestation, Schema as EASSchema } from '@/graphql/gql/graphql'\n\nexport const GET_SCHEMAS = graphql(/* GraphQL */ `\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n`)\n\nexport const GET_SCHEMA_BY_NAME = graphql(/* GraphQL */ `\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n`) as TypedDocumentNode<{ schemas: EASSchema[] }>\n\nexport const GET_SEEDS = graphql(/* GraphQL */ `\n query GetSeeds($where: AttestationWhereInput!, $take: Int) {\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take) {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n schemaId\n timeCreated\n isOffchain\n }\n }\n`) as TypedDocumentNode<{ itemSeeds: Attestation[] }>\n\nexport const GET_SEED_IDS = graphql(/* GraphQL */ `\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n`) as TypedDocumentNode<{ itemSeedIds: Attestation[] }>\n\nexport const GET_STORAGE_TRANSACTION_ID = graphql(/* GraphQL */ `\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n`) as TypedDocumentNode<{ storageTransactionId: Attestation[] }>\n\nexport const GET_VERSIONS = graphql(/* GraphQL */ `\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n`) as TypedDocumentNode<{ itemVersions: Attestation[] }>\n\nexport const GET_PROPERTIES = graphql(/* GraphQL */ `\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n`) as TypedDocumentNode<{ itemProperties: Attestation[] }>\n\nexport const GET_ALL_PROPERTIES_FOR_ALL_VERSIONS = graphql(/* GraphQL */ `\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n`) as TypedDocumentNode<{ allProperties: Attestation[] }>\n","import { GET_SCHEMAS } from '@/Item/queries'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { BaseEasClient } from '@/helpers/EasClient/BaseEasClient'\nimport { BaseQueryClient } from '@/helpers/QueryClient/BaseQueryClient'\nimport { eq } from 'drizzle-orm'\nimport { models as modelsTable, modelUids } from '@/seedSchema'\n\nexport const getSchemaUidForModel = async (\n modelName: string,\n): Promise<string | null | undefined> => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const modeType = modelName.toLowerCase()\n\n const modelSchemaQuery = await queryClient.fetchQuery({\n queryKey: [`getPropertySchema${modelName}`],\n queryFn: async () =>\n easClient.request(GET_SCHEMAS, {\n where: {\n schemaNames: {\n some: {\n name: {\n equals: modeType,\n },\n },\n },\n },\n }),\n })\n\n const foundSchema = modelSchemaQuery.schemas[0]\n if (foundSchema) return foundSchema.id\n\n // Fallback: use schema UID from local DB when EAS has no schema (e.g. test schemas)\n const appDb = BaseDb.getAppDb()\n if (appDb) {\n const row = await appDb\n .select({ uid: modelUids.uid })\n .from(modelsTable)\n .innerJoin(modelUids, eq(modelsTable.id, modelUids.modelId))\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n const uid = row[0]?.uid\n if (uid) return uid\n }\n\n return undefined\n}\n","import { generateId } from '@/helpers'\nimport { seeds } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { getSchemaUidForModel } from '@/db/read/getSchemaUidForModel'\n\ntype CreateSeedProps = {\n type: string\n seedUid?: string\n}\n\nexport const createSeed = async ({ type, seedUid }: CreateSeedProps): Promise<string> => {\n const schemaUid = await getSchemaUidForModel(type)\n\n // schemaUid is optional - Items can be created without a schemaUid\n // if the EAS schema hasn't been published yet\n\n const appDb = BaseDb.getAppDb()\n\n const newSeedLocalId = generateId()\n\n await appDb.insert(seeds).values({\n localId: newSeedLocalId,\n type,\n uid: seedUid,\n createdAt: Date.now(),\n schemaUid: schemaUid || null,\n })\n\n return newSeedLocalId\n} ","import { generateId } from '@/helpers'\nimport { versions } from '@/seedSchema'\nimport { BaseDb } from '../Db/BaseDb'\n\ntype CreateVersionProps = {\n seedLocalId?: string\n seedUid?: string\n seedType?: string\n uid?: string\n}\ntype CreateVersion = (props: CreateVersionProps) => Promise<string>\n\nexport const createVersion: CreateVersion = async ({\n seedLocalId,\n seedUid,\n seedType,\n uid,\n}) => {\n const appDb = BaseDb.getAppDb()\n\n const newVersionLocalId = generateId()\n\n await appDb.insert(versions).values({\n localId: newVersionLocalId,\n createdAt: Date.now(),\n seedLocalId,\n seedUid: seedUid ?? 'NULL',\n seedType,\n uid: uid || 'NULL',\n })\n\n return newVersionLocalId\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { createSeed } from '@/db/write/createSeed'\nimport { FromCallbackInput, ItemMachineContext } from '@/types'\nimport { createVersion } from '@/db/write/createVersion'\n\nexport const hydrateNewItem = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack, input: { context } }) => {\n const { seedUid, versionUid, modelName } = context\n\n let newSeedLocalId: string\n\n const _hydrateNewItem = async (): Promise<void> => {\n if (!modelName) {\n throw new Error('modelName is required')\n }\n\n newSeedLocalId = await createSeed({\n type: modelName.toLowerCase(),\n seedUid: seedUid ?? 'NULL',\n })\n\n await createVersion({\n seedLocalId: newSeedLocalId,\n seedType: modelName.toLowerCase(),\n uid: versionUid ?? 'NULL',\n })\n }\n\n _hydrateNewItem().then(() => {\n sendBack({ type: 'hydrateNewItemSuccess' })\n })\n})\n","import { ModelProperty } from '@/ModelProperty/ModelProperty'\n\n/**\n * Convert Model.properties array to object format (for backward compatibility)\n * This replaces the old model.schema getter\n */\nexport function modelPropertiesToObject(properties: ModelProperty[]): { [propertyName: string]: any } {\n const schemaObj: { [propertyName: string]: any } = {}\n \n for (const property of properties) {\n const propContext = property._getSnapshotContext()\n if (propContext.name) {\n schemaObj[propContext.name] = {\n dataType: propContext.dataType,\n ref: propContext.refModelName || propContext.ref,\n refValueType: propContext.refValueType,\n storageType: propContext.storageType,\n localStorageDir: propContext.localStorageDir,\n filenameSuffix: propContext.filenameSuffix,\n }\n }\n }\n \n return schemaObj\n}\n\n","import { EventObject, fromCallback } from 'xstate'\nimport { GET_PROPERTIES } from '@/Item/queries'\nimport { itemMachineSingle } from '@/Item/service/itemMachineSingle'\nimport { PropertyType } from '@/seedSchema'\nimport { Attestation } from '@/graphql/gql/graphql'\nimport { BaseEasClient, BaseQueryClient } from '@/helpers'\n// Dynamic import to break circular dependency: Model -> BaseItem -> ... -> fetchDataFromEas -> Model\n// import { Model } from '@/Model/Model'\nimport { modelPropertiesToObject } from '@/helpers/model'\n\n\nimport { FromCallbackInput, ItemMachineContext } from '@/types'\n\nexport const fetchDataFromEas = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack, input: { context } }) => {\n const { ModelClass, modelTableName, versionUid, modelName } = context\n\n const _initializeAndFetch = async (): Promise<void> => {\n const propertiesMetadata = new Map<string, PropertyType>()\n\n // Get model schema - prefer ModelClass if available, otherwise look up by modelName\n let modelSchema: Record<string, PropertyType> | undefined\n if (ModelClass && ModelClass.properties) {\n modelSchema = modelPropertiesToObject(ModelClass.properties)\n } else if (modelName) {\n // Dynamic import to break circular dependency\n const modelMod = await import('../../../Model/Model')\n const { Model } = modelMod\n const model = Model.getByName(modelName)\n modelSchema = model?.properties ? modelPropertiesToObject(model.properties) : undefined\n }\n\n // EAS is the final source of truth, so we need to see if our Item is\n // already represented there. Then we need to intelligently sync/merge\n // with whatever new data has been created on the device before the sync.\n if (modelSchema) {\n for (const [propertyName, propertyMetadata] of Object.entries(modelSchema)) {\n if (propertyMetadata) {\n propertiesMetadata.set(propertyName, propertyMetadata)\n }\n }\n }\n\n sendBack({ type: 'updatePropertiesMetadata', propertiesMetadata })\n\n if (!versionUid) {\n // In this case this is a local only item, so we don't need to fetch anything\n sendBack({ type: 'fetchDataFromEasSuccess' })\n return\n }\n\n const _fetchDataFromEas = async (): Promise<void> => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n // Fetch Properties by versionUid\n const { itemProperties } = await queryClient.fetchQuery({\n queryKey: ['getProperties', versionUid],\n queryFn: async () =>\n easClient.request(GET_PROPERTIES, {\n where: {\n refUID: {\n in: [versionUid],\n },\n decodedDataJson: {\n not: {\n // The first of many filters to keep bad data out\n contains:\n '\"value\":\"0x0000000000000000000000000000000000000000000000000000000000000020\"',\n },\n },\n },\n }),\n })\n\n // Filter properties by schemaId\n const selectedPropertiesMap: {\n [schemaId: string]: Attestation[]\n } = {}\n itemProperties.forEach((property: Attestation) => {\n const existingProperties = selectedPropertiesMap[property.schemaId] || []\n existingProperties.push(property)\n selectedPropertiesMap[property.schemaId] = existingProperties\n })\n\n // For each schemaId, sort property Attestations by timeCreated DESC\n Object.keys(selectedPropertiesMap).forEach((schemaId) => {\n const sorted = selectedPropertiesMap[schemaId].sort((a, b) => {\n return a.timeCreated - b.timeCreated\n })\n selectedPropertiesMap[schemaId] = sorted\n })\n\n Object.keys(selectedPropertiesMap).forEach((schemaId) => {\n // TODO: Finish this logic\n // console.log('[singleItemActors] [fetchDataFromEas] schemaId', schemaId)\n // sendBack({ type: 'addPropertyAttestation', schemaId })\n })\n\n // Attach processed properties to the itemService/itemMachine context\n sendBack({\n type: 'updatedPropertiesBySchemaUid',\n propertiesBySchemaUid: selectedPropertiesMap,\n })\n \n sendBack({ type: 'fetchDataFromEasSuccess' })\n }\n\n await _fetchDataFromEas()\n }\n\n _initializeAndFetch().catch((error) => {\n console.error('[fetchDataFromEas] Error:', error)\n sendBack({ type: 'fetchDataFromEasError', error })\n })\n})\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport { ItemMachineContext } from '@/types/item'\n\nexport const reload = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack, input: { context } }) => {\n const { propertyInstances } = context\n\n const _reload = async () => {\n if (!propertyInstances) {\n return\n }\n\n for (const propertyInstance of propertyInstances.values()) {\n if (propertyInstance) {\n const propertyRecordSchema = propertyInstance.propertyDef\n if (\n propertyRecordSchema &&\n propertyRecordSchema.storageType &&\n propertyRecordSchema.storageType === 'ItemStorage'\n ) {\n propertyInstance.getService().send({ type: 'reload' })\n }\n }\n }\n }\n\n _reload().then(() => {\n sendBack({ type: 'reloadSuccess' })\n })\n})\n","import { versions } from '@/seedSchema'\nimport { count, max } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nexport const getVersionData = () => {\n const appDb = BaseDb.getAppDb()\n\n return appDb.$with('versionData').as(\n appDb\n .select({\n seedLocalId: versions.seedLocalId,\n seedUid: versions.seedUid,\n latestVersionUid: versions.uid,\n latestVersionLocalId: versions.localId,\n versionsCount: count(versions.localId).as('versionsCount'),\n lastVersionPublishedAt: max(versions.attestationCreatedAt).as(\n 'lastVersionPublishedAt',\n ),\n lastLocalUpdateAt: max(versions.createdAt).as('lastLocalUpdateAt'),\n })\n .from(versions)\n .groupBy(versions.seedLocalId),\n )\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types'\nimport { ItemMachineContext } from '@/types/item'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { seeds, versions, metadata } from '@/seedSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { getVersionData } from '@/db/read/subqueries/versionData'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:item:actors:loadOrCreateItem')\n\n/**\n * Create ItemProperty instances for all metadata records to ensure they're cached.\n * Passes propertyRecordSchema from Model when available (Fix 3: enables value persistence for runtime-created models).\n * @param metadataRows - Array of metadata records to create ItemProperty instances for\n * @param seedLocalId - Seed local ID\n * @param seedUid - Seed UID\n * @param modelName - Model name for resolving propertyRecordSchema from Model\n * @returns Map of propertyName -> ItemProperty instance\n */\nconst createItemPropertyInstances = async (\n metadataRows: any[],\n seedLocalId: string,\n seedUid: string | undefined,\n modelName: string\n): Promise<Map<string, any>> => {\n const propertyInstances = new Map<string, any>()\n \n if (metadataRows.length === 0) {\n return propertyInstances\n }\n\n try {\n const itemPropertyMod = await import('../../../ItemProperty/ItemProperty')\n const { ItemProperty } = itemPropertyMod\n const { modelPropertiesToObject } = await import('../../../helpers/model')\n const { Model } = await import('../../../Model/Model')\n \n // Resolve Model and build property schemas for propertyRecordSchema (Fix 3)\n let propertySchemas: Record<string, any> = {}\n const model = Model.getByName(modelName)\n if (model?.properties?.length) {\n propertySchemas = modelPropertiesToObject(model.properties)\n }\n\n // Create instances for all metadata records in parallel with propertyRecordSchema\n const createPromises = metadataRows.map(async (metaRow) => {\n try {\n const propertyName = metaRow.propertyName\n if (!propertyName) {\n logger(`Metadata row missing propertyName, skipping`)\n return\n }\n \n const createProps = {\n propertyName,\n seedLocalId,\n seedUid,\n modelName,\n propertyValue: metaRow.propertyValue ?? undefined,\n versionLocalId: metaRow.versionLocalId ?? undefined,\n versionUid: metaRow.versionUid ?? undefined,\n schemaUid: metaRow.schemaUid ?? undefined,\n propertyRecordSchema: propertySchemas[propertyName] ?? undefined,\n }\n\n const property = ItemProperty.create(createProps, { waitForReady: false })\n if (property) {\n propertyInstances.set(propertyName, property)\n logger(`Created/cached ItemProperty instance for propertyName \"${propertyName}\" with propertyRecordSchema: ${!!createProps.propertyRecordSchema}`)\n } else {\n logger(`ItemProperty.create returned undefined for propertyName \"${propertyName}\"`)\n }\n } catch (error) {\n logger(`Error creating ItemProperty instance for propertyName \"${metaRow.propertyName}\": ${error}`)\n // Don't throw - continue with other properties\n }\n })\n \n await Promise.all(createPromises)\n logger(`Finished creating/caching ${propertyInstances.size} ItemProperty instances`)\n } catch (error) {\n logger(`Error in createItemPropertyInstances: ${error}`)\n // Don't throw - this is best-effort to pre-populate cache\n }\n \n return propertyInstances\n}\n\nexport const loadOrCreateItem = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack, input: { context } }) => {\n const _loadOrCreateItem = async (): Promise<void> => {\n const { seedLocalId, seedUid, modelName } = context\n\n logger(`loadOrCreateItem called for modelName: ${modelName}, seedLocalId: ${seedLocalId}, seedUid: ${seedUid}`)\n\n if (!seedLocalId && !seedUid) {\n throw new Error('seedLocalId or seedUid is required')\n }\n\n if (!modelName) {\n throw new Error('modelName is required')\n }\n\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n // Step 1: Query seeds table FIRST by seedLocalId or seedUid\n const whereClauses = []\n if (seedUid) {\n whereClauses.push(eq(seeds.uid, seedUid))\n }\n if (seedLocalId && !seedUid) {\n whereClauses.push(eq(seeds.localId, seedLocalId))\n }\n\n const seedRecords = await db\n .select()\n .from(seeds)\n .where(and(...whereClauses))\n .limit(1)\n\n if (seedRecords.length === 0) {\n // Seed not found - this is a new item, will be created elsewhere\n logger(`Seed not found in database for seedLocalId: ${seedLocalId}, seedUid: ${seedUid}`)\n sendBack({\n type: 'loadOrCreateItemSuccess',\n item: {\n seedLocalId,\n seedUid,\n modelName,\n schemaUid: context.schemaUid,\n latestVersionLocalId: undefined,\n latestVersionUid: undefined,\n versionsCount: 0,\n lastVersionPublishedAt: undefined,\n attestationCreatedAt: undefined,\n createdAt: Date.now(),\n },\n })\n return\n }\n\n const seedRecord = seedRecords[0]\n const resolvedSeedLocalId = seedRecord.localId\n const resolvedSeedUid = seedRecord.uid || undefined\n const schemaUid = seedRecord.schemaUid || undefined\n\n // Step 2: Query versions table to find all versions for that seed\n const versionData = getVersionData()\n const versionRecords = await db\n .with(versionData)\n .select({\n seedLocalId: seeds.localId,\n seedUid: seeds.uid,\n latestVersionUid: versionData.latestVersionUid,\n latestVersionLocalId: versionData.latestVersionLocalId,\n versionsCount: versionData.versionsCount,\n lastVersionPublishedAt: versionData.lastVersionPublishedAt,\n })\n .from(seeds)\n .leftJoin(versionData, eq(seeds.localId, versionData.seedLocalId))\n .where(eq(seeds.localId, resolvedSeedLocalId))\n .limit(1)\n\n if (versionRecords.length === 0) {\n logger(`No version data found for seedLocalId: ${resolvedSeedLocalId}`)\n sendBack({\n type: 'loadOrCreateItemSuccess',\n item: {\n seedLocalId: resolvedSeedLocalId,\n seedUid: resolvedSeedUid,\n modelName,\n schemaUid,\n latestVersionLocalId: undefined,\n latestVersionUid: undefined,\n versionsCount: 0,\n lastVersionPublishedAt: undefined,\n attestationCreatedAt: seedRecord.attestationCreatedAt || undefined,\n createdAt: seedRecord.createdAt || Date.now(),\n },\n })\n return\n }\n\n const versionRecord = versionRecords[0]\n const latestVersionLocalId = versionRecord.latestVersionLocalId\n const latestVersionUid = versionRecord.latestVersionUid || undefined\n\n if (!latestVersionLocalId) {\n logger(`No latest version found for seedLocalId: ${resolvedSeedLocalId}`)\n sendBack({\n type: 'loadOrCreateItemSuccess',\n item: {\n seedLocalId: resolvedSeedLocalId,\n seedUid: resolvedSeedUid,\n modelName,\n schemaUid,\n latestVersionLocalId: undefined,\n latestVersionUid: undefined,\n versionsCount: versionRecord.versionsCount || 0,\n lastVersionPublishedAt: versionRecord.lastVersionPublishedAt || undefined,\n attestationCreatedAt: seedRecord.attestationCreatedAt || undefined,\n createdAt: seedRecord.createdAt || Date.now(),\n },\n })\n return\n }\n\n // Step 3: Query metadata table to find all metadata records that reference that version\n const metadataRecords = await db\n .select()\n .from(metadata)\n .where(\n and(\n eq(metadata.seedLocalId, resolvedSeedLocalId),\n eq(metadata.versionLocalId, latestVersionLocalId)\n )\n )\n\n logger(`Found ${metadataRecords.length} metadata records for version ${latestVersionLocalId}`)\n\n // Step 4: Create ItemProperty instances from metadata records\n // This ensures they're in the cache when Item.properties getter is called\n const propertyInstances = metadataRecords.length > 0\n ? await createItemPropertyInstances(metadataRecords, resolvedSeedLocalId, resolvedSeedUid, modelName)\n : new Map<string, any>()\n\n // Step 5: Return loaded item data with property instances\n sendBack({\n type: 'loadOrCreateItemSuccess',\n item: {\n seedLocalId: resolvedSeedLocalId,\n seedUid: resolvedSeedUid,\n modelName,\n schemaUid,\n latestVersionLocalId,\n latestVersionUid,\n versionsCount: versionRecord.versionsCount || 0,\n lastVersionPublishedAt: versionRecord.lastVersionPublishedAt || undefined,\n attestationCreatedAt: seedRecord.attestationCreatedAt || undefined,\n createdAt: seedRecord.createdAt || Date.now(),\n _metadataIds: metadataRecords.map((r: any) => r.localId || r.uid).filter(Boolean),\n propertyInstances,\n },\n })\n }\n\n _loadOrCreateItem().catch((error) => {\n logger(`Error in loadOrCreateItem: ${error}`)\n sendBack({\n type: 'loadOrCreateItemError',\n error: error instanceof Error ? error.message : String(error),\n })\n })\n})\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport { ItemMachineContext } from '@/types/item'\nimport type { Item } from '@/Item/Item'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:Item:runPublish')\n\nexport const runPublish = fromCallback<\n EventObject,\n FromCallbackInput<ItemMachineContext<any>>\n>(({ sendBack, input: { context } }) => {\n const { seedLocalId } = context\n\n const _runPublish = async () => {\n if (!seedLocalId) {\n sendBack({ type: 'publishError', error: new Error('Item has no seedLocalId') })\n return\n }\n\n try {\n const itemMod = await import('../../../Item/Item')\n const { Item } = itemMod\n const item = await Item.find({ seedLocalId })\n\n if (!item) {\n sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) })\n return\n }\n\n const getPublishUploadsMod = await import('../../../db/read/getPublishUploads')\n const { getPublishUploads } = getPublishUploadsMod\n const getPublishPayloadMod = await import('../../../db/read/getPublishPayload')\n const { getPublishPayload } = getPublishPayloadMod\n\n await getPublishUploads(item)\n // For first iteration: no Arweave sign/upload - pass empty uploadedTransactions.\n // Real upload/submit can be wired in later.\n const uploadedTransactions: { txId: string; seedLocalId?: string }[] = []\n await getPublishPayload(item as Item<any>, uploadedTransactions)\n\n logger('runPublish: payload prepared (upload/EAS submit stubbed)')\n sendBack({ type: 'publishSuccess' })\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n logger('runPublish error:', error)\n sendBack({ type: 'publishError', error })\n }\n }\n\n _runPublish()\n})\n","import { assign, setup } from 'xstate'\nimport { MachineIds } from '@/client/constants'\nimport { ItemMachineContext, HydrateExistingItemEvent } from '@/types'\nimport { waitForDb } from './actors/waitForDb'\nimport { initialize } from './actors/initialize'\nimport { hydrateExistingItem } from './actors/hydrateExistingItem'\nimport { hydrateNewItem } from './actors/hydrateNewItem'\nimport { fetchDataFromEas } from './actors/fetchDataFromEas'\nimport { reload } from './actors/reload'\nimport { loadOrCreateItem } from './actors/loadOrCreateItem'\nimport { runPublish } from './actors/runPublish'\nimport { IItemProperty } from '@/interfaces'\n\n// @ts-ignore - Complex type inference from setup().createMachine()\nexport const itemMachineSingle = setup({\n types: {\n context: {} as ItemMachineContext<any>,\n input: {},\n },\n actors: {\n waitForDb,\n loadOrCreateItem,\n initialize,\n hydrateExistingItem,\n hydrateNewItem,\n fetchDataFromEas,\n reload,\n runPublish,\n },\n}).createMachine({\n id: MachineIds.ITEM,\n initial: 'waitingForDb',\n context: ({ input }) => input as ItemMachineContext<any>,\n on: {\n updatedPropertiesBySchemaUid: {\n actions: assign({\n propertiesBySchemaUid: ({ event }) => event.propertiesBySchemaUid,\n }),\n },\n updatePropertiesMetadata: {\n actions: assign({\n propertiesMetadata: ({ event }) => event.propertiesMetadata,\n }),\n },\n updateProperties: {\n actions: assign({\n propertiesUpdatedAt: Date.now(),\n }),\n },\n updateValue: {\n actions: assign(({ event, context }) => {\n let { propertyInstances } = context\n if (!propertyInstances) {\n propertyInstances = new Map<string, IItemProperty<any>>()\n }\n const { propertyName, propertyValue } = event\n\n if (!propertyInstances.has(propertyName)) {\n return {\n [propertyName]: propertyValue,\n }\n }\n const propertyInstance = propertyInstances.get(\n propertyName,\n ) as IItemProperty<any>\n\n propertyInstance.value = propertyValue\n propertyInstances.set(propertyName, propertyInstance)\n // TODO: use immer here\n return {\n propertyInstances,\n }\n }),\n },\n addPropertyInstance: {\n actions: assign(({ context, event }) => {\n const propertyInstances =\n context.propertyInstances || new Map<string, IItemProperty<any>>()\n propertyInstances.set(event.propertyName, event.propertyInstance)\n return {\n propertyInstances,\n }\n }),\n },\n removePropertyInstance: {\n actions: assign(({ context, event }) => {\n const propertyInstances =\n context.propertyInstances || new Map<string, IItemProperty<any>>()\n propertyInstances.delete((event as { type: 'removePropertyInstance'; propertyName: string }).propertyName)\n return {\n propertyInstances,\n }\n }),\n },\n updateContext: {\n actions: assign(({ context, event }) => {\n const updates: any = {}\n for (const key in event) {\n if (key !== 'type' && key in context) {\n updates[key] = (event as any)[key]\n }\n }\n return {\n ...context,\n ...updates,\n }\n }),\n },\n reload: '.reloading',\n destroyStarted: {\n actions: assign({ _destroyInProgress: true, _destroyError: null }),\n },\n destroyDone: {\n actions: assign({ _destroyInProgress: false }),\n },\n destroyError: {\n actions: assign(({ event }) => ({\n _destroyInProgress: false,\n _destroyError:\n (event as { type: 'destroyError'; error: unknown }).error instanceof Error\n ? {\n message: (event as { type: 'destroyError'; error: Error }).error.message,\n name: (event as { type: 'destroyError'; error: Error }).error.name,\n }\n : { message: String((event as { type: 'destroyError'; error: unknown }).error) },\n })),\n },\n clearDestroyError: {\n actions: assign({ _destroyError: null }),\n },\n },\n states: {\n idle: {\n on: {\n startPublish: 'publishing',\n },\n },\n publishing: {\n on: {\n publishSuccess: {\n target: 'idle',\n actions: assign({ _publishError: () => null }),\n },\n publishError: {\n target: 'idle',\n actions: assign({\n _publishError: ({ event }) => {\n const err = 'error' in event ? (event as unknown as { error: Error }).error : null\n return err ? { message: err.message } : null\n },\n }),\n },\n },\n invoke: {\n src: 'runPublish',\n input: ({ context }) => ({ context }),\n },\n },\n waitingForDb: {\n on: {\n waitForDbSuccess: 'loading',\n },\n invoke: {\n src: 'waitForDb',\n input: ({ context }) => ({ context }),\n },\n },\n loading: {\n on: {\n loadOrCreateItemSuccess: {\n target: 'idle',\n actions: assign(({ context, event }) => {\n const item = (event as any).item\n const existingPropertyInstances = context.propertyInstances || new Map<string, IItemProperty<any>>()\n \n \n // Merge property instances from loadOrCreateItem (Fix 2: preserve existing when it has propertyRecordSchema and incoming doesn't)\n if (item.propertyInstances) {\n for (const [propertyName, propertyInstance] of item.propertyInstances) {\n const existing = existingPropertyInstances.get(propertyName) as IItemProperty<any> | undefined\n const existingHasSchema = existing?.propertyDef\n const incomingHasSchema = (propertyInstance as IItemProperty<any>)?.propertyDef\n const action = existingHasSchema && !incomingHasSchema ? 'preserve' : 'overwrite'\n\n if (existingHasSchema && !incomingHasSchema) {\n continue // Preserve existing instance with schema\n }\n existingPropertyInstances.set(propertyName, propertyInstance)\n }\n }\n\n return {\n ...context,\n seedLocalId: item.seedLocalId || context.seedLocalId,\n seedUid: item.seedUid || context.seedUid,\n schemaUid: item.schemaUid || context.schemaUid,\n latestVersionLocalId: item.latestVersionLocalId || context.latestVersionLocalId,\n latestVersionUid: item.latestVersionUid || context.latestVersionUid,\n versionsCount: item.versionsCount || context.versionsCount,\n lastVersionPublishedAt: item.lastVersionPublishedAt || context.lastVersionPublishedAt,\n attestationCreatedAt: item.attestationCreatedAt || context.attestationCreatedAt,\n createdAt: item.createdAt || context.createdAt,\n propertyInstances: existingPropertyInstances,\n }\n }),\n },\n loadOrCreateItemError: {\n target: 'error',\n },\n },\n invoke: {\n src: 'loadOrCreateItem',\n input: ({ context }) => ({ context }),\n },\n },\n error: {},\n initializing: {\n on: {\n hasExistingItem: {\n target: 'idle',\n actions: assign({\n modelTableName: ({ event }) => event.modelTableName,\n modelNamePlural: ({ event }) => event.modelNamePlural,\n modelName: ({ event }) => event.modelName,\n existingItem: ({ event }) => event.existingItem,\n }),\n },\n isNewItem: {\n target: 'idle',\n actions: assign({\n modelTableName: ({ event }) => event.modelTableName,\n modelNamePlural: ({ event }) => event.modelNamePlural,\n modelName: ({ event }) => event.modelName,\n }),\n },\n },\n invoke: {\n src: 'initialize',\n input: ({ context }) => ({ context }),\n },\n },\n hydratingExistingItem: {\n on: {\n hydrateExistingItemSuccess: 'idle',\n hydrateExistingItemFailure: 'destroying',\n },\n invoke: {\n src: 'hydrateExistingItem',\n input: ({ event, context }) => ({ \n event: event as HydrateExistingItemEvent, \n context \n }),\n },\n },\n hydratingNewItem: {\n on: {\n hydrateNewItemSuccess: 'idle',\n },\n invoke: {\n src: 'hydrateNewItem',\n input: ({ context }) => ({ context }),\n },\n },\n fetchingRemoteData: {\n on: {\n fetchDataFromEasSuccess: 'idle',\n },\n invoke: {\n src: 'fetchDataFromEas',\n input: ({ context }: { context: ItemMachineContext<any> }) => ({ context }),\n },\n },\n reloading: {\n on: {\n reloadSuccess: 'idle',\n },\n invoke: {\n src: 'reload',\n input: ({ context }) => ({ context }),\n },\n },\n destroying: {\n type: 'final',\n },\n },\n})\n","import {\n AttestationRequestData,\n} from '@ethereum-attestation-service/eas-sdk'\nimport { ZeroAddress } from 'ethers'\n\n// Define zero constants ourselves since they're not exported from eas-sdk in newer versions\nexport const ZERO_ADDRESS = ZeroAddress\nexport const ZERO_BYTES = '0x'\nexport const ZERO_BYTES32 = '0x0000000000000000000000000000000000000000000000000000000000000000'\n\n\nexport const SCHEMA_NJK = 'schema.njk'\n// Primary config file name for Seed Protocol SDK\nexport const SEED_CONFIG_FILE = 'seed.config.ts'\n// Fallback config file names (in order of preference)\nexport const SEED_CONFIG_FALLBACKS = ['seed.schema.ts', 'schema.ts']\n// Legacy constant for backward compatibility\nexport const SCHEMA_TS = SEED_CONFIG_FILE\n\nexport const INTERNAL_DATA_TYPES = {\n Text: {\n eas: 'string',\n },\n Number: {\n eas: 'uint8',\n },\n Image: {\n eas: 'string',\n },\n Relation: {\n eas: 'bytes32',\n },\n List: {\n eas: 'bytes32[]',\n },\n File: {\n eas: 'string',\n },\n Json: {\n eas: 'string',\n },\n Blob: {\n eas: 'bytes32',\n },\n Boolean: {\n eas: 'bool',\n },\n Date: {\n eas: 'uint256',\n },\n Html: {\n eas: 'string',\n },\n}\n\nexport const INTERNAL_PROPERTY_NAMES = [\n 'localId',\n 'uid',\n 'seedLocalId',\n 'seedUid',\n 'schemaUid',\n 'attestationCreatedAt',\n 'attestationRaw',\n 'createdAt',\n 'updatedAt',\n 'lastVersionPublishedAt',\n 'latestVersionLocalId',\n 'latestVersionUid',\n 'lastLocalUpdateAt',\n 'modelName',\n 'storageTransactionId',\n 'refSeedType',\n 'refValueType',\n 'refResolvedValue',\n 'refResolvedDisplayValue',\n 'type',\n // Image\n 'src',\n 'alt',\n //\n 'versionLocalId',\n 'versionsCount',\n 'versionUid',\n '_markedForDeletion',\n]\n\nexport const VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA =\n '0x13c0fd59d69dbce40501a41f8b37768d26dd2e2bb0cad64615334d84f7b9bdf6'\n\nexport const defaultAttestationData: AttestationRequestData = {\n recipient: ZERO_ADDRESS,\n revocable: true,\n value: BigInt(0),\n refUID: ZERO_BYTES32,\n expirationTime: BigInt(0),\n data: ZERO_BYTES,\n}\n\nexport enum ImageSize {\n EXTRA_SMALL = 480,\n SMALL = 760,\n MEDIUM = 1024,\n LARGE = 1440,\n EXTRA_LARGE = 1920,\n}\n\nexport const CLIENT_NOT_INITIALIZED = 'ClientManager is not initialized. Please call init() first.'\n\nexport const INIT_SCRIPT_SUCCESS_MESSAGE = '[Seed Protocol] Finished running init script'\n\nexport enum SeedModels {\n Seed = 'Seed',\n Metadata = 'Metadata',\n Version = 'Version',\n}\n\n// Internal SDK schema that should not be created in app's files directory\nexport const SEED_PROTOCOL_SCHEMA_NAME = 'Seed Protocol'\nexport const INTERNAL_SCHEMA_IDS = ['SEEDPROTOCOL'] as const\n\n/**\n * Check if a schema is an internal SDK schema that should not be created in app files\n */\nexport function isInternalSchema(schemaName: string, schemaId?: string): boolean {\n return schemaName === SEED_PROTOCOL_SCHEMA_NAME || \n (schemaId !== undefined && INTERNAL_SCHEMA_IDS.includes(schemaId as any))\n}\n","import { and, eq, getTableColumns, or, SQL, sql } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { metadata } from '@/seedSchema'\n\nexport const getMetadataLatest = ({seedLocalId, seedUid}: {seedLocalId?: string, seedUid?: string}) => {\n const appDb = BaseDb.getAppDb()\n\n const whereClauses: SQL[] = []\n\n if (seedLocalId) {\n whereClauses.push(eq(metadata.seedLocalId, seedLocalId))\n }\n\n if (seedUid) {\n whereClauses.push(eq(metadata.seedUid, seedUid))\n }\n\n const metadataColumns = getTableColumns(metadata)\n\n return appDb.$with('metadataLatest').as(\n appDb\n .select({\n ...metadataColumns,\n rowNum: sql.raw(`\n ROW_NUMBER() OVER (\n PARTITION BY property_name \n ORDER BY COALESCE(created_at, attestation_created_at) DESC\n )\n `).as('rowNum')\n })\n .from(metadata)\n .where(and(...whereClauses))\n )\n}\n","import { GetItemProperties, PropertyData } from '@/types'\nimport { metadata, seeds, versions } from '@/seedSchema'\nimport { and, eq, getTableColumns, isNotNull, isNull, sql, SQL } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { getMetadataLatest } from './subqueries/metadataLatest'\n\n\nexport const getItemProperties: GetItemProperties = async ({\n seedLocalId,\n seedUid,\n edited,\n}) => {\n const appDb = BaseDb.getAppDb()\n\n const whereClauses: SQL[] = [isNotNull(metadata.propertyName)]\n\n if (seedUid) {\n whereClauses.push(eq(seeds.uid, seedUid))\n }\n\n if (seedLocalId) {\n whereClauses.push(eq(seeds.localId, seedLocalId))\n }\n\n whereClauses.push(isNotNull(metadata.propertyName))\n\n if (typeof edited !== 'undefined') {\n if (edited) {\n whereClauses.push(isNull(metadata.uid))\n }\n if (!edited) {\n whereClauses.push(isNotNull(metadata.uid))\n }\n }\n\n // const metadataColumns = getTableColumns(metadata)\n\n const metadataLatest = getMetadataLatest({seedLocalId, seedUid})\n\n const propertiesData = await appDb\n .with(metadataLatest)\n .select()\n .from(metadataLatest)\n .where(eq(metadataLatest.rowNum, 1))\n\n return propertiesData.map((data: any) => ({\n ...data,\n localId: data.localId || '',\n uid: data.uid || '',\n propertyName: data.propertyName || '',\n propertyValue: data.propertyValue || '',\n schemaUid: data.schemaUid || '',\n modelType: data.modelType || '',\n seedLocalId: data.seedLocalId || '',\n })) as PropertyData[]\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { seeds, SeedType } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\n\ntype GetSeedDataProps = {\n seedLocalId?: string\n seedUid?: string\n}\n\ntype GetSeedData = (props: GetSeedDataProps) => Promise<SeedType | undefined>\n\nexport const getSeedData: GetSeedData = async ({ seedLocalId, seedUid }) => {\n const appDb = BaseDb.getAppDb()\n\n let query\n\n const queryBase = appDb.select().from(seeds)\n\n if (seedLocalId) {\n query = queryBase.where(eq(seeds.localId, seedLocalId))\n }\n\n if (seedUid) {\n query = queryBase.where(eq(seeds.uid, seedUid))\n }\n\n const rows = await query\n\n if (!rows || !rows.length) {\n return\n }\n\n return rows[0]\n}\n","import { GetItemData, ItemData } from \"@/types\"\nimport debug from \"debug\"\nimport { BaseDb } from \"../Db/BaseDb\"\nimport { and, eq, getTableColumns, SQL, sql, count, max } from \"drizzle-orm\"\nimport { toSnakeCase } from \"drizzle-orm/casing\"\nimport { startCase } from \"lodash-es\"\nimport { getItemProperties } from \"./getItemProperties\"\nimport { getVersionData } from \"./subqueries/versionData\"\nimport { seeds, versions } from \"@/seedSchema\"\nimport { models } from \"@/seedSchema/ModelSchema\"\nimport { modelSchemas } from \"@/seedSchema/ModelSchemaSchema\"\nimport { schemas as schemasTable } from \"@/seedSchema/SchemaSchema\"\nimport { getSeedData } from \"./getSeedData\"\n\nconst logger = debug('seedSdk:db:read:getItemData')\n\nexport const getItemData: GetItemData = async ({\n modelName,\n seedLocalId,\n seedUid,\n}) => {\n if (!seedLocalId && !seedUid) {\n throw new Error('[db/queries] [getItem] no seedLocalId or seedUid')\n }\n\n if (seedUid && !seedLocalId) {\n const seedData = await getSeedData({ seedUid })\n if (!seedData) {\n logger('[db/queries] [getItem] no seedData seedUid', seedUid)\n return\n }\n seedLocalId = seedData.localId || undefined\n }\n\n const appDb = BaseDb.getAppDb()\n\n const { localId, uid, ...rest } = getTableColumns(seeds)\n\n const whereClauses: SQL[] = []\n\n if (modelName) {\n whereClauses.push(eq(seeds.type, toSnakeCase(modelName)))\n }\n\n if (seedUid) {\n whereClauses.push(eq(seeds.uid, seedUid))\n }\n\n if (seedLocalId && !seedUid) {\n whereClauses.push(eq(seeds.localId, seedLocalId))\n }\n\n // First, query the seeds table directly to find the item\n const seedRows = await appDb\n .select({\n ...rest,\n seedLocalId: seeds.localId,\n seedUid: seeds.uid,\n })\n .from(seeds)\n .where(and(...whereClauses))\n .limit(1)\n\n logger('[getItemData] Seed query result', { rowsCount: seedRows?.length || 0, firstRow: seedRows?.[0] })\n\n if (!seedRows || seedRows.length === 0) {\n logger('[db/queries] [getItemDataFromDb] no seedRows found', { modelName, seedLocalId, seedUid })\n return\n }\n\n const seedRow = seedRows[0]\n const resolvedSeedLocalId = seedRow.seedLocalId\n\n // Fix 5: Derive schemaName for multi-schema Model resolution (models -> model_schemas -> schemas)\n let schemaName: string | undefined\n const normalizedModelName = modelName ? startCase(modelName) : (seedRow.type ? startCase(seedRow.type) : undefined)\n if (appDb && normalizedModelName) {\n try {\n const schemaRows = await appDb\n .select({ schemaName: schemasTable.name })\n .from(models)\n .innerJoin(modelSchemas, eq(models.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(eq(models.name, normalizedModelName))\n .limit(1)\n if (schemaRows.length > 0 && schemaRows[0].schemaName) {\n schemaName = schemaRows[0].schemaName\n }\n } catch (error) {\n logger('[getItemData] Error deriving schemaName:', error)\n }\n }\n\n // Now get version data if it exists - query versions table directly\n let versionRow = {\n versionsCount: 0,\n lastVersionPublishedAt: null,\n latestVersionUid: null,\n latestVersionLocalId: null,\n }\n \n try {\n const versionRows = await appDb\n .select({\n versionsCount: count(versions.localId).as('versionsCount'),\n lastVersionPublishedAt: max(versions.attestationCreatedAt).as('lastVersionPublishedAt'),\n latestVersionUid: max(versions.uid).as('latestVersionUid'),\n latestVersionLocalId: max(versions.localId).as('latestVersionLocalId'),\n })\n .from(versions)\n .where(eq(versions.seedLocalId, resolvedSeedLocalId))\n .groupBy(versions.seedLocalId)\n .limit(1)\n\n if (versionRows && versionRows.length > 0) {\n versionRow = versionRows[0]\n }\n } catch (error) {\n console.error('[getItemData] Error querying versions', error)\n // Continue with default versionRow values\n }\n\n let itemData = {\n ...seedRow,\n ...versionRow,\n schemaName,\n } as ItemData & { [key: string]: any }\n\n const propertiesData = await getItemProperties({\n seedLocalId,\n seedUid: itemData.seedUid || undefined,\n })\n\n if (!propertiesData || propertiesData.length === 0) {\n return itemData\n }\n\n for (const propertyData of propertiesData) {\n const propertyName = propertyData.propertyName\n\n let propertyValue = propertyData.propertyValue\n\n if (propertyName.endsWith('Id') || propertyName.endsWith('Ids')) {\n if (propertyData.refSeedType) {\n const propertyNameVariant = propertyName.replace(/Ids?$/, '')\n itemData[propertyNameVariant] = propertyValue\n }\n }\n\n itemData[propertyName] = propertyValue\n }\n\n if (itemData) return itemData\n}","import { ItemData } from '@/types'\nimport { and, eq, gt, inArray, isNotNull, isNull, or, SQL, sql } from 'drizzle-orm'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { seeds } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { getVersionData } from './subqueries/versionData'\nimport { getOwnedAddressesFromDb, getWatchedAddressesFromDb } from '@/helpers/db'\n\ntype GetItemsDataProps = {\n modelName?: string\n deleted?: boolean\n includeEas?: boolean\n addressFilter?: 'owned' | 'watched' | 'all'\n}\n\ntype GetItemsData = (props: GetItemsDataProps) => Promise<ItemData[]>\n\nexport const getItemsData: GetItemsData = async ({\n modelName,\n deleted,\n includeEas = false,\n addressFilter,\n}): Promise<ItemData[]> => {\n const appDb = BaseDb.getAppDb()\n\n const conditions: SQL[] = []\n\n if (!includeEas) {\n conditions.push(or(isNull(seeds.uid), eq(seeds.uid, '')) as SQL)\n }\n\n if (modelName) {\n conditions.push(eq(seeds.type, toSnakeCase(modelName)))\n }\n\n if (addressFilter === 'owned') {\n const ownedAddresses = await getOwnedAddressesFromDb()\n if (ownedAddresses.length > 0) {\n conditions.push(\n or(\n inArray(seeds.publisher, ownedAddresses),\n isNull(seeds.publisher)\n ) as SQL\n )\n }\n } else if (addressFilter === 'watched') {\n const watchedAddresses = await getWatchedAddressesFromDb()\n if (watchedAddresses.length === 0) {\n return []\n }\n conditions.push(inArray(seeds.publisher, watchedAddresses) as SQL)\n }\n\n if (deleted) {\n conditions.push(\n or(\n isNotNull(seeds._markedForDeletion),\n eq(seeds._markedForDeletion, 1),\n ) as SQL,\n )\n }\n\n if (!deleted) {\n conditions.push(\n or(\n isNull(seeds._markedForDeletion),\n eq(seeds._markedForDeletion, 0),\n ) as SQL,\n )\n }\n\n const versionData = getVersionData()\n\n // When modelName is not provided (e.g. useItems({})), select each seed's type so Item.create\n // can derive modelName via startCase(props.type). Otherwise loadOrCreateItem throws \"modelName is required\".\n const selectModelNameOrType = modelName\n ? { modelName: sql<string>`${modelName}` as any }\n : { type: seeds.type }\n\n let query = appDb\n .with(versionData)\n .select({\n seedLocalId: seeds.localId,\n seedUid: seeds.uid,\n schemaUid: seeds.schemaUid,\n ...selectModelNameOrType,\n attestationCreatedAt: seeds.attestationCreatedAt,\n versionsCount: versionData.versionsCount,\n lastVersionPublishedAt: versionData.lastVersionPublishedAt,\n lastLocalUpdateAt: versionData.lastLocalUpdateAt,\n latestVersionUid: versionData.latestVersionUid,\n latestVersionLocalId: versionData.latestVersionLocalId,\n createdAt: seeds.createdAt,\n })\n .from(seeds)\n .leftJoin(versionData, eq(seeds.localId, versionData.seedLocalId))\n .where(and(gt(versionData.versionsCount, 0), ...conditions))\n .orderBy(sql.raw('COALESCE(attestation_created_at, created_at) DESC'))\n .groupBy(seeds.localId)\n\n const itemsData = (await query) as ItemData[]\n\n return itemsData\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport { PropertyMachineContext } from '@/types/property'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\n\n\nexport const resolveRemoteStorage = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, EventObject>\n>(({ sendBack, input: { context } }) => {\n // Note: propertyInstances is not part of PropertyMachineContext\n // This actor may need to be refactored or removed if propertyInstances is no longer available\n // For now, we'll skip this functionality\n const storageTransactionId = context.storageTransactionId\n\n if (!storageTransactionId) {\n return\n }\n\n const _resolveRemoteStorage = async (): Promise<void> => {\n\n const filesDirExists = await BaseFileManager.pathExists('/files')\n\n if (!filesDirExists) {\n await BaseFileManager.createDirIfNotExists('/files')\n }\n\n const path = BaseFileManager.getPathModule()\n\n const htmlDir = path.join('/files', 'html')\n\n const htmlExists = await BaseFileManager.pathExists(htmlDir)\n\n const fs = await BaseFileManager.getFs()\n\n if (htmlExists) {\n const htmlFiles = await fs.promises.readdir(htmlDir)\n const matchingHtmlFile = htmlFiles.find(\n (file: string) => file === `${storageTransactionId}.html`,\n )\n if (matchingHtmlFile) {\n const htmlString = await fs.promises.readFile(\n path.join(htmlDir, matchingHtmlFile),\n 'utf8',\n )\n sendBack({\n type: 'updateValue',\n propertyName: 'html',\n propertyValue: htmlString,\n })\n }\n }\n\n if (!htmlExists) {\n await fs.promises.mkdir(htmlDir)\n }\n\n const jsonDir = path.join('/files', 'json')\n\n const jsonExists = await fs.promises.exists(jsonDir)\n\n if (jsonExists) {\n const jsonFiles = await fs.promises.readdir(jsonDir)\n const matchingJsonFile = jsonFiles.find(\n (file: string) => file === `${storageTransactionId}.json`,\n )\n if (matchingJsonFile) {\n const jsonString = await fs.promises.readFile(\n path.join(jsonDir, matchingJsonFile),\n 'utf8',\n )\n sendBack({\n type: 'updateValue',\n propertyName: 'json',\n propertyValue: jsonString,\n })\n }\n }\n\n if (!jsonExists) {\n await fs.promises.mkdir(jsonDir)\n }\n }\n\n _resolveRemoteStorage().then(() => {\n sendBack({ type: 'resolveRemoteStorageSuccess' })\n return\n })\n})\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput, PropertyMachineContext } from '@/types'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:ItemProperty:service:actors:waitForDb')\n\nexport const waitForDb = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext>\n>(({ sendBack }) => {\n // Check immediately first\n const appDb = BaseDb.getAppDb()\n if (appDb) {\n logger('Database is ready (immediate check)')\n sendBack({ type: 'waitForDbSuccess' })\n return\n }\n\n // If not ready, poll with timeout\n const _waitForDb = new Promise<void>((resolve, reject) => {\n const startTime = Date.now()\n const timeout = 10000 // 10 second timeout\n const interval = setInterval(() => {\n const appDb = BaseDb.getAppDb()\n if (appDb) {\n clearInterval(interval)\n logger('Database is ready (after polling)')\n resolve()\n } else if (Date.now() - startTime > timeout) {\n clearInterval(interval)\n const error = new Error('Database not available after timeout')\n logger(`Database wait timeout: ${error.message}`)\n reject(error)\n }\n }, 100)\n })\n\n _waitForDb\n .then(() => {\n logger('Sending waitForDbSuccess event')\n sendBack({ type: 'waitForDbSuccess' })\n })\n .catch((error) => {\n logger(`Error waiting for database: ${error}`)\n sendBack({ type: 'waitForDbError', error: error.message })\n })\n})\n","// Dynamic import to break circular dependency: syncDbWithEas -> stores/eas -> eas -> Model\nimport { toSnakeCase } from \"@/helpers\"\nimport { BaseEasClient } from \"@/helpers/EasClient/BaseEasClient\"\nimport { BaseQueryClient } from \"@/helpers/QueryClient/BaseQueryClient\"\nimport { GET_PROPERTIES, GET_SCHEMAS, GET_SEEDS, GET_VERSIONS } from \"@/Item/queries\"\nimport { Attestation, Schema as EASSchema } from \"@/graphql/gql/graphql\"\n\ntype GetModelSchemasFromEas = () => Promise<EASSchema[]>\n\n\nexport const getModelSchemasFromEas: GetModelSchemasFromEas = async () => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n // Dynamic import to break circular dependency\n const modelMod = await import('./Model/Model')\n const { Model } = modelMod\n const allModels = await Model.all()\n const modelNames = allModels.map(m => m.modelName).filter((name): name is string => !!name)\n\n // If there are no models, return empty array instead of querying\n if (modelNames.length === 0) {\n return []\n }\n\n const OR: Record<string, unknown>[] = []\n const hasImageModel = modelNames.includes('Image')\n\n // Add schema queries for each model\n for (const modelName of modelNames) {\n OR.push({\n schema: {\n equals: `bytes32 ${toSnakeCase(modelName)}`,\n },\n })\n }\n\n // Add bytes32 image schema query only once, and only if Image model exists\n // Image model should now be loaded from SEEDPROTOCOL_Seed_Protocol_v1.json schema\n if (hasImageModel) {\n OR.push({\n schema: {\n equals: `bytes32 image`,\n },\n })\n }\n\n const modelSchemas = await queryClient.fetchQuery({\n queryKey: [`getSchemasAllModels`],\n queryFn: async () =>\n easClient.request(GET_SCHEMAS, {\n where: {\n OR,\n },\n }),\n })\n\n // Return empty array if no schemas found instead of throwing\n // This can happen legitimately when:\n // - Models exist but don't have schemas registered in EAS yet (first-time setup)\n // - Models are loaded but schemas haven't been created/registered yet\n if (\n !modelSchemas ||\n !modelSchemas.schemas ||\n modelSchemas.schemas.length === 0\n ) {\n return []\n }\n\n return modelSchemas.schemas\n}\n\ntype GetItemVersionsFromEasProps = {\n seedUids: string[]\n}\n\ntype GetItemVersionsFromEas = (\n props: GetItemVersionsFromEasProps,\n) => Promise<Attestation[]>\n\n\nexport const getItemVersionsFromEas: GetItemVersionsFromEas = async ({ seedUids }) => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const { itemVersions } = await queryClient.fetchQuery({\n queryKey: [`getVersionsForAllModels`],\n queryFn: async () =>\n easClient.request(GET_VERSIONS, {\n where: {\n refUID: {\n in: seedUids,\n },\n },\n }),\n })\n\n return itemVersions\n}\n\ntype GetItemPropertiesFromEasProps = {\n versionUids: string[]\n}\n\ntype GetItemPropertiesFromEas = (\n props: GetItemPropertiesFromEasProps,\n) => Promise<Attestation[]>\n\nexport const getItemPropertiesFromEas: GetItemPropertiesFromEas = async ({ versionUids }) => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n \n const { itemProperties } = await queryClient.fetchQuery({\n queryKey: [`getPropertiesForAllModels`],\n queryFn: async () =>\n easClient.request(GET_PROPERTIES, {\n where: {\n refUID: {\n in: versionUids,\n },\n },\n }),\n })\n\n return itemProperties\n}\n\ntype GetSchemaUidBySchemaNameProps = {\n schemaName: string\n}\n\ntype GetSchemaUidBySchemaName = (\n props: GetSchemaUidBySchemaNameProps,\n) => Promise<string | undefined>\n\nexport const getSchemaUidBySchemaName: GetSchemaUidBySchemaName = async ({ schemaName }) => {\n try {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n \n if (!queryClient || !easClient) {\n return undefined\n }\n \n const { schemas } = await queryClient.fetchQuery({\n queryKey: [`getSchemaUidBySchemaName`],\n queryFn: async () =>\n easClient.request(GET_SCHEMAS, {\n where: {\n schema: {\n endsWith: schemaName,\n },\n },\n }),\n })\n\n if (!schemas || schemas.length === 0) {\n // Return undefined instead of throwing - schema may not be published yet\n return undefined\n }\n\n return schemas[0].id\n } catch (error) {\n // If query fails, return undefined - schema may not exist or be accessible\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schema for schema name ${schemaName}:`, error)\n }\n return undefined\n }\n}\n\n\nexport const getSeedsFromSchemaUids = async ({ schemaUids, addresses }: { schemaUids: string[], addresses: string[] }) => {\n const AND = [\n {\n OR: [] as Record<string, unknown>[],\n },\n ]\n\n for (const schemaUid of schemaUids) {\n AND[0].OR.push({\n decodedDataJson: {\n contains: schemaUid,\n },\n })\n }\n\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const { itemSeeds } = await queryClient.fetchQuery({\n queryKey: [`getSeedsForAllModels`],\n queryFn: async () =>\n easClient.request(GET_SEEDS, {\n where: {\n attester: {\n in: addresses,\n },\n schemaId: {\n in: schemaUids,\n },\n AND,\n },\n }),\n })\n\n return itemSeeds\n}\n\nexport const getSeedsBySchemaName = async (schemaName: string, limit: number = 10) => {\n\n const variables = {\n where: {\n schema: {\n is: {\n schemaNames: {\n some: {\n name: {\n equals: schemaName,\n }\n }\n }\n }\n }\n },\n take: limit\n }\n\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const { itemSeeds } = await queryClient.fetchQuery({\n queryKey: [`getSeedsBySchemaName`, schemaName, limit],\n queryFn: async () =>\n easClient.request(GET_SEEDS, variables),\n })\n\n return itemSeeds\n\n}\n\nexport const getSeedUidsBySchemaName = async (schemaName: string, limit: number = 10) => {\n const { itemSeeds } = await getSeedsBySchemaName(schemaName, limit)\n return itemSeeds.map((seed: Attestation) => seed.id)\n}","import { Schema as EASSchema, SchemaWhereInput } from '@/graphql/gql/graphql'\nimport { toSnakeCase, BaseEasClient, BaseQueryClient } from '@/helpers'\nimport { GET_SCHEMAS } from '@/Item/queries'\nimport type { EIP712MessageTypes } from '@ethereum-attestation-service/eas-sdk'\n\n// Extract TypedData type from EIP712MessageTypes\n// EIP712MessageTypes is defined as { [key: string]: TypedData[] }\ntype ExtractTypedData<T> = T extends { [key: string]: infer U }\n ? U extends Array<infer V>\n ? V\n : never\n : never\ntype TypedData = ExtractTypedData<EIP712MessageTypes>\n\ntype GetSchemaForPropertyProps = {\n schemaUid?: string\n propertyName: string\n easDataType?: TypedData['type']\n}\ntype GetSchemaForProperty = (\n props: GetSchemaForPropertyProps,\n) => Promise<EASSchema | void>\nexport const getSchemaForItemProperty: GetSchemaForProperty = async ({\n schemaUid,\n propertyName,\n easDataType,\n}): Promise<EASSchema | void> => {\n try {\n const propertyNameSnakeCase = toSnakeCase(propertyName)\n const isMissingSchemaUid =\n !schemaUid || schemaUid === 'null' || schemaUid === 'undefined'\n\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n // If clients are not available, return undefined (schema not found)\n if (!queryClient || !easClient) {\n return\n }\n\n let queryParams: { where: SchemaWhereInput } = {\n where: {\n id: {\n equals: schemaUid,\n },\n },\n }\n\n if (easDataType) {\n queryParams = {\n where: {\n schema: {\n equals: `${easDataType} ${propertyNameSnakeCase}`,\n },\n },\n }\n }\n\n if (!easDataType && isMissingSchemaUid) {\n queryParams = {\n where: {\n schemaNames: {\n some: {\n name: {\n equals: propertyNameSnakeCase,\n },\n },\n },\n },\n }\n }\n\n const foundPropertySchema = await queryClient.fetchQuery({\n queryKey: [`getPropertySchema${propertyName}`],\n queryFn: async () => easClient.request(GET_SCHEMAS, queryParams),\n networkMode: 'offlineFirst',\n })\n\n if (foundPropertySchema && foundPropertySchema.schemas.length > 0) {\n return foundPropertySchema.schemas[0] as EASSchema\n }\n } catch (error) {\n // If schema fetch fails, return undefined (schema not found)\n // This is expected when metadata exists without a published EASSchema\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schema for property ${propertyName}:`, error)\n }\n return\n }\n}\n","import { getSchemaUidBySchemaName } from '@/eas'\nimport { toSnakeCase } from '@/helpers'\nimport { getSchemaForItemProperty } from '@/helpers/getSchemaForItemProperty'\n\nconst schemaUidForSchemaDefinition = new Map<string, string>()\n\ntype SetSchemaUidForSchemaDefinitionProps = {\n text: string\n schemaUid: string\n}\n\ntype SetSchemaUidForSchemaDefinition = (\n props: SetSchemaUidForSchemaDefinitionProps,\n) => void\n\nexport const setSchemaUidForSchemaDefinition: SetSchemaUidForSchemaDefinition = ({ text, schemaUid }) => {\n const propertySnakeCase = toSnakeCase(text)\n schemaUidForSchemaDefinition.set(propertySnakeCase, schemaUid)\n}\n\ntype GetSchemaUidForSchemaDefinitionProps = {\n schemaText: string\n}\n\ntype GetSchemaUidForSchemaDefinition = (\n props: GetSchemaUidForSchemaDefinitionProps,\n) => Promise<string | undefined>\n\nexport const getSchemaUidForSchemaDefinition: GetSchemaUidForSchemaDefinition = async ({ schemaText }) => {\n const textSnakeCase = toSnakeCase(schemaText)\n if (!schemaUidForSchemaDefinition.has(textSnakeCase)) {\n const schemaUid = await getSchemaUidBySchemaName({ schemaName: textSnakeCase })\n if (schemaUid) {\n setSchemaUidForSchemaDefinition({ text: textSnakeCase, schemaUid })\n }\n return schemaUid\n }\n return schemaUidForSchemaDefinition.get(textSnakeCase)\n}\n\nexport const fetchSchemaUids = async () => {\n const versionSchema = await getSchemaForItemProperty({\n propertyName: 'version',\n easDataType: 'bytes32',\n })\n if (versionSchema) {\n setSchemaUidForSchemaDefinition({\n text: 'version',\n schemaUid: versionSchema.id,\n })\n }\n const imageSchema = await getSchemaForItemProperty({\n propertyName: 'image',\n easDataType: 'bytes32',\n })\n if (imageSchema) {\n setSchemaUidForSchemaDefinition({\n text: 'image',\n schemaUid: imageSchema.id,\n })\n }\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport { PropertyMachineContext } from '@/types/property'\nimport { getSchemaUidForSchemaDefinition } from '@/stores/eas'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport { INTERNAL_PROPERTY_NAMES } from '@/helpers/constants'\n\n\nexport const initialize = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, EventObject>\n>(({ sendBack, input: { context } }) => {\n const { \n isRelation, \n propertyName, \n storageTransactionId,\n propertyRecordSchema, \n } = context\n let { schemaUid } = context\n\n const _initialize = async () => {\n if (\n !schemaUid && \n propertyName &&\n !INTERNAL_PROPERTY_NAMES.includes(propertyName) &&\n (\n !propertyRecordSchema ||\n !propertyRecordSchema.storageType ||\n propertyRecordSchema.storageType !== 'ItemStorage'\n )\n ) {\n try {\n schemaUid = await getSchemaUidForSchemaDefinition({ schemaText: propertyName })\n if (schemaUid) {\n sendBack({ type: 'updateContext', schemaUid })\n }\n } catch (error) {\n // If schema fetch fails, continue without schemaUid - it's not required for local metadata\n // Log error in development but don't throw\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schemaUid for property ${propertyName}:`, error)\n }\n }\n }\n \n if (isRelation) {\n sendBack({ type: 'isRelatedProperty' })\n sendBack({ type: 'initializeSuccess' })\n return\n }\n \n if (!isRelation) {\n if (\n (propertyName !== 'html' && propertyName !== 'json') ||\n !storageTransactionId\n ) {\n sendBack({ type: 'initializeSuccess' })\n return\n }\n \n if (propertyName === 'html') {\n const htmlFilePath = `/files/html/${storageTransactionId}.html`\n const exists = await BaseFileManager.pathExists(htmlFilePath)\n if (!exists) {\n return\n }\n const renderValue = await BaseFileManager.readFileAsString(htmlFilePath)\n .catch((error) => {\n console.warn('Error reading html file', error)\n })\n sendBack({ type: 'updateContext', renderValue })\n return\n }\n if (propertyName === 'json') {\n const jsonFilePath = `/files/json/${storageTransactionId}.json`\n const exists = await BaseFileManager.pathExists(jsonFilePath)\n if (!exists) {\n return\n }\n const renderValue = await BaseFileManager.readFileAsString(jsonFilePath)\n .catch((error) => {\n console.warn('Error reading json file', error)\n })\n sendBack({ type: 'updateContext', renderValue })\n return\n }\n \n }\n }\n\n _initialize().then(() => {\n sendBack({ type: 'initializeSuccess' })\n })\n})\n","import { metadata } from '@/seedSchema'\nimport { and, eq } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nconst seedUidToStorageTransactionId = new Map<string, string>()\n\ntype GetStorageTransactionIdResults = {\n storageTransactionId: string\n}[]\n\nexport const getStorageTransactionIdForSeedUid = async (\n seedUid: string,\n): Promise<string | undefined> => {\n if (seedUidToStorageTransactionId.has(seedUid)) {\n return seedUidToStorageTransactionId.get(seedUid)\n }\n\n const appDb = BaseDb.getAppDb()\n\n const results = (await appDb\n .select({\n storageTransactionId: metadata.propertyValue,\n })\n .from(metadata)\n .where(\n and(\n eq(metadata.seedUid, seedUid),\n eq(metadata.propertyName, 'storageTransactionId'),\n ),\n )) as GetStorageTransactionIdResults\n\n if (!results || results.length === 0) {\n return\n }\n\n seedUidToStorageTransactionId.set(seedUid, results[0].storageTransactionId)\n return results[0].storageTransactionId\n} ","import { metadata, MetadataType } from '@/seedSchema'\nimport { eq, max } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nexport const getRelationValueData = async (\n propertyValue: any,\n): Promise<MetadataType | undefined> => {\n const appDb = BaseDb.getAppDb()\n\n const rows = (await appDb\n .select({\n propertyValue: metadata.propertyValue,\n attestationCreatedAt: max(metadata.attestationCreatedAt),\n refResolvedDisplayValue: metadata.refResolvedDisplayValue,\n refResolvedValue: metadata.refResolvedValue,\n refSeedType: metadata.refSeedType,\n easDataType: metadata.easDataType,\n })\n .from(metadata)\n .where(eq(metadata.propertyValue, propertyValue))) as MetadataType[]\n\n if (!rows || rows.length === 0) {\n return\n }\n\n return rows[0]\n} ","import { EventObject, fromCallback } from 'xstate'\nimport { BaseFileManager, convertTxIdToImage } from '@/helpers'\nimport debug from 'debug'\nimport { FromCallbackInput } from '@/types/machines'\nimport { PropertyMachineContext } from '@/types/property'\nimport { getStorageTransactionIdForSeedUid } from '@/db/read/getStorageTransactionIdForSeedUid'\nimport { getRelationValueData } from '@/db/read/getRelationValueData'\n// Dynamic import to break circular dependency: schema/index -> ... -> resolveRelatedValue -> schema/index\n// import { ModelPropertyDataTypes } from '@/schema'\n\nconst logger = debug('seedSdk:property:actors:resolveRelatedValue')\n\nconst storageTransactionIdToContentUrl = new Map<string, string>()\nconst refResolvedValueToContentUrl = new Map<string, string>()\nconst seedUidToContentUrl = new Map<string, string>()\n\nexport const resolveRelatedValue = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, EventObject>\n>(({ sendBack, input: { context } }) => {\n const {\n isRelation,\n propertyValue,\n propertyName,\n seedUid,\n propertyRecordSchema,\n populatedFromDb,\n schemaUid,\n } = context\n\n const _resolveRelatedValue = async () => {\n // Use dynamic import to break circular dependency\n const schemaMod = await import('../../../Schema')\n const { ModelPropertyDataTypes } = schemaMod\n \n if (!propertyValue || !isRelation || populatedFromDb) {\n return\n }\n\n let parsedValue\n\n try {\n parsedValue = JSON.parse(propertyValue)\n } catch (error) {\n logger(`${propertyName} value is not a JSON string.`)\n }\n\n if (!parsedValue && seedUidToContentUrl.has(propertyValue)) {\n const contentUrl = seedUidToContentUrl.get(propertyValue)\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n })\n return true\n }\n\n if (Array.isArray(propertyValue)) {\n // TODO: Handle array of seedUids\n logger(`${propertyName} value is an array of seedUids`)\n return\n }\n\n if (Array.isArray(parsedValue)) {\n logger(`${propertyName} value is a stringified array of seedUids`)\n return\n }\n\n const storageTransactionId =\n await getStorageTransactionIdForSeedUid(propertyValue)\n\n if (storageTransactionId) {\n if (storageTransactionIdToContentUrl.has(storageTransactionId)) {\n const contentUrl =\n storageTransactionIdToContentUrl.get(storageTransactionId)\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n refResolvedValue: storageTransactionId,\n })\n return true\n }\n\n const contentUrl = await convertTxIdToImage(storageTransactionId)\n if (contentUrl) {\n seedUidToContentUrl.set(propertyValue, contentUrl)\n }\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n refResolvedValue: storageTransactionId,\n })\n return true\n }\n\n const relationValueData = await getRelationValueData(propertyValue)\n\n if (relationValueData) {\n const { refResolvedValue } = relationValueData\n const propertyValueFromDb = relationValueData.propertyValue\n\n // This handles a local-only relation value and resolves from the filesystem\n if (\n refResolvedValue &&\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Relation &&\n propertyValueFromDb &&\n typeof propertyValueFromDb === 'string' &&\n propertyValueFromDb.length === 10 &&\n propertyRecordSchema.ref\n ) {\n if (refResolvedValueToContentUrl.has(refResolvedValue)) {\n const contentUrl = refResolvedValueToContentUrl.get(refResolvedValue)\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n })\n return true\n }\n\n const fileExists = await BaseFileManager.pathExists(\n '/files/images/' + refResolvedValue,\n )\n if (fileExists) {\n const file = await BaseFileManager.readFile(\n '/files/images/' + refResolvedValue,\n )\n const contentUrl = URL.createObjectURL(file)\n refResolvedValueToContentUrl.set(refResolvedValue, contentUrl)\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n })\n return true\n }\n }\n\n if (typeof propertyValueFromDb === 'string') {\n // Check files for a filename that matches the propertyValue\n if (\n propertyRecordSchema &&\n propertyRecordSchema.refValueType === ModelPropertyDataTypes.Image\n ) {\n let contentUrl\n\n if (storageTransactionIdToContentUrl.has(propertyValueFromDb)) {\n contentUrl =\n storageTransactionIdToContentUrl.get(propertyValueFromDb)\n }\n\n if (!contentUrl) {\n const imageFileExists = await BaseFileManager.pathExists(\n `/images/${propertyValue}`,\n )\n if (imageFileExists) {\n const file = await BaseFileManager.readFile(\n `/images/${propertyValue}`,\n )\n contentUrl = URL.createObjectURL(file)\n storageTransactionIdToContentUrl.set(\n propertyValueFromDb,\n contentUrl,\n )\n }\n }\n\n if (contentUrl) {\n sendBack({\n type: 'updateContext',\n renderValue: contentUrl,\n })\n sendBack({\n type: 'resolvingRelatedValueSuccess',\n refResolvedDisplayValue: contentUrl,\n })\n return true\n }\n }\n }\n }\n }\n\n _resolveRelatedValue().then((success) => {\n // if (success) {\n // sendBack({\n // type: 'resolvingRelatedValueDone',\n // })\n // }\n // return\n sendBack({\n type: 'resolvingRelatedValueDone',\n })\n })\n})\n\n// const eventKey = `storage.transaction.${initialValue}.contentUrl.response`\n//\n// const contentUrlListener = async (event) => {\n// console.log('[itemProperty] [constructor] contentUrlListener', event)\n// }\n//\n// eventEmitter.once(eventKey, contentUrlListener)\n//\n// const ready = getArePropertyEventHandlersReady()\n//\n// console.log('[itemProperty] [constructor] ready', ready)\n//\n// eventEmitter.emit('storage.transaction.contentUrl.request', {\n// storageTransactionId: initialValue,\n// })\n\n// Related property values can either be seedUid or seedUid[]\n// let relatedSeedUid: string\n// let relatedSeedUids: string[]\n//\n// if (Array.isArray(propertyValue)) {\n// relatedSeedUids = propertyValue\n// } else {\n// relatedSeedUid = propertyValue\n// }\n//\n// if (relatedSeedUid) {\n// console.log(\n// `[property/actors] [resolveRelatedValue] seedUid: ${relatedSeedUid}`,\n// )\n// const latestVersionOfRelatedSeedQuery = await appDb.run(\n// sql.raw(\n// `\n// SELECT local_id, uid, MAX(attestation_created_at)\n// FROM versions\n// WHERE seed_uid = '${relatedSeedUid}';\n// `,\n// ),\n// )\n// if (\n// latestVersionOfRelatedSeedQuery &&\n// latestVersionOfRelatedSeedQuery.rows &&\n// latestVersionOfRelatedSeedQuery.rows.length > 0\n// ) {\n// const latestVersionOfRelatedSeed =\n// latestVersionOfRelatedSeedQuery.rows[0]\n// console.log(\n// '[property/actors] [resolveRelatedValue] latestVersionOfRelatedSeed',\n// latestVersionOfRelatedSeed,\n// )\n// const storageIdQuery = await appDb.run(\n// sql.raw(\n// `\n// SELECT property_value, MAX(attestation_created_at), ref_resolved_display_value, ref_resolved_value\n// FROM metadata\n// WHERE seed_uid = '${relatedSeedUid}'\n// AND property_name = 'storageTransactionId';\n// `,\n// ),\n// )\n//\n// if (\n// storageIdQuery &&\n// storageIdQuery.rows &&\n// storageIdQuery.rows.length > 0\n// ) {\n// const storageId = storageIdQuery.rows[0][0]\n//\n// if (!storageId) {\n// console.error(\n// `storageId not found for ${propertyName} with relatedSeedUid ${relatedSeedUid}`,\n// )\n// }\n//\n// const refResolvedDisplayValue = storageIdQuery.rows[0][2]\n// let resolvedValue = storageIdQuery.rows[0][3]\n//\n// if (refResolvedDisplayValue && resolvedValue) {\n// sendBack({\n// type: 'resolvingRelatedValueSuccess',\n// refResolvedDisplayValue,\n// resolvedValue,\n// })\n// return\n// }\n//\n// console.log(\n// '[property/actors] [resolveRelatedValue] storageId',\n// storageId,\n// )\n//\n// const contentUrl = await convertTxIdToImage(storageId)\n//\n// if (!contentUrl) {\n// throw new Error(\n// `contentUrl not found for ${propertyName} with relatedSeedUid ${relatedSeedUid}`,\n// )\n// }\n//\n// await appDb.run(\n// sql.raw(\n// `UPDATE metadata\n// SET ref_resolved_display_value = '${contentUrl}',\n// ref_resolved_value = '${storageId}'\n// WHERE seed_uid = '${relatedSeedUid}'\n// AND property_name = 'storageTransactionId';\n// `,\n// ),\n// )\n//\n// sendBack({\n// type: 'resolvingRelatedValueSuccess',\n// refResolvedDisplayValue: contentUrl,\n// resolvedValue: storageId,\n// })\n// }\n// }\n//\n// const versionUidQuery = await appDb.run(\n// sql.raw(\n// `\n// SELECT uid\n// FROM versions\n// WHERE seed_uid = '${relatedSeedUid}';\n// `,\n// ),\n// )\n//\n// if (\n// versionUidQuery &&\n// versionUidQuery.rows &&\n// versionUidQuery.rows.length > 0\n// ) {\n// const versionUids = versionUidQuery.rows.map((row) => row[0])\n// console.log(\n// '[property/actors] [resolveRelatedValue] versionUids',\n// versionUids,\n// )\n// const { itemProperties } = await easClient.request(GET_PROPERTIES, {\n// where: {\n// refUID: {\n// in: versionUids,\n// },\n// decodedDataJson: {\n// contains: 'storage_transaction_id',\n// },\n// },\n// })\n//\n// console.log(\n// '[property/actors] [resolveRelatedValue] itemProperties',\n// itemProperties,\n// )\n//\n// if (itemProperties && itemProperties.length > 0) {\n// await savePropertiesToDb(itemProperties)\n// }\n// }\n// }\n","import { metadata, MetadataType } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { eq } from 'drizzle-orm'\nimport { PropertyType } from '@/types'\nimport { BaseQueryClient } from '@/helpers/QueryClient/BaseQueryClient'\nimport { BaseEasClient } from '@/helpers/EasClient/BaseEasClient'\nimport { INTERNAL_DATA_TYPES } from '@/helpers/constants'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { Schema as EASSchema } from '@/graphql/gql/graphql'\nimport { GET_SCHEMA_BY_NAME } from '@/Item/queries'\n\ntype UpdateMetadata = (\n metadataValues: Partial<MetadataType>,\n propertyRecordSchema?: PropertyType | undefined,\n) => Promise<MetadataType>\n\nexport const updateMetadata: UpdateMetadata = async (metadataValues, propertyRecordSchema) => {\n const appDb = BaseDb.getAppDb()\n\n const { localId, ...rest } = metadataValues\n\n if (!localId) {\n throw new Error('No localId provided to updateMetadata')\n }\n \n const isItemStorage = propertyRecordSchema && propertyRecordSchema.storageType === 'ItemStorage'\n\n // Convert propertyValue to string if it's not already (metadata table expects text)\n if (rest.propertyValue !== undefined && rest.propertyValue !== null) {\n if (typeof rest.propertyValue !== 'string') {\n rest.propertyValue = String(rest.propertyValue)\n }\n }\n\n if (\n !isItemStorage && \n propertyRecordSchema &&\n metadataValues.propertyName &&\n (!metadataValues.schemaUid || metadataValues.schemaUid === 'undefined' )\n ) {\n try {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n if (queryClient && easClient && propertyRecordSchema.dataType) {\n // Type-safe lookup of EAS data type\n const dataTypeKey = propertyRecordSchema.dataType as keyof typeof INTERNAL_DATA_TYPES\n const easDataType = INTERNAL_DATA_TYPES[dataTypeKey]?.eas\n\n if (easDataType) {\n const propertyNameSnakeCase = toSnakeCase(metadataValues.propertyName)\n \n const queryResult = await queryClient.fetchQuery({\n queryKey: [`getSchemaByName${metadataValues.propertyName}`],\n queryFn: async (): Promise<{schemas: EASSchema[]}> =>\n easClient.request(GET_SCHEMA_BY_NAME, {\n where: {\n schema: {\n equals: `${easDataType} ${propertyNameSnakeCase}`,\n },\n },\n }),\n })\n\n // Handle both { schemas: [...] } and { data: { schemas: [...] } } formats\n const schemas = queryResult?.schemas || (queryResult as any)?.data?.schemas\n if (schemas && Array.isArray(schemas) && schemas.length > 0) {\n metadataValues.schemaUid = schemas[0].id\n rest.schemaUid = schemas[0].id\n }\n }\n }\n } catch (error) {\n // If EAS query fails, continue without schemaUid - it's not required for metadata update\n // Log error in development but don't throw\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schemaUid for property ${metadataValues.propertyName}:`, error)\n }\n }\n }\n\n const updated = await appDb\n .update(metadata)\n .set(rest)\n .where(eq(metadata.localId, localId))\n .returning()\n\n return updated[0]\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { and, eq, or, sql } from 'drizzle-orm'\nimport debug from 'debug'\nimport { metadata } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { updateMetadata } from '@/db/write/updateMetadata'\nimport { FromCallbackInput } from '@/types/machines'\nimport { PropertyMachineContext } from '@/types/property'\nimport { BaseFileManager } from '@/helpers'\n// Dynamic import to break circular dependency: schema/index -> ... -> hydrateFromDb -> schema/index\n// import { ModelPropertyDataTypes } from '@/schema'\n\nconst logger = debug('seedSdk:property:actors:hydrateFromDb')\n\nexport const hydrateFromDb = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, EventObject>\n>(({ sendBack, input: { context } }) => {\n const {\n seedUid,\n seedLocalId,\n propertyName: propertyNameRaw,\n propertyRecordSchema,\n modelName,\n } = context\n\n if (!propertyNameRaw) {\n throw new Error('propertyName is required')\n }\n let propertyName = propertyNameRaw\n\n // Note: isRelation, isImage, isFile checks moved inside async function\n // to use dynamically imported ModelPropertyDataTypes\n\n const _hydrateFromDb = async () => {\n // Use dynamic import to break circular dependency\n const schemaMod = await import('../../../Schema')\n const { ModelPropertyDataTypes } = schemaMod\n \n const appDb = BaseDb.getAppDb()\n\n const whereClauses = []\n\n // Re-check types with dynamically imported ModelPropertyDataTypes\n const isRelationDynamic =\n propertyRecordSchema &&\n propertyRecordSchema.ref &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Relation\n\n const isImageDynamic =\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Image\n\n const isFileDynamic =\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.File\n\n if (isRelationDynamic || isImageDynamic || isFileDynamic) {\n let missingPropertyNameVariant\n if (propertyName.endsWith('Id')) {\n missingPropertyNameVariant = propertyName.slice(0, -2)\n }\n if (!propertyName.endsWith('Id')) {\n missingPropertyNameVariant = propertyName + 'Id'\n }\n if (missingPropertyNameVariant) {\n whereClauses.push(\n or(\n eq(metadata.propertyName, propertyName),\n eq(metadata.propertyName, missingPropertyNameVariant),\n ),\n )\n }\n if (!missingPropertyNameVariant) {\n whereClauses.push(eq(metadata.propertyName, propertyName))\n }\n } else {\n whereClauses.push(eq(metadata.propertyName, propertyName))\n }\n\n if (seedUid) {\n whereClauses.push(eq(metadata.seedUid, seedUid))\n }\n\n if (seedLocalId) {\n whereClauses.push(eq(metadata.seedLocalId, seedLocalId))\n }\n\n const rows = await appDb\n .select()\n .from(metadata)\n .where(and(...whereClauses))\n .orderBy(sql.raw('COALESCE(attestation_created_at, created_at) DESC'))\n\n if (!rows || !rows.length) {\n return\n }\n\n const firstRow = rows[0]\n\n const {\n localId,\n uid,\n propertyName: propertyNameFromDb,\n propertyValue: propertyValueFromDb,\n seedLocalId: seedLocalIdFromDb,\n seedUid: seedUidFromDb,\n schemaUid: schemaUidFromDb,\n versionLocalId: versionLocalIdFromDb,\n versionUid: versionUidFromDb,\n refValueType,\n } = firstRow\n\n let { refResolvedDisplayValue, refResolvedValue, localStorageDir } = firstRow\n\n let propertyValueProcessed: string | string[] | undefined | null =\n propertyValueFromDb\n\n\n if (isImageDynamic) {\n let shouldReadFromFile = true\n\n if (\n refResolvedValue &&\n refResolvedDisplayValue &&\n refResolvedDisplayValue.includes('http')\n ) {\n try {\n const response = await fetch(refResolvedDisplayValue, {\n method: 'HEAD',\n }).catch((error) => {\n // No-op\n shouldReadFromFile = true\n })\n\n if (!response || !response.ok) {\n shouldReadFromFile = true\n }\n\n // Check if the status is in the 200-299 range\n if (response && response.ok) {\n shouldReadFromFile = false\n }\n } catch (error) {\n shouldReadFromFile = true\n }\n }\n\n if (shouldReadFromFile) {\n let dir = localStorageDir\n if (\n !dir &&\n isImageDynamic\n ) {\n dir = 'images'\n }\n\n dir = dir!.replace(/^\\//, '')\n\n if (\n propertyValueFromDb &&\n propertyValueFromDb.length === 66\n ) {\n // Here the storageTransactionId is stored on a different record and\n // we want to add it as the refResolvedValue\n const storageTransactionQuery = await appDb\n .select({\n propertyValue: metadata.propertyValue,\n })\n .from(metadata)\n .where(\n and(\n eq(metadata.seedUid, propertyValueFromDb),\n or(\n eq(metadata.propertyName, 'storageTransactionId'),\n eq(metadata.propertyName, 'transactionId'),\n ),\n ),\n )\n\n if (storageTransactionQuery && storageTransactionQuery.length > 0) {\n const row = storageTransactionQuery[0]\n refResolvedValue = row.propertyValue\n await updateMetadata({\n localId,\n refResolvedValue,\n localStorageDir: '/images',\n })\n }\n }\n\n const dirPath = `/files/${dir}`\n const fs = await BaseFileManager.getFs()\n const path = BaseFileManager.getPathModule()\n const files = await fs.promises.readdir(dirPath)\n const matchingFiles = files.filter((file: string) => {\n return path.basename(file).includes(refResolvedValue!)\n })\n let fileExists = false\n let filename\n let filePath\n if (matchingFiles && matchingFiles.length > 0) {\n fileExists = true\n filename = matchingFiles[0]\n filePath = `/files/${dir}/${filename}`\n }\n localStorageDir = `/${dir}`\n if (fileExists && filename && filePath) {\n const file = await BaseFileManager.readFile(filePath)\n refResolvedDisplayValue = URL.createObjectURL(file)\n await updateMetadata({\n localId,\n refResolvedValue: filename,\n refResolvedDisplayValue: refResolvedDisplayValue,\n localStorageDir,\n })\n }\n\n }\n }\n\n if (\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.List &&\n propertyRecordSchema.ref &&\n typeof propertyValueFromDb === 'string'\n ) {\n propertyValueProcessed = propertyValueFromDb.split(',')\n }\n\n sendBack({\n type: 'updateContext',\n localId,\n uid,\n propertyValue: propertyValueProcessed,\n seedLocalId: seedLocalIdFromDb,\n seedUid: seedUidFromDb,\n versionLocalId: versionLocalIdFromDb,\n versionUid: versionUidFromDb,\n schemaUid: schemaUidFromDb,\n refValueType,\n localStorageDir,\n refResolvedValue,\n refResolvedDisplayValue,\n renderValue: refResolvedDisplayValue,\n populatedFromDb: true,\n })\n\n if (\n propertyRecordSchema &&\n propertyRecordSchema.storageType &&\n propertyRecordSchema.storageType === 'ItemStorage'\n ) {\n const itemMod = await import(`@/Item/Item`)\n const { Item } = itemMod\n const item = await Item.find({\n seedLocalId: seedLocalId ?? undefined,\n modelName,\n })\n if (item) {\n const filePath = `/files/${localStorageDir}/${refResolvedValue}`\n const exists = await BaseFileManager.pathExists(filePath)\n\n if (!exists) {\n return\n }\n\n const renderValue = await BaseFileManager.readFileAsString(filePath)\n const property = item.properties.find(p => p.propertyName === propertyName)\n if (property) {\n property.getService().send({ type: 'updateContext', renderValue })\n }\n return\n }\n }\n }\n\n _hydrateFromDb().then(() => {\n sendBack({ type: 'hydrateFromDbSuccess' })\n })\n})\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types'\nimport { PropertyMachineContext } from '@/types/property'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { metadata, models, properties } from '@/seedSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { camelCase, upperFirst } from 'lodash-es'\nimport { getMetadataLatest } from '@/db/read/subqueries/metadataLatest'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:itemProperty:actors:loadOrCreateProperty')\n\nexport const loadOrCreateProperty = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext>\n>(({ sendBack, input: { context } }) => {\n const _loadOrCreateProperty = async (): Promise<void> => {\n const { seedLocalId, seedUid, propertyName, versionLocalId } = context\n\n logger(`loadOrCreateProperty called for propertyName: ${propertyName}, seedLocalId: ${seedLocalId}, seedUid: ${seedUid}`)\n\n if (!seedLocalId && !seedUid) {\n throw new Error('seedLocalId or seedUid is required')\n }\n\n if (!propertyName) {\n throw new Error('propertyName is required')\n }\n\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not available')\n }\n\n // Use getMetadataLatest subquery pattern to get the latest metadata record for the property\n const metadataLatest = getMetadataLatest({ \n seedLocalId: seedLocalId ?? undefined, \n seedUid: seedUid ?? undefined \n })\n \n const metadataRecords = await db\n .with(metadataLatest)\n .select()\n .from(metadataLatest)\n .where(\n and(\n eq(metadataLatest.propertyName, propertyName),\n eq(metadataLatest.rowNum, 1)\n )\n )\n .limit(1)\n\n if (metadataRecords.length === 0) {\n // Metadata not found - this is a new property, will be created elsewhere\n logger(`Metadata not found in database for propertyName: ${propertyName}, seedLocalId: ${seedLocalId}`)\n sendBack({\n type: 'loadOrCreatePropertySuccess',\n property: {\n propertyName,\n propertyValue: context.propertyValue || undefined,\n renderValue: context.renderValue || context.propertyValue || undefined,\n seedLocalId,\n seedUid,\n versionLocalId: versionLocalId || context.versionLocalId,\n versionUid: context.versionUid,\n schemaUid: context.schemaUid,\n localId: undefined,\n uid: undefined,\n },\n })\n return\n }\n\n const metadataRecord = metadataRecords[0]\n\n // Load propertyRecordSchema from database to make ItemProperty independent from Model\n let propertyRecordSchema: any = undefined\n const modelName = metadataRecord.modelType || context.modelName\n if (modelName) {\n try {\n // Normalize snake_case to PascalCase: \"test_post\" -> \"TestPost\" (startCase gives \"Test Post\" which fails)\n const normalizedModelName = upperFirst(camelCase(modelName))\n // Query properties table to get property schema\n const modelRecords = await db\n .select({ id: models.id })\n .from(models)\n .where(eq(models.name, normalizedModelName))\n .limit(1)\n\n if (modelRecords.length > 0 && modelRecords[0].id) {\n const propertyRecords = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.modelId, modelRecords[0].id),\n eq(properties.name, propertyName)\n )\n )\n .limit(1)\n\n if (propertyRecords.length > 0) {\n const propRecord = propertyRecords[0]\n propertyRecordSchema = {\n dataType: propRecord.dataType,\n ref: propRecord.refModelName || undefined,\n refValueType: propRecord.refValueType || undefined,\n storageType: propRecord.storageType || undefined,\n localStorageDir: propRecord.localStorageDir || undefined,\n filenameSuffix: propRecord.filenameSuffix || undefined,\n }\n }\n }\n } catch (error) {\n logger(`Error loading propertyRecordSchema from database: ${error}`)\n // Continue without propertyRecordSchema\n }\n }\n\n // Fix 1: Fallback to in-memory Model when DB doesn't have model/properties yet (e.g. runtime-created model)\n const fromDbBeforeFallback = !!propertyRecordSchema\n if (!propertyRecordSchema && modelName) {\n try {\n const { Model } = await import('../../../Model/Model')\n const { modelPropertiesToObject } = await import('../../../helpers/model')\n const normalizedModelName = upperFirst(camelCase(modelName))\n // Try PascalCase first (\"post\" -> \"Post\"); then findByModelType for names with spaces (\"new_model\" -> \"New model\")\n let model = Model.getByName(normalizedModelName)\n if (!model?.properties?.length) {\n model = Model.findByModelType(toSnakeCase(modelName))\n }\n if (model?.properties?.length) {\n const schemas = modelPropertiesToObject(model.properties)\n propertyRecordSchema = schemas[propertyName]\n if (propertyRecordSchema) {\n logger(`Fallback: loaded propertyRecordSchema from Model for propertyName \"${propertyName}\"`)\n }\n }\n } catch (error) {\n logger(`Fallback Model lookup failed for propertyName \"${propertyName}\": ${error}`)\n }\n }\n\n // Return loaded property data\n sendBack({\n type: 'loadOrCreatePropertySuccess',\n property: {\n propertyName: metadataRecord.propertyName || propertyName,\n propertyValue: metadataRecord.propertyValue || undefined,\n renderValue: metadataRecord.propertyValue || undefined,\n seedLocalId: metadataRecord.seedLocalId || seedLocalId,\n seedUid: metadataRecord.seedUid || seedUid,\n versionLocalId: metadataRecord.versionLocalId || versionLocalId,\n versionUid: metadataRecord.versionUid || context.versionUid,\n schemaUid: metadataRecord.schemaUid || context.schemaUid,\n localId: metadataRecord.localId || undefined,\n uid: metadataRecord.uid || undefined,\n modelName: modelName || context.modelName,\n propertyRecordSchema,\n },\n })\n }\n\n _loadOrCreateProperty().catch((error) => {\n logger(`Error in loadOrCreateProperty: ${error}`)\n sendBack({\n type: 'loadOrCreatePropertyError',\n error: error instanceof Error ? error.message : String(error),\n })\n })\n})\n","import { versions, VersionsType } from '@/seedSchema'\nimport { and, eq } from 'drizzle-orm'\nimport { BaseDb } from '../Db/BaseDb'\n\ntype GetVersionDataProps = {\n localId?: string | null\n uid?: string\n seedLocalId?: string\n}\n\ntype GetVersionData = (\n props: GetVersionDataProps,\n) => Promise<VersionsType | undefined>\n\nexport const getVersionData: GetVersionData = async ({\n localId,\n seedLocalId,\n uid,\n}) => {\n const appDb = BaseDb.getAppDb()\n\n const whereClauses = []\n\n if (seedLocalId) {\n whereClauses.push(eq(versions.localId, seedLocalId))\n }\n\n if (localId) {\n whereClauses.push(eq(versions.localId, localId))\n }\n\n if (uid) {\n whereClauses.push(eq(versions.uid, uid))\n }\n\n const queryRows = await appDb\n .select()\n .from(versions)\n .where(and(...whereClauses))\n\n if (!queryRows || !queryRows.length) {\n return\n }\n\n return queryRows[0]\n}\n","import { escapeSqliteString } from '@/helpers/db'\nimport { metadata, MetadataType } from '@/seedSchema'\nimport { and, eq, sql } from 'drizzle-orm'\nimport { getSeedData } from '@/db/read/getSeedData'\nimport { getVersionData } from '@/db/read/getVersionData'\nimport { generateId } from '@/helpers'\nimport debug from 'debug'\nimport { BaseDb } from '@/db/Db/BaseDb'\nconst logger = debug('seedSdk:write:updateItemPropertyValue')\n\ntype UpdateItemPropertyValueResult = {\n localId: string\n schemaUid: string\n}\n\ntype UpdateItemPropertyValueProps = Partial<MetadataType> & {\n newValue?: string | null\n modelName?: string | null\n}\n\ntype UpdateItemPropertyValue = (props: UpdateItemPropertyValueProps) => Promise<UpdateItemPropertyValueResult | undefined>\n\nexport const updateItemPropertyValue: UpdateItemPropertyValue = async ({\n localId,\n propertyName,\n newValue,\n seedUid,\n seedLocalId,\n modelName,\n refSeedType,\n refResolvedValue,\n refResolvedDisplayValue,\n versionLocalId,\n versionUid,\n schemaUid,\n localStorageDir,\n}) => {\n if (!localId && !seedLocalId) {\n logger(\n `[db/write] [updateItemPropertyValue] no propertyLocalId or seedLocalId for property: ${propertyName}`,\n )\n return\n }\n\n let safeNewValue = newValue\n\n if (\n typeof newValue === 'string' &&\n !refResolvedDisplayValue &&\n !refResolvedValue\n ) {\n safeNewValue = escapeSqliteString(newValue)\n }\n\n const appDb = BaseDb.getAppDb()\n\n const rows = await appDb\n .select()\n .from(metadata)\n .where(\n and(\n eq(metadata.propertyName, propertyName!),\n eq(metadata.seedLocalId, seedLocalId!),\n ),\n )\n .orderBy(sql.raw('COALESCE(attestation_created_at, created_at) DESC'))\n\n // const mostRecentRecordStatement = `SELECT local_id,\n // uid,\n // property_name,\n // property_value,\n // model_type,\n // seed_uid,\n // seed_local_id,\n // version_local_id,\n // version_uid,\n // schema_uid,\n // eas_data_type\n // FROM metadata\n // WHERE property_name = '${propertyName}'\n // AND seed_local_id = '${seedLocalId}'\n // ORDER BY COALESCE(attestation_created_at, created_at) DESC;`\n //\n // const { rows } = await runQueryForStatement(mostRecentRecordStatement)\n\n if (rows && rows.length > 0) {\n const {\n localId,\n uid,\n propertyName: propertyNameFromDb,\n propertyValue: propertyValueFromDb,\n modelType,\n seedUid,\n seedLocalId: seedLocalIdFromDb,\n versionLocalId,\n versionUid,\n schemaUid,\n easDataType,\n localStorageDir: localStorageDirFromDb,\n refSeedType: refSeedTypeFromDb,\n refResolvedValue: refResolvedValueFromDb,\n refResolvedDisplayValue: refResolvedDisplayValueFromDb,\n } = rows[0]\n\n if (\n propertyValueFromDb === newValue &&\n modelType === modelName?.toLowerCase() &&\n refSeedTypeFromDb === refSeedType &&\n refResolvedValueFromDb === refResolvedValue\n ) {\n logger(\n `[db/write] [updateItemPropertyValue] value is the same as most recent record for property: ${propertyNameFromDb}`,\n )\n return\n }\n\n // This means we already have a local-only record so we should just update that one\n if (!uid) {\n const updatePropertyStatement = `UPDATE metadata\n SET property_value = '${safeNewValue}',\n ref_seed_type = ${refSeedType ? `'${refSeedType}'` : 'NULL'},\n ref_resolved_value = ${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},\n ref_resolved_display_value = ${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},\n updated_at = ${Date.now()}\n WHERE local_id = '${localId}';`\n\n await appDb.run(sql.raw(updatePropertyStatement))\n\n return\n }\n\n const seedDataFromDb = seedLocalId ? await getSeedData({ seedLocalId }) : null\n const versionDataFromDb = versionLocalId ? await getVersionData({ localId: versionLocalId }) : null\n\n // Here we don't have a local-only record so we need to create a new one\n const newLocalId = generateId()\n\n const newPropertyStatement = `INSERT INTO metadata (local_id,\n property_name,\n property_value,\n model_type,\n seed_uid,\n seed_local_id,\n version_local_id,\n version_uid,\n schema_uid,\n eas_data_type,\n ref_seed_type,\n ref_resolved_value,\n ref_resolved_display_value,\n local_storage_dir,\n created_at)\n VALUES ('${newLocalId}',\n '${propertyNameFromDb}',\n '${safeNewValue}',\n '${modelType || modelName?.toLowerCase()}',\n ${seedDataFromDb?.uid ? `'${seedDataFromDb.uid}'` : 'NULL'},\n '${seedLocalIdFromDb}',\n '${versionLocalId}',\n ${versionDataFromDb?.uid ? `'${versionDataFromDb.uid}'` : 'NULL'},\n '${schemaUid}',\n ${easDataType ? `'${easDataType}'` : 'NULL'},\n ${refSeedType ? `'${refSeedType}'` : 'NULL'},\n ${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},\n ${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},\n ${localStorageDir ? `'${localStorageDir}'` : 'NULL'},\n ${Date.now()});`\n\n await appDb.run(sql.raw(newPropertyStatement))\n\n return {\n localId: newLocalId,\n schemaUid,\n }\n }\n\n // Here there are no records for this property on this seed so we should create one\n\n const newLocalId = generateId()\n\n if (!seedUid) {\n const seedData = await getSeedData({ seedLocalId: seedLocalId || undefined })\n if (seedData) {\n seedUid = seedData.uid || undefined\n }\n }\n\n if (!versionUid) {\n const versionData = await getVersionData({ localId: versionLocalId })\n if (versionData) {\n versionUid = versionData.uid\n }\n }\n\n const newPropertyStatement = `INSERT INTO metadata (local_id,\n property_name,\n property_value,\n model_type,\n seed_uid,\n seed_local_id,\n version_local_id,\n version_uid,\n schema_uid,\n ref_seed_type,\n ref_resolved_value,\n ref_resolved_display_value,\n local_storage_dir,\n created_at)\n VALUES ('${newLocalId}',\n '${propertyName}',\n '${safeNewValue}',\n '${modelName?.toLowerCase() || ''}',\n ${seedUid ? `'${seedUid}'` : 'NULL'},\n '${seedLocalId || ''}',\n '${versionLocalId || ''}',\n ${versionUid ? `'${versionUid}'` : 'NULL'},\n '${schemaUid || ''}',\n ${refSeedType ? `'${refSeedType}'` : 'NULL'},\n ${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},\n ${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},\n ${localStorageDir ? `'${localStorageDir}'` : 'NULL'},\n ${Date.now()});`\n\n await appDb.run(sql.raw(newPropertyStatement))\n\n return {\n localId: newLocalId,\n schemaUid,\n }\n\n if (!seedLocalId && propertyName && modelName && newValue) {\n // TODO: Does this ever happen? If so, what should we do?\n }\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport {\n ItemPropertyValueType,\n PropertyMachineContext,\n SaveValueToDbEvent,\n} from '@/types/property'\nimport { updateItemPropertyValue } from '@/db/write/updateItemPropertyValue'\n\nimport { getSchemaForItemProperty } from '@/helpers/getSchemaForItemProperty'\nimport { INTERNAL_DATA_TYPES } from '@/helpers/constants'\n// Dynamic import to break circular dependency: schema/index -> ... -> analyzeInput -> schema/index\n// import { ModelPropertyDataTypes } from '@/schema'\nimport type { EIP712MessageTypes } from '@ethereum-attestation-service/eas-sdk'\n\n// Extract TypedData type from EIP712MessageTypes\n// EIP712MessageTypes is defined as { [key: string]: TypedData[] }\ntype ExtractTypedData<T> = T extends { [key: string]: infer U }\n ? U extends Array<infer V>\n ? V\n : never\n : never\ntype TypedData = ExtractTypedData<EIP712MessageTypes>\n\nexport const analyzeInput = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, SaveValueToDbEvent>\n>(({ sendBack, input: { context, event } }) => {\n const {\n localId,\n propertyName: propertyNameRaw,\n seedLocalId,\n versionLocalId,\n versionUid,\n propertyValue: existingValue,\n propertyRecordSchema,\n modelName,\n } = context\n\n let { schemaUid } = context\n\n let newValue: ItemPropertyValueType\n\n if (event) {\n newValue = event.newValue\n }\n\n if (existingValue === newValue) {\n sendBack({ type: 'saveValueToDbSuccess' })\n return\n }\n\n if (!propertyRecordSchema) {\n throw new Error('Missing propertyRecordSchema')\n }\n\n const _analyzeInput = async (): Promise<boolean> => {\n // Use dynamic import to break circular dependency\n const schemaMod = await import('../../../../Schema')\n const { ModelPropertyDataTypes } = schemaMod\n \n let propertyName = propertyNameRaw\n if (!propertyName) {\n throw new Error('propertyName is required')\n }\n\n if (\n propertyRecordSchema.refValueType &&\n propertyRecordSchema.refValueType !== ModelPropertyDataTypes.Image &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Relation\n ) {\n sendBack({\n type: 'saveRelation',\n newValue,\n })\n return false\n }\n\n if (\n propertyRecordSchema.refValueType === ModelPropertyDataTypes.Image ||\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Image\n ) {\n sendBack({\n type: 'saveImage',\n newValue,\n })\n return false\n }\n\n if (\n propertyRecordSchema.storageType &&\n propertyRecordSchema.storageType === 'ItemStorage'\n ) {\n sendBack({\n type: 'saveItemStorage',\n newValue,\n })\n return false\n }\n\n if (!schemaUid) {\n try {\n let easDataType\n\n if (propertyRecordSchema.dataType) {\n easDataType = INTERNAL_DATA_TYPES[propertyRecordSchema.dataType]\n .eas as TypedData['type']\n }\n\n const schemaFromEas = await getSchemaForItemProperty({\n propertyName: propertyName!,\n easDataType,\n })\n if (schemaFromEas) {\n schemaUid = schemaFromEas.id\n }\n } catch (error) {\n // If schema fetch fails, continue without schemaUid - it's not required for local metadata\n // Log error in development but don't throw\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schemaUid for property ${propertyName}:`, error)\n }\n }\n }\n\n // Convert newValue to string for database storage\n const stringValue = newValue !== null && newValue !== undefined \n ? (typeof newValue === 'string' ? newValue : String(newValue))\n : null\n\n const result = await updateItemPropertyValue({\n localId,\n propertyName: propertyName!,\n newValue: stringValue,\n seedLocalId,\n versionLocalId,\n versionUid,\n modelName,\n schemaUid,\n } as any) // Type assertion needed because newValue is not in MetadataType but is accepted by the function\n\n let updatedContext: Partial<PropertyMachineContext> = {\n propertyValue: typeof newValue === 'string' ? newValue : (newValue !== null && newValue !== undefined ? String(newValue) : undefined),\n }\n\n if (localId) {\n updatedContext.localId = localId\n }\n\n if (schemaUid) {\n updatedContext.schemaUid = schemaUid\n }\n\n if (!localId && result?.localId) {\n updatedContext.localId = result.localId\n }\n\n if (!schemaUid && result?.schemaUid) {\n updatedContext.schemaUid = result.schemaUid\n }\n\n sendBack({\n type: 'updateContext',\n ...updatedContext,\n })\n\n return true\n }\n\n _analyzeInput().then((isDone) => {\n if (isDone) {\n sendBack({ type: 'saveValueToDbSuccess' })\n }\n })\n})\n","import { metadata, MetadataType } from '@/seedSchema'\nimport { BaseEasClient, BaseQueryClient, generateId } from '@/helpers'\nimport { PropertyType } from '@/types'\nimport { BaseDb } from '../Db/BaseDb'\nimport { GET_SCHEMA_BY_NAME, } from '@/Item/queries'\nimport { INTERNAL_DATA_TYPES } from '@/helpers/constants'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { Schema as EASSchema } from '@/graphql/gql/graphql'\n\n\ntype CreateMetadata = (\n metadataValues: Partial<MetadataType> & { modelName?: string },\n propertyRecordSchema?: PropertyType | undefined,\n) => Promise<MetadataType>\n\nexport const createMetadata: CreateMetadata = async (\n metadataValues,\n propertyRecordSchema?,\n) => {\n const appDb = BaseDb.getAppDb()\n\n metadataValues.localId = generateId()\n\n if (!metadataValues.modelType && metadataValues.modelName) {\n metadataValues.modelType = toSnakeCase(metadataValues.modelName)\n }\n\n const isItemStorage = propertyRecordSchema && propertyRecordSchema.storageType === 'ItemStorage'\n\n // if (\n // propertyRecordSchema &&\n // propertyRecordSchema.localStorageDir &&\n // isItemStorage\n // ) {\n // const filename = `${metadataValues.seedUid || metadataValues.seedLocalId}${propertyRecordSchema.filenameSuffix}`\n // const filePath = path.join(propertyRecordSchema.localStorageDir, filename)\n // await fs.promises.writeFile(filePath, metadataValues.propertyValue)\n // metadataValues.propertyValue = filename\n // metadataValues.refValueType = 'file'\n // }\n\n // Convert propertyValue to string if it's not already (metadata table expects text)\n if (metadataValues.propertyValue !== undefined && metadataValues.propertyValue !== null) {\n if (typeof metadataValues.propertyValue !== 'string') {\n metadataValues.propertyValue = String(metadataValues.propertyValue)\n }\n }\n\n if (!isItemStorage && !metadataValues.schemaUid && propertyRecordSchema && metadataValues.propertyName) {\n try {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n if (queryClient && easClient && propertyRecordSchema.dataType) {\n // Type-safe lookup of EAS data type\n const dataTypeKey = propertyRecordSchema.dataType as keyof typeof INTERNAL_DATA_TYPES\n const easDataType = INTERNAL_DATA_TYPES[dataTypeKey]?.eas\n\n if (easDataType) {\n const propertyNameSnakeCase = toSnakeCase(metadataValues.propertyName)\n \n const queryResult = await queryClient.fetchQuery({\n queryKey: [`getSchemaByName${metadataValues.propertyName}`],\n queryFn: async (): Promise<{schemas: EASSchema[]}> =>\n easClient.request(GET_SCHEMA_BY_NAME, {\n where: {\n schema: {\n equals: `${easDataType} ${propertyNameSnakeCase}`,\n },\n },\n }),\n })\n\n // Handle both { schemas: [...] } and { data: { schemas: [...] } } formats\n const schemas = queryResult?.schemas || (queryResult as any)?.data?.schemas\n if (schemas && Array.isArray(schemas) && schemas.length > 0) {\n metadataValues.schemaUid = schemas[0].id\n }\n }\n }\n } catch (error) {\n // If EAS query fails, continue without schemaUid - it's not required for metadata insertion\n // Log error in development but don't throw\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Failed to fetch schemaUid for property ${metadataValues.propertyName}:`, error)\n }\n }\n }\n\n const inserted = await appDb\n .insert(metadata)\n .values({\n ...metadataValues,\n createdAt: Date.now(),\n updatedAt: Date.now(),\n })\n .returning()\n\n if (!inserted || inserted.length === 0) {\n throw new Error(`Failed to insert metadata record for property ${metadataValues.propertyName}`)\n }\n\n return inserted[0]\n}\n","import EventEmitter from 'eventemitter3'\n\nconst eventEmitter = new EventEmitter()\n\nexport { eventEmitter }\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport {\n ItemPropertyValueType,\n PropertyMachineContext,\n SaveValueToDbEvent,\n} from '@/types/property'\nimport { createSeed } from '@/db/write/createSeed'\nimport { getDataTypeFromString, getMimeType } from '@/helpers'\nimport { createVersion } from '@/db/write/createVersion'\nimport { createMetadata } from '@/db/write/createMetadata'\nimport { updateItemPropertyValue } from '@/db/write/updateItemPropertyValue'\nimport { getSchemaUidForModel } from '@/db/read/getSchemaUidForModel'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport { eventEmitter } from '@/eventBus'\nimport { ImageSize } from '@/helpers/constants'\n\n\nconst readFileAsArrayBuffer = async (file: File): Promise<ArrayBuffer> => {\n return new Promise((resolve) => {\n const reader = new FileReader()\n reader.onload = async (e) => {\n if (!e.target || !e.target.result) {\n throw new Error('FileReader result is null')\n }\n const arrayBuffer = e.target.result as ArrayBuffer\n\n resolve(arrayBuffer)\n }\n\n reader.readAsArrayBuffer(file)\n })\n}\n\nconst fetchImage = async (url: string) => {\n const response = await fetch(url)\n const mimeType = response.headers.get('Content-Type')\n const imageBuffer = await response.arrayBuffer()\n const bytes = new Uint8Array(imageBuffer)\n\n const binaryString = bytes.reduce(\n (acc, byte) => acc + String.fromCharCode(byte),\n '',\n )\n\n let base64 = btoa(binaryString)\n\n if (mimeType) {\n base64 = `data:${mimeType};base64,${base64}`\n }\n\n return base64\n}\n\nlet imageSchemaUid: string | undefined\n\nexport const saveImage = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, SaveValueToDbEvent>\n>(({ sendBack, input: { context, event } }) => {\n const {\n localId,\n propertyName: propertyNameRaw,\n propertyValue: existingValue,\n propertyRecordSchema,\n modelName,\n seedLocalId,\n seedUid,\n versionLocalId,\n versionUid,\n } = context\n\n let { schemaUid } = context\n\n let newValue: ItemPropertyValueType\n\n if (event) {\n newValue = event.newValue\n }\n\n if (existingValue === newValue) {\n sendBack({ type: 'saveValueToDbSuccess' })\n return\n }\n\n const _saveImage = async (): Promise<void> => {\n if (!propertyNameRaw) {\n throw new Error('propertyName is required')\n }\n let propertyName = propertyNameRaw\n\n if (!propertyNameRaw.endsWith('Id')) {\n propertyName = `${propertyName}Id`\n }\n\n let newValueType\n let fileData: string | ArrayBuffer | undefined\n let mimeType\n let fileName\n\n if (!imageSchemaUid) {\n const fetchedSchemaUid = await getSchemaUidForModel('Image')\n imageSchemaUid = fetchedSchemaUid ?? undefined\n }\n\n if (typeof newValue === 'string') {\n newValueType = getDataTypeFromString(newValue)\n }\n\n if (newValueType === 'imageBase64') {\n mimeType = getMimeType(newValue as string)\n const base64Data = (newValue as string).split(',')[1] // Strip the Base64 prefix\n const binaryString = atob(base64Data)\n\n const binaryLength = binaryString.length\n const binaryArray = new Uint8Array(binaryLength)\n for (let i = 0; i < binaryLength; i++) {\n binaryArray[i] = binaryString.charCodeAt(i)\n }\n fileData = binaryArray.buffer\n }\n\n if (newValueType === 'url') {\n fileData = await fetchImage(newValue as string)\n }\n\n if (newValue instanceof File) {\n fileName = newValue.name\n mimeType = newValue.type\n fileData = await readFileAsArrayBuffer(newValue)\n }\n\n if (!fileData) {\n throw new Error('No file data found')\n }\n\n const newImageSeedLocalId = await createSeed({\n type: 'image',\n })\n\n if (!fileName) {\n fileName = newImageSeedLocalId\n if (mimeType) {\n fileName += `.${mimeType.split('/')[1]}`\n }\n }\n\n const filePath = `/files/images/${fileName}`\n\n const imageVersionLocalId = await createVersion({\n seedLocalId: newImageSeedLocalId,\n seedType: 'image',\n })\n\n if (fileData instanceof ArrayBuffer) {\n try {\n await BaseFileManager.saveFile(filePath, fileData)\n } catch (e) {\n const fs = await BaseFileManager.getFs()\n fs.writeFileSync(filePath, new Uint8Array(fileData))\n eventEmitter.emit('file-saved', filePath)\n }\n }\n\n if (typeof fileData === 'string') {\n try {\n await BaseFileManager.saveFile(filePath, fileData)\n } catch (e) {\n const fs = await BaseFileManager.getFs()\n fs.writeFileSync(filePath, fileData)\n eventEmitter.emit('file-saved', filePath)\n }\n }\n\n\n await BaseFileManager.resizeImage({filePath, width: ImageSize.EXTRA_SMALL, height: ImageSize.EXTRA_SMALL})\n await BaseFileManager.resizeImage({filePath, width: ImageSize.SMALL, height: ImageSize.SMALL})\n await BaseFileManager.resizeImage({filePath, width: ImageSize.MEDIUM, height: ImageSize.MEDIUM})\n await BaseFileManager.resizeImage({filePath, width: ImageSize.LARGE, height: ImageSize.LARGE})\n await BaseFileManager.resizeImage({filePath, width: ImageSize.EXTRA_LARGE, height: ImageSize.EXTRA_LARGE})\n\n const refResolvedDisplayValue = await BaseFileManager.getContentUrlFromPath(filePath)\n\n let newLocalId\n\n if (!localId) {\n const result = await createMetadata(\n {\n propertyName,\n propertyValue: newImageSeedLocalId,\n seedLocalId,\n seedUid,\n versionLocalId,\n versionUid,\n modelName,\n schemaUid: imageSchemaUid,\n refSeedType: 'image',\n refModelUid: imageSchemaUid,\n refResolvedDisplayValue,\n refResolvedValue: fileName,\n localStorageDir: '/images',\n easDataType: 'bytes32',\n },\n propertyRecordSchema,\n )\n\n if (result && result.localId) {\n newLocalId = result.localId\n }\n }\n\n if (localId) {\n await updateItemPropertyValue({\n localId: localId,\n propertyName: propertyNameRaw,\n newValue: newImageSeedLocalId,\n seedLocalId,\n versionLocalId,\n modelName,\n schemaUid,\n refSeedType: 'image',\n refResolvedDisplayValue,\n refResolvedValue: fileName,\n refModelUid: imageSchemaUid,\n localStorageDir: '/images',\n easDataType: 'bytes32',\n } as any) // Type assertion needed because newValue is not in MetadataType but is accepted by the function\n }\n\n sendBack({\n type: 'updateContext',\n localId: newLocalId || localId,\n propertyValue: newImageSeedLocalId,\n refSeedType: 'image',\n refSchemaUid: imageSchemaUid,\n renderValue: refResolvedDisplayValue,\n refResolvedDisplayValue,\n refResolvedValue: fileName,\n localStorageDir: '/images',\n easDataType: 'bytes32',\n schemaUid,\n })\n }\n\n _saveImage().then(() => {\n sendBack({ type: 'saveImageSuccess' })\n })\n})\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport {\n ItemPropertyValueType,\n PropertyMachineContext,\n SaveValueToDbEvent,\n} from '@/types/property'\nimport { getDataTypeFromString } from '@/helpers'\n// Dynamic import to break circular dependency: schema/index -> ... -> saveRelation -> schema/index\n// import { ModelPropertyDataTypes } from '@/schema'\n\nexport const saveRelation = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, SaveValueToDbEvent>\n>(({ sendBack, input: { context, event } }) => {\n const {\n localId,\n propertyName: propertyNameRaw,\n versionLocalId,\n seedUid,\n seedLocalId,\n propertyValue: existingValue,\n propertyRecordSchema,\n } = context\n\n if (!propertyRecordSchema) {\n throw new Error('Missing propertyRecordSchema')\n }\n\n let newValue: ItemPropertyValueType\n\n if (event) {\n newValue = event.newValue\n }\n\n const _saveRelation = async (): Promise<boolean> => {\n // Use dynamic import to break circular dependency\n const schemaMod = await import('../../../../Schema')\n const { ModelPropertyDataTypes } = schemaMod\n \n let refResolvedDisplayValue\n let refSeedType\n if (!propertyNameRaw) {\n throw new Error('propertyName is required')\n }\n let propertyName = propertyNameRaw\n let versionLocalIdToSave = versionLocalId\n\n const refResolvedValue = newValue\n\n if (!propertyName.endsWith('Id')) {\n propertyName = `${propertyName}Id`\n }\n\n let newValueType\n\n if (typeof newValue === 'string') {\n newValueType = getDataTypeFromString(newValue)\n }\n\n if (newValue instanceof File) {\n newValueType = 'file'\n }\n\n if (propertyRecordSchema.dataType === ModelPropertyDataTypes.Image) {\n sendBack({\n type: 'saveImage',\n newValue,\n newValueType,\n })\n return false\n }\n\n return true\n\n // let fileType\n //\n // const dirs = await fs.promises.readdir('/files')\n //\n // for (const dir of dirs) {\n // const files = await fs.promises.readdir(`/files/${dir}`)\n // if (newValue && files.includes(newValue as string)) {\n // fileType = dir\n // break\n // }\n // }\n //\n // if (newValue && fileType === 'images') {\n // const filePath = `/files/images/${newValue}`\n // refResolvedDisplayValue = await getContentUrlFromPath(filePath)\n // refSeedType = 'image'\n // newValue = await createSeed({\n // type: refSeedType,\n // })\n // await createVersion({\n // seedLocalId,\n // seedUid,\n // seedType: refSeedType,\n // })\n // }\n //\n // await updateItemPropertyValue({\n // propertyLocalId: localId,\n // propertyName,\n // newValue,\n // seedLocalId,\n // refSeedType,\n // refResolvedValue,\n // refResolvedDisplayValue,\n // versionLocalId,\n // modelName: itemModelName,\n // schemaUid,\n // })\n }\n\n _saveRelation().then((isDone) => {\n if (isDone) {\n sendBack({ type: 'saveRelationSuccess' })\n }\n })\n})\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { metadata, MetadataType } from '@/seedSchema'\nimport { and, eq, getTableColumns } from 'drizzle-orm'\n\ntype GetItemPropertyProps = Partial<MetadataType>\n\ntype GetItemPropertyData = (\n props: GetItemPropertyProps,\n) => Promise<Partial<MetadataType>>\n\nexport const getItemPropertyData: GetItemPropertyData = async (props) => {\n const appDb = BaseDb.getAppDb()\n\n const whereClauses = []\n\n const tableColumns = getTableColumns(metadata)\n\n for (const [propertyName, propertyValue] of Object.entries(props)) {\n if (Object.keys(tableColumns).includes(propertyName)) {\n whereClauses.push(eq((tableColumns as any)[propertyName], propertyValue))\n }\n }\n\n const queryRows = await appDb\n .select()\n .from(metadata)\n .where(and(...whereClauses))\n\n if (!queryRows || queryRows.length === 0) {\n return\n }\n\n return queryRows[0]\n}\n","import { EventObject, fromCallback } from 'xstate'\nimport { FromCallbackInput } from '@/types/machines'\nimport {\n ItemPropertyValueType,\n PropertyMachineContext,\n SaveValueToDbEvent,\n} from '@/types/property'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { getItemPropertyData } from '@/db/read/getItemProperty'\nimport { getItemData } from '@/db/read/getItemData'\nimport { and, eq } from 'drizzle-orm'\nimport { metadata } from '@/seedSchema'\nimport { createMetadata } from '@/db/write/createMetadata'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\n\nexport const saveItemStorage = fromCallback<\n EventObject,\n FromCallbackInput<PropertyMachineContext, SaveValueToDbEvent>\n>(({ sendBack, input: { context, event } }) => {\n const {\n localId,\n seedLocalId,\n seedUid,\n propertyName,\n propertyRecordSchema,\n modelName,\n propertyValue: existingValue,\n } = context\n\n if (!propertyRecordSchema) {\n throw new Error('Missing propertyRecordSchema')\n }\n\n let newValue: ItemPropertyValueType\n\n if (event) {\n newValue = event.newValue\n }\n\n if (existingValue === newValue) {\n sendBack({ type: 'saveValueToDbSuccess' })\n return\n }\n\n const _saveItemStorage = async (): Promise<boolean> => {\n // Save value to file\n const appDb = BaseDb.getAppDb()\n let propertyData\n\n if (localId) {\n propertyData = await getItemPropertyData({\n localId,\n })\n }\n\n if (!localId && seedLocalId) {\n const itemData = await getItemData({\n seedLocalId,\n })\n if (itemData) {\n if (!propertyName) {\n throw new Error('propertyName is required')\n }\n const whereClauses = [\n eq(metadata.propertyName, propertyName),\n eq(metadata.seedLocalId, seedLocalId),\n ]\n\n if (itemData.latestVersionLocalId) {\n whereClauses.push(\n eq(metadata.versionLocalId, itemData.latestVersionLocalId),\n )\n }\n\n const queryRows = await appDb\n .select()\n .from(metadata)\n .where(and(...whereClauses))\n\n if (queryRows && queryRows.length) {\n propertyData = queryRows[0]\n }\n\n if (!propertyData && newValue) {\n\n const filename = `${seedUid || seedLocalId}${propertyRecordSchema.filenameSuffix}`\n const writeToPath = `/files/${propertyRecordSchema.localStorageDir}/${filename}`\n await BaseFileManager.saveFile(writeToPath, newValue as string | Blob | ArrayBuffer)\n\n const propertyDataRow = await createMetadata(\n {\n propertyName,\n propertyValue: filename,\n modelType: modelName.toLowerCase(),\n seedLocalId,\n seedUid,\n versionLocalId: itemData.latestVersionLocalId,\n versionUid: itemData.latestVersionUid,\n localStorageDir: propertyRecordSchema.localStorageDir,\n refValueType: 'file',\n },\n propertyRecordSchema,\n )\n\n if (propertyDataRow) {\n propertyData = propertyDataRow\n }\n }\n\n // propertyData = {\n // propertyName,\n // seedLocalId,\n // seedUid,\n // versionLocalId: itemData.latestVersionLocalId,\n // versionUid: itemData.latestVersionUid,\n // schemaUid: itemData.schemaUid,\n // }\n }\n }\n\n const localStorageDir =\n propertyRecordSchema.localStorageDir || propertyData.localStorageDir\n const fileName =\n propertyData.refResolvedValue ||\n `${propertyData.seedUid || propertyData.seedLocalId}${propertyRecordSchema.filenameSuffix}`\n\n if (!localStorageDir || !fileName) {\n throw new Error(\n `Missing localStorageDir: ${localStorageDir} or fileName: ${fileName}`,\n )\n }\n\n const filePath = `/files/${localStorageDir}/${fileName}`\n try {\n await BaseFileManager.saveFile(filePath, newValue as string | Blob | ArrayBuffer)\n } catch (error) {\n const fs = await BaseFileManager.getFs()\n fs.writeFileSync(filePath, newValue)\n }\n\n await appDb\n .update(metadata)\n .set({\n refResolvedValue: fileName,\n })\n .where(eq(metadata.localId, propertyData.localId))\n\n sendBack({\n type: 'updateContext',\n renderValue: newValue,\n })\n\n return true\n }\n\n _saveItemStorage().then((success) => {\n if (success) {\n sendBack({ type: 'saveItemStorageSuccess' })\n }\n })\n})\n","import { assign, setup } from 'xstate'\nimport { PropertyMachineContext, SaveValueToDbEvent } from '@/types'\n\nimport { resolveRemoteStorage } from '@/ItemProperty/service/actors/resolveRemoteStorage'\nimport { waitForDb } from '@/ItemProperty/service/actors/waitForDb'\nimport { initialize } from '@/ItemProperty/service/actors/initialize'\nimport { resolveRelatedValue } from '@/ItemProperty/service/actors/resolveRelatedValue'\nimport { hydrateFromDb } from '@/ItemProperty/service/actors/hydrateFromDb'\nimport { loadOrCreateProperty } from '@/ItemProperty/service/actors/loadOrCreateProperty'\nimport {\n saveImage,\n saveItemStorage,\n saveRelation,\n} from '@/ItemProperty/service/actors/saveValueToDb'\nimport { analyzeInput } from '@/ItemProperty/service/actors/saveValueToDb/analyzeInput' // import { updateMachineContext } from '@/helpers'\n// import { updateMachineContext } from '@/helpers'\n\nexport const propertyMachine = setup({\n types: {\n context: {} as PropertyMachineContext,\n input: {} as PropertyMachineContext,\n },\n // actions: {\n // updateContext: updateMachineContext,\n // },\n actors: {\n waitForDb,\n loadOrCreateProperty,\n hydrateFromDb,\n initialize,\n resolveRelatedValue,\n resolveRemoteStorage,\n analyzeInput,\n saveImage,\n saveRelation,\n saveItemStorage,\n },\n}).createMachine({\n id: 'itemProperty',\n initial: 'waitingForDb',\n context: ({ input }) => input as PropertyMachineContext,\n on: {\n // reload: '.hydratingFromDb',\n save: {\n actions: assign({\n isSaving: true,\n }),\n target: '.saving',\n },\n updateContext: {\n actions: assign(({ context, event }) => {\n const newContext = Object.assign({}, context) as any\n\n for (let i = 0; i < Object.keys(event).length; i++) {\n const key = Object.keys(event)[i]\n if (key === 'type') {\n continue\n }\n newContext[key] = (event as any)[key]\n }\n return newContext\n }),\n },\n destroyStarted: {\n actions: assign({ _destroyInProgress: true, _destroyError: null }),\n },\n destroyDone: {\n actions: assign({ _destroyInProgress: false }),\n },\n destroyError: {\n actions: assign(({ event }) => ({\n _destroyInProgress: false,\n _destroyError:\n (event as { type: 'destroyError'; error: unknown }).error instanceof Error\n ? {\n message: (event as { type: 'destroyError'; error: Error }).error.message,\n name: (event as { type: 'destroyError'; error: Error }).error.name,\n }\n : { message: String((event as { type: 'destroyError'; error: unknown }).error) },\n })),\n },\n clearDestroyError: {\n actions: assign({ _destroyError: null }),\n },\n },\n states: {\n idle: {},\n waitingForDb: {\n on: {\n waitForDbSuccess: {\n target: 'loading',\n actions: assign({\n isDbReady: true,\n }),\n },\n waitForDbError: {\n target: 'error',\n },\n },\n invoke: {\n src: 'waitForDb',\n input: ({ context }) => ({ context }),\n },\n },\n loading: {\n on: {\n loadOrCreatePropertySuccess: {\n target: 'idle',\n actions: assign(({ context, event }) => {\n const property = (event as any).property\n return {\n ...context,\n propertyName: property.propertyName || context.propertyName,\n propertyValue: property.propertyValue !== undefined ? property.propertyValue : context.propertyValue,\n renderValue: property.renderValue !== undefined ? property.renderValue : context.renderValue,\n seedLocalId: property.seedLocalId || context.seedLocalId,\n seedUid: property.seedUid || context.seedUid,\n versionLocalId: property.versionLocalId || context.versionLocalId,\n versionUid: property.versionUid || context.versionUid,\n schemaUid: property.schemaUid || context.schemaUid,\n localId: property.localId || context.localId,\n uid: property.uid || context.uid,\n modelName: property.modelName || context.modelName,\n propertyRecordSchema: property.propertyRecordSchema || context.propertyRecordSchema,\n }\n }),\n },\n loadOrCreatePropertyError: {\n target: 'error',\n },\n },\n invoke: {\n src: 'loadOrCreateProperty',\n input: ({ context }) => ({ context }),\n },\n },\n error: {},\n hydratingFromDb: {\n on: {\n hydrateFromDbSuccess: 'initializing',\n },\n invoke: {\n src: 'hydrateFromDb',\n input: ({ context }) => ({ context }),\n },\n },\n initializing: {\n on: {\n initializeSuccess: 'idle',\n isRelatedProperty: {\n target: 'resolvingRelatedValue',\n },\n hasRemoteBackup: {\n target: 'resolvingRemoteStorage',\n },\n },\n invoke: {\n src: 'initialize',\n input: ({ context, event }) => ({ context, event }),\n },\n },\n resolvingRelatedValue: {\n on: {\n resolvingRelatedValueSuccess: {\n target: 'idle',\n actions: assign({\n refResolvedDisplayValue: ({ event }) =>\n event.refResolvedDisplayValue,\n refResolvedValue: ({ event }) => event.refResolvedValue,\n }),\n },\n resolvingRelatedValueDone: {\n target: 'idle',\n },\n },\n invoke: {\n src: 'resolveRelatedValue',\n input: ({ context }) => ({ context }),\n },\n },\n resolvingRemoteStorage: {\n on: {\n resolveRemoteStorageSuccess: {\n target: 'idle',\n },\n },\n invoke: {\n src: 'resolveRemoteStorage',\n input: ({ context }) => ({ context }),\n },\n },\n saving: {\n initial: 'analyzingInput',\n states: {\n analyzingInput: {\n on: {\n saveValueToDbSuccess: {\n target: 'doneSaving',\n },\n saveImage: 'savingImage',\n saveRelation: 'savingRelation',\n saveItemStorage: 'savingItemStorage',\n },\n invoke: {\n src: 'analyzeInput',\n input: ({ context, event }) => {\n // Type assertion needed because event is AnyEventObject but actor expects SaveValueToDbEvent\n return { context, event: event as SaveValueToDbEvent }\n },\n },\n },\n savingImage: {\n on: {\n saveImageSuccess: 'doneSaving',\n },\n invoke: {\n src: 'saveImage',\n input: ({ context, event }) => {\n // Type assertion needed because event is AnyEventObject but actor expects SaveValueToDbEvent\n return { context, event: event as SaveValueToDbEvent }\n },\n },\n },\n savingRelation: {\n on: {\n saveRelationSuccess: 'doneSaving',\n },\n invoke: {\n src: 'saveRelation',\n input: ({ context, event }) => {\n // Type assertion needed because event is AnyEventObject but actor expects SaveValueToDbEvent\n return { context, event: event as SaveValueToDbEvent }\n },\n },\n },\n savingItemStorage: {\n on: {\n saveItemStorageSuccess: 'doneSaving',\n },\n invoke: {\n src: 'saveItemStorage',\n input: ({ context, event }) => {\n // Type assertion needed because event is AnyEventObject but actor expects SaveValueToDbEvent\n return { context, event: event as SaveValueToDbEvent }\n },\n },\n },\n doneSaving: {\n type: 'final',\n },\n },\n onDone: {\n target: 'idle',\n actions: assign(({ context }) => {\n return {\n isSaving: false,\n }\n }),\n },\n },\n },\n\n // conflict: {\n // on: {\n // resolveConflict: {\n // target: 'saving',\n // actions: assign({\n // data: ({ context, event }) => event.output,\n // }),\n // },\n // },\n // },\n})\n","import { PropertyData } from \"@/types\"\nimport { BaseDb } from \"@/db/Db/BaseDb\"\nimport { metadata, MetadataType } from \"@/seedSchema\"\nimport { or, eq, and, sql } from \"drizzle-orm\"\nimport { startCase } from \"lodash-es\"\nimport { GetPropertyDataOptions } from \"@/types/db\"\n\n\nexport const getPropertyData = async ({\n propertyName,\n seedLocalId,\n seedUid,\n}: GetPropertyDataOptions): Promise<PropertyData | undefined> => {\n const appDb = BaseDb.getAppDb()\n\n const whereClauses: any[] = [\n or(\n eq(metadata.propertyName, propertyName),\n eq(metadata.propertyName, propertyName + 'Id'),\n eq(metadata.propertyName, propertyName + 'Ids'),\n ),\n ]\n\n if (seedLocalId) {\n whereClauses.push(eq(metadata.seedLocalId, seedLocalId))\n }\n\n if (seedUid) {\n whereClauses.push(eq(metadata.seedUid, seedUid))\n }\n\n const rows = (await appDb\n .select()\n .from(metadata)\n .where(and(...whereClauses))\n .orderBy(\n sql.raw(`COALESCE(attestation_created_at, created_at) DESC`),\n )) as MetadataType[]\n\n if (!rows || rows.length === 0) {\n return\n }\n\n const row = rows[0]\n\n return row as PropertyData\n} ","import { CacheEntry } from './entityCache'\n\n/**\n * Configuration for entity unload operations\n */\nexport interface UnloadConfig<T extends object> {\n /**\n * Get cache key(s) for this instance\n * Returns array of cache keys that should be removed/updated\n */\n getCacheKeys: (instance: T) => string[]\n /**\n * Static cache(s) to update\n * Multiple caches can be provided (e.g., ID cache and name cache)\n */\n caches: Map<string, CacheEntry<T>>[]\n /**\n * Optional secondary caches (name → id mappings)\n * These will be cleaned up if the primary cache entry is removed\n */\n secondaryCaches?: Map<string, string>[]\n /**\n * Instance state WeakMap\n * Used to clean up liveQuery subscriptions\n */\n instanceState: WeakMap<T, { liveQuerySubscription?: { unsubscribe: () => void } | null }>\n /**\n * Get service from instance\n * Service will be stopped during unload\n */\n getService: (instance: T) => { stop: () => void }\n /**\n * Optional: Additional cleanup logic\n * Called after subscriptions are cleaned up but before service is stopped\n */\n onUnload?: (instance: T) => void\n}\n\n/**\n * Unload an entity instance and clean up all resources\n * \n * @param instance - Entity instance to unload\n * @param config - Unload configuration\n */\nexport function unloadEntity<T extends object>(instance: T, config: UnloadConfig<T>): void {\n // Clean up liveQuery subscription\n const instanceState = config.instanceState.get(instance)\n if (instanceState?.liveQuerySubscription) {\n try {\n instanceState.liveQuerySubscription.unsubscribe()\n instanceState.liveQuerySubscription = null\n } catch (error) {\n // Ignore errors during cleanup\n }\n }\n \n // Get cache keys for this instance\n const cacheKeys = config.getCacheKeys(instance)\n \n // Remove from all caches (decrement refCount, delete if 0)\n for (const cache of config.caches) {\n for (const key of cacheKeys) {\n const entry = cache.get(key)\n if (entry) {\n entry.refCount -= 1\n if (entry.refCount <= 0) {\n cache.delete(key)\n \n // Also remove from secondary caches if provided\n if (config.secondaryCaches) {\n for (const secondaryCache of config.secondaryCaches) {\n secondaryCache.delete(key)\n }\n }\n } else {\n cache.set(key, entry)\n }\n }\n }\n }\n \n // Call additional cleanup if provided\n if (config.onUnload) {\n try {\n config.onUnload(instance)\n } catch (error) {\n // Ignore errors during cleanup\n }\n }\n \n // Stop the service\n try {\n const service = config.getService(instance)\n service.stop()\n } catch (error) {\n // Ignore errors if service is already stopped\n }\n}\n","/**\n * Shared helpers for entity destroy operations.\n * Used by Schema, Model, ModelProperty, Item, and ItemProperty destroy() methods.\n */\n\nexport interface ClearDestroySubscriptionsConfig<T extends object> {\n instanceState: WeakMap<T, { liveQuerySubscription?: { unsubscribe: () => void } | null }>\n onUnload?: (instance: T) => void\n}\n\n/**\n * Unsubscribe liveQuery and any extra subscription (e.g. Item/ItemProperty _subscription).\n * Swallows errors so one failure doesn't block the rest.\n */\nexport function clearDestroySubscriptions<T extends object>(\n instance: T,\n config: ClearDestroySubscriptionsConfig<T>,\n): void {\n const instanceState = config.instanceState.get(instance)\n if (instanceState?.liveQuerySubscription) {\n try {\n instanceState.liveQuerySubscription.unsubscribe()\n instanceState.liveQuerySubscription = null\n } catch {\n // Ignore errors during cleanup\n }\n }\n if (config.onUnload) {\n try {\n config.onUnload(instance)\n } catch {\n // Ignore errors during cleanup\n }\n }\n}\n\nexport interface ForceRemoveFromCachesConfig<T extends object> {\n getCacheKeys: (instance: T) => string[]\n caches: Map<string, unknown>[]\n secondaryCaches?: Map<string, unknown>[]\n}\n\n/**\n * Remove the instance from all given caches by key, without refCount (always delete).\n * Works for both entry caches and index caches since the operation is only delete(key).\n */\nexport function forceRemoveFromCaches<T extends object>(\n instance: T,\n config: ForceRemoveFromCachesConfig<T>,\n): void {\n const cacheKeys = config.getCacheKeys(instance)\n for (const cache of config.caches) {\n for (const key of cacheKeys) {\n cache.delete(key)\n }\n }\n if (config.secondaryCaches) {\n for (const secondaryCache of config.secondaryCaches) {\n for (const key of cacheKeys) {\n secondaryCache.delete(key)\n }\n }\n }\n}\n\nexport interface RunDestroyLifecycleConfig<T extends object> {\n getService: (instance: T) => { send: (ev: unknown) => void; stop: () => void }\n doDestroy: () => Promise<void>\n}\n\n/**\n * Run the service event sequence and stop the service:\n * destroyStarted -> doDestroy -> destroyDone/destroyError -> stop.\n * Event names must match what the entity machines expect.\n */\nexport async function runDestroyLifecycle<T extends object>(\n instance: T,\n config: RunDestroyLifecycleConfig<T>,\n): Promise<void> {\n const service = config.getService(instance)\n service.send({ type: 'destroyStarted' } as { type: string; error?: unknown })\n try {\n await config.doDestroy()\n } catch (error) {\n service.send({ type: 'destroyError', error } as { type: string; error?: unknown })\n } finally {\n service.send({ type: 'destroyDone' } as { type: string; error?: unknown })\n try {\n service.stop()\n } catch {\n // Service might already be stopped\n }\n }\n}\n","/**\n * Configuration for creating a reactive proxy\n */\ninterface ProxyConfig<T> {\n /** The instance to wrap in a proxy */\n instance: T\n /** The actor service that manages state */\n service: any\n /** Array of property names that should be tracked (read from/written to actor context) */\n trackedProperties: readonly string[]\n /** Function to get the current context from the actor */\n getContext: (instance: T) => any\n /** Function to send an update to the actor when a property is set */\n sendUpdate: (instance: T, prop: string, value: any) => void\n}\n\n/**\n * Type helper that explicitly preserves all methods and properties when wrapping in a Proxy.\n * \n * TypeScript's Proxy type doesn't automatically preserve method signatures, so we need\n * to use this helper type to ensure all methods are recognized by TypeScript.\n * \n * This type uses a mapped type to explicitly preserve all properties and methods from T.\n */\nexport type Proxied<T> = {\n [K in keyof T]: T[K]\n} & T\n\n/**\n * Creates a reactive Proxy that intercepts property access and assignment\n * to read from and write to an actor service's context.\n * \n * This enables automatic React re-renders when properties change, as the\n * React hooks subscribe to the actor service which gets updated when properties\n * are set via the proxy.\n * \n * @param config Configuration object\n * @returns A proxied instance that behaves like the original but with reactive properties\n * \n * @note TypeScript's Proxy type doesn't automatically preserve method signatures,\n * so we use Proxied<T> to ensure all methods and properties are recognized.\n * The Proxy implementation preserves all methods via Reflect.get, so this is safe.\n */\nexport function createReactiveProxy<T extends object>(config: ProxyConfig<T>): Proxied<T> {\n const { instance, trackedProperties, getContext, sendUpdate } = config\n \n // Convert readonly array to regular array for includes() checks\n const trackedPropsSet = new Set(trackedProperties)\n \n // Create the proxy - TypeScript needs explicit type assertion to preserve all methods\n // The Proxy preserves all methods via Reflect.get, so we assert it maintains type T\n // Using 'as unknown as T' forces TypeScript to recognize all methods and properties\n const proxy = new Proxy(instance, {\n get(target, prop: string | symbol) {\n // Handle special properties that should not be proxied\n // These need direct access to the underlying instance\n if (prop === '_service') {\n return Reflect.get(target, prop)\n }\n \n // If it's a tracked property, read from actor context\n if (typeof prop === 'string' && trackedPropsSet.has(prop)) {\n const context = getContext(instance)\n return context[prop]\n }\n \n // For methods and non-tracked properties, use Reflect\n return Reflect.get(target, prop)\n },\n \n set(target, prop: string | symbol, value: any) {\n // Handle special properties\n if (prop === '_service') {\n return Reflect.set(target, prop, value)\n }\n \n // If it's a tracked property, send update to actor\n if (typeof prop === 'string' && trackedPropsSet.has(prop)) {\n sendUpdate(instance, prop, value)\n return true // Indicate success\n }\n \n // For non-tracked properties, use Reflect. Also trigger sendUpdate for virtual\n // 'value' so the callback runs when .value is assigned (e.g. ItemProperty).\n if (typeof prop === 'string' && prop === 'value') {\n sendUpdate(instance, prop, value)\n }\n return Reflect.set(target, prop, value)\n },\n \n has(target, prop: string | symbol) {\n // Check if property exists in context or on target\n if (typeof prop === 'string' && trackedPropsSet.has(prop)) {\n const context = getContext(instance)\n return prop in context\n }\n return Reflect.has(target, prop)\n },\n \n ownKeys(target) {\n // Only return keys that actually exist on the target object\n // This is required when the target is non-extensible (e.g., frozen by Immer)\n // Tracked properties are virtual (read from context), so we don't include them here\n // They're accessible via the get trap, but don't appear in ownKeys\n return Reflect.ownKeys(target)\n },\n \n getOwnPropertyDescriptor(target, prop: string | symbol) {\n if (typeof prop === 'string' && trackedPropsSet.has(prop)) {\n const context = getContext(instance)\n if (prop in context) {\n return {\n enumerable: true,\n configurable: true,\n value: context[prop],\n writable: true,\n }\n }\n }\n return Reflect.getOwnPropertyDescriptor(target, prop)\n }\n })\n \n // Force TypeScript to recognize all methods and properties are preserved\n // The Proxy implementation preserves all methods via Reflect.get, so this is safe\n return proxy as unknown as Proxied<T>\n}\n\n","import { ActorRefFrom, createActor, SnapshotFrom, Subscription, waitFor } from 'xstate'\nimport { BehaviorSubject, Subscriber } from 'rxjs'\nimport { Static } from '@sinclair/typebox'\nimport { IItemProperty } from '@/interfaces/IItemProperty'\nimport { CreatePropertyInstanceProps, PropertyMachineContext, PropertyType } from '@/types'\nimport type { CreateWaitOptions } from '@/types'\n// Dynamic import to break circular dependency: Model -> Item -> ItemProperty -> Model\n// import { Model } from '@/Model/Model'\nimport { propertyMachine } from './service/propertyMachine'\nimport { INTERNAL_PROPERTY_NAMES } from '@/helpers/constants'\nimport debug from 'debug'\nimport pluralize from 'pluralize'\nimport { camelCase, startCase, upperFirst } from 'lodash-es'\nimport { getPropertyData } from '@/db/read/getPropertyData'\nimport { getItemProperties } from '@/db/read/getItemProperties'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { BaseFileManager, getCorrectId } from '@/helpers'\nimport { waitForEntityIdle } from '@/helpers/waitForEntityIdle'\nimport { findEntity } from '@/helpers/entity/entityFind'\nimport { setupEntityLiveQuery } from '@/helpers/entity/entityLiveQuery'\nimport { unloadEntity } from '@/helpers/entity/entityUnload'\nimport {\n clearDestroySubscriptions,\n forceRemoveFromCaches,\n runDestroyLifecycle,\n} from '@/helpers/entity/entityDestroy'\nimport { eventEmitter } from '@/eventBus'\n// Dynamic import to break circular dependency: schema/index -> ... -> ItemProperty -> schema/index\n// Note: TProperty is used as a type, so we can import it separately. ModelPropertyDataTypes is used at runtime.\nimport type { TProperty } from '@/Schema'\nimport { createReactiveProxy } from '@/helpers/reactiveProxy'\n\n// Lazy import helper to break circular dependency for synchronous Model access\n// Since Model.getByName() is synchronous and Model imports ItemProperty (via Item),\n// Model is already initialized when ItemProperty constructor runs\nlet ModelClass: typeof import('@/Model/Model').Model | null = null\nlet modelImportPromise: Promise<typeof import('@/Model/Model')> | null = null\n\n// Start loading Model at module load time (non-blocking)\nmodelImportPromise = import('@/Model/Model').then(module => {\n ModelClass = module.Model\n return module\n}).catch(() => {\n // If import fails, ModelClass remains null\n // Return a default module structure to maintain type consistency\n return {} as typeof import('@/Model/Model')\n})\n\nconst getModel = (): typeof import('@/Model/Model').Model => {\n if (!ModelClass) {\n // Model should already be loaded because Model imports Item, which imports ItemProperty\n // If it's not loaded, this indicates a timing issue\n throw new Error('Model class not available. This may indicate a circular dependency or timing issue.')\n }\n return ModelClass\n}\n\n/**\n * Resolve propertyRecordSchema from in-memory Model (Fix 6: enables value persistence when useItemProperty path doesn't go through loadOrCreateItem).\n * Tries getByName(pascalCase) first; if that fails (e.g. \"New model\" vs \"NewModel\"), falls back to findByModelType(modelType).\n */\nconst resolvePropertyRecordSchemaFromModel = async (\n modelName: string,\n propertyName: string,\n modelType?: string\n): Promise<PropertyType | undefined> => {\n if (!modelName && !modelType) return undefined\n try {\n const { Model } = await import('@/Model/Model')\n const { modelPropertiesToObject } = await import('@/helpers/model')\n let model = modelName ? Model.getByName(modelName) : undefined\n if (!model?.properties?.length && modelType) {\n model = Model.findByModelType(modelType)\n }\n if (!model?.properties?.length) return undefined\n const schemas = modelPropertiesToObject(model.properties)\n const schema = schemas[propertyName]\n return schema as PropertyType | undefined\n } catch {\n return undefined\n }\n}\n\n/** Convert modelType (snake_case from DB) to Model name (PascalCase). startCase adds spaces (\"Test Post\"); Model names are \"TestPost\". */\nconst modelTypeToModelName = (modelType: string): string =>\n modelType ? upperFirst(camelCase(modelType)) : ''\n\nconst logger = debug('seedSdk:property:class')\n\ntype ItemPropertyService = ActorRefFrom<typeof propertyMachine>\ntype ItemPropertySnapshot = SnapshotFrom<typeof propertyMachine>\n\n// Define tracked properties for the Proxy\n// These properties will be read from/written to the actor context\nconst TRACKED_PROPERTIES = [\n 'propertyName',\n 'propertyValue',\n 'renderValue',\n 'seedLocalId',\n 'seedUid',\n 'modelName',\n 'dataType',\n 'refResolvedValue',\n 'versionLocalId',\n 'versionUid',\n 'schemaUid',\n 'localId',\n 'uid',\n] as const\n\n// WeakMap to store mutable state per ItemProperty instance\n// This avoids issues with read-only properties when instances are frozen by Immer\nconst itemPropertyInstanceState = new WeakMap<ItemProperty<any>, {\n liveQuerySubscription: { unsubscribe: () => void } | null // LiveQuery subscription for cross-instance updates\n}>()\n\ntype ItemPropertyFindProps = {\n propertyName: string\n propertyLocalId?: string\n seedLocalId?: string\n seedUid?: string\n /** When metadata has no modelType, callers (e.g. Item) can pass modelName so ItemProperty.create can succeed */\n modelName?: string\n}\n\nexport class ItemProperty<PropertyType> implements IItemProperty<PropertyType> {\n protected static instanceCache: Map<\n string,\n { instance: ItemProperty<any>; refCount: number }\n > = new Map()\n protected readonly _service: ItemPropertyService\n protected _subject: BehaviorSubject<any>\n protected readonly _isRelation: boolean = false\n protected readonly _isList: boolean = false\n protected readonly _alias: string | undefined\n protected _subscription: Subscription\n protected _dataType: string | undefined\n protected _schemaUid: string | undefined\n\n constructor(initialValues: Partial<CreatePropertyInstanceProps>) {\n const { modelName, propertyName, propertyValue, seedLocalId, seedUid, versionLocalId, versionUid, storageTransactionId, schemaUid } = initialValues\n\n if (!modelName) {\n throw new Error('Model name is required')\n }\n\n if (!propertyName) {\n throw new Error(`Property name not provided`)\n }\n\n // ItemProperty no longer depends on Model - property schema will be loaded from database\n // via loadOrCreateProperty actor or can be provided in initialValues\n const serviceInput: Partial<PropertyMachineContext> = {\n propertyValue,\n propertyName,\n seedLocalId,\n seedUid,\n versionLocalId,\n versionUid,\n modelName,\n storageTransactionId,\n // propertyRecordSchema will be loaded from database via loadOrCreateProperty actor\n // or can be provided in initialValues if available\n propertyRecordSchema: initialValues.propertyRecordSchema,\n schemaUid,\n isSaving: false,\n isRelation: false,\n isDbReady: false,\n }\n\n\n\n // Property schema will be loaded from database via loadOrCreateProperty actor\n // For now, use propertyRecordSchema from initialValues if provided\n const propertyRecordSchema = initialValues.propertyRecordSchema\n if (propertyRecordSchema) {\n this._dataType = propertyRecordSchema.dataType\n\n serviceInput.propertyRecordSchema = propertyRecordSchema\n\n // Use string literals to avoid circular dependency in constructor\n // ModelPropertyDataTypes values are stable string constants\n if (propertyRecordSchema.dataType === 'Relation') {\n this._isRelation = true\n }\n\n if (\n propertyRecordSchema.dataType === 'List' &&\n propertyRecordSchema.ref\n ) {\n this._isList = true\n this._isRelation = true\n\n if (propertyValue) {\n try {\n serviceInput.propertyValue = JSON.parse(propertyValue)\n } catch (e) {\n logger('List property value is not JSON', e)\n }\n }\n\n const propertyNameSingular = pluralize(propertyName!, 1)\n\n this._alias = propertyName\n\n serviceInput.propertyName = `${propertyNameSingular}${propertyRecordSchema.ref}Ids`\n }\n\n if (!this._alias && propertyName.endsWith('Id')) {\n this._alias = propertyName.slice(0, -2)\n } else if (!this._alias && propertyName.endsWith('Ids')) {\n this._alias = pluralize(propertyName.slice(0, -3))\n }\n }\n\n serviceInput.isRelation = this._isRelation\n\n this._subject = new BehaviorSubject(propertyValue)\n this._service = createActor(propertyMachine, {\n input: serviceInput as PropertyMachineContext,\n })\n\n this._subscription = this._service.subscribe(\n async (snapshot: ItemPropertySnapshot) => {\n if (!snapshot || !snapshot.context) {\n return\n }\n\n // Use dynamic import to break circular dependency\n const schemaMod = await import('../Schema')\n const { ModelPropertyDataTypes } = schemaMod\n\n const { context } = snapshot\n const { propertyRecordSchema } = context\n\n if (context.seedLocalId && context.propertyName) {\n const cacheKey = ItemProperty.cacheKey(\n context.seedLocalId,\n context.propertyName,\n )\n if (!ItemProperty.instanceCache.has(cacheKey)) {\n ItemProperty.instanceCache.set(cacheKey, {\n instance: this,\n refCount: 1,\n })\n }\n }\n\n let renderValue\n\n const isImage =\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.Image\n\n const isFile =\n propertyRecordSchema &&\n propertyRecordSchema.dataType === ModelPropertyDataTypes.File\n\n const isItemStorage = \n propertyRecordSchema &&\n propertyRecordSchema.storageType &&\n propertyRecordSchema.storageType === 'ItemStorage' &&\n context.refResolvedValue &&\n context.localStorageDir\n\n if (!this._schemaUid && context.schemaUid) {\n this._schemaUid = context.schemaUid\n }\n\n if (\n isImage ||\n isFile ||\n isItemStorage\n ) {\n const filePath = `/files/${context.localStorageDir}/${context.refResolvedValue}`\n try {\n const exists = await BaseFileManager.pathExists(filePath)\n if (exists && isItemStorage) {\n renderValue = await BaseFileManager.readFileAsString(filePath,)\n }\n if (exists && isImage) {\n if (context.refResolvedDisplayValue) {\n renderValue = context.refResolvedDisplayValue\n } \n if (!context.refResolvedDisplayValue) {\n renderValue = await BaseFileManager.getContentUrlFromPath(filePath)\n }\n }\n if (exists && isFile) {\n renderValue = await BaseFileManager.readFileAsString(filePath,)\n }\n if (!exists) {\n renderValue = 'No file found'\n }\n } catch (e) {\n logger(\n `[ItemProperty] [${context.seedLocalId}] [${context.propertyName}] [storageType] error`,\n e,\n )\n renderValue = 'No file found'\n }\n }\n\n if (!renderValue) {\n renderValue = context.renderValue || context.propertyValue\n }\n\n let transformedPropertyName = propertyName\n\n const skipTransform =\n INTERNAL_PROPERTY_NAMES.includes(propertyName) || !!this._alias\n\n if (!skipTransform && transformedPropertyName.endsWith('Id')) {\n transformedPropertyName = transformedPropertyName.slice(0, -2)\n }\n\n if (!skipTransform && transformedPropertyName.endsWith('Ids')) {\n transformedPropertyName = transformedPropertyName.slice(0, -3)\n }\n\n if (skipTransform && this._alias) {\n transformedPropertyName = this._alias\n }\n\n if (skipTransform && !this._alias) {\n }\n\n // Update context with renderValue instead of BehaviorSubject\n // The reactive proxy will handle reactivity\n const currentRenderValue = context.renderValue || context.propertyValue\n if (currentRenderValue === renderValue) {\n return\n }\n\n // Update context with new renderValue\n this._service.send({\n type: 'updateContext',\n renderValue,\n })\n },\n )\n\n this._service.start()\n\n // Initialize instance state in WeakMap\n itemPropertyInstanceState.set(this, {\n liveQuerySubscription: null,\n })\n \n // Set up liveQuery subscription for cross-instance updates\n this._setupLiveQuerySubscription()\n }\n\n /**\n * Set up liveQuery subscription to watch for metadata changes in the database\n * This enables cross-instance synchronization (e.g., changes in other tabs/windows)\n */\n private _setupLiveQuerySubscription(): void {\n const isBrowser = typeof window !== 'undefined'\n const logger = debug('seedSdk:itemProperty:liveQuery')\n \n // Use a closure variable to track setup state per instance\n const setupState = { subscriptionSetUp: false }\n\n const setupLiveQuery = async (seedLocalId: string, seedUid: string | undefined, propertyName: string, versionLocalId: string | undefined) => {\n if (setupState.subscriptionSetUp) {\n return\n }\n\n if (!seedLocalId && !seedUid) {\n logger('[ItemProperty._setupLiveQuerySubscription] No seedLocalId or seedUid')\n return\n }\n\n if (!propertyName) {\n logger('[ItemProperty._setupLiveQuerySubscription] No propertyName')\n return\n }\n\n setupState.subscriptionSetUp = true\n logger(`[ItemProperty._setupLiveQuerySubscription] Setting up liveQuery for propertyName: ${propertyName}, seedLocalId: ${seedLocalId}`)\n \n try {\n const seedSchemaMod = await import('../seedSchema')\n const { metadata } = seedSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, and, isNotNull } = drizzleMod\n const metadataLatestMod = await import('../db/read/subqueries/metadataLatest')\n const { getMetadataLatest } = metadataLatestMod\n \n const db = BaseDb.getAppDb()\n if (!db) {\n logger('[ItemProperty._setupLiveQuerySubscription] Database not available')\n return\n }\n\n // Query initial metadata using getMetadataLatest subquery pattern\n const metadataLatest = getMetadataLatest({ seedLocalId, seedUid })\n const initialMetadata = await db\n .with(metadataLatest)\n .select()\n .from(metadataLatest)\n .where(\n and(\n eq(metadataLatest.propertyName, propertyName),\n eq(metadataLatest.rowNum, 1)\n )\n )\n .limit(1)\n\n if (initialMetadata.length > 0) {\n const metaRow = initialMetadata[0]\n logger(`[ItemProperty._setupLiveQuerySubscription] Initial query returned metadata record`)\n \n // Update context with initial metadata\n this._service.send({\n type: 'updateContext',\n propertyValue: metaRow.propertyValue,\n renderValue: metaRow.propertyValue,\n localId: metaRow.localId || undefined,\n uid: metaRow.uid || undefined,\n versionLocalId: metaRow.versionLocalId || undefined,\n versionUid: metaRow.versionUid || undefined,\n schemaUid: metaRow.schemaUid || undefined,\n })\n }\n\n // Only set up liveQuery subscription in browser environment\n if (isBrowser) {\n // Set up liveQuery to watch metadata table for this property\n // Use proper SQL parameter binding - ensure values are strings, not objects\n const resolvedSeedUid = seedUid || null\n const resolvedSeedLocalId = seedLocalId || null\n \n const metadata$ = BaseDb.liveQuery<{ localId: string | null; uid: string | null; propertyName: string; propertyValue: string; versionLocalId: string | null; versionUid: string | null; schemaUid: string | null }>(\n (sql: any) => {\n if (resolvedSeedUid) {\n return sql`\n SELECT local_id as localId, uid, property_name as propertyName, property_value as propertyValue, \n version_local_id as versionLocalId, version_uid as versionUid, schema_uid as schemaUid\n FROM metadata\n WHERE seed_uid = ${resolvedSeedUid}\n AND property_name = ${propertyName}\n AND property_name IS NOT NULL\n ORDER BY COALESCE(created_at, attestation_created_at) DESC\n LIMIT 1\n `\n } else if (resolvedSeedLocalId) {\n return sql`\n SELECT local_id as localId, uid, property_name as propertyName, property_value as propertyValue, \n version_local_id as versionLocalId, version_uid as versionUid, schema_uid as schemaUid\n FROM metadata\n WHERE seed_local_id = ${resolvedSeedLocalId}\n AND property_name = ${propertyName}\n AND property_name IS NOT NULL\n ORDER BY COALESCE(created_at, attestation_created_at) DESC\n LIMIT 1\n `\n } else {\n // Fallback - should not happen, but handle gracefully\n return sql`\n SELECT local_id as localId, uid, property_name as propertyName, property_value as propertyValue, \n version_local_id as versionLocalId, version_uid as versionUid, schema_uid as schemaUid\n FROM metadata\n WHERE 1 = 0\n `\n }\n }\n )\n\n const instanceState = itemPropertyInstanceState.get(this)\n if (!instanceState) {\n logger('[ItemProperty._setupLiveQuerySubscription] Instance state not found')\n return\n }\n\n // Subscribe to liveQuery updates\n const subscription = metadata$.subscribe({\n next: async (metadataRows) => {\n if (metadataRows.length === 0) return\n \n const metaRow = metadataRows[0]\n logger(`[ItemProperty._setupLiveQuerySubscription] Metadata updated in database for propertyName: ${propertyName}`)\n \n // Update context with metadata changes\n this._service.send({\n type: 'updateContext',\n propertyValue: metaRow.propertyValue,\n renderValue: metaRow.propertyValue,\n localId: metaRow.localId || undefined,\n uid: metaRow.uid || undefined,\n versionLocalId: metaRow.versionLocalId || undefined,\n versionUid: metaRow.versionUid || undefined,\n schemaUid: metaRow.schemaUid || undefined,\n })\n },\n error: (error) => {\n logger(`[ItemProperty._setupLiveQuerySubscription] LiveQuery error: ${error}`)\n },\n })\n\n instanceState.liveQuerySubscription = subscription\n logger(`[ItemProperty._setupLiveQuerySubscription] LiveQuery subscription set up for propertyName: ${propertyName}`)\n } else {\n logger(`[ItemProperty._setupLiveQuerySubscription] Skipping liveQuery subscription in Node.js environment`)\n }\n } catch (error) {\n logger(`[ItemProperty._setupLiveQuerySubscription] Error setting up subscription: ${error}`)\n setupState.subscriptionSetUp = false // Reset on error so we can retry\n }\n }\n\n // Set up liveQuery subscription as soon as we have required context\n const setupSubscription = this._service.subscribe(async (snapshot) => {\n const seedLocalId = snapshot.context.seedLocalId\n const seedUid = snapshot.context.seedUid\n const propertyName = snapshot.context.propertyName\n const versionLocalId = snapshot.context.versionLocalId\n \n if ((!seedLocalId && !seedUid) || !propertyName) {\n return // Need seed ID and propertyName to proceed\n }\n\n // Once we have required context, set up the liveQuery subscription (only once)\n if ((seedLocalId || seedUid) && propertyName && !setupState.subscriptionSetUp) {\n await setupLiveQuery(seedLocalId || '', seedUid || undefined, propertyName, versionLocalId || undefined)\n if (setupState.subscriptionSetUp) {\n setupSubscription.unsubscribe()\n }\n }\n })\n \n // Also check current state immediately in case context is already available\n const currentSnapshot = this._service.getSnapshot()\n const seedLocalId = currentSnapshot.context.seedLocalId\n const seedUid = currentSnapshot.context.seedUid\n const propertyName = currentSnapshot.context.propertyName\n const versionLocalId = currentSnapshot.context.versionLocalId\n \n if ((seedLocalId || seedUid) && propertyName && !setupState.subscriptionSetUp) {\n setupLiveQuery(seedLocalId || '', seedUid || undefined, propertyName, versionLocalId || undefined).catch((error) => {\n logger(`[ItemProperty._setupLiveQuerySubscription] Error in immediate setup: ${error}`)\n })\n }\n }\n\n static create(\n props: Partial<CreatePropertyInstanceProps>,\n options?: { waitForReady?: false },\n ): ItemProperty<any> | undefined\n static create(\n props: Partial<CreatePropertyInstanceProps>,\n options?: { waitForReady?: true; readyTimeout?: number },\n ): Promise<ItemProperty<any> | undefined>\n static create(\n props: Partial<CreatePropertyInstanceProps>,\n options?: CreateWaitOptions,\n ): ItemProperty<any> | undefined | Promise<ItemProperty<any> | undefined> {\n const waitForReady = options?.waitForReady !== false\n const readyTimeout = options?.readyTimeout ?? 5000\n\n const { propertyName, seedLocalId, seedUid, versionLocalId, versionUid } =\n props\n if (!propertyName || (!seedLocalId && !seedUid)) {\n if (!waitForReady) return undefined\n return Promise.resolve(undefined)\n }\n const keyByLocal = seedLocalId ? this.cacheKey(seedLocalId, propertyName) : null\n const keyByUid = seedUid ? this.cacheKey(seedUid, propertyName) : null\n // Try both keys so we hit cache whether instance was created by find(seedLocalId) or from getItemProperties (may have only seedUid in row)\n const cacheKey = keyByLocal || keyByUid!\n const lookupKey = (keyByLocal && this.instanceCache.has(keyByLocal))\n ? keyByLocal\n : (keyByUid && this.instanceCache.has(keyByUid))\n ? keyByUid\n : null\n if (lookupKey) {\n const { instance, refCount } = this.instanceCache.get(lookupKey)!\n const entry = { instance, refCount: refCount + 1 }\n this.instanceCache.set(lookupKey, entry)\n const otherKey = lookupKey === keyByLocal ? keyByUid : keyByLocal\n if (otherKey) this.instanceCache.set(otherKey, entry)\n // On cache hit, do not sync incoming value: refetches can race with in-memory updates (e.g. save()).\n if (!waitForReady) return instance\n return waitForEntityIdle(instance, { timeout: readyTimeout }).then(\n () => instance,\n )\n }\n if (seedLocalId && propertyName) {\n if (!this.instanceCache.has(cacheKey)) {\n const newInstance = new ItemProperty(props)\n \n // Wrap instance in Proxy for reactive property access\n const proxiedInstance = createReactiveProxy<ItemProperty<any>>({\n instance: newInstance,\n service: newInstance._service,\n trackedProperties: TRACKED_PROPERTIES,\n getContext: (instance) => {\n return instance._getSnapshotContext()\n },\n sendUpdate: (instance, prop: string, value: any) => {\n instance._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n },\n })\n \n const entry = { instance: proxiedInstance, refCount: 1 }\n this.instanceCache.set(cacheKey, entry)\n if (keyByUid && keyByUid !== cacheKey) this.instanceCache.set(keyByUid, entry)\n if (!waitForReady) return proxiedInstance\n return waitForEntityIdle(proxiedInstance, { timeout: readyTimeout }).then(\n () => proxiedInstance,\n )\n }\n }\n if (seedUid && propertyName) {\n if (!this.instanceCache.has(cacheKey)) {\n const newInstance = new ItemProperty(props)\n \n // Wrap instance in Proxy for reactive property access\n const proxiedInstance = createReactiveProxy<ItemProperty<any>>({\n instance: newInstance,\n service: newInstance._service,\n trackedProperties: TRACKED_PROPERTIES,\n getContext: (instance) => {\n return instance._getSnapshotContext()\n },\n sendUpdate: (instance, prop: string, value: any) => {\n instance._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n },\n })\n \n const entry = { instance: proxiedInstance, refCount: 1 }\n this.instanceCache.set(cacheKey, entry)\n if (keyByLocal && keyByLocal !== cacheKey) this.instanceCache.set(keyByLocal, entry)\n if (!waitForReady) return proxiedInstance\n return waitForEntityIdle(proxiedInstance, { timeout: readyTimeout }).then(\n () => proxiedInstance,\n )\n }\n }\n const newInstance = new ItemProperty(props)\n \n // Wrap instance in Proxy for reactive property access\n const result = createReactiveProxy<ItemProperty<any>>({\n instance: newInstance,\n service: newInstance._service,\n trackedProperties: TRACKED_PROPERTIES,\n getContext: (instance) => {\n return instance._getSnapshotContext()\n },\n sendUpdate: (instance, prop: string, value: any) => {\n instance._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n },\n })\n if (!waitForReady) return result\n return waitForEntityIdle(result, { timeout: readyTimeout }).then(\n () => result,\n )\n }\n\n static async find({\n propertyName,\n seedLocalId,\n seedUid,\n modelName: modelNameOption,\n waitForReady = true,\n readyTimeout = 5000,\n }: ItemPropertyFindProps & {\n waitForReady?: boolean\n readyTimeout?: number\n }): Promise<ItemProperty<any> | undefined> {\n if ((!seedLocalId && !seedUid) || !propertyName) {\n return undefined\n }\n \n const cacheKeyId = seedUid || seedLocalId\n const cacheKey = ItemProperty.cacheKey(cacheKeyId!, propertyName)\n let foundProperty: ItemProperty<any> | undefined\n \n // Check cache first\n if (this.instanceCache.has(cacheKey)) {\n const { instance, refCount } = this.instanceCache.get(cacheKey)!\n this.instanceCache.set(cacheKey, {\n instance,\n refCount: refCount + 1,\n })\n foundProperty = instance as ItemProperty<any>\n } else {\n // Query database\n const propertyData = await getPropertyData({\n propertyName,\n seedLocalId,\n seedUid,\n })\n if (!propertyData) {\n return undefined\n }\n // Ensure modelName for constructor: metadata may have modelType only, or neither (e.g. when Item passes it)\n // Use modelTypeToModelName: modelType is snake_case (\"test_post\"); Model names are PascalCase (\"TestPost\")\n const data = propertyData as { modelName?: string; modelType?: string }\n const modelName =\n data.modelName ??\n ((data.modelType ? modelTypeToModelName(data.modelType) : '') || modelNameOption || '')\n // Fix 6: resolve propertyRecordSchema from Model so value setter can persist (useItemProperty path)\n // Pass modelType for fallback: \"New model\" -> \"new_model\" can't be reversed to exact name; findByModelType handles it\n const propertyRecordSchema = await resolvePropertyRecordSchemaFromModel(\n modelName,\n propertyName,\n data.modelType\n )\n foundProperty = ItemProperty.create(\n { ...propertyData, modelName, propertyRecordSchema },\n { waitForReady: false },\n )\n }\n\n if (!foundProperty) {\n return undefined\n }\n\n if (waitForReady) {\n await waitForEntityIdle(foundProperty, { timeout: readyTimeout })\n }\n\n return foundProperty\n }\n\n /**\n * Get all ItemProperty instances for an item.\n * Loads property data via getItemProperties, creates instances via create, optionally waits for idle.\n */\n static async all(\n params: { seedLocalId?: string; seedUid?: string },\n options?: { waitForReady?: boolean; readyTimeout?: number },\n ): Promise<ItemProperty<any>[]> {\n const { waitForReady = false, readyTimeout = 5000 } = options ?? {}\n const { seedLocalId, seedUid } = params\n if (!seedLocalId && !seedUid) {\n return []\n }\n\n const propertiesData = await getItemProperties({ seedLocalId, seedUid })\n const instances: ItemProperty<any>[] = []\n\n for (const data of propertiesData) {\n const d = data as { modelName?: string; modelType?: string; propertyName?: string }\n const modelName =\n d.modelName ?? (d.modelType ? modelTypeToModelName(d.modelType) : '') ?? ''\n // Fix 6: resolve propertyRecordSchema from Model so value setter can persist\n const propertyRecordSchema = d.propertyName\n ? await resolvePropertyRecordSchemaFromModel(modelName, d.propertyName, d.modelType)\n : undefined\n const createProps = {\n ...data,\n modelName,\n propertyRecordSchema,\n }\n const instance = this.create(createProps, { waitForReady: false })\n if (instance) {\n instances.push(instance)\n }\n }\n\n if (waitForReady && instances.length > 0) {\n await Promise.all(\n instances.map((p) =>\n waitForEntityIdle(p as Parameters<typeof waitForEntityIdle>[0], {\n timeout: readyTimeout,\n }),\n ),\n )\n }\n\n return instances\n }\n\n find = ItemProperty.find\n\n static cacheKey(seedLocalIdOrUid: string, propertyName: string): string {\n const { uid, localId } = getCorrectId(seedLocalIdOrUid)\n return `Item_${uid || localId}_${propertyName}`\n }\n\n /** Clears instance cache for an item (for test isolation when run in group). */\n static clearInstanceCacheForItem(seedLocalIdOrUid: string): void {\n const { uid, localId } = getCorrectId(seedLocalIdOrUid)\n const prefix = `Item_${uid || localId}_`\n for (const key of Array.from(this.instanceCache.keys())) {\n if (key.startsWith(prefix)) this.instanceCache.delete(key)\n }\n }\n\n getService() {\n return this._service\n }\n\n private _getSnapshot(): ItemPropertySnapshot {\n return this._service.getSnapshot() as ItemPropertySnapshot\n }\n\n private _getSnapshotContext(): PropertyMachineContext {\n return this._getSnapshot().context\n }\n\n get localId() {\n return this._getSnapshotContext().localId ?? ''\n }\n\n get uid() {\n return this._getSnapshotContext().uid ?? ''\n }\n\n get seedLocalId() {\n return this._getSnapshotContext().seedLocalId ?? ''\n }\n\n get seedUid() {\n return this._getSnapshotContext().seedUid ?? ''\n }\n\n get schemaUid(): string | undefined {\n return this._getSnapshotContext().schemaUid || undefined\n }\n\n get propertyName(): string {\n if (this._alias) {\n return this._alias\n }\n return this._getSnapshotContext().propertyName || ''\n }\n\n get modelName() {\n return this._getSnapshotContext().modelName\n }\n\n get propertyDef(): Static<typeof TProperty> | undefined {\n return this._getSnapshotContext().propertyRecordSchema\n }\n\n get localStorageDir(): string | void {\n const propertyDef = this.propertyDef\n if (propertyDef && propertyDef.localStorageDir) {\n return this.propertyDef.localStorageDir\n }\n const localStorageDir = this._getSnapshot().context.localStorageDir\n if (localStorageDir) {\n return localStorageDir\n }\n }\n\n get refResolvedValue(): string | undefined {\n return this._getSnapshotContext().refResolvedValue || undefined\n }\n\n get localStoragePath(): string | void {\n if (this.localStorageDir) {\n return `/files${this.localStorageDir}/${this.refResolvedValue}`\n }\n }\n\n get versionLocalId(): string | undefined {\n return this._getSnapshotContext().versionLocalId || undefined\n }\n\n get status() {\n return this._getSnapshot().value\n }\n\n get alias() {\n return this._alias\n }\n\n get value() {\n // Use string literal to avoid circular dependency\n const context = this._getSnapshotContext()\n if (this._dataType === 'Image') {\n return context.refResolvedValue\n }\n // Read from context via proxy (renderValue or propertyValue)\n return context.renderValue || context.propertyValue\n }\n\n set value(value: any) {\n const context = this._getSnapshotContext()\n const currentValue = context.renderValue || context.propertyValue\n if (currentValue === value) {\n return\n }\n // If no propertyRecordSchema, just update context directly\n if (!context.propertyRecordSchema) {\n this._service.send({\n type: 'updateContext',\n propertyValue: value,\n renderValue: value,\n })\n } else {\n // Otherwise trigger save\n this._service.send({\n type: 'save',\n newValue: value,\n })\n }\n }\n\n get published(): boolean {\n return !!this._getSnapshot().context.uid\n }\n\n subscribe(callback: Partial<Subscriber<any>>) {\n // Subscribe to service instead of BehaviorSubject for reactivity\n return this._service.subscribe((snapshot) => {\n const context = snapshot.context\n const value = context.renderValue || context.propertyValue\n if (callback.next) {\n callback.next(value)\n }\n })\n }\n\n async save(): Promise<void> {\n const ctx = this._getSnapshotContext()\n const { assertItemOwned } = await import('@/helpers/ownership')\n await assertItemOwned({\n seedLocalId: ctx?.seedLocalId ?? undefined,\n seedUid: ctx?.seedUid ?? undefined,\n })\n await waitFor(\n this._service,\n (snapshot) => !snapshot.context.isSaving && snapshot.value === 'idle',\n {\n timeout: 10_000,\n },\n )\n const canonicalId = ctx?.seedLocalId ?? ctx?.seedUid\n if (canonicalId) {\n eventEmitter.emit('itemProperty.saved', { seedLocalId: ctx.seedLocalId, seedUid: ctx.seedUid })\n if (typeof window !== 'undefined' && window.__SEED_INVALIDATE_ITEM_PROPERTIES__) {\n window.__SEED_INVALIDATE_ITEM_PROPERTIES__(canonicalId)\n }\n }\n // return new Promise((resolve) => {\n // const saveSub = this._service.subscribe((snapshot) => {\n // if (!snapshot.context.isSaving) {\n // saveSub.unsubscribe()\n // resolve()\n // }\n // })\n // })\n }\n\n unload() {\n try {\n const context = this._getSnapshotContext()\n const cacheKey = ItemProperty.cacheKey(\n context.seedUid || context.seedLocalId || '',\n context.propertyName || ''\n )\n const cacheKeys: string[] = []\n \n if (cacheKey && cacheKey !== 'Item__') {\n cacheKeys.push(cacheKey)\n }\n \n unloadEntity(this, {\n getCacheKeys: () => cacheKeys,\n caches: [ItemProperty.instanceCache],\n instanceState: itemPropertyInstanceState,\n getService: (instance) => instance._service,\n onUnload: (instance) => {\n // Clean up additional subscription\n instance._subscription?.unsubscribe()\n },\n })\n } catch (error) {\n // Still try to clean up what we can\n const instanceState = itemPropertyInstanceState.get(this)\n if (instanceState?.liveQuerySubscription) {\n instanceState.liveQuerySubscription.unsubscribe()\n instanceState.liveQuerySubscription = null\n }\n this._subscription?.unsubscribe()\n try {\n this._service.stop()\n } catch {\n // Service might already be stopped\n }\n }\n }\n\n /**\n * Destroy the item property: remove from caches, delete metadata from DB, remove from parent Item, stop service.\n */\n async destroy(): Promise<void> {\n const context = this._getSnapshotContext()\n const cacheKey = ItemProperty.cacheKey(\n context.seedUid || context.seedLocalId || '',\n context.propertyName || '',\n )\n const cacheKeys: string[] = cacheKey && cacheKey !== 'Item__' ? [cacheKey] : []\n\n clearDestroySubscriptions(this, {\n instanceState: itemPropertyInstanceState,\n onUnload: (instance) => (instance as ItemProperty<any>)._subscription?.unsubscribe(),\n })\n\n forceRemoveFromCaches(this, {\n getCacheKeys: () => cacheKeys,\n caches: [ItemProperty.instanceCache as Map<string, unknown>],\n })\n\n await runDestroyLifecycle(this, {\n getService: (instance) =>\n instance._service as { send: (ev: unknown) => void; stop: () => void },\n doDestroy: async () => {\n const db = BaseDb.getAppDb()\n const seedLocalId = context.seedLocalId\n const seedUid = context.seedUid\n const propertyName = context.propertyName\n if (!propertyName || (!seedLocalId && !seedUid)) return\n\n if (db) {\n const seedSchemaMod = await import('../seedSchema')\n const { metadata } = seedSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { and, eq, or } = drizzleMod\n const conditions = [eq(metadata.propertyName, propertyName)]\n if (seedLocalId && seedUid) {\n conditions.push(or(eq(metadata.seedLocalId, seedLocalId), eq(metadata.seedUid, seedUid)) as any)\n } else if (seedLocalId) {\n conditions.push(eq(metadata.seedLocalId, seedLocalId))\n } else if (seedUid) {\n conditions.push(eq(metadata.seedUid, seedUid))\n }\n if (conditions.length > 1) {\n await db.delete(metadata).where(and(...conditions))\n }\n }\n\n const itemMod = await import('../Item/Item')\n const { Item } = itemMod\n const item = Item.getById((seedLocalId || seedUid) as string)\n if (item) {\n item.getService().send({ type: 'removePropertyInstance', propertyName })\n }\n },\n })\n }\n}","import { ModelValues } from '@/types'\n// Dynamic import to break circular dependency: Model -> BaseItem -> createNewItem -> Model\n// import { Model } from '@/Model/Model'\nimport { createSeed } from './createSeed'\nimport { createVersion } from './createVersion'\nimport { createMetadata } from './createMetadata'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { modelPropertiesToObject } from '@/helpers/model'\n\ntype CreateNewItemProps = Partial<ModelValues<any>> & {\n modelName: string\n}\n\ntype CreateNewItemReturnType = {\n modelName: string\n seedLocalId: string\n versionLocalId: string\n}\n\nexport const createNewItem = async ({\n modelName,\n ...propertyData\n}: CreateNewItemProps): Promise<CreateNewItemReturnType> => {\n if (!modelName) {\n throw new Error('A model name is required for createNewItem')\n }\n\n const seedType = toSnakeCase(modelName)\n\n const newSeedId = await createSeed({ type: seedType })\n\n const newVersionId = await createVersion({ seedLocalId: newSeedId, seedType: toSnakeCase(modelName) })\n\n // Dynamic import to break circular dependency\n const modelMod = await import('../../Model/Model')\n const { Model } = modelMod\n const model = await Model.getByNameAsync(modelName)\n const propertySchemas = model?.properties ? modelPropertiesToObject(model.properties) : undefined\n\n // Build set of all properties to create metadata for: union of model schema + propertyData\n // This ensures we create metadata for ALL model properties even when creating with no initial values\n // (fixes first-item persistence: loadOrCreateItem needs metadata rows to run createItemPropertyInstances)\n const allPropertyNames = new Set<string>(Object.keys(propertyData))\n if (propertySchemas) {\n for (const name of Object.keys(propertySchemas)) {\n allPropertyNames.add(name)\n }\n }\n\n for (const propertyName of allPropertyNames) {\n const propertyValue = propertyData[propertyName]\n const propertyRecordSchema = propertySchemas?.[propertyName]\n\n await createMetadata(\n {\n seedLocalId: newSeedId,\n versionLocalId: newVersionId,\n propertyName,\n propertyValue,\n modelName,\n } as Parameters<typeof createMetadata>[0],\n propertyRecordSchema,\n )\n }\n\n return {\n modelName,\n seedLocalId: newSeedId,\n versionLocalId: newVersionId,\n }\n} ","import { waitForEntityIdle } from '../waitForEntityIdle'\n\n/**\n * Configuration for entity find operations\n */\nexport interface FindConfig<T> {\n /**\n * Cache lookup by ID\n */\n getById: (id: string) => T | undefined\n /**\n * Database lookup and instance creation by ID\n */\n createById: (id: string) => Promise<T | undefined>\n /**\n * Optional: Additional lookup methods (e.g., getByName)\n */\n getByName?: (name: string, ...args: any[]) => T | undefined\n /**\n * Optional: Create instance by name\n */\n createByName?: (name: string, ...args: any[]) => Promise<T | undefined>\n}\n\n/**\n * Find options\n */\nexport interface FindOptions {\n /**\n * Wait for entity to reach idle state\n * @default true\n */\n waitForReady?: boolean\n /**\n * Timeout for waiting for ready state (ms)\n * @default 5000\n */\n readyTimeout?: number\n}\n\n/**\n * Generic find implementation for entities\n * \n * @param config - Find configuration with lookup methods\n * @param params - Find parameters (id, name, or other entity-specific params)\n * @param options - Find options (waitForReady, readyTimeout)\n * @returns Entity instance if found, undefined otherwise\n */\nexport async function findEntity<T extends { getService(): any }>(\n config: FindConfig<T>,\n params: {\n id?: string\n name?: string\n [key: string]: any\n },\n options: FindOptions = {}\n): Promise<T | undefined> {\n const { waitForReady = true, readyTimeout = 5000 } = options\n let instance: T | undefined\n\n // Try ID lookup first (most specific)\n if (params.id) {\n instance = config.getById(params.id)\n if (!instance) {\n instance = await config.createById(params.id)\n }\n }\n // Fall back to name lookup if available\n else if (params.name && config.getByName && config.createByName) {\n const nameArgs: any[] = []\n // Extract additional args from params (everything except id and name)\n for (const [key, value] of Object.entries(params)) {\n if (key !== 'id' && key !== 'name') {\n nameArgs.push(value)\n }\n }\n instance = config.getByName(params.name, ...nameArgs)\n if (!instance && config.createByName) {\n instance = await config.createByName(params.name, ...nameArgs)\n }\n } else {\n return undefined\n }\n\n if (!instance) {\n return undefined\n }\n\n if (waitForReady) {\n await waitForEntityIdle(instance, { timeout: readyTimeout })\n }\n\n return instance\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { seeds } from '@/seedSchema'\nimport { eq, or } from 'drizzle-orm'\n\ntype DeleteItemProps = {\n seedLocalId?: string\n seedUid?: string\n}\ntype DeleteItem = (props: DeleteItemProps) => Promise<void>\nexport const deleteItem: DeleteItem = async ({ seedLocalId, seedUid }) => {\n const appDb = BaseDb.getAppDb()\n\n const conditions = []\n if (seedLocalId) {\n conditions.push(eq(seeds.localId, seedLocalId))\n }\n if (seedUid) {\n conditions.push(eq(seeds.uid, seedUid))\n }\n\n if (conditions.length === 0) {\n return\n }\n\n await appDb\n .update(seeds)\n .set({\n _markedForDeletion: 1,\n })\n .where(or(...conditions))\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { seeds } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\n\ntype UpdateSeedUidProps = {\n seedLocalId: string\n seedUid: string\n}\n\nexport const updateSeedUid = async ({\n seedLocalId,\n seedUid,\n}: UpdateSeedUidProps): Promise<void> => {\n if (!seedLocalId || !seedUid) {\n return\n }\n\n const appDb = BaseDb.getAppDb()\n await appDb\n .update(seeds)\n .set({\n uid: seedUid,\n updatedAt: Date.now(),\n })\n .where(eq(seeds.localId, seedLocalId))\n}\n","import { IItem, IItemProperty } from '@/interfaces'\nimport { itemMachineSingle } from '@/Item/service/itemMachineSingle'\nimport { INTERNAL_PROPERTY_NAMES } from '@/helpers/constants'\nimport { VersionsType } from '@/seedSchema'\n// Dynamic import to break circular dependency: Model -> Item -> Model\n// import { Model } from '@/Model/Model'\n\nimport {\n CreatePropertyInstanceProps,\n ItemData,\n ItemFindProps,\n ModelSchema,\n ModelValues,\n NewItemProps,\n PropertyData\n} from '@/types'\nimport type { CreateWaitOptions } from '@/types'\n\nimport { BehaviorSubject } from 'rxjs'\nimport { ActorRefFrom, Subscription, createActor, SnapshotFrom } from 'xstate'\nimport pluralize from 'pluralize'\nimport { orderBy, startCase } from 'lodash-es'\nimport { getItemData } from '@/db/read/getItemData'\nimport { getItemsData } from '@/db/read/getItems'\nimport { ItemProperty } from '@/ItemProperty/ItemProperty'\nimport { getItemProperties } from '@/db/read/getItemProperties'\nimport { createNewItem } from '@/db/write/createNewItem'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { properties as propertiesTable, models as modelsTable } from '@/seedSchema'\nimport { modelPropertiesToObject } from '@/helpers/model'\nimport { waitForEntityIdle } from '@/helpers/waitForEntityIdle'\nimport { findEntity } from '@/helpers/entity/entityFind'\nimport { unloadEntity } from '@/helpers/entity/entityUnload'\nimport {\n clearDestroySubscriptions,\n forceRemoveFromCaches,\n runDestroyLifecycle,\n} from '@/helpers/entity/entityDestroy'\nimport { deleteItem } from '@/db/write/deleteItem'\nimport { updateSeedUid } from '@/db/write/updateSeedUid'\nimport { eq, and } from 'drizzle-orm'\nimport debug from 'debug'\n\nconst itemLogger = debug('seedSdk:Item')\n\n// Fallback helper for synchronous Model access when modelInstance is not provided\n// This is only used as a fallback - the preferred approach is to pass modelInstance\n// directly to Item constructor (which Model.create() instance method does).\n// Since Model.getByName() is synchronous and just accesses a cache, Model must be loaded\n// when Item constructor runs (because Model imports Item).\nlet ModelClass: typeof import('@/Model/Model').Model | null = null\nlet modelImportPromise: Promise<typeof import('@/Model/Model')> | null = null\n\nconst getModel = (): typeof import('@/Model/Model').Model => {\n if (!ModelClass) {\n // Start loading Model if not already started\n if (!modelImportPromise) {\n modelImportPromise = import('@/Model/Model')\n // Try to get Model synchronously if already loaded\n // This works because Model imports Item, so Model is initialized when Item runs\n modelImportPromise.then(module => {\n ModelClass = module.Model\n }).catch(() => {\n // If import fails, ModelClass remains null\n })\n }\n // For synchronous access, we need Model to already be loaded\n // If it's not loaded yet, this will throw, but in practice Model is always loaded\n // because Model imports Item, creating the initialization order\n if (!ModelClass) {\n // Fallback: try to access Model directly (works if already in module cache)\n try {\n // @ts-ignore - accessing module cache directly\n const modelModule = (globalThis as any).__seedModelModule || \n (typeof window !== 'undefined' && (window as any).__seedModelModule)\n if (modelModule) {\n ModelClass = modelModule.Model\n }\n } catch {\n // If Model isn't available, throw a more helpful error\n throw new Error('Model class not available. This may indicate a circular dependency issue.')\n }\n }\n }\n return ModelClass!\n}\n\n// Define tracked properties for the Proxy\n// These properties will be read from/written to the actor context\nconst TRACKED_PROPERTIES = [\n 'seedLocalId',\n 'seedUid',\n 'modelName',\n 'schemaUid',\n 'latestVersionLocalId',\n 'latestVersionUid',\n] as const\n\n// WeakMap to store mutable state per Item instance\n// This avoids issues with read-only properties when instances are frozen by Immer\nconst itemInstanceState = new WeakMap<Item<any>, {\n liveQuerySubscription: { unsubscribe: () => void } | null // LiveQuery subscription for cross-instance updates\n definedPropertyNames: Set<string>\n}>()\n\nexport class Item<T extends ModelValues<ModelSchema>> implements IItem<T> {\n\n protected static instanceCache: Map<string, { instance: Item<any>; refCount: number }> = new Map();\n protected _subscription: Subscription | undefined;\n protected readonly _storageTransactionId: string | undefined;\n protected _propertiesSubject: BehaviorSubject<Record<string, IItemProperty>> = new BehaviorSubject({});\n protected readonly _service: ActorRefFrom<typeof itemMachineSingle>;\n\n constructor(initialValues: NewItemProps<T>) {\n const {\n modelName,\n seedUid,\n schemaUid,\n seedLocalId,\n latestVersionLocalId,\n latestVersionUid,\n modelInstance,\n } = initialValues\n\n // Store modelInstance if provided (for backward compatibility)\n // But Item no longer depends on Model being loaded - it loads properties from database directly\n if (initialValues.storageTransactionId) {\n this._storageTransactionId = initialValues.storageTransactionId\n }\n\n this._service = createActor(itemMachineSingle, {\n input: {\n seedLocalId,\n seedUid,\n schemaUid,\n modelName,\n latestVersionLocalId,\n latestVersionUid,\n storageTransactionId: this._storageTransactionId,\n // ModelClass is no longer needed - Item loads properties from database independently\n },\n })\n\n this._subscription = this._service.subscribe((snapshot: SnapshotFrom<typeof itemMachineSingle>) => {\n const { context } = snapshot\n\n if (\n !context ||\n !context.propertyInstances ||\n context.propertyInstances.size === 0\n ) {\n return\n }\n\n const propertiesObj: Record<string, IItemProperty> = {}\n\n for (const [key, propertyInstance] of context.propertyInstances) {\n if (typeof key !== 'string' || INTERNAL_PROPERTY_NAMES.includes(key)) {\n propertiesObj[key.toString()] = propertyInstance\n continue\n }\n\n let transformedKey: string = key as string\n\n if (propertyInstance.alias) {\n transformedKey = propertyInstance.alias\n }\n\n if (!propertyInstance.alias && key.endsWith('Ids')) {\n transformedKey = key.slice(0, -3) // Remove 'Ids'\n transformedKey = pluralize(transformedKey)\n }\n\n if (!propertyInstance.alias && key.endsWith('Id')) {\n transformedKey = key.slice(0, -2) // Remove 'Id'\n }\n\n propertiesObj[transformedKey] = propertyInstance\n }\n\n // Define accessors for any property instances we don't have yet (e.g. from loadOrCreateItem)\n const state = itemInstanceState.get(this)\n const definedSet = state?.definedPropertyNames\n if (definedSet) {\n for (const key of context.propertyInstances.keys()) {\n if (typeof key !== 'string' || INTERNAL_PROPERTY_NAMES.includes(key)) {\n continue\n }\n if (!definedSet.has(key)) {\n this._definePropertyAccessor(key)\n }\n }\n }\n\n this._propertiesSubject.next(propertiesObj)\n })\n\n this._service.start()\n\n // Initialize instance state in WeakMap\n itemInstanceState.set(this, {\n liveQuerySubscription: null,\n definedPropertyNames: new Set(),\n })\n \n // Set up liveQuery subscription for cross-instance updates\n this._setupLiveQuerySubscription()\n\n // Properties are now loaded from database via loadOrCreateItem actor\n // Create property instances for all model properties plus any keys in initialValues,\n // so that e.g. newPost.title = '...' works even when the item was created with no initial values.\n const itemPropertyBase: Partial<CreatePropertyInstanceProps> = {\n seedLocalId,\n seedUid,\n versionLocalId: latestVersionLocalId,\n versionUid: latestVersionUid,\n modelName,\n }\n\n const metadataKeys = [\n 'modelName',\n 'schemaName',\n 'modelInstance',\n 'seedLocalId',\n 'seedUid',\n 'schemaUid',\n 'latestVersionLocalId',\n 'latestVersionUid',\n ] as const\n\n const keysFromInitial = (Object.keys(initialValues) as Array<string & keyof Partial<T>>).filter(\n (key) => !metadataKeys.includes(key as any),\n )\n const schemaNameForModel = (initialValues as Record<string, unknown>).schemaName as string | undefined\n const modelPropertyNames = this._getModelPropertyNames(schemaNameForModel)\n const allKeys = new Set<string>([...keysFromInitial, ...modelPropertyNames])\n\n let model: import('@/Model/Model').Model | undefined\n try {\n const M = getModel()\n model = M != null ? M.getByName(modelName, schemaNameForModel) : undefined\n } catch {\n model = undefined\n }\n const propertySchemas = model?.properties?.length\n ? modelPropertiesToObject(model.properties)\n : {}\n\n for (const key of allKeys) {\n if (INTERNAL_PROPERTY_NAMES.includes(key)) {\n continue\n }\n this._createPropertyInstance({\n ...itemPropertyBase,\n propertyName: key,\n propertyValue: (initialValues as Record<string, unknown>)[key] ?? undefined,\n propertyRecordSchema: propertySchemas[key] ?? undefined,\n })\n }\n }\n\n static async create<T extends ModelValues<ModelSchema>>(\n props: Partial<ItemData> & { modelInstance?: import('@/Model/Model').Model },\n options?: CreateWaitOptions,\n ): Promise<Item<any>> {\n const waitForReady = options?.waitForReady !== false\n const readyTimeout = options?.readyTimeout ?? 5000\n\n if (!props.modelName && props.type) {\n props.modelName = startCase(props.type)\n }\n if (props.seedUid || props.seedLocalId) {\n const seedId = (props.seedUid || props.seedLocalId) as string\n if (this.instanceCache.has(seedId)) {\n const { instance, refCount } = this.instanceCache.get(seedId)!\n console.log(`[Item.create] Returning cached instance for ${seedId}`)\n this.instanceCache.set(seedId, {\n instance,\n refCount: refCount + 1,\n })\n for (const [propertyName, propertyValue] of Object.entries(props)) {\n const snapshot = instance.getService().getSnapshot() as SnapshotFrom<typeof itemMachineSingle>\n const propertyInstances = snapshot.context.propertyInstances\n if (!propertyInstances || !propertyInstances.has(propertyName)) {\n continue\n }\n const propertyInstance = propertyInstances.get(propertyName)\n if (!propertyInstance) {\n continue\n }\n propertyInstance.getService().send({\n type: 'updateContext',\n propertyValue,\n })\n }\n if (!waitForReady) return instance\n await waitForEntityIdle(instance, { timeout: readyTimeout })\n return instance\n }\n if (!this.instanceCache.has(seedId)) {\n // Item no longer needs modelInstance - it loads properties from database independently\n // Exclude latestVersionUid from props as it has incompatible types (string vs VersionsType)\n const { latestVersionUid, ...propsWithoutVersionUid } = props\n const propsWithModel = { ...propsWithoutVersionUid } as any\n const newInstance = new Item(propsWithModel)\n \n // Wrap instance in Proxy for reactive property access\n const proxiedInstance = new Proxy(newInstance, {\n get(target, prop: string | symbol) {\n // Log all property accesses to see what's being called\n if (typeof prop === 'string' && prop === 'properties') {\n console.log(`[Item.Proxy.get] properties accessed on Item instance`)\n }\n // Handle special properties\n if (prop === '_service') {\n return Reflect.get(target, prop)\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n return (context as any)[prop]\n }\n \n // Handle 'properties' getter - not tracked, but accessible via getter\n if (typeof prop === 'string' && prop === 'properties') {\n // Delegate to the getter method on the instance\n return target.properties\n }\n \n // For methods and other properties, use Reflect\n return Reflect.get(target, prop)\n },\n \n set(target, prop: string | symbol, value: any) {\n // Handle special properties\n if (prop === '_service') {\n return Reflect.set(target, prop, value)\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n // Standard property update\n target._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n // Auto-persist seedUid to DB when assigned so future loads and getPublishPayload see it\n if (prop === 'seedUid' && typeof value === 'string' && value.length > 0) {\n const seedLocalId = target._getSnapshotContext().seedLocalId\n if (seedLocalId) {\n void updateSeedUid({ seedLocalId, seedUid: value }).catch((err) => {\n itemLogger('updateSeedUid failed:', err)\n })\n }\n }\n return true\n }\n \n // Handle 'properties' - read-only computed property\n if (typeof prop === 'string' && prop === 'properties') {\n // Properties are read-only computed values from propertyInstances\n // Cannot be set directly - properties are managed via ItemProperty instances\n throw new Error('Cannot set item.properties directly. Properties are computed from ItemProperty instances.')\n }\n \n // For non-tracked properties, use Reflect\n return Reflect.set(target, prop, value)\n },\n \n has(target, prop: string | symbol) {\n // Check tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n return prop in context\n }\n return Reflect.has(target, prop)\n },\n \n ownKeys(target) {\n // Return keys from target\n return Reflect.ownKeys(target)\n },\n \n getOwnPropertyDescriptor(target, prop: string | symbol) {\n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n if (prop in context) {\n return {\n enumerable: true,\n configurable: true,\n value: (context as any)[prop],\n writable: true,\n }\n }\n }\n return Reflect.getOwnPropertyDescriptor(target, prop)\n },\n }) as Item<any>\n \n this.instanceCache.set(seedId, {\n instance: proxiedInstance,\n refCount: 1,\n })\n if (!waitForReady) return proxiedInstance\n await waitForEntityIdle(proxiedInstance, { timeout: readyTimeout })\n return proxiedInstance\n }\n }\n if (!props.modelName) {\n throw new Error('Model name is required to create an item')\n }\n // Filter out ItemData metadata properties - only pass model schema properties\n // Use schemaName from props if available (passed from Model.create() instance method)\n const schemaName = (props as any).schemaName\n \n // Get property names directly from database to make Item independent from Model\n let propertyNames: string[] = []\n const db = BaseDb.getAppDb()\n if (db && props.modelName) {\n // Query properties table directly by model name\n // First get the model record by name, optionally filtered by schema\n let modelRecords\n \n // If we have a schema name, join with modelSchemas to filter by schema\n if (schemaName) {\n const modelSchemaSchemaMod = await import('../seedSchema/ModelSchemaSchema')\n const { modelSchemas } = modelSchemaSchemaMod\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n \n modelRecords = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(\n and(\n eq(modelsTable.name, props.modelName),\n eq(schemasTable.name, schemaName)\n )\n )\n .limit(1)\n } else {\n modelRecords = await db\n .select({ id: modelsTable.id })\n .from(modelsTable)\n .where(eq(modelsTable.name, props.modelName))\n .limit(1)\n }\n \n if (modelRecords.length > 0 && modelRecords[0].id) {\n const propertyRecords = await db\n .select({ name: propertiesTable.name })\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, modelRecords[0].id))\n \n propertyNames = propertyRecords.map((r: { name: string | null }) => r.name).filter((name: string | null): name is string => Boolean(name))\n }\n }\n \n const modelPropertyData: Partial<ModelValues<ModelSchema>> & { modelName: string } = { modelName: props.modelName }\n \n // Only include properties that are in the model schema\n // Exclude modelInstance, modelName, and schemaName as they're metadata, not item properties\n for (const [key, value] of Object.entries(props)) {\n // Skip metadata properties that aren't part of the item's data\n if (key === 'modelName' || key === 'schemaName' || key === 'modelInstance') {\n continue\n }\n if (propertyNames.length === 0 || propertyNames.includes(key)) {\n // If we couldn't get property names from DB, include all properties\n // Type assertion: we've filtered out modelInstance above, so value should be a valid property value\n modelPropertyData[key] = value as any\n }\n }\n const { seedLocalId, versionLocalId, } = await createNewItem(modelPropertyData)\n props.seedLocalId = seedLocalId\n props.latestVersionLocalId = versionLocalId\n // Item no longer needs modelInstance - it loads properties from database independently\n // Exclude latestVersionUid from props as it has incompatible types (string vs VersionsType)\n const { latestVersionUid, ...propsWithoutVersionUid } = props\n const propsWithModel = { ...propsWithoutVersionUid } as any\n const newInstance = new Item(propsWithModel)\n \n // Wrap instance in Proxy for reactive property access\n const proxiedInstance = new Proxy(newInstance, {\n get(target, prop: string | symbol) {\n // Log all property accesses to see what's being called\n if (typeof prop === 'string' && prop === 'properties') {\n console.log(`[Item.Proxy.get] properties accessed on Item instance (second Proxy setup)`)\n }\n // Handle special properties\n if (prop === '_service') {\n return Reflect.get(target, prop)\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n // Special handling for properties - compute from propertyInstances Map\n if (prop === 'properties') {\n console.log(`[Item.Proxy.properties] Proxy handler called for properties (second Proxy setup)`)\n const snapshot = target._service.getSnapshot() as SnapshotFrom<typeof itemMachineSingle>\n const context = snapshot.context\n const propertyInstances = context.propertyInstances as Map<string, IItemProperty> | undefined\n const modelName = context.modelName as string\n \n console.log(`[Item.Proxy.properties] ${modelName}: propertyInstances size: ${propertyInstances?.size || 0}`)\n if (!propertyInstances || propertyInstances.size === 0) {\n console.log(`[Item.Proxy.properties] ${modelName}: No property instances`)\n return []\n }\n \n // Get model schema keys for filtering\n const modelSchemaKeys = target._getModelSchemaKeys()\n console.log(`[Item.Proxy.properties] ${modelName}: modelSchemaKeys:`, modelSchemaKeys)\n console.log(`[Item.Proxy.properties] ${modelName}: propertyInstances keys:`, Array.from(propertyInstances.keys()))\n \n // Convert Map to array, filtering by model schema\n const properties: IItemProperty[] = []\n for (const [key, propertyInstance] of propertyInstances) {\n // Skip internal properties\n if (INTERNAL_PROPERTY_NAMES.includes(key)) {\n continue\n }\n \n // Include if it's a model property\n const isModelProp = target._isModelProperty(key, modelSchemaKeys)\n const propValue = propertyInstance.value\n console.log(`[Item.Proxy.properties] ${modelName}: key=\"${key}\", propertyName=\"${propertyInstance.propertyName}\", isModelProperty=${isModelProp}, value=${propValue}`)\n if (isModelProp) {\n properties.push(propertyInstance)\n console.log(`[Item.Proxy.properties] ${modelName}: Added property \"${propertyInstance.propertyName}\" with value:`, propValue)\n }\n }\n \n const propertiesInfo = properties.map(p => ({\n propertyName: p.propertyName,\n value: p.value,\n hasValue: p.value !== undefined && p.value !== null\n }))\n console.log(`[Item.Proxy.properties] ${modelName}: Returning ${properties.length} properties:`, JSON.stringify(propertiesInfo, null, 2))\n // CRITICAL: Always create a new array reference so React detects changes\n return [...properties]\n }\n \n const context = target._getSnapshotContext()\n return (context as any)[prop]\n }\n \n // For methods and other properties, use Reflect\n return Reflect.get(target, prop)\n },\n \n set(target, prop: string | symbol, value: any) {\n // Handle special properties\n if (prop === '_service') {\n return Reflect.set(target, prop, value)\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n if (prop === 'properties') {\n // Properties are read-only computed values from propertyInstances\n // Cannot be set directly - properties are managed via ItemProperty instances\n throw new Error('Cannot set item.properties directly. Properties are computed from ItemProperty instances.')\n } else {\n // Standard property update\n target._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n }\n return true\n }\n \n // For non-tracked properties, use Reflect\n return Reflect.set(target, prop, value)\n },\n \n has(target, prop: string | symbol) {\n // Check tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n return prop in context\n }\n return Reflect.has(target, prop)\n },\n \n ownKeys(target) {\n // Return keys from target\n return Reflect.ownKeys(target)\n },\n \n getOwnPropertyDescriptor(target, prop: string | symbol) {\n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n if (prop in context) {\n return {\n enumerable: true,\n configurable: true,\n value: (context as any)[prop],\n writable: true,\n }\n }\n }\n return Reflect.getOwnPropertyDescriptor(target, prop)\n },\n }) as Item<any>\n \n this.instanceCache.set((proxiedInstance.seedUid || proxiedInstance.seedLocalId) as string, {\n instance: proxiedInstance,\n refCount: 1,\n })\n if (!waitForReady) return proxiedInstance\n await waitForEntityIdle(proxiedInstance, { timeout: readyTimeout })\n return proxiedInstance\n }\n\n /**\n * Get Item instance by ID from cache\n * The ID can be either seedUid or seedLocalId\n * @param id - seedUid or seedLocalId\n * @returns Cached Item instance or null if not found\n */\n static getById(id: string): Item<any> | null {\n if (!id) {\n return null\n }\n \n // Check cache - the cache key is seedUid || seedLocalId\n if (this.instanceCache.has(id)) {\n const { instance, refCount } = this.instanceCache.get(id)!\n this.instanceCache.set(id, {\n instance,\n refCount: refCount + 1,\n })\n return instance\n }\n \n return null\n }\n\n /**\n * Create Item instance by ID (queries database if not in cache)\n * The ID can be either seedUid or seedLocalId\n * @param id - seedUid or seedLocalId\n * @param modelName - Optional model name for querying\n * @returns Item instance or undefined if not found\n */\n static async createById(id: string, modelName?: string): Promise<Item<any> | undefined> {\n if (!id) {\n return undefined\n }\n\n // Check cache first\n const cached = this.getById(id)\n if (cached) {\n return cached\n }\n\n // Determine if id is seedUid or seedLocalId by querying database\n // Try seedUid first, then seedLocalId\n let itemData = await getItemData({\n modelName,\n seedUid: id,\n })\n\n if (!itemData) {\n // Try as seedLocalId\n itemData = await getItemData({\n modelName,\n seedLocalId: id,\n })\n }\n\n if (!itemData) {\n return undefined\n }\n\n // Item.create() will handle caching the new instance\n return await Item.create({\n ...itemData,\n modelName,\n })\n }\n\n static async find({\n modelName,\n seedLocalId,\n seedUid,\n waitForReady = true,\n readyTimeout = 5000,\n }: ItemFindProps & {\n waitForReady?: boolean\n readyTimeout?: number\n }): Promise<IItem<any> | undefined> {\n if (!seedLocalId && !seedUid) {\n return undefined\n }\n\n // Use seedUid as primary ID if available, otherwise use seedLocalId\n const id = seedUid || seedLocalId\n if (!id) {\n return undefined\n }\n\n try {\n return await findEntity<Item<any>>(\n {\n getById: (id) => Item.getById(id) || undefined,\n createById: async (id) => {\n // Pass modelName to createById if available\n return await Item.createById(id, modelName)\n },\n },\n { id },\n {\n waitForReady,\n readyTimeout,\n }\n )\n } catch (error) {\n return undefined\n }\n }\n\n static async all(\n modelName?: string,\n deleted?: boolean,\n options?: {\n waitForReady?: boolean\n readyTimeout?: number\n includeEas?: boolean\n addressFilter?: 'owned' | 'watched' | 'all'\n },\n ): Promise<Item<any>[]> {\n const {\n waitForReady = false,\n readyTimeout = 5000,\n includeEas = false,\n addressFilter,\n } = options ?? {}\n const itemsData = await getItemsData({ modelName, deleted, includeEas, addressFilter })\n const itemInstances: Item<any>[] = []\n for (const itemData of itemsData) {\n itemInstances.push(\n await Item.create({\n ...itemData,\n modelName,\n }),\n )\n }\n\n if (waitForReady && itemInstances.length > 0) {\n await Promise.all(\n itemInstances.map((item) =>\n waitForEntityIdle(item, { timeout: readyTimeout }),\n ),\n )\n }\n\n return orderBy(itemInstances, ['createdAt'], ['desc'])\n }\n\n protected _createPropertyInstance(props: Partial<CreatePropertyInstanceProps>) {\n if (this._storageTransactionId) {\n props.storageTransactionId = this._storageTransactionId\n }\n\n const propertyInstance = ItemProperty.create(props, {\n waitForReady: false,\n })\n\n if (!propertyInstance || !props.propertyName) {\n return\n }\n\n this._service.send({\n type: 'addPropertyInstance',\n propertyName: props.propertyName,\n propertyInstance,\n })\n\n this._definePropertyAccessor(props.propertyName)\n }\n\n /**\n * Defines a property accessor on this Item that delegates get/set to the\n * ItemProperty in context.propertyInstances at access time (so the correct\n * instance is used after loadOrCreateItemSuccess merges DB-backed instances).\n */\n protected _definePropertyAccessor(propertyName: string): void {\n let state = itemInstanceState.get(this)\n if (!state) {\n state = { liveQuerySubscription: null, definedPropertyNames: new Set() }\n itemInstanceState.set(this, state)\n }\n if (state.definedPropertyNames.has(propertyName)) {\n return\n }\n Object.defineProperty(this, propertyName, {\n get: () => {\n const inst = this._service.getSnapshot().context.propertyInstances?.get(propertyName)\n return inst?.value\n },\n set: (value: any) => {\n const inst = this._service.getSnapshot().context.propertyInstances?.get(propertyName)\n if (inst) {\n inst.value = value\n }\n },\n enumerable: true,\n })\n state.definedPropertyNames.add(propertyName)\n }\n\n static async publish(item: IItem<any>): Promise<void> {\n await item.publish()\n }\n\n subscribe = (callback: (itemProps: any) => void): Subscription => {\n return this._service.subscribe((snapshot: SnapshotFrom<typeof itemMachineSingle>) => {\n callback(snapshot.context)\n })\n }\n\n getService = (): ActorRefFrom<typeof itemMachineSingle> => {\n return this._service\n }\n\n getEditedProperties = async (): Promise<PropertyData[]> => {\n return await getItemProperties({\n seedLocalId: this.seedLocalId,\n edited: true,\n })\n }\n\n publish = async (): Promise<void> => {\n const { assertItemOwned } = await import('@/helpers/ownership')\n await assertItemOwned(this)\n this._service.send({ type: 'startPublish' })\n return new Promise<void>((resolve, reject) => {\n let wasPublishing = false\n const timeoutMs = 300000 // 5 minutes, match previous handler timeout\n const timeoutId = setTimeout(() => {\n unsub.unsubscribe()\n if (!wasPublishing) {\n reject(new Error('Publish did not start (timeout)'))\n } else {\n reject(new Error('Publish timed out'))\n }\n }, timeoutMs)\n const unsub = this._service.subscribe((snapshot: SnapshotFrom<typeof itemMachineSingle>) => {\n const value = snapshot.value as string\n if (value === 'publishing') {\n wasPublishing = true\n }\n if (value === 'idle' && wasPublishing) {\n clearTimeout(timeoutId)\n unsub.unsubscribe()\n const ctx = snapshot.context as { _publishError?: { message: string } | null }\n if (ctx._publishError) {\n reject(new Error(ctx._publishError.message))\n } else {\n resolve()\n }\n }\n })\n })\n }\n\n getPublishUploads = async () => {\n // Use dynamic import to break circular dependency\n const getPublishUploadsMod = await import('../db/read/getPublishUploads')\n const { getPublishUploads } = getPublishUploadsMod\n return await getPublishUploads(this)\n }\n\n getPublishPayload = async (uploadedTransactions: any[]) => {\n // Use dynamic import to break circular dependency\n const getPublishPayloadMod = await import('../db/read/getPublishPayload')\n const { getPublishPayload } = getPublishPayloadMod\n return await getPublishPayload(this, uploadedTransactions)\n }\n\n persistSeedUid = async (): Promise<void> => {\n const ctx = this._getSnapshotContext()\n const seedLocalId = ctx.seedLocalId\n const seedUid = ctx.seedUid\n if (seedLocalId && seedUid && typeof seedUid === 'string' && seedUid.length > 0) {\n await updateSeedUid({ seedLocalId, seedUid })\n }\n }\n\n get serviceContext() {\n const snapshot = this._service.getSnapshot()\n return (snapshot as any).context || {}\n }\n\n /**\n * Get snapshot context from the service\n * Used by the reactive proxy to read tracked properties\n */\n _getSnapshotContext() {\n return (this._service.getSnapshot() as SnapshotFrom<typeof itemMachineSingle>).context\n }\n\n // These getters are now handled by the reactive proxy\n // They read from the service context via the proxy\n // Keeping them for backward compatibility, but they delegate to serviceContext\n get seedLocalId(): string {\n return this.serviceContext.seedLocalId as string\n }\n\n get seedUid(): string | undefined {\n return this.serviceContext.seedUid\n }\n\n get schemaUid(): string | undefined {\n return this.serviceContext.schemaUid\n }\n\n get latestVersionUid(): VersionsType {\n return this.serviceContext.latestVersionUid as VersionsType\n }\n\n get latestVersionLocalId(): string {\n return this.serviceContext.latestVersionLocalId as string\n }\n\n get modelName(): string {\n return this.serviceContext.modelName as string\n }\n\n /**\n * Returns model property names from the Model cache (for use in constructor when\n * property instances are not yet available). Returns [] if modelName is missing\n * or Model is not in cache. Pass schemaName when available so the correct model\n * is resolved (cache is keyed by schemaName:modelName).\n */\n protected _getModelPropertyNames(schemaName?: string): string[] {\n try {\n const Model = getModel()\n const modelName = this.modelName\n if (!modelName) {\n return []\n }\n const model = Model.getByName(modelName, schemaName)\n if (!model) {\n return []\n }\n const modelProperties = model.properties || []\n if (modelProperties.length === 0) {\n return []\n }\n const names: string[] = []\n for (const modelProperty of modelProperties) {\n const propContext = modelProperty._getSnapshotContext()\n const propertyName = propContext.name\n if (propertyName && !INTERNAL_PROPERTY_NAMES.includes(propertyName)) {\n if (!names.includes(propertyName)) {\n names.push(propertyName)\n }\n }\n }\n return names\n } catch {\n return []\n }\n }\n\n /**\n * Helper method to get model schema keys for filtering properties\n * Since properties are loaded from metadata (which already corresponds to the model),\n * we can infer schema keys from the property instances themselves\n * This makes Item independent from Model\n */\n protected _getModelSchemaKeys(): string[] {\n // Get model schema keys - prefer property instances since they come from the database\n // and are already filtered to the correct model. Fall back to Model if property instances\n // aren't available yet.\n const serviceContext = this.serviceContext\n const propertyInstances = serviceContext.propertyInstances as Map<string, IItemProperty> | undefined\n const modelName = this.modelName\n \n // First, try to get schema keys from property instances (most reliable)\n // Property instances come from the database and are already model-specific\n if (propertyInstances && propertyInstances.size > 0) {\n const schemaKeys = this._getSchemaKeysFromPropertyInstances(propertyInstances)\n if (schemaKeys.length > 0) {\n return schemaKeys\n }\n }\n \n // Fall back to Model if property instances aren't available yet\n try {\n const Model = getModel()\n if (!modelName) {\n return []\n }\n \n const model = Model.getByName(modelName)\n if (!model) {\n return []\n }\n \n // Get property names from Model.properties\n const modelProperties = model.properties || []\n if (modelProperties.length === 0) {\n return []\n }\n \n const schemaKeys: string[] = []\n for (const modelProperty of modelProperties) {\n const propContext = modelProperty._getSnapshotContext()\n const propertyName = propContext.name\n if (propertyName && !INTERNAL_PROPERTY_NAMES.includes(propertyName)) {\n if (!schemaKeys.includes(propertyName)) {\n schemaKeys.push(propertyName)\n }\n }\n }\n \n return schemaKeys\n } catch (error) {\n // If Model access fails, return empty array (property instances should be used instead)\n return []\n }\n }\n \n protected _getSchemaKeysFromPropertyInstances(propertyInstances: Map<string, IItemProperty> | undefined): string[] {\n if (!propertyInstances || propertyInstances.size === 0) {\n return []\n }\n \n const schemaKeys: string[] = []\n for (const [key, propertyInstance] of propertyInstances) {\n // Skip internal properties\n if (INTERNAL_PROPERTY_NAMES.includes(key)) {\n continue\n }\n \n // Prefer propertyInstance.propertyName if available (most reliable)\n // Otherwise use the Map key\n let propertyName = propertyInstance.propertyName || key\n \n // Apply transformations if needed\n let transformedKey = propertyName\n if (propertyInstance.alias) {\n transformedKey = propertyInstance.alias\n } else if (propertyName.endsWith('Ids')) {\n transformedKey = pluralize(propertyName.slice(0, -3))\n } else if (propertyName.endsWith('Id')) {\n transformedKey = propertyName.slice(0, -2)\n }\n \n if (!schemaKeys.includes(transformedKey)) {\n schemaKeys.push(transformedKey)\n }\n }\n return schemaKeys\n }\n\n /**\n * Helper method to determine if a property key is a model-specific property\n * (as opposed to an internal/common property)\n *\n * Uses the same transformation as _getSchemaKeysFromPropertyInstances so that\n * Map keys (e.g. \"authorId\", \"tagIds\") are correctly matched to schema keys\n * (e.g. \"author\", \"tags\").\n */\n protected _isModelProperty(key: string, modelSchemaKeys: string[]): boolean {\n if (INTERNAL_PROPERTY_NAMES.includes(key)) {\n return false\n }\n if (modelSchemaKeys.includes(key)) {\n return true\n }\n const propertyInstances = this.serviceContext.propertyInstances as Map<string, IItemProperty> | undefined\n if (!propertyInstances) {\n return false\n }\n const propertyInstance = propertyInstances.get(key)\n if (!propertyInstance) {\n return false\n }\n // Apply same transformation as _getSchemaKeysFromPropertyInstances\n const propertyName = propertyInstance.propertyName || key\n let transformedKey = propertyName\n if (propertyInstance.alias) {\n transformedKey = propertyInstance.alias\n } else if (propertyName.endsWith('Ids')) {\n transformedKey = pluralize(propertyName.slice(0, -3))\n } else if (propertyName.endsWith('Id')) {\n transformedKey = propertyName.slice(0, -2)\n }\n return modelSchemaKeys.includes(transformedKey)\n }\n\n /**\n * Returns only properties that are defined in the Model's schema\n * (excludes internal/common properties)\n */\n get properties(): IItemProperty[] {\n const serviceContext = this.serviceContext\n const propertyInstances = serviceContext.propertyInstances as Map<string, IItemProperty> | undefined\n const modelName = this.modelName\n \n if (!propertyInstances || propertyInstances.size === 0) {\n console.log(`[Item.properties getter] ${modelName}: No property instances`)\n return []\n }\n \n // Get model schema keys for filtering\n const modelSchemaKeys = this._getModelSchemaKeys()\n console.log(`[Item.properties getter] ${modelName}: modelSchemaKeys:`, modelSchemaKeys)\n console.log(`[Item.properties getter] ${modelName}: propertyInstances keys:`, Array.from(propertyInstances.keys()))\n \n // Convert Map to array, filtering by model schema\n const properties: IItemProperty[] = []\n for (const [key, propertyInstance] of propertyInstances) {\n // Skip internal properties\n if (INTERNAL_PROPERTY_NAMES.includes(key)) {\n continue\n }\n \n // Include if it's a model property\n const isModelProp = this._isModelProperty(key, modelSchemaKeys)\n console.log(`[Item.properties getter] ${modelName}: key=\"${key}\", propertyName=\"${propertyInstance.propertyName}\", isModelProperty=${isModelProp}`)\n if (isModelProp) {\n properties.push(propertyInstance)\n }\n }\n \n console.log(`[Item.properties getter] ${modelName}: Returning ${properties.length} properties:`, properties.map(p => p.propertyName))\n // Always return new array reference for React reactivity\n return [...properties]\n }\n\n /**\n * Returns only internal/common properties that are shared across all Items\n * (e.g., seedLocalId, seedUid, createdAt, etc.)\n */\n get internalProperties(): Record<string, IItemProperty> {\n const allProps = this._propertiesSubject.value\n return Object.fromEntries(\n Object.entries(allProps).filter(([key]) =>\n INTERNAL_PROPERTY_NAMES.includes(key)\n )\n )\n }\n\n /**\n * Returns all properties (both model-specific and internal)\n * Useful for backward compatibility or debugging\n */\n get allProperties(): Record<string, IItemProperty> {\n return this._propertiesSubject.value\n }\n\n get attestationCreatedAt(): number {\n return this.serviceContext.attestationCreatedAt as number\n }\n\n get versionsCount(): number {\n return this.serviceContext.versionsCount as number\n }\n\n get lastVersionPublishedAt(): number {\n return this.serviceContext.lastVersionPublishedAt as number\n }\n\n get createdAt(): number | undefined {\n // Try to get from serviceContext first\n if (this.serviceContext.createdAt !== undefined) {\n return this.serviceContext.createdAt as number\n }\n // Try to get from allProperties if it exists as a property\n const createdAtProp = this.allProperties.createdAt\n if (createdAtProp) {\n return createdAtProp.value as number | undefined\n }\n return undefined\n }\n\n /**\n * Set up liveQuery subscription to watch for item and version changes in the database\n * This enables cross-instance synchronization (e.g., changes in other tabs/windows)\n */\n private _setupLiveQuerySubscription(): void {\n const isBrowser = typeof window !== 'undefined'\n const logger = debug('seedSdk:item:liveQuery')\n \n // Use a closure variable to track setup state per instance\n const setupState = { subscriptionSetUp: false }\n\n const setupLiveQuery = async (seedLocalId: string, seedUid?: string) => {\n if (setupState.subscriptionSetUp) {\n return\n }\n\n setupState.subscriptionSetUp = true\n logger(`[Item._setupLiveQuerySubscription] Setting up liveQuery for seedLocalId: ${seedLocalId}`)\n \n try {\n const seedSchemaMod = await import('../seedSchema')\n const { seeds, versions, metadata } = seedSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, and } = drizzleMod\n const versionDataMod = await import('../db/read/subqueries/versionData')\n const { getVersionData } = versionDataMod\n \n const db = BaseDb.getAppDb()\n if (!db) {\n logger('[Item._setupLiveQuerySubscription] Database not available')\n return\n }\n\n // Query initial seed and version data\n const versionData = getVersionData()\n const seedRecords = await db\n .with(versionData)\n .select({\n seedLocalId: seeds.localId,\n seedUid: seeds.uid,\n schemaUid: seeds.schemaUid,\n latestVersionUid: versionData.latestVersionUid,\n latestVersionLocalId: versionData.latestVersionLocalId,\n })\n .from(seeds)\n .leftJoin(versionData, eq(seeds.localId, versionData.seedLocalId))\n .where(\n seedUid ? eq(seeds.uid, seedUid) : eq(seeds.localId, seedLocalId)\n )\n .limit(1)\n\n if (seedRecords.length === 0) {\n logger(`[Item._setupLiveQuerySubscription] Seed not found for seedLocalId: ${seedLocalId}`)\n return\n }\n\n const seedRecord = seedRecords[0]\n const currentVersionLocalId = seedRecord.latestVersionLocalId\n\n if (!currentVersionLocalId) {\n logger(`[Item._setupLiveQuerySubscription] No version found for seedLocalId: ${seedLocalId}`)\n return\n }\n\n // Query initial metadata records for the latest version\n const initialMetadata = await db\n .select()\n .from(metadata)\n .where(\n and(\n eq(metadata.seedLocalId, seedLocalId),\n eq(metadata.versionLocalId, currentVersionLocalId)\n )\n )\n\n const initialMetadataIds = initialMetadata\n .map((row: any) => row.localId || row.uid)\n .filter((id: string | null | undefined): id is string => Boolean(id))\n\n logger(`[Item._setupLiveQuerySubscription] Initial query returned ${initialMetadataIds.length} metadata records`)\n\n // CRITICAL: Create ItemProperty instances BEFORE updating context\n if (initialMetadataIds.length > 0) {\n try {\n const itemPropertyMod = await import('../ItemProperty/ItemProperty')\n const { ItemProperty } = itemPropertyMod\n const itemModelName = this._service.getSnapshot().context.modelName\n const createPromises = initialMetadata.map(async (metaRow: any) => {\n try {\n const property = await ItemProperty.find({\n propertyName: metaRow.propertyName,\n seedLocalId,\n seedUid,\n modelName: itemModelName,\n })\n if (property) {\n logger(`[Item._setupLiveQuerySubscription] Created/cached ItemProperty instance for propertyName \"${metaRow.propertyName}\"`)\n }\n } catch (error) {\n logger(`[Item._setupLiveQuerySubscription] Error creating ItemProperty instance: ${error}`)\n }\n })\n await Promise.all(createPromises)\n } catch (error) {\n logger(`[Item._setupLiveQuerySubscription] Error importing ItemProperty or creating instances: ${error}`)\n }\n }\n\n // Update context with latest version info\n this._service.send({\n type: 'updateContext',\n latestVersionLocalId: currentVersionLocalId,\n latestVersionUid: seedRecord.latestVersionUid,\n })\n\n // Only set up liveQuery subscription in browser environment\n if (isBrowser) {\n // Set up liveQuery to watch seeds table\n // Use proper SQL parameter binding - ensure values are strings, not objects\n const resolvedSeedUid = seedUid || null\n const resolvedSeedLocalId = seedLocalId || null\n \n const seeds$ = BaseDb.liveQuery<{ localId: string; uid: string | null; schemaUid: string | null }>(\n (sql: any) => {\n if (resolvedSeedUid) {\n return sql`\n SELECT local_id as localId, uid, schema_uid as schemaUid\n FROM seeds\n WHERE uid = ${resolvedSeedUid}\n `\n } else if (resolvedSeedLocalId) {\n return sql`\n SELECT local_id as localId, uid, schema_uid as schemaUid\n FROM seeds\n WHERE local_id = ${resolvedSeedLocalId}\n `\n } else {\n // Fallback - should not happen, but handle gracefully\n return sql`\n SELECT local_id as localId, uid, schema_uid as schemaUid\n FROM seeds\n WHERE 1 = 0\n `\n }\n }\n )\n\n // Set up liveQuery to watch versions table for this seed\n const versions$ = BaseDb.liveQuery<{ localId: string; uid: string | null; seedLocalId: string }>(\n (sql: any) => sql`\n SELECT local_id as localId, uid, seed_local_id as seedLocalId\n FROM versions\n WHERE seed_local_id = ${seedLocalId}\n ORDER BY COALESCE(attestation_created_at, created_at) DESC\n `\n )\n\n const instanceState = itemInstanceState.get(this)\n if (!instanceState) {\n logger('[Item._setupLiveQuerySubscription] Instance state not found')\n return\n }\n\n // Subscribe to seeds updates\n const seedsSubscription = seeds$.subscribe({\n next: async (seedRows) => {\n if (seedRows.length === 0) return\n \n const seedRow = seedRows[0]\n logger(`[Item._setupLiveQuerySubscription] Seed updated in database`)\n \n // Update context with seed data\n this._service.send({\n type: 'updateContext',\n seedLocalId: seedRow.localId,\n seedUid: seedRow.uid || undefined,\n schemaUid: seedRow.schemaUid || undefined,\n })\n },\n error: (error) => {\n logger(`[Item._setupLiveQuerySubscription] Seeds liveQuery error: ${error}`)\n },\n })\n\n // Subscribe to versions updates\n const versionsSubscription = versions$.subscribe({\n next: async (versionRows) => {\n if (versionRows.length === 0) return\n \n // Get the most recent version\n const latestVersion = versionRows[0]\n const latestVersionLocalId = latestVersion.localId\n \n logger(`[Item._setupLiveQuerySubscription] Versions updated, latest version: ${latestVersionLocalId}`)\n \n // Query metadata for the latest version\n const metadataRows = await db\n .select()\n .from(metadata)\n .where(\n and(\n eq(metadata.seedLocalId, seedLocalId),\n eq(metadata.versionLocalId, latestVersionLocalId)\n )\n )\n\n // CRITICAL: Create ItemProperty instances BEFORE updating context\n if (metadataRows.length > 0) {\n try {\n const itemPropertyMod = await import('../ItemProperty/ItemProperty')\n const { ItemProperty } = itemPropertyMod\n const itemModelName = this._service.getSnapshot().context.modelName\n const createPromises = metadataRows.map(async (metaRow: any) => {\n try {\n const property = await ItemProperty.find({\n propertyName: metaRow.propertyName,\n seedLocalId,\n seedUid,\n modelName: itemModelName,\n })\n if (property) {\n // Add property instance to context\n this._service.send({\n type: 'addPropertyInstance',\n propertyName: metaRow.propertyName,\n propertyInstance: property,\n })\n logger(`[Item._setupLiveQuerySubscription] Created/cached ItemProperty instance for propertyName \"${metaRow.propertyName}\" from liveQuery`)\n }\n } catch (error) {\n logger(`[Item._setupLiveQuerySubscription] Error creating ItemProperty instance: ${error}`)\n }\n })\n await Promise.all(createPromises)\n } catch (error) {\n logger(`[Item._setupLiveQuerySubscription] Error importing ItemProperty or creating instances from liveQuery: ${error}`)\n }\n }\n \n // Update context with latest version info\n this._service.send({\n type: 'updateContext',\n latestVersionLocalId,\n latestVersionUid: latestVersion.uid || undefined,\n })\n },\n error: (error) => {\n logger(`[Item._setupLiveQuerySubscription] Versions liveQuery error: ${error}`)\n },\n })\n\n // Store combined subscription\n instanceState.liveQuerySubscription = {\n unsubscribe: () => {\n seedsSubscription.unsubscribe()\n versionsSubscription.unsubscribe()\n }\n }\n \n logger(`[Item._setupLiveQuerySubscription] LiveQuery subscription set up for seedLocalId: ${seedLocalId}`)\n } else {\n logger(`[Item._setupLiveQuerySubscription] Skipping liveQuery subscription in Node.js environment`)\n }\n } catch (error) {\n logger(`[Item._setupLiveQuerySubscription] Error setting up subscription: ${error}`)\n setupState.subscriptionSetUp = false // Reset on error so we can retry\n }\n }\n\n // Set up liveQuery subscription as soon as we have seedLocalId\n const setupSubscription = this._service.subscribe(async (snapshot: SnapshotFrom<typeof itemMachineSingle>) => {\n const seedLocalId = snapshot.context.seedLocalId\n const seedUid = snapshot.context.seedUid\n \n if (!seedLocalId && !seedUid) {\n return // Need seed ID to proceed\n }\n\n // Once we have seed ID, set up the liveQuery subscription (only once)\n if ((seedLocalId || seedUid) && !setupState.subscriptionSetUp) {\n await setupLiveQuery(seedLocalId || '', seedUid)\n if (setupState.subscriptionSetUp) {\n setupSubscription.unsubscribe()\n }\n }\n })\n \n // Also check current state immediately in case seedLocalId is already available\n const currentSnapshot = this._service.getSnapshot() as SnapshotFrom<typeof itemMachineSingle>\n if ((currentSnapshot.context.seedLocalId || currentSnapshot.context.seedUid) && !setupState.subscriptionSetUp) {\n setupLiveQuery(currentSnapshot.context.seedLocalId || '', currentSnapshot.context.seedUid || undefined).catch((error) => {\n logger(`[Item._setupLiveQuerySubscription] Error in immediate setup: ${error}`)\n })\n }\n }\n\n unload(): void {\n try {\n const context = this._getSnapshotContext()\n const cacheKey = context.seedUid || context.seedLocalId\n const cacheKeys: string[] = []\n \n if (cacheKey) {\n cacheKeys.push(cacheKey)\n }\n \n unloadEntity(this, {\n getCacheKeys: () => cacheKeys,\n caches: [Item.instanceCache],\n instanceState: itemInstanceState,\n getService: (instance) => instance._service,\n onUnload: (instance) => {\n // Clean up additional subscription\n instance._subscription?.unsubscribe()\n },\n })\n } catch (error) {\n // Still try to clean up what we can\n const instanceState = itemInstanceState.get(this)\n if (instanceState?.liveQuerySubscription) {\n instanceState.liveQuerySubscription.unsubscribe()\n instanceState.liveQuerySubscription = null\n }\n this._subscription?.unsubscribe()\n try {\n this._service.stop()\n } catch {\n // Service might already be stopped\n }\n }\n }\n\n /**\n * Destroy the item: soft delete in DB, remove from caches, clean up subscriptions, stop service.\n */\n async destroy(): Promise<void> {\n const { assertItemOwned } = await import('@/helpers/ownership')\n await assertItemOwned(this)\n const context = this._getSnapshotContext()\n const cacheKey = context.seedUid || context.seedLocalId\n const cacheKeys: string[] = cacheKey ? [cacheKey] : []\n\n clearDestroySubscriptions(this, {\n instanceState: itemInstanceState,\n onUnload: (instance) => (instance as Item<any>)._subscription?.unsubscribe(),\n })\n\n forceRemoveFromCaches(this, {\n getCacheKeys: () => cacheKeys,\n caches: [Item.instanceCache as Map<string, unknown>],\n })\n\n await runDestroyLifecycle(this, {\n getService: (instance) =>\n instance._service as { send: (ev: unknown) => void; stop: () => void },\n doDestroy: async () => {\n await deleteItem({\n seedLocalId: context.seedLocalId,\n seedUid: context.seedUid,\n })\n },\n })\n }\n}","/**\n * Conflict detection result\n */\nexport type ConflictResult = {\n hasConflict: boolean\n localVersion?: number\n dbVersion?: number\n localUpdatedAt?: string\n dbUpdatedAt?: string\n message?: string\n}\n\n/**\n * Error thrown when a conflict is detected between actor context and database\n */\nexport class ConflictError extends Error {\n public readonly conflict: ConflictResult\n public readonly name = 'ConflictError'\n\n constructor(message: string, conflict: ConflictResult) {\n super(message)\n this.conflict = conflict\n Object.setPrototypeOf(this, ConflictError.prototype)\n }\n}\n\n","import type { AddressConfiguration } from '@/types'\n\nexport type NormalizedAddressConfig = { owned: string[]; watched: string[] }\n\n/**\n * Normalizes AddressConfiguration to { owned, watched }.\n * - string[] -> { owned: addresses, watched: [] }\n * - { owned, watched? } -> { owned, watched: watched ?? [] }\n */\nexport function normalizeAddressConfig(\n addresses: AddressConfiguration | undefined\n): NormalizedAddressConfig {\n if (!addresses) {\n return { owned: [], watched: [] }\n }\n if (Array.isArray(addresses)) {\n return { owned: addresses, watched: [] }\n }\n return {\n owned: addresses.owned ?? [],\n watched: addresses.watched ?? [],\n }\n}\n","export const isNode = (): boolean => {\n return (\n typeof process !== 'undefined' &&\n process.versions != null &&\n process.versions.node != null\n )\n}\n\nexport const isBrowser = (): boolean => {\n return !isElectron() && typeof document !== 'undefined' && typeof window !== 'undefined'\n}\n\nexport const isReactNative = (): boolean => {\n return typeof navigator !== 'undefined' && navigator.product === 'ReactNative'\n}\n\nexport const isElectron = (): boolean => {\n return typeof process !== 'undefined' && process.versions != null && process.versions.electron != null;\n}\n\n/**\n * Detects if code is running in an Electron renderer process.\n * \n * Uses multiple detection methods for robustness:\n * 1. Checks process.type === 'renderer' (most reliable)\n * 2. Falls back to checking if Electron is present and window/document exist\n * \n * @returns true if running in Electron renderer process, false otherwise\n */\nexport const isElectronRenderer = (): boolean => {\n // Method 1: Check process.type (most reliable - official Electron API)\n if (\n typeof process !== 'undefined' &&\n (process as any).type === 'renderer'\n ) {\n return true\n }\n\n // Method 2: Fallback - Electron + browser-like environment\n // Renderer processes have window/document, main process doesn't (in modern Electron)\n if (\n isElectron() &&\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n ) {\n return true\n }\n\n return false\n}\n\n/**\n * Detects if code is running in an Electron main process.\n * \n * @returns true if running in Electron main process, false otherwise\n */\nexport const isElectronMain = (): boolean => {\n if (!isElectron()) {\n return false\n }\n\n // Check process.type (official Electron API)\n if (\n typeof process !== 'undefined' &&\n (process as any).type === 'browser'\n ) {\n return true\n }\n\n // Fallback: Electron without window/document (main process)\n // Main process has neither window nor document\n if (\n isElectron() &&\n typeof window === 'undefined' &&\n typeof document === 'undefined'\n ) {\n return true\n }\n\n return false\n}\n\nexport const getEnvironment = (): string => {\n if (isBrowser()) {\n return 'browser'\n }\n\n if (isElectron()) {\n return 'electron'\n }\n\n if (isReactNative()) {\n return 'react-native'\n }\n\n return 'node'\n}\n","import { BaseArweaveClient } from './BaseArweaveClient'\nimport Arweave from 'arweave'\nimport { isBrowser } from '../environment'\n\nlet ArweaveClient: typeof BaseArweaveClient | undefined\n\nexport const initArweaveClient = async () => {\n if (isBrowser()) {\n ArweaveClient = (await import('../../browser/helpers/ArweaveClient')).ArweaveClient\n }\n\n // if (!isBrowser()) {\n // ArweaveClient = (await import('../../node/helpers/ArweaveClient')).ArweaveClient\n // }\n}\n\n/**\n * @deprecated Use BaseArweaveClient methods instead (getTransactionStatus, getTransactionData, createTransaction, etc.)\n * This function is kept for backward compatibility but will be removed in a future version.\n * The Arweave instance is now internal to the platform-specific ArweaveClient implementations.\n * \n * Migration guide:\n * - For transaction status: BaseArweaveClient.getTransactionStatus(transactionId)\n * - For transaction data: BaseArweaveClient.getTransactionData(transactionId, options)\n * - For creating transactions: BaseArweaveClient.createTransaction(data, options)\n * - For transaction tags: BaseArweaveClient.getTransactionTags(transactionId)\n * \n * @returns Arweave instance or undefined if not available\n */\nexport const getArweave = (): Arweave | undefined => {\n if (\n typeof window === 'undefined' ||\n !Arweave ||\n (typeof Arweave.init !== 'function' &&\n !('default' in Arweave && typeof (Arweave as any).default?.init === 'function'))\n ) {\n return\n }\n\n const hostToUse = BaseArweaveClient.getHost()\n\n // Check if Arweave has a default export (ES modules) or is the class itself (CommonJS)\n if ('default' in Arweave && typeof (Arweave as any).default?.init === 'function') {\n return (Arweave as any).default.init({\n host: hostToUse,\n protocol: 'https',\n })\n }\n\n return Arweave.init({\n host: hostToUse,\n protocol: 'https',\n })\n}\n\n/**\n * @deprecated Use BaseArweaveClient.setHost() instead.\n * This function is kept for backward compatibility but will be removed in a future version.\n */\nexport const setArweaveDomain = (newDomain: string): void => {\n BaseArweaveClient.setHost(newDomain)\n}\n\n/**\n * @deprecated Use BaseArweaveClient.getHost() instead.\n * This function is kept for backward compatibility but will be removed in a future version.\n */\nexport const getArweaveDomain = (): string => {\n return BaseArweaveClient.getHost()\n}\n\nexport { ArweaveClient }","import { eventEmitter } from '@/eventBus'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:services:events')\n\nconst handleServiceSaveState = (event: any) => {\n const { state, serviceId } = event\n logger(`[browser] [service.saveState.request] serviceId: ${serviceId}`)\n // TODO: This is called from Node as well. Do we need it? If so, need to generalize this to all platforms.\n // localStorage.setItem(`seed_sdk_service_${serviceId}`, JSON.stringify(state))\n}\n\nexport const setupServicesEventHandlers = () => {\n eventEmitter.addListener('service.saveState.request', handleServiceSaveState)\n}\n","// Dynamic import to break circular dependency: Model -> BaseItem -> ... -> getModelSchemas -> Model\n// import { Model } from '@/Model/Model'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models as modelsTable, modelUids } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\nimport pluralize from 'pluralize'\nimport { toSnakeCase } from '@/helpers'\n\ntype ModelRecord = {\n id: number\n name: string\n uid: string | null\n tableName?: string\n}\n\nconst schemaStringToModelRecord = new Map<string, ModelRecord>()\n\ntype GetModelSchemasReturn = {\n schemaStringToModelRecord: Map<string, ModelRecord>\n modelRecords: ModelRecord[]\n}\n\ntype GetModelSchemas = () => Promise<GetModelSchemasReturn>\n\nexport const getModelSchemas: GetModelSchemas = async () => {\n // Dynamic import to break circular dependency\n const modelMod = await import('../../Model/Model')\n const { Model } = modelMod\n const allModels = await Model.all()\n const modelRecords: ModelRecord[] = []\n\n const appDb = BaseDb.getAppDb()\n\n for (const model of allModels) {\n const modelName = model.modelName\n if (!modelName) continue\n const foundModelQuery = await appDb\n .select({\n id: modelsTable.id,\n name: modelsTable.name,\n uid: modelUids.uid,\n })\n .from(modelsTable)\n .leftJoin(modelUids, eq(modelsTable.id, modelUids.modelId))\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n\n if (!foundModelQuery[0]) {\n console.error(\n `[item/events] [syncDbWithEas] model ${modelName} not found in SDK DB`,\n )\n continue\n }\n\n const foundModel: ModelRecord = {\n id: foundModelQuery[0].id,\n name: foundModelQuery[0].name,\n uid: foundModelQuery[0].uid,\n tableName: pluralize(foundModelQuery[0].name).toLowerCase(),\n }\n\n modelRecords.push(foundModel)\n\n if (modelName === 'Seed') {\n continue\n }\n\n const schemaString = `bytes32 ${toSnakeCase(modelName)}`\n\n schemaStringToModelRecord.set(schemaString, foundModel)\n }\n\n return {\n schemaStringToModelRecord,\n modelRecords,\n }\n}\n","import { seeds, SeedType } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\ntype CreateSeeds = (newSeeds: Partial<SeedType>[]) => Promise<string[]>\n\nexport const createSeeds: CreateSeeds = async (\n newSeeds: Partial<SeedType>[],\n) => {\n const appDb = BaseDb.getAppDb()\n\n const results = await appDb\n .insert(seeds)\n .values(newSeeds)\n .returning({ uid: seeds.uid })\n\n const newUids = results.reduce((acc: string[], result: { uid: string | null }) => {\n if (result.uid) {\n acc.push(result.uid)\n }\n return acc\n }, [] as string[])\n\n return newUids\n}\n","import { camelCase, DebouncedFunc, startCase, throttle } from 'lodash-es'\nimport { Attestation, SchemaWhereInput } from '@/graphql/gql/graphql'\nimport {\n metadata,\n MetadataType,\n modelUids,\n seeds,\n SeedType,\n versions,\n} from '@/seedSchema'\nimport { and, eq, inArray, sql } from 'drizzle-orm'\nimport {\n generateId,\n parseEasRelationPropertyName,\n} from '@/helpers'\nimport { modelPropertiesToObject } from '@/helpers/model'\nimport {\n GET_PROPERTIES,\n GET_SEEDS,\n GET_VERSIONS,\n} from '@/Item/queries'\nimport { escapeSqliteString, getAllAddressesFromDb } from '@/helpers/db'\n// Dynamic import to break circular dependency: Model -> BaseItem -> ... -> syncDbWithEas -> Model\n// import { Model } from '@/Model/Model'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { getModelSchemas } from '@/db/read/getModelSchemas'\nimport { ModelSchema, PropertyType } from '@/types'\nimport { createSeeds } from '@/db/write/createSeeds'\nimport { setSchemaUidForSchemaDefinition } from '@/stores/eas'\nimport { BaseEasClient } from '@/helpers/EasClient/BaseEasClient'\nimport { BaseQueryClient } from '@/helpers/QueryClient/BaseQueryClient'\nimport { getItemPropertiesFromEas, getItemVersionsFromEas, getModelSchemasFromEas, getSeedsFromSchemaUids } from '@/eas'\n\n\nconst relationValuesToExclude = [\n '0x0000000000000000000000000000000000000000000000000000000000000020',\n]\n\n\nconst seedUidToLocalId = new Map<string, string>()\nconst seedUidToModelType = new Map<string, string>()\nconst relatedSeedUids = new Set<string>()\n\nconst versionUidToLocalId = new Map<string, string>()\nconst versionUidToSeedUid = new Map<string, string>()\n\nconst propertyUidToLocalId = new Map<string, string>()\n\ntype SaveEasSeedsToDbProps = {\n itemSeeds: Attestation[]\n}\n\ntype SaveEasSeedsToDbReturn = {\n seedUids: string[]\n}\n\ntype SaveEasSeedsToDb = (\n props: SaveEasSeedsToDbProps,\n) => Promise<SaveEasSeedsToDbReturn>\n\nconst saveEasSeedsToDb: SaveEasSeedsToDb = async ({ itemSeeds }) => {\n const appDb = BaseDb.getAppDb()\n\n const seedUids = itemSeeds.map((seed) => seed.id)\n\n const existingSeedRecordsRows: SeedType[] = await appDb\n .select()\n .from(seeds)\n .where(inArray(seeds.uid, seedUids))\n\n const existingSeedUids = new Set<string>()\n\n if (existingSeedRecordsRows && existingSeedRecordsRows.length > 0) {\n for (const row of existingSeedRecordsRows) {\n if (row.uid) {\n existingSeedUids.add(row.uid)\n if (row.localId) {\n seedUidToLocalId.set(row.uid, row.localId)\n }\n if (row.type) {\n seedUidToModelType.set(row.uid, row.type)\n }\n }\n }\n }\n\n const newSeeds = itemSeeds.filter((seed) => !existingSeedUids.has(seed.id))\n\n if (newSeeds.length === 0) {\n return { seedUidToLocalId, seedUids }\n }\n\n const newSeedsData: Partial<SeedType>[] = []\n\n for (let i = 0; i < newSeeds.length; i++) {\n const seed = newSeeds[i]\n seedUidToModelType.set(seed.id, seed.schema.schemaNames[0].name)\n const seedLocalId = generateId()\n seedUidToLocalId.set(seed.id, seedLocalId)\n\n const attestationRaw = escapeSqliteString(JSON.stringify(seed))\n\n newSeedsData.push({\n localId: seedLocalId,\n uid: seed.id,\n schemaUid: seed.schemaId,\n type: seed.schema.schemaNames[0].name,\n publisher: seed.attester,\n createdAt: Date.now(),\n attestationCreatedAt: seed.timeCreated * 1000,\n attestationRaw,\n })\n\n seedUidToLocalId.set(seed.id, seedLocalId)\n }\n\n const newSeedUids = await createSeeds(newSeedsData)\n\n return { seedUids: newSeedUids }\n}\n\ntype SaveEasVersionsToDbParams = {\n itemVersions: Attestation[]\n}\n\ntype SaveEasVersionsToDb = (\n props: SaveEasVersionsToDbParams,\n) => Promise<SaveEasVersionsToDbReturn>\n\ntype SaveEasVersionsToDbReturn = {\n versionUids: string[]\n}\n\nconst saveEasVersionsToDb: SaveEasVersionsToDb = async ({ itemVersions }) => {\n const versionUids = itemVersions.map((version) => version.id)\n\n const appDb = BaseDb.getAppDb()\n\n const existingVersionRecordsRows: MetadataType[] = await appDb\n .select()\n .from(versions)\n .where(inArray(versions.uid, versionUids))\n\n const existingVersionUids = new Set<string>()\n\n if (existingVersionRecordsRows && existingVersionRecordsRows.length > 0) {\n for (const row of existingVersionRecordsRows) {\n if (row.uid) {\n existingVersionUids.add(row.uid)\n if (row.localId) {\n versionUidToLocalId.set(row.uid, row.localId)\n }\n if (row.seedUid) {\n versionUidToSeedUid.set(row.uid, row.seedUid)\n }\n }\n }\n }\n\n const newVersions = itemVersions.filter(\n (version) => !existingVersionUids.has(version.id),\n )\n\n if (newVersions.length === 0) {\n return { versionUidToLocalId, versionUids }\n }\n\n let insertVersionsQuery = `INSERT INTO versions (local_id, uid, seed_uid, seed_local_id, seed_type, created_at,\n attestation_created_at,\n attestation_raw)\n VALUES `\n\n for (let i = 0; i < newVersions.length; i++) {\n const version = newVersions[i]\n versionUidToSeedUid.set(version.id, version.refUID)\n const versionLocalId = generateId()\n versionUidToLocalId.set(version.id, versionLocalId)\n\n const seedUid = versionUidToSeedUid.get(version.id)\n const seedLocalId = seedUidToLocalId.get(seedUid!)\n const seedType = seedUidToModelType.get(seedUid!)\n const attestationRaw = escapeSqliteString(JSON.stringify(version))\n\n const valuesString = `('${versionLocalId}', '${version.id}', '${seedUid}', '${seedLocalId}', '${seedType}', ${Date.now()}, ${version.timeCreated * 1000}, '${attestationRaw}')`\n\n if (i < newVersions.length - 1) {\n insertVersionsQuery += valuesString + ', '\n }\n\n if (i === newVersions.length - 1) {\n insertVersionsQuery += valuesString + ';'\n }\n\n versionUidToLocalId.set(version.id, versionLocalId)\n }\n\n await appDb.run(sql.raw(insertVersionsQuery))\n\n return { versionUids }\n}\n\nconst createMetadataRecordsForStorageTransactionId = async (\n storageTransactionIdProperty: Attestation,\n modelSchema: ModelSchema | undefined,\n) => {\n // Early return if modelSchema is not provided\n if (!modelSchema) {\n console.warn(\n '[item/events] [syncDbWithEas] modelSchema is undefined for storageTransactionIdProperty: ',\n storageTransactionIdProperty.id,\n )\n return\n }\n\n // Validate and parse decodedDataJson\n if (!storageTransactionIdProperty.decodedDataJson || storageTransactionIdProperty.decodedDataJson.trim() === '') {\n console.warn(\n '[item/events] [syncDbWithEas] empty decodedDataJson for storageTransactionIdProperty: ',\n storageTransactionIdProperty.id,\n )\n return\n }\n\n let parsedData\n try {\n parsedData = JSON.parse(storageTransactionIdProperty.decodedDataJson)\n } catch (error) {\n console.warn(\n '[item/events] [syncDbWithEas] failed to parse decodedDataJson for storageTransactionIdProperty: ',\n storageTransactionIdProperty.id,\n error,\n )\n return\n }\n\n if (!Array.isArray(parsedData) || parsedData.length === 0 || !parsedData[0]?.value) {\n console.warn(\n '[item/events] [syncDbWithEas] invalid decodedDataJson structure for storageTransactionIdProperty: ',\n storageTransactionIdProperty.id,\n )\n return\n }\n\n const attestationData = parsedData[0].value\n const propertyName = camelCase(attestationData.name)\n const propertyValue = attestationData.value\n\n const itemStorageProperties = new Map<string, PropertyType>()\n\n for (const [_propertyName, propertyDef] of Object.entries(modelSchema)) {\n if (propertyDef?.storageType && propertyDef.storageType === 'ItemStorage') {\n itemStorageProperties.set(_propertyName, propertyDef)\n }\n }\n\n if (itemStorageProperties.size === 0) {\n return\n }\n\n const appDb = BaseDb.getAppDb()\n\n for (const [_propertyName, propertyDef] of itemStorageProperties.entries()) {\n const existingMetadataRecordRows = await appDb\n .select()\n .from(metadata)\n .where(\n and(\n eq(metadata.propertyName, _propertyName),\n eq(metadata.propertyValue, propertyValue),\n eq(metadata.versionUid, storageTransactionIdProperty.refUID),\n ),\n )\n\n if (existingMetadataRecordRows && existingMetadataRecordRows.length > 0) {\n continue\n }\n\n const seedUid = versionUidToSeedUid.get(\n storageTransactionIdProperty.refUID,\n ) as string\n const seedLocalId = seedUidToLocalId.get(seedUid)\n const versionUid = storageTransactionIdProperty.refUID\n const versionLocalId = versionUidToLocalId.get(versionUid)\n\n const propertyLocalId = generateId()\n await appDb.insert(metadata).values({\n localId: propertyLocalId,\n propertyName: _propertyName,\n propertyValue,\n localStorageDir: propertyDef.localStorageDir,\n seedLocalId,\n seedUid,\n versionLocalId,\n versionUid,\n refValueType: 'file',\n refResolvedValue: `${propertyValue}${propertyDef.filenameSuffix}`,\n modelType: seedUidToModelType.get(seedUid),\n createdAt: Date.now(),\n updatedAt: Date.now(),\n })\n }\n}\n\ntype SaveEasPropertiesToDbParams = {\n itemProperties: Attestation[]\n itemSeeds: Attestation[]\n}\n\ntype SaveEasPropertiesToDbReturn = {\n propertyUids: string[]\n propertyUidToLocalId?: Map<string, string>\n}\n\ntype SaveEasPropertiesToDb = (\n props: SaveEasPropertiesToDbParams,\n) => Promise<SaveEasPropertiesToDbReturn>\n\nlet isSavingToDb = false\n\nconst saveEasPropertiesToDb: SaveEasPropertiesToDb = async ({\n itemProperties,\n itemSeeds,\n}) => {\n if (isSavingToDb) {\n return { propertyUids: [] }\n }\n isSavingToDb = true\n\n const propertyUids = itemProperties.map((property) => property.id)\n\n // Dynamic import to break circular dependency\n const modelMod = await import('../../Model/Model')\n const { Model } = modelMod\n const allModels = await Model.all()\n const models = Object.fromEntries(allModels.map(m => [m.modelName!, m]))\n\n const appDb = BaseDb.getAppDb()\n\n const existingMetadataRecordsRows: MetadataType[] = await appDb\n .select()\n .from(metadata)\n .where(inArray(metadata.uid, propertyUids))\n\n const existingPropertyRecordsUids = new Set<string>()\n\n if (existingMetadataRecordsRows && existingMetadataRecordsRows.length > 0) {\n for (const row of existingMetadataRecordsRows) {\n if (row.uid) {\n existingPropertyRecordsUids.add(row.uid)\n if (row.localId) {\n propertyUidToLocalId.set(row.uid, row.localId)\n }\n }\n }\n }\n\n const newProperties = itemProperties.filter(\n (property) => !existingPropertyRecordsUids.has(property.id),\n )\n\n if (newProperties.length === 0) {\n return { propertyUidToLocalId, propertyUids }\n }\n\n let insertPropertiesQuery = `INSERT INTO metadata (local_id, uid, schema_uid, property_name, property_value,\n eas_data_type, version_uid, version_local_id, seed_uid,\n seed_local_id, model_type, ref_value_type, ref_seed_type,\n ref_schema_uid,\n created_at, attestation_created_at, attestation_raw,\n local_storage_dir, ref_resolved_value)\n VALUES `\n\n for (let i = 0; i < newProperties.length; i++) {\n const property = newProperties[i]\n const propertyLocalId = generateId()\n \n // Validate and parse decodedDataJson\n if (!property.decodedDataJson || property.decodedDataJson.trim() === '') {\n console.warn(\n '[item/events] [syncDbWithEas] empty decodedDataJson for property: ',\n property.id,\n )\n continue\n }\n\n let parsedData\n try {\n parsedData = JSON.parse(property.decodedDataJson)\n } catch (error) {\n console.warn(\n '[item/events] [syncDbWithEas] failed to parse decodedDataJson for property: ',\n property.id,\n error,\n )\n continue\n }\n\n if (!Array.isArray(parsedData) || parsedData.length === 0 || !parsedData[0]?.value) {\n console.warn(\n '[item/events] [syncDbWithEas] invalid decodedDataJson structure for property: ',\n property.id,\n )\n continue\n }\n\n const metadata = parsedData[0].value\n\n let propertyNameSnake = metadata.name\n\n if (!propertyNameSnake) {\n console.warn(\n '[item/events] [syncDbWithEas] no propertyName found for property: ',\n property,\n )\n continue\n }\n\n let isRelation = false\n let refValueType\n let refSeedType\n let refSchemaUid\n let refResolvedValue\n let isList = false\n const schemaUid = property.schemaId\n\n setSchemaUidForSchemaDefinition({\n text: propertyNameSnake,\n schemaUid,\n })\n\n if (\n (propertyNameSnake.endsWith('_id') ||\n propertyNameSnake.endsWith('_ids')) &&\n propertyNameSnake !== 'storage_transaction_id' &&\n propertyNameSnake !== 'storage_provider_transaction_id'\n ) {\n isRelation = true\n\n if (Array.isArray(metadata.value)) {\n isList = true\n refValueType = 'list'\n\n const result = parseEasRelationPropertyName(propertyNameSnake)\n\n if (result) {\n propertyNameSnake = result.propertyName\n refSeedType = result.modelName\n }\n\n metadata.value.forEach((value: string) => {\n relatedSeedUids.add(value)\n })\n }\n\n if (!isList) {\n if (relationValuesToExclude.includes(metadata.value)) {\n continue\n }\n relatedSeedUids.add(metadata.value)\n }\n }\n\n let propertyValue = metadata.value\n\n if (typeof propertyValue !== 'string') {\n propertyValue = JSON.stringify(propertyValue)\n }\n\n if (isRelation && !isList) {\n const relatedSeed = itemSeeds.find(\n (seed: Attestation) => seed.id === metadata.value,\n )\n if (relatedSeed && relatedSeed.schema && relatedSeed.schema.schemaNames) {\n refSeedType = relatedSeed.schema.schemaNames[0].name\n refSchemaUid = relatedSeed.schemaId\n }\n }\n\n if (isRelation && isList) {\n const relatedSeeds = itemSeeds.filter((seed: Attestation) =>\n metadata.value.includes(seed.id),\n )\n if (relatedSeeds && relatedSeeds.length > 0) {\n refSeedType = relatedSeeds[0].schema.schemaNames[0].name\n refSchemaUid = relatedSeeds[0].schemaId\n }\n }\n\n const propertyName = camelCase(propertyNameSnake)\n propertyValue = escapeSqliteString(propertyValue)\n const easDataType = metadata.type\n const versionUid = property.refUID\n const versionLocalId = versionUidToLocalId.get(versionUid)\n const attestationCreatedAt = property.timeCreated * 1000\n const attestationRaw = escapeSqliteString(JSON.stringify(property))\n const seedUid = versionUidToSeedUid.get(versionUid)\n const seedLocalId = seedUidToLocalId.get(seedUid!)\n const modelType = seedUidToModelType.get(seedUid!)\n\n let localStorageDir\n const modelName = startCase(modelType)\n const model = models[modelName]\n const modelSchema = model?.properties ? modelPropertiesToObject(model.properties) : undefined\n\n if (propertyNameSnake === 'storage_transaction_id') {\n await createMetadataRecordsForStorageTransactionId(property, modelSchema)\n }\n\n const valuesString = `('${propertyLocalId}', '${property.id}', \n '${property.schemaId}', '${propertyName}', \n '${propertyValue}', '${easDataType}', '${versionUid}', \n '${versionLocalId}', '${seedUid}', '${seedLocalId}', \n '${modelType}', ${refValueType ? `'${refValueType}'` : 'NULL'}, \n ${refSeedType ? `'${refSeedType}'` : 'NULL'},\n ${refSchemaUid ? `'${refSchemaUid}'` : 'NULL'},\n ${Date.now()}, ${attestationCreatedAt}, '${attestationRaw}',\n ${localStorageDir ? `'${localStorageDir}'` : 'NULL'},\n ${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'})`\n\n if (i < newProperties.length - 1) {\n insertPropertiesQuery += valuesString + ', '\n }\n\n if (i === newProperties.length - 1) {\n insertPropertiesQuery += valuesString + ';'\n }\n\n propertyUidToLocalId.set(property.id, propertyLocalId)\n }\n\n if (insertPropertiesQuery.endsWith('VALUES ')) {\n return { propertyUids }\n }\n\n if (insertPropertiesQuery.endsWith(', ')) {\n insertPropertiesQuery = insertPropertiesQuery.slice(0, -2) + ';'\n }\n\n await appDb.run(sql.raw(insertPropertiesQuery))\n\n isSavingToDb = false\n\n return { propertyUids }\n}\n\nconst getRelatedSeedsAndVersions = async () => {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const { itemSeeds } = await easClient.request(GET_SEEDS, {\n where: {\n id: {\n in: Array.from(relatedSeedUids),\n },\n },\n })\n\n await saveEasSeedsToDb({ itemSeeds })\n\n const { itemVersions } = await easClient.request(GET_VERSIONS, {\n where: {\n refUID: {\n in: Array.from(relatedSeedUids),\n },\n },\n })\n\n await saveEasVersionsToDb({ itemVersions })\n\n const relatedVersionUids = itemVersions.map((v) => v.id)\n\n const { itemProperties } = await easClient.request(GET_PROPERTIES, {\n where: {\n refUID: {\n in: relatedVersionUids,\n },\n },\n })\n\n await saveEasPropertiesToDb({\n itemProperties,\n itemSeeds,\n })\n}\n\nconst syncDbWithEasHandler: DebouncedFunc<any> = throttle(\n async (_) => {\n const addresses = await getAllAddressesFromDb()\n if (!addresses || addresses.length === 0) {\n return\n }\n\n const appDb = BaseDb.getAppDb()\n\n const { schemaStringToModelRecord } = await getModelSchemas()\n\n const modelSchemas = await getModelSchemasFromEas()\n\n const schemaUids: string[] = []\n\n for (const modelSchema of modelSchemas) {\n const foundModel = schemaStringToModelRecord.get(modelSchema.schema)\n\n if (!foundModel) {\n // Skip schemas that don't have a corresponding model in the user's config\n // This can happen with \"bytes32 image\" if there's no Image model defined\n console.warn(\n `[item/events] [syncDbWithEas] Model not found for schema ${modelSchema.schema}, skipping`\n )\n continue\n }\n\n try {\n await appDb\n .insert(modelUids)\n .values({\n modelId: foundModel.id,\n uid: modelSchema.id,\n })\n .onConflictDoNothing()\n } catch (err: unknown) {\n // Model may have been deleted by test teardown or another process; skip to avoid unhandled rejection\n const e = err as { code?: string; rawCode?: number; cause?: { code?: string; rawCode?: number } }\n const code = e?.code ?? e?.rawCode ?? e?.cause?.code ?? e?.cause?.rawCode\n if (code === 'SQLITE_CONSTRAINT_FOREIGNKEY' || code === 787) {\n continue\n }\n throw err\n }\n\n schemaUids.push(modelSchema.id)\n }\n\n // If no schemas were found, skip the rest of the sync process\n // This can happen when models exist but don't have schemas registered in EAS yet\n if (schemaUids.length === 0) {\n return\n }\n\n const itemSeeds = await getSeedsFromSchemaUids({\n schemaUids,\n addresses,\n })\n\n // const seedDbRecords = new Map<string, Record<string, unknown>>()\n\n const { seedUids } = await saveEasSeedsToDb({\n itemSeeds,\n })\n\n const itemVersions = await getItemVersionsFromEas({\n seedUids\n })\n\n const { versionUids } = await saveEasVersionsToDb({\n itemVersions,\n })\n\n const itemProperties = await getItemPropertiesFromEas({\n versionUids,\n })\n\n const { propertyUids } = await saveEasPropertiesToDb({\n itemProperties,\n itemSeeds,\n })\n\n await getRelatedSeedsAndVersions()\n\n // Note: Removed item.requestAll emission - no listeners registered\n },\n 30000,\n {\n leading: true,\n trailing: false,\n },\n)\n\nexport { syncDbWithEasHandler }\n","import { eventEmitter } from '@/eventBus'\nimport { syncDbWithEasHandler } from '@/events/item/syncDbWithEas'\n\nlet areReady = false\n\nexport const setupAllItemsEventHandlers = () => {\n eventEmitter.addListener('syncDbWithEas', syncDbWithEasHandler)\n areReady = true\n}\n\n// Note: getAreItemEventHandlersReady removed - was only used by useItemIsReady hook which has been removed\n","// AllItems services have been removed - this handler is no longer needed\n// Service state persistence is now handled by entity instances directly\n\nimport { saveAppState } from '@/db/write/saveAppState'\n\ntype SaveServiceEvent = {\n modelName: string\n}\n\nexport const saveServiceHandler = async (event: SaveServiceEvent) => {\n // AllItems services removed - this functionality is no longer needed\n // Entity instances (Schema, Model, Item) manage their own state\n console.warn('[saveServiceHandler] AllItems services removed - handler is a no-op')\n}\n","import { eventEmitter } from '@/eventBus'\nimport { saveServiceHandler } from './allItems'\n\nlet areReady = false\n\nexport const setupServiceHandlers = () => {\n eventEmitter.addListener('service.save', saveServiceHandler)\n areReady = true\n}\n\nexport const getAreServiceHandlersReady = () => {\n return areReady\n}\n","export abstract class BasePathResolver {\n private static instance: BasePathResolver\n private static PlatformClass: typeof BasePathResolver\n\n static setPlatformClass(platformClass: typeof BasePathResolver) {\n this.PlatformClass = platformClass\n }\n\n static getInstance(): BasePathResolver {\n if (!BasePathResolver.instance) {\n if (!BasePathResolver.PlatformClass) {\n throw new Error('PathResolver PlatformClass not set. Please ensure the platform-specific PathResolver is imported. For Node.js, import from @seedprotocol/sdk/node. For browser, the SDK should auto-initialize.')\n }\n if (BasePathResolver.PlatformClass === BasePathResolver) {\n throw new Error('Circular reference detected: PlatformClass is set to BasePathResolver')\n }\n BasePathResolver.instance = new (BasePathResolver.PlatformClass as any)()\n }\n return BasePathResolver.instance\n }\n\n abstract getRootWithNodeModules(): string\n abstract getSdkRootDir(): string\n abstract getNodeModulesDir(): string\n abstract getDotSeedDir(schemaFileDir?: string): string\n abstract findConfigFile(searchDir?: string): string | null\n abstract getAppPaths(schemaFileDir?: string | undefined): {\n sdkRootDir: string\n dotSeedDir: string\n nodeModulesDir: string\n appSchemaDir: string\n appDbDir: string\n appMetaDir: string\n drizzleKitPath: string\n templatePath: string\n }\n}\n\n","import { ClientManagerContext, FromCallbackInput, SeedConstructorOptions } from '@/types'\nimport { fromCallback, EventObject, waitFor } from \"xstate\";\nimport debug from 'debug'\nimport { setArweaveDomain } from \"@/helpers/ArweaveClient\";\nimport { setupServicesEventHandlers } from \"@/services/events\";\nimport { setupAllItemsEventHandlers } from \"@/events/item\";\nimport { setupServiceHandlers } from \"@/events/services\";\n// import { getGlobalService, } from \"@/services/global/globalMachine\";\n// import { GlobalState } from \"@/client/constants\";\nimport { isBrowser, isNode } from \"@/helpers/environment\";\nimport { BaseFileManager } from \"@/helpers/FileManager/BaseFileManager\";\nimport { BaseArweaveClient, BaseEasClient, BaseQueryClient } from \"@/helpers\";\nimport { BasePathResolver } from '@/helpers/PathResolver/BasePathResolver'\nimport { BaseDb } from '../../db/Db/BaseDb'\nimport { normalizeAddressConfig } from '@/helpers/addresses'\n\nconst logger = debug('seedSdk:ClientManager:initialize')\n\ntype InitEvent = {\n type: 'init'\n options: SeedConstructorOptions\n}\n\nexport const platformClassesInit = fromCallback<\nEventObject, \nFromCallbackInput<ClientManagerContext, InitEvent>\n>(({sendBack, input: {context, event}}) => {\n logger('initialize from ClientManager')\n const { isInitialized } = context\n \n if (!event || !('options' in event)) {\n throw new Error('Initialize event must include options')\n }\n \n const { options } = event\n\n if (isInitialized) {\n sendBack({type: 'initialized'})\n return\n }\n\n // Validate synchronously before starting async operations\n // This ensures errors are handled immediately, preventing unhandled rejections\n const { config } = options\n const { endpoints } = config || {}\n \n // Track if the operation is cancelled\n let cancelled = false\n\n // Create a promise that will handle validation errors immediately\n // We use Promise.resolve().then() to ensure the catch handler is attached synchronously\n // before the async function starts executing, preventing unhandled rejections\n const initPromise = Promise.resolve().then(async () => {\n // Check if cancelled before starting\n if (cancelled) {\n return\n }\n\n const { config, addresses } = options\n\n // Validate required endpoints - this should happen early in the initialization process\n if (!config?.endpoints || !config.endpoints.filePaths || !config.endpoints.files) {\n throw new Error('Config must include endpoints with filePaths and files')\n }\n\n let FileManager: typeof BaseFileManager\n let Db: typeof BaseDb\n let QueryClient: typeof BaseQueryClient\n let ArweaveClient: typeof BaseArweaveClient\n let PathResolver: typeof BasePathResolver\n let EasClient: typeof BaseEasClient\n\n if (isBrowser()) {\n FileManager = (await import('../../browser/helpers/FileManager')).FileManager\n Db = (await import('../../browser/db/Db')).Db\n QueryClient = (await import('../../browser/helpers/QueryClient')).QueryClient\n ArweaveClient = (await import('../../browser/helpers/ArweaveClient')).ArweaveClient\n PathResolver = (await import('../../browser/helpers/PathResolver')).PathResolver\n EasClient = (await import('../../browser/helpers/EasClient')).EasClient\n } else if (isNode()) {\n console.log('isNode')\n FileManager = (await import('../../node/helpers/FileManager')).FileManager\n Db = (await import('../../node/db/Db')).Db\n QueryClient = (await import('../../node/helpers/QueryClient')).QueryClient\n ArweaveClient = (await import('../../node/helpers/ArweaveClient')).ArweaveClient\n PathResolver = (await import('../../node/helpers/PathResolver')).PathResolver\n EasClient = (await import('../../node/helpers/EasClient')).EasClient\n } else {\n throw new Error(`Unable to determine environment. isBrowser()=${isBrowser()}, isNode()=${isNode()}. Platform-specific implementations could not be loaded.`)\n }\n \n if (!FileManager) {\n throw new Error('FileManager is undefined. Platform-specific FileManager could not be loaded.')\n }\n \n BaseFileManager.setPlatformClass(FileManager)\n BaseDb.setPlatformClass(Db!)\n BaseQueryClient.setPlatformClass(QueryClient!)\n BaseEasClient.setPlatformClass(EasClient!)\n BaseArweaveClient.setPlatformClass(ArweaveClient!)\n BasePathResolver.setPlatformClass(PathResolver!)\n\n // Check if cancelled after async imports\n if (cancelled) {\n return\n }\n \n const { models, endpoints, arweaveDomain, dbConfig, filesDir } = config\n\n // Note: Validation already happened above, but we have endpoints here for path normalization\n\n // Normalize filesDir for Node.js environment\n // In Node.js, filesDir should be resolved relative to .seed directory at project root\n let normalizedFilesDir = filesDir || endpoints?.files\n if (isNode() && normalizedFilesDir) {\n const path = (await import('node:path')).default\n const fs = (await import('node:fs')).default\n const pathResolver = BasePathResolver.getInstance()\n const dotSeedDir = pathResolver.getDotSeedDir()\n \n // Ensure .seed directory exists\n if (!fs.existsSync(dotSeedDir)) {\n fs.mkdirSync(dotSeedDir, { recursive: true })\n }\n \n // Check if filesDir is a browser OPFS-style path (absolute path starting with '/'\n // that is a simple single-level path like '/app-files', not a real filesystem path)\n // Browser OPFS paths are typically simple like '/app-files', '/files', etc.\n const pathWithoutLeadingSlash = normalizedFilesDir.slice(1)\n const isBrowserOpfsPath = path.isAbsolute(normalizedFilesDir) && \n normalizedFilesDir.startsWith('/') &&\n pathWithoutLeadingSlash.length > 0 &&\n !pathWithoutLeadingSlash.includes('/') && // Single directory name, no subdirectories\n !fs.existsSync(normalizedFilesDir) // Doesn't exist on filesystem\n \n if (isBrowserOpfsPath) {\n // Convert browser OPFS path to .seed subdirectory\n // e.g., '/app-files' -> '.seed/app-files'\n const dirName = normalizedFilesDir.slice(1) || 'app-files'\n normalizedFilesDir = path.join(dotSeedDir, dirName)\n } else if (!path.isAbsolute(normalizedFilesDir)) {\n // If it's a relative path, check if it already starts with .seed\n if (normalizedFilesDir.startsWith('.seed') || normalizedFilesDir.startsWith('.seed/')) {\n // Already relative to project root, resolve it\n normalizedFilesDir = path.resolve(normalizedFilesDir)\n } else {\n // Resolve relative to .seed directory\n normalizedFilesDir = path.join(dotSeedDir, normalizedFilesDir)\n }\n }\n // If it's an absolute path that exists or is a valid filesystem path, use it as-is\n }\n\n const normalizedAddresses = normalizeAddressConfig(addresses)\n sendBack({ type: 'updateContext', context: { \n models: models || {}, \n endpoints, \n arweaveDomain, \n addresses: normalizedAddresses.owned,\n ownedAddresses: normalizedAddresses.owned,\n watchedAddresses: normalizedAddresses.watched,\n filesDir: normalizedFilesDir,\n dbConfig,\n } })\n \n if (arweaveDomain) {\n setArweaveDomain(arweaveDomain)\n }\n\n // Models are now Model instances, no registration needed\n // They should be created via Model.create() and are accessible via Model static methods\n setupAllItemsEventHandlers()\n setupServicesEventHandlers()\n setupServiceHandlers()\n })\n\n // Handle the promise immediately - this ensures rejections are caught synchronously\n // The catch handler is attached synchronously before the async function executes\n initPromise\n .then(() => {\n if (!cancelled) {\n sendBack({type: 'platformClassesReady'})\n }\n })\n .catch((error) => {\n // Only send error if not cancelled (prevents unhandled rejections after cleanup)\n if (!cancelled) {\n // Send error event using sendBack - this is the recommended XState pattern\n // The parent state machine should handle the 'error' event\n sendBack({ \n type: 'error', \n error: error instanceof Error ? error : new Error(String(error))\n })\n }\n // Explicitly handle the rejection to prevent unhandled promise rejection warnings\n // The error has been sent via sendBack, so we've handled it\n })\n\n // Return cleanup function to cancel pending operations\n return () => {\n cancelled = true\n // The promise will still resolve/reject, but we won't send events if cancelled\n // This prevents unhandled rejections after the callback is cleaned up\n }\n})\n","import { fromCallback } from \"xstate\";\nimport { EventObject } from \"xstate\";\nimport debug from \"debug\";\nimport { appState } from \"@/seedSchema\";\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nconst logger = debug('seedSdk:client:writeToDb')\n\ntype SaveAppStateInput = {\n key: string\n value: any\n}\n\nexport const saveAppState = fromCallback<\nEventObject, \nSaveAppStateInput\n>(\n ({sendBack, input: {key, value}}) => {\n\n const _saveAppState = async () => {\n try {\n const appDb = BaseDb.getAppDb()\n if (!appDb) {\n // In test environments, continue anyway\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[client/actors] [saveAppState] App DB not found, but continuing in test environment')\n return\n }\n throw new Error('App DB not found')\n }\n\n const result = await appDb.insert(appState)\n .values({\n key: key,\n value: JSON.stringify(value),\n })\n .onConflictDoUpdate({\n target: appState.key,\n set: {\n value: JSON.stringify(value),\n },\n })\n\n logger('result', result)\n } catch (error: any) {\n logger('[client/actors] [saveAppState] Error saving app state:', error)\n // In test environments, continue anyway\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[client/actors] [saveAppState] Continuing despite error in test environment')\n return\n }\n throw error\n }\n }\n\n _saveAppState()\n .then(() => {\n sendBack({\n type: 'saveAppStateSuccess',\n key,\n value,\n })\n })\n .catch((error: any) => {\n logger('[client/actors] [saveAppState] Error in promise chain:', error)\n // In test environments, still send success to allow state machine to progress\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[client/actors] [saveAppState] Sending success despite error in test environment')\n sendBack({\n type: 'saveAppStateSuccess',\n key,\n value,\n })\n } else {\n throw error\n }\n })\n \n })\n","import { graphql } from '@/graphql/gql'\n\nexport const GET_FILES_METADATA = graphql(/* GraphQL */ `\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n`)\n\nexport const GET_ARWEAVE_TRANSACTIONS = graphql(/* GraphQL */ `\n query GetArweaveTransactions(\n $owners: [String!]\n $first: Int\n $after: String\n ) {\n transactions(owners: $owners, first: $first, after: $after) {\n edges {\n cursor\n node {\n id\n anchor\n signature\n block {\n id\n height\n }\n data {\n size\n type\n }\n tags {\n name\n value\n }\n }\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n`)\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { and, eq, SQL } from 'drizzle-orm'\nimport { metadata, MetadataType } from '@/seedSchema'\n\ntype GetMetadataProps =\n | {\n storageTransactionId?: string\n }\n | undefined\n\ntype GetMetadata = (\n props: GetMetadataProps,\n) => Promise<MetadataType | undefined>\n\nexport const getMetadata: GetMetadata = async (props) => {\n const appDb = BaseDb.getAppDb()\n\n let storageTransactionId: string | undefined\n if (props) {\n storageTransactionId = props.storageTransactionId\n }\n\n const whereClauses: SQL[] = []\n\n if (storageTransactionId) {\n whereClauses.push(eq(metadata.propertyName, 'storageTransactionId'))\n whereClauses.push(eq(metadata.propertyValue, storageTransactionId))\n }\n\n const metadataRows = await appDb\n .select()\n .from(metadata)\n .where(and(...whereClauses))\n\n if (!metadataRows || metadataRows.length === 0) {\n return\n }\n\n return metadataRows[0]\n}\n","import { metadata, MetadataType } from '@/seedSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { eq } from 'drizzle-orm'\n\nexport const saveMetadata = async (\n metadataRecord: Partial<MetadataType>,\n metadataValues: Partial<MetadataType>,\n) => {\n if (!metadataRecord.localId) {\n return\n }\n\n const appDb = BaseDb.getAppDb()\n\n await appDb\n .update(metadata)\n .set({\n ...metadataValues,\n updatedAt: Date.now(),\n })\n .where(eq(metadata.localId, metadataRecord.localId))\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { appState } from '@/seedSchema'\n\nexport const saveAppState = async (key: string, value: string) => {\n const appDb = BaseDb.getAppDb()\n\n await appDb\n .insert(appState)\n .values({\n key,\n value,\n })\n .onConflictDoUpdate({\n target: appState.key,\n set: {\n value,\n },\n })\n}\n","import { eventEmitter } from '@/eventBus'\nimport { appState } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\nimport { getAllAddressesFromDb } from '@/helpers/db'\nimport {\n BaseFileManager,\n} from '@/helpers'\nimport { GET_FILES_METADATA } from '@/helpers/file/queries'\nimport debug from 'debug'\n// Dynamic import to break circular dependency with globalMachine\n// import { getGlobalService } from '@/services/global/globalMachine'\nimport { waitFor } from 'xstate'\nimport { getMetadata } from '@/db/read/getMetadata'\nimport { saveMetadata } from '@/db/write/saveMetadata'\nimport { saveAppState } from '@/db/write/saveAppState'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { BaseEasClient, BaseQueryClient, BaseArweaveClient } from '@/helpers'\nimport { isBrowser } from '@/helpers/environment'\nimport { Endpoints } from '@/types'\n\n\nconst logger = debug('seedSdk:files:download')\n\n// syncDbFiles helper - internal service removed, functionality moved here\nconst syncDbFiles = async (endpoints: any) => {\n // TODO: Implement syncDbFiles functionality if needed\n // This was previously in @/services/internal/helpers\n logger('[download] syncDbFiles called but not yet implemented')\n return Promise.resolve()\n}\n\n\ntype DownloadAllFilesRequestHandlerProps = {\n endpoints: Endpoints\n eventId: string\n}\n\nexport const downloadAllFilesRequestHandler = async ({\n endpoints,\n eventId,\n}: DownloadAllFilesRequestHandlerProps) => {\n\n if (!isBrowser()) {\n return\n }\n\n await syncDbFiles(endpoints)\n\n eventEmitter.emit('fs.downloadAll.success', { eventId })\n eventEmitter.emit('fs.downloadAllBinary.request', { endpoints })\n}\n\nexport const downloadAllFilesBinaryRequestHandler = async () => {\n let addresses: string[] | undefined\n\n if (BaseDb.isAppDbReady()) {\n addresses = await getAllAddressesFromDb()\n }\n\n if (!BaseDb.isAppDbReady()) {\n // Wait for ClientManager to be ready (DB_INIT state or later)\n const clientManagerMod = await import('../../client/ClientManager')\n const { getClient } = clientManagerMod\n const clientManager = getClient()\n const clientService = clientManager.getService()\n \n await waitFor(clientService, (snapshot) => {\n const state = snapshot.value\n return state === 'dbInit' || \n state === 'saveConfig' ||\n state === 'processSchemaFiles' ||\n state === 'addModelsToStore' ||\n state === 'addModelsToDb' ||\n state === 'idle'\n }, { timeout: 30000 })\n addresses = await getAllAddressesFromDb()\n }\n\n if (!addresses || addresses.length === 0) {\n return\n }\n\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n const { filesMetadata } = await queryClient.fetchQuery({\n queryKey: ['getFilesMetadata', ...addresses],\n queryFn: async () =>\n easClient.request(GET_FILES_METADATA, {\n where: {\n attester: {\n in: addresses,\n },\n schema: {\n is: {\n id: {\n equals:\n '0x55fdefb36fcbbaebeb7d6b41dc3a1a9666e4e42154267c889de064faa7ede517',\n },\n },\n },\n },\n }),\n })\n\n await BaseFileManager.createDirIfNotExists('/files')\n await BaseFileManager.createDirIfNotExists('/files/html')\n await BaseFileManager.createDirIfNotExists('/files/json')\n await BaseFileManager.createDirIfNotExists('/files/images')\n\n const appDb = BaseDb.getAppDb()\n\n if (!appDb) {\n console.warn('[fetchAll/actors] [fetchAllBinaryData] seedDb not available')\n return []\n }\n\n const excludedTransactionsQuery = await appDb\n .select()\n .from(appState)\n .where(eq(appState.key, 'excludedTransactions'))\n\n let excludedTransactions = new Set<string>()\n\n if (excludedTransactionsQuery && excludedTransactionsQuery.length === 1) {\n const valueString = excludedTransactionsQuery[0].value\n if (valueString) {\n const excludedTransactionsArray = JSON.parse(valueString)\n excludedTransactions = new Set(excludedTransactionsArray)\n }\n }\n\n const transactionIds = []\n\n for (const fileMetadata of filesMetadata) {\n // Validate and parse decodedDataJson\n if (!fileMetadata.decodedDataJson || fileMetadata.decodedDataJson.trim() === '') {\n console.warn(\n '[events/files] [download] empty decodedDataJson for fileMetadata: ',\n fileMetadata.id,\n )\n continue\n }\n\n let json\n try {\n json = JSON.parse(fileMetadata.decodedDataJson)\n } catch (error) {\n console.warn(\n '[events/files] [download] failed to parse decodedDataJson for fileMetadata: ',\n fileMetadata.id,\n error,\n )\n continue\n }\n\n if (!Array.isArray(json) || json.length === 0 || !json[0]?.value?.value) {\n console.warn(\n '[events/files] [download] invalid decodedDataJson structure for fileMetadata: ',\n fileMetadata.id,\n )\n continue\n }\n\n const transactionId = json[0].value.value\n if (excludedTransactions.has(transactionId)) {\n continue\n }\n transactionIds.push(transactionId)\n }\n\n const transactionIdsToDownload = []\n\n for (const transactionId of transactionIds) {\n\n try {\n // Use BaseArweaveClient for transaction status check\n const status = await BaseArweaveClient.getTransactionStatus(transactionId)\n\n if (status.status !== 200) {\n logger(\n `[fetchAll/actors] [fetchAllBinaryData] error fetching transaction data for ${transactionId}`,\n )\n\n excludedTransactions.add(transactionId)\n\n await saveAppState(\n 'excludedTransactions',\n JSON.stringify(Array.from(excludedTransactions)),\n )\n\n continue\n }\n \n // Use BaseArweaveClient for getting transaction tags\n const tags = await queryClient.fetchQuery({\n queryKey: ['getTransactionTags', transactionId],\n queryFn: async () => BaseArweaveClient.getTransactionTags(transactionId),\n })\n\n if (tags && tags.length > 0) {\n for (const { name, value } of tags) {\n if (name === 'Content-SHA-256') {\n const metadataRecord = await getMetadata({\n storageTransactionId: transactionId,\n })\n\n if (metadataRecord) {\n await saveMetadata(metadataRecord, {\n contentHash: value,\n })\n }\n }\n }\n }\n\n transactionIdsToDownload.push(transactionId)\n\n } catch (error) {\n logger(error)\n }\n }\n\n await BaseFileManager.downloadAllFiles({\n transactionIds: transactionIdsToDownload,\n arweaveHost: BaseArweaveClient.getHost(),\n excludedTransactions,\n })\n\n await BaseFileManager.resizeAllImages({\n width: 480,\n height: 480,\n })\n}\n","import { eventEmitter } from '@/eventBus'\nimport { downloadAllFilesBinaryRequestHandler, downloadAllFilesRequestHandler } from './download'\n\nlet isInitialized = false\n\nconst fsInitHandler = async () => {\n if ( isInitialized ) {\n return\n }\n\n isInitialized = true\n\n}\n\nlet areReady = false\n\nexport const setupFsListeners = () => {\n eventEmitter.addListener(\n 'fs.downloadAll.request',\n downloadAllFilesRequestHandler,\n )\n eventEmitter.addListener(\n 'fs.downloadAllBinary.request',\n downloadAllFilesBinaryRequestHandler,\n )\n eventEmitter.addListener('fs.init', fsInitHandler)\n areReady = true\n}\n\nexport const areFsListenersReady = () => {\n return areReady\n}\n\nexport const isFsInitialized = () => {\n return isInitialized\n}\n","import { BaseFileManager } from \"@/helpers\";\nimport { ClientManagerContext, FromCallbackInput } from \"@/types/machines\";\nimport { EventObject, fromCallback } from \"xstate\";\nimport { areFsListenersReady, setupFsListeners } from \"@/events/files\";\nimport { eventEmitter } from \"@/eventBus\";\nimport debug from \"debug\";\n\nconst logger = debug('seedSdk:client:actors:fileSystemInit')\n\nexport const fileSystemInit = fromCallback<\nEventObject, \nFromCallbackInput<ClientManagerContext>\n>(({sendBack, input: {context},}) => {\n\n setupFsListeners()\n\n if (!areFsListenersReady()) {\n throw new Error('fs listeners not ready during init')\n }\n\n // Check for filesDir synchronously before starting async operation\n // This ensures the error is thrown synchronously and caught by XState\n const { filesDir } = context\n if (!filesDir) {\n throw new Error('filesDir is required')\n }\n\n const _fileSystemInit = async () => {\n await BaseFileManager.initializeFileSystem(filesDir)\n eventEmitter.emit('fs.init')\n }\n\n _fileSystemInit()\n .then(() => {\n sendBack({ type: 'fileSystemReady' })\n })\n .catch((error) => {\n // Send error event using sendBack - this is the recommended XState pattern\n // The parent state machine should handle the 'ERROR' event\n sendBack({ \n type: 'error', \n error: error instanceof Error ? error : new Error(String(error))\n })\n })\n\n // Return cleanup function\n return () => {\n // Cleanup if needed\n }\n})","import { ClientManagerContext, FromCallbackInput } from \"@/types/machines\"\nimport { EventObject, fromCallback } from \"xstate\"\nimport { ClientManagerEvents } from \"@/client/constants\"\nimport { BaseDb } from \"@/db/Db/BaseDb\"\nimport debug from \"debug\"\n\nconst logger = debug('seedSdk:client:actors:dbInit')\n\nexport const dbInit = fromCallback<\nEventObject, \nFromCallbackInput<ClientManagerContext>\n>(({sendBack, input: {context}}) => {\n\n const _dbInit = async () => {\n const { filesDir } = context\n if (!filesDir) {\n throw new Error('filesDir is required')\n }\n \n // Prepare databases - this handles all initialization, migration, and file setup\n await BaseDb.prepareDb(filesDir)\n\n console.log('dbInit _dbInit completed')\n \n // Verify database is ready\n const appDb = BaseDb.getAppDb()\n if (!appDb) {\n throw new Error('Database not available after preparation')\n }\n \n logger('[client/actors] [dbInit] Database prepared and ready')\n }\n\n _dbInit()\n .then(() => {\n sendBack({ type: ClientManagerEvents.DB_READY })\n })\n .catch((error) => {\n logger('Error in dbInit:', error)\n console.log('Error in dbInit:', error)\n sendBack({ \n type: 'ERROR', \n error: error instanceof Error ? error : new Error(String(error))\n })\n })\n\n})","import { EventObject, fromCallback } from 'xstate'\nimport { ClientManagerContext, FromCallbackInput } from '@/types/machines'\nimport { ClientManagerEvents } from '@/client/constants'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:client:actors:addModelsToStore')\n\nexport const addModelsToStore = fromCallback<\n EventObject,\n FromCallbackInput<ClientManagerContext>\n>(({ sendBack, input: { context } }) => {\n\n const _addModelsToStore = async () => {\n let { models } = context\n if (!models) {\n models = {}\n }\n\n // Internal models (Seed, Version, Metadata, Image) are now loaded via SEEDPROTOCOL_Seed_Protocol_v1.json schema\n // They should already be in context.models from processSchemaFiles\n const allModels = { ...models }\n \n sendBack({ type: ClientManagerEvents.UPDATE_CONTEXT, context: { models: allModels } })\n \n // Models are now Model instances, no registration needed\n // They should be created via Model.create() and are accessible via Model static methods\n for (const [key] of Object.entries(allModels)) {\n logger('model available:', key)\n }\n\n }\n\n _addModelsToStore().then(() => {\n sendBack({ type: ClientManagerEvents.ADD_MODELS_TO_STORE_SUCCESS })\n })\n})","import { EventObject, fromCallback } from 'xstate'\nimport { models as modelsTable, modelUids } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\nimport { toSnakeCase, BaseEasClient, BaseQueryClient } from '@/helpers'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { ClientManagerEvents } from '@/client/constants'\nimport { eventEmitter } from '@/eventBus'\nimport { ClientManagerContext, FromCallbackInput } from '@/types/machines'\nimport debug from 'debug'\nimport { GET_SCHEMAS } from '@/Item/queries'\n\nconst logger = debug('seedSdk:client:actors:addModelsToDb')\n\nexport const addModelsToDb = fromCallback<\n EventObject,\n FromCallbackInput<ClientManagerContext>\n>(({ sendBack, input: { context } }) => {\n const { models } = context\n\n const _addModelsToDb = async () => {\n const appDb = BaseDb.getAppDb()\n\n if (!appDb) {\n throw new Error('Database not ready')\n }\n\n if (!models) {\n return\n }\n\n // Internal models (Seed, Version, Metadata) are now loaded via SEEDPROTOCOL_Seed_Protocol_v1.json schema\n // They should already be in context.models from processSchemaFiles\n const allModels = { ...models }\n\n let hasModelsInDb = true // Start as true - we'll set to false if we can't process any model\n const schemaDefsByModelName = new Map<\n string,\n {\n dbId: number\n schemaDef: string\n }\n >()\n\n for (const [modelName, _] of Object.entries(allModels)) {\n logger(\n '[client/actors] [addModelsToDb] starting modelName:',\n modelName,\n )\n\n let foundModel\n\n const foundModelsQuery = await appDb\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, modelName))\n\n if (!foundModelsQuery || foundModelsQuery.length === 0) {\n await appDb.insert(modelsTable).values({\n name: modelName,\n })\n\n logger('[client/actors] [addModelsToDb] inserted model:', modelName)\n const foundModels = await appDb\n .select({\n id: modelsTable.id,\n name: modelsTable.name,\n uid: modelUids.uid,\n })\n .from(modelsTable)\n .leftJoin(modelUids, eq(modelsTable.id, modelUids.modelId))\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n\n foundModel = foundModels[0]\n }\n\n if (foundModelsQuery && foundModelsQuery.length > 0) {\n foundModel = foundModelsQuery[0]\n }\n\n if (!foundModel) {\n logger('[client/actors] [addModelsToDb] Warning: Could not find or create model:', modelName)\n hasModelsInDb = false\n // Don't break - continue processing other models\n continue\n }\n\n schemaDefsByModelName.set(modelName, {\n dbId: foundModel.id,\n schemaDef: `bytes32 ${toSnakeCase(modelName)}`,\n })\n }\n\n // If we have no models to process, still send success (empty models is valid)\n if (schemaDefsByModelName.size === 0) {\n logger('[client/actors] [addModelsToDb] No models to process, but continuing')\n sendBack({ type: ClientManagerEvents.ADD_MODELS_TO_DB_SUCCESS })\n return\n }\n\n const schemaDefs = Array.from(schemaDefsByModelName.values()).map(\n ({ schemaDef }) => schemaDef,\n )\n\n // Try to fetch schemas from EAS, but don't fail if unavailable (e.g., in test environments)\n try {\n const queryClient = BaseQueryClient.getQueryClient()\n const easClient = BaseEasClient.getEasClient()\n\n // Wrap fetchQuery in a timeout to prevent hanging in test environments\n const queryPromise = queryClient.fetchQuery({\n queryKey: [`getSchemasVersion`],\n queryFn: async () =>\n easClient.request(GET_SCHEMAS, {\n where: {\n schema: {\n in: schemaDefs,\n },\n },\n }),\n })\n \n const timeoutPromise = new Promise<never>((_, reject) =>\n setTimeout(() => reject(new Error('EAS query timeout after 10 seconds')), 10000)\n )\n \n const { schemas } = await Promise.race([queryPromise, timeoutPromise])\n\n if (schemas && schemas.length > 0) {\n for (const schema of schemas) {\n const modelId = Array.from(schemaDefsByModelName.values()).find(\n ({ schemaDef }) => schemaDef === schema.schema,\n )?.dbId\n\n if (modelId) {\n await appDb\n .insert(modelUids)\n .values({\n modelId,\n uid: schema.id,\n })\n .onConflictDoNothing()\n }\n }\n } else {\n logger('[client/actors] [addModelsToDb] No schemas found from EAS, but continuing')\n }\n } catch (error: any) {\n // In test environments, EAS might not be available - log but don't fail\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[client/actors] [addModelsToDb] Warning: Could not fetch schemas from EAS, but continuing in test environment:', error.message)\n } else {\n logger('[client/actors] [addModelsToDb] Error fetching schemas:', error.message)\n throw error\n }\n }\n \n return hasModelsInDb\n }\n\n _addModelsToDb()\n .then((hasModelsInDb) => {\n sendBack({ type: ClientManagerEvents.ADD_MODELS_TO_DB_SUCCESS })\n eventEmitter.emit('syncDbWithEas')\n })\n .catch((error) => {\n logger('[client/actors] [addModelsToDb] Error:', error)\n // In test environments, still send success to allow initialization to complete\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[client/actors] [addModelsToDb] Continuing despite error in test environment')\n sendBack({ type: ClientManagerEvents.ADD_MODELS_TO_DB_SUCCESS })\n } else {\n throw error\n }\n })\n\n return () => { }\n})\n\n","import { EventObject, fromCallback } from 'xstate'\nimport { ClientManagerEvents } from '@/client/constants'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { ClientManagerContext, FromCallbackInput, } from '@/types'\nimport { appState } from '@/seedSchema'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:client:actors:saveConfig')\n\nexport const saveConfig = fromCallback<\n EventObject,\n FromCallbackInput<ClientManagerContext>\n>(({ sendBack, input: { context } }) => {\n\n logger('saveConfig starting')\n\n const { endpoints, addresses, ownedAddresses, watchedAddresses, arweaveDomain } = context\n\n // Validate endpoints - required for proper initialization\n // If endpoints are missing or invalid, initialization should fail\n if (!endpoints || !endpoints.filePaths || !endpoints.files) {\n const error = new Error('saveConfig called with invalid endpoints: endpoints must include both filePaths and files')\n logger('[internal/actors] [saveConfig] Invalid endpoints:', { endpoints })\n throw error\n }\n\n const _saveConfig = async (): Promise<void> => {\n try {\n const appDb = BaseDb.getAppDb()\n\n if (!appDb) {\n // In test environments, continue anyway\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[internal/actors] [saveConfig] App DB not found, but continuing in test environment')\n return\n }\n throw new Error('App DB not found')\n }\n \n const endpointsValueString = JSON.stringify(endpoints)\n const owned = ownedAddresses ?? addresses ?? []\n const watched = watchedAddresses ?? []\n const addressesValueString = JSON.stringify({ owned, watched })\n\n // TODO: Figure out how to define on conflict with multiple rows added\n await appDb\n .insert(appState)\n .values({\n key: 'endpoints',\n value: endpointsValueString,\n })\n .onConflictDoUpdate({\n target: appState.key,\n set: {\n value: endpointsValueString,\n },\n })\n\n if (owned.length > 0 || watched.length > 0) {\n await appDb\n .insert(appState)\n .values({\n key: 'addresses',\n value: addressesValueString,\n })\n .onConflictDoUpdate({\n target: appState.key,\n set: {\n value: addressesValueString,\n },\n })\n }\n\n await appDb\n .insert(appState)\n .values({\n key: 'arweaveDomain',\n value: arweaveDomain || 'arweave.net',\n })\n .onConflictDoUpdate({\n target: appState.key,\n set: {\n value: arweaveDomain || 'arweave.net',\n },\n })\n } catch (error: any) {\n logger('[internal/actors] [saveConfig] Error saving config:', error)\n // In test environments, continue anyway\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[internal/actors] [saveConfig] Continuing despite error in test environment')\n return\n }\n throw error\n }\n }\n\n _saveConfig()\n .then(() => {\n logger('[internal/actors] [saveConfig] saveConfig success')\n return sendBack({ type: ClientManagerEvents.SAVE_CONFIG_SUCCESS })\n })\n .catch((error: any) => {\n logger('[internal/actors] [saveConfig] Error in saveConfig promise chain:', error)\n // In test environments, still send success to allow state machine to progress\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('[internal/actors] [saveConfig] Sending success despite error in test environment')\n sendBack({ type: ClientManagerEvents.SAVE_CONFIG_SUCCESS })\n } else {\n throw error\n }\n })\n\n return () => { }\n})\n","import { BaseFileManager } from './FileManager/BaseFileManager'\nimport { Model } from '@/Model/Model'\nimport { SchemaFileFormat } from '@/types/import'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { addSchemaToDb, loadModelsFromDbForSchema } from '@/helpers/db'\nimport { schemas as schemasTable } from '@/seedSchema/SchemaSchema'\nimport { desc, eq, sql } from 'drizzle-orm'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:helpers:schema')\n/**\n * \n * Schema type definition\n * A Schema is a collection of Models with a name and version\n */\nexport type Schema = {\n id?: string\n name?: string\n metadata?: {\n name: string\n createdAt: string\n updatedAt: string\n }\n version: number\n models: Model[]\n}\n\n\n/**\n * Sanitize a schema name to be filesystem-safe\n * Replaces all special characters (except alphanumeric, hyphens, underscores) with underscores\n * Converts spaces to underscores\n * Removes leading/trailing underscores\n * \n * @param name - Schema name to sanitize\n * @returns Sanitized name safe for use in filenames\n */\nconst sanitizeSchemaName = (name: string): string => {\n return name\n .replace(/[^a-zA-Z0-9\\s_-]/g, '_') // Replace special chars (except spaces, hyphens, underscores) with underscore\n .replace(/\\s+/g, '_') // Convert spaces to underscores\n .replace(/^_+|_+$/g, '') // Remove leading/trailing underscores\n .replace(/_+/g, '_') // Collapse multiple underscores to single\n}\n\n/**\n * Generate filename for a schema\n * Format: {schemaFileId}_{schemaName}_v{version}.json\n * \n * The ID-first format ensures all files for a schema group together when sorted alphabetically.\n * \n * @param name - Schema name\n * @param version - Schema version\n * @param schemaFileId - Schema file ID (required)\n */\nconst getSchemaFilename = (name: string, version: number, schemaFileId: string): string => {\n const sanitizedName = sanitizeSchemaName(name)\n return `${schemaFileId}_${sanitizedName}_v${version}.json`\n}\n\n/**\n * Get the full file path for a schema\n * Format: {schemaFileId}_{schemaName}_v{version}.json\n * \n * The ID-first format ensures all files for a schema group together when sorted alphabetically.\n * \n * @param name - Schema name\n * @param version - Schema version\n * @param schemaFileId - Schema file ID (required)\n */\nconst getSchemaFilePath = (name: string, version: number, schemaFileId: string): string => {\n const path = BaseFileManager.getPathModule()\n const filename = getSchemaFilename(name, version, schemaFileId)\n const workingDir = BaseFileManager.getWorkingDir()\n return path.join(workingDir, filename)\n}\n\n/**\n * Create a new schema file\n * @param schema - The schema object to save\n * @param schemaFileId - Schema file ID (required)\n * @throws Error if schema already exists or if workingDir is invalid\n */\nexport const createSchema = async (schema: Schema, schemaFileId: string): Promise<void> => {\n if (!schema.name || !schema.version) {\n throw new Error('Schema must have a name and version')\n }\n\n const filePath = getSchemaFilePath(schema.name, schema.version, schemaFileId)\n\n // Check if schema already exists\n const exists = await BaseFileManager.pathExists(filePath)\n if (exists) {\n throw new Error(`Schema ${schema.name} v${schema.version} already exists`)\n }\n\n // Ensure working directory exists\n const workingDir = BaseFileManager.getWorkingDir()\n await BaseFileManager.createDirIfNotExists(workingDir)\n\n // Write schema to file\n const content = JSON.stringify(schema, null, 2)\n await BaseFileManager.saveFile(filePath, content)\n}\n\n/**\n * Read a schema file by name and version\n * @param name - The name of the schema\n * @param version - The version of the schema\n * @param schemaFileId - Schema file ID (required)\n * @returns The schema object, or null if not found\n */\nexport const readSchema = async (\n name: string,\n version: number,\n schemaFileId: string,\n): Promise<Schema | null> => {\n const filePath = getSchemaFilePath(name, version, schemaFileId)\n\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n return null\n }\n\n try {\n const content = await BaseFileManager.readFileAsString(filePath)\n return JSON.parse(content) as Schema\n } catch (error) {\n throw new Error(`Failed to read schema ${name} v${version}: ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\n/**\n * Update an existing schema file\n * @param schema - The updated schema object (must have same name and version as existing)\n * @param schemaFileId - Schema file ID (required)\n * @throws Error if schema doesn't exist\n */\nexport async function updateSchema(schema: Schema, schemaFileId: string): Promise<void> {\n if (!schema.name || !schema.version) {\n throw new Error('Schema must have a name and version')\n }\n\n const filePath = getSchemaFilePath(schema.name, schema.version, schemaFileId)\n\n // Check if schema exists\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n throw new Error(`Schema ${schema.name} v${schema.version} does not exist`)\n }\n\n // Write updated schema to file\n const content = JSON.stringify(schema, null, 2)\n await BaseFileManager.saveFile(filePath, content)\n}\n\n/**\n * Delete a schema file\n * @param name - The name of the schema\n * @param version - The version of the schema\n * @param schemaFileId - Schema file ID (required)\n * @throws Error if schema doesn't exist\n */\nexport async function deleteSchema(\n name: string,\n version: number,\n schemaFileId: string,\n): Promise<void> {\n const filePath = getSchemaFilePath(name, version, schemaFileId)\n\n // Check if schema exists\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n throw new Error(`Schema ${name} v${version} does not exist`)\n }\n\n // Delete the file\n const fs = await BaseFileManager.getFs()\n const path = BaseFileManager.getPathModule()\n \n try {\n await fs.promises.unlink(filePath)\n } catch (error) {\n throw new Error(`Failed to delete schema ${name} v${version}: ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\n/**\n * List all schema files in the working directory\n * Only returns files that are NOT already complete schema files (i.e., files without $schema field)\n * This allows processing of minimal import files while skipping already-processed schema files\n * @returns Array of objects containing name, version, and file path for each schema\n */\nexport async function listSchemaFiles(): Promise<Array<{ name: string; version: number; filePath: string }>> {\n const fs = await BaseFileManager.getFs()\n const path = BaseFileManager.getPathModule()\n\n // Check if working directory exists\n const workingDir = BaseFileManager.getWorkingDir()\n\n try {\n const files = await fs.promises.readdir(workingDir)\n const schemas: Array<{ name: string; version: number; filePath: string }> = []\n\n for (const file of files) {\n // Match filename pattern: {name}-v{version}.json\n const match = file.match(/^(.+)-v(\\d+)\\.json$/)\n if (match) {\n const [, name, versionStr] = match\n const version = parseInt(versionStr, 10)\n \n if (!isNaN(version)) {\n const filePath = path.join(workingDir, file)\n \n // Check if this file is already a complete schema file (has $schema field)\n // If it is, skip it since it's already been processed\n try {\n const content = await BaseFileManager.readFileAsString(filePath)\n const data = JSON.parse(content) as any\n \n // Skip files that already have $schema (complete schema format)\n // These are already processed and don't need to be imported again\n if (data.$schema) {\n continue\n }\n } catch (error) {\n // If we can't read/parse the file, skip it\n continue\n }\n \n schemas.push({\n name,\n version,\n filePath,\n })\n }\n }\n }\n\n return schemas\n } catch (error) {\n throw new Error(`Failed to list schemas: ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\n/**\n * List all complete schema files in the working directory\n * Only returns files that are complete schema files (i.e., files with $schema field)\n * These are already-processed schema files that need to be loaded into the model store\n * @returns Array of objects containing name, version, and file path for each complete schema\n */\nexport async function listCompleteSchemaFiles(): Promise<Array<{ name: string; version: number; filePath: string; schemaFileId?: string }>> {\n const fs = await BaseFileManager.getFs()\n const path = BaseFileManager.getPathModule()\n\n // Check if working directory exists\n const workingDir = BaseFileManager.getWorkingDir()\n\n try {\n // Check if directory exists before trying to read it\n const dirExists = await BaseFileManager.pathExists(workingDir)\n if (!dirExists) {\n // Directory doesn't exist yet - return empty array (not an error condition)\n logger(`Working directory does not exist yet: ${workingDir}, returning empty schema list`)\n return []\n }\n \n const files = await fs.promises.readdir(workingDir)\n const schemas: Array<{ name: string; version: number; filePath: string; schemaFileId?: string }> = []\n\n for (const file of files) {\n // Match filename pattern: {schemaFileId}_{schemaName}_v{version}.json\n const match = file.match(/^(.+)_(.+)_v(\\d+)\\.json$/)\n \n if (match) {\n const [, schemaFileId, schemaName, versionStr] = match\n const version = parseInt(versionStr, 10)\n \n if (!isNaN(version)) {\n const filePath = path.join(workingDir, file)\n \n // Check if this file is a complete schema file (has $schema field)\n try {\n const content = await BaseFileManager.readFileAsString(filePath)\n const data = JSON.parse(content) as any\n \n // Only include files that have $schema (complete schema format)\n if (data.$schema && data.metadata?.name) {\n // CRITICAL: Use schemaFileId from filename (source of truth), not from JSON content\n // The filename pattern is {schemaFileId}_{schemaName}_v{version}.json\n // The JSON content's id might be out of sync, but the filename tells us what file actually exists\n schemas.push({\n name: data.metadata.name,\n version: data.version || version,\n filePath,\n schemaFileId: schemaFileId, // Use from filename, not data.id\n })\n }\n } catch (error) {\n // If we can't read/parse the file, skip it\n continue\n }\n }\n }\n }\n\n return schemas\n } catch (error) {\n throw new Error(`Failed to list complete schemas: ${error instanceof Error ? error.message : String(error)}`)\n }\n}\n\n/**\n * Find a schema by name (returns the latest version if multiple versions exist)\n * @param name - The name of the schema\n * @returns The schema with the highest version, or null if not found\n */\nexport async function findSchemaByName(\n name: string,\n): Promise<Schema | null> {\n const schemas = await listCompleteSchemaFiles()\n const matchingSchemas = schemas.filter((s) => s.name === name)\n\n if (matchingSchemas.length === 0) {\n return null\n }\n\n // Find the schema with the highest version\n const latest = matchingSchemas.reduce((prev, current) =>\n current.version > prev.version ? current : prev,\n )\n\n if (!latest.schemaFileId) {\n throw new Error(`Schema ${latest.name} v${latest.version} is missing schemaFileId`)\n }\n\n return readSchema(latest.name, latest.version, latest.schemaFileId)\n}\n\n/**\n * Get the latest version number for a schema by name\n * Only considers complete schema files (with $schema field)\n * @param name - The name of the schema\n * @returns The latest version number, or 0 if no schema found\n */\nexport async function getLatestSchemaVersion(\n name: string,\n): Promise<number> {\n const completeSchemas = await listCompleteSchemaFiles()\n const matchingSchemas = completeSchemas.filter((s) => s.name === name)\n\n if (matchingSchemas.length === 0) {\n return 0\n }\n\n // Find the schema with the highest version\n const latest = matchingSchemas.reduce((prev, current) =>\n current.version > prev.version ? current : prev,\n )\n\n return latest.version\n}\n\n/**\n * Get only the latest version of each schema\n * @returns Array of objects containing name, version, and file path for the latest version of each schema\n */\nexport async function listLatestSchemaFiles(): Promise<Array<{ name: string; version: number; filePath: string }>> {\n const completeSchemas = await listCompleteSchemaFiles()\n \n // Group by schema name and keep only the latest version of each\n const schemaMap = new Map<string, { name: string; version: number; filePath: string }>()\n \n for (const schema of completeSchemas) {\n const existing = schemaMap.get(schema.name)\n if (!existing || schema.version > existing.version) {\n schemaMap.set(schema.name, schema)\n }\n }\n \n return Array.from(schemaMap.values())\n}\n\n/**\n * Filter an array of schemas to only include the latest version for each schema name\n * Works with any object that has a name (via metadata.name or name property) and a version property\n * @param schemas - Array of schema objects\n * @returns Array containing only the latest version of each schema\n */\nexport function filterLatestSchemas<T extends { name?: string; metadata?: { name: string }; version: number }>(schemas: T[]): T[] {\n // Group by schema name and keep only the latest version of each\n const schemaMap = new Map<string, T>()\n \n for (const schema of schemas) {\n const schemaName = schema.metadata?.name || schema.name\n if (!schemaName) {\n continue // Skip schemas without a name\n }\n \n const existing = schemaMap.get(schemaName)\n if (!existing || schema.version > existing.version) {\n schemaMap.set(schemaName, schema)\n }\n }\n \n return Array.from(schemaMap.values())\n}\n\n/**\n * Unified schema loading function that queries database first, then merges with files\n * Returns all schemas with their draft status and source information\n * @returns Array of schema objects with metadata about their state\n */\nexport async function loadAllSchemasFromDb(): Promise<Array<{\n schema: SchemaFileFormat\n isDraft: boolean\n source: 'db' | 'file' | 'db+file'\n schemaRecordId?: number\n}>> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not found')\n }\n\n const result: Array<{\n schema: SchemaFileFormat\n isDraft: boolean\n source: 'db' | 'file' | 'db+file'\n schemaRecordId?: number\n }> = []\n\n // STEP 1: Query all schemas from database\n // Also do a direct SQL query to verify what's actually in the database\n const directQuery = await db.run(sql.raw(`SELECT name, version, schema_file_id, id FROM schemas ORDER BY name, version DESC`))\n console.log(`[loadAllSchemasFromDb] Direct SQL query result:`, directQuery.rows?.map((row: any) => ({ name: row[0], version: row[1], schemaFileId: row[2], id: row[3] })) || [])\n \n const dbSchemas = await db\n .select()\n .from(schemasTable)\n .orderBy(schemasTable.name, desc(schemasTable.version))\n\n console.log(`[loadAllSchemasFromDb] Drizzle query returned ${dbSchemas.length} schemas:`, dbSchemas.map((s: any) => ({ name: s.name, version: s.version, schemaFileId: s.schemaFileId, isDraft: s.isDraft, id: s.id })))\n console.log(`[loadAllSchemasFromDb] Schema names in query result:`, dbSchemas.map((s: any) => s.name))\n\n const processedSchemaNames = new Set<string>()\n\n // STEP 2: Process each database schema\n for (const dbSchema of dbSchemas) {\n const schemaName = dbSchema.name\n\n console.log(`[loadAllSchemasFromDb] Processing schema: ${schemaName} (id: ${dbSchema.id}, isDraft: ${dbSchema.isDraft}, hasSchemaData: ${!!dbSchema.schemaData}, schemaFileId: ${dbSchema.schemaFileId})`)\n\n // Skip if we've already processed a newer version of this schema\n if (processedSchemaNames.has(schemaName)) {\n console.log(`[loadAllSchemasFromDb] Skipping ${schemaName} - already processed`)\n continue\n }\n\n // If it's a draft, load from schemaData\n if (dbSchema.isDraft === true && dbSchema.schemaData) {\n try {\n let schemaFile = JSON.parse(dbSchema.schemaData) as SchemaFileFormat\n \n // CRITICAL: Merge models from database (model_schemas join table) with models from schemaData\n // This ensures models added to the database are included even if they're not in schemaData\n // Build merged models without mutating schemaFile (read-only approach)\n let mergedModels = { ...(schemaFile.models || {}) }\n if (dbSchema.id) {\n const dbModels = await loadModelsFromDbForSchema(dbSchema.id)\n if (Object.keys(dbModels).length > 0) {\n // Merge: database models take precedence for properties, but preserve schemaData models for full structure\n mergedModels = {\n ...mergedModels,\n ...dbModels,\n }\n // For models that exist in both, merge properties (database properties override)\n for (const [modelName, dbModel] of Object.entries(dbModels)) {\n if (mergedModels[modelName]) {\n // Merge properties, with database properties taking precedence\n mergedModels[modelName] = {\n ...mergedModels[modelName],\n properties: {\n ...mergedModels[modelName].properties,\n ...dbModel.properties,\n },\n }\n }\n }\n }\n }\n \n // Create new schemaFile object with merged models (read-only approach)\n schemaFile = {\n ...schemaFile,\n models: mergedModels,\n }\n \n result.push({\n schema: schemaFile,\n isDraft: true,\n source: 'db',\n schemaRecordId: dbSchema.id || undefined,\n })\n processedSchemaNames.add(schemaName)\n continue\n } catch (error) {\n logger(`Error parsing schemaData for ${schemaName}:`, error)\n // Fall through to file-based loading\n }\n }\n\n // If it's not a draft and has schemaFileId, try to load from file\n if (dbSchema.isDraft === false && dbSchema.schemaFileId) {\n let completeSchemas: Array<{ name: string; version: number; filePath: string; schemaFileId?: string }> = []\n try {\n completeSchemas = await listCompleteSchemaFiles()\n } catch (error) {\n // If we can't list schema files (e.g., directory doesn't exist yet), continue without file-based loading\n logger(`Error listing complete schema files (continuing with DB data): ${error instanceof Error ? error.message : String(error)}`)\n }\n const matchingSchemas = completeSchemas.filter((s) => s.name === schemaName)\n \n if (matchingSchemas.length > 0) {\n // Find the schema with the highest version\n const latest = matchingSchemas.reduce((prev, current) =>\n current.version > prev.version ? current : prev,\n )\n\n try {\n // Read the file directly to get SchemaFileFormat\n const content = await BaseFileManager.readFileAsString(latest.filePath)\n const schemaFile = JSON.parse(content) as SchemaFileFormat\n\n // Check if file is newer than DB record\n const fileUpdatedAt = new Date(schemaFile.metadata.updatedAt).getTime()\n const dbUpdatedAt = dbSchema.updatedAt || 0\n\n // If file is newer, update DB with file content\n if (fileUpdatedAt > dbUpdatedAt && schemaFile.id === dbSchema.schemaFileId) {\n await addSchemaToDb(\n {\n name: schemaName,\n version: schemaFile.version,\n createdAt: new Date(schemaFile.metadata.createdAt).getTime(),\n updatedAt: fileUpdatedAt,\n },\n schemaFile.id,\n JSON.stringify(schemaFile, null, 2),\n false, // isDraft = false\n )\n }\n\n result.push({\n schema: schemaFile,\n isDraft: false,\n source: 'db+file',\n schemaRecordId: dbSchema.id || undefined,\n })\n processedSchemaNames.add(schemaName)\n continue\n } catch (error) {\n logger(`Error loading schema file for ${schemaName}:`, error)\n // Fall through to try loading from schemaData if available\n }\n }\n\n // If file doesn't exist but we have schemaData, use that\n console.log(`[loadAllSchemasFromDb] ${schemaName}: file not found, checking schemaData...`)\n if (dbSchema.schemaData) {\n try {\n let schemaFile = JSON.parse(dbSchema.schemaData) as SchemaFileFormat\n \n // CRITICAL: Merge models from database (model_schemas join table) with models from schemaData\n // This ensures models added to the database are included even if they're not in schemaData\n // Build merged models without mutating schemaFile (read-only approach)\n let mergedModels = { ...(schemaFile.models || {}) }\n if (dbSchema.id) {\n const dbModels = await loadModelsFromDbForSchema(dbSchema.id)\n if (Object.keys(dbModels).length > 0) {\n // Merge: database models take precedence for properties, but preserve schemaData models for full structure\n mergedModels = {\n ...mergedModels,\n ...dbModels,\n }\n // For models that exist in both, merge properties (database properties override)\n for (const [modelName, dbModel] of Object.entries(dbModels)) {\n if (mergedModels[modelName]) {\n // Merge properties, with database properties taking precedence\n mergedModels[modelName] = {\n ...mergedModels[modelName],\n properties: {\n ...mergedModels[modelName].properties,\n ...dbModel.properties,\n },\n }\n }\n }\n }\n }\n \n // Create new schemaFile object with merged models (read-only approach)\n schemaFile = {\n ...schemaFile,\n models: mergedModels,\n }\n \n console.log(`[loadAllSchemasFromDb] Adding schema from schemaData: ${schemaName} (id: ${dbSchema.id}, schemaFileId: ${dbSchema.schemaFileId})`)\n result.push({\n schema: schemaFile,\n isDraft: false,\n source: 'db',\n schemaRecordId: dbSchema.id || undefined,\n })\n processedSchemaNames.add(schemaName)\n continue\n } catch (error) {\n logger(`Error parsing schemaData for ${schemaName}:`, error)\n }\n } else {\n console.log(`[loadAllSchemasFromDb] ${schemaName}: No file and no schemaData - SKIPPING`)\n }\n }\n }\n\n // STEP 3: Find schema files not yet in database (for migration/backward compatibility)\n const completeSchemas = await listCompleteSchemaFiles()\n\n for (const schemaFileInfo of completeSchemas) {\n // Only process if not already in result\n if (!processedSchemaNames.has(schemaFileInfo.name)) {\n try {\n const content = await BaseFileManager.readFileAsString(schemaFileInfo.filePath)\n const schemaFile = JSON.parse(content) as SchemaFileFormat\n\n // Import this schema to database (mark as non-draft since it's in a file)\n const schemaRecord = await addSchemaToDb(\n {\n name: schemaFile.metadata.name,\n version: schemaFile.version,\n createdAt: new Date(schemaFile.metadata.createdAt).getTime(),\n updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),\n },\n schemaFile.id,\n JSON.stringify(schemaFile, null, 2),\n false, // isDraft = false (it's in a file, so it's published)\n )\n\n result.push({\n schema: schemaFile,\n isDraft: false,\n source: 'file',\n schemaRecordId: schemaRecord.id || undefined,\n })\n processedSchemaNames.add(schemaFileInfo.name)\n } catch (error) {\n logger(`Error loading schema file ${schemaFileInfo.filePath}:`, error)\n }\n }\n }\n\n return result\n}\n\n/**\n * Migration helper: Migrate existing file-based schemas to the database\n * This function should be called once to migrate existing schema files to the new database-first approach\n * All existing schemas will be marked as published (isDraft = false) since they already exist in files\n * @returns Number of schemas migrated\n */\nexport async function migrateFileSchemasToDb(): Promise<number> {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not found')\n }\n\n logger('Starting migration of file-based schemas to database')\n\n // Get all complete schema files\n const completeSchemas = await listCompleteSchemaFiles()\n let migratedCount = 0\n\n for (const schemaFileInfo of completeSchemas) {\n try {\n // Read the schema file\n const content = await BaseFileManager.readFileAsString(schemaFileInfo.filePath)\n const schemaFile = JSON.parse(content) as SchemaFileFormat\n\n if (!schemaFile.$schema || !schemaFile.metadata?.name) {\n logger(`Skipping invalid schema file: ${schemaFileInfo.filePath}`)\n continue\n }\n\n const schemaName = schemaFile.metadata.name\n\n // Check if schema already exists in database\n const existingSchemas = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.name, schemaName))\n .limit(1)\n\n // Only migrate if it doesn't exist or if existing record doesn't have schemaFileId\n if (existingSchemas.length === 0 || !existingSchemas[0].schemaFileId) {\n // Add schema to database as published (isDraft = false)\n await addSchemaToDb(\n {\n name: schemaName,\n version: schemaFile.version,\n createdAt: new Date(schemaFile.metadata.createdAt).getTime(),\n updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),\n },\n schemaFile.id, // schemaFileId\n JSON.stringify(schemaFile, null, 2), // schemaData\n false, // isDraft = false (it's in a file, so it's published)\n )\n\n migratedCount++\n logger(`Migrated schema: ${schemaName} v${schemaFile.version}`)\n } else {\n logger(`Schema ${schemaName} already exists in database, skipping`)\n }\n } catch (error) {\n logger(`Error migrating schema file ${schemaFileInfo.filePath}:`, error)\n }\n }\n\n logger(`Migration complete: ${migratedCount} schemas migrated`)\n return migratedCount\n}\n\n/**\n * Extract the schema name from a schemaId string\n * @param schemaId - Schema ID in the format `${schemaName}-${schemaVersion}`\n * @returns The schema name, or null if the format is invalid\n */\nexport function getSchemaNameFromId(schemaId: string | null | undefined): string | null {\n if (!schemaId) {\n return null\n }\n const lastDashIndex = schemaId.lastIndexOf('-')\n if (lastDashIndex === -1 || lastDashIndex === 0 || lastDashIndex === schemaId.length - 1) {\n return null\n }\n return schemaId.substring(0, lastDashIndex)\n}\n\n","import { BaseFileManager } from '../helpers/FileManager/BaseFileManager'\nimport { JsonImportSchema, SchemaFileFormat } from '../types/import'\nimport { ModelPropertyDataTypes } from '@/Schema'\nimport { Static } from '@sinclair/typebox'\nimport { TProperty } from '@/helpers/property'\nimport { ModelDefinitions, ModelClassType } from '@/types'\n// Dynamic import to break circular dependency with helpers/db -> ModelProperty -> updateSchema -> imports/json\n// import { addModelsToDb, addSchemaToDb } from '@/helpers/db'\nimport { generateId } from '@/helpers'\nimport debug from 'debug'\n// Dynamic import to break circular dependency: ClientManager -> processSchemaFiles -> imports/json -> ClientManager\n// import { getClient } from '@/client/ClientManager'\nimport { ClientManagerEvents } from '@/client/constants'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nconst logger = debug('seedSdk:imports:json')\n\n/**\n * Verify that properties are persisted to the database for a given model\n * This is important in browser environments where database writes may not be immediately visible\n * @param db - Database instance\n * @param modelId - Database ID of the model\n * @param modelName - Name of the model (for logging)\n * @param maxRetries - Maximum number of retry attempts\n * @param retryDelay - Delay between retries in milliseconds\n * @returns Promise that resolves when properties are found, or rejects if not found after max retries\n */\nconst verifyPropertiesPersisted = async (\n db: any,\n modelId: number,\n modelName: string,\n maxRetries: number = 10,\n retryDelay: number = 100\n): Promise<void> => {\n const modelSchemaMod = await import('../seedSchema/ModelSchema')\n const { properties: propertiesTable } = modelSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq } = drizzleMod\n\n console.log(`[verifyPropertiesPersisted] Starting verification for model \"${modelName}\" (modelId: ${modelId})`)\n\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n const props = await db\n .select()\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, modelId))\n .limit(1)\n \n console.log(`[verifyPropertiesPersisted] Attempt ${attempt + 1}/${maxRetries}: found ${props.length} properties for model \"${modelName}\" (modelId: ${modelId})`)\n \n if (props.length > 0) {\n console.log(`[verifyPropertiesPersisted] ✓ Verified properties exist for model \"${modelName}\" (modelId: ${modelId}) after ${attempt + 1} attempt(s)`)\n logger(`Verified properties exist for model \"${modelName}\" (modelId: ${modelId}) after ${attempt + 1} attempt(s)`)\n return\n }\n\n if (attempt < maxRetries - 1) {\n console.log(`[verifyPropertiesPersisted] Properties not yet visible for model \"${modelName}\" (modelId: ${modelId}), retrying in ${retryDelay}ms (attempt ${attempt + 1}/${maxRetries})`)\n logger(`Properties not yet visible for model \"${modelName}\" (modelId: ${modelId}), retrying in ${retryDelay}ms (attempt ${attempt + 1}/${maxRetries})`)\n await new Promise(resolve => setTimeout(resolve, retryDelay))\n }\n }\n\n console.log(`[verifyPropertiesPersisted] ✗ Properties not found for model \"${modelName}\" (modelId: ${modelId}) after ${maxRetries} attempts`)\n throw new Error(`Properties not found for model \"${modelName}\" (modelId: ${modelId}) after ${maxRetries} attempts. This may indicate a database write issue in the browser environment.`)\n}\n\n/**\n * Compare two schema files structurally, ignoring metadata timestamps\n * This is used to determine if an existing schema file matches the schema being imported\n * @param schema1 - First schema to compare\n * @param schema2 - Second schema to compare\n * @returns true if schemas are structurally equivalent, false otherwise\n */\nfunction compareSchemasStructurally(\n schema1: SchemaFileFormat,\n schema2: SchemaFileFormat,\n): boolean {\n // Compare basic fields\n if (schema1.$schema !== schema2.$schema) return false\n if (schema1.version !== schema2.version) return false\n if (schema1.id !== schema2.id) return false\n \n // Compare metadata (ignoring timestamps)\n if (schema1.metadata?.name !== schema2.metadata?.name) return false\n \n // Compare models structure\n const models1 = schema1.models || {}\n const models2 = schema2.models || {}\n \n const modelNames1 = Object.keys(models1).sort()\n const modelNames2 = Object.keys(models2).sort()\n \n if (modelNames1.length !== modelNames2.length) return false\n if (!modelNames1.every((name, i) => name === modelNames2[i])) return false\n \n // Compare each model's structure\n for (const modelName of modelNames1) {\n const model1 = models1[modelName]\n const model2 = models2[modelName]\n \n // Compare model IDs if both have them\n if (model1.id !== model2.id) return false\n \n // Compare properties\n const props1 = model1.properties || {}\n const props2 = model2.properties || {}\n \n const propNames1 = Object.keys(props1).sort()\n const propNames2 = Object.keys(props2).sort()\n \n if (propNames1.length !== propNames2.length) return false\n if (!propNames1.every((name, i) => name === propNames2[i])) return false\n \n // Compare each property's structure\n for (const propName of propNames1) {\n const prop1 = props1[propName]\n const prop2 = props2[propName]\n \n // Compare property IDs if both have them\n if (prop1.id !== prop2.id) return false\n \n // Compare property types\n if (prop1.type !== prop2.type) return false\n \n // Compare other relevant fields (ref, items, etc.)\n if (prop1.ref !== prop2.ref) return false\n if (prop1.items?.type !== prop2.items?.type) return false\n if (prop1.items?.model !== prop2.items?.model) return false\n }\n }\n \n // Compare enums\n const enums1 = schema1.enums || {}\n const enums2 = schema2.enums || {}\n \n const enumNames1 = Object.keys(enums1).sort()\n const enumNames2 = Object.keys(enums2).sort()\n \n if (enumNames1.length !== enumNames2.length) return false\n if (!enumNames1.every((name, i) => name === enumNames2[i])) return false\n \n // Note: We don't compare migrations as they're historical records\n // and may differ even for the same schema structure\n \n return true\n}\n\n/**\n * Transform import JSON format to full schema file format\n * @param importData - The JSON import data\n * @param version - The version number for the schema (defaults to 1)\n * @returns The transformed schema file format\n */\nexport const transformImportToSchemaFile = (\n importData: JsonImportSchema,\n version: number = 1,\n): SchemaFileFormat => {\n const now = new Date().toISOString()\n const schemaId = generateId()\n\n // Generate IDs for models and properties\n const modelsWithIds: SchemaFileFormat['models'] = {}\n for (const [modelName, modelDef] of Object.entries(importData.models)) {\n const modelId = generateId()\n const propertiesWithIds: { [propertyName: string]: any } = {}\n \n for (const [propertyName, propertyDef] of Object.entries(modelDef.properties)) {\n const propertyId = generateId()\n propertiesWithIds[propertyName] = {\n ...propertyDef,\n id: propertyId,\n }\n }\n \n modelsWithIds[modelName] = {\n ...modelDef,\n id: modelId,\n properties: propertiesWithIds,\n }\n }\n\n return {\n $schema: 'https://seedprotocol.org/schemas/data-model/v1',\n version,\n id: schemaId,\n metadata: {\n name: importData.name,\n createdAt: now,\n updatedAt: now,\n },\n models: modelsWithIds,\n enums: {},\n migrations: [\n {\n version,\n timestamp: now,\n description: 'Initial schema',\n changes: [],\n },\n ],\n }\n}\n\n/**\n * Parse JSON import content (string) into JsonImportSchema format\n * Supports two formats:\n * 1. Minimal format: { name: string, models: {...} }\n * 2. Complete schema format: { $schema: string, metadata: { name: string }, models: {...}, ... }\n * @param content - The JSON content as a string\n * @returns The parsed JSON import data normalized to JsonImportSchema format\n * @throws Error if content cannot be parsed\n */\nexport const parseJsonImportContent = (\n content: string,\n): JsonImportSchema => {\n try {\n const data = JSON.parse(content) as any\n\n // Determine the format and extract name\n let schemaName: string | undefined\n \n // Check if it's a complete schema format (has $schema field)\n if (data.$schema) {\n // Complete schema format: name is in metadata.name\n schemaName = data.metadata?.name\n } else {\n // Minimal format: name is at top level\n schemaName = data.name\n }\n\n if (!schemaName) {\n throw new Error('Schema name is required (either at top level or in metadata.name)')\n }\n\n // Return normalized JsonImportSchema format\n return {\n name: schemaName,\n models: data.models,\n }\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new Error(`Invalid JSON content: ${error.message}`)\n }\n throw new Error(\n `Failed to parse JSON import content: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Read and parse a JSON import file\n * Supports two formats:\n * 1. Minimal format: { name: string, models: {...} }\n * 2. Complete schema format: { $schema: string, metadata: { name: string }, models: {...}, ... }\n * @param filePath - Path to the JSON import file\n * @returns The parsed JSON import data normalized to JsonImportSchema format\n * @throws Error if file cannot be read or parsed\n */\nexport const readJsonImportFile = async (\n filePath: string,\n): Promise<JsonImportSchema> => {\n try {\n const workingDir = BaseFileManager.getWorkingDir()\n let internalFilePath = filePath\n if (!filePath.startsWith(workingDir)) {\n internalFilePath = `${workingDir}/${filePath}`\n }\n const content = await BaseFileManager.readFileAsString(internalFilePath)\n return parseJsonImportContent(content)\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new Error(`Invalid JSON in file ${filePath}: ${error.message}`)\n }\n throw new Error(\n `Failed to read JSON import file ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Sanitize a schema name to be filesystem-safe\n * Replaces all special characters (except alphanumeric, hyphens, underscores) with underscores\n * Converts spaces to underscores\n * Removes leading/trailing underscores\n * \n * @param name - Schema name to sanitize\n * @returns Sanitized name safe for use in filenames\n */\nconst sanitizeSchemaName = (name: string): string => {\n return name\n .replace(/[^a-zA-Z0-9\\s_-]/g, '_') // Replace special chars (except spaces, hyphens, underscores) with underscore\n .replace(/\\s+/g, '_') // Convert spaces to underscores\n .replace(/^_+|_+$/g, '') // Remove leading/trailing underscores\n .replace(/_+/g, '_') // Collapse multiple underscores to single\n}\n\n/**\n * Get the full file path for a schema file\n * Format: {schemaFileId}_{schemaName}_v{version}.json\n * \n * The ID-first format ensures all files for a schema group together when sorted alphabetically.\n * \n * @param workingDir - Working directory path\n * @param name - Schema name\n * @param version - Schema version\n * @param schemaFileId - Schema file ID (required)\n */\nconst getSchemaFilePath = (workingDir: string, name: string, version: number, schemaFileId: string): string => {\n const path = BaseFileManager.getPathModule()\n const sanitizedName = sanitizeSchemaName(name)\n const filename = `${schemaFileId}_${sanitizedName}_v${version}.json`\n return path.join(workingDir, filename)\n}\n\n/**\n * Import a JSON schema file and save it in the full schema file format\n * Also converts the JSON models to Model classes and adds them to the database\n * @param importFilePath - Path to the JSON import file\n * @param version - The version number for the schema (defaults to 1)\n * @returns The file path where the schema was saved\n * @throws Error if import file cannot be read, parsed, or if schema already exists\n */\nexport async function importJsonSchema(\n importFilePath: string,\n version?: number,\n): Promise<string>\n/**\n * Import a JSON schema from file contents and save it in the full schema file format\n * Also converts the JSON models to Model classes and adds them to the database\n * @param importFileContents - Object containing the JSON file contents as a string\n * @param version - The version number for the schema (defaults to 1)\n * @returns The file path where the schema was saved\n * @throws Error if import content cannot be parsed, or if schema already exists\n */\nexport async function importJsonSchema(\n importFileContents: { contents: string },\n version?: number,\n): Promise<string>\nexport async function importJsonSchema(\n importFilePathOrContents: string | { contents: string },\n version: number = 1,\n): Promise<string> {\n // Determine if we have a file path or file contents\n let importData: JsonImportSchema | undefined\n let importFilePath: string | undefined\n let originalSchemaFile: SchemaFileFormat | undefined\n\n if (typeof importFilePathOrContents === 'string') {\n // It's a file path\n importFilePath = importFilePathOrContents\n importData = await readJsonImportFile(importFilePath)\n } else {\n // It's file contents - check if it's already a complete schema format\n try {\n const parsed = JSON.parse(importFilePathOrContents.contents) as any\n if (parsed.$schema && parsed.id && parsed.metadata) {\n // It's already a complete schema format - preserve it\n originalSchemaFile = parsed as SchemaFileFormat\n logger(`Input is already a complete schema format, preserving original ID: ${originalSchemaFile.id}`)\n }\n } catch {\n // Not valid JSON or not a complete schema, parse as import format\n }\n \n if (!originalSchemaFile) {\n importData = parseJsonImportContent(importFilePathOrContents.contents)\n }\n }\n\n // Use original schema file if available, otherwise transform from import format\n let schemaFile: SchemaFileFormat\n if (originalSchemaFile) {\n schemaFile = originalSchemaFile\n // Use provided version if different, otherwise use version from schema\n if (version !== undefined && version !== schemaFile.version) {\n schemaFile = { ...schemaFile, version }\n }\n \n // Generate missing IDs for complete schema files\n if (!schemaFile.id) {\n schemaFile.id = generateId()\n logger('Generated schema ID for imported complete schema:', schemaFile.id)\n }\n \n // Before generating IDs, check if a file already exists with this schemaFileId\n // This handles the case where the schema was already loaded via loadSchemaFromFile\n const workingDir = BaseFileManager.getWorkingDir()\n const path = BaseFileManager.getPathModule()\n const existingFilePath = getSchemaFilePath(workingDir, schemaFile.metadata.name, schemaFile.version, schemaFile.id)\n const existingFileExists = await BaseFileManager.pathExists(existingFilePath)\n \n if (existingFileExists) {\n // File already exists with this schemaFileId - just load it instead of creating a new one\n logger(`Schema file already exists with schemaFileId ${schemaFile.id}, loading it instead of creating new file`)\n return await loadSchemaFromFile(existingFilePath)\n }\n \n // Generate missing model and property IDs\n for (const [modelName, model] of Object.entries(schemaFile.models || {})) {\n if (!model.id) {\n model.id = generateId()\n logger(`Generated model ID for ${modelName}:`, model.id)\n }\n \n for (const [propName, prop] of Object.entries(model.properties || {})) {\n if (!prop.id) {\n prop.id = generateId()\n logger(`Generated property ID for ${modelName}.${propName}:`, prop.id)\n }\n }\n }\n } else {\n if (!importData) {\n throw new Error('Failed to parse import data: neither complete schema nor import format could be determined')\n }\n schemaFile = transformImportToSchemaFile(importData, version)\n }\n\n // Check if this is an internal SDK schema (should not create files in app directory)\n const constantsMod = await import('../helpers/constants')\n const { isInternalSchema } = constantsMod\n const isInternal = isInternalSchema(schemaFile.metadata.name, schemaFile.id)\n \n if (isInternal) {\n logger(`Skipping file creation for internal schema: ${schemaFile.metadata.name}`)\n // For internal schemas, just load to database and store, don't create file\n // Extract schema name and version\n const schemaName = schemaFile.metadata?.name\n const version = schemaFile.version\n\n if (!schemaName) {\n throw new Error('Schema name is required in metadata.name')\n }\n\n // Convert to JsonImportSchema format for processing\n const importDataForInternal: JsonImportSchema = {\n name: schemaName,\n models: Object.fromEntries(\n Object.entries(schemaFile.models || {}).map(([modelName, model]) => [\n modelName,\n {\n ...model,\n // Remove id field for import format\n id: undefined,\n properties: Object.fromEntries(\n Object.entries(model.properties || {}).map(([propName, prop]) => {\n const schemaProp = prop as any\n const jsonProp: any = {\n type: schemaProp.dataType || schemaProp.type,\n // Remove id field for import format\n id: undefined,\n }\n \n // Handle Relation type - convert ref to model\n if (schemaProp.ref || schemaProp.refModelName) {\n jsonProp.model = schemaProp.refModelName || schemaProp.ref\n }\n \n // Handle List type\n if ((schemaProp.dataType === 'List' || schemaProp.type === 'List') && schemaProp.refValueType) {\n jsonProp.items = {\n type: schemaProp.refValueType,\n model: schemaProp.refModelName || schemaProp.ref,\n }\n }\n \n // Copy other properties (storage, etc.)\n Object.keys(schemaProp).forEach(key => {\n if (key !== 'id' && key !== 'dataType' && key !== 'type' && key !== 'ref' && key !== 'refModelName' && key !== 'refValueType') {\n jsonProp[key] = schemaProp[key]\n }\n })\n \n return [propName, jsonProp]\n }),\n ),\n },\n ]),\n ) as unknown as JsonImportSchema['models'],\n }\n\n // Generate schema ID if missing\n if (!schemaFile.id) {\n schemaFile.id = generateId()\n logger('Generated schema ID for internal schema:', schemaFile.id)\n }\n\n // Extract schemaFileIds from JSON file and generate missing ones BEFORE creating models\n // This ensures Model instances are created with correct IDs\n const modelFileIds = new Map<string, string>()\n const propertyFileIds = new Map<string, Map<string, string>>()\n \n for (const [modelName, model] of Object.entries(schemaFile.models || {})) {\n // Generate model ID if missing\n if (!model.id) {\n model.id = generateId()\n logger(`Generated model ID for ${modelName}:`, model.id)\n // Update the schemaFile object so it's included in schemaData\n schemaFile.models[modelName].id = model.id\n }\n modelFileIds.set(modelName, model.id)\n \n const propIds = new Map<string, string>()\n for (const [propName, prop] of Object.entries(model.properties || {})) {\n // Generate property ID if missing\n if (!prop.id) {\n prop.id = generateId()\n logger(`Generated property ID for ${modelName}.${propName}:`, prop.id)\n // Update the schemaFile object so it's included in schemaData\n schemaFile.models[modelName].properties[propName].id = prop.id\n }\n propIds.set(propName, prop.id)\n }\n if (propIds.size > 0) {\n propertyFileIds.set(modelName, propIds)\n }\n }\n\n // Convert JSON models to Model classes, passing modelFileIds and propertyFileIds so Model instances use correct IDs\n const modelDefinitions = await createModelsFromJson(importDataForInternal, modelFileIds, propertyFileIds)\n\n logger('loadSchemaFromFile (internal) - modelDefinitions length:', Object.keys(modelDefinitions).length)\n\n // Convert schema file metadata to schema input for database\n const schemaInput = {\n name: schemaName,\n version,\n schemaFileId: schemaFile.id || null,\n createdAt: new Date(schemaFile.metadata.createdAt).getTime(),\n updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),\n } as Parameters<typeof addSchemaToDb>[0]\n\n // Use dynamic import to break circular dependency\n const dbMod = await import('../helpers/db')\n const { addSchemaToDb, addModelsToDb } = dbMod\n\n // Try to add schema and models to database if database is available\n try {\n const db = BaseDb.getAppDb()\n if (db) {\n // Store full schema data in database as fallback when file is not available\n // schemaFile already has all IDs (from JSON file or generated), so we can use it directly\n const schemaData = JSON.stringify(schemaFile, null, 2)\n \n // Add schema to database (creates or returns existing) with schemaFileId and schemaData\n const schemaRecord = await addSchemaToDb(schemaInput, schemaFile.id, schemaData, false)\n\n // Add models to database and link them to the schema with schemaFileIds (only if there are models)\n if (Object.keys(modelDefinitions).length > 0) {\n console.log(`[importJsonSchema] Adding ${Object.keys(modelDefinitions).length} models to database for internal schema \"${schemaName}\": ${Object.keys(modelDefinitions).join(', ')}`)\n await addModelsToDb(modelDefinitions, schemaRecord, undefined, {\n schemaFileId: schemaFile.id,\n modelFileIds,\n propertyFileIds,\n })\n \n // CRITICAL: Verify all expected models are linked via join table\n // Retry querying until all models are visible (browser environments may have delays)\n const expectedModelNames = Object.keys(schemaFile.models || {})\n const modelSchemaSchemaMod = await import('../seedSchema/ModelSchemaSchema')\n const { modelSchemas } = modelSchemaSchemaMod\n const modelSchemaMod = await import('../seedSchema/ModelSchema')\n const { models: modelsTable } = modelSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq, and } = drizzleMod\n \n let allModelsLinked = false\n for (let attempt = 0; attempt < 10; attempt++) {\n const modelLinks = await db\n .select({\n modelId: modelSchemas.modelId,\n modelName: modelsTable.name,\n })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaRecord.id))\n \n const linkedModelNames = modelLinks\n .map((link: { modelId: number | null; modelName: string | null }) => link.modelName)\n .filter((n: string | null): n is string => n !== null)\n \n const missingModels = expectedModelNames.filter(name => !linkedModelNames.includes(name))\n \n if (missingModels.length === 0) {\n console.log(`[importJsonSchema] All ${expectedModelNames.length} expected models are linked: ${linkedModelNames.join(', ')}`)\n allModelsLinked = true\n break\n } else {\n console.log(`[importJsonSchema] Attempt ${attempt + 1}/10: Missing models: ${missingModels.join(', ')}, Linked: ${linkedModelNames.join(', ')}`)\n if (attempt < 9) {\n await new Promise(resolve => setTimeout(resolve, 200))\n }\n }\n }\n \n if (!allModelsLinked) {\n const finalLinks = await db\n .select({ modelName: modelsTable.name })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaRecord.id))\n const finalLinkedNames = finalLinks.map((l: any) => l.modelName).filter(Boolean)\n const stillMissing = expectedModelNames.filter(name => !finalLinkedNames.includes(name))\n \n console.warn(`[importJsonSchema] WARNING: Not all expected models are linked after retries. Expected: ${expectedModelNames.join(', ')}, Linked: ${finalLinkedNames.join(', ')}, Still missing: ${stillMissing.join(', ') || 'none'}`)\n \n // Try to link missing models directly by finding them in the database\n if (stillMissing.length > 0) {\n console.log(`[importJsonSchema] Attempting to link missing models directly: ${stillMissing.join(', ')}`)\n for (const missingModelName of stillMissing) {\n try {\n const modelFileId = modelFileIds.get(missingModelName)\n if (modelFileId) {\n // Find model by schemaFileId\n const missingModel = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (missingModel.length > 0 && missingModel[0].id) {\n // Check if join entry already exists\n const existingJoin = await db\n .select()\n .from(modelSchemas)\n .where(\n and(\n eq(modelSchemas.modelId, missingModel[0].id),\n eq(modelSchemas.schemaId, schemaRecord.id)\n )\n )\n .limit(1)\n \n if (existingJoin.length === 0) {\n console.log(`[importJsonSchema] Creating missing join table entry for \"${missingModelName}\" (modelId: ${missingModel[0].id})`)\n await db.insert(modelSchemas).values({\n modelId: missingModel[0].id,\n schemaId: schemaRecord.id,\n })\n console.log(`[importJsonSchema] Successfully linked missing model \"${missingModelName}\"`)\n } else {\n console.log(`[importJsonSchema] Join entry already exists for \"${missingModelName}\" (modelId: ${missingModel[0].id})`)\n }\n } else {\n console.warn(`[importJsonSchema] Could not find model \"${missingModelName}\" with schemaFileId \"${modelFileId}\" in database`)\n }\n } else {\n // Fallback: find by name\n const missingModel = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, missingModelName))\n .limit(1)\n \n if (missingModel.length > 0 && missingModel[0].id) {\n const existingJoin = await db\n .select()\n .from(modelSchemas)\n .where(\n and(\n eq(modelSchemas.modelId, missingModel[0].id),\n eq(modelSchemas.schemaId, schemaRecord.id)\n )\n )\n .limit(1)\n \n if (existingJoin.length === 0) {\n console.log(`[importJsonSchema] Creating missing join table entry for \"${missingModelName}\" (modelId: ${missingModel[0].id}) by name`)\n await db.insert(modelSchemas).values({\n modelId: missingModel[0].id,\n schemaId: schemaRecord.id,\n })\n console.log(`[importJsonSchema] Successfully linked missing model \"${missingModelName}\" by name`)\n }\n } else {\n console.warn(`[importJsonSchema] Could not find model \"${missingModelName}\" by name in database`)\n }\n }\n } catch (error: any) {\n console.error(`[importJsonSchema] Error linking missing model \"${missingModelName}\":`, error?.message || String(error))\n }\n }\n }\n }\n \n // Verify properties are persisted (important for browser environments)\n // Wait a bit for database writes to be visible (browser environments may have delays)\n await new Promise(resolve => setTimeout(resolve, 200))\n \n console.log(`[importJsonSchema] Starting property verification for schema \"${schemaName}\" (schemaRecord.id: ${schemaRecord.id})`)\n // Note: modelSchemas, modelsTable, and eq are already imported above (lines 557-559), reusing them here\n \n // Try to find models directly by schemaFileId first (more reliable than join table)\n const seedModelId = modelFileIds.get('Seed')\n let seedModel: any[] = []\n if (seedModelId) {\n // Retry querying for the model until it's visible\n for (let attempt = 0; attempt < 10; attempt++) {\n seedModel = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, seedModelId))\n .limit(1)\n \n if (seedModel.length > 0 && seedModel[0].id) {\n break\n }\n \n if (attempt < 9) {\n await new Promise(resolve => setTimeout(resolve, 100))\n }\n }\n \n if (seedModel.length > 0 && seedModel[0].id) {\n console.log(`[importJsonSchema] Found Seed model (modelId: ${seedModel[0].id}), verifying properties`)\n await verifyPropertiesPersisted(db, seedModel[0].id, 'Seed', 10, 100)\n } else {\n console.log(`[importJsonSchema] WARNING: Could not find Seed model after retries`)\n }\n }\n \n // Also verify via join table if schemaRecord.id is available (for completeness)\n if (schemaRecord.id) {\n // Retry querying join table until entries are visible\n let modelLinks: any[] = []\n for (let attempt = 0; attempt < 10; attempt++) {\n modelLinks = await db\n .select({\n modelId: modelSchemas.modelId,\n modelName: modelsTable.name,\n })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaRecord.id))\n \n if (modelLinks.length > 0) {\n break\n }\n \n if (attempt < 9) {\n await new Promise(resolve => setTimeout(resolve, 100))\n }\n }\n \n logger(`Verifying properties: found ${modelLinks.length} model links for schema ${schemaName} (id: ${schemaRecord.id})`)\n \n // If we didn't verify via direct lookup, verify via join table\n if (!seedModelId || (seedModel.length === 0 || !seedModel[0].id)) {\n const seedModelLink = modelLinks.find((link: { modelId: number | null; modelName: string | null }) => link.modelName === 'Seed')\n if (seedModelLink && seedModelLink.modelId) {\n logger(`Verifying properties for Seed model via join table (modelId: ${seedModelLink.modelId})`)\n await verifyPropertiesPersisted(db, seedModelLink.modelId, 'Seed', 10, 100)\n } else if (modelLinks.length > 0 && modelLinks[0].modelId) {\n // Fallback to first model if Seed not found\n logger(`Verifying properties for ${modelLinks[0].modelName} model via join table (modelId: ${modelLinks[0].modelId})`)\n await verifyPropertiesPersisted(db, modelLinks[0].modelId, modelLinks[0].modelName || 'unknown', 10, 100)\n }\n }\n }\n \n // After properties are created (internal schema path), ensure schemaFile has the correct IDs from database\n // Query the database to get the actual schemaFileId values that were used\n // This ensures schemaData matches what's actually in the database\n const modelSchemaMod1 = await import('../seedSchema/ModelSchema')\n const { properties: propertiesTable } = modelSchemaMod1\n\n let schemaFileUpdated = false\n for (const [modelName, modelFileId] of modelFileIds.entries()) {\n // Get model record to find modelId\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (modelRecords.length > 0) {\n const modelId = modelRecords[0].id\n \n // Get all properties for this model from database\n const propertyRecords = await db\n .select()\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, modelId))\n \n // Update schemaFile with actual database IDs (only if they differ)\n for (const propRecord of propertyRecords) {\n if (propRecord.schemaFileId && schemaFile.models[modelName]?.properties[propRecord.name]) {\n const currentId = schemaFile.models[modelName].properties[propRecord.name].id\n if (currentId !== propRecord.schemaFileId) {\n schemaFile.models[modelName].properties[propRecord.name].id = propRecord.schemaFileId\n logger(`Updated schemaFile property ID for ${modelName}.${propRecord.name} from ${currentId} to ${propRecord.schemaFileId}`)\n schemaFileUpdated = true\n }\n }\n }\n }\n }\n \n // Always update schemaData to ensure it matches the current schemaFile state\n // This is important even if nothing changed, to ensure consistency\n const updatedSchemaData = JSON.stringify(schemaFile, null, 2)\n \n // Update the schema record in the database with current schemaData\n const schemaSchemaMod1 = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod1\n await db\n .update(schemasTable)\n .set({ schemaData: updatedSchemaData })\n .where(eq(schemasTable.id, schemaRecord.id))\n \n if (schemaFileUpdated) {\n logger(`Updated schemaData in database with actual property IDs for schema \"${schemaName}\"`)\n } else {\n logger(`Verified schemaData in database matches schemaFile for schema \"${schemaName}\"`)\n }\n }\n }\n } catch (dbError) {\n // Database not available - log warning but continue\n logger('Database not available, skipping database operations:', dbError instanceof Error ? dbError.message : String(dbError))\n }\n\n // Models are now Model instances, no registration needed\n // They should be created via Model.create() and are accessible via Model static methods\n for (const [modelName] of Object.entries(modelDefinitions)) {\n logger('loadSchemaFromFile (internal) - model available:', modelName)\n }\n\n // Schema is now saved to database\n // useSchemas hook will pick it up via database queries\n\n return '' // Return empty string to indicate no file was created\n }\n\n const workingDir = BaseFileManager.getWorkingDir()\n const path = BaseFileManager.getPathModule()\n\n // Ensure schema ID is defined (should always be set by this point, but check for safety)\n if (!schemaFile.id) {\n schemaFile.id = generateId()\n logger('Generated schema ID before file path creation:', schemaFile.id)\n }\n\n // Get the target file path using ID-based naming (preferred)\n const filePath = getSchemaFilePath(workingDir, schemaFile.metadata.name, version, schemaFile.id)\n \n // Check if schema already exists\n const exists = await BaseFileManager.pathExists(filePath)\n if (exists) {\n // If we have a file path and the import file is the same as the target file,\n // and it's already a complete schema, just load it without writing\n if (importFilePath) {\n const normalizedImportPath = path.resolve(importFilePath)\n const normalizedTargetPath = path.resolve(filePath)\n \n if (normalizedImportPath === normalizedTargetPath) {\n // Check if the file is already a complete schema\n try {\n const content = await BaseFileManager.readFileAsString(importFilePath)\n const data = JSON.parse(content) as any\n if (data.$schema) {\n // File is already a complete schema, just load it\n logger(`Schema file ${filePath} already exists and is complete, loading it`)\n return await loadSchemaFromFile(filePath)\n }\n } catch (error) {\n // If we can't read the file, proceed with the error\n }\n }\n }\n \n // File exists - check if it matches the schema we're trying to import\n try {\n const existingContent = await BaseFileManager.readFileAsString(filePath)\n const existingSchema = JSON.parse(existingContent) as SchemaFileFormat\n \n // Verify it's a complete schema file\n if (existingSchema.$schema) {\n // Compare schemas structurally\n if (compareSchemasStructurally(schemaFile, existingSchema)) {\n // Schemas match - just load the existing file\n logger(`Schema ${schemaFile.metadata.name} v${version} already exists with matching content, loading it`)\n return await loadSchemaFromFile(filePath)\n } else {\n // Schemas don't match - throw error to prevent data loss\n throw new Error(\n `Schema ${schemaFile.metadata.name} v${version} already exists with different content. ` +\n `To update the schema, delete the existing file first or use a different version.`,\n )\n }\n } else {\n // File exists but is not a complete schema - this shouldn't happen with ID-based naming\n // but we'll treat it as a conflict\n throw new Error(\n `Schema ${schemaFile.metadata.name} v${version} already exists but file is not a complete schema`,\n )\n }\n } catch (error) {\n // If error is already our custom error, re-throw it\n if (error instanceof Error && error.message.includes('already exists')) {\n throw error\n }\n // If we can't read/parse the existing file, throw a generic error\n throw new Error(\n `Schema ${schemaFile.metadata.name} v${version} already exists but could not be read: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n\n // Ensure working directory exists\n await BaseFileManager.createDirIfNotExists(workingDir)\n\n // Write schema to file\n const content = JSON.stringify(schemaFile, null, 2)\n await BaseFileManager.saveFile(filePath, content)\n\n // Wait for the file to be available and readable before trying to read it\n // This is necessary in browser environments where file writes may not be immediately readable\n await BaseFileManager.waitForFileWithContent(filePath, 100, 5000)\n\n // Load the schema file to process models and add them to the store\n // This handles all model creation, database operations, and store updates\n await loadSchemaFromFile(filePath)\n\n // Schema is now saved to database\n // useSchemas hook will pick it up via database queries\n\n return filePath\n}\n\n/**\n * Load an existing complete schema file and process its models\n * This is used to load models from already-processed schema files into the store\n * @param schemaFilePath - Path to the complete schema file (must have $schema field)\n * @returns The file path of the schema\n * @throws Error if file cannot be read, parsed, or is not a complete schema\n */\nexport const loadSchemaFromFile = async (\n schemaFilePath: string,\n): Promise<string> => {\n try {\n // Read and parse the schema file\n const content = await BaseFileManager.readFileAsString(schemaFilePath)\n const schemaFile = JSON.parse(content) as SchemaFileFormat\n\n // Verify it's a complete schema file\n if (!schemaFile.$schema) {\n throw new Error(\n `File ${schemaFilePath} is not a complete schema file (missing $schema field). Use importJsonSchema() for minimal format files.`,\n )\n }\n\n // Extract schema name and version\n const schemaName = schemaFile.metadata?.name\n const version = schemaFile.version\n\n if (!schemaName) {\n throw new Error('Schema name is required in metadata.name')\n }\n\n // Convert to JsonImportSchema format for processing\n // Remove id fields for JsonImportSchema format (they're not part of the import format)\n const importData: JsonImportSchema = {\n name: schemaName,\n models: Object.fromEntries(\n Object.entries(schemaFile.models || {}).map(([modelName, model]) => [\n modelName,\n {\n ...model,\n // Remove id field for import format\n id: undefined,\n properties: Object.fromEntries(\n Object.entries(model.properties).map(([propName, prop]) => {\n const schemaProp = prop as any\n const jsonProp: any = {\n type: schemaProp.dataType || schemaProp.type,\n // Remove id field for import format\n id: undefined,\n }\n \n // Handle Relation type - convert ref to model\n if (schemaProp.ref || schemaProp.refModelName) {\n jsonProp.model = schemaProp.refModelName || schemaProp.ref\n }\n \n // Handle List type\n if ((schemaProp.dataType === 'List' || schemaProp.type === 'List') && schemaProp.refValueType) {\n jsonProp.items = {\n type: schemaProp.refValueType,\n model: schemaProp.refModelName || schemaProp.ref,\n }\n }\n \n // Copy other properties (storage, etc.)\n Object.keys(schemaProp).forEach(key => {\n if (key !== 'id' && key !== 'dataType' && key !== 'type' && key !== 'ref' && key !== 'refModelName' && key !== 'refValueType') {\n jsonProp[key] = schemaProp[key]\n }\n })\n \n return [propName, jsonProp]\n }),\n ),\n },\n ]),\n ) as unknown as JsonImportSchema['models'],\n }\n\n // Generate schema ID if missing (before creating schemaInput)\n if (!schemaFile.id) {\n schemaFile.id = generateId()\n logger('Generated schema ID for schema file:', schemaFile.id)\n }\n\n // Extract schemaFileIds from JSON file and generate missing ones BEFORE creating models\n // This ensures Model instances are created with correct IDs\n const modelFileIds = new Map<string, string>()\n const propertyFileIds = new Map<string, Map<string, string>>()\n \n for (const [modelName, model] of Object.entries(schemaFile.models || {})) {\n // Generate model ID if missing\n if (!model.id) {\n model.id = generateId()\n logger(`Generated model ID for ${modelName}:`, model.id)\n // Update the schemaFile object so it's included in schemaData\n schemaFile.models[modelName].id = model.id\n }\n modelFileIds.set(modelName, model.id)\n \n const propIds = new Map<string, string>()\n for (const [propName, prop] of Object.entries(model.properties)) {\n // Generate property ID if missing\n if (!prop.id) {\n prop.id = generateId()\n logger(`Generated property ID for ${modelName}.${propName}:`, prop.id)\n // Update the schemaFile object so it's included in schemaData\n schemaFile.models[modelName].properties[propName].id = prop.id\n }\n propIds.set(propName, prop.id)\n }\n if (propIds.size > 0) {\n propertyFileIds.set(modelName, propIds)\n }\n }\n\n // Convert JSON models to Model classes, passing modelFileIds and propertyFileIds so Model instances use correct IDs\n const modelDefinitions = await createModelsFromJson(importData, modelFileIds, propertyFileIds)\n\n logger('loadSchemaFromFile - modelDefinitions length:', Object.keys(modelDefinitions).length)\n\n // Convert schema file metadata to schema input for database\n const schemaInput = {\n name: schemaName,\n version,\n schemaFileId: schemaFile.id || null,\n createdAt: new Date(schemaFile.metadata.createdAt).getTime(),\n updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),\n } as Parameters<typeof addSchemaToDb>[0]\n\n // Use dynamic import to break circular dependency\n const dbMod = await import('../helpers/db')\n const { addSchemaToDb, addModelsToDb } = dbMod\n\n // Try to add schema and models to database if database is available\n try {\n const db = BaseDb.getAppDb()\n if (db) {\n // Store full schema data in database as fallback when file is not available\n // schemaFile already has all IDs (from JSON file or generated), so we can use it directly\n const schemaData = JSON.stringify(schemaFile, null, 2)\n \n // Add schema to database (creates or returns existing) with schemaFileId and schemaData\n const schemaRecord = await addSchemaToDb(schemaInput, schemaFile.id, schemaData, false)\n\n // Add models to database and link them to the schema with schemaFileIds (only if there are models)\n if (Object.keys(modelDefinitions).length > 0) {\n await addModelsToDb(modelDefinitions, schemaRecord, undefined, {\n schemaFileId: schemaFile.id,\n modelFileIds,\n propertyFileIds,\n })\n \n // Verify properties are persisted (important for browser environments)\n // Wait a bit for database writes to be visible (browser environments may have delays)\n await new Promise(resolve => setTimeout(resolve, 200))\n \n console.log(`[importJsonSchema] Starting property verification for schema \"${schemaName}\" (schemaRecord.id: ${schemaRecord.id})`)\n // Query the database to get model IDs that were just created\n const modelSchemaSchemaMod = await import('../seedSchema/ModelSchemaSchema')\n const { modelSchemas } = modelSchemaSchemaMod\n const modelSchemaMod = await import('../seedSchema/ModelSchema')\n const { models: modelsTable } = modelSchemaMod\n const drizzleMod = await import('drizzle-orm')\n const { eq } = drizzleMod\n\n // Try to find models directly by schemaFileId first (more reliable than join table)\n const seedModelId = modelFileIds.get('Seed')\n let seedModel: any[] = []\n if (seedModelId) {\n // Retry querying for the model until it's visible\n for (let attempt = 0; attempt < 10; attempt++) {\n seedModel = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, seedModelId))\n .limit(1)\n \n if (seedModel.length > 0 && seedModel[0].id) {\n break\n }\n \n if (attempt < 9) {\n await new Promise(resolve => setTimeout(resolve, 100))\n }\n }\n \n if (seedModel.length > 0 && seedModel[0].id) {\n console.log(`[importJsonSchema] Found Seed model (modelId: ${seedModel[0].id}), verifying properties`)\n await verifyPropertiesPersisted(db, seedModel[0].id, 'Seed', 10, 100)\n } else {\n console.log(`[importJsonSchema] WARNING: Could not find Seed model after retries`)\n }\n }\n \n // Also verify via join table if schemaRecord.id is available (for completeness)\n if (schemaRecord.id) {\n // Retry querying join table until entries are visible\n let modelLinks: any[] = []\n for (let attempt = 0; attempt < 10; attempt++) {\n modelLinks = await db\n .select({\n modelId: modelSchemas.modelId,\n modelName: modelsTable.name,\n })\n .from(modelSchemas)\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(eq(modelSchemas.schemaId, schemaRecord.id))\n \n if (modelLinks.length > 0) {\n break\n }\n \n if (attempt < 9) {\n await new Promise(resolve => setTimeout(resolve, 100))\n }\n }\n \n logger(`Verifying properties: found ${modelLinks.length} model links for schema ${schemaName} (id: ${schemaRecord.id})`)\n \n // If we didn't verify via direct lookup, verify via join table\n if (!seedModelId || (seedModel.length === 0 || !seedModel[0].id)) {\n const seedModelLink = modelLinks.find((link: { modelId: number | null; modelName: string | null }) => link.modelName === 'Seed')\n if (seedModelLink && seedModelLink.modelId) {\n logger(`Verifying properties for Seed model via join table (modelId: ${seedModelLink.modelId})`)\n await verifyPropertiesPersisted(db, seedModelLink.modelId, 'Seed', 10, 100)\n } else if (modelLinks.length > 0 && modelLinks[0].modelId) {\n // Fallback to first model if Seed not found\n logger(`Verifying properties for ${modelLinks[0].modelName} model via join table (modelId: ${modelLinks[0].modelId})`)\n await verifyPropertiesPersisted(db, modelLinks[0].modelId, modelLinks[0].modelName || 'unknown', 10, 100)\n }\n }\n }\n \n // After properties are created (file path), ensure schemaFile has the correct IDs from database\n // Query the database to get the actual schemaFileId values that were used\n // This ensures schemaData matches what's actually in the database\n const modelSchemaMod2 = await import('../seedSchema/ModelSchema')\n const { properties: propertiesTable } = modelSchemaMod2\n\n let schemaFileUpdated = false\n for (const [modelName, modelFileId] of modelFileIds.entries()) {\n // Get model record to find modelId\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n \n if (modelRecords.length > 0) {\n const modelId = modelRecords[0].id\n \n // Get all properties for this model from database\n const propertyRecords = await db\n .select()\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, modelId))\n \n // Update schemaFile with actual database IDs (only if they differ)\n for (const propRecord of propertyRecords) {\n if (propRecord.schemaFileId && schemaFile.models[modelName]?.properties[propRecord.name]) {\n const currentId = schemaFile.models[modelName].properties[propRecord.name].id\n if (currentId !== propRecord.schemaFileId) {\n schemaFile.models[modelName].properties[propRecord.name].id = propRecord.schemaFileId\n logger(`Updated schemaFile property ID for ${modelName}.${propRecord.name} from ${currentId} to ${propRecord.schemaFileId}`)\n schemaFileUpdated = true\n }\n }\n }\n }\n }\n \n // Always update schemaData to ensure it matches the current schemaFile state\n // This is important even if nothing changed, to ensure consistency\n const updatedSchemaData = JSON.stringify(schemaFile, null, 2)\n \n // Update the schema record in the database with current schemaData\n const schemaSchemaMod = await import('../seedSchema/SchemaSchema')\n const { schemas: schemasTable } = schemaSchemaMod\n await db\n .update(schemasTable)\n .set({ schemaData: updatedSchemaData })\n .where(eq(schemasTable.id, schemaRecord.id))\n \n if (schemaFileUpdated) {\n logger(`Updated schemaData in database with actual property IDs for schema \"${schemaName}\"`)\n } else {\n logger(`Verified schemaData in database matches schemaFile for schema \"${schemaName}\"`)\n }\n }\n }\n } catch (dbError) {\n // Database not available - log warning but continue\n logger('Database not available, skipping database operations:', dbError instanceof Error ? dbError.message : String(dbError))\n }\n\n // Models are now Model instances, no registration needed\n // They should be created via Model.create() and are accessible via Model static methods\n for (const [modelName] of Object.entries(modelDefinitions)) {\n logger('loadSchemaFromFile - model available:', modelName)\n }\n\n return schemaFilePath\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new Error(`Invalid JSON in file ${schemaFilePath}: ${error.message}`)\n }\n throw new Error(\n `Failed to load schema from file ${schemaFilePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Create a Model class from a JSON model definition\n * @param modelName - The name of the model\n * @param modelDef - The JSON model definition\n * @param schemaName - The name of the schema this model belongs to\n * @returns A Model class that can be used with the SDK\n */\nexport const createModelFromJson = async (\n modelName: string,\n modelDef: JsonImportSchema['models'][string],\n schemaName: string,\n modelFileId?: string, // Optional modelFileId from JSON file\n propertyFileIds?: Map<string, string>, // Optional map of property names to their file IDs from the JSON file\n): Promise<any> => {\n const modelMod = await import('../Model/Model')\n const { Model } = modelMod\n\n // Convert JSON properties to schema format\n const convertedProperties: { [propName: string]: any } = {}\n if (modelDef.properties) {\n for (const [propName, propDef] of Object.entries(modelDef.properties)) {\n // JSON import format: { type, model, items, storage: { type, path, extension } }\n // Schema format: { dataType, ref, refValueType, storageType, localStorageDir, filenameSuffix }\n const jsonProp = propDef as any\n const schemaProp: any = {\n dataType: jsonProp.type,\n }\n\n // Include property ID if available from propertyFileIds map\n // This ensures the property uses the correct ID from the schema file\n const propertyFileId = propertyFileIds?.get(propName)\n if (propertyFileId) {\n schemaProp.id = propertyFileId\n }\n\n // Handle Relation type\n if (jsonProp.model) {\n schemaProp.ref = jsonProp.model\n schemaProp.refModelName = jsonProp.model\n }\n\n // Handle List type\n if (jsonProp.type === 'List' && jsonProp.items) {\n schemaProp.refValueType = jsonProp.items.type\n schemaProp.ref = jsonProp.items.model || jsonProp.model\n schemaProp.refModelName = jsonProp.items.model || jsonProp.model\n }\n\n // Handle storage configuration\n if (jsonProp.storage) {\n schemaProp.storageType = jsonProp.storage.type === 'ItemStorage' ? 'ItemStorage' : 'PropertyStorage'\n schemaProp.localStorageDir = jsonProp.storage.path\n schemaProp.filenameSuffix = jsonProp.storage.extension\n }\n\n convertedProperties[propName] = schemaProp\n }\n }\n\n // Create Model instance with the definition\n // Pass id (schemaFileId) if provided to ensure Model instance uses correct ID\n // Note: indexes and description are ignored - they remain in JSON for schema file format compliance but are not used by Model instances\n if (modelFileId) {\n logger(`Creating schema model \"${modelName}\" with modelFileId: ${modelFileId}`)\n } else {\n logger(`Warning: Creating schema model \"${modelName}\" without modelFileId - it will be renamed if duplicates exist`)\n }\n const modelInstance = Model.create(modelName, schemaName, {\n modelFileId: modelFileId, // Pass modelFileId (preferred) as id (schemaFileId) from JSON file\n id: modelFileId, // Also pass as id for backward compatibility\n properties: convertedProperties,\n waitForReady: false,\n }) as import('@/Model/Model').Model\n\n return modelInstance\n}\n\n/**\n * Convert JSON import schema to ModelDefinitions\n * @param importData - The JSON import data\n * @param modelFileIds - Optional map of model names to their file IDs from the JSON file\n * @param propertyFileIds - Optional map of model names to maps of property names to their file IDs from the JSON file\n * @returns ModelDefinitions object with Model classes\n */\nexport const createModelsFromJson = async (\n importData: JsonImportSchema,\n modelFileIds?: Map<string, string>,\n propertyFileIds?: Map<string, Map<string, string>>,\n): Promise<ModelDefinitions> => {\n const modelDefinitions: ModelDefinitions = {}\n const schemaName = importData.name\n\n for (const [modelName, modelDef] of Object.entries(importData.models)) {\n // Get modelFileId from map if available\n const modelFileId = modelFileIds?.get(modelName)\n // Use modelFileId from map (no fallback to modelDef.id as JsonImportSchema doesn't have id property)\n const finalModelFileId = modelFileId\n if (!finalModelFileId) {\n logger(`Warning: No modelFileId found for model \"${modelName}\" - model will be created without ID`)\n }\n // Get propertyFileIds for this model if available\n const modelPropertyFileIds = propertyFileIds?.get(modelName)\n const ModelClass = await createModelFromJson(modelName, modelDef, schemaName, finalModelFileId, modelPropertyFileIds)\n \n modelDefinitions[modelName] = ModelClass as unknown as ModelClassType\n }\n\n return modelDefinitions\n}\n\n/**\n * Read a JSON import file and create Model classes from it\n * @param filePath - Path to the JSON import file\n * @returns ModelDefinitions with Model classes created from the JSON schema\n */\nexport const createModelsFromJsonFile = async (\n filePath: string,\n): Promise<ModelDefinitions> => {\n const importData = await readJsonImportFile(filePath)\n return createModelsFromJson(importData)\n}\n\n","import { EventObject, fromCallback } from \"xstate\"\nimport { ClientManagerContext, FromCallbackInput } from \"@/types/machines\"\nimport { ClientManagerEvents } from \"@/client/constants\"\nimport { listSchemaFiles, loadAllSchemasFromDb } from \"@/helpers/schema\"\nimport { createModelsFromJsonFile, importJsonSchema, loadSchemaFromFile } from \"@/imports/json\"\nimport { SchemaFileFormat } from \"@/types/import\"\nimport { BaseFileManager } from \"@/helpers/FileManager/BaseFileManager\"\nimport debug from \"debug\"\nimport internalSchema from \"@/seedSchema/SEEDPROTOCOL_Seed_Protocol_v1.json\"\n\nconst logger = debug('seedSdk:client:actors:processSchemaFiles')\n\n// Timeout for the entire schema processing operation (30 seconds)\nconst PROCESS_SCHEMA_FILES_TIMEOUT_MS = 30000\n\nexport const processSchemaFiles = fromCallback<\n EventObject,\n FromCallbackInput<ClientManagerContext>\n>(({ sendBack, input: { context } }) => {\n logger('processSchemaFiles started')\n console.log('processSchemaFiles started')\n\n let hasResponded = false\n let timeoutId: NodeJS.Timeout | null = null\n\n const reportError = (error: Error) => {\n console.log('processSchemaFiles error:', error)\n if (!hasResponded) {\n hasResponded = true\n if (timeoutId) {\n clearTimeout(timeoutId)\n timeoutId = null\n }\n logger('processSchemaFiles error:', error)\n sendBack({ \n type: 'error', \n error: error instanceof Error ? error : new Error(String(error))\n })\n }\n }\n\n const reportSuccess = () => {\n console.log('processSchemaFiles completed')\n if (!hasResponded) {\n hasResponded = true\n if (timeoutId) {\n clearTimeout(timeoutId)\n timeoutId = null\n }\n logger('processSchemaFiles completed')\n sendBack({ type: ClientManagerEvents.PROCESS_SCHEMA_FILES_SUCCESS })\n }\n }\n\n // Set up a single timeout for the entire operation\n timeoutId = setTimeout(() => {\n reportError(new Error(`processSchemaFiles timed out after ${PROCESS_SCHEMA_FILES_TIMEOUT_MS}ms`))\n }, PROCESS_SCHEMA_FILES_TIMEOUT_MS)\n\n const _processSchemaFiles = async () => {\n console.log('processSchemaFiles _processSchemaFiles started')\n \n // First, load the internal seed-protocol schema\n logger('Loading internal seed-protocol schema')\n try {\n const internalSchemaData = internalSchema as SchemaFileFormat\n // Import the internal schema to database (will create models and add to store)\n // This will only import if it doesn't already exist\n await importJsonSchema({ contents: JSON.stringify(internalSchemaData) }, internalSchemaData.version)\n logger(`Loaded internal seed-protocol schema v${internalSchemaData.version}`)\n } catch (error: any) {\n // If schema already exists, that's fine - it means it was already loaded\n if (error?.message?.includes('already exists')) {\n logger('Internal seed-protocol schema already loaded')\n } else {\n logger('Error loading internal seed-protocol schema:', error)\n // Don't fail if internal schema can't be loaded - it might already be in DB\n }\n }\n\n // Then, process minimal import files (files without $schema)\n logger('Listing schema files')\n let schemaFiles: Array<{ name: string; version: number; filePath: string }> = []\n try {\n schemaFiles = await listSchemaFiles()\n logger(`Found ${schemaFiles.length} schema files to process`)\n } catch (error) {\n logger('Error listing schema files (continuing anyway):', error)\n // Continue with empty array - this is not critical\n schemaFiles = []\n }\n \n for (const schemaFile of schemaFiles) {\n try {\n await importJsonSchema(schemaFile.filePath)\n } catch (error) {\n logger(`Error importing schema file ${schemaFile.filePath}:`, error)\n // Continue with next file\n }\n }\n\n // Then, load all schemas using the unified database-first approach\n logger('Loading schemas from database and files')\n let allSchemasData: Array<{ schema: SchemaFileFormat; isDraft: boolean; source: string }> = []\n try {\n allSchemasData = await loadAllSchemasFromDb()\n logger(`Loaded ${allSchemasData.length} schemas (${allSchemasData.filter(s => s.isDraft).length} drafts, ${allSchemasData.filter(s => !s.isDraft).length} published)`)\n } catch (error) {\n logger('Error loading schemas from database (continuing anyway):', error)\n // Continue with empty array - this is not critical for initialization\n // Schemas can be loaded on-demand later\n allSchemasData = []\n }\n \n // Collect models to add to context (schemas are now loaded on-demand via database queries)\n const allModels: { [key: string]: any } = { ...(context.models || {}) }\n \n for (const schemaData of allSchemasData) {\n const schema = schemaData.schema\n const schemaName = schema.metadata?.name || 'unknown'\n \n logger(`Processing schema: ${schemaName} v${schema.version} (${schemaData.isDraft ? 'draft' : 'published'}, source: ${schemaData.source})`)\n \n // For published schemas (not drafts), load models from file if available\n // For drafts, we'll load models from the schema data itself\n if (!schemaData.isDraft && schema.id) {\n // Try to load from file if it exists (for published schemas)\n try {\n const path = BaseFileManager.getPathModule()\n const workingDir = BaseFileManager.getWorkingDir()\n const sanitizedName = schemaName.replace(/[^a-zA-Z0-9_-]/g, '_')\n const filename = `${sanitizedName}-v${schema.version}.json`\n const filePath = path.join(workingDir, filename)\n \n if (await BaseFileManager.pathExists(filePath)) {\n await loadSchemaFromFile(filePath)\n const modelDefinitions = await createModelsFromJsonFile(filePath)\n Object.assign(allModels, modelDefinitions)\n } else {\n // File doesn't exist but schema is published - this shouldn't happen\n // but we can still process the schema data\n logger(`Warning: Published schema ${schemaName} v${schema.version} has no file, using DB data`)\n }\n } catch (error) {\n logger(`Error loading schema file for ${schemaName}:`, error)\n }\n } else if (schemaData.isDraft) {\n // For drafts, we need to create models from the schema data\n // This is a simplified version - in practice you might want to call\n // createModelsFromJson with the schema data\n logger(`Draft schema ${schemaName} - models will be loaded when schema is accessed`)\n }\n \n // Schemas are now loaded on-demand via database queries (useSchemas hook uses loadAllSchemasFromDb)\n // No need to populate context.schemas\n }\n \n // Update context with models only (schemas are loaded on-demand via database queries)\n sendBack({ \n type: ClientManagerEvents.UPDATE_CONTEXT, \n context: { \n models: allModels,\n } \n })\n }\n\n _processSchemaFiles()\n .then(() => {\n reportSuccess()\n })\n .catch((error) => {\n reportError(error instanceof Error ? error : new Error(String(error)))\n })\n\n // Cleanup function to clear timeout if actor is stopped\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId)\n timeoutId = null\n }\n }\n})","import { ClientManagerContext, SeedConstructorOptions } from \"@/types\"\nimport { assign, setup } from \"xstate\"\nimport { normalizeAddressConfig } from \"@/helpers/addresses\"\nimport { platformClassesInit } from \"./actors/platformClassesInit\"\nimport { saveAppState } from \"./actors/saveAppState\"\nimport { fileSystemInit } from \"./actors/fileSystemInit\"\nimport { dbInit } from \"./actors/dbInit\"\nimport { ClientManagerEvents, ClientManagerState, MachineIds } from \"@/client/constants\"\nimport { addModelsToStore } from \"./actors/addModelsToStore\"\nimport { addModelsToDb } from \"./actors/addModelsToDb\"\nimport { saveConfig } from \"./actors/saveConfig\"\nimport { processSchemaFiles } from \"./actors/processSchemaFiles\"\n\nconst {\n UNINITIALIZED,\n PLATFORM_CLASSES_INIT,\n FILE_SYSTEM_INIT,\n DB_INIT,\n SAVE_CONFIG,\n PROCESS_SCHEMA_FILES,\n ADD_MODELS_TO_STORE,\n ADD_MODELS_TO_DB,\n IDLE,\n} = ClientManagerState\n\nconst {\n UPDATE_CONTEXT,\n PLATFORM_CLASSES_READY,\n FILE_SYSTEM_READY,\n DB_READY,\n SAVE_CONFIG_SUCCESS,\n SAVE_APP_STATE_SUCCESS,\n SET_ADDRESSES,\n ADD_MODELS_TO_STORE_SUCCESS,\n ADD_MODELS_TO_DB_SUCCESS,\n PROCESS_SCHEMA_FILES_SUCCESS,\n} = ClientManagerEvents\n\ntype InitEvent = {\n type: 'init'\n options: SeedConstructorOptions\n}\n\nexport const clientManagerMachine = setup({\n types: {\n context: {} as ClientManagerContext,\n input: {} as ClientManagerContext | undefined,\n },\n actors: {\n platformClassesInit,\n fileSystemInit,\n dbInit,\n saveConfig,\n saveAppState,\n addModelsToStore,\n addModelsToDb,\n processSchemaFiles,\n },\n}).createMachine({\n id: MachineIds.CLIENT_MANAGER,\n initial: UNINITIALIZED,\n context: ({ input }) => input as ClientManagerContext,\n on: {\n [UPDATE_CONTEXT]: {\n actions: assign(({ event, context }) => {\n console.log('updateContext event:', event)\n return {\n ...context,\n ...event.context,\n }\n }),\n },\n init: {\n target: `.${PLATFORM_CLASSES_INIT}`,\n actions: assign({\n isInitialized: false,\n initError: undefined,\n }),\n },\n },\n states: {\n [UNINITIALIZED]: {\n on: {\n init: {\n target: PLATFORM_CLASSES_INIT,\n },\n },\n },\n [PLATFORM_CLASSES_INIT]: {\n on: {\n [PLATFORM_CLASSES_READY]: {\n target: FILE_SYSTEM_INIT,\n },\n error: {\n actions: assign(({ event }) => {\n const error = (event as any).error instanceof Error \n ? (event as any).error \n : new Error(String((event as any).error || 'Platform classes initialization failed'))\n return {\n initError: error,\n }\n }),\n },\n },\n invoke: {\n src: 'platformClassesInit',\n input: ({ event, context }) => ({ \n event: event as InitEvent, \n context \n }),\n },\n },\n [FILE_SYSTEM_INIT]: {\n on: {\n [FILE_SYSTEM_READY]: {\n target: DB_INIT,\n },\n },\n invoke: {\n src: 'fileSystemInit',\n input: ({ context }) => ({ context }),\n },\n },\n [DB_INIT]: {\n on: {\n [DB_READY]: {\n target: SAVE_CONFIG,\n },\n },\n invoke: {\n src: 'dbInit',\n input: ({ context }) => ({ context }),\n },\n },\n [SAVE_CONFIG]: {\n on: {\n [SAVE_CONFIG_SUCCESS]: {\n target: PROCESS_SCHEMA_FILES,\n },\n },\n invoke: {\n src: 'saveConfig',\n input: ({ context }) => ({ context }),\n },\n },\n [PROCESS_SCHEMA_FILES]: {\n on: {\n [PROCESS_SCHEMA_FILES_SUCCESS]: {\n target: ADD_MODELS_TO_STORE,\n },\n },\n invoke: {\n src: 'processSchemaFiles',\n input: ({ context }) => ({ context }),\n },\n },\n [ADD_MODELS_TO_STORE]: {\n on: {\n [ADD_MODELS_TO_STORE_SUCCESS]: {\n target: ADD_MODELS_TO_DB,\n },\n },\n invoke: {\n src: 'addModelsToStore',\n input: ({ context }) => ({ context }),\n },\n },\n [ADD_MODELS_TO_DB]: {\n on: {\n [ADD_MODELS_TO_DB_SUCCESS]: {\n target: IDLE,\n },\n },\n invoke: {\n src: 'addModelsToDb',\n input: ({ context }) => ({ context }),\n },\n },\n [IDLE]: {\n entry: assign({\n isInitialized: true,\n }),\n on: {\n [SAVE_APP_STATE_SUCCESS]: {\n actions: assign(({ event }) => {\n const { key, value } = event\n return {\n isSaving: false\n }\n }),\n },\n [SET_ADDRESSES]: {\n actions: [\n assign(({ event, spawn }) => {\n const { addresses } = event as { type: string; addresses: string[] | { owned: string[]; watched?: string[] } }\n const normalized = normalizeAddressConfig(addresses)\n spawn('saveAppState', {\n input: {\n key: 'addresses',\n value: { owned: normalized.owned, watched: normalized.watched },\n },\n })\n return {\n addresses: normalized.owned,\n ownedAddresses: normalized.owned,\n watchedAddresses: normalized.watched,\n isSaving: true,\n }\n })\n ],\n },\n init: {\n target: PLATFORM_CLASSES_INIT,\n actions: assign({\n isInitialized: false,\n }),\n },\n },\n },\n },\n})\n","import type { AddressConfiguration } from '@/types'\nimport debug from 'debug'\nimport { createActor, waitFor } from 'xstate'\nimport { clientManagerMachine } from '@/client/clientManagerMachine'\n// import { BaseDb } from '@/db/Db/BaseDb'\n// import { appState } from '@/seedSchema'\n// import { eq } from 'drizzle-orm'\nimport { CLIENT_NOT_INITIALIZED } from '@/helpers/constants'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { appState, models } from '@/seedSchema'\nimport { eq } from 'drizzle-orm'\nimport {\n getOwnedAddressesFromDb,\n getWatchedAddressesFromDb,\n} from '@/helpers/db'\n\nconst logger = debug('seedSdk:client')\n\ntype ModelDefObj = {\n name: string\n type: string\n properties: {\n [key: string]: any\n }\n}\n\nexport const clientManager = createActor(clientManagerMachine, {\n input: {\n isInitialized: false,\n addressesSet: false,\n isSaving: false,\n }\n})\n\nconst subscription = clientManager.subscribe(( snapshot ) => {\n logger('ClientManager snapshot.value:', snapshot.value)\n logger('ClientManager snapshot.context.isInitialized:', snapshot.context.isInitialized)\n})\n\nclientManager.start()\n\nconst ensureInitialized = () => {\n if (!clientManager.getSnapshot().context.isInitialized) {\n throw new Error(CLIENT_NOT_INITIALIZED);\n }\n}\n\n// Singleton instance - created once at module load time\n// ES modules cache exports, ensuring all imports get the same instance\nconst clientInstance = {\n isInitialized: () => {\n return clientManager.getSnapshot().context.isInitialized\n },\n getService: () => {\n // ensureInitialized();\n return clientManager;\n },\n init: async (options: any) => {\n // If the actor is stopped (e.g., from a previous failed test), restart it\n const snapshot = clientManager.getSnapshot()\n const currentState = snapshot.value as string\n const isStopped = snapshot.status === 'stopped'\n \n if (isStopped) {\n logger('Client manager was stopped, restarting...')\n clientManager.start()\n // Wait for the actor to be ready\n try {\n await waitFor(clientManager, (snapshot) => snapshot.status !== 'stopped', { timeout: 1000 })\n } catch (e) {\n logger('Timeout waiting for actor to restart, continuing anyway...')\n }\n }\n \n // Clear any stale context from previous failed initializations\n // This ensures we start with a clean slate before the new init updates it\n if (currentState !== 'uninitialized') {\n logger(`Client manager is in state ${currentState}, clearing stale context before re-init...`)\n clientManager.send({ \n type: 'updateContext', \n context: {\n isInitialized: false,\n addressesSet: false,\n isSaving: false,\n endpoints: undefined,\n addresses: undefined,\n ownedAddresses: undefined,\n watchedAddresses: undefined,\n models: undefined,\n arweaveDomain: undefined,\n filesDir: undefined,\n dbConfig: undefined,\n initError: undefined,\n }\n })\n // Wait a moment for the context update to be processed\n await new Promise(resolve => setTimeout(resolve, 10))\n }\n \n // Send init event - the root-level handler will transition to PLATFORM_CLASSES_INIT\n // which will stop any running actors and start fresh with the new options\n // The platformClassesInit actor will update the context with the correct endpoints from options\n clientManager.send({ type: 'init', options });\n \n // Wait for the state machine to transition to PLATFORM_CLASSES_INIT to ensure\n // any old actors are stopped and the new initialization flow begins\n try {\n await waitFor(clientManager, (snapshot) => {\n return snapshot.value === 'platformClassesInit' || snapshot.context.isInitialized\n }, { timeout: 1000 })\n } catch (e) {\n // If we can't transition, continue anyway - the waitFor below will catch any errors\n logger('Timeout waiting for state transition, continuing...')\n }\n try {\n await waitFor(clientManager, (snapshot) => {\n // Check for errors in context (for cases where error is set but state hasn't transitioned yet)\n if (snapshot.context.initError) {\n const error = snapshot.context.initError instanceof Error \n ? snapshot.context.initError \n : new Error(String(snapshot.context.initError))\n throw error\n }\n return snapshot.context.isInitialized\n }, { timeout: 30000 });\n } catch (error: any) {\n // Ensure we never throw undefined\n if (error === undefined || error === null) {\n throw new Error('Initialization failed with undefined error')\n }\n throw error\n }\n },\n setAddresses: async (addresses: AddressConfiguration) => {\n ensureInitialized();\n logger('setAddresses', addresses);\n clientManager.send({ type: 'setAddresses', addresses });\n await waitFor(clientManager, (snapshot) => !snapshot.context.isSaving, { timeout: 10000 });\n logger('setAddresses success', addresses);\n },\n getAddresses: async () => {\n ensureInitialized();\n const owned = await getOwnedAddressesFromDb();\n const watched = await getWatchedAddressesFromDb();\n return { owned, watched };\n },\n getOwnedAddresses: async () => {\n ensureInitialized();\n return getOwnedAddressesFromDb();\n },\n getWatchedAddresses: async () => {\n ensureInitialized();\n return getWatchedAddressesFromDb();\n },\n addModel: async (modelDef: ModelDefObj) => {\n const db = await BaseDb.getAppDb();\n const existingModels = await db.select().from(models).where(eq(models.name, modelDef.name));\n if (existingModels.length > 0) {\n return;\n }\n await db.insert(models).values({\n name: modelDef.name\n })\n // Global service removed - model registration is now handled by ClientManager\n // Models are added to DB during the ADD_MODELS_TO_DB state\n },\n onReady: (callback: () => void) => {\n const subscription = clientManager.subscribe((snapshot) => {\n if (snapshot.context.isInitialized) {\n subscription.unsubscribe()\n callback();\n }\n });\n },\n stop: () => {\n ensureInitialized();\n clientManager.stop();\n },\n unload: () => {\n ensureInitialized();\n clientManager.stop();\n subscription.unsubscribe();\n },\n}\n\n// Export the singleton instance\n// This ensures all imports across different files get the same instance\nexport const ClientManager = clientInstance\n\nexport const getClient = () => {\n return clientInstance\n}","import { Observable, Subscription } from 'rxjs'\nimport debug from 'debug'\n\n/**\n * Configuration for entity liveQuery setup\n */\nexport interface LiveQueryConfig<T extends object> {\n /**\n * Get entity identifier for query (e.g., schemaId, modelId, seedLocalId)\n * Returns the ID needed to build the query\n */\n getEntityId: (instance: T) => Promise<number | string | undefined>\n /**\n * Build the liveQuery query (returns Observable)\n * Called with the entity ID from getEntityId\n * Can be async to allow dynamic imports\n */\n buildQuery: (entityId: number | string) => Observable<any[]> | Promise<Observable<any[]>>\n /**\n * Transform query results to entity IDs\n * Extracts the relevant IDs from the query result rows\n */\n extractEntityIds: (rows: any[]) => string[]\n /**\n * Update entity context with new IDs\n * Called when query results change\n */\n updateContext: (instance: T, ids: string[]) => void\n /**\n * Optional: Create child entity instances before updating context\n * This ensures instances are in cache when context is updated\n */\n createChildInstances?: (ids: string[]) => Promise<void>\n /**\n * Instance state WeakMap (for storing subscription)\n */\n instanceState: WeakMap<T, { liveQuerySubscription: Subscription | null }>\n /**\n * Logger name for debugging\n */\n loggerName: string\n /**\n * Optional: Query initial data immediately (for Node.js compatibility)\n * If provided, this will be called to get initial data before setting up subscription\n */\n queryInitialData?: (entityId: number | string) => Promise<any[]>\n /**\n * Optional: Check if entity is ready before setting up subscription\n * Returns true if ready, false otherwise\n */\n isReady?: (instance: T) => boolean\n /**\n * Optional: Wait for entity to be ready\n * Called if isReady returns false\n */\n waitForReady?: (instance: T) => Promise<void>\n}\n\n/**\n * Set up liveQuery subscription for an entity\n * This enables cross-instance synchronization (e.g., changes in other tabs/windows)\n * \n * @param instance - Entity instance\n * @param config - LiveQuery configuration\n */\nexport function setupEntityLiveQuery<T extends { getService(): any }>(\n instance: T,\n config: LiveQueryConfig<T>\n): void {\n const isBrowser = typeof window !== 'undefined'\n const logger = debug(config.loggerName)\n \n // Use a closure variable to track setup state per instance\n const setupState = { subscriptionSetUp: false }\n\n const setupLiveQuery = async (entityId: number | string) => {\n if (setupState.subscriptionSetUp) {\n return\n }\n\n setupState.subscriptionSetUp = true\n logger(`Setting up liveQuery for entity ID: ${entityId}`)\n \n try {\n // Query initial data if provided (for Node.js compatibility)\n if (config.queryInitialData) {\n const initialRows = await config.queryInitialData(entityId)\n const initialIds = config.extractEntityIds(initialRows)\n \n if (initialIds.length > 0) {\n logger(`Initial query returned ${initialIds.length} entities`)\n \n // Create child instances if provided\n if (config.createChildInstances) {\n await config.createChildInstances(initialIds)\n }\n \n // Update context with initial IDs\n config.updateContext(instance, initialIds)\n }\n }\n\n // Only set up liveQuery subscription in browser environment\n if (isBrowser) {\n // buildQuery can be async to allow dynamic imports\n const queryResult = config.buildQuery(entityId)\n const query$ = queryResult instanceof Promise ? await queryResult : queryResult\n \n const instanceState = config.instanceState.get(instance)\n if (!instanceState) {\n logger('Instance state not found')\n return\n }\n\n // Subscribe to liveQuery updates\n const subscription = query$.subscribe({\n next: async (rows) => {\n // Check if instance state still exists (hasn't been cleaned up)\n const currentInstanceState = config.instanceState.get(instance)\n if (!currentInstanceState) {\n logger('Instance state was cleaned up, skipping update')\n return\n }\n \n logger(`Query returned ${rows.length} rows`)\n \n const ids = config.extractEntityIds(rows)\n \n // Create child instances if provided (before updating context)\n if (config.createChildInstances && ids.length > 0) {\n await config.createChildInstances(ids)\n }\n \n // Update context with new IDs\n config.updateContext(instance, ids)\n },\n error: (error) => {\n logger(`LiveQuery error: ${error}`)\n },\n })\n\n instanceState.liveQuerySubscription = subscription\n logger(`LiveQuery subscription set up for entity ID: ${entityId}`)\n } else {\n logger('Skipping liveQuery subscription in Node.js environment')\n }\n } catch (error) {\n logger(`Error setting up subscription: ${error}`)\n setupState.subscriptionSetUp = false // Reset on error so we can retry\n }\n }\n\n // Set up liveQuery subscription as soon as we have entity ID\n const setupSubscription = instance.getService().subscribe(async (snapshot: any) => {\n // Check if entity is ready\n if (config.isReady && !config.isReady(instance)) {\n if (config.waitForReady) {\n await config.waitForReady(instance)\n } else {\n return // Not ready yet, will retry on next snapshot\n }\n }\n \n // Get entity ID\n const entityId = await config.getEntityId(instance)\n \n if (!entityId) {\n return // Need entity ID to proceed\n }\n\n // Once we have entity ID, set up the liveQuery subscription (only once)\n if (!setupState.subscriptionSetUp) {\n await setupLiveQuery(entityId)\n if (setupState.subscriptionSetUp) {\n setupSubscription.unsubscribe()\n }\n }\n })\n \n // Also check current state immediately in case entity ID is already available\n const currentSnapshot = instance.getService().getSnapshot()\n if (config.isReady && !config.isReady(instance)) {\n // Not ready yet, will be handled by subscription\n return\n }\n \n config.getEntityId(instance).then((entityId) => {\n if (entityId && !setupState.subscriptionSetUp) {\n setupLiveQuery(entityId).catch((error) => {\n logger(`Error in immediate setup: ${error}`)\n })\n }\n }).catch((error) => {\n logger(`Error getting entity ID: ${error}`)\n })\n}\n","import { models as modelsTable } from '@/seedSchema/ModelSchema'\nimport { modelSchemas } from '@/seedSchema/ModelSchemaSchema'\nimport { schemas as schemasTable } from '@/seedSchema/SchemaSchema'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { eq, or } from 'drizzle-orm'\n\nexport type ModelsDataRow = {\n id: number\n name: string\n schemaFileId: string | null\n isEdited: number | null\n}\n\ntype GetModelsData = (schemaIdentifier?: string) => Promise<ModelsDataRow[]>\n\n/**\n * Returns model rows (id, name, schemaFileId, isEdited) for building Model instances.\n * When schemaIdentifier is provided, only returns models for that schema (join models -> model_schemas -> schemas).\n * schemaIdentifier can be either schema name or schema file ID.\n */\nexport const getModelsData: GetModelsData = async (\n schemaIdentifier?: string,\n): Promise<ModelsDataRow[]> => {\n const appDb = BaseDb.getAppDb()\n if (!appDb) {\n return []\n }\n\n if (schemaIdentifier !== undefined && schemaIdentifier !== '') {\n const runQuery = () =>\n appDb\n .select({\n id: modelsTable.id,\n name: modelsTable.name,\n schemaFileId: modelsTable.schemaFileId,\n isEdited: modelsTable.isEdited,\n })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(\n or(\n eq(schemasTable.name, schemaIdentifier),\n eq(schemasTable.schemaFileId, schemaIdentifier),\n ),\n )\n\n let rows = await runQuery()\n\n // Retry when we get 0 rows (read-after-write consistency; SQLocal/async may not see the write immediately).\n for (let i = 0; i < 4 && rows.length === 0; i++) {\n await new Promise((r) => setTimeout(r, 150))\n rows = await runQuery()\n }\n\n return rows as ModelsDataRow[]\n }\n\n const rows = await appDb\n .select({\n id: modelsTable.id,\n name: modelsTable.name,\n schemaFileId: modelsTable.schemaFileId,\n isEdited: modelsTable.isEdited,\n })\n .from(modelsTable)\n\n return rows as ModelsDataRow[]\n}\n","import { ActorRefFrom, createActor, SnapshotFrom } from 'xstate'\nimport { modelMachine, ModelMachineContext } from './service/modelMachine'\nimport { createReactiveProxy } from '@/helpers/reactiveProxy'\nimport { Item } from '@/Item/Item'\nimport { ModelValues } from '@/types'\nimport type { CreateWaitOptions } from '@/types'\nimport { ItemData } from '@/types/item'\nimport { generateId } from '@/helpers'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { ConflictError, ConflictResult } from '@/Schema/errors'\nimport { getClient } from '@/client/ClientManager'\nimport { ClientManagerState } from '@/client/constants'\nimport { renameModelInDb } from '@/helpers/db'\nimport { modelPropertiesToObject } from '@/helpers/model'\nimport { models as modelsTable, properties as propertiesTable } from '@/seedSchema/ModelSchema'\nimport { modelSchemas } from '@/seedSchema/ModelSchemaSchema'\nimport { schemas as schemasTable } from '@/seedSchema/SchemaSchema'\nimport { waitForEntityIdle } from '@/helpers/waitForEntityIdle'\nimport { findEntity } from '@/helpers/entity/entityFind'\nimport { setupEntityLiveQuery } from '@/helpers/entity/entityLiveQuery'\nimport { unloadEntity } from '@/helpers/entity/entityUnload'\nimport {\n clearDestroySubscriptions,\n forceRemoveFromCaches,\n runDestroyLifecycle,\n} from '@/helpers/entity/entityDestroy'\nimport { getModelsData } from '@/db/read/getModelsData'\nimport { toSnakeCase } from 'drizzle-orm/casing'\nimport { eq, or } from 'drizzle-orm'\nimport { Subscription } from 'rxjs'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:model:Model')\nconst saveDraftLogger = debug('seedSdk:model:saveDraftToDb')\n\ntype ModelService = ActorRefFrom<typeof modelMachine>\ntype ModelSnapshot = SnapshotFrom<typeof modelMachine>\n\n// Lazy import cache for ModelProperty to avoid circular dependency\n// Eagerly start loading to minimize delay on first access\nlet ModelPropertyClass: any = null\nconst modelPropertyImportPromise = import('@/ModelProperty/ModelProperty')\n .then(module => {\n ModelPropertyClass = module.ModelProperty\n return ModelPropertyClass\n })\n .catch(() => {\n // If import fails, ModelPropertyClass remains null\n return null\n })\n\nfunction getModelProperty(): any {\n // Return cached class if available (synchronous access)\n // Note: On first access before import completes, this will return null\n // and the getter will return empty array, which matches the original behavior\n return ModelPropertyClass\n}\n\n// Lazy import cache for Schema to avoid circular dependency\nlet SchemaClass: any = null\nconst schemaImportPromise = import('@/Schema/Schema')\n .then(module => {\n SchemaClass = module.Schema\n return SchemaClass\n })\n .catch(() => {\n // If import fails, SchemaClass remains null\n return null\n })\n\n// WeakMap to store mutable state per Model instance\n// This avoids issues with read-only properties when instances are frozen by Immer\n\nconst modelInstanceState = new WeakMap<Model, {\n liveQuerySubscription: Subscription | null // LiveQuery subscription for cross-instance property updates\n}>()\n\n// Define tracked properties for the Proxy\n// These properties will be read from/written to the actor context\nconst TRACKED_PROPERTIES = [\n 'id', // schemaFileId (string) - public ID\n 'modelName',\n 'schemaName',\n] as const\n\nexport class Model {\n // Primary cache: ID-based (never changes on rename)\n protected static instanceCacheById: Map<\n string, // modelFileId\n { instance: Model; refCount: number }\n > = new Map()\n \n // Secondary index: name lookup (updated on rename)\n protected static instanceCacheByName: Map<\n string, // \"schemaName:modelName\"\n string // modelFileId\n > = new Map()\n \n // Legacy cache: kept temporarily for backward compatibility during migration\n protected static instanceCache: Map<\n string,\n { instance: Model; refCount: number }\n > = new Map()\n \n // Static tracking for pending writes\n private static pendingWrites = new Map<string, {\n modelFileId: string\n schemaId: number\n status: 'pending' | 'writing' | 'success' | 'error'\n timestamp: number\n }>()\n \n // Track which models are currently being saved to prevent concurrent saves\n protected static savingModels: Set<string> = new Set()\n \n // Cache client initialization state globally to avoid repeated checks\n private static cachedClientInitialized: boolean | null = null\n private static clientCheckTime: number = 0\n private static readonly CLIENT_CHECK_CACHE_MS = 50 // Cache for 50ms to avoid excessive checks\n \n static trackPendingWrite(modelFileId: string, schemaId: number): void {\n this.pendingWrites.set(modelFileId, {\n modelFileId,\n schemaId,\n status: 'pending',\n timestamp: Date.now(),\n })\n }\n \n static getPendingModelIds(schemaId: number): string[] {\n return Array.from(this.pendingWrites.entries())\n .filter(([_, write]) => write.schemaId === schemaId && write.status !== 'error')\n .map(([modelFileId]) => modelFileId)\n }\n \n protected readonly _service: ModelService\n\n modelName?: string\n schemaName?: string\n _properties?: any[] // Internal properties array (use getter for public access)\n // 'name' is available as an alias for 'modelName' via the proxy\n\n constructor(\n modelName: string,\n schemaName: string,\n id?: string, // schemaFileId (string) - public ID\n initialContext?: Pick<ModelMachineContext, '_pendingPropertyDefinitions'>,\n idFromSchema?: boolean // true when id was provided via options (schema model), not generated\n ) {\n const serviceInput: Pick<ModelMachineContext, 'modelName' | 'schemaName' | 'id' | '_pendingPropertyDefinitions' | '_idFromSchema'> = {\n modelName,\n schemaName,\n ...(id ? { id } : {}),\n ...(initialContext?._pendingPropertyDefinitions ? { _pendingPropertyDefinitions: initialContext._pendingPropertyDefinitions } : {}),\n _idFromSchema: !!idFromSchema,\n }\n\n this._service = createActor(modelMachine as any, {\n input: serviceInput,\n }) as ModelService\n\n this._service.start()\n\n // Initialize instance state in WeakMap\n modelInstanceState.set(this, {\n liveQuerySubscription: null,\n })\n \n // Set up liveQuery subscription for cross-instance property updates\n this._setupLiveQuerySubscription()\n \n // Subscribe to refresh properties after they're created (for Node.js where liveQuery isn't available)\n let previousState: string | undefined\n this._service.subscribe((snapshot) => {\n // Check if we just transitioned to idle from creatingProperties state\n if (snapshot.value === 'idle' && previousState === 'creatingProperties') {\n console.log('[Model constructor] Transitioned to idle after creating properties, refreshing properties from DB')\n // Small delay to ensure properties are written to DB\n setTimeout(() => {\n this._refreshPropertiesFromDb().catch((error) => {\n logger(`[Model constructor] Error refreshing properties: ${error}`)\n })\n }, 200)\n }\n previousState = snapshot.value as string\n })\n\n // Note: Property getters/setters are now handled by the Proxy in create()\n }\n\n /**\n * Find a unique model name by checking for duplicates (case-insensitive) in the cache\n * If duplicates are found, appends an incrementing number to make it unique\n * \n * @param modelName - The desired model name\n * @param schemaName - The schema name\n * @param skipAllChecks - If true, skip all duplicate checks and return original name (used when creating schema models to preserve original names)\n * @returns A unique model name\n */\n static findUniqueModelName(modelName: string, schemaName: string, skipAllChecks: boolean = false): string {\n // If skipAllChecks is true (schema models), preserve original name\n if (skipAllChecks) {\n return modelName\n }\n \n const lowerModelName = modelName.toLowerCase()\n \n // Check all cached models for this schema\n const existingNames = new Set<string>()\n const existingNumbers = new Set<number>()\n \n // Check name-based cache\n for (const [nameKey, modelFileId] of this.instanceCacheByName.entries()) {\n const [cachedSchemaName, cachedModelName] = nameKey.split(':', 2)\n if (cachedSchemaName === schemaName && cachedModelName) {\n const lowerCachedName = cachedModelName.toLowerCase()\n existingNames.add(lowerCachedName)\n \n // If it matches the base name (case-insensitive), check if it has a number suffix\n if (lowerCachedName === lowerModelName) {\n existingNumbers.add(0) // Base name exists\n } else if (lowerCachedName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerCachedName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n }\n }\n }\n }\n \n // Check legacy cache\n for (const [nameKey] of this.instanceCache.keys()) {\n const [cachedSchemaName, cachedModelName] = nameKey.split(':', 2)\n if (cachedSchemaName === schemaName && cachedModelName) {\n const lowerCachedName = cachedModelName.toLowerCase()\n existingNames.add(lowerCachedName)\n \n // If it matches the base name (case-insensitive), check if it has a number suffix\n if (lowerCachedName === lowerModelName) {\n existingNumbers.add(0) // Base name exists\n } else if (lowerCachedName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerCachedName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n }\n }\n }\n }\n \n // Also check schema context models (case-insensitive)\n // This ensures runtime-created models are renamed if they conflict with schema-defined models\n try {\n // Use lazy-loaded Schema class to avoid circular dependency\n if (SchemaClass) {\n const schema = SchemaClass.create(schemaName)\n const schemaContext = schema.getService().getSnapshot().context\n \n if (schemaContext.models) {\n for (const schemaModelName of Object.keys(schemaContext.models)) {\n const lowerSchemaModelName = schemaModelName.toLowerCase()\n \n // If it matches the base name (case-insensitive), check if it has a number suffix\n if (lowerSchemaModelName === lowerModelName) {\n existingNumbers.add(0) // Base name exists in schema\n } else if (lowerSchemaModelName.startsWith(lowerModelName + ' ')) {\n // Check if it's the base name followed by a space and a number\n const suffix = lowerSchemaModelName.slice(lowerModelName.length + 1)\n const number = parseInt(suffix, 10)\n if (!isNaN(number) && suffix === number.toString()) {\n existingNumbers.add(number)\n }\n }\n }\n }\n }\n } catch (error) {\n // If schema check fails, continue with cache-only check\n // This is a best-effort check and shouldn't block model creation\n }\n \n // If no duplicates found (no base name match and no numbered variants), return original name\n if (existingNumbers.size === 0) {\n return modelName\n }\n \n // Find the next available number\n // Start from 1 if base name exists, otherwise check if we can use 1\n let nextNumber = existingNumbers.has(0) ? 1 : 1\n while (existingNumbers.has(nextNumber)) {\n nextNumber++\n }\n \n // Return the name with the number appended\n return `${modelName} ${nextNumber}`\n }\n\n /**\n * Create a new Model instance or return existing cached instance\n * \n * @param modelName - The name of the model\n * @param schemaNameOrSchema - The schema name (string) or Schema instance\n * @param options - Optional configuration (can be omitted to create model with empty properties):\n * - modelFileId: Pre-existing model file ID\n * - properties: Model properties definition (defaults to empty object if not provided)\n * - registerWithSchema: Whether to automatically register this model with its schema (default: true if schema instance provided)\n * \n * @example\n * // Create model with empty properties\n * const model = Model.create('MyModel', schema)\n * \n * @example\n * // Create model with properties\n * const model = Model.create('MyModel', schema, {\n * properties: { title: { dataType: 'String' } }\n * })\n */\n static create(\n modelName: string,\n schemaNameOrSchema: string | any, // Schema type - using any to avoid circular dependency\n options?: {\n id?: string\n modelFileId?: string\n properties?: { [propertyName: string]: any }\n registerWithSchema?: boolean\n waitForReady?: false\n },\n ): Model\n static create(\n modelName: string,\n schemaNameOrSchema: string | any,\n options?: {\n id?: string\n modelFileId?: string\n properties?: { [propertyName: string]: any }\n registerWithSchema?: boolean\n waitForReady?: true\n readyTimeout?: number\n },\n ): Promise<Model>\n static create(\n modelName: string,\n schemaNameOrSchema: string | any, // Schema type - using any to avoid circular dependency\n options?: {\n id?: string // schemaFileId (string) - public ID (deprecated, use modelFileId)\n modelFileId?: string // Pre-existing model file ID (preferred)\n properties?: { [propertyName: string]: any }\n registerWithSchema?: boolean\n } & CreateWaitOptions,\n ): Model | Promise<Model> {\n if (!modelName) {\n throw new Error('Model name is required')\n }\n\n const waitForReady = options?.waitForReady !== false\n const readyTimeout = options?.readyTimeout ?? 5000\n\n // Extract schema name and instance\n let schemaName: string\n let schemaInstance: any | undefined // Using any to avoid circular dependency with Schema\n if (typeof schemaNameOrSchema === 'string') {\n schemaName = schemaNameOrSchema\n } else {\n schemaInstance = schemaNameOrSchema\n schemaName = schemaInstance.schemaName\n }\n\n if (!schemaName) {\n throw new Error('Schema name is required')\n }\n\n // Support both modelFileId (documented) and id (backward compatibility)\n const id = options?.modelFileId || options?.id // schemaFileId (string) - public ID\n const registerWithSchema = options?.registerWithSchema !== false && schemaInstance !== undefined\n\n // Step 1: Check ID-based cache first (if ID provided)\n if (id && this.instanceCacheById.has(id)) {\n const { instance, refCount } = this.instanceCacheById.get(id)!\n this.instanceCacheById.set(id, {\n instance,\n refCount: refCount + 1,\n })\n logger(`Model.create: Found instance in ID cache for \"${modelName}\" (ID: ${id})`)\n if (!waitForReady) return instance\n return waitForEntityIdle(instance, { timeout: readyTimeout }).then(\n () => instance,\n )\n }\n\n // Step 2: Check for duplicate names and generate unique name if needed (before checking cache)\n // This allows us to create new models with renamed versions when duplicates exist\n // Skip all duplicate checks if modelFileId is provided (schema models should preserve original names)\n const skipAllChecks = !!id // If id (modelFileId) is provided, this is a schema model - skip schema check to preserve name\n const uniqueModelName = this.findUniqueModelName(modelName, schemaName, skipAllChecks)\n\n // Step 3: Check name-based index with ORIGINAL name first (before using unique name)\n // Only return existing instance if the unique name matches the original (no rename needed)\n // If a rename is needed, we'll create a new model with the unique name\n let resolvedId = id\n const originalNameKey = `${schemaName}:${modelName}`\n // Step 3: When we have no id (runtime create), do not return from name cache. Each create('My Model')\n // must get a new instance with an incremented name (My Model, My Model 1, ...). If the only cached\n // instance with this name is the schema model (_idFromSchema), ensure we fall through to create new.\n if (!resolvedId) {\n const cachedId = this.instanceCacheByName.get(originalNameKey)\n if (cachedId && this.instanceCacheById.has(cachedId)) {\n const { instance, refCount } = this.instanceCacheById.get(cachedId)!\n const ctx = instance._getSnapshotContext() as { _idFromSchema?: boolean }\n if (ctx._idFromSchema) {\n resolvedId = undefined\n }\n // Never return by name when !id (runtime create); fall through to create new with unique name\n }\n }\n // Step 4: Check legacy cache with original name. Skip when !id (runtime create) so duplicate\n // create('My Model') calls get new instances with incremented names.\n if (id && uniqueModelName === modelName) {\n const legacyKey = `${schemaName}:${modelName}`\n if (this.instanceCache.has(legacyKey)) {\n const { instance, refCount } = this.instanceCache.get(legacyKey)!\n const ctx = instance._getSnapshotContext() as { _idFromSchema?: boolean }\n if (!ctx._idFromSchema) {\n this.instanceCache.set(legacyKey, {\n instance,\n refCount: refCount + 1,\n })\n logger(`Model.create: Found instance in legacy cache for \"${modelName}\"`)\n const existingId = (instance._getSnapshotContext() as { id?: string }).id\n if (existingId) {\n this.instanceCacheById.set(existingId, { instance, refCount: refCount + 1 })\n this.instanceCacheByName.set(legacyKey, existingId)\n }\n if (!waitForReady) return instance\n return waitForEntityIdle(instance, { timeout: readyTimeout }).then(\n () => instance,\n )\n }\n }\n }\n \n // Step 5: When a rename is needed (uniqueModelName !== modelName), do NOT return a cached\n // instance. The only cached instance with the original name at this point is the\n // schema-defined model (created with modelFileId); returning it would give the user the\n // schema model instead of a new runtime model with the unique name (e.g. \"New model 1\").\n if (uniqueModelName !== modelName) {\n logger(`Model.create: Found duplicate name \"${modelName}\" in schema \"${schemaName}\", using unique name \"${uniqueModelName}\"`)\n }\n\n // Step 6a: Generate ID now when needed so we can use a placeholder cache key for runtime creates\n if (!resolvedId) {\n resolvedId = generateId()\n logger(`Model.create: Generated new id (schemaFileId) \"${resolvedId}\" for model \"${modelName}\"`)\n }\n\n // Create name-based cache key. When no id (runtime create), use a placeholder so we don't\n // overwrite the schema model's entry (e.g. \"New model\"); loadOrCreateModel will replace it with the final name.\n const nameKey = id\n ? `${schemaName}:${uniqueModelName}`\n : `${schemaName}:__pending__${resolvedId}`\n\n // Step 6: Check legacy cache with unique name (backward compatibility during migration)\n // This is a fallback in case an instance was cached with a unique name\n if (this.instanceCache.has(nameKey)) {\n const { instance, refCount } = this.instanceCache.get(nameKey)!\n this.instanceCache.set(nameKey, {\n instance,\n refCount: refCount + 1,\n })\n logger(`Model.create: Found instance in legacy cache for \"${modelName}\"`)\n \n // Migrate to new cache structure\n const context = instance._getSnapshotContext()\n const existingId = context.id // id is now the schemaFileId (string)\n if (existingId) {\n this.instanceCacheById.set(existingId, { instance, refCount: refCount + 1 })\n this.instanceCacheByName.set(nameKey, existingId)\n }\n \n if (!waitForReady) return instance\n return waitForEntityIdle(instance, { timeout: readyTimeout }).then(\n () => instance,\n )\n }\n\n // Step 7: Create new instance with id in initial context\n // This ensures loadOrCreateModel sees the ID immediately\n // Pass _pendingPropertyDefinitions in initial context to avoid race condition with loadOrCreateModel\n // This is the proper XState way - include it in the initial input so it's available from the start\n const initialContext = options?.properties \n ? { _pendingPropertyDefinitions: JSON.parse(JSON.stringify(options.properties)) } as Pick<ModelMachineContext, '_pendingPropertyDefinitions'>\n : undefined\n \n // Use the unique model name for the instance (idFromSchema: true when id was provided, so schema model is not renamed)\n const newInstance = new this(uniqueModelName, schemaName, resolvedId, initialContext, !!id)\n \n if (options?.properties) {\n logger(`[Model.create] Created instance with _pendingPropertyDefinitions in initial context (${Object.keys(options.properties).length} properties) for model \"${uniqueModelName}\"`)\n }\n\n console.log('newInstance created for', uniqueModelName, 'with id', resolvedId)\n \n // Step 7: Set initial model data if provided\n // Note: description is not supported - JSON files can have it but we ignore it at runtime\n if (options) {\n const updates: any = {}\n \n if (Object.keys(updates).length > 0) {\n newInstance._service.send({\n type: 'updateContext',\n ...updates,\n })\n \n // Initialize original values\n // Note: properties are not stored in context, they're computed from ModelProperty instances\n newInstance._service.send({\n type: 'initializeOriginalValues',\n originalValues: {},\n isEdited: false,\n })\n }\n }\n \n // Wrap instance in Proxy for reactive property access\n // Create a custom proxy that handles 'name' as an alias for 'modelName'\n const proxiedInstance = new Proxy(newInstance, {\n get(target, prop: string | symbol) {\n // Handle special properties\n if (prop === '_service') {\n return Reflect.get(target, prop)\n }\n \n // Handle 'name' as an alias for 'modelName'\n if (prop === 'name') {\n const context = target._getSnapshotContext()\n return context.modelName\n }\n \n // Handle 'id' property - returns the schemaFileId (string)\n if (prop === 'id') {\n const context = target._getSnapshotContext()\n return context.id // id is now the schemaFileId (string)\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n return (context as any)[prop]\n }\n \n // Handle 'properties' getter - not tracked, but accessible via getter\n if (typeof prop === 'string' && prop === 'properties') {\n // Delegate to the getter method on the instance\n return target.properties\n }\n \n // For methods and other properties, use Reflect\n return Reflect.get(target, prop)\n },\n \n set(target, prop: string | symbol, value: any) {\n // Handle special properties\n if (prop === '_service') {\n return Reflect.set(target, prop, value)\n }\n \n // Handle 'name' as an alias for 'modelName'\n if (prop === 'name') {\n prop = 'modelName'\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n // Use the sendUpdate logic\n if (prop === 'modelName') {\n // Model name change - need to update Schema and database\n const context = target._getSnapshotContext()\n const oldName = context.modelName\n const newName = value as string\n \n if (oldName === newName) {\n logger(`Model name unchanged: \"${oldName}\"`)\n return true\n }\n \n logger(`Updating model name from \"${oldName}\" to \"${newName}\"`)\n \n // Update Model instance cache using new ID-based structure\n const modelFileId = context.id // id is now the schemaFileId (string)\n if (modelFileId) {\n Model.updateNameIndex(oldName, newName, context.schemaName, modelFileId)\n } else {\n // Fallback to legacy cache if no ID (shouldn't happen, but safety)\n const oldCacheKey = `${context.schemaName}:${oldName}`\n const newCacheKey = `${context.schemaName}:${newName}`\n if (Model.instanceCache.has(oldCacheKey)) {\n const entry = Model.instanceCache.get(oldCacheKey)!\n Model.instanceCache.delete(oldCacheKey)\n Model.instanceCache.set(newCacheKey, entry)\n }\n }\n \n // Update Model context\n target._service.send({\n type: 'updateContext',\n modelName: newName,\n })\n \n // Mark model as draft\n target._service.send({\n type: 'markAsDraft',\n propertyKey: 'modelName',\n })\n \n // Save draft to database immediately so changes persist\n target._saveDraftToDb(oldName, newName).catch((error) => {\n logger(`Failed to save draft to database: ${error instanceof Error ? error.message : String(error)}`)\n })\n \n // NOTE: Schema is not notified of model name changes during edits.\n // Schema will read from Model instances when persisting/saving.\n } else if (prop === 'properties') {\n // Properties are read-only computed values from ModelProperty instances\n // Cannot be set directly - properties are managed via ModelProperty instances\n throw new Error('Cannot set model.properties directly. Properties are computed from ModelProperty instances.')\n } else if (prop === 'description') {\n // Description is not supported - JSON files can have it but we ignore it at runtime\n throw new Error('Cannot set model.description. Description is not supported in runtime Model instances.')\n } else {\n // Standard property update\n target._service.send({\n type: 'updateContext',\n [prop]: value,\n })\n }\n return true\n }\n \n // For non-tracked properties, use Reflect\n return Reflect.set(target, prop, value)\n },\n \n has(target, prop: string | symbol) {\n // Handle 'name' as an alias for 'modelName'\n if (prop === 'name') {\n return true\n }\n \n // Handle 'id' property\n if (prop === 'id') {\n return true\n }\n \n // Check tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n return prop in context\n }\n return Reflect.has(target, prop)\n },\n \n ownKeys(target) {\n // Include 'name' and 'id' in ownKeys\n const keys = Reflect.ownKeys(target)\n const additionalKeys: (string | symbol)[] = []\n if (!keys.includes('name')) {\n additionalKeys.push('name')\n }\n if (!keys.includes('id')) {\n additionalKeys.push('id')\n }\n return additionalKeys.length > 0 ? [...keys, ...additionalKeys] : keys\n },\n \n getOwnPropertyDescriptor(target, prop: string | symbol) {\n // Handle 'name' as an alias for 'modelName'\n if (prop === 'name') {\n const context = target._getSnapshotContext()\n return {\n enumerable: true,\n configurable: true,\n value: context.modelName,\n writable: true,\n }\n }\n \n // Handle 'id' property - returns the modelFileId\n if (prop === 'id') {\n const context = target._getSnapshotContext()\n return {\n enumerable: true,\n configurable: true,\n value: context.id, // id is now the schemaFileId (string)\n writable: false, // id is read-only\n }\n }\n \n // Handle tracked properties\n if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop as any)) {\n const context = target._getSnapshotContext()\n if (prop in context) {\n return {\n enumerable: true,\n configurable: true,\n value: (context as any)[prop],\n writable: true,\n }\n }\n }\n return Reflect.getOwnPropertyDescriptor(target, prop)\n },\n }) as Model\n \n // Step 8: Store in new ID-based cache\n // resolvedId is guaranteed to be defined at this point (generated if not provided)\n this.instanceCacheById.set(resolvedId!, {\n instance: proxiedInstance,\n refCount: 1,\n })\n \n // Step 9: Store in name-based index (placeholder key when !id; loadOrCreateModel will replace with final name)\n this.instanceCacheByName.set(nameKey, resolvedId!)\n // Step 9b: When created with id (schema model) and unique name, also register original name so create(modelName) returns same instance\n if (id && uniqueModelName !== modelName) {\n this.instanceCacheByName.set(originalNameKey, resolvedId!)\n }\n\n // Step 10: Also store in legacy cache (for backward compatibility during migration)\n this.instanceCache.set(nameKey, {\n instance: proxiedInstance,\n refCount: 1,\n })\n \n logger(`Model.create: Created new instance for \"${uniqueModelName}\" (ID: ${id})`)\n \n // Model instance is now cached and accessible via Model.getById() and Model.getByName()\n // No wrapper or store registration needed\n \n // Step 11: Register with schema if requested, OR trigger write if properties are provided\n // If properties are provided, we need to write the model to get modelId for property creation\n // If schema provided, trigger write process instead of registration\n // When schemaName is passed as string (e.g. useCreateModel), we must trigger write so runtime-created\n // models get persisted to DB and show up in useModels (which queries the database).\n const shouldTriggerWrite =\n (registerWithSchema && schemaInstance) ||\n (options?.properties && Object.keys(options.properties).length > 0) ||\n typeof schemaNameOrSchema === 'string'\n if (shouldTriggerWrite) {\n queueMicrotask(async () => {\n try {\n // Wait for model to reach idle state (validation complete)\n await new Promise<void>((resolve) => {\n const subscription = proxiedInstance._service.subscribe((snapshot) => {\n // Wait for idle state (validation complete) or error state\n if (snapshot.value === 'idle' || snapshot.value === 'error') {\n subscription.unsubscribe()\n resolve()\n }\n })\n // Timeout after 10 seconds\n setTimeout(() => {\n subscription.unsubscribe()\n resolve()\n }, 10000)\n })\n \n // Only write if validation passed (model is in idle state, not error)\n const finalSnapshot = proxiedInstance._service.getSnapshot()\n if (finalSnapshot.value === 'idle' && (!finalSnapshot.context._validationErrors || finalSnapshot.context._validationErrors.length === 0)) {\n logger(`Model validation passed, triggering write process`)\n \n // Get schema ID from schema instance or look it up by schema name\n let schemaId: number | undefined\n \n if (schemaInstance) {\n const schemaContext = (schemaInstance as any)._getSnapshotContext()\n \n // First, try to use _dbId directly from schema context (most reliable)\n // But verify it exists in database before using it\n if (schemaContext._dbId && typeof schemaContext._dbId === 'number' && schemaContext._dbId > 0) {\n try {\n const db = BaseDb.getAppDb()\n \n if (db) {\n const verifySchema = await db\n .select({ id: schemasTable.id })\n .from(schemasTable)\n .where(eq(schemasTable.id, schemaContext._dbId))\n .limit(1)\n \n if (verifySchema.length > 0) {\n schemaId = schemaContext._dbId\n logger(`Using schema _dbId directly from Schema context: ${schemaId} (verified in database)`)\n } else {\n logger(`WARNING: Schema _dbId ${schemaContext._dbId} from context does not exist in database. Falling back to schemaFileId lookup.`)\n }\n }\n } catch (error) {\n logger(`WARNING: Could not verify schema _dbId: ${error}. Falling back to schemaFileId lookup.`)\n }\n }\n \n // Fall back to database lookup by schemaFileId if _dbId wasn't available or invalid\n if (!schemaId) {\n // Fall back to database lookup by schemaFileId\n const schemaFileId = schemaContext.id // id is the schemaFileId (string) in SchemaMachineContext\n \n if (schemaFileId) {\n try {\n const db = BaseDb.getAppDb()\n \n if (db) {\n const schemaRecords = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.schemaFileId, schemaFileId))\n .limit(1)\n \n if (schemaRecords.length > 0) {\n schemaId = schemaRecords[0].id\n logger(`Found schemaId ${schemaId} by schemaFileId lookup: ${schemaFileId}`)\n } else {\n logger(`WARNING: Schema not found in database by schemaFileId: ${schemaFileId}. Schema may not be fully loaded yet.`)\n }\n }\n } catch (error) {\n logger(`Error looking up schemaId: ${error}`)\n }\n } else {\n logger(`WARNING: Schema instance has no schemaFileId (id) in context`)\n }\n }\n } else if (schemaName) {\n // If no schema instance but we have schema name, look it up by name\n try {\n const db = BaseDb.getAppDb()\n \n if (db) {\n const schemaRecords = await db\n .select()\n .from(schemasTable)\n .where(eq(schemasTable.name, schemaName))\n .limit(1)\n \n if (schemaRecords.length > 0) {\n schemaId = schemaRecords[0].id\n logger(`Found schemaId ${schemaId} by schema name lookup: ${schemaName}`)\n } else {\n logger(`WARNING: Schema not found in database by name: ${schemaName}`)\n }\n }\n } catch (error) {\n logger(`Error looking up schemaId by name: ${error}`)\n }\n }\n \n // Validate schemaId before proceeding\n if (!schemaId || !Number.isInteger(schemaId) || schemaId <= 0) {\n logger(`ERROR: Invalid schemaId (${schemaId}) for model \"${finalSnapshot.context.modelName}\". Cannot trigger write process.`)\n logger(`Schema context:`, {\n schemaFileId: schemaInstance ? (schemaInstance as any)._getSnapshotContext().id : 'N/A',\n _dbId: schemaInstance ? (schemaInstance as any)._getSnapshotContext()._dbId : 'N/A',\n schemaName: schemaName || 'N/A',\n })\n } else if (finalSnapshot.context.id) {\n // Verify schema exists in database before proceeding (additional safety check)\n try {\n const db = BaseDb.getAppDb()\n \n if (db) {\n const schemaCheck = await db\n .select({ id: schemasTable.id })\n .from(schemasTable)\n .where(eq(schemasTable.id, schemaId))\n .limit(1)\n \n if (schemaCheck.length === 0) {\n const errorMsg = `Schema with id ${schemaId} does not exist in database. Cannot create model \"${finalSnapshot.context.modelName}\".`\n logger(`ERROR: ${errorMsg}`)\n throw new Error(errorMsg)\n }\n logger(`Verified schema ${schemaId} exists in database before creating model \"${finalSnapshot.context.modelName}\"`)\n } else {\n logger(`WARNING: Database not available for schema verification. Proceeding anyway.`)\n }\n } catch (error) {\n // If it's our validation error, re-throw it\n if (error instanceof Error && error.message.includes('does not exist in database')) {\n throw error\n }\n logger(`WARNING: Could not verify schema exists in database: ${error}. Proceeding anyway.`)\n }\n \n // Track pending write\n Model.trackPendingWrite(finalSnapshot.context.id, schemaId) // id is now the schemaFileId (string)\n \n // Wait for writeProcess to be spawned (it's spawned in idle state entry action)\n // Retry a few times if writeProcess isn't available yet\n let retries = 0\n const maxRetries = 10\n const checkAndSend = async () => {\n const currentSnapshot = proxiedInstance._service.getSnapshot()\n if (currentSnapshot.context.writeProcess) {\n logger(`Triggering write process for model \"${finalSnapshot.context.modelName}\" (schemaId: ${schemaId})`)\n \n // Use pending property definitions if available, otherwise convert from ModelProperty instances\n let propertiesObject: { [name: string]: any } = {}\n if (currentSnapshot.context._pendingPropertyDefinitions) {\n // Use the original property definitions for the write\n // Convert dataType to type for validation compatibility\n propertiesObject = JSON.parse(JSON.stringify(currentSnapshot.context._pendingPropertyDefinitions))\n for (const [propName, propData] of Object.entries(propertiesObject)) {\n if (propData.dataType && !propData.type) {\n propertiesObject[propName] = {\n ...propData,\n type: propData.dataType,\n }\n }\n }\n } else {\n // Fallback: convert ModelProperty instances to object format\n const properties = proxiedInstance.properties || []\n propertiesObject = modelPropertiesToObject(properties)\n }\n \n // Set up subscription to writeProcess to detect write success BEFORE sending request\n const writeProcess = currentSnapshot.context.writeProcess\n \n // Check current state - if already in success, handle immediately\n const currentWriteState = writeProcess.getSnapshot()\n if (currentWriteState.value === 'success') {\n proxiedInstance._service.send({\n type: 'writeSuccess',\n output: currentWriteState.context.entityData,\n })\n } else {\n // Set up subscription to catch future state changes\n const writeSubscription = writeProcess.subscribe((writeSnapshot) => {\n if (writeSnapshot.value === 'success') {\n writeSubscription.unsubscribe()\n const currentContext = proxiedInstance._service.getSnapshot().context\n logger(`[writeProcess subscription] Write succeeded, sending writeSuccess event. Has _pendingPropertyDefinitions: ${!!(currentContext._pendingPropertyDefinitions && Object.keys(currentContext._pendingPropertyDefinitions).length > 0)}`)\n // Send writeSuccess event to model machine\n proxiedInstance._service.send({\n type: 'writeSuccess',\n output: writeSnapshot.context.entityData,\n })\n } else if (writeSnapshot.value === 'error') {\n writeSubscription.unsubscribe()\n const errorContext = writeSnapshot.context\n logger(`Write process failed for model \"${finalSnapshot.context.modelName}\": ${errorContext.error?.message || 'Unknown error'}`)\n logger(`Write process error details:`, errorContext.error)\n logger(`Validation errors:`, errorContext.validationErrors)\n }\n })\n }\n \n proxiedInstance._service.send({\n type: 'requestWrite',\n data: {\n modelFileId: finalSnapshot.context.id, // id is now the schemaFileId (string)\n modelName: finalSnapshot.context.modelName,\n schemaName: finalSnapshot.context.schemaName,\n schemaId,\n properties: propertiesObject,\n },\n })\n } else if (retries < maxRetries) {\n retries++\n setTimeout(checkAndSend, 50) // Retry after 50ms\n } else {\n logger(`ERROR: writeProcess not available after ${maxRetries} retries for model \"${finalSnapshot.context.modelName}\"`)\n }\n }\n \n // Start checking immediately, but also allow time for entry action to complete\n setTimeout(checkAndSend, 0)\n } else {\n logger(`Cannot trigger write process: missing schemaId (${schemaId}) or id (${finalSnapshot.context.id})`)\n }\n } else {\n logger(`Model validation failed or model in error state, skipping write process`)\n }\n } catch (error) {\n logger(`Failed to trigger write process: ${error instanceof Error ? error.message : String(error)}`)\n }\n })\n }\n \n if (!waitForReady) return proxiedInstance\n return waitForEntityIdle(proxiedInstance, { timeout: readyTimeout }).then(\n () => proxiedInstance,\n )\n }\n\n /**\n * Get Model instance by modelFileId (O(1) lookup)\n */\n static getById(modelFileId: string): Model | undefined {\n const entry = this.instanceCacheById.get(modelFileId)\n if (entry) {\n // Increment ref count\n this.instanceCacheById.set(modelFileId, {\n instance: entry.instance,\n refCount: entry.refCount + 1,\n })\n return entry.instance\n }\n return undefined\n }\n\n /**\n * Get Model instance by name (O(1) lookup via name→ID mapping)\n * \n * @param modelName - The name of the model\n * @param schemaName - The schema name (optional, will query DB if not provided)\n * @returns The Model instance if found, undefined otherwise\n */\n static getByName(modelName: string, schemaName?: string): Model | undefined {\n if (schemaName) {\n const nameKey = `${schemaName}:${modelName}`\n const id = this.instanceCacheByName.get(nameKey)\n if (!id) {\n return undefined\n }\n return this.getById(id)\n }\n // If schemaName not provided, try to find in cache by searching all name keys\n for (const [nameKey, id] of this.instanceCacheByName.entries()) {\n const [, cachedModelName] = nameKey.split(':')\n if (cachedModelName === modelName) {\n return this.getById(id)\n }\n }\n return undefined\n }\n\n /**\n * Find Model by modelType (snake_case from DB/metadata).\n * Handles model names with spaces: \"new_model\" -> finds \"New model\" (toSnakeCase(\"New model\") === \"new_model\").\n */\n static findByModelType(modelType: string): Model | undefined {\n if (!modelType) return undefined\n for (const [nameKey, id] of this.instanceCacheByName.entries()) {\n const parts = nameKey.split(':', 2)\n const cachedModelName = parts[1]\n if (cachedModelName && toSnakeCase(cachedModelName) === modelType) {\n return this.getById(id)\n }\n }\n return undefined\n }\n\n /**\n * Get all Model instances for a schema from cache only (synchronous).\n * Includes models created at runtime via Model.create() that may not yet be in schema context.\n */\n static getCachedInstancesForSchema(schemaName: string): Model[] {\n const instances: Model[] = []\n const seen = new Set<string>()\n for (const [nameKey, id] of this.instanceCacheByName.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName && id && !seen.has(id)) {\n const instance = this.getById(id)\n if (instance) {\n instances.push(instance)\n seen.add(id)\n }\n }\n }\n for (const [nameKey, entry] of this.instanceCache.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName) {\n const context = entry.instance._getSnapshotContext()\n const id = context.id\n if (id && !seen.has(id)) {\n instances.push(entry.instance)\n seen.add(id)\n }\n }\n }\n return instances\n }\n\n /**\n * Get Model instance by name, querying database if not in cache\n * This is an async version that can query the database when schemaName is not provided\n * \n * @param modelName - The name of the model\n * @param schemaName - Optional schema name (will query DB if not provided)\n * @returns The Model instance if found, undefined otherwise\n */\n static async getByNameAsync(modelName: string, schemaName?: string): Promise<Model | undefined> {\n // First try cache\n const cached = this.getByName(modelName, schemaName)\n if (cached) {\n return cached\n }\n\n // If not in cache and schemaName not provided, query database\n if (!schemaName) {\n const db = BaseDb.getAppDb()\n if (!db) {\n return undefined\n }\n\n try {\n\n // Query model by name\n const modelRecords = await db\n .select({\n modelFileId: modelsTable.schemaFileId,\n modelName: modelsTable.name,\n schemaName: schemasTable.name,\n })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n\n if (modelRecords.length === 0) {\n return undefined\n }\n\n const record = modelRecords[0]\n if (!record.modelName || !record.schemaName || !record.modelFileId) {\n return undefined\n }\n\n // Create model instance (will be cached)\n return this.create(record.modelName, record.schemaName, {\n id: record.modelFileId, // id is now the schemaFileId (string)\n })\n } catch (error) {\n logger(`Model.getByNameAsync: Error looking up model by name \"${modelName}\": ${error instanceof Error ? error.message : String(error)}`)\n return undefined\n }\n }\n\n return undefined\n }\n\n /**\n * Create or get Model instance by modelFileId\n * Checks cache first, then database if not found\n * \n * @param modelFileId - The model file ID to look up\n * @returns The Model instance if found, undefined otherwise\n */\n static async createById(modelFileId: string): Promise<Model | undefined> {\n if (!modelFileId) {\n return undefined\n }\n\n // Step 1: Check cache first (fast path)\n const cached = this.getById(modelFileId)\n if (cached) {\n logger(`Model.createById: Found instance in cache for ID \"${modelFileId}\"`)\n return cached\n }\n\n // Step 2: Query database to get modelName and schemaName\n const db = BaseDb.getAppDb()\n if (!db) {\n logger(`Model.createById: Database not available for ID \"${modelFileId}\"`)\n return undefined\n }\n\n try {\n\n // Query model by schemaFileId and join to get schema name\n const modelRecords = await db\n .select({\n modelId: modelsTable.id,\n modelName: modelsTable.name,\n schemaName: schemasTable.name,\n })\n .from(modelsTable)\n .innerJoin(modelSchemas, eq(modelsTable.id, modelSchemas.modelId))\n .innerJoin(schemasTable, eq(modelSchemas.schemaId, schemasTable.id))\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n\n if (modelRecords.length === 0) {\n logger(`Model.createById: Model not found in database for ID \"${modelFileId}\"`)\n return undefined\n }\n\n const { modelName, schemaName } = modelRecords[0]\n if (!modelName || !schemaName) {\n logger(`Model.createById: Missing modelName or schemaName for ID \"${modelFileId}\"`)\n return undefined\n }\n\n // Step 3: Create model using existing create method (which will handle caching)\n logger(`Model.createById: Creating model \"${modelName}\" in schema \"${schemaName}\" from ID \"${modelFileId}\"`)\n return this.create(modelName, schemaName, {\n id: modelFileId, // id is now the schemaFileId (string)\n })\n } catch (error) {\n logger(`Model.createById: Error looking up model by ID \"${modelFileId}\": ${error instanceof Error ? error.message : String(error)}`)\n return undefined\n }\n }\n\n /**\n * Find Model instance by modelFileId, modelName/schemaName, or both\n * Waits for the model to be fully loaded (idle state) by default\n * @param options - Find options including lookup parameters and wait configuration\n * @returns Model instance if found, undefined otherwise\n */\n static async find({\n modelFileId,\n modelName,\n schemaName,\n waitForReady = true,\n readyTimeout = 5000,\n }: {\n modelFileId?: string\n modelName?: string\n schemaName?: string\n waitForReady?: boolean\n readyTimeout?: number\n }): Promise<Model | undefined> {\n return await findEntity<Model>(\n {\n getById: (id) => Model.getById(id),\n createById: (id) => Model.createById(id),\n getByName: (name, ...args) => {\n const schemaName = args[0] as string | undefined\n return Model.getByName(name, schemaName)\n },\n createByName: async (name, ...args) => {\n const schemaName = args[0] as string | undefined\n return Model.getByNameAsync(name, schemaName)\n },\n },\n {\n id: modelFileId,\n name: modelName,\n schemaName,\n },\n {\n waitForReady,\n readyTimeout,\n }\n )\n }\n\n /**\n * Get all Model instances for a schema by schemaFileId or schemaName\n * Queries database for all models with the given schemaId/schemaName and returns Model instances\n * \n * @param schemaIdentifier - The schema file ID or schema name to get models for\n * @returns Array of Model instances for the schema\n */\n static async createBySchemaId(schemaIdentifier: string): Promise<Model[]> {\n if (!schemaIdentifier) {\n return []\n }\n\n const db = BaseDb.getAppDb()\n if (!db) {\n logger(`Model.createBySchemaId: Database not available for schema \"${schemaIdentifier}\"`)\n return []\n }\n\n try {\n\n // Query all models for this schema - support both schemaFileId and schema name\n const modelRecords = await db\n .select({\n modelFileId: modelsTable.schemaFileId,\n modelName: modelsTable.name,\n schemaName: schemasTable.name,\n })\n .from(schemasTable)\n .innerJoin(modelSchemas, eq(schemasTable.id, modelSchemas.schemaId))\n .innerJoin(modelsTable, eq(modelSchemas.modelId, modelsTable.id))\n .where(\n or(\n eq(schemasTable.schemaFileId, schemaIdentifier),\n eq(schemasTable.name, schemaIdentifier)\n )\n )\n\n if (modelRecords.length === 0) {\n logger(`Model.createBySchemaId: No models found in database for schema \"${schemaIdentifier}\"`)\n return []\n }\n\n // Create Model instances for each model (create() handles caching)\n const modelInstances: Model[] = []\n for (const record of modelRecords) {\n if (!record.modelName || !record.schemaName || !record.modelFileId) {\n continue\n }\n\n // Check cache first\n const cached = this.getById(record.modelFileId)\n if (cached) {\n modelInstances.push(cached)\n } else {\n // Create model instance (will be cached)\n const model = this.create(record.modelName, record.schemaName, {\n id: record.modelFileId, // id is now the schemaFileId (string)\n waitForReady: false,\n }) as Model\n modelInstances.push(model)\n }\n }\n\n logger(`Model.createBySchemaId: Found ${modelInstances.length} models for schema \"${schemaIdentifier}\"`)\n return modelInstances\n } catch (error) {\n logger(`Model.createBySchemaId: Error looking up models for schema \"${schemaIdentifier}\": ${error instanceof Error ? error.message : String(error)}`)\n return []\n }\n }\n\n /**\n * Get all Model instances, optionally filtered by schema.\n * When DB is available, loads from DB via getModelsData; otherwise returns from cache.\n * Supports waitForReady to wait for each model to reach idle state before returning.\n */\n static async all(\n schemaName?: string,\n options?: { waitForReady?: boolean; readyTimeout?: number },\n ): Promise<Model[]> {\n const { waitForReady = false, readyTimeout = 5000 } = options ?? {}\n const appDb = BaseDb.getAppDb()\n\n if (!appDb) {\n const instances: Model[] = []\n const seen = new Set<string>()\n if (schemaName !== undefined && schemaName !== '') {\n for (const [nameKey, id] of this.instanceCacheByName.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName) {\n const instance = this.getById(id)\n if (instance && !seen.has(id)) {\n instances.push(instance)\n seen.add(id)\n }\n }\n }\n for (const [nameKey, entry] of this.instanceCache.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName) {\n const context = entry.instance._getSnapshotContext()\n const id = context.id\n if (id && !seen.has(id)) {\n instances.push(entry.instance)\n seen.add(id)\n }\n }\n }\n } else {\n for (const [id, entry] of this.instanceCacheById.entries()) {\n if (!seen.has(id)) {\n instances.push(entry.instance)\n seen.add(id)\n }\n }\n for (const [nameKey, entry] of this.instanceCache.entries()) {\n const context = entry.instance._getSnapshotContext()\n const id = context.id\n if (id && !seen.has(id)) {\n instances.push(entry.instance)\n seen.add(id)\n }\n }\n }\n return instances\n }\n\n const rows = await getModelsData(schemaName)\n const instances: Model[] = []\n const seen = new Set<string>()\n\n for (const row of rows) {\n if (row.schemaFileId) {\n const instance = await this.createById(row.schemaFileId)\n if (instance) {\n instances.push(instance)\n seen.add(instance.id ?? row.schemaFileId)\n }\n }\n }\n\n // Merge in any instances from cache for this schema (e.g. just-created model not yet visible in DB read).\n if (schemaName !== undefined && schemaName !== '') {\n for (const [nameKey, id] of this.instanceCacheByName.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName && id && !seen.has(id)) {\n const instance = this.getById(id)\n if (instance) {\n instances.push(instance)\n seen.add(id)\n }\n }\n }\n for (const [nameKey, entry] of this.instanceCache.entries()) {\n const [cachedSchemaName] = nameKey.split(':')\n if (cachedSchemaName === schemaName) {\n const context = entry.instance._getSnapshotContext()\n const id = context.id\n if (id && !seen.has(id)) {\n instances.push(entry.instance)\n seen.add(id)\n }\n }\n }\n }\n\n if (waitForReady && instances.length > 0) {\n await Promise.all(\n instances.map((m) =>\n waitForEntityIdle(m as Parameters<typeof waitForEntityIdle>[0], {\n timeout: readyTimeout,\n throwOnError: false,\n }),\n ),\n )\n return instances.filter((m) => (m as Model)._getSnapshot?.().value === 'idle')\n }\n\n return instances\n }\n\n /**\n * Update name index when model name changes\n */\n static updateNameIndex(oldName: string, newName: string, schemaName: string, modelFileId: string): void {\n const oldKey = `${schemaName}:${oldName}`\n const newKey = `${schemaName}:${newName}`\n \n // Update name index\n if (this.instanceCacheByName.has(oldKey)) {\n this.instanceCacheByName.delete(oldKey)\n }\n this.instanceCacheByName.set(newKey, modelFileId)\n \n // Also update legacy cache if it exists\n if (this.instanceCache.has(oldKey)) {\n const entry = this.instanceCache.get(oldKey)!\n this.instanceCache.delete(oldKey)\n this.instanceCache.set(newKey, entry)\n }\n \n logger(`Model.updateNameIndex: Updated name mapping from \"${oldName}\" to \"${newName}\" (ID: ${modelFileId})`)\n }\n\n getService(): ModelService {\n return this._service\n }\n\n private _getSnapshot(): ModelSnapshot {\n return this._service.getSnapshot() as ModelSnapshot\n }\n\n private _getSnapshotContext(): ModelMachineContext {\n return this._getSnapshot().context\n }\n\n /**\n * Check for conflicts between actor context and database\n * @returns ConflictResult indicating if a conflict exists\n */\n private async _checkForConflicts(): Promise<ConflictResult> {\n const context = this._getSnapshotContext()\n \n // If we don't have load metadata, can't check for conflicts\n if (!context._dbUpdatedAt || !context.id) {\n return { hasConflict: false }\n }\n \n try {\n const db = BaseDb.getAppDb()\n if (!db) {\n return { hasConflict: false } // Can't check without DB\n }\n \n // Get current DB record by id (schemaFileId) - most reliable lookup\n const dbModels = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, context.id)) // id is now the schemaFileId (string)\n .limit(1)\n \n if (dbModels.length === 0) {\n return { hasConflict: false } // No DB record, no conflict\n }\n \n const dbRecord = dbModels[0]\n \n // Check if DB was updated after we loaded\n // Note: models table doesn't have updatedAt, so we can't do timestamp comparison\n // For now, we'll just check if the record exists and matches\n // In the future, if models table gets updatedAt, we can compare timestamps\n return { hasConflict: false }\n } catch (error) {\n logger(`Error checking for conflicts: ${error instanceof Error ? error.message : String(error)}`)\n return { hasConflict: false } // On error, assume no conflict to allow save\n }\n }\n\n /**\n * Saves model name changes to the database immediately (draft save)\n * This is called when modelName is changed to persist the change immediately\n * @param oldName - The old model name (if name changed)\n * @param newName - The new model name\n */\n private async _saveDraftToDb(oldName?: string, newName?: string): Promise<void> {\n saveDraftLogger(`_saveDraftToDb called for model (oldName: \"${oldName}\", newName: \"${newName}\")`)\n \n // Don't save during initialization - models are being loaded from files, not created as drafts\n // Check this FIRST before doing any expensive work like _getSnapshotContext()\n if (typeof window !== 'undefined') {\n const now = Date.now()\n // Use cached check to avoid expensive operations\n // Always check if cache is stale or if we previously got false (to allow recovery)\n const cacheIsStale = Model.cachedClientInitialized === null || (now - Model.clientCheckTime) > Model.CLIENT_CHECK_CACHE_MS\n const shouldRecheck = cacheIsStale || Model.cachedClientInitialized === false\n \n saveDraftLogger(`Client check: cacheIsStale=${cacheIsStale}, shouldRecheck=${shouldRecheck}, cachedValue=${Model.cachedClientInitialized}, timeSinceCheck=${now - Model.clientCheckTime}ms`)\n \n if (shouldRecheck) {\n try {\n // Use dynamic import for browser compatibility (require() doesn't work in browsers)\n const client = getClient()\n const clientSnapshot = client.getService().getSnapshot()\n // Check if state is IDLE (primary check) - isInitialized is set in entry action so should be true\n // But we check it as a secondary safeguard\n const isIdle = clientSnapshot.value === ClientManagerState.IDLE\n const isInitialized = clientSnapshot.context.isInitialized\n // If state is IDLE, trust it even if isInitialized isn't set yet (entry action should set it)\n // This aligns with useIsClientReady which only checks the state value\n Model.cachedClientInitialized = isIdle && (isInitialized !== false)\n Model.clientCheckTime = now\n saveDraftLogger(`Client state checked: state=${clientSnapshot.value}, isIdle=${isIdle}, isInitialized=${isInitialized}, result=${Model.cachedClientInitialized}`)\n } catch (error) {\n // If we can't check client state, assume not initialized to be safe\n // But only cache for a short time to allow recovery\n Model.cachedClientInitialized = false\n Model.clientCheckTime = now\n saveDraftLogger(`Error checking client state: ${error instanceof Error ? error.message : String(error)}, setting cachedClientInitialized=false`)\n }\n } else {\n saveDraftLogger(`Using cached client state: cachedClientInitialized=${Model.cachedClientInitialized}`)\n }\n \n if (!Model.cachedClientInitialized) {\n saveDraftLogger(`Client not initialized, skipping save (oldName: \"${oldName}\", newName: \"${newName}\")`)\n // Skip silently during initialization to avoid log spam and reduce overhead\n return\n }\n }\n \n saveDraftLogger(`Client is initialized, proceeding with save (oldName: \"${oldName}\", newName: \"${newName}\")`)\n \n // Check for conflicts before saving\n const conflictCheck = await this._checkForConflicts()\n if (conflictCheck.hasConflict) {\n const errorMessage = conflictCheck.message || 'Database was updated externally. Please reload the model and try again.'\n saveDraftLogger(`CONFLICT DETECTED: ${errorMessage}`)\n throw new ConflictError(errorMessage, conflictCheck)\n }\n \n const context = this._getSnapshotContext()\n const modelFileId = context.id || '' // id is now the schemaFileId (string)\n const modelName = newName || context.modelName || oldName || ''\n \n // Use modelFileId as the key if available, otherwise use schemaName:modelName\n const saveKey = modelFileId || `${context.schemaName}:${modelName}`\n \n // Prevent concurrent saves for the same model\n if (Model.savingModels.has(saveKey)) {\n saveDraftLogger(`Model ${modelName} (key: ${saveKey}) is already being saved, skipping concurrent save`)\n return\n }\n \n Model.savingModels.add(saveKey)\n saveDraftLogger(`Starting save for model ${modelName} (key: ${saveKey}, id: ${modelFileId})`)\n \n try {\n const db = BaseDb.getAppDb()\n if (!db) {\n throw new Error('Database not found')\n }\n\n // If name changed, use renameModelInDb\n if (oldName && newName && oldName !== newName) {\n saveDraftLogger(`Renaming model from \"${oldName}\" to \"${newName}\"`)\n await renameModelInDb(oldName, newName)\n saveDraftLogger(`Successfully renamed model from \"${oldName}\" to \"${newName}\"`)\n } else {\n // For other tracked properties, we would save here\n // Currently only modelName is saved immediately, so this is a no-op\n saveDraftLogger(`No name change detected, skipping save (modelName: \"${modelName}\")`)\n }\n \n // Update conflict detection metadata after successful save\n // Note: models table doesn't have updatedAt, so we use current timestamp\n const now = Date.now()\n this._service.send({\n type: 'updateContext',\n _dbUpdatedAt: now,\n })\n \n } catch (error) {\n logger(`Failed to save draft to database: ${error instanceof Error ? error.message : String(error)}`)\n // Don't throw - allow operation to continue\n } finally {\n // Always remove from saving set\n Model.savingModels.delete(saveKey)\n saveDraftLogger(`Finished save for model ${modelName} (key: ${saveKey})`)\n }\n }\n\n get status() {\n return this._getSnapshot().value\n }\n\n get validationErrors() {\n return this._getSnapshotContext()._validationErrors || []\n }\n\n get isValid() {\n const errors = this.validationErrors\n return errors.length === 0\n }\n\n get isEdited() {\n const context = this._getSnapshotContext()\n // First check in-memory state\n if (context._isEdited !== undefined) {\n return context._isEdited\n }\n // Fall back to reading from database if we have _dbId\n if (context._dbId) {\n // Load from database asynchronously (fire-and-forget for now)\n // For synchronous getter, we'll need to cache it or make it async\n // For now, return false if not in context\n return false\n }\n return false\n }\n\n get id() {\n return this._getSnapshotContext().id // id is now the schemaFileId (string)\n }\n\n get name() {\n return this._getSnapshotContext().modelName\n }\n\n /**\n * Returns ModelProperty instances for this model\n * This is a computed property that reads from the service context\n * Note: This is NOT reactive - use useModelProperties() hook for reactivity\n */\n get properties(): any[] {\n const snapshot = this._service.getSnapshot()\n const context = snapshot.context\n \n // Get property IDs from liveQuery (stored in context, not instanceState)\n const liveQueryIds = context._liveQueryPropertyIds || []\n // Get _dbId from context for pending writes lookup\n const dbId: number | undefined = context._dbId // _dbId is the database integer ID\n // Get pending property IDs (synchronous - uses static Map)\n // Lazy import ModelProperty to avoid circular dependency\n const ModelProperty = getModelProperty()\n if (!ModelProperty) {\n // If ModelProperty is not yet loaded, return empty array\n // It will be available on subsequent accesses after the async import completes\n return []\n }\n const pendingIds = dbId ? ModelProperty.getPendingPropertyIds(dbId) : []\n \n // Combine and deduplicate\n const allPropertyIds = [...new Set([...liveQueryIds, ...pendingIds])]\n \n // Get ModelProperty instances from static cache (synchronous)\n const propertyInstances: any[] = []\n for (const propertyFileId of allPropertyIds) {\n const property = ModelProperty.getById(propertyFileId)\n if (property) {\n propertyInstances.push(property)\n }\n // Note: Cannot create properties asynchronously in this synchronous getter\n // Properties will be created elsewhere when needed\n }\n \n // Return a new array reference (snapshot at time of access)\n return [...propertyInstances]\n }\n\n /**\n * Validate the model\n * @returns Validation result\n */\n async validate(): Promise<{ isValid: boolean; errors: any[] }> {\n return new Promise((resolve) => {\n let resolved = false\n const subscription = this._service.subscribe((snapshot) => {\n if (snapshot.value === 'idle' || snapshot.value === 'error') {\n if (!resolved) {\n resolved = true\n subscription.unsubscribe()\n const errors = snapshot.context._validationErrors || []\n resolve({\n isValid: errors.length === 0,\n errors,\n })\n }\n }\n })\n\n this._service.send({ type: 'validateModel' })\n \n // Timeout fallback to ensure we always resolve (15 seconds - longer than actor timeout)\n setTimeout(() => {\n if (!resolved) {\n resolved = true\n subscription.unsubscribe()\n const errors = this._getSnapshotContext()._validationErrors || []\n resolve({\n isValid: errors.length === 0,\n errors,\n })\n }\n }, 15000)\n })\n }\n\n /**\n * Create a new item instance from this model\n * Automatically injects the model name, so you don't need to pass it explicitly.\n * \n * @example\n * const Post = Model.create('Post', schema)\n * const post = await Post.create({ title: 'My Post', content: '...' })\n * \n * @param values - Item property values (modelName is automatically injected)\n * @returns The created item instance\n */\n async create(values: Partial<ItemData> & Record<string, any>): Promise<Item<any>> {\n if (!this.modelName) {\n throw new Error('Cannot create item: model name is not set on this Model instance')\n }\n \n const item = await Item.create({\n modelName: this.modelName,\n schemaName: this.schemaName,\n modelInstance: this,\n ...values,\n } as Partial<ItemData> & { modelName: string; schemaName?: string; modelInstance?: Model } & Record<string, any>)\n return item\n }\n\n\n /**\n * Reload model from database\n * This refreshes the actor context with the latest data from the database\n */\n async reload(): Promise<void> {\n logger(`Reloading model ${this.modelName} from database`)\n \n // Send reload event to machine (which will trigger loadOrCreateModel)\n this._service.send({ type: 'reloadFromDb' })\n \n // Wait for reload to complete\n return new Promise((resolve, reject) => {\n const subscription = this._service.subscribe((snapshot) => {\n if (snapshot.value === 'idle') {\n subscription.unsubscribe()\n resolve()\n } else if (snapshot.value === 'error') {\n subscription.unsubscribe()\n reject(new Error('Failed to reload model from database'))\n }\n })\n \n // Timeout after 10 seconds\n setTimeout(() => {\n subscription.unsubscribe()\n reject(new Error('Timeout waiting for model reload'))\n }, 10000)\n })\n }\n\n /**\n * Unload the model instance and clean up resources\n */\n unload(): void {\n try {\n const context = this._getSnapshotContext()\n const modelFileId = context.id // id is now the schemaFileId (string)\n const nameKey = `${context.schemaName}:${context.modelName}`\n \n const cacheKeys: string[] = []\n if (modelFileId) {\n cacheKeys.push(modelFileId)\n }\n cacheKeys.push(nameKey)\n \n unloadEntity(this, {\n getCacheKeys: () => cacheKeys,\n caches: [Model.instanceCacheById, Model.instanceCache],\n secondaryCaches: [Model.instanceCacheByName],\n instanceState: modelInstanceState,\n getService: (instance) => instance._service,\n })\n } catch (error) {\n logger(`Error during unload: ${error instanceof Error ? error.message : String(error)}`)\n // Still try to stop service\n try {\n this._service.stop()\n } catch {\n // Service might already be stopped\n }\n }\n }\n\n /**\n * Destroy the model instance completely: remove from caches, delete from database,\n * update Schema context, stop service. Uses shared destroy helpers.\n */\n async destroy(): Promise<void> {\n const context = this._getSnapshotContext()\n const modelFileId = context.id\n const modelName = context.modelName\n const schemaName = context.schemaName\n const nameKey = schemaName && modelName ? `${schemaName}:${modelName}` : ''\n\n clearDestroySubscriptions(this, { instanceState: modelInstanceState })\n\n const cacheKeys: string[] = []\n if (modelFileId) cacheKeys.push(modelFileId)\n if (nameKey) cacheKeys.push(nameKey)\n forceRemoveFromCaches(this, {\n getCacheKeys: () => cacheKeys,\n caches: [\n Model.instanceCacheById as Map<string, unknown>,\n Model.instanceCacheByName as Map<string, unknown>,\n Model.instanceCache as Map<string, unknown>,\n ],\n })\n\n await runDestroyLifecycle(this, {\n getService: (instance) =>\n instance._service as { send: (ev: unknown) => void; stop: () => void },\n doDestroy: async () => {\n const db = BaseDb.getAppDb()\n if (db && modelFileId) {\n const drizzleMod = await import('drizzle-orm')\n const { eq } = drizzleMod\n\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.schemaFileId, modelFileId))\n .limit(1)\n\n if (modelRecords.length > 0) {\n const modelId = modelRecords[0].id\n await db.delete(modelSchemas).where(eq(modelSchemas.modelId, modelId))\n await db\n .delete(propertiesTable)\n .where(eq(propertiesTable.modelId, typeof modelId === 'string' ? parseInt(modelId, 10) : modelId))\n await db.delete(modelsTable).where(eq(modelsTable.id, modelId))\n }\n }\n\n if (schemaName && modelName) {\n const Schema = await schemaImportPromise\n if (!Schema) throw new Error('Schema not loaded')\n const schema = Schema.create(schemaName, { waitForReady: false }) as import('@/Schema/Schema').Schema\n const schemaContext = schema.getService().getSnapshot().context\n if (schemaContext.models?.[modelName]) {\n const updatedModels = { ...schemaContext.models }\n delete updatedModels[modelName]\n schema.getService().send({ type: 'updateContext', models: updatedModels })\n schema.getService().send({ type: 'markAsDraft', propertyKey: `model:${modelName}` })\n await new Promise((resolve) => setTimeout(resolve, 100))\n }\n }\n },\n })\n }\n\n /**\n * Set up liveQuery subscription to watch for property changes in the database\n * This enables cross-instance synchronization (e.g., changes in other tabs/windows)\n */\n private _setupLiveQuerySubscription(): void {\n setupEntityLiveQuery(this, {\n getEntityId: async (model) => {\n const context = model._getSnapshotContext()\n let dbId = context._dbId // _dbId is the database integer ID\n const modelName = context.modelName\n \n if (!modelName) {\n return undefined\n }\n \n // If we don't have _dbId yet, try to find it in the database\n if (!dbId) {\n try {\n const db = BaseDb.getAppDb()\n if (!db) {\n return undefined\n }\n\n const modelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.name, modelName))\n .limit(1)\n\n if (modelRecords.length === 0 || !modelRecords[0].id) {\n return undefined\n }\n\n dbId = modelRecords[0].id\n\n // Update context with _dbId\n model._service.send({\n type: 'updateContext',\n _dbId: dbId,\n })\n } catch (error) {\n logger(`[Model._setupLiveQuerySubscription] Error finding model: ${error}`)\n return undefined\n }\n }\n \n return dbId\n },\n buildQuery: async (modelId) => {\n return BaseDb.liveQuery<{ id: number; name: string; dataType: string; modelId: number; refModelId: number | null; refValueType: string | null; schemaFileId: string | null }>(\n (sql: any) => sql`\n SELECT id, name, data_type as dataType, model_id as modelId, ref_model_id as refModelId, ref_value_type as refValueType, schema_file_id as schemaFileId\n FROM properties\n WHERE model_id = ${modelId}\n `\n )\n },\n extractEntityIds: (rows) => rows\n .map(row => row.schemaFileId)\n .filter((id): id is string => id !== null && id !== undefined),\n updateContext: (model, ids) => {\n model._service.send({\n type: 'updateContext',\n _liveQueryPropertyIds: ids, // Store in service context for reactivity\n _propertiesUpdated: Date.now(), // Internal field for tracking\n })\n },\n createChildInstances: async (ids) => {\n await modelPropertyImportPromise\n const ModelProperty = getModelProperty()\n if (!ModelProperty) {\n logger('[Model._setupLiveQuerySubscription] ModelProperty not yet loaded')\n return\n }\n const createPromises = ids.map(async (propertyFileId: string) => {\n try {\n await ModelProperty.createById(propertyFileId)\n } catch (error) {\n logger(`[Model._setupLiveQuerySubscription] Error creating ModelProperty instance for propertyFileId \"${propertyFileId}\": ${error}`)\n }\n })\n await Promise.all(createPromises)\n },\n queryInitialData: async (modelId) => {\n const db = BaseDb.getAppDb()\n if (!db) {\n return []\n }\n\n const initialProperties = await db\n .select({ schemaFileId: propertiesTable.schemaFileId })\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, typeof modelId === 'string' ? parseInt(modelId, 10) : modelId))\n\n return initialProperties.map((row: { schemaFileId: string | null }) => ({\n schemaFileId: row.schemaFileId,\n }))\n },\n instanceState: modelInstanceState as WeakMap<Model, { liveQuerySubscription: Subscription | null }>,\n loggerName: 'seedSdk:model:liveQuery',\n })\n }\n\n /**\n * Refresh property IDs from database (useful in Node.js where liveQuery isn't available)\n */\n private async _refreshPropertiesFromDb(): Promise<void> {\n const snapshot = this._service.getSnapshot()\n const dbId = snapshot.context._dbId // _dbId is the database integer ID\n const modelName = snapshot.context.modelName\n\n if (!dbId || !modelName) {\n return\n }\n\n try {\n const db = BaseDb.getAppDb()\n if (!db) {\n return\n }\n\n const propertyRows = await db\n .select({ schemaFileId: propertiesTable.schemaFileId })\n .from(propertiesTable)\n .where(eq(propertiesTable.modelId, dbId)) // Use _dbId (database integer ID)\n\n const propertyIds = propertyRows\n .map((row: { schemaFileId: string | null }) => row.schemaFileId)\n .filter((id: string | null): id is string => id !== null && id !== undefined)\n\n console.log(`[Model._refreshPropertiesFromDb] Refreshed properties for model \"${modelName}\" (id: ${dbId}): ${propertyIds.length} properties`, propertyIds)\n\n // CRITICAL: Create ModelProperty instances BEFORE updating context\n // This ensures they're in the cache when the properties getter is called\n if (propertyIds.length > 0) {\n try {\n await modelPropertyImportPromise\n const ModelProperty = getModelProperty()\n if (!ModelProperty) {\n logger('[Model._refreshPropertiesFromDb] ModelProperty not yet loaded')\n } else {\n const createPromises = propertyIds.map(async (propertyFileId: string) => {\n try {\n const property = await ModelProperty.createById(propertyFileId)\n if (property) {\n logger(`[Model._refreshPropertiesFromDb] Created/cached ModelProperty instance for propertyFileId \"${propertyFileId}\"`)\n } else {\n logger(`[Model._refreshPropertiesFromDb] ModelProperty.createById returned undefined for propertyFileId \"${propertyFileId}\"`)\n }\n } catch (error) {\n logger(`[Model._refreshPropertiesFromDb] Error creating ModelProperty instance for propertyFileId \"${propertyFileId}\": ${error}`)\n }\n })\n await Promise.all(createPromises)\n console.log(`[Model._refreshPropertiesFromDb] Created ${propertyIds.length} ModelProperty instances before updating context`)\n }\n } catch (error) {\n logger(`[Model._refreshPropertiesFromDb] Error importing ModelProperty or creating instances: ${error}`)\n }\n }\n\n // Update context with refreshed property IDs AFTER creating instances\n this._service.send({\n type: 'updateContext',\n _liveQueryPropertyIds: propertyIds,\n _propertiesUpdated: Date.now(),\n })\n } catch (error) {\n logger(`[Model._refreshPropertiesFromDb] Error refreshing properties: ${error}`)\n }\n }\n\n /**\n * Public method to refresh properties from database\n */\n async refreshProperties(): Promise<void> {\n await this._refreshPropertiesFromDb()\n }\n\n}\n\n","import { Type, TSchema } from '@sinclair/typebox'\nimport { ModelPropertyDataTypes } from '@/helpers/property'\n\n/**\n * Validation rules that can be applied to properties\n * Matches the ValidationRules definition in protocol/schema.json\n */\nexport type ValidationRules = {\n pattern?: string\n minLength?: number\n maxLength?: number\n enum?: any[]\n custom?: string\n [key: string]: any\n}\n\n/**\n * TypeBox schema for ValidationRules\n */\nexport const TValidationRules = Type.Object({\n pattern: Type.Optional(Type.String()),\n minLength: Type.Optional(Type.Integer({ minimum: 0 })),\n maxLength: Type.Optional(Type.Integer({ minimum: 1 })),\n enum: Type.Optional(Type.Array(Type.Any())),\n custom: Type.Optional(Type.String()),\n}, { additionalProperties: true })\n\n/**\n * Validation error structure\n */\nexport type ValidationError = {\n field: string\n message: string\n code: string\n severity: 'error' | 'warning'\n}\n\n/**\n * Validation result\n */\nexport type ValidationResult = {\n isValid: boolean\n errors: ValidationError[]\n warnings?: ValidationError[]\n}\n\n","import { Static, Type } from '@sinclair/typebox'\nimport { PropertyDataType, PropertyDefs, StorageType } from '@/types'\nimport { TValidationRules } from '@/Schema/validation'\n\n/**\n * Enum for all property data types\n */\nexport enum ModelPropertyDataTypes {\n Text = 'Text',\n Number = 'Number',\n List = 'List',\n Relation = 'Relation',\n Image = 'Image',\n Json = 'Json',\n File = 'File',\n Boolean = 'Boolean',\n Date = 'Date',\n Html = 'Html',\n}\n\nexport const TPropertyDataType = Type.Union([\n Type.Literal(ModelPropertyDataTypes.Text),\n Type.Literal(ModelPropertyDataTypes.Number),\n Type.Literal(ModelPropertyDataTypes.List),\n Type.Literal(ModelPropertyDataTypes.Relation),\n Type.Literal(ModelPropertyDataTypes.Image),\n Type.Literal(ModelPropertyDataTypes.Json),\n Type.Literal(ModelPropertyDataTypes.File),\n Type.Literal(ModelPropertyDataTypes.Boolean),\n Type.Literal(ModelPropertyDataTypes.Date),\n Type.Literal(ModelPropertyDataTypes.Html),\n])\n\nexport const TStorageType = Type.Union([\n Type.Literal('ItemStorage'), // Looks for a storageTransactionId property on the item\n Type.Literal('PropertyStorage'), // Looks for a storageTransactionId value on the property\n])\n\nexport const TProperty = Type.Object({\n id: Type.Optional(Type.String()), // schemaFileId (string) - public ID\n _dbId: Type.Optional(Type.Number()), // Database integer ID - internal only\n name: Type.Optional(Type.String()),\n dataType: TPropertyDataType,\n ref: Type.Optional(Type.String()),\n // modelId: string (modelFileId) in code; number only for DB foreign keys when resolved\n modelId: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n modelName: Type.Optional(Type.String()),\n refModelId: Type.Optional(Type.Number()),\n refModelName: Type.Optional(Type.String()),\n refValueType: Type.Optional(TPropertyDataType),\n storageType: Type.Optional(TStorageType),\n localStorageDir: Type.Optional(Type.String()),\n filenameSuffix: Type.Optional(Type.String()),\n validation: Type.Optional(TValidationRules),\n})\n\nexport const TPropertyConstructor = Type.Function(\n [\n Type.Optional(Type.Union([Type.String(), TStorageType, Type.Undefined()])),\n Type.Optional(Type.Union([Type.String(), TPropertyDataType])),\n Type.Optional(Type.String()),\n ],\n TProperty,\n)\n\nexport const TPropertyDefs = Type.Record(\n TPropertyDataType,\n TPropertyConstructor,\n)\n\nexport const Property = {\n Text: (\n storageType?: StorageType,\n localStorageDir?: string,\n filenameSuffix?: string,\n ) => ({\n dataType: ModelPropertyDataTypes.Text,\n storageType,\n localStorageDir,\n filenameSuffix,\n TObject: Type.String(),\n }),\n Json: () => ({ dataType: ModelPropertyDataTypes.Json }),\n File: () => ({ dataType: ModelPropertyDataTypes.File }),\n Number: () => ({ dataType: ModelPropertyDataTypes.Number }),\n List: (ref: string, refValueType?: PropertyDataType) => ({\n dataType: ModelPropertyDataTypes.List,\n ref,\n refValueType,\n }),\n Relation: (ref?: string, refValueType?: PropertyDataType) => ({\n dataType: ModelPropertyDataTypes.Relation,\n ref,\n refValueType,\n }),\n Image: () => ({ dataType: ModelPropertyDataTypes.Image }),\n Boolean: () => ({ dataType: ModelPropertyDataTypes.Boolean }),\n Date: () => ({ dataType: ModelPropertyDataTypes.Date }),\n Html: () => ({ dataType: ModelPropertyDataTypes.Html }),\n} as PropertyDefs\n\nexport const PropertyMetadataKey = Symbol('property')\n\nexport const PropertyConstructor = (propertyType: Static<typeof TProperty>) => {\n return function (parentClassPrototype: any, propertyKey: string) {\n const existingProperties =\n Reflect.getMetadata(PropertyMetadataKey, parentClassPrototype) || []\n\n existingProperties.push({ propertyKey, propertyType })\n Reflect.defineMetadata(\n PropertyMetadataKey,\n existingProperties,\n parentClassPrototype,\n )\n }\n}\n\nexport const Text = (\n storageType?: StorageType,\n srcDir?: string,\n filenameSuffix?: string,\n) => PropertyConstructor(Property.Text(storageType, srcDir, filenameSuffix))\nexport const Number = () => PropertyConstructor(Property.Number())\nexport const Json = () => PropertyConstructor(Property.Json())\nexport const File = () => PropertyConstructor(Property.File())\nexport const Image = () => PropertyConstructor(Property.Image())\nexport const Relation = (ref: string, refValueType?: PropertyDataType) =>\n PropertyConstructor(Property.Relation(ref, refValueType)) // Adjust for actual relation type\nexport const List = (ref: string, reValueType?: PropertyDataType) =>\n PropertyConstructor(Property.List(ref, reValueType)) // Adjust for actual list type\nexport const Boolean = () => PropertyConstructor(Property.Boolean())\nexport const Date = () => PropertyConstructor(Property.Date())\n","// Export the Model class\nexport { Model } from './Model'\nexport type { ModelMachineContext } from './service/modelMachine'\n\n// Export types (for schema validation)\nimport { Type } from '@sinclair/typebox'\nimport { TProperty } from '../helpers/property/index'\n\nexport const TModelValues = Type.Record(Type.String(), Type.Any())\nexport const TModelSchema = Type.Record(Type.String(), TProperty)\n","import * as fsAsync from 'fs/promises'\nimport * as fs from 'fs'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport path from 'path'\n\nclass FileManager extends BaseFileManager {\n\n static async getFs() {\n return fs\n }\n\n static getFsSync() {\n return fs\n }\n\n static async getContentUrlFromPath( path: string ): Promise<string | undefined> {\n return new Promise(( resolve, reject ) => {\n reject(new Error('Not implemented'))\n })\n }\n\n static async initializeFileSystem(workingDir?: string): Promise<void> {\n return // No need to initialize file system in node\n }\n\n static async downloadAllFiles(): Promise<void> {\n return new Promise(( resolve, reject ) => {\n reject(new Error('Not implemented'))\n })\n }\n\n static async resizeImage(): Promise<void> {\n return new Promise(( resolve, reject ) => {\n reject(new Error('Not implemented'))\n })\n }\n\n static async resizeAllImages(): Promise<void> {\n return new Promise(( resolve, reject ) => {\n reject(new Error('Not implemented'))\n })\n }\n\n static async pathExists(filePath: string): Promise<boolean> {\n return await fsAsync.access(filePath).then(() => true).catch(() => false)\n }\n\n static async createDirIfNotExists(filePath: string): Promise<void> {\n await fsAsync.mkdir(filePath, { recursive: true })\n }\n\n static async waitForFile(filePath: string, interval: number = 1000, timeout: number = 60000): Promise<boolean> {\n // Check if file exists immediately\n const pathExists = await this.pathExists(filePath)\n if (pathExists) {\n return true\n }\n\n return new Promise((resolve, reject) => {\n const startTime = Date.now()\n let isBusy = false\n\n const checkInterval = setInterval(async () => {\n if (isBusy) {\n return\n }\n isBusy = true\n\n try {\n const exists = await this.pathExists(filePath)\n if (exists) {\n clearInterval(checkInterval)\n resolve(true)\n return\n }\n\n if (Date.now() - startTime >= timeout) {\n clearInterval(checkInterval)\n reject(new Error('Timeout exceeded while waiting for file'))\n return\n }\n } catch (error) {\n clearInterval(checkInterval)\n reject(error)\n return\n } finally {\n isBusy = false\n }\n }, interval)\n })\n }\n\n static async waitForFileWithContent(filePath: string, interval: number = 100, timeout: number = 5000): Promise<boolean> {\n // In node, file writes are synchronous, so if the file exists, it has content\n // Just wait for the file to exist\n return this.waitForFile(filePath, interval, timeout)\n }\n\n static async saveFile(filePath: string, content: string | Blob | ArrayBuffer): Promise<void> {\n // Ensure the directory exists\n const dir = path.dirname(filePath)\n await fsAsync.mkdir(dir, { recursive: true })\n\n // Write the content based on type\n if (typeof content === 'string') {\n await fsAsync.writeFile(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n const arrayBuffer = await content.arrayBuffer()\n await fsAsync.writeFile(filePath, Buffer.from(arrayBuffer))\n } else if (content instanceof ArrayBuffer) {\n await fsAsync.writeFile(filePath, Buffer.from(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n static saveFileSync(filePath: string, content: string | Blob | ArrayBuffer): void {\n // Ensure the directory exists\n const dir = path.dirname(filePath)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n\n // Write the content based on type\n if (typeof content === 'string') {\n fs.writeFileSync(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n // For Blob, we need to convert to Buffer synchronously\n // This is a limitation - we can't do this truly synchronously\n // But we can read it as ArrayBuffer if it's already available\n throw new Error('Blob content not supported in saveFileSync. Use saveFile() instead or convert to ArrayBuffer first.')\n } else if (content instanceof ArrayBuffer) {\n fs.writeFileSync(filePath, Buffer.from(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n static async readFileAsBuffer( filePath: string ): Promise<Buffer> {\n return await fsAsync.readFile(filePath)\n }\n\n static async readFileAsString(filePath: string): Promise<string> {\n return await fsAsync.readFile(filePath, 'utf-8')\n }\n\n static async readFile(filePath: string): Promise<File> {\n return new File([await fsAsync.readFile(filePath)], filePath)\n }\n\n static readFileSync(filePath: string): File {\n return new File([fs.readFileSync(filePath)], filePath)\n }\n\n static getParentDirPath(filePath: string): string {\n return path.dirname(filePath)\n }\n\n static getFilenameFromPath(filePath: string): string {\n return path.basename(filePath)\n }\n\n static getPathModule(): any {\n return path\n }\n}\n\nexport { FileManager }\n\n","import { BaseDb } from \"@/db/Db/BaseDb\";\nimport { IDb } from \"@/interfaces\";\nimport path from \"path\";\nimport { DrizzleConfig, } from \"drizzle-orm\";\nimport debug from 'debug'\nimport { appState } from '@/seedSchema'\nimport fs from 'fs'\nimport { createClient } from '@libsql/client'\nimport { drizzle } from 'drizzle-orm/libsql'\nimport { pushSQLiteSchema } from 'drizzle-kit/api'\nimport * as schema from '@/seedSchema'\nimport { Observable, interval, switchMap, distinctUntilChanged, startWith } from 'rxjs'\n\nconst logger = debug('seedSdk:node:db:Db')\n\nexport interface DbConfig {\n dbUrl?: string\n schemaDir?: string\n outDir?: string\n}\n\nconst getConfig = async (dotSeedDir: string, config?: DbConfig) => {\n // Create config inline - config values can be passed in or use defaults\n const drizzleKitMod = await import('drizzle-kit')\n const { defineConfig } = drizzleKitMod\n const appSchemaDir = config?.schemaDir || path.join(dotSeedDir, 'schema')\n const outDir = config?.outDir || `${dotSeedDir}/db`\n const dbUrl = config?.dbUrl || `${dotSeedDir}/db/seed.db`\n\n const nodeDbConfig = defineConfig({\n schema: appSchemaDir,\n dialect: 'sqlite',\n out: outDir,\n dbCredentials: {\n url: dbUrl,\n }\n }) as DrizzleConfig & { dbCredentials: { url: string } }\n\n return nodeDbConfig\n}\n\nclass Db extends BaseDb implements IDb {\n static db: any\n\n constructor() {\n super()\n }\n\n static getAppDb() {\n return this.db\n }\n\n static isAppDbReady() {\n return true\n }\n\n static async prepareDb(filesDir: string, config?: DbConfig) {\n // Resolve and normalize the filesDir path\n const resolvedFilesDir = path.resolve(filesDir)\n \n // Ensure the filesDir exists first (parent directory)\n if (!fs.existsSync(resolvedFilesDir)) {\n fs.mkdirSync(resolvedFilesDir, { recursive: true })\n }\n \n const nodeDbConfig = await getConfig(resolvedFilesDir, config)\n const dbPath = nodeDbConfig.dbCredentials?.url || path.join(resolvedFilesDir, 'db', 'seed.db')\n\n // Ensure the database directory exists\n const dbDir = path.dirname(dbPath)\n const dbDirExists = fs.existsSync(dbDir)\n if (!dbDirExists) {\n fs.mkdirSync(dbDir, { recursive: true })\n }\n \n // Use the dbUrl from config if provided, otherwise construct from filesDir\n const dbUrl = config?.dbUrl \n ? (config.dbUrl.startsWith('file:') ? config.dbUrl : `file:${path.resolve(config.dbUrl)}`)\n : `file:${path.resolve(dbPath)}`\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 await apply();\n\n this.db = db\n\n return this.db\n }\n\n static async connectToDb(pathToDir: string,) {\n\n return {\n id: this.db ? this.db.constructor.name : ''\n }\n }\n\n static async migrate(pathToDbDir: string, dbName: string, dbId: string) {\n const fs = await import('fs')\n const path = await import('path')\n \n // Ensure meta directory and _journal.json exist\n const metaDir = path.join(pathToDbDir, 'meta')\n const journalPath = path.join(metaDir, '_journal.json')\n \n try {\n if (!fs.existsSync(metaDir)) {\n fs.mkdirSync(metaDir, { recursive: true })\n }\n \n // Create a minimal _journal.json if it doesn't exist\n if (!fs.existsSync(journalPath)) {\n const minimalJournal = {\n version: \"7\",\n dialect: \"sqlite\",\n entries: []\n }\n fs.writeFileSync(journalPath, JSON.stringify(minimalJournal, null, 2))\n logger('Created minimal _journal.json file')\n } else {\n // Verify the journal file is valid JSON\n try {\n const journalContent = fs.readFileSync(journalPath, 'utf-8')\n const journal = JSON.parse(journalContent)\n if (!journal.dialect || !journal.version) {\n // Fix invalid journal\n const fixedJournal = {\n version: journal.version || \"7\",\n dialect: journal.dialect || \"sqlite\",\n entries: journal.entries || []\n }\n fs.writeFileSync(journalPath, JSON.stringify(fixedJournal, null, 2))\n logger('Fixed invalid _journal.json file')\n }\n } catch (parseError) {\n // If journal is invalid, recreate it\n const minimalJournal = {\n version: \"7\",\n dialect: \"sqlite\",\n entries: []\n }\n fs.writeFileSync(journalPath, JSON.stringify(minimalJournal, null, 2))\n logger('Recreated corrupted _journal.json file')\n }\n }\n } catch (error: any) {\n logger('Warning: Could not create meta/_journal.json:', error.message)\n // Continue anyway - the migrator might handle it\n }\n \n try {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n \n // OLD CODE: const {migrate} = await import('drizzle-orm/better-sqlite3/migrator')\n // migrationsFolder should point to the directory containing migration SQL files\n // In drizzle-kit, migrations are generated in the 'out' directory (which is pathToDbDir)\n // migrate(this.db, { migrationsFolder: pathToDbDir })\n \n // NEW CODE: Use libsql migrator\n const migratorMod = await import('drizzle-orm/libsql/migrator')\n const { migrate } = migratorMod\n // migrationsFolder should point to the directory containing migration SQL files\n // In drizzle-kit, migrations are generated in the 'out' directory (which is pathToDbDir)\n await migrate(this.db, { migrationsFolder: pathToDbDir })\n const queryResult = await this.db.select().from(appState)\n logger('queryResult', queryResult)\n } catch (error: any) {\n // Handle various migration errors gracefully in test environments\n const errorMessage = error.message || String(error) || ''\n const errorString = String(error)\n const isMigrationError = \n errorMessage.includes(\"Can't find meta/_journal.json\") || \n errorMessage.includes('_journal.json') ||\n errorMessage.includes(\"Cannot read properties of undefined\") ||\n errorMessage.includes(\"reading 'dialect'\") ||\n errorMessage.includes(\"undefined is not an object\") ||\n errorString.includes(\"dialect\") ||\n errorString.includes(\"undefined is not an object\")\n \n if (isMigrationError) {\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger('Warning: Migration failed, but continuing in test environment:', errorMessage || errorString)\n // Try to query the database anyway to see if it's usable\n try {\n if (this.db) {\n const queryResult = await this.db.select().from(appState)\n logger('Database is accessible despite migration error')\n return this.db\n }\n } catch (queryError) {\n logger('Database query also failed, but continuing in test environment')\n return this.db\n }\n }\n }\n throw error\n }\n\n return this.db\n }\n\n /**\n * Execute a reactive query that emits new results whenever the underlying data changes.\n * \n * NOTE: This is a stub implementation using polling. For production use, consider enhancing\n * with database triggers, change streams, or other real-time mechanisms.\n * \n * Currently supports Drizzle query builders. SQL tag functions are not supported in node\n * environment (use browser implementation for SQL tag functions).\n * \n * @param query - Drizzle query builder (SQL tag functions not supported in node)\n * @returns Observable that emits arrays of query results\n * \n * @example\n * ```typescript\n * import { models } from '@/seedSchema'\n * import { eq } from 'drizzle-orm'\n * \n * const appDb = Db.getAppDb()\n * const models$ = Db.liveQuery<ModelRow>(\n * appDb.select().from(models).where(eq(models.schemaFileId, schemaId))\n * )\n * \n * models$.subscribe(models => {\n * console.log('Models updated:', models)\n * })\n * ```\n */\n static liveQuery<T>(\n query: ((sql: any) => any) | any\n ): Observable<T[]> {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n \n // Polling interval (configurable, default: 1000ms)\n const pollInterval = 1000\n \n // Check if query is a function (SQL tag function) - not supported in node stub\n if (typeof query === 'function') {\n throw new Error('SQL tag functions are not supported in node liveQuery stub implementation. Use Drizzle query builders instead.')\n }\n \n // For Drizzle query builders, we need to execute them\n // Store the query builder for polling\n const queryBuilder = query\n \n return interval(pollInterval).pipe(\n startWith(0), // Execute immediately on subscription\n switchMap(async () => {\n try {\n // Execute the Drizzle query builder\n // Drizzle query builders return promises when executed\n const result = await Promise.resolve(queryBuilder)\n return result as T[]\n } catch (error) {\n logger('[Db.liveQuery] Error executing query:', error)\n throw error\n }\n }),\n distinctUntilChanged((prev, curr) => {\n // Only emit if results actually changed\n // Use JSON.stringify for deep comparison\n return JSON.stringify(prev) === JSON.stringify(curr)\n })\n )\n }\n}\n\nBaseDb.setPlatformClass(Db)\n\nexport { Db }\n","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 }\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 } = 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 (!target) {\n throw new Error(\n `Target model is required for List property ${propertyName}`,\n )\n }\n schema[propertyName] = Property.List(target)\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 path from 'path'\nimport fs from 'fs'\nimport { SEED_CONFIG_FILE, SEED_CONFIG_FALLBACKS } from '@/helpers/constants'\nimport { BasePathResolver } from '@/helpers/PathResolver/BasePathResolver'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:node:helpers:PathResolver')\n\nclass PathResolver extends BasePathResolver {\n /**\n * Detects the current environment based on filesystem structure and package.json\n */\n private detectEnvironment(): 'sdk-dev' | 'linked-sdk' | 'production' | 'test' {\n // Check if we're in the SDK repo itself\n if (process.env.NODE_ENV !== 'test' && this.isInSdkRepo()) {\n return 'sdk-dev'\n }\n\n // Check if we're running tests\n if (process.env.NODE_ENV === 'test') {\n return 'test'\n }\n\n // Check if we're using a linked version of the SDK\n if (this.isUsingLinkedSdk()) {\n return 'linked-sdk'\n }\n\n // Default to production environment\n return 'production'\n }\n\n private isInSdkRepo(): boolean {\n try {\n // Check if we're in the SDK repo by looking for specific SDK files/directories\n const currentDir = process.cwd()\n return fs.existsSync(path.join(currentDir, 'src', 'node')) &&\n fs.existsSync(path.join(currentDir, 'package.json')) &&\n JSON.parse(fs.readFileSync(path.join(currentDir, 'package.json'), 'utf8')).name === '@seedprotocol/sdk'\n } catch {\n return false\n }\n }\n\n private isUsingLinkedSdk(): boolean {\n try {\n const pkgPath = path.join(process.cwd(), 'package.json')\n if (!fs.existsSync(pkgPath)) return false\n \n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))\n const sdkDep = pkg.dependencies?.['@seedprotocol/sdk']\n \n return sdkDep && (sdkDep.startsWith('link:') || sdkDep.startsWith('portal:'))\n } catch {\n return false\n }\n }\n\n /**\n * Gets the root directory containing node_modules\n */\n getRootWithNodeModules(): string {\n const processCwd = process.cwd()\n\n const calledFromMocks = processCwd.includes('__mocks__')\n\n if (calledFromMocks) {\n return path.join(processCwd, '..', '..', '..', '..',)\n }\n\n return processCwd\n }\n\n /**\n * Gets the SDK root directory\n */\n getSdkRootDir(): string {\n const env = this.detectEnvironment()\n const rootWithNodeModules = this.getRootWithNodeModules()\n const processCwd = process.cwd()\n\n // For test environment, always return the SDK root directory\n if (env === 'test') {\n return rootWithNodeModules\n }\n\n if (env === 'linked-sdk') {\n // For linked packages, find the package directory\n const pkgJson = JSON.parse(fs.readFileSync(path.join(processCwd, 'package.json'), 'utf8'))\n const sdkPath = pkgJson.dependencies?.['@seedprotocol/sdk'] || pkgJson.devDependencies?.['@seedprotocol/sdk']\n if (sdkPath === 'link:@seedprotocol/sdk') {\n return path.join(processCwd, 'node_modules', '@seedprotocol', 'sdk',)\n }\n return path.resolve(processCwd, sdkPath.replace(/^(link:|portal:)/, ''))\n }\n\n // After early returns, env can only be 'sdk-dev' or 'production'\n if (env === 'sdk-dev') {\n // This should be {localDir}/seed-protocol-sdk (the SDK root directory)\n return rootWithNodeModules\n }\n \n // Default to production environment\n // This should be {projectDir}/node_modules/@seedprotocol/sdk/dist\n return path.join(rootWithNodeModules, 'node_modules', '@seedprotocol', 'sdk', 'dist')\n }\n\n getNodeModulesDir(): string {\n const env = this.detectEnvironment()\n const rootWithNodeModules = this.getRootWithNodeModules()\n\n let nodeModulesDir = path.join(rootWithNodeModules, 'node_modules')\n\n if (env !== 'linked-sdk' && env !== 'sdk-dev' && nodeModulesDir.includes('__tests__')) {\n nodeModulesDir = path.join(process.cwd(), '..', '..', '..', '..', 'node_modules',)\n }\n\n return nodeModulesDir\n }\n\n /**\n * Gets the .seed directory path\n */\n getDotSeedDir(schemaFileDir?: string): string {\n if (!schemaFileDir && process.env.SEED_SDK_TEST_PROJECT_TYPE && !process.cwd().includes('__mocks__')) {\n return path.join(process.cwd(), '__tests__', '__mocks__', process.env.SEED_SDK_TEST_PROJECT_TYPE, 'project', '.seed')\n }\n return path.join(schemaFileDir || process.cwd(), '.seed')\n }\n\n /**\n * Finds the Seed Protocol config file in the given directory\n * @param searchDir - Directory to search for the config file\n * @returns The path to the found config file, or null if not found\n */\n findConfigFile(searchDir: string = process.cwd()): string | null {\n // First try the primary config file name\n const primaryPath = path.join(searchDir, SEED_CONFIG_FILE)\n if (fs.existsSync(primaryPath)) {\n return primaryPath\n }\n\n // Then try fallback names in order\n for (const fallbackName of SEED_CONFIG_FALLBACKS) {\n const fallbackPath = path.join(searchDir, fallbackName)\n if (fs.existsSync(fallbackPath)) {\n return fallbackPath\n }\n }\n\n return null\n }\n\n /**\n * Gets paths for app-specific directories\n */\n getAppPaths(schemaFileDir?: string | undefined) {\n const env = this.detectEnvironment()\n const dotSeedDir = this.getDotSeedDir(schemaFileDir)\n const nodeModulesDir = this.getNodeModulesDir()\n\n let drizzleKitPath = path.join(nodeModulesDir, 'drizzle-kit', 'bin.cjs')\n\n if (env === 'linked-sdk') {\n const sdkRootDir = this.getSdkRootDir()\n const sdkPackageDir = path.dirname(sdkRootDir)\n const sdkNodeModulesDir = path.join(sdkPackageDir, 'node_modules')\n drizzleKitPath = path.join(sdkNodeModulesDir, 'drizzle-kit', 'bin.cjs')\n }\n\n // Determine the correct template path based on environment\n let templatePath: string\n if (env === 'production') {\n // In production, templates are at dist/node/codegen/templates\n templatePath = path.join(this.getSdkRootDir(), 'node', 'codegen', 'templates')\n } else {\n // In development/test, templates are at src/node/codegen/templates\n templatePath = path.join(this.getSdkRootDir(), 'src', 'node', 'codegen', 'templates')\n }\n\n logger('env', env)\n\n logger('getAppPaths', {\n sdkRootDir: this.getSdkRootDir(),\n dotSeedDir,\n nodeModulesDir,\n appSchemaDir: path.join(dotSeedDir, 'schema'),\n appDbDir: path.join(dotSeedDir, 'db'),\n appMetaDir: path.join(dotSeedDir, 'db', 'meta'),\n })\n\n return {\n sdkRootDir: this.getSdkRootDir(),\n dotSeedDir,\n nodeModulesDir,\n appSchemaDir: path.join(dotSeedDir, 'schema'),\n appDbDir: path.join(dotSeedDir, 'db'),\n appMetaDir: path.join(dotSeedDir, 'db', 'meta'),\n drizzleKitPath,\n templatePath\n }\n }\n}\n\nBasePathResolver.setPlatformClass(PathResolver)\n\nexport { PathResolver }\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 const listProperties = Object.entries(schema).filter(\n ([key, propertyDef]) => propertyDef?.dataType === ModelPropertyDataTypes.List && !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 { BaseEasClient } from \"@/helpers/EasClient/BaseEasClient\"\nimport { EAS_ENDPOINT } from \"@/client/constants\"\nimport { GraphQLClient } from \"graphql-request\"\n\nclass EasClient extends BaseEasClient {\n static getEasClient() {\n if (!this.easClient) {\n this.easClient = new GraphQLClient(EAS_ENDPOINT)\n }\n return this.easClient\n }\n\n}\n\nBaseEasClient.setPlatformClass(EasClient)\n\nexport { EasClient }","import { BaseQueryClient } from \"@/helpers/QueryClient/BaseQueryClient\"\nimport { IQueryClient } from '@/interfaces/IQueryClient'\n\n\n\nclass QueryClient extends BaseQueryClient {\n static getQueryClient = (): IQueryClient=> {\n return {\n fetchQuery: async <T>({\n queryKey,\n queryFn,\n }: {\n queryKey: unknown[]\n queryFn: () => Promise<T>\n }): Promise<T> => {\n return await queryFn()\n },\n getQueryData: () => {\n return new Promise((resolve, reject) => {\n reject(new Error('Not implemented'))\n })\n },\n }\n }\n}\n\nBaseQueryClient.setPlatformClass(QueryClient)\n\nexport { QueryClient }\n","import { graphql } from '@/graphql/gql'\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core'\nimport { GetTransactionTagsQuery } from '@/graphql/gql/graphql'\n\nexport const GET_TRANSACTION_TAGS = graphql(/* GraphQL */ `\n query GetTransactionTags($transactionId: ID!) {\n tags: transaction(id: $transactionId) {\n id\n tags {\n name\n value\n }\n }\n }\n`) as unknown as TypedDocumentNode<{ tags: { id: string; tags: { name: string; value: string }[] } | null }, { transactionId: string }>\n","import { BaseArweaveClient } from '@/helpers/ArweaveClient/BaseArweaveClient';\nimport { GraphQLClient } from 'graphql-request';\nimport Arweave from 'arweave';\nimport type {\n TransactionStatus,\n TransactionTag,\n GetDataOptions,\n DownloadFilesParams,\n DownloadResult,\n CreateTransactionOptions,\n} from '@/types/arweave';\nimport { GET_TRANSACTION_TAGS } from '@/helpers/ArweaveClient/queries';\nimport debug from 'debug';\n\nconst logger = debug('seedSdk:node:ArweaveClient');\n\n// Cached Arweave instance\nlet _arweaveInstance: Arweave | null = null;\n\n/**\n * Get or create the Arweave instance for Node.js\n */\nconst getArweaveInstance = (): Arweave => {\n if (_arweaveInstance) {\n return _arweaveInstance;\n }\n\n const host = BaseArweaveClient.getHost();\n\n // Handle both ES modules and CommonJS exports from arweave package\n if ('default' in Arweave && typeof (Arweave as any).default?.init === 'function') {\n _arweaveInstance = (Arweave as any).default.init({\n host,\n protocol: 'https',\n });\n } else {\n _arweaveInstance = Arweave.init({\n host,\n protocol: 'https',\n });\n }\n\n return _arweaveInstance!;\n};\n\nclass ArweaveClient extends BaseArweaveClient {\n /**\n * Get the GraphQL client for Arweave queries\n */\n static getArweaveClient(): GraphQLClient {\n return new GraphQLClient(BaseArweaveClient.getEndpoint());\n }\n\n /**\n * Get the status of a transaction\n */\n static async getTransactionStatus(transactionId: string): Promise<TransactionStatus> {\n const url = BaseArweaveClient.getStatusUrl(transactionId);\n \n try {\n const response = await fetch(url);\n \n if (response.status === 404) {\n return {\n status: 404,\n confirmed: null,\n };\n }\n\n if (!response.ok) {\n return {\n status: response.status,\n confirmed: null,\n };\n }\n\n const data = await response.json();\n return {\n status: 200,\n confirmed: {\n block_height: data.block_height,\n block_indep_hash: data.block_indep_hash,\n number_of_confirmations: data.number_of_confirmations,\n },\n };\n } catch (error) {\n logger('Error fetching transaction status:', error);\n return {\n status: 500,\n confirmed: null,\n };\n }\n }\n\n /**\n * Get transaction data\n */\n static async getTransactionData(\n transactionId: string,\n options?: GetDataOptions\n ): Promise<Uint8Array | string> {\n const arweave = getArweaveInstance();\n\n try {\n const data = await arweave.transactions.getData(transactionId, {\n decode: options?.decode ?? true,\n string: options?.string ?? false,\n });\n\n if (options?.string && typeof data === 'string') {\n return data;\n }\n\n // Ensure we return Uint8Array\n if (data instanceof Uint8Array) {\n return data;\n }\n\n // Handle string data when not requesting string\n if (typeof data === 'string') {\n return new TextEncoder().encode(data);\n }\n\n return data as Uint8Array;\n } catch (error) {\n logger('Error fetching transaction data:', error);\n throw error;\n }\n }\n\n /**\n * Get transaction tags via GraphQL\n */\n static async getTransactionTags(transactionId: string): Promise<TransactionTag[]> {\n const client = this.getArweaveClient();\n \n try {\n const result = await client.request(GET_TRANSACTION_TAGS, { transactionId });\n \n if (!result.tags?.tags) {\n return [];\n }\n\n return result.tags.tags.map((tag: { name: string; value: string }) => ({\n name: tag.name,\n value: tag.value,\n }));\n } catch (error) {\n logger('Error fetching transaction tags:', error);\n return [];\n }\n }\n\n /**\n * Create a new unsigned transaction\n */\n static async createTransaction(\n data: string | Uint8Array,\n options?: CreateTransactionOptions\n ): Promise<any> {\n const arweave = getArweaveInstance();\n\n const tx = await arweave.createTransaction({\n data,\n });\n\n // Add tags if provided\n if (options?.tags) {\n for (const tag of options.tags) {\n tx.addTag(tag.name, tag.value);\n }\n }\n\n return tx;\n }\n\n /**\n * Download multiple files from Arweave\n */\n static async downloadFiles(params: DownloadFilesParams): Promise<DownloadResult[]> {\n const { transactionIds, excludedTransactions } = params;\n const results: DownloadResult[] = [];\n const host = BaseArweaveClient.getHost();\n\n for (const transactionId of transactionIds) {\n // Skip excluded transactions\n if (excludedTransactions?.has(transactionId)) {\n continue;\n }\n\n try {\n const url = `https://${host}/raw/${transactionId}`;\n const response = await fetch(url);\n\n if (!response.ok) {\n results.push({\n transactionId,\n success: false,\n error: `HTTP ${response.status}: ${response.statusText}`,\n });\n continue;\n }\n\n const arrayBuffer = await response.arrayBuffer();\n const data = new Uint8Array(arrayBuffer);\n\n // Detect content type\n const contentType = response.headers.get('content-type') || undefined;\n\n results.push({\n transactionId,\n success: true,\n contentType,\n data,\n });\n } catch (error) {\n logger(`Error downloading transaction ${transactionId}:`, error);\n results.push({\n transactionId,\n success: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n return results;\n }\n}\n\nBaseArweaveClient.setPlatformClass(ArweaveClient);\n\nexport { ArweaveClient };","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":["models","sqliteTable","integer","text","unique","relations","waitFor","logger","nanoIdDictionary","customAlphabet","fromCallback","modelsTable","eq","propertiesTable","fromPromise","int","metadata","blob","isNull","and","addModelsToDb","index","setup","assign","ClientManagerState","waitForDb","isNotNull","not","or","initialize","types.GetSchemasDocument","types.GetSchemaByNameDocument","types.GetSeedsDocument","types.GetSeedIdsDocument","types.GetStorageTransactionIdDocument","types.GetVersionsDocument","types.GetPropertiesDocument","types.GetAllPropertiesForAllVersionsDocument","types.AttestationFieldsFragmentDoc","types.SchemaFieldsFragmentDoc","types.GetTransactionTagsDocument","types.GetFilesMetadataDocument","types.GetArweaveTransactionsDocument","types.GetImageSeedsDocument","types.GetImageVersionsDocument","types.GetSchemaUidsDocument","getVersionData","count","max","model","ZeroAddress","getTableColumns","sql","toSnakeCase","startCase","schemasTable","inArray","gt","upperFirst","camelCase","TRACKED_PROPERTIES","BehaviorSubject","createActor","metadataLatest","orderBy","versionData","throttle","saveAppState","desc","Type","ModelPropertyDataTypes","Number","Boolean","Date","fs","fsAsync","client","createClient","drizzle","schema","pushSQLiteSchema","interval","startWith","switchMap","distinctUntilChanged","readFileSync","tsImport","LoadMode","__filename","fileURLToPath","execSync","snakeCase","GraphQLClient","enableMapSet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGsB,MAAM,CAAA;AAI1B,IAAA,WAAA,GAAA;IACA;IAIA,OAAO,gBAAgB,CAAC,aAA4B,EAAA;AAClD,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;IACpC;AAEA,IAAA,OAAO,QAAQ,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;IACtC;IAEA,OAAO,SAAS,CAAC,QAAgB,EAAA;QAC/B,OAAO,IAAI,CAAC,aAAa,CAAC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I,UAAU,EAAE;AACd,wBAAA,QAAQ,CAAC;AACP,4BAAA,IAAI,EAAE,eAAe;AACrB,4BAAA,WAAW,EAAE,UAAU;AACxB,yBAAA,CAAC;AACF,wBAAA,QAAQ,CAAC;AACP,4BAAA,IAAI,EAAE,8BAA8B;AACpC,4BAAA,uBAAuB,EAAE,UAAU;AACpC,yBAAA,CAAC;AACF,wBAAA,OAAO,IAAI;oBACb;gBACF;YACF;QACF;AACF,IAAA,CAAC;AAED,IAAA,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,KAAI;;;;;;;AAOtC,QAAA,QAAQ,CAAC;AACP,YAAA,IAAI,EAAE,2BAA2B;AAClC,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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