@seedprotocol/sdk 0.7.11-next.1384.g8b47246 → 0.7.11
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/{BaseFileManager-DLou1TZS.js → BaseFileManager-D-pLXQAp.js} +2 -14
- package/dist/BaseFileManager-D-pLXQAp.js.map +1 -0
- package/dist/{Item-Ld1iPicQ.js → Item-BU9wIT7l.js} +61 -59
- package/dist/Item-BU9wIT7l.js.map +1 -0
- package/dist/{ModelProperty-C8gTx4pO.js → ModelProperty-Bv7KzP97.js} +40 -37
- package/dist/ModelProperty-Bv7KzP97.js.map +1 -0
- package/dist/{Schema-BzeBUZxi.js → Schema-C_4wv0RP.js} +22 -22
- package/dist/{Schema-BzeBUZxi.js.map → Schema-C_4wv0RP.js.map} +1 -1
- package/dist/{SchemaValidationService-CW0s7V7R.js → SchemaValidationService-Dc-lpFQX.js} +9 -6
- package/dist/{SchemaValidationService-CW0s7V7R.js.map → SchemaValidationService-Dc-lpFQX.js.map} +1 -1
- package/dist/{tabEvents-BnBzIdEi.js → arweaveContentTags-iW_HcWJA.js} +53 -5
- package/dist/arweaveContentTags-iW_HcWJA.js.map +1 -0
- package/dist/{configurePlatform-WkmvqeTO.js → configurePlatform-BH1YOZpg.js} +2 -2
- package/dist/{configurePlatform-WkmvqeTO.js.map → configurePlatform-BH1YOZpg.js.map} +1 -1
- package/dist/db/drizzle/0030_drop_property_uids.sql +1 -0
- package/dist/db/drizzle/meta/0030_snapshot.json +1638 -0
- package/dist/db/drizzle/meta/_journal.json +8 -1
- package/dist/{detachRowsBeforeDelete-BZr_0iZU.js → detachRowsBeforeDelete-Cie55SoG.js} +4 -6
- package/dist/detachRowsBeforeDelete-Cie55SoG.js.map +1 -0
- package/dist/dist/{BaseFileManager-DLou1TZS.d.ts → BaseFileManager-D-pLXQAp.d.ts} +432 -495
- package/dist/dist/BaseFileManager-D-pLXQAp.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-WkmvqeTO.d.ts → configurePlatform-BH1YOZpg.d.ts} +1 -1
- package/dist/dist/configurePlatform-BH1YOZpg.d.ts.map +1 -0
- package/dist/dist/{index-BjWk0x4-.d.ts → index-2PaIhvOU.d.ts} +1 -64
- package/dist/dist/{index-BjWk0x4-.d.ts.map → index-2PaIhvOU.d.ts.map} +1 -1
- package/dist/dist/{index.node-DV1OXCp0.d.ts → index.node-C3rI1upv.d.ts} +1 -253
- package/dist/dist/{index.node-DV1OXCp0.d.ts.map → index.node-C3rI1upv.d.ts.map} +1 -1
- package/dist/dist/minimumUpgradeVersion-Dg2MguFf.d.ts +20 -0
- package/dist/dist/minimumUpgradeVersion-Dg2MguFf.d.ts.map +1 -0
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/{download-Cvac_VGu.js → download-DHWUPLlK.js} +4 -5
- package/dist/{download-Cvac_VGu.js.map → download-DHWUPLlK.js.map} +1 -1
- package/dist/{eas-CdhfODXL.js → eas-MXEdKKVc.js} +10 -7
- package/dist/{eas-CdhfODXL.js.map → eas-MXEdKKVc.js.map} +1 -1
- package/dist/{ensureImageLocal-DNM6c2yD.js → ensureImageLocal-B6suz6FC.js} +8 -9
- package/dist/{ensureImageLocal-DNM6c2yD.js.map → ensureImageLocal-B6suz6FC.js.map} +1 -1
- package/dist/{getPublishPayload-CLrAcZwr.js → getPublishPayload-Dd3HCYeI.js} +8 -49
- package/dist/getPublishPayload-Dd3HCYeI.js.map +1 -0
- package/dist/{getPublishPendingDiff-DiPff8pS.js → getPublishPendingDiff-kcTP52Kj.js} +11 -9
- package/dist/{getPublishPendingDiff-DiPff8pS.js.map → getPublishPendingDiff-kcTP52Kj.js.map} +1 -1
- package/dist/{index-BjWk0x4-.js → index-2PaIhvOU.js} +2 -4
- package/dist/index-2PaIhvOU.js.map +1 -0
- package/dist/{index-9udoYObJ.js → index-BXTyvnKb.js} +11 -8
- package/dist/index-BXTyvnKb.js.map +1 -0
- package/dist/{index-CghAYA-z.js → index-CmNqUKQN.js} +11 -8
- package/dist/index-CmNqUKQN.js.map +1 -0
- package/dist/{index-Cdm7Q7el.js → index-Xs_EDi-_.js} +18 -403
- package/dist/index-Xs_EDi-_.js.map +1 -0
- package/dist/{index.browser-D9oC-KKx.js → index.browser-BkcOQGhw.js} +25 -69
- package/dist/index.browser-BkcOQGhw.js.map +1 -0
- package/dist/{index.node-DV1OXCp0.js → index.node-C3rI1upv.js} +8 -6
- package/dist/index.node-C3rI1upv.js.map +1 -0
- package/dist/main.js +19 -22
- package/dist/main.js.map +1 -1
- package/dist/{minimumUpgradeVersion-BDhHvHtr.js → minimumUpgradeVersion-Dg2MguFf.js} +38 -9
- package/dist/minimumUpgradeVersion-Dg2MguFf.js.map +1 -0
- package/dist/{modelPropertyRecordSchemas-se4QMXSi.js → modelPropertyRecordSchemas-CEac3FB8.js} +8 -5
- package/dist/{modelPropertyRecordSchemas-se4QMXSi.js.map → modelPropertyRecordSchemas-CEac3FB8.js.map} +1 -1
- package/dist/node.js +14 -11
- 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 -5
- package/dist/{property-Broz_CWj.js → property-4jSqHieb.js} +11 -8
- package/dist/property-4jSqHieb.js.map +1 -0
- package/dist/{errors-DKxFSvb3.js → publishErrors-DZXDX3B6.js} +1688 -195
- package/dist/publishErrors-DZXDX3B6.js.map +1 -0
- package/dist/{readHtmlBodyForStorageSeed-FvwYPn4m.js → readHtmlBodyForStorageSeed-Cva1DPzE.js} +9 -9
- package/dist/{readHtmlBodyForStorageSeed-FvwYPn4m.js.map → readHtmlBodyForStorageSeed-Cva1DPzE.js.map} +1 -1
- package/dist/seedSchema/index.ts +0 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +1 -0
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/db/minimumUpgradeVersion.d.ts +20 -5
- package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -1
- package/dist/src/helpers/entity/detachRowsBeforeDelete.d.ts +2 -3
- package/dist/src/helpers/entity/detachRowsBeforeDelete.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +9 -1
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/seedSchema/index.d.ts +0 -1
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-Dj_8VqM7.js → syncDbWithEas-V_9gIyHp.js} +21 -20
- package/dist/syncDbWithEas-V_9gIyHp.js.map +1 -0
- package/dist/{tolerantWebAccess-CNfvmR3m.js → tolerantWebAccess-D6hFxREe.js} +7 -8
- package/dist/{tolerantWebAccess-CNfvmR3m.js.map → tolerantWebAccess-D6hFxREe.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-D-3SLW-D.js → updateSeedRevokedAt-CsAoUEEt.js} +4 -4
- package/dist/{updateSeedRevokedAt-D-3SLW-D.js.map → updateSeedRevokedAt-CsAoUEEt.js.map} +1 -1
- package/package.json +7 -7
- package/dist/BaseFileManager-DLou1TZS.js.map +0 -1
- package/dist/Item-Ld1iPicQ.js.map +0 -1
- package/dist/ModelProperty-C8gTx4pO.js.map +0 -1
- package/dist/arweaveContentTags-Bh4wCTal.js +0 -51
- package/dist/arweaveContentTags-Bh4wCTal.js.map +0 -1
- package/dist/detachRowsBeforeDelete-BZr_0iZU.js.map +0 -1
- package/dist/dist/BaseFileManager-DLou1TZS.d.ts.map +0 -1
- package/dist/dist/configurePlatform-WkmvqeTO.d.ts.map +0 -1
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +0 -9
- package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +0 -1
- package/dist/errors-DKxFSvb3.js.map +0 -1
- package/dist/getPublishPayload-CLrAcZwr.js.map +0 -1
- package/dist/getPublishUploads-DFcgc27c.js +0 -784
- package/dist/getPublishUploads-DFcgc27c.js.map +0 -1
- package/dist/index-9udoYObJ.js.map +0 -1
- package/dist/index-BjWk0x4-.js.map +0 -1
- package/dist/index-Cdm7Q7el.js.map +0 -1
- package/dist/index-CghAYA-z.js.map +0 -1
- package/dist/index.browser-D9oC-KKx.js.map +0 -1
- package/dist/index.node-DV1OXCp0.js.map +0 -1
- package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +0 -1
- package/dist/property-Broz_CWj.js.map +0 -1
- package/dist/publishGraph-DnWoWZRP.js +0 -311
- package/dist/publishGraph-DnWoWZRP.js.map +0 -1
- package/dist/seedSchema/PropertyUidSchema.ts +0 -16
- package/dist/src/seedSchema/PropertyUidSchema.d.ts +0 -64
- package/dist/src/seedSchema/PropertyUidSchema.d.ts.map +0 -1
- package/dist/syncDbWithEas-Dj_8VqM7.js.map +0 -1
- package/dist/tabEvents-BnBzIdEi.js.map +0 -1
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor, waitFor } from 'xstate';
|
|
2
|
-
import { M as Model,
|
|
3
|
-
import { n as normalizeDataType, k as generateId, M as ModelPropertyDataTypes } from './
|
|
2
|
+
import { M as Model, J as saveDefinition } from './publishErrors-DZXDX3B6.js';
|
|
3
|
+
import { n as normalizeDataType, k as generateId, M as ModelPropertyDataTypes } from './arweaveContentTags-iW_HcWJA.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import '@seedprotocol/eas';
|
|
6
|
-
import { B as BaseDb, d as models, l as properties,
|
|
7
|
-
import {
|
|
6
|
+
import { B as BaseDb, d as models, l as properties, q as schemas, j as modelSchemas, r as BaseFileManager } from './BaseFileManager-D-pLXQAp.js';
|
|
7
|
+
import { as as isActorStopped, N as applyContextUpdate, P as isInternalUpdate, at as differsFromOriginals, Q as evictionLog, ag as modelPropertiesToObject, au as resolveModelRecord, W as DEFAULT_READY_TIMEOUT_MS, av as definitionOnlyFields, aw as persistDefinitionFields, X as createReactiveProxy, ax as onEntityTeardown, Y as runEntityLoad, Z as waitForEntityReady, T as holdChild, ay as getPropertyDefinition, az as propertyDefinitionFromRow, U as isEntityTornDown, E as EntityUnloadedError, $ as entityStatus, _ as evictEntities, a1 as releaseEntity, a2 as destroyEntity, a6 as EntityCache, aA as addCachedPropertyRefresher } from './Item-BU9wIT7l.js';
|
|
8
8
|
import debug from 'debug';
|
|
9
9
|
import '@seedprotocol/arweave';
|
|
10
10
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
11
|
-
import { S as Schema } from './Schema-
|
|
11
|
+
import { S as Schema } from './Schema-C_4wv0RP.js';
|
|
12
12
|
import '@sinclair/typebox';
|
|
13
13
|
import 'lodash-es';
|
|
14
|
+
import '@seedprotocol/query';
|
|
15
|
+
import '@seedprotocol/archive';
|
|
16
|
+
import 'parse5';
|
|
14
17
|
import '@noble/hashes/sha3';
|
|
15
18
|
import '@noble/hashes/utils';
|
|
16
|
-
import '@seedprotocol/query';
|
|
17
19
|
import 'nanoid';
|
|
18
20
|
import 'nanoid-dictionary';
|
|
21
|
+
import '@noble/hashes/sha256';
|
|
19
22
|
import 'drizzle-orm/sqlite-core';
|
|
20
23
|
import 'rxjs';
|
|
21
|
-
import './SchemaValidationService-
|
|
24
|
+
import './SchemaValidationService-Dc-lpFQX.js';
|
|
22
25
|
import '@sinclair/typebox/value';
|
|
23
26
|
|
|
24
27
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
@@ -29,15 +32,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
29
32
|
*/
|
|
30
33
|
async function getSchemaNameFromModel(modelName) {
|
|
31
34
|
// Get the latest schema files and find which one contains this model
|
|
32
|
-
const _mod_0 = await import('./
|
|
33
|
-
const _ns_0 = _mod_0
|
|
35
|
+
const _mod_0 = await import('./publishErrors-DZXDX3B6.js');
|
|
36
|
+
const _ns_0 = _mod_0.an;
|
|
34
37
|
const schemaHelpersMod = _ns_0;
|
|
35
38
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
36
39
|
const latestSchemas = await listLatestSchemaFiles();
|
|
37
40
|
for (const schema of latestSchemas) {
|
|
38
41
|
try {
|
|
39
|
-
const _mod_1 = await import('./BaseFileManager-
|
|
40
|
-
const _ns_1 = _mod_1.
|
|
42
|
+
const _mod_1 = await import('./BaseFileManager-D-pLXQAp.js');
|
|
43
|
+
const _ns_1 = _mod_1.y;
|
|
41
44
|
const fileManagerMod = _ns_1;
|
|
42
45
|
const { BaseFileManager } = fileManagerMod;
|
|
43
46
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
@@ -56,7 +59,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
56
59
|
const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
57
60
|
const _saveToSchema = async () => {
|
|
58
61
|
// Use dynamic import to break circular dependency
|
|
59
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
62
|
+
const validationServiceMod = await import('./SchemaValidationService-Dc-lpFQX.js');
|
|
60
63
|
const { SchemaValidationService } = validationServiceMod;
|
|
61
64
|
const validationService = new SchemaValidationService();
|
|
62
65
|
// Validate property structure before saving
|
|
@@ -75,15 +78,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
|
75
78
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
76
79
|
}
|
|
77
80
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
78
|
-
const _mod_2 = await import('./Item-
|
|
79
|
-
const _ns_2 = _mod_2.
|
|
81
|
+
const _mod_2 = await import('./Item-BU9wIT7l.js');
|
|
82
|
+
const _ns_2 = _mod_2.bS;
|
|
80
83
|
const dbMod = _ns_2;
|
|
81
84
|
const { savePropertyToDb } = dbMod;
|
|
82
85
|
await savePropertyToDb(context);
|
|
83
86
|
// Mark schema as draft so user knows to save
|
|
84
87
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
85
88
|
if (schemaName) {
|
|
86
|
-
const _mod_3 = await import('./Schema-
|
|
89
|
+
const _mod_3 = await import('./Schema-C_4wv0RP.js');
|
|
87
90
|
const _ns_3 = _mod_3.a;
|
|
88
91
|
const schemaMod = _ns_3;
|
|
89
92
|
const { Schema } = schemaMod;
|
|
@@ -121,8 +124,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
121
124
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
122
125
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
123
126
|
try {
|
|
124
|
-
const _mod_4 = await import('./Item-
|
|
125
|
-
const _ns_4 = _mod_4.
|
|
127
|
+
const _mod_4 = await import('./Item-BU9wIT7l.js');
|
|
128
|
+
const _ns_4 = _mod_4.bP;
|
|
126
129
|
const { resolveModelRecord, resolvePropertyModelRecord } = _ns_4;
|
|
127
130
|
const fromDb = await resolvePropertyModelRecord(schemaFileIdForResolve);
|
|
128
131
|
if (fromDb) {
|
|
@@ -160,8 +163,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
160
163
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
161
164
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
162
165
|
try {
|
|
163
|
-
const _mod_5 = await import('./Item-
|
|
164
|
-
const _ns_5 = _mod_5.
|
|
166
|
+
const _mod_5 = await import('./Item-BU9wIT7l.js');
|
|
167
|
+
const _ns_5 = _mod_5.bS;
|
|
165
168
|
const dbMod = _ns_5;
|
|
166
169
|
const { savePropertyToDb } = dbMod;
|
|
167
170
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
@@ -222,8 +225,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
222
225
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
223
226
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
224
227
|
// Use dynamic import to break circular dependency
|
|
225
|
-
const _mod_6 = await import('./Item-
|
|
226
|
-
const _ns_6 = _mod_6.
|
|
228
|
+
const _mod_6 = await import('./Item-BU9wIT7l.js');
|
|
229
|
+
const _ns_6 = _mod_6.bS;
|
|
227
230
|
const dbMod = _ns_6;
|
|
228
231
|
const { savePropertyToDb } = dbMod;
|
|
229
232
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
@@ -238,7 +241,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
238
241
|
// Mark schema as draft if schema name is available
|
|
239
242
|
if (fullContext._schemaName) {
|
|
240
243
|
// Get the Schema instance and mark it as draft
|
|
241
|
-
const _mod_7 = await import('./Schema-
|
|
244
|
+
const _mod_7 = await import('./Schema-C_4wv0RP.js');
|
|
242
245
|
const _ns_7 = _mod_7.a;
|
|
243
246
|
const schemaMod = _ns_7;
|
|
244
247
|
const { Schema } = schemaMod;
|
|
@@ -258,7 +261,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
258
261
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
259
262
|
// Clear isEdited flag in database
|
|
260
263
|
try {
|
|
261
|
-
const _mod_8 = await import('./index-
|
|
264
|
+
const _mod_8 = await import('./index-2PaIhvOU.js');
|
|
262
265
|
const _ns_8 = _mod_8.s;
|
|
263
266
|
const seedSchemaMod = _ns_8;
|
|
264
267
|
const { properties: propertiesTable } = seedSchemaMod;
|
|
@@ -267,8 +270,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
267
270
|
const db = BaseDb.getAppDb();
|
|
268
271
|
if (db && fullContext.modelName && fullContext.name) {
|
|
269
272
|
// Find this property's model (model names are only unique per schema)
|
|
270
|
-
const _mod_9 = await import('./Item-
|
|
271
|
-
const _ns_9 = _mod_9.
|
|
273
|
+
const _mod_9 = await import('./Item-BU9wIT7l.js');
|
|
274
|
+
const _ns_9 = _mod_9.bP;
|
|
272
275
|
const { resolveModelRecord } = _ns_9;
|
|
273
276
|
const modelRecord = await resolveModelRecord(fullContext.modelName, {
|
|
274
277
|
modelId: typeof fullContext.modelId === 'number' ? fullContext.modelId : undefined,
|
|
@@ -325,8 +328,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
325
328
|
const schemaFileId = typeof context.id === 'string' ? context.id : undefined;
|
|
326
329
|
if (schemaFileId && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
327
330
|
try {
|
|
328
|
-
const _mod_10 = await import('./Item-
|
|
329
|
-
const _ns_10 = _mod_10.
|
|
331
|
+
const _mod_10 = await import('./Item-BU9wIT7l.js');
|
|
332
|
+
const _ns_10 = _mod_10.bP;
|
|
330
333
|
const { resolveModelRecord, resolvePropertyModelRecord } = _ns_10;
|
|
331
334
|
// Try pending write first (property row may not exist yet)
|
|
332
335
|
if (fullContext.modelName === undefined && schemaFileId) {
|
|
@@ -359,10 +362,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
359
362
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
360
363
|
}
|
|
361
364
|
// Use dynamic imports to break circular dependencies
|
|
362
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
365
|
+
const validationServiceMod = await import('./SchemaValidationService-Dc-lpFQX.js');
|
|
363
366
|
const { SchemaValidationService } = validationServiceMod;
|
|
364
367
|
const validationService = new SchemaValidationService();
|
|
365
|
-
const _mod_11 = await import('./Schema-
|
|
368
|
+
const _mod_11 = await import('./Schema-C_4wv0RP.js');
|
|
366
369
|
const _ns_11 = _mod_11.a;
|
|
367
370
|
const schemaMod = _ns_11;
|
|
368
371
|
const { Schema } = schemaMod;
|
|
@@ -869,8 +872,8 @@ class ModelProperty {
|
|
|
869
872
|
return fallbackIsEdited;
|
|
870
873
|
}
|
|
871
874
|
// Find this property's model (by modelId when known; model names are only unique per schema)
|
|
872
|
-
const _mod_12 = await import('./Item-
|
|
873
|
-
const _ns_12 = _mod_12.
|
|
875
|
+
const _mod_12 = await import('./Item-BU9wIT7l.js');
|
|
876
|
+
const _ns_12 = _mod_12.bP;
|
|
874
877
|
const { resolveModelRecord } = _ns_12;
|
|
875
878
|
const modelRecord = await resolveModelRecord(property.modelName, this._ownerModelScope(property), db);
|
|
876
879
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
@@ -907,8 +910,8 @@ class ModelProperty {
|
|
|
907
910
|
return undefined;
|
|
908
911
|
}
|
|
909
912
|
// Resolve the ref within the owning model's schema
|
|
910
|
-
const _mod_13 = await import('./Item-
|
|
911
|
-
const _ns_13 = _mod_13.
|
|
913
|
+
const _mod_13 = await import('./Item-BU9wIT7l.js');
|
|
914
|
+
const _ns_13 = _mod_13.bP;
|
|
912
915
|
const { resolveRefModelRecord } = _ns_13;
|
|
913
916
|
const refModelRecord = await resolveRefModelRecord(refModelName, property ? this._ownerModelScope(property) : { schemaName: this._getSnapshotContext()._schemaName }, db);
|
|
914
917
|
if (refModelRecord?.id) {
|
|
@@ -953,8 +956,8 @@ class ModelProperty {
|
|
|
953
956
|
}
|
|
954
957
|
}
|
|
955
958
|
if (!model && modelId) {
|
|
956
|
-
const _mod_14 = await import('./Item-
|
|
957
|
-
const _ns_14 = _mod_14.
|
|
959
|
+
const _mod_14 = await import('./Item-BU9wIT7l.js');
|
|
960
|
+
const _ns_14 = _mod_14.bP;
|
|
958
961
|
const { resolveModelRecord } = _ns_14;
|
|
959
962
|
const modelFileId = (await resolveModelRecord(property.modelName, { modelId }))?.schemaFileId;
|
|
960
963
|
model = modelFileId ? Model.peek(modelFileId) : undefined;
|
|
@@ -1786,7 +1789,7 @@ class ModelProperty {
|
|
|
1786
1789
|
.where(eq(properties.schemaFileId, propertyFileId))
|
|
1787
1790
|
.limit(1);
|
|
1788
1791
|
if (row) {
|
|
1789
|
-
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-
|
|
1792
|
+
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-Cie55SoG.js');
|
|
1790
1793
|
await detachPropertyRows(db, [row.id]);
|
|
1791
1794
|
await db.delete(properties).where(eq(properties.id, row.id));
|
|
1792
1795
|
}
|
|
@@ -1825,4 +1828,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1825
1828
|
});
|
|
1826
1829
|
|
|
1827
1830
|
export { ModelProperty };
|
|
1828
|
-
//# sourceMappingURL=ModelProperty-
|
|
1831
|
+
//# sourceMappingURL=ModelProperty-Bv7KzP97.js.map
|