@seedprotocol/sdk 0.7.1 → 0.7.2

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 (113) hide show
  1. package/dist/{BasePathResolver-DRT09oVv.js → BasePathResolver-BdxCSIzn.js} +2 -2
  2. package/dist/{BasePathResolver-DRT09oVv.js.map → BasePathResolver-BdxCSIzn.js.map} +1 -1
  3. package/dist/{ClientManager-DngaZdw6.js → ClientManager-ClCwwhwo.js} +27 -22
  4. package/dist/ClientManager-ClCwwhwo.js.map +1 -0
  5. package/dist/{Item-ZUAmf943.js → Item-B9Y4VuK1.js} +75 -55
  6. package/dist/Item-B9Y4VuK1.js.map +1 -0
  7. package/dist/{ModelProperty-6llK4MTH.js → ModelProperty-BMePcicQ.js} +26 -27
  8. package/dist/ModelProperty-BMePcicQ.js.map +1 -0
  9. package/dist/{Schema-D-Ud-XYw.js → Schema-COsEXXaR.js} +30 -31
  10. package/dist/{Schema-D-Ud-XYw.js.map → Schema-COsEXXaR.js.map} +1 -1
  11. package/dist/{SchemaValidationService-IoS7JquP.js → SchemaValidationService-DabGMzSE.js} +7 -8
  12. package/dist/{SchemaValidationService-IoS7JquP.js.map → SchemaValidationService-DabGMzSE.js.map} +1 -1
  13. package/dist/{backfillMetadataPropertyIds-BlVeE7w7.js → backfillMetadataPropertyIds-Ck6fumnm.js} +4 -4
  14. package/dist/{backfillMetadataPropertyIds-BlVeE7w7.js.map → backfillMetadataPropertyIds-Ck6fumnm.js.map} +1 -1
  15. package/dist/cjs/{ModelProperty-Dv7AQfmQ.js → ModelProperty-BT6Un_MB.js} +21 -21
  16. package/dist/cjs/{ModelProperty-Dv7AQfmQ.js.map → ModelProperty-BT6Un_MB.js.map} +1 -1
  17. package/dist/cjs/{Schema-BHVp1g-M.js → Schema-BXhXdUsA.js} +23 -23
  18. package/dist/cjs/{Schema-BHVp1g-M.js.map → Schema-BXhXdUsA.js.map} +1 -1
  19. package/dist/cjs/{SchemaValidationService-BSU9knjf.js → SchemaValidationService-CC18QDfc.js} +2 -2
  20. package/dist/cjs/{SchemaValidationService-BSU9knjf.js.map → SchemaValidationService-CC18QDfc.js.map} +1 -1
  21. package/dist/cjs/{backfillMetadataPropertyIds-WIovQ_d8.js → backfillMetadataPropertyIds-DEHC9ejq.js} +3 -3
  22. package/dist/cjs/{backfillMetadataPropertyIds-WIovQ_d8.js.map → backfillMetadataPropertyIds-DEHC9ejq.js.map} +1 -1
  23. package/dist/cjs/{eas-CUYXdr2t.js → eas-C3CL0l7l.js} +3 -3
  24. package/dist/cjs/{eas-CUYXdr2t.js.map → eas-C3CL0l7l.js.map} +1 -1
  25. package/dist/cjs/{getItem-z1tHu0hu.js → getItem-CrwWYCkj.js} +2 -2
  26. package/dist/cjs/{getItem-z1tHu0hu.js.map → getItem-CrwWYCkj.js.map} +1 -1
  27. package/dist/cjs/{getPublishPayload-CEP_e-Kv.js → getPublishPayload-DRJh7WR0.js} +22 -16
  28. package/dist/cjs/getPublishPayload-DRJh7WR0.js.map +1 -0
  29. package/dist/cjs/{getPublishUploads-Ctn5k1k6.js → getPublishUploads-Bh22D3zJ.js} +4 -4
  30. package/dist/cjs/{getPublishUploads-Ctn5k1k6.js.map → getPublishUploads-Bh22D3zJ.js.map} +1 -1
  31. package/dist/cjs/{index-DfGhF1dc.js → index-BA1RIYFG.js} +3 -3
  32. package/dist/cjs/index-BA1RIYFG.js.map +1 -0
  33. package/dist/cjs/{index-Cvvt0-5B.js → index-Dls7aMjr.js} +74 -40
  34. package/dist/cjs/index-Dls7aMjr.js.map +1 -0
  35. package/dist/cjs/{property-DbEPQ1m9.js → property-ZerTWizX.js} +5 -5
  36. package/dist/cjs/{property-DbEPQ1m9.js.map → property-ZerTWizX.js.map} +1 -1
  37. package/dist/cjs/{publishDraftGraph-C38gf302.js → publishDraftGraph-CPOAcQFf.js} +4 -4
  38. package/dist/cjs/{publishDraftGraph-C38gf302.js.map → publishDraftGraph-CPOAcQFf.js.map} +1 -1
  39. package/dist/cjs/{resetAmbiguousLegacyItemData-CfMhRHwK.js → resetAmbiguousLegacyItemData-adDl4LcT.js} +2 -2
  40. package/dist/cjs/{resetAmbiguousLegacyItemData-CfMhRHwK.js.map → resetAmbiguousLegacyItemData-adDl4LcT.js.map} +1 -1
  41. package/dist/cjs/{resolveModelForSyncedSeed-CNYaLOir.js → resolveModelForSyncedSeed-DoNThPdL.js} +2 -2
  42. package/dist/cjs/{resolveModelForSyncedSeed-CNYaLOir.js.map → resolveModelForSyncedSeed-DoNThPdL.js.map} +1 -1
  43. package/dist/cjs/{syncDbWithEas-d1iOdTTI.js → syncDbWithEas-CYfPkus9.js} +7 -7
  44. package/dist/cjs/{syncDbWithEas-d1iOdTTI.js.map → syncDbWithEas-CYfPkus9.js.map} +1 -1
  45. package/dist/{configurePlatform-CZpjyuCo.js → configurePlatform-xU3Hsno3.js} +4 -4
  46. package/dist/{configurePlatform-CZpjyuCo.js.map → configurePlatform-xU3Hsno3.js.map} +1 -1
  47. package/dist/{db-Lw0KVZmc.js → db-W1g29qsM.js} +30 -26
  48. package/dist/{db-Lw0KVZmc.js.map → db-W1g29qsM.js.map} +1 -1
  49. package/dist/{eas-CQ-Smzk2.js → eas-CSwV6MvB.js} +5 -5
  50. package/dist/{eas-CQ-Smzk2.js.map → eas-CSwV6MvB.js.map} +1 -1
  51. package/dist/{getItem-CSfSok9f.js → getItem-BYQeM3DY.js} +5 -6
  52. package/dist/{getItem-CSfSok9f.js.map → getItem-BYQeM3DY.js.map} +1 -1
  53. package/dist/{getPublishPayload-76_KfB5Y.js → getPublishPayload-D5CQZd-y.js} +27 -21
  54. package/dist/getPublishPayload-D5CQZd-y.js.map +1 -0
  55. package/dist/{getPublishUploads-CqgMBD8f.js → getPublishUploads-BGpDsrBp.js} +9 -10
  56. package/dist/{getPublishUploads-CqgMBD8f.js.map → getPublishUploads-BGpDsrBp.js.map} +1 -1
  57. package/dist/{index-BpgD305l.js → index-Bev-hZF-.js} +9 -10
  58. package/dist/index-Bev-hZF-.js.map +1 -0
  59. package/dist/{index-5b3JsS55.js → index-CSOQFAOn.js} +2 -2
  60. package/dist/index-CSOQFAOn.js.map +1 -0
  61. package/dist/{index-Y-yYyRBf.js → index-DRXC5Mra.js} +38 -37
  62. package/dist/{index-Y-yYyRBf.js.map → index-DRXC5Mra.js.map} +1 -1
  63. package/dist/{index.browser-DaTzn79x.js → index.browser-DO20vYuP.js} +8 -8
  64. package/dist/{index.browser-DaTzn79x.js.map → index.browser-DO20vYuP.js.map} +1 -1
  65. package/dist/{index.node-NYKqFOoe.js → index.node-C4iyOhdo.js} +5 -5
  66. package/dist/{index.node-NYKqFOoe.js.map → index.node-C4iyOhdo.js.map} +1 -1
  67. package/dist/main.cjs +1 -1
  68. package/dist/main.js +28 -29
  69. package/dist/main.js.map +1 -1
  70. package/dist/node.js +14 -15
  71. package/dist/node.js.map +1 -1
  72. package/dist/platform.browser.js +5 -5
  73. package/dist/platform.node.js +3 -3
  74. package/dist/{property-ByaiSyUK.js → property-BT1zDSkd.js} +9 -10
  75. package/dist/property-BT1zDSkd.js.map +1 -0
  76. package/dist/{publishDraftGraph-BRm6Pq3Q.js → publishDraftGraph-Bcfrdj7-.js} +8 -8
  77. package/dist/{publishDraftGraph-BRm6Pq3Q.js.map → publishDraftGraph-Bcfrdj7-.js.map} +1 -1
  78. package/dist/{resetAmbiguousLegacyItemData-B4dX6ZA1.js → resetAmbiguousLegacyItemData-Ci6PM_vC.js} +2 -2
  79. package/dist/{resetAmbiguousLegacyItemData-B4dX6ZA1.js.map → resetAmbiguousLegacyItemData-Ci6PM_vC.js.map} +1 -1
  80. package/dist/{resolveModelForSyncedSeed-B0tco3zG.js → resolveModelForSyncedSeed-CLlumTBq.js} +2 -2
  81. package/dist/{resolveModelForSyncedSeed-B0tco3zG.js.map → resolveModelForSyncedSeed-CLlumTBq.js.map} +1 -1
  82. package/dist/src/Item/Item.d.ts.map +1 -1
  83. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  84. package/dist/src/helpers/generateId.d.ts +4 -0
  85. package/dist/src/helpers/generateId.d.ts.map +1 -1
  86. package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
  87. package/dist/{syncDbWithEas-BPap9Sru.js → syncDbWithEas-BQsXjGhe.js} +13 -14
  88. package/dist/syncDbWithEas-BQsXjGhe.js.map +1 -0
  89. package/dist/{tabEvents-C6NXS6Jl.js → tabEvents-C9qUKx_z.js} +28 -11
  90. package/dist/tabEvents-C9qUKx_z.js.map +1 -0
  91. package/dist/{tolerantWebAccess-NBQ1NB4i.js → tolerantWebAccess-B-9bwxbw.js} +6 -6
  92. package/dist/{tolerantWebAccess-NBQ1NB4i.js.map → tolerantWebAccess-B-9bwxbw.js.map} +1 -1
  93. package/dist/{updateSeedRevokedAt-CYwgVNlM.js → updateSeedRevokedAt-D6q0h7pj.js} +3 -3
  94. package/dist/{updateSeedRevokedAt-CYwgVNlM.js.map → updateSeedRevokedAt-D6q0h7pj.js.map} +1 -1
  95. package/package.json +10 -5
  96. package/dist/ClientManager-DngaZdw6.js.map +0 -1
  97. package/dist/Item-ZUAmf943.js.map +0 -1
  98. package/dist/ModelProperty-6llK4MTH.js.map +0 -1
  99. package/dist/cjs/getLatestVersionRow-CcaabxIW.js +0 -59
  100. package/dist/cjs/getLatestVersionRow-CcaabxIW.js.map +0 -1
  101. package/dist/cjs/getPublishPayload-CEP_e-Kv.js.map +0 -1
  102. package/dist/cjs/index-Cvvt0-5B.js.map +0 -1
  103. package/dist/cjs/index-DfGhF1dc.js.map +0 -1
  104. package/dist/generateId-BopUwD8F.js +0 -9
  105. package/dist/generateId-BopUwD8F.js.map +0 -1
  106. package/dist/getLatestVersionRow-72Atl9vB.js +0 -46
  107. package/dist/getLatestVersionRow-72Atl9vB.js.map +0 -1
  108. package/dist/getPublishPayload-76_KfB5Y.js.map +0 -1
  109. package/dist/index-5b3JsS55.js.map +0 -1
  110. package/dist/index-BpgD305l.js.map +0 -1
  111. package/dist/property-ByaiSyUK.js.map +0 -1
  112. package/dist/syncDbWithEas-BPap9Sru.js.map +0 -1
  113. package/dist/tabEvents-C6NXS6Jl.js.map +0 -1
