@seedprotocol/sdk 0.6.2 → 0.6.3

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 (74) hide show
  1. package/dist/{ModelProperty-DMjKVphl.js → ModelProperty-BiDQu5rE.js} +17 -17
  2. package/dist/{ModelProperty-DMjKVphl.js.map → ModelProperty-BiDQu5rE.js.map} +1 -1
  3. package/dist/{Schema-cK2z7wet.js → Schema-qciDB7Nu.js} +23 -23
  4. package/dist/{Schema-cK2z7wet.js.map → Schema-qciDB7Nu.js.map} +1 -1
  5. package/dist/{SchemaValidationService-B3pQ_q-9.js → SchemaValidationService-BaOkRjsU.js} +4 -4
  6. package/dist/{SchemaValidationService-B3pQ_q-9.js.map → SchemaValidationService-BaOkRjsU.js.map} +1 -1
  7. package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js → backfillMetadataPropertyIds-oypxoBXv.js} +2 -2
  8. package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js.map → backfillMetadataPropertyIds-oypxoBXv.js.map} +1 -1
  9. package/dist/cjs/{ModelProperty-CCwtTuvi.js → ModelProperty-DvIIhBnK.js} +17 -17
  10. package/dist/cjs/{ModelProperty-CCwtTuvi.js.map → ModelProperty-DvIIhBnK.js.map} +1 -1
  11. package/dist/cjs/{Schema-DU28JWKv.js → Schema-FdzNqyGo.js} +20 -20
  12. package/dist/cjs/{Schema-DU28JWKv.js.map → Schema-FdzNqyGo.js.map} +1 -1
  13. package/dist/cjs/{SchemaValidationService-BOYI1syg.js → SchemaValidationService-pxRoOs79.js} +2 -2
  14. package/dist/cjs/{SchemaValidationService-BOYI1syg.js.map → SchemaValidationService-pxRoOs79.js.map} +1 -1
  15. package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js → backfillMetadataPropertyIds-D0o5VwBh.js} +2 -2
  16. package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js.map → backfillMetadataPropertyIds-D0o5VwBh.js.map} +1 -1
  17. package/dist/cjs/{eas-D-Casv2P.js → eas-DSZkoDUn.js} +3 -3
  18. package/dist/cjs/{eas-D-Casv2P.js.map → eas-DSZkoDUn.js.map} +1 -1
  19. package/dist/cjs/{getItem-BPAs0Jxp.js → getItem-CPcdcFuS.js} +2 -2
  20. package/dist/cjs/{getItem-BPAs0Jxp.js.map → getItem-CPcdcFuS.js.map} +1 -1
  21. package/dist/cjs/{getPublishPayload-BeoNRCLY.js → getPublishPayload-BvmVTKoc.js} +11 -11
  22. package/dist/cjs/{getPublishPayload-BeoNRCLY.js.map → getPublishPayload-BvmVTKoc.js.map} +1 -1
  23. package/dist/cjs/{getPublishUploads-C75vy7nb.js → getPublishUploads-D2VZHZnu.js} +4 -4
  24. package/dist/cjs/{getPublishUploads-C75vy7nb.js.map → getPublishUploads-D2VZHZnu.js.map} +1 -1
  25. package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js → getSegmentedItemProperties-Bm1TEvBS.js} +3 -3
  26. package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js.map → getSegmentedItemProperties-Bm1TEvBS.js.map} +1 -1
  27. package/dist/cjs/{index-BbfxH7OY.js → index-C-POwaLs.js} +158 -160
  28. package/dist/cjs/index-C-POwaLs.js.map +1 -0
  29. package/dist/cjs/{index-CA6kGjZH.js → index-D_ph4zut.js} +3 -3
  30. package/dist/cjs/index-D_ph4zut.js.map +1 -0
  31. package/dist/cjs/{property-aeBSv5CF.js → property-DkUtJxV2.js} +4 -4
  32. package/dist/cjs/{property-aeBSv5CF.js.map → property-DkUtJxV2.js.map} +1 -1
  33. package/dist/cjs/{syncDbWithEas-ChvunkwQ.js → syncDbWithEas-DRoys7eo.js} +6 -6
  34. package/dist/cjs/{syncDbWithEas-ChvunkwQ.js.map → syncDbWithEas-DRoys7eo.js.map} +1 -1
  35. package/dist/{constants-DMHTYMgJ.js → constants-Bre6dTJR.js} +3 -1
  36. package/dist/constants-Bre6dTJR.js.map +1 -0
  37. package/dist/{db-BwVuO1tO.js → db-DVsy4QZe.js} +4 -4
  38. package/dist/{db-BwVuO1tO.js.map → db-DVsy4QZe.js.map} +1 -1
  39. package/dist/{eas-C0H0EbDo.js → eas-z4W41ith.js} +2 -2
  40. package/dist/{eas-C0H0EbDo.js.map → eas-z4W41ith.js.map} +1 -1
  41. package/dist/{getItem-Cxa-rKqh.js → getItem-BiE_b7Fu.js} +4 -4
  42. package/dist/{getItem-Cxa-rKqh.js.map → getItem-BiE_b7Fu.js.map} +1 -1
  43. package/dist/{getPublishPayload-DmOu0I29.js → getPublishPayload-CuRGEZa5.js} +13 -13
  44. package/dist/{getPublishPayload-DmOu0I29.js.map → getPublishPayload-CuRGEZa5.js.map} +1 -1
  45. package/dist/{getPublishUploads-gWv4tDyT.js → getPublishUploads-CMgzBCzZ.js} +6 -6
  46. package/dist/{getPublishUploads-gWv4tDyT.js.map → getPublishUploads-CMgzBCzZ.js.map} +1 -1
  47. package/dist/{getSegmentedItemProperties-BfIBZbR7.js → getSegmentedItemProperties-BCCSwTxr.js} +3 -3
  48. package/dist/{getSegmentedItemProperties-BfIBZbR7.js.map → getSegmentedItemProperties-BCCSwTxr.js.map} +1 -1
  49. package/dist/{index-DAwvrNga.js → index-C41UZTmQ.js} +5 -5
  50. package/dist/index-C41UZTmQ.js.map +1 -0
  51. package/dist/{index-C1pktvdj.js → index-DjwIC6U3.js} +160 -164
  52. package/dist/index-DjwIC6U3.js.map +1 -0
  53. package/dist/{index.node-DqC_o5EN.js → index.node-DQZ3cPe-.js} +3 -3
  54. package/dist/{index.node-DqC_o5EN.js.map → index.node-DQZ3cPe-.js.map} +1 -1
  55. package/dist/main.cjs +1 -1
  56. package/dist/main.js +18 -18
  57. package/dist/node.js +5 -5
  58. package/dist/platform.browser.js +1 -1
  59. package/dist/platform.node.js +2 -2
  60. package/dist/{property-eMrSbAWU.js → property-Bs3a4Dna.js} +6 -6
  61. package/dist/{property-eMrSbAWU.js.map → property-Bs3a4Dna.js.map} +1 -1
  62. package/dist/src/Item/Item.d.ts.map +1 -1
  63. package/dist/src/Model/Model.d.ts.map +1 -1
  64. package/dist/src/helpers/constants.d.ts.map +1 -1
  65. package/dist/src/helpers/reactiveProxy.d.ts +10 -0
  66. package/dist/src/helpers/reactiveProxy.d.ts.map +1 -1
  67. package/dist/{syncDbWithEas-c9Xe17zq.js → syncDbWithEas-DRpLRxwb.js} +8 -8
  68. package/dist/{syncDbWithEas-c9Xe17zq.js.map → syncDbWithEas-DRpLRxwb.js.map} +1 -1
  69. package/package.json +5 -5
  70. package/dist/cjs/index-BbfxH7OY.js.map +0 -1
  71. package/dist/cjs/index-CA6kGjZH.js.map +0 -1
  72. package/dist/constants-DMHTYMgJ.js.map +0 -1
  73. package/dist/index-C1pktvdj.js.map +0 -1
  74. package/dist/index-DAwvrNga.js.map +0 -1
