@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,10 +1,10 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
import { j as BaseDb, af as writeProcessMachine, u as models, v as properties, M as Model, r as modelPropertiesToObject, a0 as schemas, U as modelSchemas, ag as getModelIdByFileId, n as normalizeDataType, ah as generateId, ai as waitForEntityIdle, aj as createReactiveProxy, ak as findEntity, C as BaseFileManager, al as forceRemoveFromCaches, am as runDestroyLifecycle, an as getModelId } from './index-
|
|
3
|
+
import { j as BaseDb, af as writeProcessMachine, u as models, v as properties, M as Model, r as modelPropertiesToObject, a0 as schemas, U as modelSchemas, ag as getModelIdByFileId, n as normalizeDataType, ah as generateId, ai as waitForEntityIdle, aj as createReactiveProxy, ak as findEntity, C as BaseFileManager, al as forceRemoveFromCaches, am as runDestroyLifecycle, an as getModelId } from './index-BUFvepcD.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import { eq, and } from 'drizzle-orm';
|
|
6
6
|
import debug from 'debug';
|
|
7
|
-
import { S as Schema } from './Schema-
|
|
7
|
+
import { S as Schema } from './Schema-DF4mLt86.js';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'nanoid';
|
|
10
10
|
import 'nanoid-dictionary';
|
|
@@ -15,7 +15,7 @@ import 'drizzle-orm/casing';
|
|
|
15
15
|
import 'eventemitter3';
|
|
16
16
|
import 'arweave';
|
|
17
17
|
import '@sinclair/typebox';
|
|
18
|
-
import './SchemaValidationService-
|
|
18
|
+
import './SchemaValidationService-D4LwnnIB.js';
|
|
19
19
|
import '@sinclair/typebox/value';
|
|
20
20
|
|
|
21
21
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
@@ -26,14 +26,14 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
26
26
|
*/
|
|
27
27
|
async function getSchemaNameFromModel(modelName) {
|
|
28
28
|
// Get the latest schema files and find which one contains this model
|
|
29
|
-
const _mod_0 = await import('./index-
|
|
29
|
+
const _mod_0 = await import('./index-BUFvepcD.js');
|
|
30
30
|
const _ns_0 = _mod_0.aZ;
|
|
31
31
|
const schemaHelpersMod = _ns_0;
|
|
32
32
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
33
33
|
const latestSchemas = await listLatestSchemaFiles();
|
|
34
34
|
for (const schema of latestSchemas) {
|
|
35
35
|
try {
|
|
36
|
-
const _mod_1 = await import('./index-
|
|
36
|
+
const _mod_1 = await import('./index-BUFvepcD.js');
|
|
37
37
|
const _ns_1 = _mod_1.aX;
|
|
38
38
|
const fileManagerMod = _ns_1;
|
|
39
39
|
const { BaseFileManager } = fileManagerMod;
|
|
@@ -53,7 +53,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
53
53
|
const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
54
54
|
const _saveToSchema = async () => {
|
|
55
55
|
// Use dynamic import to break circular dependency
|
|
56
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
56
|
+
const validationServiceMod = await import('./SchemaValidationService-D4LwnnIB.js');
|
|
57
57
|
const { SchemaValidationService } = validationServiceMod;
|
|
58
58
|
const validationService = new SchemaValidationService();
|
|
59
59
|
// Validate property structure before saving
|
|
@@ -72,7 +72,7 @@ const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
72
72
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
73
73
|
}
|
|
74
74
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
75
|
-
const _mod_2 = await import('./index-
|
|
75
|
+
const _mod_2 = await import('./index-BUFvepcD.js');
|
|
76
76
|
const _ns_2 = _mod_2.aY;
|
|
77
77
|
const dbMod = _ns_2;
|
|
78
78
|
const { savePropertyToDb } = dbMod;
|
|
@@ -80,7 +80,7 @@ const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
80
80
|
// Mark schema as draft so user knows to save
|
|
81
81
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
82
82
|
if (schemaName) {
|
|
83
|
-
const _mod_3 = await import('./Schema-
|
|
83
|
+
const _mod_3 = await import('./Schema-DF4mLt86.js');
|
|
84
84
|
const _ns_3 = _mod_3.b;
|
|
85
85
|
const schemaMod = _ns_3;
|
|
86
86
|
const { Schema } = schemaMod;
|
|
@@ -115,7 +115,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
115
115
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
116
116
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
117
117
|
try {
|
|
118
|
-
const _mod_4 = await import('./index-
|
|
118
|
+
const _mod_4 = await import('./index-BUFvepcD.js');
|
|
119
119
|
const _ns_4 = _mod_4.aY;
|
|
120
120
|
const dbMod = _ns_4;
|
|
121
121
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
@@ -156,16 +156,13 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
156
156
|
if (!fullContext._originalValues) {
|
|
157
157
|
logger$2('No original values to compare against');
|
|
158
158
|
logger$2(`[compareAndMarkDraft] Context: modelName=${fullContext.modelName}, name=${fullContext.name}, id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}`);
|
|
159
|
-
// #region agent log
|
|
160
|
-
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: 'compareAndMarkDraft.ts:noOriginalValues', message: 'compareAndMarkDraft early path - no _originalValues', data: { name: fullContext.name, modelName: fullContext.modelName, schemaFileId: schemaFileId, willSave: !!(fullContext.modelName && fullContext.name && schemaFileId) }, timestamp: Date.now(), hypothesisId: 'A' }) }).catch(() => { });
|
|
161
|
-
// #endregion
|
|
162
159
|
// If we have a name and modelName, try to save to database anyway
|
|
163
160
|
// This ensures name changes are persisted even if _originalValues isn't initialized yet
|
|
164
161
|
// We need either schemaFileId (id or _propertyFileId) to find the property in the database
|
|
165
162
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
166
163
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
167
164
|
try {
|
|
168
|
-
const _mod_5 = await import('./index-
|
|
165
|
+
const _mod_5 = await import('./index-BUFvepcD.js');
|
|
169
166
|
const _ns_5 = _mod_5.aY;
|
|
170
167
|
const dbMod = _ns_5;
|
|
171
168
|
const { savePropertyToDb } = dbMod;
|
|
@@ -189,9 +186,6 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
189
186
|
return;
|
|
190
187
|
}
|
|
191
188
|
logger$2(`[compareAndMarkDraft] Comparing: context.name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
192
|
-
// #region agent log
|
|
193
|
-
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: 'compareAndMarkDraft.ts:beforeHasChanges', message: 'compareAndMarkDraft before hasChanges', data: { name: fullContext.name, originalName: fullContext._originalValues?.name, id: fullContext.id, schemaFileId: fullContext._propertyFileId || fullContext.id }, timestamp: Date.now(), hypothesisId: 'A' }) }).catch(() => { });
|
|
194
|
-
// #endregion
|
|
195
189
|
// Compare current values with original
|
|
196
190
|
// Only compare property fields, not internal fields
|
|
197
191
|
const propertyFields = ['name', 'dataType', 'ref', 'refModelName', 'refModelId', 'refValueType', 'storageType', 'localStorageDir', 'filenameSuffix', 'modelName', 'modelId'];
|
|
@@ -229,11 +223,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
229
223
|
if (hasChanges) {
|
|
230
224
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
231
225
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
232
|
-
// #region agent log
|
|
233
|
-
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: 'compareAndMarkDraft.ts:hasChanges-callingSave', message: 'compareAndMarkDraft calling savePropertyToDb', data: { name: fullContext.name, originalName: fullContext._originalValues?.name, schemaFileId: fullContext._propertyFileId || fullContext.id }, timestamp: Date.now(), hypothesisId: 'A' }) }).catch(() => { });
|
|
234
|
-
// #endregion
|
|
235
226
|
// Use dynamic import to break circular dependency
|
|
236
|
-
const _mod_6 = await import('./index-
|
|
227
|
+
const _mod_6 = await import('./index-BUFvepcD.js');
|
|
237
228
|
const _ns_6 = _mod_6.aY;
|
|
238
229
|
const dbMod = _ns_6;
|
|
239
230
|
const { savePropertyToDb } = dbMod;
|
|
@@ -241,23 +232,15 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
241
232
|
try {
|
|
242
233
|
await savePropertyToDb(fullContext);
|
|
243
234
|
logger$2(`[compareAndMarkDraft] Successfully saved property ${fullContext.modelName}:${fullContext.name} to database`);
|
|
244
|
-
// #region agent log
|
|
245
|
-
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: 'compareAndMarkDraft.ts:savePropertyToDbSuccess', message: 'savePropertyToDb completed successfully', data: { name: fullContext.name }, timestamp: Date.now(), hypothesisId: 'A' }) }).catch(() => { });
|
|
246
|
-
// #endregion
|
|
247
235
|
}
|
|
248
236
|
catch (error) {
|
|
249
237
|
logger$2(`[compareAndMarkDraft] Error saving property to database: ${error}`);
|
|
250
|
-
// #region agent log
|
|
251
|
-
if (typeof fetch === 'function') {
|
|
252
|
-
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: 'compareAndMarkDraft.ts:savePropertyToDbError', message: 'savePropertyToDb FAILED', data: { name: fullContext.name, error: String(error) }, timestamp: Date.now(), hypothesisId: 'B' }) }).catch(() => { });
|
|
253
|
-
}
|
|
254
|
-
// #endregion
|
|
255
238
|
throw error;
|
|
256
239
|
}
|
|
257
240
|
// Mark schema as draft if schema name is available
|
|
258
241
|
if (fullContext._schemaName) {
|
|
259
242
|
// Get the Schema instance and mark it as draft
|
|
260
|
-
const _mod_7 = await import('./Schema-
|
|
243
|
+
const _mod_7 = await import('./Schema-DF4mLt86.js');
|
|
261
244
|
const _ns_7 = _mod_7.b;
|
|
262
245
|
const schemaMod = _ns_7;
|
|
263
246
|
const { Schema } = schemaMod;
|
|
@@ -276,7 +259,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
276
259
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
277
260
|
// Clear isEdited flag in database
|
|
278
261
|
try {
|
|
279
|
-
const _mod_8 = await import('./index-
|
|
262
|
+
const _mod_8 = await import('./index-CjAALVQh.js');
|
|
280
263
|
const _ns_8 = _mod_8.s;
|
|
281
264
|
const seedSchemaMod = _ns_8;
|
|
282
265
|
const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
|
|
@@ -342,7 +325,7 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
342
325
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
343
326
|
await new Promise((r) => setTimeout(r, 60));
|
|
344
327
|
try {
|
|
345
|
-
const _mod_9 = await import('./index-
|
|
328
|
+
const _mod_9 = await import('./index-BUFvepcD.js');
|
|
346
329
|
const _ns_9 = _mod_9.aY;
|
|
347
330
|
const dbMod = _ns_9;
|
|
348
331
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
@@ -396,21 +379,16 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
396
379
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
397
380
|
}
|
|
398
381
|
// Use dynamic imports to break circular dependencies
|
|
399
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
382
|
+
const validationServiceMod = await import('./SchemaValidationService-D4LwnnIB.js');
|
|
400
383
|
const { SchemaValidationService } = validationServiceMod;
|
|
401
384
|
const validationService = new SchemaValidationService();
|
|
402
|
-
const _mod_10 = await import('./Schema-
|
|
385
|
+
const _mod_10 = await import('./Schema-DF4mLt86.js');
|
|
403
386
|
const _ns_10 = _mod_10.b;
|
|
404
387
|
const schemaMod = _ns_10;
|
|
405
388
|
const { Schema } = schemaMod;
|
|
406
389
|
// Validate property structure
|
|
407
390
|
const structureResult = validationService.validatePropertyStructure(fullContext);
|
|
408
391
|
if (!structureResult.isValid) {
|
|
409
|
-
// #region agent log
|
|
410
|
-
if (typeof fetch === 'function') {
|
|
411
|
-
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: 'validateProperty.ts:structureInvalid', message: 'validateProperty structure validation FAILED', data: { name: fullContext.name, errors: structureResult.errors?.map((e) => e.message || e.code) }, timestamp: Date.now(), hypothesisId: 'D' }) }).catch(() => { });
|
|
412
|
-
}
|
|
413
|
-
// #endregion
|
|
414
392
|
sendBack({ type: 'validationError', errors: structureResult.errors });
|
|
415
393
|
return;
|
|
416
394
|
}
|
|
@@ -450,11 +428,6 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
450
428
|
return true; // Critical error
|
|
451
429
|
});
|
|
452
430
|
if (criticalErrors.length > 0) {
|
|
453
|
-
// #region agent log
|
|
454
|
-
if (typeof fetch === 'function') {
|
|
455
|
-
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: 'validateProperty.ts:schemaCriticalErrors', message: 'validateProperty schema validation FAILED (critical)', data: { name: fullContext.name, isRenamed: !!(fullContext._originalValues?.name && fullContext._originalValues.name !== fullContext.name), criticalErrors: criticalErrors?.map((e) => e.message || e.code) }, timestamp: Date.now(), hypothesisId: 'D' }) }).catch(() => { });
|
|
456
|
-
}
|
|
457
|
-
// #endregion
|
|
458
431
|
sendBack({ type: 'validationError', errors: criticalErrors });
|
|
459
432
|
return;
|
|
460
433
|
}
|
|
@@ -539,11 +512,6 @@ const modelPropertyMachine = setup({
|
|
|
539
512
|
updateContext: {
|
|
540
513
|
actions: assign(({ context, event }) => {
|
|
541
514
|
const newContext = Object.assign({}, context);
|
|
542
|
-
// #region agent log
|
|
543
|
-
if (event.name !== undefined && event.name !== context.name) {
|
|
544
|
-
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: 'modelPropertyMachine.ts:updateContext', message: 'Name change via updateContext', data: { oldName: context.name, newName: event.name, id: context.id, _propertyFileId: context._propertyFileId, hasOriginalValues: !!context._originalValues }, timestamp: Date.now(), hypothesisId: 'A' }) }).catch(() => { });
|
|
545
|
-
}
|
|
546
|
-
// #endregion
|
|
547
515
|
// Check if this is only updating internal fields
|
|
548
516
|
const onlyInternalFields = Object.keys(event).every((key) => {
|
|
549
517
|
return key === 'type' || key.startsWith('_');
|
|
@@ -1492,11 +1460,6 @@ class ModelProperty {
|
|
|
1492
1460
|
const modelName = modelRecords[0].name;
|
|
1493
1461
|
// Build property data
|
|
1494
1462
|
// id is now the schemaFileId (string), _dbId is the database integer ID
|
|
1495
|
-
// #region agent log
|
|
1496
|
-
if (typeof fetch === 'function') {
|
|
1497
|
-
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: 'ModelProperty.ts:createById', message: 'createById loading from DB', data: { propertyFileId, name: propertyRecord.name, modelName }, timestamp: Date.now(), hypothesisId: 'E' }) }).catch(() => { });
|
|
1498
|
-
}
|
|
1499
|
-
// #endregion
|
|
1500
1463
|
const propertyData = {
|
|
1501
1464
|
id: propertyFileId, // schemaFileId (string) - public ID
|
|
1502
1465
|
_dbId: propertyRecord.id ?? undefined, // Database integer ID - internal only
|
|
@@ -1804,4 +1767,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1804
1767
|
});
|
|
1805
1768
|
|
|
1806
1769
|
export { ModelProperty };
|
|
1807
|
-
//# sourceMappingURL=ModelProperty
|
|
1770
|
+
//# sourceMappingURL=ModelProperty--OQb3Dy0.js.map
|