@@ -1,16 +1,15 @@
1
1
  import { waitFor, fromCallback, setup, assign, stateIn, createActor, isMachineSnapshot } from 'xstate';
2
- import { B as BaseDb, v as versions, m as metadata, r as seeds, s as schemas, j as models, g as modelSchemas, Z as ZERO_BYTES32, I as INTERNAL_PROPERTY_NAMES, a as BaseFileManager, D as ImageSize, p as properties, x as INTERNAL_DATA_TYPES, i as modelUids, C as INTERNAL_STORAGE_MODEL_FILE_IDS, P as PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP } from './BasePathResolver-DRT09oVv.js';
2
+ import { a as BaseDb, v as versions, m as metadata, r as seeds, s as schemas, j as models, g as modelSchemas, Z as ZERO_BYTES32, I as INTERNAL_PROPERTY_NAMES, B as BaseFileManager, D as ImageSize, p as properties, x as INTERNAL_DATA_TYPES, i as modelUids, C as INTERNAL_STORAGE_MODEL_FILE_IDS, P as PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP } from './BasePathResolver-BdxCSIzn.js';
3
3
  import { or, isNull, eq, max, count, and, getTableColumns, sql, desc, inArray, isNotNull, gt } from 'drizzle-orm';
4
4
  import pluralize from 'pluralize';
