@seedprotocol/sdk 0.7.9-next.1189.g5e63267 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseFileManager-BAlySv8w.js +650 -0
- package/dist/BaseFileManager-BAlySv8w.js.map +1 -0
- package/dist/{Item-CG5IhPtL.js → Item-Bf4kWKpH.js} +5576 -6649
- package/dist/Item-Bf4kWKpH.js.map +1 -0
- package/dist/{ModelProperty-DDD47KVm.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-CZzKNL04.js → SchemaValidationService-CnmKyzR-.js} +6 -9
- package/dist/{SchemaValidationService-CZzKNL04.js.map → SchemaValidationService-CnmKyzR-.js.map} +1 -1
- package/dist/{configurePlatform-Dukm2QwO.js → configurePlatform-CiOJ1R3q.js} +3 -12
- package/dist/configurePlatform-CiOJ1R3q.js.map +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/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 +29 -1
- package/dist/{detachRowsBeforeDelete-Di1enVUF.js → detachRowsBeforeDelete-sEaUwlOU.js} +2 -13
- package/dist/{detachRowsBeforeDelete-Di1enVUF.js.map → detachRowsBeforeDelete-sEaUwlOU.js.map} +1 -1
- package/dist/dist/{index-rOTW-2QZ.d.ts → BaseFileManager-BAlySv8w.d.ts} +1407 -2700
- package/dist/dist/BaseFileManager-BAlySv8w.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-Dukm2QwO.d.ts → configurePlatform-CiOJ1R3q.d.ts} +1 -1
- package/dist/dist/configurePlatform-CiOJ1R3q.d.ts.map +1 -0
- package/dist/dist/{index-DxHpPNfn.d.ts → index-D0V-mjCV.d.ts} +39 -1
- package/dist/dist/{index-DxHpPNfn.d.ts.map → index-D0V-mjCV.d.ts.map} +1 -1
- package/dist/dist/{index.node-WsEJCOwC.d.ts → index.node-CYPemH-t.d.ts} +157 -5
- package/dist/dist/{index.node-WsEJCOwC.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-DQoyhp2c.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-DxHpPNfn.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-QPWBkLJA.js → index.browser-CUmBVYen.js} +397 -356
- package/dist/index.browser-CUmBVYen.js.map +1 -0
- package/dist/{index.node-WsEJCOwC.js → index.node-CYPemH-t.js} +10 -10
- package/dist/index.node-CYPemH-t.js.map +1 -0
- package/dist/main.js +23 -1075
- 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/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 +77 -46
- 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 +4 -50
- 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 +6 -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 +5 -1
- package/dist/src/db/read/getPropertyClear.d.ts.map +1 -1
- 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 +2 -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 +13 -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/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/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 +18 -3
- 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 -26
- 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 +13 -13
- 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 +9 -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 +2 -1
- 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 +63 -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/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 -24
- 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-BMHoou6X.js → syncDbWithEas-CA7PvBgu.js} +112 -162
- 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-BHndShch.js → tolerantWebAccess-BJqViq08.js} +10 -15
- package/dist/{tolerantWebAccess-BHndShch.js.map → tolerantWebAccess-BJqViq08.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-fIURvYRV.js → updateSeedRevokedAt-BL9Bg-G7.js} +30 -4
- package/dist/updateSeedRevokedAt-BL9Bg-G7.js.map +1 -0
- package/package.json +6 -6
- package/dist/ClientManager-DqL0q_eu.js +0 -5292
- package/dist/ClientManager-DqL0q_eu.js.map +0 -1
- package/dist/Item-CG5IhPtL.js.map +0 -1
- package/dist/ModelProperty-DDD47KVm.js.map +0 -1
- package/dist/Schema-BS8oR7QV.js +0 -4370
- package/dist/Schema-BS8oR7QV.js.map +0 -1
- package/dist/backfillMetadataPropertyIds-C7P7FL6F.js +0 -72
- package/dist/backfillMetadataPropertyIds-C7P7FL6F.js.map +0 -1
- package/dist/changeFeed-M8sGbOrW.js +0 -726
- package/dist/changeFeed-M8sGbOrW.js.map +0 -1
- package/dist/configurePlatform-Dukm2QwO.js.map +0 -1
- package/dist/dist/ClientManager-DqL0q_eu.d.ts +0 -952
- package/dist/dist/ClientManager-DqL0q_eu.d.ts.map +0 -1
- package/dist/dist/Item-CG5IhPtL.d.ts +0 -1115
- package/dist/dist/Item-CG5IhPtL.d.ts.map +0 -1
- package/dist/dist/ModelProperty-DDD47KVm.d.ts +0 -315
- package/dist/dist/ModelProperty-DDD47KVm.d.ts.map +0 -1
- package/dist/dist/Schema-BS8oR7QV.d.ts +0 -432
- package/dist/dist/Schema-BS8oR7QV.d.ts.map +0 -1
- package/dist/dist/SchemaValidationService-CZzKNL04.d.ts +0 -118
- package/dist/dist/SchemaValidationService-CZzKNL04.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-C7P7FL6F.d.ts +0 -7
- package/dist/dist/backfillMetadataPropertyIds-C7P7FL6F.d.ts.map +0 -1
- package/dist/dist/changeFeed-M8sGbOrW.d.ts +0 -160
- package/dist/dist/changeFeed-M8sGbOrW.d.ts.map +0 -1
- package/dist/dist/configurePlatform-Dukm2QwO.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-Di1enVUF.d.ts +0 -13
- package/dist/dist/detachRowsBeforeDelete-Di1enVUF.d.ts.map +0 -1
- package/dist/dist/eas-B5VJolSj.d.ts +0 -12
- package/dist/dist/eas-B5VJolSj.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-CS3nDpUU.d.ts +0 -515
- package/dist/dist/errors-CS3nDpUU.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-CuQmK7An.d.ts +0 -13
- package/dist/dist/findSeedRowsByUid-CuQmK7An.d.ts.map +0 -1
- package/dist/dist/getItem-Uha3_H0t.d.ts +0 -6
- package/dist/dist/getItem-Uha3_H0t.d.ts.map +0 -1
- package/dist/dist/getPublishPayload-pbin4lk8.d.ts +0 -65
- package/dist/dist/getPublishPayload-pbin4lk8.d.ts.map +0 -1
- package/dist/dist/getPublishPendingDiff-ByIaPvCn.d.ts +0 -18
- package/dist/dist/getPublishPendingDiff-ByIaPvCn.d.ts.map +0 -1
- package/dist/dist/getPublishUploads-BBqiowVc.d.ts +0 -89
- package/dist/dist/getPublishUploads-BBqiowVc.d.ts.map +0 -1
- package/dist/dist/index-DQoyhp2c.d.ts +0 -6
- package/dist/dist/index-DQoyhp2c.d.ts.map +0 -1
- package/dist/dist/index-njjjo74v.d.ts +0 -14
- package/dist/dist/index-njjjo74v.d.ts.map +0 -1
- package/dist/dist/index-rOTW-2QZ.d.ts.map +0 -1
- package/dist/dist/index.browser-QPWBkLJA.d.ts +0 -9959
- package/dist/dist/index.browser-QPWBkLJA.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-onFOG2x6.d.ts +0 -7
- package/dist/dist/modelPropertyRecordSchemas-onFOG2x6.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-C85DCD7K.d.ts +0 -37
- package/dist/dist/property-C85DCD7K.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-CjUPOFeu.d.ts +0 -13
- package/dist/dist/propertyValidationRules-CjUPOFeu.d.ts.map +0 -1
- package/dist/dist/publishDraftGraph-DBWAN72w.d.ts +0 -93
- package/dist/dist/publishDraftGraph-DBWAN72w.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-fIURvYRV.d.ts +0 -21
- package/dist/dist/resolveModelForSyncedSeed-fIURvYRV.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-BMHoou6X.d.ts +0 -13
- package/dist/dist/syncDbWithEas-BMHoou6X.d.ts.map +0 -1
- package/dist/dist/tolerantWebAccess-BHndShch.d.ts +0 -113
- package/dist/dist/tolerantWebAccess-BHndShch.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-DpfG6ztE.d.ts +0 -11
- package/dist/dist/updateSeedRevokedAt-DpfG6ztE.d.ts.map +0 -1
- package/dist/eas-B5VJolSj.js +0 -67
- package/dist/eas-B5VJolSj.js.map +0 -1
- package/dist/errors-CS3nDpUU.js +0 -4006
- package/dist/errors-CS3nDpUU.js.map +0 -1
- package/dist/eventBus-7vxTCc3a.js +0 -64
- package/dist/eventBus-7vxTCc3a.js.map +0 -1
- package/dist/findSeedRowsByUid-CuQmK7An.js +0 -47
- package/dist/findSeedRowsByUid-CuQmK7An.js.map +0 -1
- package/dist/getItem-Uha3_H0t.js +0 -45
- package/dist/getItem-Uha3_H0t.js.map +0 -1
- package/dist/getPublishPayload-pbin4lk8.js +0 -1736
- package/dist/getPublishPayload-pbin4lk8.js.map +0 -1
- package/dist/getPublishPendingDiff-ByIaPvCn.js +0 -118
- package/dist/getPublishPendingDiff-ByIaPvCn.js.map +0 -1
- package/dist/getPublishUploads-BBqiowVc.js +0 -1080
- package/dist/getPublishUploads-BBqiowVc.js.map +0 -1
- package/dist/index-DQoyhp2c.js.map +0 -1
- package/dist/index-DxHpPNfn.js.map +0 -1
- package/dist/index-njjjo74v.js +0 -29
- package/dist/index-njjjo74v.js.map +0 -1
- package/dist/index-rOTW-2QZ.js +0 -4760
- package/dist/index-rOTW-2QZ.js.map +0 -1
- package/dist/index.browser-QPWBkLJA.js.map +0 -1
- package/dist/index.node-WsEJCOwC.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-onFOG2x6.js +0 -94
- package/dist/modelPropertyRecordSchemas-onFOG2x6.js.map +0 -1
- package/dist/property-C85DCD7K.js +0 -289
- package/dist/property-C85DCD7K.js.map +0 -1
- package/dist/propertyValidationRules-CjUPOFeu.js +0 -73
- package/dist/propertyValidationRules-CjUPOFeu.js.map +0 -1
- package/dist/publishDraftGraph-DBWAN72w.js +0 -505
- package/dist/publishDraftGraph-DBWAN72w.js.map +0 -1
- package/dist/resolveModelForSyncedSeed-fIURvYRV.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-BMHoou6X.js.map +0 -1
- package/dist/updateSeedRevokedAt-DpfG6ztE.js +0 -31
- package/dist/updateSeedRevokedAt-DpfG6ztE.js.map +0 -1
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
import { L as BaseDb, m as metadata, ae as getItemModelScope, M as ModelPropertyDataTypes, R as resolveModelRecord, E as properties, p as models, n as normalizeDataType, s as seeds, ad as ZERO_BYTES32, q as normalizeRelationPropertyValue, r as resolveSeedIdsFromRefString, l as isPublishedSeedRef } from './index-rOTW-2QZ.js';
|
|
2
|
-
import { M as METADATA_LATEST_FIRST_ORDER_SQL, N as isVersionRevoked, L as parseListPropertyValueFromStorage } from './Item-CG5IhPtL.js';
|
|
3
|
-
import './errors-CS3nDpUU.js';
|
|
4
|
-
import { getPropertySchema } from './property-C85DCD7K.js';
|
|
5
|
-
import { eq, sql, and } from 'drizzle-orm';
|
|
6
|
-
import { upperFirst, camelCase } from 'lodash-es';
|
|
7
|
-
import { isPlaceholderUid } from '@seedprotocol/eas';
|
|
8
|
-
import { f as findSeedRowsByUid } from './findSeedRowsByUid-CuQmK7An.js';
|
|
9
|
-
import 'pluralize';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Points each property whose context holds a published row's uid at the property's newest row when
|
|
13
|
-
* that row is a draft, clearing the uid. Publish skips a property with a uid in patch mode, so an
|
|
14
|
-
* edit the context missed (another tab's write, a metadata update the live query dropped while the
|
|
15
|
-
* property was saving) would never attest. The context takes the row's value too, the way the
|
|
16
|
-
* change feed sets it, so the payload attests the value of the row it names (audit 1.1).
|
|
17
|
-
*/
|
|
18
|
-
const reconcilePropertyDraftRows = async (item) => {
|
|
19
|
-
const stale = item.properties.filter((property) => property.uid && property.localId);
|
|
20
|
-
const seedLocalId = item.seedLocalId;
|
|
21
|
-
if (stale.length === 0 || !seedLocalId)
|
|
22
|
-
return;
|
|
23
|
-
const appDb = BaseDb.getAppDb();
|
|
24
|
-
if (!appDb)
|
|
25
|
-
return;
|
|
26
|
-
const rows = await appDb
|
|
27
|
-
.select({
|
|
28
|
-
localId: metadata.localId,
|
|
29
|
-
uid: metadata.uid,
|
|
30
|
-
propertyName: metadata.propertyName,
|
|
31
|
-
propertyValue: metadata.propertyValue,
|
|
32
|
-
refResolvedValue: metadata.refResolvedValue,
|
|
33
|
-
})
|
|
34
|
-
.from(metadata)
|
|
35
|
-
.where(eq(metadata.seedLocalId, seedLocalId))
|
|
36
|
-
.orderBy(sql.raw(METADATA_LATEST_FIRST_ORDER_SQL));
|
|
37
|
-
for (const property of stale) {
|
|
38
|
-
// The context's row gives the stored property name (relations and lists store a variant).
|
|
39
|
-
const current = rows.find((row) => row.localId === property.localId);
|
|
40
|
-
if (!current?.propertyName)
|
|
41
|
-
continue;
|
|
42
|
-
const newest = rows.find((row) => row.propertyName === current.propertyName);
|
|
43
|
-
if (!newest?.localId || newest.localId === current.localId || !isPlaceholderUid(newest.uid))
|
|
44
|
-
continue;
|
|
45
|
-
// As in the change feed: an ItemStorage row pointing at its file holds no content to show.
|
|
46
|
-
const contentInFile = property.propertyDef?.storageType === 'ItemStorage' &&
|
|
47
|
-
newest.propertyValue == null &&
|
|
48
|
-
!!newest.refResolvedValue;
|
|
49
|
-
property.getService().send({
|
|
50
|
-
type: 'updateContext',
|
|
51
|
-
localId: newest.localId,
|
|
52
|
-
uid: undefined,
|
|
53
|
-
propertyValue: newest.propertyValue,
|
|
54
|
-
...(contentInFile ? {} : { renderValue: newest.propertyValue }),
|
|
55
|
-
refResolvedValue: newest.refResolvedValue || undefined,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const matchesDataType = (actual, expected) => normalizeDataType(actual) === expected;
|
|
61
|
-
async function resolvePropertyDef(modelName, propertyName, scope) {
|
|
62
|
-
const schema = await getPropertySchema(modelName, propertyName, scope);
|
|
63
|
-
if (schema)
|
|
64
|
-
return schema;
|
|
65
|
-
const db = BaseDb.getAppDb();
|
|
66
|
-
if (!db)
|
|
67
|
-
return undefined;
|
|
68
|
-
try {
|
|
69
|
-
const normalizedModelName = upperFirst(camelCase(modelName));
|
|
70
|
-
const modelRecord = await resolveModelRecord(normalizedModelName, scope, db);
|
|
71
|
-
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
72
|
-
if (modelRecords.length === 0 || !modelRecords[0].id)
|
|
73
|
-
return undefined;
|
|
74
|
-
const propertyRecords = await db
|
|
75
|
-
.select()
|
|
76
|
-
.from(properties)
|
|
77
|
-
.where(and(eq(properties.modelId, modelRecords[0].id), eq(properties.name, propertyName)))
|
|
78
|
-
.limit(1);
|
|
79
|
-
if (propertyRecords.length === 0)
|
|
80
|
-
return undefined;
|
|
81
|
-
const propRecord = propertyRecords[0];
|
|
82
|
-
let refModelName;
|
|
83
|
-
if (propRecord.refModelId != null) {
|
|
84
|
-
const refModelRows = await db
|
|
85
|
-
.select({ name: models.name })
|
|
86
|
-
.from(models)
|
|
87
|
-
.where(eq(models.id, propRecord.refModelId))
|
|
88
|
-
.limit(1);
|
|
89
|
-
refModelName = refModelRows[0]?.name ?? undefined;
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
dataType: propRecord.dataType,
|
|
93
|
-
ref: refModelName ?? undefined,
|
|
94
|
-
refValueType: propRecord.refValueType || undefined,
|
|
95
|
-
storageType: propRecord.storageType || undefined,
|
|
96
|
-
localStorageDir: propRecord.localStorageDir || undefined,
|
|
97
|
-
filenameSuffix: propRecord.filenameSuffix || undefined,
|
|
98
|
-
required: propRecord.required ?? undefined,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
const getSegmentedItemProperties = async (item) => {
|
|
106
|
-
const itemBasicProperties = [];
|
|
107
|
-
const itemRelationProperties = [];
|
|
108
|
-
const itemListProperties = [];
|
|
109
|
-
const itemUploadProperties = [];
|
|
110
|
-
const itemImageProperties = [];
|
|
111
|
-
const itemStorageProperties = [];
|
|
112
|
-
let itemStorageTransactionProperty;
|
|
113
|
-
let itemScope;
|
|
114
|
-
// Publish decides from each property's uid; it must name the property's newest row.
|
|
115
|
-
await reconcilePropertyDraftRows(item);
|
|
116
|
-
for (const itemProperty of item.properties) {
|
|
117
|
-
let propertyDef = itemProperty.propertyDef;
|
|
118
|
-
// When propertyDef is missing (e.g. external app, Model not registered), resolve inline
|
|
119
|
-
// so properties are not skipped and metadata attestations can be created
|
|
120
|
-
if (!propertyDef && item.modelName) {
|
|
121
|
-
itemScope ?? (itemScope = await getItemModelScope(item));
|
|
122
|
-
const resolved = await resolvePropertyDef(item.modelName, itemProperty.propertyName, itemScope);
|
|
123
|
-
if (resolved) {
|
|
124
|
-
itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: resolved });
|
|
125
|
-
propertyDef = resolved;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
// Last resort: Model and DB don't have schema. Use Text so property routes to
|
|
129
|
-
// itemBasicProperties and can be attested (covers title, description, etc.)
|
|
130
|
-
const fallbackDef = { dataType: 'Text' };
|
|
131
|
-
itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: fallbackDef });
|
|
132
|
-
propertyDef = fallbackDef;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (!propertyDef) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
const isItemStorage = propertyDef.storageType &&
|
|
139
|
-
propertyDef.storageType === 'ItemStorage';
|
|
140
|
-
const isStorageTransaction = itemProperty.propertyName === 'storageTransactionId' ||
|
|
141
|
-
itemProperty.propertyName === 'storage_transaction_id';
|
|
142
|
-
const isStorageSeedType = matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Image) ||
|
|
143
|
-
matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.File) ||
|
|
144
|
-
matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Html) ||
|
|
145
|
-
matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Json) ||
|
|
146
|
-
(matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Relation) &&
|
|
147
|
-
(matchesDataType(propertyDef.refValueType, ModelPropertyDataTypes.Image) ||
|
|
148
|
-
matchesDataType(propertyDef.refValueType, ModelPropertyDataTypes.File) ||
|
|
149
|
-
matchesDataType(propertyDef.refValueType, ModelPropertyDataTypes.Html) ||
|
|
150
|
-
matchesDataType(propertyDef.refValueType, ModelPropertyDataTypes.Json)));
|
|
151
|
-
if (isStorageSeedType) {
|
|
152
|
-
itemImageProperties.push(itemProperty);
|
|
153
|
-
if (matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Relation)) {
|
|
154
|
-
itemRelationProperties.push(itemProperty);
|
|
155
|
-
}
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.Relation)) {
|
|
159
|
-
itemRelationProperties.push(itemProperty);
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
if (matchesDataType(propertyDef.dataType, ModelPropertyDataTypes.List)) {
|
|
163
|
-
// List-of-relations: ref present, goes to processListProperty
|
|
164
|
-
// List-of-primitives: ref absent, treat as basic property
|
|
165
|
-
const listRef = propertyDef.ref || propertyDef.refModelName;
|
|
166
|
-
if (listRef) {
|
|
167
|
-
itemListProperties.push(itemProperty);
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
itemBasicProperties.push(itemProperty);
|
|
171
|
-
}
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if (isItemStorage) {
|
|
175
|
-
itemStorageProperties.push(itemProperty);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (isStorageTransaction) {
|
|
179
|
-
itemStorageTransactionProperty = { itemProperty, childProperties: [] };
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
itemBasicProperties.push(itemProperty);
|
|
183
|
-
}
|
|
184
|
-
if (itemStorageTransactionProperty && itemStorageProperties.length > 0) {
|
|
185
|
-
itemStorageTransactionProperty.childProperties = itemStorageProperties;
|
|
186
|
-
}
|
|
187
|
-
if (itemStorageTransactionProperty) {
|
|
188
|
-
itemUploadProperties.push(itemStorageTransactionProperty);
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
itemBasicProperties,
|
|
192
|
-
itemRelationProperties,
|
|
193
|
-
itemListProperties,
|
|
194
|
-
itemUploadProperties,
|
|
195
|
-
itemImageProperties,
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* The items one internal read loads (a publish payload build, a publish walk). `getItem` and
|
|
201
|
-
* `Item.find` take a cache hold on each item they return; `release()` drops this read's holds, so
|
|
202
|
-
* an item nobody else holds stops instead of staying loaded for the session. A read that hands
|
|
203
|
-
* none of these items to its caller releases them when it is done.
|
|
204
|
-
*/
|
|
205
|
-
class ItemLoads {
|
|
206
|
-
constructor() {
|
|
207
|
-
this.held = [];
|
|
208
|
-
}
|
|
209
|
-
async getItem(params) {
|
|
210
|
-
// Dynamic imports: getItem and Item import the publish readers that use this
|
|
211
|
-
const { getItem } = await import('./getItem-Uha3_H0t.js');
|
|
212
|
-
return this.keep(await getItem(params));
|
|
213
|
-
}
|
|
214
|
-
async find(params) {
|
|
215
|
-
const _mod_0 = await import('./Item-CG5IhPtL.js');
|
|
216
|
-
const _ns_0 = _mod_0.av;
|
|
217
|
-
const { Item } = _ns_0;
|
|
218
|
-
return this.keep(await Item.find(params));
|
|
219
|
-
}
|
|
220
|
-
/** Adds an item the caller loaded (one hold) to the holds `release()` drops. */
|
|
221
|
-
keep(item) {
|
|
222
|
-
if (item)
|
|
223
|
-
this.held.push(item);
|
|
224
|
-
return item;
|
|
225
|
-
}
|
|
226
|
-
/** Drops every hold this read took, except one hold on each item in `except`, which passes to the caller. */
|
|
227
|
-
release(except = []) {
|
|
228
|
-
const kept = new Set(except);
|
|
229
|
-
for (const item of this.held.splice(0)) {
|
|
230
|
-
if (kept.delete(item))
|
|
231
|
-
continue;
|
|
232
|
-
try {
|
|
233
|
-
item.unload();
|
|
234
|
-
}
|
|
235
|
-
catch {
|
|
236
|
-
// Already stopped
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/** Runs `read` with `loads`, or with its own ItemLoads released when `read` settles. */
|
|
242
|
-
async function withItemLoads(loads, read) {
|
|
243
|
-
const own = new ItemLoads();
|
|
244
|
-
try {
|
|
245
|
-
return await read(own);
|
|
246
|
-
}
|
|
247
|
-
finally {
|
|
248
|
-
own.release();
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* True when the item's seed attestation was revoked (`seeds.revoked_at` set, by unpublish or EAS
|
|
254
|
-
* sync). Such a seed can't take new versions: publishing again creates a new seed attestation
|
|
255
|
-
* (see "Republishing" in docs/ATTESTATION_REVOCATION.md).
|
|
256
|
-
*/
|
|
257
|
-
const isSeedRevoked = async (seedLocalId) => {
|
|
258
|
-
if (!seedLocalId)
|
|
259
|
-
return false;
|
|
260
|
-
const appDb = BaseDb.getAppDb();
|
|
261
|
-
if (!appDb)
|
|
262
|
-
return false;
|
|
263
|
-
const [row] = await appDb
|
|
264
|
-
.select({ revokedAt: seeds.revokedAt })
|
|
265
|
-
.from(seeds)
|
|
266
|
-
.where(eq(seeds.localId, seedLocalId))
|
|
267
|
-
.limit(1);
|
|
268
|
-
return isVersionRevoked(row?.revokedAt);
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
const selectSeed = {
|
|
272
|
-
seedLocalId: seeds.localId,
|
|
273
|
-
seedUid: seeds.uid,
|
|
274
|
-
revokedAt: seeds.revokedAt,
|
|
275
|
-
type: seeds.type,
|
|
276
|
-
};
|
|
277
|
-
/**
|
|
278
|
-
* The local seed row a relation/list/image ref points at, by local id or uid. A uid resolves as
|
|
279
|
-
* {@link findSeedRowsByUid} resolves it (the order EAS sync matches seeds in): the old uid of a seed
|
|
280
|
-
* that was unpublished and published again resolves to that seed, through its old version rows.
|
|
281
|
-
* Null when nothing local matches (e.g. a published uid with no local copy).
|
|
282
|
-
*/
|
|
283
|
-
const findRelatedSeedRow = async ({ seedLocalId, seedUid, }) => {
|
|
284
|
-
const appDb = BaseDb.getAppDb();
|
|
285
|
-
if (!appDb)
|
|
286
|
-
return null;
|
|
287
|
-
if (seedLocalId) {
|
|
288
|
-
const [row] = await appDb.select(selectSeed).from(seeds).where(eq(seeds.localId, seedLocalId)).limit(1);
|
|
289
|
-
if (row?.seedLocalId)
|
|
290
|
-
return row;
|
|
291
|
-
}
|
|
292
|
-
if (!seedUid || seedUid === ZERO_BYTES32)
|
|
293
|
-
return null;
|
|
294
|
-
const row = (await findSeedRowsByUid([seedUid])).get(seedUid);
|
|
295
|
-
return row?.localId
|
|
296
|
-
? { seedLocalId: row.localId, seedUid: row.uid, revokedAt: row.revokedAt, type: row.type }
|
|
297
|
-
: null;
|
|
298
|
-
};
|
|
299
|
-
/** The seed is attested and its attestation is live. */
|
|
300
|
-
const isLivePublishedSeed = (row) => !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && !isVersionRevoked(row.revokedAt);
|
|
301
|
-
/** The seed was attested and that attestation was revoked (unpublished). */
|
|
302
|
-
const isUnpublishedSeed = (row) => !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && isVersionRevoked(row.revokedAt);
|
|
303
|
-
/** Model a relation/list/image property points at, from its definition. */
|
|
304
|
-
function relatedModelNameFromDef(propertyDef) {
|
|
305
|
-
const def = propertyDef;
|
|
306
|
-
if (!def)
|
|
307
|
-
return undefined;
|
|
308
|
-
const dataType = normalizeDataType(def.dataType);
|
|
309
|
-
if (dataType === ModelPropertyDataTypes.Image)
|
|
310
|
-
return 'Image';
|
|
311
|
-
if (dataType === ModelPropertyDataTypes.File)
|
|
312
|
-
return 'File';
|
|
313
|
-
if (dataType === ModelPropertyDataTypes.Html)
|
|
314
|
-
return 'Html';
|
|
315
|
-
return def.ref ?? def.refModelName;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Name of the item's Html property whose value is the Html seed `htmlSeedLocalId`: the property
|
|
319
|
-
* that refers to the images embedded in that Html (htmlEmbeddedImageCoPublish rows).
|
|
320
|
-
*/
|
|
321
|
-
function htmlPropertyNameForHtmlSeed(item, htmlSeedLocalId) {
|
|
322
|
-
const want = htmlSeedLocalId.trim();
|
|
323
|
-
for (const p of item.properties ?? []) {
|
|
324
|
-
if (normalizeDataType(p.propertyDef?.dataType) !== ModelPropertyDataTypes.Html)
|
|
325
|
-
continue;
|
|
326
|
-
const snap = p.getService().getSnapshot();
|
|
327
|
-
const value = 'context' in snap ? snap.context.propertyValue : undefined;
|
|
328
|
-
if (typeof value === 'string' && value.trim() === want)
|
|
329
|
-
return p.propertyName;
|
|
330
|
-
}
|
|
331
|
-
return 'html';
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* The draft items a publish of an item carries along, and how it walks to them.
|
|
336
|
-
*
|
|
337
|
-
* A publish attests the item and every draft item (no seed uid yet) reachable from it through
|
|
338
|
-
* relation and list-of-relation properties, each with its full property set. Already-published
|
|
339
|
-
* targets are referenced by their current uid and not walked into; revoked ones stop the publish
|
|
340
|
-
* (RelatedItemUnpublishedError). getPublishPayload, getPublishUploads, getPublishUploadData (publish
|
|
341
|
-
* package), summarizePublishWork and the Html-embedded image co-publish all walk this graph in the
|
|
342
|
-
* same order: depth first, properties in item order (relations, then lists), list members in order.
|
|
343
|
-
*
|
|
344
|
-
* Cycles: an item can only attest the uid of a seed published before it in the same publish, so a
|
|
345
|
-
* ref back to an item still being walked (an ancestor that gets a new seed in this publish) can't be
|
|
346
|
-
* attested. Such a property is deferred: left out of this publish (it keeps no uid, so the next
|
|
347
|
-
* publish of its item attests it, with the target's uid). For A ↔ B reached from A, A attests B's
|
|
348
|
-
* uid and B's relation to A is deferred.
|
|
349
|
-
*/
|
|
350
|
-
/** Relation properties that point at model items (not Image/File/Html/Json storage seeds). */
|
|
351
|
-
function draftWalkProperties(segmented) {
|
|
352
|
-
const storage = new Set(segmented.itemImageProperties);
|
|
353
|
-
return {
|
|
354
|
-
relationProperties: segmented.itemRelationProperties.filter((p) => !storage.has(p)),
|
|
355
|
-
listProperties: segmented.itemListProperties,
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
const propertyContext = (prop) => {
|
|
359
|
-
const snapshot = prop.getService().getSnapshot();
|
|
360
|
-
return snapshot && 'context' in snapshot
|
|
361
|
-
? (snapshot.context ?? null)
|
|
362
|
-
: null;
|
|
363
|
-
};
|
|
364
|
-
/** Seed refs held by a relation property (one) or a list property (each member). */
|
|
365
|
-
function propertySeedRefs(prop, isList) {
|
|
366
|
-
const context = propertyContext(prop);
|
|
367
|
-
if (!context)
|
|
368
|
-
return [];
|
|
369
|
-
let value = context.propertyValue;
|
|
370
|
-
if (isList) {
|
|
371
|
-
if (typeof value === 'string')
|
|
372
|
-
value = parseListPropertyValueFromStorage(value);
|
|
373
|
-
const arr = Array.isArray(value) ? value : value != null ? [value] : [];
|
|
374
|
-
return arr
|
|
375
|
-
.map((v) => v && typeof v === 'object'
|
|
376
|
-
? normalizeRelationPropertyValue(v.seedLocalId ??
|
|
377
|
-
v.localId ??
|
|
378
|
-
v.seedUid ??
|
|
379
|
-
v.uid)
|
|
380
|
-
: normalizeRelationPropertyValue(v))
|
|
381
|
-
.filter((v) => !!v);
|
|
382
|
-
}
|
|
383
|
-
const ref = normalizeRelationPropertyValue(value);
|
|
384
|
-
return ref ? [ref] : [];
|
|
385
|
-
}
|
|
386
|
-
const isZeroUid = (uid) => !uid || uid === ZERO_BYTES32;
|
|
387
|
-
/** The item gets a new seed attestation in this publish: a draft, or a revoked seed published again. */
|
|
388
|
-
async function getsNewSeed(item) {
|
|
389
|
-
return isZeroUid(item.seedUid) || (await isSeedRevoked(item.seedLocalId));
|
|
390
|
-
}
|
|
391
|
-
/** Would the publish attest this property (so walk its refs)? Same rule as getPublishPayload. */
|
|
392
|
-
function walksProperty(prop, forceFullSnapshot) {
|
|
393
|
-
if (prop.uid && !forceFullSnapshot)
|
|
394
|
-
return false;
|
|
395
|
-
const ctx = propertyContext(prop);
|
|
396
|
-
const value = ctx?.propertyValue;
|
|
397
|
-
return value != null && value !== '' && !(Array.isArray(value) && value.length === 0);
|
|
398
|
-
}
|
|
399
|
-
async function loadItem(seedLocalId, loads) {
|
|
400
|
-
try {
|
|
401
|
-
return await loads.getItem({ seedLocalId });
|
|
402
|
-
}
|
|
403
|
-
catch {
|
|
404
|
-
return undefined;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
async function getPublishDraftGraph(root, options) {
|
|
408
|
-
const forceFullSnapshot = options?.forceFullSnapshot === true;
|
|
409
|
-
const strict = options?.strict === true;
|
|
410
|
-
const loads = options?.loads ?? new ItemLoads();
|
|
411
|
-
const drafts = [];
|
|
412
|
-
const deferredProperties = new Set();
|
|
413
|
-
const backReferences = new Map();
|
|
414
|
-
const visited = new Set([root.seedLocalId]);
|
|
415
|
-
const inProgress = new Set();
|
|
416
|
-
if (await getsNewSeed(root))
|
|
417
|
-
inProgress.add(root.seedLocalId);
|
|
418
|
-
/** Draft target of a ref, or undefined (published, revoked, unknown). */
|
|
419
|
-
const draftTarget = async (prop, ref, isList) => {
|
|
420
|
-
const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(ref);
|
|
421
|
-
if (!seedLocalId && !seedUid) {
|
|
422
|
-
if (strict && !isList) {
|
|
423
|
-
throw new Error(`Invalid relation value for ${prop.propertyName}: expected local seed id or 0x uid`);
|
|
424
|
-
}
|
|
425
|
-
return undefined;
|
|
426
|
-
}
|
|
427
|
-
const row = await findRelatedSeedRow({ seedLocalId, seedUid });
|
|
428
|
-
const targetLocalId = row?.seedLocalId ?? seedLocalId;
|
|
429
|
-
if (!targetLocalId)
|
|
430
|
-
return undefined;
|
|
431
|
-
// An item getting a new seed in this publish, still being walked (also the root when it is a
|
|
432
|
-
// revoked seed published again): a back edge, whatever its current uid.
|
|
433
|
-
if (inProgress.has(targetLocalId))
|
|
434
|
-
return { seedLocalId: targetLocalId };
|
|
435
|
-
// Published (live or revoked): referenced by uid / reported, never walked into.
|
|
436
|
-
if (row && !isZeroUid(row.seedUid))
|
|
437
|
-
return undefined;
|
|
438
|
-
if (visited.has(targetLocalId))
|
|
439
|
-
return { seedLocalId: targetLocalId };
|
|
440
|
-
const item = await loadItem(targetLocalId, loads);
|
|
441
|
-
if (!item) {
|
|
442
|
-
if (strict && !isList && !isPublishedSeedRef(ref)) {
|
|
443
|
-
throw new Error(`No relatedItem found for ${prop.propertyName}`);
|
|
444
|
-
}
|
|
445
|
-
return undefined;
|
|
446
|
-
}
|
|
447
|
-
if (!isZeroUid(item.seedUid))
|
|
448
|
-
return undefined;
|
|
449
|
-
return { seedLocalId: targetLocalId, item };
|
|
450
|
-
};
|
|
451
|
-
const visit = async (item) => {
|
|
452
|
-
const segmented = await getSegmentedItemProperties(item);
|
|
453
|
-
const { relationProperties, listProperties } = draftWalkProperties(segmented);
|
|
454
|
-
const walk = async (prop, isList) => {
|
|
455
|
-
if (!walksProperty(prop, forceFullSnapshot))
|
|
456
|
-
return;
|
|
457
|
-
const targets = [];
|
|
458
|
-
for (const ref of propertySeedRefs(prop, isList)) {
|
|
459
|
-
const t = await draftTarget(prop, ref, isList);
|
|
460
|
-
if (t)
|
|
461
|
-
targets.push(t);
|
|
462
|
-
}
|
|
463
|
-
const back = targets.filter((t) => inProgress.has(t.seedLocalId)).map((t) => t.seedLocalId);
|
|
464
|
-
if (back.length > 0) {
|
|
465
|
-
deferredProperties.add(prop);
|
|
466
|
-
backReferences.set(prop, new Set(back));
|
|
467
|
-
}
|
|
468
|
-
for (const t of targets) {
|
|
469
|
-
if (!t.item || visited.has(t.seedLocalId))
|
|
470
|
-
continue;
|
|
471
|
-
visited.add(t.seedLocalId);
|
|
472
|
-
inProgress.add(t.seedLocalId);
|
|
473
|
-
await visit(t.item);
|
|
474
|
-
inProgress.delete(t.seedLocalId);
|
|
475
|
-
drafts.push({ item: t.item, via: prop, viaList: isList });
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
for (const prop of relationProperties)
|
|
479
|
-
await walk(prop, false);
|
|
480
|
-
for (const prop of listProperties)
|
|
481
|
-
await walk(prop, true);
|
|
482
|
-
};
|
|
483
|
-
try {
|
|
484
|
-
await visit(root);
|
|
485
|
-
}
|
|
486
|
-
catch (err) {
|
|
487
|
-
if (!options?.loads)
|
|
488
|
-
loads.release();
|
|
489
|
-
throw err;
|
|
490
|
-
}
|
|
491
|
-
if (!options?.loads)
|
|
492
|
-
loads.release(drafts.map((d) => d.item));
|
|
493
|
-
return { drafts, deferredProperties, backReferences };
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
var publishDraftGraph = /*#__PURE__*/Object.freeze({
|
|
497
|
-
__proto__: null,
|
|
498
|
-
draftWalkProperties: draftWalkProperties,
|
|
499
|
-
getPublishDraftGraph: getPublishDraftGraph,
|
|
500
|
-
getsNewSeed: getsNewSeed,
|
|
501
|
-
propertySeedRefs: propertySeedRefs
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
export { ItemLoads as I, getSegmentedItemProperties as a, isUnpublishedSeed as b, isLivePublishedSeed as c, draftWalkProperties as d, findRelatedSeedRow as f, getPublishDraftGraph as g, htmlPropertyNameForHtmlSeed as h, isSeedRevoked as i, publishDraftGraph as p, relatedModelNameFromDef as r, withItemLoads as w };
|
|
505
|
-
//# sourceMappingURL=publishDraftGraph-DBWAN72w.js.map
|