@seedprotocol/sdk 0.7.4-next.784.g879c6a3 → 0.7.4
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-DxdS0wJ0.js → BasePathResolver-DrzGVH9L.js} +232 -40
- package/dist/BasePathResolver-DrzGVH9L.js.map +1 -0
- package/dist/{ClientManager-De-vKHGe.js → ClientManager-Dfu4jcgm.js} +583 -219
- package/dist/ClientManager-Dfu4jcgm.js.map +1 -0
- package/dist/{Item-cq9VcsAY.js → Item-BUUFuywT.js} +175 -306
- package/dist/Item-BUUFuywT.js.map +1 -0
- package/dist/{ModelProperty-DuuoFXaC.js → ModelProperty-B6cnRvIz.js} +38 -39
- package/dist/ModelProperty-B6cnRvIz.js.map +1 -0
- package/dist/{Schema-Dc5EA8Yb.js → Schema-Bf-jOLq0.js} +37 -36
- package/dist/{Schema-Dc5EA8Yb.js.map → Schema-Bf-jOLq0.js.map} +1 -1
- package/dist/{SchemaValidationService-DViJ056F.js → SchemaValidationService-BNYMacsx.js} +7 -8
- package/dist/{SchemaValidationService-DViJ056F.js.map → SchemaValidationService-BNYMacsx.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-DacVthS5.js → backfillMetadataPropertyIds-C2-s_jUa.js} +4 -5
- package/dist/{backfillMetadataPropertyIds-DacVthS5.js.map → backfillMetadataPropertyIds-C2-s_jUa.js.map} +1 -1
- package/dist/{configurePlatform-DlZ23w7e.js → configurePlatform-BzfirKuM.js} +3 -4
- package/dist/{configurePlatform-DlZ23w7e.js.map → configurePlatform-BzfirKuM.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-YRSZY6dO.js → detachRowsBeforeDelete-B0Daoz9Z.js} +3 -4
- package/dist/{detachRowsBeforeDelete-YRSZY6dO.js.map → detachRowsBeforeDelete-B0Daoz9Z.js.map} +1 -1
- package/dist/{eas-D_6ptL_F.js → eas-Dq5Kx_Nd.js} +14 -32
- package/dist/eas-Dq5Kx_Nd.js.map +1 -0
- package/dist/{errors-Cl8rbtKR.js → errors-DdWbxb_n.js} +42 -39
- package/dist/errors-DdWbxb_n.js.map +1 -0
- package/dist/{getItem-BcmJcUZB.js → getItem-9bYSErSj.js} +4 -5
- package/dist/{getItem-BcmJcUZB.js.map → getItem-9bYSErSj.js.map} +1 -1
- package/dist/{getPublishPayload-C278kK9P.js → getPublishPayload-DPy-uMrR.js} +28 -29
- package/dist/getPublishPayload-DPy-uMrR.js.map +1 -0
- package/dist/{getPublishUploads-DJ1UPh7i.js → getPublishUploads-J-143iSV.js} +10 -11
- package/dist/{getPublishUploads-DJ1UPh7i.js.map → getPublishUploads-J-143iSV.js.map} +1 -1
- package/dist/{index-DAl9U4rn.js → index-7y2f_iQz.js} +2 -2
- package/dist/index-7y2f_iQz.js.map +1 -0
- package/dist/{index-CqnU-5i0.js → index-C61Rxy0F.js} +9 -10
- package/dist/index-C61Rxy0F.js.map +1 -0
- package/dist/{index.browser-J6QZ9smP.js → index.browser-C1pisOEa.js} +10 -10
- package/dist/{index.browser-J6QZ9smP.js.map → index.browser-C1pisOEa.js.map} +1 -1
- package/dist/{index.node-C9VB9NlX.js → index.node-BAlST8pD.js} +6 -6
- package/dist/{index.node-C9VB9NlX.js.map → index.node-BAlST8pD.js.map} +1 -1
- package/dist/main.js +27 -28
- package/dist/main.js.map +1 -1
- package/dist/node.js +12 -13
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +6 -7
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +5 -6
- package/dist/platform.node.js.map +1 -1
- package/dist/{property-Brgr5RdT.js → property-zFPMtR3T.js} +10 -14
- package/dist/property-zFPMtR3T.js.map +1 -0
- package/dist/{propertyValidationRules-CDRitiiK.js → propertyValidationRules-CeFVhdQg.js} +10 -10
- package/dist/{propertyValidationRules-CDRitiiK.js.map → propertyValidationRules-CeFVhdQg.js.map} +1 -1
- package/dist/{publishDraftGraph-C37ibxb5.js → publishDraftGraph-CuVq6iAR.js} +7 -6
- package/dist/{publishDraftGraph-C37ibxb5.js.map → publishDraftGraph-CuVq6iAR.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-CcLFRREE.js → resetAmbiguousLegacyItemData-DsFTnMBz.js} +5 -6
- package/dist/resetAmbiguousLegacyItemData-DsFTnMBz.js.map +1 -0
- package/dist/{resolveModelForSyncedSeed-BTAeCOJE.js → resolveModelForSyncedSeed-RUsgAZXG.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-BTAeCOJE.js.map → resolveModelForSyncedSeed-RUsgAZXG.js.map} +1 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +4 -4
- package/dist/src/Model/Model.d.ts +3 -2
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +2 -2
- package/dist/src/client/ClientManager.d.ts +6 -6
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +2 -2
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/db/canonicalizeModelTypes.d.ts +18 -0
- package/dist/src/db/canonicalizeModelTypes.d.ts.map +1 -0
- package/dist/src/db/read/getModelSchemas.d.ts +6 -0
- package/dist/src/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getSchemaUidForModel.d.ts +6 -0
- package/dist/src/db/read/getSchemaUidForModel.d.ts.map +1 -1
- package/dist/src/db/read/resolveModelRecord.d.ts.map +1 -1
- package/dist/src/db/removeForeignAttestationRows.d.ts +27 -0
- package/dist/src/db/removeForeignAttestationRows.d.ts.map +1 -0
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/easSyncProcess.d.ts +9 -1
- package/dist/src/db/write/easSyncProcess.d.ts.map +1 -1
- package/dist/src/db/write/updateMetadata.d.ts.map +1 -1
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/item/easSyncManager.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +20 -0
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +3 -1
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/metadataPropertyNames.d.ts +12 -0
- package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
- package/dist/src/helpers/retryWhenOnline.d.ts +20 -0
- package/dist/src/helpers/retryWhenOnline.d.ts.map +1 -0
- package/dist/src/imports/json.d.ts +10 -0
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
- package/dist/src/types/import.d.ts +4 -0
- package/dist/src/types/import.d.ts.map +1 -1
- package/dist/{syncDbWithEas-B-Ho0IOB.js → syncDbWithEas-CRpnkq00.js} +157 -61
- package/dist/syncDbWithEas-CRpnkq00.js.map +1 -0
- package/dist/{tabEvents-BTzckWrN.js → tabEvents-nBUq_1u1.js} +6 -6
- package/dist/{tabEvents-BTzckWrN.js.map → tabEvents-nBUq_1u1.js.map} +1 -1
- package/dist/{tolerantWebAccess-DOm2Xv-f.js → tolerantWebAccess-DIt3R8_u.js} +7 -8
- package/dist/{tolerantWebAccess-DOm2Xv-f.js.map → tolerantWebAccess-DIt3R8_u.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-IHXnJI-i.js → updateSeedRevokedAt-DtTPSzpM.js} +3 -3
- package/dist/{updateSeedRevokedAt-IHXnJI-i.js.map → updateSeedRevokedAt-DtTPSzpM.js.map} +1 -1
- package/package.json +5 -5
- package/dist/BasePathResolver-DxdS0wJ0.js.map +0 -1
- package/dist/ClientManager-De-vKHGe.js.map +0 -1
- package/dist/Item-cq9VcsAY.js.map +0 -1
- package/dist/ModelProperty-DuuoFXaC.js.map +0 -1
- package/dist/eas-D_6ptL_F.js.map +0 -1
- package/dist/errors-Cl8rbtKR.js.map +0 -1
- package/dist/getPublishPayload-C278kK9P.js.map +0 -1
- package/dist/index-CqnU-5i0.js.map +0 -1
- package/dist/index-DAl9U4rn.js.map +0 -1
- package/dist/property-Brgr5RdT.js.map +0 -1
- package/dist/resetAmbiguousLegacyItemData-CcLFRREE.js.map +0 -1
- package/dist/syncDbWithEas-B-Ho0IOB.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import { g as getRefValueType,
|
|
3
|
-
import {
|
|
2
|
+
import { g as getRefValueType, H as createModelsFromJson, p as listCompleteSchemaFiles, J as getLatestSchemaVersion, l as loadSchemaFromFile, K as jsonPropertiesToSchemaProperties, q as loadAllSchemasFromDb, k as getClient } from './ClientManager-Dfu4jcgm.js';
|
|
3
|
+
import { at as SEED_PROTOCOL_SCHEMA_NAME, E as BaseDb, z as schemas, aL as addSchemaToDb, i as isDataType, M as ModelPropertyDataTypes, $ as generateId, a5 as addModelsToDb, s as models, q as modelSchemas, u as properties, J as BaseFileManager, aN as loadModelsFromDbForSchema, aI as isInternalSchema } from './BasePathResolver-DrzGVH9L.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-DdWbxb_n.js';
|
|
7
7
|
import 'pluralize';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import '@seedprotocol/eas';
|
|
9
|
+
import { SchemaValidationService } from './SchemaValidationService-BNYMacsx.js';
|
|
10
|
+
import { D as DEFAULT_READY_TIMEOUT_MS, l as waitForEntityIdle, m as createReactiveProxy, n as findEntity, C as ClientManagerState, _ as clearDestroySubscriptions, o as forceRemoveFromCaches, $ as unloadEntity, q as runDestroyLifecycle } from './Item-BUUFuywT.js';
|
|
10
11
|
|
|
11
12
|
const logger$d = debug('seedSdk:schema:actors:loadOrCreateSchema');
|
|
12
13
|
/**
|
|
@@ -50,7 +51,7 @@ const createModelInstances$2 = async (modelIds, evictionEpoch) => {
|
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
53
|
try {
|
|
53
|
-
const _mod_0 = await import('./errors-
|
|
54
|
+
const _mod_0 = await import('./errors-DdWbxb_n.js');
|
|
54
55
|
const _ns_0 = _mod_0.h;
|
|
55
56
|
const modelMod = _ns_0;
|
|
56
57
|
const { Model } = modelMod;
|
|
@@ -167,7 +168,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
167
168
|
// For Seed Protocol, always load from internal file, never create new
|
|
168
169
|
logger$d(`Loading internal Seed Protocol schema from SDK`);
|
|
169
170
|
try {
|
|
170
|
-
const _mod_1 = await import('./ClientManager-
|
|
171
|
+
const _mod_1 = await import('./ClientManager-Dfu4jcgm.js');
|
|
171
172
|
const _ns_1 = _mod_1.S;
|
|
172
173
|
const internalSchema = _ns_1;
|
|
173
174
|
const schemaFile = internalSchema.default;
|
|
@@ -662,7 +663,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
662
663
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
663
664
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
664
665
|
try {
|
|
665
|
-
const _mod_2 = await import('./ClientManager-
|
|
666
|
+
const _mod_2 = await import('./ClientManager-Dfu4jcgm.js');
|
|
666
667
|
const _ns_2 = _mod_2.S;
|
|
667
668
|
const internalSchema = _ns_2;
|
|
668
669
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -893,7 +894,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
893
894
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
894
895
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
895
896
|
try {
|
|
896
|
-
const _mod_3 = await import('./ClientManager-
|
|
897
|
+
const _mod_3 = await import('./ClientManager-Dfu4jcgm.js');
|
|
897
898
|
const _ns_3 = _mod_3.S;
|
|
898
899
|
const internalSchema = _ns_3;
|
|
899
900
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -984,7 +985,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
984
985
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
985
986
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
986
987
|
try {
|
|
987
|
-
const _mod_4 = await import('./ClientManager-
|
|
988
|
+
const _mod_4 = await import('./ClientManager-Dfu4jcgm.js');
|
|
988
989
|
const _ns_4 = _mod_4.S;
|
|
989
990
|
const internalSchema = _ns_4;
|
|
990
991
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -1072,7 +1073,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1072
1073
|
// If schemaData is missing, try to load from internal schema file for seed-protocol
|
|
1073
1074
|
if (!dbSchema.schemaData && schemaName === 'Seed Protocol') {
|
|
1074
1075
|
try {
|
|
1075
|
-
const _mod_5 = await import('./ClientManager-
|
|
1076
|
+
const _mod_5 = await import('./ClientManager-Dfu4jcgm.js');
|
|
1076
1077
|
const _ns_5 = _mod_5.S;
|
|
1077
1078
|
const internalSchema = _ns_5;
|
|
1078
1079
|
const schemaFile = internalSchema.default;
|
|
@@ -1183,7 +1184,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1183
1184
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
1184
1185
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
1185
1186
|
try {
|
|
1186
|
-
const _mod_6 = await import('./ClientManager-
|
|
1187
|
+
const _mod_6 = await import('./ClientManager-Dfu4jcgm.js');
|
|
1187
1188
|
const _ns_6 = _mod_6.S;
|
|
1188
1189
|
const internalSchema = _ns_6;
|
|
1189
1190
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -1510,7 +1511,7 @@ const createModelInstances$1 = async (modelIds, evictionEpoch) => {
|
|
|
1510
1511
|
return;
|
|
1511
1512
|
}
|
|
1512
1513
|
try {
|
|
1513
|
-
const _mod_7 = await import('./errors-
|
|
1514
|
+
const _mod_7 = await import('./errors-DdWbxb_n.js');
|
|
1514
1515
|
const _ns_7 = _mod_7.h;
|
|
1515
1516
|
const mod = _ns_7;
|
|
1516
1517
|
const Model = mod?.Model ?? mod?.default;
|
|
@@ -1559,7 +1560,7 @@ const checkExistingSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1559
1560
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
1560
1561
|
// For Seed Protocol, check if it exists in database
|
|
1561
1562
|
try {
|
|
1562
|
-
const _mod_8 = await import('./ClientManager-
|
|
1563
|
+
const _mod_8 = await import('./ClientManager-Dfu4jcgm.js');
|
|
1563
1564
|
const _ns_8 = _mod_8.S;
|
|
1564
1565
|
const internalSchema = _ns_8;
|
|
1565
1566
|
const schemaFile = internalSchema.default;
|
|
@@ -1921,7 +1922,7 @@ const writeSchemaToDb = fromCallback(({ sendBack, input }) => {
|
|
|
1921
1922
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
1922
1923
|
// For Seed Protocol, load from internal file
|
|
1923
1924
|
logger$b(`Loading internal Seed Protocol schema from SDK`);
|
|
1924
|
-
const _mod_9 = await import('./ClientManager-
|
|
1925
|
+
const _mod_9 = await import('./ClientManager-Dfu4jcgm.js');
|
|
1925
1926
|
const _ns_9 = _mod_9.S;
|
|
1926
1927
|
const internalSchema = _ns_9;
|
|
1927
1928
|
finalSchema = internalSchema.default;
|
|
@@ -2392,7 +2393,7 @@ const createModelInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2392
2393
|
return;
|
|
2393
2394
|
}
|
|
2394
2395
|
try {
|
|
2395
|
-
const _mod_10 = await import('./errors-
|
|
2396
|
+
const _mod_10 = await import('./errors-DdWbxb_n.js');
|
|
2396
2397
|
const _ns_10 = _mod_10.h;
|
|
2397
2398
|
const modelMod = _ns_10;
|
|
2398
2399
|
const { Model } = modelMod;
|
|
@@ -2481,7 +2482,7 @@ const verifyModelInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
2481
2482
|
}
|
|
2482
2483
|
try {
|
|
2483
2484
|
const result = await verifyWithRetry$2(async () => {
|
|
2484
|
-
const _mod_11 = await import('./errors-
|
|
2485
|
+
const _mod_11 = await import('./errors-DdWbxb_n.js');
|
|
2485
2486
|
const _ns_11 = _mod_11.h;
|
|
2486
2487
|
const modelMod = _ns_11;
|
|
2487
2488
|
const { Model } = modelMod;
|
|
@@ -2540,8 +2541,8 @@ const writePropertiesToDb = fromCallback(({ sendBack, input }) => {
|
|
|
2540
2541
|
const _write = async () => {
|
|
2541
2542
|
const { modelIds } = input;
|
|
2542
2543
|
try {
|
|
2543
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
2544
|
-
const _ns_12 = _mod_12.
|
|
2544
|
+
const _mod_12 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
2545
|
+
const _ns_12 = _mod_12.b6;
|
|
2545
2546
|
const modelSchemaMod = _ns_12;
|
|
2546
2547
|
const { models: modelsTable, properties: propertiesTable } = modelSchemaMod;
|
|
2547
2548
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2730,9 +2731,9 @@ const createPropertyInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2730
2731
|
return;
|
|
2731
2732
|
}
|
|
2732
2733
|
try {
|
|
2733
|
-
const modProp = await import('./ModelProperty-
|
|
2734
|
+
const modProp = await import('./ModelProperty-B6cnRvIz.js');
|
|
2734
2735
|
const ModelProperty = modProp?.ModelProperty ?? modProp?.default;
|
|
2735
|
-
const _mod_13 = await import('./errors-
|
|
2736
|
+
const _mod_13 = await import('./errors-DdWbxb_n.js');
|
|
2736
2737
|
const _ns_13 = _mod_13.h;
|
|
2737
2738
|
const modModel = _ns_13;
|
|
2738
2739
|
const Model = modModel?.Model ?? modModel?.default;
|
|
@@ -2839,7 +2840,7 @@ const verifyPropertyInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
2839
2840
|
}
|
|
2840
2841
|
try {
|
|
2841
2842
|
const result = await verifyWithRetry(async () => {
|
|
2842
|
-
const mod = await import('./ModelProperty-
|
|
2843
|
+
const mod = await import('./ModelProperty-B6cnRvIz.js');
|
|
2843
2844
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
2844
2845
|
if (!ModelProperty) {
|
|
2845
2846
|
throw new Error('ModelProperty not available from dynamic import');
|
|
@@ -3857,8 +3858,8 @@ async function loadSchemaWithRenames(schemaFilePath, modelRenames) {
|
|
|
3857
3858
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
3858
3859
|
};
|
|
3859
3860
|
// Use dynamic import to break circular dependency
|
|
3860
|
-
const _mod_14 = await import('./BasePathResolver-
|
|
3861
|
-
const _ns_14 = _mod_14.
|
|
3861
|
+
const _mod_14 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
3862
|
+
const _ns_14 = _mod_14.bb;
|
|
3862
3863
|
const dbMod = _ns_14;
|
|
3863
3864
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
3864
3865
|
// Add schema to database with schemaFileId
|
|
@@ -3977,8 +3978,8 @@ async function renameModelProperty(schemaName, modelName, oldPropertyName, newPr
|
|
|
3977
3978
|
await BaseFileManager.waitForFileWithContent(newFilePath);
|
|
3978
3979
|
logger$1(`Renamed property ${oldPropertyName} to ${newPropertyName} in schema ${schemaName} v${newVersion}`);
|
|
3979
3980
|
// Migrate metadata rows so ItemProperty values follow the new name (prevents duplicate ItemProperties)
|
|
3980
|
-
const _mod_15 = await import('./BasePathResolver-
|
|
3981
|
-
const _ns_15 = _mod_15.
|
|
3981
|
+
const _mod_15 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
3982
|
+
const _ns_15 = _mod_15.bb;
|
|
3982
3983
|
const { migrateMetadataForPropertyRename } = _ns_15;
|
|
3983
3984
|
const migratedCount = await migrateMetadataForPropertyRename(modelName, oldPropertyName, newPropertyName, oldProperty.id, { schemaName });
|
|
3984
3985
|
if (migratedCount > 0) {
|
|
@@ -4974,7 +4975,7 @@ class Schema {
|
|
|
4974
4975
|
const modelDbId = modelInstance.getService().getSnapshot().context._dbId;
|
|
4975
4976
|
const db = BaseDb.getAppDb();
|
|
4976
4977
|
if (propertyContexts.length === 0 && modelDbId && db) {
|
|
4977
|
-
const { ModelProperty } = await import('./ModelProperty-
|
|
4978
|
+
const { ModelProperty } = await import('./ModelProperty-B6cnRvIz.js');
|
|
4978
4979
|
const rows = await db.select().from(properties).where(eq(properties.modelId, modelDbId));
|
|
4979
4980
|
propertyContexts = rows.map((row) => {
|
|
4980
4981
|
const cached = row.schemaFileId ? ModelProperty.getById(row.schemaFileId) : undefined;
|
|
@@ -5127,7 +5128,7 @@ class Schema {
|
|
|
5127
5128
|
savedSchema: publishedSchema,
|
|
5128
5129
|
});
|
|
5129
5130
|
// Clear edited flags on all ModelProperty instances and in database
|
|
5130
|
-
const modelPropertyMod = await import('./ModelProperty-
|
|
5131
|
+
const modelPropertyMod = await import('./ModelProperty-B6cnRvIz.js');
|
|
5131
5132
|
const { ModelProperty } = modelPropertyMod;
|
|
5132
5133
|
for (const propertyKey of context._editedProperties) {
|
|
5133
5134
|
const [modelName, propertyName] = propertyKey.split(':');
|
|
@@ -5151,8 +5152,8 @@ class Schema {
|
|
|
5151
5152
|
try {
|
|
5152
5153
|
if (db && modelName && propertyName) {
|
|
5153
5154
|
// Find this schema's model by name
|
|
5154
|
-
const _mod_16 = await import('./BasePathResolver-
|
|
5155
|
-
const _ns_16 = _mod_16.
|
|
5155
|
+
const _mod_16 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
5156
|
+
const _ns_16 = _mod_16.ba;
|
|
5156
5157
|
const { resolveModelRecord } = _ns_16;
|
|
5157
5158
|
const modelRecord = await resolveModelRecord(modelName, { schemaName: thisSchemaName }, db);
|
|
5158
5159
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
@@ -5776,10 +5777,10 @@ class Schema {
|
|
|
5776
5777
|
// instances too, or a re-import would get them back with dangling _dbIds.
|
|
5777
5778
|
if (schemaName) {
|
|
5778
5779
|
const evictedModelNames = Model.evictForSchema(schemaName);
|
|
5779
|
-
const { ModelProperty } = await import('./ModelProperty-
|
|
5780
|
+
const { ModelProperty } = await import('./ModelProperty-B6cnRvIz.js');
|
|
5780
5781
|
ModelProperty.evictForModels(evictedModelNames, schemaName);
|
|
5781
5782
|
// Evicting stops new writes but not ones already running; let those land before deleting their rows
|
|
5782
|
-
const _mod_17 = await import('./errors-
|
|
5783
|
+
const _mod_17 = await import('./errors-DdWbxb_n.js');
|
|
5783
5784
|
const _ns_17 = _mod_17.e;
|
|
5784
5785
|
const { waitForInFlightWrites } = _ns_17;
|
|
5785
5786
|
await waitForInFlightWrites();
|
|
@@ -5812,7 +5813,7 @@ class Schema {
|
|
|
5812
5813
|
.map((r) => r.modelId)
|
|
5813
5814
|
.filter((id) => id != null)),
|
|
5814
5815
|
];
|
|
5815
|
-
const { detachModelRows } = await import('./detachRowsBeforeDelete-
|
|
5816
|
+
const { detachModelRows } = await import('./detachRowsBeforeDelete-B0Daoz9Z.js');
|
|
5816
5817
|
await detachModelRows(db, modelIds);
|
|
5817
5818
|
await db.delete(modelSchemas).where(inArray(modelSchemas.schemaId, schemaIds));
|
|
5818
5819
|
for (const modelId of modelIds) {
|
|
@@ -5827,8 +5828,8 @@ class Schema {
|
|
|
5827
5828
|
// the destroyed schema back on the next Schema.all().
|
|
5828
5829
|
// Match on name as well as id: versions imported from complete schema files can each
|
|
5829
5830
|
// have their own id, and any version left behind would bring the schema back.
|
|
5830
|
-
const _mod_18 = await import('./ClientManager-
|
|
5831
|
-
const _ns_18 = _mod_18.
|
|
5831
|
+
const _mod_18 = await import('./ClientManager-Dfu4jcgm.js');
|
|
5832
|
+
const _ns_18 = _mod_18.L;
|
|
5832
5833
|
const { listCompleteSchemaFiles } = _ns_18;
|
|
5833
5834
|
const files = await listCompleteSchemaFiles().catch(() => []);
|
|
5834
5835
|
const fs = await BaseFileManager.getFs();
|
|
@@ -6023,4 +6024,4 @@ var Schema$1 = /*#__PURE__*/Object.freeze({
|
|
|
6023
6024
|
});
|
|
6024
6025
|
|
|
6025
6026
|
export { Schema as S, deletePropertyFromModel as a, Schema$1 as b, deleteModelFromSchema as d, renameModelProperty as r, schemaMachine as s, updateModelProperties as u };
|
|
6026
|
-
//# sourceMappingURL=Schema-
|
|
6027
|
+
//# sourceMappingURL=Schema-Bf-jOLq0.js.map
|