@seedprotocol/sdk 0.7.8-next.1071.g2a141c1 → 0.7.8
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,16 +1,16 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import { w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-
|
|
3
|
-
import {
|
|
2
|
+
import { w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-rIWK7gwJ.js';
|
|
3
|
+
import { G as BaseDb, t as models, w as properties, B as schemas, r as modelSchemas, an as getModelIdByFileId, n as normalizeDataType, aj as generateId, M as ModelPropertyDataTypes, Q as BaseFileManager, ao as getModelId, ap as setCachedPropertyRefresher } from './index-C0SetTd1.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import '@seedprotocol/eas';
|
|
6
6
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
7
7
|
import { modelPropertiesToObject } from './model-oHA3YhOd.js';
|
|
8
|
-
import { P as isActorStopped, Q as DEFAULT_READY_TIMEOUT_MS, C as waitForEntityIdle, R as createReactiveProxy, S as sameEntity, T as findEntity, U as forceRemoveFromCaches, V as runDestroyLifecycle } from './Item-
|
|
8
|
+
import { P as isActorStopped, Q as DEFAULT_READY_TIMEOUT_MS, C as waitForEntityIdle, R as createReactiveProxy, S as sameEntity, T as findEntity, U as forceRemoveFromCaches, V as runDestroyLifecycle } from './Item-CjTEShfk.js';
|
|
9
9
|
import debug from 'debug';
|
|
10
|
-
import { S as Schema } from './Schema-
|
|
11
|
-
import './ClientManager-
|
|
10
|
+
import { S as Schema } from './Schema-CX9CTtho.js';
|
|
11
|
+
import './ClientManager-B1r_8P5Z.js';
|
|
12
12
|
import 'lodash-es';
|
|
13
|
-
import './
|
|
13
|
+
import './changeFeed-DcsZ7deG.js';
|
|
14
14
|
import '@seedprotocol/arweave';
|
|
15
15
|
import '@noble/hashes/sha3';
|
|
16
16
|
import '@noble/hashes/utils';
|
|
@@ -21,7 +21,7 @@ import 'nanoid';
|
|
|
21
21
|
import 'nanoid-dictionary';
|
|
22
22
|
import '@noble/hashes/sha256';
|
|
23
23
|
import 'rxjs';
|
|
24
|
-
import './SchemaValidationService-
|
|
24
|
+
import './SchemaValidationService-T5mqnY8q.js';
|
|
25
25
|
import '@sinclair/typebox/value';
|
|
26
26
|
|
|
27
27
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
@@ -32,15 +32,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
32
32
|
*/
|
|
33
33
|
async function getSchemaNameFromModel(modelName) {
|
|
34
34
|
// Get the latest schema files and find which one contains this model
|
|
35
|
-
const _mod_0 = await import('./ClientManager-
|
|
35
|
+
const _mod_0 = await import('./ClientManager-B1r_8P5Z.js');
|
|
36
36
|
const _ns_0 = _mod_0.X;
|
|
37
37
|
const schemaHelpersMod = _ns_0;
|
|
38
38
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
39
39
|
const latestSchemas = await listLatestSchemaFiles();
|
|
40
40
|
for (const schema of latestSchemas) {
|
|
41
41
|
try {
|
|
42
|
-
const _mod_1 = await import('./index-
|
|
43
|
-
const _ns_1 = _mod_1.
|
|
42
|
+
const _mod_1 = await import('./index-C0SetTd1.js');
|
|
43
|
+
const _ns_1 = _mod_1.bk;
|
|
44
44
|
const fileManagerMod = _ns_1;
|
|
45
45
|
const { BaseFileManager } = fileManagerMod;
|
|
46
46
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
@@ -59,7 +59,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
59
59
|
const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
60
60
|
const _saveToSchema = async () => {
|
|
61
61
|
// Use dynamic import to break circular dependency
|
|
62
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
62
|
+
const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
|
|
63
63
|
const { SchemaValidationService } = validationServiceMod;
|
|
64
64
|
const validationService = new SchemaValidationService();
|
|
65
65
|
// Validate property structure before saving
|
|
@@ -78,15 +78,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
|
78
78
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
79
79
|
}
|
|
80
80
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
81
|
-
const _mod_2 = await import('./index-
|
|
82
|
-
const _ns_2 = _mod_2.
|
|
81
|
+
const _mod_2 = await import('./index-C0SetTd1.js');
|
|
82
|
+
const _ns_2 = _mod_2.bo;
|
|
83
83
|
const dbMod = _ns_2;
|
|
84
84
|
const { savePropertyToDb } = dbMod;
|
|
85
85
|
await savePropertyToDb(context);
|
|
86
86
|
// Mark schema as draft so user knows to save
|
|
87
87
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
88
88
|
if (schemaName) {
|
|
89
|
-
const _mod_3 = await import('./Schema-
|
|
89
|
+
const _mod_3 = await import('./Schema-CX9CTtho.js');
|
|
90
90
|
const _ns_3 = _mod_3.b;
|
|
91
91
|
const schemaMod = _ns_3;
|
|
92
92
|
const { Schema } = schemaMod;
|
|
@@ -124,8 +124,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
124
124
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
125
125
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
126
126
|
try {
|
|
127
|
-
const _mod_4 = await import('./index-
|
|
128
|
-
const _ns_4 = _mod_4.
|
|
127
|
+
const _mod_4 = await import('./index-C0SetTd1.js');
|
|
128
|
+
const _ns_4 = _mod_4.bo;
|
|
129
129
|
const dbMod = _ns_4;
|
|
130
130
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
131
131
|
let fromDb;
|
|
@@ -171,8 +171,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
171
171
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
172
172
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
173
173
|
try {
|
|
174
|
-
const _mod_5 = await import('./index-
|
|
175
|
-
const _ns_5 = _mod_5.
|
|
174
|
+
const _mod_5 = await import('./index-C0SetTd1.js');
|
|
175
|
+
const _ns_5 = _mod_5.bo;
|
|
176
176
|
const dbMod = _ns_5;
|
|
177
177
|
const { savePropertyToDb } = dbMod;
|
|
178
178
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
@@ -233,8 +233,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
233
233
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
234
234
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
235
235
|
// Use dynamic import to break circular dependency
|
|
236
|
-
const _mod_6 = await import('./index-
|
|
237
|
-
const _ns_6 = _mod_6.
|
|
236
|
+
const _mod_6 = await import('./index-C0SetTd1.js');
|
|
237
|
+
const _ns_6 = _mod_6.bo;
|
|
238
238
|
const dbMod = _ns_6;
|
|
239
239
|
const { savePropertyToDb } = dbMod;
|
|
240
240
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
@@ -249,7 +249,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
249
249
|
// Mark schema as draft if schema name is available
|
|
250
250
|
if (fullContext._schemaName) {
|
|
251
251
|
// Get the Schema instance and mark it as draft
|
|
252
|
-
const _mod_7 = await import('./Schema-
|
|
252
|
+
const _mod_7 = await import('./Schema-CX9CTtho.js');
|
|
253
253
|
const _ns_7 = _mod_7.b;
|
|
254
254
|
const schemaMod = _ns_7;
|
|
255
255
|
const { Schema } = schemaMod;
|
|
@@ -269,7 +269,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
269
269
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
270
270
|
// Clear isEdited flag in database
|
|
271
271
|
try {
|
|
272
|
-
const _mod_8 = await import('./index-
|
|
272
|
+
const _mod_8 = await import('./index-CZQrNqvq.js');
|
|
273
273
|
const _ns_8 = _mod_8.s;
|
|
274
274
|
const seedSchemaMod = _ns_8;
|
|
275
275
|
const { properties: propertiesTable } = seedSchemaMod;
|
|
@@ -278,8 +278,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
278
278
|
const db = BaseDb.getAppDb();
|
|
279
279
|
if (db && fullContext.modelName && fullContext.name) {
|
|
280
280
|
// Find this property's model (model names are only unique per schema)
|
|
281
|
-
const _mod_9 = await import('./index-
|
|
282
|
-
const _ns_9 = _mod_9.
|
|
281
|
+
const _mod_9 = await import('./index-C0SetTd1.js');
|
|
282
|
+
const _ns_9 = _mod_9.bn;
|
|
283
283
|
const { resolveModelRecord } = _ns_9;
|
|
284
284
|
const modelRecord = await resolveModelRecord(fullContext.modelName, {
|
|
285
285
|
modelId: typeof fullContext.modelId === 'number' ? fullContext.modelId : undefined,
|
|
@@ -338,8 +338,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
338
338
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
339
339
|
await new Promise((r) => setTimeout(r, 60));
|
|
340
340
|
try {
|
|
341
|
-
const _mod_10 = await import('./index-
|
|
342
|
-
const _ns_10 = _mod_10.
|
|
341
|
+
const _mod_10 = await import('./index-C0SetTd1.js');
|
|
342
|
+
const _ns_10 = _mod_10.bo;
|
|
343
343
|
const dbMod = _ns_10;
|
|
344
344
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
345
345
|
// Try pending write first (property row may not exist yet)
|
|
@@ -392,10 +392,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
392
392
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
393
393
|
}
|
|
394
394
|
// Use dynamic imports to break circular dependencies
|
|
395
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
395
|
+
const validationServiceMod = await import('./SchemaValidationService-T5mqnY8q.js');
|
|
396
396
|
const { SchemaValidationService } = validationServiceMod;
|
|
397
397
|
const validationService = new SchemaValidationService();
|
|
398
|
-
const _mod_11 = await import('./Schema-
|
|
398
|
+
const _mod_11 = await import('./Schema-CX9CTtho.js');
|
|
399
399
|
const _ns_11 = _mod_11.b;
|
|
400
400
|
const schemaMod = _ns_11;
|
|
401
401
|
const { Schema } = schemaMod;
|
|
@@ -1023,8 +1023,8 @@ class ModelProperty {
|
|
|
1023
1023
|
return fallbackIsEdited;
|
|
1024
1024
|
}
|
|
1025
1025
|
// Find this property's model (by modelId when known; model names are only unique per schema)
|
|
1026
|
-
const _mod_12 = await import('./index-
|
|
1027
|
-
const _ns_12 = _mod_12.
|
|
1026
|
+
const _mod_12 = await import('./index-C0SetTd1.js');
|
|
1027
|
+
const _ns_12 = _mod_12.bn;
|
|
1028
1028
|
const { resolveModelRecord } = _ns_12;
|
|
1029
1029
|
const modelRecord = await resolveModelRecord(property.modelName, this._ownerModelScope(property), db);
|
|
1030
1030
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
@@ -1061,8 +1061,8 @@ class ModelProperty {
|
|
|
1061
1061
|
return undefined;
|
|
1062
1062
|
}
|
|
1063
1063
|
// Resolve the ref within the owning model's schema
|
|
1064
|
-
const _mod_13 = await import('./index-
|
|
1065
|
-
const _ns_13 = _mod_13.
|
|
1064
|
+
const _mod_13 = await import('./index-C0SetTd1.js');
|
|
1065
|
+
const _ns_13 = _mod_13.bn;
|
|
1066
1066
|
const { resolveRefModelRecord } = _ns_13;
|
|
1067
1067
|
const refModelRecord = await resolveRefModelRecord(refModelName, property ? this._ownerModelScope(property) : { schemaName: this._getSnapshotContext()._schemaName }, db);
|
|
1068
1068
|
if (refModelRecord?.id) {
|
|
@@ -1107,8 +1107,8 @@ class ModelProperty {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
if (!model && modelId) {
|
|
1110
|
-
const _mod_14 = await import('./index-
|
|
1111
|
-
const _ns_14 = _mod_14.
|
|
1110
|
+
const _mod_14 = await import('./index-C0SetTd1.js');
|
|
1111
|
+
const _ns_14 = _mod_14.bn;
|
|
1112
1112
|
const { resolveModelRecord } = _ns_14;
|
|
1113
1113
|
const modelFileId = (await resolveModelRecord(property.modelName, { modelId }))?.schemaFileId;
|
|
1114
1114
|
model = modelFileId ? Model.peek(modelFileId) : undefined;
|
|
@@ -2107,7 +2107,7 @@ class ModelProperty {
|
|
|
2107
2107
|
.where(and(eq(schemas.name, schemaName), eq(models.name, modelName), eq(properties.name, propertyName)))
|
|
2108
2108
|
.limit(1);
|
|
2109
2109
|
if (propertyRecords.length > 0 && propertyRecords[0].propertyId != null) {
|
|
2110
|
-
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-
|
|
2110
|
+
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-Bo_pky-R.js');
|
|
2111
2111
|
await detachPropertyRows(db, [propertyRecords[0].propertyId]);
|
|
2112
2112
|
await db
|
|
2113
2113
|
.delete(properties)
|
|
@@ -2156,4 +2156,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
2156
2156
|
});
|
|
2157
2157
|
|
|
2158
2158
|
export { ModelProperty };
|
|
2159
|
-
//# sourceMappingURL=ModelProperty-
|
|
2159
|
+
//# sourceMappingURL=ModelProperty-C3749Wjq.js.map
|