@seedprotocol/sdk 0.7.10 → 0.7.11-next.1396.g883ef47
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/README.md +1 -1
- package/dist/{BaseFileManager-DLou1TZS.js → BaseFileManager-D-pLXQAp.js} +2 -14
- package/dist/BaseFileManager-D-pLXQAp.js.map +1 -0
- package/dist/{Item-oPnmIehk.js → Item-BU9wIT7l.js} +2053 -412
- package/dist/Item-BU9wIT7l.js.map +1 -0
- package/dist/{ModelProperty-D2vJozmW.js → ModelProperty-Bv7KzP97.js} +40 -38
- package/dist/ModelProperty-Bv7KzP97.js.map +1 -0
- package/dist/{Schema-BMXRF4j9.js → Schema-C_4wv0RP.js} +22 -22
- package/dist/{Schema-BMXRF4j9.js.map → Schema-C_4wv0RP.js.map} +1 -1
- package/dist/{SchemaValidationService-CieGrj5c.js → SchemaValidationService-Dc-lpFQX.js} +9 -7
- package/dist/{SchemaValidationService-CieGrj5c.js.map → SchemaValidationService-Dc-lpFQX.js.map} +1 -1
- package/dist/arweaveContentTags-iW_HcWJA.js +1456 -0
- 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-BfiBriEq.d.ts → index.node-C3rI1upv.d.ts} +25 -281
- package/dist/dist/{index.node-BfiBriEq.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-DHWUPLlK.js +393 -0
- package/dist/download-DHWUPLlK.js.map +1 -0
- package/dist/{eas-FZPPqxqe.js → eas-MXEdKKVc.js} +12 -10
- package/dist/{eas-FZPPqxqe.js.map → eas-MXEdKKVc.js.map} +1 -1
- package/dist/ensureImageLocal-B6suz6FC.js +175 -0
- package/dist/ensureImageLocal-B6suz6FC.js.map +1 -0
- package/dist/{getPublishPayload-DKuEaq96.js → getPublishPayload-Dd3HCYeI.js} +8 -49
- package/dist/getPublishPayload-Dd3HCYeI.js.map +1 -0
- package/dist/{getPublishPendingDiff-CH5xLMjU.js → getPublishPendingDiff-kcTP52Kj.js} +13 -12
- package/dist/{getPublishPendingDiff-CH5xLMjU.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-BXTyvnKb.js +28 -0
- package/dist/index-BXTyvnKb.js.map +1 -0
- package/dist/{index-DXRhFg1N.js → index-CmNqUKQN.js} +10 -8
- package/dist/index-CmNqUKQN.js.map +1 -0
- package/dist/{index-Gh42_47r.js → index-Xs_EDi-_.js} +18 -401
- package/dist/index-Xs_EDi-_.js.map +1 -0
- package/dist/{index.browser-DQstVvRV.js → index.browser-BkcOQGhw.js} +59 -102
- package/dist/index.browser-BkcOQGhw.js.map +1 -0
- package/dist/{index.node-BfiBriEq.js → index.node-C3rI1upv.js} +14 -36
- package/dist/index.node-C3rI1upv.js.map +1 -0
- package/dist/main.js +19 -19
- package/dist/{minimumUpgradeVersion-BDhHvHtr.js → minimumUpgradeVersion-Dg2MguFf.js} +38 -9
- package/dist/minimumUpgradeVersion-Dg2MguFf.js.map +1 -0
- package/dist/{modelPropertyRecordSchemas-DEe-lYhn.js → modelPropertyRecordSchemas-CEac3FB8.js} +10 -10
- package/dist/{modelPropertyRecordSchemas-DEe-lYhn.js.map → modelPropertyRecordSchemas-CEac3FB8.js.map} +1 -1
- package/dist/node.js +14 -12
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +10 -12
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +5 -5
- package/dist/{property-iNW1N3vm.js → property-4jSqHieb.js} +9 -9
- package/dist/{property-iNW1N3vm.js.map → property-4jSqHieb.js.map} +1 -1
- package/dist/{errors-CnT0fSMK.js → publishErrors-DZXDX3B6.js} +1830 -245
- package/dist/publishErrors-DZXDX3B6.js.map +1 -0
- package/dist/{readHtmlBodyForStorageSeed-B7HgPmq6.js → readHtmlBodyForStorageSeed-Cva1DPzE.js} +10 -12
- package/dist/{readHtmlBodyForStorageSeed-B7HgPmq6.js.map → readHtmlBodyForStorageSeed-Cva1DPzE.js.map} +1 -1
- package/dist/seedSchema/index.ts +0 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +1 -0
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -1
- package/dist/src/Model/index.d.ts +0 -2
- package/dist/src/Model/index.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/browser/helpers/FileManager.d.ts +1 -3
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts +1 -0
- package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
- package/dist/src/browser/workers/ImageResizer.d.ts +1 -0
- package/dist/src/browser/workers/ImageResizer.d.ts.map +1 -1
- package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
- package/dist/src/client/actors/saveAppState.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.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/db/read/metadataProperty.d.ts +1 -1
- package/dist/src/db/read/metadataProperty.d.ts.map +1 -1
- package/dist/src/db/read/resolveModelRecord.d.ts +0 -20
- package/dist/src/db/read/resolveModelRecord.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts +1 -8
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts +0 -5
- package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts.map +1 -1
- package/dist/src/db/write/updateItemPropertyValue.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/easPropertyCanonical.d.ts +1 -1
- package/dist/src/helpers/easPropertyCanonical.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/helpers/entity/entityLifecycle.d.ts +0 -2
- package/dist/src/helpers/entity/entityLifecycle.d.ts.map +1 -1
- package/dist/src/helpers/environment.d.ts +0 -13
- package/dist/src/helpers/environment.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +0 -4
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/itemStorageFile.d.ts +0 -11
- package/dist/src/helpers/itemStorageFile.d.ts.map +1 -1
- package/dist/src/helpers/propertySchemaUid.d.ts +7 -5
- package/dist/src/helpers/propertySchemaUid.d.ts.map +1 -1
- package/dist/src/helpers/storageDir.d.ts +0 -2
- package/dist/src/helpers/storageDir.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 +0 -2
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/helpers/FileManager.d.ts +0 -2
- package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +11 -3
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/outbox/index.d.ts +5 -5
- package/dist/src/outbox/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-FuyqoEKk.js → syncDbWithEas-V_9gIyHp.js} +25 -23
- package/dist/syncDbWithEas-V_9gIyHp.js.map +1 -0
- package/dist/{tolerantWebAccess-zEseJ2zT.js → tolerantWebAccess-D6hFxREe.js} +11 -13
- package/dist/{tolerantWebAccess-zEseJ2zT.js.map → tolerantWebAccess-D6hFxREe.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-B9JRwr5T.js → updateSeedRevokedAt-CsAoUEEt.js} +4 -3
- package/dist/{updateSeedRevokedAt-B9JRwr5T.js.map → updateSeedRevokedAt-CsAoUEEt.js.map} +1 -1
- package/package.json +7 -12
- package/dist/BaseFileManager-DLou1TZS.js.map +0 -1
- package/dist/Item-oPnmIehk.js.map +0 -1
- package/dist/ModelProperty-D2vJozmW.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-CnT0fSMK.js.map +0 -1
- package/dist/getPublishPayload-DKuEaq96.js.map +0 -1
- package/dist/getPublishUploads-DivYpgNw.js +0 -783
- package/dist/getPublishUploads-DivYpgNw.js.map +0 -1
- package/dist/index-BjWk0x4-.js.map +0 -1
- package/dist/index-CZMWKXLM.js +0 -27
- package/dist/index-CZMWKXLM.js.map +0 -1
- package/dist/index-DXRhFg1N.js.map +0 -1
- package/dist/index-Gh42_47r.js.map +0 -1
- package/dist/index.browser-DQstVvRV.js.map +0 -1
- package/dist/index.node-BfiBriEq.js.map +0 -1
- package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +0 -1
- package/dist/publishGraph-CRn_N3NT.js +0 -311
- package/dist/publishGraph-CRn_N3NT.js.map +0 -1
- package/dist/seedSchema/PropertyUidSchema.ts +0 -16
- package/dist/src/db/read/getItemProperty.d.ts +0 -6
- package/dist/src/db/read/getItemProperty.d.ts.map +0 -1
- package/dist/src/db/read/isSeedRevoked.d.ts +0 -7
- package/dist/src/db/read/isSeedRevoked.d.ts.map +0 -1
- package/dist/src/db/write/saveMetadata.d.ts +0 -3
- package/dist/src/db/write/saveMetadata.d.ts.map +0 -1
- package/dist/src/db/write/updateMetadata.d.ts +0 -13
- package/dist/src/db/write/updateMetadata.d.ts.map +0 -1
- package/dist/src/seedSchema/PropertyUidSchema.d.ts +0 -64
- package/dist/src/seedSchema/PropertyUidSchema.d.ts.map +0 -1
- package/dist/src/types/fileManager.d.ts +0 -13
- package/dist/src/types/fileManager.d.ts.map +0 -1
- package/dist/syncDbWithEas-FuyqoEKk.js.map +0 -1
- package/dist/tabEvents-DT5ez6io.js +0 -3830
- package/dist/tabEvents-DT5ez6io.js.map +0 -1
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor, waitFor } from 'xstate';
|
|
2
|
-
import { M as Model,
|
|
3
|
-
import {
|
|
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
|
-
import 'drizzle-orm/sqlite-core';
|
|
18
19
|
import 'nanoid';
|
|
19
20
|
import 'nanoid-dictionary';
|
|
20
21
|
import '@noble/hashes/sha256';
|
|
22
|
+
import 'drizzle-orm/sqlite-core';
|
|
21
23
|
import 'rxjs';
|
|
22
|
-
import './SchemaValidationService-
|
|
24
|
+
import './SchemaValidationService-Dc-lpFQX.js';
|
|
23
25
|
import '@sinclair/typebox/value';
|
|
24
26
|
|
|
25
27
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
@@ -30,15 +32,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
30
32
|
*/
|
|
31
33
|
async function getSchemaNameFromModel(modelName) {
|
|
32
34
|
// Get the latest schema files and find which one contains this model
|
|
33
|
-
const _mod_0 = await import('./
|
|
34
|
-
const _ns_0 = _mod_0.
|
|
35
|
+
const _mod_0 = await import('./publishErrors-DZXDX3B6.js');
|
|
36
|
+
const _ns_0 = _mod_0.an;
|
|
35
37
|
const schemaHelpersMod = _ns_0;
|
|
36
38
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
37
39
|
const latestSchemas = await listLatestSchemaFiles();
|
|
38
40
|
for (const schema of latestSchemas) {
|
|
39
41
|
try {
|
|
40
|
-
const _mod_1 = await import('./BaseFileManager-
|
|
41
|
-
const _ns_1 = _mod_1.
|
|
42
|
+
const _mod_1 = await import('./BaseFileManager-D-pLXQAp.js');
|
|
43
|
+
const _ns_1 = _mod_1.y;
|
|
42
44
|
const fileManagerMod = _ns_1;
|
|
43
45
|
const { BaseFileManager } = fileManagerMod;
|
|
44
46
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
@@ -57,7 +59,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
57
59
|
const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
58
60
|
const _saveToSchema = async () => {
|
|
59
61
|
// Use dynamic import to break circular dependency
|
|
60
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
62
|
+
const validationServiceMod = await import('./SchemaValidationService-Dc-lpFQX.js');
|
|
61
63
|
const { SchemaValidationService } = validationServiceMod;
|
|
62
64
|
const validationService = new SchemaValidationService();
|
|
63
65
|
// Validate property structure before saving
|
|
@@ -76,15 +78,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context }, self }) => {
|
|
|
76
78
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
77
79
|
}
|
|
78
80
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
79
|
-
const _mod_2 = await import('./
|
|
80
|
-
const _ns_2 = _mod_2.
|
|
81
|
+
const _mod_2 = await import('./Item-BU9wIT7l.js');
|
|
82
|
+
const _ns_2 = _mod_2.bS;
|
|
81
83
|
const dbMod = _ns_2;
|
|
82
84
|
const { savePropertyToDb } = dbMod;
|
|
83
85
|
await savePropertyToDb(context);
|
|
84
86
|
// Mark schema as draft so user knows to save
|
|
85
87
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
86
88
|
if (schemaName) {
|
|
87
|
-
const _mod_3 = await import('./Schema-
|
|
89
|
+
const _mod_3 = await import('./Schema-C_4wv0RP.js');
|
|
88
90
|
const _ns_3 = _mod_3.a;
|
|
89
91
|
const schemaMod = _ns_3;
|
|
90
92
|
const { Schema } = schemaMod;
|
|
@@ -122,8 +124,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
122
124
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
123
125
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
124
126
|
try {
|
|
125
|
-
const _mod_4 = await import('./
|
|
126
|
-
const _ns_4 = _mod_4.
|
|
127
|
+
const _mod_4 = await import('./Item-BU9wIT7l.js');
|
|
128
|
+
const _ns_4 = _mod_4.bP;
|
|
127
129
|
const { resolveModelRecord, resolvePropertyModelRecord } = _ns_4;
|
|
128
130
|
const fromDb = await resolvePropertyModelRecord(schemaFileIdForResolve);
|
|
129
131
|
if (fromDb) {
|
|
@@ -161,8 +163,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
161
163
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
162
164
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
163
165
|
try {
|
|
164
|
-
const _mod_5 = await import('./
|
|
165
|
-
const _ns_5 = _mod_5.
|
|
166
|
+
const _mod_5 = await import('./Item-BU9wIT7l.js');
|
|
167
|
+
const _ns_5 = _mod_5.bS;
|
|
166
168
|
const dbMod = _ns_5;
|
|
167
169
|
const { savePropertyToDb } = dbMod;
|
|
168
170
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
@@ -223,8 +225,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
223
225
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
224
226
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
225
227
|
// Use dynamic import to break circular dependency
|
|
226
|
-
const _mod_6 = await import('./
|
|
227
|
-
const _ns_6 = _mod_6.
|
|
228
|
+
const _mod_6 = await import('./Item-BU9wIT7l.js');
|
|
229
|
+
const _ns_6 = _mod_6.bS;
|
|
228
230
|
const dbMod = _ns_6;
|
|
229
231
|
const { savePropertyToDb } = dbMod;
|
|
230
232
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
@@ -239,7 +241,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
239
241
|
// Mark schema as draft if schema name is available
|
|
240
242
|
if (fullContext._schemaName) {
|
|
241
243
|
// Get the Schema instance and mark it as draft
|
|
242
|
-
const _mod_7 = await import('./Schema-
|
|
244
|
+
const _mod_7 = await import('./Schema-C_4wv0RP.js');
|
|
243
245
|
const _ns_7 = _mod_7.a;
|
|
244
246
|
const schemaMod = _ns_7;
|
|
245
247
|
const { Schema } = schemaMod;
|
|
@@ -259,7 +261,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
259
261
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
260
262
|
// Clear isEdited flag in database
|
|
261
263
|
try {
|
|
262
|
-
const _mod_8 = await import('./index-
|
|
264
|
+
const _mod_8 = await import('./index-2PaIhvOU.js');
|
|
263
265
|
const _ns_8 = _mod_8.s;
|
|
264
266
|
const seedSchemaMod = _ns_8;
|
|
265
267
|
const { properties: propertiesTable } = seedSchemaMod;
|
|
@@ -268,8 +270,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context }, self }
|
|
|
268
270
|
const db = BaseDb.getAppDb();
|
|
269
271
|
if (db && fullContext.modelName && fullContext.name) {
|
|
270
272
|
// Find this property's model (model names are only unique per schema)
|
|
271
|
-
const _mod_9 = await import('./
|
|
272
|
-
const _ns_9 = _mod_9.
|
|
273
|
+
const _mod_9 = await import('./Item-BU9wIT7l.js');
|
|
274
|
+
const _ns_9 = _mod_9.bP;
|
|
273
275
|
const { resolveModelRecord } = _ns_9;
|
|
274
276
|
const modelRecord = await resolveModelRecord(fullContext.modelName, {
|
|
275
277
|
modelId: typeof fullContext.modelId === 'number' ? fullContext.modelId : undefined,
|
|
@@ -326,8 +328,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
326
328
|
const schemaFileId = typeof context.id === 'string' ? context.id : undefined;
|
|
327
329
|
if (schemaFileId && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
328
330
|
try {
|
|
329
|
-
const _mod_10 = await import('./
|
|
330
|
-
const _ns_10 = _mod_10.
|
|
331
|
+
const _mod_10 = await import('./Item-BU9wIT7l.js');
|
|
332
|
+
const _ns_10 = _mod_10.bP;
|
|
331
333
|
const { resolveModelRecord, resolvePropertyModelRecord } = _ns_10;
|
|
332
334
|
// Try pending write first (property row may not exist yet)
|
|
333
335
|
if (fullContext.modelName === undefined && schemaFileId) {
|
|
@@ -360,10 +362,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context }, self }) =
|
|
|
360
362
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
361
363
|
}
|
|
362
364
|
// Use dynamic imports to break circular dependencies
|
|
363
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
365
|
+
const validationServiceMod = await import('./SchemaValidationService-Dc-lpFQX.js');
|
|
364
366
|
const { SchemaValidationService } = validationServiceMod;
|
|
365
367
|
const validationService = new SchemaValidationService();
|
|
366
|
-
const _mod_11 = await import('./Schema-
|
|
368
|
+
const _mod_11 = await import('./Schema-C_4wv0RP.js');
|
|
367
369
|
const _ns_11 = _mod_11.a;
|
|
368
370
|
const schemaMod = _ns_11;
|
|
369
371
|
const { Schema } = schemaMod;
|
|
@@ -870,8 +872,8 @@ class ModelProperty {
|
|
|
870
872
|
return fallbackIsEdited;
|
|
871
873
|
}
|
|
872
874
|
// Find this property's model (by modelId when known; model names are only unique per schema)
|
|
873
|
-
const _mod_12 = await import('./
|
|
874
|
-
const _ns_12 = _mod_12.
|
|
875
|
+
const _mod_12 = await import('./Item-BU9wIT7l.js');
|
|
876
|
+
const _ns_12 = _mod_12.bP;
|
|
875
877
|
const { resolveModelRecord } = _ns_12;
|
|
876
878
|
const modelRecord = await resolveModelRecord(property.modelName, this._ownerModelScope(property), db);
|
|
877
879
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
@@ -908,8 +910,8 @@ class ModelProperty {
|
|
|
908
910
|
return undefined;
|
|
909
911
|
}
|
|
910
912
|
// Resolve the ref within the owning model's schema
|
|
911
|
-
const _mod_13 = await import('./
|
|
912
|
-
const _ns_13 = _mod_13.
|
|
913
|
+
const _mod_13 = await import('./Item-BU9wIT7l.js');
|
|
914
|
+
const _ns_13 = _mod_13.bP;
|
|
913
915
|
const { resolveRefModelRecord } = _ns_13;
|
|
914
916
|
const refModelRecord = await resolveRefModelRecord(refModelName, property ? this._ownerModelScope(property) : { schemaName: this._getSnapshotContext()._schemaName }, db);
|
|
915
917
|
if (refModelRecord?.id) {
|
|
@@ -954,8 +956,8 @@ class ModelProperty {
|
|
|
954
956
|
}
|
|
955
957
|
}
|
|
956
958
|
if (!model && modelId) {
|
|
957
|
-
const _mod_14 = await import('./
|
|
958
|
-
const _ns_14 = _mod_14.
|
|
959
|
+
const _mod_14 = await import('./Item-BU9wIT7l.js');
|
|
960
|
+
const _ns_14 = _mod_14.bP;
|
|
959
961
|
const { resolveModelRecord } = _ns_14;
|
|
960
962
|
const modelFileId = (await resolveModelRecord(property.modelName, { modelId }))?.schemaFileId;
|
|
961
963
|
model = modelFileId ? Model.peek(modelFileId) : undefined;
|
|
@@ -1787,7 +1789,7 @@ class ModelProperty {
|
|
|
1787
1789
|
.where(eq(properties.schemaFileId, propertyFileId))
|
|
1788
1790
|
.limit(1);
|
|
1789
1791
|
if (row) {
|
|
1790
|
-
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-
|
|
1792
|
+
const { detachPropertyRows } = await import('./detachRowsBeforeDelete-Cie55SoG.js');
|
|
1791
1793
|
await detachPropertyRows(db, [row.id]);
|
|
1792
1794
|
await db.delete(properties).where(eq(properties.id, row.id));
|
|
1793
1795
|
}
|
|
@@ -1826,4 +1828,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1826
1828
|
});
|
|
1827
1829
|
|
|
1828
1830
|
export { ModelProperty };
|
|
1829
|
-
//# sourceMappingURL=ModelProperty-
|
|
1831
|
+
//# sourceMappingURL=ModelProperty-Bv7KzP97.js.map
|