@seedprotocol/sdk 0.7.8 → 0.7.9-next.1177.ga3e08ed
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/README.md +1 -1
- package/dist/{ClientManager-B1r_8P5Z.js → ClientManager-GZfXErDX.js} +187 -1451
- package/dist/ClientManager-GZfXErDX.js.map +1 -0
- package/dist/{Item-CjTEShfk.js → Item-0oDoTPhi.js} +175 -238
- package/dist/Item-0oDoTPhi.js.map +1 -0
- package/dist/{ModelProperty-C3749Wjq.js → ModelProperty-i5flwzQG.js} +41 -40
- package/dist/ModelProperty-i5flwzQG.js.map +1 -0
- package/dist/{Schema-CX9CTtho.js → Schema-PFZwG9Nl.js} +88 -1623
- package/dist/Schema-PFZwG9Nl.js.map +1 -0
- package/dist/{SchemaValidationService-T5mqnY8q.js → SchemaValidationService-DnGKel4V.js} +7 -6
- package/dist/{SchemaValidationService-T5mqnY8q.js.map → SchemaValidationService-DnGKel4V.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js → backfillMetadataPropertyIds-BbxgavEQ.js} +4 -4
- package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js.map → backfillMetadataPropertyIds-BbxgavEQ.js.map} +1 -1
- package/dist/{changeFeed-DcsZ7deG.js → changeFeed-DKdVlUmt.js} +8 -7
- package/dist/changeFeed-DKdVlUmt.js.map +1 -0
- package/dist/configurePlatform-CrMafpMW.js +29 -0
- package/dist/configurePlatform-CrMafpMW.js.map +1 -0
- package/dist/db/drizzle/0024_merge_republished_ghost_seeds.sql +29 -0
- package/dist/db/drizzle/meta/0024_snapshot.json +1645 -0
- package/dist/db/drizzle/meta/_journal.json +7 -0
- package/dist/{detachRowsBeforeDelete-Bo_pky-R.js → detachRowsBeforeDelete-DXFYSHRR.js} +2 -3
- package/dist/{detachRowsBeforeDelete-Bo_pky-R.js.map → detachRowsBeforeDelete-DXFYSHRR.js.map} +1 -1
- package/dist/dist/{ClientManager-B1r_8P5Z.d.ts → ClientManager-GZfXErDX.d.ts} +323 -406
- package/dist/dist/ClientManager-GZfXErDX.d.ts.map +1 -0
- package/dist/dist/{Item-CjTEShfk.d.ts → Item-0oDoTPhi.d.ts} +85 -91
- package/dist/dist/Item-0oDoTPhi.d.ts.map +1 -0
- package/dist/dist/{ModelProperty-C3749Wjq.d.ts → ModelProperty-i5flwzQG.d.ts} +1 -1
- package/dist/dist/{ModelProperty-C3749Wjq.d.ts.map → ModelProperty-i5flwzQG.d.ts.map} +1 -1
- package/dist/dist/{Schema-CX9CTtho.d.ts → Schema-PFZwG9Nl.d.ts} +7 -183
- package/dist/dist/Schema-PFZwG9Nl.d.ts.map +1 -0
- package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts → SchemaValidationService-DnGKel4V.d.ts} +1 -1
- package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts.map → SchemaValidationService-DnGKel4V.d.ts.map} +1 -1
- package/dist/dist/{backfillMetadataPropertyIds-DWWkh-Ex.d.ts → backfillMetadataPropertyIds-BbxgavEQ.d.ts} +1 -1
- package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts.map +1 -0
- package/dist/dist/{changeFeed-DcsZ7deG.d.ts → changeFeed-DKdVlUmt.d.ts} +17 -20
- package/dist/dist/changeFeed-DKdVlUmt.d.ts.map +1 -0
- package/dist/dist/configurePlatform-CrMafpMW.d.ts +5 -0
- package/dist/dist/configurePlatform-CrMafpMW.d.ts.map +1 -0
- package/dist/dist/{detachRowsBeforeDelete-Bo_pky-R.d.ts → detachRowsBeforeDelete-DXFYSHRR.d.ts} +1 -1
- package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts.map +1 -0
- package/dist/dist/{eas--9vtNkma.d.ts → eas-dyepi5jz.d.ts} +1 -1
- package/dist/dist/eas-dyepi5jz.d.ts.map +1 -0
- package/dist/dist/{errors-Do7v6RKu.d.ts → errors-C1qUEZ7A.d.ts} +5 -2
- package/dist/dist/errors-C1qUEZ7A.d.ts.map +1 -0
- package/dist/dist/{errors-rIWK7gwJ.d.ts → errors-D1zHAqjr.d.ts} +1 -1
- package/dist/dist/{errors-rIWK7gwJ.d.ts.map → errors-D1zHAqjr.d.ts.map} +1 -1
- package/dist/dist/eventBus-7vxTCc3a.d.ts +18 -0
- package/dist/dist/eventBus-7vxTCc3a.d.ts.map +1 -0
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts +13 -0
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts.map +1 -0
- package/dist/dist/{getItem-5j22EWWE.d.ts → getItem-Bhjecbia.d.ts} +1 -1
- package/dist/dist/getItem-Bhjecbia.d.ts.map +1 -0
- package/dist/dist/{getPublishPayload-BGl2SaGK.d.ts → getPublishPayload-DH4rMqXG.d.ts} +1 -1
- package/dist/dist/getPublishPayload-DH4rMqXG.d.ts.map +1 -0
- package/dist/dist/{getPublishUploads-DVsDx6Xf.d.ts → getPublishUploads-BzUIDA2G.d.ts} +5 -5
- package/dist/dist/getPublishUploads-BzUIDA2G.d.ts.map +1 -0
- package/dist/dist/index-CkYb3wcU.d.ts +14 -0
- package/dist/dist/index-CkYb3wcU.d.ts.map +1 -0
- package/dist/dist/{index-Dp4uyZYx.d.ts → index-DJmWkVIK.d.ts} +5 -5
- package/dist/dist/index-DJmWkVIK.d.ts.map +1 -0
- package/dist/dist/{index-C0SetTd1.d.ts → index-Dx_GTdyQ.d.ts} +1457 -1513
- package/dist/dist/index-Dx_GTdyQ.d.ts.map +1 -0
- package/dist/dist/{index-CZQrNqvq.d.ts → index-PbnKw2es.d.ts} +1 -1
- package/dist/dist/{index-CZQrNqvq.d.ts.map → index-PbnKw2es.d.ts.map} +1 -1
- package/dist/dist/{index.browser-Ll71Y_Dl.d.ts → index.browser-i9uPJice.d.ts} +13 -40
- package/dist/dist/{index.browser-Ll71Y_Dl.d.ts.map → index.browser-i9uPJice.d.ts.map} +1 -1
- package/dist/dist/{index.node-CgltN0cC.d.ts → index.node-CzMwMr_d.d.ts} +2 -45
- package/dist/dist/{index.node-CgltN0cC.d.ts.map → index.node-CzMwMr_d.d.ts.map} +1 -1
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +9 -0
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +1 -0
- package/dist/dist/{modelPropertyRecordSchemas-C_lYTzMr.d.ts → modelPropertyRecordSchemas-C5lW9aA-.d.ts} +1 -1
- package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts.map +1 -0
- package/dist/dist/platform.browser.d.ts +2 -2
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/dist/{property-pcDxNEpy.d.ts → property-BwYtg5Q_.d.ts} +3 -3
- package/dist/dist/property-BwYtg5Q_.d.ts.map +1 -0
- package/dist/dist/{propertyValidationRules-BEjN0f3-.d.ts → propertyValidationRules-CyHdpcPP.d.ts} +1 -1
- package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts.map +1 -0
- package/dist/dist/{publishDraftGraph-I5yKe1Xz.d.ts → publishDraftGraph-C5F6b7GK.d.ts} +23 -6
- package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts.map +1 -0
- package/dist/dist/{resolveModelForSyncedSeed-C5KXn6ex.d.ts → resolveModelForSyncedSeed-4gO9Hfn2.d.ts} +1 -1
- package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts.map +1 -0
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts +13 -0
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts.map +1 -0
- package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts → tolerantWebAccess-DecKDGen.d.ts} +1 -1
- package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts.map → tolerantWebAccess-DecKDGen.d.ts.map} +1 -1
- package/dist/dist/{updateSeedRevokedAt-CR4zwn-6.d.ts → updateSeedRevokedAt-CP606vKs.d.ts} +1 -1
- package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts.map +1 -0
- package/dist/{eas--9vtNkma.js → eas-dyepi5jz.js} +3 -4
- package/dist/eas-dyepi5jz.js.map +1 -0
- package/dist/{errors-Do7v6RKu.js → errors-C1qUEZ7A.js} +12 -6
- package/dist/errors-C1qUEZ7A.js.map +1 -0
- package/dist/{errors-rIWK7gwJ.js → errors-D1zHAqjr.js} +46 -98
- package/dist/errors-D1zHAqjr.js.map +1 -0
- package/dist/eventBus-7vxTCc3a.js +64 -0
- package/dist/eventBus-7vxTCc3a.js.map +1 -0
- package/dist/findSeedRowsByUid-CT3sOXXw.js +47 -0
- package/dist/findSeedRowsByUid-CT3sOXXw.js.map +1 -0
- package/dist/{getItem-5j22EWWE.js → getItem-Bhjecbia.js} +5 -5
- package/dist/{getItem-5j22EWWE.js.map → getItem-Bhjecbia.js.map} +1 -1
- package/dist/{getPublishPayload-BGl2SaGK.js → getPublishPayload-DH4rMqXG.js} +27 -27
- package/dist/getPublishPayload-DH4rMqXG.js.map +1 -0
- package/dist/{getPublishUploads-DVsDx6Xf.js → getPublishUploads-BzUIDA2G.js} +64 -95
- package/dist/getPublishUploads-BzUIDA2G.js.map +1 -0
- package/dist/{index-CJK3F_MK.js → index-CkYb3wcU.js} +9 -8
- package/dist/index-CkYb3wcU.js.map +1 -0
- package/dist/{index-Dp4uyZYx.js → index-DJmWkVIK.js} +9 -8
- package/dist/index-DJmWkVIK.js.map +1 -0
- package/dist/{index-C0SetTd1.js → index-Dx_GTdyQ.js} +27 -463
- package/dist/index-Dx_GTdyQ.js.map +1 -0
- package/dist/{index-CZQrNqvq.js → index-PbnKw2es.js} +2 -2
- package/dist/index-PbnKw2es.js.map +1 -0
- package/dist/{index.browser-Ll71Y_Dl.js → index.browser-i9uPJice.js} +239 -179
- package/dist/index.browser-i9uPJice.js.map +1 -0
- package/dist/{index.node-CgltN0cC.js → index.node-CzMwMr_d.js} +51 -216
- package/dist/index.node-CzMwMr_d.js.map +1 -0
- package/dist/main.js +165 -241
- package/dist/main.js.map +1 -1
- package/dist/minimumUpgradeVersion-BDhHvHtr.js +81 -0
- package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +1 -0
- package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js → modelPropertyRecordSchemas-C5lW9aA-.js} +5 -5
- package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js.map → modelPropertyRecordSchemas-C5lW9aA-.js.map} +1 -1
- package/dist/node.js +14 -221
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +8 -7
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +7 -7
- package/dist/{property-pcDxNEpy.js → property-BwYtg5Q_.js} +8 -9
- package/dist/property-BwYtg5Q_.js.map +1 -0
- package/dist/{propertyValidationRules-BEjN0f3-.js → propertyValidationRules-CyHdpcPP.js} +10 -10
- package/dist/{propertyValidationRules-BEjN0f3-.js.map → propertyValidationRules-CyHdpcPP.js.map} +1 -1
- package/dist/{publishDraftGraph-I5yKe1Xz.js → publishDraftGraph-C5F6b7GK.js} +104 -35
- package/dist/publishDraftGraph-C5F6b7GK.js.map +1 -0
- package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js → resolveModelForSyncedSeed-4gO9Hfn2.js} +3 -2
- package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js.map → resolveModelForSyncedSeed-4gO9Hfn2.js.map} +1 -1
- package/dist/seedSchema/PendingWriteSchema.ts +3 -2
- package/dist/src/Item/Item.d.ts +1 -0
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/runPublish.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +2 -2
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +0 -20
- package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +0 -20
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +1 -107
- package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
- package/dist/src/Schema/validation.d.ts +0 -1
- package/dist/src/Schema/validation.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts +8 -3
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/createSqlocalDrizzle.d.ts +20 -2
- package/dist/src/browser/db/createSqlocalDrizzle.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/constants.d.ts +0 -51
- package/dist/src/client/constants.d.ts.map +1 -1
- package/dist/src/db/minimumUpgradeVersion.d.ts +33 -0
- package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -0
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts +2 -1
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts.map +1 -1
- package/dist/src/db/read/findSeedRowsByUid.d.ts +13 -0
- package/dist/src/db/read/findSeedRowsByUid.d.ts.map +1 -0
- package/dist/src/db/read/getItemData.d.ts.map +1 -1
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts +2 -1
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts.map +1 -1
- package/dist/src/db/read/getLatestVersionRow.d.ts +1 -1
- package/dist/src/db/read/getLatestVersionRow.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts +4 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts +1 -3
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts +2 -0
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
- package/dist/src/db/read/itemLoads.d.ts +20 -0
- package/dist/src/db/read/itemLoads.d.ts.map +1 -0
- package/dist/src/db/read/publishDraftGraph.d.ts +7 -0
- package/dist/src/db/read/publishDraftGraph.d.ts.map +1 -1
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts +4 -4
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts.map +1 -1
- package/dist/src/db/read/subqueries/latestVersion.d.ts +14 -0
- package/dist/src/db/read/subqueries/latestVersion.d.ts.map +1 -0
- package/dist/src/db/read/subqueries/versionData.d.ts +2 -2
- package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -1
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +6 -0
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -1
- package/dist/src/db/write/easSyncProcess.d.ts +1 -1
- package/dist/src/db/write/easSyncProcess.d.ts.map +1 -1
- package/dist/src/db/write/updateVersionUid.d.ts +2 -2
- package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts +1 -10
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/item/easSyncManager.d.ts +0 -1
- package/dist/src/events/item/easSyncManager.d.ts.map +1 -1
- package/dist/src/events/item/index.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts +0 -10
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/IFileManager.d.ts +7 -0
- package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/errors.d.ts +4 -1
- package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
- package/dist/src/helpers/arweaveContentTags.d.ts +1 -2
- package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +3 -12
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +3 -28
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/ethereumUtils.d.ts +0 -2
- package/dist/src/helpers/ethereumUtils.d.ts.map +1 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +2 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +0 -7
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/itemStorageFile.d.ts +2 -2
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +2 -1
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -1
- package/dist/src/helpers/schema.d.ts +0 -73
- package/dist/src/helpers/schema.d.ts.map +1 -1
- package/dist/src/helpers/updateSchema.d.ts +0 -46
- package/dist/src/helpers/updateSchema.d.ts.map +1 -1
- package/dist/src/imports/index.d.ts +0 -1
- package/dist/src/imports/index.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts +2 -1
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/helpers/dotSeedDir.d.ts +7 -0
- package/dist/src/node/helpers/dotSeedDir.d.ts.map +1 -0
- package/dist/src/node/index.d.ts +0 -5
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/outbox/index.d.ts +1 -1
- package/dist/src/outbox/index.d.ts.map +1 -1
- package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
- package/dist/src/outbox/outbox.d.ts +3 -19
- package/dist/src/outbox/outbox.d.ts.map +1 -1
- 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/platform/types.d.ts +0 -2
- package/dist/src/platform/types.d.ts.map +1 -1
- package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
- package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -1
- package/dist/src/services/write/actors/validateEntity.d.ts +1 -1
- package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -1
- package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -1
- package/dist/src/services/write/writeProcessMachine.d.ts +1 -23
- package/dist/src/services/write/writeProcessMachine.d.ts.map +1 -1
- package/dist/src/stores/eas.d.ts +0 -1
- package/dist/src/stores/eas.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +1 -18
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/machines.d.ts +1 -32
- package/dist/src/types/machines.d.ts.map +1 -1
- package/dist/{syncDbWithEas-b4fESZ7C.js → syncDbWithEas-DUu_wjUG.js} +37 -105
- package/dist/syncDbWithEas-DUu_wjUG.js.map +1 -0
- package/dist/{tolerantWebAccess-CIpS7RLk.js → tolerantWebAccess-DecKDGen.js} +9 -8
- package/dist/{tolerantWebAccess-CIpS7RLk.js.map → tolerantWebAccess-DecKDGen.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-CR4zwn-6.js → updateSeedRevokedAt-CP606vKs.js} +3 -3
- package/dist/{updateSeedRevokedAt-CR4zwn-6.js.map → updateSeedRevokedAt-CP606vKs.js.map} +1 -1
- package/package.json +6 -8
- package/dist/ClientManager-B1r_8P5Z.js.map +0 -1
- package/dist/Item-CjTEShfk.js.map +0 -1
- package/dist/ModelProperty-C3749Wjq.js.map +0 -1
- package/dist/Schema-CX9CTtho.js.map +0 -1
- package/dist/changeFeed-DcsZ7deG.js.map +0 -1
- package/dist/configurePlatform-AWild9o4.js +0 -81
- package/dist/configurePlatform-AWild9o4.js.map +0 -1
- package/dist/dist/ClientManager-B1r_8P5Z.d.ts.map +0 -1
- package/dist/dist/Item-CjTEShfk.d.ts.map +0 -1
- package/dist/dist/Schema-CX9CTtho.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-DWWkh-Ex.d.ts.map +0 -1
- package/dist/dist/changeFeed-DcsZ7deG.d.ts.map +0 -1
- package/dist/dist/configurePlatform-AWild9o4.d.ts +0 -30
- package/dist/dist/configurePlatform-AWild9o4.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-Bo_pky-R.d.ts.map +0 -1
- package/dist/dist/eas--9vtNkma.d.ts.map +0 -1
- package/dist/dist/errors-Do7v6RKu.d.ts.map +0 -1
- package/dist/dist/getItem-5j22EWWE.d.ts.map +0 -1
- package/dist/dist/getPublishPayload-BGl2SaGK.d.ts.map +0 -1
- package/dist/dist/getPublishUploads-DVsDx6Xf.d.ts.map +0 -1
- package/dist/dist/index-C0SetTd1.d.ts.map +0 -1
- package/dist/dist/index-CJK3F_MK.d.ts +0 -14
- package/dist/dist/index-CJK3F_MK.d.ts.map +0 -1
- package/dist/dist/index-Dp4uyZYx.d.ts.map +0 -1
- package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.d.ts.map +0 -1
- package/dist/dist/property-pcDxNEpy.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-BEjN0f3-.d.ts.map +0 -1
- package/dist/dist/publishDraftGraph-I5yKe1Xz.d.ts.map +0 -1
- package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts +0 -17
- package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-C5KXn6ex.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts +0 -22
- package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-CR4zwn-6.d.ts.map +0 -1
- package/dist/eas--9vtNkma.js.map +0 -1
- package/dist/errors-Do7v6RKu.js.map +0 -1
- package/dist/errors-rIWK7gwJ.js.map +0 -1
- package/dist/getPublishPayload-BGl2SaGK.js.map +0 -1
- package/dist/getPublishUploads-DVsDx6Xf.js.map +0 -1
- package/dist/index-C0SetTd1.js.map +0 -1
- package/dist/index-CJK3F_MK.js.map +0 -1
- package/dist/index-CZQrNqvq.js.map +0 -1
- package/dist/index-Dp4uyZYx.js.map +0 -1
- package/dist/index.browser-Ll71Y_Dl.js.map +0 -1
- package/dist/index.node-CgltN0cC.js.map +0 -1
- package/dist/property-pcDxNEpy.js.map +0 -1
- package/dist/publishDraftGraph-I5yKe1Xz.js.map +0 -1
- package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js +0 -98
- package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js.map +0 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +0 -5
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +0 -1
- package/dist/src/browser/db/sqlWasmClient.d.ts +0 -1
- package/dist/src/browser/db/sqlWasmClient.d.ts.map +0 -1
- package/dist/src/browser/helpers/PathResolver.d.ts +0 -41
- package/dist/src/browser/helpers/PathResolver.d.ts.map +0 -1
- package/dist/src/browser/index.d.ts +0 -3
- package/dist/src/browser/index.d.ts.map +0 -1
- package/dist/src/browser/seed.d.ts +0 -21
- package/dist/src/browser/seed.d.ts.map +0 -1
- package/dist/src/browser/workers/content-hash.d.ts +0 -2
- package/dist/src/browser/workers/content-hash.d.ts.map +0 -1
- package/dist/src/browser/workers/dbWorker.d.ts +0 -1
- package/dist/src/browser/workers/dbWorker.d.ts.map +0 -1
- package/dist/src/client/BaseClientManager.d.ts +0 -7
- package/dist/src/client/BaseClientManager.d.ts.map +0 -1
- package/dist/src/client/actions/setAddresses.d.ts +0 -2
- package/dist/src/client/actions/setAddresses.d.ts.map +0 -1
- package/dist/src/db/alignRowPublishers.d.ts +0 -25
- package/dist/src/db/alignRowPublishers.d.ts.map +0 -1
- package/dist/src/db/clearStoredDisplayUrls.d.ts +0 -18
- package/dist/src/db/clearStoredDisplayUrls.d.ts.map +0 -1
- package/dist/src/db/migrateLegacyItemStorageRows.d.ts +0 -57
- package/dist/src/db/migrateLegacyItemStorageRows.d.ts.map +0 -1
- package/dist/src/db/read/getExistingItem.d.ts +0 -12
- package/dist/src/db/read/getExistingItem.d.ts.map +0 -1
- package/dist/src/db/read/getModels.d.ts +0 -5
- package/dist/src/db/read/getModels.d.ts.map +0 -1
- package/dist/src/db/read/getVersionsForVersionUids.d.ts +0 -10
- package/dist/src/db/read/getVersionsForVersionUids.d.ts.map +0 -1
- package/dist/src/db/removeForeignAttestationRows.d.ts +0 -27
- package/dist/src/db/removeForeignAttestationRows.d.ts.map +0 -1
- package/dist/src/db/resetAmbiguousLegacyItemData.d.ts +0 -17
- package/dist/src/db/resetAmbiguousLegacyItemData.d.ts.map +0 -1
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +0 -14
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +0 -1
- package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts +0 -44
- package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts.map +0 -1
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts +0 -18
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +0 -1
- package/dist/src/db/write/saveAppState.d.ts +0 -2
- package/dist/src/db/write/saveAppState.d.ts.map +0 -1
- package/dist/src/eslint-rules/align-imports.d.ts +0 -12
- package/dist/src/eslint-rules/align-imports.d.ts.map +0 -1
- package/dist/src/events/files/index.d.ts +0 -4
- package/dist/src/events/files/index.d.ts.map +0 -1
- package/dist/src/events/index.d.ts +0 -13
- package/dist/src/events/index.d.ts.map +0 -1
- package/dist/src/events/services/allItems.d.ts +0 -6
- package/dist/src/events/services/allItems.d.ts.map +0 -1
- package/dist/src/events/services/index.d.ts +0 -3
- package/dist/src/events/services/index.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/index.d.ts +0 -30
- package/dist/src/helpers/ArweaveClient/index.d.ts.map +0 -1
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +0 -26
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +0 -1
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts +0 -16
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +0 -1
- package/dist/src/helpers/easRevokedFilter.d.ts +0 -2
- package/dist/src/helpers/easRevokedFilter.d.ts.map +0 -1
- package/dist/src/helpers/file/fetchAll/actors.d.ts +0 -16
- package/dist/src/helpers/file/fetchAll/actors.d.ts.map +0 -1
- package/dist/src/helpers/file/fetchAll/index.d.ts +0 -58
- package/dist/src/helpers/file/fetchAll/index.d.ts.map +0 -1
- package/dist/src/helpers/files.d.ts +0 -10
- package/dist/src/helpers/files.d.ts.map +0 -1
- package/dist/src/helpers/updateMachineContext.d.ts +0 -7
- package/dist/src/helpers/updateMachineContext.d.ts.map +0 -1
- package/dist/src/imports/markdown.d.ts +0 -40
- package/dist/src/imports/markdown.d.ts.map +0 -1
- package/dist/src/node/constants.d.ts +0 -2
- package/dist/src/node/constants.d.ts.map +0 -1
- package/dist/src/node/db/index.d.ts +0 -5
- package/dist/src/node/db/index.d.ts.map +0 -1
- package/dist/src/node/helpers/PathResolver.d.ts +0 -44
- package/dist/src/node/helpers/PathResolver.d.ts.map +0 -1
- package/dist/src/node/helpers/scripts.d.ts +0 -14
- package/dist/src/node/helpers/scripts.d.ts.map +0 -1
- package/dist/src/node/seed.d.ts +0 -1
- package/dist/src/node/seed.d.ts.map +0 -1
- package/dist/src/node/webpack/fs-proxy.d.ts +0 -4
- package/dist/src/node/webpack/fs-proxy.d.ts.map +0 -1
- package/dist/src/node/webpack/index.d.ts +0 -7
- package/dist/src/node/webpack/index.d.ts.map +0 -1
- package/dist/src/services/events.d.ts +0 -2
- package/dist/src/services/events.d.ts.map +0 -1
- package/dist/src/testing/platformTestHandle.d.ts +0 -8
- package/dist/src/testing/platformTestHandle.d.ts.map +0 -1
- package/dist/src/types/browser.d.ts +0 -24
- package/dist/src/types/browser.d.ts.map +0 -1
- package/dist/src/types/seedProtocol.d.ts +0 -16
- package/dist/src/types/seedProtocol.d.ts.map +0 -1
- package/dist/src/types/services.d.ts +0 -1
- package/dist/src/types/services.d.ts.map +0 -1
- package/dist/syncDbWithEas-b4fESZ7C.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export { C as ConflictError, d as ItemCreateError, I as ItemCreateValidationError, M as Model, U as UnknownModelError } from './errors-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
export { getPropertySchema } from './property-
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
1
|
+
export { C as ConflictError, d as ItemCreateError, I as ItemCreateValidationError, M as Model, U as UnknownModelError } from './errors-D1zHAqjr.js';
|
|
2
|
+
import { L as BaseDb, v as versions, a8 as normalizePublisher, s as seeds, ad as generateId, m as metadata, p as models, E as properties, n as normalizeDataType, a6 as listRelationEasPropertyName, q as normalizeRelationPropertyValue, r as resolveSeedIdsFromRefString, i as isDataType, M as ModelPropertyDataTypes, a2 as INTERNAL_PROPERTY_NAMES, x as htmlEmbeddedImageCoPublish, a0 as ZERO_BYTES32, Q as BaseFileManager, W as getStorageDirForDataType } from './index-Dx_GTdyQ.js';
|
|
3
|
+
export { A as AmbiguousModelError, an as CONTENT_SHA256_TAG, ao as CONTENT_TYPE_TAG, ac as EAS_SEED_DATA_SYNCED_TO_DB_EVENT, a5 as INTERNAL_DATA_TYPES, ap as ImageSize, aq as SEED_PROTOCOL_SCHEMA_NAME, ar as SeedModels, as as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, h as appState, t as arweaveL1FinalizeJobs, Y as buildArweaveContentTags, at as classifyMediaRef, au as closestImageSize, av as contentSha256TagMatches, a7 as easPropertyNameForPublish, u as easSyncProcesses, aw as ensureImageLocal, ax as getAddressesForItemsFilter, ay as getArweaveUrlForTransaction, X as getContentSha256, k as getCorrectId, az as getFeedItemStringField, l as isPublishedSeedRef, z as modelSchemas, o as modelUids, aA as normalizeAddressConfig, aB as normalizeAddressList, aC as normalizeArweaveTxIdForEnsure, aD as normalizeFeedItemFields, ae as normalizeHexAddress, H as propertyUids, I as publishProcesses, aE as resolveMediaRef, J as schemas, K as uploadProcesses } from './index-Dx_GTdyQ.js';
|
|
4
|
+
export { getPropertySchema } from './property-BwYtg5Q_.js';
|
|
5
|
+
export { e as eventEmitter } from './eventBus-7vxTCc3a.js';
|
|
6
|
+
export { A as ADDRESSES_PERSISTED_EVENT, F as FILES_CHANGED_EVENT, L as LOCAL_COPIES_REMOVED_EVENT, T as TabLockTimeoutError, i as isChangeFeedRunning, a as isLeaderTab, p as parseAddressesPersistedPayload, w as watchEntityChanges, b as watchEntityRows, c as whenLeaderTab } from './changeFeed-DKdVlUmt.js';
|
|
7
|
+
export { E as EAS_CHAIN_ID_APP_STATE_KEY, I as INIT_CONFIG_CONFLICT_MESSAGE, o as assertLocalDbChain, p as claimUnpublishedDrafts, C as client, q as createLocalQueryDataSource, u as easSyncActor, v as getClient, x as getPublishedSeedRecord, y as getSchemaNameFromId, i as importJsonSchema, z as isSeedQueryLocalSourceRegistered, A as listSchemas, B as loadAllSchemasFromDb, D as mergeEasSyncRequestIntents, r as readJsonImportFile, F as registerSeedQueryLocalSource, G as requestEasSyncFromAddressChange, H as requestEasSyncFromModelsInit, J as sendEasSyncClientRequest, K as setRetriesWhenOnlineEnabled, L as startEasSyncActor, j as syncSchemaFromSource, k as transformImportToSchemaFile, M as unregisterSeedQueryLocalSource } from './ClientManager-GZfXErDX.js';
|
|
8
|
+
import { U as latestVersionOrder, K as isVersionRevoked, C as compareMetadataRowsLatestFirst, F as parseListPropertyValueFromStorage, V as isPublishedMetadataRow, E as getLatestPublishedVersionRow } from './Item-0oDoTPhi.js';
|
|
9
|
+
export { W as ClientManagerState, I as Item, q as ItemProperty, t as ItemPropertySaveValidationError, M as METADATA_LATEST_FIRST_ORDER_SQL, X as MachineIds, u as OwnershipError, Y as PUBLISH_NOT_CONFIGURED_MESSAGE, v as assertItemOwned, Z as createNewItem, J as getGetAdditionalSyncAddresses, _ as getGetPublisherForNewSeeds, $ as getMetadataLatest, a0 as getPublishExecutor, a1 as getRevokeExecutor, a2 as getUploadExecutor, a3 as getVersionData, x as isItemOwned, a4 as isLocalUnsealedDraft, a5 as isSeedRowOwned, a6 as localUnsealedDraftSql, a7 as ownedPublisherSql, a8 as ownedSeedsSql, a9 as pickLatestMetadataRowPerProperty, aa as placeholderUidSql, ab as propertyMachine, ac as publisherInAddressListSql, ad as publisherIsInOwnedSet, ae as setAdditionalSyncAddresses, af as setGetPublisherForNewSeeds, ag as setPublishExecutor, ah as setRevokeExecutor, ai as setUploadExecutor, B as waitForEntityIdle } from './Item-0oDoTPhi.js';
|
|
10
|
+
import { eq, and, inArray, or, isNotNull, ne } from 'drizzle-orm';
|
|
11
|
+
import { isPlaceholderUid, isValidEasAttestationUid, normalizeBytes32Hex, easName, BaseQueryClient, BaseEasClient, GET_SCHEMAS } from '@seedprotocol/eas';
|
|
12
|
+
export { EAS_CHAIN_DEPLOYMENTS, BaseEasClient as EasClient, VERSION_SCHEMA_DEF, VERSION_SCHEMA_UID, easName, getCanonicalItemPropertiesFromEas, getEasChainDeployment, getEasEndpoint, getEasReadChainId, getEasSchemaUidBySchemaName, getItemPropertiesFromEas, getItemVersionsFromEas, getSeedsBySchemaName, getSeedsFromSchemaUids, isPlaceholderUid, isValidEasAttestationUid, matchEasName, normalizeBytes32Hex, pickLatestPropertyAttestationsByRefAndSchema, setSchemaUidForModel, setSchemaUidForSchemaDefinition, withExcludeRevokedFilter } from '@seedprotocol/eas';
|
|
13
|
+
export { S as Schema, r as renameModelProperty, s as schemaMachine, u as updateModelProperties } from './Schema-PFZwG9Nl.js';
|
|
14
|
+
export { D as DatabaseNotPersistentError, F as FileSystemLockedError } from './errors-C1qUEZ7A.js';
|
|
15
|
+
export { M as MODEL_AMBIGUOUS_EVENT } from './resolveModelForSyncedSeed-4gO9Hfn2.js';
|
|
16
|
+
export { ModelProperty } from './ModelProperty-i5flwzQG.js';
|
|
17
|
+
export { getModelSchemasFromEas } from './eas-dyepi5jz.js';
|
|
17
18
|
export { BaseArweaveClient, DEFAULT_ARWEAVE_GATEWAYS, DEFAULT_ARWEAVE_GRAPHQL_URL, DEFAULT_ARWEAVE_HOST, DEFAULT_GATEWAY_SIDECAR_HOST, DEFAULT_GATEWAY_SIDECAR_PORT, DEFAULT_SEED_FEED_HYPER_KEY, DEFAULT_SEED_GATEWAY_HYPER_KEY, SEED_RSS_IMAGE_RELATION_FIELD_KEYS, ensureReadGatewaySelected, fetchArweaveRawFromBaseUrl, fetchArweaveRawTextAcrossGateways, getArweaveReadBaseUrls, getArweaveUploadStatus, getDefaultArweaveReadGatewayHostsOrdered, getLastHealthyReadGatewayHost, getPreferredArweaveReadBaseUrls, getReadGatewayHostsForConfig, getResolvedArweaveReadBaseUrls, getResolvedSeedGatewayEndpoints, getUploadApiArweaveDataUrl, getUploadApiArweaveStatusUrl, getUploadPipelineTransactionStatus, hasArweaveContentReadTransform, invalidateReadGatewayCache, invalidateSidecarProbeCache, isArweaveL1AnchoringComplete, isEasAttestationExplorerUrl, isGatewayHostCircuitOpen, isKnownArweaveGatewayHostname, isReadGatewayKnownHealthy, mergePrimaryHostWithDefaults, normalizeGatewayHostKey, normalizeUploadApiBaseUrl, queryArweaveGatewayTransaction, queryArweaveGatewayTransactionWithFallback, readArweaveContentResponse, recordGatewayHostFailure, recordGatewayHostSuccess, resetArweaveReadGatewayForTests, resolveSeedGatewayEndpoints, resolveSeedRssImageRelationFromItem, resolveSeedRssImageRelationRef, seedGatewayConfigFromClientContext, seedGatewayConfigFromSeedConfig, setArweaveContentReadTransform, setPreferredArweaveReadBaseUrls, setResolvedSeedGatewayEndpoints, transformArweaveContent } from '@seedprotocol/arweave';
|
|
18
|
-
export { u as updateSeedRevokedAt } from './updateSeedRevokedAt-
|
|
19
|
-
import { a as getSegmentedItemProperties, g as getPublishDraftGraph, i as isSeedRevoked, f as findRelatedSeedRow, b as isUnpublishedSeed, h as htmlPropertyNameForHtmlSeed, r as relatedModelNameFromDef } from './publishDraftGraph-
|
|
20
|
-
export { P as PublishValidationFailedError, R as RELATED_ITEM_UNPUBLISHED_CODE, a as RelatedItemUnpublishedError, r as resolvePublishPayloadValues, v as validateItemForPublish } from './getPublishPayload-
|
|
19
|
+
export { u as updateSeedRevokedAt } from './updateSeedRevokedAt-CP606vKs.js';
|
|
20
|
+
import { I as ItemLoads, a as getSegmentedItemProperties, w as withItemLoads, g as getPublishDraftGraph, i as isSeedRevoked, f as findRelatedSeedRow, b as isUnpublishedSeed, h as htmlPropertyNameForHtmlSeed, r as relatedModelNameFromDef } from './publishDraftGraph-C5F6b7GK.js';
|
|
21
|
+
export { P as PublishValidationFailedError, R as RELATED_ITEM_UNPUBLISHED_CODE, a as RelatedItemUnpublishedError, r as resolvePublishPayloadValues, v as validateItemForPublish } from './getPublishPayload-DH4rMqXG.js';
|
|
21
22
|
import 'pluralize';
|
|
22
|
-
import { g as getRelatedDraftsCoPublishedWith, f as findEmbeddedImageFilePath } from './getPublishUploads-
|
|
23
|
-
export { H as HTML_EMBEDDED_MAX_IMAGES_PER_DOC, a as HTML_EMBEDDED_MAX_IMAGE_BYTES, b as HTML_EMBEDDED_MAX_TOTAL_BYTES, c as HtmlEmbeddedDataUriLimitError, d as HtmlSeedPropertyRefError, S as SEED_PROPERTY_REF_PREFIX, e as clearHtmlEmbeddedImageCoPublishRows, h as extractDataUriImagesFromHtml, i as findSeedPropertyRefsInHtml, j as getPublishUploadData, k as itemHasPublishUploadCandidates, p as prepareHtmlEmbeddedImagesForPublish, r as replaceDataUrisInParsedHtml, l as replaceSeedPropertyRefsInHtml, m as resolveEffectiveHtmlEmbeddedDataUriPolicy, n as rewriteHtmlEmbeddedImagesOnDisk } from './getPublishUploads-
|
|
24
|
-
import 'js-yaml';
|
|
23
|
+
import { g as getRelatedDraftsCoPublishedWith, f as findEmbeddedImageFilePath } from './getPublishUploads-BzUIDA2G.js';
|
|
24
|
+
export { H as HTML_EMBEDDED_MAX_IMAGES_PER_DOC, a as HTML_EMBEDDED_MAX_IMAGE_BYTES, b as HTML_EMBEDDED_MAX_TOTAL_BYTES, c as HtmlEmbeddedDataUriLimitError, d as HtmlSeedPropertyRefError, S as SEED_PROPERTY_REF_PREFIX, e as clearHtmlEmbeddedImageCoPublishRows, h as extractDataUriImagesFromHtml, i as findSeedPropertyRefsInHtml, j as getPublishUploadData, k as itemHasPublishUploadCandidates, p as prepareHtmlEmbeddedImagesForPublish, r as replaceDataUrisInParsedHtml, l as replaceSeedPropertyRefsInHtml, m as resolveEffectiveHtmlEmbeddedDataUriPolicy, n as rewriteHtmlEmbeddedImagesOnDisk } from './getPublishUploads-BzUIDA2G.js';
|
|
25
25
|
import 'xstate';
|
|
26
26
|
import 'debug';
|
|
27
27
|
import './model-oHA3YhOd.js';
|
|
@@ -29,79 +29,22 @@ import '@sinclair/typebox';
|
|
|
29
29
|
import 'drizzle-orm/sqlite-core';
|
|
30
30
|
import 'nanoid';
|
|
31
31
|
import 'nanoid-dictionary';
|
|
32
|
-
import '@seedprotocol/query';
|
|
33
32
|
import '@noble/hashes/sha256';
|
|
34
33
|
import '@noble/hashes/sha3';
|
|
35
34
|
import '@noble/hashes/utils';
|
|
36
35
|
import 'lodash-es';
|
|
36
|
+
import '@seedprotocol/query';
|
|
37
37
|
import 'rxjs';
|
|
38
|
-
import './SchemaValidationService-
|
|
38
|
+
import './SchemaValidationService-DnGKel4V.js';
|
|
39
39
|
import '@sinclair/typebox/value';
|
|
40
|
+
import './findSeedRowsByUid-CT3sOXXw.js';
|
|
40
41
|
import 'parse5';
|
|
41
42
|
import './mimeTypes-C9r76DCH.js';
|
|
42
43
|
|
|
43
|
-
const getEasSchemaForItemProperty = async ({ schemaUid, propertyName, easDataType, }) => {
|
|
44
|
-
try {
|
|
45
|
-
const propertyNameSnakeCase = easName(propertyName);
|
|
46
|
-
const isMissingSchemaUid = !schemaUid || schemaUid === 'null' || schemaUid === 'undefined';
|
|
47
|
-
const queryClient = BaseQueryClient.getQueryClient();
|
|
48
|
-
const easClient = BaseEasClient.getEasClient();
|
|
49
|
-
// If clients are not available, return undefined (schema not found)
|
|
50
|
-
if (!queryClient || !easClient) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let queryParams = {
|
|
54
|
-
where: {
|
|
55
|
-
id: {
|
|
56
|
-
equals: schemaUid,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
if (easDataType) {
|
|
61
|
-
queryParams = {
|
|
62
|
-
where: {
|
|
63
|
-
schema: {
|
|
64
|
-
equals: `${easDataType} ${propertyNameSnakeCase}`,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (!easDataType && isMissingSchemaUid) {
|
|
70
|
-
queryParams = {
|
|
71
|
-
where: {
|
|
72
|
-
schemaNames: {
|
|
73
|
-
some: {
|
|
74
|
-
name: {
|
|
75
|
-
equals: propertyNameSnakeCase,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
const foundPropertySchema = await queryClient.fetchQuery({
|
|
83
|
-
queryKey: [`getEasSchemaForItemProperty`, queryParams],
|
|
84
|
-
queryFn: async () => easClient.request(GET_SCHEMAS, queryParams),
|
|
85
|
-
networkMode: 'offlineFirst',
|
|
86
|
-
});
|
|
87
|
-
if (foundPropertySchema && foundPropertySchema.schemas.length > 0) {
|
|
88
|
-
return foundPropertySchema.schemas[0];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
// If schema fetch fails, return undefined (schema not found)
|
|
93
|
-
// This is expected when metadata exists without a published EASSchema
|
|
94
|
-
if (process.env.NODE_ENV === 'development') {
|
|
95
|
-
console.warn(`Failed to fetch schema for property ${propertyName}:`, error);
|
|
96
|
-
}
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
44
|
/**
|
|
102
45
|
* Updates the version record with the attestation UID after a Version attestation is created.
|
|
103
|
-
* Targets the version without a uid yet (the one being published).
|
|
104
|
-
* version rows already has is ignored.
|
|
46
|
+
* Targets the first version without a uid yet in head-version order (the one being published).
|
|
47
|
+
* A uid one of the seed's version rows already has is ignored.
|
|
105
48
|
* Publisher is immutable once set: we never overwrite an existing publisher.
|
|
106
49
|
*/
|
|
107
50
|
const updateVersionUid = async ({ seedLocalId, versionUid, publisher, attestationCreatedAt, }) => {
|
|
@@ -115,7 +58,7 @@ const updateVersionUid = async ({ seedLocalId, versionUid, publisher, attestatio
|
|
|
115
58
|
.select({ localId: versions.localId, uid: versions.uid, publisher: versions.publisher })
|
|
116
59
|
.from(versions)
|
|
117
60
|
.where(eq(versions.seedLocalId, seedLocalId))
|
|
118
|
-
.orderBy(
|
|
61
|
+
.orderBy(latestVersionOrder());
|
|
119
62
|
// Already recorded: nothing to stamp. A patch publish attaches to an existing version, and the
|
|
120
63
|
// modular executor's SeedPublished event still reports that version's uid; stamping it onto a
|
|
121
64
|
// local draft version would give two rows the same version uid.
|
|
@@ -228,24 +171,29 @@ async function applyPropertyAttestationUidsFromPublish(params) {
|
|
|
228
171
|
const pairName = pair.propertyName != null && pair.propertyName !== '' ? pair.propertyName : undefined;
|
|
229
172
|
const pairDef = pairName ? refDefs.get(pairName) : undefined;
|
|
230
173
|
const pairNames = new Set(pairName ? [pairName, ...(pairDef ? [pairDef.schemaKey, pairDef.storageName] : [])] : []);
|
|
231
|
-
const
|
|
232
|
-
.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
174
|
+
const attestedRow = pair.metadataLocalId
|
|
175
|
+
? working.find((r) => r.localId === pair.metadataLocalId)
|
|
176
|
+
: undefined;
|
|
177
|
+
const candidates = attestedRow
|
|
178
|
+
? [attestedRow]
|
|
179
|
+
: working
|
|
180
|
+
.filter((r) => {
|
|
181
|
+
// Rows sync derived for ItemStorage properties aren't placeholders for an attestation.
|
|
182
|
+
if (r.derivedFromUid != null)
|
|
238
183
|
return false;
|
|
239
|
-
if (
|
|
240
|
-
|
|
184
|
+
if (pairName) {
|
|
185
|
+
if (!r.propertyName || !pairNames.has(r.propertyName))
|
|
186
|
+
return false;
|
|
187
|
+
if (r.schemaUid) {
|
|
188
|
+
return normalizeBytes32Hex(r.schemaUid) === wantSchema;
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
241
191
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
})
|
|
248
|
-
.sort(compareMetadataRowsLatestFirst);
|
|
192
|
+
if (!r.schemaUid)
|
|
193
|
+
return false;
|
|
194
|
+
return normalizeBytes32Hex(r.schemaUid) === wantSchema;
|
|
195
|
+
})
|
|
196
|
+
.sort(compareMetadataRowsLatestFirst);
|
|
249
197
|
const target = candidates.find((r) => isPlaceholderUid(r.uid));
|
|
250
198
|
if (!target?.localId) {
|
|
251
199
|
// Full snapshot: the property's rows are all attested. Record this attestation as a new row
|
|
@@ -413,6 +361,64 @@ async function toAttestedRefValue(appDb, raw, kind, resolvedSeedUids) {
|
|
|
413
361
|
return value === raw ? undefined : value;
|
|
414
362
|
}
|
|
415
363
|
|
|
364
|
+
const getEasSchemaForItemProperty = async ({ schemaUid, propertyName, easDataType, }) => {
|
|
365
|
+
try {
|
|
366
|
+
const propertyNameSnakeCase = easName(propertyName);
|
|
367
|
+
const isMissingSchemaUid = !schemaUid || schemaUid === 'null' || schemaUid === 'undefined';
|
|
368
|
+
const queryClient = BaseQueryClient.getQueryClient();
|
|
369
|
+
const easClient = BaseEasClient.getEasClient();
|
|
370
|
+
// If clients are not available, return undefined (schema not found)
|
|
371
|
+
if (!queryClient || !easClient) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
let queryParams = {
|
|
375
|
+
where: {
|
|
376
|
+
id: {
|
|
377
|
+
equals: schemaUid,
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
if (easDataType) {
|
|
382
|
+
queryParams = {
|
|
383
|
+
where: {
|
|
384
|
+
schema: {
|
|
385
|
+
equals: `${easDataType} ${propertyNameSnakeCase}`,
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
if (!easDataType && isMissingSchemaUid) {
|
|
391
|
+
queryParams = {
|
|
392
|
+
where: {
|
|
393
|
+
schemaNames: {
|
|
394
|
+
some: {
|
|
395
|
+
name: {
|
|
396
|
+
equals: propertyNameSnakeCase,
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
const foundPropertySchema = await queryClient.fetchQuery({
|
|
404
|
+
queryKey: [`getEasSchemaForItemProperty`, queryParams],
|
|
405
|
+
queryFn: async () => easClient.request(GET_SCHEMAS, queryParams),
|
|
406
|
+
networkMode: 'offlineFirst',
|
|
407
|
+
});
|
|
408
|
+
if (foundPropertySchema && foundPropertySchema.schemas.length > 0) {
|
|
409
|
+
return foundPropertySchema.schemas[0];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
// If schema fetch fails, return undefined (schema not found)
|
|
414
|
+
// This is expected when metadata exists without a published EASSchema
|
|
415
|
+
if (process.env.NODE_ENV === 'development') {
|
|
416
|
+
console.warn(`Failed to fetch schema for property ${propertyName}:`, error);
|
|
417
|
+
}
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
416
422
|
const getVersionsForSeedUid = async (seedUid) => {
|
|
417
423
|
if (!seedUid)
|
|
418
424
|
return [];
|
|
@@ -653,105 +659,25 @@ async function getAttesterForSeed(params) {
|
|
|
653
659
|
return getAttesterFromRow(seedRows[0]);
|
|
654
660
|
}
|
|
655
661
|
|
|
656
|
-
/**
|
|
657
|
-
* @deprecated Don't use: it makes the local value differ from the attested one. It replaces
|
|
658
|
-
* local `metadata` rows' ANS-104 data item id with the L1 bundle transaction id, but the
|
|
659
|
-
* attestation holds the data item id, gateways serve a bundled data item by its own id, and
|
|
660
|
-
* `/raw/<bundle>` returns the whole bundle. Publish no longer calls it;
|
|
661
|
-
* restoreDataItemIdsOverwrittenByL1 undoes it.
|
|
662
|
-
*/
|
|
663
|
-
async function applyArweaveL1TransactionIdLocal(params) {
|
|
664
|
-
const { seedLocalId, versionLocalId, dataItemId, l1TransactionId } = params;
|
|
665
|
-
const appDb = BaseDb.getAppDb();
|
|
666
|
-
if (!appDb)
|
|
667
|
-
return;
|
|
668
|
-
const nameClause = or(eq(metadata.propertyName, 'storage_transaction_id'), eq(metadata.propertyName, 'storageTransactionId'));
|
|
669
|
-
const whereBase = and(eq(metadata.seedLocalId, seedLocalId), eq(metadata.propertyValue, dataItemId), nameClause);
|
|
670
|
-
const where = versionLocalId != null && versionLocalId !== ''
|
|
671
|
-
? and(whereBase, eq(metadata.versionLocalId, versionLocalId))
|
|
672
|
-
: whereBase;
|
|
673
|
-
const rows = await appDb.select().from(metadata).where(where);
|
|
674
|
-
if (!rows.length)
|
|
675
|
-
return;
|
|
676
|
-
for (const row of rows) {
|
|
677
|
-
const localId = row.localId;
|
|
678
|
-
if (!localId)
|
|
679
|
-
continue;
|
|
680
|
-
let nextRef = row.refResolvedValue;
|
|
681
|
-
if (nextRef && nextRef.includes(dataItemId)) {
|
|
682
|
-
nextRef = nextRef.split(dataItemId).join(l1TransactionId);
|
|
683
|
-
}
|
|
684
|
-
await appDb
|
|
685
|
-
.update(metadata)
|
|
686
|
-
.set({
|
|
687
|
-
propertyValue: l1TransactionId,
|
|
688
|
-
refResolvedValue: nextRef ?? row.refResolvedValue,
|
|
689
|
-
refResolvedDisplayValue: row.refResolvedDisplayValue
|
|
690
|
-
? row.refResolvedDisplayValue.split(dataItemId).join(l1TransactionId)
|
|
691
|
-
: row.refResolvedDisplayValue,
|
|
692
|
-
})
|
|
693
|
-
.where(eq(metadata.localId, localId));
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Undo what the bundler L1-finalize worker used to do: once a bundle was confirmed, it replaced
|
|
699
|
-
* the `storage_transaction_id` rows' data item id with the bundle's L1 transaction id. The
|
|
700
|
-
* attestation holds the data item id, and `/raw/<bundle>` returns the whole bundle, so the local
|
|
701
|
-
* value was wrong. The worker no longer does this; this sets rows it changed back, from the
|
|
702
|
-
* confirmed jobs in `arweave_l1_finalize_jobs`.
|
|
703
|
-
*
|
|
704
|
-
* Only when a seed's version has one job in that bundle: with several, the rows all hold the same
|
|
705
|
-
* bundle id and can't be matched to their data items, so they are counted as ambiguous and left.
|
|
706
|
-
*/
|
|
707
|
-
async function restoreDataItemIdsOverwrittenByL1() {
|
|
708
|
-
const appDb = BaseDb.getAppDb();
|
|
709
|
-
const jobs = await appDb
|
|
710
|
-
.select()
|
|
711
|
-
.from(arweaveL1FinalizeJobs)
|
|
712
|
-
.where(and(eq(arweaveL1FinalizeJobs.phase, 'confirmed'), isNotNull(arweaveL1FinalizeJobs.l1TransactionId)));
|
|
713
|
-
const groups = new Map();
|
|
714
|
-
for (const job of jobs) {
|
|
715
|
-
if (!job.l1TransactionId || job.l1TransactionId === job.dataItemId)
|
|
716
|
-
continue;
|
|
717
|
-
const key = `${job.seedLocalId}|${job.versionLocalId ?? ''}|${job.l1TransactionId}`;
|
|
718
|
-
groups.set(key, [...(groups.get(key) ?? []), job]);
|
|
719
|
-
}
|
|
720
|
-
let restored = 0;
|
|
721
|
-
let ambiguous = 0;
|
|
722
|
-
for (const group of groups.values()) {
|
|
723
|
-
const job = group[0];
|
|
724
|
-
const l1 = job.l1TransactionId;
|
|
725
|
-
const where = and(eq(metadata.seedLocalId, job.seedLocalId), job.versionLocalId ? eq(metadata.versionLocalId, job.versionLocalId) : isNull(metadata.versionLocalId), eq(metadata.propertyValue, l1), or(eq(metadata.propertyName, 'storage_transaction_id'), eq(metadata.propertyName, 'storageTransactionId')));
|
|
726
|
-
const rows = await appDb.select().from(metadata).where(where);
|
|
727
|
-
if (rows.length === 0)
|
|
728
|
-
continue;
|
|
729
|
-
if (group.length > 1) {
|
|
730
|
-
ambiguous += 1;
|
|
731
|
-
continue;
|
|
732
|
-
}
|
|
733
|
-
for (const row of rows) {
|
|
734
|
-
const swap = (value) => (value ? value.split(l1).join(job.dataItemId) : value);
|
|
735
|
-
await appDb
|
|
736
|
-
.update(metadata)
|
|
737
|
-
.set({
|
|
738
|
-
propertyValue: job.dataItemId,
|
|
739
|
-
refResolvedValue: swap(row.refResolvedValue),
|
|
740
|
-
refResolvedDisplayValue: swap(row.refResolvedDisplayValue),
|
|
741
|
-
})
|
|
742
|
-
.where(eq(metadata.localId, row.localId));
|
|
743
|
-
restored += 1;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
return { restored, ambiguous };
|
|
747
|
-
}
|
|
748
|
-
|
|
749
662
|
/**
|
|
750
663
|
* Collects all items that will be in the publish payload (main item + related items from
|
|
751
664
|
* relations and lists). Used by ensureEasSchemas to register schemas for nested items.
|
|
752
665
|
* Skips items that already have seedUid (already published).
|
|
666
|
+
*
|
|
667
|
+
* Each returned item carries one cache hold the caller releases with `unload()`.
|
|
753
668
|
*/
|
|
754
669
|
async function getRelatedItemsForPublish(item, visited = new Set()) {
|
|
670
|
+
const loads = new ItemLoads();
|
|
671
|
+
let result = [];
|
|
672
|
+
try {
|
|
673
|
+
result = await collectRelatedItemsForPublish(item, visited, loads);
|
|
674
|
+
}
|
|
675
|
+
finally {
|
|
676
|
+
loads.release(result);
|
|
677
|
+
}
|
|
678
|
+
return result;
|
|
679
|
+
}
|
|
680
|
+
async function collectRelatedItemsForPublish(item, visited, loads) {
|
|
755
681
|
const seedLocalId = item.seedLocalId;
|
|
756
682
|
if (!seedLocalId || visited.has(seedLocalId)) {
|
|
757
683
|
return [];
|
|
@@ -759,8 +685,6 @@ async function getRelatedItemsForPublish(item, visited = new Set()) {
|
|
|
759
685
|
visited.add(seedLocalId);
|
|
760
686
|
const result = [];
|
|
761
687
|
const { itemRelationProperties, itemImageProperties, itemListProperties } = await getSegmentedItemProperties(item);
|
|
762
|
-
const getItemMod = await import('./getItem-5j22EWWE.js');
|
|
763
|
-
const { getItem } = getItemMod;
|
|
764
688
|
const processRelationOrImage = async (prop) => {
|
|
765
689
|
const snapshot = prop.getService().getSnapshot();
|
|
766
690
|
const context = snapshot.context ?? null;
|
|
@@ -778,8 +702,8 @@ async function getRelatedItemsForPublish(item, visited = new Set()) {
|
|
|
778
702
|
if (!value && prop.propertyName && isStorageSeed) {
|
|
779
703
|
const ctx = context;
|
|
780
704
|
if (ctx.seedLocalId || ctx.seedUid) {
|
|
781
|
-
const _mod_0 = await import('./Item-
|
|
782
|
-
const _ns_0 = _mod_0.
|
|
705
|
+
const _mod_0 = await import('./Item-0oDoTPhi.js');
|
|
706
|
+
const _ns_0 = _mod_0.at;
|
|
783
707
|
const { getPropertyData } = _ns_0;
|
|
784
708
|
const meta = await getPropertyData({
|
|
785
709
|
propertyName: prop.propertyName,
|
|
@@ -795,10 +719,10 @@ async function getRelatedItemsForPublish(item, visited = new Set()) {
|
|
|
795
719
|
const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(normalized);
|
|
796
720
|
if (!seedLocalId && !seedUid)
|
|
797
721
|
return;
|
|
798
|
-
const relatedItem = await getItem({ seedLocalId, seedUid });
|
|
722
|
+
const relatedItem = await loads.getItem({ seedLocalId, seedUid });
|
|
799
723
|
if (!relatedItem || relatedItem.seedUid)
|
|
800
724
|
return;
|
|
801
|
-
const nested = await
|
|
725
|
+
const nested = await collectRelatedItemsForPublish(relatedItem, visited, loads);
|
|
802
726
|
result.push(...nested, relatedItem);
|
|
803
727
|
};
|
|
804
728
|
for (const prop of [...itemRelationProperties, ...itemImageProperties]) {
|
|
@@ -827,10 +751,10 @@ async function getRelatedItemsForPublish(item, visited = new Set()) {
|
|
|
827
751
|
const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(normalized);
|
|
828
752
|
if (!seedLocalId && !seedUid)
|
|
829
753
|
continue;
|
|
830
|
-
const relatedItem = await getItem({ seedLocalId, seedUid });
|
|
754
|
+
const relatedItem = await loads.getItem({ seedLocalId, seedUid });
|
|
831
755
|
if (!relatedItem || relatedItem.seedUid)
|
|
832
756
|
continue;
|
|
833
|
-
const nested = await
|
|
757
|
+
const nested = await collectRelatedItemsForPublish(relatedItem, visited, loads);
|
|
834
758
|
result.push(...nested, relatedItem);
|
|
835
759
|
}
|
|
836
760
|
}
|
|
@@ -964,26 +888,25 @@ async function collectUploadBytes(item, itemUploadProperties, itemImagePropertie
|
|
|
964
888
|
await addUploadFromPath(acc, seen, filePath, seedLocalId ? `seed:${seedLocalId}` : `path:${filePath}`);
|
|
965
889
|
}
|
|
966
890
|
}
|
|
967
|
-
async function loadRelatedItem(value) {
|
|
891
|
+
async function loadRelatedItem(value, loads) {
|
|
968
892
|
const normalized = normalizeRelationPropertyValue(value);
|
|
969
893
|
if (!normalized)
|
|
970
894
|
return undefined;
|
|
971
895
|
const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(normalized);
|
|
972
896
|
if (!seedLocalId && !seedUid)
|
|
973
897
|
return undefined;
|
|
974
|
-
const { getItem } = await import('./getItem-5j22EWWE.js');
|
|
975
898
|
try {
|
|
976
|
-
return await getItem({ seedLocalId, seedUid });
|
|
899
|
+
return await loads.getItem({ seedLocalId, seedUid });
|
|
977
900
|
}
|
|
978
901
|
catch {
|
|
979
902
|
return undefined;
|
|
980
903
|
}
|
|
981
904
|
}
|
|
982
|
-
async function relatedIfUnpublished(prop) {
|
|
905
|
+
async function relatedIfUnpublished(prop, loads) {
|
|
983
906
|
const context = propertyContext(prop);
|
|
984
907
|
if (!context)
|
|
985
908
|
return undefined;
|
|
986
|
-
const related = await loadRelatedItem(context.propertyValue);
|
|
909
|
+
const related = await loadRelatedItem(context.propertyValue, loads);
|
|
987
910
|
if (!related || !isZeroUid(related.seedUid))
|
|
988
911
|
return undefined;
|
|
989
912
|
return related;
|
|
@@ -1005,7 +928,7 @@ function seedRefsOf(prop, isList) {
|
|
|
1005
928
|
return ref ? [ref] : [];
|
|
1006
929
|
}
|
|
1007
930
|
/** Like getPublishPayload: attested refs to revoked seeds block the publish. */
|
|
1008
|
-
async function collectUnpublishedRelatedItems(props, isList, forceFullSnapshot, out, backReferences) {
|
|
931
|
+
async function collectUnpublishedRelatedItems(props, isList, forceFullSnapshot, out, loads, backReferences) {
|
|
1009
932
|
for (const prop of props) {
|
|
1010
933
|
if (!shouldAttestProperty(prop, forceFullSnapshot))
|
|
1011
934
|
continue;
|
|
@@ -1023,7 +946,7 @@ async function collectUnpublishedRelatedItems(props, isList, forceFullSnapshot,
|
|
|
1023
946
|
if (out.some((r) => r.propertyName === prop.propertyName && r.seedLocalId === row.seedLocalId)) {
|
|
1024
947
|
continue;
|
|
1025
948
|
}
|
|
1026
|
-
const related = await loadRelatedItem(row.seedLocalId);
|
|
949
|
+
const related = await loadRelatedItem(row.seedLocalId, loads);
|
|
1027
950
|
out.push({
|
|
1028
951
|
propertyName: prop.propertyName,
|
|
1029
952
|
modelName: related?.modelName ?? relatedModelNameFromDef(prop.propertyDef) ?? row.type ?? 'unknown',
|
|
@@ -1038,11 +961,11 @@ async function collectUnpublishedRelatedItems(props, isList, forceFullSnapshot,
|
|
|
1038
961
|
* them like image properties pointing at revoked seeds. Like getPublishPayload, checks the published
|
|
1039
962
|
* item's co-publish rows and those of the draft items published with it.
|
|
1040
963
|
*/
|
|
1041
|
-
async function collectUnpublishedEmbeddedImages(item, out) {
|
|
964
|
+
async function collectUnpublishedEmbeddedImages(item, out, loads) {
|
|
1042
965
|
const appDb = BaseDb.getAppDb();
|
|
1043
966
|
if (!appDb || !item.seedLocalId)
|
|
1044
967
|
return;
|
|
1045
|
-
for (const owner of [item, ...(await getRelatedDraftsCoPublishedWith(item))]) {
|
|
968
|
+
for (const owner of [item, ...(await getRelatedDraftsCoPublishedWith(item, loads))]) {
|
|
1046
969
|
const rows = await appDb
|
|
1047
970
|
.select()
|
|
1048
971
|
.from(htmlEmbeddedImageCoPublish)
|
|
@@ -1058,7 +981,7 @@ async function collectUnpublishedEmbeddedImages(item, out) {
|
|
|
1058
981
|
}
|
|
1059
982
|
}
|
|
1060
983
|
}
|
|
1061
|
-
async function appendCoPublishImages(item, acc, seen, visited, forceFullSnapshot, publishMode, graph) {
|
|
984
|
+
async function appendCoPublishImages(item, acc, seen, visited, forceFullSnapshot, publishMode, graph, loads) {
|
|
1062
985
|
const appDb = BaseDb.getAppDb();
|
|
1063
986
|
if (!appDb)
|
|
1064
987
|
return;
|
|
@@ -1067,10 +990,7 @@ async function appendCoPublishImages(item, acc, seen, visited, forceFullSnapshot
|
|
|
1067
990
|
.from(htmlEmbeddedImageCoPublish)
|
|
1068
991
|
.where(eq(htmlEmbeddedImageCoPublish.parentSeedLocalId, item.seedLocalId));
|
|
1069
992
|
for (const row of rows) {
|
|
1070
|
-
const
|
|
1071
|
-
const _ns_1 = _mod_1.av;
|
|
1072
|
-
const { Item } = _ns_1;
|
|
1073
|
-
const imageItem = await Item.find({
|
|
993
|
+
const imageItem = await loads.find({
|
|
1074
994
|
seedLocalId: row.imageSeedLocalId,
|
|
1075
995
|
modelName: 'Image',
|
|
1076
996
|
});
|
|
@@ -1081,10 +1001,10 @@ async function appendCoPublishImages(item, acc, seen, visited, forceFullSnapshot
|
|
|
1081
1001
|
const filePath = await findEmbeddedImageFilePath(imageItem.seedLocalId);
|
|
1082
1002
|
if (filePath)
|
|
1083
1003
|
await addUploadFromPath(acc, seen, filePath, `seed:${imageItem.seedLocalId}`);
|
|
1084
|
-
await summarizeItem(imageItem, publishMode, forceFullSnapshot, acc, seen, visited, graph);
|
|
1004
|
+
await summarizeItem(imageItem, publishMode, forceFullSnapshot, acc, seen, visited, graph, loads);
|
|
1085
1005
|
}
|
|
1086
1006
|
}
|
|
1087
|
-
async function summarizeItem(item, publishMode, forceFullSnapshot, acc, seenUploads, visited, graph) {
|
|
1007
|
+
async function summarizeItem(item, publishMode, forceFullSnapshot, acc, seenUploads, visited, graph, loads) {
|
|
1088
1008
|
const seedLocalId = item.seedLocalId;
|
|
1089
1009
|
if (!seedLocalId || visited.has(seedLocalId))
|
|
1090
1010
|
return;
|
|
@@ -1096,20 +1016,20 @@ async function summarizeItem(item, publishMode, forceFullSnapshot, acc, seenUplo
|
|
|
1096
1016
|
acc.newVersionCount += 1;
|
|
1097
1017
|
const { itemBasicProperties, itemRelationProperties, itemListProperties, itemUploadProperties, itemImageProperties, } = await getSegmentedItemProperties(item);
|
|
1098
1018
|
await collectUploadBytes(item, itemUploadProperties, itemImageProperties, undefined, acc, seenUploads);
|
|
1099
|
-
await collectUnpublishedRelatedItems([...itemRelationProperties, ...itemImageProperties], false, forceFullSnapshot, acc.unpublishedRelatedItems, graph.backReferences);
|
|
1100
|
-
await collectUnpublishedRelatedItems(itemListProperties, true, forceFullSnapshot, acc.unpublishedRelatedItems, graph.backReferences);
|
|
1019
|
+
await collectUnpublishedRelatedItems([...itemRelationProperties, ...itemImageProperties], false, forceFullSnapshot, acc.unpublishedRelatedItems, loads, graph.backReferences);
|
|
1020
|
+
await collectUnpublishedRelatedItems(itemListProperties, true, forceFullSnapshot, acc.unpublishedRelatedItems, loads, graph.backReferences);
|
|
1101
1021
|
// Draft Image/File/Html/Json items its storage relations point at. Draft model items its relations
|
|
1102
1022
|
// and lists reach are summarized by summarizePublishWork from the publish's draft graph.
|
|
1103
1023
|
const storageProperties = new Set(itemImageProperties);
|
|
1104
1024
|
for (const rel of itemRelationProperties) {
|
|
1105
1025
|
if (!storageProperties.has(rel))
|
|
1106
1026
|
continue;
|
|
1107
|
-
const related = await relatedIfUnpublished(rel);
|
|
1027
|
+
const related = await relatedIfUnpublished(rel, loads);
|
|
1108
1028
|
if (related) {
|
|
1109
|
-
await summarizeItem(related, publishMode, forceFullSnapshot, acc, seenUploads, visited, graph);
|
|
1029
|
+
await summarizeItem(related, publishMode, forceFullSnapshot, acc, seenUploads, visited, graph, loads);
|
|
1110
1030
|
}
|
|
1111
1031
|
}
|
|
1112
|
-
await appendCoPublishImages(item, acc, seenUploads, visited, forceFullSnapshot, publishMode, graph);
|
|
1032
|
+
await appendCoPublishImages(item, acc, seenUploads, visited, forceFullSnapshot, publishMode, graph, loads);
|
|
1113
1033
|
const attestable = [
|
|
1114
1034
|
...itemBasicProperties,
|
|
1115
1035
|
...itemRelationProperties,
|
|
@@ -1140,10 +1060,10 @@ const publishForcesFullSnapshot = async (item, publishMode) => {
|
|
|
1140
1060
|
const republishRevokedSeed = !isZeroUid(item.seedUid) && (await isSeedRevoked(item.seedLocalId));
|
|
1141
1061
|
return { republishRevokedSeed, forceFullSnapshot: publishMode === 'new_version' || republishRevokedSeed };
|
|
1142
1062
|
};
|
|
1143
|
-
async function collectUnpublishedRelatedItemsOf(item, forceFullSnapshot, out, backReferences) {
|
|
1063
|
+
async function collectUnpublishedRelatedItemsOf(item, forceFullSnapshot, out, backReferences, loads) {
|
|
1144
1064
|
const { itemRelationProperties, itemListProperties, itemImageProperties } = await getSegmentedItemProperties(item);
|
|
1145
|
-
await collectUnpublishedRelatedItems([...itemRelationProperties, ...itemImageProperties], false, forceFullSnapshot, out, backReferences);
|
|
1146
|
-
await collectUnpublishedRelatedItems(itemListProperties, true, forceFullSnapshot, out, backReferences);
|
|
1065
|
+
await collectUnpublishedRelatedItems([...itemRelationProperties, ...itemImageProperties], false, forceFullSnapshot, out, loads, backReferences);
|
|
1066
|
+
await collectUnpublishedRelatedItems(itemListProperties, true, forceFullSnapshot, out, loads, backReferences);
|
|
1147
1067
|
}
|
|
1148
1068
|
/**
|
|
1149
1069
|
* References a publish of `item` would attest to items whose seed was unpublished (revoked), the
|
|
@@ -1153,12 +1073,14 @@ async function collectUnpublishedRelatedItemsOf(item, forceFullSnapshot, out, ba
|
|
|
1153
1073
|
const getUnpublishedRelatedItems = async (item, options) => {
|
|
1154
1074
|
const { forceFullSnapshot } = await publishForcesFullSnapshot(item, options?.publishMode ?? 'patch');
|
|
1155
1075
|
const out = [];
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1076
|
+
await withItemLoads(undefined, async (loads) => {
|
|
1077
|
+
// The item and every draft its publish carries along (publishDraftGraph.ts).
|
|
1078
|
+
const { drafts, backReferences } = await getPublishDraftGraph(item, { forceFullSnapshot, loads });
|
|
1079
|
+
for (const owner of [item, ...drafts.map((d) => d.item)]) {
|
|
1080
|
+
await collectUnpublishedRelatedItemsOf(owner, forceFullSnapshot, out, backReferences, loads);
|
|
1081
|
+
}
|
|
1082
|
+
await collectUnpublishedEmbeddedImages(item, out, loads);
|
|
1083
|
+
});
|
|
1162
1084
|
return out;
|
|
1163
1085
|
};
|
|
1164
1086
|
const summarizePublishWork = async (item, options) => {
|
|
@@ -1175,19 +1097,21 @@ const summarizePublishWork = async (item, options) => {
|
|
|
1175
1097
|
uploadSizes: [],
|
|
1176
1098
|
unpublishedRelatedItems: [],
|
|
1177
1099
|
};
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1100
|
+
await withItemLoads(undefined, async (loads) => {
|
|
1101
|
+
const graph = await getPublishDraftGraph(item, { forceFullSnapshot, loads });
|
|
1102
|
+
const { drafts } = graph;
|
|
1103
|
+
const seenUploads = new Set();
|
|
1104
|
+
const visited = new Set();
|
|
1105
|
+
for (const owner of [item, ...drafts.map((d) => d.item)]) {
|
|
1106
|
+
await summarizeItem(owner, publishMode, forceFullSnapshot, acc, seenUploads, visited, graph, loads);
|
|
1107
|
+
}
|
|
1108
|
+
await collectUnpublishedEmbeddedImages(item, acc.unpublishedRelatedItems, loads);
|
|
1109
|
+
});
|
|
1186
1110
|
// summarizeItem counts the root as an existing seed (it has a seedUid).
|
|
1187
1111
|
if (republishRevokedSeed)
|
|
1188
1112
|
acc.newSeedCount += 1;
|
|
1189
1113
|
return acc;
|
|
1190
1114
|
};
|
|
1191
1115
|
|
|
1192
|
-
export { BaseDb, BaseFileManager, BaseFileManager as FileManager, ModelPropertyDataTypes,
|
|
1116
|
+
export { BaseDb, BaseFileManager, BaseFileManager as FileManager, ModelPropertyDataTypes, applyPropertyAttestationUidsFromPublish, compareMetadataRowsLatestFirst, estimateDataUriByteLength, generateId, getAttesterForSeed, getEasSchemaForItemProperty, getMetadataAttestationUidsForSeedUid, getPublishDraftGraph, getPublishPendingDiff, getRelatedItemsForPublish, getSeedPublishState, getSegmentedItemProperties, getUnpublishedRelatedItems, getVersionsForSeedUid, htmlEmbeddedImageCoPublish, isDataType, listRelationEasPropertyName, metadata, models, normalizeDataType, normalizePublisher, normalizeRelationPropertyValue, properties, resolveSeedIdsFromRefString, seeds, shouldAttestProperty, summarizePublishWork, updateVersionUid, versions };
|
|
1193
1117
|
//# sourceMappingURL=main.js.map
|