@seedprotocol/sdk 0.7.8 → 0.7.9-next.1177.ga3e08ed
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{ClientManager-B1r_8P5Z.js → ClientManager-GZfXErDX.js} +187 -1451
- package/dist/ClientManager-GZfXErDX.js.map +1 -0
- package/dist/{Item-CjTEShfk.js → Item-0oDoTPhi.js} +175 -238
- package/dist/Item-0oDoTPhi.js.map +1 -0
- package/dist/{ModelProperty-C3749Wjq.js → ModelProperty-i5flwzQG.js} +41 -40
- package/dist/ModelProperty-i5flwzQG.js.map +1 -0
- package/dist/{Schema-CX9CTtho.js → Schema-PFZwG9Nl.js} +88 -1623
- package/dist/Schema-PFZwG9Nl.js.map +1 -0
- package/dist/{SchemaValidationService-T5mqnY8q.js → SchemaValidationService-DnGKel4V.js} +7 -6
- package/dist/{SchemaValidationService-T5mqnY8q.js.map → SchemaValidationService-DnGKel4V.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js → backfillMetadataPropertyIds-BbxgavEQ.js} +4 -4
- package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js.map → backfillMetadataPropertyIds-BbxgavEQ.js.map} +1 -1
- package/dist/{changeFeed-DcsZ7deG.js → changeFeed-DKdVlUmt.js} +8 -7
- package/dist/changeFeed-DKdVlUmt.js.map +1 -0
- package/dist/configurePlatform-CrMafpMW.js +29 -0
- package/dist/configurePlatform-CrMafpMW.js.map +1 -0
- package/dist/db/drizzle/0024_merge_republished_ghost_seeds.sql +29 -0
- package/dist/db/drizzle/meta/0024_snapshot.json +1645 -0
- package/dist/db/drizzle/meta/_journal.json +7 -0
- package/dist/{detachRowsBeforeDelete-Bo_pky-R.js → detachRowsBeforeDelete-DXFYSHRR.js} +2 -3
- package/dist/{detachRowsBeforeDelete-Bo_pky-R.js.map → detachRowsBeforeDelete-DXFYSHRR.js.map} +1 -1
- package/dist/dist/{ClientManager-B1r_8P5Z.d.ts → ClientManager-GZfXErDX.d.ts} +323 -406
- package/dist/dist/ClientManager-GZfXErDX.d.ts.map +1 -0
- package/dist/dist/{Item-CjTEShfk.d.ts → Item-0oDoTPhi.d.ts} +85 -91
- package/dist/dist/Item-0oDoTPhi.d.ts.map +1 -0
- package/dist/dist/{ModelProperty-C3749Wjq.d.ts → ModelProperty-i5flwzQG.d.ts} +1 -1
- package/dist/dist/{ModelProperty-C3749Wjq.d.ts.map → ModelProperty-i5flwzQG.d.ts.map} +1 -1
- package/dist/dist/{Schema-CX9CTtho.d.ts → Schema-PFZwG9Nl.d.ts} +7 -183
- package/dist/dist/Schema-PFZwG9Nl.d.ts.map +1 -0
- package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts → SchemaValidationService-DnGKel4V.d.ts} +1 -1
- package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts.map → SchemaValidationService-DnGKel4V.d.ts.map} +1 -1
- package/dist/dist/{backfillMetadataPropertyIds-DWWkh-Ex.d.ts → backfillMetadataPropertyIds-BbxgavEQ.d.ts} +1 -1
- package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts.map +1 -0
- package/dist/dist/{changeFeed-DcsZ7deG.d.ts → changeFeed-DKdVlUmt.d.ts} +17 -20
- package/dist/dist/changeFeed-DKdVlUmt.d.ts.map +1 -0
- package/dist/dist/configurePlatform-CrMafpMW.d.ts +5 -0
- package/dist/dist/configurePlatform-CrMafpMW.d.ts.map +1 -0
- package/dist/dist/{detachRowsBeforeDelete-Bo_pky-R.d.ts → detachRowsBeforeDelete-DXFYSHRR.d.ts} +1 -1
- package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts.map +1 -0
- package/dist/dist/{eas--9vtNkma.d.ts → eas-dyepi5jz.d.ts} +1 -1
- package/dist/dist/eas-dyepi5jz.d.ts.map +1 -0
- package/dist/dist/{errors-Do7v6RKu.d.ts → errors-C1qUEZ7A.d.ts} +5 -2
- package/dist/dist/errors-C1qUEZ7A.d.ts.map +1 -0
- package/dist/dist/{errors-rIWK7gwJ.d.ts → errors-D1zHAqjr.d.ts} +1 -1
- package/dist/dist/{errors-rIWK7gwJ.d.ts.map → errors-D1zHAqjr.d.ts.map} +1 -1
- package/dist/dist/eventBus-7vxTCc3a.d.ts +18 -0
- package/dist/dist/eventBus-7vxTCc3a.d.ts.map +1 -0
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts +13 -0
- package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts.map +1 -0
- package/dist/dist/{getItem-5j22EWWE.d.ts → getItem-Bhjecbia.d.ts} +1 -1
- package/dist/dist/getItem-Bhjecbia.d.ts.map +1 -0
- package/dist/dist/{getPublishPayload-BGl2SaGK.d.ts → getPublishPayload-DH4rMqXG.d.ts} +1 -1
- package/dist/dist/getPublishPayload-DH4rMqXG.d.ts.map +1 -0
- package/dist/dist/{getPublishUploads-DVsDx6Xf.d.ts → getPublishUploads-BzUIDA2G.d.ts} +5 -5
- package/dist/dist/getPublishUploads-BzUIDA2G.d.ts.map +1 -0
- package/dist/dist/index-CkYb3wcU.d.ts +14 -0
- package/dist/dist/index-CkYb3wcU.d.ts.map +1 -0
- package/dist/dist/{index-Dp4uyZYx.d.ts → index-DJmWkVIK.d.ts} +5 -5
- package/dist/dist/index-DJmWkVIK.d.ts.map +1 -0
- package/dist/dist/{index-C0SetTd1.d.ts → index-Dx_GTdyQ.d.ts} +1457 -1513
- package/dist/dist/index-Dx_GTdyQ.d.ts.map +1 -0
- package/dist/dist/{index-CZQrNqvq.d.ts → index-PbnKw2es.d.ts} +1 -1
- package/dist/dist/{index-CZQrNqvq.d.ts.map → index-PbnKw2es.d.ts.map} +1 -1
- package/dist/dist/{index.browser-Ll71Y_Dl.d.ts → index.browser-i9uPJice.d.ts} +13 -40
- package/dist/dist/{index.browser-Ll71Y_Dl.d.ts.map → index.browser-i9uPJice.d.ts.map} +1 -1
- package/dist/dist/{index.node-CgltN0cC.d.ts → index.node-CzMwMr_d.d.ts} +2 -45
- package/dist/dist/{index.node-CgltN0cC.d.ts.map → index.node-CzMwMr_d.d.ts.map} +1 -1
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +9 -0
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +1 -0
- package/dist/dist/{modelPropertyRecordSchemas-C_lYTzMr.d.ts → modelPropertyRecordSchemas-C5lW9aA-.d.ts} +1 -1
- package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts.map +1 -0
- package/dist/dist/platform.browser.d.ts +2 -2
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/dist/{property-pcDxNEpy.d.ts → property-BwYtg5Q_.d.ts} +3 -3
- package/dist/dist/property-BwYtg5Q_.d.ts.map +1 -0
- package/dist/dist/{propertyValidationRules-BEjN0f3-.d.ts → propertyValidationRules-CyHdpcPP.d.ts} +1 -1
- package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts.map +1 -0
- package/dist/dist/{publishDraftGraph-I5yKe1Xz.d.ts → publishDraftGraph-C5F6b7GK.d.ts} +23 -6
- package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts.map +1 -0
- package/dist/dist/{resolveModelForSyncedSeed-C5KXn6ex.d.ts → resolveModelForSyncedSeed-4gO9Hfn2.d.ts} +1 -1
- package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts.map +1 -0
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts +13 -0
- package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts.map +1 -0
- package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts → tolerantWebAccess-DecKDGen.d.ts} +1 -1
- package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts.map → tolerantWebAccess-DecKDGen.d.ts.map} +1 -1
- package/dist/dist/{updateSeedRevokedAt-CR4zwn-6.d.ts → updateSeedRevokedAt-CP606vKs.d.ts} +1 -1
- package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts.map +1 -0
- package/dist/{eas--9vtNkma.js → eas-dyepi5jz.js} +3 -4
- package/dist/eas-dyepi5jz.js.map +1 -0
- package/dist/{errors-Do7v6RKu.js → errors-C1qUEZ7A.js} +12 -6
- package/dist/errors-C1qUEZ7A.js.map +1 -0
- package/dist/{errors-rIWK7gwJ.js → errors-D1zHAqjr.js} +46 -98
- package/dist/errors-D1zHAqjr.js.map +1 -0
- package/dist/eventBus-7vxTCc3a.js +64 -0
- package/dist/eventBus-7vxTCc3a.js.map +1 -0
- package/dist/findSeedRowsByUid-CT3sOXXw.js +47 -0
- package/dist/findSeedRowsByUid-CT3sOXXw.js.map +1 -0
- package/dist/{getItem-5j22EWWE.js → getItem-Bhjecbia.js} +5 -5
- package/dist/{getItem-5j22EWWE.js.map → getItem-Bhjecbia.js.map} +1 -1
- package/dist/{getPublishPayload-BGl2SaGK.js → getPublishPayload-DH4rMqXG.js} +27 -27
- package/dist/getPublishPayload-DH4rMqXG.js.map +1 -0
- package/dist/{getPublishUploads-DVsDx6Xf.js → getPublishUploads-BzUIDA2G.js} +64 -95
- package/dist/getPublishUploads-BzUIDA2G.js.map +1 -0
- package/dist/{index-CJK3F_MK.js → index-CkYb3wcU.js} +9 -8
- package/dist/index-CkYb3wcU.js.map +1 -0
- package/dist/{index-Dp4uyZYx.js → index-DJmWkVIK.js} +9 -8
- package/dist/index-DJmWkVIK.js.map +1 -0
- package/dist/{index-C0SetTd1.js → index-Dx_GTdyQ.js} +27 -463
- package/dist/index-Dx_GTdyQ.js.map +1 -0
- package/dist/{index-CZQrNqvq.js → index-PbnKw2es.js} +2 -2
- package/dist/index-PbnKw2es.js.map +1 -0
- package/dist/{index.browser-Ll71Y_Dl.js → index.browser-i9uPJice.js} +239 -179
- package/dist/index.browser-i9uPJice.js.map +1 -0
- package/dist/{index.node-CgltN0cC.js → index.node-CzMwMr_d.js} +51 -216
- package/dist/index.node-CzMwMr_d.js.map +1 -0
- package/dist/main.js +165 -241
- package/dist/main.js.map +1 -1
- package/dist/minimumUpgradeVersion-BDhHvHtr.js +81 -0
- package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +1 -0
- package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js → modelPropertyRecordSchemas-C5lW9aA-.js} +5 -5
- package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js.map → modelPropertyRecordSchemas-C5lW9aA-.js.map} +1 -1
- package/dist/node.js +14 -221
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +8 -7
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +7 -7
- package/dist/{property-pcDxNEpy.js → property-BwYtg5Q_.js} +8 -9
- package/dist/property-BwYtg5Q_.js.map +1 -0
- package/dist/{propertyValidationRules-BEjN0f3-.js → propertyValidationRules-CyHdpcPP.js} +10 -10
- package/dist/{propertyValidationRules-BEjN0f3-.js.map → propertyValidationRules-CyHdpcPP.js.map} +1 -1
- package/dist/{publishDraftGraph-I5yKe1Xz.js → publishDraftGraph-C5F6b7GK.js} +104 -35
- package/dist/publishDraftGraph-C5F6b7GK.js.map +1 -0
- package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js → resolveModelForSyncedSeed-4gO9Hfn2.js} +3 -2
- package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js.map → resolveModelForSyncedSeed-4gO9Hfn2.js.map} +1 -1
- package/dist/seedSchema/PendingWriteSchema.ts +3 -2
- package/dist/src/Item/Item.d.ts +1 -0
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/runPublish.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +2 -2
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +0 -20
- package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +0 -20
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +1 -107
- package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
- package/dist/src/Schema/validation.d.ts +0 -1
- package/dist/src/Schema/validation.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts +8 -3
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/createSqlocalDrizzle.d.ts +20 -2
- package/dist/src/browser/db/createSqlocalDrizzle.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/constants.d.ts +0 -51
- package/dist/src/client/constants.d.ts.map +1 -1
- package/dist/src/db/minimumUpgradeVersion.d.ts +33 -0
- package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -0
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts +2 -1
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts.map +1 -1
- package/dist/src/db/read/findSeedRowsByUid.d.ts +13 -0
- package/dist/src/db/read/findSeedRowsByUid.d.ts.map +1 -0
- package/dist/src/db/read/getItemData.d.ts.map +1 -1
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts +2 -1
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts.map +1 -1
- package/dist/src/db/read/getLatestVersionRow.d.ts +1 -1
- package/dist/src/db/read/getLatestVersionRow.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts +4 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts +1 -3
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts +2 -0
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
- package/dist/src/db/read/itemLoads.d.ts +20 -0
- package/dist/src/db/read/itemLoads.d.ts.map +1 -0
- package/dist/src/db/read/publishDraftGraph.d.ts +7 -0
- package/dist/src/db/read/publishDraftGraph.d.ts.map +1 -1
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts +4 -4
- package/dist/src/db/read/resolveRelatedSeedRef.d.ts.map +1 -1
- package/dist/src/db/read/subqueries/latestVersion.d.ts +14 -0
- package/dist/src/db/read/subqueries/latestVersion.d.ts.map +1 -0
- package/dist/src/db/read/subqueries/versionData.d.ts +2 -2
- package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -1
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +6 -0
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -1
- package/dist/src/db/write/easSyncProcess.d.ts +1 -1
- package/dist/src/db/write/easSyncProcess.d.ts.map +1 -1
- package/dist/src/db/write/updateVersionUid.d.ts +2 -2
- package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts +1 -10
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/item/easSyncManager.d.ts +0 -1
- package/dist/src/events/item/easSyncManager.d.ts.map +1 -1
- package/dist/src/events/item/index.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts +0 -10
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/IFileManager.d.ts +7 -0
- package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/errors.d.ts +4 -1
- package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
- package/dist/src/helpers/arweaveContentTags.d.ts +1 -2
- package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +3 -12
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +3 -28
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/ethereumUtils.d.ts +0 -2
- package/dist/src/helpers/ethereumUtils.d.ts.map +1 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +2 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +0 -7
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/itemStorageFile.d.ts +2 -2
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +2 -1
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -1
- package/dist/src/helpers/schema.d.ts +0 -73
- package/dist/src/helpers/schema.d.ts.map +1 -1
- package/dist/src/helpers/updateSchema.d.ts +0 -46
- package/dist/src/helpers/updateSchema.d.ts.map +1 -1
- package/dist/src/imports/index.d.ts +0 -1
- package/dist/src/imports/index.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts +2 -1
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/helpers/dotSeedDir.d.ts +7 -0
- package/dist/src/node/helpers/dotSeedDir.d.ts.map +1 -0
- package/dist/src/node/index.d.ts +0 -5
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/outbox/index.d.ts +1 -1
- package/dist/src/outbox/index.d.ts.map +1 -1
- package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
- package/dist/src/outbox/outbox.d.ts +3 -19
- package/dist/src/outbox/outbox.d.ts.map +1 -1
- package/dist/src/platform/configurePlatform.d.ts.map +1 -1
- package/dist/src/platform/index.browser.d.ts.map +1 -1
- package/dist/src/platform/index.node.d.ts.map +1 -1
- package/dist/src/platform/types.d.ts +0 -2
- package/dist/src/platform/types.d.ts.map +1 -1
- package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
- package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -1
- package/dist/src/services/write/actors/validateEntity.d.ts +1 -1
- package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -1
- package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -1
- package/dist/src/services/write/writeProcessMachine.d.ts +1 -23
- package/dist/src/services/write/writeProcessMachine.d.ts.map +1 -1
- package/dist/src/stores/eas.d.ts +0 -1
- package/dist/src/stores/eas.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +1 -18
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/machines.d.ts +1 -32
- package/dist/src/types/machines.d.ts.map +1 -1
- package/dist/{syncDbWithEas-b4fESZ7C.js → syncDbWithEas-DUu_wjUG.js} +37 -105
- package/dist/syncDbWithEas-DUu_wjUG.js.map +1 -0
- package/dist/{tolerantWebAccess-CIpS7RLk.js → tolerantWebAccess-DecKDGen.js} +9 -8
- package/dist/{tolerantWebAccess-CIpS7RLk.js.map → tolerantWebAccess-DecKDGen.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-CR4zwn-6.js → updateSeedRevokedAt-CP606vKs.js} +3 -3
- package/dist/{updateSeedRevokedAt-CR4zwn-6.js.map → updateSeedRevokedAt-CP606vKs.js.map} +1 -1
- package/package.json +6 -8
- package/dist/ClientManager-B1r_8P5Z.js.map +0 -1
- package/dist/Item-CjTEShfk.js.map +0 -1
- package/dist/ModelProperty-C3749Wjq.js.map +0 -1
- package/dist/Schema-CX9CTtho.js.map +0 -1
- package/dist/changeFeed-DcsZ7deG.js.map +0 -1
- package/dist/configurePlatform-AWild9o4.js +0 -81
- package/dist/configurePlatform-AWild9o4.js.map +0 -1
- package/dist/dist/ClientManager-B1r_8P5Z.d.ts.map +0 -1
- package/dist/dist/Item-CjTEShfk.d.ts.map +0 -1
- package/dist/dist/Schema-CX9CTtho.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-DWWkh-Ex.d.ts.map +0 -1
- package/dist/dist/changeFeed-DcsZ7deG.d.ts.map +0 -1
- package/dist/dist/configurePlatform-AWild9o4.d.ts +0 -30
- package/dist/dist/configurePlatform-AWild9o4.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-Bo_pky-R.d.ts.map +0 -1
- package/dist/dist/eas--9vtNkma.d.ts.map +0 -1
- package/dist/dist/errors-Do7v6RKu.d.ts.map +0 -1
- package/dist/dist/getItem-5j22EWWE.d.ts.map +0 -1
- package/dist/dist/getPublishPayload-BGl2SaGK.d.ts.map +0 -1
- package/dist/dist/getPublishUploads-DVsDx6Xf.d.ts.map +0 -1
- package/dist/dist/index-C0SetTd1.d.ts.map +0 -1
- package/dist/dist/index-CJK3F_MK.d.ts +0 -14
- package/dist/dist/index-CJK3F_MK.d.ts.map +0 -1
- package/dist/dist/index-Dp4uyZYx.d.ts.map +0 -1
- package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.d.ts.map +0 -1
- package/dist/dist/property-pcDxNEpy.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-BEjN0f3-.d.ts.map +0 -1
- package/dist/dist/publishDraftGraph-I5yKe1Xz.d.ts.map +0 -1
- package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts +0 -17
- package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-C5KXn6ex.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts +0 -22
- package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-CR4zwn-6.d.ts.map +0 -1
- package/dist/eas--9vtNkma.js.map +0 -1
- package/dist/errors-Do7v6RKu.js.map +0 -1
- package/dist/errors-rIWK7gwJ.js.map +0 -1
- package/dist/getPublishPayload-BGl2SaGK.js.map +0 -1
- package/dist/getPublishUploads-DVsDx6Xf.js.map +0 -1
- package/dist/index-C0SetTd1.js.map +0 -1
- package/dist/index-CJK3F_MK.js.map +0 -1
- package/dist/index-CZQrNqvq.js.map +0 -1
- package/dist/index-Dp4uyZYx.js.map +0 -1
- package/dist/index.browser-Ll71Y_Dl.js.map +0 -1
- package/dist/index.node-CgltN0cC.js.map +0 -1
- package/dist/property-pcDxNEpy.js.map +0 -1
- package/dist/publishDraftGraph-I5yKe1Xz.js.map +0 -1
- package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js +0 -98
- package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js.map +0 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +0 -5
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +0 -1
- package/dist/src/browser/db/sqlWasmClient.d.ts +0 -1
- package/dist/src/browser/db/sqlWasmClient.d.ts.map +0 -1
- package/dist/src/browser/helpers/PathResolver.d.ts +0 -41
- package/dist/src/browser/helpers/PathResolver.d.ts.map +0 -1
- package/dist/src/browser/index.d.ts +0 -3
- package/dist/src/browser/index.d.ts.map +0 -1
- package/dist/src/browser/seed.d.ts +0 -21
- package/dist/src/browser/seed.d.ts.map +0 -1
- package/dist/src/browser/workers/content-hash.d.ts +0 -2
- package/dist/src/browser/workers/content-hash.d.ts.map +0 -1
- package/dist/src/browser/workers/dbWorker.d.ts +0 -1
- package/dist/src/browser/workers/dbWorker.d.ts.map +0 -1
- package/dist/src/client/BaseClientManager.d.ts +0 -7
- package/dist/src/client/BaseClientManager.d.ts.map +0 -1
- package/dist/src/client/actions/setAddresses.d.ts +0 -2
- package/dist/src/client/actions/setAddresses.d.ts.map +0 -1
- package/dist/src/db/alignRowPublishers.d.ts +0 -25
- package/dist/src/db/alignRowPublishers.d.ts.map +0 -1
- package/dist/src/db/clearStoredDisplayUrls.d.ts +0 -18
- package/dist/src/db/clearStoredDisplayUrls.d.ts.map +0 -1
- package/dist/src/db/migrateLegacyItemStorageRows.d.ts +0 -57
- package/dist/src/db/migrateLegacyItemStorageRows.d.ts.map +0 -1
- package/dist/src/db/read/getExistingItem.d.ts +0 -12
- package/dist/src/db/read/getExistingItem.d.ts.map +0 -1
- package/dist/src/db/read/getModels.d.ts +0 -5
- package/dist/src/db/read/getModels.d.ts.map +0 -1
- package/dist/src/db/read/getVersionsForVersionUids.d.ts +0 -10
- package/dist/src/db/read/getVersionsForVersionUids.d.ts.map +0 -1
- package/dist/src/db/removeForeignAttestationRows.d.ts +0 -27
- package/dist/src/db/removeForeignAttestationRows.d.ts.map +0 -1
- package/dist/src/db/resetAmbiguousLegacyItemData.d.ts +0 -17
- package/dist/src/db/resetAmbiguousLegacyItemData.d.ts.map +0 -1
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +0 -14
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +0 -1
- package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts +0 -44
- package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts.map +0 -1
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts +0 -18
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +0 -1
- package/dist/src/db/write/saveAppState.d.ts +0 -2
- package/dist/src/db/write/saveAppState.d.ts.map +0 -1
- package/dist/src/eslint-rules/align-imports.d.ts +0 -12
- package/dist/src/eslint-rules/align-imports.d.ts.map +0 -1
- package/dist/src/events/files/index.d.ts +0 -4
- package/dist/src/events/files/index.d.ts.map +0 -1
- package/dist/src/events/index.d.ts +0 -13
- package/dist/src/events/index.d.ts.map +0 -1
- package/dist/src/events/services/allItems.d.ts +0 -6
- package/dist/src/events/services/allItems.d.ts.map +0 -1
- package/dist/src/events/services/index.d.ts +0 -3
- package/dist/src/events/services/index.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/index.d.ts +0 -30
- package/dist/src/helpers/ArweaveClient/index.d.ts.map +0 -1
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +0 -26
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +0 -1
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts +0 -16
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +0 -1
- package/dist/src/helpers/easRevokedFilter.d.ts +0 -2
- package/dist/src/helpers/easRevokedFilter.d.ts.map +0 -1
- package/dist/src/helpers/file/fetchAll/actors.d.ts +0 -16
- package/dist/src/helpers/file/fetchAll/actors.d.ts.map +0 -1
- package/dist/src/helpers/file/fetchAll/index.d.ts +0 -58
- package/dist/src/helpers/file/fetchAll/index.d.ts.map +0 -1
- package/dist/src/helpers/files.d.ts +0 -10
- package/dist/src/helpers/files.d.ts.map +0 -1
- package/dist/src/helpers/updateMachineContext.d.ts +0 -7
- package/dist/src/helpers/updateMachineContext.d.ts.map +0 -1
- package/dist/src/imports/markdown.d.ts +0 -40
- package/dist/src/imports/markdown.d.ts.map +0 -1
- package/dist/src/node/constants.d.ts +0 -2
- package/dist/src/node/constants.d.ts.map +0 -1
- package/dist/src/node/db/index.d.ts +0 -5
- package/dist/src/node/db/index.d.ts.map +0 -1
- package/dist/src/node/helpers/PathResolver.d.ts +0 -44
- package/dist/src/node/helpers/PathResolver.d.ts.map +0 -1
- package/dist/src/node/helpers/scripts.d.ts +0 -14
- package/dist/src/node/helpers/scripts.d.ts.map +0 -1
- package/dist/src/node/seed.d.ts +0 -1
- package/dist/src/node/seed.d.ts.map +0 -1
- package/dist/src/node/webpack/fs-proxy.d.ts +0 -4
- package/dist/src/node/webpack/fs-proxy.d.ts.map +0 -1
- package/dist/src/node/webpack/index.d.ts +0 -7
- package/dist/src/node/webpack/index.d.ts.map +0 -1
- package/dist/src/services/events.d.ts +0 -2
- package/dist/src/services/events.d.ts.map +0 -1
- package/dist/src/testing/platformTestHandle.d.ts +0 -8
- package/dist/src/testing/platformTestHandle.d.ts.map +0 -1
- package/dist/src/types/browser.d.ts +0 -24
- package/dist/src/types/browser.d.ts.map +0 -1
- package/dist/src/types/seedProtocol.d.ts +0 -16
- package/dist/src/types/seedProtocol.d.ts.map +0 -1
- package/dist/src/types/services.d.ts +0 -1
- package/dist/src/types/services.d.ts.map +0 -1
- package/dist/syncDbWithEas-b4fESZ7C.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fromCallback, fromPromise, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import {
|
|
2
|
+
import { L as BaseDb, p as models, E as properties, ad as generateId, aF as isInternalSchema, aG as writeModelToDb, aH as writePropertyToDb, z as modelSchemas, J as schemas, A as AmbiguousModelError, aI as renameModelInDb, aJ as currentNameMatchLevels, a as TProperty } from './index-Dx_GTdyQ.js';
|
|
3
3
|
import { eq, and, isNull, or } from 'drizzle-orm';
|
|
4
4
|
import debug from 'debug';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { L as isActorStopped, aj as ActorKeyedState, B as waitForEntityIdle, N as DEFAULT_READY_TIMEOUT_MS, P as createReactiveProxy, R as findEntity, W as ClientManagerState, I as Item, ak as clearDestroySubscriptions, S as forceRemoveFromCaches, al as unloadEntity, T as runDestroyLifecycle } from './Item-0oDoTPhi.js';
|
|
6
|
+
import { v as getClient } from './ClientManager-GZfXErDX.js';
|
|
7
7
|
import { modelPropertiesToObject } from './model-oHA3YhOd.js';
|
|
8
8
|
import { localNamesInBestMatchTier } from '@seedprotocol/eas';
|
|
9
9
|
import { Type } from '@sinclair/typebox';
|
|
@@ -19,7 +19,7 @@ const createPropertyInstances = async (propertyFileIds) => {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
22
|
-
const mod = await import('./ModelProperty-
|
|
22
|
+
const mod = await import('./ModelProperty-i5flwzQG.js');
|
|
23
23
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
24
24
|
if (!ModelProperty) {
|
|
25
25
|
logger$7('createPropertyInstances: ModelProperty not available from dynamic import');
|
|
@@ -85,11 +85,11 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
|
|
|
85
85
|
if (!modelRecord) {
|
|
86
86
|
// Model names are only unique per schema: prefer this schema's row, and otherwise only
|
|
87
87
|
// consider same-name rows that no schema claims yet (never another schema's model).
|
|
88
|
-
const _mod_0 = await import('./index-
|
|
89
|
-
const _ns_0 = _mod_0.
|
|
88
|
+
const _mod_0 = await import('./index-Dx_GTdyQ.js');
|
|
89
|
+
const _ns_0 = _mod_0.bd;
|
|
90
90
|
const { modelSchemas } = _ns_0;
|
|
91
|
-
const _mod_1 = await import('./index-
|
|
92
|
-
const _ns_1 = _mod_1.
|
|
91
|
+
const _mod_1 = await import('./index-Dx_GTdyQ.js');
|
|
92
|
+
const _ns_1 = _mod_1.bc;
|
|
93
93
|
const { schemas: schemasTable } = _ns_1;
|
|
94
94
|
let dbModels = await db
|
|
95
95
|
.select({
|
|
@@ -236,8 +236,8 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
|
|
|
236
236
|
// Step 2: Fallback to Schema context (only if database doesn't have the model)
|
|
237
237
|
// This handles the case where model exists in schema file but not yet in database
|
|
238
238
|
try {
|
|
239
|
-
const _mod_2 = await import('./Schema-
|
|
240
|
-
const _ns_2 = _mod_2.
|
|
239
|
+
const _mod_2 = await import('./Schema-PFZwG9Nl.js');
|
|
240
|
+
const _ns_2 = _mod_2.a;
|
|
241
241
|
const schemaMod = _ns_2;
|
|
242
242
|
const { Schema } = schemaMod;
|
|
243
243
|
// Stopped meanwhile (unloaded, or evicted with its schema): don't load the schema again
|
|
@@ -387,12 +387,12 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
|
|
|
387
387
|
}
|
|
388
388
|
// Also check database for models (in case they're persisted but not in Schema context)
|
|
389
389
|
if (db) {
|
|
390
|
-
const _mod_3 = await import('./index-
|
|
391
|
-
const _ns_3 = _mod_3.
|
|
390
|
+
const _mod_3 = await import('./index-Dx_GTdyQ.js');
|
|
391
|
+
const _ns_3 = _mod_3.bd;
|
|
392
392
|
const modelSchemaSchemaMod = _ns_3;
|
|
393
393
|
const { modelSchemas } = modelSchemaSchemaMod;
|
|
394
|
-
const _mod_4 = await import('./index-
|
|
395
|
-
const _ns_4 = _mod_4.
|
|
394
|
+
const _mod_4 = await import('./index-Dx_GTdyQ.js');
|
|
395
|
+
const _ns_4 = _mod_4.bc;
|
|
396
396
|
const schemaSchemaMod = _ns_4;
|
|
397
397
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
398
398
|
// Query all models for this schema to check for duplicates (case-insensitive)
|
|
@@ -487,8 +487,8 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context }, self })
|
|
|
487
487
|
}
|
|
488
488
|
// Mark schema as draft when a new model is created so saveNewVersion() can persist it
|
|
489
489
|
try {
|
|
490
|
-
const _mod_5 = await import('./Schema-
|
|
491
|
-
const _ns_5 = _mod_5.
|
|
490
|
+
const _mod_5 = await import('./Schema-PFZwG9Nl.js');
|
|
491
|
+
const _ns_5 = _mod_5.a;
|
|
492
492
|
const schemaMod = _ns_5;
|
|
493
493
|
const { Schema } = schemaMod;
|
|
494
494
|
if (!isActorStopped(self)) {
|
|
@@ -535,11 +535,11 @@ const validateModel = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
|
535
535
|
const _validateModel = async () => {
|
|
536
536
|
try {
|
|
537
537
|
// Use dynamic imports to break circular dependencies
|
|
538
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
538
|
+
const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
|
|
539
539
|
const { SchemaValidationService } = validationServiceMod;
|
|
540
540
|
const validationService = new SchemaValidationService();
|
|
541
|
-
const _mod_6 = await import('./Schema-
|
|
542
|
-
const _ns_6 = _mod_6.
|
|
541
|
+
const _mod_6 = await import('./Schema-PFZwG9Nl.js');
|
|
542
|
+
const _ns_6 = _mod_6.a;
|
|
543
543
|
const schemaMod = _ns_6;
|
|
544
544
|
const { Schema } = schemaMod;
|
|
545
545
|
// Validate model structure
|
|
@@ -655,7 +655,7 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
|
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
657
|
logger$5(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
|
|
658
|
-
const mod = await import('./ModelProperty-
|
|
658
|
+
const mod = await import('./ModelProperty-i5flwzQG.js');
|
|
659
659
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
660
660
|
if (!ModelProperty) {
|
|
661
661
|
logger$5('ModelProperty not available from dynamic import');
|
|
@@ -680,8 +680,8 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
|
|
|
680
680
|
: undefined;
|
|
681
681
|
// Otherwise use provided ID or generate a random one
|
|
682
682
|
// IDs should be generated in the import process before creating properties
|
|
683
|
-
const _mod_7 = await import('./index-
|
|
684
|
-
const _ns_7 = _mod_7.
|
|
683
|
+
const _mod_7 = await import('./index-Dx_GTdyQ.js');
|
|
684
|
+
const _ns_7 = _mod_7.bh;
|
|
685
685
|
const { generateId } = _ns_7;
|
|
686
686
|
const propertyFileId = propData.id || propertyRecord?.schemaFileId || generateId();
|
|
687
687
|
logger$5(`Creating property "${propName}" with fileId "${propertyFileId}"`);
|
|
@@ -698,8 +698,8 @@ const createModelProperties = fromCallback(({ sendBack, input, self }) => {
|
|
|
698
698
|
}
|
|
699
699
|
else if (refModelName) {
|
|
700
700
|
// Fallback: resolve the ref by name within this model's schema
|
|
701
|
-
const _mod_8 = await import('./index-
|
|
702
|
-
const _ns_8 = _mod_8.
|
|
701
|
+
const _mod_8 = await import('./index-Dx_GTdyQ.js');
|
|
702
|
+
const _ns_8 = _mod_8.be;
|
|
703
703
|
const { resolveModelRecord } = _ns_8;
|
|
704
704
|
const refModelRecord = await resolveModelRecord(refModelName, { schemaName }, db);
|
|
705
705
|
if (refModelRecord?.id) {
|
|
@@ -869,8 +869,8 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
869
869
|
const evictionEpoch = currentEvictionEpoch();
|
|
870
870
|
/** The schema to validate against; throws (validation then skips the schema check) once it was evicted. */
|
|
871
871
|
const schemaForValidation = async (schemaName) => {
|
|
872
|
-
const _mod_9 = await import('./Schema-
|
|
873
|
-
const _ns_9 = _mod_9.
|
|
872
|
+
const _mod_9 = await import('./Schema-PFZwG9Nl.js');
|
|
873
|
+
const _ns_9 = _mod_9.a;
|
|
874
874
|
const { Schema } = _ns_9;
|
|
875
875
|
if (schemaEvictedSince(schemaName, evictionEpoch)) {
|
|
876
876
|
throw new Error(`Schema "${schemaName}" was evicted during validation`);
|
|
@@ -887,7 +887,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
887
887
|
const structureMsg = `[validateEntity] Validating model structure`;
|
|
888
888
|
logger$4(structureMsg);
|
|
889
889
|
// Use existing Model validation
|
|
890
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
890
|
+
const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
|
|
891
891
|
const { SchemaValidationService } = validationServiceMod;
|
|
892
892
|
const validationService = new SchemaValidationService();
|
|
893
893
|
// Validate model structure
|
|
@@ -937,7 +937,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
937
937
|
}
|
|
938
938
|
else if (entityInput.entityType === 'modelProperty') {
|
|
939
939
|
// Use existing ModelProperty validation
|
|
940
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
940
|
+
const validationServiceMod = await import('./SchemaValidationService-DnGKel4V.js');
|
|
941
941
|
const { SchemaValidationService } = validationServiceMod;
|
|
942
942
|
const validationService = new SchemaValidationService();
|
|
943
943
|
// Validate property structure
|
|
@@ -975,19 +975,6 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
else if (entityInput.entityType === 'schema') {
|
|
979
|
-
// Schema validation - use existing validation
|
|
980
|
-
const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
|
|
981
|
-
const { SchemaValidationService } = validationServiceMod;
|
|
982
|
-
const validationService = new SchemaValidationService();
|
|
983
|
-
const schemaResult = validationService.validateSchema(entityInput.entityData);
|
|
984
|
-
if (!schemaResult.isValid) {
|
|
985
|
-
result = {
|
|
986
|
-
isValid: false,
|
|
987
|
-
errors: schemaResult.errors,
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
978
|
// Return the result - fromPromise will automatically put this in event.output
|
|
992
979
|
const completeMsg = `[validateEntity] Validation complete: isValid=${result.isValid}, errors=${result.errors?.length || 0}`;
|
|
993
980
|
logger$4(completeMsg);
|
|
@@ -1065,7 +1052,7 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
|
|
|
1065
1052
|
// initial write completes is not overwritten by the stale requestWrite payload.
|
|
1066
1053
|
let dataToWrite = input.entityData;
|
|
1067
1054
|
try {
|
|
1068
|
-
const mod = await import('./ModelProperty-
|
|
1055
|
+
const mod = await import('./ModelProperty-i5flwzQG.js');
|
|
1069
1056
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1070
1057
|
if (ModelProperty && typeof ModelProperty.getById === 'function') {
|
|
1071
1058
|
const instance = ModelProperty.getById(input.entityId);
|
|
@@ -1093,11 +1080,6 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
|
|
|
1093
1080
|
await writePropertyToDb(input.entityId, dataToWrite);
|
|
1094
1081
|
output = input.entityData;
|
|
1095
1082
|
}
|
|
1096
|
-
else if (input.entityType === 'schema') {
|
|
1097
|
-
const schemaRecord = await addSchemaToDb(input.entityData, input.entityId, // schemaFileId (string)
|
|
1098
|
-
input.entityData.schemaData, input.entityData.isDraft);
|
|
1099
|
-
output = { ...input.entityData, _dbId: schemaRecord.id }; // Store as _dbId (database integer ID)
|
|
1100
|
-
}
|
|
1101
1083
|
else {
|
|
1102
1084
|
throw new Error(`Unknown entity type: ${input.entityType}`);
|
|
1103
1085
|
}
|
|
@@ -1154,9 +1136,7 @@ const writeProcessMachine = setup({
|
|
|
1154
1136
|
entityId: input.entityId,
|
|
1155
1137
|
entityData: input.entityData || {},
|
|
1156
1138
|
validationErrors: [],
|
|
1157
|
-
writeStatus: 'idle',
|
|
1158
1139
|
error: null,
|
|
1159
|
-
retryCount: 0,
|
|
1160
1140
|
pendingWrite: null,
|
|
1161
1141
|
}),
|
|
1162
1142
|
states: {
|
|
@@ -1170,7 +1150,6 @@ const writeProcessMachine = setup({
|
|
|
1170
1150
|
data: event.data,
|
|
1171
1151
|
timestamp: Date.now(),
|
|
1172
1152
|
}),
|
|
1173
|
-
writeStatus: 'validating',
|
|
1174
1153
|
}),
|
|
1175
1154
|
({ event, context }) => {
|
|
1176
1155
|
logger$2(`[startWrite] Received startWrite for ${context.entityType} "${context.entityId}"`);
|
|
@@ -1225,7 +1204,6 @@ const writeProcessMachine = setup({
|
|
|
1225
1204
|
actions: [
|
|
1226
1205
|
assign({
|
|
1227
1206
|
validationErrors: [],
|
|
1228
|
-
writeStatus: 'writing',
|
|
1229
1207
|
}),
|
|
1230
1208
|
({ context }) => {
|
|
1231
1209
|
const msg = `[validating] Validation passed, transitioning to writing for ${context.entityType} "${context.entityId}"`;
|
|
@@ -1241,7 +1219,6 @@ const writeProcessMachine = setup({
|
|
|
1241
1219
|
const result = event.output;
|
|
1242
1220
|
return result.errors || [];
|
|
1243
1221
|
},
|
|
1244
|
-
writeStatus: 'error',
|
|
1245
1222
|
error: ({ event }) => {
|
|
1246
1223
|
const result = event.output;
|
|
1247
1224
|
return new Error(`Validation failed: ${result.errors.map(e => e.message).join(', ')}`);
|
|
@@ -1259,7 +1236,6 @@ const writeProcessMachine = setup({
|
|
|
1259
1236
|
actions: [
|
|
1260
1237
|
assign({
|
|
1261
1238
|
error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),
|
|
1262
|
-
writeStatus: 'error',
|
|
1263
1239
|
}),
|
|
1264
1240
|
({ context, event }) => {
|
|
1265
1241
|
const errorMsg = `[validating] Validation error for ${context.entityType} "${context.entityId}": ${event.error}`;
|
|
@@ -1269,9 +1245,6 @@ const writeProcessMachine = setup({
|
|
|
1269
1245
|
],
|
|
1270
1246
|
},
|
|
1271
1247
|
},
|
|
1272
|
-
on: {
|
|
1273
|
-
reset: 'idle',
|
|
1274
|
-
},
|
|
1275
1248
|
},
|
|
1276
1249
|
writing: {
|
|
1277
1250
|
invoke: {
|
|
@@ -1292,7 +1265,6 @@ const writeProcessMachine = setup({
|
|
|
1292
1265
|
target: 'success',
|
|
1293
1266
|
actions: [
|
|
1294
1267
|
assign({
|
|
1295
|
-
writeStatus: 'success',
|
|
1296
1268
|
pendingWrite: null,
|
|
1297
1269
|
entityData: ({ context, event }) => {
|
|
1298
1270
|
// Update entityData with any returned data from write
|
|
@@ -1309,8 +1281,6 @@ const writeProcessMachine = setup({
|
|
|
1309
1281
|
actions: [
|
|
1310
1282
|
assign({
|
|
1311
1283
|
error: ({ event }) => event.error instanceof Error ? event.error : new Error(String(event.error)),
|
|
1312
|
-
writeStatus: 'error',
|
|
1313
|
-
retryCount: ({ context }) => context.retryCount + 1,
|
|
1314
1284
|
}),
|
|
1315
1285
|
({ context, event }) => {
|
|
1316
1286
|
const errorMsg = `[writing] Write error for ${context.entityType} "${context.entityId}": ${event.error}`;
|
|
@@ -1320,40 +1290,14 @@ const writeProcessMachine = setup({
|
|
|
1320
1290
|
},
|
|
1321
1291
|
],
|
|
1322
1292
|
},
|
|
1323
|
-
reset: 'idle',
|
|
1324
1293
|
},
|
|
1325
1294
|
},
|
|
1326
1295
|
success: {
|
|
1327
1296
|
after: {
|
|
1328
1297
|
2000: { target: 'idle' }, // Auto-reset after 2s
|
|
1329
1298
|
},
|
|
1330
|
-
on: {
|
|
1331
|
-
reset: 'idle',
|
|
1332
|
-
},
|
|
1333
|
-
entry: assign({
|
|
1334
|
-
writeStatus: 'success',
|
|
1335
|
-
}),
|
|
1336
|
-
},
|
|
1337
|
-
error: {
|
|
1338
|
-
on: {
|
|
1339
|
-
retry: {
|
|
1340
|
-
target: 'validating',
|
|
1341
|
-
guard: ({ context }) => context.retryCount < 3,
|
|
1342
|
-
actions: assign({
|
|
1343
|
-
error: null,
|
|
1344
|
-
}),
|
|
1345
|
-
},
|
|
1346
|
-
revert: {
|
|
1347
|
-
target: 'idle',
|
|
1348
|
-
actions: assign({
|
|
1349
|
-
pendingWrite: null,
|
|
1350
|
-
writeStatus: 'idle',
|
|
1351
|
-
error: null,
|
|
1352
|
-
}),
|
|
1353
|
-
},
|
|
1354
|
-
reset: 'idle',
|
|
1355
|
-
},
|
|
1356
1299
|
},
|
|
1300
|
+
error: {},
|
|
1357
1301
|
},
|
|
1358
1302
|
});
|
|
1359
1303
|
|
|
@@ -1459,7 +1403,7 @@ const modelMachine = setup({
|
|
|
1459
1403
|
// Create ModelProperty instances for any new property IDs
|
|
1460
1404
|
if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
|
|
1461
1405
|
// Import and create instances asynchronously (fire-and-forget)
|
|
1462
|
-
import('./ModelProperty-
|
|
1406
|
+
import('./ModelProperty-i5flwzQG.js').then(({ ModelProperty }) => {
|
|
1463
1407
|
if (self.getSnapshot().status === 'stopped')
|
|
1464
1408
|
return;
|
|
1465
1409
|
const createPromises = newPropertyIds.map(async (propertyFileId) => {
|
|
@@ -1996,7 +1940,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
|
|
|
1996
1940
|
// Lazy import cache for ModelProperty to avoid circular dependency
|
|
1997
1941
|
// Eagerly start loading to minimize delay on first access
|
|
1998
1942
|
let ModelPropertyClass = null;
|
|
1999
|
-
const modelPropertyImportPromise = import('./ModelProperty-
|
|
1943
|
+
const modelPropertyImportPromise = import('./ModelProperty-i5flwzQG.js')
|
|
2000
1944
|
.then(module => {
|
|
2001
1945
|
ModelPropertyClass = module.ModelProperty;
|
|
2002
1946
|
return ModelPropertyClass;
|
|
@@ -2475,9 +2419,13 @@ class Model {
|
|
|
2475
2419
|
// If schema provided, trigger write process instead of registration
|
|
2476
2420
|
// When schemaName is passed as string (e.g. useCreateModel), we must trigger write so runtime-created
|
|
2477
2421
|
// models get persisted to DB and show up in useModels (which queries the database).
|
|
2422
|
+
const hasProperties = !!options?.properties && Object.keys(options.properties).length > 0;
|
|
2478
2423
|
const shouldTriggerWrite = (registerWithSchema && schemaInstance) ||
|
|
2479
|
-
|
|
2424
|
+
hasProperties ||
|
|
2480
2425
|
typeof schemaNameOrSchema === 'string';
|
|
2426
|
+
// Every DB load (createById, getByNameAsync, ...) also passes a string schema and no properties.
|
|
2427
|
+
// Such a model adopts its existing row: writing it again rewrote each property row and cleared is_edited.
|
|
2428
|
+
const adoptExistingRow = !!options?.persistedBy || (typeof schemaNameOrSchema === 'string' && !hasProperties);
|
|
2481
2429
|
if (shouldTriggerWrite) {
|
|
2482
2430
|
queueMicrotask(async () => {
|
|
2483
2431
|
try {
|
|
@@ -2506,7 +2454,7 @@ class Model {
|
|
|
2506
2454
|
failPropertyCreation('the model was unloaded');
|
|
2507
2455
|
return;
|
|
2508
2456
|
}
|
|
2509
|
-
if (
|
|
2457
|
+
if (adoptExistingRow && (await Model.adoptPersistedRow(proxiedInstance))) {
|
|
2510
2458
|
return;
|
|
2511
2459
|
}
|
|
2512
2460
|
// Only write if validation passed (model is in idle state, not error)
|
|
@@ -2973,8 +2921,8 @@ class Model {
|
|
|
2973
2921
|
const evictionEpoch = options?.evictionEpoch ?? currentEvictionEpoch();
|
|
2974
2922
|
try {
|
|
2975
2923
|
// Query model by name (throws AmbiguousModelError when several schemas define it)
|
|
2976
|
-
const _mod_10 = await import('./index-
|
|
2977
|
-
const _ns_10 = _mod_10.
|
|
2924
|
+
const _mod_10 = await import('./index-Dx_GTdyQ.js');
|
|
2925
|
+
const _ns_10 = _mod_10.be;
|
|
2978
2926
|
const { resolveModelRecord } = _ns_10;
|
|
2979
2927
|
const resolved = await resolveModelRecord(modelName, {}, db);
|
|
2980
2928
|
if (!resolved?.schemaFileId) {
|
|
@@ -3733,7 +3681,7 @@ class Model {
|
|
|
3733
3681
|
.limit(1);
|
|
3734
3682
|
if (modelRecords.length > 0) {
|
|
3735
3683
|
const modelId = modelRecords[0].id;
|
|
3736
|
-
const { detachModelRows } = await import('./detachRowsBeforeDelete-
|
|
3684
|
+
const { detachModelRows } = await import('./detachRowsBeforeDelete-DXFYSHRR.js');
|
|
3737
3685
|
await detachModelRows(db, [typeof modelId === 'string' ? parseInt(modelId, 10) : modelId]);
|
|
3738
3686
|
await db.delete(modelSchemas).where(eq(modelSchemas.modelId, modelId));
|
|
3739
3687
|
await db
|
|
@@ -3744,8 +3692,8 @@ class Model {
|
|
|
3744
3692
|
}
|
|
3745
3693
|
if (schemaName && modelName) {
|
|
3746
3694
|
// Imported here, not at module load: Model and Schema import each other.
|
|
3747
|
-
const _mod_11 = await import('./Schema-
|
|
3748
|
-
const _ns_11 = _mod_11.
|
|
3695
|
+
const _mod_11 = await import('./Schema-PFZwG9Nl.js');
|
|
3696
|
+
const _ns_11 = _mod_11.a;
|
|
3749
3697
|
const { Schema } = _ns_11;
|
|
3750
3698
|
const schema = Schema.create(schemaName, { waitForReady: false, hold: false });
|
|
3751
3699
|
const schemaContext = schema.getService().getSnapshot().context;
|
|
@@ -3788,8 +3736,8 @@ class Model {
|
|
|
3788
3736
|
return undefined;
|
|
3789
3737
|
}
|
|
3790
3738
|
// Model names are only unique per schema: find this model's row by its id (schemaFileId).
|
|
3791
|
-
const _mod_12 = await import('./index-
|
|
3792
|
-
const _ns_12 = _mod_12.
|
|
3739
|
+
const _mod_12 = await import('./index-Dx_GTdyQ.js');
|
|
3740
|
+
const _ns_12 = _mod_12.be;
|
|
3793
3741
|
const { resolveModelRecord } = _ns_12;
|
|
3794
3742
|
const modelRecord = await resolveModelRecord(modelName, { modelFileId: context.id, schemaName: context.schemaName }, db);
|
|
3795
3743
|
if (!modelRecord?.id) {
|
|
@@ -4055,4 +4003,4 @@ var errors = /*#__PURE__*/Object.freeze({
|
|
|
4055
4003
|
});
|
|
4056
4004
|
|
|
4057
4005
|
export { ConflictError as C, ItemCreateValidationError as I, Model as M, TModelSchema as T, UnknownModelError as U, TModelValues as a, anyEvictionSince as b, currentEvictionEpoch as c, ItemCreateError as d, setupEntityLiveQuery as e, finishSchemaDestroy as f, getDraftSaveError as g, writeToDatabase$1 as h, Model$1 as i, errors as j, recordSchemaDestroy as r, schemaEvictedSince as s, trackDraftSave as t, writeProcessMachine as w };
|
|
4058
|
-
//# sourceMappingURL=errors-
|
|
4006
|
+
//# sourceMappingURL=errors-D1zHAqjr.js.map
|