@seedprotocol/sdk 0.7.4-next.793.g6dd83dd → 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-DT63t0XU.js → BasePathResolver-DrzGVH9L.js} +231 -39
- package/dist/BasePathResolver-DrzGVH9L.js.map +1 -0
- package/dist/{ClientManager-Cos8NaRU.js → ClientManager-Dfu4jcgm.js} +300 -188
- package/dist/ClientManager-Dfu4jcgm.js.map +1 -0
- package/dist/{Item-CoP48bl3.js → Item-BUUFuywT.js} +75 -219
- package/dist/Item-BUUFuywT.js.map +1 -0
- package/dist/{ModelProperty-jSo2QWIc.js → ModelProperty-B6cnRvIz.js} +37 -38
- package/dist/ModelProperty-B6cnRvIz.js.map +1 -0
- package/dist/{Schema-DN1KwJ57.js → Schema-Bf-jOLq0.js} +36 -35
- package/dist/{Schema-DN1KwJ57.js.map → Schema-Bf-jOLq0.js.map} +1 -1
- package/dist/{SchemaValidationService-CCG9Bu__.js → SchemaValidationService-BNYMacsx.js} +7 -8
- package/dist/{SchemaValidationService-CCG9Bu__.js.map → SchemaValidationService-BNYMacsx.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-D8t61oNl.js → backfillMetadataPropertyIds-C2-s_jUa.js} +4 -5
- package/dist/{backfillMetadataPropertyIds-D8t61oNl.js.map → backfillMetadataPropertyIds-C2-s_jUa.js.map} +1 -1
- package/dist/{configurePlatform-Su9vV5qO.js → configurePlatform-BzfirKuM.js} +3 -4
- package/dist/{configurePlatform-Su9vV5qO.js.map → configurePlatform-BzfirKuM.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-DcWDZ8KP.js → detachRowsBeforeDelete-B0Daoz9Z.js} +3 -4
- package/dist/{detachRowsBeforeDelete-DcWDZ8KP.js.map → detachRowsBeforeDelete-B0Daoz9Z.js.map} +1 -1
- package/dist/{eas-Ce0KDpvb.js → eas-Dq5Kx_Nd.js} +14 -32
- package/dist/eas-Dq5Kx_Nd.js.map +1 -0
- package/dist/{errors-D1brJy1k.js → errors-DdWbxb_n.js} +42 -39
- package/dist/errors-DdWbxb_n.js.map +1 -0
- package/dist/{getItem-Cs5IIZCQ.js → getItem-9bYSErSj.js} +4 -5
- package/dist/{getItem-Cs5IIZCQ.js.map → getItem-9bYSErSj.js.map} +1 -1
- package/dist/{getPublishPayload-CquFaK1c.js → getPublishPayload-DPy-uMrR.js} +28 -29
- package/dist/getPublishPayload-DPy-uMrR.js.map +1 -0
- package/dist/{getPublishUploads-Bv9aOq2x.js → getPublishUploads-J-143iSV.js} +10 -11
- package/dist/{getPublishUploads-Bv9aOq2x.js.map → getPublishUploads-J-143iSV.js.map} +1 -1
- package/dist/{index-BPrJV9Wt.js → index-7y2f_iQz.js} +2 -2
- package/dist/index-7y2f_iQz.js.map +1 -0
- package/dist/{index-DhP5gMMF.js → index-C61Rxy0F.js} +9 -10
- package/dist/index-C61Rxy0F.js.map +1 -0
- package/dist/{index.browser-cpZehMwT.js → index.browser-C1pisOEa.js} +10 -10
- package/dist/{index.browser-cpZehMwT.js.map → index.browser-C1pisOEa.js.map} +1 -1
- package/dist/{index.node-D_-a9z-S.js → index.node-BAlST8pD.js} +6 -6
- package/dist/{index.node-D_-a9z-S.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-DNfhGsdq.js → property-zFPMtR3T.js} +10 -14
- package/dist/property-zFPMtR3T.js.map +1 -0
- package/dist/{propertyValidationRules-BiEBQvPZ.js → propertyValidationRules-CeFVhdQg.js} +10 -10
- package/dist/{propertyValidationRules-BiEBQvPZ.js.map → propertyValidationRules-CeFVhdQg.js.map} +1 -1
- package/dist/{publishDraftGraph-BZ6gku_X.js → publishDraftGraph-CuVq6iAR.js} +7 -6
- package/dist/{publishDraftGraph-BZ6gku_X.js.map → publishDraftGraph-CuVq6iAR.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-CkSoBEOU.js → resetAmbiguousLegacyItemData-DsFTnMBz.js} +5 -6
- package/dist/resetAmbiguousLegacyItemData-DsFTnMBz.js.map +1 -0
- package/dist/{resolveModelForSyncedSeed-CsnKV72V.js → resolveModelForSyncedSeed-RUsgAZXG.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-CsnKV72V.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/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/resolveModelRecord.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.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/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/imports/json.d.ts +10 -0
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -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-CfRijZhj.js → syncDbWithEas-CRpnkq00.js} +157 -61
- package/dist/syncDbWithEas-CRpnkq00.js.map +1 -0
- package/dist/{tabEvents-D5X2Hwcp.js → tabEvents-nBUq_1u1.js} +6 -6
- package/dist/{tabEvents-D5X2Hwcp.js.map → tabEvents-nBUq_1u1.js.map} +1 -1
- package/dist/{tolerantWebAccess-BNYRvW9a.js → tolerantWebAccess-DIt3R8_u.js} +7 -8
- package/dist/{tolerantWebAccess-BNYRvW9a.js.map → tolerantWebAccess-DIt3R8_u.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-B-xAQxaj.js → updateSeedRevokedAt-DtTPSzpM.js} +3 -3
- package/dist/{updateSeedRevokedAt-B-xAQxaj.js.map → updateSeedRevokedAt-DtTPSzpM.js.map} +1 -1
- package/package.json +5 -5
- package/dist/BasePathResolver-DT63t0XU.js.map +0 -1
- package/dist/ClientManager-Cos8NaRU.js.map +0 -1
- package/dist/Item-CoP48bl3.js.map +0 -1
- package/dist/ModelProperty-jSo2QWIc.js.map +0 -1
- package/dist/eas-Ce0KDpvb.js.map +0 -1
- package/dist/errors-D1brJy1k.js.map +0 -1
- package/dist/getPublishPayload-CquFaK1c.js.map +0 -1
- package/dist/index-BPrJV9Wt.js.map +0 -1
- package/dist/index-DhP5gMMF.js.map +0 -1
- package/dist/property-DNfhGsdq.js.map +0 -1
- package/dist/resetAmbiguousLegacyItemData-CkSoBEOU.js.map +0 -1
- package/dist/syncDbWithEas-CfRijZhj.js.map +0 -1
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import { i as isActorStopped, w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-
|
|
3
|
-
import { E as BaseDb, s as models, u as properties, z as schemas, q as modelSchemas,
|
|
2
|
+
import { i as isActorStopped, w as writeProcessMachine, c as currentEvictionEpoch, M as Model, b as anyEvictionSince, s as schemaEvictedSince } from './errors-DdWbxb_n.js';
|
|
3
|
+
import { E as BaseDb, s as models, u as properties, z as schemas, q as modelSchemas, al as getModelIdByFileId, n as normalizeDataType, $ as generateId, M as ModelPropertyDataTypes, J as BaseFileManager, am as getModelId, an as setCachedPropertyRefresher } from './BasePathResolver-DrzGVH9L.js';
|
|
4
4
|
import 'pluralize';
|
|
5
|
+
import '@seedprotocol/eas';
|
|
5
6
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
6
7
|
import { modelPropertiesToObject } from './model-oHA3YhOd.js';
|
|
7
8
|
import debug from 'debug';
|
|
8
|
-
import { S as Schema } from './Schema-
|
|
9
|
-
import { D as DEFAULT_READY_TIMEOUT_MS,
|
|
10
|
-
import './ClientManager-
|
|
9
|
+
import { S as Schema } from './Schema-Bf-jOLq0.js';
|
|
10
|
+
import { D as DEFAULT_READY_TIMEOUT_MS, l as waitForEntityIdle, m as createReactiveProxy, n as findEntity, o as forceRemoveFromCaches, q as runDestroyLifecycle } from './Item-BUUFuywT.js';
|
|
11
|
+
import './ClientManager-Dfu4jcgm.js';
|
|
11
12
|
import 'lodash-es';
|
|
12
|
-
import './tabEvents-
|
|
13
|
+
import './tabEvents-nBUq_1u1.js';
|
|
13
14
|
import '@seedprotocol/arweave';
|
|
14
|
-
import '@seedprotocol/eas';
|
|
15
15
|
import '@noble/hashes/sha3';
|
|
16
16
|
import '@noble/hashes/utils';
|
|
17
17
|
import '@seedprotocol/query';
|
|
18
|
-
import 'drizzle-orm/casing';
|
|
19
18
|
import '@sinclair/typebox';
|
|
20
19
|
import 'drizzle-orm/sqlite-core';
|
|
21
20
|
import 'nanoid';
|
|
22
21
|
import 'nanoid-dictionary';
|
|
23
22
|
import '@noble/hashes/sha256';
|
|
24
|
-
import './SchemaValidationService-
|
|
23
|
+
import './SchemaValidationService-BNYMacsx.js';
|
|
25
24
|
import '@sinclair/typebox/value';
|
|
26
25
|
import 'rxjs';
|
|
27
26
|
|
|
@@ -33,15 +32,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
33
32
|
*/
|
|
34
33
|
async function getSchemaNameFromModel(modelName) {
|
|
35
34
|
// Get the latest schema files and find which one contains this model
|
|
36
|
-
const _mod_0 = await import('./ClientManager-
|
|
35
|
+
const _mod_0 = await import('./ClientManager-Dfu4jcgm.js');
|
|
37
36
|
const _ns_0 = _mod_0.L;
|
|
38
37
|
const schemaHelpersMod = _ns_0;
|
|
39
38
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
40
39
|
const latestSchemas = await listLatestSchemaFiles();
|
|
41
40
|
for (const schema of latestSchemas) {
|
|
42
41
|
try {
|
|
43
|
-
const _mod_1 = await import('./BasePathResolver-
|
|
44
|
-
const _ns_1 = _mod_1.
|
|
42
|
+
const _mod_1 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
43
|
+
const _ns_1 = _mod_1.b7;
|
|
45
44
|
const fileManagerMod = _ns_1;
|
|
46
45
|
const { BaseFileManager } = fileManagerMod;
|
|
47
46
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
@@ -60,7 +59,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
60
59
|
const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
61
60
|
const _saveToSchema = async () => {
|
|
62
61
|
// Use dynamic import to break circular dependency
|
|
63
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
62
|
+
const validationServiceMod = await import('./SchemaValidationService-BNYMacsx.js');
|
|
64
63
|
const { SchemaValidationService } = validationServiceMod;
|
|
65
64
|
const validationService = new SchemaValidationService();
|
|
66
65
|
// Validate property structure before saving
|
|
@@ -79,15 +78,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
|
79
78
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
80
79
|
}
|
|
81
80
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
82
|
-
const _mod_2 = await import('./BasePathResolver-
|
|
83
|
-
const _ns_2 = _mod_2.
|
|
81
|
+
const _mod_2 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
82
|
+
const _ns_2 = _mod_2.bb;
|
|
84
83
|
const dbMod = _ns_2;
|
|
85
84
|
const { savePropertyToDb } = dbMod;
|
|
86
85
|
await savePropertyToDb(context);
|
|
87
86
|
// Mark schema as draft so user knows to save
|
|
88
87
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
89
88
|
if (schemaName) {
|
|
90
|
-
const _mod_3 = await import('./Schema-
|
|
89
|
+
const _mod_3 = await import('./Schema-Bf-jOLq0.js');
|
|
91
90
|
const _ns_3 = _mod_3.b;
|
|
92
91
|
const schemaMod = _ns_3;
|
|
93
92
|
const { Schema } = schemaMod;
|
|
@@ -125,8 +124,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
125
124
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
126
125
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
127
126
|
try {
|
|
128
|
-
const _mod_4 = await import('./BasePathResolver-
|
|
129
|
-
const _ns_4 = _mod_4.
|
|
127
|
+
const _mod_4 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
128
|
+
const _ns_4 = _mod_4.bb;
|
|
130
129
|
const dbMod = _ns_4;
|
|
131
130
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
132
131
|
let fromDb;
|
|
@@ -172,8 +171,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
172
171
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
173
172
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
174
173
|
try {
|
|
175
|
-
const _mod_5 = await import('./BasePathResolver-
|
|
176
|
-
const _ns_5 = _mod_5.
|
|
174
|
+
const _mod_5 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
175
|
+
const _ns_5 = _mod_5.bb;
|
|
177
176
|
const dbMod = _ns_5;
|
|
178
177
|
const { savePropertyToDb } = dbMod;
|
|
179
178
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
@@ -234,8 +233,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
234
233
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
235
234
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
236
235
|
// Use dynamic import to break circular dependency
|
|
237
|
-
const _mod_6 = await import('./BasePathResolver-
|
|
238
|
-
const _ns_6 = _mod_6.
|
|
236
|
+
const _mod_6 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
237
|
+
const _ns_6 = _mod_6.bb;
|
|
239
238
|
const dbMod = _ns_6;
|
|
240
239
|
const { savePropertyToDb } = dbMod;
|
|
241
240
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
@@ -250,7 +249,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
250
249
|
// Mark schema as draft if schema name is available
|
|
251
250
|
if (fullContext._schemaName) {
|
|
252
251
|
// Get the Schema instance and mark it as draft
|
|
253
|
-
const _mod_7 = await import('./Schema-
|
|
252
|
+
const _mod_7 = await import('./Schema-Bf-jOLq0.js');
|
|
254
253
|
const _ns_7 = _mod_7.b;
|
|
255
254
|
const schemaMod = _ns_7;
|
|
256
255
|
const { Schema } = schemaMod;
|
|
@@ -272,7 +271,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
272
271
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
273
272
|
// Clear isEdited flag in database
|
|
274
273
|
try {
|
|
275
|
-
const _mod_8 = await import('./index-
|
|
274
|
+
const _mod_8 = await import('./index-7y2f_iQz.js');
|
|
276
275
|
const _ns_8 = _mod_8.s;
|
|
277
276
|
const seedSchemaMod = _ns_8;
|
|
278
277
|
const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
|
|
@@ -281,8 +280,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
281
280
|
const db = BaseDb.getAppDb();
|
|
282
281
|
if (db && fullContext.modelName && fullContext.name) {
|
|
283
282
|
// Find this property's model (model names are only unique per schema)
|
|
284
|
-
const _mod_9 = await import('./BasePathResolver-
|
|
285
|
-
const _ns_9 = _mod_9.
|
|
283
|
+
const _mod_9 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
284
|
+
const _ns_9 = _mod_9.ba;
|
|
286
285
|
const { resolveModelRecord } = _ns_9;
|
|
287
286
|
const modelRecord = await resolveModelRecord(fullContext.modelName, {
|
|
288
287
|
modelId: typeof fullContext.modelId === 'number' ? fullContext.modelId : undefined,
|
|
@@ -341,8 +340,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
341
340
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
342
341
|
await new Promise((r) => setTimeout(r, 60));
|
|
343
342
|
try {
|
|
344
|
-
const _mod_10 = await import('./BasePathResolver-
|
|
345
|
-
const _ns_10 = _mod_10.
|
|
343
|
+
const _mod_10 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
344
|
+
const _ns_10 = _mod_10.bb;
|
|
346
345
|
const dbMod = _ns_10;
|
|
347
346
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
348
347
|
// Try pending write first (property row may not exist yet)
|
|
@@ -395,10 +394,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
395
394
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
396
395
|
}
|
|
397
396
|
// Use dynamic imports to break circular dependencies
|
|
398
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
397
|
+
const validationServiceMod = await import('./SchemaValidationService-BNYMacsx.js');
|
|
399
398
|
const { SchemaValidationService } = validationServiceMod;
|
|
400
399
|
const validationService = new SchemaValidationService();
|
|
401
|
-
const _mod_11 = await import('./Schema-
|
|
400
|
+
const _mod_11 = await import('./Schema-Bf-jOLq0.js');
|
|
402
401
|
const _ns_11 = _mod_11.b;
|
|
403
402
|
const schemaMod = _ns_11;
|
|
404
403
|
const { Schema } = schemaMod;
|
|
@@ -1028,8 +1027,8 @@ class ModelProperty {
|
|
|
1028
1027
|
return fallbackIsEdited;
|
|
1029
1028
|
}
|
|
1030
1029
|
// Find this property's model (by modelId when known; model names are only unique per schema)
|
|
1031
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
1032
|
-
const _ns_12 = _mod_12.
|
|
1030
|
+
const _mod_12 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
1031
|
+
const _ns_12 = _mod_12.ba;
|
|
1033
1032
|
const { resolveModelRecord } = _ns_12;
|
|
1034
1033
|
const modelRecord = await resolveModelRecord(property.modelName, this._ownerModelScope(property), db);
|
|
1035
1034
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
@@ -1066,8 +1065,8 @@ class ModelProperty {
|
|
|
1066
1065
|
return undefined;
|
|
1067
1066
|
}
|
|
1068
1067
|
// Resolve the ref within the owning model's schema
|
|
1069
|
-
const _mod_13 = await import('./BasePathResolver-
|
|
1070
|
-
const _ns_13 = _mod_13.
|
|
1068
|
+
const _mod_13 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
1069
|
+
const _ns_13 = _mod_13.ba;
|
|
1071
1070
|
const { resolveRefModelRecord } = _ns_13;
|
|
1072
1071
|
const refModelRecord = await resolveRefModelRecord(refModelName, property ? this._ownerModelScope(property) : { schemaName: this._getSnapshotContext()._schemaName }, db);
|
|
1073
1072
|
if (refModelRecord?.id) {
|
|
@@ -1112,8 +1111,8 @@ class ModelProperty {
|
|
|
1112
1111
|
}
|
|
1113
1112
|
}
|
|
1114
1113
|
if (!model && modelId) {
|
|
1115
|
-
const _mod_14 = await import('./BasePathResolver-
|
|
1116
|
-
const _ns_14 = _mod_14.
|
|
1114
|
+
const _mod_14 = await import('./BasePathResolver-DrzGVH9L.js');
|
|
1115
|
+
const _ns_14 = _mod_14.ba;
|
|
1117
1116
|
const { resolveModelRecord } = _ns_14;
|
|
1118
1117
|
const modelFileId = (await resolveModelRecord(property.modelName, { modelId }))?.schemaFileId;
|
|
1119
1118
|
model = modelFileId ? Model.getById(modelFileId) : undefined;
|
|
@@ -2079,7 +2078,7 @@ class ModelProperty {
|
|
|
2079
2078
|
.where(and(eq(schemas.name, schemaName), eq(models.name, modelName), eq(properties.name, propertyName)))
|
|
2080
2079
|
.limit(1);
|
|
2081
2080
|
if (propertyRecords.length > 0 && propertyRecords[0].propertyId != null) {
|
|
2082
|
-
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-
|
|
2081
|
+
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-B0Daoz9Z.js');
|
|
2083
2082
|
await detachPropertyRows(db, [propertyRecords[0].propertyId]);
|
|
2084
2083
|
await db
|
|
2085
2084
|
.delete(properties)
|
|
@@ -2123,4 +2122,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
2123
2122
|
});
|
|
2124
2123
|
|
|
2125
2124
|
export { ModelProperty };
|
|
2126
|
-
//# sourceMappingURL=ModelProperty-
|
|
2125
|
+
//# sourceMappingURL=ModelProperty-B6cnRvIz.js.map
|