@seedprotocol/sdk 0.4.22 → 0.4.24

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 (104) hide show
  1. package/dist/{ArweaveClient-B-vm2Xae.js → ArweaveClient-DoBABTLW.js} +3 -4
  2. package/dist/{ArweaveClient-B-vm2Xae.js.map → ArweaveClient-DoBABTLW.js.map} +1 -1
  3. package/dist/{ArweaveClient-C-eLH0zU.js → ArweaveClient-KF_T3NSr.js} +3 -4
  4. package/dist/{ArweaveClient-C-eLH0zU.js.map → ArweaveClient-KF_T3NSr.js.map} +1 -1
  5. package/dist/{Db-nir1xVHg.js → Db-Cg7Q5gIc.js} +4 -5
  6. package/dist/{Db-nir1xVHg.js.map → Db-Cg7Q5gIc.js.map} +1 -1
  7. package/dist/{Db-B7whB3oJ.js → Db-DA_e7Jcc.js} +4 -5
  8. package/dist/{Db-B7whB3oJ.js.map → Db-DA_e7Jcc.js.map} +1 -1
  9. package/dist/{EasClient-BH_feMaX.js → EasClient-B4VivHxM.js} +2 -3
  10. package/dist/{EasClient-BH_feMaX.js.map → EasClient-B4VivHxM.js.map} +1 -1
  11. package/dist/{EasClient-CFguAKBp.js → EasClient-CVPHYGNP.js} +2 -3
  12. package/dist/{EasClient-CFguAKBp.js.map → EasClient-CVPHYGNP.js.map} +1 -1
  13. package/dist/{FileManager-C2uXql_C.js → FileManager-BOxbzROS.js} +2 -3
  14. package/dist/{FileManager-C2uXql_C.js.map → FileManager-BOxbzROS.js.map} +1 -1
  15. package/dist/{FileManager-BR3jtuSl.js → FileManager-Ba5BCbCL.js} +2 -3
  16. package/dist/{FileManager-BR3jtuSl.js.map → FileManager-Ba5BCbCL.js.map} +1 -1
  17. package/dist/{ModelProperty-CIeLasI4.js → ModelProperty-D6JLRqQW.js} +17 -18
  18. package/dist/ModelProperty-D6JLRqQW.js.map +1 -0
  19. package/dist/{PathResolver-CZoSnHBU.js → PathResolver-D7WqjJCo.js} +2 -3
  20. package/dist/{PathResolver-CZoSnHBU.js.map → PathResolver-D7WqjJCo.js.map} +1 -1
  21. package/dist/{PathResolver-DnrG1hUX.js → PathResolver-DHTAlCzo.js} +2 -3
  22. package/dist/{PathResolver-DnrG1hUX.js.map → PathResolver-DHTAlCzo.js.map} +1 -1
  23. package/dist/{QueryClient-PqOg8mcw.js → QueryClient-B12y2daD.js} +2 -3
  24. package/dist/{QueryClient-PqOg8mcw.js.map → QueryClient-B12y2daD.js.map} +1 -1
  25. package/dist/{QueryClient-DJOrJZRR.js → QueryClient-BCxuWg7f.js} +2 -3
  26. package/dist/{QueryClient-DJOrJZRR.js.map → QueryClient-BCxuWg7f.js.map} +1 -1
  27. package/dist/{Schema-B3YQHTtu.js → Schema-B5_B8nM5.js} +22 -22
  28. package/dist/{Schema-B3YQHTtu.js.map → Schema-B5_B8nM5.js.map} +1 -1
  29. package/dist/{SchemaValidationService-C4DIwn8Z.js → SchemaValidationService-DXYRdSYa.js} +2 -3
  30. package/dist/{SchemaValidationService-C4DIwn8Z.js.map → SchemaValidationService-DXYRdSYa.js.map} +1 -1
  31. package/dist/{backfillMetadataPropertyIds-CBlRaU_M.js → backfillMetadataPropertyIds-BWEhAJPS.js} +2 -3
  32. package/dist/{backfillMetadataPropertyIds-CBlRaU_M.js.map → backfillMetadataPropertyIds-BWEhAJPS.js.map} +1 -1
  33. package/dist/cjs/{ModelProperty-tfM38NL4.js → ModelProperty-Ov1_YL9l.js} +17 -18
  34. package/dist/cjs/{ModelProperty-tfM38NL4.js.map → ModelProperty-Ov1_YL9l.js.map} +1 -1
  35. package/dist/cjs/{Schema-44NqLqMV.js → Schema-CeG5iRX_.js} +20 -21
  36. package/dist/cjs/{Schema-44NqLqMV.js.map → Schema-CeG5iRX_.js.map} +1 -1
  37. package/dist/cjs/{SchemaValidationService-Cq_YBzFN.js → SchemaValidationService-C8mdrNnp.js} +2 -3
  38. package/dist/cjs/{SchemaValidationService-Cq_YBzFN.js.map → SchemaValidationService-C8mdrNnp.js.map} +1 -1
  39. package/dist/cjs/{backfillMetadataPropertyIds-D1nLJAhB.js → backfillMetadataPropertyIds-LDYghZxU.js} +2 -3
  40. package/dist/cjs/{backfillMetadataPropertyIds-D1nLJAhB.js.map → backfillMetadataPropertyIds-LDYghZxU.js.map} +1 -1
  41. package/dist/cjs/{getItem-BRoq91YU.js → getItem-CW3BFytl.js} +2 -3
  42. package/dist/cjs/{getItem-BRoq91YU.js.map → getItem-CW3BFytl.js.map} +1 -1
  43. package/dist/cjs/{getPublishPayload-ddl-1x6R.js → getPublishPayload-C0hWIYCX.js} +11 -12
  44. package/dist/cjs/{getPublishPayload-ddl-1x6R.js.map → getPublishPayload-C0hWIYCX.js.map} +1 -1
  45. package/dist/cjs/{getPublishUploads-BljRx4o4.js → getPublishUploads-CMpPR2JJ.js} +4 -5
  46. package/dist/cjs/{getPublishUploads-BljRx4o4.js.map → getPublishUploads-CMpPR2JJ.js.map} +1 -1
  47. package/dist/cjs/{getSegmentedItemProperties-iK5kepzl.js → getSegmentedItemProperties-B4ao_B1Q.js} +3 -3
  48. package/dist/cjs/{getSegmentedItemProperties-iK5kepzl.js.map → getSegmentedItemProperties-B4ao_B1Q.js.map} +1 -1
  49. package/dist/cjs/{index-DqSDhOp3.js → index-Dty7eE10.js} +3 -4
  50. package/dist/cjs/index-Dty7eE10.js.map +1 -0
  51. package/dist/cjs/{index-C6rrqy3z.js → index-Far6-WGM.js} +89 -40
  52. package/dist/cjs/index-Far6-WGM.js.map +1 -0
  53. package/dist/cjs/{ownership-CXlKAj4o.js → ownership-TCXiKRY_.js} +2 -3
  54. package/dist/cjs/{ownership-CXlKAj4o.js.map → ownership-TCXiKRY_.js.map} +1 -1
  55. package/dist/cjs/{property-2D7P6a2q.js → property-BT7i8Tl-.js} +4 -5
  56. package/dist/cjs/{property-2D7P6a2q.js.map → property-BT7i8Tl-.js.map} +1 -1
  57. package/dist/cjs/{syncDbWithEas-DcKL-_Pb.js → syncDbWithEas-DUi78csI.js} +5 -6
  58. package/dist/cjs/{syncDbWithEas-DcKL-_Pb.js.map → syncDbWithEas-DUi78csI.js.map} +1 -1
  59. package/dist/{getItem-CV3yTCRt.js → getItem-D5_bPYyC.js} +2 -3
  60. package/dist/{getItem-CV3yTCRt.js.map → getItem-D5_bPYyC.js.map} +1 -1
  61. package/dist/{getPublishPayload-Ddc_LGPs.js → getPublishPayload-DEdHgrgC.js} +11 -12
  62. package/dist/getPublishPayload-DEdHgrgC.js.map +1 -0
  63. package/dist/{getPublishUploads-Cf2J-5FR.js → getPublishUploads-CH72lAID.js} +4 -5
  64. package/dist/{getPublishUploads-Cf2J-5FR.js.map → getPublishUploads-CH72lAID.js.map} +1 -1
  65. package/dist/{getSegmentedItemProperties-B2mzArFD.js → getSegmentedItemProperties-Cp92QUHQ.js} +3 -3
  66. package/dist/{getSegmentedItemProperties-B2mzArFD.js.map → getSegmentedItemProperties-Cp92QUHQ.js.map} +1 -1
  67. package/dist/{index-DUMXLKJr.js → index-18lln0cM.js} +103 -54
  68. package/dist/{index-DUMXLKJr.js.map → index-18lln0cM.js.map} +1 -1
  69. package/dist/{index-BRo7D3s1.js → index-Bp0ChnQr.js} +2 -2
  70. package/dist/index-Bp0ChnQr.js.map +1 -0
  71. package/dist/{index-3Ekqb4QB.js → index-DB3nZ0lK.js} +3 -4
  72. package/dist/index-DB3nZ0lK.js.map +1 -0
  73. package/dist/main.cjs +1 -2
  74. package/dist/main.cjs.map +1 -1
  75. package/dist/main.js +13 -14
  76. package/dist/main.js.map +1 -1
  77. package/dist/node.js +10 -11
  78. package/dist/node.js.map +1 -1
  79. package/dist/{ownership-TR-mIjJh.js → ownership-D-KsIkxM.js} +2 -3
  80. package/dist/{ownership-TR-mIjJh.js.map → ownership-D-KsIkxM.js.map} +1 -1
  81. package/dist/{property-BSNWvgei.js → property-DViA9nga.js} +5 -6
  82. package/dist/property-DViA9nga.js.map +1 -0
  83. package/dist/{queries-0FZBThGQ.js → queries-ANFHy2e0.js} +2 -2
  84. package/dist/{queries-0FZBThGQ.js.map → queries-ANFHy2e0.js.map} +1 -1
  85. package/dist/src/eventBus.d.ts +13 -2
  86. package/dist/src/eventBus.d.ts.map +1 -1
  87. package/dist/src/vite/index.d.ts.map +1 -1
  88. package/dist/{syncDbWithEas-CaytdS8D.js → syncDbWithEas-m-_3Ds7d.js} +6 -7
  89. package/dist/syncDbWithEas-m-_3Ds7d.js.map +1 -0
  90. package/dist/{updateSeedRevokedAt-CfUXirik.js → updateSeedRevokedAt-BvAK-Rfh.js} +2 -2
  91. package/dist/{updateSeedRevokedAt-CfUXirik.js.map → updateSeedRevokedAt-BvAK-Rfh.js.map} +1 -1
  92. package/dist/vite.cjs +115 -26
  93. package/dist/vite.cjs.map +1 -1
  94. package/dist/vite.js +115 -26
  95. package/dist/vite.js.map +1 -1
  96. package/package.json +1 -1
  97. package/dist/ModelProperty-CIeLasI4.js.map +0 -1
  98. package/dist/cjs/index-C6rrqy3z.js.map +0 -1
  99. package/dist/cjs/index-DqSDhOp3.js.map +0 -1
  100. package/dist/getPublishPayload-Ddc_LGPs.js.map +0 -1
  101. package/dist/index-3Ekqb4QB.js.map +0 -1
  102. package/dist/index-BRo7D3s1.js.map +0 -1
  103. package/dist/property-BSNWvgei.js.map +0 -1
  104. package/dist/syncDbWithEas-CaytdS8D.js.map +0 -1
