@seedprotocol/sdk 0.7.9 → 0.7.10-next.1353.g74aeeed

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.
Files changed (136) hide show
  1. package/README.md +1 -1
  2. package/dist/{BaseFileManager-BAlySv8w.js → BaseFileManager-DLou1TZS.js} +5 -1
  3. package/dist/BaseFileManager-DLou1TZS.js.map +1 -0
  4. package/dist/{Item-Bf4kWKpH.js → Item-oPnmIehk.js} +571 -346
  5. package/dist/Item-oPnmIehk.js.map +1 -0
  6. package/dist/{ModelProperty-BlaEgb_U.js → ModelProperty-D2vJozmW.js} +95 -62
  7. package/dist/ModelProperty-D2vJozmW.js.map +1 -0
  8. package/dist/{Schema-J_1f6p0c.js → Schema-BMXRF4j9.js} +88 -52
  9. package/dist/Schema-BMXRF4j9.js.map +1 -0
  10. package/dist/{SchemaValidationService-CnmKyzR-.js → SchemaValidationService-CieGrj5c.js} +5 -5
  11. package/dist/{SchemaValidationService-CnmKyzR-.js.map → SchemaValidationService-CieGrj5c.js.map} +1 -1
  12. package/dist/{errors-C1qUEZ7A.js → browserSupport-C64rX-2I.js} +38 -2
  13. package/dist/browserSupport-C64rX-2I.js.map +1 -0
  14. package/dist/{configurePlatform-CiOJ1R3q.js → configurePlatform-WkmvqeTO.js} +2 -2
  15. package/dist/{configurePlatform-CiOJ1R3q.js.map → configurePlatform-WkmvqeTO.js.map} +1 -1
  16. package/dist/{detachRowsBeforeDelete-sEaUwlOU.js → detachRowsBeforeDelete-BZr_0iZU.js} +2 -2
  17. package/dist/{detachRowsBeforeDelete-sEaUwlOU.js.map → detachRowsBeforeDelete-BZr_0iZU.js.map} +1 -1
  18. package/dist/dist/{BaseFileManager-BAlySv8w.d.ts → BaseFileManager-DLou1TZS.d.ts} +3 -1
  19. package/dist/dist/BaseFileManager-DLou1TZS.d.ts.map +1 -0
  20. package/dist/dist/{configurePlatform-CiOJ1R3q.d.ts → configurePlatform-WkmvqeTO.d.ts} +1 -1
  21. package/dist/dist/configurePlatform-WkmvqeTO.d.ts.map +1 -0
  22. package/dist/dist/{index-D0V-mjCV.d.ts → index-BjWk0x4-.d.ts} +1 -1
  23. package/dist/dist/{index-D0V-mjCV.d.ts.map → index-BjWk0x4-.d.ts.map} +1 -1
  24. package/dist/dist/{index.node-CYPemH-t.d.ts → index.node-BfiBriEq.d.ts} +7 -1
  25. package/dist/dist/{index.node-CYPemH-t.d.ts.map → index.node-BfiBriEq.d.ts.map} +1 -1
  26. package/dist/dist/platform.node.d.ts +2 -2
  27. package/dist/{eas-wB_fQ8Tc.js → eas-FZPPqxqe.js} +5 -5
  28. package/dist/{eas-wB_fQ8Tc.js.map → eas-FZPPqxqe.js.map} +1 -1
  29. package/dist/{errors-DLSoqSHG.js → errors-CnT0fSMK.js} +185 -97
  30. package/dist/errors-CnT0fSMK.js.map +1 -0
  31. package/dist/{getPublishPayload-BnIwpwz1.js → getPublishPayload-DKuEaq96.js} +8 -8
  32. package/dist/{getPublishPayload-BnIwpwz1.js.map → getPublishPayload-DKuEaq96.js.map} +1 -1
  33. package/dist/{getPublishPendingDiff-D6_-A5ns.js → getPublishPendingDiff-CH5xLMjU.js} +7 -7
  34. package/dist/{getPublishPendingDiff-D6_-A5ns.js.map → getPublishPendingDiff-CH5xLMjU.js.map} +1 -1
  35. package/dist/{getPublishUploads-sS6JfPgz.js → getPublishUploads-DivYpgNw.js} +7 -7
  36. package/dist/{getPublishUploads-sS6JfPgz.js.map → getPublishUploads-DivYpgNw.js.map} +1 -1
  37. package/dist/{index-D0V-mjCV.js → index-BjWk0x4-.js} +2 -2
  38. package/dist/index-BjWk0x4-.js.map +1 -0
  39. package/dist/{index-CYGWPoOx.js → index-CZMWKXLM.js} +7 -7
  40. package/dist/index-CZMWKXLM.js.map +1 -0
  41. package/dist/{index-BVBmz_cc.js → index-DXRhFg1N.js} +7 -7
  42. package/dist/index-DXRhFg1N.js.map +1 -0
  43. package/dist/{index-DmTtj1nk.js → index-Gh42_47r.js} +402 -20
  44. package/dist/index-Gh42_47r.js.map +1 -0
  45. package/dist/{index.browser-CUmBVYen.js → index.browser-DQstVvRV.js} +46 -10
  46. package/dist/index.browser-DQstVvRV.js.map +1 -0
  47. package/dist/{index.node-CYPemH-t.js → index.node-BfiBriEq.js} +31 -4
  48. package/dist/index.node-BfiBriEq.js.map +1 -0
  49. package/dist/main.js +17 -16
  50. package/dist/main.js.map +1 -1
  51. package/dist/{modelPropertyRecordSchemas-C7UgA5TH.js → modelPropertyRecordSchemas-DEe-lYhn.js} +5 -5
  52. package/dist/{modelPropertyRecordSchemas-C7UgA5TH.js.map → modelPropertyRecordSchemas-DEe-lYhn.js.map} +1 -1
  53. package/dist/node.js +8 -8
  54. package/dist/platform.browser.js +6 -6
  55. package/dist/platform.node.js +4 -4
  56. package/dist/{property-BxUYznH0.js → property-iNW1N3vm.js} +8 -8
  57. package/dist/{property-BxUYznH0.js.map → property-iNW1N3vm.js.map} +1 -1
  58. package/dist/{publishGraph-EcB40Uii.js → publishGraph-CRn_N3NT.js} +5 -5
  59. package/dist/{publishGraph-EcB40Uii.js.map → publishGraph-CRn_N3NT.js.map} +1 -1
  60. package/dist/{readHtmlBodyForStorageSeed-D6KPtWoR.js → readHtmlBodyForStorageSeed-B7HgPmq6.js} +10 -10
  61. package/dist/{readHtmlBodyForStorageSeed-D6KPtWoR.js.map → readHtmlBodyForStorageSeed-B7HgPmq6.js.map} +1 -1
  62. package/dist/src/Item/Item.d.ts +26 -5
  63. package/dist/src/Item/Item.d.ts.map +1 -1
  64. package/dist/src/ItemProperty/ItemProperty.d.ts +20 -5
  65. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  66. package/dist/src/ItemProperty/loadProperty.d.ts.map +1 -1
  67. package/dist/src/ItemProperty/propertyWrite.d.ts.map +1 -1
  68. package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
  69. package/dist/src/Model/Model.d.ts +45 -34
  70. package/dist/src/Model/Model.d.ts.map +1 -1
  71. package/dist/src/ModelProperty/ModelProperty.d.ts +31 -13
  72. package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
  73. package/dist/src/Schema/Schema.d.ts +36 -27
  74. package/dist/src/Schema/Schema.d.ts.map +1 -1
  75. package/dist/src/archive/exportArchive.d.ts +57 -0
  76. package/dist/src/archive/exportArchive.d.ts.map +1 -0
  77. package/dist/src/browser/db/Db.d.ts +5 -0
  78. package/dist/src/browser/db/Db.d.ts.map +1 -1
  79. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  80. package/dist/src/browser/helpers/tolerantWebAccess.d.ts +12 -1
  81. package/dist/src/browser/helpers/tolerantWebAccess.d.ts.map +1 -1
  82. package/dist/src/client/ClientManager.d.ts +14 -4
  83. package/dist/src/client/ClientManager.d.ts.map +1 -1
  84. package/dist/src/db/Db/BaseDb.d.ts +2 -0
  85. package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
  86. package/dist/src/helpers/FileManager/errors.d.ts +11 -0
  87. package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
  88. package/dist/src/helpers/browserSupport.d.ts +23 -0
  89. package/dist/src/helpers/browserSupport.d.ts.map +1 -0
  90. package/dist/src/helpers/cachedPropertyRefresh.d.ts +6 -6
  91. package/dist/src/helpers/cachedPropertyRefresh.d.ts.map +1 -1
  92. package/dist/src/helpers/entity/entityCache.d.ts +45 -3
  93. package/dist/src/helpers/entity/entityCache.d.ts.map +1 -1
  94. package/dist/src/helpers/entity/entityLifecycle.d.ts +21 -3
  95. package/dist/src/helpers/entity/entityLifecycle.d.ts.map +1 -1
  96. package/dist/src/helpers/propertyDefinition.d.ts +2 -0
  97. package/dist/src/helpers/propertyDefinition.d.ts.map +1 -1
  98. package/dist/src/helpers/schemaApply.d.ts.map +1 -1
  99. package/dist/src/helpers/tabCoordinator.d.ts +9 -2
  100. package/dist/src/helpers/tabCoordinator.d.ts.map +1 -1
  101. package/dist/src/index.d.ts +4 -1
  102. package/dist/src/index.d.ts.map +1 -1
  103. package/dist/src/interfaces/IDb.d.ts +6 -0
  104. package/dist/src/interfaces/IDb.d.ts.map +1 -1
  105. package/dist/src/node/db/Db.d.ts +6 -0
  106. package/dist/src/node/db/Db.d.ts.map +1 -1
  107. package/dist/src/outbox/conflicts.d.ts.map +1 -1
  108. package/dist/src/outbox/outbox.d.ts +6 -0
  109. package/dist/src/outbox/outbox.d.ts.map +1 -1
  110. package/dist/src/types/index.d.ts +16 -0
  111. package/dist/src/types/index.d.ts.map +1 -1
  112. package/dist/{syncDbWithEas-CA7PvBgu.js → syncDbWithEas-FuyqoEKk.js} +14 -14
  113. package/dist/{syncDbWithEas-CA7PvBgu.js.map → syncDbWithEas-FuyqoEKk.js.map} +1 -1
  114. package/dist/{tabEvents-CaVmngqr.js → tabEvents-DT5ez6io.js} +38 -12
  115. package/dist/tabEvents-DT5ez6io.js.map +1 -0
  116. package/dist/{tolerantWebAccess-BJqViq08.js → tolerantWebAccess-zEseJ2zT.js} +53 -13
  117. package/dist/tolerantWebAccess-zEseJ2zT.js.map +1 -0
  118. package/dist/{updateSeedRevokedAt-BL9Bg-G7.js → updateSeedRevokedAt-B9JRwr5T.js} +3 -3
  119. package/dist/{updateSeedRevokedAt-BL9Bg-G7.js.map → updateSeedRevokedAt-B9JRwr5T.js.map} +1 -1
  120. package/package.json +10 -12
  121. package/dist/BaseFileManager-BAlySv8w.js.map +0 -1
  122. package/dist/Item-Bf4kWKpH.js.map +0 -1
  123. package/dist/ModelProperty-BlaEgb_U.js.map +0 -1
  124. package/dist/Schema-J_1f6p0c.js.map +0 -1
  125. package/dist/dist/BaseFileManager-BAlySv8w.d.ts.map +0 -1
  126. package/dist/dist/configurePlatform-CiOJ1R3q.d.ts.map +0 -1
  127. package/dist/errors-C1qUEZ7A.js.map +0 -1
  128. package/dist/errors-DLSoqSHG.js.map +0 -1
  129. package/dist/index-BVBmz_cc.js.map +0 -1
  130. package/dist/index-CYGWPoOx.js.map +0 -1
  131. package/dist/index-D0V-mjCV.js.map +0 -1
  132. package/dist/index-DmTtj1nk.js.map +0 -1
  133. package/dist/index.browser-CUmBVYen.js.map +0 -1
  134. package/dist/index.node-CYPemH-t.js.map +0 -1
  135. package/dist/tabEvents-CaVmngqr.js.map +0 -1
  136. package/dist/tolerantWebAccess-BJqViq08.js.map +0 -1
