@seedprotocol/sdk 0.7.5-next.850.g9ab585b → 0.7.5
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-CsZHPrk9.js → BasePathResolver-CBTXCMFL.js} +20 -6
- package/dist/BasePathResolver-CBTXCMFL.js.map +1 -0
- package/dist/{ClientManager-DETTj0_z.js → ClientManager-DRf4uuei.js} +348 -222
- package/dist/ClientManager-DRf4uuei.js.map +1 -0
- package/dist/{Item-TMrVEPeX.js → Item-DTJPMjFk.js} +241 -157
- package/dist/Item-DTJPMjFk.js.map +1 -0
- package/dist/{ModelProperty-Bw6N8OMK.js → ModelProperty-Dto5C0om.js} +66 -31
- package/dist/ModelProperty-Dto5C0om.js.map +1 -0
- package/dist/{Schema-VLenyJDy.js → Schema-8DxGcORY.js} +39 -37
- package/dist/{Schema-VLenyJDy.js.map → Schema-8DxGcORY.js.map} +1 -1
- package/dist/{SchemaValidationService-CLGadxgf.js → SchemaValidationService-CE92y1TT.js} +6 -6
- package/dist/{SchemaValidationService-CLGadxgf.js.map → SchemaValidationService-CE92y1TT.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-C8fSvzy2.js → backfillMetadataPropertyIds-CRqp-BqX.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-C8fSvzy2.js.map → backfillMetadataPropertyIds-CRqp-BqX.js.map} +1 -1
- package/dist/{configurePlatform-C3E0BS3u.js → configurePlatform-D4aGjKNk.js} +2 -2
- package/dist/{configurePlatform-C3E0BS3u.js.map → configurePlatform-D4aGjKNk.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-D1gTseFW.js → detachRowsBeforeDelete-BVetHtn2.js} +2 -2
- package/dist/{detachRowsBeforeDelete-D1gTseFW.js.map → detachRowsBeforeDelete-BVetHtn2.js.map} +1 -1
- package/dist/discardNewDraft-CEOouygG.js +78 -0
- package/dist/discardNewDraft-CEOouygG.js.map +1 -0
- package/dist/{eas-A82zVNQ9.js → eas-D7jvWMnI.js} +3 -3
- package/dist/{eas-A82zVNQ9.js.map → eas-D7jvWMnI.js.map} +1 -1
- package/dist/{errors-CWKup8tw.js → errors-CIrbsN_i.js} +46 -39
- package/dist/errors-CIrbsN_i.js.map +1 -0
- package/dist/{getItem-ChieGxJV.js → getItem-CxU_kT5W.js} +4 -4
- package/dist/{getItem-ChieGxJV.js.map → getItem-CxU_kT5W.js.map} +1 -1
- package/dist/{getPublishPayload-CWfjl8PM.js → getPublishPayload-DTjOKd3y.js} +13 -13
- package/dist/{getPublishPayload-CWfjl8PM.js.map → getPublishPayload-DTjOKd3y.js.map} +1 -1
- package/dist/{getPublishUploads-cLbSEXLk.js → getPublishUploads-CVTBo_OV.js} +506 -45
- package/dist/getPublishUploads-CVTBo_OV.js.map +1 -0
- package/dist/{index-CXkcz4hT.js → index-CMxEil8T.js} +8 -8
- package/dist/index-CMxEil8T.js.map +1 -0
- package/dist/{index-CURf9L4d.js → index-DWK-LOUY.js} +2 -2
- package/dist/index-DWK-LOUY.js.map +1 -0
- package/dist/{index.browser-47W0fJPw.js → index.browser-shRXMeB3.js} +11 -11
- package/dist/{index.browser-47W0fJPw.js.map → index.browser-shRXMeB3.js.map} +1 -1
- package/dist/{index.node-BiQhZQvH.js → index.node-DAKJNYp5.js} +20 -6
- package/dist/index.node-DAKJNYp5.js.map +1 -0
- package/dist/main.js +89 -504
- package/dist/main.js.map +1 -1
- package/dist/{mimeTypes-DHAHC4eZ.js → mimeTypes-C9r76DCH.js} +7 -2
- package/dist/{mimeTypes-DHAHC4eZ.js.map → mimeTypes-C9r76DCH.js.map} +1 -1
- package/dist/node.js +10 -10
- package/dist/platform.browser.js +6 -6
- package/dist/platform.node.js +4 -4
- package/dist/{property-tgPI5hMu.js → property-lz9yIpyA.js} +6 -6
- package/dist/{property-tgPI5hMu.js.map → property-lz9yIpyA.js.map} +1 -1
- package/dist/{propertyValidationRules-BLVxTejW.js → propertyValidationRules-LuIwoQoJ.js} +6 -6
- package/dist/{propertyValidationRules-BLVxTejW.js.map → propertyValidationRules-LuIwoQoJ.js.map} +1 -1
- package/dist/{publishDraftGraph-FAfecR_4.js → publishDraftGraph-CgSLPKvQ.js} +6 -6
- package/dist/{publishDraftGraph-FAfecR_4.js.map → publishDraftGraph-CgSLPKvQ.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-kz2PYdZi.js → resetAmbiguousLegacyItemData-CuamkAAh.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-kz2PYdZi.js.map → resetAmbiguousLegacyItemData-CuamkAAh.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-Dm1E4ebt.js → resolveModelForSyncedSeed-BbSctSvz.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-Dm1E4ebt.js.map → resolveModelForSyncedSeed-BbSctSvz.js.map} +1 -1
- package/dist/src/Item/Item.d.ts +9 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/errors.d.ts +3 -1
- package/dist/src/Item/errors.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/service/actors/createModelProperties.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +17 -0
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +2 -2
- 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/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/db/alignRowPublishers.d.ts +25 -0
- package/dist/src/db/alignRowPublishers.d.ts.map +1 -0
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getSchemaUidForModel.d.ts.map +1 -1
- package/dist/src/db/read/getSeedPublisher.d.ts +7 -0
- package/dist/src/db/read/getSeedPublisher.d.ts.map +1 -0
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +5 -3
- package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +1 -1
- package/dist/src/db/write/claimUnpublishedDrafts.d.ts +4 -2
- package/dist/src/db/write/claimUnpublishedDrafts.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/createNewItem.d.ts.map +1 -1
- package/dist/src/db/write/createSeed.d.ts.map +1 -1
- package/dist/src/db/write/createVersion.d.ts.map +1 -1
- package/dist/src/db/write/discardNewDraft.d.ts +8 -0
- package/dist/src/db/write/discardNewDraft.d.ts.map +1 -0
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts +18 -0
- package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +1 -0
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +13 -2
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
- package/dist/src/helpers/ownership.d.ts +9 -12
- package/dist/src/helpers/ownership.d.ts.map +1 -1
- package/dist/src/helpers/publishConfig.d.ts +9 -4
- package/dist/src/helpers/publishConfig.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CMCAihFh.js → syncDbWithEas-CrAY9Rl2.js} +13 -13
- package/dist/{syncDbWithEas-CMCAihFh.js.map → syncDbWithEas-CrAY9Rl2.js.map} +1 -1
- package/dist/{tabEvents-BEAmMncP.js → tabEvents-BGBYV65P.js} +4 -4
- package/dist/{tabEvents-BEAmMncP.js.map → tabEvents-BGBYV65P.js.map} +1 -1
- package/dist/{tolerantWebAccess-CqiDGEyR.js → tolerantWebAccess-DVHCEulL.js} +7 -7
- package/dist/{tolerantWebAccess-CqiDGEyR.js.map → tolerantWebAccess-DVHCEulL.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-Bw3uEStt.js → updateSeedRevokedAt-Dy5J8CfQ.js} +3 -3
- package/dist/{updateSeedRevokedAt-Bw3uEStt.js.map → updateSeedRevokedAt-Dy5J8CfQ.js.map} +1 -1
- package/package.json +5 -5
- package/dist/BasePathResolver-CsZHPrk9.js.map +0 -1
- package/dist/ClientManager-DETTj0_z.js.map +0 -1
- package/dist/Item-TMrVEPeX.js.map +0 -1
- package/dist/ModelProperty-Bw6N8OMK.js.map +0 -1
- package/dist/errors-CWKup8tw.js.map +0 -1
- package/dist/getPublishUploads-cLbSEXLk.js.map +0 -1
- package/dist/index-CURf9L4d.js.map +0 -1
- package/dist/index-CXkcz4hT.js.map +0 -1
- package/dist/index.node-BiQhZQvH.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import { av as SEED_PROTOCOL_SCHEMA_NAME,
|
|
3
|
-
import { g as getRefValueType,
|
|
2
|
+
import { av as SEED_PROTOCOL_SCHEMA_NAME, B as BaseDb, A as schemas, aN as addSchemaToDb, i as isDataType, M as ModelPropertyDataTypes, al as generateId, O as addModelsToDb, t as models, r as modelSchemas, v as properties, h as BaseFileManager, aQ as loadModelsFromDbForSchema, aK as isInternalSchema, aR as clearNameMatchLevels } from './BasePathResolver-CBTXCMFL.js';
|
|
3
|
+
import { g as getRefValueType, J as createModelsFromJson, q as listCompleteSchemaFiles, K as getLatestSchemaVersion, l as loadSchemaFromFile, L as jsonPropertiesToSchemaProperties, u as loadAllSchemasFromDb, m as getClient } from './ClientManager-DRf4uuei.js';
|
|
4
4
|
import { eq, desc, and } from 'drizzle-orm';
|
|
5
5
|
import debug from 'debug';
|
|
6
|
-
import { c as currentEvictionEpoch, w as writeProcessMachine, t as trackDraftSave, M as Model, g as getDraftSaveError, C as ConflictError, r as recordSchemaDestroy, f as finishSchemaDestroy, d as setupEntityLiveQuery } from './errors-
|
|
6
|
+
import { c as currentEvictionEpoch, w as writeProcessMachine, t as trackDraftSave, M as Model, g as getDraftSaveError, C as ConflictError, r as recordSchemaDestroy, f as finishSchemaDestroy, d as setupEntityLiveQuery } from './errors-CIrbsN_i.js';
|
|
7
7
|
import 'pluralize';
|
|
8
8
|
import '@seedprotocol/eas';
|
|
9
|
-
import { SchemaValidationService } from './SchemaValidationService-
|
|
10
|
-
import { D as DEFAULT_READY_TIMEOUT_MS,
|
|
9
|
+
import { SchemaValidationService } from './SchemaValidationService-CE92y1TT.js';
|
|
10
|
+
import { D as DEFAULT_READY_TIMEOUT_MS, d as waitForEntityIdle, m as createReactiveProxy, n as findEntity, C as ClientManagerState, _ as clearDestroySubscriptions, o as forceRemoveFromCaches, $ as unloadEntity, q as runDestroyLifecycle } from './Item-DTJPMjFk.js';
|
|
11
11
|
|
|
12
12
|
const logger$d = debug('seedSdk:schema:actors:loadOrCreateSchema');
|
|
13
13
|
/**
|
|
@@ -51,7 +51,7 @@ const createModelInstances$2 = async (modelIds, evictionEpoch) => {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
const _mod_0 = await import('./errors-
|
|
54
|
+
const _mod_0 = await import('./errors-CIrbsN_i.js');
|
|
55
55
|
const _ns_0 = _mod_0.h;
|
|
56
56
|
const modelMod = _ns_0;
|
|
57
57
|
const { Model } = modelMod;
|
|
@@ -168,7 +168,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
168
168
|
// For Seed Protocol, always load from internal file, never create new
|
|
169
169
|
logger$d(`Loading internal Seed Protocol schema from SDK`);
|
|
170
170
|
try {
|
|
171
|
-
const _mod_1 = await import('./ClientManager-
|
|
171
|
+
const _mod_1 = await import('./ClientManager-DRf4uuei.js');
|
|
172
172
|
const _ns_1 = _mod_1.S;
|
|
173
173
|
const internalSchema = _ns_1;
|
|
174
174
|
const schemaFile = internalSchema.default;
|
|
@@ -663,7 +663,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
663
663
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
664
664
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
665
665
|
try {
|
|
666
|
-
const _mod_2 = await import('./ClientManager-
|
|
666
|
+
const _mod_2 = await import('./ClientManager-DRf4uuei.js');
|
|
667
667
|
const _ns_2 = _mod_2.S;
|
|
668
668
|
const internalSchema = _ns_2;
|
|
669
669
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -894,7 +894,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
894
894
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
895
895
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
896
896
|
try {
|
|
897
|
-
const _mod_3 = await import('./ClientManager-
|
|
897
|
+
const _mod_3 = await import('./ClientManager-DRf4uuei.js');
|
|
898
898
|
const _ns_3 = _mod_3.S;
|
|
899
899
|
const internalSchema = _ns_3;
|
|
900
900
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -985,7 +985,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
985
985
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
986
986
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
987
987
|
try {
|
|
988
|
-
const _mod_4 = await import('./ClientManager-
|
|
988
|
+
const _mod_4 = await import('./ClientManager-DRf4uuei.js');
|
|
989
989
|
const _ns_4 = _mod_4.S;
|
|
990
990
|
const internalSchema = _ns_4;
|
|
991
991
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -1073,7 +1073,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1073
1073
|
// If schemaData is missing, try to load from internal schema file for seed-protocol
|
|
1074
1074
|
if (!dbSchema.schemaData && schemaName === 'Seed Protocol') {
|
|
1075
1075
|
try {
|
|
1076
|
-
const _mod_5 = await import('./ClientManager-
|
|
1076
|
+
const _mod_5 = await import('./ClientManager-DRf4uuei.js');
|
|
1077
1077
|
const _ns_5 = _mod_5.S;
|
|
1078
1078
|
const internalSchema = _ns_5;
|
|
1079
1079
|
const schemaFile = internalSchema.default;
|
|
@@ -1184,7 +1184,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1184
1184
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
1185
1185
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
1186
1186
|
try {
|
|
1187
|
-
const _mod_6 = await import('./ClientManager-
|
|
1187
|
+
const _mod_6 = await import('./ClientManager-DRf4uuei.js');
|
|
1188
1188
|
const _ns_6 = _mod_6.S;
|
|
1189
1189
|
const internalSchema = _ns_6;
|
|
1190
1190
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -1511,7 +1511,7 @@ const createModelInstances$1 = async (modelIds, evictionEpoch) => {
|
|
|
1511
1511
|
return;
|
|
1512
1512
|
}
|
|
1513
1513
|
try {
|
|
1514
|
-
const _mod_7 = await import('./errors-
|
|
1514
|
+
const _mod_7 = await import('./errors-CIrbsN_i.js');
|
|
1515
1515
|
const _ns_7 = _mod_7.h;
|
|
1516
1516
|
const mod = _ns_7;
|
|
1517
1517
|
const Model = mod?.Model ?? mod?.default;
|
|
@@ -1560,7 +1560,7 @@ const checkExistingSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1560
1560
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
1561
1561
|
// For Seed Protocol, check if it exists in database
|
|
1562
1562
|
try {
|
|
1563
|
-
const _mod_8 = await import('./ClientManager-
|
|
1563
|
+
const _mod_8 = await import('./ClientManager-DRf4uuei.js');
|
|
1564
1564
|
const _ns_8 = _mod_8.S;
|
|
1565
1565
|
const internalSchema = _ns_8;
|
|
1566
1566
|
const schemaFile = internalSchema.default;
|
|
@@ -1922,7 +1922,7 @@ const writeSchemaToDb = fromCallback(({ sendBack, input }) => {
|
|
|
1922
1922
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
1923
1923
|
// For Seed Protocol, load from internal file
|
|
1924
1924
|
logger$b(`Loading internal Seed Protocol schema from SDK`);
|
|
1925
|
-
const _mod_9 = await import('./ClientManager-
|
|
1925
|
+
const _mod_9 = await import('./ClientManager-DRf4uuei.js');
|
|
1926
1926
|
const _ns_9 = _mod_9.S;
|
|
1927
1927
|
const internalSchema = _ns_9;
|
|
1928
1928
|
finalSchema = internalSchema.default;
|
|
@@ -2393,7 +2393,7 @@ const createModelInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2393
2393
|
return;
|
|
2394
2394
|
}
|
|
2395
2395
|
try {
|
|
2396
|
-
const _mod_10 = await import('./errors-
|
|
2396
|
+
const _mod_10 = await import('./errors-CIrbsN_i.js');
|
|
2397
2397
|
const _ns_10 = _mod_10.h;
|
|
2398
2398
|
const modelMod = _ns_10;
|
|
2399
2399
|
const { Model } = modelMod;
|
|
@@ -2482,7 +2482,7 @@ const verifyModelInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
try {
|
|
2484
2484
|
const result = await verifyWithRetry$2(async () => {
|
|
2485
|
-
const _mod_11 = await import('./errors-
|
|
2485
|
+
const _mod_11 = await import('./errors-CIrbsN_i.js');
|
|
2486
2486
|
const _ns_11 = _mod_11.h;
|
|
2487
2487
|
const modelMod = _ns_11;
|
|
2488
2488
|
const { Model } = modelMod;
|
|
@@ -2541,7 +2541,7 @@ const writePropertiesToDb = fromCallback(({ sendBack, input }) => {
|
|
|
2541
2541
|
const _write = async () => {
|
|
2542
2542
|
const { modelIds } = input;
|
|
2543
2543
|
try {
|
|
2544
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
2544
|
+
const _mod_12 = await import('./BasePathResolver-CBTXCMFL.js');
|
|
2545
2545
|
const _ns_12 = _mod_12.bb;
|
|
2546
2546
|
const modelSchemaMod = _ns_12;
|
|
2547
2547
|
const { models: modelsTable, properties: propertiesTable } = modelSchemaMod;
|
|
@@ -2731,9 +2731,9 @@ const createPropertyInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2731
2731
|
return;
|
|
2732
2732
|
}
|
|
2733
2733
|
try {
|
|
2734
|
-
const modProp = await import('./ModelProperty-
|
|
2734
|
+
const modProp = await import('./ModelProperty-Dto5C0om.js');
|
|
2735
2735
|
const ModelProperty = modProp?.ModelProperty ?? modProp?.default;
|
|
2736
|
-
const _mod_13 = await import('./errors-
|
|
2736
|
+
const _mod_13 = await import('./errors-CIrbsN_i.js');
|
|
2737
2737
|
const _ns_13 = _mod_13.h;
|
|
2738
2738
|
const modModel = _ns_13;
|
|
2739
2739
|
const Model = modModel?.Model ?? modModel?.default;
|
|
@@ -2840,7 +2840,7 @@ const verifyPropertyInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
2840
2840
|
}
|
|
2841
2841
|
try {
|
|
2842
2842
|
const result = await verifyWithRetry(async () => {
|
|
2843
|
-
const mod = await import('./ModelProperty-
|
|
2843
|
+
const mod = await import('./ModelProperty-Dto5C0om.js');
|
|
2844
2844
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
2845
2845
|
if (!ModelProperty) {
|
|
2846
2846
|
throw new Error('ModelProperty not available from dynamic import');
|
|
@@ -3862,7 +3862,7 @@ async function loadSchemaWithRenames(schemaFilePath, modelRenames) {
|
|
|
3862
3862
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
3863
3863
|
};
|
|
3864
3864
|
// Use dynamic import to break circular dependency
|
|
3865
|
-
const _mod_14 = await import('./BasePathResolver-
|
|
3865
|
+
const _mod_14 = await import('./BasePathResolver-CBTXCMFL.js');
|
|
3866
3866
|
const _ns_14 = _mod_14.bg;
|
|
3867
3867
|
const dbMod = _ns_14;
|
|
3868
3868
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
@@ -3982,7 +3982,7 @@ async function renameModelProperty(schemaName, modelName, oldPropertyName, newPr
|
|
|
3982
3982
|
await BaseFileManager.waitForFileWithContent(newFilePath);
|
|
3983
3983
|
logger$1(`Renamed property ${oldPropertyName} to ${newPropertyName} in schema ${schemaName} v${newVersion}`);
|
|
3984
3984
|
// Migrate metadata rows so ItemProperty values follow the new name (prevents duplicate ItemProperties)
|
|
3985
|
-
const _mod_15 = await import('./BasePathResolver-
|
|
3985
|
+
const _mod_15 = await import('./BasePathResolver-CBTXCMFL.js');
|
|
3986
3986
|
const _ns_15 = _mod_15.bg;
|
|
3987
3987
|
const { migrateMetadataForPropertyRename } = _ns_15;
|
|
3988
3988
|
const migratedCount = await migrateMetadataForPropertyRename(modelName, oldPropertyName, newPropertyName, oldProperty.id, { schemaName });
|
|
@@ -4979,7 +4979,7 @@ class Schema {
|
|
|
4979
4979
|
const modelDbId = modelInstance.getService().getSnapshot().context._dbId;
|
|
4980
4980
|
const db = BaseDb.getAppDb();
|
|
4981
4981
|
if (propertyContexts.length === 0 && modelDbId && db) {
|
|
4982
|
-
const { ModelProperty } = await import('./ModelProperty-
|
|
4982
|
+
const { ModelProperty } = await import('./ModelProperty-Dto5C0om.js');
|
|
4983
4983
|
const rows = await db.select().from(properties).where(eq(properties.modelId, modelDbId));
|
|
4984
4984
|
propertyContexts = rows.map((row) => {
|
|
4985
4985
|
const cached = row.schemaFileId ? ModelProperty.getById(row.schemaFileId) : undefined;
|
|
@@ -5145,7 +5145,7 @@ class Schema {
|
|
|
5145
5145
|
savedSchema: publishedSchema,
|
|
5146
5146
|
});
|
|
5147
5147
|
// Clear edited flags on all ModelProperty instances and in database
|
|
5148
|
-
const modelPropertyMod = await import('./ModelProperty-
|
|
5148
|
+
const modelPropertyMod = await import('./ModelProperty-Dto5C0om.js');
|
|
5149
5149
|
const { ModelProperty } = modelPropertyMod;
|
|
5150
5150
|
for (const propertyKey of context._editedProperties) {
|
|
5151
5151
|
const [modelName, propertyName] = propertyKey.split(':');
|
|
@@ -5169,7 +5169,7 @@ class Schema {
|
|
|
5169
5169
|
try {
|
|
5170
5170
|
if (db && modelName && propertyName) {
|
|
5171
5171
|
// Find this schema's model by name
|
|
5172
|
-
const _mod_16 = await import('./BasePathResolver-
|
|
5172
|
+
const _mod_16 = await import('./BasePathResolver-CBTXCMFL.js');
|
|
5173
5173
|
const _ns_16 = _mod_16.bf;
|
|
5174
5174
|
const { resolveModelRecord } = _ns_16;
|
|
5175
5175
|
const modelRecord = await resolveModelRecord(modelName, { schemaName: thisSchemaName }, db);
|
|
@@ -5278,21 +5278,23 @@ class Schema {
|
|
|
5278
5278
|
this._service.send({ type: 'reloadFromDb' });
|
|
5279
5279
|
// Wait for reload to complete
|
|
5280
5280
|
return new Promise((resolve, reject) => {
|
|
5281
|
+
// Cleared once the reload settles: a pending timer kept Node scripts alive for 10 s.
|
|
5282
|
+
const timer = setTimeout(() => {
|
|
5283
|
+
subscription.unsubscribe();
|
|
5284
|
+
reject(new Error('Timeout waiting for schema reload'));
|
|
5285
|
+
}, 10000);
|
|
5281
5286
|
const subscription = this._service.subscribe((snapshot) => {
|
|
5282
5287
|
if (snapshot.value === 'idle') {
|
|
5288
|
+
clearTimeout(timer);
|
|
5283
5289
|
subscription.unsubscribe();
|
|
5284
5290
|
resolve();
|
|
5285
5291
|
}
|
|
5286
5292
|
else if (snapshot.value === 'error') {
|
|
5293
|
+
clearTimeout(timer);
|
|
5287
5294
|
subscription.unsubscribe();
|
|
5288
5295
|
reject(new Error('Failed to reload schema from database'));
|
|
5289
5296
|
}
|
|
5290
5297
|
});
|
|
5291
|
-
// Timeout after 10 seconds
|
|
5292
|
-
setTimeout(() => {
|
|
5293
|
-
subscription.unsubscribe();
|
|
5294
|
-
reject(new Error('Timeout waiting for schema reload'));
|
|
5295
|
-
}, 10000);
|
|
5296
5298
|
});
|
|
5297
5299
|
}
|
|
5298
5300
|
/**
|
|
@@ -5797,10 +5799,10 @@ class Schema {
|
|
|
5797
5799
|
// instances too, or a re-import would get them back with dangling _dbIds.
|
|
5798
5800
|
if (schemaName) {
|
|
5799
5801
|
const evictedModelNames = Model.evictForSchema(schemaName);
|
|
5800
|
-
const { ModelProperty } = await import('./ModelProperty-
|
|
5802
|
+
const { ModelProperty } = await import('./ModelProperty-Dto5C0om.js');
|
|
5801
5803
|
ModelProperty.evictForModels(evictedModelNames, schemaName);
|
|
5802
5804
|
// Evicting stops new writes but not ones already running; let those land before deleting their rows
|
|
5803
|
-
const _mod_17 = await import('./errors-
|
|
5805
|
+
const _mod_17 = await import('./errors-CIrbsN_i.js');
|
|
5804
5806
|
const _ns_17 = _mod_17.e;
|
|
5805
5807
|
const { waitForInFlightWrites } = _ns_17;
|
|
5806
5808
|
await waitForInFlightWrites();
|
|
@@ -5833,7 +5835,7 @@ class Schema {
|
|
|
5833
5835
|
.map((r) => r.modelId)
|
|
5834
5836
|
.filter((id) => id != null)),
|
|
5835
5837
|
];
|
|
5836
|
-
const { detachModelRows } = await import('./detachRowsBeforeDelete-
|
|
5838
|
+
const { detachModelRows } = await import('./detachRowsBeforeDelete-BVetHtn2.js');
|
|
5837
5839
|
await detachModelRows(db, modelIds);
|
|
5838
5840
|
await db.delete(modelSchemas).where(inArray(modelSchemas.schemaId, schemaIds));
|
|
5839
5841
|
for (const modelId of modelIds) {
|
|
@@ -5848,8 +5850,8 @@ class Schema {
|
|
|
5848
5850
|
// the destroyed schema back on the next Schema.all().
|
|
5849
5851
|
// Match on name as well as id: versions imported from complete schema files can each
|
|
5850
5852
|
// have their own id, and any version left behind would bring the schema back.
|
|
5851
|
-
const _mod_18 = await import('./ClientManager-
|
|
5852
|
-
const _ns_18 = _mod_18.
|
|
5853
|
+
const _mod_18 = await import('./ClientManager-DRf4uuei.js');
|
|
5854
|
+
const _ns_18 = _mod_18.M;
|
|
5853
5855
|
const { listCompleteSchemaFiles } = _ns_18;
|
|
5854
5856
|
const files = await listCompleteSchemaFiles().catch(() => []);
|
|
5855
5857
|
const fs = await BaseFileManager.getFs();
|
|
@@ -6044,4 +6046,4 @@ var Schema$1 = /*#__PURE__*/Object.freeze({
|
|
|
6044
6046
|
});
|
|
6045
6047
|
|
|
6046
6048
|
export { Schema as S, deletePropertyFromModel as a, Schema$1 as b, deleteModelFromSchema as d, renameModelProperty as r, schemaMachine as s, updateModelProperties as u };
|
|
6047
|
-
//# sourceMappingURL=Schema-
|
|
6049
|
+
//# sourceMappingURL=Schema-8DxGcORY.js.map
|