@seedprotocol/sdk 0.6.7 → 0.6.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.
Files changed (201) hide show
  1. package/dist/{BasePathResolver-qV0apdVY.js → BasePathResolver-B6CKqoKw.js} +16 -5
  2. package/dist/BasePathResolver-B6CKqoKw.js.map +1 -0
  3. package/dist/{ClientManager-Y5EWQuJj.js → ClientManager-ChcmUL47.js} +619 -264
  4. package/dist/ClientManager-ChcmUL47.js.map +1 -0
  5. package/dist/{ModelProperty-DuB5nk6A.js → ModelProperty-D79uV42p.js} +33 -30
  6. package/dist/ModelProperty-D79uV42p.js.map +1 -0
  7. package/dist/{Schema-BYM-GNdE.js → Schema-a8uO-hIZ.js} +43 -43
  8. package/dist/Schema-a8uO-hIZ.js.map +1 -0
  9. package/dist/{SchemaValidationService-Dr6nmwPm.js → SchemaValidationService-Y49vqast.js} +13 -12
  10. package/dist/SchemaValidationService-Y49vqast.js.map +1 -0
  11. package/dist/{backfillMetadataPropertyIds-BzbAB-C5.js → backfillMetadataPropertyIds-CBsf7LnU.js} +5 -3
  12. package/dist/{backfillMetadataPropertyIds-BzbAB-C5.js.map → backfillMetadataPropertyIds-CBsf7LnU.js.map} +1 -1
  13. package/dist/cjs/{ModelProperty-CDTOx5zi.js → ModelProperty-D9FGaGuE.js} +21 -17
  14. package/dist/cjs/ModelProperty-D9FGaGuE.js.map +1 -0
  15. package/dist/cjs/{Schema-XXcwj3hV.js → Schema-BiJIPLEL.js} +25 -24
  16. package/dist/cjs/Schema-BiJIPLEL.js.map +1 -0
  17. package/dist/cjs/{SchemaValidationService-Z7OhtGn5.js → SchemaValidationService-DtYs_CNY.js} +5 -3
  18. package/dist/cjs/SchemaValidationService-DtYs_CNY.js.map +1 -0
  19. package/dist/cjs/{backfillMetadataPropertyIds-Bt4fzfIV.js → backfillMetadataPropertyIds-2XaN3b9S.js} +3 -2
  20. package/dist/cjs/{backfillMetadataPropertyIds-Bt4fzfIV.js.map → backfillMetadataPropertyIds-2XaN3b9S.js.map} +1 -1
  21. package/dist/cjs/{eas-DdI-4vwl.js → eas-CMNppmGE.js} +4 -3
  22. package/dist/cjs/{eas-DdI-4vwl.js.map → eas-CMNppmGE.js.map} +1 -1
  23. package/dist/cjs/{getItem-B_2GeTQf.js → getItem-B6jEINjW.js} +3 -2
  24. package/dist/cjs/{getItem-B_2GeTQf.js.map → getItem-B6jEINjW.js.map} +1 -1
  25. package/dist/cjs/{getPublishPayload-Jmgi1RUj.js → getPublishPayload-D5DhLGvN.js} +64 -59
  26. package/dist/cjs/getPublishPayload-D5DhLGvN.js.map +1 -0
  27. package/dist/cjs/{getPublishUploads-DNULcrN5.js → getPublishUploads-DMhCCKYF.js} +17 -10
  28. package/dist/cjs/getPublishUploads-DMhCCKYF.js.map +1 -0
  29. package/dist/cjs/{getSegmentedItemProperties-DK82kjri.js → getSegmentedItemProperties-CU8rtBAo.js} +3 -51
  30. package/dist/cjs/getSegmentedItemProperties-CU8rtBAo.js.map +1 -0
  31. package/dist/cjs/{index-DM1WR83P.js → index-CSNtEnbF.js} +879 -467
  32. package/dist/cjs/index-CSNtEnbF.js.map +1 -0
  33. package/dist/cjs/{index-tpO1Nj4v.js → index-DPp9rdRL.js} +6 -3
  34. package/dist/cjs/index-DPp9rdRL.js.map +1 -0
  35. package/dist/cjs/{property-DmvgA8FD.js → property-DlKiAWt4.js} +7 -4
  36. package/dist/cjs/{property-DmvgA8FD.js.map → property-DlKiAWt4.js.map} +1 -1
  37. package/dist/cjs/{syncDbWithEas-3hOoPdu1.js → syncDbWithEas-C6n34o_Q.js} +11 -6
  38. package/dist/cjs/syncDbWithEas-C6n34o_Q.js.map +1 -0
  39. package/dist/{configurePlatform-CCYQruij.js → configurePlatform-CE0Vew17.js} +5 -5
  40. package/dist/{configurePlatform-CCYQruij.js.map → configurePlatform-CE0Vew17.js.map} +1 -1
  41. package/dist/db/drizzle/0014_add_error_code_to_publish_processes.sql +1 -0
  42. package/dist/db/drizzle/meta/0014_snapshot.json +1269 -0
  43. package/dist/db/drizzle/meta/_journal.json +7 -0
  44. package/dist/{db-CceyWksv.js → db-WbrzEf7c.js} +254 -35
  45. package/dist/db-WbrzEf7c.js.map +1 -0
  46. package/dist/{eas-CH8iFIST.js → eas-CfYCu4IX.js} +6 -6
  47. package/dist/{eas-CH8iFIST.js.map → eas-CfYCu4IX.js.map} +1 -1
  48. package/dist/{getItem-C7Mtfz6O.js → getItem-Br-bGNFO.js} +6 -6
  49. package/dist/{getItem-C7Mtfz6O.js.map → getItem-Br-bGNFO.js.map} +1 -1
  50. package/dist/{getPublishPayload-2gnnDdMh.js → getPublishPayload-BIrTVUxb.js} +66 -62
  51. package/dist/getPublishPayload-BIrTVUxb.js.map +1 -0
  52. package/dist/{getPublishUploads-AKISt3JA.js → getPublishUploads-C6cDeZdz.js} +19 -13
  53. package/dist/getPublishUploads-C6cDeZdz.js.map +1 -0
  54. package/dist/{getSegmentedItemProperties-eIjvhCP_.js → getSegmentedItemProperties-BmKE71vU.js} +5 -5
  55. package/dist/{getSegmentedItemProperties-eIjvhCP_.js.map → getSegmentedItemProperties-BmKE71vU.js.map} +1 -1
  56. package/dist/{constants-DSqHBPNe.js → index-280bL-n4.js} +32 -257
  57. package/dist/index-280bL-n4.js.map +1 -0
  58. package/dist/{index-CHi212ST.js → index-ClSv5pTA.js} +13 -13
  59. package/dist/index-ClSv5pTA.js.map +1 -0
  60. package/dist/{index-CsmiM0RI.js → index-Djd3667v.js} +2 -2
  61. package/dist/index-Djd3667v.js.map +1 -0
  62. package/dist/{index-BFpbtEsg.js → index-HRHkbVQd.js} +24 -24
  63. package/dist/{index-BFpbtEsg.js.map → index-HRHkbVQd.js.map} +1 -1
  64. package/dist/{index.node-CbWB4MDz.js → index.node-DBtQkEfz.js} +8 -6
  65. package/dist/index.node-DBtQkEfz.js.map +1 -0
  66. package/dist/main.cjs +6 -1
  67. package/dist/main.cjs.map +1 -1
  68. package/dist/main.js +36 -38
  69. package/dist/main.js.map +1 -1
  70. package/dist/node.js +15 -14
  71. package/dist/node.js.map +1 -1
  72. package/dist/platform.browser.js +108 -46
  73. package/dist/platform.browser.js.map +1 -1
  74. package/dist/platform.node.js +4 -3
  75. package/dist/platform.node.js.map +1 -1
  76. package/dist/{property-CWKcZ5YZ.js → property-CQjuZ4JW.js} +14 -13
  77. package/dist/property-CQjuZ4JW.js.map +1 -0
  78. package/dist/seedSchema/PublishProcessSchema.ts +1 -0
  79. package/dist/src/Item/Item.d.ts +6 -0
  80. package/dist/src/Item/Item.d.ts.map +1 -1
  81. package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +1 -1
  82. package/dist/src/ItemProperty/ItemProperty.d.ts +10 -1
  83. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  84. package/dist/src/ItemProperty/service/actors/resolveRelatedValue.d.ts.map +1 -1
  85. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts.map +1 -1
  86. package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
  87. package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
  88. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
  89. package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +1 -1
  90. package/dist/src/Schema/service/addModelsMachine.d.ts.map +1 -1
  91. package/dist/src/Schema/service/validation/SchemaValidationService.d.ts.map +1 -1
  92. package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
  93. package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
  94. package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
  95. package/dist/src/browser/helpers/EasClient.d.ts +2 -1
  96. package/dist/src/browser/helpers/EasClient.d.ts.map +1 -1
  97. package/dist/src/browser/helpers/FileManager.d.ts +1 -1
  98. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  99. package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
  100. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
  101. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
  102. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
  103. package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
  104. package/dist/src/client/constants.d.ts +4 -0
  105. package/dist/src/client/constants.d.ts.map +1 -1
  106. package/dist/src/client/nodeEndpointDefaults.d.ts +8 -0
  107. package/dist/src/client/nodeEndpointDefaults.d.ts.map +1 -0
  108. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  109. package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
  110. package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
  111. package/dist/src/db/write/createMetadata.d.ts.map +1 -1
  112. package/dist/src/events/files/download.d.ts.map +1 -1
  113. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  114. package/dist/src/helpers/ArweaveClient/index.d.ts.map +1 -1
  115. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +2 -2
  116. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  117. package/dist/src/helpers/FileManager/IFileManager.d.ts +4 -0
  118. package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
  119. package/dist/src/helpers/constants.d.ts +8 -0
  120. package/dist/src/helpers/constants.d.ts.map +1 -1
  121. package/dist/src/helpers/db.d.ts +6 -0
  122. package/dist/src/helpers/db.d.ts.map +1 -1
  123. package/dist/src/helpers/gateway/gatewayState.d.ts +1 -1
  124. package/dist/src/helpers/gateway/gatewayState.d.ts.map +1 -1
  125. package/dist/src/helpers/localDbChain.d.ts +22 -0
  126. package/dist/src/helpers/localDbChain.d.ts.map +1 -0
  127. package/dist/src/helpers/metadataPropertyNames.d.ts +9 -0
  128. package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
  129. package/dist/src/helpers/property/index.d.ts +12 -0
  130. package/dist/src/helpers/property/index.d.ts.map +1 -1
  131. package/dist/src/helpers/readHtmlBodyForStorageSeed.d.ts.map +1 -1
  132. package/dist/src/helpers/relationSeedRef.d.ts +8 -0
  133. package/dist/src/helpers/relationSeedRef.d.ts.map +1 -1
  134. package/dist/src/index.d.ts +9 -5
  135. package/dist/src/index.d.ts.map +1 -1
  136. package/dist/src/node/easLodashHook.d.ts +2 -0
  137. package/dist/src/node/easLodashHook.d.ts.map +1 -0
  138. package/dist/src/node/easLodashRegister.d.ts +2 -0
  139. package/dist/src/node/easLodashRegister.d.ts.map +1 -0
  140. package/dist/src/node/helpers/FileManager.d.ts +2 -1
  141. package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
  142. package/dist/src/node/index.d.ts +2 -1
  143. package/dist/src/node/index.d.ts.map +1 -1
  144. package/dist/src/seedSchema/PublishProcessSchema.d.ts +19 -0
  145. package/dist/src/seedSchema/PublishProcessSchema.d.ts.map +1 -1
  146. package/dist/src/types/fileManager.d.ts +4 -0
  147. package/dist/src/types/fileManager.d.ts.map +1 -1
  148. package/dist/src/types/index.d.ts +15 -1
  149. package/dist/src/types/index.d.ts.map +1 -1
  150. package/dist/{syncDbWithEas-5kZneTEL.js → syncDbWithEas-CuARXfyN.js} +16 -12
  151. package/dist/syncDbWithEas-CuARXfyN.js.map +1 -0
  152. package/dist/{updateSeedRevokedAt-CgfOBtqJ.js → updateSeedRevokedAt-CBcLfHWs.js} +2 -2
  153. package/dist/{updateSeedRevokedAt-CgfOBtqJ.js.map → updateSeedRevokedAt-CBcLfHWs.js.map} +1 -1
  154. package/package.json +11 -7
  155. package/src/node/easLodashHook.js +22 -0
  156. package/src/node/easLodashRegister.js +13 -0
  157. package/dist/BasePathResolver-qV0apdVY.js.map +0 -1
  158. package/dist/ClientManager-Y5EWQuJj.js.map +0 -1
  159. package/dist/ModelProperty-DuB5nk6A.js.map +0 -1
  160. package/dist/Schema-BYM-GNdE.js.map +0 -1
  161. package/dist/SchemaValidationService-Dr6nmwPm.js.map +0 -1
  162. package/dist/cjs/ModelProperty-CDTOx5zi.js.map +0 -1
  163. package/dist/cjs/Schema-XXcwj3hV.js.map +0 -1
  164. package/dist/cjs/SchemaValidationService-Z7OhtGn5.js.map +0 -1
  165. package/dist/cjs/getPublishPayload-Jmgi1RUj.js.map +0 -1
  166. package/dist/cjs/getPublishUploads-DNULcrN5.js.map +0 -1
  167. package/dist/cjs/getSegmentedItemProperties-DK82kjri.js.map +0 -1
  168. package/dist/cjs/index-DM1WR83P.js.map +0 -1
  169. package/dist/cjs/index-tpO1Nj4v.js.map +0 -1
  170. package/dist/cjs/syncDbWithEas-3hOoPdu1.js.map +0 -1
  171. package/dist/constants-DSqHBPNe.js.map +0 -1
  172. package/dist/db-CceyWksv.js.map +0 -1
  173. package/dist/getPublishPayload-2gnnDdMh.js.map +0 -1
  174. package/dist/getPublishUploads-AKISt3JA.js.map +0 -1
  175. package/dist/index-CHi212ST.js.map +0 -1
  176. package/dist/index-CsmiM0RI.js.map +0 -1
  177. package/dist/index.node-CbWB4MDz.js.map +0 -1
  178. package/dist/property-CWKcZ5YZ.js.map +0 -1
  179. package/dist/seedSchema/AppStateSchema.d.ts +0 -82
  180. package/dist/seedSchema/AppStateSchema.d.ts.map +0 -1
  181. package/dist/seedSchema/ConfigSchema.d.ts +0 -101
  182. package/dist/seedSchema/ConfigSchema.d.ts.map +0 -1
  183. package/dist/seedSchema/MetadataSchema.d.ts +0 -422
  184. package/dist/seedSchema/MetadataSchema.d.ts.map +0 -1
  185. package/dist/seedSchema/ModelSchema.d.ts +0 -243
  186. package/dist/seedSchema/ModelSchema.d.ts.map +0 -1
  187. package/dist/seedSchema/ModelSchemaSchema.d.ts +0 -61
  188. package/dist/seedSchema/ModelSchemaSchema.d.ts.map +0 -1
  189. package/dist/seedSchema/ModelUidSchema.d.ts +0 -64
  190. package/dist/seedSchema/ModelUidSchema.d.ts.map +0 -1
  191. package/dist/seedSchema/PropertyUidSchema.d.ts +0 -64
  192. package/dist/seedSchema/PropertyUidSchema.d.ts.map +0 -1
  193. package/dist/seedSchema/SchemaSchema.d.ts +0 -169
  194. package/dist/seedSchema/SchemaSchema.d.ts.map +0 -1
  195. package/dist/seedSchema/SeedSchema.d.ts +0 -192
  196. package/dist/seedSchema/SeedSchema.d.ts.map +0 -1
  197. package/dist/seedSchema/VersionSchema.d.ts +0 -194
  198. package/dist/seedSchema/VersionSchema.d.ts.map +0 -1
  199. package/dist/seedSchema/index.d.ts +0 -14
  200. package/dist/seedSchema/index.d.ts.map +0 -1
  201. package/dist/syncDbWithEas-5kZneTEL.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { fromCallback, setup, assign, createActor } from 'xstate';
