@seedprotocol/sdk 0.7.11-next.1384.g8b47246 → 0.7.11
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-DLou1TZS.js → BaseFileManager-D-pLXQAp.js} +2 -14
- package/dist/BaseFileManager-D-pLXQAp.js.map +1 -0
- package/dist/{Item-Ld1iPicQ.js → Item-BU9wIT7l.js} +61 -59
- package/dist/Item-BU9wIT7l.js.map +1 -0
- package/dist/{ModelProperty-C8gTx4pO.js → ModelProperty-Bv7KzP97.js} +40 -37
- package/dist/ModelProperty-Bv7KzP97.js.map +1 -0
- package/dist/{Schema-BzeBUZxi.js → Schema-C_4wv0RP.js} +22 -22
- package/dist/{Schema-BzeBUZxi.js.map → Schema-C_4wv0RP.js.map} +1 -1
- package/dist/{SchemaValidationService-CW0s7V7R.js → SchemaValidationService-Dc-lpFQX.js} +9 -6
- package/dist/{SchemaValidationService-CW0s7V7R.js.map → SchemaValidationService-Dc-lpFQX.js.map} +1 -1
- package/dist/{tabEvents-BnBzIdEi.js → arweaveContentTags-iW_HcWJA.js} +53 -5
- package/dist/arweaveContentTags-iW_HcWJA.js.map +1 -0
- package/dist/{configurePlatform-WkmvqeTO.js → configurePlatform-BH1YOZpg.js} +2 -2
- package/dist/{configurePlatform-WkmvqeTO.js.map → configurePlatform-BH1YOZpg.js.map} +1 -1
- package/dist/db/drizzle/0030_drop_property_uids.sql +1 -0
- package/dist/db/drizzle/meta/0030_snapshot.json +1638 -0
- package/dist/db/drizzle/meta/_journal.json +8 -1
- package/dist/{detachRowsBeforeDelete-BZr_0iZU.js → detachRowsBeforeDelete-Cie55SoG.js} +4 -6
- package/dist/detachRowsBeforeDelete-Cie55SoG.js.map +1 -0
- package/dist/dist/{BaseFileManager-DLou1TZS.d.ts → BaseFileManager-D-pLXQAp.d.ts} +432 -495
- package/dist/dist/BaseFileManager-D-pLXQAp.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-WkmvqeTO.d.ts → configurePlatform-BH1YOZpg.d.ts} +1 -1
- package/dist/dist/configurePlatform-BH1YOZpg.d.ts.map +1 -0
- package/dist/dist/{index-BjWk0x4-.d.ts → index-2PaIhvOU.d.ts} +1 -64
- package/dist/dist/{index-BjWk0x4-.d.ts.map → index-2PaIhvOU.d.ts.map} +1 -1
- package/dist/dist/{index.node-DV1OXCp0.d.ts → index.node-C3rI1upv.d.ts} +1 -253
- package/dist/dist/{index.node-DV1OXCp0.d.ts.map → index.node-C3rI1upv.d.ts.map} +1 -1
- package/dist/dist/minimumUpgradeVersion-Dg2MguFf.d.ts +20 -0
- package/dist/dist/minimumUpgradeVersion-Dg2MguFf.d.ts.map +1 -0
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/{download-Cvac_VGu.js → download-DHWUPLlK.js} +4 -5
- package/dist/{download-Cvac_VGu.js.map → download-DHWUPLlK.js.map} +1 -1
- package/dist/{eas-CdhfODXL.js → eas-MXEdKKVc.js} +10 -7
- package/dist/{eas-CdhfODXL.js.map → eas-MXEdKKVc.js.map} +1 -1
- package/dist/{ensureImageLocal-DNM6c2yD.js → ensureImageLocal-B6suz6FC.js} +8 -9
- package/dist/{ensureImageLocal-DNM6c2yD.js.map → ensureImageLocal-B6suz6FC.js.map} +1 -1
- package/dist/{getPublishPayload-CLrAcZwr.js → getPublishPayload-Dd3HCYeI.js} +8 -49
- package/dist/getPublishPayload-Dd3HCYeI.js.map +1 -0
- package/dist/{getPublishPendingDiff-DiPff8pS.js → getPublishPendingDiff-kcTP52Kj.js} +11 -9
- package/dist/{getPublishPendingDiff-DiPff8pS.js.map → getPublishPendingDiff-kcTP52Kj.js.map} +1 -1
- package/dist/{index-BjWk0x4-.js → index-2PaIhvOU.js} +2 -4
- package/dist/index-2PaIhvOU.js.map +1 -0
- package/dist/{index-9udoYObJ.js → index-BXTyvnKb.js} +11 -8
- package/dist/index-BXTyvnKb.js.map +1 -0
- package/dist/{index-CghAYA-z.js → index-CmNqUKQN.js} +11 -8
- package/dist/index-CmNqUKQN.js.map +1 -0
- package/dist/{index-Cdm7Q7el.js → index-Xs_EDi-_.js} +18 -403
- package/dist/index-Xs_EDi-_.js.map +1 -0
- package/dist/{index.browser-D9oC-KKx.js → index.browser-BkcOQGhw.js} +25 -69
- package/dist/index.browser-BkcOQGhw.js.map +1 -0
- package/dist/{index.node-DV1OXCp0.js → index.node-C3rI1upv.js} +8 -6
- package/dist/index.node-C3rI1upv.js.map +1 -0
- package/dist/main.js +19 -22
- package/dist/main.js.map +1 -1
- package/dist/{minimumUpgradeVersion-BDhHvHtr.js → minimumUpgradeVersion-Dg2MguFf.js} +38 -9
- package/dist/minimumUpgradeVersion-Dg2MguFf.js.map +1 -0
- package/dist/{modelPropertyRecordSchemas-se4QMXSi.js → modelPropertyRecordSchemas-CEac3FB8.js} +8 -5
- package/dist/{modelPropertyRecordSchemas-se4QMXSi.js.map → modelPropertyRecordSchemas-CEac3FB8.js.map} +1 -1
- package/dist/node.js +14 -11
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +6 -7
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +5 -5
- package/dist/{property-Broz_CWj.js → property-4jSqHieb.js} +11 -8
- package/dist/property-4jSqHieb.js.map +1 -0
- package/dist/{errors-DKxFSvb3.js → publishErrors-DZXDX3B6.js} +1688 -195
- package/dist/publishErrors-DZXDX3B6.js.map +1 -0
- package/dist/{readHtmlBodyForStorageSeed-FvwYPn4m.js → readHtmlBodyForStorageSeed-Cva1DPzE.js} +9 -9
- package/dist/{readHtmlBodyForStorageSeed-FvwYPn4m.js.map → readHtmlBodyForStorageSeed-Cva1DPzE.js.map} +1 -1
- package/dist/seedSchema/index.ts +0 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +1 -0
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/db/minimumUpgradeVersion.d.ts +20 -5
- package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -1
- package/dist/src/helpers/entity/detachRowsBeforeDelete.d.ts +2 -3
- package/dist/src/helpers/entity/detachRowsBeforeDelete.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +9 -1
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/seedSchema/index.d.ts +0 -1
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-Dj_8VqM7.js → syncDbWithEas-V_9gIyHp.js} +21 -20
- package/dist/syncDbWithEas-V_9gIyHp.js.map +1 -0
- package/dist/{tolerantWebAccess-CNfvmR3m.js → tolerantWebAccess-D6hFxREe.js} +7 -8
- package/dist/{tolerantWebAccess-CNfvmR3m.js.map → tolerantWebAccess-D6hFxREe.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-D-3SLW-D.js → updateSeedRevokedAt-CsAoUEEt.js} +4 -4
- package/dist/{updateSeedRevokedAt-D-3SLW-D.js.map → updateSeedRevokedAt-CsAoUEEt.js.map} +1 -1
- package/package.json +7 -7
- package/dist/BaseFileManager-DLou1TZS.js.map +0 -1
- package/dist/Item-Ld1iPicQ.js.map +0 -1
- package/dist/ModelProperty-C8gTx4pO.js.map +0 -1
- package/dist/arweaveContentTags-Bh4wCTal.js +0 -51
- package/dist/arweaveContentTags-Bh4wCTal.js.map +0 -1
- package/dist/detachRowsBeforeDelete-BZr_0iZU.js.map +0 -1
- package/dist/dist/BaseFileManager-DLou1TZS.d.ts.map +0 -1
- package/dist/dist/configurePlatform-WkmvqeTO.d.ts.map +0 -1
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +0 -9
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +0 -1
- package/dist/errors-DKxFSvb3.js.map +0 -1
- package/dist/getPublishPayload-CLrAcZwr.js.map +0 -1
- package/dist/getPublishUploads-DFcgc27c.js +0 -784
- package/dist/getPublishUploads-DFcgc27c.js.map +0 -1
- package/dist/index-9udoYObJ.js.map +0 -1
- package/dist/index-BjWk0x4-.js.map +0 -1
- package/dist/index-Cdm7Q7el.js.map +0 -1
- package/dist/index-CghAYA-z.js.map +0 -1
- package/dist/index.browser-D9oC-KKx.js.map +0 -1
- package/dist/index.node-DV1OXCp0.js.map +0 -1
- package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +0 -1
- package/dist/property-Broz_CWj.js.map +0 -1
- package/dist/publishGraph-DnWoWZRP.js +0 -311
- package/dist/publishGraph-DnWoWZRP.js.map +0 -1
- package/dist/seedSchema/PropertyUidSchema.ts +0 -16
- package/dist/src/seedSchema/PropertyUidSchema.d.ts +0 -64
- package/dist/src/seedSchema/PropertyUidSchema.d.ts.map +0 -1
- package/dist/syncDbWithEas-Dj_8VqM7.js.map +0 -1
- package/dist/tabEvents-BnBzIdEi.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPublishPayload-CLrAcZwr.js","sources":["../../src/db/read/getPropertyClear.ts","../../src/helpers/easSdk.ts","../../src/helpers/ethereumUtils.ts","../../src/db/read/publishErrors.ts","../../src/db/read/getPublishPayload.ts"],"sourcesContent":["import { and, eq, or, sql } from 'drizzle-orm'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { metadata, type MetadataType } from '@/seedSchema'\nimport { matchMetadataProperty, metadataRowsOfProperty } from '@/db/read/metadataProperty'\nimport { METADATA_LATEST_FIRST_ORDER_SQL } from '@/helpers/compareMetadataRowsLatestFirst'\nimport { isPublishedMetadataRow } from '@/helpers/isPublishedMetadataRow'\nimport { isValidEasAttestationUid } from '@seedprotocol/eas'\n\n/** An empty current value that publishing changes: it has live attestations to remove or retract. */\nexport type PropertyClear = {\n /** The newest row is an unpublished retraction: publish revokes `retractScope` instead of attesting. */\n retract: boolean\n /** The property's attestations on the seed that are still live, newest first. */\n live: MetadataType[]\n /**\n * What a retraction revokes: the live attestations on the Version of the newest one, and those on\n * other Versions whose value is one of theirs. That Version is the seed's current one unless the\n * property was attested only before it, or a `new_version` publish has just made a newer one.\n */\n retractScope: MetadataType[]\n}\n\nconst isEmptyValue = (value: string | null | undefined): boolean => value == null || value === ''\n\n/**\n * What publishing a property with an empty value does (ADR 0021). Undefined when there is nothing\n * to publish: the newest row holds a value, or the property has no live attestation (never\n * published, or already retracted). The property's rows are those linked by property_id, and rows\n * with none stored under one of its names.\n */\nexport async function getPropertyClear(params: {\n seedLocalId?: string | null\n seedUid?: string | null\n propertyName: string\n /** metadata.property_id when the caller has it; otherwise resolved from the name. */\n propertyId?: number | null\n modelName?: string | null\n dataType?: string\n refValueType?: string\n}): Promise<PropertyClear | undefined> {\n const { seedLocalId, seedUid, propertyName, propertyId, modelName, dataType, refValueType } = params\n if (!seedLocalId && !seedUid) return undefined\n const appDb = BaseDb.getAppDb()\n if (!appDb) return undefined\n\n // The property's rows by property_id (decision D4), rows with none by name\n const property = await matchMetadataProperty(\n { propertyId, propertyName, modelName, seedLocalId, seedUid, dataType, refValueType },\n appDb,\n )\n const seedWhere =\n seedLocalId && seedUid\n ? or(eq(metadata.seedLocalId, seedLocalId), eq(metadata.seedUid, seedUid))\n : seedLocalId\n ? eq(metadata.seedLocalId, seedLocalId)\n : eq(metadata.seedUid, seedUid!)\n const rows = (await appDb\n .select()\n .from(metadata)\n .where(and(metadataRowsOfProperty(property), seedWhere))\n .orderBy(sql.raw(METADATA_LATEST_FIRST_ORDER_SQL))) as MetadataType[]\n\n const newest = rows[0]\n if (!newest || !isEmptyValue(newest.propertyValue)) return undefined\n const live = rows.filter((row) => isValidEasAttestationUid(row.uid) && row.revokedAt == null)\n if (live.length === 0) return undefined\n\n // `live` is newest first\n const onVersion = live.filter((row) => row.versionUid === live[0]!.versionUid)\n const values = new Set(onVersion.map((row) => row.propertyValue))\n const retractScope = live.filter((row) => onVersion.includes(row) || values.has(row.propertyValue))\n\n return { retract: !!newest.retract && !isPublishedMetadataRow(newest), live, retractScope }\n}\n\n/** The empty value of an EAS type, or undefined for `bool` and `uint256`, which have none (ADR 0021). */\nexport function emptyEasValue(easDataType: string | undefined): string | string[] | undefined {\n if (easDataType === 'string') return ''\n if (easDataType === 'bytes32') return `0x${'0'.repeat(64)}`\n if (easDataType === 'bytes32[]') return []\n return undefined\n}\n\n/** A retracted property and the attestations publish revokes for it. */\nexport type PendingRetraction = {\n propertyName: string\n attestations: { uid: string; schemaUid: string }[]\n}\n\n/**\n * The seed's retracted properties that still have attestations to revoke (ADR 0021), with the\n * attestations publish revokes for each.\n */\nexport async function getPendingRetractions(params: {\n seedLocalId?: string | null\n seedUid?: string | null\n}): Promise<PendingRetraction[]> {\n const { seedLocalId, seedUid } = params\n if (!seedLocalId && !seedUid) return []\n const { getPublishPendingDiff } = await import('@/db/read/getPublishPendingDiff')\n const { pendingProperties } = await getPublishPendingDiff({\n seedLocalId: seedLocalId ?? undefined,\n seedUid: seedUid ?? undefined,\n })\n const retractions: PendingRetraction[] = []\n for (const { propertyName, change } of pendingProperties) {\n if (change !== 'retracted') continue\n const clear = await getPropertyClear({ seedLocalId, seedUid, propertyName })\n if (!clear?.retract) continue\n const attestations = clear.retractScope\n .filter((row) => row.uid && row.schemaUid)\n .map((row) => ({ uid: row.uid!, schemaUid: row.schemaUid! }))\n if (attestations.length > 0) retractions.push({ propertyName, attestations })\n }\n return retractions\n}\n","import { isNode } from '@/helpers/environment'\n\ntype EasSdk = typeof import('@ethereum-attestation-service/eas-sdk')\n\nlet easSdkPromise: Promise<EasSdk> | undefined\n\n/**\n * Load eas-sdk on first use instead of at SDK import time.\n *\n * On Node this loads eas-sdk's CommonJS build. Its ESM build (2.9.1+) does\n * `import { isEqual } from 'lodash'`, which Node rejects because lodash is\n * CommonJS, so a static import made `import '@seedprotocol/sdk'` fail unless the\n * app ran with `--import @seedprotocol/sdk/node-eas-lodash`.\n *\n * `process.getBuiltinModule` (Node 20.16+, 22.3+) keeps `node:module` out of the\n * import graph, so browser bundlers never see it. Bundlers resolve the\n * `import()` branch, and handle lodash there themselves.\n */\nexport function loadEasSdk(): Promise<EasSdk> {\n if (!easSdkPromise) {\n easSdkPromise = (async () => {\n if (isNode() && typeof document === 'undefined' && typeof process.getBuiltinModule === 'function') {\n try {\n const { createRequire } = process.getBuiltinModule('node:module')\n return createRequire(import.meta.url)('@ethereum-attestation-service/eas-sdk') as EasSdk\n } catch {\n // e.g. import.meta.url is not a file: URL (bundled renderer). Fall through.\n }\n }\n return import('@ethereum-attestation-service/eas-sdk')\n })()\n easSdkPromise.catch(() => {\n easSdkPromise = undefined\n })\n }\n return easSdkPromise\n}\n","/** UTF-8 string to 0x-prefixed bytes32 hex (right-padded with zeros). */\nexport function encodeBytes32String(value: string): string {\n const bytes = new TextEncoder().encode(value)\n if (bytes.length > 32) {\n throw new Error(`encodeBytes32String: value exceeds 32 bytes (${bytes.length})`)\n }\n const hex = Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('')\n return `0x${hex.padEnd(64, '0')}`\n}\n","import type { ValidationError } from '@/Schema/validation'\n\n/** Validation error collected during publish payload building. */\nexport type PublishValidationError = Pick<ValidationError, 'field' | 'message'> & { code?: string }\n\n/** Error thrown when publish validation fails. Includes all validation errors for user to fix. */\nexport class PublishValidationFailedError extends Error {\n constructor(\n message: string,\n public readonly validationErrors: PublishValidationError[],\n ) {\n super(message)\n this.name = 'PublishValidationFailedError'\n }\n}\n\n/** Validation error code for a relation, list member or image/file ref to an unpublished seed. */\nexport const RELATED_ITEM_UNPUBLISHED_CODE = 'related_item_unpublished'\n\n/** A seed a publish would reference although its seed attestation was revoked (unpublished). */\nexport type UnpublishedRelatedItem = {\n /** The referring property on the item being published (or on an item published with it). */\n propertyName: string\n /** Model of the referenced item (e.g. `Author`, `Image`). */\n modelName: string\n seedLocalId: string\n /** The revoked seed uid the reference would attest. */\n seedUid: string\n}\n\nexport const describeUnpublishedRelatedItem = (r: UnpublishedRelatedItem): string =>\n `${r.propertyName} -> ${r.modelName} ${r.seedLocalId} (seed ${r.seedUid})`\n\n/**\n * Thrown before anything is uploaded or attested when the item references items whose seed was\n * unpublished: the parent would attest a revoked seed uid. Republish those items (which gives\n * them a new seed uid) or remove the references, then publish again.\n * See docs/ATTESTATION_REVOCATION.md (\"Republishing\").\n *\n * A PublishValidationFailedError, so validateItemForPublish and the publish package's checking\n * step report it as validation errors (code `related_item_unpublished`, one per reference).\n */\nexport class RelatedItemUnpublishedError extends PublishValidationFailedError {\n readonly unpublishedRelatedItems: UnpublishedRelatedItem[]\n\n constructor(\n unpublishedRelatedItems: UnpublishedRelatedItem[],\n otherValidationErrors: PublishValidationError[] = [],\n ) {\n const lines = unpublishedRelatedItems.map(describeUnpublishedRelatedItem)\n const message =\n `Cannot publish: it references ${lines.length} unpublished item${lines.length === 1 ? '' : 's'} ` +\n `(their seed attestations were revoked). Republish them or remove the references, then publish again:\\n` +\n lines.join('\\n')\n super(message, [\n ...unpublishedRelatedItems.map((r) => ({\n field: r.propertyName,\n message:\n `${r.propertyName} references unpublished ${r.modelName} ${r.seedLocalId} (seed ${r.seedUid}). ` +\n `Republish it or remove the reference.`,\n code: RELATED_ITEM_UNPUBLISHED_CODE,\n })),\n ...otherValidationErrors,\n ])\n this.name = 'RelatedItemUnpublishedError'\n this.unpublishedRelatedItems = unpublishedRelatedItems\n }\n}\n","import {\n decodeEasNumber,\n easName,\n getEasSchemaUidForSchemaDefinition,\n getSchemaUidForSchemaDefinitionFromCache,\n} from '@seedprotocol/eas'\nimport {\n defaultAttestationData,\n INTERNAL_DATA_TYPES,\n INTERNAL_PROPERTY_NAMES,\n VERSION_SCHEMA_UID,\n ZERO_BYTES32,\n} from '@/helpers/constants'\nimport type {\n AttestationRequest,\n AttestationRequestData,\n} from '@ethereum-attestation-service/eas-sdk'\nimport { loadEasSdk } from '@/helpers/easSdk'\nimport { getEasSchemaUidForModel } from './getSchemaUidForModel'\nimport { emptyEasValue, getPropertyClear } from '@/db/read/getPropertyClear'\nimport { isStorageSeedRef } from '@/helpers/relationSeedRef'\nimport {\n easPropertyNameForPublish,\n listRelationEasPropertyName,\n metadataStorageName,\n} from '@/helpers/metadataPropertyNames'\nimport { encodeBytes32String } from '@/helpers/ethereumUtils'\nimport { ModelPropertyDataTypes, normalizeDataType } from '@/Schema'\nimport {\n PublishValidationFailedError,\n RelatedItemUnpublishedError,\n type PublishValidationError,\n} from '@/db/read/publishErrors'\nimport {\n getPublishGraph,\n htmlPropertyForHtmlSeed,\n type PublishGraph,\n type PublishGraphNode,\n type PublishGraphProperty,\n type PublishMode,\n} from '@/db/read/publishGraph'\n\nexport { PublishValidationFailedError, type PublishValidationError }\nexport type { PublishMode }\n\nexport type GetPublishPayloadOptions = {\n /** `patch` (default): new property attestations on the current Version. `new_version`: new Version attestation + attest all properties. */\n publishMode?: PublishMode\n}\n\ntype Attestation = Omit<AttestationRequest, 'data'> & {\n data: AttestationRequestData[]\n /** The property's schema key. */\n _propertyName?: string\n /** Metadata row the attested value was read from: recording gives the uid to exactly that row. */\n _metadataLocalId?: string\n /** A value that is not in that row yet (the storage transaction id of this publish's upload), for recording to store. */\n _attestedValue?: string\n /** Same as encode step (getPropertyData); resolvePublishPayloadValues must use this, not easName(propertyName). */\n _propertyNameForSchema?: string\n _schemaDef?: string\n _unresolvedValue?: string\n _easDataType?: string\n /** Per-slot raw ids (local or 0x) before encodeBytes32String; re-encoded after sequential publish. */\n _rawListIdsForResolve?: string[]\n}\n\ntype PublishPayload = {\n localId: string\n /** The version row this request's Version attestation is recorded on (none when it attests under an existing version). */\n versionLocalId?: string\n seedIsRevocable: boolean\n seedSchemaUid: string\n seedUid: string\n versionSchemaUid: string\n versionUid: string\n listOfAttestations: Attestation[]\n propertiesToUpdate: { publishLocalId: string; propertySchemaUid: string }[]\n}\n\ntype MultiPublishPayload = PublishPayload[]\n\n/** Map of seed localId -> attestation uid for resolving relation/image property values after dependent seeds are published */\nexport type ResolvedSeedUids = Record<string, string>\n\ntype UploadedTransaction = {\n txId: string\n itemPropertyLocalId?: string\n seedLocalId?: string\n versionLocalId?: string\n itemPropertyName?: string\n}\n\ntype BuildContext = {\n graph: PublishGraph\n errors: PublishValidationError[]\n uploadedTransactions: UploadedTransaction[]\n}\n\nconst matchesDataType = (\n actual: string | undefined,\n expected: ModelPropertyDataTypes | string,\n): boolean => normalizeDataType(actual) === expected\n\n/**\n * An EAS uid (0x + 64 hex), as opposed to a local id. A \"0x\" prefix alone doesn't tell them apart:\n * local ids are random alphanumerics, and about 1 in 3,844 starts with \"0x\".\n */\nfunction isUidRef(ref: string): boolean {\n return ref.length === 66 && ref.startsWith('0x')\n}\n\nfunction addValidationError(ctx: BuildContext, message: string, field?: string, code = 'publish_validation'): void {\n if (ctx.errors.some((e) => e.message === message && e.field === (field ?? ''))) return\n ctx.errors.push({ field: field ?? '', message, code })\n}\n\n/** Current uid for a ref to a live published seed, else the ref itself. */\nconst currentRelatedRef = (ctx: BuildContext, ref: string): string => ctx.graph.relatedRefUids.get(ref.trim()) ?? ref\n\nconst uploadedTxFor = (ctx: BuildContext, seedLocalId: string): UploadedTransaction | undefined =>\n ctx.uploadedTransactions.find((u) => u.seedLocalId?.trim() === seedLocalId)\n\ntype PropertyDataResult = {\n schemaUid: string\n easDataType: string\n schemaDef: string\n propertyNameForSchema: string\n}\n\n/** The EAS schema a property attests under. Reports an error and returns null when there is none. */\nconst getPropertyData = async (\n property: PublishGraphProperty,\n ctx: BuildContext,\n): Promise<PropertyDataResult | null> => {\n const { key, definition } = property\n const rawDataType = definition.dataType\n const dataType = rawDataType ? normalizeDataType(String(rawDataType)) : undefined\n const easDataType = dataType ? INTERNAL_DATA_TYPES[dataType as keyof typeof INTERNAL_DATA_TYPES]?.eas : undefined\n if (!easDataType) {\n addValidationError(\n ctx,\n `Unknown or unsupported property data type \"${rawDataType ?? 'undefined'}\" for property: ${key}. Supported types: ${Object.keys(INTERNAL_DATA_TYPES).join(', ')}.`,\n key,\n )\n return null\n }\n\n // ADR 0008: list relations publish under their storage name (authors → author_identity_ids),\n // single relations under their schema key (author), never the local authorId.\n const listRelationName = listRelationEasPropertyName(key, definition)\n const propertyNameForSchema = easPropertyNameForPublish(key, definition)\n const schemaDef = `${easDataType} ${propertyNameForSchema}`\n\n // The UID ensureEasSchemasForItem resolved for this exact definition comes first. A row's\n // schemaUid was looked up under the property's own name, which matches any type: Optimism\n // Sepolia has `bytes32 storage_transaction_id` beside `string storage_transaction_id`, and\n // attesting a string under the bytes32 one reads back as 0x…20. Trust the row's only when\n // that name is the one published (not for a list relation, or a single relation stored as authorId).\n const storageName = metadataStorageName(key, definition)\n let schemaUid: string | undefined =\n getSchemaUidForSchemaDefinitionFromCache(schemaDef) ??\n (!listRelationName && easName(storageName) === propertyNameForSchema ? property.row?.schemaUid ?? undefined : undefined)\n if (!schemaUid) {\n schemaUid = await getEasSchemaUidForSchemaDefinition({ schemaText: schemaDef })\n }\n if (!schemaUid) {\n addValidationError(\n ctx,\n `EAS schema not found for \"${schemaDef}\" (property: ${key}). Register it before publishing (ensureEasSchemasForItem).`,\n key,\n 'publish_schema_not_found',\n )\n return null\n }\n return { schemaUid, easDataType, schemaDef, propertyNameForSchema }\n}\n\n/** The label a required-value error uses for a relation or storage-seed property. */\nfunction refTypeLabel(definition: PublishGraphProperty['definition']): string {\n for (const [type, label] of [\n [ModelPropertyDataTypes.File, 'file'],\n [ModelPropertyDataTypes.Image, 'image'],\n [ModelPropertyDataTypes.Html, 'html'],\n [ModelPropertyDataTypes.Json, 'json'],\n ] as const) {\n if (matchesDataType(definition.dataType, type) || matchesDataType(definition.refValueType, type)) return label\n }\n return 'relation'\n}\n\n/** Required relation and storage-seed properties need a value pointing at an item. */\nfunction checkRequiredRef(node: PublishGraphNode, property: PublishGraphProperty, ctx: BuildContext): void {\n const { key, definition } = property\n if (definition.required !== true) return\n const value = property.row?.propertyValue\n const refLabel = definition.ref ?? definition.refModelName ?? 'related'\n if (value == null || value.trim() === '') {\n addValidationError(\n ctx,\n `Required ${refTypeLabel(definition)} ${key} has no value. A value pointing to a valid ${refLabel} item is required to publish.`,\n key,\n )\n return\n }\n for (const broken of ctx.graph.brokenRefs) {\n if (broken.seedLocalId !== node.seedLocalId || broken.propertyKey !== key || broken.list) continue\n addValidationError(\n ctx,\n broken.reason === 'invalid'\n ? `Required relation ${key} has invalid value: ${JSON.stringify(value)}. ` +\n `Value must be a valid seed reference (localId or uid) pointing to a ${refLabel} item.`\n : `No related item found for required relation: ${key}. Value: ${JSON.stringify(value)} (seedLocalId/seedUid). ` +\n `The related item may be missing, in a different database, or the reference may be broken.`,\n key,\n )\n }\n}\n\n/** A Boolean row value as stored (\"true\"/\"false\", \"1\"/\"0\"). */\nconst booleanFromRow = (value: string): boolean | string =>\n value === 'true' || value === '1' ? true : value === 'false' || value === '0' ? false : value\n\n/**\n * The attestation of one property of `node`, or undefined when the publish leaves it out (no\n * value, already attested in patch mode, deferred, invalid: the last reports an error).\n */\nasync function attestProperty(\n node: PublishGraphNode,\n property: PublishGraphProperty,\n versionUid: string,\n ctx: BuildContext,\n): Promise<Attestation | undefined> {\n const { key, definition, row } = property\n const forceFullSnapshot = ctx.graph.forceFullSnapshot\n if (INTERNAL_PROPERTY_NAMES.includes(key) || property.deferred) return undefined\n\n const isFileImageHtml =\n matchesDataType(definition.dataType, ModelPropertyDataTypes.File) ||\n matchesDataType(definition.dataType, ModelPropertyDataTypes.Image) ||\n matchesDataType(definition.dataType, ModelPropertyDataTypes.Html)\n const isRef = property.kind === 'relation' || property.kind === 'storageSeed'\n const isStorageTransaction = property.kind === 'storageTransaction'\n\n // The storage transaction slot attests this publish's upload of the node's file(s).\n const uploaded = isStorageTransaction ? uploadedTxFor(ctx, node.seedLocalId) : undefined\n if (isStorageTransaction && !uploaded) return undefined\n let value: unknown = uploaded ? uploaded.txId : row?.propertyValue\n\n // 0 and false are values (ADR 0010). An empty value publishes only as a removal of a value\n // attested before (ADR 0021); a retraction attests nothing (publish revokes instead).\n let isRemoval = false\n if (value == null || value === '') {\n if (property.uid && !forceFullSnapshot) return undefined\n const clear = await getPropertyClear({\n seedLocalId: node.seedLocalId,\n seedUid: node.seedUid,\n propertyId: definition._dbId,\n modelName: node.modelName,\n propertyName: key,\n dataType: definition.dataType,\n refValueType: definition.refValueType,\n })\n if (!clear || clear.retract) return undefined\n isRemoval = true\n }\n // Patch mode skips properties that already have an EAS uid, except a storage transaction this\n // publish uploaded.\n if (!isRemoval && property.uid && !forceFullSnapshot && !uploaded) return undefined\n\n // File/Image/Html values must be a storage seed id by now. Raw content means the property's\n // save pipeline never ran or failed (e.g. createNewItem with raw html), so it was never uploaded.\n if (!isRemoval && isFileImageHtml && typeof value === 'string' && !isStorageSeedRef(value.trim())) {\n addValidationError(\n ctx,\n `Invalid value for property: ${key}. Expected a storage seed id ` +\n `(${normalizeDataType(definition.dataType)} content must be saved through the property before publishing), ` +\n `got ${value.length > 40 ? `${value.slice(0, 40)}…` : value}.`,\n key,\n 'publish_storage_value_not_saved',\n )\n return undefined\n }\n\n const propertyData = await getPropertyData(property, ctx)\n if (!propertyData) return undefined\n const { schemaUid, easDataType, schemaDef, propertyNameForSchema } = propertyData\n const isList = schemaDef.startsWith('bytes32[]')\n\n let rawListIdsForResolve: string[] | undefined\n if (isRemoval) {\n const empty = emptyEasValue(easDataType)\n if (empty === undefined) {\n addValidationError(\n ctx,\n `${key} can't be published empty: ${definition.dataType ?? easDataType} properties have no empty value. Clear it with clear({ retract: true }).`,\n key,\n 'publish_clear_unsupported',\n )\n return undefined\n }\n value = empty\n } else {\n if (typeof value === 'string' && isRef) value = currentRelatedRef(ctx, value.trim())\n if (isList && typeof value === 'string') {\n const text = value.trim()\n if (text.startsWith('[')) {\n try {\n value = JSON.parse(text)\n } catch {\n // reported below\n }\n } else if (text.includes(',')) {\n // Legacy comma-separated ids (pre-JSON List storage)\n value = text.split(',').map((s) => s.trim()).filter(Boolean)\n }\n }\n if (isList && !Array.isArray(value)) {\n addValidationError(ctx, `Invalid value for property: ${key}. Expected an array of bytes32, got ${value}.`, key)\n return undefined\n }\n if (easDataType === 'bool' && typeof value === 'string') value = booleanFromRow(value.trim())\n\n // Validate against property validation rules (enum, pattern, minLength, maxLength) before encoding\n if (definition.validation) {\n const { SchemaValidationService } = await import('@/Schema/service/validation/SchemaValidationService')\n const result = new SchemaValidationService().validatePropertyValue(\n value,\n normalizeDataType(definition.dataType) as ModelPropertyDataTypes,\n definition.validation,\n definition.refValueType ? (normalizeDataType(definition.refValueType) as string) : undefined,\n )\n if (!result.isValid && result.errors.length > 0) {\n const firstError = result.errors[0]!\n addValidationError(ctx, firstError.message, key, firstError.code ?? 'publish_validation')\n return undefined\n }\n }\n\n if (isList) {\n const encoded: string[] = []\n const rawIds: string[] = []\n for (const member of value as unknown[]) {\n const id = typeof member === 'string' ? member.trim() : ''\n if (!id) continue\n const ref = currentRelatedRef(ctx, id)\n rawIds.push(ref)\n encoded.push(isUidRef(ref) ? ref : encodeBytes32String(ref))\n }\n value = encoded\n if (rawIds.some((id) => !isUidRef(id))) rawListIdsForResolve = rawIds\n }\n\n // uint256 (Date) must be numeric/BigInt; normalize ISO strings to Unix seconds\n if (easDataType === 'uint256' && (typeof value === 'string' || value instanceof Date)) {\n const ms = value instanceof Date ? value.getTime() : /^\\d+$/.test(value) ? Number(value) : new Date(value).getTime()\n value = BigInt(Math.floor(ms / 1000))\n }\n\n // ADR 0010: Number attests as its decimal string, in the form readers decode it to.\n if (matchesDataType(definition.dataType, ModelPropertyDataTypes.Number)) {\n const decimal = decodeEasNumber(value)\n if (decimal === undefined) {\n addValidationError(\n ctx,\n `Invalid value for property: ${key}. Expected a finite number, got ${JSON.stringify(value)}.`,\n key,\n 'publish_invalid_number',\n )\n return undefined\n }\n value = decimal\n }\n }\n\n let encodedData: string\n try {\n const { SchemaEncoder } = await loadEasSdk()\n encodedData = new SchemaEncoder(schemaDef).encodeData([\n { name: propertyNameForSchema, type: easDataType, value: value as any },\n ]) as string\n } catch (encodeErr) {\n addValidationError(\n ctx,\n `Failed to encode property ${key}: ${encodeErr instanceof Error ? encodeErr.message : String(encodeErr)}`,\n key,\n )\n return undefined\n }\n\n const attestation: Attestation = {\n schema: schemaUid,\n data: [\n {\n ...defaultAttestationData,\n // The storage transaction references the Version attestation (contract may use when supported)\n refUID: isStorageTransaction ? versionUid : defaultAttestationData.refUID,\n data: encodedData,\n } as AttestationRequestData,\n ],\n _propertyName: key,\n ...(row?.localId ? { _metadataLocalId: row.localId } : {}),\n ...(uploaded && uploaded.txId !== row?.propertyValue ? { _attestedValue: uploaded.txId } : {}),\n }\n\n // Refs to seeds of this publish by local id: resolution hints for resolvePublishPayloadValues\n if (\n typeof value === 'string' &&\n !isUidRef(value) &&\n /^[a-zA-Z0-9_-]{10,21}$/.test(value.trim()) &&\n (easDataType === 'bytes32' || easDataType === 'string')\n ) {\n attestation._propertyNameForSchema = propertyNameForSchema\n attestation._schemaDef = schemaDef\n attestation._unresolvedValue = value.trim()\n attestation._easDataType = easDataType\n }\n if (rawListIdsForResolve?.length) {\n attestation._propertyNameForSchema = propertyNameForSchema\n attestation._schemaDef = schemaDef\n attestation._easDataType = 'bytes32[]'\n attestation._rawListIdsForResolve = rawListIdsForResolve\n }\n return attestation\n}\n\n/** The order a node's properties attest in: basic values, its upload, refs, lists. */\nconst ATTEST_ORDER: PublishGraphProperty['kind'][] = ['basic', 'storageTransaction', 'relation', 'storageSeed', 'list']\n\n/** One node's request: its seed, version and property attestations, and the parent properties its seed uid fills. */\nasync function buildRequest(node: PublishGraphNode, ctx: BuildContext): Promise<PublishPayload> {\n const { graph } = ctx\n const isRoot = node.kind === 'root'\n // A storage seed or an embedded image attests its own basic properties only.\n const full = isRoot || node.kind === 'draft'\n const reportField = node.links[0]?.propertyKey\n\n let seedSchemaUid = isRoot ? node.seedSchemaUid : undefined\n seedSchemaUid ??= (await getEasSchemaUidForModel(node.modelName)) ?? undefined\n if (!seedSchemaUid) addValidationError(ctx, `Schema UID not found for model: ${node.modelName}`, isRoot ? undefined : reportField)\n\n let versionUid = node.version.uid ?? (node.newSeed ? undefined : node.version.publishedUid) ?? ZERO_BYTES32\n if (isRoot && graph.forceFullSnapshot && node.seedUid) versionUid = ZERO_BYTES32\n const versionLocalId = versionUid === ZERO_BYTES32 && !node.version.uid ? node.version.localId : undefined\n\n const request: PublishPayload = {\n localId: node.seedLocalId,\n ...(versionLocalId ? { versionLocalId } : {}),\n seedIsRevocable: true,\n seedSchemaUid: seedSchemaUid ?? ZERO_BYTES32,\n seedUid: node.newSeed || !node.seedUid ? ZERO_BYTES32 : node.seedUid,\n versionSchemaUid: VERSION_SCHEMA_UID,\n versionUid,\n listOfAttestations: [],\n propertiesToUpdate: [],\n }\n\n for (const kind of ATTEST_ORDER) {\n for (const property of node.properties) {\n if (property.kind !== kind) continue\n if (!full && kind !== 'basic' && kind !== 'storageTransaction') continue\n if (full && (kind === 'relation' || kind === 'storageSeed')) checkRequiredRef(node, property, ctx)\n const attestation = await attestProperty(node, property, versionUid, ctx)\n if (attestation) request.listOfAttestations.push(attestation)\n }\n }\n\n // Each property this seed's uid fills: the contract writes the uid into that attestation.\n for (const { seedLocalId, propertyKey } of node.links) {\n const owner = graph.nodes.find((n) => n.seedLocalId === seedLocalId)\n const property = owner?.properties.find((p) => p.key === propertyKey)\n if (!property) continue\n const propertySchemaUid = (await getPropertyData(property, ctx))?.schemaUid\n if (!propertySchemaUid) continue\n if (!request.propertiesToUpdate.some((u) => u.publishLocalId === seedLocalId && u.propertySchemaUid.toLowerCase() === propertySchemaUid.toLowerCase())) {\n request.propertiesToUpdate.push({ publishLocalId: seedLocalId, propertySchemaUid })\n }\n }\n return request\n}\n\n/**\n * Embedded image rows must still name an Html value of their owner, with a schema to attest under.\n * No propertiesToUpdate: the Html refers to the image by its Arweave URL (the data URI is\n * rewritten to it before the Html is uploaded), not by seed uid.\n */\nasync function checkEmbeddedImages(ctx: BuildContext): Promise<void> {\n const { graph } = ctx\n for (const owner of graph.nodes) {\n for (const row of owner.embeddedImages) {\n const imageNode = graph.nodes.find((n) => n.seedLocalId === row.imageSeedLocalId && n.kind === 'embeddedImage')\n const missing = graph.missingEmbeddedImages.some((m) => m.imageSeedLocalId === row.imageSeedLocalId)\n if (!imageNode && !missing) continue\n const html = htmlPropertyForHtmlSeed(owner, row.htmlSeedLocalId)\n if (!html) {\n addValidationError(ctx, `Could not find Html property for embedded image rewrite (html seed ${row.htmlSeedLocalId.trim()}).`, 'html', 'html_embed_schema')\n continue\n }\n if (!(await getPropertyData(html, ctx))) continue\n if (missing) {\n addValidationError(ctx, `Embedded Image item not found for seed ${row.imageSeedLocalId}.`, 'html', 'html_embed_image_missing')\n }\n }\n }\n}\n\nexport const getPublishPayload = async (\n item: { seedLocalId: string; modelName?: string },\n uploadedTransactions: UploadedTransaction[],\n options?: GetPublishPayloadOptions,\n): Promise<MultiPublishPayload> => {\n const publishMode: PublishMode = options?.publishMode ?? 'patch'\n const graph = await getPublishGraph(item, { publishMode })\n const ctx: BuildContext = { graph, errors: [], uploadedTransactions }\n\n if (publishMode === 'new_version' && !graph.root.seedUid) {\n addValidationError(\n ctx,\n 'Publishing as a new version requires the item to already have a published Seed attestation (seed UID).',\n 'seedUid',\n 'publish_new_version_requires_seed',\n )\n }\n\n let multiPublishPayload: MultiPublishPayload = []\n for (const node of graph.nodes) multiPublishPayload.push(await buildRequest(node, ctx))\n await checkEmbeddedImages(ctx)\n\n // A request whose seed fills another request's property (propertiesToUpdate) publishes first, and a\n // request encoding another's local id publishes after it.\n multiPublishPayload = orderPayloadByDependencies(multiPublishPayload)\n\n if (publishMode === 'new_version') {\n const rootPayload = multiPublishPayload.find((p) => p.localId === graph.root.seedLocalId)\n if (!rootPayload?.listOfAttestations.length) {\n addValidationError(\n ctx,\n 'Publishing as a new version requires at least one property attestation for the item. ' +\n 'Ensure required fields have values and that publishable properties are present.',\n 'listOfAttestations',\n 'publish_new_version_empty_snapshot',\n )\n }\n }\n\n // Stop before anything is uploaded or attested: the payload would attest revoked seed uids.\n if (graph.unpublishedRelatedItems.length) {\n throw new RelatedItemUnpublishedError(graph.unpublishedRelatedItems, ctx.errors)\n }\n\n if (ctx.errors.length > 0) {\n const combinedMessage = ctx.errors.map((e) => e.message).join('\\n')\n throw new PublishValidationFailedError(\n `Validation failed (${ctx.errors.length} error${ctx.errors.length === 1 ? '' : 's'}):\\n${combinedMessage}`,\n ctx.errors,\n )\n }\n\n return multiPublishPayload\n}\n\nexport type ValidateItemForPublishResult = {\n isValid: boolean\n errors: PublishValidationError[]\n}\n\n/**\n * Validates an item for publishing without performing Arweave or EAS work.\n * Use in the checking step to fail fast before creating transactions.\n * Pass empty array for uploadedTransactions when validating before Arweave upload.\n */\nexport const validateItemForPublish = async (\n item: { seedLocalId: string; modelName?: string },\n uploadedTransactions: UploadedTransaction[] = [],\n options?: GetPublishPayloadOptions,\n): Promise<ValidateItemForPublishResult> => {\n try {\n await getPublishPayload(item, uploadedTransactions, options)\n return { isValid: true, errors: [] }\n } catch (err) {\n if (err instanceof PublishValidationFailedError) {\n return { isValid: false, errors: err.validationErrors }\n }\n throw err\n }\n}\n\n/**\n * LocalIds in this batch referenced by attestations (bytes32 / bytes32[]) that must publish before this request.\n */\nfunction collectAttestationLocalRefIds(req: PublishPayload, allLocalIds: Set<string>): string[] {\n const refs: string[] = []\n for (const att of req.listOfAttestations) {\n if (att._unresolvedValue && allLocalIds.has(att._unresolvedValue)) refs.push(att._unresolvedValue)\n for (const id of att._rawListIdsForResolve ?? []) {\n const t = id != null ? String(id).trim() : ''\n if (t && allLocalIds.has(t)) refs.push(t)\n }\n }\n return refs\n}\n\n/**\n * Topological sort (Kahn): edge `from → to` means `from` must publish before `to`.\n * - propertiesToUpdate: updater before updatee (contract injection).\n * - _unresolvedValue / _rawListIdsForResolve: referenced seed before request that encodes the ref.\n * Ties keep the input order (the graph's finish order).\n */\nfunction orderPayloadByDependencies(payload: MultiPublishPayload): MultiPublishPayload {\n if (payload.length <= 1) return payload\n\n const byLocalId = new Map<string, PublishPayload>()\n const indexOrder = new Map<string, number>()\n payload.forEach((p, i) => {\n byLocalId.set(p.localId, p)\n indexOrder.set(p.localId, i)\n })\n const allIds = new Set(byLocalId.keys())\n const indegree = new Map<string, number>([...allIds].map((id) => [id, 0]))\n const adj = new Map<string, Set<string>>()\n\n const addEdge = (from: string, to: string) => {\n if (from === to || !allIds.has(from) || !allIds.has(to)) return\n if (!adj.has(from)) adj.set(from, new Set())\n const set = adj.get(from)!\n if (set.has(to)) return\n set.add(to)\n indegree.set(to, (indegree.get(to) ?? 0) + 1)\n }\n\n for (const p of payload) {\n for (const u of p.propertiesToUpdate) addEdge(p.localId, u.publishLocalId)\n for (const refId of collectAttestationLocalRefIds(p, allIds)) addEdge(refId, p.localId)\n }\n\n const byInputOrder = (a: string, b: string) => (indexOrder.get(a) ?? 0) - (indexOrder.get(b) ?? 0)\n const queue = [...allIds].filter((id) => (indegree.get(id) ?? 0) === 0).sort(byInputOrder)\n const result: PublishPayload[] = []\n while (queue.length > 0) {\n const id = queue.shift()!\n result.push(byLocalId.get(id)!)\n for (const to of adj.get(id) ?? []) {\n const next = (indegree.get(to) ?? 0) - 1\n indegree.set(to, next)\n if (next === 0) {\n queue.push(to)\n queue.sort(byInputOrder)\n }\n }\n }\n\n if (result.length !== payload.length) {\n const seen = new Set(result.map((r) => r.localId))\n for (const p of payload) if (!seen.has(p.localId)) result.push(p)\n }\n return result\n}\n\n/** Normalize attestation UID to 32-byte hex for SchemaEncoder bytes32 fields. */\nfunction padUidForBytes32Schema(uid: string): string {\n const t = uid.trim()\n if (!t.startsWith('0x')) return uid\n const hex = t.slice(2).replace(/[^0-9a-fA-F]/g, '')\n if (hex.length === 0) return uid\n return ('0x' + hex.padStart(64, '0').slice(-64)).toLowerCase()\n}\n\n/**\n * Resolves relation/image property values (seedLocalId) to attestation uids after dependent seeds are published.\n * Call after each payload is published, passing the returned attestation uid for that seed's localId.\n * Returns an updated multiPayload with re-encoded attestations where resolution was applied.\n */\nexport const resolvePublishPayloadValues = async (\n multiPayload: MultiPublishPayload,\n resolvedUids: ResolvedSeedUids,\n): Promise<MultiPublishPayload> => {\n if (Object.keys(resolvedUids).length === 0) {\n return multiPayload\n }\n\n const { SchemaEncoder } = await loadEasSdk()\n const result: MultiPublishPayload = []\n\n for (const payload of multiPayload) {\n const updatedAttestations: PublishPayload['listOfAttestations'] = []\n\n for (const attestation of payload.listOfAttestations) {\n const entry = attestation as Attestation & { data?: AttestationRequestData[] | AttestationRequestData }\n\n const rawList = entry._rawListIdsForResolve\n if (\n rawList &&\n rawList.length > 0 &&\n entry._schemaDef &&\n (entry._propertyNameForSchema || entry._propertyName)\n ) {\n const fieldName =\n entry._propertyNameForSchema ?? easName(entry._propertyName as string)\n const resolvedValues: string[] = []\n let allSlotsResolved = true\n for (const id of rawList) {\n const trimmed = id.trim()\n if (isUidRef(trimmed)) {\n resolvedValues.push(padUidForBytes32Schema(trimmed))\n continue\n }\n const r = resolvedUids[trimmed]\n if (r) {\n resolvedValues.push(padUidForBytes32Schema(r))\n continue\n }\n allSlotsResolved = false\n break\n }\n // Do not encode or clear hints until every slot has a real uid — otherwise sequential\n // publish burns encodeBytes32String(localId) into data and drops _rawListIdsForResolve.\n if (!allSlotsResolved) {\n updatedAttestations.push({\n ...entry,\n data: Array.isArray(entry.data) ? entry.data : [entry.data as AttestationRequestData],\n })\n continue\n }\n const dataEncoder = new SchemaEncoder(entry._schemaDef)\n const encodedData = dataEncoder.encodeData([\n {\n name: fieldName,\n type: 'bytes32[]',\n value: resolvedValues,\n },\n ])\n const baseData = Array.isArray(entry.data) ? entry.data[0] : (entry.data as AttestationRequestData)\n updatedAttestations.push({\n ...entry,\n data: [\n {\n ...baseData,\n data: encodedData,\n } as AttestationRequestData,\n ],\n _rawListIdsForResolve: undefined,\n _easDataType: undefined,\n })\n continue\n }\n\n const resolvedUid = entry._unresolvedValue && resolvedUids[entry._unresolvedValue]\n const easType = (entry._easDataType as 'bytes32' | 'string') || 'bytes32'\n if (resolvedUid && entry._schemaDef && (entry._propertyNameForSchema || entry._propertyName)) {\n const fieldName =\n entry._propertyNameForSchema ?? easName(entry._propertyName as string)\n const valueForEncode =\n easType === 'bytes32' ? padUidForBytes32Schema(resolvedUid) : resolvedUid\n const dataEncoder = new SchemaEncoder(entry._schemaDef)\n const encodedData = dataEncoder.encodeData([\n {\n name: fieldName,\n type: easType,\n value: valueForEncode,\n },\n ])\n const baseData = Array.isArray(entry.data) ? entry.data[0] : (entry.data as AttestationRequestData)\n updatedAttestations.push({\n ...entry,\n data: [\n {\n ...baseData,\n data: encodedData,\n } as AttestationRequestData,\n ],\n _unresolvedValue: undefined,\n })\n } else {\n const normalizedEntry: PublishPayload['listOfAttestations'][0] = {\n ...entry,\n data: Array.isArray(entry.data) ? entry.data : [entry.data as AttestationRequestData],\n }\n updatedAttestations.push(normalizedEntry)\n }\n }\n\n result.push({\n ...payload,\n listOfAttestations: updatedAttestations,\n })\n }\n\n return result\n}\n"],"names":[],"mappings":";;;;;;;;;AAsBA,MAAM,YAAY,GAAG,CAAC,KAAgC,KAAc,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;AAEjG;;;;;AAKG;AACI,eAAe,gBAAgB,CAAC,MAStC,EAAA;AACC,IAAA,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM;AACpG,IAAA,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO;AAAE,QAAA,OAAO,SAAS;AAC9C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE;AAC/B,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,SAAS;;IAG5B,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAC1C,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,YAA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