@seedprotocol/sdk 0.7.7 → 0.7.8-next.1066.gac32194
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.
- package/dist/{ClientManager-2GtDWHq6.js → ClientManager-Dcju5x4k.js} +835 -80
- package/dist/ClientManager-Dcju5x4k.js.map +1 -0
- package/dist/{Item-D6j0IvBP.js → Item-DZfNz7xl.js} +2145 -1354
- package/dist/Item-DZfNz7xl.js.map +1 -0
- package/dist/{ModelProperty-B52C3CQ2.js → ModelProperty-sMGL-_LK.js} +51 -52
- package/dist/ModelProperty-sMGL-_LK.js.map +1 -0
- package/dist/{Schema-O1QLoXv6.js → Schema-D-TczaIj.js} +106 -91
- package/dist/Schema-D-TczaIj.js.map +1 -0
- package/dist/{SchemaValidationService-BxCbfDaI.js → SchemaValidationService-NYTtSCxd.js} +6 -6
- package/dist/{SchemaValidationService-BxCbfDaI.js.map → SchemaValidationService-NYTtSCxd.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-CzSbuucw.js → backfillMetadataPropertyIds-DEvD0OAT.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-CzSbuucw.js.map → backfillMetadataPropertyIds-DEvD0OAT.js.map} +1 -1
- package/dist/{configurePlatform-Bbpw_R4y.js → configurePlatform-CtA7fydC.js} +2 -2
- package/dist/{configurePlatform-Bbpw_R4y.js.map → configurePlatform-CtA7fydC.js.map} +1 -1
- package/dist/db/drizzle/0020_add_pending_writes.sql +24 -0
- package/dist/db/drizzle/0021_add_pending_write_error_name.sql +1 -0
- package/dist/db/drizzle/meta/0020_snapshot.json +1542 -0
- package/dist/db/drizzle/meta/0021_snapshot.json +1549 -0
- package/dist/db/drizzle/meta/_journal.json +14 -0
- package/dist/{detachRowsBeforeDelete-D1TyEMco.js → detachRowsBeforeDelete-CLbBbpX4.js} +2 -2
- package/dist/{detachRowsBeforeDelete-D1TyEMco.js.map → detachRowsBeforeDelete-CLbBbpX4.js.map} +1 -1
- package/dist/dist/{ClientManager-2GtDWHq6.d.ts → ClientManager-Dcju5x4k.d.ts} +393 -292
- package/dist/dist/ClientManager-Dcju5x4k.d.ts.map +1 -0
- package/dist/dist/{Item-D6j0IvBP.d.ts → Item-DZfNz7xl.d.ts} +456 -266
- package/dist/dist/Item-DZfNz7xl.d.ts.map +1 -0
- package/dist/dist/{ModelProperty-B52C3CQ2.d.ts → ModelProperty-sMGL-_LK.d.ts} +1 -1
- package/dist/dist/{ModelProperty-B52C3CQ2.d.ts.map → ModelProperty-sMGL-_LK.d.ts.map} +1 -1
- package/dist/dist/{Schema-O1QLoXv6.d.ts → Schema-D-TczaIj.d.ts} +11 -4
- package/dist/dist/Schema-D-TczaIj.d.ts.map +1 -0
- package/dist/dist/{SchemaValidationService-BxCbfDaI.d.ts → SchemaValidationService-NYTtSCxd.d.ts} +1 -1
- package/dist/dist/{SchemaValidationService-BxCbfDaI.d.ts.map → SchemaValidationService-NYTtSCxd.d.ts.map} +1 -1
- package/dist/dist/{backfillMetadataPropertyIds-CzSbuucw.d.ts → backfillMetadataPropertyIds-DEvD0OAT.d.ts} +1 -1
- package/dist/dist/backfillMetadataPropertyIds-DEvD0OAT.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-Bbpw_R4y.d.ts → configurePlatform-CtA7fydC.d.ts} +1 -1
- package/dist/dist/configurePlatform-CtA7fydC.d.ts.map +1 -0
- package/dist/dist/{detachRowsBeforeDelete-D1TyEMco.d.ts → detachRowsBeforeDelete-CLbBbpX4.d.ts} +1 -1
- package/dist/dist/detachRowsBeforeDelete-CLbBbpX4.d.ts.map +1 -0
- package/dist/dist/{eas-DOdj-EMK.d.ts → eas-CcpQiXum.d.ts} +1 -1
- package/dist/dist/eas-CcpQiXum.d.ts.map +1 -0
- package/dist/dist/{errors-KM-yq2MD.d.ts → errors-BGk_IJO5.d.ts} +39 -24
- package/dist/dist/errors-BGk_IJO5.d.ts.map +1 -0
- package/dist/dist/{getItem-Bh0zv-o1.d.ts → getItem-CHSX3aMm.d.ts} +1 -1
- package/dist/dist/getItem-CHSX3aMm.d.ts.map +1 -0
- package/dist/dist/{getPublishPayload-oH8wJhnH.d.ts → getPublishPayload-DMd4oLir.d.ts} +1 -1
- package/dist/dist/getPublishPayload-DMd4oLir.d.ts.map +1 -0
- package/dist/dist/{getPublishUploads-Cex-NBe6.d.ts → getPublishUploads-C9FnRG9c.d.ts} +1 -1
- package/dist/dist/{getPublishUploads-Cex-NBe6.d.ts.map → getPublishUploads-C9FnRG9c.d.ts.map} +1 -1
- package/dist/dist/{index-BbFwftAv.d.ts → index-C--KAWoe.d.ts} +378 -1
- package/dist/dist/{index-BbFwftAv.d.ts.map → index-C--KAWoe.d.ts.map} +1 -1
- package/dist/dist/{index-DpgQMIRq.d.ts → index-CI0NFf4B.d.ts} +836 -426
- package/dist/dist/index-CI0NFf4B.d.ts.map +1 -0
- package/dist/dist/{index-BAao3_Po.d.ts → index-Ccmd9_KY.d.ts} +5 -5
- package/dist/dist/index-Ccmd9_KY.d.ts.map +1 -0
- package/dist/dist/index-l3b6p1Ih.d.ts +14 -0
- package/dist/dist/index-l3b6p1Ih.d.ts.map +1 -0
- package/dist/dist/{index.browser-nndbVM7z.d.ts → index.browser-kY8M-xUA.d.ts} +2892 -1754
- package/dist/dist/{index.browser-nndbVM7z.d.ts.map → index.browser-kY8M-xUA.d.ts.map} +1 -1
- package/dist/dist/{index.node-BUfx-JaP.d.ts → index.node-Ba2KbmOq.d.ts} +4125 -2613
- package/dist/dist/{index.node-BUfx-JaP.d.ts.map → index.node-Ba2KbmOq.d.ts.map} +1 -1
- package/dist/dist/platform.browser.d.ts +2 -2
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/dist/{property-BDBvImLs.d.ts → property-CO7pKTWK.d.ts} +3 -3
- package/dist/dist/property-CO7pKTWK.d.ts.map +1 -0
- package/dist/dist/{propertyValidationRules-BlfLn4rP.d.ts → propertyValidationRules-D5HZy0Bq.d.ts} +1 -1
- package/dist/dist/propertyValidationRules-D5HZy0Bq.d.ts.map +1 -0
- package/dist/dist/{publishDraftGraph-CLO85LLz.d.ts → publishDraftGraph-B5KPqtbg.d.ts} +1 -1
- package/dist/dist/{publishDraftGraph-CLO85LLz.d.ts.map → publishDraftGraph-B5KPqtbg.d.ts.map} +1 -1
- package/dist/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.d.ts → resetAmbiguousLegacyItemData-77CZ8HT7.d.ts} +1 -1
- package/dist/dist/resetAmbiguousLegacyItemData-77CZ8HT7.d.ts.map +1 -0
- package/dist/dist/{resolveModelForSyncedSeed-DFr4COc4.d.ts → resolveModelForSyncedSeed-DHOq_FGs.d.ts} +1 -1
- package/dist/dist/resolveModelForSyncedSeed-DHOq_FGs.d.ts.map +1 -0
- package/dist/dist/{syncDbWithEas-CAOlw3i-.d.ts → syncDbWithEas-BZ6AI-IC.d.ts} +1 -1
- package/dist/dist/syncDbWithEas-BZ6AI-IC.d.ts.map +1 -0
- package/dist/dist/{tabEvents-DksXwk3X.d.ts → tabEvents-CIlzHSKZ.d.ts} +35 -18
- package/dist/dist/tabEvents-CIlzHSKZ.d.ts.map +1 -0
- package/dist/dist/{tolerantWebAccess-CEIjFGf0.d.ts → tolerantWebAccess-BwJ8bElF.d.ts} +1 -1
- package/dist/dist/{tolerantWebAccess-CEIjFGf0.d.ts.map → tolerantWebAccess-BwJ8bElF.d.ts.map} +1 -1
- package/dist/dist/{updateSeedRevokedAt-Cjr35YjE.d.ts → updateSeedRevokedAt-ClxMSXcB.d.ts} +1 -1
- package/dist/dist/updateSeedRevokedAt-ClxMSXcB.d.ts.map +1 -0
- package/dist/{eas-DOdj-EMK.js → eas-CcpQiXum.js} +4 -4
- package/dist/{eas-DOdj-EMK.js.map → eas-CcpQiXum.js.map} +1 -1
- package/dist/{errors-KM-yq2MD.js → errors-BGk_IJO5.js} +222 -275
- package/dist/errors-BGk_IJO5.js.map +1 -0
- package/dist/{getItem-Bh0zv-o1.js → getItem-CHSX3aMm.js} +5 -5
- package/dist/{getItem-Bh0zv-o1.js.map → getItem-CHSX3aMm.js.map} +1 -1
- package/dist/{getPublishPayload-oH8wJhnH.js → getPublishPayload-DMd4oLir.js} +18 -15
- package/dist/getPublishPayload-DMd4oLir.js.map +1 -0
- package/dist/{getPublishUploads-Cex-NBe6.js → getPublishUploads-C9FnRG9c.js} +9 -6
- package/dist/getPublishUploads-C9FnRG9c.js.map +1 -0
- package/dist/{index-BbFwftAv.js → index-C--KAWoe.js} +3 -2
- package/dist/index-C--KAWoe.js.map +1 -0
- package/dist/{index-DpgQMIRq.js → index-CI0NFf4B.js} +132 -9
- package/dist/index-CI0NFf4B.js.map +1 -0
- package/dist/{index-BAao3_Po.js → index-Ccmd9_KY.js} +8 -8
- package/dist/index-Ccmd9_KY.js.map +1 -0
- package/dist/index-l3b6p1Ih.js +28 -0
- package/dist/index-l3b6p1Ih.js.map +1 -0
- package/dist/{index.browser-nndbVM7z.js → index.browser-kY8M-xUA.js} +284 -73
- package/dist/index.browser-kY8M-xUA.js.map +1 -0
- package/dist/{index.node-BUfx-JaP.js → index.node-Ba2KbmOq.js} +93 -6
- package/dist/index.node-Ba2KbmOq.js.map +1 -0
- package/dist/main.js +84 -26
- package/dist/main.js.map +1 -1
- package/dist/node.js +11 -11
- package/dist/platform.browser.js +5 -5
- package/dist/platform.node.js +4 -4
- package/dist/{property-BDBvImLs.js → property-CO7pKTWK.js} +9 -11
- package/dist/property-CO7pKTWK.js.map +1 -0
- package/dist/{propertyValidationRules-BlfLn4rP.js → propertyValidationRules-D5HZy0Bq.js} +10 -10
- package/dist/{propertyValidationRules-BlfLn4rP.js.map → propertyValidationRules-D5HZy0Bq.js.map} +1 -1
- package/dist/{publishDraftGraph-CLO85LLz.js → publishDraftGraph-B5KPqtbg.js} +6 -6
- package/dist/{publishDraftGraph-CLO85LLz.js.map → publishDraftGraph-B5KPqtbg.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.js → resetAmbiguousLegacyItemData-77CZ8HT7.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.js.map → resetAmbiguousLegacyItemData-77CZ8HT7.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-DFr4COc4.js → resolveModelForSyncedSeed-DHOq_FGs.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-DFr4COc4.js.map → resolveModelForSyncedSeed-DHOq_FGs.js.map} +1 -1
- package/dist/seedSchema/PendingWriteSchema.ts +57 -0
- package/dist/seedSchema/index.ts +1 -0
- package/dist/src/Item/Item.d.ts +38 -7
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/itemMachineSingle.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +66 -9
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts +5 -0
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/storageValue.d.ts +22 -0
- package/dist/src/ItemProperty/service/actors/saveValueToDb/storageValue.d.ts.map +1 -0
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +50 -9
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/service/actors/validateModel.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/validateProperty.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts +22 -3
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/createModelInstances.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts +7 -0
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +4 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/db/sqliteBusyRetry.d.ts.map +1 -1
- package/dist/src/browser/helpers/EasClient.d.ts +1 -1
- package/dist/src/browser/helpers/EasClient.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +13 -0
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/client/addressesPersisted.d.ts +10 -0
- package/dist/src/client/addressesPersisted.d.ts.map +1 -0
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/db/Db/BaseDb.d.ts +10 -0
- package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
- package/dist/src/db/read/getItemProperties.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getSeedData.d.ts +4 -1
- package/dist/src/db/read/getSeedData.d.ts.map +1 -1
- package/dist/src/db/read/getSeedPublisher.d.ts +4 -1
- package/dist/src/db/read/getSeedPublisher.d.ts.map +1 -1
- package/dist/src/db/read/getVersionData.d.ts +4 -1
- package/dist/src/db/read/getVersionData.d.ts.map +1 -1
- package/dist/src/db/write/claimUnpublishedDrafts.d.ts +6 -0
- package/dist/src/db/write/claimUnpublishedDrafts.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts +13 -0
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/createNewItem.d.ts +5 -0
- package/dist/src/db/write/createNewItem.d.ts.map +1 -1
- package/dist/src/db/write/createSeed.d.ts +20 -1
- package/dist/src/db/write/createSeed.d.ts.map +1 -1
- package/dist/src/db/write/createVersion.d.ts +5 -1
- package/dist/src/db/write/createVersion.d.ts.map +1 -1
- package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts +9 -2
- package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts.map +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts +9 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/db/write/updateMetadata.d.ts +8 -1
- package/dist/src/db/write/updateMetadata.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +4 -2
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityCache.d.ts +2 -42
- package/dist/src/helpers/entity/entityCache.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityCommon.d.ts +9 -0
- package/dist/src/helpers/entity/entityCommon.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityDestroy.d.ts +13 -7
- package/dist/src/helpers/entity/entityDestroy.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityLiveQuery.d.ts +3 -2
- package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityState.d.ts +28 -0
- package/dist/src/helpers/entity/entityState.d.ts.map +1 -0
- package/dist/src/helpers/entity/entityUnload.d.ts +3 -2
- package/dist/src/helpers/entity/entityUnload.d.ts.map +1 -1
- package/dist/src/helpers/entity/index.d.ts +1 -0
- package/dist/src/helpers/entity/index.d.ts.map +1 -1
- package/dist/src/helpers/itemStorageFile.d.ts +7 -0
- package/dist/src/helpers/itemStorageFile.d.ts.map +1 -1
- package/dist/src/helpers/metadataPropertyNames.d.ts +6 -0
- package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
- package/dist/src/helpers/property.d.ts.map +1 -1
- package/dist/src/helpers/propertySchemaUid.d.ts +13 -0
- package/dist/src/helpers/propertySchemaUid.d.ts.map +1 -0
- package/dist/src/helpers/propertyWriteTickets.d.ts +11 -0
- package/dist/src/helpers/propertyWriteTickets.d.ts.map +1 -0
- package/dist/src/helpers/reactiveProxy.d.ts +18 -0
- package/dist/src/helpers/reactiveProxy.d.ts.map +1 -1
- package/dist/src/helpers/sessionObjectUrls.d.ts +4 -0
- package/dist/src/helpers/sessionObjectUrls.d.ts.map +1 -0
- package/dist/src/helpers/tabCoordinator.d.ts +9 -0
- package/dist/src/helpers/tabCoordinator.d.ts.map +1 -1
- package/dist/src/helpers/tabLocks.d.ts +11 -0
- package/dist/src/helpers/tabLocks.d.ts.map +1 -1
- package/dist/src/helpers/timing.d.ts +10 -0
- package/dist/src/helpers/timing.d.ts.map +1 -0
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IDb.d.ts +2 -0
- package/dist/src/interfaces/IDb.d.ts.map +1 -1
- package/dist/src/interfaces/IItem.d.ts +1 -0
- package/dist/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/src/interfaces/IItemProperty.d.ts +5 -0
- package/dist/src/interfaces/IItemProperty.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts +3 -0
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/db/singleConnectionTransactions.d.ts +22 -0
- package/dist/src/node/db/singleConnectionTransactions.d.ts.map +1 -0
- package/dist/src/outbox/conflicts.d.ts +60 -0
- package/dist/src/outbox/conflicts.d.ts.map +1 -0
- package/dist/src/outbox/index.d.ts +9 -0
- package/dist/src/outbox/index.d.ts.map +1 -0
- package/dist/src/outbox/itemAppliers.d.ts +153 -0
- package/dist/src/outbox/itemAppliers.d.ts.map +1 -0
- package/dist/src/outbox/outbox.d.ts +143 -0
- package/dist/src/outbox/outbox.d.ts.map +1 -0
- package/dist/src/outbox/pendingValues.d.ts +27 -0
- package/dist/src/outbox/pendingValues.d.ts.map +1 -0
- package/dist/src/seedSchema/PendingWriteSchema.d.ts +385 -0
- package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -0
- package/dist/src/seedSchema/index.d.ts +1 -0
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/src/types/property.d.ts +5 -0
- package/dist/src/types/property.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CAOlw3i-.js → syncDbWithEas-BZ6AI-IC.js} +25 -20
- package/dist/syncDbWithEas-BZ6AI-IC.js.map +1 -0
- package/dist/{tabEvents-DksXwk3X.js → tabEvents-CIlzHSKZ.js} +56 -25
- package/dist/tabEvents-CIlzHSKZ.js.map +1 -0
- package/dist/{tolerantWebAccess-CEIjFGf0.js → tolerantWebAccess-BwJ8bElF.js} +6 -6
- package/dist/{tolerantWebAccess-CEIjFGf0.js.map → tolerantWebAccess-BwJ8bElF.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-Cjr35YjE.js → updateSeedRevokedAt-ClxMSXcB.js} +3 -3
- package/dist/{updateSeedRevokedAt-Cjr35YjE.js.map → updateSeedRevokedAt-ClxMSXcB.js.map} +1 -1
- package/package.json +7 -7
- package/dist/ClientManager-2GtDWHq6.js.map +0 -1
- package/dist/Item-D6j0IvBP.js.map +0 -1
- package/dist/ModelProperty-B52C3CQ2.js.map +0 -1
- package/dist/Schema-O1QLoXv6.js.map +0 -1
- package/dist/discardNewDraft-hiVaUVjV.js +0 -78
- package/dist/discardNewDraft-hiVaUVjV.js.map +0 -1
- package/dist/dist/ClientManager-2GtDWHq6.d.ts.map +0 -1
- package/dist/dist/Item-D6j0IvBP.d.ts.map +0 -1
- package/dist/dist/Schema-O1QLoXv6.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-CzSbuucw.d.ts.map +0 -1
- package/dist/dist/configurePlatform-Bbpw_R4y.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-D1TyEMco.d.ts.map +0 -1
- package/dist/dist/discardNewDraft-hiVaUVjV.d.ts +0 -8
- package/dist/dist/discardNewDraft-hiVaUVjV.d.ts.map +0 -1
- package/dist/dist/eas-DOdj-EMK.d.ts.map +0 -1
- package/dist/dist/errors-KM-yq2MD.d.ts.map +0 -1
- package/dist/dist/getItem-Bh0zv-o1.d.ts.map +0 -1
- package/dist/dist/getPublishPayload-oH8wJhnH.d.ts.map +0 -1
- package/dist/dist/index-BAao3_Po.d.ts.map +0 -1
- package/dist/dist/index-DpgQMIRq.d.ts.map +0 -1
- package/dist/dist/property-BDBvImLs.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-BlfLn4rP.d.ts.map +0 -1
- package/dist/dist/resetAmbiguousLegacyItemData-Cy8ik7xk.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-DFr4COc4.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-CAOlw3i-.d.ts.map +0 -1
- package/dist/dist/tabEvents-DksXwk3X.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-Cjr35YjE.d.ts.map +0 -1
- package/dist/errors-KM-yq2MD.js.map +0 -1
- package/dist/getPublishPayload-oH8wJhnH.js.map +0 -1
- package/dist/getPublishUploads-Cex-NBe6.js.map +0 -1
- package/dist/index-BAao3_Po.js.map +0 -1
- package/dist/index-BbFwftAv.js.map +0 -1
- package/dist/index-DpgQMIRq.js.map +0 -1
- package/dist/index.browser-nndbVM7z.js.map +0 -1
- package/dist/index.node-BUfx-JaP.js.map +0 -1
- package/dist/property-BDBvImLs.js.map +0 -1
- package/dist/src/db/write/discardNewDraft.d.ts +0 -8
- package/dist/src/db/write/discardNewDraft.d.ts.map +0 -1
- package/dist/src/helpers/propertyWriteQueue.d.ts +0 -15
- package/dist/src/helpers/propertyWriteQueue.d.ts.map +0 -1
- package/dist/syncDbWithEas-CAOlw3i-.js.map +0 -1
- package/dist/tabEvents-DksXwk3X.js.map +0 -1
|
@@ -1,51 +1,63 @@
|
|
|
1
|
+
declare function getGetPublisherForNewSeeds(): any;
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* Throws OwnershipError if the item is not owned. Use before write operations
|
|
4
|
+
* (publish, save, destroy).
|
|
5
|
+
*/
|
|
6
|
+
declare function assertItemOwned(item: any): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the current user owns the item: its publisher is in the persisted owned addresses,
|
|
9
|
+
* or it's a local unsealed draft (no publisher, no real uid, no attestationRaw). Such a draft
|
|
10
|
+
* was made with no wallet connected and is editable until `claimUnpublishedDrafts`, which
|
|
11
|
+
* connecting a wallet calls, gives it that wallet as publisher.
|
|
4
12
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
13
|
+
* Does not include `getAdditionalSyncAddresses` (those are extra EAS indexers,
|
|
14
|
+
* not wallets the user controls).
|
|
7
15
|
*/
|
|
8
|
-
declare function
|
|
9
|
-
declare function getPublishExecutor(): any;
|
|
10
|
-
declare function getRevokeExecutor(): any;
|
|
11
|
-
declare var ClientManagerState: any;
|
|
16
|
+
declare function isItemOwned(item: any): Promise<boolean>;
|
|
12
17
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
18
|
+
* Wait for an entity's state machine to reach 'idle' state
|
|
19
|
+
* @param entity - Entity instance with getService() method
|
|
20
|
+
* @param options - Configuration options
|
|
21
|
+
* @returns Promise that resolves when entity reaches idle, or rejects on error/timeout
|
|
15
22
|
*/
|
|
16
|
-
declare
|
|
17
|
-
/**
|
|
18
|
-
declare function
|
|
23
|
+
declare function waitForEntityIdle(entity: any, options?: {}): Promise<void>;
|
|
24
|
+
/** Sort comparator: live before revoked; then larger time first; on tie, larger localId (lexicographic) first. */
|
|
25
|
+
declare function compareMetadataRowsLatestFirst(a: any, b: any): number;
|
|
19
26
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `lastVersionPublishedAt`. `versionsCount` and `lastLocalUpdateAt` still cover every version row,
|
|
25
|
-
* so a fully unpublished seed (every version revoked) keeps its row here, with null
|
|
26
|
-
* `latestVersionUid` / `latestVersionLocalId` / `lastVersionPublishedAt`.
|
|
27
|
-
*
|
|
28
|
-
* For `publishedVersionUid` / `publishedVersionLocalId` on list rows, see `getItemsData`
|
|
29
|
-
* (batched resolution aligned with `getLatestPublishedVersionRow`).
|
|
27
|
+
* EAS schema UID of a model's seeds: the in-memory cache, then `model_uids` (written from EAS by
|
|
28
|
+
* startup and sync), then EAS itself. The DB comes before EAS so creating items and saving
|
|
29
|
+
* images, files and Html bodies works offline. A failed EAS request (offline) counts as "no UID":
|
|
30
|
+
* the seed is created without one and publish looks it up again.
|
|
30
31
|
*/
|
|
31
|
-
declare function
|
|
32
|
+
declare function getEasSchemaUidForModel(modelName: any): Promise<any>;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* Latest version row for the seed (by createdAt) whose uid is a real EAS attestation id.
|
|
35
|
+
* Skips legacy 'NULL' / ZERO_BYTES32 placeholders, non-bytes32 strings, and revoked versions
|
|
36
|
+
* (`revoked_at` set): after a full unpublish the seed has no published version.
|
|
34
37
|
*/
|
|
35
|
-
declare function
|
|
38
|
+
declare function getLatestPublishedVersionRow(seedLocalId: any): Promise<{
|
|
39
|
+
uid: any;
|
|
40
|
+
localId: any;
|
|
41
|
+
attestationCreatedAt: any;
|
|
42
|
+
} | null>;
|
|
36
43
|
/**
|
|
37
|
-
*
|
|
38
|
-
* - A local unsealed draft (never given a publisher) is owned whatever the owned addresses are:
|
|
39
|
-
* it belongs to no wallet yet, and the next wallet to connect claims it (claimUnpublishedDrafts).
|
|
40
|
-
* - Any other row is owned when its publisher (or attester) is in the owned addresses.
|
|
44
|
+
* Parse List property values persisted as strings (JSON array or legacy comma-separated ids).
|
|
41
45
|
*/
|
|
42
|
-
declare function
|
|
46
|
+
declare function parseListPropertyValueFromStorage(raw: any): any;
|
|
47
|
+
/** Splits `values` into chunks of at most `size` (one empty list gives no chunks). */
|
|
48
|
+
declare function chunkValues(values: any, size?: number): any[];
|
|
43
49
|
declare class Item {
|
|
44
50
|
/** Prefer local id so list rows (local + uid) resolve the same cache entry as early draft loads. */
|
|
45
51
|
static findItemInstanceCacheEntryByProps(props: any): any;
|
|
46
52
|
static findItemInstanceCacheEntryById(id: any): any;
|
|
47
53
|
static collectInstanceCacheKeysForInstance(instance: any): any[];
|
|
48
54
|
static registerItemInInstanceCache(instance: any): void;
|
|
55
|
+
/**
|
|
56
|
+
* Wraps a new instance in its reactive proxy: tracked names read from and write to the actor's
|
|
57
|
+
* context, and the model's property names (`item.title`, or `item.html` for `htmlId`) read and
|
|
58
|
+
* write their ItemProperty's value.
|
|
59
|
+
*/
|
|
60
|
+
static wrapInProxy(instance: any): any;
|
|
49
61
|
/**
|
|
50
62
|
* Sets a tracked context property from the proxy. Setting `seedUid` to a different uid means a
|
|
51
63
|
* new seed attestation (publishing again after unpublish): the revocation belonged to the old
|
|
@@ -59,6 +71,11 @@ declare class Item {
|
|
|
59
71
|
* `propertyInstances` is merged (an item with a version but no property instances yet).
|
|
60
72
|
*/
|
|
61
73
|
static isItemSnapshotReadyForRead(snap: any): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The cached Item for a seedLocalId or seedUid, in any state, without taking a hold. For SDK code
|
|
76
|
+
* that reads or messages the item and doesn't hand it to a caller.
|
|
77
|
+
*/
|
|
78
|
+
static peek(id: any): any;
|
|
62
79
|
/**
|
|
63
80
|
* The cached Item for a seedLocalId or seedUid when it can be read right now: idle and hydrated,
|
|
64
81
|
* so at least what `Item.find()` would wait for. Otherwise undefined. Unlike `getById`, it takes
|
|
@@ -72,7 +89,11 @@ declare class Item {
|
|
|
72
89
|
static waitForItemInstanceReadyForRead(item: any, readyTimeout: any): Promise<void>;
|
|
73
90
|
static itemCacheEntryLooksUnhydratedAfterIdle(instance: any, props: any): boolean;
|
|
74
91
|
static create(props: any, options: any): Promise<any>;
|
|
75
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Stops a just-created item and deletes what create wrote: a `discard` outbox op (ADR 0019),
|
|
94
|
+
* applied after the item's other pending ops, hard-deletes the draft and the storage seeds its
|
|
95
|
+
* rows point at; their files go once it has applied.
|
|
96
|
+
*/
|
|
76
97
|
static discardCreatedItem(item: any, seedLocalId: any): Promise<void>;
|
|
77
98
|
/**
|
|
78
99
|
* Run each File/Image/Html/ItemStorage initial value through its ItemProperty save pipeline (sequentially, to
|
|
@@ -150,6 +171,11 @@ declare class Item {
|
|
|
150
171
|
readonly error: {};
|
|
151
172
|
};
|
|
152
173
|
}, import("xstate").MetaObject>>;
|
|
174
|
+
/**
|
|
175
|
+
* The item's unresolved conflicts, one per property: local edits that were kept over a value
|
|
176
|
+
* sync wrote while they were pending (ADR 0019). Each property's is also on `property.conflict`.
|
|
177
|
+
*/
|
|
178
|
+
conflicts: () => Promise<any[]>;
|
|
153
179
|
getEditedProperties: () => Promise<any>;
|
|
154
180
|
unpublish: () => Promise<void>;
|
|
155
181
|
/**
|
|
@@ -193,13 +219,19 @@ declare class Item {
|
|
|
193
219
|
};
|
|
194
220
|
}, import("xstate").MetaObject>>;
|
|
195
221
|
_subscription: import("xstate").Subscription;
|
|
196
|
-
_createPropertyInstance(props: any): void;
|
|
197
222
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
|
|
223
|
+
* The ItemProperty a model property name reads and writes on the item: by its name, or by its
|
|
224
|
+
* storage name (`html` finds `htmlId` and the other way round). Internal names don't resolve.
|
|
225
|
+
*/
|
|
226
|
+
_findPropertyInstance(propertyName: any): any;
|
|
227
|
+
/** Every name `_findPropertyInstance` resolves: the stored names and their schema names. */
|
|
228
|
+
_propertyInstanceNames(): any[];
|
|
229
|
+
/**
|
|
230
|
+
* Writes an assigned seed uid to the item's seed row, so later loads and getPublishPayload see it.
|
|
231
|
+
* Writes run one after another per item, so the last assignment is the one that stays.
|
|
201
232
|
*/
|
|
202
|
-
|
|
233
|
+
_persistSeedUid(seedUid: any): void;
|
|
234
|
+
_createPropertyInstance(props: any): void;
|
|
203
235
|
get serviceContext(): {};
|
|
204
236
|
/**
|
|
205
237
|
* Get snapshot context from the service
|
|
@@ -279,21 +311,17 @@ declare namespace Item {
|
|
|
279
311
|
let instanceCache: Map<any, any>;
|
|
280
312
|
let CREATE_METADATA_KEYS: Set<string>;
|
|
281
313
|
}
|
|
282
|
-
/** SQL form of {@link isLocalUnsealedDraft} on `seeds`. */
|
|
283
|
-
declare function localUnsealedDraftSql(): import("drizzle-orm").SQL<unknown> | undefined;
|
|
284
314
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
315
|
+
* Rows per multi-row INSERT into `table` so the statement binds at most
|
|
316
|
+
* {@link SQLITE_DEFAULT_MAX_VARIABLE_NUMBER} parameters even with every column set.
|
|
287
317
|
*/
|
|
288
|
-
declare function
|
|
318
|
+
declare function rowsPerInsert(table: any): number;
|
|
319
|
+
declare function getGetAdditionalSyncAddresses(): any;
|
|
289
320
|
/**
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* - Otherwise `lower(trim(publisher))` is in the owned set, or, when publisher is blank, the
|
|
293
|
-
* `attestationRaw.attester` ({@link resolvePublisherFromSeedRow}). `json_valid` guards
|
|
294
|
-
* `json_extract`, which throws on malformed JSON.
|
|
321
|
+
* Runs `query` once per chunk of `values` (see {@link chunkValues}), one after another, and
|
|
322
|
+
* concatenates the rows. Use it for `inArray(column, values)` reads whose list can be large.
|
|
295
323
|
*/
|
|
296
|
-
declare function
|
|
324
|
+
declare function selectInBatches(values: any, query: any, size?: number): Promise<any[]>;
|
|
297
325
|
/**
|
|
298
326
|
* Canonical "latest metadata row first" ordering, the one readers use to pick a property's value
|
|
299
327
|
* from its rows across versions:
|
|
@@ -310,16 +338,161 @@ declare function ownedSeedsSql(ownedAddresses: any): import("drizzle-orm").SQL<u
|
|
|
310
338
|
* out; keep those in sync.
|
|
311
339
|
*/
|
|
312
340
|
declare const METADATA_LATEST_FIRST_ORDER_SQL: "(revoked_at IS NOT NULL), COALESCE(attestation_created_at, created_at) DESC, local_id DESC";
|
|
313
|
-
/** The row readers show for each property name (first by {@link compareMetadataRowsLatestFirst}). */
|
|
314
|
-
declare function pickLatestMetadataRowPerProperty(rows: any): any[];
|
|
315
341
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
342
|
+
* True when a version row's attestation was revoked (`versions.revoked_at` set). 0 counts as
|
|
343
|
+
* "not revoked", like `seeds.revoked_at`.
|
|
318
344
|
*/
|
|
319
|
-
declare
|
|
320
|
-
|
|
321
|
-
|
|
345
|
+
declare function isVersionRevoked(revokedAt: any): boolean;
|
|
346
|
+
/** How long a deferred op waits before the drainer tries it again. */
|
|
347
|
+
declare const OUTBOX_DEFER_MS: 50;
|
|
348
|
+
/**
|
|
349
|
+
* Whether an actor has been stopped (unload, destroy, or Schema eviction). Async work started by an
|
|
350
|
+
* entity (DB lookups, retry timers) must check this before sending, since a stopped actor ignores
|
|
351
|
+
* events and XState warns about every one of them.
|
|
352
|
+
*/
|
|
353
|
+
declare function isActorStopped(actor: any): boolean;
|
|
354
|
+
/**
|
|
355
|
+
* Default readyTimeout for create/find/all with waitForReady. Loads that touch OPFS and the DB can take
|
|
356
|
+
* several seconds on slow devices and CI runners; a load that is really stuck still errors.
|
|
357
|
+
*/
|
|
358
|
+
declare const DEFAULT_READY_TIMEOUT_MS: 15000;
|
|
359
|
+
/**
|
|
360
|
+
* Creates a reactive Proxy that intercepts property access and assignment
|
|
361
|
+
* to read from and write to an actor service's context.
|
|
362
|
+
*
|
|
363
|
+
* This enables automatic React re-renders when properties change, as the
|
|
364
|
+
* React hooks subscribe to the actor service which gets updated when properties
|
|
365
|
+
* are set via the proxy.
|
|
366
|
+
*
|
|
367
|
+
* @param config Configuration object
|
|
368
|
+
* @returns A proxied instance that behaves like the original but with reactive properties
|
|
369
|
+
*
|
|
370
|
+
* @note TypeScript's Proxy type doesn't automatically preserve method signatures,
|
|
371
|
+
* so we use Proxied<T> to ensure all methods and properties are recognized.
|
|
372
|
+
* The Proxy implementation preserves all methods via Reflect.get, so this is safe.
|
|
373
|
+
*/
|
|
374
|
+
declare function createReactiveProxy(config: any): any;
|
|
375
|
+
/**
|
|
376
|
+
* Common getters and utilities for entity classes
|
|
377
|
+
* These work with any entity that has a getService() method returning an XState actor
|
|
378
|
+
*/
|
|
379
|
+
/**
|
|
380
|
+
* Get the current state value from an entity's service
|
|
381
|
+
*/
|
|
382
|
+
/**
|
|
383
|
+
* Whether two references are the same entity: an instance and its reactive proxy are different
|
|
384
|
+
* objects that share one actor.
|
|
385
|
+
*/
|
|
386
|
+
declare function sameEntity(a: any, b: any): boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Generic find implementation for entities
|
|
389
|
+
*
|
|
390
|
+
* @param config - Find configuration with lookup methods
|
|
391
|
+
* @param params - Find parameters (id, name, or other entity-specific params)
|
|
392
|
+
* @param options - Find options (waitForReady, readyTimeout)
|
|
393
|
+
* @returns Entity instance if found, undefined otherwise
|
|
394
|
+
*/
|
|
395
|
+
declare function findEntity(config: any, params: any, options?: {}): Promise<any>;
|
|
396
|
+
/**
|
|
397
|
+
* Remove the instance from all given caches by key, without refCount (always delete).
|
|
398
|
+
* Works for both entry caches and index caches since the operation is only delete(key).
|
|
399
|
+
*/
|
|
400
|
+
declare function forceRemoveFromCaches(instance: any, config: any): void;
|
|
401
|
+
/**
|
|
402
|
+
* Run the service event sequence and stop the service:
|
|
403
|
+
* destroyStarted -> doDestroy -> (destroyError on failure) -> stop.
|
|
404
|
+
* A doDestroy failure is recorded on the service (destroyError) and rethrown, so destroy()
|
|
405
|
+
* rejects instead of resolving with the rows still in the DB.
|
|
406
|
+
* Event names must match what the entity machines expect.
|
|
407
|
+
*/
|
|
408
|
+
declare function runDestroyLifecycle(instance: any, config: any): Promise<void>;
|
|
409
|
+
/**
|
|
410
|
+
* A metadata row holds published content when it has a valid EAS attestation uid, or when sync
|
|
411
|
+
* derived it from one (ItemStorage rows from a storage_transaction_id attestation: no uid of their
|
|
412
|
+
* own, `derivedFromUid` set). Anything else is a local edit (or a row awaiting its uid backfill).
|
|
413
|
+
*/
|
|
414
|
+
declare function isPublishedMetadataRow(row: any): boolean;
|
|
415
|
+
declare var ClientManagerState: any;
|
|
416
|
+
declare var MachineIds: any;
|
|
322
417
|
declare const PUBLISH_NOT_CONFIGURED_MESSAGE: "Publishing is not configured. item.publish() needs @seedprotocol/publish: call initPublish() from it, or mount <PublishProvider config={...}>, before publishing.";
|
|
418
|
+
/**
|
|
419
|
+
* Writes a new item (ADR 0019): its seed, first version and a row per property go in one outbox op
|
|
420
|
+
* applied in one transaction, so a failure leaves nothing behind. ItemStorage initial values are
|
|
421
|
+
* staged first and moved into the item's files when the op applies.
|
|
422
|
+
*/
|
|
423
|
+
declare function createNewItem({ modelName, modelFileId, ...propertyData }: {
|
|
424
|
+
[x: string]: any;
|
|
425
|
+
modelName: any;
|
|
426
|
+
modelFileId: any;
|
|
427
|
+
}): Promise<{
|
|
428
|
+
modelName: any;
|
|
429
|
+
seedLocalId: string;
|
|
430
|
+
versionLocalId: any;
|
|
431
|
+
}>;
|
|
432
|
+
/**
|
|
433
|
+
* Appends one op and waits until it settles: its applier's result once applied, or `superseded`
|
|
434
|
+
* when a newer op of its property replaced it. Rejects with OutboxOpFailedError when it fails.
|
|
435
|
+
*/
|
|
436
|
+
declare function appendOutboxOpAndWait(input: any): Promise<{
|
|
437
|
+
superseded: boolean;
|
|
438
|
+
result?: undefined;
|
|
439
|
+
} | {
|
|
440
|
+
superseded: boolean;
|
|
441
|
+
result: any;
|
|
442
|
+
}>;
|
|
443
|
+
/**
|
|
444
|
+
* Metadata rows of a seed numbered per property_name in reader order (`rowNum = 1` is the value to
|
|
445
|
+
* show): live rows before revoked ones, then newest first. See `compareMetadataRowsLatestFirst`.
|
|
446
|
+
*/
|
|
447
|
+
declare function getMetadataLatest({ seedLocalId, seedUid }: {
|
|
448
|
+
seedLocalId: any;
|
|
449
|
+
seedUid: any;
|
|
450
|
+
}): any;
|
|
451
|
+
declare function getPublishExecutor(): any;
|
|
452
|
+
declare function getRevokeExecutor(): any;
|
|
453
|
+
/** @deprecated See UploadExecutor. */
|
|
454
|
+
declare function getUploadExecutor(): any;
|
|
455
|
+
/**
|
|
456
|
+
* Per-seed version aggregates plus the latest version row by (created_at DESC, local_id DESC) via
|
|
457
|
+
* max(created_at) then max(local_id) tie-break.
|
|
458
|
+
*
|
|
459
|
+
* Revoked versions (`revoked_at` set) are never the latest version and don't count toward
|
|
460
|
+
* `lastVersionPublishedAt`. `versionsCount` and `lastLocalUpdateAt` still cover every version row,
|
|
461
|
+
* so a fully unpublished seed (every version revoked) keeps its row here, with null
|
|
462
|
+
* `latestVersionUid` / `latestVersionLocalId` / `lastVersionPublishedAt`.
|
|
463
|
+
*
|
|
464
|
+
* For `publishedVersionUid` / `publishedVersionLocalId` on list rows, see `getItemsData`
|
|
465
|
+
* (batched resolution aligned with `getLatestPublishedVersionRow`).
|
|
466
|
+
*/
|
|
467
|
+
declare function getVersionData$1(): any;
|
|
468
|
+
/**
|
|
469
|
+
* Local draft that has never been attested: no publisher, no real uid, no attestationRaw.
|
|
470
|
+
*/
|
|
471
|
+
declare function isLocalUnsealedDraft(row: any): boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Shared ownership predicate.
|
|
474
|
+
* - A local unsealed draft (never given a publisher) is owned whatever the owned addresses are:
|
|
475
|
+
* it belongs to no wallet yet, and the next wallet to connect claims it (claimUnpublishedDrafts).
|
|
476
|
+
* - Any other row is owned when its publisher (or attester) is in the owned addresses.
|
|
477
|
+
*/
|
|
478
|
+
declare function isSeedRowOwned(row: any, ownedAddresses: any): boolean;
|
|
479
|
+
/** SQL form of {@link isLocalUnsealedDraft} on `seeds`. */
|
|
480
|
+
declare function localUnsealedDraftSql(): import("drizzle-orm").SQL<unknown> | undefined;
|
|
481
|
+
/**
|
|
482
|
+
* @deprecated Matches `seeds.publisher` only. Use {@link ownedSeedsSql}, which agrees
|
|
483
|
+
* with {@link isSeedRowOwned} (empty owned → local unsealed drafts; attester fallback).
|
|
484
|
+
*/
|
|
485
|
+
declare function ownedPublisherSql(ownedAddresses: any): import("drizzle-orm").SQL<any>;
|
|
486
|
+
/**
|
|
487
|
+
* SQL for `addressFilter: 'owned'`: a row passes exactly when {@link isSeedRowOwned} is true.
|
|
488
|
+
* - Local unsealed drafts always pass.
|
|
489
|
+
* - Otherwise `lower(trim(publisher))` is in the owned set, or, when publisher is blank, the
|
|
490
|
+
* `attestationRaw.attester` ({@link resolvePublisherFromSeedRow}). `json_valid` guards
|
|
491
|
+
* `json_extract`, which throws on malformed JSON.
|
|
492
|
+
*/
|
|
493
|
+
declare function ownedSeedsSql(ownedAddresses: any): import("drizzle-orm").SQL<unknown> | undefined;
|
|
494
|
+
/** The row readers show for each property name (first by {@link compareMetadataRowsLatestFirst}). */
|
|
495
|
+
declare function pickLatestMetadataRowPerProperty(rows: any): any[];
|
|
323
496
|
/** SQL form of {@link isPlaceholderUid}: null, `''`, `'NULL'`, or zero bytes32 (trimmed, any case). */
|
|
324
497
|
declare function placeholderUidSql(column: any): import("drizzle-orm").SQL<unknown> | undefined;
|
|
325
498
|
declare const propertyMachine: import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
@@ -406,27 +579,188 @@ declare function setRevokeExecutor(executor: any): void;
|
|
|
406
579
|
/** @deprecated See UploadExecutor. */
|
|
407
580
|
declare function setUploadExecutor(executor: any): void;
|
|
408
581
|
/**
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
582
|
+
* Per-instance state for an entity (liveQuery subscriptions and the like), keyed by the entity's
|
|
583
|
+
* actor. An entity's raw instance and its reactive proxy are different objects that share one
|
|
584
|
+
* actor. State set from the constructor (`this` = raw instance) must be found again from methods
|
|
585
|
+
* called on the proxy (`this` = proxy), so a WeakMap keyed by the instance misses there.
|
|
586
|
+
*
|
|
587
|
+
* `getService()` must return the actor before the first `set`.
|
|
412
588
|
*/
|
|
413
|
-
declare
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
589
|
+
declare class ActorKeyedState {
|
|
590
|
+
states: WeakMap<object, any>;
|
|
591
|
+
get(instance: any): any;
|
|
592
|
+
set(instance: any, state: any): this;
|
|
593
|
+
delete(instance: any): boolean;
|
|
594
|
+
has(instance: any): boolean;
|
|
595
|
+
}
|
|
419
596
|
/**
|
|
420
597
|
* Shared helpers for entity destroy operations.
|
|
421
598
|
* Used by Schema, Model, ModelProperty, Item, and ItemProperty destroy() methods.
|
|
422
599
|
*/
|
|
423
600
|
/**
|
|
424
|
-
* Unsubscribe
|
|
425
|
-
* Swallows errors so one failure doesn't block the rest.
|
|
601
|
+
* Unsubscribe the entity's liveQueries and any extra subscription (e.g. Item/ItemProperty
|
|
602
|
+
* _subscription), and drop its instance state. Swallows errors so one failure doesn't block the rest.
|
|
426
603
|
*/
|
|
427
604
|
declare function clearDestroySubscriptions(instance: any, config: any): void;
|
|
605
|
+
/**
|
|
606
|
+
* Release one reference to a cached entity instance. When none remain, remove it from the
|
|
607
|
+
* caches, clean up its subscriptions and stop its service
|
|
608
|
+
*
|
|
609
|
+
* @param instance - Entity instance to unload
|
|
610
|
+
* @param config - Unload configuration
|
|
611
|
+
*/
|
|
612
|
+
declare function unloadEntity(instance: any, config: any): void;
|
|
613
|
+
declare var ClientManagerEvents: any;
|
|
614
|
+
/** Resolve publisher from seed row: `publisher` column, else `attestationRaw.attester`. */
|
|
615
|
+
declare function resolvePublisherFromSeedRow(row: any): any;
|
|
616
|
+
/**
|
|
617
|
+
* The publisher a seed's version and property rows take: the seed's own (its `publisher`, else the
|
|
618
|
+
* attester of its stored attestation). Undefined for a draft that belongs to no wallet yet; those
|
|
619
|
+
* rows are then claimed together with their seed (claimUnpublishedDrafts).
|
|
620
|
+
*/
|
|
621
|
+
declare function getSeedPublisher(seedLocalId: any, db?: any): Promise<any>;
|
|
622
|
+
/** Html, Image, File and Relation rows are stored as `<name>Id`; match either spelling. */
|
|
623
|
+
declare function propertyNameVariants(name: any): any[];
|
|
624
|
+
declare function createSeed({ type, seedUid, modelFileId }: {
|
|
625
|
+
type: any;
|
|
626
|
+
seedUid: any;
|
|
627
|
+
modelFileId: any;
|
|
628
|
+
}, options?: {}): Promise<any>;
|
|
629
|
+
declare function createMetadata(metadataValues: any, propertyRecordSchema: any, options: any): Promise<any>;
|
|
630
|
+
declare function updateItemPropertyValue({ localId: localIdParam, propertyName, newValue, seedUid, seedLocalId, modelName, refSeedType, refResolvedValue, refResolvedDisplayValue, versionLocalId, versionUid, schemaUid, localStorageDir, dataType, refValueType, }: {
|
|
631
|
+
localId: any;
|
|
632
|
+
propertyName: any;
|
|
633
|
+
newValue: any;
|
|
634
|
+
seedUid: any;
|
|
635
|
+
seedLocalId: any;
|
|
636
|
+
modelName: any;
|
|
637
|
+
refSeedType: any;
|
|
638
|
+
refResolvedValue: any;
|
|
639
|
+
refResolvedDisplayValue: any;
|
|
640
|
+
versionLocalId: any;
|
|
641
|
+
versionUid: any;
|
|
642
|
+
schemaUid: any;
|
|
643
|
+
localStorageDir: any;
|
|
644
|
+
dataType: any;
|
|
645
|
+
refValueType: any;
|
|
646
|
+
}, options?: {}): Promise<{
|
|
647
|
+
localId: any;
|
|
648
|
+
uid: any;
|
|
649
|
+
schemaUid: any;
|
|
650
|
+
} | undefined>;
|
|
651
|
+
declare var getPropertyData$1: Readonly<{
|
|
652
|
+
__proto__: null;
|
|
653
|
+
getPropertyData: ({ propertyName, seedLocalId, seedUid, modelName, }: {
|
|
654
|
+
propertyName: any;
|
|
655
|
+
seedLocalId: any;
|
|
656
|
+
seedUid: any;
|
|
657
|
+
modelName: any;
|
|
658
|
+
}) => Promise<any>;
|
|
659
|
+
}>;
|
|
660
|
+
declare var Item$1: Readonly<{
|
|
661
|
+
__proto__: null;
|
|
662
|
+
Item: typeof Item;
|
|
663
|
+
}>;
|
|
664
|
+
/**
|
|
665
|
+
* Resolves once the op is applied, or superseded by a newer op that applied; rejects with
|
|
666
|
+
* OutboxOpFailedError when it, or the op that superseded it, failed.
|
|
667
|
+
*/
|
|
668
|
+
declare function waitForOutboxOp(opId: any): Promise<any>;
|
|
669
|
+
/** Appends one op; see appendOutboxOps. */
|
|
670
|
+
declare function appendOutboxOp(input: any): Promise<any>;
|
|
671
|
+
/** Attempts before a retryable error fails the op. */
|
|
672
|
+
declare const OUTBOX_MAX_ATTEMPTS: 8;
|
|
673
|
+
/** Applied and superseded ops are kept this long, then pruned. */
|
|
674
|
+
declare const OUTBOX_PRUNE_AFTER_MS: number;
|
|
675
|
+
/** Failed ops are kept longer, so a refused write can still be looked into. */
|
|
676
|
+
declare const OUTBOX_PRUNE_FAILED_AFTER_MS: number;
|
|
677
|
+
/** The status of each op, by id; ops not found are left out. */
|
|
678
|
+
declare function getOutboxOps(opIds: any): Promise<any>;
|
|
679
|
+
/** Waits before each retry of an op that failed with a retryable error; the last is reused. */
|
|
680
|
+
declare const OUTBOX_RETRY_DELAYS_MS: number[];
|
|
681
|
+
/**
|
|
682
|
+
* An op that can't apply yet for a reason that will pass without counting as a failure: an applier's
|
|
683
|
+
* `around` found a lock held. The drainer sets the op (and its property's queue) aside for
|
|
684
|
+
* OUTBOX_DEFER_MS and goes on with other ops; its attempts aren't counted.
|
|
685
|
+
*/
|
|
686
|
+
declare class OutboxOpDeferredError extends Error {
|
|
687
|
+
constructor(message: any);
|
|
688
|
+
}
|
|
689
|
+
/** Rejects `waitForOutboxOp` for an op that failed, or that a failed op superseded. */
|
|
690
|
+
declare class OutboxOpFailedError extends Error {
|
|
691
|
+
constructor(opId: any, message: any, errorName?: null);
|
|
692
|
+
opId: any;
|
|
693
|
+
errorName: any;
|
|
694
|
+
code: string;
|
|
695
|
+
}
|
|
696
|
+
/** An op that can never apply (a broken rule, an item the client doesn't own). Not retried. */
|
|
697
|
+
declare class OutboxOpRejectedError extends Error {
|
|
698
|
+
constructor(message: any, options: any);
|
|
699
|
+
}
|
|
700
|
+
/** A failure worth retrying (a file the browser had locked, say). Other errors fail the op at once. */
|
|
701
|
+
declare class OutboxOpRetryableError extends Error {
|
|
702
|
+
constructor(message: any, options: any);
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Appends one op, or several that apply together (they share a new group id unless they carry
|
|
706
|
+
* one), and tells the leader to drain. Returns the op ids in order.
|
|
707
|
+
*/
|
|
708
|
+
declare function appendOutboxOps(inputs: any): Promise<any>;
|
|
709
|
+
/**
|
|
710
|
+
* Applies every pending op that is due, in order. Exported for tests and for code that must see
|
|
711
|
+
* the outbox applied before it continues; normally the leader drains on its own.
|
|
712
|
+
*/
|
|
713
|
+
declare function drainOutbox(): Promise<void>;
|
|
714
|
+
/** What an applied op's applier returned, decoded. */
|
|
715
|
+
declare function outboxOpResult(op: any): any;
|
|
716
|
+
/**
|
|
717
|
+
* The value an item property will have once its pending `set` ops apply, in its stored string form.
|
|
718
|
+
* Undefined when its newest pending value op is not a `set`, or it has none.
|
|
719
|
+
*/
|
|
720
|
+
declare function getPendingSetValue(seedLocalId: any, propertyName: any): Promise<any>;
|
|
721
|
+
/** An op's stored value, decoded. */
|
|
722
|
+
declare function outboxOpValue(op: any): any;
|
|
723
|
+
/**
|
|
724
|
+
* Deletes settled ops older than their retention: applied and superseded ops after
|
|
725
|
+
* OUTBOX_PRUNE_AFTER_MS, failed ones after OUTBOX_PRUNE_FAILED_AFTER_MS. An applied op with an
|
|
726
|
+
* unresolved conflict stays until the conflict is resolved. Pending ops are never pruned. The
|
|
727
|
+
* leader runs it after a drain, at most hourly. Returns how many ops it deleted.
|
|
728
|
+
*/
|
|
729
|
+
declare function pruneOutbox(now?: number): Promise<any>;
|
|
730
|
+
/** Registers the applier for one op kind; returns a function that removes it. */
|
|
731
|
+
declare function registerOutboxApplier(kind: any, applier: any): () => void;
|
|
732
|
+
/**
|
|
733
|
+
* Starts draining in this tab once it is the leader, resuming ops left pending (a reload, a closed
|
|
734
|
+
* leader tab), and listens for other tabs' nudges and settled ops. Safe to call more than once.
|
|
735
|
+
*/
|
|
736
|
+
declare function startOutbox(): void;
|
|
737
|
+
/** Runs `write` once per chunk of `values`, one after another (deletes / updates with an `IN` list). */
|
|
738
|
+
declare function writeInBatches(values: any, write: any, size?: number): Promise<void>;
|
|
739
|
+
/**
|
|
740
|
+
* Assemble flat ItemData for Item / liveQuery / draft-head authoring.
|
|
741
|
+
*
|
|
742
|
+
* For **published chain JSON** (Seed → latest attested Version → properties),
|
|
743
|
+
* prefer `getPublishedSeedRecord` from `@seedprotocol/sdk` or
|
|
744
|
+
* `getSeed` / `queryBySchema` from `@seedprotocol/query`. This function remains
|
|
745
|
+
* the correct path for local-head / draft-wins property selection used by Item.
|
|
746
|
+
*/
|
|
747
|
+
declare function getItemData({ modelName, seedLocalId, seedUid, }: {
|
|
748
|
+
modelName: any;
|
|
749
|
+
seedLocalId: any;
|
|
750
|
+
seedUid: any;
|
|
751
|
+
}): Promise<any>;
|
|
752
|
+
/**
|
|
753
|
+
* Resolves once every op pending when it was called has settled (applied, superseded or failed),
|
|
754
|
+
* so a reader of `metadata` sees every edit made before. Publish waits on this before it reads.
|
|
755
|
+
*/
|
|
756
|
+
declare function waitForPendingOutboxOps(): Promise<void>;
|
|
428
757
|
declare class ItemProperty {
|
|
429
758
|
static create(props: any, options: any): any;
|
|
759
|
+
/**
|
|
760
|
+
* Wraps a new instance in its reactive proxy: tracked names read from and write to the actor's
|
|
761
|
+
* context, and assigning `value` also sends it to the actor before the setter runs.
|
|
762
|
+
*/
|
|
763
|
+
static wrapInProxy(instance: any): any;
|
|
430
764
|
/**
|
|
431
765
|
* The cached ItemProperty when it can be read right now (idle, not saving), the state
|
|
432
766
|
* `ItemProperty.find()` waits for. Otherwise undefined. Unlike `find`, it takes no cache hold, so
|
|
@@ -437,21 +771,39 @@ declare class ItemProperty {
|
|
|
437
771
|
seedLocalId: any;
|
|
438
772
|
seedUid: any;
|
|
439
773
|
}): any;
|
|
440
|
-
|
|
774
|
+
/** Takes a hold on the instance it returns: release it with `unload()`. */
|
|
775
|
+
static find({ propertyName, seedLocalId, seedUid, modelName: modelNameOption, waitForReady, readyTimeout, hold, }: {
|
|
441
776
|
propertyName: any;
|
|
442
777
|
seedLocalId: any;
|
|
443
778
|
seedUid: any;
|
|
444
779
|
modelName: any;
|
|
445
780
|
waitForReady?: boolean | undefined;
|
|
446
781
|
readyTimeout?: number | undefined;
|
|
782
|
+
hold: any;
|
|
447
783
|
}): Promise<any>;
|
|
448
784
|
/**
|
|
449
785
|
* Get all ItemProperty instances for an item.
|
|
450
786
|
* Loads property data via getItemProperties, creates instances via create, optionally waits for idle.
|
|
787
|
+
* Takes a hold on each instance, as `create` does.
|
|
451
788
|
*/
|
|
452
789
|
static all(params: any, options: any): Promise<any[]>;
|
|
790
|
+
/**
|
|
791
|
+
* @internal Takes one more hold on a cached, running instance, released with `unload()`. False
|
|
792
|
+
* (and no hold) when the instance isn't cached or was stopped.
|
|
793
|
+
*/
|
|
794
|
+
static retain(instance: any): boolean;
|
|
795
|
+
/**
|
|
796
|
+
* Stops an item's cached properties that nobody holds. Internal lookups cache a property without
|
|
797
|
+
* a hold for the item to take; one that finished after the item stopped (a liveQuery handler's
|
|
798
|
+
* find, say) never got that hold and would otherwise keep running. Called when the item stops.
|
|
799
|
+
*/
|
|
800
|
+
static unloadUnheldForItem(seedIds: any): void;
|
|
453
801
|
static cacheKey(seedLocalIdOrUid: any, propertyName: any): string;
|
|
454
|
-
/**
|
|
802
|
+
/**
|
|
803
|
+
* Drops an item's properties from the instance cache, under every key they're cached by. A dropped
|
|
804
|
+
* instance someone still holds keeps running but is detached: it doesn't re-key itself into the
|
|
805
|
+
* cache when its context changes, so the next lookup creates a fresh instance.
|
|
806
|
+
*/
|
|
455
807
|
static clearInstanceCacheForItem(seedLocalIdOrUid: any): void;
|
|
456
808
|
constructor(initialValues: any);
|
|
457
809
|
_isRelation: boolean;
|
|
@@ -659,21 +1011,46 @@ declare class ItemProperty {
|
|
|
659
1011
|
/** Validation errors from last failed save (enum, pattern, minLength, maxLength). Cleared when the next save starts. */
|
|
660
1012
|
get saveValidationErrors(): any;
|
|
661
1013
|
get alias(): any;
|
|
1014
|
+
/**
|
|
1015
|
+
* The unresolved conflict between this property's last local edit and a value sync wrote while
|
|
1016
|
+
* the edit was pending (ADR 0019): the local edit was kept, and `remoteValue` is what sync wrote.
|
|
1017
|
+
* Null when there is none. Cleared by the next edit or `resolveConflict`.
|
|
1018
|
+
*/
|
|
1019
|
+
get conflict(): any;
|
|
1020
|
+
/**
|
|
1021
|
+
* Settles `conflict`. `'local'` keeps the local edit. `'remote'` drops the local draft, so the
|
|
1022
|
+
* synced value shows again (and publish has nothing to send for this property).
|
|
1023
|
+
*/
|
|
1024
|
+
resolveConflict(choice: any): Promise<void>;
|
|
662
1025
|
set value(value: any);
|
|
663
1026
|
get value(): any;
|
|
664
1027
|
/**
|
|
665
1028
|
* Shows `value` at once and saves it; `await property.save()` to wait for the result. Unlike
|
|
666
1029
|
* assigning `property.value`, it saves even when `value` is already in context.
|
|
667
1030
|
*
|
|
668
|
-
* @param options.before - The values to restore if the save is refused or fails. Defaults to
|
|
669
|
-
*
|
|
670
|
-
* so a refusal still rolls back to what was there before.
|
|
1031
|
+
* @param options.before - The values to restore if the save is refused or fails. Defaults to what
|
|
1032
|
+
* showed before the first `showValue` since the last save, else the current context.
|
|
671
1033
|
*/
|
|
672
1034
|
setValue(value: any, options?: {}): void;
|
|
1035
|
+
_unsavedBefore: {
|
|
1036
|
+
propertyValue: any;
|
|
1037
|
+
renderValue: any;
|
|
1038
|
+
} | undefined;
|
|
673
1039
|
_pendingSchemaSave: Promise<boolean> | undefined;
|
|
1040
|
+
/**
|
|
1041
|
+
* Shows `value` without saving it, for input that saves later (a debounced text field). The next
|
|
1042
|
+
* `setValue` or assignment saves, and if that save is refused or fails, the property goes back to
|
|
1043
|
+
* what showed before the first `showValue`.
|
|
1044
|
+
*/
|
|
1045
|
+
showValue(value: any): void;
|
|
674
1046
|
get published(): boolean;
|
|
675
1047
|
subscribe(callback: any): import("xstate").Subscription;
|
|
676
1048
|
save(): Promise<void>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Every cache key holding this instance: its item's local id and seed uid, and the name it had
|
|
1051
|
+
* before a rename (List of relation). They share one entry.
|
|
1052
|
+
*/
|
|
1053
|
+
_cacheKeys(): any[];
|
|
677
1054
|
unload(): void;
|
|
678
1055
|
/**
|
|
679
1056
|
* Destroy the item property: remove from caches, delete its metadata rows (every version of
|
|
@@ -681,211 +1058,24 @@ declare class ItemProperty {
|
|
|
681
1058
|
* Throws OwnershipError if none of the client's addresses own the item.
|
|
682
1059
|
*/
|
|
683
1060
|
destroy(): Promise<void>;
|
|
1061
|
+
_destroyRows(context: any): Promise<void>;
|
|
684
1062
|
}
|
|
685
1063
|
declare namespace ItemProperty {
|
|
686
1064
|
let instanceCache_1: Map<any, any>;
|
|
687
1065
|
export { instanceCache_1 as instanceCache };
|
|
688
1066
|
}
|
|
689
|
-
declare var ClientManagerEvents: any;
|
|
690
|
-
/**
|
|
691
|
-
* Runs `fn` with a fresh read of metadata row `localId`, holding the lock of the file that row's
|
|
692
|
-
* content goes to. `fileOf` names that file (absolute path) for a row, or returns undefined when
|
|
693
|
-
* there is nothing to write (then `fn` isn't called and the result is undefined).
|
|
694
|
-
*
|
|
695
|
-
* The file depends on the row, so the row is read once to pick the lock and again once it is held;
|
|
696
|
-
* if the row now points at another file (another writer changed it meanwhile), the lock is
|
|
697
|
-
* released and taken again for that file.
|
|
698
|
-
*/
|
|
699
|
-
declare function withLockedItemStorageRow(localId: any, fileOf: any, fn: any): Promise<any>;
|
|
700
|
-
/** Absolute path of the file {@link writeItemStorageFile} writes for `target`. */
|
|
701
|
-
declare function getItemStorageFilePath(target: any): string;
|
|
702
|
-
/**
|
|
703
|
-
* Write an ItemStorage property's content to its local file, where saveItemStorage, reads, publish
|
|
704
|
-
* (resolveItemStorageChildFile) and download all look for it. Returns what the metadata row records:
|
|
705
|
-
* `refResolvedValue` (the file name) and `localStorageDir` (with a leading slash).
|
|
706
|
-
*
|
|
707
|
-
* Callers that also update the file's metadata row hold {@link withItemStorageFileLock} around
|
|
708
|
-
* both, so another writer of the same file can't land in between.
|
|
709
|
-
*/
|
|
710
|
-
declare function writeItemStorageFile(target: any, content: any): Promise<{
|
|
711
|
-
fileName: any;
|
|
712
|
-
filePath: string;
|
|
713
|
-
localStorageDir: any;
|
|
714
|
-
}>;
|
|
715
|
-
/** Resolve publisher from seed row: `publisher` column, else `attestationRaw.attester`. */
|
|
716
|
-
declare function resolvePublisherFromSeedRow(row: any): any;
|
|
717
|
-
declare var getPropertyData$1: Readonly<{
|
|
718
|
-
__proto__: null;
|
|
719
|
-
getPropertyData: ({ propertyName, seedLocalId, seedUid, modelName, }: {
|
|
720
|
-
propertyName: any;
|
|
721
|
-
seedLocalId: any;
|
|
722
|
-
seedUid: any;
|
|
723
|
-
modelName: any;
|
|
724
|
-
}) => Promise<any>;
|
|
725
|
-
}>;
|
|
726
|
-
declare var Item$1: Readonly<{
|
|
727
|
-
__proto__: null;
|
|
728
|
-
Item: typeof Item;
|
|
729
|
-
}>;
|
|
730
1067
|
/** Thrown by ItemProperty.save() when the value failed validation (enum, pattern, minLength, maxLength). */
|
|
731
1068
|
declare class ItemPropertySaveValidationError extends Error {
|
|
732
1069
|
constructor(message: any, validationErrors: any);
|
|
733
1070
|
validationErrors: any;
|
|
734
1071
|
}
|
|
735
1072
|
/**
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*/
|
|
739
|
-
declare function assertItemOwned(item: any): Promise<void>;
|
|
740
|
-
/**
|
|
741
|
-
* Wait for an entity's state machine to reach 'idle' state
|
|
742
|
-
* @param entity - Entity instance with getService() method
|
|
743
|
-
* @param options - Configuration options
|
|
744
|
-
* @returns Promise that resolves when entity reaches idle, or rejects on error/timeout
|
|
745
|
-
*/
|
|
746
|
-
declare function waitForEntityIdle(entity: any, options?: {}): Promise<void>;
|
|
747
|
-
/** Sort comparator: live before revoked; then larger time first; on tie, larger localId (lexicographic) first. */
|
|
748
|
-
declare function compareMetadataRowsLatestFirst(a: any, b: any): number;
|
|
749
|
-
/**
|
|
750
|
-
* EAS schema UID of a model's seeds: the in-memory cache, then `model_uids` (written from EAS by
|
|
751
|
-
* startup and sync), then EAS itself. The DB comes before EAS so creating items and saving
|
|
752
|
-
* images, files and Html bodies works offline. A failed EAS request (offline) counts as "no UID":
|
|
753
|
-
* the seed is created without one and publish looks it up again.
|
|
754
|
-
*/
|
|
755
|
-
declare function getEasSchemaUidForModel(modelName: any): Promise<any>;
|
|
756
|
-
/**
|
|
757
|
-
* Assemble flat ItemData for Item / liveQuery / draft-head authoring.
|
|
758
|
-
*
|
|
759
|
-
* For **published chain JSON** (Seed → latest attested Version → properties),
|
|
760
|
-
* prefer `getPublishedSeedRecord` from `@seedprotocol/sdk` or
|
|
761
|
-
* `getSeed` / `queryBySchema` from `@seedprotocol/query`. This function remains
|
|
762
|
-
* the correct path for local-head / draft-wins property selection used by Item.
|
|
763
|
-
*/
|
|
764
|
-
declare function getItemData({ modelName, seedLocalId, seedUid, }: {
|
|
765
|
-
modelName: any;
|
|
766
|
-
seedLocalId: any;
|
|
767
|
-
seedUid: any;
|
|
768
|
-
}): Promise<any>;
|
|
769
|
-
/**
|
|
770
|
-
* Latest version row for the seed (by createdAt) whose uid is a real EAS attestation id.
|
|
771
|
-
* Skips legacy 'NULL' / ZERO_BYTES32 placeholders, non-bytes32 strings, and revoked versions
|
|
772
|
-
* (`revoked_at` set): after a full unpublish the seed has no published version.
|
|
773
|
-
*/
|
|
774
|
-
declare function getLatestPublishedVersionRow(seedLocalId: any): Promise<{
|
|
775
|
-
uid: any;
|
|
776
|
-
localId: any;
|
|
777
|
-
attestationCreatedAt: any;
|
|
778
|
-
} | null>;
|
|
779
|
-
/**
|
|
780
|
-
* Checks if the current user owns the item: its publisher is in the persisted owned addresses,
|
|
781
|
-
* or it's a local unsealed draft (no publisher, no real uid, no attestationRaw). Such a draft
|
|
782
|
-
* was made with no wallet connected and is editable until `claimUnpublishedDrafts`, which
|
|
783
|
-
* connecting a wallet calls, gives it that wallet as publisher.
|
|
784
|
-
*
|
|
785
|
-
* Does not include `getAdditionalSyncAddresses` (those are extra EAS indexers,
|
|
786
|
-
* not wallets the user controls).
|
|
787
|
-
*/
|
|
788
|
-
declare function isItemOwned(item: any): Promise<boolean>;
|
|
789
|
-
/** Splits `values` into chunks of at most `size` (one empty list gives no chunks). */
|
|
790
|
-
declare function chunkValues(values: any, size?: number): any[];
|
|
791
|
-
declare function getGetAdditionalSyncAddresses(): any;
|
|
792
|
-
/**
|
|
793
|
-
* True when a version row's attestation was revoked (`versions.revoked_at` set). 0 counts as
|
|
794
|
-
* "not revoked", like `seeds.revoked_at`.
|
|
795
|
-
*/
|
|
796
|
-
declare function isVersionRevoked(revokedAt: any): boolean;
|
|
797
|
-
/**
|
|
798
|
-
* Creates a reactive Proxy that intercepts property access and assignment
|
|
799
|
-
* to read from and write to an actor service's context.
|
|
800
|
-
*
|
|
801
|
-
* This enables automatic React re-renders when properties change, as the
|
|
802
|
-
* React hooks subscribe to the actor service which gets updated when properties
|
|
803
|
-
* are set via the proxy.
|
|
804
|
-
*
|
|
805
|
-
* @param config Configuration object
|
|
806
|
-
* @returns A proxied instance that behaves like the original but with reactive properties
|
|
807
|
-
*
|
|
808
|
-
* @note TypeScript's Proxy type doesn't automatically preserve method signatures,
|
|
809
|
-
* so we use Proxied<T> to ensure all methods and properties are recognized.
|
|
810
|
-
* The Proxy implementation preserves all methods via Reflect.get, so this is safe.
|
|
811
|
-
*/
|
|
812
|
-
declare function createReactiveProxy(config: any): any;
|
|
813
|
-
/**
|
|
814
|
-
* Generic find implementation for entities
|
|
815
|
-
*
|
|
816
|
-
* @param config - Find configuration with lookup methods
|
|
817
|
-
* @param params - Find parameters (id, name, or other entity-specific params)
|
|
818
|
-
* @param options - Find options (waitForReady, readyTimeout)
|
|
819
|
-
* @returns Entity instance if found, undefined otherwise
|
|
820
|
-
*/
|
|
821
|
-
declare function findEntity(config: any, params: any, options?: {}): Promise<any>;
|
|
822
|
-
/**
|
|
823
|
-
* Remove the instance from all given caches by key, without refCount (always delete).
|
|
824
|
-
* Works for both entry caches and index caches since the operation is only delete(key).
|
|
825
|
-
*/
|
|
826
|
-
declare function forceRemoveFromCaches(instance: any, config: any): void;
|
|
827
|
-
/**
|
|
828
|
-
* Parse List property values persisted as strings (JSON array or legacy comma-separated ids).
|
|
829
|
-
*/
|
|
830
|
-
declare function parseListPropertyValueFromStorage(raw: any): any;
|
|
831
|
-
/**
|
|
832
|
-
* Run the service event sequence and stop the service:
|
|
833
|
-
* destroyStarted -> doDestroy -> (destroyError on failure) -> stop.
|
|
834
|
-
* A doDestroy failure is recorded on the service (destroyError) and rethrown, so destroy()
|
|
835
|
-
* rejects instead of resolving with the rows still in the DB.
|
|
836
|
-
* Event names must match what the entity machines expect.
|
|
837
|
-
*/
|
|
838
|
-
declare function runDestroyLifecycle(instance: any, config: any): Promise<void>;
|
|
839
|
-
/**
|
|
840
|
-
* Rows per multi-row INSERT into `table` so the statement binds at most
|
|
841
|
-
* {@link SQLITE_DEFAULT_MAX_VARIABLE_NUMBER} parameters even with every column set.
|
|
842
|
-
*/
|
|
843
|
-
declare function rowsPerInsert(table: any): number;
|
|
844
|
-
/**
|
|
845
|
-
* Runs `query` once per chunk of `values` (see {@link chunkValues}), one after another, and
|
|
846
|
-
* concatenates the rows. Use it for `inArray(column, values)` reads whose list can be large.
|
|
847
|
-
*/
|
|
848
|
-
declare function selectInBatches(values: any, query: any, size?: number): Promise<any[]>;
|
|
849
|
-
/**
|
|
850
|
-
* A metadata row holds published content when it has a valid EAS attestation uid, or when sync
|
|
851
|
-
* derived it from one (ItemStorage rows from a storage_transaction_id attestation: no uid of their
|
|
852
|
-
* own, `derivedFromUid` set). Anything else is a local edit (or a row awaiting its uid backfill).
|
|
853
|
-
*/
|
|
854
|
-
declare function isPublishedMetadataRow(row: any): boolean;
|
|
855
|
-
declare var MachineIds: any;
|
|
856
|
-
declare function createNewItem({ modelName, modelFileId, ...propertyData }: {
|
|
857
|
-
[x: string]: any;
|
|
858
|
-
modelName: any;
|
|
859
|
-
modelFileId: any;
|
|
860
|
-
}): Promise<{
|
|
861
|
-
modelName: any;
|
|
862
|
-
seedLocalId: any;
|
|
863
|
-
versionLocalId: string;
|
|
864
|
-
}>;
|
|
865
|
-
/** Runs `write` once per chunk of `values`, one after another (deletes / updates with an `IN` list). */
|
|
866
|
-
declare function writeInBatches(values: any, write: any, size?: number): Promise<void>;
|
|
867
|
-
declare function getEasSchemaForItemProperty({ schemaUid, propertyName, easDataType, }: {
|
|
868
|
-
schemaUid: any;
|
|
869
|
-
propertyName: any;
|
|
870
|
-
easDataType: any;
|
|
871
|
-
}): Promise<{
|
|
872
|
-
__typename?: "Schema";
|
|
873
|
-
id: string;
|
|
874
|
-
schema: string;
|
|
875
|
-
schemaNames: Array<{
|
|
876
|
-
__typename?: "SchemaName";
|
|
877
|
-
name: string;
|
|
878
|
-
}>;
|
|
879
|
-
} | undefined>;
|
|
880
|
-
declare function getGetPublisherForNewSeeds(): any;
|
|
881
|
-
/**
|
|
882
|
-
* Metadata rows of a seed numbered per property_name in reader order (`rowNum = 1` is the value to
|
|
883
|
-
* show): live rows before revoked ones, then newest first. See `compareMetadataRowsLatestFirst`.
|
|
1073
|
+
* Thrown by write operations (save, destroy, publish, unpublish) on an item none
|
|
1074
|
+
* of the client's addresses own. See isItemOwned for what counts as owned.
|
|
884
1075
|
*/
|
|
885
|
-
declare
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
}): any;
|
|
1076
|
+
declare class OwnershipError extends Error {
|
|
1077
|
+
constructor(message?: string);
|
|
1078
|
+
}
|
|
889
1079
|
import { BehaviorSubject } from 'rxjs';
|
|
890
|
-
export {
|
|
891
|
-
//# sourceMappingURL=Item-
|
|
1080
|
+
export { getGetPublisherForNewSeeds as $, assertItemOwned as A, isItemOwned as B, waitForEntityIdle as C, compareMetadataRowsLatestFirst as D, getEasSchemaUidForModel as E, getLatestPublishedVersionRow as F, parseListPropertyValueFromStorage as G, chunkValues as H, Item as I, rowsPerInsert as J, getGetAdditionalSyncAddresses as K, selectInBatches as L, METADATA_LATEST_FIRST_ORDER_SQL as M, isVersionRevoked as N, OUTBOX_DEFER_MS as O, isActorStopped as P, DEFAULT_READY_TIMEOUT_MS as Q, createReactiveProxy as R, sameEntity as S, findEntity as T, forceRemoveFromCaches as U, runDestroyLifecycle as V, isPublishedMetadataRow as W, ClientManagerState as X, MachineIds as Y, PUBLISH_NOT_CONFIGURED_MESSAGE as Z, createNewItem as _, appendOutboxOpAndWait as a, getMetadataLatest as a0, getPublishExecutor as a1, getRevokeExecutor as a2, getUploadExecutor as a3, getVersionData$1 as a4, isLocalUnsealedDraft as a5, isSeedRowOwned as a6, localUnsealedDraftSql as a7, ownedPublisherSql as a8, ownedSeedsSql as a9, pickLatestMetadataRowPerProperty as aa, placeholderUidSql as ab, propertyMachine as ac, publisherInAddressListSql as ad, publisherIsInOwnedSet as ae, setAdditionalSyncAddresses as af, setGetPublisherForNewSeeds as ag, setPublishExecutor as ah, setRevokeExecutor as ai, setUploadExecutor as aj, ActorKeyedState as ak, clearDestroySubscriptions as al, unloadEntity as am, ClientManagerEvents as an, resolvePublisherFromSeedRow as ao, getSeedPublisher as ap, propertyNameVariants as aq, createSeed as ar, createMetadata as as, updateItemPropertyValue as at, getPropertyData$1 as au, Item$1 as av, waitForOutboxOp as b, appendOutboxOp as c, OUTBOX_MAX_ATTEMPTS as d, OUTBOX_PRUNE_AFTER_MS as e, OUTBOX_PRUNE_FAILED_AFTER_MS as f, getOutboxOps as g, OUTBOX_RETRY_DELAYS_MS as h, OutboxOpDeferredError as i, OutboxOpFailedError as j, OutboxOpRejectedError as k, OutboxOpRetryableError as l, appendOutboxOps as m, drainOutbox as n, outboxOpResult as o, getPendingSetValue as p, outboxOpValue as q, pruneOutbox as r, registerOutboxApplier as s, startOutbox as t, writeInBatches as u, getItemData as v, waitForPendingOutboxOps as w, ItemProperty as x, ItemPropertySaveValidationError as y, OwnershipError as z };
|
|
1081
|
+
//# sourceMappingURL=Item-DZfNz7xl.d.ts.map
|