@seedprotocol/sdk 0.6.7 → 0.6.9
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-qV0apdVY.js → BasePathResolver-B6CKqoKw.js} +16 -5
- package/dist/BasePathResolver-B6CKqoKw.js.map +1 -0
- package/dist/{ClientManager-Y5EWQuJj.js → ClientManager-ChcmUL47.js} +619 -264
- package/dist/ClientManager-ChcmUL47.js.map +1 -0
- package/dist/{ModelProperty-DuB5nk6A.js → ModelProperty-D79uV42p.js} +33 -30
- package/dist/ModelProperty-D79uV42p.js.map +1 -0
- package/dist/{Schema-BYM-GNdE.js → Schema-a8uO-hIZ.js} +43 -43
- package/dist/Schema-a8uO-hIZ.js.map +1 -0
- package/dist/{SchemaValidationService-Dr6nmwPm.js → SchemaValidationService-Y49vqast.js} +13 -12
- package/dist/SchemaValidationService-Y49vqast.js.map +1 -0
- package/dist/{backfillMetadataPropertyIds-BzbAB-C5.js → backfillMetadataPropertyIds-CBsf7LnU.js} +5 -3
- package/dist/{backfillMetadataPropertyIds-BzbAB-C5.js.map → backfillMetadataPropertyIds-CBsf7LnU.js.map} +1 -1
- package/dist/cjs/{ModelProperty-CDTOx5zi.js → ModelProperty-D9FGaGuE.js} +21 -17
- package/dist/cjs/ModelProperty-D9FGaGuE.js.map +1 -0
- package/dist/cjs/{Schema-XXcwj3hV.js → Schema-BiJIPLEL.js} +25 -24
- package/dist/cjs/Schema-BiJIPLEL.js.map +1 -0
- package/dist/cjs/{SchemaValidationService-Z7OhtGn5.js → SchemaValidationService-DtYs_CNY.js} +5 -3
- package/dist/cjs/SchemaValidationService-DtYs_CNY.js.map +1 -0
- package/dist/cjs/{backfillMetadataPropertyIds-Bt4fzfIV.js → backfillMetadataPropertyIds-2XaN3b9S.js} +3 -2
- package/dist/cjs/{backfillMetadataPropertyIds-Bt4fzfIV.js.map → backfillMetadataPropertyIds-2XaN3b9S.js.map} +1 -1
- package/dist/cjs/{eas-DdI-4vwl.js → eas-CMNppmGE.js} +4 -3
- package/dist/cjs/{eas-DdI-4vwl.js.map → eas-CMNppmGE.js.map} +1 -1
- package/dist/cjs/{getItem-B_2GeTQf.js → getItem-B6jEINjW.js} +3 -2
- package/dist/cjs/{getItem-B_2GeTQf.js.map → getItem-B6jEINjW.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-Jmgi1RUj.js → getPublishPayload-D5DhLGvN.js} +64 -59
- package/dist/cjs/getPublishPayload-D5DhLGvN.js.map +1 -0
- package/dist/cjs/{getPublishUploads-DNULcrN5.js → getPublishUploads-DMhCCKYF.js} +17 -10
- package/dist/cjs/getPublishUploads-DMhCCKYF.js.map +1 -0
- package/dist/cjs/{getSegmentedItemProperties-DK82kjri.js → getSegmentedItemProperties-CU8rtBAo.js} +3 -51
- package/dist/cjs/getSegmentedItemProperties-CU8rtBAo.js.map +1 -0
- package/dist/cjs/{index-DM1WR83P.js → index-CSNtEnbF.js} +879 -467
- package/dist/cjs/index-CSNtEnbF.js.map +1 -0
- package/dist/cjs/{index-tpO1Nj4v.js → index-DPp9rdRL.js} +6 -3
- package/dist/cjs/index-DPp9rdRL.js.map +1 -0
- package/dist/cjs/{property-DmvgA8FD.js → property-DlKiAWt4.js} +7 -4
- package/dist/cjs/{property-DmvgA8FD.js.map → property-DlKiAWt4.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-3hOoPdu1.js → syncDbWithEas-C6n34o_Q.js} +11 -6
- package/dist/cjs/syncDbWithEas-C6n34o_Q.js.map +1 -0
- package/dist/{configurePlatform-CCYQruij.js → configurePlatform-CE0Vew17.js} +5 -5
- package/dist/{configurePlatform-CCYQruij.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-CceyWksv.js → db-WbrzEf7c.js} +254 -35
- package/dist/db-WbrzEf7c.js.map +1 -0
- package/dist/{eas-CH8iFIST.js → eas-CfYCu4IX.js} +6 -6
- package/dist/{eas-CH8iFIST.js.map → eas-CfYCu4IX.js.map} +1 -1
- package/dist/{getItem-C7Mtfz6O.js → getItem-Br-bGNFO.js} +6 -6
- package/dist/{getItem-C7Mtfz6O.js.map → getItem-Br-bGNFO.js.map} +1 -1
- package/dist/{getPublishPayload-2gnnDdMh.js → getPublishPayload-BIrTVUxb.js} +66 -62
- package/dist/getPublishPayload-BIrTVUxb.js.map +1 -0
- package/dist/{getPublishUploads-AKISt3JA.js → getPublishUploads-C6cDeZdz.js} +19 -13
- package/dist/getPublishUploads-C6cDeZdz.js.map +1 -0
- package/dist/{getSegmentedItemProperties-eIjvhCP_.js → getSegmentedItemProperties-BmKE71vU.js} +5 -5
- package/dist/{getSegmentedItemProperties-eIjvhCP_.js.map → getSegmentedItemProperties-BmKE71vU.js.map} +1 -1
- package/dist/{constants-DSqHBPNe.js → index-280bL-n4.js} +32 -257
- package/dist/index-280bL-n4.js.map +1 -0
- package/dist/{index-CHi212ST.js → index-ClSv5pTA.js} +13 -13
- package/dist/index-ClSv5pTA.js.map +1 -0
- package/dist/{index-CsmiM0RI.js → index-Djd3667v.js} +2 -2
- package/dist/index-Djd3667v.js.map +1 -0
- package/dist/{index-BFpbtEsg.js → index-HRHkbVQd.js} +24 -24
- package/dist/{index-BFpbtEsg.js.map → index-HRHkbVQd.js.map} +1 -1
- package/dist/{index.node-CbWB4MDz.js → index.node-DBtQkEfz.js} +8 -6
- package/dist/index.node-DBtQkEfz.js.map +1 -0
- package/dist/main.cjs +6 -1
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +36 -38
- package/dist/main.js.map +1 -1
- package/dist/node.js +15 -14
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +108 -46
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +4 -3
- package/dist/platform.node.js.map +1 -1
- package/dist/{property-CWKcZ5YZ.js → property-CQjuZ4JW.js} +14 -13
- 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/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/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/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- 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/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.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/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/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 +8 -0
- package/dist/src/helpers/constants.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/gateway/gatewayState.d.ts +1 -1
- package/dist/src/helpers/gateway/gatewayState.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/index.d.ts +9 -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-5kZneTEL.js → syncDbWithEas-CuARXfyN.js} +16 -12
- package/dist/syncDbWithEas-CuARXfyN.js.map +1 -0
- package/dist/{updateSeedRevokedAt-CgfOBtqJ.js → updateSeedRevokedAt-CBcLfHWs.js} +2 -2
- package/dist/{updateSeedRevokedAt-CgfOBtqJ.js.map → updateSeedRevokedAt-CBcLfHWs.js.map} +1 -1
- package/package.json +11 -7
- package/src/node/easLodashHook.js +22 -0
- package/src/node/easLodashRegister.js +13 -0
- package/dist/BasePathResolver-qV0apdVY.js.map +0 -1
- package/dist/ClientManager-Y5EWQuJj.js.map +0 -1
- package/dist/ModelProperty-DuB5nk6A.js.map +0 -1
- package/dist/Schema-BYM-GNdE.js.map +0 -1
- package/dist/SchemaValidationService-Dr6nmwPm.js.map +0 -1
- package/dist/cjs/ModelProperty-CDTOx5zi.js.map +0 -1
- package/dist/cjs/Schema-XXcwj3hV.js.map +0 -1
- package/dist/cjs/SchemaValidationService-Z7OhtGn5.js.map +0 -1
- package/dist/cjs/getPublishPayload-Jmgi1RUj.js.map +0 -1
- package/dist/cjs/getPublishUploads-DNULcrN5.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-DK82kjri.js.map +0 -1
- package/dist/cjs/index-DM1WR83P.js.map +0 -1
- package/dist/cjs/index-tpO1Nj4v.js.map +0 -1
- package/dist/cjs/syncDbWithEas-3hOoPdu1.js.map +0 -1
- package/dist/constants-DSqHBPNe.js.map +0 -1
- package/dist/db-CceyWksv.js.map +0 -1
- package/dist/getPublishPayload-2gnnDdMh.js.map +0 -1
- package/dist/getPublishUploads-AKISt3JA.js.map +0 -1
- package/dist/index-CHi212ST.js.map +0 -1
- package/dist/index-CsmiM0RI.js.map +0 -1
- package/dist/index.node-CbWB4MDz.js.map +0 -1
- package/dist/property-CWKcZ5YZ.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-5kZneTEL.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { D as SEED_PROTOCOL_SCHEMA_NAME, a as BaseDb, s as schemas, m as models, i as modelSchemas, p as properties, B as BaseFileManager,
|
|
2
|
+
import { i as getRefValueType, ai as createModelsFromJson, X as listCompleteSchemaFiles, aj as getLatestSchemaVersion, ak as createModelFromJson, k as loadSchemaFromFile, n as waitForEntityIdle, o as createReactiveProxy, q as findEntity, Y as loadAllSchemasFromDb, H as getClient, y as ClientManagerState, ag as unloadEntity, ah as clearDestroySubscriptions, u as forceRemoveFromCaches, v as runDestroyLifecycle } from './ClientManager-ChcmUL47.js';
|
|
3
|
+
import './index-280bL-n4.js';
|
|
4
|
+
import { A as addSchemaToDb, k as isDataType, M as ModelPropertyDataTypes, s as addModelsToDb, E as loadModelsFromDbForSchema } from './db-WbrzEf7c.js';
|
|
5
|
+
import { D as SEED_PROTOCOL_SCHEMA_NAME, a as BaseDb, s as schemas, m as models, i as modelSchemas, p as properties, B as BaseFileManager, J as isInternalSchema } from './BasePathResolver-B6CKqoKw.js';
|
|
6
6
|
import { eq, desc, and } from 'drizzle-orm';
|
|
7
7
|
import debug from 'debug';
|
|
8
|
-
import { generateId } from './generateId-BopUwD8F.js';
|
|
9
|
-
import { SchemaValidationService } from './SchemaValidationService-Dr6nmwPm.js';
|
|
10
|
-
import { M as Model, w as writeProcessMachine, C as ConflictError, s as setupEntityLiveQuery } from './index-BFpbtEsg.js';
|
|
11
8
|
import 'pluralize';
|
|
9
|
+
import { generateId } from './generateId-BopUwD8F.js';
|
|
10
|
+
import { SchemaValidationService } from './SchemaValidationService-Y49vqast.js';
|
|
11
|
+
import { M as Model, w as writeProcessMachine, C as ConflictError, s as setupEntityLiveQuery } from './index-HRHkbVQd.js';
|
|
12
12
|
|
|
13
13
|
const logger$d = debug('seedSdk:schema:actors:loadOrCreateSchema');
|
|
14
14
|
/**
|
|
@@ -52,7 +52,7 @@ const createModelInstances$2 = async (modelIds) => {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
try {
|
|
55
|
-
const _mod_0 = await import('./index-
|
|
55
|
+
const _mod_0 = await import('./index-HRHkbVQd.js');
|
|
56
56
|
const _ns_0 = _mod_0.b;
|
|
57
57
|
const modelMod = _ns_0;
|
|
58
58
|
const { Model } = modelMod;
|
|
@@ -167,8 +167,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
167
167
|
// For Seed Protocol, always load from internal file, never create new
|
|
168
168
|
logger$d(`Loading internal Seed Protocol schema from SDK`);
|
|
169
169
|
try {
|
|
170
|
-
const _mod_1 = await import('./ClientManager-
|
|
171
|
-
const _ns_1 = _mod_1.
|
|
170
|
+
const _mod_1 = await import('./ClientManager-ChcmUL47.js');
|
|
171
|
+
const _ns_1 = _mod_1.ao;
|
|
172
172
|
const internalSchema = _ns_1;
|
|
173
173
|
const schemaFile = internalSchema.default;
|
|
174
174
|
// Check if it exists in database, if not, add it
|
|
@@ -217,7 +217,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
217
217
|
}
|
|
218
218
|
// Handle List type (case-insensitive refValueType)
|
|
219
219
|
const listRefValueType = getRefValueType(schemaProp);
|
|
220
|
-
if (schemaProp.dataType
|
|
220
|
+
if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && listRefValueType) {
|
|
221
221
|
jsonProp.refValueType = listRefValueType;
|
|
222
222
|
if (schemaProp.ref || schemaProp.refModelName) {
|
|
223
223
|
jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
|
|
@@ -359,7 +359,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
359
359
|
jsonProp.model = schemaProp.refModelName || schemaProp.ref;
|
|
360
360
|
}
|
|
361
361
|
// Handle List type (support both refValueType and legacy items, case-insensitive)
|
|
362
|
-
if (schemaProp.dataType
|
|
362
|
+
if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) || isDataType(schemaProp.type, ModelPropertyDataTypes.List)) {
|
|
363
363
|
const refValueType = getRefValueType(schemaProp);
|
|
364
364
|
if (refValueType) {
|
|
365
365
|
jsonProp.refValueType = refValueType;
|
|
@@ -662,8 +662,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
662
662
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
663
663
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
664
664
|
try {
|
|
665
|
-
const _mod_2 = await import('./ClientManager-
|
|
666
|
-
const _ns_2 = _mod_2.
|
|
665
|
+
const _mod_2 = await import('./ClientManager-ChcmUL47.js');
|
|
666
|
+
const _ns_2 = _mod_2.ao;
|
|
667
667
|
const internalSchema = _ns_2;
|
|
668
668
|
const internalSchemaFile = internalSchema.default;
|
|
669
669
|
mergedModels = { ...(internalSchemaFile.models || {}) };
|
|
@@ -891,8 +891,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
891
891
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
892
892
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
893
893
|
try {
|
|
894
|
-
const _mod_3 = await import('./ClientManager-
|
|
895
|
-
const _ns_3 = _mod_3.
|
|
894
|
+
const _mod_3 = await import('./ClientManager-ChcmUL47.js');
|
|
895
|
+
const _ns_3 = _mod_3.ao;
|
|
896
896
|
const internalSchema = _ns_3;
|
|
897
897
|
const internalSchemaFile = internalSchema.default;
|
|
898
898
|
mergedModels = { ...(internalSchemaFile.models || {}) };
|
|
@@ -982,8 +982,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
982
982
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
983
983
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
984
984
|
try {
|
|
985
|
-
const _mod_4 = await import('./ClientManager-
|
|
986
|
-
const _ns_4 = _mod_4.
|
|
985
|
+
const _mod_4 = await import('./ClientManager-ChcmUL47.js');
|
|
986
|
+
const _ns_4 = _mod_4.ao;
|
|
987
987
|
const internalSchema = _ns_4;
|
|
988
988
|
const internalSchemaFile = internalSchema.default;
|
|
989
989
|
mergedModels = { ...(internalSchemaFile.models || {}) };
|
|
@@ -1070,8 +1070,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1070
1070
|
// If schemaData is missing, try to load from internal schema file for seed-protocol
|
|
1071
1071
|
if (!dbSchema.schemaData && schemaName === 'Seed Protocol') {
|
|
1072
1072
|
try {
|
|
1073
|
-
const _mod_5 = await import('./ClientManager-
|
|
1074
|
-
const _ns_5 = _mod_5.
|
|
1073
|
+
const _mod_5 = await import('./ClientManager-ChcmUL47.js');
|
|
1074
|
+
const _ns_5 = _mod_5.ao;
|
|
1075
1075
|
const internalSchema = _ns_5;
|
|
1076
1076
|
const schemaFile = internalSchema.default;
|
|
1077
1077
|
logger$d(`Found seed-protocol schema in internal file (schemaData missing, using internal schema)`);
|
|
@@ -1181,8 +1181,8 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1181
1181
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
1182
1182
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
1183
1183
|
try {
|
|
1184
|
-
const _mod_6 = await import('./ClientManager-
|
|
1185
|
-
const _ns_6 = _mod_6.
|
|
1184
|
+
const _mod_6 = await import('./ClientManager-ChcmUL47.js');
|
|
1185
|
+
const _ns_6 = _mod_6.ao;
|
|
1186
1186
|
const internalSchema = _ns_6;
|
|
1187
1187
|
const internalSchemaFile = internalSchema.default;
|
|
1188
1188
|
mergedModels = { ...(internalSchemaFile.models || {}) };
|
|
@@ -1821,7 +1821,7 @@ const addModelsMachine = setup({
|
|
|
1821
1821
|
jsonProp.model = schemaProp.refModelName || schemaProp.ref;
|
|
1822
1822
|
}
|
|
1823
1823
|
// Handle List type
|
|
1824
|
-
if (schemaProp.dataType
|
|
1824
|
+
if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && schemaProp.refValueType) {
|
|
1825
1825
|
jsonProp.refValueType = schemaProp.refValueType;
|
|
1826
1826
|
if (schemaProp.ref || schemaProp.refModelName) {
|
|
1827
1827
|
jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
|
|
@@ -2084,7 +2084,7 @@ const createModelInstances$1 = async (modelIds) => {
|
|
|
2084
2084
|
return;
|
|
2085
2085
|
}
|
|
2086
2086
|
try {
|
|
2087
|
-
const _mod_7 = await import('./index-
|
|
2087
|
+
const _mod_7 = await import('./index-HRHkbVQd.js');
|
|
2088
2088
|
const _ns_7 = _mod_7.b;
|
|
2089
2089
|
const mod = _ns_7;
|
|
2090
2090
|
const Model = mod?.Model ?? mod?.default;
|
|
@@ -2131,8 +2131,8 @@ const checkExistingSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2131
2131
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
2132
2132
|
// For Seed Protocol, check if it exists in database
|
|
2133
2133
|
try {
|
|
2134
|
-
const _mod_8 = await import('./ClientManager-
|
|
2135
|
-
const _ns_8 = _mod_8.
|
|
2134
|
+
const _mod_8 = await import('./ClientManager-ChcmUL47.js');
|
|
2135
|
+
const _ns_8 = _mod_8.ao;
|
|
2136
2136
|
const internalSchema = _ns_8;
|
|
2137
2137
|
const schemaFile = internalSchema.default;
|
|
2138
2138
|
if (db && schemaFile.id) {
|
|
@@ -2491,8 +2491,8 @@ const writeSchemaToDb = fromCallback(({ sendBack, input }) => {
|
|
|
2491
2491
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
2492
2492
|
// For Seed Protocol, load from internal file
|
|
2493
2493
|
logger$b(`Loading internal Seed Protocol schema from SDK`);
|
|
2494
|
-
const _mod_9 = await import('./ClientManager-
|
|
2495
|
-
const _ns_9 = _mod_9.
|
|
2494
|
+
const _mod_9 = await import('./ClientManager-ChcmUL47.js');
|
|
2495
|
+
const _ns_9 = _mod_9.ao;
|
|
2496
2496
|
const internalSchema = _ns_9;
|
|
2497
2497
|
finalSchema = internalSchema.default;
|
|
2498
2498
|
const db = BaseDb.getAppDb();
|
|
@@ -2759,7 +2759,7 @@ const writeModelsToDb = fromCallback(({ sendBack, input }) => {
|
|
|
2759
2759
|
jsonProp.model = schemaProp.refModelName || schemaProp.ref;
|
|
2760
2760
|
}
|
|
2761
2761
|
// Handle List type
|
|
2762
|
-
if (schemaProp.dataType
|
|
2762
|
+
if (isDataType(schemaProp.dataType, ModelPropertyDataTypes.List) && schemaProp.refValueType) {
|
|
2763
2763
|
jsonProp.refValueType = schemaProp.refValueType;
|
|
2764
2764
|
if (schemaProp.ref || schemaProp.refModelName) {
|
|
2765
2765
|
jsonProp.ref = schemaProp.refModelName || schemaProp.ref;
|
|
@@ -2961,7 +2961,7 @@ const createModelInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2961
2961
|
return;
|
|
2962
2962
|
}
|
|
2963
2963
|
try {
|
|
2964
|
-
const _mod_10 = await import('./index-
|
|
2964
|
+
const _mod_10 = await import('./index-HRHkbVQd.js');
|
|
2965
2965
|
const _ns_10 = _mod_10.b;
|
|
2966
2966
|
const modelMod = _ns_10;
|
|
2967
2967
|
const { Model } = modelMod;
|
|
@@ -3049,7 +3049,7 @@ const verifyModelInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
3049
3049
|
}
|
|
3050
3050
|
try {
|
|
3051
3051
|
const result = await verifyWithRetry$2(async () => {
|
|
3052
|
-
const _mod_11 = await import('./index-
|
|
3052
|
+
const _mod_11 = await import('./index-HRHkbVQd.js');
|
|
3053
3053
|
const _ns_11 = _mod_11.b;
|
|
3054
3054
|
const modelMod = _ns_11;
|
|
3055
3055
|
const { Model } = modelMod;
|
|
@@ -3108,7 +3108,7 @@ const writePropertiesToDb = fromCallback(({ sendBack, input }) => {
|
|
|
3108
3108
|
const _write = async () => {
|
|
3109
3109
|
const { modelIds } = input;
|
|
3110
3110
|
try {
|
|
3111
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
3111
|
+
const _mod_12 = await import('./BasePathResolver-B6CKqoKw.js');
|
|
3112
3112
|
const _ns_12 = _mod_12.M;
|
|
3113
3113
|
const modelSchemaMod = _ns_12;
|
|
3114
3114
|
const { models: modelsTable, properties: propertiesTable } = modelSchemaMod;
|
|
@@ -3298,9 +3298,9 @@ const createPropertyInstances = fromCallback(({ sendBack, input }) => {
|
|
|
3298
3298
|
return;
|
|
3299
3299
|
}
|
|
3300
3300
|
try {
|
|
3301
|
-
const modProp = await import('./ModelProperty-
|
|
3301
|
+
const modProp = await import('./ModelProperty-D79uV42p.js');
|
|
3302
3302
|
const ModelProperty = modProp?.ModelProperty ?? modProp?.default;
|
|
3303
|
-
const _mod_13 = await import('./index-
|
|
3303
|
+
const _mod_13 = await import('./index-HRHkbVQd.js');
|
|
3304
3304
|
const _ns_13 = _mod_13.b;
|
|
3305
3305
|
const modModel = _ns_13;
|
|
3306
3306
|
const Model = modModel?.Model ?? modModel?.default;
|
|
@@ -3407,7 +3407,7 @@ const verifyPropertyInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
3407
3407
|
}
|
|
3408
3408
|
try {
|
|
3409
3409
|
const result = await verifyWithRetry(async () => {
|
|
3410
|
-
const mod = await import('./ModelProperty-
|
|
3410
|
+
const mod = await import('./ModelProperty-D79uV42p.js');
|
|
3411
3411
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
3412
3412
|
if (!ModelProperty) {
|
|
3413
3413
|
throw new Error('ModelProperty not available from dynamic import');
|
|
@@ -4300,7 +4300,7 @@ async function updateModelProperties(schemaName, propertyUpdates, modelUpdates)
|
|
|
4300
4300
|
if (property.model === modelUpdate.oldName) {
|
|
4301
4301
|
property.model = modelUpdate.newName;
|
|
4302
4302
|
}
|
|
4303
|
-
if (property.ref === modelUpdate.oldName && (property.type
|
|
4303
|
+
if (property.ref === modelUpdate.oldName && (isDataType(property.type, ModelPropertyDataTypes.List) || isDataType(property.dataType, ModelPropertyDataTypes.List))) {
|
|
4304
4304
|
property.ref = modelUpdate.newName;
|
|
4305
4305
|
}
|
|
4306
4306
|
// Legacy: items.model
|
|
@@ -4429,8 +4429,8 @@ async function loadSchemaWithRenames(schemaFilePath, modelRenames) {
|
|
|
4429
4429
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
4430
4430
|
};
|
|
4431
4431
|
// Use dynamic import to break circular dependency
|
|
4432
|
-
const _mod_14 = await import('./db-
|
|
4433
|
-
const _ns_14 = _mod_14.
|
|
4432
|
+
const _mod_14 = await import('./db-WbrzEf7c.js');
|
|
4433
|
+
const _ns_14 = _mod_14.Q;
|
|
4434
4434
|
const dbMod = _ns_14;
|
|
4435
4435
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
4436
4436
|
// Add schema to database with schemaFileId
|
|
@@ -4542,8 +4542,8 @@ async function renameModelProperty(schemaName, modelName, oldPropertyName, newPr
|
|
|
4542
4542
|
await BaseFileManager.waitForFileWithContent(newFilePath);
|
|
4543
4543
|
logger$1(`Renamed property ${oldPropertyName} to ${newPropertyName} in schema ${schemaName} v${newVersion}`);
|
|
4544
4544
|
// Migrate metadata rows so ItemProperty values follow the new name (prevents duplicate ItemProperties)
|
|
4545
|
-
const _mod_15 = await import('./db-
|
|
4546
|
-
const _ns_15 = _mod_15.
|
|
4545
|
+
const _mod_15 = await import('./db-WbrzEf7c.js');
|
|
4546
|
+
const _ns_15 = _mod_15.Q;
|
|
4547
4547
|
const { migrateMetadataForPropertyRename } = _ns_15;
|
|
4548
4548
|
const migratedCount = await migrateMetadataForPropertyRename(modelName, oldPropertyName, newPropertyName, oldProperty.id);
|
|
4549
4549
|
if (migratedCount > 0) {
|
|
@@ -4644,7 +4644,7 @@ async function deleteModelFromSchema(schemaName, modelName, options = {}) {
|
|
|
4644
4644
|
if (property.model === modelName) {
|
|
4645
4645
|
delete property.model;
|
|
4646
4646
|
}
|
|
4647
|
-
if (property.ref === modelName && (property.type
|
|
4647
|
+
if (property.ref === modelName && (isDataType(property.type, ModelPropertyDataTypes.List) || isDataType(property.dataType, ModelPropertyDataTypes.List))) {
|
|
4648
4648
|
delete property.ref;
|
|
4649
4649
|
}
|
|
4650
4650
|
if (property.items?.model === modelName) {
|
|
@@ -5753,7 +5753,7 @@ class Schema {
|
|
|
5753
5753
|
_dbVersion: publishedSchema.version,
|
|
5754
5754
|
});
|
|
5755
5755
|
// Clear edited flags on all ModelProperty instances and in database
|
|
5756
|
-
const modelPropertyMod = await import('./ModelProperty-
|
|
5756
|
+
const modelPropertyMod = await import('./ModelProperty-D79uV42p.js');
|
|
5757
5757
|
const { ModelProperty } = modelPropertyMod;
|
|
5758
5758
|
for (const propertyKey of context._editedProperties) {
|
|
5759
5759
|
const [modelName, propertyName] = propertyKey.split(':');
|
|
@@ -6556,4 +6556,4 @@ var Schema$1 = /*#__PURE__*/Object.freeze({
|
|
|
6556
6556
|
});
|
|
6557
6557
|
|
|
6558
6558
|
export { Schema as S, deletePropertyFromModel as a, Schema$1 as b, deleteModelFromSchema as d, renameModelProperty as r, schemaMachine as s, updateModelProperties as u };
|
|
6559
|
-
//# sourceMappingURL=Schema-
|
|
6559
|
+
//# sourceMappingURL=Schema-a8uO-hIZ.js.map
|