@seedprotocol/sdk 0.7.7 → 0.7.8-next.1034.g2acd2a2

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.
Files changed (195) hide show
  1. package/dist/{ClientManager-2GtDWHq6.js → ClientManager-DBKvmJov.js} +64 -36
  2. package/dist/ClientManager-DBKvmJov.js.map +1 -0
  3. package/dist/{Item-D6j0IvBP.js → Item-BiMHgg-_.js} +539 -486
  4. package/dist/Item-BiMHgg-_.js.map +1 -0
  5. package/dist/{ModelProperty-B52C3CQ2.js → ModelProperty-C1Fzcnbm.js} +50 -51
  6. package/dist/ModelProperty-C1Fzcnbm.js.map +1 -0
  7. package/dist/{Schema-O1QLoXv6.js → Schema-COTbavcm.js} +97 -82
  8. package/dist/Schema-COTbavcm.js.map +1 -0
  9. package/dist/{SchemaValidationService-BxCbfDaI.js → SchemaValidationService-paOfbcwd.js} +6 -6
  10. package/dist/{SchemaValidationService-BxCbfDaI.js.map → SchemaValidationService-paOfbcwd.js.map} +1 -1
  11. package/dist/{backfillMetadataPropertyIds-CzSbuucw.js → backfillMetadataPropertyIds-BkpBahbz.js} +3 -3
  12. package/dist/{backfillMetadataPropertyIds-CzSbuucw.js.map → backfillMetadataPropertyIds-BkpBahbz.js.map} +1 -1
  13. package/dist/{configurePlatform-Bbpw_R4y.js → configurePlatform-_XR45RnJ.js} +2 -2
  14. package/dist/{configurePlatform-Bbpw_R4y.js.map → configurePlatform-_XR45RnJ.js.map} +1 -1
  15. package/dist/{detachRowsBeforeDelete-D1TyEMco.js → detachRowsBeforeDelete-C1iapUFl.js} +2 -2
  16. package/dist/{detachRowsBeforeDelete-D1TyEMco.js.map → detachRowsBeforeDelete-C1iapUFl.js.map} +1 -1
  17. package/dist/{discardNewDraft-hiVaUVjV.js → discardNewDraft-D4nrwp3T.js} +5 -5
  18. package/dist/{discardNewDraft-hiVaUVjV.js.map → discardNewDraft-D4nrwp3T.js.map} +1 -1
  19. package/dist/dist/{ClientManager-2GtDWHq6.d.ts → ClientManager-DBKvmJov.d.ts} +20 -1
  20. package/dist/dist/ClientManager-DBKvmJov.d.ts.map +1 -0
  21. package/dist/dist/{Item-D6j0IvBP.d.ts → Item-BiMHgg-_.d.ts} +146 -85
  22. package/dist/dist/Item-BiMHgg-_.d.ts.map +1 -0
  23. package/dist/dist/{ModelProperty-B52C3CQ2.d.ts → ModelProperty-C1Fzcnbm.d.ts} +1 -1
  24. package/dist/dist/{ModelProperty-B52C3CQ2.d.ts.map → ModelProperty-C1Fzcnbm.d.ts.map} +1 -1
  25. package/dist/dist/{Schema-O1QLoXv6.d.ts → Schema-COTbavcm.d.ts} +11 -4
  26. package/dist/dist/Schema-COTbavcm.d.ts.map +1 -0
  27. package/dist/dist/{SchemaValidationService-BxCbfDaI.d.ts → SchemaValidationService-paOfbcwd.d.ts} +1 -1
  28. package/dist/dist/{SchemaValidationService-BxCbfDaI.d.ts.map → SchemaValidationService-paOfbcwd.d.ts.map} +1 -1
  29. package/dist/dist/{backfillMetadataPropertyIds-CzSbuucw.d.ts → backfillMetadataPropertyIds-BkpBahbz.d.ts} +1 -1
  30. package/dist/dist/backfillMetadataPropertyIds-BkpBahbz.d.ts.map +1 -0
  31. package/dist/dist/{configurePlatform-Bbpw_R4y.d.ts → configurePlatform-_XR45RnJ.d.ts} +1 -1
  32. package/dist/dist/configurePlatform-_XR45RnJ.d.ts.map +1 -0
  33. package/dist/dist/{detachRowsBeforeDelete-D1TyEMco.d.ts → detachRowsBeforeDelete-C1iapUFl.d.ts} +1 -1
  34. package/dist/dist/detachRowsBeforeDelete-C1iapUFl.d.ts.map +1 -0
  35. package/dist/dist/{discardNewDraft-hiVaUVjV.d.ts → discardNewDraft-D4nrwp3T.d.ts} +1 -1
  36. package/dist/dist/discardNewDraft-D4nrwp3T.d.ts.map +1 -0
  37. package/dist/dist/{eas-DOdj-EMK.d.ts → eas-BRVEGT97.d.ts} +1 -1
  38. package/dist/dist/eas-BRVEGT97.d.ts.map +1 -0
  39. package/dist/dist/{errors-KM-yq2MD.d.ts → errors-CQagdED2.d.ts} +39 -24
  40. package/dist/dist/errors-CQagdED2.d.ts.map +1 -0
  41. package/dist/dist/{getItem-Bh0zv-o1.d.ts → getItem-Jpr1SKIL.d.ts} +1 -1
  42. package/dist/dist/getItem-Jpr1SKIL.d.ts.map +1 -0
  43. package/dist/dist/{getPublishPayload-oH8wJhnH.d.ts → getPublishPayload-Bmeqtq4l.d.ts} +1 -1
  44. package/dist/dist/{getPublishPayload-oH8wJhnH.d.ts.map → getPublishPayload-Bmeqtq4l.d.ts.map} +1 -1
  45. package/dist/dist/{getPublishUploads-Cex-NBe6.d.ts → getPublishUploads-7nW1kMZV.d.ts} +1 -1
  46. package/dist/dist/{getPublishUploads-Cex-NBe6.d.ts.map → getPublishUploads-7nW1kMZV.d.ts.map} +1 -1
  47. package/dist/dist/{index-BbFwftAv.d.ts → index-3_hGVu7v.d.ts} +1 -1
  48. package/dist/dist/{index-BbFwftAv.d.ts.map → index-3_hGVu7v.d.ts.map} +1 -1
  49. package/dist/dist/{index-DpgQMIRq.d.ts → index-C-NqjjY_.d.ts} +11 -5
  50. package/dist/dist/index-C-NqjjY_.d.ts.map +1 -0
  51. package/dist/dist/{index-BAao3_Po.d.ts → index-DM3zrNtX.d.ts} +5 -5
  52. package/dist/dist/index-DM3zrNtX.d.ts.map +1 -0
  53. package/dist/dist/{index.browser-nndbVM7z.d.ts → index.browser-DGoOSs1J.d.ts} +1 -1
  54. package/dist/dist/{index.browser-nndbVM7z.d.ts.map → index.browser-DGoOSs1J.d.ts.map} +1 -1
  55. package/dist/dist/{index.node-BUfx-JaP.d.ts → index.node-CTv62R2a.d.ts} +1 -1
  56. package/dist/dist/{index.node-BUfx-JaP.d.ts.map → index.node-CTv62R2a.d.ts.map} +1 -1
  57. package/dist/dist/platform.browser.d.ts +2 -2
  58. package/dist/dist/platform.node.d.ts +2 -2
  59. package/dist/dist/{property-BDBvImLs.d.ts → property-DaUy4XMe.d.ts} +3 -3
  60. package/dist/dist/property-DaUy4XMe.d.ts.map +1 -0
  61. package/dist/dist/{propertyValidationRules-BlfLn4rP.d.ts → propertyValidationRules-DbbWvBzj.d.ts} +1 -1
  62. package/dist/dist/propertyValidationRules-DbbWvBzj.d.ts.map +1 -0
  63. package/dist/dist/{publishDraftGraph-CLO85LLz.d.ts → publishDraftGraph-CCa6EzeO.d.ts} +1 -1
  64. package/dist/dist/{publishDraftGraph-CLO85LLz.d.ts.map → publishDraftGraph-CCa6EzeO.d.ts.map} +1 -1
  65. package/dist/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.d.ts → resetAmbiguousLegacyItemData--PN1v53N.d.ts} +1 -1
  66. package/dist/dist/resetAmbiguousLegacyItemData--PN1v53N.d.ts.map +1 -0
  67. package/dist/dist/{resolveModelForSyncedSeed-DFr4COc4.d.ts → resolveModelForSyncedSeed-VDzkS6Rs.d.ts} +1 -1
  68. package/dist/dist/resolveModelForSyncedSeed-VDzkS6Rs.d.ts.map +1 -0
  69. package/dist/dist/{syncDbWithEas-CAOlw3i-.d.ts → syncDbWithEas-D0gyJ58h.d.ts} +1 -1
  70. package/dist/dist/syncDbWithEas-D0gyJ58h.d.ts.map +1 -0
  71. package/dist/dist/{tabEvents-DksXwk3X.d.ts → tabEvents-UH-wNsZC.d.ts} +7 -4
  72. package/dist/dist/tabEvents-UH-wNsZC.d.ts.map +1 -0
  73. package/dist/dist/{tolerantWebAccess-CEIjFGf0.d.ts → tolerantWebAccess-CpcTCAZv.d.ts} +1 -1
  74. package/dist/dist/{tolerantWebAccess-CEIjFGf0.d.ts.map → tolerantWebAccess-CpcTCAZv.d.ts.map} +1 -1
  75. package/dist/dist/{updateSeedRevokedAt-Cjr35YjE.d.ts → updateSeedRevokedAt-D230zfWk.d.ts} +1 -1
  76. package/dist/dist/updateSeedRevokedAt-D230zfWk.d.ts.map +1 -0
  77. package/dist/{eas-DOdj-EMK.js → eas-BRVEGT97.js} +4 -4
  78. package/dist/{eas-DOdj-EMK.js.map → eas-BRVEGT97.js.map} +1 -1
  79. package/dist/{errors-KM-yq2MD.js → errors-CQagdED2.js} +222 -275
  80. package/dist/errors-CQagdED2.js.map +1 -0
  81. package/dist/{getItem-Bh0zv-o1.js → getItem-Jpr1SKIL.js} +4 -4
  82. package/dist/{getItem-Bh0zv-o1.js.map → getItem-Jpr1SKIL.js.map} +1 -1
  83. package/dist/{getPublishPayload-oH8wJhnH.js → getPublishPayload-Bmeqtq4l.js} +15 -15
  84. package/dist/{getPublishPayload-oH8wJhnH.js.map → getPublishPayload-Bmeqtq4l.js.map} +1 -1
  85. package/dist/{getPublishUploads-Cex-NBe6.js → getPublishUploads-7nW1kMZV.js} +6 -6
  86. package/dist/{getPublishUploads-Cex-NBe6.js.map → getPublishUploads-7nW1kMZV.js.map} +1 -1
  87. package/dist/{index-BbFwftAv.js → index-3_hGVu7v.js} +2 -2
  88. package/dist/index-3_hGVu7v.js.map +1 -0
  89. package/dist/{index-DpgQMIRq.js → index-C-NqjjY_.js} +18 -3
  90. package/dist/index-C-NqjjY_.js.map +1 -0
  91. package/dist/{index-BAao3_Po.js → index-DM3zrNtX.js} +8 -8
  92. package/dist/index-DM3zrNtX.js.map +1 -0
  93. package/dist/{index.browser-nndbVM7z.js → index.browser-DGoOSs1J.js} +27 -18
  94. package/dist/index.browser-DGoOSs1J.js.map +1 -0
  95. package/dist/{index.node-BUfx-JaP.js → index.node-CTv62R2a.js} +6 -6
  96. package/dist/{index.node-BUfx-JaP.js.map → index.node-CTv62R2a.js.map} +1 -1
  97. package/dist/main.js +24 -24
  98. package/dist/node.js +11 -11
  99. package/dist/platform.browser.js +5 -5
  100. package/dist/platform.node.js +4 -4
  101. package/dist/{property-BDBvImLs.js → property-DaUy4XMe.js} +9 -11
  102. package/dist/property-DaUy4XMe.js.map +1 -0
  103. package/dist/{propertyValidationRules-BlfLn4rP.js → propertyValidationRules-DbbWvBzj.js} +10 -10
  104. package/dist/{propertyValidationRules-BlfLn4rP.js.map → propertyValidationRules-DbbWvBzj.js.map} +1 -1
  105. package/dist/{publishDraftGraph-CLO85LLz.js → publishDraftGraph-CCa6EzeO.js} +6 -6
  106. package/dist/{publishDraftGraph-CLO85LLz.js.map → publishDraftGraph-CCa6EzeO.js.map} +1 -1
  107. package/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.js → resetAmbiguousLegacyItemData--PN1v53N.js} +2 -2
  108. package/dist/{resetAmbiguousLegacyItemData-Cy8ik7xk.js.map → resetAmbiguousLegacyItemData--PN1v53N.js.map} +1 -1
  109. package/dist/{resolveModelForSyncedSeed-DFr4COc4.js → resolveModelForSyncedSeed-VDzkS6Rs.js} +2 -2
  110. package/dist/{resolveModelForSyncedSeed-DFr4COc4.js.map → resolveModelForSyncedSeed-VDzkS6Rs.js.map} +1 -1
  111. package/dist/src/Item/Item.d.ts +23 -6
  112. package/dist/src/Item/Item.d.ts.map +1 -1
  113. package/dist/src/Item/service/itemMachineSingle.d.ts.map +1 -1
  114. package/dist/src/ItemProperty/ItemProperty.d.ts +38 -6
  115. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  116. package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
  117. package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
  118. package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
  119. package/dist/src/Model/Model.d.ts +50 -9
  120. package/dist/src/Model/Model.d.ts.map +1 -1
  121. package/dist/src/Model/service/actors/validateModel.d.ts.map +1 -1
  122. package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
  123. package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -1
  124. package/dist/src/ModelProperty/service/actors/validateProperty.d.ts.map +1 -1
  125. package/dist/src/Schema/Schema.d.ts +22 -3
  126. package/dist/src/Schema/Schema.d.ts.map +1 -1
  127. package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
  128. package/dist/src/Schema/service/actors/createModelInstances.d.ts.map +1 -1
  129. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
  130. package/dist/src/browser/db/Db.d.ts.map +1 -1
  131. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  132. package/dist/src/client/ClientManager.d.ts +13 -0
  133. package/dist/src/client/ClientManager.d.ts.map +1 -1
  134. package/dist/src/helpers/entity/entityCache.d.ts +2 -42
  135. package/dist/src/helpers/entity/entityCache.d.ts.map +1 -1
  136. package/dist/src/helpers/entity/entityCommon.d.ts +9 -0
  137. package/dist/src/helpers/entity/entityCommon.d.ts.map +1 -1
  138. package/dist/src/helpers/entity/entityDestroy.d.ts +13 -7
  139. package/dist/src/helpers/entity/entityDestroy.d.ts.map +1 -1
  140. package/dist/src/helpers/entity/entityLiveQuery.d.ts +3 -2
  141. package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
  142. package/dist/src/helpers/entity/entityState.d.ts +28 -0
  143. package/dist/src/helpers/entity/entityState.d.ts.map +1 -0
  144. package/dist/src/helpers/entity/entityUnload.d.ts +3 -2
  145. package/dist/src/helpers/entity/entityUnload.d.ts.map +1 -1
  146. package/dist/src/helpers/entity/index.d.ts +1 -0
  147. package/dist/src/helpers/entity/index.d.ts.map +1 -1
  148. package/dist/src/helpers/metadataPropertyNames.d.ts +6 -0
  149. package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
  150. package/dist/src/helpers/property.d.ts.map +1 -1
  151. package/dist/src/helpers/reactiveProxy.d.ts +18 -0
  152. package/dist/src/helpers/reactiveProxy.d.ts.map +1 -1
  153. package/dist/src/helpers/sessionObjectUrls.d.ts +4 -0
  154. package/dist/src/helpers/sessionObjectUrls.d.ts.map +1 -0
  155. package/dist/src/imports/json.d.ts.map +1 -1
  156. package/dist/{syncDbWithEas-CAOlw3i-.js → syncDbWithEas-D0gyJ58h.js} +19 -19
  157. package/dist/syncDbWithEas-D0gyJ58h.js.map +1 -0
  158. package/dist/{tabEvents-DksXwk3X.js → tabEvents-UH-wNsZC.js} +24 -7
  159. package/dist/tabEvents-UH-wNsZC.js.map +1 -0
  160. package/dist/{tolerantWebAccess-CEIjFGf0.js → tolerantWebAccess-CpcTCAZv.js} +6 -6
  161. package/dist/{tolerantWebAccess-CEIjFGf0.js.map → tolerantWebAccess-CpcTCAZv.js.map} +1 -1
  162. package/dist/{updateSeedRevokedAt-Cjr35YjE.js → updateSeedRevokedAt-D230zfWk.js} +3 -3
  163. package/dist/{updateSeedRevokedAt-Cjr35YjE.js.map → updateSeedRevokedAt-D230zfWk.js.map} +1 -1
  164. package/package.json +6 -6
  165. package/dist/ClientManager-2GtDWHq6.js.map +0 -1
  166. package/dist/Item-D6j0IvBP.js.map +0 -1
  167. package/dist/ModelProperty-B52C3CQ2.js.map +0 -1
  168. package/dist/Schema-O1QLoXv6.js.map +0 -1
  169. package/dist/dist/ClientManager-2GtDWHq6.d.ts.map +0 -1
  170. package/dist/dist/Item-D6j0IvBP.d.ts.map +0 -1
  171. package/dist/dist/Schema-O1QLoXv6.d.ts.map +0 -1
  172. package/dist/dist/backfillMetadataPropertyIds-CzSbuucw.d.ts.map +0 -1
  173. package/dist/dist/configurePlatform-Bbpw_R4y.d.ts.map +0 -1
  174. package/dist/dist/detachRowsBeforeDelete-D1TyEMco.d.ts.map +0 -1
  175. package/dist/dist/discardNewDraft-hiVaUVjV.d.ts.map +0 -1
  176. package/dist/dist/eas-DOdj-EMK.d.ts.map +0 -1
  177. package/dist/dist/errors-KM-yq2MD.d.ts.map +0 -1
  178. package/dist/dist/getItem-Bh0zv-o1.d.ts.map +0 -1
  179. package/dist/dist/index-BAao3_Po.d.ts.map +0 -1
  180. package/dist/dist/index-DpgQMIRq.d.ts.map +0 -1
  181. package/dist/dist/property-BDBvImLs.d.ts.map +0 -1
  182. package/dist/dist/propertyValidationRules-BlfLn4rP.d.ts.map +0 -1
  183. package/dist/dist/resetAmbiguousLegacyItemData-Cy8ik7xk.d.ts.map +0 -1
  184. package/dist/dist/resolveModelForSyncedSeed-DFr4COc4.d.ts.map +0 -1
  185. package/dist/dist/syncDbWithEas-CAOlw3i-.d.ts.map +0 -1
  186. package/dist/dist/tabEvents-DksXwk3X.d.ts.map +0 -1
  187. package/dist/dist/updateSeedRevokedAt-Cjr35YjE.d.ts.map +0 -1
  188. package/dist/errors-KM-yq2MD.js.map +0 -1
  189. package/dist/index-BAao3_Po.js.map +0 -1
  190. package/dist/index-BbFwftAv.js.map +0 -1
  191. package/dist/index-DpgQMIRq.js.map +0 -1
  192. package/dist/index.browser-nndbVM7z.js.map +0 -1
  193. package/dist/property-BDBvImLs.js.map +0 -1
  194. package/dist/syncDbWithEas-CAOlw3i-.js.map +0 -1
  195. package/dist/tabEvents-DksXwk3X.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import { fromCallback, setup, assign, createActor } from 'xstate';
