@seedprotocol/sdk 0.4.11 → 0.4.13
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/{ArweaveClient-CwXE3NCK.js → ArweaveClient-Bot35vMf.js} +3 -3
- package/dist/{ArweaveClient-CwXE3NCK.js.map → ArweaveClient-Bot35vMf.js.map} +1 -1
- package/dist/{ArweaveClient-DyhvHiIT.js → ArweaveClient-C6mBPWwy.js} +3 -3
- package/dist/{ArweaveClient-DyhvHiIT.js.map → ArweaveClient-C6mBPWwy.js.map} +1 -1
- package/dist/{Db-Dr6gWq8d.js → Db-DP7ELP9S.js} +3 -3
- package/dist/{Db-Dr6gWq8d.js.map → Db-DP7ELP9S.js.map} +1 -1
- package/dist/{Db-mH9nSDfI.js → Db-rlxROH4S.js} +3 -3
- package/dist/{Db-mH9nSDfI.js.map → Db-rlxROH4S.js.map} +1 -1
- package/dist/{EasClient-Yh-t7zEA.js → EasClient-CHI9lBP8.js} +2 -2
- package/dist/{EasClient-Yh-t7zEA.js.map → EasClient-CHI9lBP8.js.map} +1 -1
- package/dist/{EasClient-aggdMFrc.js → EasClient-CszJzwqw.js} +2 -2
- package/dist/{EasClient-aggdMFrc.js.map → EasClient-CszJzwqw.js.map} +1 -1
- package/dist/{FileManager-ClU_rIR0.js → FileManager-C7yOhPvS.js} +2 -2
- package/dist/{FileManager-ClU_rIR0.js.map → FileManager-C7yOhPvS.js.map} +1 -1
- package/dist/{FileManager-Dl2DD4Uc.js → FileManager-Dy3BbIxq.js} +2 -2
- package/dist/{FileManager-Dl2DD4Uc.js.map → FileManager-Dy3BbIxq.js.map} +1 -1
- package/dist/{ModelProperty-gBmew8gY.js → ModelProperty--OQb3Dy0.js} +17 -54
- package/dist/ModelProperty--OQb3Dy0.js.map +1 -0
- package/dist/{PathResolver-CILJPhz1.js → PathResolver-BtnV9pXS.js} +2 -2
- package/dist/{PathResolver-CILJPhz1.js.map → PathResolver-BtnV9pXS.js.map} +1 -1
- package/dist/{PathResolver-CfA_D3wa.js → PathResolver-D--w4fFE.js} +2 -2
- package/dist/{PathResolver-CfA_D3wa.js.map → PathResolver-D--w4fFE.js.map} +1 -1
- package/dist/{QueryClient-BdpWYoxo.js → QueryClient-BdNnK6Es.js} +2 -2
- package/dist/{QueryClient-BdpWYoxo.js.map → QueryClient-BdNnK6Es.js.map} +1 -1
- package/dist/{QueryClient-Dl_P8u5s.js → QueryClient-Bia5wKCO.js} +2 -2
- package/dist/{QueryClient-Dl_P8u5s.js.map → QueryClient-Bia5wKCO.js.map} +1 -1
- package/dist/{Schema-B-vCLIuU.js → Schema-DF4mLt86.js} +21 -21
- package/dist/{Schema-B-vCLIuU.js.map → Schema-DF4mLt86.js.map} +1 -1
- package/dist/{SchemaValidationService-C_iTQIjR.js → SchemaValidationService-D4LwnnIB.js} +2 -2
- package/dist/{SchemaValidationService-C_iTQIjR.js.map → SchemaValidationService-D4LwnnIB.js.map} +1 -1
- package/dist/cjs/{ModelProperty-DcAM5M8T.js → ModelProperty-C5BRfISV.js} +17 -54
- package/dist/cjs/ModelProperty-C5BRfISV.js.map +1 -0
- package/dist/cjs/{Schema-B6ifYEhD.js → Schema-DVJG8ISB.js} +20 -20
- package/dist/cjs/{Schema-B6ifYEhD.js.map → Schema-DVJG8ISB.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-OFyzZIUX.js → SchemaValidationService-_wef0VX6.js} +2 -2
- package/dist/cjs/{SchemaValidationService-OFyzZIUX.js.map → SchemaValidationService-_wef0VX6.js.map} +1 -1
- package/dist/cjs/{getItem-CAYQYTpg.js → getItem-CUGoglni.js} +2 -2
- package/dist/cjs/{getItem-CAYQYTpg.js.map → getItem-CUGoglni.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-CBuGIazw.js → getPublishPayload-CGl97AXX.js} +5 -5
- package/dist/cjs/{getPublishPayload-CBuGIazw.js.map → getPublishPayload-CGl97AXX.js.map} +1 -1
- package/dist/cjs/{getPublishUploads-B7bB1OGg.js → getPublishUploads-BA5PdoJ3.js} +3 -3
- package/dist/cjs/{getPublishUploads-B7bB1OGg.js.map → getPublishUploads-BA5PdoJ3.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-MVZ-0mQG.js → getSegmentedItemProperties-D3iBFPeo.js} +2 -2
- package/dist/cjs/{getSegmentedItemProperties-MVZ-0mQG.js.map → getSegmentedItemProperties-D3iBFPeo.js.map} +1 -1
- package/dist/cjs/{index-CA4i5TA7.js → index-B3K0jG2t.js} +54 -59
- package/dist/cjs/index-B3K0jG2t.js.map +1 -0
- package/dist/cjs/{index-6P4MEsbO.js → index-CpBFvNId.js} +2 -2
- package/dist/cjs/index-CpBFvNId.js.map +1 -0
- package/dist/cjs/{ownership-5TQ-v2CF.js → ownership-CkgGUliG.js} +2 -2
- package/dist/cjs/{ownership-5TQ-v2CF.js.map → ownership-CkgGUliG.js.map} +1 -1
- package/dist/{getItem-xpxRXqHI.js → getItem-CbGS6wbp.js} +2 -2
- package/dist/{getItem-xpxRXqHI.js.map → getItem-CbGS6wbp.js.map} +1 -1
- package/dist/{getPublishPayload-CBeCMSeQ.js → getPublishPayload-jUcwhhs1.js} +5 -5
- package/dist/{getPublishPayload-CBeCMSeQ.js.map → getPublishPayload-jUcwhhs1.js.map} +1 -1
- package/dist/{getPublishUploads-NITxWWDD.js → getPublishUploads-BAsUuLSM.js} +3 -3
- package/dist/{getPublishUploads-NITxWWDD.js.map → getPublishUploads-BAsUuLSM.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-CYzNtJxH.js → getSegmentedItemProperties-1QklOMkN.js} +2 -2
- package/dist/{getSegmentedItemProperties-CYzNtJxH.js.map → getSegmentedItemProperties-1QklOMkN.js.map} +1 -1
- package/dist/{index-B_apqB1Q.js → index-BUFvepcD.js} +68 -73
- package/dist/index-BUFvepcD.js.map +1 -0
- package/dist/{index-BC0xKxkf.js → index-BnBV-CWp.js} +3 -3
- package/dist/index-BnBV-CWp.js.map +1 -0
- package/dist/{index-CcXvJ2H7.js → index-CjAALVQh.js} +2 -2
- package/dist/index-CjAALVQh.js.map +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +11 -11
- package/dist/node.js +10 -10
- package/dist/{ownership-C7Afj3yr.js → ownership-CeuRaVwP.js} +2 -2
- package/dist/{ownership-C7Afj3yr.js.map → ownership-CeuRaVwP.js.map} +1 -1
- package/dist/{property-C2gviIFJ.js → property-BiZvboSH.js} +4 -4
- package/dist/{property-C2gviIFJ.js.map → property-BiZvboSH.js.map} +1 -1
- package/dist/{queries-BFzkFn4Y.js → queries-B2xdenwS.js} +2 -2
- package/dist/{queries-BFzkFn4Y.js.map → queries-B2xdenwS.js.map} +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/validateProperty.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -1
- package/dist/src/vite/index.d.ts.map +1 -1
- package/dist/vite.cjs +11 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +11 -1
- package/dist/vite.js.map +1 -1
- package/package.json +5 -1
- package/dist/ModelProperty-gBmew8gY.js.map +0 -1
- package/dist/cjs/ModelProperty-DcAM5M8T.js.map +0 -1
- package/dist/cjs/index-6P4MEsbO.js.map +0 -1
- package/dist/cjs/index-CA4i5TA7.js.map +0 -1
- package/dist/index-BC0xKxkf.js.map +0 -1
- package/dist/index-B_apqB1Q.js.map +0 -1
- package/dist/index-CcXvJ2H7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSegmentedItemProperties-
|
|
1
|
+
{"version":3,"file":"getSegmentedItemProperties-D3iBFPeo.js","sources":["../../../src/helpers/getSegmentedItemProperties.ts"],"sourcesContent":["import { UploadProperty } from '@/db/read/getPublishUploads'\nimport { IItem } from '@/interfaces'\nimport { ModelPropertyDataTypes } from '@/Schema'\n\nexport const getSegmentedItemProperties = (item: IItem<any>) => {\n const itemBasicProperties = []\n const itemRelationProperties = []\n const itemListProperties = []\n const itemUploadProperties: UploadProperty[] = []\n const itemImageProperties = []\n const itemStorageProperties = []\n let itemStorageTransactionProperty: UploadProperty | undefined\n\n for (const itemProperty of item.properties) {\n if (!itemProperty.propertyDef) {\n continue\n }\n\n const isItemStorage =\n itemProperty.propertyDef.storageType &&\n itemProperty.propertyDef.storageType === 'ItemStorage'\n\n\n const isStorageTransaction =\n itemProperty.propertyName === 'storageTransactionId'\n\n const isStorageSeedType =\n itemProperty.propertyDef.dataType === ModelPropertyDataTypes.Image ||\n itemProperty.propertyDef.dataType === ModelPropertyDataTypes.File ||\n itemProperty.propertyDef.dataType === ModelPropertyDataTypes.Html\n\n if (isStorageSeedType) {\n itemImageProperties.push(itemProperty)\n continue\n }\n\n if (itemProperty.propertyDef.dataType === ModelPropertyDataTypes.Relation) {\n itemRelationProperties.push(itemProperty)\n continue\n }\n\n if (itemProperty.propertyDef.dataType === ModelPropertyDataTypes.List) {\n // List-of-relations: ref present, goes to processListProperty\n // List-of-primitives: ref absent, treat as basic property\n if (itemProperty.propertyDef.ref) {\n itemListProperties.push(itemProperty)\n } else {\n itemBasicProperties.push(itemProperty)\n }\n continue\n }\n\n if (isItemStorage) {\n itemStorageProperties.push(itemProperty)\n continue\n }\n\n if (isStorageTransaction) {\n itemStorageTransactionProperty = { itemProperty, childProperties: [] }\n continue\n }\n\n itemBasicProperties.push(itemProperty)\n }\n\n if (itemStorageTransactionProperty && itemStorageProperties.length > 0) {\n itemStorageTransactionProperty.childProperties = itemStorageProperties\n }\n\n if (itemStorageTransactionProperty) {\n itemUploadProperties.push(itemStorageTransactionProperty)\n }\n\n return {\n itemBasicProperties,\n itemRelationProperties,\n itemListProperties,\n itemUploadProperties,\n itemImageProperties,\n }\n}\n"],"names":["ModelPropertyDataTypes"],"mappings":";;;;;;;AAIO,MAAM,0BAA0B,GAAG,CAAC,IAAgB,KAAI;IAC7D,MAAM,mBAAmB,GAAG,EAAE;IAC9B,MAAM,sBAAsB,GAAG,EAAE;IACjC,MAAM,kBAAkB,GAAG,EAAE;IAC7B,MAAM,oBAAoB,GAAqB,EAAE;IACjD,MAAM,mBAAmB,GAAG,EAAE;IAC9B,MAAM,qBAAqB,GAAG,EAAE;AAChC,IAAA,IAAI,8BAA0D;AAE9D,IAAA,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,UAAU,EAAE;AAC1C,QAAA,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;YAC7B;QACF;AAEA,QAAA,MAAM,aAAa,GACjB,YAAY,CAAC,WAAW,CAAC,WAAW;AACpC,YAAA,YAAY,CAAC,WAAW,CAAC,WAAW,KAAK,aAAa;AAGxD,QAAA,MAAM,oBAAoB,GACxB,YAAY,CAAC,YAAY,KAAK,sBAAsB;QAEtD,MAAM,iBAAiB,GACrB,YAAY,CAAC,WAAW,CAAC,QAAQ,KAAKA,+BAAsB,CAAC,KAAK;AAClE,YAAA,YAAY,CAAC,WAAW,CAAC,QAAQ,KAAKA,+BAAsB,CAAC,IAAI;YACjE,YAAY,CAAC,WAAW,CAAC,QAAQ,KAAKA,+BAAsB,CAAC,IAAI;QAEnE,IAAI,iBAAiB,EAAE;AACrB,YAAA,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;YACtC;QACF;QAEA,IAAI,YAAY,CAAC,WAAW,CAAC,QAAQ,KAAKA,+BAAsB,CAAC,QAAQ,EAAE;AACzE,YAAA,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC;YACzC;QACF;QAEA,IAAI,YAAY,CAAC,WAAW,CAAC,QAAQ,KAAKA,+BAAsB,CAAC,IAAI,EAAE;;;AAGrE,YAAA,IAAI,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE;AAChC,gBAAA,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC;YACvC;iBAAO;AACL,gBAAA,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC;YACA;QACF;QAEA,IAAI,aAAa,EAAE;AACjB,YAAA,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC;QACF;QAEA,IAAI,oBAAoB,EAAE;YACxB,8BAA8B,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,EAAE;YACtE;QACF;AAEA,QAAA,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;IACxC;IAEA,IAAI,8BAA8B,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE;AACtE,QAAA,8BAA8B,CAAC,eAAe,GAAG,qBAAqB;IACxE;IAEA,IAAI,8BAA8B,EAAE;AAClC,QAAA,oBAAoB,CAAC,IAAI,CAAC,8BAA8B,CAAC;IAC3D;IAEA,OAAO;QACL,mBAAmB;QACnB,sBAAsB;QACtB,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;KACpB;AACH;;;;"}
|
|
@@ -807,7 +807,7 @@ const createPropertyInstances = async (propertyFileIds) => {
|
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
809
|
try {
|
|
810
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
810
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); });
|
|
811
811
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
812
812
|
if (!ModelProperty) {
|
|
813
813
|
logger$x('createPropertyInstances: ModelProperty not available from dynamic import');
|
|
@@ -991,7 +991,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
991
991
|
// Step 2: Fallback to Schema context (only if database doesn't have the model)
|
|
992
992
|
// This handles the case where model exists in schema file but not yet in database
|
|
993
993
|
try {
|
|
994
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
994
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); });
|
|
995
995
|
const { Schema } = schemaMod;
|
|
996
996
|
const schema = Schema.create(schemaName, { waitForReady: false });
|
|
997
997
|
const schemaSnapshot = schema.getService().getSnapshot();
|
|
@@ -1235,7 +1235,7 @@ const loadOrCreateModel = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
1235
1235
|
}
|
|
1236
1236
|
// Mark schema as draft when a new model is created so saveNewVersion() can persist it
|
|
1237
1237
|
try {
|
|
1238
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1238
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); });
|
|
1239
1239
|
const { Schema } = schemaMod;
|
|
1240
1240
|
const schema = Schema.create(schemaName, { waitForReady: false });
|
|
1241
1241
|
schema.getService().send({ type: 'markAsDraft', propertyKey: 'schema:models' });
|
|
@@ -1279,10 +1279,10 @@ const validateModel = xstate.fromCallback(({ sendBack, input: { context } }) =>
|
|
|
1279
1279
|
const _validateModel = async () => {
|
|
1280
1280
|
try {
|
|
1281
1281
|
// Use dynamic imports to break circular dependencies
|
|
1282
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
1282
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-_wef0VX6.js'); });
|
|
1283
1283
|
const { SchemaValidationService } = validationServiceMod;
|
|
1284
1284
|
const validationService = new SchemaValidationService();
|
|
1285
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1285
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); });
|
|
1286
1286
|
const { Schema } = schemaMod;
|
|
1287
1287
|
// Validate model structure
|
|
1288
1288
|
const structureResult = validationService.validateModelStructure(context);
|
|
@@ -1392,7 +1392,7 @@ const createModelProperties = xstate.fromCallback(({ sendBack, input }) => {
|
|
|
1392
1392
|
return;
|
|
1393
1393
|
}
|
|
1394
1394
|
logger$v(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
|
|
1395
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
1395
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); });
|
|
1396
1396
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1397
1397
|
if (!ModelProperty) {
|
|
1398
1398
|
logger$v('ModelProperty not available from dynamic import');
|
|
@@ -1495,7 +1495,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1495
1495
|
const structureMsg = `[validateEntity] Validating model structure`;
|
|
1496
1496
|
logger$u(structureMsg);
|
|
1497
1497
|
// Use existing Model validation
|
|
1498
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
1498
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-_wef0VX6.js'); });
|
|
1499
1499
|
const { SchemaValidationService } = validationServiceMod;
|
|
1500
1500
|
const validationService = new SchemaValidationService();
|
|
1501
1501
|
// Validate model structure
|
|
@@ -1513,7 +1513,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1513
1513
|
if (entityInput.entityData.schemaName) {
|
|
1514
1514
|
try {
|
|
1515
1515
|
logger$u(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
|
|
1516
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1516
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); });
|
|
1517
1517
|
const { Schema } = schemaMod;
|
|
1518
1518
|
const schema = Schema.create(entityInput.entityData.schemaName, {
|
|
1519
1519
|
waitForReady: false,
|
|
@@ -1549,7 +1549,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
else if (entityInput.entityType === 'modelProperty') {
|
|
1551
1551
|
// Use existing ModelProperty validation
|
|
1552
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
1552
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-_wef0VX6.js'); });
|
|
1553
1553
|
const { SchemaValidationService } = validationServiceMod;
|
|
1554
1554
|
const validationService = new SchemaValidationService();
|
|
1555
1555
|
// Validate property structure
|
|
@@ -1564,7 +1564,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1564
1564
|
// If schema name and model name provided, validate against schema
|
|
1565
1565
|
if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
|
|
1566
1566
|
try {
|
|
1567
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-
|
|
1567
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); });
|
|
1568
1568
|
const { Schema } = schemaMod;
|
|
1569
1569
|
const schema = Schema.create(entityInput.entityData._schemaName, {
|
|
1570
1570
|
waitForReady: false,
|
|
@@ -1593,7 +1593,7 @@ const validateEntity = xstate.fromPromise(async ({ input }) => {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
else if (entityInput.entityType === 'schema') {
|
|
1595
1595
|
// Schema validation - use existing validation
|
|
1596
|
-
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-
|
|
1596
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-_wef0VX6.js'); });
|
|
1597
1597
|
const { SchemaValidationService } = validationServiceMod;
|
|
1598
1598
|
const validationService = new SchemaValidationService();
|
|
1599
1599
|
const schemaResult = validationService.validateSchema(entityInput.entityData);
|
|
@@ -2230,7 +2230,7 @@ async function checkIfPropertyIsEdited(modelName, propertyName, schemaFileValue)
|
|
|
2230
2230
|
const cacheKey = `${modelName}:${propertyName}`;
|
|
2231
2231
|
// First, check the in-memory cache (for current session edits)
|
|
2232
2232
|
// Robust dynamic import for consumer re-bundling (named or default export)
|
|
2233
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
2233
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); });
|
|
2234
2234
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
2235
2235
|
if (!ModelProperty) {
|
|
2236
2236
|
logger$t('ModelProperty not available from dynamic import');
|
|
@@ -2597,7 +2597,18 @@ const addModelsToDb$1 = async (models, schema, modelRenames, schemaFileData) =>
|
|
|
2597
2597
|
isEdited: false,
|
|
2598
2598
|
};
|
|
2599
2599
|
logger$t(`Creating new property ${modelName}:${propertyName} with schemaFileId: ${propertyData.schemaFileId}`);
|
|
2600
|
-
|
|
2600
|
+
try {
|
|
2601
|
+
await db.insert(properties).values(propertyDataWithIsEdited);
|
|
2602
|
+
}
|
|
2603
|
+
catch (insertError) {
|
|
2604
|
+
// Treat UNIQUE constraint as success - property already exists (e.g. from concurrent addModelsToDb call)
|
|
2605
|
+
if (insertError?.code === 'SQLITE_CONSTRAINT_UNIQUE' || insertError?.message?.includes('UNIQUE constraint')) {
|
|
2606
|
+
logger$t(`Property ${modelName}:${propertyName} already exists (UNIQUE constraint), treating as success`);
|
|
2607
|
+
}
|
|
2608
|
+
else {
|
|
2609
|
+
throw insertError;
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2601
2612
|
}
|
|
2602
2613
|
}
|
|
2603
2614
|
}
|
|
@@ -2918,11 +2929,6 @@ const savePropertyToDb = async (property) => {
|
|
|
2918
2929
|
})
|
|
2919
2930
|
.where(drizzleOrm.eq(properties.id, existingProperty.id));
|
|
2920
2931
|
logger$t(`Updated property ${property.modelName}:${property._originalValues?.name || 'unknown'} -> ${property.name} in database`);
|
|
2921
|
-
// #region agent log
|
|
2922
|
-
if (typeof fetch === 'function') {
|
|
2923
|
-
fetch('http://127.0.0.1:7242/ingest/0978b378-ebae-46bf-8fd3-134ef2e16cdd', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '9ee076' }, body: JSON.stringify({ sessionId: '9ee076', location: 'db.ts:savePropertyToDb-update', message: 'savePropertyToDb UPDATED row', data: { oldName: property._originalValues?.name, newName: property.name, dbId: existingProperty.id }, timestamp: Date.now(), hypothesisId: 'B' }) }).catch(() => { });
|
|
2924
|
-
}
|
|
2925
|
-
// #endregion
|
|
2926
2932
|
}
|
|
2927
2933
|
else {
|
|
2928
2934
|
// Property doesn't exist, create it
|
|
@@ -2932,11 +2938,6 @@ const savePropertyToDb = async (property) => {
|
|
|
2932
2938
|
isEdited: true, // Runtime-created properties are edited
|
|
2933
2939
|
});
|
|
2934
2940
|
logger$t(`Created property ${property.modelName}:${property.name} in database`);
|
|
2935
|
-
// #region agent log
|
|
2936
|
-
if (typeof fetch === 'function') {
|
|
2937
|
-
fetch('http://127.0.0.1:7242/ingest/0978b378-ebae-46bf-8fd3-134ef2e16cdd', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '9ee076' }, body: JSON.stringify({ sessionId: '9ee076', location: 'db.ts:savePropertyToDb-insert', message: 'savePropertyToDb INSERTED new row', data: { name: property.name, schemaFileId }, timestamp: Date.now(), hypothesisId: 'B' }) }).catch(() => { });
|
|
2938
|
-
}
|
|
2939
|
-
// #endregion
|
|
2940
2941
|
}
|
|
2941
2942
|
};
|
|
2942
2943
|
function parseAddressConfig(value) {
|
|
@@ -3537,18 +3538,13 @@ const writeToDatabase = xstate.fromCallback(({ sendBack, input }) => {
|
|
|
3537
3538
|
// initial write completes is not overwritten by the stale requestWrite payload.
|
|
3538
3539
|
let dataToWrite = input.entityData;
|
|
3539
3540
|
try {
|
|
3540
|
-
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-
|
|
3541
|
+
const mod = await Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); });
|
|
3541
3542
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
3542
3543
|
if (ModelProperty && typeof ModelProperty.getById === 'function') {
|
|
3543
3544
|
const instance = ModelProperty.getById(input.entityId);
|
|
3544
3545
|
if (instance && typeof instance._getSnapshotContext === 'function') {
|
|
3545
3546
|
const ctx = instance._getSnapshotContext();
|
|
3546
3547
|
const ctxName = ctx.name ?? input.entityData.name;
|
|
3547
|
-
// #region agent log
|
|
3548
|
-
if (ctx.name !== input.entityData.name && typeof fetch === 'function') {
|
|
3549
|
-
fetch('http://127.0.0.1:7242/ingest/0978b378-ebae-46bf-8fd3-134ef2e16cdd', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '9ee076' }, body: JSON.stringify({ sessionId: '9ee076', location: 'writeToDatabase.ts:modelProperty', message: 'writeToDatabase using ctx name (rename detected)', data: { requestWriteName: input.entityData.name, ctxName: ctx.name, finalName: ctxName }, timestamp: Date.now(), hypothesisId: 'C' }) }).catch(() => { });
|
|
3550
|
-
}
|
|
3551
|
-
// #endregion
|
|
3552
3548
|
dataToWrite = {
|
|
3553
3549
|
...input.entityData,
|
|
3554
3550
|
name: ctxName,
|
|
@@ -3567,11 +3563,6 @@ const writeToDatabase = xstate.fromCallback(({ sendBack, input }) => {
|
|
|
3567
3563
|
// Fall back to input.entityData if instance not available
|
|
3568
3564
|
}
|
|
3569
3565
|
await writePropertyToDb(input.entityId, dataToWrite);
|
|
3570
|
-
// #region agent log
|
|
3571
|
-
if (typeof fetch === 'function') {
|
|
3572
|
-
fetch('http://127.0.0.1:7242/ingest/0978b378-ebae-46bf-8fd3-134ef2e16cdd', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '9ee076' }, body: JSON.stringify({ sessionId: '9ee076', location: 'writeToDatabase.ts:writePropertyToDbDone', message: 'writePropertyToDb completed', data: { entityId: input.entityId, name: dataToWrite.name }, timestamp: Date.now(), hypothesisId: 'C' }) }).catch(() => { });
|
|
3573
|
-
}
|
|
3574
|
-
// #endregion
|
|
3575
3566
|
output = input.entityData;
|
|
3576
3567
|
}
|
|
3577
3568
|
else if (input.entityType === 'schema') {
|
|
@@ -3927,7 +3918,7 @@ const modelMachine = xstate.setup({
|
|
|
3927
3918
|
// Create ModelProperty instances for any new property IDs
|
|
3928
3919
|
if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
|
|
3929
3920
|
// Import and create instances asynchronously (fire-and-forget)
|
|
3930
|
-
Promise.resolve().then(function () { return require('./ModelProperty-
|
|
3921
|
+
Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); }).then(({ ModelProperty }) => {
|
|
3931
3922
|
const createPromises = newPropertyIds.map(async (propertyFileId) => {
|
|
3932
3923
|
try {
|
|
3933
3924
|
const property = await ModelProperty.createById(propertyFileId);
|
|
@@ -4128,11 +4119,12 @@ const modelMachine = xstate.setup({
|
|
|
4128
4119
|
target: 'creatingProperties',
|
|
4129
4120
|
actions: xstate.assign(({ context, event }) => {
|
|
4130
4121
|
logger$q(`[writeSuccess] Transitioning to creatingProperties for model "${context.modelName}"`);
|
|
4131
|
-
// Update _dbId from write output if available
|
|
4122
|
+
// Update _dbId from write output if available (writeToDatabase returns _dbId, not id)
|
|
4132
4123
|
const newContext = { ...context };
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4124
|
+
const dbId = event.output?._dbId ?? event.output?.id;
|
|
4125
|
+
if (dbId != null) {
|
|
4126
|
+
newContext._dbId = dbId;
|
|
4127
|
+
logger$q(`[writeSuccess] Updated _dbId to ${dbId}`);
|
|
4136
4128
|
}
|
|
4137
4129
|
return newContext;
|
|
4138
4130
|
}),
|
|
@@ -4140,10 +4132,11 @@ const modelMachine = xstate.setup({
|
|
|
4140
4132
|
{
|
|
4141
4133
|
target: 'idle',
|
|
4142
4134
|
actions: xstate.assign(({ context, event }) => {
|
|
4143
|
-
// Update _dbId from write output if available
|
|
4135
|
+
// Update _dbId from write output if available (writeToDatabase returns _dbId, not id)
|
|
4144
4136
|
const newContext = { ...context };
|
|
4145
|
-
|
|
4146
|
-
|
|
4137
|
+
const dbId = event.output?._dbId ?? event.output?.id;
|
|
4138
|
+
if (dbId != null) {
|
|
4139
|
+
newContext._dbId = dbId;
|
|
4147
4140
|
}
|
|
4148
4141
|
return newContext;
|
|
4149
4142
|
}),
|
|
@@ -5385,9 +5378,9 @@ const runPublish = xstate.fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5385
5378
|
sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
|
|
5386
5379
|
return;
|
|
5387
5380
|
}
|
|
5388
|
-
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-
|
|
5381
|
+
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-BA5PdoJ3.js'); });
|
|
5389
5382
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
5390
|
-
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-
|
|
5383
|
+
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-CGl97AXX.js'); });
|
|
5391
5384
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
5392
5385
|
const uploads = await getPublishUploads(item);
|
|
5393
5386
|
let uploadedTransactions = [];
|
|
@@ -6146,7 +6139,7 @@ const resolveRelatedValue = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
6146
6139
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
6147
6140
|
const _resolveRelatedValue = async () => {
|
|
6148
6141
|
// Use dynamic import to break circular dependency
|
|
6149
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
6142
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CpBFvNId.js'); });
|
|
6150
6143
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
6151
6144
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
6152
6145
|
return;
|
|
@@ -6486,7 +6479,7 @@ const hydrateFromDb = xstate.fromCallback(({ sendBack, input: { context } }) =>
|
|
|
6486
6479
|
// to use dynamically imported ModelPropertyDataTypes
|
|
6487
6480
|
const _hydrateFromDb = async () => {
|
|
6488
6481
|
// Use dynamic import to break circular dependency
|
|
6489
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
6482
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CpBFvNId.js'); });
|
|
6490
6483
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
6491
6484
|
const appDb = BaseDb.getAppDb();
|
|
6492
6485
|
const whereClauses = [];
|
|
@@ -6996,7 +6989,7 @@ const analyzeInput = xstate.fromCallback(({ sendBack, input: { context, event }
|
|
|
6996
6989
|
}
|
|
6997
6990
|
const _analyzeInput = async () => {
|
|
6998
6991
|
// Use dynamic import to break circular dependency
|
|
6999
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
6992
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CpBFvNId.js'); });
|
|
7000
6993
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7001
6994
|
let propertyName = propertyNameRaw;
|
|
7002
6995
|
if (!propertyName) {
|
|
@@ -7078,8 +7071,10 @@ const analyzeInput = xstate.fromCallback(({ sendBack, input: { context, event }
|
|
|
7078
7071
|
modelName,
|
|
7079
7072
|
schemaUid,
|
|
7080
7073
|
}); // Type assertion needed because newValue is not in MetadataType but is accepted by the function
|
|
7074
|
+
const stringValueForContext = typeof newValue === 'string' ? newValue : (newValue !== null && newValue !== undefined ? String(newValue) : undefined);
|
|
7081
7075
|
let updatedContext = {
|
|
7082
|
-
propertyValue:
|
|
7076
|
+
propertyValue: stringValueForContext,
|
|
7077
|
+
renderValue: stringValueForContext,
|
|
7083
7078
|
};
|
|
7084
7079
|
if (localId) {
|
|
7085
7080
|
updatedContext.localId = localId;
|
|
@@ -7638,7 +7633,7 @@ const saveRelation = xstate.fromCallback(({ sendBack, input: { context, event }
|
|
|
7638
7633
|
}
|
|
7639
7634
|
const _saveRelation = async () => {
|
|
7640
7635
|
// Use dynamic import to break circular dependency
|
|
7641
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
7636
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CpBFvNId.js'); });
|
|
7642
7637
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7643
7638
|
if (!propertyNameRaw) {
|
|
7644
7639
|
throw new Error('propertyName is required');
|
|
@@ -8502,7 +8497,7 @@ class ItemProperty {
|
|
|
8502
8497
|
return;
|
|
8503
8498
|
}
|
|
8504
8499
|
// Use dynamic import to break circular dependency
|
|
8505
|
-
const schemaMod = await Promise.resolve().then(function () { return require('./index-
|
|
8500
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./index-CpBFvNId.js'); });
|
|
8506
8501
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
8507
8502
|
const { context } = snapshot;
|
|
8508
8503
|
const { propertyRecordSchema } = context;
|
|
@@ -9188,7 +9183,7 @@ class ItemProperty {
|
|
|
9188
9183
|
}
|
|
9189
9184
|
async save() {
|
|
9190
9185
|
const ctx = this._getSnapshotContext();
|
|
9191
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
9186
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-CkgGUliG.js'); });
|
|
9192
9187
|
await assertItemOwned({
|
|
9193
9188
|
seedLocalId: ctx?.seedLocalId ?? undefined,
|
|
9194
9189
|
seedUid: ctx?.seedUid ?? undefined,
|
|
@@ -9508,7 +9503,7 @@ class Item {
|
|
|
9508
9503
|
});
|
|
9509
9504
|
};
|
|
9510
9505
|
this.publish = async () => {
|
|
9511
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
9506
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-CkgGUliG.js'); });
|
|
9512
9507
|
await assertItemOwned(this);
|
|
9513
9508
|
this._service.send({ type: 'startPublish' });
|
|
9514
9509
|
return new Promise((resolve, reject) => {
|
|
@@ -9544,13 +9539,13 @@ class Item {
|
|
|
9544
9539
|
};
|
|
9545
9540
|
this.getPublishUploads = async () => {
|
|
9546
9541
|
// Use dynamic import to break circular dependency
|
|
9547
|
-
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-
|
|
9542
|
+
const getPublishUploadsMod = await Promise.resolve().then(function () { return require('./getPublishUploads-BA5PdoJ3.js'); });
|
|
9548
9543
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
9549
9544
|
return await getPublishUploads(this);
|
|
9550
9545
|
};
|
|
9551
9546
|
this.getPublishPayload = async (uploadedTransactions) => {
|
|
9552
9547
|
// Use dynamic import to break circular dependency
|
|
9553
|
-
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-
|
|
9548
|
+
const getPublishPayloadMod = await Promise.resolve().then(function () { return require('./getPublishPayload-CGl97AXX.js'); });
|
|
9554
9549
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
9555
9550
|
return await getPublishPayload(this, uploadedTransactions);
|
|
9556
9551
|
};
|
|
@@ -10672,7 +10667,7 @@ class Item {
|
|
|
10672
10667
|
* Destroy the item: soft delete in DB, remove from caches, clean up subscriptions, stop service.
|
|
10673
10668
|
*/
|
|
10674
10669
|
async destroy() {
|
|
10675
|
-
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-
|
|
10670
|
+
const { assertItemOwned } = await Promise.resolve().then(function () { return require('./ownership-CkgGUliG.js'); });
|
|
10676
10671
|
await assertItemOwned(this);
|
|
10677
10672
|
const context = this._getSnapshotContext();
|
|
10678
10673
|
const cacheKey = context.seedUid || context.seedLocalId;
|
|
@@ -14501,7 +14496,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
|
|
|
14501
14496
|
// Lazy import cache for ModelProperty to avoid circular dependency
|
|
14502
14497
|
// Eagerly start loading to minimize delay on first access
|
|
14503
14498
|
let ModelPropertyClass = null;
|
|
14504
|
-
const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-
|
|
14499
|
+
const modelPropertyImportPromise = Promise.resolve().then(function () { return require('./ModelProperty-C5BRfISV.js'); })
|
|
14505
14500
|
.then(module => {
|
|
14506
14501
|
ModelPropertyClass = module.ModelProperty;
|
|
14507
14502
|
return ModelPropertyClass;
|
|
@@ -14518,7 +14513,7 @@ function getModelProperty() {
|
|
|
14518
14513
|
}
|
|
14519
14514
|
// Lazy import cache for Schema to avoid circular dependency
|
|
14520
14515
|
let SchemaClass = null;
|
|
14521
|
-
const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-
|
|
14516
|
+
const schemaImportPromise = Promise.resolve().then(function () { return require('./Schema-DVJG8ISB.js'); })
|
|
14522
14517
|
.then(module => {
|
|
14523
14518
|
SchemaClass = module.Schema;
|
|
14524
14519
|
return SchemaClass;
|
|
@@ -17114,7 +17109,7 @@ const getTsImport = async (filePath) => {
|
|
|
17114
17109
|
|
|
17115
17110
|
// Get the directory of this file to resolve relative paths
|
|
17116
17111
|
// @ts-ignore - rollup plugin-typescript doesn't recognize import.meta with module: "preserve"
|
|
17117
|
-
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-
|
|
17112
|
+
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cjs/index-B3K0jG2t.js', document.baseURI).href)));
|
|
17118
17113
|
path.dirname(__filename$1);
|
|
17119
17114
|
const commandExists = (command) => {
|
|
17120
17115
|
try {
|
|
@@ -17670,4 +17665,4 @@ exports.versions = versions;
|
|
|
17670
17665
|
exports.waitForEntityIdle = waitForEntityIdle;
|
|
17671
17666
|
exports.withSeed = withSeed;
|
|
17672
17667
|
exports.writeProcessMachine = writeProcessMachine;
|
|
17673
|
-
//# sourceMappingURL=index-
|
|
17668
|
+
//# sourceMappingURL=index-B3K0jG2t.js.map
|