@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
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":["../../src/node/index.ts"],"sourcesContent":["import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport { Model, Property } from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError, ClearNotSupportedError } from '../ItemProperty/ItemProperty'\nexport type { IItem, IItemProperty } from '../interfaces'\n\n// Errors\nexport { AmbiguousModelError } from '../Model/errors'\nexport { ItemCreateValidationError, UnknownModelError, type ItemCreateProblem } from '../Item/errors'\nexport { ConflictError, type ConflictResult } from '../Schema/errors'\nexport { OwnershipError, assertItemOwned, isItemOwned } from '../helpers/ownership'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport {
|
|
1
|
+
{"version":3,"file":"node.js","sources":["../../src/node/index.ts"],"sourcesContent":["import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport { Model, Property } from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError, ClearNotSupportedError } from '../ItemProperty/ItemProperty'\nexport type { IItem, IItemProperty } from '../interfaces'\n\n// Errors\nexport { AmbiguousModelError } from '../Model/errors'\nexport { ItemCreateValidationError, UnknownModelError, type ItemCreateProblem } from '../Item/errors'\nexport { ConflictError, type ConflictResult } from '../Schema/errors'\nexport { OwnershipError, assertItemOwned, isItemOwned } from '../helpers/ownership'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport { isPublishedSeedRef } from '../helpers/relationSeedRef'\nexport { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\nexport type { MultiTabMode } from '../helpers/tabCoordinator'\nexport type { SyncFromEasOptions } from '../events/item/syncDbWithEas'\nexport type { HtmlEmbeddedDataUriPolicy } from '../helpers/property'\n\n// Register the Node platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE"}
|
package/dist/platform.browser.js
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-
|
|
2
|
-
export { configurePlatform } from './configurePlatform-Dukm2QwO.js';
|
|
3
|
-
import './changeFeed-M8sGbOrW.js';
|
|
4
|
-
import 'debug';
|
|
5
|
-
import './eventBus-7vxTCc3a.js';
|
|
6
|
-
import './index-rOTW-2QZ.js';
|
|
1
|
+
export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-CUmBVYen.js';
|
|
7
2
|
import '@seedprotocol/arweave';
|
|
8
3
|
import '@seedprotocol/eas';
|
|
4
|
+
export { configurePlatform } from './configurePlatform-CiOJ1R3q.js';
|
|
5
|
+
import './tabEvents-CaVmngqr.js';
|
|
6
|
+
import 'debug';
|
|
7
|
+
import './BaseFileManager-BAlySv8w.js';
|
|
8
|
+
import 'drizzle-orm/sqlite-core';
|
|
9
|
+
import 'drizzle-orm';
|
|
9
10
|
import 'xstate';
|
|
10
11
|
import 'pluralize';
|
|
11
12
|
import '@sinclair/typebox';
|
|
12
|
-
import 'drizzle-orm/sqlite-core';
|
|
13
|
-
import 'drizzle-orm';
|
|
14
13
|
import 'nanoid';
|
|
15
14
|
import 'nanoid-dictionary';
|
|
16
15
|
import '@noble/hashes/sha256';
|
|
17
16
|
import '@noble/hashes/sha3';
|
|
18
17
|
import '@noble/hashes/utils';
|
|
19
18
|
import 'lodash-es';
|
|
20
|
-
import './mimeTypes-C9r76DCH.js';
|
|
21
19
|
import './errors-C1qUEZ7A.js';
|
|
22
20
|
import 'drizzle-orm/sqlite-proxy';
|
|
23
|
-
import './index-
|
|
21
|
+
import './index-D0V-mjCV.js';
|
|
24
22
|
import 'sqlocal/drizzle';
|
|
25
23
|
import './minimumUpgradeVersion-BDhHvHtr.js';
|
|
26
24
|
import 'rxjs';
|
|
27
|
-
import 'graphql-request';
|
|
28
|
-
import 'arweave';
|
|
29
|
-
import '@tanstack/query-core';
|
|
30
25
|
//# sourceMappingURL=platform.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/platform.node.js
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
export { c as createPlatformServices, a as resolveFilesDir } from './index.node-
|
|
2
|
-
import '@seedprotocol/arweave
|
|
1
|
+
export { c as createPlatformServices, a as resolveFilesDir } from './index.node-CYPemH-t.js';
|
|
2
|
+
import '@seedprotocol/arweave';
|
|
3
|
+
import '@seedprotocol/eas';
|
|
3
4
|
import '@seedprotocol/eas/node';
|
|
4
|
-
export { configurePlatform } from './configurePlatform-
|
|
5
|
+
export { configurePlatform } from './configurePlatform-CiOJ1R3q.js';
|
|
5
6
|
import 'fs/promises';
|
|
6
7
|
import 'fs';
|
|
7
|
-
import './
|
|
8
|
+
import './BaseFileManager-BAlySv8w.js';
|
|
8
9
|
import 'debug';
|
|
9
|
-
import '@seedprotocol/arweave';
|
|
10
|
-
import '@seedprotocol/eas';
|
|
11
|
-
import 'xstate';
|
|
12
|
-
import 'pluralize';
|
|
13
|
-
import '@sinclair/typebox';
|
|
14
10
|
import 'drizzle-orm/sqlite-core';
|
|
15
11
|
import 'drizzle-orm';
|
|
16
|
-
import 'nanoid';
|
|
17
|
-
import 'nanoid-dictionary';
|
|
18
|
-
import '@noble/hashes/sha256';
|
|
19
|
-
import '@noble/hashes/sha3';
|
|
20
|
-
import '@noble/hashes/utils';
|
|
21
|
-
import 'lodash-es';
|
|
22
12
|
import 'path';
|
|
23
13
|
import 'url';
|
|
24
14
|
import 'node:url';
|
|
25
|
-
import './index-
|
|
15
|
+
import './index-D0V-mjCV.js';
|
|
26
16
|
import '@libsql/client';
|
|
27
17
|
import 'drizzle-orm/libsql';
|
|
28
18
|
import 'drizzle-orm/libsql/migrator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.node.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.node.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import pluralize from 'pluralize';
|
|
2
|
+
import { E as propertyKeyFromStoredName } from './Item-Bf4kWKpH.js';
|
|
3
|
+
import { B as BaseDb } from './BaseFileManager-BAlySv8w.js';
|
|
4
|
+
export { M as ModelPropertyDataTypes, P as Property, T as THtmlEmbeddedDataUriPolicy, a as TProperty, b as TPropertyConstructor, c as TPropertyDataType, d as TPropertyDefs, e as TStorageType, i as isDataType, n as normalizeDataType, g as normalizePropertyRecordSchema } from './tabEvents-CaVmngqr.js';
|
|
5
|
+
import 'xstate';
|
|
6
|
+
import 'debug';
|
|
7
|
+
import '@seedprotocol/eas';
|
|
8
|
+
import 'drizzle-orm';
|
|
9
|
+
import 'rxjs';
|
|
10
|
+
import 'lodash-es';
|
|
11
|
+
import '@seedprotocol/arweave';
|
|
12
|
+
import 'drizzle-orm/sqlite-core';
|
|
13
|
+
import '@sinclair/typebox';
|
|
14
|
+
import 'nanoid';
|
|
15
|
+
import 'nanoid-dictionary';
|
|
16
|
+
import '@noble/hashes/sha256';
|
|
17
|
+
import '@noble/hashes/sha3';
|
|
18
|
+
import '@noble/hashes/utils';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The key in `defs` a property name refers to: the key itself, a stored metadata name
|
|
22
|
+
* (`authorId` → `author`, `authorIdentityIds` → `authors`), or the name minus `Id` / `Ids`
|
|
23
|
+
* (pluralized).
|
|
24
|
+
*/
|
|
25
|
+
function resolvePropertyKey(defs, propertyName) {
|
|
26
|
+
if (defs[propertyName])
|
|
27
|
+
return propertyName;
|
|
28
|
+
const storedKey = propertyKeyFromStoredName(defs, propertyName);
|
|
29
|
+
if (storedKey && defs[storedKey])
|
|
30
|
+
return storedKey;
|
|
31
|
+
const base = propertyName.endsWith('Ids')
|
|
32
|
+
? pluralize(propertyName.slice(0, -3))
|
|
33
|
+
: propertyName.endsWith('Id')
|
|
34
|
+
? propertyName.slice(0, -2)
|
|
35
|
+
: undefined;
|
|
36
|
+
return base && defs[base] ? base : undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every property definition of one model ({@link getPropertyDefinitions}), with the model row
|
|
40
|
+
* resolved from its name and scope. Empty when the model has no row. Throws AmbiguousModelError
|
|
41
|
+
* for a bare name two schemas define.
|
|
42
|
+
*/
|
|
43
|
+
async function getModelPropertyDefinitions(modelName, scope = {}, db = BaseDb.getAppDb()) {
|
|
44
|
+
if (!db)
|
|
45
|
+
return new Map();
|
|
46
|
+
const _mod_0 = await import('./tabEvents-CaVmngqr.js');
|
|
47
|
+
const _ns_0 = _mod_0.be;
|
|
48
|
+
const { resolveModelRecord } = _ns_0;
|
|
49
|
+
const modelRecord = await resolveModelRecord(modelName, scope, db);
|
|
50
|
+
if (!modelRecord?.id)
|
|
51
|
+
return new Map();
|
|
52
|
+
const _mod_1 = await import('./tabEvents-CaVmngqr.js');
|
|
53
|
+
const _ns_1 = _mod_1.bf;
|
|
54
|
+
const { getPropertyDefinitions } = _ns_1;
|
|
55
|
+
return getPropertyDefinitions(modelRecord.id, db);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A property's definition, from its row ({@link getPropertyDefinition}), by model name and
|
|
59
|
+
* property name. The name may be a stored metadata name (`authorId`, `tagIds`); the result's
|
|
60
|
+
* `name` is the property's key. Undefined when the model or the property has no row.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const schema = await getPropertySchema('Article', 'title')
|
|
65
|
+
* // { dataType: 'Text', name: 'title', id: '<schema file id>', validation: ..., ... }
|
|
66
|
+
* const relation = await getPropertySchema('Article', 'authorId')
|
|
67
|
+
* // { dataType: 'Relation', ref: 'Author', name: 'author', ... }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
const getPropertySchema = async (modelName, propertyName,
|
|
71
|
+
/** Which model is meant when several schemas define one named modelName (Model.id and/or schema). */
|
|
72
|
+
scope = {}) => {
|
|
73
|
+
const definitions = await getModelPropertyDefinitions(modelName, scope);
|
|
74
|
+
const defs = Object.fromEntries(definitions);
|
|
75
|
+
const key = resolvePropertyKey(defs, propertyName);
|
|
76
|
+
if (!key)
|
|
77
|
+
return undefined;
|
|
78
|
+
const definition = definitions.get(key);
|
|
79
|
+
return {
|
|
80
|
+
...definition,
|
|
81
|
+
modelName,
|
|
82
|
+
_propertyFileId: definition.id,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { getModelPropertyDefinitions, getPropertySchema, resolvePropertyKey };
|
|
87
|
+
//# sourceMappingURL=property-BxUYznH0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-BxUYznH0.js","sources":["../../src/helpers/property.ts"],"sourcesContent":["import { Static } from '@sinclair/typebox'\nimport { TProperty } from '@/Schema'\nimport pluralize from 'pluralize'\nimport { propertyKeyFromStoredName } from '@/helpers/metadataPropertyNames'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport type { ModelScope } from '@/db/read/resolveModelRecord'\nimport type { PropertyDefinition } from '@/helpers/propertyDefinition'\n\n// Re-export everything from property/index.ts to make it available when importing from helpers/property\nexport * from './property/index'\n\n/**\n * The key in `defs` a property name refers to: the key itself, a stored metadata name\n * (`authorId` → `author`, `authorIdentityIds` → `authors`), or the name minus `Id` / `Ids`\n * (pluralized).\n */\nexport function resolvePropertyKey(defs: Record<string, any>, propertyName: string): string | undefined {\n if (defs[propertyName]) return propertyName\n const storedKey = propertyKeyFromStoredName(defs, propertyName)\n if (storedKey && defs[storedKey]) return storedKey\n const base = propertyName.endsWith('Ids')\n ? pluralize(propertyName.slice(0, -3))\n : propertyName.endsWith('Id')\n ? propertyName.slice(0, -2)\n : undefined\n return base && defs[base] ? base : undefined\n}\n\n/**\n * Every property definition of one model ({@link getPropertyDefinitions}), with the model row\n * resolved from its name and scope. Empty when the model has no row. Throws AmbiguousModelError\n * for a bare name two schemas define.\n */\nexport async function getModelPropertyDefinitions(\n modelName: string | undefined,\n scope: ModelScope = {},\n db = BaseDb.getAppDb(),\n): Promise<Map<string, PropertyDefinition>> {\n if (!db) return new Map()\n const { resolveModelRecord } = await import('../db/read/resolveModelRecord')\n const modelRecord = await resolveModelRecord(modelName, scope, db)\n if (!modelRecord?.id) return new Map()\n const { getPropertyDefinitions } = await import('./propertyDefinition')\n return getPropertyDefinitions(modelRecord.id, db)\n}\n\n/**\n * A property's definition, from its row ({@link getPropertyDefinition}), by model name and\n * property name. The name may be a stored metadata name (`authorId`, `tagIds`); the result's\n * `name` is the property's key. Undefined when the model or the property has no row.\n *\n * @example\n * ```typescript\n * const schema = await getPropertySchema('Article', 'title')\n * // { dataType: 'Text', name: 'title', id: '<schema file id>', validation: ..., ... }\n * const relation = await getPropertySchema('Article', 'authorId')\n * // { dataType: 'Relation', ref: 'Author', name: 'author', ... }\n * ```\n */\nexport const getPropertySchema = async (\n modelName: string,\n propertyName: string,\n /** Which model is meant when several schemas define one named modelName (Model.id and/or schema). */\n scope: { modelFileId?: string | null; schemaName?: string | null } = {},\n): Promise<(Static<typeof TProperty> & PropertyDefinition & { _propertyFileId?: string }) | undefined> => {\n const definitions = await getModelPropertyDefinitions(modelName, scope)\n const defs = Object.fromEntries(definitions)\n const key = resolvePropertyKey(defs, propertyName)\n if (!key) return undefined\n const definition = definitions.get(key)!\n return {\n ...definition,\n modelName,\n _propertyFileId: definition.id,\n } as Static<typeof TProperty> & PropertyDefinition & { _propertyFileId?: string }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,CAAA,CAAA;;;;AAIG,CAAA,CAAA;AACG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAC,CAAA,CAAA,CAAA,CAAyB,CAAA,CAAE,YAAoB,CAAA,CAAA;IAChF,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAC;AAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY;IAC3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,SAAS,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAE,YAAY,CAAC;AAC/D,CAAA,CAAA,CAAA,CAAA,IAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAC,SAAS,CAAC;AAAE,CAA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU;QACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;QACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAE;KACiD;AACnF,CAAA;;"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { eq } from 'drizzle-orm';
|
|
2
|
+
import { isValidEasAttestationUid } from '@seedprotocol/eas';
|
|
3
|
+
import { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave';
|
|
4
|
+
import { B as BaseDb, h as htmlEmbeddedImageCoPublish } from './BaseFileManager-BAlySv8w.js';
|
|
5
|
+
import { j as findSeedRow, Z as ZERO_BYTES32, n as normalizeDataType, M as ModelPropertyDataTypes, k as getPropertyDefinitions, r as resolveModelRecord, l as resolveModelRecordByNameOrType } from './tabEvents-CaVmngqr.js';
|
|
6
|
+
import { M as isVersionRevoked, N as readModelMetadataProperties, P as metadataPropertyNameForms, Q as currentPropertyRow, R as getLatestVersionRow, L as getLatestPublishedVersionRow, S as parseListPropertyValueFromStorage, D as isPublishedSeedRef } from './Item-Bf4kWKpH.js';
|
|
7
|
+
import 'pluralize';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The local seed row a relation/list/image ref points at, by local id or uid. A uid resolves as
|
|
11
|
+
* {@link findSeedRow} resolves it (the order EAS sync matches seeds in): the old uid of a seed
|
|
12
|
+
* that was unpublished and published again resolves to that seed, through its old version rows.
|
|
13
|
+
* Null when nothing local matches (e.g. a published uid with no local copy).
|
|
14
|
+
*/
|
|
15
|
+
const findRelatedSeedRow = async ({ seedLocalId, seedUid, }) => {
|
|
16
|
+
const row = await findSeedRow({ localId: seedLocalId, uid: seedUid });
|
|
17
|
+
return row ? { seedLocalId: row.localId, seedUid: row.uid, revokedAt: row.revokedAt, type: row.type } : null;
|
|
18
|
+
};
|
|
19
|
+
/** The seed is attested and its attestation is live. */
|
|
20
|
+
const isLivePublishedSeed = (row) => !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && !isVersionRevoked(row.revokedAt);
|
|
21
|
+
/** The seed was attested and that attestation was revoked (unpublished). */
|
|
22
|
+
const isUnpublishedSeed = (row) => !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && isVersionRevoked(row.revokedAt);
|
|
23
|
+
/** Model a relation/list/image property points at, from its definition. */
|
|
24
|
+
function relatedModelNameFromDef(propertyDef) {
|
|
25
|
+
const def = propertyDef;
|
|
26
|
+
if (!def)
|
|
27
|
+
return undefined;
|
|
28
|
+
const dataType = normalizeDataType(def.dataType);
|
|
29
|
+
if (dataType === ModelPropertyDataTypes.Image)
|
|
30
|
+
return 'Image';
|
|
31
|
+
if (dataType === ModelPropertyDataTypes.File)
|
|
32
|
+
return 'File';
|
|
33
|
+
if (dataType === ModelPropertyDataTypes.Html)
|
|
34
|
+
return 'Html';
|
|
35
|
+
return def.ref ?? def.refModelName;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const STORAGE_SEED_TYPES = new Set([
|
|
39
|
+
ModelPropertyDataTypes.Image,
|
|
40
|
+
ModelPropertyDataTypes.File,
|
|
41
|
+
ModelPropertyDataTypes.Html,
|
|
42
|
+
ModelPropertyDataTypes.Json,
|
|
43
|
+
]);
|
|
44
|
+
const isStorageTransactionPropertyName = (name) => name === 'storageTransactionId' || name === 'storage_transaction_id';
|
|
45
|
+
function publishPropertyKind(key, def) {
|
|
46
|
+
const dataType = normalizeDataType(def.dataType);
|
|
47
|
+
const refValueType = normalizeDataType(def.refValueType);
|
|
48
|
+
if (STORAGE_SEED_TYPES.has(dataType))
|
|
49
|
+
return 'storageSeed';
|
|
50
|
+
if (dataType === ModelPropertyDataTypes.Relation) {
|
|
51
|
+
return STORAGE_SEED_TYPES.has(refValueType) ? 'storageSeed' : 'relation';
|
|
52
|
+
}
|
|
53
|
+
if (dataType === ModelPropertyDataTypes.List)
|
|
54
|
+
return def.ref || def.refModelName ? 'list' : 'basic';
|
|
55
|
+
if (def.storageType === 'ItemStorage')
|
|
56
|
+
return 'itemStorage';
|
|
57
|
+
if (isStorageTransactionPropertyName(key))
|
|
58
|
+
return 'storageTransaction';
|
|
59
|
+
return 'basic';
|
|
60
|
+
}
|
|
61
|
+
const isEmptyValue = (value) => value == null || value.trim() === '';
|
|
62
|
+
/** The seed refs a property's stored value names: one (Relation, storage seed) or each list member. */
|
|
63
|
+
function refsOf(value, kind) {
|
|
64
|
+
if (isEmptyValue(value))
|
|
65
|
+
return [];
|
|
66
|
+
if (kind === 'list') {
|
|
67
|
+
return parseListPropertyValueFromStorage(value)
|
|
68
|
+
.map((member) => normalizeRelationPropertyValue(member))
|
|
69
|
+
.filter((ref) => !!ref);
|
|
70
|
+
}
|
|
71
|
+
const ref = normalizeRelationPropertyValue(value);
|
|
72
|
+
return ref ? [ref] : [];
|
|
73
|
+
}
|
|
74
|
+
async function modelOfSeed(seed, modelNameHint) {
|
|
75
|
+
if (seed.modelFileId) {
|
|
76
|
+
const model = await resolveModelRecord(undefined, { modelFileId: seed.modelFileId });
|
|
77
|
+
if (model)
|
|
78
|
+
return model;
|
|
79
|
+
}
|
|
80
|
+
return (await resolveModelRecordByNameOrType(seed.type ?? modelNameHint, {})) ?? undefined;
|
|
81
|
+
}
|
|
82
|
+
/** One seed with its model's properties and their current rows. Undefined when the seed or its model isn't local. */
|
|
83
|
+
async function readNode(seedLocalId, kind, modelNameHint) {
|
|
84
|
+
const db = BaseDb.getAppDb();
|
|
85
|
+
if (!db)
|
|
86
|
+
return undefined;
|
|
87
|
+
const seed = await findSeedRow({ localId: seedLocalId });
|
|
88
|
+
if (!seed)
|
|
89
|
+
return undefined;
|
|
90
|
+
const model = await modelOfSeed(seed, modelNameHint);
|
|
91
|
+
if (!model)
|
|
92
|
+
return undefined;
|
|
93
|
+
const definitions = await getPropertyDefinitions(model.id);
|
|
94
|
+
const metadataProperties = await readModelMetadataProperties(db, model.id);
|
|
95
|
+
const seedUid = isValidEasAttestationUid(seed.uid) ? seed.uid : undefined;
|
|
96
|
+
const seedRef = { seedLocalId: seed.localId, seedUid };
|
|
97
|
+
const properties = [];
|
|
98
|
+
for (const [key, definition] of definitions) {
|
|
99
|
+
const property = metadataProperties.find((p) => p.id === definition._dbId);
|
|
100
|
+
const match = property
|
|
101
|
+
? { property, propertyId: property.id, names: metadataPropertyNameForms(property) }
|
|
102
|
+
: { property: undefined, propertyId: null, names: [key] };
|
|
103
|
+
const row = await currentPropertyRow(seedRef, { match, propertyName: key }, { overlay: false });
|
|
104
|
+
const propertyKind = publishPropertyKind(key, definition);
|
|
105
|
+
properties.push({
|
|
106
|
+
key,
|
|
107
|
+
definition,
|
|
108
|
+
kind: propertyKind,
|
|
109
|
+
row,
|
|
110
|
+
uid: isValidEasAttestationUid(row?.uid) ? row.uid : undefined,
|
|
111
|
+
walked: false,
|
|
112
|
+
deferred: false,
|
|
113
|
+
refs: [],
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const head = await getLatestVersionRow(seed.localId);
|
|
117
|
+
const published = seedUid ? await getLatestPublishedVersionRow(seed.localId) : null;
|
|
118
|
+
const isFullNode = kind === 'root' || kind === 'draft';
|
|
119
|
+
const embeddedImages = isFullNode
|
|
120
|
+
? await db.select().from(htmlEmbeddedImageCoPublish).where(eq(htmlEmbeddedImageCoPublish.parentSeedLocalId, seed.localId))
|
|
121
|
+
: [];
|
|
122
|
+
return {
|
|
123
|
+
seedLocalId: seed.localId,
|
|
124
|
+
kind,
|
|
125
|
+
seedUid,
|
|
126
|
+
newSeed: !seedUid || (kind === 'root' && isVersionRevoked(seed.revokedAt)),
|
|
127
|
+
modelName: model.name,
|
|
128
|
+
seedSchemaUid: isValidEasAttestationUid(seed.schemaUid) ? seed.schemaUid : undefined,
|
|
129
|
+
version: {
|
|
130
|
+
localId: head?.localId ?? undefined,
|
|
131
|
+
uid: isValidEasAttestationUid(head?.uid) ? head.uid : undefined,
|
|
132
|
+
publishedUid: published?.uid,
|
|
133
|
+
},
|
|
134
|
+
properties,
|
|
135
|
+
links: [],
|
|
136
|
+
embeddedImages,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** The Html property of `node` whose value is the Html storage seed `htmlSeedLocalId`. */
|
|
140
|
+
function htmlPropertyForHtmlSeed(node, htmlSeedLocalId) {
|
|
141
|
+
const want = htmlSeedLocalId.trim();
|
|
142
|
+
return node.properties.find((p) => normalizeDataType(p.definition.dataType) === ModelPropertyDataTypes.Html && p.row?.propertyValue?.trim() === want);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The publish graph of the seed `root` (an Item, or any `{ seedLocalId }`). Waits for pending
|
|
146
|
+
* outbox ops first, so every edit made before publishing is in its row (ADR 0019), then reads rows
|
|
147
|
+
* only.
|
|
148
|
+
*/
|
|
149
|
+
async function getPublishGraph(root, options = {}) {
|
|
150
|
+
const { waitForPendingOutboxOps } = await import('./index-CYGWPoOx.js');
|
|
151
|
+
await waitForPendingOutboxOps();
|
|
152
|
+
const rootNode = await readNode(root.seedLocalId, 'root', root.modelName);
|
|
153
|
+
if (!rootNode)
|
|
154
|
+
throw new Error(`Cannot publish ${root.seedLocalId}: no local seed with a known model`);
|
|
155
|
+
const republishRevokedSeed = !!rootNode.seedUid && rootNode.newSeed;
|
|
156
|
+
const forceFullSnapshot = options.publishMode === 'new_version' || republishRevokedSeed;
|
|
157
|
+
const graph = {
|
|
158
|
+
root: rootNode,
|
|
159
|
+
nodes: [],
|
|
160
|
+
forceFullSnapshot,
|
|
161
|
+
republishRevokedSeed,
|
|
162
|
+
unpublishedRelatedItems: [],
|
|
163
|
+
relatedRefUids: new Map(),
|
|
164
|
+
brokenRefs: [],
|
|
165
|
+
missingEmbeddedImages: [],
|
|
166
|
+
};
|
|
167
|
+
const nodes = new Map([[rootNode.seedLocalId, rootNode]]);
|
|
168
|
+
// Items getting a new seed in this publish whose walk hasn't finished: a ref to one is a back edge
|
|
169
|
+
const inProgress = new Set();
|
|
170
|
+
const noteUnpublished = (propertyKey, modelName, seed) => {
|
|
171
|
+
if (graph.unpublishedRelatedItems.some((r) => r.propertyName === propertyKey && r.seedLocalId === seed.seedLocalId))
|
|
172
|
+
return;
|
|
173
|
+
graph.unpublishedRelatedItems.push({
|
|
174
|
+
propertyName: propertyKey,
|
|
175
|
+
modelName: modelName ?? seed.type ?? 'unknown',
|
|
176
|
+
seedLocalId: seed.seedLocalId,
|
|
177
|
+
seedUid: seed.seedUid,
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
const link = (target, owner, propertyKey) => {
|
|
181
|
+
if (!target.links.some((l) => l.seedLocalId === owner.seedLocalId && l.propertyKey === propertyKey)) {
|
|
182
|
+
target.links.push({ seedLocalId: owner.seedLocalId, propertyKey });
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Follows one ref of `property`: a draft target becomes a node (walked now, or already in the
|
|
187
|
+
* graph). Returns the ref with its node, or undefined for a back edge.
|
|
188
|
+
*/
|
|
189
|
+
const follow = async (owner, property, ref) => {
|
|
190
|
+
const list = property.kind === 'list';
|
|
191
|
+
const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(ref);
|
|
192
|
+
if (!seedLocalId && !seedUid) {
|
|
193
|
+
graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'invalid', list });
|
|
194
|
+
return { ref };
|
|
195
|
+
}
|
|
196
|
+
const row = await findRelatedSeedRow({ seedLocalId, seedUid });
|
|
197
|
+
const targetLocalId = row?.seedLocalId ?? seedLocalId;
|
|
198
|
+
if (property.kind !== 'storageSeed' && targetLocalId && inProgress.has(targetLocalId))
|
|
199
|
+
return 'backEdge';
|
|
200
|
+
if (isUnpublishedSeed(row)) {
|
|
201
|
+
const targetNode = nodes.get(row.seedLocalId);
|
|
202
|
+
noteUnpublished(property.key, targetNode?.modelName ?? relatedModelNameFromDef(property.definition), row);
|
|
203
|
+
return { ref, seedLocalId: row.seedLocalId };
|
|
204
|
+
}
|
|
205
|
+
if (isLivePublishedSeed(row)) {
|
|
206
|
+
if (ref !== row.seedUid)
|
|
207
|
+
graph.relatedRefUids.set(ref, row.seedUid);
|
|
208
|
+
return { ref, seedLocalId: row.seedLocalId };
|
|
209
|
+
}
|
|
210
|
+
if (!row) {
|
|
211
|
+
// An attested uid with no local copy is already published: attested as-is
|
|
212
|
+
if (!isPublishedSeedRef(ref)) {
|
|
213
|
+
graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'missing', list });
|
|
214
|
+
}
|
|
215
|
+
return { ref, seedLocalId };
|
|
216
|
+
}
|
|
217
|
+
let node = nodes.get(row.seedLocalId);
|
|
218
|
+
if (!node) {
|
|
219
|
+
const kind = property.kind === 'storageSeed' ? 'storageSeed' : 'draft';
|
|
220
|
+
node = await readNode(row.seedLocalId, kind, relatedModelNameFromDef(property.definition));
|
|
221
|
+
if (!node) {
|
|
222
|
+
graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'missing', list });
|
|
223
|
+
return { ref, seedLocalId: row.seedLocalId };
|
|
224
|
+
}
|
|
225
|
+
nodes.set(node.seedLocalId, node);
|
|
226
|
+
await visit(node);
|
|
227
|
+
}
|
|
228
|
+
return { ref, seedLocalId: node.seedLocalId, node };
|
|
229
|
+
};
|
|
230
|
+
const walkProperty = async (owner, property) => {
|
|
231
|
+
const refs = refsOf(property.row?.propertyValue, property.kind);
|
|
232
|
+
property.walked = refs.length > 0 && (!property.uid || forceFullSnapshot);
|
|
233
|
+
if (!property.walked)
|
|
234
|
+
return;
|
|
235
|
+
// A list member that is a back edge defers the whole list; its other drafts are still published
|
|
236
|
+
const followed = [];
|
|
237
|
+
for (const ref of refs) {
|
|
238
|
+
const result = await follow(owner, property, ref);
|
|
239
|
+
if (result === 'backEdge') {
|
|
240
|
+
property.deferred = true;
|
|
241
|
+
if (property.kind !== 'list')
|
|
242
|
+
return;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
followed.push(result);
|
|
246
|
+
}
|
|
247
|
+
property.refs = followed;
|
|
248
|
+
if (property.deferred)
|
|
249
|
+
return;
|
|
250
|
+
for (const { node } of followed)
|
|
251
|
+
if (node)
|
|
252
|
+
link(node, owner, property.key);
|
|
253
|
+
};
|
|
254
|
+
const walkEmbeddedImages = async (owner) => {
|
|
255
|
+
const done = new Set();
|
|
256
|
+
for (const row of owner.embeddedImages) {
|
|
257
|
+
if (done.has(row.imageSeedLocalId))
|
|
258
|
+
continue;
|
|
259
|
+
done.add(row.imageSeedLocalId);
|
|
260
|
+
const seed = await findRelatedSeedRow({ seedLocalId: row.imageSeedLocalId });
|
|
261
|
+
if (isUnpublishedSeed(seed)) {
|
|
262
|
+
noteUnpublished(htmlPropertyForHtmlSeed(owner, row.htmlSeedLocalId)?.key ?? 'html', 'Image', seed);
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if (isLivePublishedSeed(seed))
|
|
266
|
+
continue;
|
|
267
|
+
if (!seed) {
|
|
268
|
+
graph.missingEmbeddedImages.push({ seedLocalId: owner.seedLocalId, imageSeedLocalId: row.imageSeedLocalId });
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (nodes.has(seed.seedLocalId))
|
|
272
|
+
continue;
|
|
273
|
+
const node = await readNode(seed.seedLocalId, 'embeddedImage', 'Image');
|
|
274
|
+
if (!node) {
|
|
275
|
+
graph.missingEmbeddedImages.push({ seedLocalId: owner.seedLocalId, imageSeedLocalId: row.imageSeedLocalId });
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
nodes.set(node.seedLocalId, node);
|
|
279
|
+
graph.nodes.push(node);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
async function visit(node) {
|
|
283
|
+
const full = node.kind === 'root' || node.kind === 'draft';
|
|
284
|
+
if (node.newSeed)
|
|
285
|
+
inProgress.add(node.seedLocalId);
|
|
286
|
+
try {
|
|
287
|
+
if (full) {
|
|
288
|
+
for (const property of node.properties) {
|
|
289
|
+
if (property.kind === 'relation' || property.kind === 'storageSeed')
|
|
290
|
+
await walkProperty(node, property);
|
|
291
|
+
}
|
|
292
|
+
await walkEmbeddedImages(node);
|
|
293
|
+
for (const property of node.properties) {
|
|
294
|
+
if (property.kind === 'list')
|
|
295
|
+
await walkProperty(node, property);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
finally {
|
|
300
|
+
inProgress.delete(node.seedLocalId);
|
|
301
|
+
}
|
|
302
|
+
graph.nodes.push(node);
|
|
303
|
+
}
|
|
304
|
+
await visit(rootNode);
|
|
305
|
+
return graph;
|
|
306
|
+
}
|
|
307
|
+
/** Nodes of `graph` that are full items (the root and model drafts): the owners of Html properties and embedded images. */
|
|
308
|
+
const publishGraphItemNodes = (graph) => graph.nodes.filter((n) => n.kind === 'root' || n.kind === 'draft');
|
|
309
|
+
|
|
310
|
+
export { getPublishGraph as g, htmlPropertyForHtmlSeed as h, publishGraphItemNodes as p };
|
|
311
|
+
//# sourceMappingURL=publishGraph-EcB40Uii.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishGraph-EcB40Uii.js","sources":["../../src/db/read/resolveRelatedSeedRef.ts","../../src/db/read/publishGraph.ts"],"sourcesContent":["import { findSeedRow } from './findSeedRow'\nimport { ZERO_BYTES32 } from '@/helpers/constants'\nimport { isVersionRevoked } from './subqueries/liveVersion'\nimport { ModelPropertyDataTypes, normalizeDataType } from '@/helpers/property'\n\nexport type RelatedSeedRow = {\n seedLocalId: string\n /** The seed's current uid (null while it was never published). */\n seedUid: string | null\n revokedAt: number | null\n type: string | null\n}\n\n/**\n * The local seed row a relation/list/image ref points at, by local id or uid. A uid resolves as\n * {@link findSeedRow} resolves it (the order EAS sync matches seeds in): the old uid of a seed\n * that was unpublished and published again resolves to that seed, through its old version rows.\n * Null when nothing local matches (e.g. a published uid with no local copy).\n */\nexport const findRelatedSeedRow = async ({\n seedLocalId,\n seedUid,\n}: {\n seedLocalId?: string\n seedUid?: string\n}): Promise<RelatedSeedRow | null> => {\n const row = await findSeedRow({ localId: seedLocalId, uid: seedUid })\n return row ? { seedLocalId: row.localId, seedUid: row.uid, revokedAt: row.revokedAt, type: row.type } : null\n}\n\n/** The seed is attested and its attestation is live. */\nexport const isLivePublishedSeed = (row: RelatedSeedRow | null): row is RelatedSeedRow & { seedUid: string } =>\n !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && !isVersionRevoked(row.revokedAt)\n\n/** The seed was attested and that attestation was revoked (unpublished). */\nexport const isUnpublishedSeed = (row: RelatedSeedRow | null): row is RelatedSeedRow & { seedUid: string } =>\n !!row?.seedUid && row.seedUid !== ZERO_BYTES32 && isVersionRevoked(row.revokedAt)\n\n/** Model a relation/list/image property points at, from its definition. */\nexport function relatedModelNameFromDef(propertyDef: unknown): string | undefined {\n const def = propertyDef as { dataType?: string; ref?: string; refModelName?: string } | undefined\n if (!def) return undefined\n const dataType = normalizeDataType(def.dataType)\n if (dataType === ModelPropertyDataTypes.Image) return 'Image'\n if (dataType === ModelPropertyDataTypes.File) return 'File'\n if (dataType === ModelPropertyDataTypes.Html) return 'Html'\n return def.ref ?? def.refModelName\n}\n","import { eq } from 'drizzle-orm'\nimport { isValidEasAttestationUid } from '@seedprotocol/eas'\nimport { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { htmlEmbeddedImageCoPublish } from '@/seedSchema/HtmlEmbeddedImageCoPublishSchema'\nimport { findSeedRow, type FoundSeedRow } from '@/db/read/findSeedRow'\nimport { currentPropertyRow, type CurrentPropertyRow } from '@/db/read/currentPropertyRow'\nimport { getLatestVersionRow } from '@/db/read/getLatestVersionRow'\nimport { getLatestPublishedVersionRow } from '@/db/read/getLatestPublishedVersionRow'\nimport { metadataPropertyNameForms, readModelMetadataProperties } from '@/db/read/metadataProperty'\nimport { resolveModelRecord, resolveModelRecordByNameOrType } from '@/db/read/resolveModelRecord'\nimport {\n findRelatedSeedRow,\n isLivePublishedSeed,\n isUnpublishedSeed,\n relatedModelNameFromDef,\n} from '@/db/read/resolveRelatedSeedRef'\nimport { isVersionRevoked } from '@/db/read/subqueries/liveVersion'\nimport type { UnpublishedRelatedItem } from '@/db/read/publishErrors'\nimport { getPropertyDefinitions, type PropertyDefinition } from '@/helpers/propertyDefinition'\nimport { parseListPropertyValueFromStorage } from '@/helpers/listPropertyValueFromStorage'\nimport { isPublishedSeedRef } from '@/helpers/relationSeedRef'\nimport { ModelPropertyDataTypes, normalizeDataType } from '@/helpers/property'\n\n/**\n * The seeds one publish attests, read from rows once (audit T11, decision D3). The payload, the\n * uploads, the cost estimate, the upload-candidate check, the early revoked-ref check, the Html\n * embedded-image passes and EAS schema registration all read this graph; none of them reads an\n * Item or ItemProperty instance.\n *\n * The publish attests the root and every draft (no seed uid yet) reachable from it:\n * - through relation and list-of-relation properties: model items, each with its full property set;\n * - through storage-seed properties (Image, File, Html, Json, or a Relation to one): storage seeds,\n * which attest their own basic properties;\n * - through the root's and the model drafts' Html-embedded image rows (htmlEmbeddedImageCoPublish).\n * Already-published targets are referenced by their current uid and not walked into; revoked ones\n * stop the publish (RelatedItemUnpublishedError).\n *\n * Walk order: depth first; per node, relation and storage-seed properties in model order, then\n * embedded images, then lists. `nodes` is the order nodes finish, so a node comes after the\n * nodes it refers to and the root is last.\n *\n * Cycles: an item can only attest the uid of a seed published before it in the same publish, so a\n * ref back to an item still being walked (one that gets a new seed in this publish) can't be\n * attested. Such a property is deferred: left out of this publish (it keeps no uid, so the next\n * publish of its item attests it, with the target's uid). For A ↔ B reached from A, A attests B's\n * uid and B's relation to A is deferred. A list with a back reference is deferred whole; its other\n * draft members are still published, unlinked.\n */\n\n/** How a property takes part in a publish. */\nexport type PublishPropertyKind =\n /** Attested with its value. */\n | 'basic'\n /** A Relation to a model item. */\n | 'relation'\n /** A List of Relation. */\n | 'list'\n /** Image, File, Html or Json, or a Relation to one: its value is a storage seed. */\n | 'storageSeed'\n /** The node's own Arweave transaction slot (`storageTransactionId`). */\n | 'storageTransaction'\n /** An ItemStorage file, uploaded inside the node's composite upload. */\n | 'itemStorage'\n\n/** A seed one of a property's values names. */\nexport type PublishGraphRef = {\n /** The value as stored (local id, or uid). */\n ref: string\n /** The local seed it resolves to, also for the old uid of a seed published again since. */\n seedLocalId?: string\n /** The node this publish attests for it (a draft). */\n node?: PublishGraphNode\n}\n\nexport type PublishGraphProperty = {\n /** Schema key. */\n key: string\n definition: PropertyDefinition\n kind: PublishPropertyKind\n /** The property's current row. Publish waits for the outbox first, so no pending overlay. */\n row?: CurrentPropertyRow\n /** The row's attestation uid, when the row is attested. */\n uid?: string\n /**\n * Whether this publish walks the property's refs: it has a value, and no uid unless the\n * publish attests every property (`forceFullSnapshot`).\n */\n walked: boolean\n /** Points back at an item still being walked: left out of this publish. */\n deferred: boolean\n /** Relation, list and storage-seed values: the seeds named, in order. */\n refs: PublishGraphRef[]\n}\n\nexport type PublishGraphNodeKind = 'root' | 'draft' | 'storageSeed' | 'embeddedImage'\n\nexport type EmbeddedImageRow = typeof htmlEmbeddedImageCoPublish.$inferSelect\n\nexport type PublishGraphNode = {\n seedLocalId: string\n kind: PublishGraphNodeKind\n /** The seed's attestation uid; undefined for a draft. */\n seedUid?: string\n /** Gets a new seed attestation: a draft, or a revoked root published again. */\n newSeed: boolean\n modelName: string\n /** `seeds.schema_uid`. */\n seedSchemaUid?: string\n /** The head version row; `publishedUid` is the newest attested one (a draft version may be newer). */\n version: { localId?: string; uid?: string; publishedUid?: string }\n /** Every property of the node's model. */\n properties: PublishGraphProperty[]\n /** Properties in this publish that are filled with this node's new seed uid (propertiesToUpdate). */\n links: { seedLocalId: string; propertyKey: string }[]\n /** Html-embedded image rows of this node (root and model drafts only). */\n embeddedImages: EmbeddedImageRow[]\n}\n\n/** A ref the walk could not follow. */\nexport type PublishGraphBrokenRef = {\n seedLocalId: string\n propertyKey: string\n ref: string\n /** `invalid`: neither a local id nor a uid. `missing`: a local id with no local seed (or no model). */\n reason: 'invalid' | 'missing'\n list: boolean\n}\n\nexport type PublishGraph = {\n root: PublishGraphNode\n /** Every node, in the order the walk finishes them: referenced nodes first, the root last. */\n nodes: PublishGraphNode[]\n /** `new_version`, or a revoked root published again: properties with a uid are attested again. */\n forceFullSnapshot: boolean\n /** The root's seed was revoked: it gets a new seed attestation. */\n republishRevokedSeed: boolean\n /** Refs to seeds whose attestation was revoked; the publish stops with RelatedItemUnpublishedError. */\n unpublishedRelatedItems: UnpublishedRelatedItem[]\n /** Refs (local id, or a republished seed's old uid) to live published seeds, mapped to their current uid. */\n relatedRefUids: Map<string, string>\n brokenRefs: PublishGraphBrokenRef[]\n /** Embedded image rows whose image seed has no local row. */\n missingEmbeddedImages: { seedLocalId: string; imageSeedLocalId: string }[]\n}\n\nexport type PublishMode = 'patch' | 'new_version'\n\nexport type GetPublishGraphOptions = {\n /** `patch` (default): properties with a uid are left out. `new_version`: every property is attested. */\n publishMode?: PublishMode\n}\n\nconst STORAGE_SEED_TYPES = new Set<string>([\n ModelPropertyDataTypes.Image,\n ModelPropertyDataTypes.File,\n ModelPropertyDataTypes.Html,\n ModelPropertyDataTypes.Json,\n])\n\nexport const isStorageTransactionPropertyName = (name: string | undefined): boolean =>\n name === 'storageTransactionId' || name === 'storage_transaction_id'\n\nexport function publishPropertyKind(key: string, def: PropertyDefinition): PublishPropertyKind {\n const dataType = normalizeDataType(def.dataType)\n const refValueType = normalizeDataType(def.refValueType)\n if (STORAGE_SEED_TYPES.has(dataType)) return 'storageSeed'\n if (dataType === ModelPropertyDataTypes.Relation) {\n return STORAGE_SEED_TYPES.has(refValueType) ? 'storageSeed' : 'relation'\n }\n if (dataType === ModelPropertyDataTypes.List) return def.ref || def.refModelName ? 'list' : 'basic'\n if (def.storageType === 'ItemStorage') return 'itemStorage'\n if (isStorageTransactionPropertyName(key)) return 'storageTransaction'\n return 'basic'\n}\n\nconst isEmptyValue = (value: string | null | undefined): boolean => value == null || value.trim() === ''\n\n/** The seed refs a property's stored value names: one (Relation, storage seed) or each list member. */\nfunction refsOf(value: string | null | undefined, kind: PublishPropertyKind): string[] {\n if (isEmptyValue(value)) return []\n if (kind === 'list') {\n return parseListPropertyValueFromStorage(value!)\n .map((member) => normalizeRelationPropertyValue(member))\n .filter((ref): ref is string => !!ref)\n }\n const ref = normalizeRelationPropertyValue(value)\n return ref ? [ref] : []\n}\n\ntype SeedModel = { id: number; name: string }\n\nasync function modelOfSeed(seed: FoundSeedRow, modelNameHint?: string): Promise<SeedModel | undefined> {\n if (seed.modelFileId) {\n const model = await resolveModelRecord(undefined, { modelFileId: seed.modelFileId })\n if (model) return model\n }\n return (await resolveModelRecordByNameOrType(seed.type ?? modelNameHint, {})) ?? undefined\n}\n\n/** One seed with its model's properties and their current rows. Undefined when the seed or its model isn't local. */\nasync function readNode(\n seedLocalId: string,\n kind: PublishGraphNodeKind,\n modelNameHint?: string,\n): Promise<PublishGraphNode | undefined> {\n const db = BaseDb.getAppDb()\n if (!db) return undefined\n const seed = await findSeedRow({ localId: seedLocalId })\n if (!seed) return undefined\n const model = await modelOfSeed(seed, modelNameHint)\n if (!model) return undefined\n\n const definitions = await getPropertyDefinitions(model.id)\n const metadataProperties = await readModelMetadataProperties(db, model.id)\n const seedUid = isValidEasAttestationUid(seed.uid) ? seed.uid! : undefined\n const seedRef = { seedLocalId: seed.localId, seedUid }\n\n const properties: PublishGraphProperty[] = []\n for (const [key, definition] of definitions) {\n const property = metadataProperties.find((p) => p.id === definition._dbId)\n const match = property\n ? { property, propertyId: property.id, names: metadataPropertyNameForms(property) }\n : { property: undefined, propertyId: null, names: [key] }\n const row = await currentPropertyRow(seedRef, { match, propertyName: key }, { overlay: false })\n const propertyKind = publishPropertyKind(key, definition)\n properties.push({\n key,\n definition,\n kind: propertyKind,\n row,\n uid: isValidEasAttestationUid(row?.uid) ? row!.uid! : undefined,\n walked: false,\n deferred: false,\n refs: [],\n })\n }\n\n const head = await getLatestVersionRow(seed.localId)\n const published = seedUid ? await getLatestPublishedVersionRow(seed.localId) : null\n const isFullNode = kind === 'root' || kind === 'draft'\n const embeddedImages = isFullNode\n ? await db.select().from(htmlEmbeddedImageCoPublish).where(eq(htmlEmbeddedImageCoPublish.parentSeedLocalId, seed.localId))\n : []\n\n return {\n seedLocalId: seed.localId,\n kind,\n seedUid,\n newSeed: !seedUid || (kind === 'root' && isVersionRevoked(seed.revokedAt)),\n modelName: model.name,\n seedSchemaUid: isValidEasAttestationUid(seed.schemaUid) ? seed.schemaUid! : undefined,\n version: {\n localId: head?.localId ?? undefined,\n uid: isValidEasAttestationUid(head?.uid) ? head!.uid! : undefined,\n publishedUid: published?.uid,\n },\n properties,\n links: [],\n embeddedImages,\n }\n}\n\n/** The Html property of `node` whose value is the Html storage seed `htmlSeedLocalId`. */\nexport function htmlPropertyForHtmlSeed(node: PublishGraphNode, htmlSeedLocalId: string): PublishGraphProperty | undefined {\n const want = htmlSeedLocalId.trim()\n return node.properties.find(\n (p) => normalizeDataType(p.definition.dataType) === ModelPropertyDataTypes.Html && p.row?.propertyValue?.trim() === want,\n )\n}\n\n/**\n * The publish graph of the seed `root` (an Item, or any `{ seedLocalId }`). Waits for pending\n * outbox ops first, so every edit made before publishing is in its row (ADR 0019), then reads rows\n * only.\n */\nexport async function getPublishGraph(\n root: { seedLocalId: string; modelName?: string },\n options: GetPublishGraphOptions = {},\n): Promise<PublishGraph> {\n const { waitForPendingOutboxOps } = await import('@/outbox')\n await waitForPendingOutboxOps()\n const rootNode = await readNode(root.seedLocalId, 'root', root.modelName)\n if (!rootNode) throw new Error(`Cannot publish ${root.seedLocalId}: no local seed with a known model`)\n const republishRevokedSeed = !!rootNode.seedUid && rootNode.newSeed\n const forceFullSnapshot = options.publishMode === 'new_version' || republishRevokedSeed\n\n const graph: PublishGraph = {\n root: rootNode,\n nodes: [],\n forceFullSnapshot,\n republishRevokedSeed,\n unpublishedRelatedItems: [],\n relatedRefUids: new Map(),\n brokenRefs: [],\n missingEmbeddedImages: [],\n }\n const nodes = new Map<string, PublishGraphNode>([[rootNode.seedLocalId, rootNode]])\n // Items getting a new seed in this publish whose walk hasn't finished: a ref to one is a back edge\n const inProgress = new Set<string>()\n\n const noteUnpublished = (propertyKey: string, modelName: string | undefined, seed: { seedLocalId: string; seedUid: string; type?: string | null }) => {\n if (graph.unpublishedRelatedItems.some((r) => r.propertyName === propertyKey && r.seedLocalId === seed.seedLocalId)) return\n graph.unpublishedRelatedItems.push({\n propertyName: propertyKey,\n modelName: modelName ?? seed.type ?? 'unknown',\n seedLocalId: seed.seedLocalId,\n seedUid: seed.seedUid,\n })\n }\n\n const link = (target: PublishGraphNode, owner: PublishGraphNode, propertyKey: string) => {\n if (!target.links.some((l) => l.seedLocalId === owner.seedLocalId && l.propertyKey === propertyKey)) {\n target.links.push({ seedLocalId: owner.seedLocalId, propertyKey })\n }\n }\n\n /**\n * Follows one ref of `property`: a draft target becomes a node (walked now, or already in the\n * graph). Returns the ref with its node, or undefined for a back edge.\n */\n const follow = async (\n owner: PublishGraphNode,\n property: PublishGraphProperty,\n ref: string,\n ): Promise<PublishGraphRef | 'backEdge'> => {\n const list = property.kind === 'list'\n const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(ref)\n if (!seedLocalId && !seedUid) {\n graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'invalid', list })\n return { ref }\n }\n const row = await findRelatedSeedRow({ seedLocalId, seedUid })\n const targetLocalId = row?.seedLocalId ?? seedLocalId\n if (property.kind !== 'storageSeed' && targetLocalId && inProgress.has(targetLocalId)) return 'backEdge'\n if (isUnpublishedSeed(row)) {\n const targetNode = nodes.get(row.seedLocalId)\n noteUnpublished(property.key, targetNode?.modelName ?? relatedModelNameFromDef(property.definition), row)\n return { ref, seedLocalId: row.seedLocalId }\n }\n if (isLivePublishedSeed(row)) {\n if (ref !== row.seedUid) graph.relatedRefUids.set(ref, row.seedUid)\n return { ref, seedLocalId: row.seedLocalId }\n }\n if (!row) {\n // An attested uid with no local copy is already published: attested as-is\n if (!isPublishedSeedRef(ref)) {\n graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'missing', list })\n }\n return { ref, seedLocalId }\n }\n let node = nodes.get(row.seedLocalId)\n if (!node) {\n const kind = property.kind === 'storageSeed' ? 'storageSeed' : 'draft'\n node = await readNode(row.seedLocalId, kind, relatedModelNameFromDef(property.definition))\n if (!node) {\n graph.brokenRefs.push({ seedLocalId: owner.seedLocalId, propertyKey: property.key, ref, reason: 'missing', list })\n return { ref, seedLocalId: row.seedLocalId }\n }\n nodes.set(node.seedLocalId, node)\n await visit(node)\n }\n return { ref, seedLocalId: node.seedLocalId, node }\n }\n\n const walkProperty = async (owner: PublishGraphNode, property: PublishGraphProperty) => {\n const refs = refsOf(property.row?.propertyValue, property.kind)\n property.walked = refs.length > 0 && (!property.uid || forceFullSnapshot)\n if (!property.walked) return\n // A list member that is a back edge defers the whole list; its other drafts are still published\n const followed: PublishGraphRef[] = []\n for (const ref of refs) {\n const result = await follow(owner, property, ref)\n if (result === 'backEdge') {\n property.deferred = true\n if (property.kind !== 'list') return\n continue\n }\n followed.push(result)\n }\n property.refs = followed\n if (property.deferred) return\n for (const { node } of followed) if (node) link(node, owner, property.key)\n }\n\n const walkEmbeddedImages = async (owner: PublishGraphNode) => {\n const done = new Set<string>()\n for (const row of owner.embeddedImages) {\n if (done.has(row.imageSeedLocalId)) continue\n done.add(row.imageSeedLocalId)\n const seed = await findRelatedSeedRow({ seedLocalId: row.imageSeedLocalId })\n if (isUnpublishedSeed(seed)) {\n noteUnpublished(htmlPropertyForHtmlSeed(owner, row.htmlSeedLocalId)?.key ?? 'html', 'Image', seed)\n continue\n }\n if (isLivePublishedSeed(seed)) continue\n if (!seed) {\n graph.missingEmbeddedImages.push({ seedLocalId: owner.seedLocalId, imageSeedLocalId: row.imageSeedLocalId })\n continue\n }\n if (nodes.has(seed.seedLocalId)) continue\n const node = await readNode(seed.seedLocalId, 'embeddedImage', 'Image')\n if (!node) {\n graph.missingEmbeddedImages.push({ seedLocalId: owner.seedLocalId, imageSeedLocalId: row.imageSeedLocalId })\n continue\n }\n nodes.set(node.seedLocalId, node)\n graph.nodes.push(node)\n }\n }\n\n async function visit(node: PublishGraphNode): Promise<void> {\n const full = node.kind === 'root' || node.kind === 'draft'\n if (node.newSeed) inProgress.add(node.seedLocalId)\n try {\n if (full) {\n for (const property of node.properties) {\n if (property.kind === 'relation' || property.kind === 'storageSeed') await walkProperty(node, property)\n }\n await walkEmbeddedImages(node)\n for (const property of node.properties) {\n if (property.kind === 'list') await walkProperty(node, property)\n }\n }\n } finally {\n inProgress.delete(node.seedLocalId)\n }\n graph.nodes.push(node)\n }\n\n await visit(rootNode)\n return graph\n}\n\n/** Nodes of `graph` that are full items (the root and model drafts): the owners of Html properties and embedded images. */\nexport const publishGraphItemNodes = (graph: PublishGraph): PublishGraphNode[] =>\n graph.nodes.filter((n) => n.kind === 'root' || n.kind === 'draft')\n"],"names":[],"mappings":";;;;;;;;AAaA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,OAAO,EACvC,WAAW,EACX,OAAO,GAIR,KAAoC;AACnC,IAAA,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AACrE,IAAA,OAAO,GAAG,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI;AAC9G,CAAC;AAED;AACO,MAAM,mBAAmB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