2
- import { i as isActorStopped, w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-KM-yq2MD.js';
3
- import { B as BaseDb, t as models, v as properties, A as schemas, r as modelSchemas, ao as getModelIdByFileId, n as normalizeDataType, ai as generateId, M as ModelPropertyDataTypes, h as BaseFileManager, ap as getModelId, aq as setCachedPropertyRefresher } from './index-DpgQMIRq.js';
2
+ import { w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-CQagdED2.js';
3
+ import { B as BaseDb, t as models, v as properties, A as schemas, r as modelSchemas, ao as getModelIdByFileId, n as normalizeDataType, ah as generateId, M as ModelPropertyDataTypes, h as BaseFileManager, ap as getModelId, aq as setCachedPropertyRefresher } from './index-C-NqjjY_.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 { m as isActorStopped, D as DEFAULT_READY_TIMEOUT_MS, d as waitForEntityIdle, n as createReactiveProxy, o as sameEntity, q as findEntity, t as forceRemoveFromCaches, u as runDestroyLifecycle } from './Item-BiMHgg-_.js';
8
9
  import debug from 'debug';
9
- import { S as Schema } from './Schema-O1QLoXv6.js';
10
- import { D as DEFAULT_READY_TIMEOUT_MS, d as waitForEntityIdle, m as createReactiveProxy, n as findEntity, o as forceRemoveFromCaches, q as runDestroyLifecycle } from './Item-D6j0IvBP.js';
11
- import './ClientManager-2GtDWHq6.js';
10
+ import { S as Schema } from './Schema-COTbavcm.js';
11
+ import './ClientManager-DBKvmJov.js';
12
12
  import 'lodash-es';
13
- import './tabEvents-DksXwk3X.js';
13
+ import './tabEvents-UH-wNsZC.js';
14
14
  import '@seedprotocol/arweave';
15
15
  import '@noble/hashes/sha3';
16
16
  import '@noble/hashes/utils';
@@ -20,9 +20,9 @@ import 'drizzle-orm/sqlite-core';
20
20
  import 'nanoid';
21
21
  import 'nanoid-dictionary';
22
22
  import '@noble/hashes/sha256';
23
- import './SchemaValidationService-BxCbfDaI.js';
24
- import '@sinclair/typebox/value';
25
23
  import 'rxjs';
24
+ import './SchemaValidationService-paOfbcwd.js';
25
+ import '@sinclair/typebox/value';
26
26
 
27
27
  const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
28
28
  /**
@@ -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-2GtDWHq6.js');
35
+ const _mod_0 = await import('./ClientManager-DBKvmJov.js');
36
36
  const _ns_0 = _mod_0.N;
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-DpgQMIRq.js');
43
- const _ns_1 = _mod_1.be;
42
+ const _mod_1 = await import('./index-C-NqjjY_.js');
43
+ const _ns_1 = _mod_1.bf;
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-BxCbfDaI.js');
62
+ const validationServiceMod = await import('./SchemaValidationService-paOfbcwd.js');
63
63
  const { SchemaValidationService } = validationServiceMod;
64
64
  const validationService = new SchemaValidationService();
65
65
  // Validate property structure before saving
@@ -78,22 +78,22 @@ 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-DpgQMIRq.js');
82
- const _ns_2 = _mod_2.bi;
81
+ const _mod_2 = await import('./index-C-NqjjY_.js');
82
+ const _ns_2 = _mod_2.bj;
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-O1QLoXv6.js');
89
+ const _mod_3 = await import('./Schema-COTbavcm.js');
90
90
  const _ns_3 = _mod_3.b;
91
91
  const schemaMod = _ns_3;
92
92
  const { Schema } = schemaMod;
93
93
  // Stopped meanwhile (unloaded, or evicted with its schema): don't load the schema again
94
94
  if (isActorStopped(self))
95
95
  return;
96
- const schema = Schema.create(schemaName, { waitForReady: false });
96
+ const schema = Schema.create(schemaName, { waitForReady: false, hold: false });
97
97
  schema.getService().send({
98
98
  type: 'markAsDraft',
99
99
  propertyKey: `${context.modelName}:${context.name}`,
@@ -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-DpgQMIRq.js');
128
- const _ns_4 = _mod_4.bi;
127
+ const _mod_4 = await import('./index-C-NqjjY_.js');
128
+ const _ns_4 = _mod_4.bj;
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-DpgQMIRq.js');
175
- const _ns_5 = _mod_5.bi;
174
+ const _mod_5 = await import('./index-C-NqjjY_.js');
175
+ const _ns_5 = _mod_5.bj;
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-DpgQMIRq.js');
237
- const _ns_6 = _mod_6.bi;
236
+ const _mod_6 = await import('./index-C-NqjjY_.js');
237
+ const _ns_6 = _mod_6.bj;
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,16 +249,14 @@ 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-O1QLoXv6.js');
252
+ const _mod_7 = await import('./Schema-COTbavcm.js');
253
253
  const _ns_7 = _mod_7.b;
254
254
  const schemaMod = _ns_7;
255
255
  const { Schema } = schemaMod;
256
256
  // Stopped meanwhile (unloaded, or evicted with its schema): don't load the schema again
257
257
  if (isActorStopped(self))
258
258
  return;
259
- const schema = Schema.create(fullContext._schemaName, {
260
- waitForReady: false,
261
- });
259
+ const schema = Schema.create(fullContext._schemaName, { waitForReady: false, hold: false });
262
260
  // Send event to Schema machine to mark as draft
263
261
  schema.getService().send({
264
262
  type: 'markAsDraft',
@@ -271,7 +269,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
271
269
  logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
272
270
  // Clear isEdited flag in database
273
271
  try {
274
- const _mod_8 = await import('./index-BbFwftAv.js');
272
+ const _mod_8 = await import('./index-3_hGVu7v.js');
275
273
  const _ns_8 = _mod_8.s;
276
274
  const seedSchemaMod = _ns_8;
277
275
  const { properties: propertiesTable } = seedSchemaMod;
@@ -280,8 +278,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
280
278
  const db = BaseDb.getAppDb();
281
279
  if (db && fullContext.modelName && fullContext.name) {
282
280
  // Find this property's model (model names are only unique per schema)
283
- const _mod_9 = await import('./index-DpgQMIRq.js');
284
- const _ns_9 = _mod_9.bh;
281
+ const _mod_9 = await import('./index-C-NqjjY_.js');
282
+ const _ns_9 = _mod_9.bi;
285
283
  const { resolveModelRecord } = _ns_9;
286
284
  const modelRecord = await resolveModelRecord(fullContext.modelName, {
287
285
  modelId: typeof fullContext.modelId === 'number' ? fullContext.modelId : undefined,
@@ -340,8 +338,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
340
338
  // Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
341
339
  await new Promise((r) => setTimeout(r, 60));
342
340
  try {
343
- const _mod_10 = await import('./index-DpgQMIRq.js');
344
- const _ns_10 = _mod_10.bi;
341
+ const _mod_10 = await import('./index-C-NqjjY_.js');
342
+ const _ns_10 = _mod_10.bj;
345
343
  const dbMod = _ns_10;
346
344
  const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
347
345
  // Try pending write first (property row may not exist yet)
@@ -394,10 +392,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
394
392
  fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
395
393
  }
396
394
  // Use dynamic imports to break circular dependencies
397
- const validationServiceMod = await import('./SchemaValidationService-BxCbfDaI.js');
395
+ const validationServiceMod = await import('./SchemaValidationService-paOfbcwd.js');
398
396
  const { SchemaValidationService } = validationServiceMod;
399
397
  const validationService = new SchemaValidationService();
400
- const _mod_11 = await import('./Schema-O1QLoXv6.js');
398
+ const _mod_11 = await import('./Schema-COTbavcm.js');
401
399
  const _ns_11 = _mod_11.b;
402
400
  const schemaMod = _ns_11;
403
401
  const { Schema } = schemaMod;
@@ -413,9 +411,7 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
413
411
  return;
414
412
  if (fullContext._schemaName && fullContext.modelName) {
415
413
  try {
416
- const schema = Schema.create(fullContext._schemaName, {
417
- waitForReady: false,
418
- });
414
+ const schema = Schema.create(fullContext._schemaName, { waitForReady: false, hold: false });
419
415
  const schemaSnapshot = schema.getService().getSnapshot();
420
416
  const schemaStatus = schemaSnapshot.value;
421
417
  // Only validate against schema if it's loaded (in idle state)
@@ -1027,8 +1023,8 @@ class ModelProperty {
1027
1023
  return fallbackIsEdited;
1028
1024
  }
1029
1025
  // Find this property's model (by modelId when known; model names are only unique per schema)
1030
- const _mod_12 = await import('./index-DpgQMIRq.js');
1031
- const _ns_12 = _mod_12.bh;
1026
+ const _mod_12 = await import('./index-C-NqjjY_.js');
1027
+ const _ns_12 = _mod_12.bi;
1032
1028
  const { resolveModelRecord } = _ns_12;
1033
1029
  const modelRecord = await resolveModelRecord(property.modelName, this._ownerModelScope(property), db);
1034
1030
  const modelRecords = modelRecord ? [modelRecord] : [];
@@ -1065,8 +1061,8 @@ class ModelProperty {
1065
1061
  return undefined;
1066
1062
  }
1067
1063
  // Resolve the ref within the owning model's schema
1068
- const _mod_13 = await import('./index-DpgQMIRq.js');
1069
- const _ns_13 = _mod_13.bh;
1064
+ const _mod_13 = await import('./index-C-NqjjY_.js');
1065
+ const _ns_13 = _mod_13.bi;
1070
1066
  const { resolveRefModelRecord } = _ns_13;
1071
1067
  const refModelRecord = await resolveRefModelRecord(refModelName, property ? this._ownerModelScope(property) : { schemaName: this._getSnapshotContext()._schemaName }, db);
1072
1068
  if (refModelRecord?.id) {
@@ -1101,21 +1097,21 @@ class ModelProperty {
1101
1097
  // Synchronous cache hits first: callers compare against these values right after construction,
1102
1098
  // so an extra await here lets every property look "edited" (a draft save each). Only then the
1103
1099
  // DB (by modelId), and never instantiate a Model while its own properties are initializing.
1104
- let model = schemaName ? Model.getByName(property.modelName, schemaName) : undefined;
1100
+ let model = schemaName ? Model.peekByName(property.modelName, schemaName) : undefined;
1105
1101
  if (!model) {
1106
1102
  try {
1107
- model = Model.getByName(property.modelName);
1103
+ model = Model.peekByName(property.modelName);
1108
1104
  }
1109
1105
  catch {
1110
1106
  model = undefined; // ambiguous name; resolve by modelId below
1111
1107
  }
1112
1108
  }
1113
1109
  if (!model && modelId) {
1114
- const _mod_14 = await import('./index-DpgQMIRq.js');
1115
- const _ns_14 = _mod_14.bh;
1110
+ const _mod_14 = await import('./index-C-NqjjY_.js');
1111
+ const _ns_14 = _mod_14.bi;
1116
1112
  const { resolveModelRecord } = _ns_14;
1117
1113
  const modelFileId = (await resolveModelRecord(property.modelName, { modelId }))?.schemaFileId;
1118
- model = modelFileId ? Model.getById(modelFileId) : undefined;
1114
+ model = modelFileId ? Model.peek(modelFileId) : undefined;
1119
1115
  }
1120
1116
  // Evicted (with its schema) or unloaded while the lookups above ran: don't instantiate its model
1121
1117
  // again from rows that are being deleted.
@@ -1127,6 +1123,7 @@ class ModelProperty {
1127
1123
  // then (this instance may already be stopped) must not re-create the model.
1128
1124
  model = await Model.getByNameAsync(property.modelName, undefined, {
1129
1125
  evictionEpoch: this._evictionEpoch,
1126
+ hold: false,
1130
1127
  });
1131
1128
  }
1132
1129
  catch {
@@ -1559,7 +1556,8 @@ class ModelProperty {
1559
1556
  }
1560
1557
  /** Whether an idIndex entry still points at a cached instance with that id. */
1561
1558
  static isIndexEntryCurrent(propertyFileId, entry) {
1562
- if (this.instanceCache.get(entry.cacheKey)?.instance !== entry.instance)
1559
+ const cached = this.instanceCache.get(entry.cacheKey)?.instance;
1560
+ if (!cached || !sameEntity(cached, entry.instance))
1563
1561
  return false;
1564
1562
  try {
1565
1563
  return entry.instance._getSnapshotContext().id === propertyFileId;
@@ -1575,7 +1573,7 @@ class ModelProperty {
1575
1573
  return;
1576
1574
  const existing = this.idIndex.get(id);
1577
1575
  // Keep the instance cached first, as the old scan in insertion order returned
1578
- if (existing && existing.instance !== instance && this.isIndexEntryCurrent(id, existing))
1576
+ if (existing && !sameEntity(existing.instance, instance) && this.isIndexEntryCurrent(id, existing))
1579
1577
  return;
1580
1578
  this.idIndex.set(id, { cacheKey, instance });
1581
1579
  };
@@ -1791,7 +1789,8 @@ class ModelProperty {
1791
1789
  if (newCacheKey && cacheKey === `${context.modelName}:${context.name}` && !this.instanceCache.has(newCacheKey)) {
1792
1790
  this.instanceCache.delete(cacheKey);
1793
1791
  this.instanceCache.set(newCacheKey, entry);
1794
- if (this.idIndex.get(propertyFileId)?.instance === instance) {
1792
+ const indexed = this.idIndex.get(propertyFileId)?.instance;
1793
+ if (indexed && sameEntity(indexed, instance)) {
1795
1794
  this.idIndex.set(propertyFileId, { cacheKey: newCacheKey, instance });
1796
1795
  }
1797
1796
  }
@@ -2108,7 +2107,7 @@ class ModelProperty {
2108
2107
  .where(and(eq(schemas.name, schemaName), eq(models.name, modelName), eq(properties.name, propertyName)))
2109
2108
  .limit(1);
2110
2109
  if (propertyRecords.length > 0 && propertyRecords[0].propertyId != null) {
2111
- const { detachPropertyRows } = await import('./detachRowsBeforeDelete-D1TyEMco.js');
2110
+ const { detachPropertyRows } = await import('./detachRowsBeforeDelete-C1iapUFl.js');
2112
2111
  await detachPropertyRows(db, [propertyRecords[0].propertyId]);
2113
2112
  await db
2114
2113
  .delete(properties)
@@ -2116,7 +2115,7 @@ class ModelProperty {
2116
2115
  }
2117
2116
  }
2118
2117
  if (schemaName) {
2119
- const schema = Schema.create(schemaName, { waitForReady: false });
2118
+ const schema = Schema.create(schemaName, { waitForReady: false, hold: false });
2120
2119
  const snapshot = schema.getService().getSnapshot();
2121
2120
  const schemaContext = snapshot.context;
2122
2121
  if (schemaContext.models?.[modelName]?.properties?.[propertyName]) {
@@ -2157,4 +2156,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
2157
2156
  });
2158
2157
 
2159
2158
  export { ModelProperty };
2160
- //# sourceMappingURL=ModelProperty-B52C3CQ2.js.map
2159
+ //# sourceMappingURL=ModelProperty-C1Fzcnbm.js.map