5
- import { n as normalizeDataType, W as getOwnedAddressesFromDb, E as normalizeAddressList, u as normalizeHexAddress, z as getAddressesForItemsFilter, k as isDataType, s as normalizePublisher, M as ModelPropertyDataTypes, r as resolveItemModelFileId, X as getPropertyIdForSchemaFileId, o as getPropertyIdForModelAndName, l as normalizePropertyRecordSchema, m as eventEmitter } from './db-Lw0KVZmc.js';
5
+ import { n as normalizeDataType, W as getOwnedAddressesFromDb, E as normalizeAddressList, u as normalizeHexAddress, z as getAddressesForItemsFilter, k as isDataType, s as normalizePublisher, M as ModelPropertyDataTypes, r as resolveItemModelFileId, X as getPropertyIdForSchemaFileId, o as getPropertyIdForModelAndName, l as normalizePropertyRecordSchema, m as eventEmitter } from './db-W1g29qsM.js';
6
6
  import debug from 'debug';
7
7
  import { BehaviorSubject } from 'rxjs';
8
8
  import { startCase, upperFirst, camelCase, orderBy } from 'lodash-es';
9
9
  import { toSnakeCase } from 'drizzle-orm/casing';
10
10
  import { isValidEasAttestationUid, isPlaceholderUid, BaseQueryClient, BaseEasClient, GET_SCHEMAS, getEasSchemaUidForSchemaDefinition, getSchemaUidForModelFromCache, cachedSchemaLookup, setSchemaUidForModel, getEasSchemaUidForExactDefinition } from '@seedprotocol/eas';
