@seedprotocol/sdk 0.7.5 → 0.7.6

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 (220) hide show
  1. package/README.md +2 -2
  2. package/dist/{ClientManager-DRf4uuei.js → ClientManager-D6YA20jP.js} +207 -149
  3. package/dist/ClientManager-D6YA20jP.js.map +1 -0
  4. package/dist/{Item-DTJPMjFk.js → Item-B1MH0tXx.js} +126 -86
  5. package/dist/Item-B1MH0tXx.js.map +1 -0
  6. package/dist/{ModelProperty-Dto5C0om.js → ModelProperty-Dw6dHdu_.js} +37 -37
  7. package/dist/{ModelProperty-Dto5C0om.js.map → ModelProperty-Dw6dHdu_.js.map} +1 -1
  8. package/dist/{Schema-8DxGcORY.js → Schema-DppObO6h.js} +62 -212
  9. package/dist/Schema-DppObO6h.js.map +1 -0
  10. package/dist/{SchemaValidationService-CE92y1TT.js → SchemaValidationService-DXQ-D531.js} +6 -6
  11. package/dist/{SchemaValidationService-CE92y1TT.js.map → SchemaValidationService-DXQ-D531.js.map} +1 -1
  12. package/dist/{backfillMetadataPropertyIds-CRqp-BqX.js → backfillMetadataPropertyIds-Uhzlwg9X.js} +3 -3
  13. package/dist/{backfillMetadataPropertyIds-CRqp-BqX.js.map → backfillMetadataPropertyIds-Uhzlwg9X.js.map} +1 -1
  14. package/dist/configurePlatform-CVoh3JeR.js +81 -0
  15. package/dist/configurePlatform-CVoh3JeR.js.map +1 -0
  16. package/dist/{detachRowsBeforeDelete-BVetHtn2.js → detachRowsBeforeDelete-CtmIFpgV.js} +2 -2
  17. package/dist/{detachRowsBeforeDelete-BVetHtn2.js.map → detachRowsBeforeDelete-CtmIFpgV.js.map} +1 -1
  18. package/dist/{discardNewDraft-CEOouygG.js → discardNewDraft-oGYdB5vS.js} +5 -5
  19. package/dist/{discardNewDraft-CEOouygG.js.map → discardNewDraft-oGYdB5vS.js.map} +1 -1
  20. package/dist/dist/ClientManager-D6YA20jP.d.ts +933 -0
  21. package/dist/dist/ClientManager-D6YA20jP.d.ts.map +1 -0
  22. package/dist/dist/Item-B1MH0tXx.d.ts +898 -0
  23. package/dist/dist/Item-B1MH0tXx.d.ts.map +1 -0
  24. package/dist/dist/ModelProperty-Dw6dHdu_.d.ts +315 -0
  25. package/dist/dist/ModelProperty-Dw6dHdu_.d.ts.map +1 -0
  26. package/dist/dist/Schema-DppObO6h.d.ts +601 -0
  27. package/dist/dist/Schema-DppObO6h.d.ts.map +1 -0
  28. package/dist/dist/SchemaValidationService-DXQ-D531.d.ts +118 -0
  29. package/dist/dist/SchemaValidationService-DXQ-D531.d.ts.map +1 -0
  30. package/dist/dist/backfillMetadataPropertyIds-Uhzlwg9X.d.ts +7 -0
  31. package/dist/dist/backfillMetadataPropertyIds-Uhzlwg9X.d.ts.map +1 -0
  32. package/dist/dist/configurePlatform-CVoh3JeR.d.ts +30 -0
  33. package/dist/dist/configurePlatform-CVoh3JeR.d.ts.map +1 -0
  34. package/dist/dist/detachRowsBeforeDelete-CtmIFpgV.d.ts +13 -0
  35. package/dist/dist/detachRowsBeforeDelete-CtmIFpgV.d.ts.map +1 -0
  36. package/dist/dist/discardNewDraft-oGYdB5vS.d.ts +8 -0
  37. package/dist/dist/discardNewDraft-oGYdB5vS.d.ts.map +1 -0
  38. package/dist/dist/eas-CSm5wmry.d.ts +12 -0
  39. package/dist/dist/eas-CSm5wmry.d.ts.map +1 -0
  40. package/dist/dist/errors-3tc6XkCB.d.ts +487 -0
  41. package/dist/dist/errors-3tc6XkCB.d.ts.map +1 -0
  42. package/dist/dist/errors-Do7v6RKu.d.ts +22 -0
  43. package/dist/dist/errors-Do7v6RKu.d.ts.map +1 -0
  44. package/dist/dist/getItem-DM3a-7XE.d.ts +6 -0
  45. package/dist/dist/getItem-DM3a-7XE.d.ts.map +1 -0
  46. package/dist/dist/getPublishPayload-CJF0k5d8.d.ts +47 -0
  47. package/dist/dist/getPublishPayload-CJF0k5d8.d.ts.map +1 -0
  48. package/dist/dist/getPublishUploads-C7-fYIgX.d.ts +89 -0
  49. package/dist/dist/getPublishUploads-C7-fYIgX.d.ts.map +1 -0
  50. package/dist/dist/index--mmQ3LQu.d.ts +6 -0
  51. package/dist/dist/index--mmQ3LQu.d.ts.map +1 -0
  52. package/dist/dist/index-B7yAoYli.d.ts +2752 -0
  53. package/dist/dist/index-B7yAoYli.d.ts.map +1 -0
  54. package/dist/dist/index-CrvIcVFJ.d.ts +4475 -0
  55. package/dist/dist/index-CrvIcVFJ.d.ts.map +1 -0
  56. package/dist/dist/index.browser-BmVS-c2C.d.ts +8445 -0
  57. package/dist/dist/index.browser-BmVS-c2C.d.ts.map +1 -0
  58. package/dist/dist/index.node-BKpbCAWt.d.ts +11123 -0
  59. package/dist/dist/index.node-BKpbCAWt.d.ts.map +1 -0
  60. package/dist/dist/mimeTypes-C9r76DCH.d.ts +30 -0
  61. package/dist/dist/mimeTypes-C9r76DCH.d.ts.map +1 -0
  62. package/dist/dist/model-oHA3YhOd.d.ts +6 -0
  63. package/dist/dist/model-oHA3YhOd.d.ts.map +1 -0
  64. package/dist/dist/platform.browser.d.ts +3 -0
  65. package/dist/dist/platform.browser.d.ts.map +1 -0
  66. package/dist/dist/platform.node.d.ts +3 -0
  67. package/dist/dist/platform.node.d.ts.map +1 -0
  68. package/dist/dist/property-DQ-Owzki.d.ts +37 -0
  69. package/dist/dist/property-DQ-Owzki.d.ts.map +1 -0
  70. package/dist/dist/propertyValidationRules-BDhFjlwP.d.ts +8 -0
  71. package/dist/dist/propertyValidationRules-BDhFjlwP.d.ts.map +1 -0
  72. package/dist/dist/publishDraftGraph-CzPd9oe9.d.ts +76 -0
  73. package/dist/dist/publishDraftGraph-CzPd9oe9.d.ts.map +1 -0
  74. package/dist/dist/resetAmbiguousLegacyItemData-cXZm4NuG.d.ts +17 -0
  75. package/dist/dist/resetAmbiguousLegacyItemData-cXZm4NuG.d.ts.map +1 -0
  76. package/dist/dist/resolveModelForSyncedSeed-BgxtVCHI.d.ts +21 -0
  77. package/dist/dist/resolveModelForSyncedSeed-BgxtVCHI.d.ts.map +1 -0
  78. package/dist/dist/syncDbWithEas-Y5GysSCm.d.ts +22 -0
  79. package/dist/dist/syncDbWithEas-Y5GysSCm.d.ts.map +1 -0
  80. package/dist/dist/tabEvents-D9x26vf2.d.ts +81 -0
  81. package/dist/dist/tabEvents-D9x26vf2.d.ts.map +1 -0
  82. package/dist/dist/tolerantWebAccess-BFU2t-SC.d.ts +113 -0
  83. package/dist/dist/tolerantWebAccess-BFU2t-SC.d.ts.map +1 -0
  84. package/dist/dist/updateSeedRevokedAt-CCF8WWYS.d.ts +11 -0
  85. package/dist/dist/updateSeedRevokedAt-CCF8WWYS.d.ts.map +1 -0
  86. package/dist/drizzle.js +2 -0
  87. package/dist/drizzle.js.map +1 -0
  88. package/dist/{eas-D7jvWMnI.js → eas-CSm5wmry.js} +3 -3
  89. package/dist/{eas-D7jvWMnI.js.map → eas-CSm5wmry.js.map} +1 -1
  90. package/dist/{errors-CIrbsN_i.js → errors-3tc6XkCB.js} +81 -36
  91. package/dist/errors-3tc6XkCB.js.map +1 -0
  92. package/dist/errors-Do7v6RKu.js +34 -0
  93. package/dist/errors-Do7v6RKu.js.map +1 -0
  94. package/dist/{getItem-CxU_kT5W.js → getItem-DM3a-7XE.js} +4 -4
  95. package/dist/{getItem-CxU_kT5W.js.map → getItem-DM3a-7XE.js.map} +1 -1
  96. package/dist/{getPublishPayload-DTjOKd3y.js → getPublishPayload-CJF0k5d8.js} +31 -25
  97. package/dist/getPublishPayload-CJF0k5d8.js.map +1 -0
  98. package/dist/{getPublishUploads-CVTBo_OV.js → getPublishUploads-C7-fYIgX.js} +6 -6
  99. package/dist/{getPublishUploads-CVTBo_OV.js.map → getPublishUploads-C7-fYIgX.js.map} +1 -1
  100. package/dist/{index-CMxEil8T.js → index--mmQ3LQu.js} +8 -8
  101. package/dist/index--mmQ3LQu.js.map +1 -0
  102. package/dist/{index-DWK-LOUY.js → index-B7yAoYli.js} +2 -2
  103. package/dist/index-B7yAoYli.js.map +1 -0
  104. package/dist/{BasePathResolver-CBTXCMFL.js → index-CrvIcVFJ.js} +304 -285
  105. package/dist/index-CrvIcVFJ.js.map +1 -0
  106. package/dist/{index.browser-shRXMeB3.js → index.browser-BmVS-c2C.js} +34 -44
  107. package/dist/index.browser-BmVS-c2C.js.map +1 -0
  108. package/dist/{index.node-DAKJNYp5.js → index.node-BKpbCAWt.js} +43 -7
  109. package/dist/index.node-BKpbCAWt.js.map +1 -0
  110. package/dist/main.js +23 -24
  111. package/dist/main.js.map +1 -1
  112. package/dist/node.js +13 -10
  113. package/dist/node.js.map +1 -1
  114. package/dist/platform.browser.js +7 -7
  115. package/dist/platform.node.js +4 -4
  116. package/dist/{property-lz9yIpyA.js → property-DQ-Owzki.js} +7 -7
  117. package/dist/{property-lz9yIpyA.js.map → property-DQ-Owzki.js.map} +1 -1
  118. package/dist/{propertyValidationRules-LuIwoQoJ.js → propertyValidationRules-BDhFjlwP.js} +10 -10
  119. package/dist/{propertyValidationRules-LuIwoQoJ.js.map → propertyValidationRules-BDhFjlwP.js.map} +1 -1
  120. package/dist/{publishDraftGraph-CgSLPKvQ.js → publishDraftGraph-CzPd9oe9.js} +41 -8
  121. package/dist/publishDraftGraph-CzPd9oe9.js.map +1 -0
  122. package/dist/{resetAmbiguousLegacyItemData-CuamkAAh.js → resetAmbiguousLegacyItemData-cXZm4NuG.js} +2 -2
  123. package/dist/{resetAmbiguousLegacyItemData-CuamkAAh.js.map → resetAmbiguousLegacyItemData-cXZm4NuG.js.map} +1 -1
  124. package/dist/{resolveModelForSyncedSeed-BbSctSvz.js → resolveModelForSyncedSeed-BgxtVCHI.js} +2 -2
  125. package/dist/{resolveModelForSyncedSeed-BbSctSvz.js.map → resolveModelForSyncedSeed-BgxtVCHI.js.map} +1 -1
  126. package/dist/src/Item/Item.d.ts.map +1 -1
  127. package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -1
  128. package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
  129. package/dist/src/ItemProperty/service/actors/saveValueToDb/rowContext.d.ts +10 -0
  130. package/dist/src/ItemProperty/service/actors/saveValueToDb/rowContext.d.ts.map +1 -0
  131. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +1 -1
  132. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts.map +1 -1
  133. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +1 -1
  134. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
  135. package/dist/src/ItemProperty/service/propertyMachine.d.ts +20 -20
  136. package/dist/src/Model/Model.d.ts +8 -0
  137. package/dist/src/Model/Model.d.ts.map +1 -1
  138. package/dist/src/ModelProperty/ModelProperty.d.ts +1 -1
  139. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +3 -3
  140. package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
  141. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
  142. package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +1 -1
  143. package/dist/src/browser/db/Db.d.ts.map +1 -1
  144. package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
  145. package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
  146. package/dist/src/client/actors/platformClassesInit.d.ts +1 -7
  147. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
  148. package/dist/src/client/actors/saveAppState.d.ts.map +1 -1
  149. package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
  150. package/dist/src/client/seedConfigDefaults.d.ts +10 -0
  151. package/dist/src/client/seedConfigDefaults.d.ts.map +1 -0
  152. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  153. package/dist/src/db/write/updateItemPropertyValue.d.ts +6 -0
  154. package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
  155. package/dist/src/drizzle/index.d.ts +7 -0
  156. package/dist/src/drizzle/index.d.ts.map +1 -0
  157. package/dist/src/events/files/download.d.ts.map +1 -1
  158. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  159. package/dist/src/helpers/FileManager/errors.d.ts +11 -0
  160. package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
  161. package/dist/src/helpers/db.d.ts +14 -0
  162. package/dist/src/helpers/db.d.ts.map +1 -1
  163. package/dist/src/helpers/dotSeedPath.d.ts +7 -0
  164. package/dist/src/helpers/dotSeedPath.d.ts.map +1 -0
  165. package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
  166. package/dist/src/helpers/environment.d.ts +5 -0
  167. package/dist/src/helpers/environment.d.ts.map +1 -1
  168. package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
  169. package/dist/src/helpers/metadataPropertyNames.d.ts +10 -0
  170. package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
  171. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +9 -0
  172. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -0
  173. package/dist/src/helpers/updateSchema.d.ts.map +1 -1
  174. package/dist/src/imports/index.d.ts +1 -1
  175. package/dist/src/imports/index.d.ts.map +1 -1
  176. package/dist/src/imports/json.d.ts +18 -5
  177. package/dist/src/imports/json.d.ts.map +1 -1
  178. package/dist/src/index.d.ts +2 -2
  179. package/dist/src/index.d.ts.map +1 -1
  180. package/dist/src/node/helpers/resolveFilesDir.d.ts +8 -0
  181. package/dist/src/node/helpers/resolveFilesDir.d.ts.map +1 -0
  182. package/dist/src/node/webpack/index.d.ts +2 -0
  183. package/dist/src/node/webpack/index.d.ts.map +1 -1
  184. package/dist/src/platform/index.browser.d.ts +5 -0
  185. package/dist/src/platform/index.browser.d.ts.map +1 -1
  186. package/dist/src/platform/index.node.d.ts +1 -0
  187. package/dist/src/platform/index.node.d.ts.map +1 -1
  188. package/dist/src/stores/eas.d.ts +1 -1
  189. package/dist/src/stores/eas.d.ts.map +1 -1
  190. package/dist/src/types/import.d.ts +15 -0
  191. package/dist/src/types/import.d.ts.map +1 -1
  192. package/dist/src/types/index.d.ts +8 -4
  193. package/dist/src/types/index.d.ts.map +1 -1
  194. package/dist/{syncDbWithEas-CrAY9Rl2.js → syncDbWithEas-Y5GysSCm.js} +17 -13
  195. package/dist/syncDbWithEas-Y5GysSCm.js.map +1 -0
  196. package/dist/{tabEvents-BGBYV65P.js → tabEvents-D9x26vf2.js} +4 -4
  197. package/dist/{tabEvents-BGBYV65P.js.map → tabEvents-D9x26vf2.js.map} +1 -1
  198. package/dist/{tolerantWebAccess-DVHCEulL.js → tolerantWebAccess-BFU2t-SC.js} +8 -8
  199. package/dist/{tolerantWebAccess-DVHCEulL.js.map → tolerantWebAccess-BFU2t-SC.js.map} +1 -1
  200. package/dist/{updateSeedRevokedAt-Dy5J8CfQ.js → updateSeedRevokedAt-CCF8WWYS.js} +3 -3
  201. package/dist/{updateSeedRevokedAt-Dy5J8CfQ.js.map → updateSeedRevokedAt-CCF8WWYS.js.map} +1 -1
  202. package/package.json +31 -31
  203. package/dist/BasePathResolver-CBTXCMFL.js.map +0 -1
  204. package/dist/ClientManager-DRf4uuei.js.map +0 -1
  205. package/dist/Item-DTJPMjFk.js.map +0 -1
  206. package/dist/Schema-8DxGcORY.js.map +0 -1
  207. package/dist/configurePlatform-D4aGjKNk.js +0 -31
  208. package/dist/configurePlatform-D4aGjKNk.js.map +0 -1
  209. package/dist/errors-CIrbsN_i.js.map +0 -1
  210. package/dist/errors-CrBxGWah.js +0 -17
  211. package/dist/errors-CrBxGWah.js.map +0 -1
  212. package/dist/getPublishPayload-DTjOKd3y.js.map +0 -1
  213. package/dist/index-CMxEil8T.js.map +0 -1
  214. package/dist/index-DWK-LOUY.js.map +0 -1
  215. package/dist/index.browser-shRXMeB3.js.map +0 -1
  216. package/dist/index.node-DAKJNYp5.js.map +0 -1
  217. package/dist/publishDraftGraph-CgSLPKvQ.js.map +0 -1
  218. package/dist/src/client/nodeEndpointDefaults.d.ts +0 -8
  219. package/dist/src/client/nodeEndpointDefaults.d.ts.map +0 -1
  220. package/dist/syncDbWithEas-CrAY9Rl2.js.map +0 -1
