@seedprotocol/sdk 0.4.17 → 0.4.19
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/{ArweaveClient-Zz6VwCkj.js → ArweaveClient-CAdWVQnJ.js} +3 -3
- package/dist/{ArweaveClient-Zz6VwCkj.js.map → ArweaveClient-CAdWVQnJ.js.map} +1 -1
- package/dist/{ArweaveClient-DPeCeRMF.js → ArweaveClient-V62RJhsZ.js} +3 -3
- package/dist/{ArweaveClient-DPeCeRMF.js.map → ArweaveClient-V62RJhsZ.js.map} +1 -1
- package/dist/{Db-Cvoi9q3N.js → Db-8N3-le9a.js} +4 -4
- package/dist/{Db-Cvoi9q3N.js.map → Db-8N3-le9a.js.map} +1 -1
- package/dist/{Db-DsFElL33.js → Db-DS2GBY6h.js} +133 -6
- package/dist/Db-DS2GBY6h.js.map +1 -0
- package/dist/{EasClient-B2N8bc3C.js → EasClient-D1eibg8b.js} +2 -2
- package/dist/{EasClient-B2N8bc3C.js.map → EasClient-D1eibg8b.js.map} +1 -1
- package/dist/{EasClient-D5Nn1WBF.js → EasClient-nOmY5meW.js} +2 -2
- package/dist/{EasClient-D5Nn1WBF.js.map → EasClient-nOmY5meW.js.map} +1 -1
- package/dist/{FileManager-Bk-JeMoA.js → FileManager-Cze8qmS1.js} +2 -2
- package/dist/{FileManager-Bk-JeMoA.js.map → FileManager-Cze8qmS1.js.map} +1 -1
- package/dist/{FileManager-Cqy_Lq46.js → FileManager-DSTAwkqw.js} +2 -2
- package/dist/{FileManager-Cqy_Lq46.js.map → FileManager-DSTAwkqw.js.map} +1 -1
- package/dist/{ModelProperty-CkQaEsBu.js → ModelProperty-ChevZoUy.js} +24 -24
- package/dist/{ModelProperty-CkQaEsBu.js.map → ModelProperty-ChevZoUy.js.map} +1 -1
- package/dist/{PathResolver-DF1QFI1d.js → PathResolver-3TuYA9yv.js} +2 -2
- package/dist/{PathResolver-DF1QFI1d.js.map → PathResolver-3TuYA9yv.js.map} +1 -1
- package/dist/{PathResolver-C3sdR5LL.js → PathResolver-C5gj9EU2.js} +2 -2
- package/dist/{PathResolver-C3sdR5LL.js.map → PathResolver-C5gj9EU2.js.map} +1 -1
- package/dist/{QueryClient-Ctgd0tDn.js → QueryClient-BGv6JOls.js} +2 -2
- package/dist/{QueryClient-Ctgd0tDn.js.map → QueryClient-BGv6JOls.js.map} +1 -1
- package/dist/{QueryClient-CnONLIkA.js → QueryClient-By2vdhIz.js} +2 -2
- package/dist/{QueryClient-CnONLIkA.js.map → QueryClient-By2vdhIz.js.map} +1 -1
- package/dist/{Schema-Bnim4hAF.js → Schema-BQ5W3aOW.js} +38 -38
- package/dist/{Schema-Bnim4hAF.js.map → Schema-BQ5W3aOW.js.map} +1 -1
- package/dist/{SchemaValidationService-DXxRk-9Q.js → SchemaValidationService-DQx83Cte.js} +2 -2
- package/dist/{SchemaValidationService-DXxRk-9Q.js.map → SchemaValidationService-DQx83Cte.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-dzwzz4dA.js → backfillMetadataPropertyIds-CMsU83q9.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-dzwzz4dA.js.map → backfillMetadataPropertyIds-CMsU83q9.js.map} +1 -1
- package/dist/cjs/{ModelProperty-C80601ai.js → ModelProperty-Cuj839nX.js} +17 -17
- package/dist/cjs/{ModelProperty-C80601ai.js.map → ModelProperty-Cuj839nX.js.map} +1 -1
- package/dist/cjs/{Schema-6BQKp7hO.js → Schema-TFe24NNG.js} +20 -20
- package/dist/cjs/{Schema-6BQKp7hO.js.map → Schema-TFe24NNG.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-BySF1P0v.js → SchemaValidationService-DVQrRpse.js} +2 -2
- package/dist/cjs/{SchemaValidationService-BySF1P0v.js.map → SchemaValidationService-DVQrRpse.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-D9uzW5bW.js → backfillMetadataPropertyIds-BiXK4hT1.js} +2 -2
- package/dist/cjs/{backfillMetadataPropertyIds-D9uzW5bW.js.map → backfillMetadataPropertyIds-BiXK4hT1.js.map} +1 -1
- package/dist/cjs/{getItem-Dj49AjWB.js → getItem-FgLv9abh.js} +2 -2
- package/dist/cjs/{getItem-Dj49AjWB.js.map → getItem-FgLv9abh.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-dR9co4rH.js → getPublishPayload-h_Rz8nVX.js} +527 -79
- package/dist/cjs/getPublishPayload-h_Rz8nVX.js.map +1 -0
- package/dist/cjs/{getPublishUploads-g61mgXaA.js → getPublishUploads-DdSwst2x.js} +14 -8
- package/dist/cjs/getPublishUploads-DdSwst2x.js.map +1 -0
- package/dist/cjs/{getSegmentedItemProperties-NFvOHlAi.js → getSegmentedItemProperties-Bu4P_MG8.js} +5 -4
- package/dist/cjs/getSegmentedItemProperties-Bu4P_MG8.js.map +1 -0
- package/dist/cjs/{index-ud9i9fpp.js → index-CKJeh6ic.js} +3 -3
- package/dist/cjs/index-CKJeh6ic.js.map +1 -0
- package/dist/cjs/{index-9O_Ji1kY.js → index-pyKmk9hA.js} +243 -60
- package/dist/cjs/index-pyKmk9hA.js.map +1 -0
- package/dist/cjs/{ownership-CyLRNReQ.js → ownership-gfm5thj7.js} +2 -2
- package/dist/cjs/{ownership-CyLRNReQ.js.map → ownership-gfm5thj7.js.map} +1 -1
- package/dist/cjs/{property-Hj-RhQVX.js → property-Dw0b_Sf8.js} +4 -4
- package/dist/cjs/{property-Hj-RhQVX.js.map → property-Dw0b_Sf8.js.map} +1 -1
- package/dist/db/drizzle/drizzle/0010_add_arweave_l1_finalize_jobs.sql +16 -0
- package/dist/db/drizzle/drizzle/meta/0010_snapshot.json +1182 -0
- package/dist/db/drizzle/drizzle/meta/_journal.json +7 -0
- package/dist/{getItem-ClK0UZqi.js → getItem-Bd9U9Yih.js} +2 -2
- package/dist/{getItem-ClK0UZqi.js.map → getItem-Bd9U9Yih.js.map} +1 -1
- package/dist/{getPublishPayload-CdfPTl8l.js → getPublishPayload-eJL7ktes.js} +530 -82
- package/dist/getPublishPayload-eJL7ktes.js.map +1 -0
- package/dist/{getPublishUploads-CGBky9q9.js → getPublishUploads-CKm5dsL6.js} +14 -8
- package/dist/getPublishUploads-CKm5dsL6.js.map +1 -0
- package/dist/{getSegmentedItemProperties-CJWdYH9W.js → getSegmentedItemProperties-B74LN_bz.js} +5 -4
- package/dist/getSegmentedItemProperties-B74LN_bz.js.map +1 -0
- package/dist/{index-C74KrwXN.js → index-BQv2k74p.js} +3 -2
- package/dist/index-BQv2k74p.js.map +1 -0
- package/dist/{index-uPXtq2cf.js → index-BvZCYMxA.js} +268 -75
- package/dist/index-BvZCYMxA.js.map +1 -0
- package/dist/{index-CgmWq1sF.js → index-BxfqPvtu.js} +3 -3
- package/dist/index-BxfqPvtu.js.map +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +155 -18
- package/dist/main.js.map +1 -1
- package/dist/node.js +10 -10
- package/dist/{ownership-QK5haR3-.js → ownership-tVhYQomL.js} +2 -2
- package/dist/{ownership-QK5haR3-.js.map → ownership-tVhYQomL.js.map} +1 -1
- package/dist/{property-Dt0U3UXJ.js → property-BOdk-wW1.js} +6 -6
- package/dist/{property-Dt0U3UXJ.js.map → property-BOdk-wW1.js.map} +1 -1
- package/dist/{queries-BUB-vUBm.js → queries-DBqVwEdv.js} +2 -2
- package/dist/{queries-BUB-vUBm.js.map → queries-DBqVwEdv.js.map} +1 -1
- package/dist/seedSchema/ArweaveL1FinalizeSchema.ts +28 -0
- package/dist/seedSchema/index.d.ts +3 -0
- package/dist/seedSchema/index.ts +1 -0
- package/dist/src/Item/Item.d.ts +12 -9
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/queries.d.ts +3 -3
- package/dist/src/Item/service/actors/fetchDataFromEas.d.ts +1 -1
- package/dist/src/Item/service/actors/fetchDataFromEas.d.ts.map +1 -1
- package/dist/src/Item/service/actors/hydrateExistingItem.d.ts +1 -1
- package/dist/src/Item/service/actors/hydrateNewItem.d.ts +1 -1
- package/dist/src/Item/service/actors/initialize.d.ts +1 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts +2 -2
- package/dist/src/Item/service/actors/reload.d.ts +2 -2
- package/dist/src/Item/service/actors/runPublish.d.ts +2 -2
- package/dist/src/Item/service/actors/saveDataToDb.d.ts +1 -1
- package/dist/src/Item/service/actors/waitForDb.d.ts +1 -1
- package/dist/src/Item/service/itemMachineSingle.d.ts +11 -11
- package/dist/src/ItemProperty/ItemProperty.d.ts +5 -5
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/initialize.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/resolveRelatedValue.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/waitForDb.d.ts +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +14 -14
- package/dist/src/Model/Model.d.ts +2 -2
- package/dist/src/Model/service/actors/createModelProperties.d.ts +1 -1
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts +1 -1
- package/dist/src/Model/service/actors/validateModel.d.ts +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +6 -6
- package/dist/src/ModelProperty/ModelProperty.d.ts +3 -3
- package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts +1 -1
- package/dist/src/ModelProperty/service/actors/saveToSchema.d.ts +1 -1
- package/dist/src/ModelProperty/service/actors/validateProperty.d.ts +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +7 -7
- package/dist/src/Schema/Schema.d.ts +1 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/validateSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts +1 -1
- package/dist/src/Schema/service/actors/writeSchemaToDb.d.ts +1 -1
- package/dist/src/Schema/service/addModelsMachine.d.ts +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +7 -7
- package/dist/src/Schema/service/validation/SchemaValidationService.d.ts +4 -4
- package/dist/src/browser/db/Db.d.ts +2 -2
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/helpers/ArweaveClient.d.ts +2 -2
- package/dist/src/browser/helpers/EasClient.d.ts +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts +1 -1
- package/dist/src/browser/helpers/PathResolver.d.ts +1 -1
- package/dist/src/browser/helpers/QueryClient.d.ts +2 -2
- package/dist/src/browser/seed.d.ts +1 -1
- package/dist/src/client/BaseClientManager.d.ts +1 -1
- package/dist/src/client/ClientManager.d.ts +41 -41
- package/dist/src/client/actors/addModelsToDb.d.ts +1 -1
- package/dist/src/client/actors/addModelsToStore.d.ts +1 -1
- package/dist/src/client/actors/dbInit.d.ts +1 -1
- package/dist/src/client/actors/fileSystemInit.d.ts +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts +1 -1
- package/dist/src/client/actors/saveConfig.d.ts +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +11 -11
- package/dist/src/client/constants.d.ts +2 -2
- package/dist/src/db/Db/BaseDb.d.ts +1 -1
- package/dist/src/db/read/getItem.d.ts +1 -1
- package/dist/src/db/read/getItemData.d.ts +1 -1
- package/dist/src/db/read/getItemProperties.d.ts +1 -1
- package/dist/src/db/read/getItemProperty.d.ts +1 -1
- package/dist/src/db/read/getItems.d.ts +1 -1
- package/dist/src/db/read/getMetadata.d.ts +1 -1
- package/dist/src/db/read/getModels.d.ts +1 -1
- package/dist/src/db/read/getPropertyData.d.ts +2 -2
- package/dist/src/db/read/getPublishPayload.d.ts +12 -4
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPendingDiff.d.ts +25 -0
- package/dist/src/db/read/getPublishPendingDiff.d.ts.map +1 -0
- package/dist/src/db/read/getPublishUploads.d.ts +3 -3
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
- package/dist/src/db/read/getRelationValueData.d.ts +1 -1
- package/dist/src/db/read/getSeedData.d.ts +1 -1
- package/dist/src/db/read/getVersionData.d.ts +1 -1
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +12 -0
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +1 -0
- package/dist/src/db/write/createMetadata.d.ts +2 -2
- package/dist/src/db/write/createNewItem.d.ts +1 -1
- package/dist/src/db/write/createSeeds.d.ts +1 -1
- package/dist/src/db/write/saveMetadata.d.ts +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts +1 -1
- package/dist/src/db/write/updateMetadata.d.ts +2 -2
- package/dist/src/eas.d.ts +12 -1
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts +1 -1
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts +46 -0
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts.map +1 -0
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +1 -1
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts +1 -1
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts +1 -1
- package/dist/src/helpers/addresses.d.ts +1 -1
- package/dist/src/helpers/constants.d.ts +2 -0
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +4 -4
- package/dist/src/helpers/easPropertyCanonical.d.ts +15 -0
- package/dist/src/helpers/easPropertyCanonical.d.ts.map +1 -0
- package/dist/src/helpers/file/fetchAll/index.d.ts +1 -1
- package/dist/src/helpers/getSchemaForItemProperty.d.ts +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts +6 -6
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +4 -1
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/model.d.ts +1 -1
- package/dist/src/helpers/ownership.d.ts +1 -1
- package/dist/src/helpers/property/index.d.ts +1 -1
- package/dist/src/helpers/property.d.ts +1 -1
- package/dist/src/helpers/publishConfig.d.ts +1 -1
- package/dist/src/helpers/relationSeedRef.d.ts +8 -0
- package/dist/src/helpers/relationSeedRef.d.ts.map +1 -0
- package/dist/src/helpers/schema.d.ts +2 -2
- package/dist/src/helpers/updateSchema.d.ts +2 -2
- package/dist/src/imports/json.d.ts +1 -1
- package/dist/src/imports/markdown.d.ts +1 -1
- package/dist/src/index.d.ts +11 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IItem.d.ts +5 -3
- package/dist/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/src/interfaces/IItemProperty.d.ts +3 -3
- package/dist/src/node/codegen/drizzle.d.ts +1 -1
- package/dist/src/node/db/Db.d.ts +3 -3
- package/dist/src/node/helpers/ArweaveClient.d.ts +2 -2
- package/dist/src/node/helpers/EasClient.d.ts +1 -1
- package/dist/src/node/helpers/FileManager.d.ts +1 -1
- package/dist/src/node/helpers/PathResolver.d.ts +1 -1
- package/dist/src/node/helpers/QueryClient.d.ts +2 -2
- package/dist/src/seedSchema/ArweaveL1FinalizeSchema.d.ts +233 -0
- package/dist/src/seedSchema/ArweaveL1FinalizeSchema.d.ts.map +1 -0
- package/dist/src/seedSchema/index.d.ts +1 -0
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/src/services/publish/actors/createPublishAttempt.d.ts +1 -1
- package/dist/src/services/publish/actors/preparePublishRequestData.d.ts +1 -1
- package/dist/src/services/publish/actors/upload.d.ts +1 -1
- package/dist/src/services/publish/actors/validateItemData.d.ts +1 -1
- package/dist/src/services/publish/publishMachine.d.ts +7 -7
- package/dist/src/services/write/writeProcessMachine.d.ts +1 -1
- package/dist/src/types/db.d.ts +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/item.d.ts +6 -6
- package/dist/src/types/machines.d.ts +2 -2
- package/dist/src/types/model.d.ts +3 -3
- package/dist/src/types/property.d.ts +3 -3
- package/dist/src/types/publish.d.ts +1 -1
- package/dist/src/types/seedProtocol.d.ts +1 -1
- package/package.json +2 -2
- package/dist/Db-DsFElL33.js.map +0 -1
- package/dist/cjs/getPublishPayload-dR9co4rH.js.map +0 -1
- package/dist/cjs/getPublishUploads-g61mgXaA.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-NFvOHlAi.js.map +0 -1
- package/dist/cjs/index-9O_Ji1kY.js.map +0 -1
- package/dist/cjs/index-ud9i9fpp.js.map +0 -1
- package/dist/getPublishPayload-CdfPTl8l.js.map +0 -1
- package/dist/getPublishUploads-CGBky9q9.js.map +0 -1
- package/dist/getSegmentedItemProperties-CJWdYH9W.js.map +0 -1
- package/dist/index-C74KrwXN.js.map +0 -1
- package/dist/index-CgmWq1sF.js.map +0 -1
- package/dist/index-uPXtq2cf.js.map +0 -1
|
@@ -626,6 +626,103 @@ async function getUploadPipelineTransactionStatus(uploadApiBaseUrl, txOrDataItem
|
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
+
const GATEWAY_TX_QUERY = `
|
|
630
|
+
query ArweaveGatewayTransaction($id: String!) {
|
|
631
|
+
transaction(id: $id) {
|
|
632
|
+
id
|
|
633
|
+
bundledIn {
|
|
634
|
+
id
|
|
635
|
+
}
|
|
636
|
+
block {
|
|
637
|
+
height
|
|
638
|
+
timestamp
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
`;
|
|
643
|
+
function getUploadApiArweaveStatusUrl(baseUrl, dataItemId) {
|
|
644
|
+
const base = normalizeUploadApiBaseUrl(baseUrl);
|
|
645
|
+
const id = encodeURIComponent(dataItemId);
|
|
646
|
+
return `${base}/api/upload/arweave/status/${id}`;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Whether L1 anchoring is complete per upload API status JSON.
|
|
650
|
+
*/
|
|
651
|
+
function isArweaveL1AnchoringComplete(status) {
|
|
652
|
+
const l1 = status.l1;
|
|
653
|
+
if (!l1)
|
|
654
|
+
return false;
|
|
655
|
+
if (l1.meetsMinConfirmations === true)
|
|
656
|
+
return true;
|
|
657
|
+
if (l1.confirmed === true)
|
|
658
|
+
return true;
|
|
659
|
+
return false;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Fetches JSON from `GET /api/upload/arweave/status/{dataItemId}`.
|
|
663
|
+
* Returns `null` if the response is not OK or body is not JSON.
|
|
664
|
+
*/
|
|
665
|
+
async function getArweaveUploadStatus(uploadApiBaseUrl, dataItemId) {
|
|
666
|
+
const url = getUploadApiArweaveStatusUrl(uploadApiBaseUrl, dataItemId);
|
|
667
|
+
try {
|
|
668
|
+
const response = await fetch(url);
|
|
669
|
+
if (!response.ok) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
const body = (await response.json());
|
|
673
|
+
return body && typeof body === 'object' ? body : null;
|
|
674
|
+
}
|
|
675
|
+
catch {
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Queries an Arweave gateway GraphQL API for transaction + bundle info.
|
|
681
|
+
*/
|
|
682
|
+
async function queryArweaveGatewayTransaction(graphqlUrl, dataItemId, init) {
|
|
683
|
+
const url = graphqlUrl.trim();
|
|
684
|
+
if (!url)
|
|
685
|
+
return null;
|
|
686
|
+
try {
|
|
687
|
+
const response = await fetch(url, {
|
|
688
|
+
method: 'POST',
|
|
689
|
+
headers: {
|
|
690
|
+
'Content-Type': 'application/json',
|
|
691
|
+
},
|
|
692
|
+
body: JSON.stringify({
|
|
693
|
+
query: GATEWAY_TX_QUERY,
|
|
694
|
+
variables: { id: dataItemId },
|
|
695
|
+
}),
|
|
696
|
+
signal: init?.signal,
|
|
697
|
+
});
|
|
698
|
+
if (!response.ok) {
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
const json = (await response.json());
|
|
702
|
+
if (json.errors) {
|
|
703
|
+
return null;
|
|
704
|
+
}
|
|
705
|
+
const tx = json.data?.transaction;
|
|
706
|
+
if (!tx) {
|
|
707
|
+
return {
|
|
708
|
+
transactionId: null,
|
|
709
|
+
bundledInId: null,
|
|
710
|
+
blockHeight: null,
|
|
711
|
+
blockTimestamp: null,
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
return {
|
|
715
|
+
transactionId: typeof tx.id === 'string' ? tx.id : null,
|
|
716
|
+
bundledInId: tx.bundledIn?.id != null ? String(tx.bundledIn.id) : null,
|
|
717
|
+
blockHeight: tx.block?.height ?? null,
|
|
718
|
+
blockTimestamp: tx.block?.timestamp ?? null,
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
catch {
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
629
726
|
class BaseEasClient {
|
|
630
727
|
static setPlatformClass(platformClass) {
|
|
631
728
|
if (!platformClass) {
|
|
@@ -1048,6 +1145,69 @@ function resolveMetadataRecord(records, preferredPropertyName, dataType, refValu
|
|
|
1048
1145
|
return (records.find((r) => r.propertyName === preferredPropertyName) ?? records[0]);
|
|
1049
1146
|
}
|
|
1050
1147
|
|
|
1148
|
+
/** Same rules as getCorrectId in helpers/index (avoid barrel circular import). */
|
|
1149
|
+
function parseLocalIdOrUid(localIdOrUid) {
|
|
1150
|
+
const id = { localId: undefined, uid: undefined };
|
|
1151
|
+
if (!localIdOrUid)
|
|
1152
|
+
return id;
|
|
1153
|
+
if (localIdOrUid.length === 10) {
|
|
1154
|
+
id.localId = localIdOrUid;
|
|
1155
|
+
}
|
|
1156
|
+
if (localIdOrUid.startsWith('0x') && localIdOrUid.length === 66) {
|
|
1157
|
+
id.uid = localIdOrUid;
|
|
1158
|
+
}
|
|
1159
|
+
return id;
|
|
1160
|
+
}
|
|
1161
|
+
/** Relation/image refs may be string ids or `{ seedLocalId?, seedUid? }`. */
|
|
1162
|
+
function normalizeRelationPropertyValue(value) {
|
|
1163
|
+
if (value == null)
|
|
1164
|
+
return undefined;
|
|
1165
|
+
if (typeof value === 'string') {
|
|
1166
|
+
const t = value.trim();
|
|
1167
|
+
return t !== '' ? t : undefined;
|
|
1168
|
+
}
|
|
1169
|
+
if (typeof value === 'object' && value !== null) {
|
|
1170
|
+
const o = value;
|
|
1171
|
+
if (typeof o.seedLocalId === 'string' && o.seedLocalId.trim() !== '') {
|
|
1172
|
+
return o.seedLocalId.trim();
|
|
1173
|
+
}
|
|
1174
|
+
if (typeof o.seedUid === 'string' && o.seedUid.trim() !== '') {
|
|
1175
|
+
return o.seedUid.trim();
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
return undefined;
|
|
1179
|
+
}
|
|
1180
|
+
/** getCorrectId only accepts 10-char local ids and 0x66 uids; local seed refs can be up to 21 chars. */
|
|
1181
|
+
const LOCAL_SEED_REF = /^[a-zA-Z0-9_-]{10,21}$/;
|
|
1182
|
+
/** Resolve seed ids from a single string (context propertyValue or DB row). */
|
|
1183
|
+
function resolveSeedIdsFromRefString(s) {
|
|
1184
|
+
const fromCorrect = parseLocalIdOrUid(s);
|
|
1185
|
+
if (fromCorrect.localId || fromCorrect.uid) {
|
|
1186
|
+
return { seedLocalId: fromCorrect.localId, seedUid: fromCorrect.uid };
|
|
1187
|
+
}
|
|
1188
|
+
if (LOCAL_SEED_REF.test(s) && !s.startsWith('0x')) {
|
|
1189
|
+
return { seedLocalId: s };
|
|
1190
|
+
}
|
|
1191
|
+
return {};
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function pickLatestPropertyAttestationsByRefAndSchema(attestations) {
|
|
1195
|
+
const byKey = new Map();
|
|
1196
|
+
for (const att of attestations) {
|
|
1197
|
+
const sid = att.schemaId;
|
|
1198
|
+
if (!sid)
|
|
1199
|
+
continue;
|
|
1200
|
+
const key = `${att.refUID ?? ''}:${sid}`;
|
|
1201
|
+
const existing = byKey.get(key);
|
|
1202
|
+
const t = att.timeCreated ?? 0;
|
|
1203
|
+
const t0 = existing?.timeCreated ?? 0;
|
|
1204
|
+
if (!existing || t > t0) {
|
|
1205
|
+
byKey.set(key, att);
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
return [...byKey.values()];
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1051
1211
|
const logger$z = debug('seedSdk:shared:helpers');
|
|
1052
1212
|
const { alphanumeric } = nanoIdDictionary__namespace;
|
|
1053
1213
|
const generateId = () => {
|
|
@@ -1221,6 +1381,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1221
1381
|
convertTxIdToImage: convertTxIdToImage,
|
|
1222
1382
|
generateId: generateId,
|
|
1223
1383
|
getAlternatePropertyNameForInstanceLookup: getAlternatePropertyNameForInstanceLookup,
|
|
1384
|
+
getArweaveUploadStatus: getArweaveUploadStatus,
|
|
1224
1385
|
getArweaveUrlForTransaction: getArweaveUrlForTransaction,
|
|
1225
1386
|
getCorrectId: getCorrectId,
|
|
1226
1387
|
getDataTypeFromString: getDataTypeFromString,
|
|
@@ -1232,15 +1393,21 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1232
1393
|
getPublisherForNewSeedsWithTimeout: getPublisherForNewSeedsWithTimeout,
|
|
1233
1394
|
getRevokeExecutor: getRevokeExecutor,
|
|
1234
1395
|
getUploadApiArweaveDataUrl: getUploadApiArweaveDataUrl,
|
|
1396
|
+
getUploadApiArweaveStatusUrl: getUploadApiArweaveStatusUrl,
|
|
1235
1397
|
getUploadExecutor: getUploadExecutor,
|
|
1236
1398
|
getUploadPipelineTransactionStatus: getUploadPipelineTransactionStatus,
|
|
1237
1399
|
identifyString: identifyString,
|
|
1400
|
+
isArweaveL1AnchoringComplete: isArweaveL1AnchoringComplete,
|
|
1238
1401
|
isBinary: isBinary,
|
|
1239
1402
|
listRelationStoragePropertyName: listRelationStoragePropertyName,
|
|
1240
1403
|
needsMetadataIdSuffix: needsMetadataIdSuffix,
|
|
1404
|
+
normalizeRelationPropertyValue: normalizeRelationPropertyValue,
|
|
1241
1405
|
normalizeUploadApiBaseUrl: normalizeUploadApiBaseUrl,
|
|
1242
1406
|
parseEasRelationPropertyName: parseEasRelationPropertyName,
|
|
1407
|
+
pickLatestPropertyAttestationsByRefAndSchema: pickLatestPropertyAttestationsByRefAndSchema,
|
|
1408
|
+
queryArweaveGatewayTransaction: queryArweaveGatewayTransaction,
|
|
1243
1409
|
resolveMetadataRecord: resolveMetadataRecord,
|
|
1410
|
+
resolveSeedIdsFromRefString: resolveSeedIdsFromRefString,
|
|
1244
1411
|
resolveStorageNameToSchemaName: resolveStorageNameToSchemaName,
|
|
1245
1412
|
setAdditionalSyncAddresses: setAdditionalSyncAddresses,
|
|
1246
1413
|
setGetPublisherForNewSeeds: setGetPublisherForNewSeeds,
|
|
@@ -1264,7 +1431,7 @@ const createPropertyInstances = async (propertyFileIds) => {
|
|
|
1264
1431
|
return;
|
|
1265
1432
|
}
|
|
1266
1433
|
try {
|
|
1267
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
1434
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-Cuj839nX.js'); });
|
|
1268
1435
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1269
1436
|
if (!ModelProperty) {
|
|
1270
1437
|
logger$y('createPropertyInstances: ModelProperty not available from dynamic import');
|
|
@@ -1448,7 +1615,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
1448
1615
|
// Step 2: Fallback to Schema context (only if database doesn't have the model)
|
|
1449
1616
|
// This handles the case where model exists in schema file but not yet in database
|
|
1450
1617
|
try {
|
|
1451
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1618
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
1452
1619
|
const { Schema } = schemaMod;
|
|
1453
1620
|
const schema = Schema.create(schemaName, { waitForReady: false });
|
|
1454
1621
|
const schemaSnapshot = schema.getService().getSnapshot();
|
|
@@ -1692,7 +1859,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
1692
1859
|
}
|
|
1693
1860
|
// Mark schema as draft when a new model is created so saveNewVersion() can persist it
|
|
1694
1861
|
try {
|
|
1695
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1862
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
1696
1863
|
const { Schema } = schemaMod;
|
|
1697
1864
|
const schema = Schema.create(schemaName, { waitForReady: false });
|
|
1698
1865
|
schema.getService().send({ type: 'markAsDraft', propertyKey: 'schema:models' });
|
|
@@ -1736,10 +1903,10 @@ const validateModel = xstate.fromCallback(({ sendBack, input: { context } }) =>
|
|
|
1736
1903
|
const _validateModel = async () => {
|
|
1737
1904
|
try {
|
|
1738
1905
|
// Use dynamic imports to break circular dependencies
|
|
1739
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
1906
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
1740
1907
|
const { SchemaValidationService } = validationServiceMod;
|
|
1741
1908
|
const validationService = new SchemaValidationService();
|
|
1742
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1909
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
1743
1910
|
const { Schema } = schemaMod;
|
|
1744
1911
|
// Validate model structure
|
|
1745
1912
|
const structureResult = validationService.validateModelStructure(context);
|
|
@@ -1849,7 +2016,7 @@ const createModelProperties = xstate.fromCallback(({ sendBack, input }) => {
|
|
|
1849
2016
|
return;
|
|
1850
2017
|
}
|
|
1851
2018
|
logger$w(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
|
|
1852
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
2019
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-Cuj839nX.js'); });
|
|
1853
2020
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1854
2021
|
if (!ModelProperty) {
|
|
1855
2022
|
logger$w('ModelProperty not available from dynamic import');
|
|
@@ -1953,7 +2120,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1953
2120
|
const structureMsg = `[validateEntity] Validating model structure`;
|
|
1954
2121
|
logger$v(structureMsg);
|
|
1955
2122
|
// Use existing Model validation
|
|
1956
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
2123
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
1957
2124
|
const { SchemaValidationService } = validationServiceMod;
|
|
1958
2125
|
const validationService = new SchemaValidationService();
|
|
1959
2126
|
// Validate model structure
|
|
@@ -1971,7 +2138,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1971
2138
|
if (entityInput.entityData.schemaName) {
|
|
1972
2139
|
try {
|
|
1973
2140
|
logger$v(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
|
|
1974
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
2141
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
1975
2142
|
const { Schema } = schemaMod;
|
|
1976
2143
|
const schema = Schema.create(entityInput.entityData.schemaName, {
|
|
1977
2144
|
waitForReady: false,
|
|
@@ -2007,7 +2174,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
2007
2174
|
}
|
|
2008
2175
|
else if (entityInput.entityType === 'modelProperty') {
|
|
2009
2176
|
// Use existing ModelProperty validation
|
|
2010
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
2177
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
2011
2178
|
const { SchemaValidationService } = validationServiceMod;
|
|
2012
2179
|
const validationService = new SchemaValidationService();
|
|
2013
2180
|
// Validate property structure
|
|
@@ -2022,7 +2189,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
2022
2189
|
// If schema name and model name provided, validate against schema
|
|
2023
2190
|
if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
|
|
2024
2191
|
try {
|
|
2025
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
2192
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
2026
2193
|
const { Schema } = schemaMod;
|
|
2027
2194
|
const schema = Schema.create(entityInput.entityData._schemaName, {
|
|
2028
2195
|
waitForReady: false,
|
|
@@ -2051,7 +2218,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
2051
2218
|
}
|
|
2052
2219
|
else if (entityInput.entityType === 'schema') {
|
|
2053
2220
|
// Schema validation - use existing validation
|
|
2054
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
2221
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
2055
2222
|
const { SchemaValidationService } = validationServiceMod;
|
|
2056
2223
|
const validationService = new SchemaValidationService();
|
|
2057
2224
|
const schemaResult = validationService.validateSchema(entityInput.entityData);
|
|
@@ -2234,9 +2401,30 @@ const uploadProcesses = sqliteCore.sqliteTable('upload_processes', {
|
|
|
2234
2401
|
updatedAt: sqliteCore.int('updated_at'),
|
|
2235
2402
|
});
|
|
2236
2403
|
|
|
2404
|
+
/** Background job: resolve L1 tx id and wait for L1 confirmation after bundler publish. */
|
|
2405
|
+
const arweaveL1FinalizeJobs = sqliteCore.sqliteTable('arweave_l1_finalize_jobs', {
|
|
2406
|
+
id: sqliteCore.int('id').primaryKey({ autoIncrement: true }),
|
|
2407
|
+
seedLocalId: sqliteCore.text('seed_local_id').notNull(),
|
|
2408
|
+
dataItemId: sqliteCore.text('data_item_id').notNull(),
|
|
2409
|
+
/** L1 bundle / anchor transaction id from gateway GraphQL `bundledIn.id`. */
|
|
2410
|
+
l1TransactionId: sqliteCore.text('l1_transaction_id'),
|
|
2411
|
+
bundleId: sqliteCore.text('bundle_id'),
|
|
2412
|
+
versionLocalId: sqliteCore.text('version_local_id'),
|
|
2413
|
+
itemPropertyName: sqliteCore.text('item_property_name'),
|
|
2414
|
+
/** `pending_l1` | `confirmed` | `failed` */
|
|
2415
|
+
phase: sqliteCore.text('phase').notNull(),
|
|
2416
|
+
statusJson: sqliteCore.text('status_json'),
|
|
2417
|
+
errorMessage: sqliteCore.text('error_message'),
|
|
2418
|
+
createdAt: sqliteCore.int('created_at').notNull(),
|
|
2419
|
+
updatedAt: sqliteCore.int('updated_at').notNull(),
|
|
2420
|
+
}, (table) => ({
|
|
2421
|
+
dataItemIdUnique: sqliteCore.uniqueIndex('arweave_l1_finalize_jobs_data_item_id_unique').on(table.dataItemId),
|
|
2422
|
+
}));
|
|
2423
|
+
|
|
2237
2424
|
var schema$1 = /*#__PURE__*/Object.freeze({
|
|
2238
2425
|
__proto__: null,
|
|
2239
2426
|
appState: appState,
|
|
2427
|
+
arweaveL1FinalizeJobs: arweaveL1FinalizeJobs,
|
|
2240
2428
|
config: config,
|
|
2241
2429
|
metadata: metadata$1,
|
|
2242
2430
|
modelRelations: modelRelations,
|
|
@@ -4178,7 +4366,7 @@ const writeToDatabase = xstate.fromCallback(({ sendBack, input }) => {
|
|
|
4178
4366
|
// initial write completes is not overwritten by the stale requestWrite payload.
|
|
4179
4367
|
let dataToWrite = input.entityData;
|
|
4180
4368
|
try {
|
|
4181
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
4369
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-Cuj839nX.js'); });
|
|
4182
4370
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
4183
4371
|
if (ModelProperty && typeof ModelProperty.getById === 'function') {
|
|
4184
4372
|
const instance = ModelProperty.getById(input.entityId);
|
|
@@ -4558,7 +4746,7 @@ const modelMachine = xstate.setup({
|
|
|
4558
4746
|
// Create ModelProperty instances for any new property IDs
|
|
4559
4747
|
if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
|
|
4560
4748
|
// Import and create instances asynchronously (fire-and-forget)
|
|
4561
|
-
Promise.resolve().then(function () { return require('./ModelProperty-
|
|
4749
|
+
Promise.resolve().then(function () { return require('./ModelProperty-Cuj839nX.js'); }).then(({ ModelProperty }) => {
|
|
4562
4750
|
const createPromises = newPropertyIds.map(async (propertyFileId) => {
|
|
4563
4751
|
try {
|
|
4564
4752
|
const property = await ModelProperty.createById(propertyFileId);
|
|
@@ -5350,6 +5538,11 @@ const getItemVersionsFromEas = async ({ seedUids, excludeRevoked = true, }) => {
|
|
|
5350
5538
|
});
|
|
5351
5539
|
return itemVersions;
|
|
5352
5540
|
};
|
|
5541
|
+
/**
|
|
5542
|
+
* Returns all property attestations for the given Version UIDs. May include multiple
|
|
5543
|
+
* rows per schema (patch updates). Use `pickLatestPropertyAttestationsByRefAndSchema`
|
|
5544
|
+
* from `@seedprotocol/sdk` to resolve canonical values per `(refUID, schemaId)`.
|
|
5545
|
+
*/
|
|
5353
5546
|
const getItemPropertiesFromEas = async ({ versionUids, excludeRevoked = true, }) => {
|
|
5354
5547
|
const queryClient = BaseQueryClient.getQueryClient();
|
|
5355
5548
|
const easClient = BaseEasClient.getEasClient();
|
|
@@ -5697,26 +5890,14 @@ const fetchDataFromEas = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
5697
5890
|
},
|
|
5698
5891
|
}),
|
|
5699
5892
|
});
|
|
5700
|
-
|
|
5893
|
+
const latest = pickLatestPropertyAttestationsByRefAndSchema(itemProperties);
|
|
5701
5894
|
const selectedPropertiesMap = {};
|
|
5702
|
-
|
|
5703
|
-
const
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
Object.keys(selectedPropertiesMap).forEach((schemaId) => {
|
|
5709
|
-
const sorted = selectedPropertiesMap[schemaId].sort((a, b) => {
|
|
5710
|
-
return a.timeCreated - b.timeCreated;
|
|
5711
|
-
});
|
|
5712
|
-
selectedPropertiesMap[schemaId] = sorted;
|
|
5713
|
-
});
|
|
5714
|
-
Object.keys(selectedPropertiesMap).forEach((schemaId) => {
|
|
5715
|
-
// TODO: Finish this logic
|
|
5716
|
-
// console.log('[singleItemActors] [fetchDataFromEas] schemaId', schemaId)
|
|
5717
|
-
// sendBack({ type: 'addPropertyAttestation', schemaId })
|
|
5718
|
-
});
|
|
5719
|
-
// Attach processed properties to the itemService/itemMachine context
|
|
5895
|
+
for (const property of latest) {
|
|
5896
|
+
const sid = property.schemaId;
|
|
5897
|
+
if (!sid)
|
|
5898
|
+
continue;
|
|
5899
|
+
selectedPropertiesMap[sid] = [property];
|
|
5900
|
+
}
|
|
5720
5901
|
sendBack({
|
|
5721
5902
|
type: 'updatedPropertiesBySchemaUid',
|
|
5722
5903
|
propertiesBySchemaUid: selectedPropertiesMap,
|
|
@@ -5810,7 +5991,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5810
5991
|
const schemaNameToTry = model$1?.schemaName;
|
|
5811
5992
|
if (schemaNameToTry) {
|
|
5812
5993
|
try {
|
|
5813
|
-
const { Schema } = await Promise.resolve().then(function () { return require('./Schema-
|
|
5994
|
+
const { Schema } = await Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); });
|
|
5814
5995
|
const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
|
|
5815
5996
|
const schemaContext = schemaInstance.getService().getSnapshot().context;
|
|
5816
5997
|
if (schemaContext.models?.[modelName]?.properties) {
|
|
@@ -5859,7 +6040,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5859
6040
|
}
|
|
5860
6041
|
}
|
|
5861
6042
|
if (Object.keys(propertySchemas).length === 0) {
|
|
5862
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
6043
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
5863
6044
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5864
6045
|
const KNOWN_MODEL_FALLBACKS = {
|
|
5865
6046
|
Post: {
|
|
@@ -5908,7 +6089,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5908
6089
|
// Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
|
|
5909
6090
|
let propSchema = propertySchemas[propertyName];
|
|
5910
6091
|
if (!propSchema && isRefTypeFromMeta) {
|
|
5911
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
6092
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
5912
6093
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5913
6094
|
propSchema = {
|
|
5914
6095
|
dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
|
|
@@ -6156,9 +6337,9 @@ const runPublish = xstate.fromCallback(({ sendBack, input: { context } }) => {
|
|
|
6156
6337
|
sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
|
|
6157
6338
|
return;
|
|
6158
6339
|
}
|
|
6159
|
-
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-
|
|
6340
|
+
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-DdSwst2x.js'); });
|
|
6160
6341
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
6161
|
-
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-
|
|
6342
|
+
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-h_Rz8nVX.js'); });
|
|
6162
6343
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
6163
6344
|
const uploads = await getPublishUploads(item);
|
|
6164
6345
|
let uploadedTransactions = [];
|
|
@@ -6923,7 +7104,7 @@ const resolveRelatedValue = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
6923
7104
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
6924
7105
|
const _resolveRelatedValue = async () => {
|
|
6925
7106
|
// Use dynamic import to break circular dependency
|
|
6926
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
7107
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
6927
7108
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
6928
7109
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
6929
7110
|
return;
|
|
@@ -7299,7 +7480,7 @@ const hydrateFromDb = xstate.fromCallback(({ sendBack, input: { context } }) =>
|
|
|
7299
7480
|
// to use dynamically imported ModelPropertyDataTypes
|
|
7300
7481
|
const _hydrateFromDb = async () => {
|
|
7301
7482
|
// Use dynamic import to break circular dependency
|
|
7302
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
7483
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
7303
7484
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7304
7485
|
const appDb = BaseDb.getAppDb();
|
|
7305
7486
|
const whereClauses = [];
|
|
@@ -7604,7 +7785,7 @@ const loadOrCreateProperty = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
7604
7785
|
};
|
|
7605
7786
|
// Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
|
|
7606
7787
|
try {
|
|
7607
|
-
const { getPropertySchema } = await Promise.resolve().then(function () { return require('./property-
|
|
7788
|
+
const { getPropertySchema } = await Promise.resolve().then(function () { return require('./property-Dw0b_Sf8.js'); });
|
|
7608
7789
|
let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName);
|
|
7609
7790
|
if (!schemaFromFile?.validation) {
|
|
7610
7791
|
// Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
|
|
@@ -7988,9 +8169,9 @@ const analyzeInput = xstate.fromCallback(({ sendBack, input: { context, event }
|
|
|
7988
8169
|
}
|
|
7989
8170
|
const _analyzeInput = async () => {
|
|
7990
8171
|
// Use dynamic import to break circular dependency
|
|
7991
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
8172
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
7992
8173
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7993
|
-
const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
8174
|
+
const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
7994
8175
|
let propertyName = propertyNameRaw;
|
|
7995
8176
|
if (!propertyName) {
|
|
7996
8177
|
throw new Error('propertyName is required');
|
|
@@ -8188,7 +8369,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
|
|
|
8188
8369
|
propertyRecordSchema?.validation &&
|
|
8189
8370
|
metadataValues.propertyValue != null &&
|
|
8190
8371
|
metadataValues.propertyValue !== '') {
|
|
8191
|
-
const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
8372
|
+
const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-DVQrRpse.js'); });
|
|
8192
8373
|
const validationService = new SchemaValidationService();
|
|
8193
8374
|
const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, propertyRecordSchema.dataType, propertyRecordSchema.validation, propertyRecordSchema.refValueType);
|
|
8194
8375
|
if (!validationResult.isValid && validationResult.errors.length > 0) {
|
|
@@ -8775,7 +8956,7 @@ const saveRelation = xstate.fromCallback(({ sendBack, input: { context, event }
|
|
|
8775
8956
|
}
|
|
8776
8957
|
const _saveRelation = async () => {
|
|
8777
8958
|
// Use dynamic import to break circular dependency
|
|
8778
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
8959
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
8779
8960
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
8780
8961
|
if (!propertyNameRaw) {
|
|
8781
8962
|
throw new Error('propertyName is required');
|
|
@@ -9807,7 +9988,7 @@ class ItemProperty {
|
|
|
9807
9988
|
return;
|
|
9808
9989
|
}
|
|
9809
9990
|
// Use dynamic import to break circular dependency
|
|
9810
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
9991
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CKJeh6ic.js'); });
|
|
9811
9992
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
9812
9993
|
const { context } = snapshot;
|
|
9813
9994
|
const { propertyRecordSchema } = context;
|
|
@@ -10664,7 +10845,7 @@ class ItemProperty {
|
|
|
10664
10845
|
}
|
|
10665
10846
|
async save() {
|
|
10666
10847
|
const ctx = this._getSnapshotContext();
|
|
10667
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
10848
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-gfm5thj7.js'); });
|
|
10668
10849
|
await assertItemOwned({
|
|
10669
10850
|
seedLocalId: ctx?.seedLocalId ?? undefined,
|
|
10670
10851
|
seedUid: ctx?.seedUid ?? undefined,
|
|
@@ -11002,7 +11183,7 @@ class Item {
|
|
|
11002
11183
|
});
|
|
11003
11184
|
};
|
|
11004
11185
|
this.unpublish = async () => {
|
|
11005
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
11186
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-gfm5thj7.js'); });
|
|
11006
11187
|
const { getRevokeExecutor } = await Promise.resolve().then(function () { return publishConfig; });
|
|
11007
11188
|
await assertItemOwned(this);
|
|
11008
11189
|
const seedUid = this.seedUid;
|
|
@@ -11026,7 +11207,7 @@ class Item {
|
|
|
11026
11207
|
this._service.send({ type: 'updateContext', revokedAt });
|
|
11027
11208
|
};
|
|
11028
11209
|
this.publish = async () => {
|
|
11029
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
11210
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-gfm5thj7.js'); });
|
|
11030
11211
|
await assertItemOwned(this);
|
|
11031
11212
|
this._service.send({ type: 'startPublish' });
|
|
11032
11213
|
return new Promise((resolve, reject) => {
|
|
@@ -11062,15 +11243,14 @@ class Item {
|
|
|
11062
11243
|
};
|
|
11063
11244
|
this.getPublishUploads = async () => {
|
|
11064
11245
|
// Use dynamic import to break circular dependency
|
|
11065
|
-
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-
|
|
11246
|
+
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-DdSwst2x.js'); });
|
|
11066
11247
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
11067
11248
|
return await getPublishUploads(this);
|
|
11068
11249
|
};
|
|
11069
|
-
this.getPublishPayload = async (uploadedTransactions) => {
|
|
11070
|
-
|
|
11071
|
-
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-dR9co4rH.js'); });
|
|
11250
|
+
this.getPublishPayload = async (uploadedTransactions, options) => {
|
|
11251
|
+
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-h_Rz8nVX.js'); });
|
|
11072
11252
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
11073
|
-
return await getPublishPayload(this, uploadedTransactions);
|
|
11253
|
+
return await getPublishPayload(this, uploadedTransactions, options);
|
|
11074
11254
|
};
|
|
11075
11255
|
this.persistSeedUid = async (publisher) => {
|
|
11076
11256
|
const ctx = this._getSnapshotContext();
|
|
@@ -12268,7 +12448,7 @@ class Item {
|
|
|
12268
12448
|
* Destroy the item: soft delete in DB, remove from caches, clean up subscriptions, stop service.
|
|
12269
12449
|
*/
|
|
12270
12450
|
async destroy() {
|
|
12271
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
12451
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-gfm5thj7.js'); });
|
|
12272
12452
|
await assertItemOwned(this);
|
|
12273
12453
|
const context = this._getSnapshotContext();
|
|
12274
12454
|
const cacheKey = context.seedUid || context.seedLocalId;
|
|
@@ -12912,10 +13092,11 @@ const runSyncFromEas = async (options) => {
|
|
|
12912
13092
|
const { versionUids } = await saveEasVersionsToDb({
|
|
12913
13093
|
itemVersions,
|
|
12914
13094
|
});
|
|
12915
|
-
const
|
|
13095
|
+
const rawProperties = await getItemPropertiesFromEas({
|
|
12916
13096
|
versionUids,
|
|
12917
13097
|
excludeRevoked: false,
|
|
12918
13098
|
});
|
|
13099
|
+
const itemProperties = pickLatestPropertyAttestationsByRefAndSchema(rawProperties);
|
|
12919
13100
|
await saveEasPropertiesToDb({
|
|
12920
13101
|
itemProperties,
|
|
12921
13102
|
itemSeeds,
|
|
@@ -16442,7 +16623,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
|
|
|
16442
16623
|
// Lazy import cache for ModelProperty to avoid circular dependency
|
|
16443
16624
|
// Eagerly start loading to minimize delay on first access
|
|
16444
16625
|
let ModelPropertyClass = null;
|
|
16445
|
-
const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-
|
|
16626
|
+
const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-Cuj839nX.js'); })
|
|
16446
16627
|
.then(module => {
|
|
16447
16628
|
ModelPropertyClass = module.ModelProperty;
|
|
16448
16629
|
return ModelPropertyClass;
|
|
@@ -16459,7 +16640,7 @@ function getModelProperty() {
|
|
|
16459
16640
|
}
|
|
16460
16641
|
// Lazy import cache for Schema to avoid circular dependency
|
|
16461
16642
|
let SchemaClass = null;
|
|
16462
|
-
const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-
|
|
16643
|
+
const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-TFe24NNG.js'); })
|
|
16463
16644
|
.then(module => {
|
|
16464
16645
|
SchemaClass = module.Schema;
|
|
16465
16646
|
return SchemaClass;
|
|
@@ -18413,7 +18594,7 @@ class Db extends BaseDb {
|
|
|
18413
18594
|
// You can inspect what will happen before applying
|
|
18414
18595
|
await apply();
|
|
18415
18596
|
this.db = db;
|
|
18416
|
-
const { backfillMetadataPropertyIds } = await Promise.resolve().then(function () { return require('./backfillMetadataPropertyIds-
|
|
18597
|
+
const { backfillMetadataPropertyIds } = await Promise.resolve().then(function () { return require('./backfillMetadataPropertyIds-BiXK4hT1.js'); });
|
|
18417
18598
|
await backfillMetadataPropertyIds();
|
|
18418
18599
|
return this.db;
|
|
18419
18600
|
}
|
|
@@ -19060,7 +19241,7 @@ const getTsImport = async (filePath) => {
|
|
|
19060
19241
|
|
|
19061
19242
|
// Get the directory of this file to resolve relative paths
|
|
19062
19243
|
// @ts-ignore - rollup plugin-typescript doesn't recognize import.meta with module: "preserve"
|
|
19063
|
-
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-
|
|
19244
|
+
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-pyKmk9hA.js', document.baseURI).href)));
|
|
19064
19245
|
path.dirname(__filename$1);
|
|
19065
19246
|
const commandExists = (command) => {
|
|
19066
19247
|
try {
|
|
@@ -19611,11 +19792,13 @@ exports.modelSchemas = modelSchemas;
|
|
|
19611
19792
|
exports.modelUids = modelUids;
|
|
19612
19793
|
exports.models = models$1;
|
|
19613
19794
|
exports.normalizeDataType = normalizeDataType;
|
|
19795
|
+
exports.normalizeRelationPropertyValue = normalizeRelationPropertyValue;
|
|
19614
19796
|
exports.parseListPropertyValueFromStorage = parseListPropertyValueFromStorage;
|
|
19615
19797
|
exports.parseMarkdownFrontmatter = parseMarkdownFrontmatter;
|
|
19616
19798
|
exports.processSeedConfig = processSeedConfig;
|
|
19617
19799
|
exports.properties = properties;
|
|
19618
19800
|
exports.readJsonImportFile = readJsonImportFile;
|
|
19801
|
+
exports.resolveSeedIdsFromRefString = resolveSeedIdsFromRefString;
|
|
19619
19802
|
exports.resolveStorageNameToSchemaName = resolveStorageNameToSchemaName;
|
|
19620
19803
|
exports.runDestroyLifecycle = runDestroyLifecycle;
|
|
19621
19804
|
exports.runSeedInit = runSeedInit;
|
|
@@ -19633,4 +19816,4 @@ exports.versions = versions;
|
|
|
19633
19816
|
exports.waitForEntityIdle = waitForEntityIdle;
|
|
19634
19817
|
exports.withSeed = withSeed;
|
|
19635
19818
|
exports.writeProcessMachine = writeProcessMachine;
|
|
19636
|
-
//# sourceMappingURL=index-
|
|
19819
|
+
//# sourceMappingURL=index-pyKmk9hA.js.map
|