11
- import { t as toSnakeCase$1, G as getStorageTransactionIdForSeedUid, H as convertTxIdToImage, f as ensureImageLocal, I as downloadTransactionIdWithDedupe, J as getDataTypeFromString, K as getMimeType, M as notifyFileSaved, g as getCorrectId, a as isStorageSeedRef } from './tabEvents-C6NXS6Jl.js';
11
+ import { t as toSnakeCase$1, H as getStorageTransactionIdForSeedUid, I as convertTxIdToImage, h as ensureImageLocal, J as downloadTransactionIdWithDedupe, b as generateId, K as getDataTypeFromString, M as getMimeType, N as notifyFileSaved, g as getCorrectId, a as isStorageSeedRef } from './tabEvents-C9qUKx_z.js';
12
12
  import { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave';
13
- import { generateId } from './generateId-BopUwD8F.js';
14
13
  import { modelPropertiesToObject } from './model-DGMe-TTm.js';
15
14
 
16
15
  /**
@@ -709,7 +708,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
709
708
  const itemPropertyMod = await Promise.resolve().then(function () { return ItemProperty$1; });
710
709
  const { ItemProperty } = itemPropertyMod;
711
710
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
712
- const _mod_0 = await import('./index-Y-yYyRBf.js');
711
+ const _mod_0 = await import('./index-DRXC5Mra.js');
713
712
  const _ns_0 = _mod_0.f;
714
713
  const { Model } = _ns_0;
715
714
  // Resolve Model and build property schemas (use getByNameAsync for models not yet in cache)
@@ -727,7 +726,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
727
726
  const schemaNameToTry = schemaName ?? model?.schemaName;
728
727
  if (schemaNameToTry) {
729
728
  try {
730
- const _mod_1 = await import('./Schema-D-Ud-XYw.js');
729
+ const _mod_1 = await import('./Schema-COsEXXaR.js');
731
730
  const _ns_1 = _mod_1.b;
732
731
  const { Schema } = _ns_1;
733
732
  const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
@@ -743,7 +742,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
743
742
  }
744
743
  if (Object.keys(propertySchemas).length === 0) {
745
744
  try {
746
- const _mod_2 = await import('./ClientManager-DngaZdw6.js');
745
+ const _mod_2 = await import('./ClientManager-ClCwwhwo.js');
747
746
  const _ns_2 = _mod_2.G;
748
747
  const { loadAllSchemasFromDb } = _ns_2;
749
748
  const allSchemas = await loadAllSchemasFromDb();
@@ -764,10 +763,10 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
764
763
  }
765
764
  if (Object.keys(propertySchemas).length === 0) {
766
765
  try {
767
- const _mod_3 = await import('./ClientManager-DngaZdw6.js');
766
+ const _mod_3 = await import('./ClientManager-ClCwwhwo.js');
768
767
  const _ns_3 = _mod_3.G;
769
768
  const { listCompleteSchemaFiles } = _ns_3;
770
- const _mod_4 = await import('./BasePathResolver-DRT09oVv.js');
769
+ const _mod_4 = await import('./BasePathResolver-BdxCSIzn.js');
771
770
  const _ns_4 = _mod_4.O;
772
771
  const { BaseFileManager } = _ns_4;
773
772
  const schemaFiles = await listCompleteSchemaFiles();
@@ -788,7 +787,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
788
787
  }
789
788
  }
790
789
  if (Object.keys(propertySchemas).length === 0) {
791
- const schemaMod = await import('./index-BpgD305l.js');
790
+ const schemaMod = await import('./index-Bev-hZF-.js');
792
791
  const { ModelPropertyDataTypes } = schemaMod;
793
792
  const KNOWN_MODEL_FALLBACKS = {
794
793
  Post: {
@@ -805,7 +804,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
805
804
  }
806
805
  }
807
806
  // Fallbacks above may return schema-file shape ({ type, model, items }); normalize to dataType/ref/refValueType.
808
- const { normalizePropertyRecordSchema } = await import('./property-ByaiSyUK.js');
807
+ const { normalizePropertyRecordSchema } = await import('./property-BT1zDSkd.js');
809
808
  propertySchemas = Object.fromEntries(Object.entries(propertySchemas).map(([name, def]) => [name, normalizePropertyRecordSchema(def)]));
810
809
  // Collapse rows that map to the same instance key (e.g. authorIdentityIds + authors -> authors).
811
810
  // ItemProperty.create cache does not sync propertyValue on hit; processing order would otherwise
@@ -838,7 +837,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
838
837
  // Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
839
838
  let propSchema = propertySchemas[propertyName];
840
839
  if (!propSchema && isRefTypeFromMeta) {
841
- const schemaMod = await import('./index-BpgD305l.js');
840
+ const schemaMod = await import('./index-Bev-hZF-.js');
842
841
  const { ModelPropertyDataTypes } = schemaMod;
843
842
  propSchema = {
844
843
  dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
@@ -1105,9 +1104,9 @@ const runPublish = fromCallback(({ sendBack, input: { context } }) => {
1105
1104
  sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
1106
1105
  return;
1107
1106
  }
1108
- const getPublishUploadsMod = await import('./getPublishUploads-CqgMBD8f.js');
1107
+ const getPublishUploadsMod = await import('./getPublishUploads-BGpDsrBp.js');
1109
1108
  const { getPublishUploads } = getPublishUploadsMod;
1110
- const _mod_5 = await import('./getPublishPayload-76_KfB5Y.js');
1109
+ const _mod_5 = await import('./getPublishPayload-D5CQZd-y.js');
1111
1110
  const _ns_5 = _mod_5.g;
1112
1111
  const getPublishPayloadMod = _ns_5;
1113
1112
  const { getPublishPayload } = getPublishPayloadMod;
@@ -1808,7 +1807,7 @@ const getItemsData = async ({ modelName, modelFileId, schemaName, deleted, inclu
1808
1807
  conditions.push(eq(seeds.type, toSnakeCase(modelName)));
1809
1808
  }
1810
1809
  if (!modelFileId && schemaName && modelName) {
1811
- const _mod_6 = await import('./db-Lw0KVZmc.js');
1810
+ const _mod_6 = await import('./db-W1g29qsM.js');
1812
1811
  const _ns_6 = _mod_6.Y;
1813
1812
  const { resolveModelRecord } = _ns_6;
1814
1813
  modelFileId = (await resolveModelRecord(modelName, { schemaName }))?.schemaFileId ?? undefined;
@@ -1874,6 +1873,29 @@ const getItemsData = async ({ modelName, modelFileId, schemaName, deleted, inclu
1874
1873
  });
1875
1874
  };
1876
1875
 
1876
+ /**
1877
+ * The seed's head version row: newest by (created_at DESC, local_id DESC), attested or not, skipping
1878
+ * revoked versions. Null when the seed has no version or every version is revoked (a fully
1879
+ * unpublished item). Same choice as `latestVersionLocalId` in the `getVersionData` subquery.
1880
+ */
1881
+ async function getLatestVersionRow(seedLocalId) {
1882
+ const appDb = BaseDb.getAppDb();
1883
+ if (!appDb || !seedLocalId)
1884
+ return null;
1885
+ const rows = await appDb
1886
+ .select({
1887
+ localId: versions.localId,
1888
+ uid: versions.uid,
1889
+ createdAt: versions.createdAt,
1890
+ attestationCreatedAt: versions.attestationCreatedAt,
1891
+ })
1892
+ .from(versions)
1893
+ .where(and(eq(versions.seedLocalId, seedLocalId), versionNotRevoked()))
1894
+ .orderBy(desc(versions.createdAt), desc(versions.localId))
1895
+ .limit(1);
1896
+ return rows[0] ?? null;
1897
+ }
1898
+
1877
1899
  const logger$5 = debug('seedSdk:ItemProperty:service:actors:waitForDb');
1878
1900
  const waitForDb = fromCallback(({ sendBack }) => {
1879
1901
  // Check immediately first
@@ -2068,7 +2090,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
2068
2090
  const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
2069
2091
  const _resolveRelatedValue = async () => {
2070
2092
  // Use dynamic import to break circular dependency
2071
- const schemaMod = await import('./index-BpgD305l.js');
2093
+ const schemaMod = await import('./index-Bev-hZF-.js');
2072
2094
  const { ModelPropertyDataTypes } = schemaMod;
2073
2095
  if (!propertyValue || !isRelation || populatedFromDb) {
2074
2096
  return;
@@ -2503,8 +2525,8 @@ async function readHtmlBodyFromChildStorageArweave(seedLocalId) {
2503
2525
  /* offline / bad tx id */
2504
2526
  }
2505
2527
  try {
2506
- const _mod_7 = await import('./tabEvents-C6NXS6Jl.js');
2507
- const _ns_7 = _mod_7.N;
2528
+ const _mod_7 = await import('./tabEvents-C9qUKx_z.js');
2529
+ const _ns_7 = _mod_7.O;
2508
2530
  const { downloadTransactionIdWithDedupe } = _ns_7;
2509
2531
  await downloadTransactionIdWithDedupe(txId);
2510
2532
  const retryFp = BaseFileManager.getFilesPath('html', `${seedLocalId}.html`);
@@ -2564,7 +2586,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
2564
2586
  // to use dynamically imported ModelPropertyDataTypes
2565
2587
  const _hydrateFromDb = async () => {
2566
2588
  // Use dynamic import to break circular dependency
2567
- const schemaMod = await import('./index-BpgD305l.js');
2589
+ const schemaMod = await import('./index-Bev-hZF-.js');
2568
2590
  const { ModelPropertyDataTypes } = schemaMod;
2569
2591
  const appDb = BaseDb.getAppDb();
2570
2592
  const whereClauses = [];
@@ -2843,11 +2865,11 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
2843
2865
  const modelNameForNew = context.modelName;
2844
2866
  if (modelNameForNew) {
2845
2867
  try {
2846
- const _mod_8 = await import('./index-Y-yYyRBf.js');
2868
+ const _mod_8 = await import('./index-DRXC5Mra.js');
2847
2869
  const _ns_8 = _mod_8.f;
2848
2870
  const { Model } = _ns_8;
2849
2871
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
2850
- const _mod_9 = await import('./db-Lw0KVZmc.js');
2872
+ const _mod_9 = await import('./db-W1g29qsM.js');
2851
2873
  const _ns_9 = _mod_9.Y;
2852
2874
  const { resolveItemModelFileId } = _ns_9;
2853
2875
  const normalizedModelName = upperFirst(camelCase(modelNameForNew));
@@ -2901,7 +2923,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
2901
2923
  // It ends up in the context below, and later lookups by name (Model.getByName) can't match it.
2902
2924
  const modelName = context.modelName || (metadataRecord.modelType ? upperFirst(camelCase(metadataRecord.modelType)) : undefined);
2903
2925
  // Model names are only unique per schema: pin lookups to the item's own model row.
2904
- const _mod_10 = await import('./db-Lw0KVZmc.js');
2926
+ const _mod_10 = await import('./db-W1g29qsM.js');
2905
2927
  const _ns_10 = _mod_10.Y;
2906
2928
  const { resolveItemModelFileId, resolveModelRecord } = _ns_10;
2907
2929
  const modelFileId = await resolveItemModelFileId({
@@ -2947,16 +2969,16 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
2947
2969
  };
2948
2970
  // Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
2949
2971
  try {
2950
- const { getPropertySchema } = await import('./property-ByaiSyUK.js');
2972
+ const { getPropertySchema } = await import('./property-BT1zDSkd.js');
2951
2973
  let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName, {
2952
2974
  modelFileId: modelRecord?.schemaFileId ?? modelFileId,
2953
2975
  });
2954
2976
  if (!schemaFromFile?.validation) {
2955
2977
  // Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
2956
- const _mod_11 = await import('./BasePathResolver-DRT09oVv.js');
2978
+ const _mod_11 = await import('./BasePathResolver-BdxCSIzn.js');
2957
2979
  const _ns_11 = _mod_11.Q;
2958
2980
  const { schemas: schemasTable } = _ns_11;
2959
- const _mod_12 = await import('./BasePathResolver-DRT09oVv.js');
2981
+ const _mod_12 = await import('./BasePathResolver-BdxCSIzn.js');
2960
2982
  const _ns_12 = _mod_12.R;
2961
2983
  const { modelSchemas } = _ns_12;
2962
2984
  const modelSchemaRows = await db
@@ -2997,7 +3019,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
2997
3019
  }
2998
3020
  if (!propertyRecordSchema && modelName) {
2999
3021
  try {
3000
- const _mod_13 = await import('./index-Y-yYyRBf.js');
3022
+ const _mod_13 = await import('./index-DRXC5Mra.js');
3001
3023
  const _ns_13 = _mod_13.f;
3002
3024
  const { Model } = _ns_13;
3003
3025
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
@@ -3374,9 +3396,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
3374
3396
  }
3375
3397
  const _analyzeInput = async () => {
3376
3398
  // Use dynamic import to break circular dependency
3377
- const schemaMod = await import('./index-BpgD305l.js');
3399
+ const schemaMod = await import('./index-Bev-hZF-.js');
3378
3400
  const { ModelPropertyDataTypes } = schemaMod;
3379
- const { SchemaValidationService } = await import('./SchemaValidationService-IoS7JquP.js');
3401
+ const { SchemaValidationService } = await import('./SchemaValidationService-DabGMzSE.js');
3380
3402
  let propertyName = propertyNameRaw;
3381
3403
  if (!propertyName) {
3382
3404
  throw new Error('propertyName is required');
@@ -3666,7 +3688,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
3666
3688
  propertyRecordSchema?.validation &&
3667
3689
  metadataValues.propertyValue != null &&
3668
3690
  metadataValues.propertyValue !== '') {
3669
- const { SchemaValidationService } = await import('./SchemaValidationService-IoS7JquP.js');
3691
+ const { SchemaValidationService } = await import('./SchemaValidationService-DabGMzSE.js');
3670
3692
  const validationService = new SchemaValidationService();
3671
3693
  const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, normalizeDataType(propertyRecordSchema.dataType), propertyRecordSchema.validation, propertyRecordSchema.refValueType
3672
3694
  ? normalizeDataType(String(propertyRecordSchema.refValueType))
@@ -4248,7 +4270,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
4248
4270
  }
4249
4271
  const _saveRelation = async () => {
4250
4272
  // Use dynamic import to break circular dependency
4251
- const schemaMod = await import('./index-BpgD305l.js');
4273
+ const schemaMod = await import('./index-Bev-hZF-.js');
4252
4274
  const { ModelPropertyDataTypes } = schemaMod;
4253
4275
  if (!propertyNameRaw) {
4254
4276
  throw new Error('propertyName is required');
@@ -4812,10 +4834,10 @@ const getPropertyData = async ({ propertyName, seedLocalId, seedUid, modelName,
4812
4834
  let names = [...getMetadataPropertyNamesForQuery(propertyName)];
4813
4835
  if (modelName) {
4814
4836
  try {
4815
- const _mod_14 = await import('./index-Y-yYyRBf.js');
4837
+ const _mod_14 = await import('./index-DRXC5Mra.js');
4816
4838
  const _ns_14 = _mod_14.f;
4817
4839
  const { Model } = _ns_14;
4818
- const _mod_15 = await import('./db-Lw0KVZmc.js');
4840
+ const _mod_15 = await import('./db-W1g29qsM.js');
4819
4841
  const _ns_15 = _mod_15.Y;
4820
4842
  const { resolveItemModelFileId } = _ns_15;
4821
4843
  // Model names are only unique per schema: use the seed's own model when it is recorded.
@@ -5006,7 +5028,7 @@ const HTML_PROP_SEED_UID_RE = /^0x[a-fA-F0-9]{64}$/;
5006
5028
  */
5007
5029
  const resolvePropertyRecordSchemaFromSchemaData = async (modelName, propertyName, modelType, schemaName) => {
5008
5030
  try {
5009
- const _mod_16 = await import('./ClientManager-DngaZdw6.js');
5031
+ const _mod_16 = await import('./ClientManager-ClCwwhwo.js');
5010
5032
  const _ns_16 = _mod_16.G;
5011
5033
  const { loadAllSchemasFromDb } = _ns_16;
5012
5034
  const allSchemas = await loadAllSchemasFromDb();
@@ -5060,11 +5082,11 @@ hints = {}) => {
5060
5082
  return undefined;
5061
5083
  }
5062
5084
  try {
5063
- const _mod_17 = await import('./index-Y-yYyRBf.js');
5085
+ const _mod_17 = await import('./index-DRXC5Mra.js');
5064
5086
  const _ns_17 = _mod_17.f;
5065
5087
  const { Model } = _ns_17;
5066
5088
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
5067
- const _mod_18 = await import('./db-Lw0KVZmc.js');
5089
+ const _mod_18 = await import('./db-W1g29qsM.js');
5068
5090
  const _ns_18 = _mod_18.Y;
5069
5091
  const { resolveItemModelFileId } = _ns_18;
5070
5092
  const modelFileId = await resolveItemModelFileId(hints);
@@ -5224,7 +5246,7 @@ class ItemProperty {
5224
5246
  return;
5225
5247
  }
5226
5248
  // Use dynamic import to break circular dependency
5227
- const schemaMod = await import('./index-BpgD305l.js');
5249
+ const schemaMod = await import('./index-Bev-hZF-.js');
5228
5250
  const { ModelPropertyDataTypes } = schemaMod;
5229
5251
  const { context } = snapshot;
5230
5252
  const { propertyRecordSchema } = context;
@@ -5395,7 +5417,7 @@ class ItemProperty {
5395
5417
  const normalizedRefValueType = normalizeDataType(propertyRecordSchema?.refValueType);
5396
5418
  const propertyNames = getMetadataPropertyNamesForQuery(propertyName, normalizedDataType, normalizedRefValueType);
5397
5419
  const propertyNameVariant = propertyNames.length > 1 ? propertyNames[1] : undefined;
5398
- const _mod_19 = await import('./index-5b3JsS55.js');
5420
+ const _mod_19 = await import('./index-CSOQFAOn.js');
5399
5421
  const _ns_19 = _mod_19.s;
5400
5422
  const seedSchemaMod = _ns_19;
5401
5423
  const { metadata } = seedSchemaMod;
@@ -5611,7 +5633,7 @@ class ItemProperty {
5611
5633
  const ctx = this._service.getSnapshot().context;
5612
5634
  let modelFileId;
5613
5635
  try {
5614
- const _mod_20 = await import('./db-Lw0KVZmc.js');
5636
+ const _mod_20 = await import('./db-W1g29qsM.js');
5615
5637
  const _ns_20 = _mod_20.Y;
5616
5638
  const { resolveItemModelFileId } = _ns_20;
5617
5639
  modelFileId = await resolveItemModelFileId({
@@ -5974,7 +5996,7 @@ class ItemProperty {
5974
5996
  const propertiesData = await getItemProperties({ seedLocalId, seedUid });
5975
5997
  const instances = [];
5976
5998
  const seenNormalized = new Set();
5977
- const _mod_21 = await import('./db-Lw0KVZmc.js');
5999
+ const _mod_21 = await import('./db-W1g29qsM.js');
5978
6000
  const _ns_21 = _mod_21.Y;
5979
6001
  const { resolveItemModelFileId } = _ns_21;
5980
6002
  const itemModelFileId = await resolveItemModelFileId({ seedLocalId, seedUid });
@@ -5992,7 +6014,7 @@ class ItemProperty {
5992
6014
  }
5993
6015
  else if (baseName) {
5994
6016
  try {
5995
- const _mod_22 = await import('./index-Y-yYyRBf.js');
6017
+ const _mod_22 = await import('./index-DRXC5Mra.js');
5996
6018
  const _ns_22 = _mod_22.f;
5997
6019
  const { Model } = _ns_22;
5998
6020
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
@@ -6009,7 +6031,7 @@ class ItemProperty {
6009
6031
  }
6010
6032
  if (modelName && propertyName) {
6011
6033
  try {
6012
- const _mod_23 = await import('./index-Y-yYyRBf.js');
6034
+ const _mod_23 = await import('./index-DRXC5Mra.js');
6013
6035
  const _ns_23 = _mod_23.f;
6014
6036
  const { Model } = _ns_23;
6015
6037
  const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
@@ -6331,7 +6353,7 @@ class ItemProperty {
6331
6353
  if (!propertyName || (!seedLocalId && !seedUid))
6332
6354
  return;
6333
6355
  if (db) {
6334
- const _mod_24 = await import('./index-5b3JsS55.js');
6356
+ const _mod_24 = await import('./index-CSOQFAOn.js');
6335
6357
  const _ns_24 = _mod_24.s;
6336
6358
  const seedSchemaMod = _ns_24;
6337
6359
  const { metadata } = seedSchemaMod;
@@ -6377,7 +6399,7 @@ const createNewItem = async ({ modelName, modelFileId, ...propertyData }) => {
6377
6399
  }
6378
6400
  const seedType = toSnakeCase(modelName);
6379
6401
  // Dynamic import to break circular dependency
6380
- const _mod_25 = await import('./index-Y-yYyRBf.js');
6402
+ const _mod_25 = await import('./index-DRXC5Mra.js');
6381
6403
  const _ns_25 = _mod_25.f;
6382
6404
  const modelMod = _ns_25;
6383
6405
  const { Model } = modelMod;
@@ -6535,7 +6557,7 @@ const getModel = () => {
6535
6557
  // the fragile `import(...).then(n => n.X)` chunk-namespace pattern.
6536
6558
  if (!modelImportPromise) {
6537
6559
  modelImportPromise = (async () => {
6538
- const _mod_26 = await import('./index-Y-yYyRBf.js');
6560
+ const _mod_26 = await import('./index-DRXC5Mra.js');
6539
6561
  const _ns_26 = _mod_26.f;
6540
6562
  const mod = _ns_26;
6541
6563
  ModelClass = mod.Model;
@@ -6639,7 +6661,6 @@ class Item {
6639
6661
  const revokedAt = Math.floor(Date.now() / 1000);
6640
6662
  // The executor stamps the revoked version rows; the latest version is now the newest one left
6641
6663
  // (a local draft) or none, never a revoked one.
6642
- const { getLatestVersionRow } = await import('./getLatestVersionRow-72Atl9vB.js');
6643
6664
  const head = await getLatestVersionRow(this.seedLocalId);
6644
6665
  this._service.send({
6645
6666
  type: 'updateContext',
@@ -6685,12 +6706,12 @@ class Item {
6685
6706
  };
6686
6707
  this.getPublishUploads = async (options) => {
6687
6708
  // Use dynamic import to break circular dependency
6688
- const getPublishUploadsMod = await import('./getPublishUploads-CqgMBD8f.js');
6709
+ const getPublishUploadsMod = await import('./getPublishUploads-BGpDsrBp.js');
6689
6710
  const { getPublishUploads } = getPublishUploadsMod;
6690
6711
  return await getPublishUploads(this, [], undefined, options);
6691
6712
  };
6692
6713
  this.getPublishPayload = async (uploadedTransactions, options) => {
6693
- const _mod_27 = await import('./getPublishPayload-76_KfB5Y.js');
6714
+ const _mod_27 = await import('./getPublishPayload-D5CQZd-y.js');
6694
6715
  const _ns_27 = _mod_27.g;
6695
6716
  const getPublishPayloadMod = _ns_27;
6696
6717
  const { getPublishPayload } = getPublishPayloadMod;
@@ -6709,7 +6730,6 @@ class Item {
6709
6730
  });
6710
6731
  // Publish has recorded the version it attested (updateVersionUid): reflect it here too, as
6711
6732
  // the versions liveQuery does in the browser. After a republish this is the new version.
6712
- const { getLatestVersionRow } = await import('./getLatestVersionRow-72Atl9vB.js');
6713
6733
  const head = await getLatestVersionRow(seedLocalId);
6714
6734
  if (head?.localId) {
6715
6735
  this._service.send({
@@ -7226,7 +7246,7 @@ class Item {
7226
7246
  const db = BaseDb.getAppDb();
7227
7247
  if (db && props.modelName) {
7228
7248
  // Model names are only unique per schema: resolve the exact models row from the most specific scope.
7229
- const _mod_28 = await import('./db-Lw0KVZmc.js');
7249
+ const _mod_28 = await import('./db-W1g29qsM.js');
7230
7250
  const _ns_28 = _mod_28.Y;
7231
7251
  const { resolveModelRecord } = _ns_28;
7232
7252
  const modelRecord = await resolveModelRecord(props.modelName, {
@@ -7240,10 +7260,10 @@ class Item {
7240
7260
  // Scope the constructor's Model lookup to this model's schema (as getItemData does on reload),
7241
7261
  // so a same-named model cached from another schema can't supply the property set.
7242
7262
  if (modelRecord && !props.schemaName) {
7243
- const _mod_29 = await import('./BasePathResolver-DRT09oVv.js');
7263
+ const _mod_29 = await import('./BasePathResolver-BdxCSIzn.js');
7244
7264
  const _ns_29 = _mod_29.R;
7245
7265
  const { modelSchemas } = _ns_29;
7246
- const _mod_30 = await import('./BasePathResolver-DRT09oVv.js');
7266
+ const _mod_30 = await import('./BasePathResolver-BdxCSIzn.js');
7247
7267
  const _ns_30 = _mod_30.Q;
7248
7268
  const { schemas: schemasTable } = _ns_30;
7249
7269
  const schemaRows = await db
@@ -7589,7 +7609,7 @@ class Item {
7589
7609
  if (!appDb || Item.instanceCache.size === 0) {
7590
7610
  return;
7591
7611
  }
7592
- const _mod_31 = await import('./index-5b3JsS55.js');
7612
+ const _mod_31 = await import('./index-CSOQFAOn.js');
7593
7613
  const _ns_31 = _mod_31.s;
7594
7614
  const { metadata } = _ns_31;
7595
7615
  const { eq, and } = await import('drizzle-orm');
@@ -8048,7 +8068,7 @@ class Item {
8048
8068
  itemActor.send(event);
8049
8069
  };
8050
8070
  try {
8051
- const _mod_32 = await import('./index-5b3JsS55.js');
8071
+ const _mod_32 = await import('./index-CSOQFAOn.js');
8052
8072
  const _ns_32 = _mod_32.s;
8053
8073
  const seedSchemaMod = _ns_32;
8054
8074
  const { seeds, versions, metadata } = seedSchemaMod;
@@ -8401,5 +8421,5 @@ var Item$1 = /*#__PURE__*/Object.freeze({
8401
8421
  Item: Item
8402
8422
  });
8403
8423
 
8404
- export { getMetadataLatest as A, getRevokeExecutor as B, ClientManagerState as C, getUploadExecutor as D, getVersionData$1 as E, isItemOwned as F, isLocalUnsealedDraft as G, isSeedRowOwned as H, Item as I, ownedPublisherSql as J, pickLatestMetadataRowPerProperty as K, propertyMachine as L, METADATA_LATEST_FIRST_ORDER_SQL as M, publisherInAddressListSql as N, publisherIsInOwnedSet as O, setAdditionalSyncAddresses as P, setGetPublisherForNewSeeds as Q, setRevokeExecutor as R, setUploadExecutor as S, getInvariantSafePropertyDescriptor as T, clearDestroySubscriptions as U, unloadEntity as V, ClientManagerEvents as W, resolvePublisherFromSeedRow as X, getPropertyData$1 as Y, Item$1 as Z, getEasSchemaUidForModel as a, getLatestPublishedVersionRow as b, chunkValues as c, rowsPerInsert as d, getGetAdditionalSyncAddresses as e, ItemProperty as f, getItemData as g, ItemPropertySaveValidationError as h, isVersionRevoked as i, waitForEntityIdle as j, createReactiveProxy as k, listRelationEasPropertyName as l, findEntity as m, forceRemoveFromCaches as n, runDestroyLifecycle as o, parseListPropertyValueFromStorage as p, compareMetadataRowsLatestFirst as q, resolveStorageNameToSchemaName as r, selectInBatches as s, isPublishedMetadataRow as t, MachineIds as u, versionNotRevoked as v, writeInBatches as w, createNewItem as x, getEasSchemaForItemProperty as y, getGetPublisherForNewSeeds as z };
8405
- //# sourceMappingURL=Item-ZUAmf943.js.map
8424
+ export { getRevokeExecutor as A, getUploadExecutor as B, ClientManagerState as C, getVersionData$1 as D, isItemOwned as E, isLocalUnsealedDraft as F, isSeedRowOwned as G, ownedPublisherSql as H, Item as I, pickLatestMetadataRowPerProperty as J, propertyMachine as K, publisherInAddressListSql as L, METADATA_LATEST_FIRST_ORDER_SQL as M, publisherIsInOwnedSet as N, setAdditionalSyncAddresses as O, setGetPublisherForNewSeeds as P, setRevokeExecutor as Q, setUploadExecutor as R, getInvariantSafePropertyDescriptor as S, clearDestroySubscriptions as T, unloadEntity as U, ClientManagerEvents as V, resolvePublisherFromSeedRow as W, getPropertyData$1 as X, Item$1 as Y, getEasSchemaUidForModel as a, getLatestPublishedVersionRow as b, chunkValues as c, rowsPerInsert as d, getGetAdditionalSyncAddresses as e, ItemProperty as f, getItemData as g, ItemPropertySaveValidationError as h, isVersionRevoked as i, waitForEntityIdle as j, createReactiveProxy as k, listRelationEasPropertyName as l, findEntity as m, forceRemoveFromCaches as n, runDestroyLifecycle as o, parseListPropertyValueFromStorage as p, compareMetadataRowsLatestFirst as q, resolveStorageNameToSchemaName as r, selectInBatches as s, isPublishedMetadataRow as t, MachineIds as u, createNewItem as v, writeInBatches as w, getEasSchemaForItemProperty as x, getGetPublisherForNewSeeds as y, getMetadataLatest as z };
8425
+ //# sourceMappingURL=Item-B9Y4VuK1.js.map