@@ -0,0 +1,933 @@
1
+ declare function requestEasSyncFromEventBus(): void;
2
+ declare function requestEasSyncFromModelsInit(): void;
3
+ declare namespace ClientManager {
4
+ function isInitialized(): any;
5
+ function getService(): import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
6
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
7
+ }, {
8
+ src: "platformClassesInit";
9
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
10
+ id: string | undefined;
11
+ } | {
12
+ src: "fileSystemInit";
13
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
14
+ id: string | undefined;
15
+ } | {
16
+ src: "dbInit";
17
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
18
+ id: string | undefined;
19
+ } | {
20
+ src: "saveConfig";
21
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
22
+ id: string | undefined;
23
+ } | {
24
+ src: "addModelsToStore";
25
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
26
+ id: string | undefined;
27
+ } | {
28
+ src: "addModelsToDb";
29
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
30
+ id: string | undefined;
31
+ } | {
32
+ src: "processSchemaFiles";
33
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
34
+ id: string | undefined;
35
+ } | {
36
+ src: "saveAppState";
37
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
38
+ id: string | undefined;
39
+ }, {
40
+ type: "assignInitError";
41
+ params: import("xstate").NonReducibleUnknown;
42
+ }, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
43
+ id?: string | undefined | undefined;
44
+ states?: {} | undefined;
45
+ }, import("xstate").MetaObject>>;
46
+ function init(options: any): Promise<void>;
47
+ function setAddresses(addresses: any): Promise<void>;
48
+ function getAddresses(): Promise<{
49
+ owned: any;
50
+ watched: any;
51
+ }>;
52
+ function getOwnedAddresses(): Promise<any>;
53
+ function getWatchedAddresses(): Promise<any>;
54
+ function claimUnpublishedDrafts(publisher: any): Promise<{
55
+ seeds: any;
56
+ versions: number;
57
+ metadata: number;
58
+ seedLocalIds: any;
59
+ }>;
60
+ function removeLocalCopiesForAddresses(addresses: any): Promise<{
61
+ removedSeedLocalIds: any;
62
+ removedSeedUids: any;
63
+ }>;
64
+ function syncFromEas(options: any): Promise<void>;
65
+ function addModel(modelDef: any): Promise<void>;
66
+ function onReady(callback: any): () => void;
67
+ function stop(): void;
68
+ function unload(): void;
69
+ }
70
+ declare function sendEasSyncClientRequest(correlationId: any, options: any): void;
71
+ /** appState key recording which EAS chain the local database holds attestations from. */
72
+ declare const EAS_CHAIN_ID_APP_STATE_KEY: "easChainId";
73
+ /**
74
+ * Turns retries without an explicit `enabled` on or off; `undefined` restores the default.
75
+ * Returns the previous setting, so a test can put it back.
76
+ */
77
+ declare function setRetriesWhenOnlineEnabled(enabled: any): any;
78
+ declare function startEasSyncActor(): void;
79
+ /** Unregister local query source (tests / client unload). */
80
+ declare function unregisterSeedQueryLocalSource(): void;
81
+ declare const INIT_CONFIG_CONFLICT_MESSAGE: string;
82
+ /**
83
+ * For callers of createModelsFromJson that write the models with addModelsToDb: pass `promise` as its
84
+ * persistedBy and call `settle` once addModelsToDb has run or failed (in a finally). The new models wait
85
+ * for it, then adopt the rows addModelsToDb wrote; any model it didn't write writes itself.
86
+ */
87
+ declare function createRowsWrittenSignal(): {
88
+ promise: Promise<any>;
89
+ settle: undefined;
90
+ };
91
+ /**
92
+ * Convert JSON import schema to ModelDefinitions
93
+ * @param importData - The JSON import data
94
+ * @param modelFileIds - Optional map of model names to their file IDs from the JSON file
95
+ * @param propertyFileIds - Optional map of model names to maps of property names to their file IDs from the JSON file
96
+ * @param persistedBy - When the caller writes the models with addModelsToDb: a promise that settles once
97
+ * that has run (see createRowsWrittenSignal). New models then adopt those rows instead of writing them too.
98
+ * @returns ModelDefinitions object with Model classes
99
+ */
100
+ declare function createModelsFromJson(importData: any, modelFileIds: any, propertyFileIds: any, persistedBy: any): Promise<{}>;
101
+ /**
102
+ * Get the latest version number for a schema by name
103
+ * Only considers complete schema files (with $schema field)
104
+ * @param name - The name of the schema
105
+ * @returns The latest version number, or 0 if no schema found
106
+ */
107
+ declare function getLatestSchemaVersion(name: any): Promise<any>;
108
+ /**
109
+ * Convert a JSON model's properties to the schema property format Model.create and addModelsToDb take
110
+ * @param modelName - The name of the model (for error messages)
111
+ * @param modelDef - The JSON model definition
112
+ * @param propertyFileIds - Optional map of property names to their file IDs from the JSON file
113
+ */
114
+ declare function jsonPropertiesToSchemaProperties(modelName: any, modelDef: any, propertyFileIds: any): {};
115
+ declare var schema: Readonly<{
116
+ __proto__: null;
117
+ createSchema: (schema: any, schemaFileId: any) => Promise<void>;
118
+ deleteSchema: typeof deleteSchema;
119
+ filterLatestSchemas: typeof filterLatestSchemas;
120
+ findSchemaByName: typeof findSchemaByName;
121
+ getLatestSchemaVersion: typeof getLatestSchemaVersion;
122
+ getSchemaNameFromId: typeof getSchemaNameFromId;
123
+ listCompleteSchemaFiles: typeof listCompleteSchemaFiles;
124
+ listLatestSchemaFiles: typeof listLatestSchemaFiles;
125
+ listSchemaFiles: typeof listSchemaFiles;
126
+ loadAllSchemasFromDb: typeof loadAllSchemasFromDb;
127
+ migrateFileSchemasToDb: typeof migrateFileSchemasToDb;
128
+ readSchema: (name: any, version: any, schemaFileId: any) => Promise<any>;
129
+ updateSchema: typeof updateSchema;
130
+ }>;
131
+ declare var ClientManager$1: Readonly<{
132
+ __proto__: null;
133
+ ClientManager: {
134
+ isInitialized: () => any;
135
+ getService: () => import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
136
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
137
+ }, {
138
+ src: "platformClassesInit";
139
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
140
+ id: string | undefined;
141
+ } | {
142
+ src: "fileSystemInit";
143
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
144
+ id: string | undefined;
145
+ } | {
146
+ src: "dbInit";
147
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
148
+ id: string | undefined;
149
+ } | {
150
+ src: "saveConfig";
151
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
152
+ id: string | undefined;
153
+ } | {
154
+ src: "addModelsToStore";
155
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
156
+ id: string | undefined;
157
+ } | {
158
+ src: "addModelsToDb";
159
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
160
+ id: string | undefined;
161
+ } | {
162
+ src: "processSchemaFiles";
163
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
164
+ id: string | undefined;
165
+ } | {
166
+ src: "saveAppState";
167
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
168
+ id: string | undefined;
169
+ }, {
170
+ type: "assignInitError";
171
+ params: import("xstate").NonReducibleUnknown;
172
+ }, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
173
+ id?: string | undefined | undefined;
174
+ states?: {} | undefined;
175
+ }, import("xstate").MetaObject>>;
176
+ /**
177
+ * Initialise the SDK. Calls made while an init is running share it. Once initialised, a
178
+ * call with the same config resolves at once and applies any change in `addresses`; a
179
+ * call with a different config throws INIT_CONFIG_CONFLICT_MESSAGE (call stop() first).
180
+ */
181
+ init: (options: any) => Promise<void>;
182
+ setAddresses: (addresses: any) => Promise<void>;
183
+ getAddresses: () => Promise<{
184
+ owned: any;
185
+ watched: any;
186
+ }>;
187
+ getOwnedAddresses: () => Promise<any>;
188
+ getWatchedAddresses: () => Promise<any>;
189
+ /**
190
+ * Stamp local seeds/versions/metadata that have no publisher and no real uid.
191
+ * Sealed rows (real EAS uid or attestationRaw) are left unchanged.
192
+ * Use after `setAddresses` on connect; `setPublishWallet` does this automatically.
193
+ */
194
+ claimUnpublishedDrafts: (publisher: any) => Promise<{
195
+ seeds: any;
196
+ versions: number;
197
+ metadata: number;
198
+ seedLocalIds: any;
199
+ }>;
200
+ /**
201
+ * Hard-delete local on-chain seed copies for the given publisher addresses.
202
+ * Drafts (no uid / attestationRaw) are kept. Chain is untouched; reconnect can rehydrate via syncFromEas.
203
+ */
204
+ removeLocalCopiesForAddresses: (addresses: any) => Promise<{
205
+ removedSeedLocalIds: any;
206
+ removedSeedUids: any;
207
+ }>;
208
+ /**
209
+ * Syncs item attestations from EAS for the configured models and given addresses.
210
+ * Uses owned + watched addresses from DB when addresses are not provided.
211
+ */
212
+ syncFromEas: (options: any) => Promise<void>;
213
+ addModel: (modelDef: any) => Promise<void>;
214
+ /**
215
+ * Calls `callback` once the client is initialised, or on the next microtask if it already
216
+ * is. Returns a function that cancels the callback.
217
+ */
218
+ onReady: (callback: any) => () => void;
219
+ stop: () => void;
220
+ unload: () => void;
221
+ };
222
+ INIT_CONFIG_CONFLICT_MESSAGE: string;
223
+ readonly clientManager: import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
224
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
225
+ }, {
226
+ src: "platformClassesInit";
227
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
228
+ id: string | undefined;
229
+ } | {
230
+ src: "fileSystemInit";
231
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
232
+ id: string | undefined;
233
+ } | {
234
+ src: "dbInit";
235
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
236
+ id: string | undefined;
237
+ } | {
238
+ src: "saveConfig";
239
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
240
+ id: string | undefined;
241
+ } | {
242
+ src: "addModelsToStore";
243
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
244
+ id: string | undefined;
245
+ } | {
246
+ src: "addModelsToDb";
247
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
248
+ id: string | undefined;
249
+ } | {
250
+ src: "processSchemaFiles";
251
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
252
+ id: string | undefined;
253
+ } | {
254
+ src: "saveAppState";
255
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
256
+ id: string | undefined;
257
+ }, {
258
+ type: "assignInitError";
259
+ params: import("xstate").NonReducibleUnknown;
260
+ }, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
261
+ id?: string | undefined | undefined;
262
+ states?: {} | undefined;
263
+ }, import("xstate").MetaObject>>;
264
+ getClient: () => {
265
+ isInitialized: () => any;
266
+ getService: () => import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
267
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
268
+ }, {
269
+ src: "platformClassesInit";
270
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
271
+ id: string | undefined;
272
+ } | {
273
+ src: "fileSystemInit";
274
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
275
+ id: string | undefined;
276
+ } | {
277
+ src: "dbInit";
278
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
279
+ id: string | undefined;
280
+ } | {
281
+ src: "saveConfig";
282
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
283
+ id: string | undefined;
284
+ } | {
285
+ src: "addModelsToStore";
286
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
287
+ id: string | undefined;
288
+ } | {
289
+ src: "addModelsToDb";
290
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
291
+ id: string | undefined;
292
+ } | {
293
+ src: "processSchemaFiles";
294
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
295
+ id: string | undefined;
296
+ } | {
297
+ src: "saveAppState";
298
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
299
+ id: string | undefined;
300
+ }, {
301
+ type: "assignInitError";
302
+ params: import("xstate").NonReducibleUnknown;
303
+ }, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
304
+ id?: string | undefined | undefined;
305
+ states?: {} | undefined;
306
+ }, import("xstate").MetaObject>>;
307
+ /**
308
+ * Initialise the SDK. Calls made while an init is running share it. Once initialised, a
309
+ * call with the same config resolves at once and applies any change in `addresses`; a
310
+ * call with a different config throws INIT_CONFIG_CONFLICT_MESSAGE (call stop() first).
311
+ */
312
+ init: (options: any) => Promise<void>;
313
+ setAddresses: (addresses: any) => Promise<void>;
314
+ getAddresses: () => Promise<{
315
+ owned: any;
316
+ watched: any;
317
+ }>;
318
+ getOwnedAddresses: () => Promise<any>;
319
+ getWatchedAddresses: () => Promise<any>;
320
+ /**
321
+ * Stamp local seeds/versions/metadata that have no publisher and no real uid.
322
+ * Sealed rows (real EAS uid or attestationRaw) are left unchanged.
323
+ * Use after `setAddresses` on connect; `setPublishWallet` does this automatically.
324
+ */
325
+ claimUnpublishedDrafts: (publisher: any) => Promise<{
326
+ seeds: any;
327
+ versions: number;
328
+ metadata: number;
329
+ seedLocalIds: any;
330
+ }>;
331
+ /**
332
+ * Hard-delete local on-chain seed copies for the given publisher addresses.
333
+ * Drafts (no uid / attestationRaw) are kept. Chain is untouched; reconnect can rehydrate via syncFromEas.
334
+ */
335
+ removeLocalCopiesForAddresses: (addresses: any) => Promise<{
336
+ removedSeedLocalIds: any;
337
+ removedSeedUids: any;
338
+ }>;
339
+ /**
340
+ * Syncs item attestations from EAS for the configured models and given addresses.
341
+ * Uses owned + watched addresses from DB when addresses are not provided.
342
+ */
343
+ syncFromEas: (options: any) => Promise<void>;
344
+ addModel: (modelDef: any) => Promise<void>;
345
+ /**
346
+ * Calls `callback` once the client is initialised, or on the next microtask if it already
347
+ * is. Returns a function that cancels the callback.
348
+ */
349
+ onReady: (callback: any) => () => void;
350
+ stop: () => void;
351
+ unload: () => void;
352
+ };
353
+ }>;
354
+ declare var SEEDPROTOCOL_Seed_Protocol_v1: Readonly<{
355
+ __proto__: null;
356
+ $schema: string;
357
+ default: {
358
+ $schema: string;
359
+ version: number;
360
+ id: string;
361
+ metadata: {
362
+ name: string;
363
+ description: string;
364
+ createdAt: string;
365
+ updatedAt: string;
366
+ };
367
+ models: {
368
+ Seed: {
369
+ id: string;
370
+ description: string;
371
+ properties: {
372
+ uid: {
373
+ type: string;
374
+ id: string;
375
+ };
376
+ type: {
377
+ type: string;
378
+ id: string;
379
+ };
380
+ };
381
+ };
382
+ Version: {
383
+ id: string;
384
+ description: string;
385
+ properties: {
386
+ seedUid: {
387
+ type: string;
388
+ id: string;
389
+ };
390
+ note: {
391
+ type: string;
392
+ id: string;
393
+ };
394
+ };
395
+ };
396
+ Metadata: {
397
+ id: string;
398
+ description: string;
399
+ properties: {
400
+ key: {
401
+ type: string;
402
+ id: string;
403
+ };
404
+ value: {
405
+ type: string;
406
+ id: string;
407
+ };
408
+ };
409
+ };
410
+ Image: {
411
+ id: string;
412
+ description: string;
413
+ properties: {
414
+ storageTransactionId: {
415
+ type: string;
416
+ id: string;
417
+ };
418
+ uri: {
419
+ type: string;
420
+ id: string;
421
+ };
422
+ alt: {
423
+ type: string;
424
+ id: string;
425
+ };
426
+ };
427
+ };
428
+ File: {
429
+ id: string;
430
+ description: string;
431
+ properties: {
432
+ storageTransactionId: {
433
+ type: string;
434
+ id: string;
435
+ };
436
+ uri: {
437
+ type: string;
438
+ id: string;
439
+ };
440
+ };
441
+ };
442
+ Html: {
443
+ id: string;
444
+ description: string;
445
+ properties: {
446
+ storageTransactionId: {
447
+ type: string;
448
+ id: string;
449
+ };
450
+ uri: {
451
+ type: string;
452
+ id: string;
453
+ };
454
+ };
455
+ };
456
+ };
457
+ enums: {};
458
+ migrations: {
459
+ version: number;
460
+ timestamp: string;
461
+ description: string;
462
+ changes: string[];
463
+ }[];
464
+ };
465
+ enums: {};
466
+ id: string;
467
+ metadata: {
468
+ name: string;
469
+ description: string;
470
+ createdAt: string;
471
+ updatedAt: string;
472
+ };
473
+ migrations: {
474
+ version: number;
475
+ timestamp: string;
476
+ description: string;
477
+ changes: string[];
478
+ }[];
479
+ models: {
480
+ Seed: {
481
+ id: string;
482
+ description: string;
483
+ properties: {
484
+ uid: {
485
+ type: string;
486
+ id: string;
487
+ };
488
+ type: {
489
+ type: string;
490
+ id: string;
491
+ };
492
+ };
493
+ };
494
+ Version: {
495
+ id: string;
496
+ description: string;
497
+ properties: {
498
+ seedUid: {
499
+ type: string;
500
+ id: string;
501
+ };
502
+ note: {
503
+ type: string;
504
+ id: string;
505
+ };
506
+ };
507
+ };
508
+ Metadata: {
509
+ id: string;
510
+ description: string;
511
+ properties: {
512
+ key: {
513
+ type: string;
514
+ id: string;
515
+ };
516
+ value: {
517
+ type: string;
518
+ id: string;
519
+ };
520
+ };
521
+ };
522
+ Image: {
523
+ id: string;
524
+ description: string;
525
+ properties: {
526
+ storageTransactionId: {
527
+ type: string;
528
+ id: string;
529
+ };
530
+ uri: {
531
+ type: string;
532
+ id: string;
533
+ };
534
+ alt: {
535
+ type: string;
536
+ id: string;
537
+ };
538
+ };
539
+ };
540
+ File: {
541
+ id: string;
542
+ description: string;
543
+ properties: {
544
+ storageTransactionId: {
545
+ type: string;
546
+ id: string;
547
+ };
548
+ uri: {
549
+ type: string;
550
+ id: string;
551
+ };
552
+ };
553
+ };
554
+ Html: {
555
+ id: string;
556
+ description: string;
557
+ properties: {
558
+ storageTransactionId: {
559
+ type: string;
560
+ id: string;
561
+ };
562
+ uri: {
563
+ type: string;
564
+ id: string;
565
+ };
566
+ };
567
+ };
568
+ };
569
+ version: number;
570
+ }>;
571
+ declare function getContentHash(data: any): Promise<string>;
572
+ /**
573
+ * A legacy ItemStorage draft row: a local edit (no attestation uid, not derived from one) that holds
574
+ * the content itself in property_value, with no file reference. Item.create / createNewItem stored
575
+ * ItemStorage values like this before they went through the save pipeline.
576
+ */
577
+ declare function isVerbatimItemStorageDraftRow(row: any): boolean;
578
+ /**
579
+ * Convert one legacy ItemStorage draft row (see {@link isVerbatimItemStorageDraftRow}) into the
580
+ * shape saveItemStorage gives a row: the content goes to the file a save would write
581
+ * (`<seedUid or seedLocalId><extension>` in the property's storage directory), and the row records
582
+ * `refResolvedValue`, `localStorageDir` and `refValueType: 'file'` with property_value cleared.
583
+ * Used by publish (resolveItemStorageChildFile) and the one-time migration (migrateLegacyItemStorageRows).
584
+ *
585
+ * Reading the row, writing the file and updating the row happen under the file's lock
586
+ * ({@link withItemStorageFileLock}), which saveItemStorage holds too: a save in this or another tab
587
+ * either finishes before (the row, read again once the lock is held, is no longer legacy and is
588
+ * left alone) or starts after (and overwrites the file and row with its content). Without the lock
589
+ * a save landing between the read and the file write would have its file overwritten with the old
590
+ * content. The row update also stays conditional on the row being unchanged, for writers that
591
+ * don't take the lock (a tab still running an older SDK).
592
+ *
593
+ * Returns undefined when there was nothing to convert. Throws when the file can't be written; the
594
+ * row is then unchanged.
595
+ */
596
+ declare function convertVerbatimItemStorageRow(localId: any, storage?: {}): Promise<any>;
597
+ /**
598
+ * Call before writing chain data to the local DB (EAS sync, publish, revoke). Records the
599
+ * current chain on an empty DB; throws when the DB holds data from a different chain.
600
+ */
601
+ declare function assertLocalDbChain(): Promise<void>;
602
+ /**
603
+ * Gives `publisher` to local drafts that belong to no wallet yet: seeds with no publisher, no real
604
+ * uid and no attestationRaw, and those seeds' versions and property rows that are unsealed too.
605
+ * Versions and property rows go only with their seed, so rows of a seed that already has a
606
+ * publisher are never claimed. Sealed rows (real EAS uid or attestationRaw) are never touched.
607
+ */
608
+ declare function claimUnpublishedDrafts(publisher: any): Promise<{
609
+ seeds: any;
610
+ versions: number;
611
+ metadata: number;
612
+ seedLocalIds: any;
613
+ }>;
614
+ /**
615
+ * SDK local QueryDataSource: published Seeds/Versions/metadata from SQLite.
616
+ *
617
+ * Revocation follows the local `revoked_at` columns, not the stored `attestation_raw`: rows with
618
+ * `revoked_at` set are left out (as the remote source leaves out revoked attestations) and returned
619
+ * attestations carry `revoked`/`revocationTime` from those columns.
620
+ */
621
+ declare function createLocalQueryDataSource(): {
622
+ kind: string;
623
+ getSeedByUid(seedUid: any): Promise<any>;
624
+ listSeedsBySchemaName(schemaName: any, opts: any): Promise<any[]>;
625
+ listSeedsByUidPrefix(schemaName: any, uidPrefix: any, opts: any): Promise<any[]>;
626
+ listSeedsBySchemaNameForMonth(schemaName: any, year: any, month: any): Promise<any[]>;
627
+ getVersionsForSeed(seedUid: any): Promise<any[]>;
628
+ getVersionsForSeeds(seedUids: any, opts: any): Promise<any[]>;
629
+ getPropertiesForVersionUids(versionUids: any): Promise<any[]>;
630
+ getSeedsByUids(uids: any): Promise<any[]>;
631
+ readStorageBody(ref: any): Promise<any>;
632
+ };
633
+ /**
634
+ * Get refValueType from a property object with case-insensitive key lookup.
635
+ */
636
+ declare function getRefValueType(prop: any): string | undefined;
637
+ /**
638
+ * Hard-delete the given seed local ids and related local rows (cascade).
639
+ * Does not touch schemas, app_state, or chain.
640
+ */
641
+ declare function hardDeleteLocalSeedsByLocalIds(seedLocalIds: any): Promise<void>;
642
+ declare function importJsonSchema(importFilePathOrContents: any, version?: number): Promise<any>;
643
+ /**
644
+ * Create a new schema file
645
+ * @param schema - The schema object to save
646
+ * @param schemaFileId - Schema file ID (required)
647
+ * @throws Error if schema already exists or if workingDir is invalid
648
+ */
649
+ declare function createSchema(schema: any, schemaFileId: any): Promise<void>;
650
+ declare const easSyncActor: import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
651
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
652
+ }, {
653
+ src: "runEasSync";
654
+ logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
655
+ id: string | undefined;
656
+ }, never, never, never, "idle" | "running" | "afterRun", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
657
+ id: any;
658
+ states: {
659
+ readonly idle: {};
660
+ readonly running: {};
661
+ readonly afterRun: {};
662
+ };
663
+ }, import("xstate").MetaObject>>;
664
+ /**
665
+ * Load an existing complete schema file and process its models
666
+ * This is used to load models from already-processed schema files into the store
667
+ * @param schemaFilePath - Path to the complete schema file (must have $schema field)
668
+ * @returns The file path of the schema
669
+ * @throws Error if file cannot be read, parsed, or is not a complete schema
670
+ */
671
+ declare function loadSchemaFromFile(schemaFilePath: any): Promise<any>;
672
+ declare function getClient(): {
673
+ isInitialized: () => any;
674
+ getService: () => import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
675
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
676
+ }, {
677
+ src: "platformClassesInit";
678
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
679
+ id: string | undefined;
680
+ } | {
681
+ src: "fileSystemInit";
682
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
683
+ id: string | undefined;
684
+ } | {
685
+ src: "dbInit";
686
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
687
+ id: string | undefined;
688
+ } | {
689
+ src: "saveConfig";
690
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
691
+ id: string | undefined;
692
+ } | {
693
+ src: "addModelsToStore";
694
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
695
+ id: string | undefined;
696
+ } | {
697
+ src: "addModelsToDb";
698
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
699
+ id: string | undefined;
700
+ } | {
701
+ src: "processSchemaFiles";
702
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
703
+ id: string | undefined;
704
+ } | {
705
+ src: "saveAppState";
706
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
707
+ id: string | undefined;
708
+ }, {
709
+ type: "assignInitError";
710
+ params: import("xstate").NonReducibleUnknown;
711
+ }, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
712
+ id?: string | undefined | undefined;
713
+ states?: {} | undefined;
714
+ }, import("xstate").MetaObject>>;
715
+ /**
716
+ * Initialise the SDK. Calls made while an init is running share it. Once initialised, a
717
+ * call with the same config resolves at once and applies any change in `addresses`; a
718
+ * call with a different config throws INIT_CONFIG_CONFLICT_MESSAGE (call stop() first).
719
+ */
720
+ init: (options: any) => Promise<void>;
721
+ setAddresses: (addresses: any) => Promise<void>;
722
+ getAddresses: () => Promise<{
723
+ owned: any;
724
+ watched: any;
725
+ }>;
726
+ getOwnedAddresses: () => Promise<any>;
727
+ getWatchedAddresses: () => Promise<any>;
728
+ /**
729
+ * Stamp local seeds/versions/metadata that have no publisher and no real uid.
730
+ * Sealed rows (real EAS uid or attestationRaw) are left unchanged.
731
+ * Use after `setAddresses` on connect; `setPublishWallet` does this automatically.
732
+ */
733
+ claimUnpublishedDrafts: (publisher: any) => Promise<{
734
+ seeds: any;
735
+ versions: number;
736
+ metadata: number;
737
+ seedLocalIds: any;
738
+ }>;
739
+ /**
740
+ * Hard-delete local on-chain seed copies for the given publisher addresses.
741
+ * Drafts (no uid / attestationRaw) are kept. Chain is untouched; reconnect can rehydrate via syncFromEas.
742
+ */
743
+ removeLocalCopiesForAddresses: (addresses: any) => Promise<{
744
+ removedSeedLocalIds: any;
745
+ removedSeedUids: any;
746
+ }>;
747
+ /**
748
+ * Syncs item attestations from EAS for the configured models and given addresses.
749
+ * Uses owned + watched addresses from DB when addresses are not provided.
750
+ */
751
+ syncFromEas: (options: any) => Promise<void>;
752
+ addModel: (modelDef: any) => Promise<void>;
753
+ /**
754
+ * Calls `callback` once the client is initialised, or on the next microtask if it already
755
+ * is. Returns a function that cancels the callback.
756
+ */
757
+ onReady: (callback: any) => () => void;
758
+ stop: () => void;
759
+ unload: () => void;
760
+ };
761
+ /**
762
+ * Thin published-JSON helper: `getSeed` via the local (or auto) query source.
763
+ * Does not touch Item / drafts / liveQuery.
764
+ *
765
+ * Prefer this (or `@seedprotocol/query` `getSeed` / `queryBySchema`) for
766
+ * canonical published Seed JSON. Use `getItemData` / Item for draft-head authoring.
767
+ */
768
+ declare function getPublishedSeedRecord(seedUid: any, options: any): Promise<import("@seedprotocol/query").GetSeedResult | null>;
769
+ /**
770
+ * Extract the schema name from a schemaId string
771
+ * @param schemaId - Schema ID in the format `${schemaName}-${schemaVersion}`
772
+ * @returns The schema name, or null if the format is invalid
773
+ */
774
+ declare function getSchemaNameFromId(schemaId: any): string | null;
775
+ declare function isSeedQueryLocalSourceRegistered(): boolean;
776
+ declare function listCompleteSchemaFiles(): Promise<{
777
+ name: any;
778
+ version: any;
779
+ filePath: any;
780
+ schemaFileId: any;
781
+ }[]>;
782
+ /**
783
+ * Read and parse a JSON import file
784
+ * Supports two formats:
785
+ * 1. Minimal format: { name: string, models: {...} }
786
+ * 2. Complete schema format: { $schema: string, metadata: { name: string }, models: {...}, ... }
787
+ * @param filePath - Path to the JSON import file
788
+ * @returns The parsed JSON import data normalized to JsonImportSchema format
789
+ * @throws Error if file cannot be read or parsed
790
+ */
791
+ declare function readJsonImportFile(filePath: any): Promise<{
792
+ models: any;
793
+ nameMatch?: any;
794
+ name: any;
795
+ }>;
796
+ /**
797
+ * Sync a canonical schema from a file path or inlined object to the database.
798
+ * A stored schema file with the same id and version but different content is overwritten (with a
799
+ * warning) instead of reused, and models dropped from the schema are unlinked from it.
800
+ * Called automatically at init when config.schema is provided.
801
+ *
802
+ * @param source - File path (string) or complete SchemaFileFormat object
803
+ */
804
+ declare function syncSchemaFromSource(source: any): Promise<void>;
805
+ /**
806
+ * Transform import JSON format to full schema file format
807
+ * @param importData - The JSON import data
808
+ * @param version - The version number for the schema (defaults to 1)
809
+ * @returns The transformed schema file format
810
+ */
811
+ declare function transformImportToSchemaFile(importData: any, version?: number): {
812
+ metadata: {
813
+ name: any;
814
+ createdAt: string;
815
+ updatedAt: string;
816
+ };
817
+ models: {};
818
+ enums: {};
819
+ migrations: {
820
+ version: number;
821
+ timestamp: string;
822
+ description: string;
823
+ changes: never[];
824
+ }[];
825
+ nameMatch?: any;
826
+ $schema: string;
827
+ version: number;
828
+ id: string;
829
+ };
830
+ declare function loadAllSchemasFromDb(): Promise<({
831
+ schema: any;
832
+ isDraft: boolean;
833
+ source: string;
834
+ schemaRecordId: any;
835
+ filePath?: undefined;
836
+ dbMatchesFile?: undefined;
837
+ } | {
838
+ schema: any;
839
+ isDraft: boolean;
840
+ source: string;
841
+ schemaRecordId: any;
842
+ filePath: any;
843
+ dbMatchesFile: boolean;
844
+ } | {
845
+ schema: any;
846
+ isDraft: boolean;
847
+ source: string;
848
+ schemaRecordId: any;
849
+ filePath: any;
850
+ dbMatchesFile?: undefined;
851
+ })[]>;
852
+ /**
853
+ * Merge multiple EAS sync intents: full sync (no concrete address list) wins;
854
+ * otherwise union addresses (first-seen casing).
855
+ */
856
+ declare function mergeEasSyncRequestIntents(parts: any): {
857
+ addresses?: undefined;
858
+ } | {
859
+ addresses: any[];
860
+ };
861
+ /**
862
+ * Wait until the read chain is known before syncing. Only waits when `@seedprotocol/publish`
863
+ * is loaded but `initPublish` has not run, and no chain is configured or recorded locally.
864
+ */
865
+ declare function waitForEasReadChain(timeoutMs?: number): Promise<void>;
866
+ /**
867
+ * Read a schema file by name and version
868
+ * @param name - The name of the schema
869
+ * @param version - The version of the schema
870
+ * @param schemaFileId - Schema file ID (required)
871
+ * @returns The schema object, or null if not found
872
+ */
873
+ declare function readSchema(name: any, version: any, schemaFileId: any): Promise<any>;
874
+ /**
875
+ * Register the SDK SQLite/files adapter with `@seedprotocol/query`.
876
+ * Safe to call multiple times; re-registers with a fresh adapter instance.
877
+ * No-op when the app DB is not ready yet (unless `force`).
878
+ */
879
+ declare function registerSeedQueryLocalSource(options: any): boolean;
880
+ declare function requestEasSyncFromAddressChange(addresses: any): void;
881
+ /**
882
+ * Delete a schema file
883
+ * @param name - The name of the schema
884
+ * @param version - The version of the schema
885
+ * @param schemaFileId - Schema file ID (required)
886
+ * @throws Error if schema doesn't exist
887
+ */
888
+ declare function deleteSchema(name: any, version: any, schemaFileId: any): Promise<void>;
889
+ /**
890
+ * Filter an array of schemas to only include the latest version for each schema name
891
+ * Works with any object that has a name (via metadata.name or name property) and a version property
892
+ * @param schemas - Array of schema objects
893
+ * @returns Array containing only the latest version of each schema
894
+ */
895
+ declare function filterLatestSchemas(schemas: any): any[];
896
+ /**
897
+ * Find a schema by name (returns the latest version if multiple versions exist)
898
+ * @param name - The name of the schema
899
+ * @returns The schema with the highest version, or null if not found
900
+ */
901
+ declare function findSchemaByName(name: any): Promise<any>;
902
+ /**
903
+ * Get only the latest version of each schema
904
+ * @returns Array of objects containing name, version, and file path for the latest version of each schema
905
+ */
906
+ declare function listLatestSchemaFiles(): Promise<any[]>;
907
+ /**
908
+ * List all schema files in the working directory
909
+ * Only returns files that are NOT already complete schema files (i.e., files without $schema field)
910
+ * This allows processing of minimal import files while skipping already-processed schema files
911
+ * @returns Array of objects containing name, version, and file path for each schema
912
+ */
913
+ declare function listSchemaFiles(): Promise<{
914
+ name: any;
915
+ version: number;
916
+ filePath: any;
917
+ }[]>;
918
+ /**
919
+ * Migration helper: Migrate existing file-based schemas to the database
920
+ * This function should be called once to migrate existing schema files to the new database-first approach
921
+ * All existing schemas will be marked as published (isDraft = false) since they already exist in files
922
+ * @returns Number of schemas migrated
923
+ */
924
+ declare function migrateFileSchemasToDb(): Promise<number>;
925
+ /**
926
+ * Update an existing schema file
927
+ * @param schema - The updated schema object (must have same name and version as existing)
928
+ * @param schemaFileId - Schema file ID (required)
929
+ * @throws Error if schema doesn't exist
930
+ */
931
+ declare function updateSchema(schema: any, schemaFileId: any): Promise<void>;
932
+ export { requestEasSyncFromEventBus as A, requestEasSyncFromModelsInit as B, ClientManager as C, sendEasSyncClientRequest as D, EAS_CHAIN_ID_APP_STATE_KEY as E, setRetriesWhenOnlineEnabled as F, startEasSyncActor as G, unregisterSeedQueryLocalSource as H, INIT_CONFIG_CONFLICT_MESSAGE as I, createRowsWrittenSignal as J, createModelsFromJson as K, getLatestSchemaVersion as L, jsonPropertiesToSchemaProperties as M, schema as N, ClientManager$1 as O, SEEDPROTOCOL_Seed_Protocol_v1 as S, getContentHash as a, isVerbatimItemStorageDraftRow as b, convertVerbatimItemStorageRow as c, assertLocalDbChain as d, claimUnpublishedDrafts as e, createLocalQueryDataSource as f, getRefValueType as g, hardDeleteLocalSeedsByLocalIds as h, importJsonSchema as i, createSchema as j, easSyncActor as k, loadSchemaFromFile as l, getClient as m, getPublishedSeedRecord as n, getSchemaNameFromId as o, isSeedQueryLocalSourceRegistered as p, listCompleteSchemaFiles as q, readJsonImportFile as r, syncSchemaFromSource as s, transformImportToSchemaFile as t, loadAllSchemasFromDb as u, mergeEasSyncRequestIntents as v, waitForEasReadChain as w, readSchema as x, registerSeedQueryLocalSource as y, requestEasSyncFromAddressChange as z };
933
+ //# sourceMappingURL=ClientManager-D6YA20jP.d.ts.map