@seedprotocol/sdk 0.7.8-next.1071.g2a141c1 → 0.7.8-next.1101.g18b928b
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/{ClientManager-Bv15o3Oz.js → ClientManager-B1r_8P5Z.js} +37 -40
- package/dist/ClientManager-B1r_8P5Z.js.map +1 -0
- package/dist/{Item-tX3kpbj4.js → Item-CjTEShfk.js} +384 -399
- package/dist/Item-CjTEShfk.js.map +1 -0
- package/dist/{ModelProperty-N-3gBfu5.js → ModelProperty-C3749Wjq.js} +36 -36
- package/dist/{ModelProperty-N-3gBfu5.js.map → ModelProperty-C3749Wjq.js.map} +1 -1
- package/dist/{Schema-CY3OxwKS.js → Schema-CX9CTtho.js} +35 -35
- package/dist/{Schema-CY3OxwKS.js.map → Schema-CX9CTtho.js.map} +1 -1
- package/dist/{SchemaValidationService-BR2ABK2r.js → SchemaValidationService-T5mqnY8q.js} +6 -6
- package/dist/{SchemaValidationService-BR2ABK2r.js.map → SchemaValidationService-T5mqnY8q.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-vc_1RoDT.js → backfillMetadataPropertyIds-DWWkh-Ex.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-vc_1RoDT.js.map → backfillMetadataPropertyIds-DWWkh-Ex.js.map} +1 -1
- package/dist/{tabEvents-BuorBItJ.js → changeFeed-DcsZ7deG.js} +369 -10
- package/dist/changeFeed-DcsZ7deG.js.map +1 -0
- package/dist/{configurePlatform-D-Pj9gTx.js → configurePlatform-AWild9o4.js} +2 -2
- package/dist/{configurePlatform-D-Pj9gTx.js.map → configurePlatform-AWild9o4.js.map} +1 -1
- package/dist/db/drizzle/0022_add_read_indexes.sql +5 -0
- package/dist/db/drizzle/0023_add_entity_changes.sql +48 -0
- package/dist/db/drizzle/meta/0022_snapshot.json +1585 -0
- package/dist/db/drizzle/meta/0023_snapshot.json +1645 -0
- package/dist/db/drizzle/meta/_journal.json +14 -0
- package/dist/{detachRowsBeforeDelete-sK1ye2W6.js → detachRowsBeforeDelete-Bo_pky-R.js} +2 -2
- package/dist/{detachRowsBeforeDelete-sK1ye2W6.js.map → detachRowsBeforeDelete-Bo_pky-R.js.map} +1 -1
- package/dist/dist/{ClientManager-Bv15o3Oz.d.ts → ClientManager-B1r_8P5Z.d.ts} +1 -1
- package/dist/dist/ClientManager-B1r_8P5Z.d.ts.map +1 -0
- package/dist/dist/{Item-tX3kpbj4.d.ts → Item-CjTEShfk.d.ts} +3 -2
- package/dist/dist/Item-CjTEShfk.d.ts.map +1 -0
- package/dist/dist/{ModelProperty-N-3gBfu5.d.ts → ModelProperty-C3749Wjq.d.ts} +1 -1
- package/dist/dist/{ModelProperty-N-3gBfu5.d.ts.map → ModelProperty-C3749Wjq.d.ts.map} +1 -1
- package/dist/dist/{Schema-CY3OxwKS.d.ts → Schema-CX9CTtho.d.ts} +2 -2
- package/dist/dist/{Schema-CY3OxwKS.d.ts.map → Schema-CX9CTtho.d.ts.map} +1 -1
- package/dist/dist/{SchemaValidationService-BR2ABK2r.d.ts → SchemaValidationService-T5mqnY8q.d.ts} +1 -1
- package/dist/dist/{SchemaValidationService-BR2ABK2r.d.ts.map → SchemaValidationService-T5mqnY8q.d.ts.map} +1 -1
- package/dist/dist/{backfillMetadataPropertyIds-vc_1RoDT.d.ts → backfillMetadataPropertyIds-DWWkh-Ex.d.ts} +1 -1
- package/dist/dist/backfillMetadataPropertyIds-DWWkh-Ex.d.ts.map +1 -0
- package/dist/dist/{tabEvents-BuorBItJ.d.ts → changeFeed-DcsZ7deG.d.ts} +101 -36
- package/dist/dist/changeFeed-DcsZ7deG.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-D-Pj9gTx.d.ts → configurePlatform-AWild9o4.d.ts} +1 -1
- package/dist/dist/configurePlatform-AWild9o4.d.ts.map +1 -0
- package/dist/dist/{detachRowsBeforeDelete-sK1ye2W6.d.ts → detachRowsBeforeDelete-Bo_pky-R.d.ts} +1 -1
- package/dist/dist/detachRowsBeforeDelete-Bo_pky-R.d.ts.map +1 -0
- package/dist/dist/{eas-BSQxj7gN.d.ts → eas--9vtNkma.d.ts} +1 -1
- package/dist/dist/eas--9vtNkma.d.ts.map +1 -0
- package/dist/dist/{errors-a4Tj6hly.d.ts → errors-rIWK7gwJ.d.ts} +1 -1
- package/dist/dist/{errors-a4Tj6hly.d.ts.map → errors-rIWK7gwJ.d.ts.map} +1 -1
- package/dist/dist/{getItem-Ctps9gSs.d.ts → getItem-5j22EWWE.d.ts} +1 -1
- package/dist/dist/getItem-5j22EWWE.d.ts.map +1 -0
- package/dist/dist/{getPublishPayload-C2g5pPD2.d.ts → getPublishPayload-BGl2SaGK.d.ts} +1 -1
- package/dist/dist/{getPublishPayload-C2g5pPD2.d.ts.map → getPublishPayload-BGl2SaGK.d.ts.map} +1 -1
- package/dist/dist/{getPublishUploads-CaJHy3SL.d.ts → getPublishUploads-DVsDx6Xf.d.ts} +1 -1
- package/dist/dist/{getPublishUploads-CaJHy3SL.d.ts.map → getPublishUploads-DVsDx6Xf.d.ts.map} +1 -1
- package/dist/dist/{index-s73wD_LC.d.ts → index-C0SetTd1.d.ts} +1190 -1065
- package/dist/dist/index-C0SetTd1.d.ts.map +1 -0
- package/dist/dist/{index-BgEwcREa.d.ts → index-CJK3F_MK.d.ts} +13 -13
- package/dist/dist/index-CJK3F_MK.d.ts.map +1 -0
- package/dist/dist/{index-B6hPWSM4.d.ts → index-CZQrNqvq.d.ts} +130 -13
- package/dist/dist/{index-B6hPWSM4.d.ts.map → index-CZQrNqvq.d.ts.map} +1 -1
- package/dist/dist/{index-bOwhhJJL.d.ts → index-Dp4uyZYx.d.ts} +5 -5
- package/dist/dist/index-Dp4uyZYx.d.ts.map +1 -0
- package/dist/dist/{index.browser-C7iZp7mx.d.ts → index.browser-Ll71Y_Dl.d.ts} +391 -39
- package/dist/dist/{index.browser-C7iZp7mx.d.ts.map → index.browser-Ll71Y_Dl.d.ts.map} +1 -1
- package/dist/dist/{index.node-MPVTJR2J.d.ts → index.node-CgltN0cC.d.ts} +517 -49
- package/dist/dist/{index.node-MPVTJR2J.d.ts.map → index.node-CgltN0cC.d.ts.map} +1 -1
- package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.d.ts +7 -0
- package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.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-mP9mOZ2L.d.ts → property-pcDxNEpy.d.ts} +3 -3
- package/dist/dist/property-pcDxNEpy.d.ts.map +1 -0
- package/dist/dist/{propertyValidationRules-DwzrYA7c.d.ts → propertyValidationRules-BEjN0f3-.d.ts} +6 -1
- package/dist/dist/propertyValidationRules-BEjN0f3-.d.ts.map +1 -0
- package/dist/dist/{publishDraftGraph-BzYVblZZ.d.ts → publishDraftGraph-I5yKe1Xz.d.ts} +1 -1
- package/dist/dist/{publishDraftGraph-BzYVblZZ.d.ts.map → publishDraftGraph-I5yKe1Xz.d.ts.map} +1 -1
- package/dist/dist/{resetAmbiguousLegacyItemData-B_IUQA09.d.ts → resetAmbiguousLegacyItemData-0Tin9-JK.d.ts} +1 -1
- package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts.map +1 -0
- package/dist/dist/{resolveModelForSyncedSeed-H-4tmU6l.d.ts → resolveModelForSyncedSeed-C5KXn6ex.d.ts} +1 -1
- package/dist/dist/resolveModelForSyncedSeed-C5KXn6ex.d.ts.map +1 -0
- package/dist/dist/{syncDbWithEas-y5VF623G.d.ts → syncDbWithEas-b4fESZ7C.d.ts} +1 -1
- package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts.map +1 -0
- package/dist/dist/{tolerantWebAccess-DoI7QYT-.d.ts → tolerantWebAccess-CIpS7RLk.d.ts} +1 -1
- package/dist/dist/{tolerantWebAccess-DoI7QYT-.d.ts.map → tolerantWebAccess-CIpS7RLk.d.ts.map} +1 -1
- package/dist/dist/{updateSeedRevokedAt-BIzkbsUd.d.ts → updateSeedRevokedAt-CR4zwn-6.d.ts} +1 -1
- package/dist/dist/updateSeedRevokedAt-CR4zwn-6.d.ts.map +1 -0
- package/dist/{eas-BSQxj7gN.js → eas--9vtNkma.js} +3 -3
- package/dist/{eas-BSQxj7gN.js.map → eas--9vtNkma.js.map} +1 -1
- package/dist/{errors-a4Tj6hly.js → errors-rIWK7gwJ.js} +35 -35
- package/dist/{errors-a4Tj6hly.js.map → errors-rIWK7gwJ.js.map} +1 -1
- package/dist/{getItem-Ctps9gSs.js → getItem-5j22EWWE.js} +5 -5
- package/dist/{getItem-Ctps9gSs.js.map → getItem-5j22EWWE.js.map} +1 -1
- package/dist/{getPublishPayload-C2g5pPD2.js → getPublishPayload-BGl2SaGK.js} +14 -14
- package/dist/{getPublishPayload-C2g5pPD2.js.map → getPublishPayload-BGl2SaGK.js.map} +1 -1
- package/dist/{getPublishUploads-CaJHy3SL.js → getPublishUploads-DVsDx6Xf.js} +7 -7
- package/dist/{getPublishUploads-CaJHy3SL.js.map → getPublishUploads-DVsDx6Xf.js.map} +1 -1
- package/dist/{index-s73wD_LC.js → index-C0SetTd1.js} +52 -13
- package/dist/index-C0SetTd1.js.map +1 -0
- package/dist/{index-BgEwcREa.js → index-CJK3F_MK.js} +8 -8
- package/dist/index-CJK3F_MK.js.map +1 -0
- package/dist/{index-B6hPWSM4.js → index-CZQrNqvq.js} +3 -2
- package/dist/index-CZQrNqvq.js.map +1 -0
- package/dist/{index-bOwhhJJL.js → index-Dp4uyZYx.js} +8 -8
- package/dist/index-Dp4uyZYx.js.map +1 -0
- package/dist/{index.browser-C7iZp7mx.js → index.browser-Ll71Y_Dl.js} +243 -18
- package/dist/index.browser-Ll71Y_Dl.js.map +1 -0
- package/dist/{index.node-MPVTJR2J.js → index.node-CgltN0cC.js} +50 -15
- package/dist/index.node-CgltN0cC.js.map +1 -0
- package/dist/main.js +23 -30
- package/dist/main.js.map +1 -1
- package/dist/modelPropertyRecordSchemas-C_lYTzMr.js +94 -0
- package/dist/modelPropertyRecordSchemas-C_lYTzMr.js.map +1 -0
- package/dist/node.js +11 -11
- package/dist/platform.browser.js +5 -5
- package/dist/platform.node.js +4 -4
- package/dist/{property-mP9mOZ2L.js → property-pcDxNEpy.js} +7 -7
- package/dist/{property-mP9mOZ2L.js.map → property-pcDxNEpy.js.map} +1 -1
- package/dist/propertyValidationRules-BEjN0f3-.js +73 -0
- package/dist/propertyValidationRules-BEjN0f3-.js.map +1 -0
- package/dist/{publishDraftGraph-BzYVblZZ.js → publishDraftGraph-I5yKe1Xz.js} +6 -6
- package/dist/{publishDraftGraph-BzYVblZZ.js.map → publishDraftGraph-I5yKe1Xz.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-B_IUQA09.js → resetAmbiguousLegacyItemData-0Tin9-JK.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-B_IUQA09.js.map → resetAmbiguousLegacyItemData-0Tin9-JK.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-H-4tmU6l.js → resolveModelForSyncedSeed-C5KXn6ex.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-H-4tmU6l.js.map → resolveModelForSyncedSeed-C5KXn6ex.js.map} +1 -1
- package/dist/seedSchema/EntityChangeSchema.ts +28 -0
- package/dist/seedSchema/MetadataSchema.ts +12 -4
- package/dist/seedSchema/SeedSchema.ts +9 -3
- package/dist/seedSchema/VersionSchema.ts +9 -4
- package/dist/seedSchema/index.ts +1 -0
- package/dist/src/Item/Item.d.ts +2 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/modelPropertyRecordSchemas.d.ts +21 -0
- package/dist/src/ItemProperty/service/actors/modelPropertyRecordSchemas.d.ts.map +1 -0
- package/dist/src/browser/db/Db.d.ts +2 -2
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/changeFeed.d.ts +77 -0
- package/dist/src/browser/db/changeFeed.d.ts.map +1 -0
- package/dist/src/browser/db/drizzleFiles.d.ts +4 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +1 -1
- package/dist/src/db/write/claimUnpublishedDrafts.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/createSeed.d.ts.map +1 -1
- package/dist/src/db/write/createVersion.d.ts.map +1 -1
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +1 -1
- package/dist/src/db/write/saveMetadata.d.ts.map +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/db/write/updateSeedRevokedAt.d.ts.map +1 -1
- package/dist/src/db/write/updateSeedUid.d.ts.map +1 -1
- package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/propertyValidationRules.d.ts +8 -0
- package/dist/src/helpers/propertyValidationRules.d.ts.map +1 -1
- package/dist/src/helpers/timing.d.ts +36 -0
- package/dist/src/helpers/timing.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/singleConnectionTransactions.d.ts +6 -0
- package/dist/src/node/db/singleConnectionTransactions.d.ts.map +1 -1
- package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
- package/dist/src/outbox/outbox.d.ts +2 -0
- package/dist/src/outbox/outbox.d.ts.map +1 -1
- package/dist/src/outbox/pendingValues.d.ts.map +1 -1
- package/dist/src/seedSchema/EntityChangeSchema.d.ts +126 -0
- package/dist/src/seedSchema/EntityChangeSchema.d.ts.map +1 -0
- package/dist/src/seedSchema/MetadataSchema.d.ts +4 -4
- package/dist/src/seedSchema/MetadataSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/SeedSchema.d.ts +4 -4
- package/dist/src/seedSchema/SeedSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/VersionSchema.d.ts +4 -4
- package/dist/src/seedSchema/VersionSchema.d.ts.map +1 -1
- package/dist/src/seedSchema/index.d.ts +1 -0
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-y5VF623G.js → syncDbWithEas-b4fESZ7C.js} +17 -23
- package/dist/syncDbWithEas-b4fESZ7C.js.map +1 -0
- package/dist/{tolerantWebAccess-DoI7QYT-.js → tolerantWebAccess-CIpS7RLk.js} +6 -6
- package/dist/{tolerantWebAccess-DoI7QYT-.js.map → tolerantWebAccess-CIpS7RLk.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-BIzkbsUd.js → updateSeedRevokedAt-CR4zwn-6.js} +5 -6
- package/dist/updateSeedRevokedAt-CR4zwn-6.js.map +1 -0
- package/package.json +6 -6
- package/dist/ClientManager-Bv15o3Oz.js.map +0 -1
- package/dist/Item-tX3kpbj4.js.map +0 -1
- package/dist/dist/ClientManager-Bv15o3Oz.d.ts.map +0 -1
- package/dist/dist/Item-tX3kpbj4.d.ts.map +0 -1
- package/dist/dist/backfillMetadataPropertyIds-vc_1RoDT.d.ts.map +0 -1
- package/dist/dist/configurePlatform-D-Pj9gTx.d.ts.map +0 -1
- package/dist/dist/detachRowsBeforeDelete-sK1ye2W6.d.ts.map +0 -1
- package/dist/dist/eas-BSQxj7gN.d.ts.map +0 -1
- package/dist/dist/getItem-Ctps9gSs.d.ts.map +0 -1
- package/dist/dist/index-BgEwcREa.d.ts.map +0 -1
- package/dist/dist/index-bOwhhJJL.d.ts.map +0 -1
- package/dist/dist/index-s73wD_LC.d.ts.map +0 -1
- package/dist/dist/property-mP9mOZ2L.d.ts.map +0 -1
- package/dist/dist/propertyValidationRules-DwzrYA7c.d.ts.map +0 -1
- package/dist/dist/resetAmbiguousLegacyItemData-B_IUQA09.d.ts.map +0 -1
- package/dist/dist/resolveModelForSyncedSeed-H-4tmU6l.d.ts.map +0 -1
- package/dist/dist/syncDbWithEas-y5VF623G.d.ts.map +0 -1
- package/dist/dist/tabEvents-BuorBItJ.d.ts.map +0 -1
- package/dist/dist/updateSeedRevokedAt-BIzkbsUd.d.ts.map +0 -1
- package/dist/index-B6hPWSM4.js.map +0 -1
- package/dist/index-BgEwcREa.js.map +0 -1
- package/dist/index-bOwhhJJL.js.map +0 -1
- package/dist/index-s73wD_LC.js.map +0 -1
- package/dist/index.browser-C7iZp7mx.js.map +0 -1
- package/dist/index.node-MPVTJR2J.js.map +0 -1
- package/dist/propertyValidationRules-DwzrYA7c.js +0 -51
- package/dist/propertyValidationRules-DwzrYA7c.js.map +0 -1
- package/dist/syncDbWithEas-y5VF623G.js.map +0 -1
- package/dist/tabEvents-BuorBItJ.js.map +0 -1
- package/dist/updateSeedRevokedAt-BIzkbsUd.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { startCase, isEqual } from 'lodash-es';
|
|
2
|
-
import {
|
|
2
|
+
import { G as BaseDb, l as easSyncProcesses, J as eventEmitter, au as isBrowser, a4 as isNode, aI as normalizeAddressConfig, aX as isTestOrSeedDev, h as appState, aY as downloadAllFilesRequestHandler, aZ as downloadAllFilesBinaryRequestHandler, Q as BaseFileManager, ag as loadNameMatchLevels, t as models$1, s as modelUids, C as seeds, aJ as normalizeAddressList, B as schemas, aU as loadModelsFromDbForSchema, aQ as addSchemaToDb, aN as isInternalSchema, aj as generateId, aW as clearNameMatchLevels, a_ as warnOnInvalidNameMatch, a$ as INTERNAL_SCHEMA_IDS, b0 as linkModelToSchema, n as normalizeDataType, ad as easPropertyNameForPublish, ay as SEED_PROTOCOL_SCHEMA_NAME, r as modelSchemas, a2 as getItemStorageSubdir, a3 as getItemStorageLocalFileName, m as metadata$1, w as properties, O as resolveItemModelFileId, F as versions, ae as normalizePublisher, v as pendingWrites, b1 as getMetadataPropertyNamesForQuery, p as htmlEmbeddedImageCoPublish, j as arweaveL1FinalizeJobs, A as publishProcesses, b2 as getWatchedAddressesFromDb, b3 as getOwnedAddressesFromDb, b4 as CLIENT_NOT_INITIALIZED } from './index-C0SetTd1.js';
|
|
3
3
|
import debug from 'debug';
|
|
4
4
|
import { createActor, setup, assign, fromPromise, fromCallback, waitFor } from 'xstate';
|
|
5
|
-
import { Y as MachineIds, an as ClientManagerEvents, D as compareMetadataRowsLatestFirst, u as writeInBatches, ao as resolvePublisherFromSeedRow, ap as getSeedPublisher, aq as propertyNameVariants, M as METADATA_LATEST_FIRST_ORDER_SQL, L as selectInBatches, ar as createSeed, as as createMetadata, at as updateItemPropertyValue, s as registerOutboxApplier, q as outboxOpValue, i as OutboxOpDeferredError, t as startOutbox, j as OutboxOpFailedError, z as OwnershipError, B as isItemOwned, G as parseListPropertyValueFromStorage, X as ClientManagerState, a5 as isLocalUnsealedDraft, I as Item } from './Item-
|
|
5
|
+
import { Y as MachineIds, an as ClientManagerEvents, D as compareMetadataRowsLatestFirst, u as writeInBatches, ao as resolvePublisherFromSeedRow, ap as getSeedPublisher, aq as propertyNameVariants, M as METADATA_LATEST_FIRST_ORDER_SQL, L as selectInBatches, ar as createSeed, as as createMetadata, at as updateItemPropertyValue, s as registerOutboxApplier, q as outboxOpValue, i as OutboxOpDeferredError, t as startOutbox, j as OutboxOpFailedError, z as OwnershipError, B as isItemOwned, G as parseListPropertyValueFromStorage, X as ClientManagerState, a5 as isLocalUnsealedDraft, I as Item } from './Item-CjTEShfk.js';
|
|
6
6
|
import { eq, inArray, and, isNotNull, ne, desc, countDistinct, isNull, or, sql, like, lt } from 'drizzle-orm';
|
|
7
|
-
import {
|
|
7
|
+
import { d as withDbTabLock, a as isLeaderTab, k as postTabMessage, o as onTabMessage, c as whenLeaderTab, l as listenForOtherTabsEvents, m as startTabCoordination, g as withSeedDbLock, e as emitAcrossTabs, A as ADDRESSES_PERSISTED_EVENT, q as tryWithTabLock, r as withTabLock, u as notifyFileSaved, p as parseAddressesPersistedPayload, L as LOCAL_COPIES_REMOVED_EVENT } from './changeFeed-DcsZ7deG.js';
|
|
8
8
|
import { seedGatewayConfigFromSeedConfig, setPreferredArweaveReadBaseUrls, resolveSeedGatewayEndpoints, setResolvedSeedGatewayEndpoints, BaseArweaveClient, ensureReadGatewaySelected, DEFAULT_ARWEAVE_HOST } from '@seedprotocol/arweave';
|
|
9
9
|
import { configureEasReadChain, easName, BaseQueryClient, BaseEasClient, GET_SCHEMAS, whenEasReadChainSettled, getEasReadChainId, DEFAULT_EAS_CHAIN_ID, isEasReadChainConfigured, isPlaceholderUid, localNamesInBestMatchTier, isValidEasAttestationUid } from '@seedprotocol/eas';
|
|
10
10
|
import 'pluralize';
|
|
@@ -212,7 +212,7 @@ function toRunSyncArg(options) {
|
|
|
212
212
|
return undefined;
|
|
213
213
|
}
|
|
214
214
|
const runEasSync = fromPromise(async ({ input, }) => {
|
|
215
|
-
const { runSyncFromEas } = await import('./syncDbWithEas-
|
|
215
|
+
const { runSyncFromEas } = await import('./syncDbWithEas-b4fESZ7C.js');
|
|
216
216
|
// Sync checks for rows and then inserts the rest (no unique index on uids), so syncs in
|
|
217
217
|
// different tabs take turns. A sync can run for minutes, so wait without a timeout.
|
|
218
218
|
await withDbTabLock('eas-sync', async () => {
|
|
@@ -590,7 +590,7 @@ const platformClassesInit = fromCallback(({ sendBack, input: { context, event }
|
|
|
590
590
|
if (!config) {
|
|
591
591
|
throw new Error('client.init requires a config');
|
|
592
592
|
}
|
|
593
|
-
const _mod_0 = await import('./configurePlatform-
|
|
593
|
+
const _mod_0 = await import('./configurePlatform-AWild9o4.js');
|
|
594
594
|
const _ns_0 = _mod_0.a;
|
|
595
595
|
const { configurePlatform } = _ns_0;
|
|
596
596
|
if (isBrowser()) {
|
|
@@ -2003,8 +2003,8 @@ function getRefValueType(prop) {
|
|
|
2003
2003
|
* @returns Promise that resolves when properties are found, or rejects if not found after max retries
|
|
2004
2004
|
*/
|
|
2005
2005
|
const verifyPropertiesPersisted = async (db, modelId, modelName, maxRetries = 10, retryDelay = 100) => {
|
|
2006
|
-
const _mod_1 = await import('./index-
|
|
2007
|
-
const _ns_1 = _mod_1.
|
|
2006
|
+
const _mod_1 = await import('./index-C0SetTd1.js');
|
|
2007
|
+
const _ns_1 = _mod_1.bj;
|
|
2008
2008
|
const modelSchemaMod = _ns_1;
|
|
2009
2009
|
const { properties: propertiesTable } = modelSchemaMod;
|
|
2010
2010
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2410,8 +2410,8 @@ async function importSchema(importFilePathOrContents, version, options) {
|
|
|
2410
2410
|
// Check DB for existing schema by name+version (same as minimal path)
|
|
2411
2411
|
const db = BaseDb.getAppDb();
|
|
2412
2412
|
if (db) {
|
|
2413
|
-
const _mod_2 = await import('./index-
|
|
2414
|
-
const _ns_2 = _mod_2.
|
|
2413
|
+
const _mod_2 = await import('./index-C0SetTd1.js');
|
|
2414
|
+
const _ns_2 = _mod_2.bl;
|
|
2415
2415
|
const schemaSchemaMod = _ns_2;
|
|
2416
2416
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
2417
2417
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2502,8 +2502,8 @@ async function importSchema(importFilePathOrContents, version, options) {
|
|
|
2502
2502
|
// For minimal imports: check DB for existing schema before creating new file
|
|
2503
2503
|
const db = BaseDb.getAppDb();
|
|
2504
2504
|
if (db) {
|
|
2505
|
-
const _mod_3 = await import('./index-
|
|
2506
|
-
const _ns_3 = _mod_3.
|
|
2505
|
+
const _mod_3 = await import('./index-C0SetTd1.js');
|
|
2506
|
+
const _ns_3 = _mod_3.bl;
|
|
2507
2507
|
const schemaSchemaMod = _ns_3;
|
|
2508
2508
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
2509
2509
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2685,8 +2685,8 @@ async function importSchema(importFilePathOrContents, version, options) {
|
|
|
2685
2685
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
2686
2686
|
};
|
|
2687
2687
|
// Use dynamic import to break circular dependency
|
|
2688
|
-
const _mod_4 = await import('./index-
|
|
2689
|
-
const _ns_4 = _mod_4.
|
|
2688
|
+
const _mod_4 = await import('./index-C0SetTd1.js');
|
|
2689
|
+
const _ns_4 = _mod_4.bo;
|
|
2690
2690
|
const dbMod = _ns_4;
|
|
2691
2691
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
2692
2692
|
// Try to add schema and models to database if database is available
|
|
@@ -2707,12 +2707,12 @@ async function importSchema(importFilePathOrContents, version, options) {
|
|
|
2707
2707
|
});
|
|
2708
2708
|
// Verify expected models are linked (single attempt - addModelsToDb already confirmed)
|
|
2709
2709
|
const expectedModelNames = Object.keys(schemaFile.models || {});
|
|
2710
|
-
const _mod_5 = await import('./index-
|
|
2711
|
-
const _ns_5 = _mod_5.
|
|
2710
|
+
const _mod_5 = await import('./index-C0SetTd1.js');
|
|
2711
|
+
const _ns_5 = _mod_5.bm;
|
|
2712
2712
|
const modelSchemaSchemaMod = _ns_5;
|
|
2713
2713
|
const { modelSchemas } = modelSchemaSchemaMod;
|
|
2714
|
-
const _mod_6 = await import('./index-
|
|
2715
|
-
const _ns_6 = _mod_6.
|
|
2714
|
+
const _mod_6 = await import('./index-C0SetTd1.js');
|
|
2715
|
+
const _ns_6 = _mod_6.bj;
|
|
2716
2716
|
const modelSchemaMod = _ns_6;
|
|
2717
2717
|
const { models: modelsTable } = modelSchemaMod;
|
|
2718
2718
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2913,8 +2913,8 @@ async function applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, prope
|
|
|
2913
2913
|
createdAt: new Date(schemaFile.metadata.createdAt).getTime(),
|
|
2914
2914
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
2915
2915
|
};
|
|
2916
|
-
const _mod_7 = await import('./index-
|
|
2917
|
-
const _ns_7 = _mod_7.
|
|
2916
|
+
const _mod_7 = await import('./index-C0SetTd1.js');
|
|
2917
|
+
const _ns_7 = _mod_7.bo;
|
|
2918
2918
|
const dbMod = _ns_7;
|
|
2919
2919
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
2920
2920
|
const db = BaseDb.getAppDb();
|
|
@@ -2945,8 +2945,8 @@ async function applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, prope
|
|
|
2945
2945
|
* draft (its edits aren't the app's to undo) or a newer version than schemaFile.
|
|
2946
2946
|
*/
|
|
2947
2947
|
async function getModelsDroppedFromStoredSchema(db, schemaFile) {
|
|
2948
|
-
const _mod_8 = await import('./index-
|
|
2949
|
-
const _ns_8 = _mod_8.
|
|
2948
|
+
const _mod_8 = await import('./index-C0SetTd1.js');
|
|
2949
|
+
const _ns_8 = _mod_8.bl;
|
|
2950
2950
|
const { schemas: schemasTable } = _ns_8;
|
|
2951
2951
|
const { eq } = await import('drizzle-orm');
|
|
2952
2952
|
const rows = await db
|
|
@@ -2973,11 +2973,11 @@ async function getModelsDroppedFromStoredSchema(db, schemaFile) {
|
|
|
2973
2973
|
}
|
|
2974
2974
|
/** Delete the model_schemas rows linking the named models to the schema. The models and their items stay. */
|
|
2975
2975
|
async function unlinkModelsFromSchema(db, schemaId, modelNames) {
|
|
2976
|
-
const _mod_9 = await import('./index-
|
|
2977
|
-
const _ns_9 = _mod_9.
|
|
2976
|
+
const _mod_9 = await import('./index-C0SetTd1.js');
|
|
2977
|
+
const _ns_9 = _mod_9.bm;
|
|
2978
2978
|
const { modelSchemas } = _ns_9;
|
|
2979
|
-
const _mod_10 = await import('./index-
|
|
2980
|
-
const _ns_10 = _mod_10.
|
|
2979
|
+
const _mod_10 = await import('./index-C0SetTd1.js');
|
|
2980
|
+
const _ns_10 = _mod_10.bj;
|
|
2981
2981
|
const { models: modelsTable } = _ns_10;
|
|
2982
2982
|
const { and, eq, inArray } = await import('drizzle-orm');
|
|
2983
2983
|
const links = await db
|
|
@@ -3139,12 +3139,12 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
3139
3139
|
]));
|
|
3140
3140
|
const { schemaRecord } = await applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, propertyFileIds, propertyDefinitions).finally(rowsWritten.settle);
|
|
3141
3141
|
// Query the database to get model IDs that were just created
|
|
3142
|
-
const _mod_11 = await import('./index-
|
|
3143
|
-
const _ns_11 = _mod_11.
|
|
3142
|
+
const _mod_11 = await import('./index-C0SetTd1.js');
|
|
3143
|
+
const _ns_11 = _mod_11.bm;
|
|
3144
3144
|
const modelSchemaSchemaMod = _ns_11;
|
|
3145
3145
|
const { modelSchemas } = modelSchemaSchemaMod;
|
|
3146
|
-
const _mod_12 = await import('./index-
|
|
3147
|
-
const _ns_12 = _mod_12.
|
|
3146
|
+
const _mod_12 = await import('./index-C0SetTd1.js');
|
|
3147
|
+
const _ns_12 = _mod_12.bj;
|
|
3148
3148
|
const modelSchemaMod = _ns_12;
|
|
3149
3149
|
const { models: modelsTable } = modelSchemaMod;
|
|
3150
3150
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -3209,8 +3209,8 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
3209
3209
|
// After properties are created (file path), ensure schemaFile has the correct IDs from database
|
|
3210
3210
|
// Query the database to get the actual schemaFileId values that were used
|
|
3211
3211
|
// This ensures schemaData matches what's actually in the database
|
|
3212
|
-
const _mod_13 = await import('./index-
|
|
3213
|
-
const _ns_13 = _mod_13.
|
|
3212
|
+
const _mod_13 = await import('./index-C0SetTd1.js');
|
|
3213
|
+
const _ns_13 = _mod_13.bj;
|
|
3214
3214
|
const modelSchemaMod2 = _ns_13;
|
|
3215
3215
|
const { properties: propertiesTable } = modelSchemaMod2;
|
|
3216
3216
|
let schemaFileUpdated = false;
|
|
@@ -3245,8 +3245,8 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
3245
3245
|
// This is important even if nothing changed, to ensure consistency
|
|
3246
3246
|
const updatedSchemaData = JSON.stringify(schemaFile, null, 2);
|
|
3247
3247
|
// Update the schema record in the database with current schemaData
|
|
3248
|
-
const _mod_14 = await import('./index-
|
|
3249
|
-
const _ns_14 = _mod_14.
|
|
3248
|
+
const _mod_14 = await import('./index-C0SetTd1.js');
|
|
3249
|
+
const _ns_14 = _mod_14.bl;
|
|
3250
3250
|
const schemaSchemaMod = _ns_14;
|
|
3251
3251
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
3252
3252
|
await db
|
|
@@ -3372,7 +3372,7 @@ const createRowsWrittenSignal = () => {
|
|
|
3372
3372
|
const createModelFromJson = async (modelName, modelDef, schemaName, modelFileId, // Optional modelFileId from JSON file
|
|
3373
3373
|
propertyFileIds, // Optional map of property names to their file IDs from the JSON file
|
|
3374
3374
|
persistedBy) => {
|
|
3375
|
-
const _mod_15 = await import('./errors-
|
|
3375
|
+
const _mod_15 = await import('./errors-rIWK7gwJ.js');
|
|
3376
3376
|
const _ns_15 = _mod_15.i;
|
|
3377
3377
|
const modelMod = _ns_15;
|
|
3378
3378
|
const { Model } = modelMod;
|
|
@@ -4711,7 +4711,6 @@ const createVersion = async ({ seedLocalId, seedUid, seedType, uid, }, options =
|
|
|
4711
4711
|
const publisher = await getSeedPublisher(seedLocalId, appDb);
|
|
4712
4712
|
await appDb.insert(versions).values({
|
|
4713
4713
|
localId: newVersionLocalId,
|
|
4714
|
-
createdAt: Date.now(),
|
|
4715
4714
|
seedLocalId,
|
|
4716
4715
|
seedUid: seedUid ?? null,
|
|
4717
4716
|
seedType,
|
|
@@ -4890,7 +4889,7 @@ async function keepLocalDraftsOverSyncedRows(synced) {
|
|
|
4890
4889
|
if (remoteAt >= (draft.createdAt ?? 0)) {
|
|
4891
4890
|
await db
|
|
4892
4891
|
.update(metadata$1)
|
|
4893
|
-
.set({ createdAt: remoteAt + 1
|
|
4892
|
+
.set({ createdAt: remoteAt + 1 })
|
|
4894
4893
|
.where(eq(metadata$1.localId, draft.localId));
|
|
4895
4894
|
}
|
|
4896
4895
|
// The attested value the draft replaced: the newest attested row that sync didn't just write
|
|
@@ -5037,7 +5036,6 @@ async function applyItemStorageValue(seedLocalId, propertyName, op, db) {
|
|
|
5037
5036
|
localStorageDir,
|
|
5038
5037
|
// The draft is as new as its content (see updateItemPropertyValue).
|
|
5039
5038
|
createdAt: now,
|
|
5040
|
-
updatedAt: now,
|
|
5041
5039
|
// Same shape as a row the migration or publish converted (convertVerbatimItemStorageRow).
|
|
5042
5040
|
...(clearsVerbatimValue && { propertyValue: null, refValueType: 'file' }),
|
|
5043
5041
|
})
|
|
@@ -6160,11 +6158,10 @@ async function claimUnpublishedDrafts(publisher) {
|
|
|
6160
6158
|
return emptyResult();
|
|
6161
6159
|
if (!BaseDb.getAppDb())
|
|
6162
6160
|
return emptyResult();
|
|
6163
|
-
const now = Date.now();
|
|
6164
6161
|
const isClaimable = (row) => typeof row.localId === 'string' && row.localId !== '' && isLocalUnsealedDraft(row);
|
|
6165
6162
|
return BaseDb.transaction(async (tx) => {
|
|
6166
6163
|
const stamp = async (table, ids) => {
|
|
6167
|
-
await writeInBatches(ids, (chunk) => tx.update(table).set({ publisher: normalized
|
|
6164
|
+
await writeInBatches(ids, (chunk) => tx.update(table).set({ publisher: normalized }).where(inArray(table.localId, chunk)));
|
|
6168
6165
|
};
|
|
6169
6166
|
const pendingCreateIds = await claimPendingCreates(tx, normalized);
|
|
6170
6167
|
const seedRows = (await tx
|
|
@@ -6543,4 +6540,4 @@ var ClientManager$1 = /*#__PURE__*/Object.freeze({
|
|
|
6543
6540
|
});
|
|
6544
6541
|
|
|
6545
6542
|
export { ClientManager$1 as $, getPublishedSeedRecord as A, getSchemaNameFromId as B, ClientManager as C, isSeedQueryLocalSourceRegistered as D, EAS_CHAIN_ID_APP_STATE_KEY as E, listCompleteSchemaFiles as F, loadAllSchemasFromDb as G, mergeEasSyncRequestIntents as H, INIT_CONFIG_CONFLICT_MESSAGE as I, readSchema as J, registerSeedQueryLocalSource as K, requestEasSyncFromAddressChange as L, requestEasSyncFromEventBus as M, requestEasSyncFromModelsInit as N, sendEasSyncClientRequest as O, setRetriesWhenOnlineEnabled as P, startEasSyncActor as Q, RelationTargetError as R, unregisterSeedQueryLocalSource as S, createRowsWrittenSignal as T, createModelsFromJson as U, getLatestSchemaVersion as V, jsonPropertiesToSchemaProperties as W, schema as X, SEEDPROTOCOL_Seed_Protocol_v1 as Y, conflicts as Z, itemAppliers as _, applyCreateItem as a, applyDelete as b, applyItemStorageValue as c, deleteFiles as d, applyStorageValue as e, getPropertyConflict as f, getItemConflicts as g, getRefValueType as h, importJsonSchema as i, syncSchemaFromSource as j, transformImportToSchemaFile as k, loadSchemaFromFile as l, markPropertyConflictsResolved as m, getContentHash as n, isVerbatimItemStorageDraftRow as o, convertVerbatimItemStorageRow as p, assertLocalDbChain as q, readJsonImportFile as r, startItemOutbox as s, throwItemWriteError as t, claimUnpublishedDrafts as u, createLocalQueryDataSource as v, waitForEasReadChain as w, createSchema as x, easSyncActor as y, getClient as z };
|
|
6546
|
-
//# sourceMappingURL=ClientManager-
|
|
6543
|
+
//# sourceMappingURL=ClientManager-B1r_8P5Z.js.map
|