@seedprotocol/sdk 0.7.3 → 0.7.4-next.784.g879c6a3
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-Cm4apKRb.js → BasePathResolver-DxdS0wJ0.js} +43 -8
- package/dist/BasePathResolver-DxdS0wJ0.js.map +1 -0
- package/dist/{ClientManager-i3nJASkg.js → ClientManager-De-vKHGe.js} +37 -38
- package/dist/ClientManager-De-vKHGe.js.map +1 -0
- package/dist/{Item-DBFchXpC.js → Item-cq9VcsAY.js} +365 -191
- package/dist/Item-cq9VcsAY.js.map +1 -0
- package/dist/{ModelProperty-BS49g01Y.js → ModelProperty-DuuoFXaC.js} +45 -37
- package/dist/ModelProperty-DuuoFXaC.js.map +1 -0
- package/dist/{Schema-CpMNEnUO.js → Schema-Dc5EA8Yb.js} +246 -68
- package/dist/Schema-Dc5EA8Yb.js.map +1 -0
- package/dist/{SchemaValidationService-DieV4KL-.js → SchemaValidationService-DViJ056F.js} +49 -36
- package/dist/SchemaValidationService-DViJ056F.js.map +1 -0
- package/dist/{backfillMetadataPropertyIds-DSoOoTnX.js → backfillMetadataPropertyIds-DacVthS5.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-DSoOoTnX.js.map → backfillMetadataPropertyIds-DacVthS5.js.map} +1 -1
- package/dist/{configurePlatform-D0lQGAMQ.js → configurePlatform-DlZ23w7e.js} +2 -2
- package/dist/{configurePlatform-D0lQGAMQ.js.map → configurePlatform-DlZ23w7e.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-S0q-DJPT.js → detachRowsBeforeDelete-YRSZY6dO.js} +2 -2
- package/dist/{detachRowsBeforeDelete-S0q-DJPT.js.map → detachRowsBeforeDelete-YRSZY6dO.js.map} +1 -1
- package/dist/{eas-6pjU-OuX.js → eas-D_6ptL_F.js} +4 -4
- package/dist/{eas-6pjU-OuX.js.map → eas-D_6ptL_F.js.map} +1 -1
- package/dist/{index-8O3Uow-Y.js → errors-Cl8rbtKR.js} +192 -48
- package/dist/errors-Cl8rbtKR.js.map +1 -0
- package/dist/{getItem-CxBNZ-WL.js → getItem-BcmJcUZB.js} +5 -5
- package/dist/{getItem-CxBNZ-WL.js.map → getItem-BcmJcUZB.js.map} +1 -1
- package/dist/{getPublishPayload-CTCvRUoU.js → getPublishPayload-C278kK9P.js} +15 -15
- package/dist/{getPublishPayload-CTCvRUoU.js.map → getPublishPayload-C278kK9P.js.map} +1 -1
- package/dist/{getPublishUploads-SFHCbf_y.js → getPublishUploads-DJ1UPh7i.js} +9 -9
- package/dist/{getPublishUploads-SFHCbf_y.js.map → getPublishUploads-DJ1UPh7i.js.map} +1 -1
- package/dist/{index-Cvt5UBz4.js → index-CqnU-5i0.js} +9 -9
- package/dist/index-CqnU-5i0.js.map +1 -0
- package/dist/{index-AVFTVp1m.js → index-DAl9U4rn.js} +2 -2
- package/dist/index-DAl9U4rn.js.map +1 -0
- package/dist/{index.browser-DBhxRoe8.js → index.browser-J6QZ9smP.js} +10 -10
- package/dist/{index.browser-DBhxRoe8.js.map → index.browser-J6QZ9smP.js.map} +1 -1
- package/dist/{index.node-CJhlcNHM.js → index.node-C9VB9NlX.js} +9 -9
- package/dist/index.node-C9VB9NlX.js.map +1 -0
- package/dist/main.js +24 -24
- package/dist/{model-DGMe-TTm.js → model-oHA3YhOd.js} +5 -1
- package/dist/model-oHA3YhOd.js.map +1 -0
- package/dist/node.js +11 -11
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +5 -5
- package/dist/platform.node.js +4 -4
- package/dist/{property-DwPD283A.js → property-Brgr5RdT.js} +11 -11
- package/dist/{property-DwPD283A.js.map → property-Brgr5RdT.js.map} +1 -1
- package/dist/propertyValidationRules-CDRitiiK.js +51 -0
- package/dist/propertyValidationRules-CDRitiiK.js.map +1 -0
- package/dist/{publishDraftGraph-BOn3_Occ.js → publishDraftGraph-C37ibxb5.js} +6 -6
- package/dist/{publishDraftGraph-BOn3_Occ.js.map → publishDraftGraph-C37ibxb5.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-BkYmBeJc.js → resetAmbiguousLegacyItemData-CcLFRREE.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-BkYmBeJc.js.map → resetAmbiguousLegacyItemData-CcLFRREE.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-BL24nLa7.js → resolveModelForSyncedSeed-BTAeCOJE.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-BL24nLa7.js.map → resolveModelForSyncedSeed-BTAeCOJE.js.map} +1 -1
- package/dist/src/Item/Item.d.ts +6 -2
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/errors.d.ts +23 -0
- package/dist/src/Item/errors.d.ts.map +1 -0
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts +19 -0
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +2 -0
- 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 +2 -0
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts +11 -2
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
- package/dist/src/Schema/service/validation/SchemaValidationService.d.ts +4 -1
- package/dist/src/Schema/service/validation/SchemaValidationService.d.ts.map +1 -1
- package/dist/src/db/Db/BaseDb.d.ts +5 -2
- package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/entity/draftSaveErrors.d.ts +4 -0
- package/dist/src/helpers/entity/draftSaveErrors.d.ts.map +1 -0
- package/dist/src/helpers/entity/entityUnload.d.ts +2 -1
- package/dist/src/helpers/entity/entityUnload.d.ts.map +1 -1
- package/dist/src/helpers/entity/evictionEpoch.d.ts +27 -2
- package/dist/src/helpers/entity/evictionEpoch.d.ts.map +1 -1
- package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts.map +1 -1
- package/dist/src/helpers/model.d.ts.map +1 -1
- package/dist/src/helpers/propertyValidationRules.d.ts +12 -0
- package/dist/src/helpers/propertyValidationRules.d.ts.map +1 -0
- package/dist/src/helpers/propertyWriteQueue.d.ts +15 -0
- package/dist/src/helpers/propertyWriteQueue.d.ts.map +1 -0
- package/dist/src/helpers/schema.d.ts.map +1 -1
- package/dist/src/helpers/storageFileName.d.ts +7 -0
- package/dist/src/helpers/storageFileName.d.ts.map +1 -0
- 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 +1 -1
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +1 -0
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +12 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-Bv2Fe38J.js → syncDbWithEas-B-Ho0IOB.js} +50 -27
- package/dist/syncDbWithEas-B-Ho0IOB.js.map +1 -0
- package/dist/{tabEvents-9s2WCYw-.js → tabEvents-BTzckWrN.js} +4 -4
- package/dist/{tabEvents-9s2WCYw-.js.map → tabEvents-BTzckWrN.js.map} +1 -1
- package/dist/{tolerantWebAccess-iUu80pAP.js → tolerantWebAccess-DOm2Xv-f.js} +6 -6
- package/dist/{tolerantWebAccess-iUu80pAP.js.map → tolerantWebAccess-DOm2Xv-f.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-zBfi931j.js → updateSeedRevokedAt-IHXnJI-i.js} +3 -3
- package/dist/{updateSeedRevokedAt-zBfi931j.js.map → updateSeedRevokedAt-IHXnJI-i.js.map} +1 -1
- package/package.json +5 -5
- package/dist/BasePathResolver-Cm4apKRb.js.map +0 -1
- package/dist/ClientManager-i3nJASkg.js.map +0 -1
- package/dist/Item-DBFchXpC.js.map +0 -1
- package/dist/ModelProperty-BS49g01Y.js.map +0 -1
- package/dist/Schema-CpMNEnUO.js.map +0 -1
- package/dist/SchemaValidationService-DieV4KL-.js.map +0 -1
- package/dist/index-8O3Uow-Y.js.map +0 -1
- package/dist/index-AVFTVp1m.js.map +0 -1
- package/dist/index-Cvt5UBz4.js.map +0 -1
- package/dist/index.node-CJhlcNHM.js.map +0 -1
- package/dist/model-DGMe-TTm.js.map +0 -1
- package/dist/syncDbWithEas-Bv2Fe38J.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { startCase, isEqual } from 'lodash-es';
|
|
2
|
-
import { E as BaseDb, l as easSyncProcesses, G as eventEmitter, a8 as isNode, ah as isBrowser, I as BasePathResolver, aA as normalizeAddressConfig, h as appState, aL as downloadAllFilesRequestHandler, aM as downloadAllFilesBinaryRequestHandler, J as BaseFileManager, H as toSnakeCase, s as models$1, r as modelUids, A as seeds, aB as normalizeAddressList, z as schemas, aK as loadModelsFromDbForSchema, aI as addSchemaToDb, aF as isInternalSchema, aN as INTERNAL_SCHEMA_IDS, $ as generateId, aO as linkModelToSchema, n as normalizeDataType, aq as SEED_PROTOCOL_SCHEMA_NAME, q as modelSchemas, m as metadata$1, u as properties, L as resolveItemModelFileId, C as versions, o as htmlEmbeddedImageCoPublish, j as arweaveL1FinalizeJobs, y as publishProcesses, X as normalizePublisher, aP as getWatchedAddressesFromDb, aQ as getOwnedAddressesFromDb, aR as CLIENT_NOT_INITIALIZED } from './BasePathResolver-
|
|
2
|
+
import { E as BaseDb, l as easSyncProcesses, G as eventEmitter, a8 as isNode, ah as isBrowser, I as BasePathResolver, aA as normalizeAddressConfig, h as appState, aL as downloadAllFilesRequestHandler, aM as downloadAllFilesBinaryRequestHandler, J as BaseFileManager, H as toSnakeCase, s as models$1, r as modelUids, A as seeds, aB as normalizeAddressList, z as schemas, aK as loadModelsFromDbForSchema, aI as addSchemaToDb, aF as isInternalSchema, aN as INTERNAL_SCHEMA_IDS, $ as generateId, aO as linkModelToSchema, n as normalizeDataType, aq as SEED_PROTOCOL_SCHEMA_NAME, q as modelSchemas, m as metadata$1, u as properties, L as resolveItemModelFileId, C as versions, o as htmlEmbeddedImageCoPublish, j as arweaveL1FinalizeJobs, y as publishProcesses, X as normalizePublisher, aP as getWatchedAddressesFromDb, aQ as getOwnedAddressesFromDb, aR as CLIENT_NOT_INITIALIZED } from './BasePathResolver-DxdS0wJ0.js';
|
|
3
3
|
import debug from 'debug';
|
|
4
4
|
import { createActor, setup, assign, fromPromise, fromCallback, waitFor } from 'xstate';
|
|
5
|
-
import { x as MachineIds, a2 as ClientManagerEvents, a3 as withLockedItemStorageRow, a4 as getItemStorageFilePath, a5 as writeItemStorageFile, c as compareMetadataRowsLatestFirst, C as ClientManagerState, a6 as resolvePublisherFromSeedRow, J as isLocalUnsealedDraft, I as Item } from './Item-
|
|
5
|
+
import { x as MachineIds, a2 as ClientManagerEvents, a3 as withLockedItemStorageRow, a4 as getItemStorageFilePath, a5 as writeItemStorageFile, c as compareMetadataRowsLatestFirst, C as ClientManagerState, a6 as resolvePublisherFromSeedRow, J as isLocalUnsealedDraft, I as Item } from './Item-cq9VcsAY.js';
|
|
6
6
|
import { eq, inArray, and, isNotNull, ne, desc, countDistinct, isNull, or, like } from 'drizzle-orm';
|
|
7
|
-
import { a as withDbTabLock, i as isLeaderTab, c as postTabMessage, o as onTabMessage, w as whenLeaderTab, l as listenForOtherTabsEvents, s as startTabCoordination, b as withSeedDbLock, p as parseAddressesPersistedPayload, e as emitAcrossTabs, A as ADDRESSES_PERSISTED_EVENT, L as LOCAL_COPIES_REMOVED_EVENT } from './tabEvents-
|
|
7
|
+
import { a as withDbTabLock, i as isLeaderTab, c as postTabMessage, o as onTabMessage, w as whenLeaderTab, l as listenForOtherTabsEvents, s as startTabCoordination, b as withSeedDbLock, p as parseAddressesPersistedPayload, e as emitAcrossTabs, A as ADDRESSES_PERSISTED_EVENT, L as LOCAL_COPIES_REMOVED_EVENT } from './tabEvents-BTzckWrN.js';
|
|
8
8
|
import { seedGatewayConfigFromSeedConfig, setPreferredArweaveReadBaseUrls, resolveSeedGatewayEndpoints, setResolvedSeedGatewayEndpoints, BaseArweaveClient, ensureReadGatewaySelected, DEFAULT_ARWEAVE_HOST } from '@seedprotocol/arweave';
|
|
9
9
|
import { configureEasReadChain, BaseQueryClient, BaseEasClient, GET_SCHEMAS, whenEasReadChainSettled, getEasReadChainId, DEFAULT_EAS_CHAIN_ID, isEasReadChainConfigured, isValidEasAttestationUid } from '@seedprotocol/eas';
|
|
10
10
|
import 'pluralize';
|
|
@@ -108,7 +108,7 @@ const runEasSync = fromPromise(async ({ input, }) => {
|
|
|
108
108
|
requestPayload: input.requestPayload,
|
|
109
109
|
persistedSnapshot: input.runningSnapshot,
|
|
110
110
|
});
|
|
111
|
-
const { runSyncFromEas } = await import('./syncDbWithEas-
|
|
111
|
+
const { runSyncFromEas } = await import('./syncDbWithEas-B-Ho0IOB.js');
|
|
112
112
|
try {
|
|
113
113
|
// Sync checks for rows and then inserts the rest (no unique index on uids), so syncs in
|
|
114
114
|
// different tabs take turns. A sync can run for minutes, so wait without a timeout.
|
|
@@ -471,7 +471,7 @@ const platformClassesInit = fromCallback(({ sendBack, input: { context, event }
|
|
|
471
471
|
}
|
|
472
472
|
// Prefer the condition-resolved factory when available; fall back to explicit
|
|
473
473
|
// platform imports so source/vitest resolution stays reliable.
|
|
474
|
-
const { configurePlatform } = await import('./configurePlatform-
|
|
474
|
+
const { configurePlatform } = await import('./configurePlatform-DlZ23w7e.js');
|
|
475
475
|
if (isBrowser()) {
|
|
476
476
|
const { createPlatformServices } = await import('./platform.browser.js');
|
|
477
477
|
configurePlatform(createPlatformServices());
|
|
@@ -732,12 +732,12 @@ const fileSystemInit = fromCallback(({ sendBack, input: { context }, }) => {
|
|
|
732
732
|
const logger$9 = debug('seedSdk:client:actors:dbInit');
|
|
733
733
|
const dbInit = fromCallback(({ sendBack, input: { context } }) => {
|
|
734
734
|
const _dbInit = async () => {
|
|
735
|
-
const { filesDir } = context;
|
|
735
|
+
const { filesDir, dbConfig } = context;
|
|
736
736
|
if (!filesDir) {
|
|
737
737
|
throw new Error('filesDir is required');
|
|
738
738
|
}
|
|
739
739
|
// Prepare databases - this handles all initialization, migration, and file setup
|
|
740
|
-
await BaseDb.prepareDb(filesDir);
|
|
740
|
+
await BaseDb.prepareDb(filesDir, dbConfig);
|
|
741
741
|
// Verify database is ready
|
|
742
742
|
const appDb = BaseDb.getAppDb();
|
|
743
743
|
if (!appDb) {
|
|
@@ -1378,7 +1378,8 @@ async function listCompleteSchemaFiles() {
|
|
|
1378
1378
|
const schemas = [];
|
|
1379
1379
|
for (const file of files) {
|
|
1380
1380
|
// Match filename pattern: {schemaFileId}_{schemaName}_v{version}.json
|
|
1381
|
-
|
|
1381
|
+
// Ids have no underscores but names can ("My_Schema"), so the id group stops at the first one
|
|
1382
|
+
const match = file.match(/^(.+?)_(.+)_v(\d+)\.json$/);
|
|
1382
1383
|
if (match) {
|
|
1383
1384
|
const [, schemaFileId, schemaName, versionStr] = match;
|
|
1384
1385
|
const version = parseInt(versionStr, 10);
|
|
@@ -1752,11 +1753,9 @@ function getSchemaNameFromId(schemaId) {
|
|
|
1752
1753
|
if (!schemaId) {
|
|
1753
1754
|
return null;
|
|
1754
1755
|
}
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}
|
|
1759
|
-
return schemaId.substring(0, lastDashIndex);
|
|
1756
|
+
// Only a numeric version suffix: names may contain hyphens ("my-app" must stay "my-app").
|
|
1757
|
+
const match = /^(.+)-(\d+)$/.exec(schemaId);
|
|
1758
|
+
return match ? match[1] : null;
|
|
1760
1759
|
}
|
|
1761
1760
|
|
|
1762
1761
|
var schema = /*#__PURE__*/Object.freeze({
|
|
@@ -1873,8 +1872,8 @@ function getRefValueType(prop) {
|
|
|
1873
1872
|
* @returns Promise that resolves when properties are found, or rejects if not found after max retries
|
|
1874
1873
|
*/
|
|
1875
1874
|
const verifyPropertiesPersisted = async (db, modelId, modelName, maxRetries = 10, retryDelay = 100) => {
|
|
1876
|
-
const _mod_0 = await import('./BasePathResolver-
|
|
1877
|
-
const _ns_0 = _mod_0.
|
|
1875
|
+
const _mod_0 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
1876
|
+
const _ns_0 = _mod_0.a_;
|
|
1878
1877
|
const modelSchemaMod = _ns_0;
|
|
1879
1878
|
const { properties: propertiesTable } = modelSchemaMod;
|
|
1880
1879
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2221,8 +2220,8 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
2221
2220
|
// Check DB for existing schema by name+version (same as minimal path)
|
|
2222
2221
|
const db = BaseDb.getAppDb();
|
|
2223
2222
|
if (db) {
|
|
2224
|
-
const _mod_1 = await import('./BasePathResolver-
|
|
2225
|
-
const _ns_1 = _mod_1.
|
|
2223
|
+
const _mod_1 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2224
|
+
const _ns_1 = _mod_1.b0;
|
|
2226
2225
|
const schemaSchemaMod = _ns_1;
|
|
2227
2226
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
2228
2227
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2306,8 +2305,8 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
2306
2305
|
// For minimal imports: check DB for existing schema before creating new file
|
|
2307
2306
|
const db = BaseDb.getAppDb();
|
|
2308
2307
|
if (db) {
|
|
2309
|
-
const _mod_2 = await import('./BasePathResolver-
|
|
2310
|
-
const _ns_2 = _mod_2.
|
|
2308
|
+
const _mod_2 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2309
|
+
const _ns_2 = _mod_2.b0;
|
|
2311
2310
|
const schemaSchemaMod = _ns_2;
|
|
2312
2311
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
2313
2312
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2485,8 +2484,8 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
2485
2484
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
2486
2485
|
};
|
|
2487
2486
|
// Use dynamic import to break circular dependency
|
|
2488
|
-
const _mod_3 = await import('./BasePathResolver-
|
|
2489
|
-
const _ns_3 = _mod_3.
|
|
2487
|
+
const _mod_3 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2488
|
+
const _ns_3 = _mod_3.b3;
|
|
2490
2489
|
const dbMod = _ns_3;
|
|
2491
2490
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
2492
2491
|
// Try to add schema and models to database if database is available
|
|
@@ -2507,12 +2506,12 @@ async function importJsonSchema(importFilePathOrContents, version = 1) {
|
|
|
2507
2506
|
});
|
|
2508
2507
|
// Verify expected models are linked (single attempt - addModelsToDb already confirmed)
|
|
2509
2508
|
const expectedModelNames = Object.keys(schemaFile.models || {});
|
|
2510
|
-
const _mod_4 = await import('./BasePathResolver-
|
|
2511
|
-
const _ns_4 = _mod_4.
|
|
2509
|
+
const _mod_4 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2510
|
+
const _ns_4 = _mod_4.b1;
|
|
2512
2511
|
const modelSchemaSchemaMod = _ns_4;
|
|
2513
2512
|
const { modelSchemas } = modelSchemaSchemaMod;
|
|
2514
|
-
const _mod_5 = await import('./BasePathResolver-
|
|
2515
|
-
const _ns_5 = _mod_5.
|
|
2513
|
+
const _mod_5 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2514
|
+
const _ns_5 = _mod_5.a_;
|
|
2516
2515
|
const modelSchemaMod = _ns_5;
|
|
2517
2516
|
const { models: modelsTable } = modelSchemaMod;
|
|
2518
2517
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2710,8 +2709,8 @@ async function applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, prope
|
|
|
2710
2709
|
createdAt: new Date(schemaFile.metadata.createdAt).getTime(),
|
|
2711
2710
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
2712
2711
|
};
|
|
2713
|
-
const _mod_6 = await import('./BasePathResolver-
|
|
2714
|
-
const _ns_6 = _mod_6.
|
|
2712
|
+
const _mod_6 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2713
|
+
const _ns_6 = _mod_6.b3;
|
|
2715
2714
|
const dbMod = _ns_6;
|
|
2716
2715
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
2717
2716
|
const db = BaseDb.getAppDb();
|
|
@@ -2878,12 +2877,12 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
2878
2877
|
]));
|
|
2879
2878
|
const { schemaRecord } = await applySchemaToDb(schemaFile, modelDefinitions, modelFileIds, propertyFileIds, propertyDefinitions);
|
|
2880
2879
|
// Query the database to get model IDs that were just created
|
|
2881
|
-
const _mod_7 = await import('./BasePathResolver-
|
|
2882
|
-
const _ns_7 = _mod_7.
|
|
2880
|
+
const _mod_7 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2881
|
+
const _ns_7 = _mod_7.b1;
|
|
2883
2882
|
const modelSchemaSchemaMod = _ns_7;
|
|
2884
2883
|
const { modelSchemas } = modelSchemaSchemaMod;
|
|
2885
|
-
const _mod_8 = await import('./BasePathResolver-
|
|
2886
|
-
const _ns_8 = _mod_8.
|
|
2884
|
+
const _mod_8 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2885
|
+
const _ns_8 = _mod_8.a_;
|
|
2887
2886
|
const modelSchemaMod = _ns_8;
|
|
2888
2887
|
const { models: modelsTable } = modelSchemaMod;
|
|
2889
2888
|
const drizzleMod = await import('drizzle-orm');
|
|
@@ -2948,8 +2947,8 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
2948
2947
|
// After properties are created (file path), ensure schemaFile has the correct IDs from database
|
|
2949
2948
|
// Query the database to get the actual schemaFileId values that were used
|
|
2950
2949
|
// This ensures schemaData matches what's actually in the database
|
|
2951
|
-
const _mod_9 = await import('./BasePathResolver-
|
|
2952
|
-
const _ns_9 = _mod_9.
|
|
2950
|
+
const _mod_9 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2951
|
+
const _ns_9 = _mod_9.a_;
|
|
2953
2952
|
const modelSchemaMod2 = _ns_9;
|
|
2954
2953
|
const { properties: propertiesTable } = modelSchemaMod2;
|
|
2955
2954
|
let schemaFileUpdated = false;
|
|
@@ -2984,8 +2983,8 @@ const loadSchemaFromFile = async (schemaFilePath) => {
|
|
|
2984
2983
|
// This is important even if nothing changed, to ensure consistency
|
|
2985
2984
|
const updatedSchemaData = JSON.stringify(schemaFile, null, 2);
|
|
2986
2985
|
// Update the schema record in the database with current schemaData
|
|
2987
|
-
const _mod_10 = await import('./BasePathResolver-
|
|
2988
|
-
const _ns_10 = _mod_10.
|
|
2986
|
+
const _mod_10 = await import('./BasePathResolver-DxdS0wJ0.js');
|
|
2987
|
+
const _ns_10 = _mod_10.b0;
|
|
2989
2988
|
const schemaSchemaMod = _ns_10;
|
|
2990
2989
|
const { schemas: schemasTable } = schemaSchemaMod;
|
|
2991
2990
|
await db
|
|
@@ -3094,8 +3093,8 @@ const jsonPropertiesToSchemaProperties = (modelName, modelDef, propertyFileIds)
|
|
|
3094
3093
|
*/
|
|
3095
3094
|
const createModelFromJson = async (modelName, modelDef, schemaName, modelFileId, // Optional modelFileId from JSON file
|
|
3096
3095
|
propertyFileIds) => {
|
|
3097
|
-
const _mod_11 = await import('./
|
|
3098
|
-
const _ns_11 = _mod_11.
|
|
3096
|
+
const _mod_11 = await import('./errors-Cl8rbtKR.js');
|
|
3097
|
+
const _ns_11 = _mod_11.h;
|
|
3099
3098
|
const modelMod = _ns_11;
|
|
3100
3099
|
const { Model } = modelMod;
|
|
3101
3100
|
const convertedProperties = jsonPropertiesToSchemaProperties(modelName, modelDef, propertyFileIds);
|
|
@@ -5152,4 +5151,4 @@ var ClientManager$1 = /*#__PURE__*/Object.freeze({
|
|
|
5152
5151
|
});
|
|
5153
5152
|
|
|
5154
5153
|
export { requestEasSyncFromModelsInit as A, sendEasSyncClientRequest as B, ClientManager as C, startEasSyncActor as D, EAS_CHAIN_ID_APP_STATE_KEY as E, unregisterSeedQueryLocalSource as F, createModelsFromJson as G, getLatestSchemaVersion as H, INIT_CONFIG_CONFLICT_MESSAGE as I, jsonPropertiesToSchemaProperties as J, schema as K, ClientManager$1 as L, SEEDPROTOCOL_Seed_Protocol_v1 as S, assertLocalDbChain as a, importJsonSchema as b, convertVerbatimItemStorageRow as c, getContentHash as d, claimUnpublishedDrafts as e, createLocalQueryDataSource as f, getRefValueType as g, createSchema as h, isVerbatimItemStorageDraftRow as i, easSyncActor as j, getClient as k, loadSchemaFromFile as l, getPublishedSeedRecord as m, getSchemaNameFromId as n, isSeedQueryLocalSourceRegistered as o, listCompleteSchemaFiles as p, loadAllSchemasFromDb as q, readJsonImportFile as r, syncSchemaFromSource as s, transformImportToSchemaFile as t, mergeEasSyncRequestIntents as u, readSchema as v, waitForEasReadChain as w, registerSeedQueryLocalSource as x, requestEasSyncFromAddressChange as y, requestEasSyncFromEventBus as z };
|
|
5155
|
-
//# sourceMappingURL=ClientManager-
|
|
5154
|
+
//# sourceMappingURL=ClientManager-De-vKHGe.js.map
|