@seedprotocol/sdk 0.6.2 → 0.6.4
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.
- package/dist/{ModelProperty-DMjKVphl.js → ModelProperty-BiDQu5rE.js} +17 -17
- package/dist/{ModelProperty-DMjKVphl.js.map → ModelProperty-BiDQu5rE.js.map} +1 -1
- package/dist/{Schema-cK2z7wet.js → Schema-qciDB7Nu.js} +23 -23
- package/dist/{Schema-cK2z7wet.js.map → Schema-qciDB7Nu.js.map} +1 -1
- package/dist/{SchemaValidationService-B3pQ_q-9.js → SchemaValidationService-BaOkRjsU.js} +4 -4
- package/dist/{SchemaValidationService-B3pQ_q-9.js.map → SchemaValidationService-BaOkRjsU.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js → backfillMetadataPropertyIds-oypxoBXv.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js.map → backfillMetadataPropertyIds-oypxoBXv.js.map} +1 -1
- package/dist/cjs/{ModelProperty-CCwtTuvi.js → ModelProperty-DvIIhBnK.js} +17 -17
- package/dist/cjs/{ModelProperty-CCwtTuvi.js.map → ModelProperty-DvIIhBnK.js.map} +1 -1
- package/dist/cjs/{Schema-DU28JWKv.js → Schema-FdzNqyGo.js} +20 -20
- package/dist/cjs/{Schema-DU28JWKv.js.map → Schema-FdzNqyGo.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-BOYI1syg.js → SchemaValidationService-pxRoOs79.js} +2 -2
- package/dist/cjs/{SchemaValidationService-BOYI1syg.js.map → SchemaValidationService-pxRoOs79.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js → backfillMetadataPropertyIds-D0o5VwBh.js} +2 -2
- package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js.map → backfillMetadataPropertyIds-D0o5VwBh.js.map} +1 -1
- package/dist/cjs/{eas-D-Casv2P.js → eas-DSZkoDUn.js} +3 -3
- package/dist/cjs/{eas-D-Casv2P.js.map → eas-DSZkoDUn.js.map} +1 -1
- package/dist/cjs/{getItem-BPAs0Jxp.js → getItem-CPcdcFuS.js} +2 -2
- package/dist/cjs/{getItem-BPAs0Jxp.js.map → getItem-CPcdcFuS.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-BeoNRCLY.js → getPublishPayload-BvmVTKoc.js} +11 -11
- package/dist/cjs/{getPublishPayload-BeoNRCLY.js.map → getPublishPayload-BvmVTKoc.js.map} +1 -1
- package/dist/cjs/{getPublishUploads-C75vy7nb.js → getPublishUploads-D2VZHZnu.js} +4 -4
- package/dist/cjs/{getPublishUploads-C75vy7nb.js.map → getPublishUploads-D2VZHZnu.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js → getSegmentedItemProperties-Bm1TEvBS.js} +3 -3
- package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js.map → getSegmentedItemProperties-Bm1TEvBS.js.map} +1 -1
- package/dist/cjs/{index-BbfxH7OY.js → index-C-POwaLs.js} +158 -160
- package/dist/cjs/index-C-POwaLs.js.map +1 -0
- package/dist/cjs/{index-CA6kGjZH.js → index-D_ph4zut.js} +3 -3
- package/dist/cjs/index-D_ph4zut.js.map +1 -0
- package/dist/cjs/{property-aeBSv5CF.js → property-DkUtJxV2.js} +4 -4
- package/dist/cjs/{property-aeBSv5CF.js.map → property-DkUtJxV2.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-ChvunkwQ.js → syncDbWithEas-DRoys7eo.js} +6 -6
- package/dist/cjs/{syncDbWithEas-ChvunkwQ.js.map → syncDbWithEas-DRoys7eo.js.map} +1 -1
- package/dist/{constants-DMHTYMgJ.js → constants-Bre6dTJR.js} +3 -1
- package/dist/constants-Bre6dTJR.js.map +1 -0
- package/dist/{db-BwVuO1tO.js → db-DVsy4QZe.js} +4 -4
- package/dist/{db-BwVuO1tO.js.map → db-DVsy4QZe.js.map} +1 -1
- package/dist/{eas-C0H0EbDo.js → eas-z4W41ith.js} +2 -2
- package/dist/{eas-C0H0EbDo.js.map → eas-z4W41ith.js.map} +1 -1
- package/dist/{getItem-Cxa-rKqh.js → getItem-BiE_b7Fu.js} +4 -4
- package/dist/{getItem-Cxa-rKqh.js.map → getItem-BiE_b7Fu.js.map} +1 -1
- package/dist/{getPublishPayload-DmOu0I29.js → getPublishPayload-CuRGEZa5.js} +13 -13
- package/dist/{getPublishPayload-DmOu0I29.js.map → getPublishPayload-CuRGEZa5.js.map} +1 -1
- package/dist/{getPublishUploads-gWv4tDyT.js → getPublishUploads-CMgzBCzZ.js} +6 -6
- package/dist/{getPublishUploads-gWv4tDyT.js.map → getPublishUploads-CMgzBCzZ.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-BfIBZbR7.js → getSegmentedItemProperties-BCCSwTxr.js} +3 -3
- package/dist/{getSegmentedItemProperties-BfIBZbR7.js.map → getSegmentedItemProperties-BCCSwTxr.js.map} +1 -1
- package/dist/{index-DAwvrNga.js → index-C41UZTmQ.js} +5 -5
- package/dist/index-C41UZTmQ.js.map +1 -0
- package/dist/{index-C1pktvdj.js → index-DjwIC6U3.js} +160 -164
- package/dist/index-DjwIC6U3.js.map +1 -0
- package/dist/{index.node-DqC_o5EN.js → index.node-DQZ3cPe-.js} +3 -3
- package/dist/{index.node-DqC_o5EN.js.map → index.node-DQZ3cPe-.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +18 -18
- package/dist/node.js +5 -5
- package/dist/platform.browser.js +1 -1
- package/dist/platform.node.js +2 -2
- package/dist/{property-eMrSbAWU.js → property-Bs3a4Dna.js} +6 -6
- package/dist/{property-eMrSbAWU.js.map → property-Bs3a4Dna.js.map} +1 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/reactiveProxy.d.ts +10 -0
- package/dist/src/helpers/reactiveProxy.d.ts.map +1 -1
- package/dist/{syncDbWithEas-c9Xe17zq.js → syncDbWithEas-DRpLRxwb.js} +8 -8
- package/dist/{syncDbWithEas-c9Xe17zq.js.map → syncDbWithEas-DRpLRxwb.js.map} +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-BbfxH7OY.js.map +0 -1
- package/dist/cjs/index-CA6kGjZH.js.map +0 -1
- package/dist/constants-DMHTYMgJ.js.map +0 -1
- package/dist/index-C1pktvdj.js.map +0 -1
- package/dist/index-DAwvrNga.js.map +0 -1
|
@@ -5,10 +5,10 @@ import { n as normalizeDataType, t as toSnakeCase, o as MachineIds, v as getStor
|
|
|
5
5
|
import debug from 'debug';
|
|
6
6
|
import { customAlphabet } from 'nanoid';
|
|
7
7
|
import { alphanumeric } from 'nanoid-dictionary';
|
|
8
|
-
import { w as writeModelToDb, m as writePropertyToDb, k as addSchemaToDb, n as normalizePublisher, o as getOwnedAddressesFromDb, j as normalizeAddressList, b as normalizeHexAddress, h as getAddressesForItemsFilter, a as getAllAddressesFromDb, e as escapeSqliteString, g as getPropertyIdForModelAndName, i as normalizeAddressConfig, l as loadModelsFromDbForSchema, p as getWatchedAddressesFromDb, r as renameModelInDb } from './db-
|
|
8
|
+
import { w as writeModelToDb, m as writePropertyToDb, k as addSchemaToDb, n as normalizePublisher, o as getOwnedAddressesFromDb, j as normalizeAddressList, b as normalizeHexAddress, h as getAddressesForItemsFilter, a as getAllAddressesFromDb, e as escapeSqliteString, g as getPropertyIdForModelAndName, i as normalizeAddressConfig, l as loadModelsFromDbForSchema, p as getWatchedAddressesFromDb, r as renameModelInDb } from './db-DVsy4QZe.js';
|
|
9
9
|
import pluralize from 'pluralize';
|
|
10
10
|
import { BaseQueryClient, BaseEasClient, GET_SCHEMAS, getSchemaUidForModelFromCache, setSchemaUidForModel, GET_PROPERTIES, pickLatestPropertyAttestationsByRefAndSchema, isValidEasAttestationUid, isPlaceholderUid, getEasSchemaUidForSchemaDefinition, GET_FILES_METADATA, GET_SCHEMA_BY_NAME } from '@seedprotocol/eas';
|
|
11
|
-
import { ZERO_BYTES32, INTERNAL_PROPERTY_NAMES, INTERNAL_DATA_TYPES, ImageSize, PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP, isInternalSchema, INTERNAL_SCHEMA_IDS, SEED_PROTOCOL_SCHEMA_NAME, CLIENT_NOT_INITIALIZED } from './constants-
|
|
11
|
+
import { ZERO_BYTES32, INTERNAL_PROPERTY_NAMES, INTERNAL_DATA_TYPES, ImageSize, PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP, isInternalSchema, INTERNAL_SCHEMA_IDS, SEED_PROTOCOL_SCHEMA_NAME, CLIENT_NOT_INITIALIZED } from './constants-Bre6dTJR.js';
|
|
12
12
|
import { BehaviorSubject } from 'rxjs';
|
|
13
13
|
import { startCase, throttle, upperFirst, camelCase, orderBy } from 'lodash-es';
|
|
14
14
|
import { toSnakeCase as toSnakeCase$1 } from 'drizzle-orm/casing';
|
|
@@ -283,7 +283,7 @@ const createPropertyInstances = async (propertyFileIds) => {
|
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
285
|
try {
|
|
286
|
-
const mod = await import('./ModelProperty-
|
|
286
|
+
const mod = await import('./ModelProperty-BiDQu5rE.js');
|
|
287
287
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
288
288
|
if (!ModelProperty) {
|
|
289
289
|
logger$s('createPropertyInstances: ModelProperty not available from dynamic import');
|
|
@@ -467,7 +467,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
467
467
|
// Step 2: Fallback to Schema context (only if database doesn't have the model)
|
|
468
468
|
// This handles the case where model exists in schema file but not yet in database
|
|
469
469
|
try {
|
|
470
|
-
const _mod_0 = await import('./Schema-
|
|
470
|
+
const _mod_0 = await import('./Schema-qciDB7Nu.js');
|
|
471
471
|
const _ns_0 = _mod_0.b;
|
|
472
472
|
const schemaMod = _ns_0;
|
|
473
473
|
const { Schema } = schemaMod;
|
|
@@ -541,7 +541,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
541
541
|
let finalModelName = modelName;
|
|
542
542
|
if (db) {
|
|
543
543
|
// Check if this is an internal schema (Seed Protocol)
|
|
544
|
-
const constantsMod = await import('./constants-
|
|
544
|
+
const constantsMod = await import('./constants-Bre6dTJR.js');
|
|
545
545
|
const { isInternalSchema } = constantsMod;
|
|
546
546
|
const isInternal = isInternalSchema(schemaName);
|
|
547
547
|
// Only skip duplicate check if:
|
|
@@ -717,7 +717,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
717
717
|
}
|
|
718
718
|
// Mark schema as draft when a new model is created so saveNewVersion() can persist it
|
|
719
719
|
try {
|
|
720
|
-
const _mod_3 = await import('./Schema-
|
|
720
|
+
const _mod_3 = await import('./Schema-qciDB7Nu.js');
|
|
721
721
|
const _ns_3 = _mod_3.b;
|
|
722
722
|
const schemaMod = _ns_3;
|
|
723
723
|
const { Schema } = schemaMod;
|
|
@@ -763,10 +763,10 @@ const validateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
763
763
|
const _validateModel = async () => {
|
|
764
764
|
try {
|
|
765
765
|
// Use dynamic imports to break circular dependencies
|
|
766
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
766
|
+
const validationServiceMod = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
767
767
|
const { SchemaValidationService } = validationServiceMod;
|
|
768
768
|
const validationService = new SchemaValidationService();
|
|
769
|
-
const _mod_4 = await import('./Schema-
|
|
769
|
+
const _mod_4 = await import('./Schema-qciDB7Nu.js');
|
|
770
770
|
const _ns_4 = _mod_4.b;
|
|
771
771
|
const schemaMod = _ns_4;
|
|
772
772
|
const { Schema } = schemaMod;
|
|
@@ -878,7 +878,7 @@ const createModelProperties = fromCallback(({ sendBack, input }) => {
|
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
880
880
|
logger$q(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
|
|
881
|
-
const mod = await import('./ModelProperty-
|
|
881
|
+
const mod = await import('./ModelProperty-BiDQu5rE.js');
|
|
882
882
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
883
883
|
if (!ModelProperty) {
|
|
884
884
|
logger$q('ModelProperty not available from dynamic import');
|
|
@@ -981,7 +981,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
981
981
|
const structureMsg = `[validateEntity] Validating model structure`;
|
|
982
982
|
logger$p(structureMsg);
|
|
983
983
|
// Use existing Model validation
|
|
984
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
984
|
+
const validationServiceMod = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
985
985
|
const { SchemaValidationService } = validationServiceMod;
|
|
986
986
|
const validationService = new SchemaValidationService();
|
|
987
987
|
// Validate model structure
|
|
@@ -999,7 +999,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
999
999
|
if (entityInput.entityData.schemaName) {
|
|
1000
1000
|
try {
|
|
1001
1001
|
logger$p(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
|
|
1002
|
-
const _mod_5 = await import('./Schema-
|
|
1002
|
+
const _mod_5 = await import('./Schema-qciDB7Nu.js');
|
|
1003
1003
|
const _ns_5 = _mod_5.b;
|
|
1004
1004
|
const schemaMod = _ns_5;
|
|
1005
1005
|
const { Schema } = schemaMod;
|
|
@@ -1037,7 +1037,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
else if (entityInput.entityType === 'modelProperty') {
|
|
1039
1039
|
// Use existing ModelProperty validation
|
|
1040
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
1040
|
+
const validationServiceMod = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
1041
1041
|
const { SchemaValidationService } = validationServiceMod;
|
|
1042
1042
|
const validationService = new SchemaValidationService();
|
|
1043
1043
|
// Validate property structure
|
|
@@ -1052,7 +1052,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1052
1052
|
// If schema name and model name provided, validate against schema
|
|
1053
1053
|
if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
|
|
1054
1054
|
try {
|
|
1055
|
-
const _mod_6 = await import('./Schema-
|
|
1055
|
+
const _mod_6 = await import('./Schema-qciDB7Nu.js');
|
|
1056
1056
|
const _ns_6 = _mod_6.b;
|
|
1057
1057
|
const schemaMod = _ns_6;
|
|
1058
1058
|
const { Schema } = schemaMod;
|
|
@@ -1083,7 +1083,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
else if (entityInput.entityType === 'schema') {
|
|
1085
1085
|
// Schema validation - use existing validation
|
|
1086
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
1086
|
+
const validationServiceMod = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
1087
1087
|
const { SchemaValidationService } = validationServiceMod;
|
|
1088
1088
|
const validationService = new SchemaValidationService();
|
|
1089
1089
|
const schemaResult = validationService.validateSchema(entityInput.entityData);
|
|
@@ -1156,7 +1156,7 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
|
|
|
1156
1156
|
// initial write completes is not overwritten by the stale requestWrite payload.
|
|
1157
1157
|
let dataToWrite = input.entityData;
|
|
1158
1158
|
try {
|
|
1159
|
-
const mod = await import('./ModelProperty-
|
|
1159
|
+
const mod = await import('./ModelProperty-BiDQu5rE.js');
|
|
1160
1160
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1161
1161
|
if (ModelProperty && typeof ModelProperty.getById === 'function') {
|
|
1162
1162
|
const instance = ModelProperty.getById(input.entityId);
|
|
@@ -1536,7 +1536,7 @@ const modelMachine = setup({
|
|
|
1536
1536
|
// Create ModelProperty instances for any new property IDs
|
|
1537
1537
|
if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
|
|
1538
1538
|
// Import and create instances asynchronously (fire-and-forget)
|
|
1539
|
-
import('./ModelProperty-
|
|
1539
|
+
import('./ModelProperty-BiDQu5rE.js').then(({ ModelProperty }) => {
|
|
1540
1540
|
const createPromises = newPropertyIds.map(async (propertyFileId) => {
|
|
1541
1541
|
try {
|
|
1542
1542
|
const property = await ModelProperty.createById(propertyFileId);
|
|
@@ -1831,6 +1831,111 @@ const modelMachine = setup({
|
|
|
1831
1831
|
},
|
|
1832
1832
|
});
|
|
1833
1833
|
|
|
1834
|
+
/**
|
|
1835
|
+
* Proxy [[GetOwnProperty]] that stays compatible with the target.
|
|
1836
|
+
* Never overrides an own descriptor, never invents on a non-extensible target,
|
|
1837
|
+
* and never promotes a prototype accessor to an own descriptor.
|
|
1838
|
+
*/
|
|
1839
|
+
function getInvariantSafePropertyDescriptor(target, prop, invent) {
|
|
1840
|
+
const own = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1841
|
+
if (own)
|
|
1842
|
+
return own;
|
|
1843
|
+
if (!invent)
|
|
1844
|
+
return undefined;
|
|
1845
|
+
if (!Object.isExtensible(target))
|
|
1846
|
+
return undefined;
|
|
1847
|
+
return {
|
|
1848
|
+
enumerable: true,
|
|
1849
|
+
configurable: true,
|
|
1850
|
+
value: invent.value,
|
|
1851
|
+
writable: invent.writable ?? true,
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Creates a reactive Proxy that intercepts property access and assignment
|
|
1856
|
+
* to read from and write to an actor service's context.
|
|
1857
|
+
*
|
|
1858
|
+
* This enables automatic React re-renders when properties change, as the
|
|
1859
|
+
* React hooks subscribe to the actor service which gets updated when properties
|
|
1860
|
+
* are set via the proxy.
|
|
1861
|
+
*
|
|
1862
|
+
* @param config Configuration object
|
|
1863
|
+
* @returns A proxied instance that behaves like the original but with reactive properties
|
|
1864
|
+
*
|
|
1865
|
+
* @note TypeScript's Proxy type doesn't automatically preserve method signatures,
|
|
1866
|
+
* so we use Proxied<T> to ensure all methods and properties are recognized.
|
|
1867
|
+
* The Proxy implementation preserves all methods via Reflect.get, so this is safe.
|
|
1868
|
+
*/
|
|
1869
|
+
function createReactiveProxy(config) {
|
|
1870
|
+
const { instance, trackedProperties, getContext, sendUpdate } = config;
|
|
1871
|
+
// Convert readonly array to regular array for includes() checks
|
|
1872
|
+
const trackedPropsSet = new Set(trackedProperties);
|
|
1873
|
+
// Create the proxy - TypeScript needs explicit type assertion to preserve all methods
|
|
1874
|
+
// The Proxy preserves all methods via Reflect.get, so we assert it maintains type T
|
|
1875
|
+
// Using 'as unknown as T' forces TypeScript to recognize all methods and properties
|
|
1876
|
+
const proxy = new Proxy(instance, {
|
|
1877
|
+
get(target, prop) {
|
|
1878
|
+
// Handle special properties that should not be proxied
|
|
1879
|
+
// These need direct access to the underlying instance
|
|
1880
|
+
if (prop === '_service') {
|
|
1881
|
+
return Reflect.get(target, prop);
|
|
1882
|
+
}
|
|
1883
|
+
// If it's a tracked property, read from actor context
|
|
1884
|
+
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
1885
|
+
const context = getContext(instance);
|
|
1886
|
+
return context[prop];
|
|
1887
|
+
}
|
|
1888
|
+
// For methods and non-tracked properties, use Reflect
|
|
1889
|
+
return Reflect.get(target, prop);
|
|
1890
|
+
},
|
|
1891
|
+
set(target, prop, value) {
|
|
1892
|
+
// Handle special properties
|
|
1893
|
+
if (prop === '_service') {
|
|
1894
|
+
return Reflect.set(target, prop, value);
|
|
1895
|
+
}
|
|
1896
|
+
// If it's a tracked property, send update to actor
|
|
1897
|
+
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
1898
|
+
sendUpdate(instance, prop, value);
|
|
1899
|
+
return true; // Indicate success
|
|
1900
|
+
}
|
|
1901
|
+
// For non-tracked properties, use Reflect. Also trigger sendUpdate for virtual
|
|
1902
|
+
// 'value' so the callback runs when .value is assigned (e.g. ItemProperty).
|
|
1903
|
+
if (typeof prop === 'string' && prop === 'value') {
|
|
1904
|
+
sendUpdate(instance, prop, value);
|
|
1905
|
+
}
|
|
1906
|
+
return Reflect.set(target, prop, value);
|
|
1907
|
+
},
|
|
1908
|
+
has(target, prop) {
|
|
1909
|
+
// Check if property exists in context or on target
|
|
1910
|
+
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
1911
|
+
const context = getContext(instance);
|
|
1912
|
+
return prop in context;
|
|
1913
|
+
}
|
|
1914
|
+
return Reflect.has(target, prop);
|
|
1915
|
+
},
|
|
1916
|
+
ownKeys(target) {
|
|
1917
|
+
// Only return keys that actually exist on the target object
|
|
1918
|
+
// This is required when the target is non-extensible (e.g., frozen by Immer)
|
|
1919
|
+
// Tracked properties are virtual (read from context), so we don't include them here
|
|
1920
|
+
// They're accessible via the get trap, but don't appear in ownKeys
|
|
1921
|
+
return Reflect.ownKeys(target);
|
|
1922
|
+
},
|
|
1923
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
1924
|
+
let invent;
|
|
1925
|
+
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
1926
|
+
const context = getContext(instance);
|
|
1927
|
+
if (prop in context) {
|
|
1928
|
+
invent = { value: context[prop] };
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
return getInvariantSafePropertyDescriptor(target, prop, invent);
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
// Force TypeScript to recognize all methods and properties are preserved
|
|
1935
|
+
// The Proxy implementation preserves all methods via Reflect.get, so this is safe
|
|
1936
|
+
return proxy;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1834
1939
|
debug('seedSdk:item:service:actors:waitForDb');
|
|
1835
1940
|
const waitForDb$1 = fromCallback(({ sendBack }) => {
|
|
1836
1941
|
const _waitForDb = new Promise((resolve) => {
|
|
@@ -2434,7 +2539,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
2434
2539
|
const schemaNameToTry = model$1?.schemaName;
|
|
2435
2540
|
if (schemaNameToTry) {
|
|
2436
2541
|
try {
|
|
2437
|
-
const _mod_7 = await import('./Schema-
|
|
2542
|
+
const _mod_7 = await import('./Schema-qciDB7Nu.js');
|
|
2438
2543
|
const _ns_7 = _mod_7.b;
|
|
2439
2544
|
const { Schema } = _ns_7;
|
|
2440
2545
|
const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
|
|
@@ -2487,7 +2592,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
2487
2592
|
}
|
|
2488
2593
|
}
|
|
2489
2594
|
if (Object.keys(propertySchemas).length === 0) {
|
|
2490
|
-
const schemaMod = await import('./index-
|
|
2595
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
2491
2596
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2492
2597
|
const KNOWN_MODEL_FALLBACKS = {
|
|
2493
2598
|
Post: {
|
|
@@ -2534,7 +2639,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
2534
2639
|
// Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
|
|
2535
2640
|
let propSchema = propertySchemas[propertyName];
|
|
2536
2641
|
if (!propSchema && isRefTypeFromMeta) {
|
|
2537
|
-
const schemaMod = await import('./index-
|
|
2642
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
2538
2643
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2539
2644
|
propSchema = {
|
|
2540
2645
|
dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
|
|
@@ -2791,9 +2896,9 @@ const runPublish = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2791
2896
|
sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
|
|
2792
2897
|
return;
|
|
2793
2898
|
}
|
|
2794
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
2899
|
+
const getPublishUploadsMod = await import('./getPublishUploads-CMgzBCzZ.js');
|
|
2795
2900
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
2796
|
-
const getPublishPayloadMod = await import('./getPublishPayload-
|
|
2901
|
+
const getPublishPayloadMod = await import('./getPublishPayload-CuRGEZa5.js');
|
|
2797
2902
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
2798
2903
|
const uploads = await getPublishUploads(item);
|
|
2799
2904
|
let uploadedTransactions = [];
|
|
@@ -3765,7 +3870,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3765
3870
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
3766
3871
|
const _resolveRelatedValue = async () => {
|
|
3767
3872
|
// Use dynamic import to break circular dependency
|
|
3768
|
-
const schemaMod = await import('./index-
|
|
3873
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
3769
3874
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
3770
3875
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
3771
3876
|
return;
|
|
@@ -4769,7 +4874,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
4769
4874
|
// to use dynamically imported ModelPropertyDataTypes
|
|
4770
4875
|
const _hydrateFromDb = async () => {
|
|
4771
4876
|
// Use dynamic import to break circular dependency
|
|
4772
|
-
const schemaMod = await import('./index-
|
|
4877
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
4773
4878
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
4774
4879
|
const appDb = BaseDb.getAppDb();
|
|
4775
4880
|
const whereClauses = [];
|
|
@@ -5132,7 +5237,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
5132
5237
|
};
|
|
5133
5238
|
// Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
|
|
5134
5239
|
try {
|
|
5135
|
-
const { getPropertySchema } = await import('./property-
|
|
5240
|
+
const { getPropertySchema } = await import('./property-Bs3a4Dna.js');
|
|
5136
5241
|
let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName);
|
|
5137
5242
|
if (!schemaFromFile?.validation) {
|
|
5138
5243
|
// Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
|
|
@@ -5601,9 +5706,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
5601
5706
|
}
|
|
5602
5707
|
const _analyzeInput = async () => {
|
|
5603
5708
|
// Use dynamic import to break circular dependency
|
|
5604
|
-
const schemaMod = await import('./index-
|
|
5709
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
5605
5710
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5606
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
5711
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
5607
5712
|
let propertyName = propertyNameRaw;
|
|
5608
5713
|
if (!propertyName) {
|
|
5609
5714
|
throw new Error('propertyName is required');
|
|
@@ -5801,7 +5906,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
|
|
|
5801
5906
|
propertyRecordSchema?.validation &&
|
|
5802
5907
|
metadataValues.propertyValue != null &&
|
|
5803
5908
|
metadataValues.propertyValue !== '') {
|
|
5804
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
5909
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-BaOkRjsU.js');
|
|
5805
5910
|
const validationService = new SchemaValidationService();
|
|
5806
5911
|
const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, normalizeDataType(propertyRecordSchema.dataType), propertyRecordSchema.validation, propertyRecordSchema.refValueType
|
|
5807
5912
|
? normalizeDataType(String(propertyRecordSchema.refValueType))
|
|
@@ -6394,7 +6499,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
6394
6499
|
}
|
|
6395
6500
|
const _saveRelation = async () => {
|
|
6396
6501
|
// Use dynamic import to break circular dependency
|
|
6397
|
-
const schemaMod = await import('./index-
|
|
6502
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
6398
6503
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
6399
6504
|
if (!propertyNameRaw) {
|
|
6400
6505
|
throw new Error('propertyName is required');
|
|
@@ -7143,95 +7248,6 @@ async function runDestroyLifecycle(instance, config) {
|
|
|
7143
7248
|
}
|
|
7144
7249
|
}
|
|
7145
7250
|
|
|
7146
|
-
/**
|
|
7147
|
-
* Creates a reactive Proxy that intercepts property access and assignment
|
|
7148
|
-
* to read from and write to an actor service's context.
|
|
7149
|
-
*
|
|
7150
|
-
* This enables automatic React re-renders when properties change, as the
|
|
7151
|
-
* React hooks subscribe to the actor service which gets updated when properties
|
|
7152
|
-
* are set via the proxy.
|
|
7153
|
-
*
|
|
7154
|
-
* @param config Configuration object
|
|
7155
|
-
* @returns A proxied instance that behaves like the original but with reactive properties
|
|
7156
|
-
*
|
|
7157
|
-
* @note TypeScript's Proxy type doesn't automatically preserve method signatures,
|
|
7158
|
-
* so we use Proxied<T> to ensure all methods and properties are recognized.
|
|
7159
|
-
* The Proxy implementation preserves all methods via Reflect.get, so this is safe.
|
|
7160
|
-
*/
|
|
7161
|
-
function createReactiveProxy(config) {
|
|
7162
|
-
const { instance, trackedProperties, getContext, sendUpdate } = config;
|
|
7163
|
-
// Convert readonly array to regular array for includes() checks
|
|
7164
|
-
const trackedPropsSet = new Set(trackedProperties);
|
|
7165
|
-
// Create the proxy - TypeScript needs explicit type assertion to preserve all methods
|
|
7166
|
-
// The Proxy preserves all methods via Reflect.get, so we assert it maintains type T
|
|
7167
|
-
// Using 'as unknown as T' forces TypeScript to recognize all methods and properties
|
|
7168
|
-
const proxy = new Proxy(instance, {
|
|
7169
|
-
get(target, prop) {
|
|
7170
|
-
// Handle special properties that should not be proxied
|
|
7171
|
-
// These need direct access to the underlying instance
|
|
7172
|
-
if (prop === '_service') {
|
|
7173
|
-
return Reflect.get(target, prop);
|
|
7174
|
-
}
|
|
7175
|
-
// If it's a tracked property, read from actor context
|
|
7176
|
-
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
7177
|
-
const context = getContext(instance);
|
|
7178
|
-
return context[prop];
|
|
7179
|
-
}
|
|
7180
|
-
// For methods and non-tracked properties, use Reflect
|
|
7181
|
-
return Reflect.get(target, prop);
|
|
7182
|
-
},
|
|
7183
|
-
set(target, prop, value) {
|
|
7184
|
-
// Handle special properties
|
|
7185
|
-
if (prop === '_service') {
|
|
7186
|
-
return Reflect.set(target, prop, value);
|
|
7187
|
-
}
|
|
7188
|
-
// If it's a tracked property, send update to actor
|
|
7189
|
-
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
7190
|
-
sendUpdate(instance, prop, value);
|
|
7191
|
-
return true; // Indicate success
|
|
7192
|
-
}
|
|
7193
|
-
// For non-tracked properties, use Reflect. Also trigger sendUpdate for virtual
|
|
7194
|
-
// 'value' so the callback runs when .value is assigned (e.g. ItemProperty).
|
|
7195
|
-
if (typeof prop === 'string' && prop === 'value') {
|
|
7196
|
-
sendUpdate(instance, prop, value);
|
|
7197
|
-
}
|
|
7198
|
-
return Reflect.set(target, prop, value);
|
|
7199
|
-
},
|
|
7200
|
-
has(target, prop) {
|
|
7201
|
-
// Check if property exists in context or on target
|
|
7202
|
-
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
7203
|
-
const context = getContext(instance);
|
|
7204
|
-
return prop in context;
|
|
7205
|
-
}
|
|
7206
|
-
return Reflect.has(target, prop);
|
|
7207
|
-
},
|
|
7208
|
-
ownKeys(target) {
|
|
7209
|
-
// Only return keys that actually exist on the target object
|
|
7210
|
-
// This is required when the target is non-extensible (e.g., frozen by Immer)
|
|
7211
|
-
// Tracked properties are virtual (read from context), so we don't include them here
|
|
7212
|
-
// They're accessible via the get trap, but don't appear in ownKeys
|
|
7213
|
-
return Reflect.ownKeys(target);
|
|
7214
|
-
},
|
|
7215
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
7216
|
-
if (typeof prop === 'string' && trackedPropsSet.has(prop)) {
|
|
7217
|
-
const context = getContext(instance);
|
|
7218
|
-
if (prop in context) {
|
|
7219
|
-
return {
|
|
7220
|
-
enumerable: true,
|
|
7221
|
-
configurable: true,
|
|
7222
|
-
value: context[prop],
|
|
7223
|
-
writable: true,
|
|
7224
|
-
};
|
|
7225
|
-
}
|
|
7226
|
-
}
|
|
7227
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
7228
|
-
}
|
|
7229
|
-
});
|
|
7230
|
-
// Force TypeScript to recognize all methods and properties are preserved
|
|
7231
|
-
// The Proxy implementation preserves all methods via Reflect.get, so this is safe
|
|
7232
|
-
return proxy;
|
|
7233
|
-
}
|
|
7234
|
-
|
|
7235
7251
|
/** Parent Html property `propertyValue` after publish (66-char seed uid). */
|
|
7236
7252
|
const HTML_PROP_SEED_UID_RE = /^0x[a-fA-F0-9]{64}$/;
|
|
7237
7253
|
// Start loading Model at module load time (non-blocking)
|
|
@@ -7438,7 +7454,7 @@ class ItemProperty {
|
|
|
7438
7454
|
return;
|
|
7439
7455
|
}
|
|
7440
7456
|
// Use dynamic import to break circular dependency
|
|
7441
|
-
const schemaMod = await import('./index-
|
|
7457
|
+
const schemaMod = await import('./index-C41UZTmQ.js');
|
|
7442
7458
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7443
7459
|
const { context } = snapshot;
|
|
7444
7460
|
const { propertyRecordSchema } = context;
|
|
@@ -8751,12 +8767,12 @@ class Item {
|
|
|
8751
8767
|
};
|
|
8752
8768
|
this.getPublishUploads = async (options) => {
|
|
8753
8769
|
// Use dynamic import to break circular dependency
|
|
8754
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
8770
|
+
const getPublishUploadsMod = await import('./getPublishUploads-CMgzBCzZ.js');
|
|
8755
8771
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
8756
8772
|
return await getPublishUploads(this, [], undefined, options);
|
|
8757
8773
|
};
|
|
8758
8774
|
this.getPublishPayload = async (uploadedTransactions, options) => {
|
|
8759
|
-
const getPublishPayloadMod = await import('./getPublishPayload-
|
|
8775
|
+
const getPublishPayloadMod = await import('./getPublishPayload-CuRGEZa5.js');
|
|
8760
8776
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
8761
8777
|
return await getPublishPayload(this, uploadedTransactions, options);
|
|
8762
8778
|
};
|
|
@@ -8875,6 +8891,7 @@ class Item {
|
|
|
8875
8891
|
'latestVersionUid',
|
|
8876
8892
|
'publishedVersionUid',
|
|
8877
8893
|
'publishedVersionLocalId',
|
|
8894
|
+
'revokedAt',
|
|
8878
8895
|
];
|
|
8879
8896
|
const keysFromInitial = Object.keys(initialValues).filter((key) => !metadataKeys.includes(key));
|
|
8880
8897
|
const schemaNameForModel = initialValues.schemaName;
|
|
@@ -9180,19 +9197,14 @@ class Item {
|
|
|
9180
9197
|
return Reflect.ownKeys(target);
|
|
9181
9198
|
},
|
|
9182
9199
|
getOwnPropertyDescriptor(target, prop) {
|
|
9183
|
-
|
|
9200
|
+
let invent;
|
|
9184
9201
|
if (typeof prop === 'string' && TRACKED_PROPERTIES$1.includes(prop)) {
|
|
9185
9202
|
const context = target._getSnapshotContext();
|
|
9186
9203
|
if (prop in context) {
|
|
9187
|
-
|
|
9188
|
-
enumerable: true,
|
|
9189
|
-
configurable: true,
|
|
9190
|
-
value: context[prop],
|
|
9191
|
-
writable: true,
|
|
9192
|
-
};
|
|
9204
|
+
invent = { value: context[prop] };
|
|
9193
9205
|
}
|
|
9194
9206
|
}
|
|
9195
|
-
return
|
|
9207
|
+
return getInvariantSafePropertyDescriptor(target, prop, invent);
|
|
9196
9208
|
},
|
|
9197
9209
|
});
|
|
9198
9210
|
this.registerItemInInstanceCache(proxiedInstance);
|
|
@@ -9364,19 +9376,14 @@ class Item {
|
|
|
9364
9376
|
return Reflect.ownKeys(target);
|
|
9365
9377
|
},
|
|
9366
9378
|
getOwnPropertyDescriptor(target, prop) {
|
|
9367
|
-
|
|
9379
|
+
let invent;
|
|
9368
9380
|
if (typeof prop === 'string' && TRACKED_PROPERTIES$1.includes(prop)) {
|
|
9369
9381
|
const context = target._getSnapshotContext();
|
|
9370
9382
|
if (prop in context) {
|
|
9371
|
-
|
|
9372
|
-
enumerable: true,
|
|
9373
|
-
configurable: true,
|
|
9374
|
-
value: context[prop],
|
|
9375
|
-
writable: true,
|
|
9376
|
-
};
|
|
9383
|
+
invent = { value: context[prop] };
|
|
9377
9384
|
}
|
|
9378
9385
|
}
|
|
9379
|
-
return
|
|
9386
|
+
return getInvariantSafePropertyDescriptor(target, prop, invent);
|
|
9380
9387
|
},
|
|
9381
9388
|
});
|
|
9382
9389
|
this.registerItemInInstanceCache(proxiedInstance);
|
|
@@ -9690,6 +9697,7 @@ class Item {
|
|
|
9690
9697
|
}
|
|
9691
9698
|
},
|
|
9692
9699
|
enumerable: true,
|
|
9700
|
+
configurable: true,
|
|
9693
9701
|
});
|
|
9694
9702
|
state.definedPropertyNames.add(propertyName);
|
|
9695
9703
|
}
|
|
@@ -10429,7 +10437,7 @@ const runEasSync = fromPromise(async ({ input, }) => {
|
|
|
10429
10437
|
requestPayload: input.requestPayload,
|
|
10430
10438
|
persistedSnapshot: input.runningSnapshot,
|
|
10431
10439
|
});
|
|
10432
|
-
const { runSyncFromEas } = await import('./syncDbWithEas-
|
|
10440
|
+
const { runSyncFromEas } = await import('./syncDbWithEas-DRpLRxwb.js');
|
|
10433
10441
|
try {
|
|
10434
10442
|
await runSyncFromEas(toRunSyncArg(input.options));
|
|
10435
10443
|
await finalizeEasSyncProcessRow(rowId, {
|
|
@@ -12443,7 +12451,7 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
12443
12451
|
}
|
|
12444
12452
|
}
|
|
12445
12453
|
// Check if this is an internal SDK schema (should not create files in app directory)
|
|
12446
|
-
const constantsMod = await import('./constants-
|
|
12454
|
+
const constantsMod = await import('./constants-Bre6dTJR.js');
|
|
12447
12455
|
const { isInternalSchema, INTERNAL_SCHEMA_IDS } = constantsMod;
|
|
12448
12456
|
const isInternal = isInternalSchema(schemaFile.metadata.name, schemaFile.id);
|
|
12449
12457
|
if (isInternal) {
|
|
@@ -12546,7 +12554,7 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
12546
12554
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
12547
12555
|
};
|
|
12548
12556
|
// Use dynamic import to break circular dependency
|
|
12549
|
-
const _mod_20 = await import('./db-
|
|
12557
|
+
const _mod_20 = await import('./db-DVsy4QZe.js');
|
|
12550
12558
|
const _ns_20 = _mod_20.q;
|
|
12551
12559
|
const dbMod = _ns_20;
|
|
12552
12560
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
@@ -12775,7 +12783,7 @@ async function applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, prope
|
|
|
12775
12783
|
createdAt: new Date(schemaFile.metadata.createdAt).getTime(),
|
|
12776
12784
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
12777
12785
|
};
|
|
12778
|
-
const _mod_23 = await import('./db-
|
|
12786
|
+
const _mod_23 = await import('./db-DVsy4QZe.js');
|
|
12779
12787
|
const _ns_23 = _mod_23.q;
|
|
12780
12788
|
const dbMod = _ns_23;
|
|
12781
12789
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
@@ -14911,7 +14919,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
|
|
|
14911
14919
|
// Lazy import cache for ModelProperty to avoid circular dependency
|
|
14912
14920
|
// Eagerly start loading to minimize delay on first access
|
|
14913
14921
|
let ModelPropertyClass = null;
|
|
14914
|
-
const modelPropertyImportPromise = import('./ModelProperty-
|
|
14922
|
+
const modelPropertyImportPromise = import('./ModelProperty-BiDQu5rE.js')
|
|
14915
14923
|
.then(module => {
|
|
14916
14924
|
ModelPropertyClass = module.ModelProperty;
|
|
14917
14925
|
return ModelPropertyClass;
|
|
@@ -14928,7 +14936,7 @@ function getModelProperty() {
|
|
|
14928
14936
|
}
|
|
14929
14937
|
// Lazy import cache for Schema to avoid circular dependency
|
|
14930
14938
|
let SchemaClass = null;
|
|
14931
|
-
const schemaImportPromise = (async () => { const _mod_28 = await import('./Schema-
|
|
14939
|
+
const schemaImportPromise = (async () => { const _mod_28 = await import('./Schema-qciDB7Nu.js'); return _mod_28.b; })()
|
|
14932
14940
|
.then(module => {
|
|
14933
14941
|
SchemaClass = module.Schema;
|
|
14934
14942
|
return SchemaClass;
|
|
@@ -15386,37 +15394,25 @@ class Model {
|
|
|
15386
15394
|
getOwnPropertyDescriptor(target, prop) {
|
|
15387
15395
|
// Handle 'name' as an alias for 'modelName'
|
|
15388
15396
|
if (prop === 'name') {
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
configurable: true,
|
|
15393
|
-
value: context.modelName,
|
|
15394
|
-
writable: true,
|
|
15395
|
-
};
|
|
15397
|
+
return getInvariantSafePropertyDescriptor(target, prop, {
|
|
15398
|
+
value: target._getSnapshotContext().modelName,
|
|
15399
|
+
});
|
|
15396
15400
|
}
|
|
15397
15401
|
// Handle 'id' property - returns the modelFileId
|
|
15398
15402
|
if (prop === 'id') {
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
enumerable: true,
|
|
15402
|
-
configurable: true,
|
|
15403
|
-
value: context.id, // id is now the schemaFileId (string)
|
|
15403
|
+
return getInvariantSafePropertyDescriptor(target, prop, {
|
|
15404
|
+
value: target._getSnapshotContext().id, // id is now the schemaFileId (string)
|
|
15404
15405
|
writable: false, // id is read-only
|
|
15405
|
-
};
|
|
15406
|
+
});
|
|
15406
15407
|
}
|
|
15407
|
-
|
|
15408
|
+
let invent;
|
|
15408
15409
|
if (typeof prop === 'string' && TRACKED_PROPERTIES.includes(prop)) {
|
|
15409
15410
|
const context = target._getSnapshotContext();
|
|
15410
15411
|
if (prop in context) {
|
|
15411
|
-
|
|
15412
|
-
enumerable: true,
|
|
15413
|
-
configurable: true,
|
|
15414
|
-
value: context[prop],
|
|
15415
|
-
writable: true,
|
|
15416
|
-
};
|
|
15412
|
+
invent = { value: context[prop] };
|
|
15417
15413
|
}
|
|
15418
15414
|
}
|
|
15419
|
-
return
|
|
15415
|
+
return getInvariantSafePropertyDescriptor(target, prop, invent);
|
|
15420
15416
|
},
|
|
15421
15417
|
});
|
|
15422
15418
|
// Step 8: Store in new ID-based cache
|
|
@@ -16669,4 +16665,4 @@ const TModelValues = Type.Record(Type.String(), Type.Any());
|
|
|
16669
16665
|
const TModelSchema = Type.Record(Type.String(), TProperty);
|
|
16670
16666
|
|
|
16671
16667
|
export { ownedPublisherSql as $, compareMetadataRowsLatestFirst as A, ADDRESSES_PERSISTED_EVENT as B, ClientManager as C, claimUnpublishedDrafts as D, createLocalQueryDataSource as E, createNewItem as F, createSchema as G, easSyncActor as H, Item as I, getClient as J, getGetPublisherForNewSeeds as K, LOCAL_COPIES_REMOVED_EVENT as L, Model as M, getMetadataLatest as N, getPublishedSeedRecord as O, getRevokeExecutor as P, getSchemaNameFromId as Q, getUploadExecutor as R, getVersionData$1 as S, TModelSchema as T, isItemOwned as U, isLocalUnsealedDraft as V, isSeedQueryLocalSourceRegistered as W, isSeedRowOwned as X, listCompleteSchemaFiles as Y, loadAllSchemasFromDb as Z, mergeEasSyncRequestIntents as _, TModelValues as a, parseAddressesPersistedPayload as a0, propertyMachine as a1, publisherInAddressListSql as a2, publisherIsInOwnedSet as a3, readSchema as a4, registerSeedQueryLocalSource as a5, requestEasSyncFromAddressChange as a6, requestEasSyncFromEventBus as a7, requestEasSyncFromModelsInit as a8, sendEasSyncClientRequest as a9, setAdditionalSyncAddresses as aa, setGetPublisherForNewSeeds as ab, setRevokeExecutor as ac, setUploadExecutor as ad, startEasSyncActor as ae, unregisterSeedQueryLocalSource as af, createModelsFromJson as ag, getLatestSchemaVersion as ah, createModelFromJson as ai, ConflictError as aj, unloadEntity as ak, clearDestroySubscriptions as al, setupEntityLiveQuery as am, generateId$1 as an, model as ao, getPropertyData$1 as ap, Item$1 as aq, schema as ar, SEEDPROTOCOL_Seed_Protocol_v1 as as, Model$1 as at, getItemData as b, getEasSchemaUidForModel as c, getLatestPublishedVersionRow as d, getEasSchemaForItemProperty as e, eventEmitter as f, getContentHash as g, generateId as h, getGetAdditionalSyncAddresses as i, ItemProperty as j, getRefValueType as k, importJsonSchema as l, modelPropertiesToObject as m, loadSchemaFromFile as n, readJsonImportFile as o, parseListPropertyValueFromStorage as p, syncSchemaFromSource as q, resolveStorageNameToSchemaName as r, scheduleBulkFilesDownloadFromEasSync as s, transformImportToSchemaFile as t, waitForEntityIdle as u, createReactiveProxy as v, writeProcessMachine as w, findEntity as x, forceRemoveFromCaches as y, runDestroyLifecycle as z };
|
|
16672
|
-
//# sourceMappingURL=index-
|
|
16668
|
+
//# sourceMappingURL=index-DjwIC6U3.js.map
|