@@ -1 +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,GAAG,CAAC,GAA0B,KAC5D,CAAC,CAAC,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,KAAK,YAAY,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC;AAEpF;AACO,MAAM,iBAAiB,GAAG,CAAC,GAA0B,KAC1D,CAAC,CAAC,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,KAAK,YAAY,IAAI,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC;AAEnF;AACM,SAAU,uBAAuB,CAAC,WAAoB,EAAA;IAC1D,MAAM,GAAG,GAAG,WAAqF;AACjG,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC;AAChD,IAAA,IAAI,QAAQ,KAAK,sBAAsB,CAAC,KAAK;AAAE,QAAA,OAAO,OAAO;AAC7D,IAAA,IAAI,QAAQ,KAAK,sBAAsB,CAAC,IAAI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UAAU,EAAE;AACtC,oBAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM;AAAE,wBAAA,MAAM,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAClE;YACF;QACF;gBAAU;AACR,YAAA,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QACrC;AACA,QAAA,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB;AAEA,IAAA,MAAM,KAAK,CAAC,QAAQ,CAAC;AACrB,IAAA,OAAO,KAAK;AACd;AAEA;AACO,MAAM,qBAAqB,GAAG,CAAC,KAAmB,KACvD,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;;"}
1
+ {"version":3,"file":"publishGraph-CRn_N3NT.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,GAAG,CAAC,GAA0B,KAC5D,CAAC,CAAC,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,KAAK,YAAY,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC;AAEpF;AACO,MAAM,iBAAiB,GAAG,CAAC,GAA0B,KAC1D,CAAC,CAAC,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,KAAK,YAAY,IAAI,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC;AAEnF;AACM,SAAU,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AAE;AACR,gBAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;oBACtC,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,KAAK,aAAa;AAAE,wBAAA,MAAM,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;gBACzG;AACA,gBAAA,MAAM,kBAAkB,CAAC,IAAI,CAAC;AAC9B,gBAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;AACtC,oBAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM;AAAE,wBAAA,MAAM,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAClE;YACF;QACF;gBAAU;AACR,YAAA,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QACrC;AACA,QAAA,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB;AAEA,IAAA,MAAM,KAAK,CAAC,QAAQ,CAAC;AACrB,IAAA,OAAO,KAAK;AACd;AAEA;AACO,MAAM,qBAAqB,GAAG,CAAC,KAAmB,KACvD,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;;"}
@@ -1,4 +1,4 @@
1
- import { w as BaseFileManager } from './BaseFileManager-BAlySv8w.js';
1
+ import { w as BaseFileManager } from './BaseFileManager-DLou1TZS.js';
2
2
  import { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave';
3
3
  import 'debug';
4
4
  import 'drizzle-orm/sqlite-core';
@@ -36,8 +36,8 @@ async function resolveHtmlStorageSeedLocalId(propertyValue) {
36
36
  if (!pv)
37
37
  return undefined;
38
38
  if (SEED_UID_HEX_RE.test(pv)) {
39
- const _mod_0 = await import('./tabEvents-CaVmngqr.js');
40
- const _ns_0 = _mod_0.bd;
39
+ const _mod_0 = await import('./tabEvents-DT5ez6io.js');
40
+ const _ns_0 = _mod_0.bg;
41
41
  const { findSeedRow } = _ns_0;
42
42
  return (await findSeedRow({ uid: pv }))?.localId ?? undefined;
43
43
  }
@@ -49,8 +49,8 @@ async function resolveHtmlStorageSeedLocalId(propertyValue) {
49
49
  * client, then a download into `html/` (named after the seed or the transaction).
50
50
  */
51
51
  async function readHtmlBodyFromChildStorageArweave(seedLocalId) {
52
- const _mod_1 = await import('./Item-Bf4kWKpH.js');
53
- const _ns_1 = _mod_1.b2;
52
+ const _mod_1 = await import('./Item-oPnmIehk.js');
53
+ const _ns_1 = _mod_1.b8;
54
54
  const { storageSeedTransactionId } = _ns_1;
55
55
  const txId = await storageSeedTransactionId({ seedLocalId });
56
56
  if (!txId || SEED_UID_HEX_RE.test(txId))
@@ -70,12 +70,12 @@ async function readHtmlBodyFromChildStorageArweave(seedLocalId) {
70
70
  /* offline / bad tx id */
71
71
  }
72
72
  try {
73
- const _mod_2 = await import('./tabEvents-CaVmngqr.js');
74
- const _ns_2 = _mod_2.bj;
73
+ const _mod_2 = await import('./tabEvents-DT5ez6io.js');
74
+ const _ns_2 = _mod_2.bm;
75
75
  const { downloadTransactionIdWithDedupe } = _ns_2;
76
76
  await downloadTransactionIdWithDedupe(txId);
77
- const _mod_3 = await import('./tabEvents-CaVmngqr.js');
78
- const _ns_3 = _mod_3.bk;
77
+ const _mod_3 = await import('./tabEvents-DT5ez6io.js');
78
+ const _ns_3 = _mod_3.bn;
79
79
  const { findFileInDir } = _ns_3;
80
80
  const filePath = await findFileInDir('html', [`${seedLocalId}.html`, extractArweaveTransactionId(txId)]);
81
81
  if (filePath)
@@ -107,4 +107,4 @@ async function readHtmlBodyForStorageSeedPropertyValue(propertyValue) {
107
107
  }
108
108
 
109
109
  export { readHtmlBodyForStorageSeedPropertyValue, resolveHtmlStorageSeedLocalId };
110
- //# sourceMappingURL=readHtmlBodyForStorageSeed-D6KPtWoR.js.map
110
+ //# sourceMappingURL=readHtmlBodyForStorageSeed-B7HgPmq6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readHtmlBodyForStorageSeed-D6KPtWoR.js","sources":["../../src/helpers/readHtmlBodyForStorageSeed.ts"],"sourcesContent":["import { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave'\n\n/** Published storage seeds use `0x` + 64 hex; `saveHtml` still writes `html/{localId}.html`. */\nconst SEED_UID_HEX_RE = /^0x[a-fA-F0-9]{64}$/\n\n/** Arweave L1 transaction ids are 43 URL-safe base64 characters. */\nconst ARWEAVE_TX_ID_IN_STRING_RE = /[a-z0-9_-]{43}/i\n\nfunction extractArweaveTransactionId(raw: string): string {\n const t = raw.trim()\n const embedded = t.match(ARWEAVE_TX_ID_IN_STRING_RE)\n if (embedded && /^[a-z0-9_-]{43}$/i.test(embedded[0])) {\n return embedded[0]\n }\n return t\n}\n\n/**\n * GET /raw/{txId} on each read gateway, preferred ones ({@link setPreferredArweaveReadBaseUrls})\n * first. Avoids arweave.js /tx/.../offset which often 404s on arweave.net while another gateway\n * (e.g. ar.seedprotocol.io, or the one the item was just uploaded through) still serves the data.\n */\nasync function fetchHtmlViaRawAcrossGateways(txId: string): Promise<string | undefined> {\n const id = extractArweaveTransactionId(txId)\n if (!id || SEED_UID_HEX_RE.test(id)) return undefined\n return fetchArweaveRawTextAcrossGateways(id)\n}\n\n/**\n * Resolve the Html storage seed's `local_id` used for the `{localId}.html` file name.\n * `propertyValue` on the parent Html property is either that local id or the seed uid after publish.\n */\nexport async function resolveHtmlStorageSeedLocalId(\n propertyValue: string | null | undefined,\n): Promise<string | undefined> {\n const pv = String(propertyValue ?? '').trim()\n if (!pv) return undefined\n if (SEED_UID_HEX_RE.test(pv)) {\n const { findSeedRow } = await import('../db/read/findSeedRow')\n return (await findSeedRow({ uid: pv }))?.localId ?? undefined\n }\n return pv\n}\n\n/**\n * When the local draft file is gone (new device, OPFS cleared, etc.), load HTML from the\n * Html storage seed's published Arweave transaction id: a read gateway's `/raw`, then the Arweave\n * client, then a download into `html/` (named after the seed or the transaction).\n */\nasync function readHtmlBodyFromChildStorageArweave(seedLocalId: string): Promise<string | undefined> {\n const { storageSeedTransactionId } = await import('@/storageValue/resolve')\n const txId = await storageSeedTransactionId({ seedLocalId })\n if (!txId || SEED_UID_HEX_RE.test(txId)) return undefined\n\n const rawHtml = await fetchHtmlViaRawAcrossGateways(txId)\n if (rawHtml) return rawHtml\n\n try {\n const { BaseArweaveClient } = await import('@seedprotocol/arweave')\n const data = await BaseArweaveClient.getTransactionData(extractArweaveTransactionId(txId), {\n string: true,\n })\n if (typeof data === 'string' && data.length > 0) return data\n } catch {\n /* offline / bad tx id */\n }\n\n try {\n const { downloadTransactionIdWithDedupe } = await import('../events/files/download')\n await downloadTransactionIdWithDedupe(txId)\n const { findFileInDir } = await import('@/storageValue/findFile')\n const filePath = await findFileInDir('html', [`${seedLocalId}.html`, extractArweaveTransactionId(txId)])\n if (filePath) return BaseFileManager.readFileAsString(filePath)\n } catch {\n /* OPFS unsupported or download failed */\n }\n return undefined\n}\n\n/** Read saved HTML body for a parent Html property whose `propertyValue` points at the Html storage seed. */\nexport async function readHtmlBodyForStorageSeedPropertyValue(\n propertyValue: string | null | undefined,\n): Promise<string | undefined> {\n const pv = String(propertyValue ?? '').trim()\n if (!pv) return undefined\n const localId = await resolveHtmlStorageSeedLocalId(propertyValue)\n const fp = localId ? BaseFileManager.getFilesPath('html', `${localId}.html`) : ''\n let fileExists = fp ? await BaseFileManager.pathExists(fp) : false\n // OPFS: file can appear shortly after create/download; avoid false \"missing\" before hitting Arweave.\n if (!fileExists && fp) {\n await BaseFileManager.waitForFileWithContent(fp, 100, 5000).catch(() => {})\n fileExists = await BaseFileManager.pathExists(fp)\n }\n let body = fileExists && fp ? await BaseFileManager.readFileAsString(fp) : undefined\n\n if (!body && localId) {\n body = await readHtmlBodyFromChildStorageArweave(localId)\n }\n\n return body\n}\n"],"names":[],"mappings":";;;;;;AAGA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CAAC,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;AAEpF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,OAAO,CAAA,CAAE;AACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAI,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmC,CAAC,OAAO,CAAC;IAC3D;AAEA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAI;AACb;;"}
1
+ {"version":3,"file":"readHtmlBodyForStorageSeed-B7HgPmq6.js","sources":["../../src/helpers/readHtmlBodyForStorageSeed.ts"],"sourcesContent":["import { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave'\n\n/** Published storage seeds use `0x` + 64 hex; `saveHtml` still writes `html/{localId}.html`. */\nconst SEED_UID_HEX_RE = /^0x[a-fA-F0-9]{64}$/\n\n/** Arweave L1 transaction ids are 43 URL-safe base64 characters. */\nconst ARWEAVE_TX_ID_IN_STRING_RE = /[a-z0-9_-]{43}/i\n\nfunction extractArweaveTransactionId(raw: string): string {\n const t = raw.trim()\n const embedded = t.match(ARWEAVE_TX_ID_IN_STRING_RE)\n if (embedded && /^[a-z0-9_-]{43}$/i.test(embedded[0])) {\n return embedded[0]\n }\n return t\n}\n\n/**\n * GET /raw/{txId} on each read gateway, preferred ones ({@link setPreferredArweaveReadBaseUrls})\n * first. Avoids arweave.js /tx/.../offset which often 404s on arweave.net while another gateway\n * (e.g. ar.seedprotocol.io, or the one the item was just uploaded through) still serves the data.\n */\nasync function fetchHtmlViaRawAcrossGateways(txId: string): Promise<string | undefined> {\n const id = extractArweaveTransactionId(txId)\n if (!id || SEED_UID_HEX_RE.test(id)) return undefined\n return fetchArweaveRawTextAcrossGateways(id)\n}\n\n/**\n * Resolve the Html storage seed's `local_id` used for the `{localId}.html` file name.\n * `propertyValue` on the parent Html property is either that local id or the seed uid after publish.\n */\nexport async function resolveHtmlStorageSeedLocalId(\n propertyValue: string | null | undefined,\n): Promise<string | undefined> {\n const pv = String(propertyValue ?? '').trim()\n if (!pv) return undefined\n if (SEED_UID_HEX_RE.test(pv)) {\n const { findSeedRow } = await import('../db/read/findSeedRow')\n return (await findSeedRow({ uid: pv }))?.localId ?? undefined\n }\n return pv\n}\n\n/**\n * When the local draft file is gone (new device, OPFS cleared, etc.), load HTML from the\n * Html storage seed's published Arweave transaction id: a read gateway's `/raw`, then the Arweave\n * client, then a download into `html/` (named after the seed or the transaction).\n */\nasync function readHtmlBodyFromChildStorageArweave(seedLocalId: string): Promise<string | undefined> {\n const { storageSeedTransactionId } = await import('@/storageValue/resolve')\n const txId = await storageSeedTransactionId({ seedLocalId })\n if (!txId || SEED_UID_HEX_RE.test(txId)) return undefined\n\n const rawHtml = await fetchHtmlViaRawAcrossGateways(txId)\n if (rawHtml) return rawHtml\n\n try {\n const { BaseArweaveClient } = await import('@seedprotocol/arweave')\n const data = await BaseArweaveClient.getTransactionData(extractArweaveTransactionId(txId), {\n string: true,\n })\n if (typeof data === 'string' && data.length > 0) return data\n } catch {\n /* offline / bad tx id */\n }\n\n try {\n const { downloadTransactionIdWithDedupe } = await import('../events/files/download')\n await downloadTransactionIdWithDedupe(txId)\n const { findFileInDir } = await import('@/storageValue/findFile')\n const filePath = await findFileInDir('html', [`${seedLocalId}.html`, extractArweaveTransactionId(txId)])\n if (filePath) return BaseFileManager.readFileAsString(filePath)\n } catch {\n /* OPFS unsupported or download failed */\n }\n return undefined\n}\n\n/** Read saved HTML body for a parent Html property whose `propertyValue` points at the Html storage seed. */\nexport async function readHtmlBodyForStorageSeedPropertyValue(\n propertyValue: string | null | undefined,\n): Promise<string | undefined> {\n const pv = String(propertyValue ?? '').trim()\n if (!pv) return undefined\n const localId = await resolveHtmlStorageSeedLocalId(propertyValue)\n const fp = localId ? BaseFileManager.getFilesPath('html', `${localId}.html`) : ''\n let fileExists = fp ? await BaseFileManager.pathExists(fp) : false\n // OPFS: file can appear shortly after create/download; avoid false \"missing\" before hitting Arweave.\n if (!fileExists && fp) {\n await BaseFileManager.waitForFileWithContent(fp, 100, 5000).catch(() => {})\n fileExists = await BaseFileManager.pathExists(fp)\n }\n let body = fileExists && fp ? await BaseFileManager.readFileAsString(fp) : undefined\n\n if (!body && localId) {\n body = await readHtmlBodyFromChildStorageArweave(localId)\n }\n\n return body\n}\n"],"names":[],"mappings":";;;;;;AAGA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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ModelValues<ModelSchema>> implements IItem<T
31
31
  * write their ItemProperty's value.
32
32
  */
33
33
  private static wrapInProxy;
34
+ /** Throws EntityUnloadedError, naming the item, when this instance was unloaded. */
35
+ private _assertLoaded;
34
36
  /**
35
37
  * The ItemProperty a model property name reads and writes on the item: by its name, or by its
36
38
  * storage name (`html` finds `htmlId` and the other way round). Internal names don't resolve.
@@ -97,11 +99,33 @@ export declare class Item<T extends ModelValues<ModelSchema>> implements IItem<T
97
99
  * @returns Item instance or undefined if not found
98
100
  */
99
101
  static createById(id: string, modelName?: string, idKind?: 'localId'): Promise<Item<any> | undefined>;
100
- static find({ modelName, seedLocalId, seedUid, waitForReady, readyTimeout, }: ItemFindProps & {
102
+ /**
103
+ * The Item for a seedLocalId or seedUid, loaded from its rows when it isn't cached. Takes no
104
+ * cache hold: an item no one holds stays cached for the grace period
105
+ * (`SeedConfig.entityCache.unloadGraceMs`) after this lookup, then unloads. A caller that keeps
106
+ * the item longer passes `hold: true` and releases it with `unload()`, or holds it with
107
+ * `Item.retain` (React hooks do). Returns undefined, keeping no hold, when there is no such item
108
+ * or it isn't ready in `readyTimeout`.
109
+ */
110
+ static find({ modelName, seedLocalId, seedUid, waitForReady, readyTimeout, hold, }: ItemFindProps & {
101
111
  waitForReady?: boolean;
102
112
  readyTimeout?: number;
113
+ hold?: boolean;
103
114
  }): Promise<IItem<any> | undefined>;
115
+ /**
116
+ * Takes one more hold on a cached, running instance, released with `unload()`. False (and no
117
+ * hold) when the instance isn't cached or was stopped.
118
+ */
119
+ static retain(instance: IItem<any>): boolean;
120
+ /**
121
+ * The items of a model (every model when `modelName` is omitted), newest first. Takes no cache
122
+ * holds, as `find`: an item no one holds unloads after the grace period. With `hold: true` each
123
+ * item comes with a hold the caller releases with `unload()`; when the call then throws (aborted,
124
+ * an item not ready in `readyTimeout`), it keeps none of the holds it took.
125
+ */
104
126
  static all(modelName?: string, deleted?: boolean, options?: {
127
+ /** Take a cache hold on each returned item (default false). */
128
+ hold?: boolean;
105
129
  waitForReady?: boolean;
106
130
  readyTimeout?: number;
107
131
  includeEas?: boolean;
@@ -110,10 +134,7 @@ export declare class Item<T extends ModelValues<ModelSchema>> implements IItem<T
110
134
  modelFileId?: string;
111
135
  /** ... or the schema that defines it. */
112
136
  schemaName?: string;
113
- /**
114
- * Stops building items once aborted and rejects with the signal's reason. Items already
115
- * built stay loaded.
116
- */
137
+ /** Stops building items once aborted and rejects with the signal's reason. */
117
138
  signal?: AbortSignal;
118
139
  }): Promise<Item<any>[]>;
119
140
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../src/Item/Item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAapE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,OAAO,EACL,2BAA2B,EAC3B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AACtC,OAAO,EACL,YAAY,EACZ,YAAY,EAKb,MAAM,QAAQ,CAAA;AAiBf,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAuI1D,qBAAa,IAAI,CAAC,CAAC,SAAS,WAAW,CAAC,WAAW,CAAC,CAAE,YAAW,KAAK,CAAC,CAAC,CAAC;IAEvE,iDAAiD;IACjD,MAAM,CAAC,QAAQ,CAAC,KAAK,yBAA+B;IACpD,SAAS,CAAC,aAAa,EAAE,YAAY,GAAG,SAAS,CAAC;IAClD,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EA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
  /**
38
- * @internal false for SDK code that hands the instance to an owner that takes its own hold (an
39
- * Item's property map): no hold is taken, and a new instance is cached with none.
38
+ * Take a cache hold, released with `unload()`. `create` holds by default; `find` and `all` don't:
39
+ * a property no one holds unloads after the grace period (`SeedConfig.entityCache.unloadGraceMs`).
40
+ * SDK code that hands a new instance to an owner taking its own hold (an Item's property map)
41
+ * creates it with false.
40
42
  */
41
- hold?: false;
43
+ hold?: boolean;
42
44
  };
43
45
  export declare class ItemProperty<PropertyType> implements IItemProperty<PropertyType> {
44
46
  /** Cached as `Item_<id>_<propertyName>` under its item's local id and seed uid. */
@@ -65,6 +67,14 @@ export declare class ItemProperty<PropertyType> implements IItemProperty<Propert
65
67
  * This enables cross-instance synchronization (e.g., changes in other tabs/windows)
66
68
  */
67
69
  private _setupLiveQuerySubscription;
70
+ /** Takes a property definition read from its row, as the constructor takes the initial one. */
71
+ private _applyDefinition;
72
+ /**
73
+ * Gives cached instances of these properties their rows' current definitions, after a schema
74
+ * change wrote the rows (refreshCachedProperties). An instance keeps the definition it loaded
75
+ * with otherwise: Node has no live query, and the browser's arrives some time after the write.
76
+ */
77
+ static refreshDefinitions(propertyFileIds: string[]): Promise<void>;
68
78
  /**
69
79
  * Set up liveQuery subscription to watch for property schema changes in the properties table.
70
80
  * When ModelProperty dataType (or other schema fields) changes in the database, ItemProperty
@@ -106,7 +116,10 @@ export declare class ItemProperty<PropertyType> implements IItemProperty<Propert
106
116
  seedLocalId?: string;
107
117
  seedUid?: string;
108
118
  }): ItemProperty<any> | undefined;
109
- /** Takes a hold on the instance it returns: release it with `unload()`. */
119
+ /**
120
+ * The property's instance, loaded from its row when it isn't cached. Takes no hold unless
121
+ * `hold: true` (release it with `unload()`).
122
+ */
110
123
  static find({ propertyName, seedLocalId, seedUid, modelName: modelNameOption, waitForReady, readyTimeout, hold, }: ItemPropertyFindProps & {
111
124
  waitForReady?: boolean;
112
125
  readyTimeout?: number;
@@ -114,7 +127,7 @@ export declare class ItemProperty<PropertyType> implements IItemProperty<Propert
114
127
  /**
115
128
  * Get all ItemProperty instances for an item.
116
129
  * Loads property data via getItemProperties, creates instances via create, optionally waits for idle.
117
- * Takes a hold on each instance, as `create` does.
130
+ * Takes no holds unless `hold: true`, as `find`.
118
131
  */
119
132
  static all(params: {
120
133
  seedLocalId?: string;
@@ -261,6 +274,8 @@ export declare class ItemProperty<PropertyType> implements IItemProperty<Propert
261
274
  * Every cache key holding this instance: its item's local id and seed uid, and the name it had
262
275
  * before a rename (List of relation). They share one entry.
263
276
  */
277
+ /** Throws EntityUnloadedError, naming the property and its item, when this instance was unloaded. */
278
+ private _assertLoaded;
264
279
  /** Releases this caller's hold; the last one stops the property and drops it from the cache. */
265
280
  unload(): void;
266
281
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ItemProperty.d.ts","sourceRoot":"","sources":["../../../src/ItemProperty/ItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6B,YAAY,EAAW,MAAM,QAAQ,CAAA;AACvF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAsC,MAAM,SAAS,CAAA;AAIjH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAwB3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAmB1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAgFzC,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAA;AAiD/D,4GAA4G;AAC5G,qBAAa,+BAAgC,SAAQ,KAAK;aAGtC,gBAAgB,EAAE,OAAO,qBAAqB,EAAE,eAAe,EAAE;gBADjF,OAAO,EAAE,MAAM,EACC,gBAAgB,EAAE,O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E,MAAM,CAAA;CAAE,CAAA;AAEvF;;;GAGG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CA2K3F"}
1
+ {"version":3,"file":"loadProperty.d.ts","sourceRoot":"","sources":["../../../src/ItemProperty/loadProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAYzD,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvF;;;GAGG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CA0K3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"propertyWrite.d.ts","sourceRoot":"","sources":["../../../src/ItemProperty/propertyWrite.ts"],"names":[],"mappings":"AAQA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAExF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,OAAO,EAAkD,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAUzG,sGAAsG;AACtG,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAUpD;AAED,eAAO,MAAM,kBAAkB,QAAO,OAA0C,CAAA;AAEhF,wDAAwD;AACxD,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAA;AAEV,qHAAqH;AACrH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,aAAa,GAAG,KAAK,CAAA;AAEnE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,CAAC,GAAG,iBAAiB,CAQxH;AAED,kFAAkF;AAClF,MAAM,MAAM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Q,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAQzD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uHAgFxB,CAAA"}
1
+ {"version":3,"file":"hydrateFromDb.d.ts","sourceRoot":"","sources":["../../../../../src/ItemProperty/service/actors/hydrateFromDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAQzD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uHAqFxB,CAAA"}