@@ -999,7 +999,7 @@ const createPropertyInstances = async (propertyFileIds) => {
999
999
  return;
1000
1000
  }
1001
1001
  try {
1002
- const mod = await Promise.resolve().then(function () { return require('./ModelProperty-CCwtTuvi.js'); });
1002
+ const mod = await Promise.resolve().then(function () { return require('./ModelProperty-DvIIhBnK.js'); });
1003
1003
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
1004
1004
  if (!ModelProperty) {
1005
1005
  logger$v('createPropertyInstances: ModelProperty not available from dynamic import');
@@ -1183,7 +1183,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
1183
1183
  // Step 2: Fallback to Schema context (only if database doesn't have the model)
1184
1184
  // This handles the case where model exists in schema file but not yet in database
1185
1185
  try {
1186
- const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
1186
+ const schemaMod = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
1187
1187
  const { Schema } = schemaMod;
1188
1188
  const schema = Schema.create(schemaName, { waitForReady: false });
1189
1189
  const schemaSnapshot = schema.getService().getSnapshot();
@@ -1427,7 +1427,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
1427
1427
  }
1428
1428
  // Mark schema as draft when a new model is created so saveNewVersion() can persist it
1429
1429
  try {
1430
- const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
1430
+ const schemaMod = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
1431
1431
  const { Schema } = schemaMod;
1432
1432
  const schema = Schema.create(schemaName, { waitForReady: false });
1433
1433
  schema.getService().send({ type: 'markAsDraft', propertyKey: 'schema:models' });
@@ -1471,10 +1471,10 @@ const validateModel = xstate.fromCallback(({ sendBack, input: { context } }) =>
1471
1471
  const _validateModel = async () => {
1472
1472
  try {
1473
1473
  // Use dynamic imports to break circular dependencies
1474
- const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
1474
+ const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
1475
1475
  const { SchemaValidationService } = validationServiceMod;
1476
1476
  const validationService = new SchemaValidationService();
1477
- const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
1477
+ const schemaMod = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
1478
1478
  const { Schema } = schemaMod;
1479
1479
  // Validate model structure
1480
1480
  const structureResult = validationService.validateModelStructure(context);
@@ -1584,7 +1584,7 @@ const createModelProperties = xstate.fromCallback(({ sendBack, input }) => {
1584
1584
  return;
1585
1585
  }
1586
1586
  logger$t(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
1587
- const mod = await Promise.resolve().then(function () { return require('./ModelProperty-CCwtTuvi.js'); });
1587
+ const mod = await Promise.resolve().then(function () { return require('./ModelProperty-DvIIhBnK.js'); });
1588
1588
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
1589
1589
  if (!ModelProperty) {
1590
1590
  logger$t('ModelProperty not available from dynamic import');
@@ -1687,7 +1687,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
1687
1687
  const structureMsg = `[validateEntity] Validating model structure`;
1688
1688
  logger$s(structureMsg);
1689
1689
  // Use existing Model validation
1690
- const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
1690
+ const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
1691
1691
  const { SchemaValidationService } = validationServiceMod;
1692
1692
  const validationService = new SchemaValidationService();
1693
1693
  // Validate model structure
@@ -1705,7 +1705,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
1705
1705
  if (entityInput.entityData.schemaName) {
1706
1706
  try {
1707
1707
  logger$s(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
1708
- const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
1708
+ const schemaMod = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
1709
1709
  const { Schema } = schemaMod;
1710
1710
  const schema = Schema.create(entityInput.entityData.schemaName, {
1711
1711
  waitForReady: false,
@@ -1741,7 +1741,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
1741
1741
  }
1742
1742
  else if (entityInput.entityType === 'modelProperty') {
1743
1743
  // Use existing ModelProperty validation
1744
- const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
1744
+ const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
1745
1745
  const { SchemaValidationService } = validationServiceMod;
1746
1746
  const validationService = new SchemaValidationService();
1747
1747
  // Validate property structure
@@ -1756,7 +1756,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
1756
1756
  // If schema name and model name provided, validate against schema
1757
1757
  if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
1758
1758
  try {
1759
- const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
1759
+ const schemaMod = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
1760
1760
  const { Schema } = schemaMod;
1761
1761
  const schema = Schema.create(entityInput.entityData._schemaName, {
1762
1762
  waitForReady: false,
@@ -1785,7 +1785,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
1785
1785
  }
1786
1786
  else if (entityInput.entityType === 'schema') {
1787
1787
  // Schema validation - use existing validation
1788
- const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
1788
+ const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
1789
1789
  const { SchemaValidationService } = validationServiceMod;
1790
1790
  const validationService = new SchemaValidationService();
1791
1791
  const schemaResult = validationService.validateSchema(entityInput.entityData);
@@ -3865,7 +3865,7 @@ const writeToDatabase = xstate.fromCallback(({ sendBack, input }) => {
3865
3865
  // initial write completes is not overwritten by the stale requestWrite payload.
3866
3866
  let dataToWrite = input.entityData;
3867
3867
  try {
3868
- const mod = await Promise.resolve().then(function () { return require('./ModelProperty-CCwtTuvi.js'); });
3868
+ const mod = await Promise.resolve().then(function () { return require('./ModelProperty-DvIIhBnK.js'); });
3869
3869
  const ModelProperty = mod?.ModelProperty ?? mod?.default;
3870
3870
  if (ModelProperty && typeof ModelProperty.getById === 'function') {
3871
3871
  const instance = ModelProperty.getById(input.entityId);
@@ -4245,7 +4245,7 @@ const modelMachine = xstate.setup({
4245
4245
  // Create ModelProperty instances for any new property IDs
4246
4246
  if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
4247
4247
  // Import and create instances asynchronously (fire-and-forget)
4248
- Promise.resolve().then(function () { return require('./ModelProperty-CCwtTuvi.js'); }).then(({ ModelProperty }) => {
4248
+ Promise.resolve().then(function () { return require('./ModelProperty-DvIIhBnK.js'); }).then(({ ModelProperty }) => {
4249
4249
  const createPromises = newPropertyIds.map(async (propertyFileId) => {
4250
4250
  try {
4251
4251
  const property = await ModelProperty.createById(propertyFileId);
@@ -4540,6 +4540,111 @@ const modelMachine = xstate.setup({
4540
4540
  },
4541
4541
  });
4542
4542
 
4543
+ /**
4544
+ * Proxy [[GetOwnProperty]] that stays compatible with the target.
4545
+ * Never overrides an own descriptor, never invents on a non-extensible target,
4546
+ * and never promotes a prototype accessor to an own descriptor.
4547
+ */
4548
+ function getInvariantSafePropertyDescriptor(target, prop, invent) {
4549
+ const own = Reflect.getOwnPropertyDescriptor(target, prop);
4550
+ if (own)
4551
+ return own;
4552
+ if (!invent)
4553
+ return undefined;
4554
+ if (!Object.isExtensible(target))
4555
+ return undefined;
4556
+ return {
4557
+ enumerable: true,
4558
+ configurable: true,
4559
+ value: invent.value,
4560
+ writable: invent.writable ?? true,
4561
+ };
4562
+ }
4563
+ /**
4564
+ * Creates a reactive Proxy that intercepts property access and assignment
4565
+ * to read from and write to an actor service's context.
4566
+ *
4567
+ * This enables automatic React re-renders when properties change, as the
4568
+ * React hooks subscribe to the actor service which gets updated when properties
4569
+ * are set via the proxy.
4570
+ *
4571
+ * @param config Configuration object
4572
+ * @returns A proxied instance that behaves like the original but with reactive properties
4573
+ *
4574
+ * @note TypeScript's Proxy type doesn't automatically preserve method signatures,
4575
+ * so we use Proxied<T> to ensure all methods and properties are recognized.
4576
+ * The Proxy implementation preserves all methods via Reflect.get, so this is safe.
4577
+ */
4578
+ function createReactiveProxy(config) {
4579
+ const { instance, trackedProperties, getContext, sendUpdate } = config;
4580
+ // Convert readonly array to regular array for includes() checks
4581
+ const trackedPropsSet = new Set(trackedProperties);
4582
+ // Create the proxy - TypeScript needs explicit type assertion to preserve all methods
4583
+ // The Proxy preserves all methods via Reflect.get, so we assert it maintains type T
4584
+ // Using 'as unknown as T' forces TypeScript to recognize all methods and properties
4585
+ const proxy = new Proxy(instance, {
4586
+ get(target, prop) {
4587
+ // Handle special properties that should not be proxied
4588
+ // These need direct access to the underlying instance
4589
+ if (prop === '_service') {
4590
+ return Reflect.get(target, prop);
4591
+ }
4592
+ // If it's a tracked property, read from actor context
4593
+ if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
4594
+ const context = getContext(instance);
4595
+ return context[prop];
4596
+ }
4597
+ // For methods and non-tracked properties, use Reflect
4598
+ return Reflect.get(target, prop);
4599
+ },
4600
+ set(target, prop, value) {
4601
+ // Handle special properties
4602
+ if (prop === '_service') {
4603
+ return Reflect.set(target, prop, value);
4604
+ }
4605
+ // If it's a tracked property, send update to actor
4606
+ if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
4607
+ sendUpdate(instance, prop, value);
4608
+ return true; // Indicate success
4609
+ }
4610
+ // For non-tracked properties, use Reflect. Also trigger sendUpdate for virtual
4611
+ // 'value' so the callback runs when .value is assigned (e.g. ItemProperty).
4612
+ if (typeof prop === 'string' && prop === 'value') {
4613
+ sendUpdate(instance, prop, value);
4614
+ }
4615
+ return Reflect.set(target, prop, value);
4616
+ },
4617
+ has(target, prop) {
4618
+ // Check if property exists in context or on target
4619
+ if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
4620
+ const context = getContext(instance);
4621
+ return prop in context;
4622
+ }
4623
+ return Reflect.has(target, prop);
4624
+ },
4625
+ ownKeys(target) {
4626
+ // Only return keys that actually exist on the target object
4627
+ // This is required when the target is non-extensible (e.g., frozen by Immer)
4628
+ // Tracked properties are virtual (read from context), so we don't include them here
4629
+ // They're accessible via the get trap, but don't appear in ownKeys
4630
+ return Reflect.ownKeys(target);
4631
+ },
4632
+ getOwnPropertyDescriptor(target, prop) {
4633
+ let invent;
4634
+ if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
4635
+ const context = getContext(instance);
4636
+ if (prop in context) {
4637
+ invent = { value: context[prop] };
4638
+ }
4639
+ }
4640
+ return getInvariantSafePropertyDescriptor(target, prop, invent);
4641
+ }
4642
+ });
4643
+ // Force TypeScript to recognize all methods and properties are preserved
4644
+ // The Proxy implementation preserves all methods via Reflect.get, so this is safe
4645
+ return proxy;
4646
+ }
4647
+
4543
4648
  const ENV = (typeof process !== 'undefined' && process.env)
4544
4649
  ? process.env
4545
4650
  : (typeof window !== 'undefined' && window.env)
@@ -5226,7 +5331,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
5226
5331
  const schemaNameToTry = model$1?.schemaName;
5227
5332
  if (schemaNameToTry) {
5228
5333
  try {
5229
- const { Schema } = await Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); });
5334
+ const { Schema } = await Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); });
5230
5335
  const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
5231
5336
  const schemaContext = schemaInstance.getService().getSnapshot().context;
5232
5337
  if (schemaContext.models?.[modelName]?.properties) {
@@ -5275,7 +5380,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
5275
5380
  }
5276
5381
  }
5277
5382
  if (Object.keys(propertySchemas).length === 0) {
5278
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
5383
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
5279
5384
  const { ModelPropertyDataTypes } = schemaMod;
5280
5385
  const KNOWN_MODEL_FALLBACKS = {
5281
5386
  Post: {
@@ -5322,7 +5427,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
5322
5427
  // Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
5323
5428
  let propSchema = propertySchemas[propertyName];
5324
5429
  if (!propSchema && isRefTypeFromMeta) {
5325
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
5430
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
5326
5431
  const { ModelPropertyDataTypes } = schemaMod;
5327
5432
  propSchema = {
5328
5433
  dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
@@ -5579,9 +5684,9 @@ const runPublish = xstate.fromCallback(({ sendBack, input: { context } }) => {
5579
5684
  sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
5580
5685
  return;
5581
5686
  }
5582
- const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-C75vy7nb.js'); });
5687
+ const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-D2VZHZnu.js'); });
5583
5688
  const { getPublishUploads } = getPublishUploadsMod;
5584
- const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-BeoNRCLY.js'); });
5689
+ const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-BvmVTKoc.js'); });
5585
5690
  const { getPublishPayload } = getPublishPayloadMod;
5586
5691
  const uploads = await getPublishUploads(item);
5587
5692
  let uploadedTransactions = [];
@@ -5941,6 +6046,8 @@ const INTERNAL_PROPERTY_NAMES = [
5941
6046
  '_markedForDeletion',
5942
6047
  // SDK-internal: wallet address of attester; never publish as property attestation
5943
6048
  'publisher',
6049
+ // SDK-internal: Unix timestamp when attestations were revoked; never a schema field
6050
+ 'revokedAt',
5944
6051
  ];
5945
6052
  const VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA = '0x13c0fd59d69dbce40501a41f8b37768d26dd2e2bb0cad64615334d84f7b9bdf6';
5946
6053
  const defaultAttestationData = {
@@ -6681,7 +6788,7 @@ const resolveRelatedValue = xstate.fromCallback(({ sendBack, input: { context }
6681
6788
  const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
6682
6789
  const _resolveRelatedValue = async () => {
6683
6790
  // Use dynamic import to break circular dependency
6684
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
6791
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
6685
6792
  const { ModelPropertyDataTypes } = schemaMod;
6686
6793
  if (!propertyValue || !isRelation || populatedFromDb) {
6687
6794
  return;
@@ -7685,7 +7792,7 @@ const hydrateFromDb = xstate.fromCallback(({ sendBack, input: { context } }) =>
7685
7792
  // to use dynamically imported ModelPropertyDataTypes
7686
7793
  const _hydrateFromDb = async () => {
7687
7794
  // Use dynamic import to break circular dependency
7688
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
7795
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
7689
7796
  const { ModelPropertyDataTypes } = schemaMod;
7690
7797
  const appDb = BaseDb.getAppDb();
7691
7798
  const whereClauses = [];
@@ -8048,7 +8155,7 @@ const loadOrCreateProperty = xstate.fromCallback(({ sendBack, input: { context }
8048
8155
  };
8049
8156
  // Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
8050
8157
  try {
8051
- const { getPropertySchema } = await Promise.resolve().then(function () { return require('./property-aeBSv5CF.js'); });
8158
+ const { getPropertySchema } = await Promise.resolve().then(function () { return require('./property-DkUtJxV2.js'); });
8052
8159
  let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName);
8053
8160
  if (!schemaFromFile?.validation) {
8054
8161
  // Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
@@ -8513,9 +8620,9 @@ const analyzeInput = xstate.fromCallback(({ sendBack, input: { context, event }
8513
8620
  }
8514
8621
  const _analyzeInput = async () => {
8515
8622
  // Use dynamic import to break circular dependency
8516
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
8623
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
8517
8624
  const { ModelPropertyDataTypes } = schemaMod;
8518
- const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
8625
+ const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
8519
8626
  let propertyName = propertyNameRaw;
8520
8627
  if (!propertyName) {
8521
8628
  throw new Error('propertyName is required');
@@ -8713,7 +8820,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
8713
8820
  propertyRecordSchema?.validation &&
8714
8821
  metadataValues.propertyValue != null &&
8715
8822
  metadataValues.propertyValue !== '') {
8716
- const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-BOYI1syg.js'); });
8823
+ const { SchemaValidationService } = await Promise.resolve().then(function () { return require('./SchemaValidationService-pxRoOs79.js'); });
8717
8824
  const validationService = new SchemaValidationService();
8718
8825
  const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, normalizeDataType(propertyRecordSchema.dataType), propertyRecordSchema.validation, propertyRecordSchema.refValueType
8719
8826
  ? normalizeDataType(String(propertyRecordSchema.refValueType))
@@ -9306,7 +9413,7 @@ const saveRelation = xstate.fromCallback(({ sendBack, input: { context, event }
9306
9413
  }
9307
9414
  const _saveRelation = async () => {
9308
9415
  // Use dynamic import to break circular dependency
9309
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
9416
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
9310
9417
  const { ModelPropertyDataTypes } = schemaMod;
9311
9418
  if (!propertyNameRaw) {
9312
9419
  throw new Error('propertyName is required');
@@ -10055,95 +10162,6 @@ async function runDestroyLifecycle(instance, config) {
10055
10162
  }
10056
10163
  }
10057
10164
 
10058
- /**
10059
- * Creates a reactive Proxy that intercepts property access and assignment
10060
- * to read from and write to an actor service's context.
10061
- *
10062
- * This enables automatic React re-renders when properties change, as the
10063
- * React hooks subscribe to the actor service which gets updated when properties
10064
- * are set via the proxy.
10065
- *
10066
- * @param config Configuration object
10067
- * @returns A proxied instance that behaves like the original but with reactive properties
10068
- *
10069
- * @note TypeScript's Proxy type doesn't automatically preserve method signatures,
10070
- * so we use Proxied<T> to ensure all methods and properties are recognized.
10071
- * The Proxy implementation preserves all methods via Reflect.get, so this is safe.
10072
- */
10073
- function createReactiveProxy(config) {
10074
- const { instance, trackedProperties, getContext, sendUpdate } = config;
10075
- // Convert readonly array to regular array for includes() checks
10076
- const trackedPropsSet = new Set(trackedProperties);
10077
- // Create the proxy - TypeScript needs explicit type assertion to preserve all methods
10078
- // The Proxy preserves all methods via Reflect.get, so we assert it maintains type T
10079
- // Using 'as unknown as T' forces TypeScript to recognize all methods and properties
10080
- const proxy = new Proxy(instance, {
10081
- get(target, prop) {
10082
- // Handle special properties that should not be proxied
10083
- // These need direct access to the underlying instance
10084
- if (prop === '_service') {
10085
- return Reflect.get(target, prop);
10086
- }
10087
- // If it's a tracked property, read from actor context
10088
- if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
10089
- const context = getContext(instance);
10090
- return context[prop];
10091
- }
10092
- // For methods and non-tracked properties, use Reflect
10093
- return Reflect.get(target, prop);
10094
- },
10095
- set(target, prop, value) {
10096
- // Handle special properties
10097
- if (prop === '_service') {
10098
- return Reflect.set(target, prop, value);
10099
- }
10100
- // If it's a tracked property, send update to actor
10101
- if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
10102
- sendUpdate(instance, prop, value);
10103
- return true; // Indicate success
10104
- }
10105
- // For non-tracked properties, use Reflect. Also trigger sendUpdate for virtual
10106
- // 'value' so the callback runs when .value is assigned (e.g. ItemProperty).
10107
- if (typeof prop === 'string' && prop === 'value') {
10108
- sendUpdate(instance, prop, value);
10109
- }
10110
- return Reflect.set(target, prop, value);
10111
- },
10112
- has(target, prop) {
10113
- // Check if property exists in context or on target
10114
- if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
10115
- const context = getContext(instance);
10116
- return prop in context;
10117
- }
10118
- return Reflect.has(target, prop);
10119
- },
10120
- ownKeys(target) {
10121
- // Only return keys that actually exist on the target object
10122
- // This is required when the target is non-extensible (e.g., frozen by Immer)
10123
- // Tracked properties are virtual (read from context), so we don't include them here
10124
- // They're accessible via the get trap, but don't appear in ownKeys
10125
- return Reflect.ownKeys(target);
10126
- },
10127
- getOwnPropertyDescriptor(target, prop) {
10128
- if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
10129
- const context = getContext(instance);
10130
- if (prop in context) {
10131
- return {
10132
- enumerable: true,
10133
- configurable: true,
10134
- value: context[prop],
10135
- writable: true,
10136
- };
10137
- }
10138
- }
10139
- return Reflect.getOwnPropertyDescriptor(target, prop);
10140
- }
10141
- });
10142
- // Force TypeScript to recognize all methods and properties are preserved
10143
- // The Proxy implementation preserves all methods via Reflect.get, so this is safe
10144
- return proxy;
10145
- }
10146
-
10147
10165
  /** Parent Html property `propertyValue` after publish (66-char seed uid). */
10148
10166
  const HTML_PROP_SEED_UID_RE = /^0x[a-fA-F0-9]{64}$/;
10149
10167
  // Start loading Model at module load time (non-blocking)
@@ -10350,7 +10368,7 @@ class ItemProperty {
10350
10368
  return;
10351
10369
  }
10352
10370
  // Use dynamic import to break circular dependency
10353
- const schemaMod = await Promise.resolve().then(function () { return require('./index-CA6kGjZH.js'); });
10371
+ const schemaMod = await Promise.resolve().then(function () { return require('./index-D_ph4zut.js'); });
10354
10372
  const { ModelPropertyDataTypes } = schemaMod;
10355
10373
  const { context } = snapshot;
10356
10374
  const { propertyRecordSchema } = context;
@@ -11659,12 +11677,12 @@ class Item {
11659
11677
  };
11660
11678
  this.getPublishUploads = async (options) => {
11661
11679
  // Use dynamic import to break circular dependency
11662
- const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-C75vy7nb.js'); });
11680
+ const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-D2VZHZnu.js'); });
11663
11681
  const { getPublishUploads } = getPublishUploadsMod;
11664
11682
  return await getPublishUploads(this, [], undefined, options);
11665
11683
  };
11666
11684
  this.getPublishPayload = async (uploadedTransactions, options) => {
11667
- const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-BeoNRCLY.js'); });
11685
+ const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-BvmVTKoc.js'); });
11668
11686
  const { getPublishPayload } = getPublishPayloadMod;
11669
11687
  return await getPublishPayload(this, uploadedTransactions, options);
11670
11688
  };
@@ -11783,6 +11801,7 @@ class Item {
11783
11801
  'latestVersionUid',
11784
11802
  'publishedVersionUid',
11785
11803
  'publishedVersionLocalId',
11804
+ 'revokedAt',
11786
11805
  ];
11787
11806
  const keysFromInitial = Object.keys(initialValues).filter((key) => !metadataKeys.includes(key));
11788
11807
  const schemaNameForModel = initialValues.schemaName;
@@ -12088,19 +12107,14 @@ class Item {
12088
12107
  return Reflect.ownKeys(target);
12089
12108
  },
12090
12109
  getOwnPropertyDescriptor(target, prop) {
12091
- // Handle tracked properties
12110
+ let invent;
12092
12111
  if (typeof prop === 'string' && TRACKED_PROPERTIES$1.includes(prop)) {
12093
12112
  const context = target._getSnapshotContext();
12094
12113
  if (prop in context) {
12095
- return {
12096
- enumerable: true,
12097
- configurable: true,
12098
- value: context[prop],
12099
- writable: true,
12100
- };
12114
+ invent = { value: context[prop] };
12101
12115
  }
12102
12116
  }
12103
- return Reflect.getOwnPropertyDescriptor(target, prop);
12117
+ return getInvariantSafePropertyDescriptor(target, prop, invent);
12104
12118
  },
12105
12119
  });
12106
12120
  this.registerItemInInstanceCache(proxiedInstance);
@@ -12268,19 +12282,14 @@ class Item {
12268
12282
  return Reflect.ownKeys(target);
12269
12283
  },
12270
12284
  getOwnPropertyDescriptor(target, prop) {
12271
- // Handle tracked properties
12285
+ let invent;
12272
12286
  if (typeof prop === 'string' && TRACKED_PROPERTIES$1.includes(prop)) {
12273
12287
  const context = target._getSnapshotContext();
12274
12288
  if (prop in context) {
12275
- return {
12276
- enumerable: true,
12277
- configurable: true,
12278
- value: context[prop],
12279
- writable: true,
12280
- };
12289
+ invent = { value: context[prop] };
12281
12290
  }
12282
12291
  }
12283
- return Reflect.getOwnPropertyDescriptor(target, prop);
12292
+ return getInvariantSafePropertyDescriptor(target, prop, invent);
12284
12293
  },
12285
12294
  });
12286
12295
  this.registerItemInInstanceCache(proxiedInstance);
@@ -12592,6 +12601,7 @@ class Item {
12592
12601
  }
12593
12602
  },
12594
12603
  enumerable: true,
12604
+ configurable: true,
12595
12605
  });
12596
12606
  state.definedPropertyNames.add(propertyName);
12597
12607
  }
@@ -13329,7 +13339,7 @@ const runEasSync = xstate.fromPromise(async ({ input, }) => {
13329
13339
  requestPayload: input.requestPayload,
13330
13340
  persistedSnapshot: input.runningSnapshot,
13331
13341
  });
13332
- const { runSyncFromEas } = await Promise.resolve().then(function () { return require('./syncDbWithEas-ChvunkwQ.js'); });
13342
+ const { runSyncFromEas } = await Promise.resolve().then(function () { return require('./syncDbWithEas-DRoys7eo.js'); });
13333
13343
  try {
13334
13344
  await runSyncFromEas(toRunSyncArg(input.options));
13335
13345
  await finalizeEasSyncProcessRow(rowId, {
@@ -17827,7 +17837,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
17827
17837
  // Lazy import cache for ModelProperty to avoid circular dependency
17828
17838
  // Eagerly start loading to minimize delay on first access
17829
17839
  let ModelPropertyClass = null;
17830
- const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-CCwtTuvi.js'); })
17840
+ const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-DvIIhBnK.js'); })
17831
17841
  .then(module => {
17832
17842
  ModelPropertyClass = module.ModelProperty;
17833
17843
  return ModelPropertyClass;
@@ -17844,7 +17854,7 @@ function getModelProperty() {
17844
17854
  }
17845
17855
  // Lazy import cache for Schema to avoid circular dependency
17846
17856
  let SchemaClass = null;
17847
- const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-DU28JWKv.js'); })
17857
+ const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-FdzNqyGo.js'); })
17848
17858
  .then(module => {
17849
17859
  SchemaClass = module.Schema;
17850
17860
  return SchemaClass;
@@ -18302,37 +18312,25 @@ class Model {
18302
18312
  getOwnPropertyDescriptor(target, prop) {
18303
18313
  // Handle 'name' as an alias for 'modelName'
18304
18314
  if (prop === 'name') {
18305
- const context = target._getSnapshotContext();
18306
- return {
18307
- enumerable: true,
18308
- configurable: true,
18309
- value: context.modelName,
18310
- writable: true,
18311
- };
18315
+ return getInvariantSafePropertyDescriptor(target, prop, {
18316
+ value: target._getSnapshotContext().modelName,
18317
+ });
18312
18318
  }
18313
18319
  // Handle 'id' property - returns the modelFileId
18314
18320
  if (prop === 'id') {
18315
- const context = target._getSnapshotContext();
18316
- return {
18317
- enumerable: true,
18318
- configurable: true,
18319
- value: context.id, // id is now the schemaFileId (string)
18321
+ return getInvariantSafePropertyDescriptor(target, prop, {
18322
+ value: target._getSnapshotContext().id, // id is now the schemaFileId (string)
18320
18323
  writable: false, // id is read-only
18321
- };
18324
+ });
18322
18325
  }
18323
- // Handle tracked properties
18326
+ let invent;
18324
18327
  if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop)) {
18325
18328
  const context = target._getSnapshotContext();
18326
18329
  if (prop in context) {
18327
- return {
18328
- enumerable: true,
18329
- configurable: true,
18330
- value: context[prop],
18331
- writable: true,
18332
- };
18330
+ invent = { value: context[prop] };
18333
18331
  }
18334
18332
  }
18335
- return Reflect.getOwnPropertyDescriptor(target, prop);
18333
+ return getInvariantSafePropertyDescriptor(target, prop, invent);
18336
18334
  },
18337
18335
  });
18338
18336
  // Step 8: Store in new ID-based cache
@@ -19758,7 +19756,7 @@ function resolveSdkDrizzleMigrationsDir(sdkRootDir) {
19758
19756
  })();
19759
19757
  // Also resolve relative to this module so temp-cwd tests / odd roots still find
19760
19758
  // packages/sdk/src/db/drizzle (or dist/db/drizzle after publish).
19761
- const moduleDir = path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-BbfxH7OY.js', document.baseURI).href))));
19759
+ const moduleDir = path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-C-POwaLs.js', document.baseURI).href))));
19762
19760
  const candidates = [
19763
19761
  path.join(root, 'db', 'drizzle'), // production: sdkRoot is dist/
19764
19762
  path.join(root, 'dist', 'db', 'drizzle'), // sdk package root with built dist
@@ -19828,7 +19826,7 @@ class NodeDb {
19828
19826
  logger$1('[Db.prepareDb] running migrations from %s', outDir);
19829
19827
  await migrator.migrate(db, { migrationsFolder: outDir });
19830
19828
  this.db = db;
19831
- const { backfillMetadataPropertyIds } = await Promise.resolve().then(function () { return require('./backfillMetadataPropertyIds-CrvyL7Xq.js'); });
19829
+ const { backfillMetadataPropertyIds } = await Promise.resolve().then(function () { return require('./backfillMetadataPropertyIds-D0o5VwBh.js'); });
19832
19830
  await backfillMetadataPropertyIds();
19833
19831
  return this.db;
19834
19832
  }
@@ -20419,4 +20417,4 @@ exports.versions = versions;
20419
20417
  exports.waitForEntityIdle = waitForEntityIdle;
20420
20418
  exports.withSeed = withSeed;
20421
20419
  exports.writeProcessMachine = writeProcessMachine;
20422
- //# sourceMappingURL=index-BbfxH7OY.js.map
20420
+ //# sourceMappingURL=index-C-POwaLs.js.map