2
- import { h as getRefValueType, ab as createModelsFromJson, Q as listCompleteSchemaFiles, ac as getLatestSchemaVersion, ad as createModelFromJson, l as loadSchemaFromFile, w as waitForEntityIdle, k as createReactiveProxy, m as findEntity, R as loadAllSchemasFromDb, B as getClient, a9 as unloadEntity, aa as clearDestroySubscriptions, n as forceRemoveFromCaches, o as runDestroyLifecycle } from './ClientManager-Y5EWQuJj.js';
3
- import { C as ClientManagerState } from './constants-DSqHBPNe.js';
4
- import { l as addSchemaToDb, c as addModelsToDb, m as loadModelsFromDbForSchema } from './db-CceyWksv.js';
5
- import { D as SEED_PROTOCOL_SCHEMA_NAME, a as BaseDb, s as schemas, m as models, i as modelSchemas, p as properties, B as BaseFileManager, G as isInternalSchema } from './BasePathResolver-qV0apdVY.js';
2
+ import { i as getRefValueType, ai as createModelsFromJson, X as listCompleteSchemaFiles, aj as getLatestSchemaVersion, ak as createModelFromJson, k as loadSchemaFromFile, n as waitForEntityIdle, o as createReactiveProxy, q as findEntity, Y as loadAllSchemasFromDb, H as getClient, y as ClientManagerState, ag as unloadEntity, ah as clearDestroySubscriptions, u as forceRemoveFromCaches, v as runDestroyLifecycle } from './ClientManager-ChcmUL47.js';
3
+ import './index-280bL-n4.js';
4
+ import { A as addSchemaToDb, k as isDataType, M as ModelPropertyDataTypes, s as addModelsToDb, E as loadModelsFromDbForSchema } from './db-WbrzEf7c.js';
5
+ import { D as SEED_PROTOCOL_SCHEMA_NAME, a as BaseDb, s as schemas, m as models, i as modelSchemas, p as properties, B as BaseFileManager, J as isInternalSchema } from './BasePathResolver-B6CKqoKw.js';
6
6
  import { eq, desc, and } from 'drizzle-orm';
