@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
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import { n as normalizeDataType,
|
|
2
|
-
import { r as resolveModelForSyncedSeed, s as skipSeedOnAmbiguousModel } from './
|
|
1
|
+
import { n as normalizeDataType, v as INTERNAL_DATA_TYPES, x as normalizePublisher, y as chunkValues, z as rowsPerInsert, B as getAllAddressesFromDb, C as loadNameMatchLevels, E as scheduleBulkFilesDownloadFromEasSync, F as isBrowser, G as emitAcrossTabs, H as findSeedRowsByUid, m as generateId, J as normalizeHexAddress, K as selectInBatches, w as writeInBatches, L as nameMatchLevels, N as getItemStoragePropertiesForModel, O as resolveItemModelFileId, Q as EAS_SEED_DATA_SYNCED_TO_DB_EVENT } from './tabEvents-CaVmngqr.js';
|
|
2
|
+
import { u as updateSeedRevokedAt, r as resolveModelForSyncedSeed, s as skipSeedOnAmbiguousModel } from './updateSeedRevokedAt-BL9Bg-G7.js';
|
|
3
3
|
import { camelCase } from 'lodash-es';
|
|
4
|
-
import { decodeEasNumber, isNumericEasType,
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { decodeEasNumber, isNumericEasType, matchEasModelSchemas, getSeedsFromSchemaUids, getItemVersionsFromEas, partitionByRefAttester, getItemPropertiesFromEas, BaseEasClient, GET_SEEDS, easName, pickLatestPropertyAttestationsByRefAndSchema, isEasEmptyValue, setSchemaUidForSchemaDefinition, isNameMatchLevel, matchEasName } from '@seedprotocol/eas';
|
|
5
|
+
import 'pluralize';
|
|
6
|
+
import { a6 as getGetAdditionalSyncAddresses, a7 as modelPropertiesToObject, a8 as listRelationEasPropertyName, a9 as easPropertyNameForPublish, aa as metadataStorageName, ab as resolveMetadataPropertyId } from './Item-Bf4kWKpH.js';
|
|
7
|
+
import { B as BaseDb, s as seeds, v as versions, m as metadata } from './BaseFileManager-BAlySv8w.js';
|
|
8
8
|
import { parseEasPropertyMetadata, parseEasRelationPropertyName } from '@seedprotocol/query';
|
|
9
|
-
import {
|
|
10
|
-
import { f as findSeedRowsByUid } from './findSeedRowsByUid-CT3sOXXw.js';
|
|
11
|
-
import { u as updateSeedRevokedAt } from './updateSeedRevokedAt-CP606vKs.js';
|
|
12
|
-
import { getModelSchemasFromEas } from './eas-dyepi5jz.js';
|
|
13
|
-
import { w as waitForEasReadChain, o as assertLocalDbChain } from './ClientManager-GZfXErDX.js';
|
|
14
|
-
import { e as emitAcrossTabs } from './changeFeed-DKdVlUmt.js';
|
|
15
|
-
import 'debug';
|
|
9
|
+
import { inArray, eq, and, or, isNull, ne, isNotNull } from 'drizzle-orm';
|
|
16
10
|
import '@seedprotocol/arweave';
|
|
11
|
+
import { A as waitForEasReadChain, B as assertLocalDbChain, k as localModelSchemaLookups, D as writeModelUids } from './errors-DLSoqSHG.js';
|
|
12
|
+
import { getModelSchemasFromEas } from './eas-wB_fQ8Tc.js';
|
|
13
|
+
import 'debug';
|
|
17
14
|
import 'xstate';
|
|
18
|
-
import '@sinclair/typebox';
|
|
19
15
|
import 'drizzle-orm/sqlite-core';
|
|
16
|
+
import '@sinclair/typebox';
|
|
20
17
|
import 'nanoid';
|
|
21
18
|
import 'nanoid-dictionary';
|
|
22
19
|
import '@noble/hashes/sha256';
|
|
23
20
|
import '@noble/hashes/sha3';
|
|
24
21
|
import '@noble/hashes/utils';
|
|
25
|
-
import './eventBus-7vxTCc3a.js';
|
|
26
22
|
import 'rxjs';
|
|
27
23
|
|
|
28
24
|
/**
|
|
@@ -64,76 +60,10 @@ function syncedPropertyValue(dataType, easType, value) {
|
|
|
64
60
|
return value;
|
|
65
61
|
}
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Dynamic import to break circular dependency
|
|
72
|
-
const _mod_0 = await import('./errors-D1zHAqjr.js');
|
|
73
|
-
const _ns_0 = _mod_0.i;
|
|
74
|
-
const modelMod = _ns_0;
|
|
75
|
-
const { Model } = modelMod;
|
|
76
|
-
const allModels = await Model.all();
|
|
77
|
-
const modelRecords = [];
|
|
78
|
-
const appDb = BaseDb.getAppDb();
|
|
79
|
-
for (const model of allModels) {
|
|
80
|
-
const modelName = model.modelName;
|
|
81
|
-
if (!modelName)
|
|
82
|
-
continue;
|
|
83
|
-
const foundModelQuery = await appDb
|
|
84
|
-
.select({
|
|
85
|
-
id: models.id,
|
|
86
|
-
name: models.name,
|
|
87
|
-
uid: modelUids.uid,
|
|
88
|
-
})
|
|
89
|
-
.from(models)
|
|
90
|
-
.leftJoin(modelUids, eq(models.id, modelUids.modelId))
|
|
91
|
-
// Model names are only unique per schema: use this model's own row
|
|
92
|
-
.where(model.id ? eq(models.schemaFileId, model.id) : eq(models.name, modelName))
|
|
93
|
-
.limit(1);
|
|
94
|
-
if (!foundModelQuery[0]) {
|
|
95
|
-
console.error(`[item/events] [syncDbWithEas] model ${modelName} not found in SDK DB`);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const foundModel = {
|
|
99
|
-
id: foundModelQuery[0].id,
|
|
100
|
-
name: foundModelQuery[0].name,
|
|
101
|
-
uid: foundModelQuery[0].uid,
|
|
102
|
-
tableName: pluralize(foundModelQuery[0].name).toLowerCase(),
|
|
103
|
-
};
|
|
104
|
-
modelRecords.push(foundModel);
|
|
105
|
-
if (modelName === 'Seed') {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
const schemaString = `bytes32 ${easName(modelName)}`;
|
|
109
|
-
schemaStringToModelRecord.set(schemaString, foundModel);
|
|
110
|
-
}
|
|
111
|
-
// One candidate per name: same-named models in several schemas share one EAS schema.
|
|
112
|
-
const byName = new Map();
|
|
113
|
-
for (const record of modelRecords) {
|
|
114
|
-
if (record.name !== 'Seed')
|
|
115
|
-
byName.set(record.name, record);
|
|
116
|
-
}
|
|
117
|
-
// ADR 0009: each model's name matches at its own nameMatch level.
|
|
118
|
-
const levels = await nameMatchLevels(appDb);
|
|
119
|
-
const candidates = [...byName.values()].map((record) => ({
|
|
120
|
-
value: record,
|
|
121
|
-
name: record.name,
|
|
122
|
-
level: levels.model(record.name),
|
|
123
|
-
}));
|
|
124
|
-
const matchModelRecord = (schemaString) => {
|
|
125
|
-
if (!schemaString.startsWith('bytes32 '))
|
|
126
|
-
return undefined;
|
|
127
|
-
const match = matchEasName(schemaString.slice('bytes32 '.length), candidates);
|
|
128
|
-
return match.kind === 'match' ? match.value : undefined;
|
|
129
|
-
};
|
|
130
|
-
return {
|
|
131
|
-
schemaStringToModelRecord,
|
|
132
|
-
modelRecords,
|
|
133
|
-
matchModelRecord,
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Inserts seed rows. A row whose uid another row already has (seeds.uid is unique for attested
|
|
65
|
+
* uids) is not inserted. Returns the local ids of the rows inserted.
|
|
66
|
+
*/
|
|
137
67
|
const createSeeds = async (newSeeds) => {
|
|
138
68
|
const appDb = BaseDb.getAppDb();
|
|
139
69
|
const values = newSeeds.map((row) => {
|
|
@@ -143,10 +73,19 @@ const createSeeds = async (newSeeds) => {
|
|
|
143
73
|
...(publisher ? { publisher } : {}),
|
|
144
74
|
};
|
|
145
75
|
});
|
|
76
|
+
const inserted = new Set();
|
|
146
77
|
// Sync can create thousands of seeds at once: keep each INSERT under SQLite's parameter limit.
|
|
147
78
|
for (const chunk of chunkValues(values, rowsPerInsert(seeds))) {
|
|
148
|
-
await appDb
|
|
149
|
-
|
|
79
|
+
const rows = await appDb
|
|
80
|
+
.insert(seeds)
|
|
81
|
+
.values(chunk)
|
|
82
|
+
.onConflictDoNothing()
|
|
83
|
+
.returning({ localId: seeds.localId });
|
|
84
|
+
for (const row of rows)
|
|
85
|
+
if (row.localId)
|
|
86
|
+
inserted.add(row.localId);
|
|
87
|
+
}
|
|
88
|
+
return inserted;
|
|
150
89
|
};
|
|
151
90
|
|
|
152
91
|
/**
|
|
@@ -182,6 +121,13 @@ const syncedRevokedAt = (attestation, stored) => {
|
|
|
182
121
|
const relationValuesToExclude = [
|
|
183
122
|
'0x0000000000000000000000000000000000000000000000000000000000000020',
|
|
184
123
|
];
|
|
124
|
+
/** A property attestation revoked while its seed is live: a retraction (ADR 0021), stored as no value. */
|
|
125
|
+
const isRetracted = (property, itemSeeds, state) => {
|
|
126
|
+
if (!property.revoked)
|
|
127
|
+
return false;
|
|
128
|
+
const seedUid = state.versionUidToSeedUid.get(property.refUID);
|
|
129
|
+
return !itemSeeds.find((seed) => seed.id === seedUid)?.revoked;
|
|
130
|
+
};
|
|
185
131
|
const createSyncRunState = () => ({
|
|
186
132
|
seedUidToLocalId: new Map(),
|
|
187
133
|
seedUidToModelType: new Map(),
|
|
@@ -234,17 +180,16 @@ const resolveSyncedPropertyName = (easPropertyName, value, modelSchema, easType)
|
|
|
234
180
|
console.warn(`[item/events] [syncDbWithEas] EAS property "${easPropertyName}" is ${easType}, which doesn't fit local property "${key}" (${def?.dataType}); skipping it`);
|
|
235
181
|
return undefined;
|
|
236
182
|
}
|
|
183
|
+
// Stored under the property's storage name, as local writers store it (decision D4)
|
|
184
|
+
const propertyName = metadataStorageName(key, def);
|
|
185
|
+
const definitionId = typeof def?.id === 'string' && def.id ? def.id : undefined;
|
|
237
186
|
if (isListRelation) {
|
|
238
|
-
return { propertyName
|
|
187
|
+
return { propertyName, isRelation: true, isList: true, refSeedType: def?.ref ? easName(def.ref) : undefined, definitionId };
|
|
239
188
|
}
|
|
240
189
|
if (isSingleRef) {
|
|
241
|
-
return {
|
|
242
|
-
propertyName: toMetadataPropertyName(key, def?.dataType, def?.refValueType),
|
|
243
|
-
isRelation: true,
|
|
244
|
-
isList: false,
|
|
245
|
-
};
|
|
190
|
+
return { propertyName, isRelation: true, isList: false, definitionId };
|
|
246
191
|
}
|
|
247
|
-
return { propertyName
|
|
192
|
+
return { propertyName, isRelation: false, isList: false, dataType: normalizeDataType(def?.dataType), definitionId };
|
|
248
193
|
}
|
|
249
194
|
// A name one of the model's properties would match at a looser level than its nameMatch
|
|
250
195
|
// allows is that property's, refused (ADR 0009): don't store it under a name of its own.
|
|
@@ -289,9 +234,9 @@ const modelSchemaForSyncedProperty = async (Model, property, state) => {
|
|
|
289
234
|
* only newly stored ones, so related seeds are refreshed (new versions, revocations) on each sync.
|
|
290
235
|
*/
|
|
291
236
|
const collectRelatedSeedUids = async (properties, state) => {
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
const { Model } =
|
|
237
|
+
const _mod_0 = await import('./errors-DLSoqSHG.js');
|
|
238
|
+
const _ns_0 = _mod_0.a4;
|
|
239
|
+
const { Model } = _ns_0;
|
|
295
240
|
for (const property of properties) {
|
|
296
241
|
const parsed = parseEasPropertyMetadata(property.decodedDataJson);
|
|
297
242
|
if (!parsed.ok)
|
|
@@ -304,8 +249,9 @@ const collectRelatedSeedUids = async (properties, state) => {
|
|
|
304
249
|
continue;
|
|
305
250
|
const values = Array.isArray(value) ? value : [value];
|
|
306
251
|
for (const v of values) {
|
|
307
|
-
if (typeof v === 'string' && v && !relationValuesToExclude.includes(v))
|
|
252
|
+
if (typeof v === 'string' && v && !relationValuesToExclude.includes(v) && !isEasEmptyValue('bytes32', v)) {
|
|
308
253
|
state.relatedSeedUids.add(v);
|
|
254
|
+
}
|
|
309
255
|
}
|
|
310
256
|
}
|
|
311
257
|
};
|
|
@@ -315,9 +261,9 @@ const collectRelatedSeedUids = async (properties, state) => {
|
|
|
315
261
|
* of HTMLPage have. A name matching no local model, or several, is kept as it is.
|
|
316
262
|
*/
|
|
317
263
|
const localModelType = async (easModelName) => {
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
const { Model } =
|
|
264
|
+
const _mod_1 = await import('./errors-DLSoqSHG.js');
|
|
265
|
+
const _ns_1 = _mod_1.a4;
|
|
266
|
+
const { Model } = _ns_1;
|
|
321
267
|
try {
|
|
322
268
|
const model = Model.findByModelType(easModelName);
|
|
323
269
|
return model?.modelName ? easName(model.modelName) : easModelName;
|
|
@@ -382,7 +328,17 @@ const saveEasSeedsToDb = async ({ itemSeeds, state }) => {
|
|
|
382
328
|
...(revokedAt !== undefined && { revokedAt }),
|
|
383
329
|
});
|
|
384
330
|
}
|
|
385
|
-
await createSeeds(newSeedsData);
|
|
331
|
+
const inserted = await createSeeds(newSeedsData);
|
|
332
|
+
// A row another writer stored for the uid since the lookup above (publish recording it) is the seed.
|
|
333
|
+
const raced = newSeedsData.filter((row) => !inserted.has(row.localId)).map((row) => row.uid);
|
|
334
|
+
if (raced.length > 0) {
|
|
335
|
+
for (const [uid, row] of await findSeedRowsByUid(raced)) {
|
|
336
|
+
if (row.localId)
|
|
337
|
+
seedUidToLocalId.set(uid, row.localId);
|
|
338
|
+
if (row.type)
|
|
339
|
+
seedUidToModelType.set(uid, row.type);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
386
342
|
// All fetched seeds, not only the new ones: existing seeds can have new versions on EAS.
|
|
387
343
|
return { seedUids };
|
|
388
344
|
};
|
|
@@ -449,8 +405,30 @@ const saveEasVersionsToDb = async ({ itemVersions, state }) => {
|
|
|
449
405
|
});
|
|
450
406
|
}
|
|
451
407
|
// Bound parameters: keep each statement well under SQLite's host-parameter limit.
|
|
408
|
+
// A uid another writer stored since the lookup above is not inserted again (versions.uid is
|
|
409
|
+
// unique): its row is the version.
|
|
410
|
+
const insertedLocalIds = new Set();
|
|
452
411
|
for (let i = 0; i < rows.length; i += VERSION_INSERT_BATCH) {
|
|
453
|
-
|
|
412
|
+
const inserted = await appDb
|
|
413
|
+
.insert(versions)
|
|
414
|
+
.values(rows.slice(i, i + VERSION_INSERT_BATCH))
|
|
415
|
+
.onConflictDoNothing()
|
|
416
|
+
.returning({ localId: versions.localId });
|
|
417
|
+
for (const row of inserted)
|
|
418
|
+
if (row.localId)
|
|
419
|
+
insertedLocalIds.add(row.localId);
|
|
420
|
+
}
|
|
421
|
+
const raced = rows.filter((row) => !insertedLocalIds.has(row.localId)).map((row) => row.uid);
|
|
422
|
+
if (raced.length > 0) {
|
|
423
|
+
const stored = await selectInBatches(raced, (chunk) => appDb.select().from(versions).where(inArray(versions.uid, chunk)));
|
|
424
|
+
for (const row of stored) {
|
|
425
|
+
if (!row.uid)
|
|
426
|
+
continue;
|
|
427
|
+
if (row.localId)
|
|
428
|
+
versionUidToLocalId.set(row.uid, row.localId);
|
|
429
|
+
if (row.seedUid)
|
|
430
|
+
versionUidToSeedUid.set(row.uid, row.seedUid);
|
|
431
|
+
}
|
|
454
432
|
}
|
|
455
433
|
// Only versions that are stored locally: properties of a skipped version would have no version row.
|
|
456
434
|
return { versionUids: versionUids.filter((uid) => storedVersionUids.has(uid)) };
|
|
@@ -518,12 +496,13 @@ const createMetadataRecordsForStorageTransactionId = async (storageTransactionId
|
|
|
518
496
|
if (existingMetadataRecordRows && existingMetadataRecordRows.length > 0) {
|
|
519
497
|
continue;
|
|
520
498
|
}
|
|
521
|
-
const propertyId =
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
499
|
+
const propertyId = (await skipSeedOnAmbiguousModel({ seedLocalId, seedUid }, 'easSync.storageTransactionId', async () => resolveMetadataPropertyId({
|
|
500
|
+
definitionId: propertyDef.id,
|
|
501
|
+
propertyName: _propertyName,
|
|
502
|
+
modelName: modelType,
|
|
503
|
+
seedLocalId,
|
|
504
|
+
seedUid,
|
|
505
|
+
}))) ?? null;
|
|
527
506
|
const propertyLocalId = generateId();
|
|
528
507
|
await appDb.insert(metadata).values({
|
|
529
508
|
localId: propertyLocalId,
|
|
@@ -575,6 +554,8 @@ const saveEasPropertiesToDbBody = async ({ fetchedProperties, itemSeeds, state,
|
|
|
575
554
|
const existingPropertyRecordsUids = new Set();
|
|
576
555
|
const staleUids = new Set();
|
|
577
556
|
const revokedAtUpdates = new Map();
|
|
557
|
+
// Rows whose attestation EAS now reports revoked while the seed is live: retracted (ADR 0021)
|
|
558
|
+
const retractedUids = new Set();
|
|
578
559
|
for (const row of storedRows) {
|
|
579
560
|
if (!row.uid)
|
|
580
561
|
continue;
|
|
@@ -589,6 +570,8 @@ const saveEasPropertiesToDbBody = async ({ fetchedProperties, itemSeeds, state,
|
|
|
589
570
|
const revokedAt = syncedRevokedAt(canonical, row.revokedAt);
|
|
590
571
|
if ((row.revokedAt ?? null) !== revokedAt) {
|
|
591
572
|
revokedAtUpdates.set(row.uid, revokedAt);
|
|
573
|
+
if (revokedAt != null && isRetracted(canonical, itemSeeds, state))
|
|
574
|
+
retractedUids.add(row.uid);
|
|
592
575
|
}
|
|
593
576
|
}
|
|
594
577
|
const newProperties = itemProperties.filter((property) => !existingPropertyRecordsUids.has(property.id));
|
|
@@ -602,7 +585,15 @@ const saveEasPropertiesToDbBody = async ({ fetchedProperties, itemSeeds, state,
|
|
|
602
585
|
for (const [uid, revokedAt] of revokedAtUpdates) {
|
|
603
586
|
await appDb
|
|
604
587
|
.update(metadata)
|
|
605
|
-
.set({
|
|
588
|
+
.set({
|
|
589
|
+
revokedAt,
|
|
590
|
+
...(retractedUids.has(uid) && {
|
|
591
|
+
propertyValue: null,
|
|
592
|
+
refSeedType: null,
|
|
593
|
+
refResolvedValue: null,
|
|
594
|
+
refResolvedDisplayValue: null,
|
|
595
|
+
}),
|
|
596
|
+
})
|
|
606
597
|
.where(eq(metadata.uid, uid));
|
|
607
598
|
}
|
|
608
599
|
await syncDerivedStorageRows({ fetchedProperties, canonicalProperties: itemProperties });
|
|
@@ -691,9 +682,9 @@ const resolveSyncedSeedModel = async (Model, modelType, seed) => {
|
|
|
691
682
|
const insertSyncedProperties = async ({ newProperties, itemSeeds, state, }) => {
|
|
692
683
|
const { seedUidToLocalId, seedUidToModelType, versionUidToLocalId, versionUidToSeedUid } = state;
|
|
693
684
|
// Dynamic import to break circular dependency
|
|
694
|
-
const
|
|
695
|
-
const
|
|
696
|
-
const modelMod =
|
|
685
|
+
const _mod_2 = await import('./errors-DLSoqSHG.js');
|
|
686
|
+
const _ns_2 = _mod_2.a4;
|
|
687
|
+
const modelMod = _ns_2;
|
|
697
688
|
const { Model } = modelMod;
|
|
698
689
|
// Loads every model into Model's cache, where resolveSyncedSeedModel looks them up.
|
|
699
690
|
await Model.all();
|
|
@@ -749,21 +740,25 @@ const insertSyncedProperties = async ({ newProperties, itemSeeds, state, }) => {
|
|
|
749
740
|
if (isRelation && !isList && relationValuesToExclude.includes(propertyMetadata.value)) {
|
|
750
741
|
continue;
|
|
751
742
|
}
|
|
743
|
+
// A removal or a retraction (ADR 0021) is stored as no value, so it is the property's newest row
|
|
744
|
+
const cleared = isEasEmptyValue(easDataType, propertyMetadata.value) || isRetracted(property, itemSeeds, state);
|
|
752
745
|
// ADR 0010: numeric values decoded (Number as a decimal string, Date as ISO).
|
|
753
|
-
const decodedValue =
|
|
746
|
+
const decodedValue = cleared
|
|
747
|
+
? null
|
|
748
|
+
: syncedPropertyValue(resolvedName.dataType, easDataType, propertyMetadata.value);
|
|
754
749
|
if (decodedValue === undefined) {
|
|
755
750
|
console.warn(`[item/events] [syncDbWithEas] EAS property "${propertyNameSnake}" has a value that isn't a valid ${resolvedName.dataType}; skipping it`);
|
|
756
751
|
continue;
|
|
757
752
|
}
|
|
758
|
-
const propertyValue = typeof decodedValue === 'string' ? decodedValue : JSON.stringify(decodedValue);
|
|
759
|
-
if (isRelation && !isList) {
|
|
753
|
+
const propertyValue = decodedValue === null ? null : typeof decodedValue === 'string' ? decodedValue : JSON.stringify(decodedValue);
|
|
754
|
+
if (isRelation && !isList && !cleared) {
|
|
760
755
|
const relatedSeed = itemSeeds.find((seed) => seed.id === propertyMetadata.value);
|
|
761
756
|
if (relatedSeed && relatedSeed.schema && relatedSeed.schema.schemaNames) {
|
|
762
757
|
refSeedType = relatedSeed.schema.schemaNames[0].name;
|
|
763
758
|
refSchemaUid = relatedSeed.schemaId;
|
|
764
759
|
}
|
|
765
760
|
}
|
|
766
|
-
if (isRelation && isList) {
|
|
761
|
+
if (isRelation && isList && !cleared) {
|
|
767
762
|
const relatedSeeds = itemSeeds.filter((seed) => propertyMetadata.value.includes(seed.id));
|
|
768
763
|
if (relatedSeeds && relatedSeeds.length > 0) {
|
|
769
764
|
refSeedType = relatedSeeds[0].schema.schemaNames[0].name;
|
|
@@ -773,12 +768,14 @@ const insertSyncedProperties = async ({ newProperties, itemSeeds, state, }) => {
|
|
|
773
768
|
if (propertyNameSnake === 'storage_transaction_id') {
|
|
774
769
|
await createMetadataRecordsForStorageTransactionId(property, modelSchema, state);
|
|
775
770
|
}
|
|
776
|
-
const propertyId =
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
771
|
+
const propertyId = (await skipSeedOnAmbiguousModel({ seedLocalId, seedUid }, 'easSync.metadata', async () => resolveMetadataPropertyId({
|
|
772
|
+
definitionId: resolvedName.definitionId,
|
|
773
|
+
propertyName,
|
|
774
|
+
// EAS identifies models by name only; a locally-created seed still knows its model.
|
|
775
|
+
modelName: modelType,
|
|
776
|
+
seedLocalId,
|
|
777
|
+
seedUid,
|
|
778
|
+
}))) ?? null;
|
|
782
779
|
rows.push({
|
|
783
780
|
localId: propertyLocalId,
|
|
784
781
|
uid: property.id,
|
|
@@ -808,9 +805,9 @@ const insertSyncedProperties = async ({ newProperties, itemSeeds, state, }) => {
|
|
|
808
805
|
await appDb.insert(metadata).values(rows.slice(i, i + batchSize));
|
|
809
806
|
}
|
|
810
807
|
// A local draft of a synced property stays its value, and the conflict is recorded (ADR 0019)
|
|
811
|
-
const
|
|
812
|
-
const
|
|
813
|
-
const { keepLocalDraftsOverSyncedRows } =
|
|
808
|
+
const _mod_3 = await import('./Item-Bf4kWKpH.js');
|
|
809
|
+
const _ns_3 = _mod_3.b3;
|
|
810
|
+
const { keepLocalDraftsOverSyncedRows } = _ns_3;
|
|
814
811
|
await keepLocalDraftsOverSyncedRows(rows);
|
|
815
812
|
};
|
|
816
813
|
const saveEasPropertiesToDb = (params) => {
|
|
@@ -910,38 +907,13 @@ const runSyncFromEas = async (options) => {
|
|
|
910
907
|
const appDb = BaseDb.getAppDb();
|
|
911
908
|
// ADR 0009: this run matches names at the levels the stored schema files set now.
|
|
912
909
|
await loadNameMatchLevels(appDb);
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
// Skip schemas that don't have a corresponding model in the user's config
|
|
921
|
-
// This can happen with "bytes32 image" if there's no Image model defined
|
|
922
|
-
console.warn(`[item/events] [syncDbWithEas] Model not found for schema ${modelSchema.schema}, skipping`);
|
|
923
|
-
continue;
|
|
924
|
-
}
|
|
925
|
-
try {
|
|
926
|
-
await appDb
|
|
927
|
-
.insert(modelUids)
|
|
928
|
-
.values({
|
|
929
|
-
modelId: foundModel.id,
|
|
930
|
-
uid: modelSchema.id,
|
|
931
|
-
})
|
|
932
|
-
.onConflictDoNothing();
|
|
933
|
-
}
|
|
934
|
-
catch (err) {
|
|
935
|
-
// Model may have been deleted by test teardown or another process; skip to avoid unhandled rejection
|
|
936
|
-
const e = err;
|
|
937
|
-
const code = e?.code ?? e?.rawCode ?? e?.cause?.code ?? e?.cause?.rawCode;
|
|
938
|
-
if (code === 'SQLITE_CONSTRAINT_FOREIGNKEY' || code === 787) {
|
|
939
|
-
continue;
|
|
940
|
-
}
|
|
941
|
-
throw err;
|
|
942
|
-
}
|
|
943
|
-
schemaUids.push(modelSchema.id);
|
|
944
|
-
}
|
|
910
|
+
// ADR 0008: matched by name, so seeds published under an older SDK's name are found too. Schemas
|
|
911
|
+
// that match no local model (e.g. "bytes32 image" with no Image model) aren't fetched.
|
|
912
|
+
const modelSchemaLookups = await localModelSchemaLookups();
|
|
913
|
+
const modelSchemaMatches = matchEasModelSchemas(await getModelSchemasFromEas(modelSchemaLookups), modelSchemaLookups);
|
|
914
|
+
// The same rule as init: only each model's exact schema goes into model_uids.
|
|
915
|
+
await writeModelUids(modelSchemaMatches, appDb);
|
|
916
|
+
const schemaUids = [...new Set(modelSchemaMatches.map((match) => match.schema.id))];
|
|
945
917
|
// If no schemas were found, skip the rest of the sync process
|
|
946
918
|
// This can happen when models exist but don't have schemas registered in EAS yet
|
|
947
919
|
if (schemaUids.length === 0) {
|
|
@@ -960,18 +932,20 @@ const runSyncFromEas = async (options) => {
|
|
|
960
932
|
await syncVersionsAndPropertiesForSeeds({ seedUids, itemSeeds, state });
|
|
961
933
|
await getRelatedSeedsAndVersions(state);
|
|
962
934
|
scheduleBulkFilesDownloadFromEasSync(addresses);
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
935
|
+
// Loaded items in the browser see sync's writes through the change feed (ADR 0020); Node has none.
|
|
936
|
+
if (!isBrowser()) {
|
|
937
|
+
try {
|
|
938
|
+
const _mod_4 = await import('./Item-Bf4kWKpH.js');
|
|
939
|
+
const _ns_4 = _mod_4.b5;
|
|
940
|
+
const itemMod = _ns_4;
|
|
941
|
+
await itemMod.Item.rehydrateCachedItemsFromDbAfterEasSync();
|
|
942
|
+
}
|
|
943
|
+
catch (err) {
|
|
944
|
+
console.warn('[item/events] [syncDbWithEas] rehydrateCachedItemsFromDbAfterEasSync:', err);
|
|
945
|
+
}
|
|
971
946
|
}
|
|
972
|
-
// Other tabs reload their cached Items too (docs/MULTI_TAB.md).
|
|
973
947
|
emitAcrossTabs(EAS_SEED_DATA_SYNCED_TO_DB_EVENT);
|
|
974
948
|
};
|
|
975
949
|
|
|
976
950
|
export { VERSION_INSERT_BATCH, runSyncFromEas };
|
|
977
|
-
//# sourceMappingURL=syncDbWithEas-
|
|
951
|
+
//# sourceMappingURL=syncDbWithEas-CA7PvBgu.js.map
|