@@ -10,7 +10,6 @@ import { Type } from '@sinclair/typebox';
10
10
  import { toSnakeCase as toSnakeCase$1 } from 'drizzle-orm/casing';
11
11
  import { upperFirst, camelCase, startCase, throttle, orderBy } from 'lodash-es';
12
12
  import { BehaviorSubject } from 'rxjs';
13
- import EventEmitter from 'eventemitter3';
14
13
  import 'arweave';
15
14
  import * as sha3 from 'js-sha3';
16
15
 
@@ -2207,7 +2206,7 @@ const createPropertyInstances = async (propertyFileIds) => {
2207
2206
  return;
2208
2207
  }
2209
2208
  try {
2210
- const mod = await import('./ModelProperty-CIeLasI4.js');
2209
+ const mod = await import('./ModelProperty-D6JLRqQW.js');
2211
2210
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
2212
2211
  if (!ModelProperty) {
2213
2212
  logger$t('createPropertyInstances: ModelProperty not available from dynamic import');
@@ -2391,7 +2390,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
2391
2390
  // Step 2: Fallback to Schema context (only if database doesn't have the model)
2392
2391
  // This handles the case where model exists in schema file but not yet in database
2393
2392
  try {
2394
- const _mod_0 = await import('./Schema-B3YQHTtu.js');
2393
+ const _mod_0 = await import('./Schema-B5_B8nM5.js');
2395
2394
  const _ns_0 = _mod_0.b;
2396
2395
  const schemaMod = _ns_0;
2397
2396
  const { Schema } = schemaMod;
@@ -2637,7 +2636,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
2637
2636
  }
2638
2637
  // Mark schema as draft when a new model is created so saveNewVersion() can persist it
2639
2638
  try {
2640
- const _mod_1 = await import('./Schema-B3YQHTtu.js');
2639
+ const _mod_1 = await import('./Schema-B5_B8nM5.js');
2641
2640
  const _ns_1 = _mod_1.b;
2642
2641
  const schemaMod = _ns_1;
2643
2642
  const { Schema } = schemaMod;
@@ -2683,10 +2682,10 @@ const validateModel = fromCallback(({ sendBack, input: { context } }) => {
2683
2682
  const _validateModel = async () => {
2684
2683
  try {
2685
2684
  // Use dynamic imports to break circular dependencies
2686
- const validationServiceMod = await import('./SchemaValidationService-C4DIwn8Z.js');
2685
+ const validationServiceMod = await import('./SchemaValidationService-DXYRdSYa.js');
2687
2686
  const { SchemaValidationService } = validationServiceMod;
2688
2687
  const validationService = new SchemaValidationService();
2689
- const _mod_2 = await import('./Schema-B3YQHTtu.js');
2688
+ const _mod_2 = await import('./Schema-B5_B8nM5.js');
2690
2689
  const _ns_2 = _mod_2.b;
2691
2690
  const schemaMod = _ns_2;
2692
2691
  const { Schema } = schemaMod;
@@ -2798,7 +2797,7 @@ const createModelProperties = fromCallback(({ sendBack, input }) => {
2798
2797
  return;
2799
2798
  }
2800
2799
  logger$r(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
2801
- const mod = await import('./ModelProperty-CIeLasI4.js');
2800
+ const mod = await import('./ModelProperty-D6JLRqQW.js');
2802
2801
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
2803
2802
  if (!ModelProperty) {
2804
2803
  logger$r('ModelProperty not available from dynamic import');
@@ -2902,7 +2901,7 @@ const validateEntity = fromPromise(async ({ input }) => {
2902
2901
  const structureMsg = `[validateEntity] Validating model structure`;
2903
2902
  logger$q(structureMsg);
2904
2903
  // Use existing Model validation
2905
- const validationServiceMod = await import('./SchemaValidationService-C4DIwn8Z.js');
2904
+ const validationServiceMod = await import('./SchemaValidationService-DXYRdSYa.js');
2906
2905
  const { SchemaValidationService } = validationServiceMod;
2907
2906
  const validationService = new SchemaValidationService();
2908
2907
  // Validate model structure
@@ -2920,7 +2919,7 @@ const validateEntity = fromPromise(async ({ input }) => {
2920
2919
  if (entityInput.entityData.schemaName) {
2921
2920
  try {
2922
2921
  logger$q(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
2923
- const _mod_3 = await import('./Schema-B3YQHTtu.js');
2922
+ const _mod_3 = await import('./Schema-B5_B8nM5.js');
2924
2923
  const _ns_3 = _mod_3.b;
2925
2924
  const schemaMod = _ns_3;
2926
2925
  const { Schema } = schemaMod;
@@ -2958,7 +2957,7 @@ const validateEntity = fromPromise(async ({ input }) => {
2958
2957
  }
2959
2958
  else if (entityInput.entityType === 'modelProperty') {
2960
2959
  // Use existing ModelProperty validation
2961
- const validationServiceMod = await import('./SchemaValidationService-C4DIwn8Z.js');
2960
+ const validationServiceMod = await import('./SchemaValidationService-DXYRdSYa.js');
2962
2961
  const { SchemaValidationService } = validationServiceMod;
2963
2962
  const validationService = new SchemaValidationService();
2964
2963
  // Validate property structure
@@ -2973,7 +2972,7 @@ const validateEntity = fromPromise(async ({ input }) => {
2973
2972
  // If schema name and model name provided, validate against schema
2974
2973
  if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
2975
2974
  try {
2976
- const _mod_4 = await import('./Schema-B3YQHTtu.js');
2975
+ const _mod_4 = await import('./Schema-B5_B8nM5.js');
2977
2976
  const _ns_4 = _mod_4.b;
2978
2977
  const schemaMod = _ns_4;
2979
2978
  const { Schema } = schemaMod;
@@ -3004,7 +3003,7 @@ const validateEntity = fromPromise(async ({ input }) => {
3004
3003
  }
3005
3004
  else if (entityInput.entityType === 'schema') {
3006
3005
  // Schema validation - use existing validation
3007
- const validationServiceMod = await import('./SchemaValidationService-C4DIwn8Z.js');
3006
+ const validationServiceMod = await import('./SchemaValidationService-DXYRdSYa.js');
3008
3007
  const { SchemaValidationService } = validationServiceMod;
3009
3008
  const validationService = new SchemaValidationService();
3010
3009
  const schemaResult = validationService.validateSchema(entityInput.entityData);
@@ -4956,7 +4955,7 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
4956
4955
  // initial write completes is not overwritten by the stale requestWrite payload.
4957
4956
  let dataToWrite = input.entityData;
4958
4957
  try {
4959
- const mod = await import('./ModelProperty-CIeLasI4.js');
4958
+ const mod = await import('./ModelProperty-D6JLRqQW.js');
4960
4959
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
4961
4960
  if (ModelProperty && typeof ModelProperty.getById === 'function') {
4962
4961
  const instance = ModelProperty.getById(input.entityId);
@@ -5336,7 +5335,7 @@ const modelMachine = setup({
5336
5335
  // Create ModelProperty instances for any new property IDs
5337
5336
  if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
5338
5337
  // Import and create instances asynchronously (fire-and-forget)
5339
- import('./ModelProperty-CIeLasI4.js').then(({ ModelProperty }) => {
5338
+ import('./ModelProperty-D6JLRqQW.js').then(({ ModelProperty }) => {
5340
5339
  const createPromises = newPropertyIds.map(async (propertyFileId) => {
5341
5340
  try {
5342
5341
  const property = await ModelProperty.createById(propertyFileId);
@@ -6755,7 +6754,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
6755
6754
  const schemaNameToTry = model$1?.schemaName;
6756
6755
  if (schemaNameToTry) {
6757
6756
  try {
6758
- const _mod_5 = await import('./Schema-B3YQHTtu.js');
6757
+ const _mod_5 = await import('./Schema-B5_B8nM5.js');
6759
6758
  const _ns_5 = _mod_5.b;
6760
6759
  const { Schema } = _ns_5;
6761
6760
  const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
@@ -6806,7 +6805,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
6806
6805
  }
6807
6806
  }
6808
6807
  if (Object.keys(propertySchemas).length === 0) {
6809
- const schemaMod = await import('./index-3Ekqb4QB.js');
6808
+ const schemaMod = await import('./index-DB3nZ0lK.js');
6810
6809
  const { ModelPropertyDataTypes } = schemaMod;
6811
6810
  const KNOWN_MODEL_FALLBACKS = {
6812
6811
  Post: {
@@ -6853,7 +6852,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
6853
6852
  // Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
6854
6853
  let propSchema = propertySchemas[propertyName];
6855
6854
  if (!propSchema && isRefTypeFromMeta) {
6856
- const schemaMod = await import('./index-3Ekqb4QB.js');
6855
+ const schemaMod = await import('./index-DB3nZ0lK.js');
6857
6856
  const { ModelPropertyDataTypes } = schemaMod;
6858
6857
  propSchema = {
6859
6858
  dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
@@ -7110,9 +7109,9 @@ const runPublish = fromCallback(({ sendBack, input: { context } }) => {
7110
7109
  sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
7111
7110
  return;
7112
7111
  }
7113
- const getPublishUploadsMod = await import('./getPublishUploads-Cf2J-5FR.js');
7112
+ const getPublishUploadsMod = await import('./getPublishUploads-CH72lAID.js');
7114
7113
  const { getPublishUploads } = getPublishUploadsMod;
7115
- const getPublishPayloadMod = await import('./getPublishPayload-Ddc_LGPs.js');
7114
+ const getPublishPayloadMod = await import('./getPublishPayload-DEdHgrgC.js');
7116
7115
  const { getPublishPayload } = getPublishPayloadMod;
7117
7116
  const uploads = await getPublishUploads(item);
7118
7117
  let uploadedTransactions = [];
@@ -7952,7 +7951,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
7952
7951
  const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
7953
7952
  const _resolveRelatedValue = async () => {
7954
7953
  // Use dynamic import to break circular dependency
7955
- const schemaMod = await import('./index-3Ekqb4QB.js');
7954
+ const schemaMod = await import('./index-DB3nZ0lK.js');
7956
7955
  const { ModelPropertyDataTypes } = schemaMod;
7957
7956
  if (!propertyValue || !isRelation || populatedFromDb) {
7958
7957
  return;
@@ -8315,7 +8314,57 @@ function parseListPropertyValueFromStorage(raw) {
8315
8314
  return trimmed.split(',').map((s) => s.trim()).filter(Boolean);
8316
8315
  }
8317
8316
 
8318
- const eventEmitter = new EventEmitter();
8317
+ class SeedEventEmitter {
8318
+ constructor() {
8319
+ this.listeners = new Map();
8320
+ }
8321
+ on(event, listener) {
8322
+ const set = this.listeners.get(event) ?? new Set();
8323
+ set.add(listener);
8324
+ this.listeners.set(event, set);
8325
+ return this;
8326
+ }
8327
+ addListener(event, listener) {
8328
+ return this.on(event, listener);
8329
+ }
8330
+ once(event, listener) {
8331
+ const wrapped = (...args) => {
8332
+ this.off(event, wrapped);
8333
+ listener(...args);
8334
+ };
8335
+ return this.on(event, wrapped);
8336
+ }
8337
+ off(event, listener) {
8338
+ const set = this.listeners.get(event);
8339
+ if (!set)
8340
+ return this;
8341
+ set.delete(listener);
8342
+ if (set.size === 0)
8343
+ this.listeners.delete(event);
8344
+ return this;
8345
+ }
8346
+ removeListener(event, listener) {
8347
+ return this.off(event, listener);
8348
+ }
8349
+ removeAllListeners(event) {
8350
+ if (typeof event === 'undefined') {
8351
+ this.listeners.clear();
8352
+ return this;
8353
+ }
8354
+ this.listeners.delete(event);
8355
+ return this;
8356
+ }
8357
+ emit(event, ...args) {
8358
+ const set = this.listeners.get(event);
8359
+ if (!set || set.size === 0)
8360
+ return false;
8361
+ for (const listener of [...set]) {
8362
+ listener(...args);
8363
+ }
8364
+ return true;
8365
+ }
8366
+ }
8367
+ const eventEmitter = new SeedEventEmitter();
8319
8368
 
8320
8369
  const GET_FILES_METADATA = graphql(/* GraphQL */ `
8321
8370
  query GetFilesMetadata($where: AttestationWhereInput!) {
@@ -8910,7 +8959,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
8910
8959
  // to use dynamically imported ModelPropertyDataTypes
8911
8960
  const _hydrateFromDb = async () => {
8912
8961
  // Use dynamic import to break circular dependency
8913
- const schemaMod = await import('./index-3Ekqb4QB.js');
8962
+ const schemaMod = await import('./index-DB3nZ0lK.js');
8914
8963
  const { ModelPropertyDataTypes } = schemaMod;
8915
8964
  const appDb = BaseDb.getAppDb();
8916
8965
  const whereClauses = [];
@@ -9273,7 +9322,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
9273
9322
  };
9274
9323
  // Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
9275
9324
  try {
9276
- const { getPropertySchema } = await import('./property-BSNWvgei.js');
9325
+ const { getPropertySchema } = await import('./property-DViA9nga.js');
9277
9326
  let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName);
9278
9327
  if (!schemaFromFile?.validation) {
9279
9328
  // Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
@@ -9738,9 +9787,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
9738
9787
  }
9739
9788
  const _analyzeInput = async () => {
9740
9789
  // Use dynamic import to break circular dependency
9741
- const schemaMod = await import('./index-3Ekqb4QB.js');
9790
+ const schemaMod = await import('./index-DB3nZ0lK.js');
9742
9791
  const { ModelPropertyDataTypes } = schemaMod;
9743
- const { SchemaValidationService } = await import('./SchemaValidationService-C4DIwn8Z.js');
9792
+ const { SchemaValidationService } = await import('./SchemaValidationService-DXYRdSYa.js');
9744
9793
  let propertyName = propertyNameRaw;
9745
9794
  if (!propertyName) {
9746
9795
  throw new Error('propertyName is required');
@@ -9938,7 +9987,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
9938
9987
  propertyRecordSchema?.validation &&
9939
9988
  metadataValues.propertyValue != null &&
9940
9989
  metadataValues.propertyValue !== '') {
9941
- const { SchemaValidationService } = await import('./SchemaValidationService-C4DIwn8Z.js');
9990
+ const { SchemaValidationService } = await import('./SchemaValidationService-DXYRdSYa.js');
9942
9991
  const validationService = new SchemaValidationService();
9943
9992
  const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, propertyRecordSchema.dataType, propertyRecordSchema.validation, propertyRecordSchema.refValueType);
9944
9993
  if (!validationResult.isValid && validationResult.errors.length > 0) {
@@ -10529,7 +10578,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
10529
10578
  }
10530
10579
  const _saveRelation = async () => {
10531
10580
  // Use dynamic import to break circular dependency
10532
- const schemaMod = await import('./index-3Ekqb4QB.js');
10581
+ const schemaMod = await import('./index-DB3nZ0lK.js');
10533
10582
  const { ModelPropertyDataTypes } = schemaMod;
10534
10583
  if (!propertyNameRaw) {
10535
10584
  throw new Error('propertyName is required');
@@ -11573,7 +11622,7 @@ class ItemProperty {
11573
11622
  return;
11574
11623
  }
11575
11624
  // Use dynamic import to break circular dependency
11576
- const schemaMod = await import('./index-3Ekqb4QB.js');
11625
+ const schemaMod = await import('./index-DB3nZ0lK.js');
11577
11626
  const { ModelPropertyDataTypes } = schemaMod;
11578
11627
  const { context } = snapshot;
11579
11628
  const { propertyRecordSchema } = context;
@@ -11744,7 +11793,7 @@ class ItemProperty {
11744
11793
  const normalizedRefValueType = normalizeDataType(propertyRecordSchema?.refValueType);
11745
11794
  const propertyNames = getMetadataPropertyNamesForQuery(propertyName, normalizedDataType, normalizedRefValueType);
11746
11795
  const propertyNameVariant = propertyNames.length > 1 ? propertyNames[1] : undefined;
11747
- const _mod_6 = await import('./index-BRo7D3s1.js');
11796
+ const _mod_6 = await import('./index-Bp0ChnQr.js');
11748
11797
  const _ns_6 = _mod_6.s;
11749
11798
  const seedSchemaMod = _ns_6;
11750
11799
  const { metadata } = seedSchemaMod;
@@ -12474,7 +12523,7 @@ class ItemProperty {
12474
12523
  }
12475
12524
  async save() {
12476
12525
  const ctx = this._getSnapshotContext();
12477
- const { assertItemOwned } = await import('./ownership-TR-mIjJh.js');
12526
+ const { assertItemOwned } = await import('./ownership-D-KsIkxM.js');
12478
12527
  await assertItemOwned({
12479
12528
  seedLocalId: ctx?.seedLocalId ?? undefined,
12480
12529
  seedUid: ctx?.seedUid ?? undefined,
@@ -12567,7 +12616,7 @@ class ItemProperty {
12567
12616
  if (!propertyName || (!seedLocalId && !seedUid))
12568
12617
  return;
12569
12618
  if (db) {
12570
- const _mod_7 = await import('./index-BRo7D3s1.js');
12619
+ const _mod_7 = await import('./index-Bp0ChnQr.js');
12571
12620
  const _ns_7 = _mod_7.s;
12572
12621
  const seedSchemaMod = _ns_7;
12573
12622
  const { metadata } = seedSchemaMod;
@@ -12815,7 +12864,7 @@ class Item {
12815
12864
  });
12816
12865
  };
12817
12866
  this.unpublish = async () => {
12818
- const { assertItemOwned } = await import('./ownership-TR-mIjJh.js');
12867
+ const { assertItemOwned } = await import('./ownership-D-KsIkxM.js');
12819
12868
  const { getRevokeExecutor } = await Promise.resolve().then(function () { return publishConfig; });
12820
12869
  await assertItemOwned(this);
12821
12870
  const seedUid = this.seedUid;
@@ -12839,7 +12888,7 @@ class Item {
12839
12888
  this._service.send({ type: 'updateContext', revokedAt });
12840
12889
  };
12841
12890
  this.publish = async () => {
12842
- const { assertItemOwned } = await import('./ownership-TR-mIjJh.js');
12891
+ const { assertItemOwned } = await import('./ownership-D-KsIkxM.js');
12843
12892
  await assertItemOwned(this);
12844
12893
  this._service.send({ type: 'startPublish' });
12845
12894
  return new Promise((resolve, reject) => {
@@ -12875,12 +12924,12 @@ class Item {
12875
12924
  };
12876
12925
  this.getPublishUploads = async (options) => {
12877
12926
  // Use dynamic import to break circular dependency
12878
- const getPublishUploadsMod = await import('./getPublishUploads-Cf2J-5FR.js');
12927
+ const getPublishUploadsMod = await import('./getPublishUploads-CH72lAID.js');
12879
12928
  const { getPublishUploads } = getPublishUploadsMod;
12880
12929
  return await getPublishUploads(this, [], undefined, options);
12881
12930
  };
12882
12931
  this.getPublishPayload = async (uploadedTransactions, options) => {
12883
- const getPublishPayloadMod = await import('./getPublishPayload-Ddc_LGPs.js');
12932
+ const getPublishPayloadMod = await import('./getPublishPayload-DEdHgrgC.js');
12884
12933
  const { getPublishPayload } = getPublishPayloadMod;
12885
12934
  return await getPublishPayload(this, uploadedTransactions, options);
12886
12935
  };
@@ -13621,7 +13670,7 @@ class Item {
13621
13670
  if (!appDb || Item.instanceCache.size === 0) {
13622
13671
  return;
13623
13672
  }
13624
- const _mod_8 = await import('./index-BRo7D3s1.js');
13673
+ const _mod_8 = await import('./index-Bp0ChnQr.js');
13625
13674
  const _ns_8 = _mod_8.s;
13626
13675
  const { metadata } = _ns_8;
13627
13676
  const { eq, and } = await import('drizzle-orm');
@@ -14072,7 +14121,7 @@ class Item {
14072
14121
  itemActor.send(event);
14073
14122
  };
14074
14123
  try {
14075
- const _mod_9 = await import('./index-BRo7D3s1.js');
14124
+ const _mod_9 = await import('./index-Bp0ChnQr.js');
14076
14125
  const _ns_9 = _mod_9.s;
14077
14126
  const seedSchemaMod = _ns_9;
14078
14127
  const { seeds, versions, metadata } = seedSchemaMod;
@@ -14378,7 +14427,7 @@ class Item {
14378
14427
  * Destroy the item: soft delete in DB, remove from caches, clean up subscriptions, stop service.
14379
14428
  */
14380
14429
  async destroy() {
14381
- const { assertItemOwned } = await import('./ownership-TR-mIjJh.js');
14430
+ const { assertItemOwned } = await import('./ownership-D-KsIkxM.js');
14382
14431
  await assertItemOwned(this);
14383
14432
  const context = this._getSnapshotContext();
14384
14433
  const cacheKeys = Item.collectInstanceCacheKeysForInstance(this);
@@ -14534,7 +14583,7 @@ const runEasSync = fromPromise(async ({ input, }) => {
14534
14583
  requestPayload: input.requestPayload,
14535
14584
  persistedSnapshot: input.runningSnapshot,
14536
14585
  });
14537
- const { runSyncFromEas } = await import('./syncDbWithEas-CaytdS8D.js');
14586
+ const { runSyncFromEas } = await import('./syncDbWithEas-m-_3Ds7d.js');
14538
14587
  try {
14539
14588
  await runSyncFromEas(toRunSyncArg(input.options));
14540
14589
  await finalizeEasSyncProcessRow(rowId, {
@@ -14844,20 +14893,20 @@ const platformClassesInit = fromCallback(({ sendBack, input: { context, event }
14844
14893
  let PathResolver;
14845
14894
  let EasClient;
14846
14895
  if (isBrowser()) {
14847
- FileManager = (await import('./FileManager-C2uXql_C.js')).FileManager;
14848
- Db = (await import('./Db-B7whB3oJ.js')).Db;
14849
- QueryClient = (await import('./QueryClient-PqOg8mcw.js')).QueryClient;
14850
- ArweaveClient = (await import('./ArweaveClient-C-eLH0zU.js')).ArweaveClient;
14851
- PathResolver = (await import('./PathResolver-DnrG1hUX.js')).PathResolver;
14852
- EasClient = (await import('./EasClient-CFguAKBp.js')).EasClient;
14896
+ FileManager = (await import('./FileManager-BOxbzROS.js')).FileManager;
14897
+ Db = (await import('./Db-DA_e7Jcc.js')).Db;
14898
+ QueryClient = (await import('./QueryClient-B12y2daD.js')).QueryClient;
14899
+ ArweaveClient = (await import('./ArweaveClient-KF_T3NSr.js')).ArweaveClient;
14900
+ PathResolver = (await import('./PathResolver-DHTAlCzo.js')).PathResolver;
14901
+ EasClient = (await import('./EasClient-CVPHYGNP.js')).EasClient;
14853
14902
  }
14854
14903
  else if (isNode()) {
14855
- FileManager = (await import('./FileManager-BR3jtuSl.js')).FileManager;
14856
- Db = (await import('./Db-nir1xVHg.js')).Db;
14857
- QueryClient = (await import('./QueryClient-DJOrJZRR.js')).QueryClient;
14858
- ArweaveClient = (await import('./ArweaveClient-B-vm2Xae.js')).ArweaveClient;
14859
- PathResolver = (await import('./PathResolver-CZoSnHBU.js')).PathResolver;
14860
- EasClient = (await import('./EasClient-BH_feMaX.js')).EasClient;
14904
+ FileManager = (await import('./FileManager-Ba5BCbCL.js')).FileManager;
14905
+ Db = (await import('./Db-Cg7Q5gIc.js')).Db;
14906
+ QueryClient = (await import('./QueryClient-BCxuWg7f.js')).QueryClient;
14907
+ ArweaveClient = (await import('./ArweaveClient-DoBABTLW.js')).ArweaveClient;
14908
+ PathResolver = (await import('./PathResolver-D7WqjJCo.js')).PathResolver;
14909
+ EasClient = (await import('./EasClient-B4VivHxM.js')).EasClient;
14861
14910
  }
14862
14911
  else {
14863
14912
  throw new Error(`Unable to determine environment. isBrowser()=${isBrowser()}, isNode()=${isNode()}. Platform-specific implementations could not be loaded.`);
@@ -18257,7 +18306,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
18257
18306
  // Lazy import cache for ModelProperty to avoid circular dependency
18258
18307
  // Eagerly start loading to minimize delay on first access
18259
18308
  let ModelPropertyClass = null;
18260
- const modelPropertyImportPromise = import('./ModelProperty-CIeLasI4.js')
18309
+ const modelPropertyImportPromise = import('./ModelProperty-D6JLRqQW.js')
18261
18310
  .then(module => {
18262
18311
  ModelPropertyClass = module.ModelProperty;
18263
18312
  return ModelPropertyClass;
@@ -18274,7 +18323,7 @@ function getModelProperty() {
18274
18323
  }
18275
18324
  // Lazy import cache for Schema to avoid circular dependency
18276
18325
  let SchemaClass = null;
18277
- const schemaImportPromise = (async () => { const _mod_10 = await import('./Schema-B3YQHTtu.js'); return _mod_10.b; })()
18326
+ const schemaImportPromise = (async () => { const _mod_10 = await import('./Schema-B5_B8nM5.js'); return _mod_10.b; })()
18278
18327
  .then(module => {
18279
18328
  SchemaClass = module.Schema;
18280
18329
  return SchemaClass;
@@ -20015,4 +20064,4 @@ const TModelValues = Type.Record(Type.String(), Type.Any());
20015
20064
  const TModelSchema = Type.Record(Type.String(), TProperty);
20016
20065
 
20017
20066
  export { getItemData as $, models$1 as A, Boolean$1 as B, properties as C, Date$1 as D, isValidEasAttestationUid as E, File$1 as F, getLatestPublishedVersionRow as G, Html as H, Image as I, Json as J, modelPropertiesToObject as K, List as L, Model as M, Number$1 as N, parseListPropertyValueFromStorage as O, Property as P, getCorrectId as Q, Relation as R, INTERNAL_PROPERTY_NAMES as S, TModelValues as T, defaultAttestationData as U, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as V, INTERNAL_DATA_TYPES as W, toSnakeCase as X, getEasSchemaUidForSchemaDefinition as Y, ZERO_BYTES32 as Z, getEasSchemaForItemProperty as _, TModelSchema as a, compareMetadataRowsLatestFirst as a$, resolveStorageNameToSchemaName as a0, appState as a1, BasePathResolver as a2, SEED_CONFIG_FILE as a3, SEED_CONFIG_FALLBACKS as a4, BaseEasClient as a5, EAS_ENDPOINT as a6, BaseQueryClient as a7, arweaveL1FinalizeJobs as a8, config as a9, GET_SEEDS as aA, GET_VERSIONS as aB, GET_PROPERTIES as aC, setSchemaUidForSchemaDefinition as aD, parseEasRelationPropertyName as aE, addModelsToDb$1 as aF, SCHEMA_NJK as aG, ItemProperty as aH, ClientManager as aI, INIT_SCRIPT_SUCCESS_MESSAGE as aJ, SCHEMA_TS as aK, getRefValueType as aL, importJsonSchema as aM, loadSchemaFromFile as aN, readJsonImportFile as aO, syncSchemaFromSource as aP, transformImportToSchemaFile as aQ, writeProcessMachine as aR, getModelIdByFileId as aS, waitForEntityIdle as aT, createReactiveProxy as aU, findEntity as aV, forceRemoveFromCaches as aW, runDestroyLifecycle as aX, getModelId as aY, isPlaceholderUid as aZ, normalizeBytes32Hex as a_, easSyncProcesses as aa, metadata$1 as ab, modelRelations as ac, modelSchemas as ad, modelUids as ae, modelsRelations as af, propertiesRelations as ag, propertyUidRelations as ah, propertyUids as ai, publishProcesses as aj, schemas as ak, uploadProcesses as al, versions as am, graphql as an, getPropertyIdForModelAndName as ao, getAllAddressesFromDb as ap, getModelSchemasFromEas as aq, getSeedsFromSchemaUids as ar, getItemVersionsFromEas as as, getItemPropertiesFromEas as at, pickLatestPropertyAttestationsByRefAndSchema as au, scheduleBulkFilesDownloadFromEasSync as av, eventEmitter as aw, EAS_SEED_DATA_SYNCED_TO_DB_EVENT as ax, generateId as ay, escapeSqliteString as az, ModelPropertyDataTypes as b, isInternalSchema as b$, getArweaveUrlForTransaction as b0, ADDRESSES_PERSISTED_EVENT as b1, parseAddressesPersistedPayload as b2, getClient as b3, ClientManagerState as b4, MachineIds as b5, createNewItem as b6, getVersionData$1 as b7, getMetadataLatest as b8, loadAllSchemasFromDb as b9, queryArweaveGatewayTransaction as bA, queryArweaveGatewayTransactionWithFallback as bB, ensureReadGatewaySelected as bC, invalidateReadGatewayCache as bD, resetArweaveReadGatewayForTests as bE, setUploadExecutor as bF, getUploadExecutor as bG, setGetPublisherForNewSeeds as bH, getGetPublisherForNewSeeds as bI, setRevokeExecutor as bJ, getRevokeExecutor as bK, setAdditionalSyncAddresses as bL, createSchema as bM, readSchema as bN, listCompleteSchemaFiles as bO, getSchemaNameFromId as bP, easSyncActor as bQ, startEasSyncActor as bR, sendEasSyncClientRequest as bS, requestEasSyncFromAddressChange as bT, requestEasSyncFromEventBus as bU, requestEasSyncFromModelsInit as bV, mergeEasSyncRequestIntents as bW, addSchemaToDb as bX, createModelsFromJson as bY, loadModelsFromDbForSchema as bZ, getLatestSchemaVersion as b_, propertyMachine as ba, SEED_PROTOCOL_SCHEMA_NAME as bb, ImageSize as bc, setSchemaUidForModel as bd, getCanonicalItemPropertiesFromEas as be, getEasSchemaUidBySchemaName as bf, getSeedsBySchemaName as bg, withExcludeRevokedFilter as bh, classifyMediaRef as bi, resolveMediaRef as bj, normalizeFeedItemFields as bk, getFeedItemStringField as bl, SeedModels as bm, DEFAULT_ARWEAVE_HOST as bn, DEFAULT_ARWEAVE_GATEWAYS as bo, DEFAULT_ARWEAVE_GRAPHQL_URL as bp, getDefaultArweaveReadGatewayHostsOrdered as bq, mergePrimaryHostWithDefaults as br, isKnownArweaveGatewayHostname as bs, getAddressesForItemsFilter as bt, normalizeUploadApiBaseUrl as bu, getUploadApiArweaveDataUrl as bv, getUploadPipelineTransactionStatus as bw, getUploadApiArweaveStatusUrl as bx, getArweaveUploadStatus as by, isArweaveL1AnchoringComplete as bz, TPropertyDataType as c, createModelFromJson as c0, ConflictError as c1, unloadEntity as c2, clearDestroySubscriptions as c3, setupEntityLiveQuery as c4, ModelSchema as c5, BaseFileManager$1 as c6, db as c7, eas as c8, getPropertyData$1 as c9, Item$1 as ca, schema as cb, SEEDPROTOCOL_Seed_Protocol_v1 as cc, Model$1 as cd, TStorageType as d, THtmlEmbeddedDataUriPolicy as e, TProperty as f, TPropertyConstructor as g, TPropertyDefs as h, PropertyMetadataKey as i, PropertyConstructor as j, Text as k, DEFAULT_TEXT_MAX_LENGTH as l, TValidationRules as m, normalizeDataType as n, getOwnedAddressesFromDb as o, BaseDb as p, getGetAdditionalSyncAddresses as q, resolveSeedIdsFromRefString as r, seeds as s, normalizeRelationPropertyValue as t, Item as u, BaseFileManager as v, getContentHash as w, htmlEmbeddedImageCoPublish as x, BaseArweaveClient as y, getEasSchemaUidForModel as z };
20018
- //# sourceMappingURL=index-DUMXLKJr.js.map
20067
+ //# sourceMappingURL=index-18lln0cM.js.map