@seedprotocol/sdk 0.6.6 → 0.6.8
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/{BasePathResolver-BGxb4Qod.js → BasePathResolver-B6CKqoKw.js} +137 -4
- package/dist/BasePathResolver-B6CKqoKw.js.map +1 -0
- package/dist/{index-CJNKYI37.js → ClientManager-ChcmUL47.js} +1928 -5543
- package/dist/ClientManager-ChcmUL47.js.map +1 -0
- package/dist/{ModelProperty-Bvg9cJcd.js → ModelProperty-D79uV42p.js} +42 -36
- package/dist/ModelProperty-D79uV42p.js.map +1 -0
- package/dist/{Schema-BNJBY80k.js → Schema-a8uO-hIZ.js} +48 -47
- package/dist/Schema-a8uO-hIZ.js.map +1 -0
- package/dist/{SchemaValidationService-aqXkwXTr.js → SchemaValidationService-Y49vqast.js} +16 -12
- package/dist/SchemaValidationService-Y49vqast.js.map +1 -0
- package/dist/{backfillMetadataPropertyIds-DYkvoOMz.js → backfillMetadataPropertyIds-CBsf7LnU.js} +6 -3
- package/dist/{backfillMetadataPropertyIds-DYkvoOMz.js.map → backfillMetadataPropertyIds-CBsf7LnU.js.map} +1 -1
- package/dist/cjs/{ModelProperty-alntkSnH.js → ModelProperty-D9FGaGuE.js} +25 -20
- package/dist/cjs/ModelProperty-D9FGaGuE.js.map +1 -0
- package/dist/cjs/{Schema-ByFv6fcb.js → Schema-BiJIPLEL.js} +29 -27
- package/dist/cjs/Schema-BiJIPLEL.js.map +1 -0
- package/dist/cjs/{SchemaValidationService-D55MWsxv.js → SchemaValidationService-DtYs_CNY.js} +9 -6
- package/dist/cjs/SchemaValidationService-DtYs_CNY.js.map +1 -0
- package/dist/cjs/{backfillMetadataPropertyIds-DrrL5RqD.js → backfillMetadataPropertyIds-2XaN3b9S.js} +7 -5
- package/dist/cjs/{backfillMetadataPropertyIds-DrrL5RqD.js.map → backfillMetadataPropertyIds-2XaN3b9S.js.map} +1 -1
- package/dist/cjs/{eas-D2E3_i_c.js → eas-CMNppmGE.js} +32 -6
- package/dist/cjs/eas-CMNppmGE.js.map +1 -0
- package/dist/cjs/{getItem-B2zLVB_l.js → getItem-B6jEINjW.js} +6 -4
- package/dist/cjs/{getItem-B2zLVB_l.js.map → getItem-B6jEINjW.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-Bv94k4ak.js → getPublishPayload-D5DhLGvN.js} +66 -60
- package/dist/cjs/getPublishPayload-D5DhLGvN.js.map +1 -0
- package/dist/cjs/{getPublishUploads-CSbHUxYk.js → getPublishUploads-DMhCCKYF.js} +21 -13
- package/dist/cjs/getPublishUploads-DMhCCKYF.js.map +1 -0
- package/dist/cjs/{getSegmentedItemProperties-CMhXKQHz.js → getSegmentedItemProperties-CU8rtBAo.js} +3 -51
- package/dist/cjs/getSegmentedItemProperties-CU8rtBAo.js.map +1 -0
- package/dist/cjs/{index-D-9WglxG.js → index-CSNtEnbF.js} +5986 -5389
- package/dist/cjs/index-CSNtEnbF.js.map +1 -0
- package/dist/cjs/{index-pSLjO-ch.js → index-DPp9rdRL.js} +10 -6
- package/dist/cjs/index-DPp9rdRL.js.map +1 -0
- package/dist/cjs/{property-gUK2PijH.js → property-DlKiAWt4.js} +11 -7
- package/dist/cjs/{property-gUK2PijH.js.map → property-DlKiAWt4.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-CYtl7VTD.js → syncDbWithEas-C6n34o_Q.js} +14 -8
- package/dist/cjs/syncDbWithEas-C6n34o_Q.js.map +1 -0
- package/dist/{configurePlatform-bGvKBBQy.js → configurePlatform-CE0Vew17.js} +6 -3
- package/dist/{configurePlatform-bGvKBBQy.js.map → configurePlatform-CE0Vew17.js.map} +1 -1
- package/dist/db/drizzle/0014_add_error_code_to_publish_processes.sql +1 -0
- package/dist/db/drizzle/meta/0014_snapshot.json +1269 -0
- package/dist/db/drizzle/meta/_journal.json +7 -0
- package/dist/{db-YiH_kIpE.js → db-WbrzEf7c.js} +266 -53
- package/dist/db-WbrzEf7c.js.map +1 -0
- package/dist/{eas-1nUCcmeh.js → eas-CfYCu4IX.js} +9 -6
- package/dist/eas-CfYCu4IX.js.map +1 -0
- package/dist/generateId-BopUwD8F.js +9 -0
- package/dist/generateId-BopUwD8F.js.map +1 -0
- package/dist/{getItem-Bb8bTYzY.js → getItem-Br-bGNFO.js} +12 -10
- package/dist/{getItem-Bb8bTYzY.js.map → getItem-Br-bGNFO.js.map} +1 -1
- package/dist/{getPublishPayload-BHw8mPSb.js → getPublishPayload-BIrTVUxb.js} +72 -65
- package/dist/getPublishPayload-BIrTVUxb.js.map +1 -0
- package/dist/{getPublishUploads-BYhckxFl.js → getPublishUploads-C6cDeZdz.js} +22 -13
- package/dist/getPublishUploads-C6cDeZdz.js.map +1 -0
- package/dist/{getSegmentedItemProperties-B73nMPBv.js → getSegmentedItemProperties-BmKE71vU.js} +5 -5
- package/dist/{getSegmentedItemProperties-B73nMPBv.js.map → getSegmentedItemProperties-BmKE71vU.js.map} +1 -1
- package/dist/index-280bL-n4.js +1122 -0
- package/dist/index-280bL-n4.js.map +1 -0
- package/dist/{index-DzgMt8ba.js → index-ClSv5pTA.js} +17 -14
- package/dist/index-ClSv5pTA.js.map +1 -0
- package/dist/{index-C_5xwOPQ.js → index-Djd3667v.js} +2 -2
- package/dist/index-Djd3667v.js.map +1 -0
- package/dist/index-HRHkbVQd.js +3492 -0
- package/dist/index-HRHkbVQd.js.map +1 -0
- package/dist/{index.node-ZLiBj9Cu.js → index.node-DBtQkEfz.js} +8 -7
- package/dist/index.node-DBtQkEfz.js.map +1 -0
- package/dist/main.cjs +10 -4
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +43 -43
- package/dist/main.js.map +1 -1
- package/dist/model-DGMe-TTm.js +25 -0
- package/dist/model-DGMe-TTm.js.map +1 -0
- package/dist/node.js +21 -17
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +162 -63
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +5 -5
- package/dist/{property-Dcb50seV.js → property-CQjuZ4JW.js} +20 -17
- package/dist/property-CQjuZ4JW.js.map +1 -0
- package/dist/seedSchema/PublishProcessSchema.ts +1 -0
- package/dist/src/Item/Item.d.ts +6 -0
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +10 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/resolveRelatedValue.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +1 -1
- package/dist/src/Schema/service/addModelsMachine.d.ts.map +1 -1
- package/dist/src/Schema/service/validation/SchemaValidationService.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/db/embeddedMigrations.d.ts +17 -0
- package/dist/src/browser/db/embeddedMigrations.d.ts.map +1 -0
- package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
- package/dist/src/browser/helpers/EasClient.d.ts +2 -1
- package/dist/src/browser/helpers/EasClient.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +18 -3
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +6 -1
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/constants.d.ts +4 -0
- package/dist/src/client/constants.d.ts.map +1 -1
- package/dist/src/client/nodeEndpointDefaults.d.ts +8 -0
- package/dist/src/client/nodeEndpointDefaults.d.ts.map +1 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/eas.d.ts +2 -2
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/index.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts +1 -1
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts +2 -2
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/IFileManager.d.ts +4 -0
- package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +9 -2
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/crypto.d.ts +3 -2
- package/dist/src/helpers/crypto.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +6 -0
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/ensureImageLocal.d.ts +24 -0
- package/dist/src/helpers/ensureImageLocal.d.ts.map +1 -0
- package/dist/src/helpers/ethereumUtils.d.ts.map +1 -1
- package/dist/src/helpers/gateway/gatewayState.d.ts +1 -1
- package/dist/src/helpers/gateway/gatewayState.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +10 -2
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/localDbChain.d.ts +22 -0
- package/dist/src/helpers/localDbChain.d.ts.map +1 -0
- package/dist/src/helpers/metadataPropertyNames.d.ts +9 -0
- package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
- package/dist/src/helpers/property/index.d.ts +12 -0
- package/dist/src/helpers/property/index.d.ts.map +1 -1
- package/dist/src/helpers/readHtmlBodyForStorageSeed.d.ts.map +1 -1
- package/dist/src/helpers/relationSeedRef.d.ts +8 -0
- package/dist/src/helpers/relationSeedRef.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +11 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/easLodashHook.d.ts +2 -0
- package/dist/src/node/easLodashHook.d.ts.map +1 -0
- package/dist/src/node/easLodashRegister.d.ts +2 -0
- package/dist/src/node/easLodashRegister.d.ts.map +1 -0
- package/dist/src/node/helpers/FileManager.d.ts +2 -1
- package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +2 -1
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/seedSchema/PublishProcessSchema.d.ts +19 -0
- package/dist/src/seedSchema/PublishProcessSchema.d.ts.map +1 -1
- package/dist/src/types/fileManager.d.ts +4 -0
- package/dist/src/types/fileManager.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +15 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-B0RUeDuj.js → syncDbWithEas-CuARXfyN.js} +24 -18
- package/dist/syncDbWithEas-CuARXfyN.js.map +1 -0
- package/dist/{updateSeedRevokedAt-D5ZbBehZ.js → updateSeedRevokedAt-CBcLfHWs.js} +2 -2
- package/dist/{updateSeedRevokedAt-D5ZbBehZ.js.map → updateSeedRevokedAt-CBcLfHWs.js.map} +1 -1
- package/package.json +12 -8
- package/src/node/easLodashHook.js +22 -0
- package/src/node/easLodashRegister.js +13 -0
- package/dist/BasePathResolver-BGxb4Qod.js.map +0 -1
- package/dist/ModelProperty-Bvg9cJcd.js.map +0 -1
- package/dist/Schema-BNJBY80k.js.map +0 -1
- package/dist/SchemaValidationService-aqXkwXTr.js.map +0 -1
- package/dist/cjs/ModelProperty-alntkSnH.js.map +0 -1
- package/dist/cjs/Schema-ByFv6fcb.js.map +0 -1
- package/dist/cjs/SchemaValidationService-D55MWsxv.js.map +0 -1
- package/dist/cjs/eas-D2E3_i_c.js.map +0 -1
- package/dist/cjs/getPublishPayload-Bv94k4ak.js.map +0 -1
- package/dist/cjs/getPublishUploads-CSbHUxYk.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-CMhXKQHz.js.map +0 -1
- package/dist/cjs/index-D-9WglxG.js.map +0 -1
- package/dist/cjs/index-pSLjO-ch.js.map +0 -1
- package/dist/cjs/syncDbWithEas-CYtl7VTD.js.map +0 -1
- package/dist/constants-Bre6dTJR.js +0 -122
- package/dist/constants-Bre6dTJR.js.map +0 -1
- package/dist/constants-CTs2RUrM.js +0 -657
- package/dist/constants-CTs2RUrM.js.map +0 -1
- package/dist/db-YiH_kIpE.js.map +0 -1
- package/dist/eas-1nUCcmeh.js.map +0 -1
- package/dist/getPublishPayload-BHw8mPSb.js.map +0 -1
- package/dist/getPublishUploads-BYhckxFl.js.map +0 -1
- package/dist/index-CJNKYI37.js.map +0 -1
- package/dist/index-C_5xwOPQ.js.map +0 -1
- package/dist/index-DzgMt8ba.js.map +0 -1
- package/dist/index.node-ZLiBj9Cu.js.map +0 -1
- package/dist/property-Dcb50seV.js.map +0 -1
- package/dist/seedSchema/AppStateSchema.d.ts +0 -82
- package/dist/seedSchema/AppStateSchema.d.ts.map +0 -1
- package/dist/seedSchema/ConfigSchema.d.ts +0 -101
- package/dist/seedSchema/ConfigSchema.d.ts.map +0 -1
- package/dist/seedSchema/MetadataSchema.d.ts +0 -422
- package/dist/seedSchema/MetadataSchema.d.ts.map +0 -1
- package/dist/seedSchema/ModelSchema.d.ts +0 -243
- package/dist/seedSchema/ModelSchema.d.ts.map +0 -1
- package/dist/seedSchema/ModelSchemaSchema.d.ts +0 -61
- package/dist/seedSchema/ModelSchemaSchema.d.ts.map +0 -1
- package/dist/seedSchema/ModelUidSchema.d.ts +0 -64
- package/dist/seedSchema/ModelUidSchema.d.ts.map +0 -1
- package/dist/seedSchema/PropertyUidSchema.d.ts +0 -64
- package/dist/seedSchema/PropertyUidSchema.d.ts.map +0 -1
- package/dist/seedSchema/SchemaSchema.d.ts +0 -169
- package/dist/seedSchema/SchemaSchema.d.ts.map +0 -1
- package/dist/seedSchema/SeedSchema.d.ts +0 -192
- package/dist/seedSchema/SeedSchema.d.ts.map +0 -1
- package/dist/seedSchema/VersionSchema.d.ts +0 -194
- package/dist/seedSchema/VersionSchema.d.ts.map +0 -1
- package/dist/seedSchema/index.d.ts +0 -14
- package/dist/seedSchema/index.d.ts.map +0 -1
- package/dist/syncDbWithEas-B0RUeDuj.js.map +0 -1
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
import { w as writeProcessMachine, M as Model
|
|
4
|
-
import { n as normalizeDataType } from './
|
|
3
|
+
import { w as writeProcessMachine, M as Model } from './index-HRHkbVQd.js';
|
|
4
|
+
import { t as getModelIdByFileId, n as normalizeDataType, u as getModelId } from './db-WbrzEf7c.js';
|
|
5
5
|
import 'pluralize';
|
|
6
|
-
import { a as BaseDb, m as models, p as properties, s as schemas, i as modelSchemas, B as BaseFileManager } from './BasePathResolver-
|
|
6
|
+
import { a as BaseDb, m as models, p as properties, s as schemas, i as modelSchemas, B as BaseFileManager } from './BasePathResolver-B6CKqoKw.js';
|
|
7
7
|
import { eq, and } from 'drizzle-orm';
|
|
8
|
+
import { modelPropertiesToObject } from './model-DGMe-TTm.js';
|
|
8
9
|
import debug from 'debug';
|
|
9
|
-
import
|
|
10
|
-
import { S as Schema } from './Schema-
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '@seedprotocol/eas';
|
|
14
|
-
import './constants-Bre6dTJR.js';
|
|
15
|
-
import '@seedprotocol/arweave';
|
|
16
|
-
import 'rxjs';
|
|
17
|
-
import 'lodash-es';
|
|
10
|
+
import './index-280bL-n4.js';
|
|
11
|
+
import { S as Schema } from './Schema-a8uO-hIZ.js';
|
|
12
|
+
import { n as waitForEntityIdle, o as createReactiveProxy, q as findEntity, u as forceRemoveFromCaches, v as runDestroyLifecycle } from './ClientManager-ChcmUL47.js';
|
|
13
|
+
import { generateId } from './generateId-BopUwD8F.js';
|
|
18
14
|
import 'drizzle-orm/casing';
|
|
19
|
-
import 'js-sha3';
|
|
20
|
-
import '@seedprotocol/query';
|
|
21
15
|
import '@sinclair/typebox';
|
|
16
|
+
import 'lodash-es';
|
|
22
17
|
import 'drizzle-orm/sqlite-core';
|
|
23
|
-
import '
|
|
18
|
+
import '@seedprotocol/arweave';
|
|
19
|
+
import '@seedprotocol/eas';
|
|
20
|
+
import 'nanoid';
|
|
21
|
+
import 'nanoid-dictionary';
|
|
22
|
+
import '@seedprotocol/query';
|
|
23
|
+
import './SchemaValidationService-Y49vqast.js';
|
|
24
24
|
import '@sinclair/typebox/value';
|
|
25
|
+
import '@noble/hashes/sha3';
|
|
26
|
+
import '@noble/hashes/utils';
|
|
27
|
+
import 'rxjs';
|
|
25
28
|
|
|
26
29
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
27
30
|
/**
|
|
@@ -31,15 +34,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
31
34
|
*/
|
|
32
35
|
async function getSchemaNameFromModel(modelName) {
|
|
33
36
|
// Get the latest schema files and find which one contains this model
|
|
34
|
-
const _mod_0 = await import('./
|
|
35
|
-
const _ns_0 = _mod_0.
|
|
37
|
+
const _mod_0 = await import('./ClientManager-ChcmUL47.js');
|
|
38
|
+
const _ns_0 = _mod_0.an;
|
|
36
39
|
const schemaHelpersMod = _ns_0;
|
|
37
40
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
38
41
|
const latestSchemas = await listLatestSchemaFiles();
|
|
39
42
|
for (const schema of latestSchemas) {
|
|
40
43
|
try {
|
|
41
|
-
const _mod_1 = await import('./BasePathResolver-
|
|
42
|
-
const _ns_1 = _mod_1.
|
|
44
|
+
const _mod_1 = await import('./BasePathResolver-B6CKqoKw.js');
|
|
45
|
+
const _ns_1 = _mod_1.N;
|
|
43
46
|
const fileManagerMod = _ns_1;
|
|
44
47
|
const { BaseFileManager } = fileManagerMod;
|
|
45
48
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
@@ -58,7 +61,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
58
61
|
const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
59
62
|
const _saveToSchema = async () => {
|
|
60
63
|
// Use dynamic import to break circular dependency
|
|
61
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
64
|
+
const validationServiceMod = await import('./SchemaValidationService-Y49vqast.js');
|
|
62
65
|
const { SchemaValidationService } = validationServiceMod;
|
|
63
66
|
const validationService = new SchemaValidationService();
|
|
64
67
|
// Validate property structure before saving
|
|
@@ -77,15 +80,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
77
80
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
78
81
|
}
|
|
79
82
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
80
|
-
const _mod_2 = await import('./db-
|
|
81
|
-
const _ns_2 = _mod_2.
|
|
83
|
+
const _mod_2 = await import('./db-WbrzEf7c.js');
|
|
84
|
+
const _ns_2 = _mod_2.Q;
|
|
82
85
|
const dbMod = _ns_2;
|
|
83
86
|
const { savePropertyToDb } = dbMod;
|
|
84
87
|
await savePropertyToDb(context);
|
|
85
88
|
// Mark schema as draft so user knows to save
|
|
86
89
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
87
90
|
if (schemaName) {
|
|
88
|
-
const _mod_3 = await import('./Schema-
|
|
91
|
+
const _mod_3 = await import('./Schema-a8uO-hIZ.js');
|
|
89
92
|
const _ns_3 = _mod_3.b;
|
|
90
93
|
const schemaMod = _ns_3;
|
|
91
94
|
const { Schema } = schemaMod;
|
|
@@ -120,8 +123,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
120
123
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
121
124
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
122
125
|
try {
|
|
123
|
-
const _mod_4 = await import('./db-
|
|
124
|
-
const _ns_4 = _mod_4.
|
|
126
|
+
const _mod_4 = await import('./db-WbrzEf7c.js');
|
|
127
|
+
const _ns_4 = _mod_4.Q;
|
|
125
128
|
const dbMod = _ns_4;
|
|
126
129
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
127
130
|
let fromDb;
|
|
@@ -167,8 +170,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
167
170
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
168
171
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
169
172
|
try {
|
|
170
|
-
const _mod_5 = await import('./db-
|
|
171
|
-
const _ns_5 = _mod_5.
|
|
173
|
+
const _mod_5 = await import('./db-WbrzEf7c.js');
|
|
174
|
+
const _ns_5 = _mod_5.Q;
|
|
172
175
|
const dbMod = _ns_5;
|
|
173
176
|
const { savePropertyToDb } = dbMod;
|
|
174
177
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
@@ -229,8 +232,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
229
232
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
230
233
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
231
234
|
// Use dynamic import to break circular dependency
|
|
232
|
-
const _mod_6 = await import('./db-
|
|
233
|
-
const _ns_6 = _mod_6.
|
|
235
|
+
const _mod_6 = await import('./db-WbrzEf7c.js');
|
|
236
|
+
const _ns_6 = _mod_6.Q;
|
|
234
237
|
const dbMod = _ns_6;
|
|
235
238
|
const { savePropertyToDb } = dbMod;
|
|
236
239
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
@@ -245,7 +248,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
245
248
|
// Mark schema as draft if schema name is available
|
|
246
249
|
if (fullContext._schemaName) {
|
|
247
250
|
// Get the Schema instance and mark it as draft
|
|
248
|
-
const _mod_7 = await import('./Schema-
|
|
251
|
+
const _mod_7 = await import('./Schema-a8uO-hIZ.js');
|
|
249
252
|
const _ns_7 = _mod_7.b;
|
|
250
253
|
const schemaMod = _ns_7;
|
|
251
254
|
const { Schema } = schemaMod;
|
|
@@ -264,7 +267,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
264
267
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
265
268
|
// Clear isEdited flag in database
|
|
266
269
|
try {
|
|
267
|
-
const _mod_8 = await import('./index-
|
|
270
|
+
const _mod_8 = await import('./index-Djd3667v.js');
|
|
268
271
|
const _ns_8 = _mod_8.s;
|
|
269
272
|
const seedSchemaMod = _ns_8;
|
|
270
273
|
const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
|
|
@@ -330,8 +333,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
330
333
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
331
334
|
await new Promise((r) => setTimeout(r, 60));
|
|
332
335
|
try {
|
|
333
|
-
const _mod_9 = await import('./db-
|
|
334
|
-
const _ns_9 = _mod_9.
|
|
336
|
+
const _mod_9 = await import('./db-WbrzEf7c.js');
|
|
337
|
+
const _ns_9 = _mod_9.Q;
|
|
335
338
|
const dbMod = _ns_9;
|
|
336
339
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
337
340
|
// Try pending write first (property row may not exist yet)
|
|
@@ -384,10 +387,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
384
387
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
385
388
|
}
|
|
386
389
|
// Use dynamic imports to break circular dependencies
|
|
387
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
390
|
+
const validationServiceMod = await import('./SchemaValidationService-Y49vqast.js');
|
|
388
391
|
const { SchemaValidationService } = validationServiceMod;
|
|
389
392
|
const validationService = new SchemaValidationService();
|
|
390
|
-
const _mod_10 = await import('./Schema-
|
|
393
|
+
const _mod_10 = await import('./Schema-a8uO-hIZ.js');
|
|
391
394
|
const _ns_10 = _mod_10.b;
|
|
392
395
|
const schemaMod = _ns_10;
|
|
393
396
|
const { Schema } = schemaMod;
|
|
@@ -1202,6 +1205,9 @@ class ModelProperty {
|
|
|
1202
1205
|
if (rawType) {
|
|
1203
1206
|
propertyWithId.dataType = normalizeDataType(rawType);
|
|
1204
1207
|
}
|
|
1208
|
+
if (typeof propertyWithId.refValueType === 'string') {
|
|
1209
|
+
propertyWithId.refValueType = normalizeDataType(propertyWithId.refValueType);
|
|
1210
|
+
}
|
|
1205
1211
|
// Ensure id (schemaFileId) is set correctly
|
|
1206
1212
|
// Priority: _propertyFileId > id (if string) > generate new
|
|
1207
1213
|
// If id is a number (old format), use _propertyFileId instead
|
|
@@ -1773,4 +1779,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1773
1779
|
});
|
|
1774
1780
|
|
|
1775
1781
|
export { ModelProperty };
|
|
1776
|
-
//# sourceMappingURL=ModelProperty-
|
|
1782
|
+
//# sourceMappingURL=ModelProperty-D79uV42p.js.map
|