7
7
  import debug from 'debug';
8
- import { generateId } from './generateId-BopUwD8F.js';
9
- import { SchemaValidationService } from './SchemaValidationService-Dr6nmwPm.js';
10
- import { M as Model, w as writeProcessMachine, C as ConflictError, s as setupEntityLiveQuery } from './index-BFpbtEsg.js';
11
8
  import 'pluralize';
9
+ import { generateId } from './generateId-BopUwD8F.js';
10
+ import { SchemaValidationService } from './SchemaValidationService-Y49vqast.js';
11
+ import { M as Model, w as writeProcessMachine, C as ConflictError, s as setupEntityLiveQuery } from './index-HRHkbVQd.js';
12
12
 
13
13
  const logger$d = debug('seedSdk:schema:actors:loadOrCreateSchema');
14
14
  /**
@@ -52,7 +52,7 @@ const createModelInstances$2 = async (modelIds) => {
52
52
  return;
53
53
  }
54
54
  try {
55
- const _mod_0 = await import('./index-BFpbtEsg.js');
55
+ const _mod_0 = await import('./index-HRHkbVQd.js');
56
56
  const _ns_0 = _mod_0.b;
57
57
  const modelMod = _ns_0;
58
58
  const { Model } = modelMod;
@@ -167,8 +167,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
167
167
  // For Seed Protocol, always load from internal file, never create new
168
168
  logger$d(`Loading internal Seed Protocol schema from SDK`);
169
169
  try {
170
- const _mod_1 = await import('./ClientManager-Y5EWQuJj.js');
171
- const _ns_1 = _mod_1.ah;
170
+ const _mod_1 = await import('./ClientManager-ChcmUL47.js');
171
+ const _ns_1 = _mod_1.ao;
172
172
  const internalSchema = _ns_1;
173
173
  const schemaFile = internalSchema.default;
174
174
  // Check if it exists in database, if not, add it
@@ -217,7 +217,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
217
217
  }
218
218
  // Handle List type (case-insensitive refValueType)
219
219
  const listRefValueType = getRefValueType(schemaProp);
220
- if (schemaProp.dataType === 'List' && listRefValueType) {
220
+ if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && listRefValueType) {
221
221
  jsonProp.refValueType = listRefValueType;
222
222
  if (schemaProp.ref || schemaProp.refModelName) {
223
223
  jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
@@ -359,7 +359,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
359
359
  jsonProp.model = schemaProp.refModelName || schemaProp.ref;
360
360
  }
361
361
  // Handle List type (support both refValueType and legacy items, case-insensitive)
362
- if (schemaProp.dataType === 'List' || schemaProp.type === 'List') {
362
+ if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) || isDataType(schemaProp.type, ModelPropertyDataTypes.List)) {
363
363
  const refValueType = getRefValueType(schemaProp);
364
364
  if (refValueType) {
365
365
  jsonProp.refValueType = refValueType;
@@ -662,8 +662,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
662
662
  // Ensure models are populated (fallback for seed-protocol if missing)
663
663
  if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
664
664
  try {
665
- const _mod_2 = await import('./ClientManager-Y5EWQuJj.js');
666
- const _ns_2 = _mod_2.ah;
665
+ const _mod_2 = await import('./ClientManager-ChcmUL47.js');
666
+ const _ns_2 = _mod_2.ao;
667
667
  const internalSchema = _ns_2;
668
668
  const internalSchemaFile = internalSchema.default;
669
669
  mergedModels = { ...(internalSchemaFile.models || {}) };
@@ -891,8 +891,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
891
891
  // Ensure models are populated (fallback for seed-protocol if missing)
892
892
  if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
893
893
  try {
894
- const _mod_3 = await import('./ClientManager-Y5EWQuJj.js');
895
- const _ns_3 = _mod_3.ah;
894
+ const _mod_3 = await import('./ClientManager-ChcmUL47.js');
895
+ const _ns_3 = _mod_3.ao;
896
896
  const internalSchema = _ns_3;
897
897
  const internalSchemaFile = internalSchema.default;
898
898
  mergedModels = { ...(internalSchemaFile.models || {}) };
@@ -982,8 +982,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
982
982
  // Ensure models are populated (fallback for seed-protocol if missing)
983
983
  if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
984
984
  try {
985
- const _mod_4 = await import('./ClientManager-Y5EWQuJj.js');
986
- const _ns_4 = _mod_4.ah;
985
+ const _mod_4 = await import('./ClientManager-ChcmUL47.js');
986
+ const _ns_4 = _mod_4.ao;
987
987
  const internalSchema = _ns_4;
988
988
  const internalSchemaFile = internalSchema.default;
989
989
  mergedModels = { ...(internalSchemaFile.models || {}) };
@@ -1070,8 +1070,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
1070
1070
  // If schemaData is missing, try to load from internal schema file for seed-protocol
1071
1071
  if (!dbSchema.schemaData && schemaName === 'Seed Protocol') {
1072
1072
  try {
1073
- const _mod_5 = await import('./ClientManager-Y5EWQuJj.js');
1074
- const _ns_5 = _mod_5.ah;
1073
+ const _mod_5 = await import('./ClientManager-ChcmUL47.js');
1074
+ const _ns_5 = _mod_5.ao;
1075
1075
  const internalSchema = _ns_5;
1076
1076
  const schemaFile = internalSchema.default;
1077
1077
  logger$d(`Found seed-protocol schema in internal file (schemaData missing, using internal schema)`);
@@ -1181,8 +1181,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
1181
1181
  // Ensure models are populated (fallback for seed-protocol if missing)
1182
1182
  if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
1183
1183
  try {
1184
- const _mod_6 = await import('./ClientManager-Y5EWQuJj.js');
1185
- const _ns_6 = _mod_6.ah;
1184
+ const _mod_6 = await import('./ClientManager-ChcmUL47.js');
1185
+ const _ns_6 = _mod_6.ao;
1186
1186
  const internalSchema = _ns_6;
1187
1187
  const internalSchemaFile = internalSchema.default;
1188
1188
  mergedModels = { ...(internalSchemaFile.models || {}) };
@@ -1821,7 +1821,7 @@ const addModelsMachine = setup({
1821
1821
  jsonProp.model = schemaProp.refModelName || schemaProp.ref;
1822
1822
  }
1823
1823
  // Handle List type
1824
- if (schemaProp.dataType === 'List' && schemaProp.refValueType) {
1824
+ if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && schemaProp.refValueType) {
1825
1825
  jsonProp.refValueType = schemaProp.refValueType;
1826
1826
  if (schemaProp.ref || schemaProp.refModelName) {
1827
1827
  jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
@@ -2084,7 +2084,7 @@ const createModelInstances$1 = async (modelIds) => {
2084
2084
  return;
2085
2085
  }
2086
2086
  try {
2087
- const _mod_7 = await import('./index-BFpbtEsg.js');
2087
+ const _mod_7 = await import('./index-HRHkbVQd.js');
2088
2088
  const _ns_7 = _mod_7.b;
2089
2089
  const mod = _ns_7;
2090
2090
  const Model = mod?.Model ?? mod?.default;
@@ -2131,8 +2131,8 @@ const checkExistingSchema = fromCallback(({ sendBack, input: { context } }) => {
2131
2131
  if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
2132
2132
  // For Seed Protocol, check if it exists in database
2133
2133
  try {
2134
- const _mod_8 = await import('./ClientManager-Y5EWQuJj.js');
2135
- const _ns_8 = _mod_8.ah;
2134
+ const _mod_8 = await import('./ClientManager-ChcmUL47.js');
2135
+ const _ns_8 = _mod_8.ao;
2136
2136
  const internalSchema = _ns_8;
2137
2137
  const schemaFile = internalSchema.default;
2138
2138
  if (db && schemaFile.id) {
@@ -2491,8 +2491,8 @@ const writeSchemaToDb = fromCallback(({ sendBack, input }) => {
2491
2491
  if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
2492
2492
  // For Seed Protocol, load from internal file
2493
2493
  logger$b(`Loading internal Seed Protocol schema from SDK`);
2494
- const _mod_9 = await import('./ClientManager-Y5EWQuJj.js');
2495
- const _ns_9 = _mod_9.ah;
2494
+ const _mod_9 = await import('./ClientManager-ChcmUL47.js');
2495
+ const _ns_9 = _mod_9.ao;
2496
2496
  const internalSchema = _ns_9;
2497
2497
  finalSchema = internalSchema.default;
2498
2498
  const db = BaseDb.getAppDb();
@@ -2759,7 +2759,7 @@ const writeModelsToDb = fromCallback(({ sendBack, input }) => {
2759
2759
  jsonProp.model = schemaProp.refModelName || schemaProp.ref;
2760
2760
  }
2761
2761
  // Handle List type
2762
- if (schemaProp.dataType === 'List' && schemaProp.refValueType) {
2762
+ if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && schemaProp.refValueType) {
2763
2763
  jsonProp.refValueType = schemaProp.refValueType;
2764
2764
  if (schemaProp.ref || schemaProp.refModelName) {
2765
2765
  jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
@@ -2961,7 +2961,7 @@ const createModelInstances = fromCallback(({ sendBack, input }) => {
2961
2961
  return;
2962
2962
  }
2963
2963
  try {
2964
- const _mod_10 = await import('./index-BFpbtEsg.js');
2964
+ const _mod_10 = await import('./index-HRHkbVQd.js');
2965
2965
  const _ns_10 = _mod_10.b;
2966
2966
  const modelMod = _ns_10;
2967
2967
  const { Model } = modelMod;
@@ -3049,7 +3049,7 @@ const verifyModelInstancesInCache = fromCallback(({ sendBack, input }) => {
3049
3049
  }
3050
3050
  try {
3051
3051
  const result = await verifyWithRetry$2(async () => {
3052
- const _mod_11 = await import('./index-BFpbtEsg.js');
3052
+ const _mod_11 = await import('./index-HRHkbVQd.js');
3053
3053
  const _ns_11 = _mod_11.b;
3054
3054
  const modelMod = _ns_11;
3055
3055
  const { Model } = modelMod;
@@ -3108,7 +3108,7 @@ const writePropertiesToDb = fromCallback(({ sendBack, input }) => {
3108
3108
  const _write = async () => {
3109
3109
  const { modelIds } = input;
3110
3110
  try {
3111
- const _mod_12 = await import('./BasePathResolver-qV0apdVY.js');
3111
+ const _mod_12 = await import('./BasePathResolver-B6CKqoKw.js');
3112
3112
  const _ns_12 = _mod_12.M;
3113
3113
  const modelSchemaMod = _ns_12;
3114
3114
  const { models: modelsTable, properties: propertiesTable } = modelSchemaMod;
@@ -3298,9 +3298,9 @@ const createPropertyInstances = fromCallback(({ sendBack, input }) => {
3298
3298
  return;
3299
3299
  }
3300
3300
  try {
3301
- const modProp = await import('./ModelProperty-DuB5nk6A.js');
3301
+ const modProp = await import('./ModelProperty-D79uV42p.js');
3302
3302
  const ModelProperty = modProp?.ModelProperty ?? modProp?.default;
3303
- const _mod_13 = await import('./index-BFpbtEsg.js');
3303
+ const _mod_13 = await import('./index-HRHkbVQd.js');
3304
3304
  const _ns_13 = _mod_13.b;
3305
3305
  const modModel = _ns_13;
3306
3306
  const Model = modModel?.Model ?? modModel?.default;
@@ -3407,7 +3407,7 @@ const verifyPropertyInstancesInCache = fromCallback(({ sendBack, input }) => {
3407
3407
  }
3408
3408
  try {
3409
3409
  const result = await verifyWithRetry(async () => {
3410
- const mod = await import('./ModelProperty-DuB5nk6A.js');
3410
+ const mod = await import('./ModelProperty-D79uV42p.js');
3411
3411
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
3412
3412
  if (!ModelProperty) {
3413
3413
  throw new Error('ModelProperty not available from dynamic import');
@@ -4300,7 +4300,7 @@ async function updateModelProperties(schemaName, propertyUpdates, modelUpdates)
4300
4300
  if (property.model === modelUpdate.oldName) {
4301
4301
  property.model = modelUpdate.newName;
4302
4302
  }
4303
- if (property.ref === modelUpdate.oldName && (property.type === 'List' || property.dataType === 'List')) {
4303
+ if (property.ref === modelUpdate.oldName && (isDataType(property.type, ModelPropertyDataTypes.List) || isDataType(property.dataType, ModelPropertyDataTypes.List))) {
4304
4304
  property.ref = modelUpdate.newName;
4305
4305
  }
4306
4306
  // Legacy: items.model
@@ -4429,8 +4429,8 @@ async function loadSchemaWithRenames(schemaFilePath, modelRenames) {
4429
4429
  updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
4430
4430
  };
4431
4431
  // Use dynamic import to break circular dependency
4432
- const _mod_14 = await import('./db-CceyWksv.js');
4433
- const _ns_14 = _mod_14.q;
4432
+ const _mod_14 = await import('./db-WbrzEf7c.js');
4433
+ const _ns_14 = _mod_14.Q;
4434
4434
  const dbMod = _ns_14;
4435
4435
  const { addSchemaToDb, addModelsToDb } = dbMod;
4436
4436
  // Add schema to database with schemaFileId
@@ -4542,8 +4542,8 @@ async function renameModelProperty(schemaName, modelName, oldPropertyName, newPr
4542
4542
  await BaseFileManager.waitForFileWithContent(newFilePath);
4543
4543
  logger$1(`Renamed property ${oldPropertyName} to ${newPropertyName} in schema ${schemaName} v${newVersion}`);
4544
4544
  // Migrate metadata rows so ItemProperty values follow the new name (prevents duplicate ItemProperties)
4545
- const _mod_15 = await import('./db-CceyWksv.js');
4546
- const _ns_15 = _mod_15.q;
4545
+ const _mod_15 = await import('./db-WbrzEf7c.js');
4546
+ const _ns_15 = _mod_15.Q;
4547
4547
  const { migrateMetadataForPropertyRename } = _ns_15;
4548
4548
  const migratedCount = await migrateMetadataForPropertyRename(modelName, oldPropertyName, newPropertyName, oldProperty.id);
4549
4549
  if (migratedCount > 0) {
@@ -4644,7 +4644,7 @@ async function deleteModelFromSchema(schemaName, modelName, options = {}) {
4644
4644
  if (property.model === modelName) {
4645
4645
  delete property.model;
4646
4646
  }
4647
- if (property.ref === modelName && (property.type === 'List' || property.dataType === 'List')) {
4647
+ if (property.ref === modelName && (isDataType(property.type, ModelPropertyDataTypes.List) || isDataType(property.dataType, ModelPropertyDataTypes.List))) {
4648
4648
  delete property.ref;
4649
4649
  }
4650
4650
  if (property.items?.model === modelName) {
@@ -5753,7 +5753,7 @@ class Schema {
5753
5753
  _dbVersion: publishedSchema.version,
5754
5754
  });
5755
5755
  // Clear edited flags on all ModelProperty instances and in database
5756
- const modelPropertyMod = await import('./ModelProperty-DuB5nk6A.js');
5756
+ const modelPropertyMod = await import('./ModelProperty-D79uV42p.js');
5757
5757
  const { ModelProperty } = modelPropertyMod;
5758
5758
  for (const propertyKey of context._editedProperties) {
5759
5759
  const [modelName, propertyName] = propertyKey.split(':');
@@ -6556,4 +6556,4 @@ var Schema$1 = /*#__PURE__*/Object.freeze({
6556
6556
  });
6557
6557
 
6558
6558
  export { Schema as S, deletePropertyFromModel as a, Schema$1 as b, deleteModelFromSchema as d, renameModelProperty as r, schemaMachine as s, updateModelProperties as u };
6559
- //# sourceMappingURL=Schema-BYM-GNdE.js.map
6559
+ //# sourceMappingURL=Schema-a8uO-hIZ.js.map