@seedprotocol/sdk 0.7.9-next.1177.ga3e08ed → 0.7.9-next.1306.g4ff6582
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/BaseFileManager-BAlySv8w.js +650 -0
- package/dist/BaseFileManager-BAlySv8w.js.map +1 -0
- package/dist/{Item-0oDoTPhi.js → Item-Bf4kWKpH.js} +5647 -6573
- package/dist/Item-Bf4kWKpH.js.map +1 -0
- package/dist/{ModelProperty-i5flwzQG.js → ModelProperty-BlaEgb_U.js} +345 -709
- package/dist/ModelProperty-BlaEgb_U.js.map +1 -0
- package/dist/Schema-J_1f6p0c.js +1456 -0
- package/dist/Schema-J_1f6p0c.js.map +1 -0
- package/dist/{SchemaValidationService-DnGKel4V.js → SchemaValidationService-CnmKyzR-.js} +6 -9
- package/dist/{SchemaValidationService-DnGKel4V.js.map → SchemaValidationService-CnmKyzR-.js.map} +1 -1
- package/dist/{configurePlatform-CrMafpMW.js → configurePlatform-CiOJ1R3q.js} +3 -12
- package/dist/configurePlatform-CiOJ1R3q.js.map +1 -0
- package/dist/db/drizzle/0025_add_metadata_retract.sql +1 -0
- package/dist/db/drizzle/0026_add_content_hash_to_schemas.sql +1 -0
- package/dist/db/drizzle/0027_link_metadata_property_ids.sql +74 -0
- package/dist/db/drizzle/0028_add_definition_to_properties.sql +17 -0
- package/dist/db/drizzle/0029_dedupe_chain_uids_add_unique_indexes.sql +120 -0
- package/dist/db/drizzle/meta/0025_snapshot.json +1652 -0
- package/dist/db/drizzle/meta/0026_snapshot.json +1659 -0
- package/dist/db/drizzle/meta/0027_snapshot.json +1659 -0
- package/dist/db/drizzle/meta/0028_snapshot.json +1666 -0
- package/dist/db/drizzle/meta/0029_snapshot.json +1691 -0
- package/dist/db/drizzle/meta/_journal.json +36 -1
- package/dist/{detachRowsBeforeDelete-DXFYSHRR.js → detachRowsBeforeDelete-sEaUwlOU.js} +2 -13
- package/dist/{detachRowsBeforeDelete-DXFYSHRR.js.map → detachRowsBeforeDelete-sEaUwlOU.js.map} +1 -1
- package/dist/dist/{index-Dx_GTdyQ.d.ts → BaseFileManager-BAlySv8w.d.ts} +1424 -2696
- package/dist/dist/BaseFileManager-BAlySv8w.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-CrMafpMW.d.ts → configurePlatform-CiOJ1R3q.d.ts} +1 -1
- package/dist/dist/configurePlatform-CiOJ1R3q.d.ts.map +1 -0
- package/dist/dist/{index-PbnKw2es.d.ts → index-D0V-mjCV.d.ts} +56 -1
- package/dist/dist/{index-PbnKw2es.d.ts.map → index-D0V-mjCV.d.ts.map} +1 -1
- package/dist/dist/{index.node-CzMwMr_d.d.ts → index.node-CYPemH-t.d.ts} +225 -5
- package/dist/dist/{index.node-CzMwMr_d.d.ts.map → index.node-CYPemH-t.d.ts.map} +1 -1
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/eas-wB_fQ8Tc.js +32 -0
- package/dist/eas-wB_fQ8Tc.js.map +1 -0
- package/dist/errors-DLSoqSHG.js +6550 -0
- package/dist/errors-DLSoqSHG.js.map +1 -0
- package/dist/getPublishPayload-BnIwpwz1.js +760 -0
- package/dist/getPublishPayload-BnIwpwz1.js.map +1 -0
- package/dist/getPublishPendingDiff-D6_-A5ns.js +125 -0
- package/dist/getPublishPendingDiff-D6_-A5ns.js.map +1 -0
- package/dist/getPublishUploads-sS6JfPgz.js +783 -0
- package/dist/getPublishUploads-sS6JfPgz.js.map +1 -0
- package/dist/{index-DJmWkVIK.js → index-BVBmz_cc.js} +11 -14
- package/dist/index-BVBmz_cc.js.map +1 -0
- package/dist/index-CYGWPoOx.js +27 -0
- package/dist/index-CYGWPoOx.js.map +1 -0
- package/dist/{index-PbnKw2es.js → index-D0V-mjCV.js} +2 -2
- package/dist/index-D0V-mjCV.js.map +1 -0
- package/dist/index-DmTtj1nk.js +817 -0
- package/dist/index-DmTtj1nk.js.map +1 -0
- package/dist/{index.browser-i9uPJice.js → index.browser-CUmBVYen.js} +436 -379
- package/dist/index.browser-CUmBVYen.js.map +1 -0
- package/dist/{index.node-CzMwMr_d.js → index.node-CYPemH-t.js} +10 -10
- package/dist/index.node-CYPemH-t.js.map +1 -0
- package/dist/main.js +23 -1105
- package/dist/main.js.map +1 -1
- package/dist/modelPropertyRecordSchemas-C7UgA5TH.js +48 -0
- package/dist/modelPropertyRecordSchemas-C7UgA5TH.js.map +1 -0
- package/dist/node.js +14 -18
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +8 -13
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +6 -16
- package/dist/platform.node.js.map +1 -1
- package/dist/property-BxUYznH0.js +87 -0
- package/dist/property-BxUYznH0.js.map +1 -0
- package/dist/publishGraph-EcB40Uii.js +311 -0
- package/dist/publishGraph-EcB40Uii.js.map +1 -0
- package/dist/readHtmlBodyForStorageSeed-D6KPtWoR.js +110 -0
- package/dist/readHtmlBodyForStorageSeed-D6KPtWoR.js.map +1 -0
- package/dist/seedSchema/MetadataSchema.ts +3 -0
- package/dist/seedSchema/ModelSchema.ts +4 -0
- package/dist/seedSchema/ModelSchemaSchema.ts +5 -2
- package/dist/seedSchema/PendingWriteSchema.ts +4 -1
- package/dist/seedSchema/SchemaSchema.ts +3 -0
- package/dist/seedSchema/SeedSchema.ts +8 -2
- package/dist/seedSchema/VersionSchema.ts +7 -2
- package/dist/seedSchema/attestedUid.ts +10 -0
- package/dist/src/Item/Item.d.ts +32 -30
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/loadItem.d.ts +12 -0
- package/dist/src/Item/loadItem.d.ts.map +1 -0
- package/dist/src/Item/service/itemMachineSingle.d.ts +2 -13
- package/dist/src/Item/service/itemMachineSingle.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +98 -41
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/loadProperty.d.ts +11 -0
- package/dist/src/ItemProperty/loadProperty.d.ts.map +1 -0
- package/dist/src/ItemProperty/propertyWrite.d.ts +54 -0
- package/dist/src/ItemProperty/propertyWrite.d.ts.map +1 -0
- package/dist/src/ItemProperty/{service/actors/saveValueToDb/rowContext.d.ts → rowContext.d.ts} +1 -1
- package/dist/src/ItemProperty/rowContext.d.ts.map +1 -0
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts +6 -0
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/modelPropertyRecordSchemas.d.ts +5 -15
- package/dist/src/ItemProperty/service/actors/modelPropertyRecordSchemas.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +3 -46
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +26 -56
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/createModelProperties.d.ts +10 -0
- package/dist/src/Model/createModelProperties.d.ts.map +1 -0
- package/dist/src/Model/loadModel.d.ts +13 -0
- package/dist/src/Model/loadModel.d.ts.map +1 -0
- package/dist/src/Model/service/actors/validateModel.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +5 -114
- package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +44 -37
- 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/ModelProperty/service/modelPropertyMachine.d.ts +6 -77
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts +36 -37
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/Schema/loadOrCreateSchema.d.ts +21 -0
- package/dist/src/Schema/loadOrCreateSchema.d.ts.map +1 -0
- package/dist/src/Schema/service/schemaMachine.d.ts +7 -125
- package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/changeFeed.d.ts +2 -18
- package/dist/src/browser/db/changeFeed.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +7 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/browser/workers/imageResize.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +90 -57
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/addModelsToDb.d.ts +9 -7
- package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
- package/dist/src/client/actors/dbInit.d.ts +3 -3
- package/dist/src/client/actors/dbInit.d.ts.map +1 -1
- package/dist/src/client/actors/fileSystemInit.d.ts +3 -3
- package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +10 -5
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts +18 -3
- package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts +6 -3
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +22 -20
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/constants.d.ts +1 -9
- package/dist/src/client/constants.d.ts.map +1 -1
- package/dist/src/client/readiness.d.ts +26 -0
- package/dist/src/client/readiness.d.ts.map +1 -0
- package/dist/src/db/read/currentPropertyRow.d.ts +61 -0
- package/dist/src/db/read/currentPropertyRow.d.ts.map +1 -0
- package/dist/src/db/read/findSeedRow.d.ts +20 -0
- package/dist/src/db/read/findSeedRow.d.ts.map +1 -0
- package/dist/src/db/read/findSeedRowsByUid.d.ts +4 -1
- package/dist/src/db/read/findSeedRowsByUid.d.ts.map +1 -1
- package/dist/src/db/read/getAttesterForSeed.d.ts +1 -1
- package/dist/src/db/read/getAttesterForSeed.d.ts.map +1 -1
- package/dist/src/db/read/getItemData.d.ts.map +1 -1
- package/dist/src/db/read/getItemProperties.d.ts +5 -0
- package/dist/src/db/read/getItemProperties.d.ts.map +1 -1
- package/dist/src/db/read/getMetadataAttestationUidsForSeedUid.d.ts.map +1 -1
- package/dist/src/db/read/getModelSchemas.d.ts +0 -7
- package/dist/src/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/src/db/read/getModelsData.d.ts.map +1 -1
- package/dist/src/db/read/getPropertyClear.d.ts +49 -0
- package/dist/src/db/read/getPropertyClear.d.ts.map +1 -0
- package/dist/src/db/read/getPublishPayload.d.ts +35 -40
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPendingDiff.d.ts +7 -2
- package/dist/src/db/read/getPublishPendingDiff.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts +59 -28
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getSchemaUidForModel.d.ts.map +1 -1
- package/dist/src/db/read/getSeedPublishState.d.ts.map +1 -1
- package/dist/src/db/read/getSeedPublisher.d.ts.map +1 -1
- package/dist/src/db/read/getVersionsForSeedUid.d.ts.map +1 -1
- package/dist/src/db/read/isSeedRevoked.d.ts.map +1 -1
- package/dist/src/db/read/localModelSchemaLookups.d.ts +8 -0
- package/dist/src/db/read/localModelSchemaLookups.d.ts.map +1 -0
- package/dist/src/db/read/metadataProperty.d.ts +104 -0
- package/dist/src/db/read/metadataProperty.d.ts.map +1 -0
- package/dist/src/db/read/publishGraph.d.ts +148 -0
- package/dist/src/db/read/publishGraph.d.ts.map +1 -0
- package/dist/src/db/read/resolveModelRecord.d.ts +26 -2
- package/dist/src/db/read/resolveModelRecord.d.ts.map +1 -1
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts +1 -7
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts.map +1 -1
- package/dist/src/db/read/subqueries/metadataLatest.d.ts +3 -1
- package/dist/src/db/read/subqueries/metadataLatest.d.ts.map +1 -1
- package/dist/src/db/read/summarizePublishWork.d.ts +18 -5
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +20 -21
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/createNewItem.d.ts.map +1 -1
- package/dist/src/db/write/createSeeds.d.ts +5 -1
- package/dist/src/db/write/createSeeds.d.ts.map +1 -1
- package/dist/src/db/write/definitions.d.ts +127 -0
- package/dist/src/db/write/definitions.d.ts.map +1 -0
- package/dist/src/db/write/markPropertyAttestationsRetracted.d.ts +11 -0
- package/dist/src/db/write/markPropertyAttestationsRetracted.d.ts.map +1 -0
- package/dist/src/db/write/mergeChainRows.d.ts +22 -0
- package/dist/src/db/write/mergeChainRows.d.ts.map +1 -0
- package/dist/src/db/write/saveDefinition.d.ts +29 -0
- package/dist/src/db/write/saveDefinition.d.ts.map +1 -0
- package/dist/src/db/write/updateItemPropertyValue.d.ts +2 -0
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/db/write/updateSeedUid.d.ts +4 -2
- package/dist/src/db/write/updateSeedUid.d.ts.map +1 -1
- package/dist/src/db/write/updateVersionUid.d.ts +12 -4
- package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
- package/dist/src/db/write/writeModelUids.d.ts +10 -0
- package/dist/src/db/write/writeModelUids.d.ts.map +1 -0
- package/dist/src/eas.d.ts +8 -6
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/arweaveContentTags.d.ts +1 -1
- package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -1
- package/dist/src/helpers/compareMetadataRowsLatestFirst.d.ts +27 -12
- package/dist/src/helpers/compareMetadataRowsLatestFirst.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +5 -2
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/dataUrl.d.ts +10 -0
- package/dist/src/helpers/dataUrl.d.ts.map +1 -0
- package/dist/src/helpers/db.d.ts +54 -105
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/ensureImageLocal.d.ts.map +1 -1
- package/dist/src/helpers/entity/contextUpdate.d.ts +20 -0
- package/dist/src/helpers/entity/contextUpdate.d.ts.map +1 -0
- package/dist/src/helpers/entity/draftSaveErrors.d.ts +5 -0
- package/dist/src/helpers/entity/draftSaveErrors.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityCache.d.ts +65 -3
- package/dist/src/helpers/entity/entityCache.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityCommon.d.ts +0 -22
- package/dist/src/helpers/entity/entityCommon.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityLifecycle.d.ts +75 -0
- package/dist/src/helpers/entity/entityLifecycle.d.ts.map +1 -0
- package/dist/src/helpers/entity/entityLiveQuery.d.ts +1 -23
- package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +4 -9
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +2 -24
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/localImageBlobUrl.d.ts +7 -0
- package/dist/src/helpers/localImageBlobUrl.d.ts.map +1 -0
- package/dist/src/helpers/mediaRef.d.ts +3 -70
- package/dist/src/helpers/mediaRef.d.ts.map +1 -1
- package/dist/src/helpers/metadataPropertyNames.d.ts +34 -21
- package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
- package/dist/src/helpers/mimeTypes.d.ts +2 -1
- package/dist/src/helpers/mimeTypes.d.ts.map +1 -1
- package/dist/src/helpers/model.d.ts.map +1 -1
- package/dist/src/helpers/ownership.d.ts.map +1 -1
- package/dist/src/helpers/property.d.ts +21 -26
- package/dist/src/helpers/property.d.ts.map +1 -1
- package/dist/src/helpers/propertyDefinition.d.ts +59 -0
- package/dist/src/helpers/propertyDefinition.d.ts.map +1 -0
- package/dist/src/helpers/readHtmlBodyForStorageSeed.d.ts.map +1 -1
- package/dist/src/helpers/relationSeedRef.d.ts +0 -7
- package/dist/src/helpers/relationSeedRef.d.ts.map +1 -1
- package/dist/src/helpers/schema.d.ts +24 -38
- package/dist/src/helpers/schema.d.ts.map +1 -1
- package/dist/src/helpers/schemaApply.d.ts +135 -0
- package/dist/src/helpers/schemaApply.d.ts.map +1 -0
- package/dist/src/helpers/tabEvents.d.ts.map +1 -1
- package/dist/src/helpers/updateSchema.d.ts +2 -18
- package/dist/src/helpers/updateSchema.d.ts.map +1 -1
- package/dist/src/imports/index.d.ts +1 -1
- package/dist/src/imports/index.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts +8 -78
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +16 -14
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IItem.d.ts +5 -0
- package/dist/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/src/interfaces/IItemProperty.d.ts +13 -7
- package/dist/src/interfaces/IItemProperty.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +3 -2
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/outbox/conflicts.d.ts +2 -0
- package/dist/src/outbox/conflicts.d.ts.map +1 -1
- package/dist/src/outbox/itemAppliers.d.ts +70 -14
- package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
- package/dist/src/outbox/outbox.d.ts +14 -3
- package/dist/src/outbox/outbox.d.ts.map +1 -1
- package/dist/src/outbox/pendingValues.d.ts +3 -1
- package/dist/src/outbox/pendingValues.d.ts.map +1 -1
- package/dist/src/outbox/storageValueRow.d.ts +7 -0
- package/dist/src/outbox/storageValueRow.d.ts.map +1 -0
- package/dist/src/platform/configurePlatform.d.ts.map +1 -1
- package/dist/src/platform/index.browser.d.ts.map +1 -1
- package/dist/src/platform/index.node.d.ts.map +1 -1
- package/dist/src/seedSchema/MetadataSchema.d.ts +17 -0
- package/dist/src/seedSchema/MetadataSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/ModelSchema.d.ts +19 -0
- package/dist/src/seedSchema/ModelSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/ModelSchemaSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/SchemaSchema.d.ts +19 -0
- package/dist/src/seedSchema/SchemaSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/SeedSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/VersionSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/attestedUid.d.ts +9 -0
- package/dist/src/seedSchema/attestedUid.d.ts.map +1 -0
- package/dist/src/storageValue/content.d.ts +45 -0
- package/dist/src/storageValue/content.d.ts.map +1 -0
- package/dist/src/storageValue/findFile.d.ts +7 -0
- package/dist/src/storageValue/findFile.d.ts.map +1 -0
- package/dist/src/storageValue/resolve.d.ts +71 -0
- package/dist/src/storageValue/resolve.d.ts.map +1 -0
- package/dist/src/storageValue/save.d.ts +24 -0
- package/dist/src/storageValue/save.d.ts.map +1 -0
- package/dist/src/storageValue/stage.d.ts +22 -0
- package/dist/src/storageValue/stage.d.ts.map +1 -0
- package/dist/src/types/db.d.ts +0 -14
- package/dist/src/types/db.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +3 -3
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/machines.d.ts +1 -1
- package/dist/src/types/machines.d.ts.map +1 -1
- package/dist/src/types/property.d.ts +9 -16
- package/dist/src/types/property.d.ts.map +1 -1
- package/dist/src/types/publish.d.ts +1 -1
- package/dist/src/types/publish.d.ts.map +1 -1
- package/dist/{syncDbWithEas-DUu_wjUG.js → syncDbWithEas-CA7PvBgu.js} +142 -168
- package/dist/syncDbWithEas-CA7PvBgu.js.map +1 -0
- package/dist/tabEvents-CaVmngqr.js +3804 -0
- package/dist/tabEvents-CaVmngqr.js.map +1 -0
- package/dist/{tolerantWebAccess-DecKDGen.js → tolerantWebAccess-BJqViq08.js} +10 -15
- package/dist/{tolerantWebAccess-DecKDGen.js.map → tolerantWebAccess-BJqViq08.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-4gO9Hfn2.js → updateSeedRevokedAt-BL9Bg-G7.js} +30 -4
- package/dist/updateSeedRevokedAt-BL9Bg-G7.js.map +1 -0
- package/package.json +6 -6
- package/dist/ClientManager-GZfXErDX.js +0 -5279
- package/dist/ClientManager-GZfXErDX.js.map +0 -1
- package/dist/Item-0oDoTPhi.js.map +0 -1
- package/dist/ModelProperty-i5flwzQG.js.map +0 -1
- package/dist/Schema-PFZwG9Nl.js +0 -4370
- package/dist/Schema-PFZwG9Nl.js.map +0 -1
- package/dist/backfillMetadataPropertyIds-BbxgavEQ.js +0 -72
- package/dist/backfillMetadataPropertyIds-BbxgavEQ.js.map +0 -1
- package/dist/changeFeed-DKdVlUmt.js +0 -726
- package/dist/changeFeed-DKdVlUmt.js.map +0 -1
- package/dist/configurePlatform-CrMafpMW.js.map +0 -1
- package/dist/dist/ClientManager-GZfXErDX.d.ts +0 -952
- package/dist/dist/ClientManager-GZfXErDX.d.ts.map +0 -1
- package/dist/dist/Item-0oDoTPhi.d.ts +0 -1076
- package/dist/dist/Item-0oDoTPhi.d.ts.map +0 -1
- package/dist/dist/ModelProperty-i5flwzQG.d.ts +0 -315
- package/dist/dist/ModelProperty-i5flwzQG.d.ts.map +0 -1
- package/dist/dist/Schema-PFZwG9Nl.d.ts +0 -432
- package/dist/dist/Schema-PFZwG9Nl.d.ts.map +0 -1
- package/dist/dist/SchemaValidationService-DnGKel4V.d.ts +0 -118
- package/dist/dist/SchemaValidationService-DnGKel4V.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts +0 -7
- package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts.map +0 -1
- package/dist/dist/changeFeed-DKdVlUmt.d.ts +0 -160
- package/dist/dist/changeFeed-DKdVlUmt.d.ts.map +0 -1
- package/dist/dist/configurePlatform-CrMafpMW.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts +0 -13
- package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts.map +0 -1
- package/dist/dist/eas-dyepi5jz.d.ts +0 -12
- package/dist/dist/eas-dyepi5jz.d.ts.map +0 -1
- package/dist/dist/errors-C1qUEZ7A.d.ts +0 -25
- package/dist/dist/errors-C1qUEZ7A.d.ts.map +0 -1
- package/dist/dist/errors-D1zHAqjr.d.ts +0 -515
- package/dist/dist/errors-D1zHAqjr.d.ts.map +0 -1
- package/dist/dist/eventBus-7vxTCc3a.d.ts +0 -18
- package/dist/dist/eventBus-7vxTCc3a.d.ts.map +0 -1
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts +0 -13
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts.map +0 -1
- package/dist/dist/getItem-Bhjecbia.d.ts +0 -6
- package/dist/dist/getItem-Bhjecbia.d.ts.map +0 -1
- package/dist/dist/getPublishPayload-DH4rMqXG.d.ts +0 -47
- package/dist/dist/getPublishPayload-DH4rMqXG.d.ts.map +0 -1
- package/dist/dist/getPublishUploads-BzUIDA2G.d.ts +0 -89
- package/dist/dist/getPublishUploads-BzUIDA2G.d.ts.map +0 -1
- package/dist/dist/index-CkYb3wcU.d.ts +0 -14
- package/dist/dist/index-CkYb3wcU.d.ts.map +0 -1
- package/dist/dist/index-DJmWkVIK.d.ts +0 -6
- package/dist/dist/index-DJmWkVIK.d.ts.map +0 -1
- package/dist/dist/index-Dx_GTdyQ.d.ts.map +0 -1
- package/dist/dist/index.browser-i9uPJice.d.ts +0 -9908
- package/dist/dist/index.browser-i9uPJice.d.ts.map +0 -1
- package/dist/dist/mimeTypes-C9r76DCH.d.ts +0 -30
- package/dist/dist/mimeTypes-C9r76DCH.d.ts.map +0 -1
- package/dist/dist/model-oHA3YhOd.d.ts +0 -6
- package/dist/dist/model-oHA3YhOd.d.ts.map +0 -1
- package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts +0 -7
- package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts.map +0 -1
- package/dist/dist/platform.browser.d.ts +0 -3
- package/dist/dist/platform.browser.d.ts.map +0 -1
- package/dist/dist/property-BwYtg5Q_.d.ts +0 -37
- package/dist/dist/property-BwYtg5Q_.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts +0 -13
- package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts.map +0 -1
- package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts +0 -93
- package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts +0 -21
- package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts +0 -13
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts.map +0 -1
- package/dist/dist/tolerantWebAccess-DecKDGen.d.ts +0 -113
- package/dist/dist/tolerantWebAccess-DecKDGen.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts +0 -11
- package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts.map +0 -1
- package/dist/eas-dyepi5jz.js +0 -67
- package/dist/eas-dyepi5jz.js.map +0 -1
- package/dist/errors-D1zHAqjr.js +0 -4006
- package/dist/errors-D1zHAqjr.js.map +0 -1
- package/dist/eventBus-7vxTCc3a.js +0 -64
- package/dist/eventBus-7vxTCc3a.js.map +0 -1
- package/dist/findSeedRowsByUid-CT3sOXXw.js +0 -47
- package/dist/findSeedRowsByUid-CT3sOXXw.js.map +0 -1
- package/dist/getItem-Bhjecbia.js +0 -45
- package/dist/getItem-Bhjecbia.js.map +0 -1
- package/dist/getPublishPayload-DH4rMqXG.js +0 -1634
- package/dist/getPublishPayload-DH4rMqXG.js.map +0 -1
- package/dist/getPublishUploads-BzUIDA2G.js +0 -1080
- package/dist/getPublishUploads-BzUIDA2G.js.map +0 -1
- package/dist/index-CkYb3wcU.js +0 -29
- package/dist/index-CkYb3wcU.js.map +0 -1
- package/dist/index-DJmWkVIK.js.map +0 -1
- package/dist/index-Dx_GTdyQ.js +0 -4745
- package/dist/index-Dx_GTdyQ.js.map +0 -1
- package/dist/index-PbnKw2es.js.map +0 -1
- package/dist/index.browser-i9uPJice.js.map +0 -1
- package/dist/index.node-CzMwMr_d.js.map +0 -1
- package/dist/mimeTypes-C9r76DCH.js +0 -209
- package/dist/mimeTypes-C9r76DCH.js.map +0 -1
- package/dist/model-oHA3YhOd.js +0 -29
- package/dist/model-oHA3YhOd.js.map +0 -1
- package/dist/modelPropertyRecordSchemas-C5lW9aA-.js +0 -94
- package/dist/modelPropertyRecordSchemas-C5lW9aA-.js.map +0 -1
- package/dist/property-BwYtg5Q_.js +0 -289
- package/dist/property-BwYtg5Q_.js.map +0 -1
- package/dist/propertyValidationRules-CyHdpcPP.js +0 -73
- package/dist/propertyValidationRules-CyHdpcPP.js.map +0 -1
- package/dist/publishDraftGraph-C5F6b7GK.js +0 -505
- package/dist/publishDraftGraph-C5F6b7GK.js.map +0 -1
- package/dist/resolveModelForSyncedSeed-4gO9Hfn2.js.map +0 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts +0 -5
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +0 -1
- package/dist/src/Item/service/actors/waitForDb.d.ts +0 -4
- package/dist/src/Item/service/actors/waitForDb.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts +0 -5
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts +0 -5
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/index.d.ts +0 -6
- package/dist/src/ItemProperty/service/actors/saveValueToDb/index.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/rowContext.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts +0 -24
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts +0 -5
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts +0 -5
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts +0 -10
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/storageValue.d.ts +0 -22
- package/dist/src/ItemProperty/service/actors/saveValueToDb/storageValue.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/waitForDb.d.ts +0 -4
- package/dist/src/ItemProperty/service/actors/waitForDb.d.ts.map +0 -1
- package/dist/src/Model/service/actors/createModelProperties.d.ts +0 -9
- package/dist/src/Model/service/actors/createModelProperties.d.ts.map +0 -1
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts +0 -5
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts +0 -5
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/createModelInstances.d.ts +0 -11
- package/dist/src/Schema/service/actors/createModelInstances.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/createPropertyInstances.d.ts +0 -12
- package/dist/src/Schema/service/actors/createPropertyInstances.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/validateSchema.d.ts +0 -5
- package/dist/src/Schema/service/actors/validateSchema.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/verifyModelInstancesInCache.d.ts +0 -6
- package/dist/src/Schema/service/actors/verifyModelInstancesInCache.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/verifyModelsInDb.d.ts +0 -7
- package/dist/src/Schema/service/actors/verifyModelsInDb.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/verifyPropertiesInDb.d.ts +0 -8
- package/dist/src/Schema/service/actors/verifyPropertiesInDb.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/verifyPropertyInstancesInCache.d.ts +0 -6
- package/dist/src/Schema/service/actors/verifyPropertyInstancesInCache.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/verifySchemaInDb.d.ts +0 -7
- package/dist/src/Schema/service/actors/verifySchemaInDb.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts +0 -9
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/writePropertiesToDb.d.ts +0 -10
- package/dist/src/Schema/service/actors/writePropertiesToDb.d.ts.map +0 -1
- package/dist/src/Schema/service/actors/writeSchemaToDb.d.ts +0 -11
- package/dist/src/Schema/service/actors/writeSchemaToDb.d.ts.map +0 -1
- package/dist/src/browser/helpers/ArweaveClient.d.ts +0 -14
- package/dist/src/browser/helpers/ArweaveClient.d.ts.map +0 -1
- package/dist/src/browser/helpers/EasClient.d.ts +0 -10
- package/dist/src/browser/helpers/EasClient.d.ts.map +0 -1
- package/dist/src/browser/helpers/QueryClient.d.ts +0 -9
- package/dist/src/browser/helpers/QueryClient.d.ts.map +0 -1
- package/dist/src/client/actors/addModelsToStore.d.ts +0 -4
- package/dist/src/client/actors/addModelsToStore.d.ts.map +0 -1
- package/dist/src/db/backfillMetadataPropertyIds.d.ts +0 -7
- package/dist/src/db/backfillMetadataPropertyIds.d.ts.map +0 -1
- package/dist/src/db/read/getItem.d.ts +0 -3
- package/dist/src/db/read/getItem.d.ts.map +0 -1
- package/dist/src/db/read/getPropertyData.d.ts +0 -4
- package/dist/src/db/read/getPropertyData.d.ts.map +0 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts +0 -10
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +0 -1
- package/dist/src/db/read/getSeedData.d.ts +0 -12
- package/dist/src/db/read/getSeedData.d.ts.map +0 -1
- package/dist/src/db/read/itemLoads.d.ts +0 -20
- package/dist/src/db/read/itemLoads.d.ts.map +0 -1
- package/dist/src/db/read/publishDraftGraph.d.ts +0 -64
- package/dist/src/db/read/publishDraftGraph.d.ts.map +0 -1
- package/dist/src/db/write/linkModelToSchema.d.ts +0 -12
- package/dist/src/db/write/linkModelToSchema.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts +0 -2
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts +0 -2
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts +0 -2
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +0 -2
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts.map +0 -1
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts +0 -2
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts.map +0 -1
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts +0 -2
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts.map +0 -1
- package/dist/src/helpers/easUid.d.ts +0 -2
- package/dist/src/helpers/easUid.d.ts.map +0 -1
- package/dist/src/helpers/entity/entityDestroy.d.ts +0 -49
- package/dist/src/helpers/entity/entityDestroy.d.ts.map +0 -1
- package/dist/src/helpers/entity/entityFind.d.ts +0 -52
- package/dist/src/helpers/entity/entityFind.d.ts.map +0 -1
- package/dist/src/helpers/entity/entityState.d.ts +0 -28
- package/dist/src/helpers/entity/entityState.d.ts.map +0 -1
- package/dist/src/helpers/entity/entityUnload.d.ts +0 -56
- package/dist/src/helpers/entity/entityUnload.d.ts.map +0 -1
- package/dist/src/helpers/entity/evictionEpoch.d.ts +0 -43
- package/dist/src/helpers/entity/evictionEpoch.d.ts.map +0 -1
- package/dist/src/helpers/entity/index.d.ts +0 -12
- package/dist/src/helpers/entity/index.d.ts.map +0 -1
- package/dist/src/helpers/gateway/gatewayState.d.ts +0 -2
- package/dist/src/helpers/gateway/gatewayState.d.ts.map +0 -1
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts +0 -2
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts.map +0 -1
- package/dist/src/helpers/gateway/seedGatewayConfig.d.ts +0 -2
- package/dist/src/helpers/gateway/seedGatewayConfig.d.ts.map +0 -1
- package/dist/src/helpers/getSchemaForItemProperty.d.ts +0 -15
- package/dist/src/helpers/getSchemaForItemProperty.d.ts.map +0 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts +0 -10
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +0 -1
- package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts +0 -7
- package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts.map +0 -1
- package/dist/src/helpers/propertyValidationRules.d.ts +0 -20
- package/dist/src/helpers/propertyValidationRules.d.ts.map +0 -1
- package/dist/src/helpers/propertyWriteTickets.d.ts +0 -11
- package/dist/src/helpers/propertyWriteTickets.d.ts.map +0 -1
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +0 -10
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +0 -1
- package/dist/src/helpers/waitForEntityIdle.d.ts +0 -21
- package/dist/src/helpers/waitForEntityIdle.d.ts.map +0 -1
- package/dist/src/interfaces/IQueryClient.d.ts +0 -15
- package/dist/src/interfaces/IQueryClient.d.ts.map +0 -1
- package/dist/src/node/helpers/ArweaveClient.d.ts +0 -5
- package/dist/src/node/helpers/ArweaveClient.d.ts.map +0 -1
- package/dist/src/node/helpers/EasClient.d.ts +0 -5
- package/dist/src/node/helpers/EasClient.d.ts.map +0 -1
- package/dist/src/node/helpers/QueryClient.d.ts +0 -5
- package/dist/src/node/helpers/QueryClient.d.ts.map +0 -1
- package/dist/src/services/write/actors/validateEntity.d.ts +0 -6
- package/dist/src/services/write/actors/validateEntity.d.ts.map +0 -1
- package/dist/src/services/write/actors/writeToDatabase.d.ts +0 -14
- package/dist/src/services/write/actors/writeToDatabase.d.ts.map +0 -1
- package/dist/src/services/write/writeProcessMachine.d.ts +0 -56
- package/dist/src/services/write/writeProcessMachine.d.ts.map +0 -1
- package/dist/src/stores/eas.d.ts +0 -2
- package/dist/src/stores/eas.d.ts.map +0 -1
- package/dist/src/types/arweave.d.ts +0 -57
- package/dist/src/types/arweave.d.ts.map +0 -1
- package/dist/src/types/gateway.d.ts +0 -2
- package/dist/src/types/gateway.d.ts.map +0 -1
- package/dist/syncDbWithEas-DUu_wjUG.js.map +0 -1
- package/dist/updateSeedRevokedAt-CP606vKs.js +0 -31
- package/dist/updateSeedRevokedAt-CP606vKs.js.map +0 -1
|
@@ -2,34 +2,29 @@ import { constants, Inode, vfs } from '@zenfs/core';
|
|
|
2
2
|
import { join, dirname } from '@zenfs/core/path';
|
|
3
3
|
import { WebAccess, WebAccessFS } from '@zenfs/dom';
|
|
4
4
|
import debug from 'debug';
|
|
5
|
-
import { i as isSkippableOpfsEntryError } from './index.browser-
|
|
6
|
-
import './
|
|
7
|
-
import './
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
import '@seedprotocol/eas';
|
|
5
|
+
import { i as isSkippableOpfsEntryError } from './index.browser-CUmBVYen.js';
|
|
6
|
+
import './tabEvents-CaVmngqr.js';
|
|
7
|
+
import './BaseFileManager-BAlySv8w.js';
|
|
8
|
+
import 'drizzle-orm/sqlite-core';
|
|
9
|
+
import 'drizzle-orm';
|
|
11
10
|
import 'xstate';
|
|
11
|
+
import '@seedprotocol/eas';
|
|
12
12
|
import 'pluralize';
|
|
13
13
|
import '@sinclair/typebox';
|
|
14
|
-
import '
|
|
15
|
-
import 'drizzle-orm';
|
|
14
|
+
import '@seedprotocol/arweave';
|
|
16
15
|
import 'nanoid';
|
|
17
16
|
import 'nanoid-dictionary';
|
|
18
17
|
import '@noble/hashes/sha256';
|
|
19
18
|
import '@noble/hashes/sha3';
|
|
20
19
|
import '@noble/hashes/utils';
|
|
21
20
|
import 'lodash-es';
|
|
22
|
-
import './mimeTypes-C9r76DCH.js';
|
|
23
21
|
import './errors-C1qUEZ7A.js';
|
|
24
22
|
import 'drizzle-orm/sqlite-proxy';
|
|
25
|
-
import './index-
|
|
23
|
+
import './index-D0V-mjCV.js';
|
|
26
24
|
import 'sqlocal/drizzle';
|
|
27
25
|
import './minimumUpgradeVersion-BDhHvHtr.js';
|
|
28
26
|
import 'rxjs';
|
|
29
|
-
import '
|
|
30
|
-
import 'arweave';
|
|
31
|
-
import '@tanstack/query-core';
|
|
32
|
-
import './configurePlatform-CrMafpMW.js';
|
|
27
|
+
import './configurePlatform-CiOJ1R3q.js';
|
|
33
28
|
|
|
34
29
|
const logger = debug('seedSdk:browser:helpers:tolerantWebAccess');
|
|
35
30
|
/**
|
|
@@ -548,4 +543,4 @@ const TolerantWebAccess = {
|
|
|
548
543
|
};
|
|
549
544
|
|
|
550
545
|
export { TolerantWebAccess, TolerantWebAccessFS };
|
|
551
|
-
//# sourceMappingURL=tolerantWebAccess-
|
|
546
|
+
//# sourceMappingURL=tolerantWebAccess-BJqViq08.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tolerantWebAccess-DecKDGen.js","sources":["../../src/browser/helpers/tolerantWebAccess.ts"],"sourcesContent":["import { constants, Inode, vfs } from '@zenfs/core'\nimport type { CreationOptions, InodeLike } from '@zenfs/core'\nimport { dirname, join } from '@zenfs/core/path'\nimport { WebAccess, WebAccessFS } from '@zenfs/dom'\nimport type { WebAccessOptions } from '@zenfs/dom'\nimport debug from 'debug'\nimport { isSkippableOpfsEntryError } from './opfsErrors'\n\nconst logger = debug('seedSdk:browser:helpers:tolerantWebAccess')\n\n/** A truncate made through this mount that OPFS doesn't have yet. Compared by identity. */\ntype PendingTruncate = { readonly length: number }\n\n/** An OPFS file as this mount last saw it. */\ntype OpfsVersion = { size: number; lastModified: number }\n\n/**\n * WebAccessFS mounts by walking all of OPFS and reading every file's size, and one unreadable\n * entry fails the whole mount. This variant skips such entries instead. A skipped file is still\n * listed by readdir, and WebAccessFS.stat() indexes it lazily on first use, once it is readable.\n *\n * It also makes overwrites with shorter content shrink the file (see `write` and `touch`), without\n * cutting off bytes another context (a tab, a worker writing through a SyncAccessHandle) added to a\n * file this mount had indexed at a smaller size: OPFS only shrinks for a truncate made through this\n * mount, and stat() re-reads a file's size when OPFS changed since this mount last looked.\n *\n * Overrides @zenfs/dom 1.2.9 / @zenfs/core 2.5.6 internals (`_loadHandles`, `_loadMetadata`,\n * `crossCopy`, `stat`, `write`, `touch`, `remove`, `get`, `_handles`, `_sync`, `_isInitialized`,\n * `index`, and `vfs.Handle#truncate`/`truncateSync`, see `trackTruncates`); both packages are pinned\n * to exact versions, and tolerantWebAccess.test.ts / opfsOverwrite.test.ts cover the coupling.\n */\nexport class TolerantWebAccessFS extends WebAccessFS {\n /**\n * Truncates made through this mount that OPFS doesn't have yet, by path. ZenFS truncates by\n * lowering the inode's size and syncing it later, so only these may shrink the OPFS file: an\n * inode that is merely smaller than the file is a stale view of a file someone else grew.\n */\n private readonly _truncates = new Map<string, PendingTruncate>()\n\n /** Each OPFS file as this mount last saw it, to notice writes made elsewhere. */\n private readonly _seen = new Map<string, OpfsVersion>()\n\n /**\n * Called with each file path whose OPFS contents this mount changed (a write, a truncate, a\n * removal; a rename is both), once the change is in OPFS. BrowserFileManager uses it to tell other\n * tabs. Not called for what invalidate(), stat() or crossCopy() put in the in-memory copy: those\n * only read OPFS.\n */\n onOpfsChange?: (path: string) => void\n\n constructor(root: FileSystemDirectoryHandle, disableHandleCache?: boolean) {\n super(root, disableHandleCache)\n // Reads would otherwise mark the file dirty (atime) and end in touch() for every read. Without\n // atime, touch() only follows writes, truncates, chmod and utimes.\n this.attributes.set('no_atime')\n }\n\n /**\n * Called by vfs.Handle#truncate(Sync) for files on this mount (see `trackTruncates`). Returns an\n * undo for a truncate the handle then rejects.\n */\n _noteTruncate(path: string, length: number): () => void {\n const previous = this._truncates.get(path)\n // Truncated twice before a write: the bytes past the shorter length are gone either way.\n this._truncates.set(path, { length: Math.min(length, previous?.length ?? length) })\n return () => {\n if (previous) this._truncates.set(path, previous)\n else this._truncates.delete(path)\n }\n }\n\n /**\n * The sync API's in-memory copy (a StoreFS) truncates by setting the size alone and keeps the old\n * bytes, which a later write past that size then exposes in place of zeros. Cut them off there\n * too. Called by vfs.Handle#truncate(Sync) once the truncate went through.\n */\n _truncateCache(path: string, length: number): void {\n try {\n const cached = this._sync.statSync(path)\n if ((cached.mode & constants.S_IFMT) != constants.S_IFREG) return\n // Even when the size already matches: a sync handle's truncate() has synced it by now.\n const data = new Uint8Array(length) // Past the old size (truncate to extend): zeros.\n const kept = Math.min(length, cached.size)\n if (kept) this._sync.readSync(path, data.subarray(0, kept), 0, kept)\n this._sync.unlinkSync(path)\n this._sync.createFileSync(path, cached as unknown as CreationOptions)\n if (length) this._sync.writeSync(path, data, 0)\n cached.size = length\n this._sync.touchSync(path, cached)\n } catch (error) {\n logger(`could not truncate the cached copy of ${path}: ${(error as Error).name}`)\n }\n }\n\n private _takeTruncate(path: string, pending: PendingTruncate | undefined): void {\n // A truncate recorded while this write or sync was under way is left for the next one.\n if (pending && this._truncates.get(path) === pending) this._truncates.delete(path)\n }\n\n private _changed(path: string): void {\n try {\n this.onOpfsChange?.(path)\n } catch (error) {\n logger(`change listener failed for ${path}`, error)\n }\n }\n\n private _remember(path: string, file: File): void {\n this._seen.set(path, { size: file.size, lastModified: file.lastModified })\n }\n\n /** Another context changed the file: the next stat() refreshes the sync API's in-memory copy. */\n private _markChangedElsewhere(path: string): void {\n this._seen.set(path, { size: -1, lastModified: -1 })\n }\n\n /**\n * The index holds each file's size from when this mount last looked, and another context may\n * have written the file since. Re-read it from OPFS, so opening a file (an append goes to its\n * size) and reading it see the true file, and refresh the in-memory copy behind the sync API when\n * the file changed. Costs one getFile() per stat of a regular file; contents are only read when\n * the file changed.\n */\n async stat(path: string): Promise<Inode> {\n const inode = (await super.stat(path)) as Inode\n if ((inode.mode & constants.S_IFMT) != constants.S_IFREG) return inode\n // While mounting, sizes were just read and crossCopy stats every file.\n if (!(this as unknown as AsyncState)._isInitialized) return inode\n // This mount truncated the file and OPFS doesn't have it yet: the inode's size is the truth.\n if (this._truncates.has(path)) return inode\n\n let file: File\n try {\n file = await ((await this.get('file', path)) as FileSystemFileHandle).getFile()\n } catch {\n return inode // Gone or busy: keep what the index knows.\n }\n const seen = this._seen.get(path)\n if (seen && seen.size == file.size && seen.lastModified == file.lastModified) return inode\n this._remember(path, file)\n // First look at a file this mount just indexed (WebAccessFS.stat, invalidate): nothing to fix.\n if (!seen && inode.size == file.size) return inode\n logger(`${path} changed outside this mount (${inode.size} -> ${file.size} bytes)`)\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this.index.set(path, inode)\n await this._recache(path, inode, file)\n return inode\n }\n\n /** Replaces the sync API's in-memory copy of `path` with `file`, if it holds one. */\n private async _recache(path: string, inode: Inode, file: File): Promise<void> {\n try {\n this._sync.statSync(path)\n } catch {\n return // Not cached: async reads go to OPFS, and invalidate() handles the rest.\n }\n try {\n const data = new Uint8Array(await file.arrayBuffer())\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Already gone.\n }\n this._sync.createFileSync(path, inode as unknown as CreationOptions)\n this._sync.writeSync(path, data, 0)\n this._sync.touchSync(path, inode)\n } catch (error) {\n logger(`not caching ${path}: ${(error as Error).name}`)\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Nothing was copied.\n }\n }\n }\n\n /**\n * WebAccessFS.write opens the file with `keepExistingData` and never truncates, so a whole-file\n * overwrite with shorter content (open 'w', then a write at 0) kept the old tail on disk. Here a\n * truncate this mount made since the file was last written (open 'w', ftruncate) is applied in\n * the same writable as the data: the file is cut to that length first (a write past it leaves\n * zeros in the gap, as POSIX does). Without one, the data goes over the file OPFS has, whatever\n * size this mount last saw: appends and writes at an offset never cut off bytes another context\n * wrote.\n */\n async write(path: string, buffer: Uint8Array, offset: number): Promise<void> {\n const pending = this._truncates.get(path)\n const inode = this.index.get(path)\n let handle: FileSystemFileHandle | undefined\n if (inode && (inode.mode & constants.S_IFMT) == constants.S_IFREG) {\n try {\n handle = (await this.get('file', path)) as FileSystemFileHandle\n } catch {\n // Not in OPFS yet: WebAccessFS.write creates it, and a new file has no old tail.\n }\n }\n if (!inode || !handle) {\n await super.write(path, buffer, offset)\n this._takeTruncate(path, pending)\n if (inode) this._seen.set(path, { size: inode.size, lastModified: inode.mtimeMs })\n // WebAccessFS.write also creates directories; only files are worth telling other tabs about.\n if (inode && (inode.mode & constants.S_IFMT) == constants.S_IFREG) this._changed(path)\n return\n }\n\n const data = copyIfShared(buffer)\n const end = offset + data.byteLength\n // Truncated to no more than this write covers: start from an empty file instead of a copy.\n const wholeFile = pending !== undefined && offset == 0 && pending.length <= data.byteLength\n const writable = await handle.createWritable({ keepExistingData: !wholeFile })\n try {\n if (pending && !wholeFile) await writable.truncate(pending.length)\n await writable.write({ type: 'write', position: offset, data })\n await writable.close()\n } catch (error) {\n await writable.abort().catch(() => {})\n throw error\n }\n this._takeTruncate(path, pending)\n\n const file = await handle.getFile()\n const seen = this._seen.get(path)\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this.index.set(path, inode)\n this._remember(path, file)\n // Larger than this mount's writes explain: another context grew it. The sync API's copy is\n // refreshed by the next stat(), not here, where queued sync writes may not have landed yet.\n const expected = pending ? Math.max(pending.length, end) : Math.max(seen?.size ?? 0, end)\n if (seen && seen.size >= 0 && file.size != expected) this._markChangedElsewhere(path)\n this._changed(path)\n }\n\n /**\n * ZenFS truncates by setting the inode's size and syncing it with touch() (FileHandle.truncate\n * with no write after it). Make OPFS follow when this mount truncated the file. Any other touch\n * (chmod, utimes, the size after writes) leaves the OPFS file alone: a smaller size there is a\n * stale view, and the index takes the file's real size back.\n */\n async touch(path: string, metadata: InodeLike): Promise<void> {\n const pending = this._truncates.get(path)\n await super.touch(path, metadata)\n const inode = this.index.get(path)\n if (!inode || (inode.mode & constants.S_IFMT) != constants.S_IFREG) return\n let handle: FileSystemFileHandle\n try {\n handle = (await this.get('file', path)) as FileSystemFileHandle\n } catch {\n return // Not in OPFS (yet): nothing to shrink, and a queued write creates it.\n }\n\n if (pending) {\n const size = typeof metadata.size == 'number' ? metadata.size : pending.length\n const writable = await handle.createWritable({ keepExistingData: true })\n try {\n await writable.truncate(Math.min(pending.length, size))\n // Truncated, then extended: the new bytes are zeros.\n if (size > pending.length) await writable.truncate(size)\n await writable.close()\n } catch (error) {\n await writable.abort().catch(() => {})\n throw error\n }\n this._takeTruncate(path, pending)\n const file = await handle.getFile()\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this._remember(path, file)\n this._changed(path)\n return\n }\n\n const file = await handle.getFile()\n if (inode.size == file.size) return\n const seen = this._seen.get(path)\n inode.update({ size: file.size })\n if (!seen || seen.size != file.size || seen.lastModified != file.lastModified) {\n this._markChangedElsewhere(path)\n }\n }\n\n async remove(path: string): Promise<void> {\n for (const map of [this._truncates, this._seen]) {\n for (const p of [...map.keys()]) if (p == path || p.startsWith(path + '/')) map.delete(p)\n }\n await super.remove(path)\n this._changed(path)\n }\n\n async _loadHandles(path: string, handle: FileSystemDirectoryHandle): Promise<void> {\n try {\n for await (const [key, child] of (handle as any).entries() as AsyncIterable<[string, FileSystemHandle]>) {\n const p = join(path, key)\n this._handles.set(p, child)\n if (child.kind == 'directory') await this._loadHandles(p, child as FileSystemDirectoryHandle)\n }\n } catch (error) {\n // An unreadable root means nothing was walked; let initializeFileSystem retry the mount.\n if (!isSkippableOpfsEntryError(error) || path == '/') throw error\n // The directory went away (or became unreadable) mid-walk: forget it and anything under it.\n logger(`skipping directory ${path}: ${(error as DOMException).name}`)\n for (const p of [...this._handles.keys()]) {\n if (p == path || p.startsWith(path + '/')) this._handles.delete(p)\n }\n }\n }\n\n async _loadMetadata(metadataPath?: string): Promise<void> {\n if (metadataPath) return super._loadMetadata(metadataPath)\n\n this._handles.set('/', this.root)\n await this._loadHandles('/', this.root)\n\n for (const [path, handle] of [...this._handles]) {\n if (handle.kind == 'directory') {\n this.index.set(path, new Inode({ mode: 0o777 | constants.S_IFDIR, size: 0 }))\n continue\n }\n try {\n const { lastModified, size } = await (handle as FileSystemFileHandle).getFile()\n this.index.set(path, new Inode({ mode: 0o644 | constants.S_IFREG, size, mtimeMs: lastModified }))\n this._seen.set(path, { size, lastModified })\n } catch (error) {\n if (!isSkippableOpfsEntryError(error)) throw error\n logger(`skipping file ${path}: ${(error as DOMException).name}`)\n // A removed file's handle would keep resolving to nothing; a locked one is still valid.\n if ((error as DOMException).name == 'NotFoundError') this._handles.delete(path)\n }\n }\n }\n\n /**\n * Forgets what the mount cached for `path` (size, handle, contents) and reads it again from OPFS.\n * For files written outside this ZenFS instance: by another tab, or by a worker writing to OPFS\n * directly. Only reads OPFS (never writes it, so never calls onOpfsChange).\n *\n * An entry that's gone (removed elsewhere) is forgotten along with anything cached under it, and\n * costs one failed lookup. A file in directories this mount hasn't cached yet (created elsewhere\n * after it mounted) gets them added to the in-memory copy, so the sync API finds it.\n */\n async invalidate(path: string): Promise<void> {\n if (path == '/') return\n this.index.delete(path)\n this._handles.delete(path)\n this._seen.delete(path)\n this._truncates.delete(path)\n let inode: Inode\n try {\n inode = await this.stat(path) // Re-indexes from OPFS (WebAccessFS.stat).\n } catch {\n this._forgetCached(path) // Gone (or unreadable for now: the next stat() looks again).\n return\n }\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Not cached, or a directory: crossCopy refreshes what's under it.\n }\n if ((inode.mode & constants.S_IFMT) == constants.S_IFREG) await this._cacheParents(path)\n await this.crossCopy(path)\n }\n\n /** Drops `path` and everything under it from the index, handles and in-memory copy. */\n private _forgetCached(path: string): void {\n for (const map of [this._handles, this._seen, this._truncates] as Map<string, unknown>[]) {\n for (const p of [...map.keys()]) if (p == path || p.startsWith(path + '/')) map.delete(p)\n }\n for (const [p] of [...this.index.entries()]) {\n if (p == path || p.startsWith(path + '/')) this.index.delete(p)\n }\n const drop = (p: string): void => {\n let stats: { mode: number }\n try {\n stats = this._sync.statSync(p)\n } catch {\n return // Not cached.\n }\n try {\n if ((stats.mode & constants.S_IFMT) == constants.S_IFDIR) {\n for (const name of this._sync.readdirSync(p)) drop(join(p, name))\n this._sync.rmdirSync(p)\n } else {\n this._sync.unlinkSync(p)\n }\n } catch (error) {\n logger(`could not drop the cached copy of ${p}: ${(error as Error).name}`)\n }\n }\n drop(path)\n }\n\n /** Adds the directories above `path` that the in-memory copy lacks, so crossCopy can fill it. */\n private async _cacheParents(path: string): Promise<void> {\n const missing: string[] = []\n for (let dir = dirname(path); dir != '/'; dir = dirname(dir)) {\n try {\n this._sync.statSync(dir)\n break\n } catch {\n missing.unshift(dir)\n }\n }\n for (const dir of missing) {\n try {\n const stats = await this.stat(dir)\n this._sync.mkdirSync(dir, stats as unknown as CreationOptions)\n this._sync.touchSync(dir, stats)\n } catch (error) {\n logger(`could not cache directory ${dir}: ${(error as Error).name}`)\n return // crossCopy then skips the file (async reads still find it).\n }\n }\n }\n\n /**\n * The Async mixin's ready() then copies every file's contents into an in-memory cache, a second\n * walk that reads the same busy entries. Skip those too; the root still fails the mount.\n */\n async crossCopy(path: string): Promise<void> {\n const crossCopy = (WebAccessFS.prototype as unknown as AsyncCrossCopy).crossCopy\n if (path == '/') return crossCopy.call(this, path)\n try {\n await crossCopy.call(this, path)\n } catch (error) {\n if (!isSkippableOpfsEntryError(error) && !isErrnoChangedEntry(error)) throw error\n logger(`not caching ${path}: ${(error as Error).name}`)\n // Drop a half-copied entry so the cache doesn't serve an empty file in its place.\n try {\n this._sync.unlinkSync(path)\n } catch {\n try {\n this._sync.rmdirSync(path)\n } catch {\n // Nothing was copied.\n }\n }\n }\n }\n}\n\n/** OPFS writes take a plain ArrayBuffer view (WebAccessFS.write copies the same way). */\nfunction copyIfShared(buffer: Uint8Array): Uint8Array<ArrayBuffer> {\n const backing = buffer.buffer as ArrayBufferLike & { resizable?: boolean; growable?: boolean }\n if (backing instanceof ArrayBuffer && !backing.resizable) return buffer as Uint8Array<ArrayBuffer>\n return new Uint8Array(buffer)\n}\n\ntype AsyncCrossCopy = { crossCopy(this: TolerantWebAccessFS, path: string): Promise<void> }\n\n/** Set by the Async mixin once ready() has copied OPFS into the in-memory cache. */\ntype AsyncState = { _isInitialized: boolean }\n\nconst TRACKED = Symbol.for('seedSdk.tolerantWebAccess.trackTruncates')\n\n/**\n * ZenFS file handles truncate by lowering their inode's size, and only tell the file system the new\n * size later (touch), the same way they report a size that's merely stale. So handles on a\n * TolerantWebAccessFS report each truncate when it's made (open with 'w', ftruncate, truncate).\n * Patches the shared vfs.Handle prototype once; handles on other file systems are unaffected.\n */\nfunction trackTruncates(): void {\n const proto = vfs.Handle.prototype as typeof vfs.Handle.prototype & { [TRACKED]?: true }\n if (proto[TRACKED]) return\n proto[TRACKED] = true\n const fsOf = (handle: vfs.Handle) => (handle.fs instanceof TolerantWebAccessFS ? handle.fs : undefined)\n\n const truncate = proto.truncate\n proto.truncate = async function (this: vfs.Handle, length: number) {\n const fs = fsOf(this)\n // Noted first: on a sync handle, truncate() syncs (touch) before it returns.\n const undo = fs?._noteTruncate(this.internalPath, length)\n try {\n await truncate.call(this, length)\n } catch (error) {\n undo?.()\n throw error\n }\n fs?._truncateCache(this.internalPath, length)\n }\n const truncateSync = proto.truncateSync\n proto.truncateSync = function (this: vfs.Handle, length: number) {\n const fs = fsOf(this)\n const undo = fs?._noteTruncate(this.internalPath, length)\n try {\n truncateSync.call(this, length)\n } catch (error) {\n undo?.()\n throw error\n }\n fs?._truncateCache(this.internalPath, length)\n }\n}\ntrackTruncates()\n\n/**\n * ZenFS converts most DOMExceptions to errno errors: an entry removed mid-walk becomes ENOENT, and\n * a file whose size changed since _loadMetadata (SQLite writing in another tab) fails read() with\n * an EIO size mismatch.\n */\nfunction isErrnoChangedEntry(error: unknown): boolean {\n const { code, message } = (error ?? {}) as { code?: unknown; message?: unknown }\n if (code === 'ENOENT') return true\n return code === 'EIO' && typeof message === 'string' && message.includes('mismatch in file data size')\n}\n\n/** Drop-in for `WebAccess` in `configureSingle({ backend, handle })`. */\nexport const TolerantWebAccess = {\n ...WebAccess,\n name: 'TolerantWebAccess',\n async create(options: WebAccessOptions): Promise<WebAccessFS> {\n const fs = new TolerantWebAccessFS(options.handle, options.disableHandleCache)\n await fs._loadMetadata(options.metadata)\n return fs\n },\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,MAAM,GAAG,KAAK,CAAC,2CAA2C,CAAC;AAQjE;;;;;;;;;;;;;;AAcG;AACG,MAAO,mBAAoB,SAAQ,WAAW,CAAA;IAmBlD,WAAA,CAAY,IAA+B,EAAE,kBAA4B,EAAA;AACvE,QAAA,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC;AAnBjC;;;;AAIG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAA2B;;AAG/C,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,GAAG,EAAuB;;;AAcr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,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;AAC/C,IAAA,CAAC;AACH;AACA,cAAc,EAAE;AAEhB;;;;AAIG;AACH,SAAS,mBAAmB,CAAC,KAAc,EAAA;IACzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,EAAE,CAA0C;IAChF,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;AAClC,IAAA,OAAO,IAAI,KAAK,KAAK,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC;AACxG;AAEA;AACO,MAAM,iBAAiB,GAAG;AAC/B,IAAA,GAAG,SAAS;AACZ,IAAA,IAAI,EAAE,mBAAmB;IACzB,MAAM,MAAM,CAAC,OAAyB,EAAA;AACpC,QAAA,MAAM,EAAE,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC;QAC9E,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;AACxC,QAAA,OAAO,EAAE;IACX,CAAC;;;"}
|
|
1
|
+
{"version":3,"file":"tolerantWebAccess-BJqViq08.js","sources":["../../src/browser/helpers/tolerantWebAccess.ts"],"sourcesContent":["import { constants, Inode, vfs } from '@zenfs/core'\nimport type { CreationOptions, InodeLike } from '@zenfs/core'\nimport { dirname, join } from '@zenfs/core/path'\nimport { WebAccess, WebAccessFS } from '@zenfs/dom'\nimport type { WebAccessOptions } from '@zenfs/dom'\nimport debug from 'debug'\nimport { isSkippableOpfsEntryError } from './opfsErrors'\n\nconst logger = debug('seedSdk:browser:helpers:tolerantWebAccess')\n\n/** A truncate made through this mount that OPFS doesn't have yet. Compared by identity. */\ntype PendingTruncate = { readonly length: number }\n\n/** An OPFS file as this mount last saw it. */\ntype OpfsVersion = { size: number; lastModified: number }\n\n/**\n * WebAccessFS mounts by walking all of OPFS and reading every file's size, and one unreadable\n * entry fails the whole mount. This variant skips such entries instead. A skipped file is still\n * listed by readdir, and WebAccessFS.stat() indexes it lazily on first use, once it is readable.\n *\n * It also makes overwrites with shorter content shrink the file (see `write` and `touch`), without\n * cutting off bytes another context (a tab, a worker writing through a SyncAccessHandle) added to a\n * file this mount had indexed at a smaller size: OPFS only shrinks for a truncate made through this\n * mount, and stat() re-reads a file's size when OPFS changed since this mount last looked.\n *\n * Overrides @zenfs/dom 1.2.9 / @zenfs/core 2.5.6 internals (`_loadHandles`, `_loadMetadata`,\n * `crossCopy`, `stat`, `write`, `touch`, `remove`, `get`, `_handles`, `_sync`, `_isInitialized`,\n * `index`, and `vfs.Handle#truncate`/`truncateSync`, see `trackTruncates`); both packages are pinned\n * to exact versions, and tolerantWebAccess.test.ts / opfsOverwrite.test.ts cover the coupling.\n */\nexport class TolerantWebAccessFS extends WebAccessFS {\n /**\n * Truncates made through this mount that OPFS doesn't have yet, by path. ZenFS truncates by\n * lowering the inode's size and syncing it later, so only these may shrink the OPFS file: an\n * inode that is merely smaller than the file is a stale view of a file someone else grew.\n */\n private readonly _truncates = new Map<string, PendingTruncate>()\n\n /** Each OPFS file as this mount last saw it, to notice writes made elsewhere. */\n private readonly _seen = new Map<string, OpfsVersion>()\n\n /**\n * Called with each file path whose OPFS contents this mount changed (a write, a truncate, a\n * removal; a rename is both), once the change is in OPFS. BrowserFileManager uses it to tell other\n * tabs. Not called for what invalidate(), stat() or crossCopy() put in the in-memory copy: those\n * only read OPFS.\n */\n onOpfsChange?: (path: string) => void\n\n constructor(root: FileSystemDirectoryHandle, disableHandleCache?: boolean) {\n super(root, disableHandleCache)\n // Reads would otherwise mark the file dirty (atime) and end in touch() for every read. Without\n // atime, touch() only follows writes, truncates, chmod and utimes.\n this.attributes.set('no_atime')\n }\n\n /**\n * Called by vfs.Handle#truncate(Sync) for files on this mount (see `trackTruncates`). Returns an\n * undo for a truncate the handle then rejects.\n */\n _noteTruncate(path: string, length: number): () => void {\n const previous = this._truncates.get(path)\n // Truncated twice before a write: the bytes past the shorter length are gone either way.\n this._truncates.set(path, { length: Math.min(length, previous?.length ?? length) })\n return () => {\n if (previous) this._truncates.set(path, previous)\n else this._truncates.delete(path)\n }\n }\n\n /**\n * The sync API's in-memory copy (a StoreFS) truncates by setting the size alone and keeps the old\n * bytes, which a later write past that size then exposes in place of zeros. Cut them off there\n * too. Called by vfs.Handle#truncate(Sync) once the truncate went through.\n */\n _truncateCache(path: string, length: number): void {\n try {\n const cached = this._sync.statSync(path)\n if ((cached.mode & constants.S_IFMT) != constants.S_IFREG) return\n // Even when the size already matches: a sync handle's truncate() has synced it by now.\n const data = new Uint8Array(length) // Past the old size (truncate to extend): zeros.\n const kept = Math.min(length, cached.size)\n if (kept) this._sync.readSync(path, data.subarray(0, kept), 0, kept)\n this._sync.unlinkSync(path)\n this._sync.createFileSync(path, cached as unknown as CreationOptions)\n if (length) this._sync.writeSync(path, data, 0)\n cached.size = length\n this._sync.touchSync(path, cached)\n } catch (error) {\n logger(`could not truncate the cached copy of ${path}: ${(error as Error).name}`)\n }\n }\n\n private _takeTruncate(path: string, pending: PendingTruncate | undefined): void {\n // A truncate recorded while this write or sync was under way is left for the next one.\n if (pending && this._truncates.get(path) === pending) this._truncates.delete(path)\n }\n\n private _changed(path: string): void {\n try {\n this.onOpfsChange?.(path)\n } catch (error) {\n logger(`change listener failed for ${path}`, error)\n }\n }\n\n private _remember(path: string, file: File): void {\n this._seen.set(path, { size: file.size, lastModified: file.lastModified })\n }\n\n /** Another context changed the file: the next stat() refreshes the sync API's in-memory copy. */\n private _markChangedElsewhere(path: string): void {\n this._seen.set(path, { size: -1, lastModified: -1 })\n }\n\n /**\n * The index holds each file's size from when this mount last looked, and another context may\n * have written the file since. Re-read it from OPFS, so opening a file (an append goes to its\n * size) and reading it see the true file, and refresh the in-memory copy behind the sync API when\n * the file changed. Costs one getFile() per stat of a regular file; contents are only read when\n * the file changed.\n */\n async stat(path: string): Promise<Inode> {\n const inode = (await super.stat(path)) as Inode\n if ((inode.mode & constants.S_IFMT) != constants.S_IFREG) return inode\n // While mounting, sizes were just read and crossCopy stats every file.\n if (!(this as unknown as AsyncState)._isInitialized) return inode\n // This mount truncated the file and OPFS doesn't have it yet: the inode's size is the truth.\n if (this._truncates.has(path)) return inode\n\n let file: File\n try {\n file = await ((await this.get('file', path)) as FileSystemFileHandle).getFile()\n } catch {\n return inode // Gone or busy: keep what the index knows.\n }\n const seen = this._seen.get(path)\n if (seen && seen.size == file.size && seen.lastModified == file.lastModified) return inode\n this._remember(path, file)\n // First look at a file this mount just indexed (WebAccessFS.stat, invalidate): nothing to fix.\n if (!seen && inode.size == file.size) return inode\n logger(`${path} changed outside this mount (${inode.size} -> ${file.size} bytes)`)\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this.index.set(path, inode)\n await this._recache(path, inode, file)\n return inode\n }\n\n /** Replaces the sync API's in-memory copy of `path` with `file`, if it holds one. */\n private async _recache(path: string, inode: Inode, file: File): Promise<void> {\n try {\n this._sync.statSync(path)\n } catch {\n return // Not cached: async reads go to OPFS, and invalidate() handles the rest.\n }\n try {\n const data = new Uint8Array(await file.arrayBuffer())\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Already gone.\n }\n this._sync.createFileSync(path, inode as unknown as CreationOptions)\n this._sync.writeSync(path, data, 0)\n this._sync.touchSync(path, inode)\n } catch (error) {\n logger(`not caching ${path}: ${(error as Error).name}`)\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Nothing was copied.\n }\n }\n }\n\n /**\n * WebAccessFS.write opens the file with `keepExistingData` and never truncates, so a whole-file\n * overwrite with shorter content (open 'w', then a write at 0) kept the old tail on disk. Here a\n * truncate this mount made since the file was last written (open 'w', ftruncate) is applied in\n * the same writable as the data: the file is cut to that length first (a write past it leaves\n * zeros in the gap, as POSIX does). Without one, the data goes over the file OPFS has, whatever\n * size this mount last saw: appends and writes at an offset never cut off bytes another context\n * wrote.\n */\n async write(path: string, buffer: Uint8Array, offset: number): Promise<void> {\n const pending = this._truncates.get(path)\n const inode = this.index.get(path)\n let handle: FileSystemFileHandle | undefined\n if (inode && (inode.mode & constants.S_IFMT) == constants.S_IFREG) {\n try {\n handle = (await this.get('file', path)) as FileSystemFileHandle\n } catch {\n // Not in OPFS yet: WebAccessFS.write creates it, and a new file has no old tail.\n }\n }\n if (!inode || !handle) {\n await super.write(path, buffer, offset)\n this._takeTruncate(path, pending)\n if (inode) this._seen.set(path, { size: inode.size, lastModified: inode.mtimeMs })\n // WebAccessFS.write also creates directories; only files are worth telling other tabs about.\n if (inode && (inode.mode & constants.S_IFMT) == constants.S_IFREG) this._changed(path)\n return\n }\n\n const data = copyIfShared(buffer)\n const end = offset + data.byteLength\n // Truncated to no more than this write covers: start from an empty file instead of a copy.\n const wholeFile = pending !== undefined && offset == 0 && pending.length <= data.byteLength\n const writable = await handle.createWritable({ keepExistingData: !wholeFile })\n try {\n if (pending && !wholeFile) await writable.truncate(pending.length)\n await writable.write({ type: 'write', position: offset, data })\n await writable.close()\n } catch (error) {\n await writable.abort().catch(() => {})\n throw error\n }\n this._takeTruncate(path, pending)\n\n const file = await handle.getFile()\n const seen = this._seen.get(path)\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this.index.set(path, inode)\n this._remember(path, file)\n // Larger than this mount's writes explain: another context grew it. The sync API's copy is\n // refreshed by the next stat(), not here, where queued sync writes may not have landed yet.\n const expected = pending ? Math.max(pending.length, end) : Math.max(seen?.size ?? 0, end)\n if (seen && seen.size >= 0 && file.size != expected) this._markChangedElsewhere(path)\n this._changed(path)\n }\n\n /**\n * ZenFS truncates by setting the inode's size and syncing it with touch() (FileHandle.truncate\n * with no write after it). Make OPFS follow when this mount truncated the file. Any other touch\n * (chmod, utimes, the size after writes) leaves the OPFS file alone: a smaller size there is a\n * stale view, and the index takes the file's real size back.\n */\n async touch(path: string, metadata: InodeLike): Promise<void> {\n const pending = this._truncates.get(path)\n await super.touch(path, metadata)\n const inode = this.index.get(path)\n if (!inode || (inode.mode & constants.S_IFMT) != constants.S_IFREG) return\n let handle: FileSystemFileHandle\n try {\n handle = (await this.get('file', path)) as FileSystemFileHandle\n } catch {\n return // Not in OPFS (yet): nothing to shrink, and a queued write creates it.\n }\n\n if (pending) {\n const size = typeof metadata.size == 'number' ? metadata.size : pending.length\n const writable = await handle.createWritable({ keepExistingData: true })\n try {\n await writable.truncate(Math.min(pending.length, size))\n // Truncated, then extended: the new bytes are zeros.\n if (size > pending.length) await writable.truncate(size)\n await writable.close()\n } catch (error) {\n await writable.abort().catch(() => {})\n throw error\n }\n this._takeTruncate(path, pending)\n const file = await handle.getFile()\n inode.update({ size: file.size, mtimeMs: file.lastModified })\n this._remember(path, file)\n this._changed(path)\n return\n }\n\n const file = await handle.getFile()\n if (inode.size == file.size) return\n const seen = this._seen.get(path)\n inode.update({ size: file.size })\n if (!seen || seen.size != file.size || seen.lastModified != file.lastModified) {\n this._markChangedElsewhere(path)\n }\n }\n\n async remove(path: string): Promise<void> {\n for (const map of [this._truncates, this._seen]) {\n for (const p of [...map.keys()]) if (p == path || p.startsWith(path + '/')) map.delete(p)\n }\n await super.remove(path)\n this._changed(path)\n }\n\n async _loadHandles(path: string, handle: FileSystemDirectoryHandle): Promise<void> {\n try {\n for await (const [key, child] of (handle as any).entries() as AsyncIterable<[string, FileSystemHandle]>) {\n const p = join(path, key)\n this._handles.set(p, child)\n if (child.kind == 'directory') await this._loadHandles(p, child as FileSystemDirectoryHandle)\n }\n } catch (error) {\n // An unreadable root means nothing was walked; let initializeFileSystem retry the mount.\n if (!isSkippableOpfsEntryError(error) || path == '/') throw error\n // The directory went away (or became unreadable) mid-walk: forget it and anything under it.\n logger(`skipping directory ${path}: ${(error as DOMException).name}`)\n for (const p of [...this._handles.keys()]) {\n if (p == path || p.startsWith(path + '/')) this._handles.delete(p)\n }\n }\n }\n\n async _loadMetadata(metadataPath?: string): Promise<void> {\n if (metadataPath) return super._loadMetadata(metadataPath)\n\n this._handles.set('/', this.root)\n await this._loadHandles('/', this.root)\n\n for (const [path, handle] of [...this._handles]) {\n if (handle.kind == 'directory') {\n this.index.set(path, new Inode({ mode: 0o777 | constants.S_IFDIR, size: 0 }))\n continue\n }\n try {\n const { lastModified, size } = await (handle as FileSystemFileHandle).getFile()\n this.index.set(path, new Inode({ mode: 0o644 | constants.S_IFREG, size, mtimeMs: lastModified }))\n this._seen.set(path, { size, lastModified })\n } catch (error) {\n if (!isSkippableOpfsEntryError(error)) throw error\n logger(`skipping file ${path}: ${(error as DOMException).name}`)\n // A removed file's handle would keep resolving to nothing; a locked one is still valid.\n if ((error as DOMException).name == 'NotFoundError') this._handles.delete(path)\n }\n }\n }\n\n /**\n * Forgets what the mount cached for `path` (size, handle, contents) and reads it again from OPFS.\n * For files written outside this ZenFS instance: by another tab, or by a worker writing to OPFS\n * directly. Only reads OPFS (never writes it, so never calls onOpfsChange).\n *\n * An entry that's gone (removed elsewhere) is forgotten along with anything cached under it, and\n * costs one failed lookup. A file in directories this mount hasn't cached yet (created elsewhere\n * after it mounted) gets them added to the in-memory copy, so the sync API finds it.\n */\n async invalidate(path: string): Promise<void> {\n if (path == '/') return\n this.index.delete(path)\n this._handles.delete(path)\n this._seen.delete(path)\n this._truncates.delete(path)\n let inode: Inode\n try {\n inode = await this.stat(path) // Re-indexes from OPFS (WebAccessFS.stat).\n } catch {\n this._forgetCached(path) // Gone (or unreadable for now: the next stat() looks again).\n return\n }\n try {\n this._sync.unlinkSync(path)\n } catch {\n // Not cached, or a directory: crossCopy refreshes what's under it.\n }\n if ((inode.mode & constants.S_IFMT) == constants.S_IFREG) await this._cacheParents(path)\n await this.crossCopy(path)\n }\n\n /** Drops `path` and everything under it from the index, handles and in-memory copy. */\n private _forgetCached(path: string): void {\n for (const map of [this._handles, this._seen, this._truncates] as Map<string, unknown>[]) {\n for (const p of [...map.keys()]) if (p == path || p.startsWith(path + '/')) map.delete(p)\n }\n for (const [p] of [...this.index.entries()]) {\n if (p == path || p.startsWith(path + '/')) this.index.delete(p)\n }\n const drop = (p: string): void => {\n let stats: { mode: number }\n try {\n stats = this._sync.statSync(p)\n } catch {\n return // Not cached.\n }\n try {\n if ((stats.mode & constants.S_IFMT) == constants.S_IFDIR) {\n for (const name of this._sync.readdirSync(p)) drop(join(p, name))\n this._sync.rmdirSync(p)\n } else {\n this._sync.unlinkSync(p)\n }\n } catch (error) {\n logger(`could not drop the cached copy of ${p}: ${(error as Error).name}`)\n }\n }\n drop(path)\n }\n\n /** Adds the directories above `path` that the in-memory copy lacks, so crossCopy can fill it. */\n private async _cacheParents(path: string): Promise<void> {\n const missing: string[] = []\n for (let dir = dirname(path); dir != '/'; dir = dirname(dir)) {\n try {\n this._sync.statSync(dir)\n break\n } catch {\n missing.unshift(dir)\n }\n }\n for (const dir of missing) {\n try {\n const stats = await this.stat(dir)\n this._sync.mkdirSync(dir, stats as unknown as CreationOptions)\n this._sync.touchSync(dir, stats)\n } catch (error) {\n logger(`could not cache directory ${dir}: ${(error as Error).name}`)\n return // crossCopy then skips the file (async reads still find it).\n }\n }\n }\n\n /**\n * The Async mixin's ready() then copies every file's contents into an in-memory cache, a second\n * walk that reads the same busy entries. Skip those too; the root still fails the mount.\n */\n async crossCopy(path: string): Promise<void> {\n const crossCopy = (WebAccessFS.prototype as unknown as AsyncCrossCopy).crossCopy\n if (path == '/') return crossCopy.call(this, path)\n try {\n await crossCopy.call(this, path)\n } catch (error) {\n if (!isSkippableOpfsEntryError(error) && !isErrnoChangedEntry(error)) throw error\n logger(`not caching ${path}: ${(error as Error).name}`)\n // Drop a half-copied entry so the cache doesn't serve an empty file in its place.\n try {\n this._sync.unlinkSync(path)\n } catch {\n try {\n this._sync.rmdirSync(path)\n } catch {\n // Nothing was copied.\n }\n }\n }\n }\n}\n\n/** OPFS writes take a plain ArrayBuffer view (WebAccessFS.write copies the same way). */\nfunction copyIfShared(buffer: Uint8Array): Uint8Array<ArrayBuffer> {\n const backing = buffer.buffer as ArrayBufferLike & { resizable?: boolean; growable?: boolean }\n if (backing instanceof ArrayBuffer && !backing.resizable) return buffer as Uint8Array<ArrayBuffer>\n return new Uint8Array(buffer)\n}\n\ntype AsyncCrossCopy = { crossCopy(this: TolerantWebAccessFS, path: string): Promise<void> }\n\n/** Set by the Async mixin once ready() has copied OPFS into the in-memory cache. */\ntype AsyncState = { _isInitialized: boolean }\n\nconst TRACKED = Symbol.for('seedSdk.tolerantWebAccess.trackTruncates')\n\n/**\n * ZenFS file handles truncate by lowering their inode's size, and only tell the file system the new\n * size later (touch), the same way they report a size that's merely stale. So handles on a\n * TolerantWebAccessFS report each truncate when it's made (open with 'w', ftruncate, truncate).\n * Patches the shared vfs.Handle prototype once; handles on other file systems are unaffected.\n */\nfunction trackTruncates(): void {\n const proto = vfs.Handle.prototype as typeof vfs.Handle.prototype & { [TRACKED]?: true }\n if (proto[TRACKED]) return\n proto[TRACKED] = true\n const fsOf = (handle: vfs.Handle) => (handle.fs instanceof TolerantWebAccessFS ? handle.fs : undefined)\n\n const truncate = proto.truncate\n proto.truncate = async function (this: vfs.Handle, length: number) {\n const fs = fsOf(this)\n // Noted first: on a sync handle, truncate() syncs (touch) before it returns.\n const undo = fs?._noteTruncate(this.internalPath, length)\n try {\n await truncate.call(this, length)\n } catch (error) {\n undo?.()\n throw error\n }\n fs?._truncateCache(this.internalPath, length)\n }\n const truncateSync = proto.truncateSync\n proto.truncateSync = function (this: vfs.Handle, length: number) {\n const fs = fsOf(this)\n const undo = fs?._noteTruncate(this.internalPath, length)\n try {\n truncateSync.call(this, length)\n } catch (error) {\n undo?.()\n throw error\n }\n fs?._truncateCache(this.internalPath, length)\n }\n}\ntrackTruncates()\n\n/**\n * ZenFS converts most DOMExceptions to errno errors: an entry removed mid-walk becomes ENOENT, and\n * a file whose size changed since _loadMetadata (SQLite writing in another tab) fails read() with\n * an EIO size mismatch.\n */\nfunction isErrnoChangedEntry(error: unknown): boolean {\n const { code, message } = (error ?? {}) as { code?: unknown; message?: unknown }\n if (code === 'ENOENT') return true\n return code === 'EIO' && typeof message === 'string' && message.includes('mismatch in file data size')\n}\n\n/** Drop-in for `WebAccess` in `configureSingle({ backend, handle })`. */\nexport const TolerantWebAccess = {\n ...WebAccess,\n name: 'TolerantWebAccess',\n async create(options: WebAccessOptions): Promise<WebAccessFS> {\n const fs = new TolerantWebAccessFS(options.handle, options.disableHandleCache)\n await fs._loadMetadata(options.metadata)\n return fs\n },\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,MAAM,GAAG,KAAK,CAAC,2CAA2C,CAAC;AAQjE;;;;;;;;;;;;;;AAcG;AACG,MAAO,mBAAoB,SAAQ,WAAW,CAAA;IAmBlD,WAAA,CAAY,IAA+B,EAAE,kBAA4B,EAAA;AACvE,QAAA,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC;AAnBjC;;;;AAIG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAA2B;;AAG/C,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,GAAG,EAAuB;;;AAcrD,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC;IACjC;AAEA;;;AAGG;IACH,aAAa,CAAC,IAAY,EAAE,MAAc,EAAA;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;;QAE1C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC;AACnF,QAAA,OAAO,MAAK;AACV,YAAA,IAAI,QAAQ;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC;;AAC5C,gBAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;AACnC,QAAA,CAAC;IACH;AAEA;;;;AAIG;IACH,cAAc,CAAC,IAAY,EAAE,MAAc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kB,CAAC;QAC9E,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;AACxC,QAAA,OAAO,EAAE;IACX,CAAC;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { A as AmbiguousModelError, h as eventEmitter, w as writeInBatches } from './tabEvents-CaVmngqr.js';
|
|
3
|
+
import { B as BaseDb, s as seeds, m as metadata, v as versions } from './BaseFileManager-BAlySv8w.js';
|
|
4
|
+
import { eq, and, or, inArray, isNull } from 'drizzle-orm';
|
|
4
5
|
|
|
5
6
|
const logger = debug('seedSdk:db:read:resolveModelForSyncedSeed');
|
|
6
7
|
/** Emitted when background work skips a seed whose model name exists in several schemas. */
|
|
@@ -43,5 +44,30 @@ const skipSeedOnAmbiguousModel = async (seed, context, work) => {
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Sets revokedAt timestamp on a seed record after attestations have been revoked on EAS.
|
|
49
|
+
*/
|
|
50
|
+
const updateSeedRevokedAt = async ({ seedLocalId, revokedAt, metadataUids, versionUids, }) => {
|
|
51
|
+
if (!seedLocalId) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const appDb = BaseDb.getAppDb();
|
|
55
|
+
await appDb
|
|
56
|
+
.update(seeds)
|
|
57
|
+
.set({
|
|
58
|
+
revokedAt,
|
|
59
|
+
})
|
|
60
|
+
.where(eq(seeds.localId, seedLocalId));
|
|
61
|
+
// An item can have many property attestations; each list binds once per uid (twice for metadata).
|
|
62
|
+
await writeInBatches(metadataUids ?? [], (chunk) => appDb
|
|
63
|
+
.update(metadata)
|
|
64
|
+
.set({ revokedAt })
|
|
65
|
+
.where(and(or(inArray(metadata.uid, chunk), inArray(metadata.derivedFromUid, chunk)), isNull(metadata.revokedAt))));
|
|
66
|
+
await writeInBatches(versionUids ?? [], (chunk) => appDb
|
|
67
|
+
.update(versions)
|
|
68
|
+
.set({ revokedAt })
|
|
69
|
+
.where(and(inArray(versions.uid, chunk), isNull(versions.revokedAt))));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { MODEL_AMBIGUOUS_EVENT as M, resolveModelForSyncedSeed as r, skipSeedOnAmbiguousModel as s, updateSeedRevokedAt as u };
|
|
73
|
+
//# sourceMappingURL=updateSeedRevokedAt-BL9Bg-G7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateSeedRevokedAt-BL9Bg-G7.js","sources":["../../src/db/read/resolveModelForSyncedSeed.ts","../../src/db/write/updateSeedRevokedAt.ts"],"sourcesContent":["import debug from 'debug'\nimport { eventEmitter } from '@/eventBus'\nimport { AmbiguousModelError } from '@/Model/errors'\n\nconst logger = debug('seedSdk:db:read:resolveModelForSyncedSeed')\n\n/** Emitted when background work skips a seed whose model name exists in several schemas. */\nexport const MODEL_AMBIGUOUS_EVENT = 'model:ambiguous' as const\n\nexport type ModelAmbiguousEventPayload = {\n modelName: string\n schemaNames: string[]\n seedLocalId?: string\n seedUid?: string\n /** What was being done when the seed was skipped (e.g. 'easSync.metadata'). */\n context: string\n}\n\nexport type SyncedSeedInfo = {\n seedUid?: string | null\n seedLocalId?: string | null\n /** seeds.type as synced from EAS (the EAS schema name, i.e. snake_case model name). */\n modelType?: string | null\n /** EAS schema UID of the seed attestation. */\n schemaUid?: string | null\n}\n\n/**\n * Seam for matching an EAS-synced seed to a local model (its schemaFileId).\n *\n * EAS identifies a seed's model only by name (`bytes32 <model_name>`), so when several local schemas\n * define a model with that name the seed alone can't say which one it is. The original plan was to\n * match by the seed's properties and metadata; docs/adr/0006-schema-scoped-seeds.md replaced it.\n *\n * TODO(eas-synced-seed-model-resolution): not implemented yet. Returns undefined, so callers fall\n * back to the name, which throws AmbiguousModelError when the name is ambiguous.\n */\nexport const resolveModelForSyncedSeed = async (_seed: SyncedSeedInfo): Promise<string | undefined> => {\n return undefined\n}\n\n/**\n * Run background work for one seed; if it hits an ambiguous model name, log, emit\n * MODEL_AMBIGUOUS_EVENT and return undefined (skip) instead of failing the whole job. Loading the\n * item directly still throws, so the problem surfaces where the app touches it.\n */\nexport const skipSeedOnAmbiguousModel = async <T>(\n seed: { seedLocalId?: string | null; seedUid?: string | null },\n context: string,\n work: () => Promise<T>,\n): Promise<T | undefined> => {\n try {\n return await work()\n } catch (error) {\n if (!(error instanceof AmbiguousModelError)) throw error\n logger(`Skipping seed ${seed.seedLocalId ?? seed.seedUid} in ${context}: ${error.message}`)\n const payload: ModelAmbiguousEventPayload = {\n modelName: error.modelName,\n schemaNames: error.schemaNames,\n seedLocalId: seed.seedLocalId ?? undefined,\n seedUid: seed.seedUid ?? undefined,\n context,\n }\n eventEmitter.emit(MODEL_AMBIGUOUS_EVENT, payload)\n return undefined\n }\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport { metadata, seeds, versions } from '@/seedSchema'\nimport { and, eq, inArray, isNull, or } from 'drizzle-orm'\nimport { writeInBatches } from '@/db/sqlParamBatches'\n\ntype UpdateSeedRevokedAtProps = {\n seedLocalId: string\n /** Unix seconds. */\n revokedAt: number\n /**\n * Property attestation UIDs revoked along with the seed. Their metadata rows get the same\n * `revoked_at` (unless they already have one), so they read as revoked before the next sync.\n * Rows sync derived from them (ItemStorage rows whose `derived_from_uid` is one of these) are\n * stamped the same way.\n */\n metadataUids?: string[]\n /** Version attestation UIDs revoked along with the seed; their rows are stamped the same way. */\n versionUids?: string[]\n}\n\n/**\n * Sets revokedAt timestamp on a seed record after attestations have been revoked on EAS.\n */\nexport const updateSeedRevokedAt = async ({\n seedLocalId,\n revokedAt,\n metadataUids,\n versionUids,\n}: UpdateSeedRevokedAtProps): Promise<void> => {\n if (!seedLocalId) {\n return\n }\n\n const appDb = BaseDb.getAppDb()\n\n await appDb\n .update(seeds)\n .set({\n revokedAt,\n })\n .where(eq(seeds.localId, seedLocalId))\n\n // An item can have many property attestations; each list binds once per uid (twice for metadata).\n await writeInBatches(metadataUids ?? [], (chunk) =>\n appDb\n .update(metadata)\n .set({ revokedAt })\n .where(\n and(\n or(inArray(metadata.uid, chunk), inArray(metadata.derivedFromUid, chunk)),\n isNull(metadata.revokedAt),\n ),\n ),\n )\n\n await writeInBatches(versionUids ?? [], (chunk) =>\n appDb\n .update(versions)\n .set({ revokedAt })\n .where(and(inArray(versions.uid, chunk), isNull(versions.revokedAt))),\n )\n}\n"],"names":[],"mappings":";;;;;AAIA,MAAM,MAAM,GAAG,KAAK,CAAC,2CAA2C,CAAC;AAEjE;AACO,MAAM,qBAAqB,GAAG;AAoBrC;;;;;;;;;AASG;MACU,yBAAyB,GAAG,OAAO,KAAqB,KAAiC;AACpG,IAAA,OAAO,SAAS;AAClB;AAEA;;;;AAIG;AACI,MAAM,wBAAwB,GAAG,OACtC,IAA8D,EAC9D,OAAe,EACf,IAAsB,KACI;AAC1B,IAAA,IAAI;QACF,OAAO,MAAM,IAAI,EAAE;IACrB;IAAE,OAAO,KAAK,EAAE;AACd,QAAA,IAAI,EAAE,KAAK,YAAY,mBAAmB,CAAC;AAAE,YAAA,MAAM,KAAK;AACxD,QAAA,MAAM,CAAC,CAAA,cAAA,EAAiB,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAA,IAAA,EAAO,OAAO,CAAA,EAAA,EAAK,KAAK,CAAC,OAAO,CAAA,CAAE,CAAC;AAC3F,QAAA,MAAM,OAAO,GAA+B;YAC1C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;AAC9B,YAAA,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;AAC1C,YAAA,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS;YAClC,OAAO;SACR;AACD,QAAA,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;AACjD,QAAA,OAAO,SAAS;IAClB;AACF;;AC9CA;;AAEG;AACI,MAAM,mBAAmB,GAAG,OAAO,EACxC,WAAW,EACX,SAAS,EACT,YAAY,EACZ,WAAW,GACc,KAAmB;IAC5C,IAAI,CAAC,WAAW,EAAE;QAChB;IACF;AAEA,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE;AAE/B,IAAA,MAAM;SACH,MAAM,CAAC,KAAK;AACZ,SAAA,GAAG,CAAC;QACH,SAAS;KACV;SACA,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;IAGxC,MAAM,cAAc,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC,KAAK,KAC7C;SACG,MAAM,CAAC,QAAQ;AACf,SAAA,GAAG,CAAC,EAAE,SAAS,EAAE;AACjB,SAAA,KAAK,CACJ,GAAG,CACD,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,EACzE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC3B,CACF,CACJ;IAED,MAAM,cAAc,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC,KAAK,KAC5C;SACG,MAAM,CAAC,QAAQ;AACf,SAAA,GAAG,CAAC,EAAE,SAAS,EAAE;SACjB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CACxE;AACH;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seedprotocol/sdk",
|
|
3
|
-
"version": "0.7.9-next.
|
|
3
|
+
"version": "0.7.9-next.1306.g4ff6582",
|
|
4
4
|
"description": "Official TypeScript SDK for Seed Protocol — local-first ORM with SQLite/OPFS, syncing via Ethereum Attestation Service (EAS) and Arweave.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"seed-protocol",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"url": "https://github.com/JournoLabs/seed-protocol-sdk/issues"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@seedprotocol/vite": "0.7.9-next.
|
|
56
|
+
"@seedprotocol/vite": "0.7.9-next.1306.g4ff6582"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@seedprotocol/vite": {
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"@ethereum-attestation-service/eas-sdk": "^2.9.0",
|
|
65
65
|
"@libsql/client": "^0.15.15",
|
|
66
66
|
"@noble/hashes": "^1.8.0",
|
|
67
|
-
"@seedprotocol/arweave": "0.7.9-next.
|
|
68
|
-
"@seedprotocol/eas": "0.7.9-next.
|
|
69
|
-
"@seedprotocol/query": "0.7.9-next.
|
|
67
|
+
"@seedprotocol/arweave": "0.7.9-next.1306.g4ff6582",
|
|
68
|
+
"@seedprotocol/eas": "0.7.9-next.1306.g4ff6582",
|
|
69
|
+
"@seedprotocol/query": "0.7.9-next.1306.g4ff6582",
|
|
70
70
|
"@sinclair/typebox": "^0.34.45",
|
|
71
71
|
"@tanstack/query-core": "^5.104.1",
|
|
72
72
|
"@zenfs/core": "2.5.6",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
157
157
|
"@rollup/plugin-json": "^6.1.0",
|
|
158
158
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
159
|
-
"@seedprotocol/vite": "0.7.9-next.
|
|
159
|
+
"@seedprotocol/vite": "0.7.9-next.1306.g4ff6582",
|
|
160
160
|
"better-sqlite3": "^12.5.0",
|
|
161
161
|
"eventemitter3": "^5.0.1",
|
|
162
162
|
"kerium": "1.3.4",
|