@seedprotocol/sdk 0.7.9 → 0.7.10-next.1353.g74aeeed
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-BAlySv8w.js → BaseFileManager-DLou1TZS.js} +5 -1
- package/dist/BaseFileManager-DLou1TZS.js.map +1 -0
- package/dist/{Item-Bf4kWKpH.js → Item-oPnmIehk.js} +571 -346
- package/dist/Item-oPnmIehk.js.map +1 -0
- package/dist/{ModelProperty-BlaEgb_U.js → ModelProperty-D2vJozmW.js} +95 -62
- package/dist/ModelProperty-D2vJozmW.js.map +1 -0
- package/dist/{Schema-J_1f6p0c.js → Schema-BMXRF4j9.js} +88 -52
- package/dist/Schema-BMXRF4j9.js.map +1 -0
- package/dist/{SchemaValidationService-CnmKyzR-.js → SchemaValidationService-CieGrj5c.js} +5 -5
- package/dist/{SchemaValidationService-CnmKyzR-.js.map → SchemaValidationService-CieGrj5c.js.map} +1 -1
- package/dist/{errors-C1qUEZ7A.js → browserSupport-C64rX-2I.js} +38 -2
- package/dist/browserSupport-C64rX-2I.js.map +1 -0
- package/dist/{configurePlatform-CiOJ1R3q.js → configurePlatform-WkmvqeTO.js} +2 -2
- package/dist/{configurePlatform-CiOJ1R3q.js.map → configurePlatform-WkmvqeTO.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-sEaUwlOU.js → detachRowsBeforeDelete-BZr_0iZU.js} +2 -2
- package/dist/{detachRowsBeforeDelete-sEaUwlOU.js.map → detachRowsBeforeDelete-BZr_0iZU.js.map} +1 -1
- package/dist/dist/{BaseFileManager-BAlySv8w.d.ts → BaseFileManager-DLou1TZS.d.ts} +3 -1
- package/dist/dist/BaseFileManager-DLou1TZS.d.ts.map +1 -0
- package/dist/dist/{configurePlatform-CiOJ1R3q.d.ts → configurePlatform-WkmvqeTO.d.ts} +1 -1
- package/dist/dist/configurePlatform-WkmvqeTO.d.ts.map +1 -0
- package/dist/dist/{index-D0V-mjCV.d.ts → index-BjWk0x4-.d.ts} +1 -1
- package/dist/dist/{index-D0V-mjCV.d.ts.map → index-BjWk0x4-.d.ts.map} +1 -1
- package/dist/dist/{index.node-CYPemH-t.d.ts → index.node-BfiBriEq.d.ts} +7 -1
- package/dist/dist/{index.node-CYPemH-t.d.ts.map → index.node-BfiBriEq.d.ts.map} +1 -1
- package/dist/dist/platform.node.d.ts +2 -2
- package/dist/{eas-wB_fQ8Tc.js → eas-FZPPqxqe.js} +5 -5
- package/dist/{eas-wB_fQ8Tc.js.map → eas-FZPPqxqe.js.map} +1 -1
- package/dist/{errors-DLSoqSHG.js → errors-CnT0fSMK.js} +185 -97
- package/dist/errors-CnT0fSMK.js.map +1 -0
- package/dist/{getPublishPayload-BnIwpwz1.js → getPublishPayload-DKuEaq96.js} +8 -8
- package/dist/{getPublishPayload-BnIwpwz1.js.map → getPublishPayload-DKuEaq96.js.map} +1 -1
- package/dist/{getPublishPendingDiff-D6_-A5ns.js → getPublishPendingDiff-CH5xLMjU.js} +7 -7
- package/dist/{getPublishPendingDiff-D6_-A5ns.js.map → getPublishPendingDiff-CH5xLMjU.js.map} +1 -1
- package/dist/{getPublishUploads-sS6JfPgz.js → getPublishUploads-DivYpgNw.js} +7 -7
- package/dist/{getPublishUploads-sS6JfPgz.js.map → getPublishUploads-DivYpgNw.js.map} +1 -1
- package/dist/{index-D0V-mjCV.js → index-BjWk0x4-.js} +2 -2
- package/dist/index-BjWk0x4-.js.map +1 -0
- package/dist/{index-CYGWPoOx.js → index-CZMWKXLM.js} +7 -7
- package/dist/index-CZMWKXLM.js.map +1 -0
- package/dist/{index-BVBmz_cc.js → index-DXRhFg1N.js} +7 -7
- package/dist/index-DXRhFg1N.js.map +1 -0
- package/dist/{index-DmTtj1nk.js → index-Gh42_47r.js} +402 -20
- package/dist/index-Gh42_47r.js.map +1 -0
- package/dist/{index.browser-CUmBVYen.js → index.browser-DQstVvRV.js} +46 -10
- package/dist/index.browser-DQstVvRV.js.map +1 -0
- package/dist/{index.node-CYPemH-t.js → index.node-BfiBriEq.js} +31 -4
- package/dist/index.node-BfiBriEq.js.map +1 -0
- package/dist/main.js +17 -16
- package/dist/main.js.map +1 -1
- package/dist/{modelPropertyRecordSchemas-C7UgA5TH.js → modelPropertyRecordSchemas-DEe-lYhn.js} +5 -5
- package/dist/{modelPropertyRecordSchemas-C7UgA5TH.js.map → modelPropertyRecordSchemas-DEe-lYhn.js.map} +1 -1
- package/dist/node.js +8 -8
- package/dist/platform.browser.js +6 -6
- package/dist/platform.node.js +4 -4
- package/dist/{property-BxUYznH0.js → property-iNW1N3vm.js} +8 -8
- package/dist/{property-BxUYznH0.js.map → property-iNW1N3vm.js.map} +1 -1
- package/dist/{publishGraph-EcB40Uii.js → publishGraph-CRn_N3NT.js} +5 -5
- package/dist/{publishGraph-EcB40Uii.js.map → publishGraph-CRn_N3NT.js.map} +1 -1
- package/dist/{readHtmlBodyForStorageSeed-D6KPtWoR.js → readHtmlBodyForStorageSeed-B7HgPmq6.js} +10 -10
- package/dist/{readHtmlBodyForStorageSeed-D6KPtWoR.js.map → readHtmlBodyForStorageSeed-B7HgPmq6.js.map} +1 -1
- package/dist/src/Item/Item.d.ts +26 -5
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +20 -5
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/loadProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/propertyWrite.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +45 -34
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +31 -13
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts +36 -27
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/archive/exportArchive.d.ts +57 -0
- package/dist/src/archive/exportArchive.d.ts.map +1 -0
- package/dist/src/browser/db/Db.d.ts +5 -0
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/browser/helpers/tolerantWebAccess.d.ts +12 -1
- package/dist/src/browser/helpers/tolerantWebAccess.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +14 -4
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/db/Db/BaseDb.d.ts +2 -0
- package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/errors.d.ts +11 -0
- package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
- package/dist/src/helpers/browserSupport.d.ts +23 -0
- package/dist/src/helpers/browserSupport.d.ts.map +1 -0
- package/dist/src/helpers/cachedPropertyRefresh.d.ts +6 -6
- package/dist/src/helpers/cachedPropertyRefresh.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityCache.d.ts +45 -3
- package/dist/src/helpers/entity/entityCache.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityLifecycle.d.ts +21 -3
- package/dist/src/helpers/entity/entityLifecycle.d.ts.map +1 -1
- package/dist/src/helpers/propertyDefinition.d.ts +2 -0
- package/dist/src/helpers/propertyDefinition.d.ts.map +1 -1
- package/dist/src/helpers/schemaApply.d.ts.map +1 -1
- package/dist/src/helpers/tabCoordinator.d.ts +9 -2
- package/dist/src/helpers/tabCoordinator.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/interfaces/IDb.d.ts +6 -0
- package/dist/src/interfaces/IDb.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts +6 -0
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/outbox/conflicts.d.ts.map +1 -1
- package/dist/src/outbox/outbox.d.ts +6 -0
- package/dist/src/outbox/outbox.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +16 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CA7PvBgu.js → syncDbWithEas-FuyqoEKk.js} +14 -14
- package/dist/{syncDbWithEas-CA7PvBgu.js.map → syncDbWithEas-FuyqoEKk.js.map} +1 -1
- package/dist/{tabEvents-CaVmngqr.js → tabEvents-DT5ez6io.js} +38 -12
- package/dist/tabEvents-DT5ez6io.js.map +1 -0
- package/dist/{tolerantWebAccess-BJqViq08.js → tolerantWebAccess-zEseJ2zT.js} +53 -13
- package/dist/tolerantWebAccess-zEseJ2zT.js.map +1 -0
- package/dist/{updateSeedRevokedAt-BL9Bg-G7.js → updateSeedRevokedAt-B9JRwr5T.js} +3 -3
- package/dist/{updateSeedRevokedAt-BL9Bg-G7.js.map → updateSeedRevokedAt-B9JRwr5T.js.map} +1 -1
- package/package.json +10 -12
- package/dist/BaseFileManager-BAlySv8w.js.map +0 -1
- package/dist/Item-Bf4kWKpH.js.map +0 -1
- package/dist/ModelProperty-BlaEgb_U.js.map +0 -1
- package/dist/Schema-J_1f6p0c.js.map +0 -1
- package/dist/dist/BaseFileManager-BAlySv8w.d.ts.map +0 -1
- package/dist/dist/configurePlatform-CiOJ1R3q.d.ts.map +0 -1
- package/dist/errors-C1qUEZ7A.js.map +0 -1
- package/dist/errors-DLSoqSHG.js.map +0 -1
- package/dist/index-BVBmz_cc.js.map +0 -1
- package/dist/index-CYGWPoOx.js.map +0 -1
- package/dist/index-D0V-mjCV.js.map +0 -1
- package/dist/index-DmTtj1nk.js.map +0 -1
- package/dist/index.browser-CUmBVYen.js.map +0 -1
- package/dist/index.node-CYPemH-t.js.map +0 -1
- package/dist/tabEvents-CaVmngqr.js.map +0 -1
- package/dist/tolerantWebAccess-BJqViq08.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as fsAsync from 'fs/promises';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import fs__default from 'fs';
|
|
4
|
-
import { w as BaseFileManager, x as isSqliteBusyError, S as SQLITE_BUSY_RETRY_DELAYS_MS, B as BaseDb, a as appState } from './BaseFileManager-
|
|
4
|
+
import { w as BaseFileManager, x as isSqliteBusyError, S as SQLITE_BUSY_RETRY_DELAYS_MS, B as BaseDb, a as appState } from './BaseFileManager-DLou1TZS.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { pathToFileURL } from 'url';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import debug from 'debug';
|
|
9
|
-
import { s as schema } from './index-
|
|
9
|
+
import { s as schema } from './index-BjWk0x4-.js';
|
|
10
10
|
import { createClient } from '@libsql/client';
|
|
11
11
|
import { drizzle } from 'drizzle-orm/libsql';
|
|
12
12
|
import { migrate } from 'drizzle-orm/libsql/migrator';
|
|
@@ -15,7 +15,7 @@ import { r as recreateIfOlderThanMinimumUpgradeVersion } from './minimumUpgradeV
|
|
|
15
15
|
import { DefaultArweaveClient } from '@seedprotocol/arweave';
|
|
16
16
|
import { DefaultQueryClient } from '@seedprotocol/eas';
|
|
17
17
|
import { NodeEasClient } from '@seedprotocol/eas/node';
|
|
18
|
-
import './configurePlatform-
|
|
18
|
+
import './configurePlatform-WkmvqeTO.js';
|
|
19
19
|
|
|
20
20
|
class NodeFileManager {
|
|
21
21
|
async getFs() {
|
|
@@ -360,6 +360,10 @@ const localDbFilePath = (dbUrl) => {
|
|
|
360
360
|
return filePath.startsWith('//') ? filePath.replace(/^\/\/(localhost)?/, '') : filePath;
|
|
361
361
|
};
|
|
362
362
|
class NodeDb {
|
|
363
|
+
constructor() {
|
|
364
|
+
/** Bumped by close(), so a prepareDb that was running closes what it opened instead of keeping it. */
|
|
365
|
+
this.openGeneration = 0;
|
|
366
|
+
}
|
|
363
367
|
getAppDb() {
|
|
364
368
|
return this.db;
|
|
365
369
|
}
|
|
@@ -400,7 +404,10 @@ class NodeDb {
|
|
|
400
404
|
if (dbFilePath) {
|
|
401
405
|
fs__default.mkdirSync(path.dirname(dbFilePath), { recursive: true });
|
|
402
406
|
}
|
|
407
|
+
const generation = this.openGeneration;
|
|
408
|
+
this.closeOpenDb();
|
|
403
409
|
const client = createClient({ url: dbUrl });
|
|
410
|
+
this.client = client;
|
|
404
411
|
// One connection for everything, transactions included (see singleConnectionTransactions)
|
|
405
412
|
this.transactions = createSingleConnectionTransactions(client, schema);
|
|
406
413
|
// Readers in other processes (a CLI on the same file) don't block a commit in WAL
|
|
@@ -410,9 +417,29 @@ class NodeDb {
|
|
|
410
417
|
await recreateIfOlderThanMinimumUpgradeVersion(db);
|
|
411
418
|
logger('[Db.prepareDb] running migrations from %s', outDir);
|
|
412
419
|
await migrate(db, { migrationsFolder: outDir });
|
|
420
|
+
if (generation !== this.openGeneration) {
|
|
421
|
+
if (this.client === client)
|
|
422
|
+
this.closeOpenDb();
|
|
423
|
+
else
|
|
424
|
+
client.close();
|
|
425
|
+
throw new Error('The database was closed while it was being opened');
|
|
426
|
+
}
|
|
413
427
|
this.db = db;
|
|
414
428
|
return this.db;
|
|
415
429
|
}
|
|
430
|
+
async close() {
|
|
431
|
+
this.openGeneration++;
|
|
432
|
+
this.closeOpenDb();
|
|
433
|
+
}
|
|
434
|
+
/** Closes the libsql client and forgets the database. */
|
|
435
|
+
closeOpenDb() {
|
|
436
|
+
const client = this.client;
|
|
437
|
+
this.db = undefined;
|
|
438
|
+
this.transactions = undefined;
|
|
439
|
+
this.client = undefined;
|
|
440
|
+
if (client && !client.closed)
|
|
441
|
+
client.close();
|
|
442
|
+
}
|
|
416
443
|
async connectToDb(_pathToDir) {
|
|
417
444
|
return {
|
|
418
445
|
id: this.db ? this.db.constructor.name : '',
|
|
@@ -534,4 +561,4 @@ function createPlatformServices() {
|
|
|
534
561
|
}
|
|
535
562
|
|
|
536
563
|
export { Db as D, FileManager as F, resolveFilesDir as a, createPlatformServices as c, resolveSdkDrizzleMigrationsDir as r };
|
|
537
|
-
//# sourceMappingURL=index.node-
|
|
564
|
+
//# sourceMappingURL=index.node-BfiBriEq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node-BfiBriEq.js","sources":["../../src/node/helpers/FileManager.ts","../../src/node/db/singleConnectionTransactions.ts","../../src/node/db/Db.ts","../../src/node/helpers/dotSeedDir.ts","../../src/helpers/dotSeedPath.ts","../../src/node/helpers/resolveFilesDir.ts","../../src/platform/index.node.ts"],"sourcesContent":["import * as fsAsync from 'fs/promises'\nimport * as fs from 'fs'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport type { IFileManager } from '@/helpers/FileManager/IFileManager'\nimport path from 'path'\nimport { pathToFileURL } from 'url'\n\nexport class NodeFileManager implements IFileManager {\n async getFs() {\n return fs\n }\n\n getFsSync() {\n return fs\n }\n\n /** Node has no blob URLs; a file:// URL keeps refResolvedDisplayValue meaningful for server callers. */\n async getContentUrlFromPath(filePath: string): Promise<string | undefined> {\n return pathToFileURL(path.resolve(filePath)).href\n }\n\n async initializeFileSystem(_workingDir?: string): Promise<void> {\n return // No need to initialize file system in node\n }\n\n async downloadAllFiles(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async resizeImage(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async resizeAllImages(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async pathExists(filePath: string): Promise<boolean> {\n return await fsAsync.access(filePath).then(() => true).catch(() => false)\n }\n\n /** Node reads the real file system; nothing is cached. */\n async invalidateCachedPaths(): Promise<void> {}\n\n async getFileSize(filePath: string): Promise<number | null> {\n try {\n const stat = await fsAsync.stat(filePath)\n return stat.size\n } catch {\n return null\n }\n }\n\n async listImageFiles(): Promise<string[]> {\n return this.listFiles('images')\n }\n\n async listFiles(dir: string): Promise<string[]> {\n const targetDir = BaseFileManager.getFilesPath(dir)\n const exists = await this.pathExists(targetDir)\n if (!exists) {\n return []\n }\n const entries = await fsAsync.readdir(targetDir, { withFileTypes: true })\n return entries.filter((entry) => entry.isFile()).map((entry) => entry.name)\n }\n\n async createDirIfNotExists(filePath: string): Promise<void> {\n await fsAsync.mkdir(filePath, { recursive: true })\n }\n\n async waitForFile(filePath: string, interval: number = 1000, timeout: number = 60000): Promise<boolean> {\n const pathExists = await this.pathExists(filePath)\n if (pathExists) {\n return true\n }\n\n return new Promise((resolve, reject) => {\n const startTime = Date.now()\n let isBusy = false\n\n const checkInterval = setInterval(async () => {\n if (isBusy) {\n return\n }\n isBusy = true\n\n try {\n const exists = await this.pathExists(filePath)\n if (exists) {\n clearInterval(checkInterval)\n resolve(true)\n return\n }\n\n if (Date.now() - startTime >= timeout) {\n clearInterval(checkInterval)\n reject(new Error('Timeout exceeded while waiting for file'))\n return\n }\n } catch (error) {\n clearInterval(checkInterval)\n reject(error)\n return\n } finally {\n isBusy = false\n }\n }, interval)\n })\n }\n\n async waitForFileWithContent(filePath: string, interval: number = 100, timeout: number = 5000): Promise<boolean> {\n return this.waitForFile(filePath, interval, timeout)\n }\n\n async saveFile(filePath: string, content: string | Blob | ArrayBuffer): Promise<void> {\n const dir = path.dirname(filePath)\n await fsAsync.mkdir(dir, { recursive: true })\n\n if (typeof content === 'string') {\n await fsAsync.writeFile(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n const arrayBuffer = await content.arrayBuffer()\n await fsAsync.writeFile(filePath, new Uint8Array(arrayBuffer))\n } else if (content instanceof ArrayBuffer) {\n await fsAsync.writeFile(filePath, new Uint8Array(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n saveFileSync(filePath: string, content: string | Blob | ArrayBuffer): void {\n const dir = path.dirname(filePath)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n\n if (typeof content === 'string') {\n fs.writeFileSync(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n throw new Error('Blob content not supported in saveFileSync. Use saveFile() instead or convert to ArrayBuffer first.')\n } else if (content instanceof ArrayBuffer) {\n fs.writeFileSync(filePath, new Uint8Array(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n async readFileAsBuffer(filePath: string): Promise<Buffer> {\n return await fsAsync.readFile(filePath)\n }\n\n async readFileAsString(filePath: string): Promise<string> {\n return await fsAsync.readFile(filePath, 'utf-8')\n }\n\n async readFile(filePath: string): Promise<File> {\n return new File([await fsAsync.readFile(filePath)], filePath)\n }\n\n readFileSync(filePath: string): File {\n return new File([fs.readFileSync(filePath)], filePath)\n }\n\n getParentDirPath(filePath: string): string {\n return path.dirname(filePath)\n }\n\n getFilenameFromPath(filePath: string): string {\n return path.basename(filePath)\n }\n\n getPathModule(): any {\n return path\n }\n}\n\n/** @deprecated Prefer NodeFileManager */\nexport const FileManager = NodeFileManager\n\nBaseFileManager.configure(new NodeFileManager())\n\nconst _check: IFileManager = new NodeFileManager()\nvoid _check\n","import type { Client } from '@libsql/client'\nimport { drizzle } from 'drizzle-orm/libsql'\nimport { isSqliteBusyError, SQLITE_BUSY_RETRY_DELAYS_MS } from '@/browser/db/sqliteBusyRetry'\n\n/**\n * Transactions on libsql's one connection, with the browser's semantics (ADR 0019).\n *\n * libsql's own `transaction()` hands the transaction the client's connection and opens a new one\n * for everything after, so a process ends up with several connections that lock each other out\n * (SQLITE_BUSY) and, in tests, lost an outbox op's committed insert. Here every statement uses the\n * client's single connection instead:\n *\n * - `transaction(fn)` runs one transaction at a time: BEGIN IMMEDIATE, `fn` on a Drizzle database\n * whose statements go straight to the connection, then COMMIT, or ROLLBACK when `fn` throws.\n * - Statements on the app database (the patched client) wait while a transaction is open, as\n * SQLocal makes them wait in the browser. So `fn` must not use the app database: it would wait\n * for its own transaction.\n * - Statements outside a transaction keep the busy retry: another process may hold the file.\n *\n * libsql 0.5 doesn't reset a statement that failed with SQLITE_BUSY, and that leaves its\n * connection in an implicit transaction that never commits: every later write on it is lost when it\n * closes and never reaches the file (`inTransaction` still reads false). So after a busy error the\n * connection is replaced (`reconnect()`) before anything else runs on it, and a transaction waits\n * for statements that are between attempts.\n */\nexport function createSingleConnectionTransactions(client: Client, schema: Record<string, unknown>) {\n const execute = client.execute.bind(client)\n const batch = client.batch.bind(client)\n\n /** Resolves when the open transaction ends; undefined when none is open. */\n let open: Promise<void> | undefined\n /** The transactions waiting their turn, chained. */\n let queue: Promise<void> = Promise.resolve()\n\n const outsideTransactions = async () => {\n while (open) await open\n }\n\n /** Statements outside transactions that are running or replacing a busy connection. */\n let statementsRunning = 0\n const whenStatementsDone: (() => void)[] = []\n const statementsDone = () =>\n statementsRunning === 0 ? Promise.resolve() : new Promise<void>((resolve) => whenStatementsDone.push(resolve))\n\n const statement = async <T>(run: () => Promise<T>): Promise<T> => {\n for (let attempt = 0; ; attempt++) {\n await outsideTransactions()\n statementsRunning++\n try {\n return await run()\n } catch (error) {\n if (!isSqliteBusyError(error) || attempt >= SQLITE_BUSY_RETRY_DELAYS_MS.length) throw error\n await client.reconnect()\n } finally {\n if (--statementsRunning === 0) for (const resolve of whenStatementsDone.splice(0)) resolve()\n }\n await new Promise((resolve) => setTimeout(resolve, SQLITE_BUSY_RETRY_DELAYS_MS[attempt]))\n }\n }\n\n client.execute = ((...args: Parameters<Client['execute']>) => statement(() => execute(...args))) as Client['execute']\n client.batch = ((...args: Parameters<Client['batch']>) => statement(() => batch(...args))) as Client['batch']\n\n // What Drizzle uses of the client, straight to the connection: the transaction's own statements\n const transactionClient = {\n execute,\n batch,\n protocol: client.protocol,\n get closed() {\n return client.closed\n },\n } as unknown as Client\n const transactionDb = drizzle(transactionClient, { schema })\n\n async function transaction<T>(fn: (tx: typeof transactionDb) => Promise<T>): Promise<T> {\n const previous = queue\n let finished!: () => void\n queue = new Promise<void>((resolve) => (finished = resolve))\n await previous\n let end!: () => void\n open = new Promise<void>((resolve) => (end = resolve))\n try {\n await statementsDone()\n try {\n await execute('BEGIN IMMEDIATE')\n } catch (error) {\n // Busy: BaseDb.transaction retries the whole transaction, on a fresh connection\n if (isSqliteBusyError(error)) await client.reconnect()\n throw error\n }\n try {\n const result = await fn(transactionDb)\n await execute('COMMIT')\n return result\n } catch (error) {\n try {\n await execute('ROLLBACK')\n } catch {\n // Already rolled back (SQLite does on some errors)\n }\n if (isSqliteBusyError(error)) await client.reconnect()\n throw error\n }\n } finally {\n open = undefined\n end()\n finished()\n }\n }\n\n return { transaction }\n}\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport type { IDb } from '@/interfaces/IDb'\nimport path from 'path'\nimport { fileURLToPath } from 'node:url'\nimport debug from 'debug'\nimport { appState } from '@/seedSchema'\nimport fs from 'fs'\nimport { createClient } from '@libsql/client'\nimport { createSingleConnectionTransactions } from './singleConnectionTransactions'\nimport { drizzle } from 'drizzle-orm/libsql'\nimport { migrate } from 'drizzle-orm/libsql/migrator'\nimport * as schema from '@/seedSchema'\nimport { Observable, interval, switchMap, distinctUntilChanged, startWith } from 'rxjs'\nimport { recreateIfOlderThanMinimumUpgradeVersion } from '@/db/minimumUpgradeVersion'\n\nconst logger = debug('seedSdk:node:db:Db')\n\nexport interface DbConfig {\n dbUrl?: string\n /** @deprecated Unused — schema is the static SDK seedSchema + prebuilt SQL migrations */\n schemaDir?: string\n outDir?: string\n}\n\nfunction resolveDbPaths(filesDir: string, config?: DbConfig) {\n const outDir = config?.outDir || path.join(filesDir, 'db')\n const dbPath = config?.dbUrl\n ? (config.dbUrl.startsWith('file:') ? config.dbUrl.replace(/^file:/, '') : config.dbUrl)\n : path.join(outDir, 'seed.db')\n return { outDir, dbPath }\n}\n\n/**\n * The installed @seedprotocol/sdk's dist directory, resolved from this module rather than the\n * working directory (hoisted monorepos, packaged Electron apps and scripts run from elsewhere all\n * differ). The working directory when the package can't be resolved.\n */\nfunction installedSdkDistDir(): string {\n try {\n const { createRequire } = process.getBuiltinModule('node:module')\n const pkgJson = createRequire(import.meta.url).resolve('@seedprotocol/sdk/package.json')\n return path.join(path.dirname(pkgJson), 'dist')\n } catch {\n return process.cwd()\n }\n}\n\n/**\n * Locate prebuilt drizzle migration SQL shipped with the SDK\n * (same files the browser embeds via drizzleFiles.ts).\n */\nexport function resolveSdkDrizzleMigrationsDir(sdkRootDir?: string): string {\n const root = sdkRootDir || installedSdkDistDir()\n\n // Look next to this module first, so the SDK always runs its own migrations\n // whatever the working directory (monorepos, packaged Electron apps, scripts\n // run from elsewhere). Rollup bundles this file into a chunk directly under\n // dist/, next to the copied dist/db/drizzle.\n const moduleDir = path.dirname(fileURLToPath(import.meta.url))\n\n const candidates = [\n path.join(moduleDir, 'db', 'drizzle'), // bundled: dist/<chunk>.js -> dist/db/drizzle\n path.join(moduleDir, '..', '..', 'db', 'drizzle'), // source: src/node/db -> src/db/drizzle\n path.join(moduleDir, '..', 'db', 'drizzle'), // dist layout variants\n path.join(moduleDir, '..', '..', '..', 'src', 'db', 'drizzle'), // dist/node -> src\n path.join(root, 'db', 'drizzle'), // production: sdkRoot is dist/\n path.join(root, 'dist', 'db', 'drizzle'), // sdk package root with built dist\n path.join(root, 'src', 'db', 'drizzle'), // monorepo / sdk-dev\n path.join(root, 'packages', 'sdk', 'src', 'db', 'drizzle'), // monorepo root as cwd\n path.join(root, 'packages', 'sdk', 'dist', 'db', 'drizzle'),\n ]\n\n for (const candidate of candidates) {\n if (fs.existsSync(path.join(candidate, 'meta', '_journal.json'))) {\n return candidate\n }\n }\n\n throw new Error(\n `Could not find SDK drizzle migrations (meta/_journal.json). Searched under: ${candidates.join(', ')}`,\n )\n}\n\nfunction copyDirRecursive(sourceDir: string, targetDir: string) {\n if (!fs.existsSync(targetDir)) {\n fs.mkdirSync(targetDir, { recursive: true })\n }\n for (const entry of fs.readdirSync(sourceDir)) {\n const sourcePath = path.join(sourceDir, entry)\n const targetPath = path.join(targetDir, entry)\n const stats = fs.statSync(sourcePath)\n if (stats.isDirectory()) {\n copyDirRecursive(sourcePath, targetPath)\n } else {\n fs.copyFileSync(sourcePath, targetPath)\n }\n }\n}\n\n\n/** The file a local libsql `file:` URL opens; undefined for `:memory:` and remote URLs. */\nconst localDbFilePath = (dbUrl: string): string | undefined => {\n if (!dbUrl.startsWith('file:')) return undefined\n const filePath = dbUrl.slice('file:'.length).split('?')[0]\n if (!filePath || filePath === ':memory:') return undefined\n return filePath.startsWith('//') ? filePath.replace(/^\\/\\/(localhost)?/, '') : filePath\n}\n\nexport class NodeDb implements IDb {\n db: any\n private client: ReturnType<typeof createClient> | undefined\n /** Bumped by close(), so a prepareDb that was running closes what it opened instead of keeping it. */\n private openGeneration = 0\n\n\n getAppDb() {\n return this.db\n }\n\n isAppDbReady() {\n return !!this.db\n }\n\n transactions: ReturnType<typeof createSingleConnectionTransactions> | undefined\n\n async transaction<T>(fn: (tx: any) => Promise<T>): Promise<T> {\n if (!this.db || !this.transactions) throw new Error('Database not prepared')\n return this.transactions.transaction(fn)\n }\n\n /**\n * Copy prebuilt SQL migrations into the app db directory (overwrite to stay current).\n */\n copyDrizzleFiles(filesDir: string, migrationsSourceDir?: string, config?: DbConfig): string {\n const { outDir } = resolveDbPaths(filesDir, config)\n const source = migrationsSourceDir || resolveSdkDrizzleMigrationsDir()\n logger('[Db.copyDrizzleFiles] copying from %s to %s', source, outDir)\n copyDirRecursive(source, outDir)\n return outDir\n }\n\n async prepareDb(filesDir: string, config?: DbConfig) {\n const resolvedFilesDir = path.resolve(filesDir)\n\n if (!fs.existsSync(resolvedFilesDir)) {\n fs.mkdirSync(resolvedFilesDir, { recursive: true })\n }\n\n const { outDir, dbPath } = resolveDbPaths(resolvedFilesDir, config)\n\n if (!fs.existsSync(outDir)) {\n fs.mkdirSync(outDir, { recursive: true })\n }\n\n // Install SDK migration SQL next to the DB (same source of truth as browser)\n this.copyDrizzleFiles(resolvedFilesDir, undefined, config)\n\n const dbUrl = config?.dbUrl\n ? (config.dbUrl.startsWith('file:') ? config.dbUrl : `file:${path.resolve(config.dbUrl)}`)\n : `file:${path.resolve(dbPath)}`\n\n // libsql won't create the database's folder (\"Unable to open connection … 14\").\n const dbFilePath = localDbFilePath(dbUrl)\n if (dbFilePath) {\n fs.mkdirSync(path.dirname(dbFilePath), { recursive: true })\n }\n\n const generation = this.openGeneration\n this.closeOpenDb()\n const client = createClient({ url: dbUrl })\n this.client = client\n // One connection for everything, transactions included (see singleConnectionTransactions)\n this.transactions = createSingleConnectionTransactions(client, schema)\n // Readers in other processes (a CLI on the same file) don't block a commit in WAL\n if (localDbFilePath(dbUrl)) await client.execute('PRAGMA journal_mode = WAL')\n const db = drizzle(client, { schema })\n\n await recreateIfOlderThanMinimumUpgradeVersion(db)\n logger('[Db.prepareDb] running migrations from %s', outDir)\n await migrate(db, { migrationsFolder: outDir })\n if (generation !== this.openGeneration) {\n if (this.client === client) this.closeOpenDb()\n else client.close()\n throw new Error('The database was closed while it was being opened')\n }\n\n this.db = db\n\n return this.db\n }\n\n async close(): Promise<void> {\n this.openGeneration++\n this.closeOpenDb()\n }\n\n /** Closes the libsql client and forgets the database. */\n private closeOpenDb(): void {\n const client = this.client\n this.db = undefined\n this.transactions = undefined\n this.client = undefined\n if (client && !client.closed) client.close()\n }\n\n async connectToDb(_pathToDir: string) {\n return {\n id: this.db ? this.db.constructor.name : '',\n }\n }\n\n async migrate(pathToDbDir: string, _dbName: string, _dbId: string) {\n try {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n\n await migrate(this.db, { migrationsFolder: pathToDbDir })\n const queryResult = await this.db.select().from(appState)\n logger('queryResult', queryResult)\n } catch (error: any) {\n const errorMessage = error.message || String(error) || ''\n const errorString = String(error)\n const isMigrationError =\n errorMessage.includes(\"Can't find meta/_journal.json\") ||\n errorMessage.includes('_journal.json') ||\n errorMessage.includes(\"Cannot read properties of undefined\") ||\n errorMessage.includes(\"reading 'dialect'\") ||\n errorMessage.includes('undefined is not an object') ||\n errorString.includes('dialect') ||\n errorString.includes('undefined is not an object')\n\n if (isMigrationError) {\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger(\n 'Warning: Migration failed, but continuing in test environment:',\n errorMessage || errorString,\n )\n return this.db\n }\n }\n throw error\n }\n\n return this.db\n }\n\n /**\n * Polling-based liveQuery stub for Node. Prefer browser reactive queries in UI apps.\n */\n liveQuery<T>(query: ((sql: any) => any) | any): Observable<T[]> {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n\n const pollInterval = 1000\n\n if (typeof query === 'function') {\n throw new Error(\n 'SQL tag functions are not supported in node liveQuery stub implementation. Use Drizzle query builders instead.',\n )\n }\n\n const queryBuilder = query\n\n return interval(pollInterval).pipe(\n startWith(0),\n switchMap(async () => {\n try {\n const result = await Promise.resolve(queryBuilder)\n return result as T[]\n } catch (error) {\n logger('[Db.liveQuery] Error executing query:', error)\n throw error\n }\n }),\n distinctUntilChanged((prev, curr) => {\n return JSON.stringify(prev) === JSON.stringify(curr)\n }),\n )\n }\n}\n\n/** @deprecated Prefer NodeDb */\nexport const Db = NodeDb\n\nBaseDb.configure(new NodeDb())\n\nconst _check: IDb = new NodeDb()\nvoid _check\n","import path from 'path'\n\n/**\n * The project's `.seed` directory on Node: `<process.cwd()>/.seed`. Apps whose working directory\n * isn't writable (a packaged Electron app's is often `/`) chdir before init or pass an absolute\n * filesDir.\n */\nexport function getDotSeedDir(): string {\n return path.join(process.cwd(), '.seed')\n}\n","/**\n * Whether a relative filesDir already names the .seed directory or a path inside\n * it ('.seed', '.seed/files', './.seed/files'). '.seed-alt/x' is not: it is\n * resolved under .seed like any other relative path.\n */\nexport function isUnderDotSeed(relativePath: string): boolean {\n const firstSegment = relativePath.split(/[\\\\/]+/).find((segment) => segment !== '' && segment !== '.')\n return firstSegment === '.seed'\n}\n","import fs from 'fs'\nimport path from 'path'\nimport { getDotSeedDir } from './dotSeedDir'\nimport { isUnderDotSeed } from '@/helpers/dotSeedPath'\n\n/**\n * The filesDir to use on Node, resolved relative to the .seed directory at the project root.\n * A browser OPFS-style path such as '/app-files' that doesn't exist on disk becomes\n * '.seed/app-files'; a relative path not already under .seed is joined to .seed; other absolute\n * paths are used as-is.\n */\nexport function resolveFilesDir(filesDir: string): string {\n // Not created here: prepareDb creates filesDir (under .seed when it's relative), so an absolute\n // filesDir works from a read-only working directory (e.g. a packaged Electron app's cwd `/`).\n const dotSeedDir = getDotSeedDir()\n\n // Browser OPFS paths are single-level, like '/app-files' or '/files'.\n const pathWithoutLeadingSlash = filesDir.slice(1)\n const isBrowserOpfsPath =\n path.isAbsolute(filesDir) &&\n filesDir.startsWith('/') &&\n pathWithoutLeadingSlash.length > 0 &&\n !pathWithoutLeadingSlash.includes('/') &&\n !fs.existsSync(filesDir)\n\n if (isBrowserOpfsPath) {\n return path.join(dotSeedDir, filesDir.slice(1) || 'app-files')\n }\n if (!path.isAbsolute(filesDir)) {\n return isUnderDotSeed(filesDir) ? path.resolve(filesDir) : path.join(dotSeedDir, filesDir)\n }\n return filesDir\n}\n","import { NodeFileManager } from '@/node/helpers/FileManager'\nimport { NodeDb } from '@/node/db/Db'\nimport { DefaultArweaveClient } from '@seedprotocol/arweave'\nimport { DefaultQueryClient } from '@seedprotocol/eas'\nimport { NodeEasClient } from '@seedprotocol/eas/node'\nimport type { PlatformServices } from './types'\n\nexport function createPlatformServices(): PlatformServices {\n return {\n fileManager: new NodeFileManager(),\n db: new NodeDb(),\n arweaveClient: new DefaultArweaveClient(),\n // Own undici Agent for EAS requests: shorter TLS handshake on Node 24.21+, 30 s keep-alive.\n easClient: new NodeEasClient(),\n queryClient: new DefaultQueryClient(),\n }\n}\n\nexport { configurePlatform } from './configurePlatform'\nexport { resolveFilesDir } from '@/node/helpers/resolveFilesDir'\nexport type { PlatformServices } from './types'\n"],"names":["fs"],"mappings":";;;;;;;;;;;;;;;;;;;MAOa,eAAe,CAAA;AAC1B,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,OAAO,EAAE;IACX;IAEA,SAAS,GAAA;AACP,QAAA,OAAO,EAAE;IACX;;IAGA,MAAM,qBAAqB,CAAC,QAAgB,EAAA;QAC1C,OAAO,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;IACnD;IAEA,MAAM,oBAAoB,CAAC,WAAoB,EAAA;AAC7C,QAAA,OAAM;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AM,UAAU,GAAG,aAAa,EAAE;;IAGlC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,IAAA,MAAM,iBAAiB,GACrB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;AACzB,QAAA,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;QACxB,uBAAuB,CAAC,MAAM,GAAG,CAAC;AAClC,QAAA,CAAC,uBAAuB,CAAC,QAAQ,CAAC,GAAG,CAAC;AACtC,QAAA,CAACA,WAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IAE1B,IAAI,iBAAiB,EAAE;AACrB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC;IAChE;IACA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC9B,OAAO,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5F;AACA,IAAA,OAAO,QAAQ;AACjB;;SCzBgB,sBAAsB,GAAA;IACpC,OAAO;QACL,WAAW,EAAE,IAAI,eAAe,EAAE;QAClC,EAAE,EAAE,IAAI,MAAM,EAAE;QAChB,aAAa,EAAE,IAAI,oBAAoB,EAAE;;QAEzC,SAAS,EAAE,IAAI,aAAa,EAAE;QAC9B,WAAW,EAAE,IAAI,kBAAkB,EAAE;KACtC;AACH;;"}
|
package/dist/main.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { C as ConflictError, G as EAS_CHAIN_ID_APP_STATE_KEY, H as INIT_CONFIG_CONFLICT_MESSAGE, J as ItemCreateError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, B as assertLocalDbChain, K as claimUnpublishedDrafts, g as client, L as createLocalQueryDataSource, N as easSyncActor, O as getClient, P as getPublishedSeedRecord, Q as getSchemaNameFromId, i as importJsonSchema, V as isSeedQueryLocalSourceRegistered, W as listSchemas, q as loadAllSchemasFromDb, X as mergeEasSyncRequestIntents, r as readJsonImportFile, Y as registerSeedQueryLocalSource, Z as requestEasSyncFromAddressChange, _ as requestEasSyncFromModelsInit, $ as sendEasSyncClientRequest, a0 as setRetriesWhenOnlineEnabled, a1 as startEasSyncActor, h as syncSchemaFromSource, j as transformImportToSchemaFile, a2 as unregisterSeedQueryLocalSource } from './errors-
|
|
2
|
-
export { a8 as ADDRESSES_PERSISTED_EVENT, A as AmbiguousModelError, a9 as CONTENT_SHA256_TAG, aa as CONTENT_TYPE_TAG, ab as ClientManagerState, Q as EAS_SEED_DATA_SYNCED_TO_DB_EVENT, ac as FILES_CHANGED_EVENT, v as INTERNAL_DATA_TYPES, ad as ImageSize, ae as LOCAL_COPIES_REMOVED_EVENT, af as MachineIds, M as ModelPropertyDataTypes, S as SEED_PROTOCOL_SCHEMA_NAME, ag as SeedModels, ah as TabLockTimeoutError, ai as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, X as buildArweaveContentTags, aj as closestImageSize, ak as contentSha256TagMatches, al as ensureImageLocal, h as eventEmitter, m as generateId, am as getAddressesForItemsFilter, W as getContentSha256, an as isChangeFeedRunning, s as isClientReady, ao as isClientReadySnapshot, i as isDataType, ap as isLeaderTab, aq as normalizeAddressConfig, ar as normalizeAddressList, as as normalizeArweaveTxIdForEnsure, n as normalizeDataType, J as normalizeHexAddress, x as normalizePublisher, at as parseAddressesPersistedPayload, au as watchEntityChanges, av as watchEntityRows, aw as whenDbReady, ax as whenLeaderTab } from './tabEvents-
|
|
3
|
-
export { getPropertySchema } from './property-
|
|
4
|
-
export { B as BaseDb, w as BaseFileManager, w as FileManager, a as appState, e as arweaveL1FinalizeJobs, f as easSyncProcesses, h as htmlEmbeddedImageCoPublish, m as metadata, j as modelSchemas, b as modelUids, d as models, l as properties, q as propertyUids, r as publishProcesses, t as schemas, s as seeds, u as uploadProcesses, v as versions } from './BaseFileManager-
|
|
5
|
-
export { C as ClearNotSupportedError, I as Item, v as ItemProperty, x as ItemPropertySaveValidationError,
|
|
6
|
-
export { a as applyPropertyAttestationUidsFromPublish, e as estimateDataUriByteLength, g as getAttesterForSeed,
|
|
7
|
-
export { S as Schema, s as schemaMachine } from './Schema-
|
|
8
|
-
export { D as DatabaseNotPersistentError, F as FileSystemLockedError } from './
|
|
9
|
-
export { M as MODEL_AMBIGUOUS_EVENT, u as updateSeedRevokedAt } from './updateSeedRevokedAt-
|
|
10
|
-
export { ModelProperty } from './ModelProperty-
|
|
1
|
+
export { C as ConflictError, G as EAS_CHAIN_ID_APP_STATE_KEY, H as INIT_CONFIG_CONFLICT_MESSAGE, J as ItemCreateError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, B as assertLocalDbChain, K as claimUnpublishedDrafts, g as client, L as createLocalQueryDataSource, N as easSyncActor, O as getClient, P as getPublishedSeedRecord, Q as getSchemaNameFromId, i as importJsonSchema, V as isSeedQueryLocalSourceRegistered, W as listSchemas, q as loadAllSchemasFromDb, X as mergeEasSyncRequestIntents, r as readJsonImportFile, Y as registerSeedQueryLocalSource, Z as requestEasSyncFromAddressChange, _ as requestEasSyncFromModelsInit, $ as sendEasSyncClientRequest, a0 as setRetriesWhenOnlineEnabled, a1 as startEasSyncActor, h as syncSchemaFromSource, j as transformImportToSchemaFile, a2 as unregisterSeedQueryLocalSource } from './errors-CnT0fSMK.js';
|
|
2
|
+
export { a8 as ADDRESSES_PERSISTED_EVENT, A as AmbiguousModelError, a9 as CONTENT_SHA256_TAG, aa as CONTENT_TYPE_TAG, ab as ClientManagerState, Q as EAS_SEED_DATA_SYNCED_TO_DB_EVENT, ac as FILES_CHANGED_EVENT, v as INTERNAL_DATA_TYPES, ad as ImageSize, ae as LOCAL_COPIES_REMOVED_EVENT, af as MachineIds, M as ModelPropertyDataTypes, S as SEED_PROTOCOL_SCHEMA_NAME, ag as SeedModels, ah as TabLockTimeoutError, ai as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, X as buildArweaveContentTags, aj as closestImageSize, ak as contentSha256TagMatches, al as ensureImageLocal, h as eventEmitter, m as generateId, am as getAddressesForItemsFilter, W as getContentSha256, an as isChangeFeedRunning, s as isClientReady, ao as isClientReadySnapshot, i as isDataType, ap as isLeaderTab, aq as normalizeAddressConfig, ar as normalizeAddressList, as as normalizeArweaveTxIdForEnsure, n as normalizeDataType, J as normalizeHexAddress, x as normalizePublisher, at as parseAddressesPersistedPayload, au as watchEntityChanges, av as watchEntityRows, aw as whenDbReady, ax as whenLeaderTab } from './tabEvents-DT5ez6io.js';
|
|
3
|
+
export { getPropertySchema } from './property-iNW1N3vm.js';
|
|
4
|
+
export { B as BaseDb, w as BaseFileManager, w as FileManager, a as appState, e as arweaveL1FinalizeJobs, f as easSyncProcesses, h as htmlEmbeddedImageCoPublish, m as metadata, j as modelSchemas, b as modelUids, d as models, l as properties, q as propertyUids, r as publishProcesses, t as schemas, s as seeds, u as uploadProcesses, v as versions } from './BaseFileManager-DLou1TZS.js';
|
|
5
|
+
export { C as ClearNotSupportedError, a2 as EntityUnloadedError, I as Item, v as ItemProperty, x as ItemPropertySaveValidationError, ah as METADATA_LATEST_FIRST_ORDER_SQL, y as OwnershipError, av as PUBLISH_NOT_CONFIGURED_MESSAGE, z as assertItemOwned, H as compareMetadataRowsLatestFirst, aw as createNewItem, aa as easPropertyNameForPublish, ax as getArweaveUrlForTransaction, A as getCorrectId, a7 as getGetAdditionalSyncAddresses, ay as getGetPublisherForNewSeeds, az as getMetadataLatest, aA as getPublishExecutor, aB as getRevokeExecutor, aC as getUploadExecutor, aD as getVersionData, B as isItemOwned, aE as isLocalUnsealedDraft, D as isPublishedSeedRef, aF as isSeedRowOwned, a9 as listRelationEasPropertyName, aG as localUnsealedDraftSql, aH as ownedPublisherSql, aI as ownedSeedsSql, aJ as pickLatestMetadataRowPerProperty, aK as placeholderUidSql, aL as propertyMachine, aM as publisherInAddressListSql, aN as publisherIsInOwnedSet, aO as setAdditionalSyncAddresses, aP as setGetPublisherForNewSeeds, aQ as setPublishExecutor, aR as setRevokeExecutor, aS as setUploadExecutor } from './Item-oPnmIehk.js';
|
|
6
|
+
export { A as ArchiveExportError, a as applyPropertyAttestationUidsFromPublish, e as estimateDataUriByteLength, b as exportArchive, g as getAttesterForSeed, c as getMetadataAttestationUidsForSeedUid, d as getSeedPublishState, f as getUnpublishedRelatedItems, h as getVersionsForSeedUid, m as markPropertyAttestationsRetracted, r as renameModelProperty, i as resolveMediaRef, s as summarizePublishWork, u as updateModelProperties, j as updateVersionUid } from './index-Gh42_47r.js';
|
|
7
|
+
export { S as Schema, s as schemaMachine } from './Schema-BMXRF4j9.js';
|
|
8
|
+
export { D as DatabaseNotPersistentError, F as FileSystemLockedError, U as UnsupportedBrowserError, c as checkBrowserSupport } from './browserSupport-C64rX-2I.js';
|
|
9
|
+
export { M as MODEL_AMBIGUOUS_EVENT, u as updateSeedRevokedAt } from './updateSeedRevokedAt-B9JRwr5T.js';
|
|
10
|
+
export { ModelProperty } from './ModelProperty-D2vJozmW.js';
|
|
11
11
|
export { EAS_CHAIN_DEPLOYMENTS, BaseEasClient as EasClient, VERSION_SCHEMA_DEF, VERSION_SCHEMA_UID, easName, getCanonicalItemPropertiesFromEas, getEasChainDeployment, getEasEndpoint, getEasReadChainId, getEasSchemaUidForExactDefinition, getItemPropertiesFromEas, getItemVersionsFromEas, getSeedsBySchemaName, getSeedsFromSchemaUids, isPlaceholderUid, isValidEasAttestationUid, matchEasName, normalizeBytes32Hex, pickLatestPropertyAttestationsByRefAndSchema, setSchemaUidForModel, setSchemaUidForSchemaDefinition, withExcludeRevokedFilter } from '@seedprotocol/eas';
|
|
12
|
-
export { getModelSchemasFromEas } from './eas-
|
|
12
|
+
export { getModelSchemasFromEas } from './eas-FZPPqxqe.js';
|
|
13
13
|
export { BaseArweaveClient, DEFAULT_ARWEAVE_GATEWAYS, DEFAULT_ARWEAVE_GRAPHQL_URL, DEFAULT_ARWEAVE_HOST, DEFAULT_GATEWAY_SIDECAR_HOST, DEFAULT_GATEWAY_SIDECAR_PORT, DEFAULT_SEED_FEED_HYPER_KEY, DEFAULT_SEED_GATEWAY_HYPER_KEY, SEED_RSS_IMAGE_RELATION_FIELD_KEYS, classifyMediaRef, ensureReadGatewaySelected, fetchArweaveRawFromBaseUrl, fetchArweaveRawTextAcrossGateways, getArweaveReadBaseUrls, getArweaveUploadStatus, getDefaultArweaveReadGatewayHostsOrdered, getFeedItemStringField, getLastHealthyReadGatewayHost, getPreferredArweaveReadBaseUrls, getReadGatewayHostsForConfig, getResolvedArweaveReadBaseUrls, getResolvedSeedGatewayEndpoints, getUploadApiArweaveDataUrl, getUploadApiArweaveStatusUrl, getUploadPipelineTransactionStatus, hasArweaveContentReadTransform, invalidateReadGatewayCache, invalidateSidecarProbeCache, isArweaveL1AnchoringComplete, isEasAttestationExplorerUrl, isGatewayHostCircuitOpen, isKnownArweaveGatewayHostname, isReadGatewayKnownHealthy, mergePrimaryHostWithDefaults, normalizeFeedItemFields, normalizeGatewayHostKey, normalizeRelationPropertyValue, normalizeUploadApiBaseUrl, queryArweaveGatewayTransaction, queryArweaveGatewayTransactionWithFallback, readArweaveContentResponse, recordGatewayHostFailure, recordGatewayHostSuccess, resetArweaveReadGatewayForTests, resolveSeedGatewayEndpoints, resolveSeedIdsFromRefString, resolveSeedRssImageRelationFromItem, resolveSeedRssImageRelationRef, seedGatewayConfigFromClientContext, seedGatewayConfigFromSeedConfig, setArweaveContentReadTransform, setPreferredArweaveReadBaseUrls, setResolvedSeedGatewayEndpoints, transformArweaveContent } from '@seedprotocol/arweave';
|
|
14
|
-
export { getPublishPendingDiff } from './getPublishPendingDiff-
|
|
15
|
-
export { P as PublishValidationFailedError, R as RELATED_ITEM_UNPUBLISHED_CODE, a as RelatedItemUnpublishedError, b as getPendingRetractions, r as resolvePublishPayloadValues, v as validateItemForPublish } from './getPublishPayload-
|
|
16
|
-
export { g as getPublishGraph } from './publishGraph-
|
|
17
|
-
export { H as HTML_EMBEDDED_MAX_IMAGES_PER_DOC, a as HTML_EMBEDDED_MAX_IMAGE_BYTES, b as HTML_EMBEDDED_MAX_TOTAL_BYTES, c as HtmlEmbeddedDataUriLimitError, d as HtmlSeedPropertyRefError, S as SEED_PROPERTY_REF_PREFIX, e as clearHtmlEmbeddedImageCoPublishRows,
|
|
14
|
+
export { getPublishPendingDiff } from './getPublishPendingDiff-CH5xLMjU.js';
|
|
15
|
+
export { P as PublishValidationFailedError, R as RELATED_ITEM_UNPUBLISHED_CODE, a as RelatedItemUnpublishedError, b as getPendingRetractions, r as resolvePublishPayloadValues, v as validateItemForPublish } from './getPublishPayload-DKuEaq96.js';
|
|
16
|
+
export { g as getPublishGraph } from './publishGraph-CRn_N3NT.js';
|
|
17
|
+
export { H as HTML_EMBEDDED_MAX_IMAGES_PER_DOC, a as HTML_EMBEDDED_MAX_IMAGE_BYTES, b as HTML_EMBEDDED_MAX_TOTAL_BYTES, c as HtmlEmbeddedDataUriLimitError, d as HtmlSeedPropertyRefError, S as SEED_PROPERTY_REF_PREFIX, e as clearHtmlEmbeddedImageCoPublishRows, h as extractDataUriImagesFromHtml, i as findSeedPropertyRefsInHtml, j as getPublishUploadData, k as itemHasPublishUploadCandidates, p as prepareHtmlEmbeddedImagesForPublish, l as replaceDataUrisInParsedHtml, m as replaceSeedPropertyRefsInHtml, n as resolveEffectiveHtmlEmbeddedDataUriPolicy, o as rewriteHtmlEmbeddedImagesOnDisk } from './getPublishUploads-DivYpgNw.js';
|
|
18
18
|
import 'xstate';
|
|
19
19
|
import 'debug';
|
|
20
20
|
import 'pluralize';
|
|
@@ -29,7 +29,8 @@ import 'nanoid';
|
|
|
29
29
|
import 'nanoid-dictionary';
|
|
30
30
|
import '@noble/hashes/sha256';
|
|
31
31
|
import 'rxjs';
|
|
32
|
-
import '
|
|
32
|
+
import '@seedprotocol/archive';
|
|
33
|
+
import './SchemaValidationService-CieGrj5c.js';
|
|
33
34
|
import '@sinclair/typebox/value';
|
|
34
35
|
import 'parse5';
|
|
35
36
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/{modelPropertyRecordSchemas-C7UgA5TH.js → modelPropertyRecordSchemas-DEe-lYhn.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getModelPropertyDefinitions } from './property-
|
|
1
|
+
import { getModelPropertyDefinitions } from './property-iNW1N3vm.js';
|
|
2
2
|
import 'pluralize';
|
|
3
|
-
import './Item-
|
|
4
|
-
import './tabEvents-
|
|
3
|
+
import './Item-oPnmIehk.js';
|
|
4
|
+
import './tabEvents-DT5ez6io.js';
|
|
5
5
|
import 'debug';
|
|
6
|
-
import './BaseFileManager-
|
|
6
|
+
import './BaseFileManager-DLou1TZS.js';
|
|
7
7
|
import 'drizzle-orm/sqlite-core';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'xstate';
|
|
@@ -45,4 +45,4 @@ function loadModelPropertyRecordSchemas(modelName, modelFileId, db) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export { loadModelPropertyRecordSchemas };
|
|
48
|
-
//# sourceMappingURL=modelPropertyRecordSchemas-
|
|
48
|
+
//# sourceMappingURL=modelPropertyRecordSchemas-DEe-lYhn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelPropertyRecordSchemas-
|
|
1
|
+
{"version":3,"file":"modelPropertyRecordSchemas-DEe-lYhn.js","sources":["../../src/ItemProperty/service/actors/modelPropertyRecordSchemas.ts"],"sourcesContent":["import type { BaseDb } from '@/db/Db/BaseDb'\nimport { getModelPropertyDefinitions } from '@/helpers/property'\nimport type { PropertyDefinition } from '@/helpers/propertyDefinition'\n\ntype Db = NonNullable<ReturnType<typeof BaseDb.getAppDb>>\n\n/**\n * One read per model while it's in flight: an item's properties load together and would otherwise\n * each read the same model's rows. Nothing is kept once the read settles, so a later load sees\n * schema changes.\n */\nconst inFlight = new Map<string, Promise<Map<string, PropertyDefinition>>>()\n\n/**\n * Every property definition of one model ({@link getModelPropertyDefinitions}), keyed by property\n * name. Empty when the model has no row. Rejects when the model can't be resolved (e.g. an\n * ambiguous name).\n */\nexport function loadModelPropertyRecordSchemas(\n modelName: string,\n modelFileId: string | undefined,\n db: Db,\n): Promise<Map<string, PropertyDefinition>> {\n const key = JSON.stringify([modelName, modelFileId ?? null])\n const existing = inFlight.get(key)\n if (existing) return existing\n const read = getModelPropertyDefinitions(modelName, { modelFileId }, db)\n inFlight.set(key, read)\n const forget = () => {\n if (inFlight.get(key) === read) inFlight.delete(key)\n }\n read.then(forget, forget)\n return read\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA;;;;AAIG;AACH,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoD;AAE5E;;;;AAIG;SACa,8BAA8B,CAC5C,SAAiB,EACjB,WAA+B,EAC/B,EAAM,EAAA;AAEN,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,WAAW,IAAI,IAAI,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AAClC,IAAA,IAAI,QAAQ;AAAE,QAAA,OAAO,QAAQ;AAC7B,IAAA,MAAM,IAAI,GAAG,2BAA2B,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AACxE,IAAA,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;IACvB,MAAM,MAAM,GAAG,MAAK;AAClB,QAAA,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI;AAAE,YAAA,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;AACtD,IAAA,CAAC;AACD,IAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;AACzB,IAAA,OAAO,IAAI;AACb;;"}
|
package/dist/node.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { enableMapSet } from 'immer';
|
|
2
|
-
export { C as ConflictError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, g as client, i as importJsonSchema, l as loadSchemaFromFile, r as readJsonImportFile, h as syncSchemaFromSource, j as transformImportToSchemaFile } from './errors-
|
|
3
|
-
export { A as AmbiguousModelError, P as Property, h as eventEmitter } from './tabEvents-
|
|
2
|
+
export { C as ConflictError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, g as client, i as importJsonSchema, l as loadSchemaFromFile, r as readJsonImportFile, h as syncSchemaFromSource, j as transformImportToSchemaFile } from './errors-CnT0fSMK.js';
|
|
3
|
+
export { A as AmbiguousModelError, P as Property, h as eventEmitter } from './tabEvents-DT5ez6io.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import '@seedprotocol/eas';
|
|
6
|
-
export { a as appState, c as config, m as metadata, b as modelUids, d as models, s as seeds, v as versions } from './BaseFileManager-
|
|
7
|
-
export { C as ClearNotSupportedError, I as Item, v as ItemProperty, x as ItemPropertySaveValidationError, y as OwnershipError, z as assertItemOwned, A as getCorrectId, B as isItemOwned, D as isPublishedSeedRef } from './Item-
|
|
8
|
-
import { c as createPlatformServices } from './index.node-
|
|
9
|
-
export { D as Db, F as FileManager, r as resolveSdkDrizzleMigrationsDir } from './index.node-
|
|
6
|
+
export { a as appState, c as config, m as metadata, b as modelUids, d as models, s as seeds, v as versions } from './BaseFileManager-DLou1TZS.js';
|
|
7
|
+
export { C as ClearNotSupportedError, I as Item, v as ItemProperty, x as ItemPropertySaveValidationError, y as OwnershipError, z as assertItemOwned, A as getCorrectId, B as isItemOwned, D as isPublishedSeedRef } from './Item-oPnmIehk.js';
|
|
8
|
+
import { c as createPlatformServices } from './index.node-BfiBriEq.js';
|
|
9
|
+
export { D as Db, F as FileManager, r as resolveSdkDrizzleMigrationsDir } from './index.node-BfiBriEq.js';
|
|
10
10
|
export { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave';
|
|
11
|
-
import { configurePlatform } from './configurePlatform-
|
|
11
|
+
import { configurePlatform } from './configurePlatform-WkmvqeTO.js';
|
|
12
12
|
import 'xstate';
|
|
13
13
|
import 'debug';
|
|
14
14
|
import 'drizzle-orm';
|
|
@@ -27,7 +27,7 @@ import 'fs';
|
|
|
27
27
|
import 'path';
|
|
28
28
|
import 'url';
|
|
29
29
|
import 'node:url';
|
|
30
|
-
import './index-
|
|
30
|
+
import './index-BjWk0x4-.js';
|
|
31
31
|
import '@libsql/client';
|
|
32
32
|
import 'drizzle-orm/libsql';
|
|
33
33
|
import 'drizzle-orm/libsql/migrator';
|
package/dist/platform.browser.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-
|
|
1
|
+
export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-DQstVvRV.js';
|
|
2
2
|
import '@seedprotocol/arweave';
|
|
3
3
|
import '@seedprotocol/eas';
|
|
4
|
-
export { configurePlatform } from './configurePlatform-
|
|
5
|
-
import './tabEvents-
|
|
4
|
+
export { configurePlatform } from './configurePlatform-WkmvqeTO.js';
|
|
5
|
+
import './tabEvents-DT5ez6io.js';
|
|
6
6
|
import 'debug';
|
|
7
|
-
import './BaseFileManager-
|
|
7
|
+
import './BaseFileManager-DLou1TZS.js';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import 'xstate';
|
|
@@ -16,9 +16,9 @@ import '@noble/hashes/sha256';
|
|
|
16
16
|
import '@noble/hashes/sha3';
|
|
17
17
|
import '@noble/hashes/utils';
|
|
18
18
|
import 'lodash-es';
|
|
19
|
-
import './
|
|
19
|
+
import './browserSupport-C64rX-2I.js';
|
|
20
20
|
import 'drizzle-orm/sqlite-proxy';
|
|
21
|
-
import './index-
|
|
21
|
+
import './index-BjWk0x4-.js';
|
|
22
22
|
import 'sqlocal/drizzle';
|
|
23
23
|
import './minimumUpgradeVersion-BDhHvHtr.js';
|
|
24
24
|
import 'rxjs';
|
package/dist/platform.node.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { c as createPlatformServices, a as resolveFilesDir } from './index.node-
|
|
1
|
+
export { c as createPlatformServices, a as resolveFilesDir } from './index.node-BfiBriEq.js';
|
|
2
2
|
import '@seedprotocol/arweave';
|
|
3
3
|
import '@seedprotocol/eas';
|
|
4
4
|
import '@seedprotocol/eas/node';
|
|
5
|
-
export { configurePlatform } from './configurePlatform-
|
|
5
|
+
export { configurePlatform } from './configurePlatform-WkmvqeTO.js';
|
|
6
6
|
import 'fs/promises';
|
|
7
7
|
import 'fs';
|
|
8
|
-
import './BaseFileManager-
|
|
8
|
+
import './BaseFileManager-DLou1TZS.js';
|
|
9
9
|
import 'debug';
|
|
10
10
|
import 'drizzle-orm/sqlite-core';
|
|
11
11
|
import 'drizzle-orm';
|
|
12
12
|
import 'path';
|
|
13
13
|
import 'url';
|
|
14
14
|
import 'node:url';
|
|
15
|
-
import './index-
|
|
15
|
+
import './index-BjWk0x4-.js';
|
|
16
16
|
import '@libsql/client';
|
|
17
17
|
import 'drizzle-orm/libsql';
|
|
18
18
|
import 'drizzle-orm/libsql/migrator';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pluralize from 'pluralize';
|
|
2
|
-
import { E as propertyKeyFromStoredName } from './Item-
|
|
3
|
-
import { B as BaseDb } from './BaseFileManager-
|
|
4
|
-
export { M as ModelPropertyDataTypes, P as Property, T as THtmlEmbeddedDataUriPolicy, a as TProperty, b as TPropertyConstructor, c as TPropertyDataType, d as TPropertyDefs, e as TStorageType, i as isDataType, n as normalizeDataType, g as normalizePropertyRecordSchema } from './tabEvents-
|
|
2
|
+
import { E as propertyKeyFromStoredName } from './Item-oPnmIehk.js';
|
|
3
|
+
import { B as BaseDb } from './BaseFileManager-DLou1TZS.js';
|
|
4
|
+
export { M as ModelPropertyDataTypes, P as Property, T as THtmlEmbeddedDataUriPolicy, a as TProperty, b as TPropertyConstructor, c as TPropertyDataType, d as TPropertyDefs, e as TStorageType, i as isDataType, n as normalizeDataType, g as normalizePropertyRecordSchema } from './tabEvents-DT5ez6io.js';
|
|
5
5
|
import 'xstate';
|
|
6
6
|
import 'debug';
|
|
7
7
|
import '@seedprotocol/eas';
|
|
@@ -43,14 +43,14 @@ function resolvePropertyKey(defs, propertyName) {
|
|
|
43
43
|
async function getModelPropertyDefinitions(modelName, scope = {}, db = BaseDb.getAppDb()) {
|
|
44
44
|
if (!db)
|
|
45
45
|
return new Map();
|
|
46
|
-
const _mod_0 = await import('./tabEvents-
|
|
47
|
-
const _ns_0 = _mod_0.
|
|
46
|
+
const _mod_0 = await import('./tabEvents-DT5ez6io.js');
|
|
47
|
+
const _ns_0 = _mod_0.bh;
|
|
48
48
|
const { resolveModelRecord } = _ns_0;
|
|
49
49
|
const modelRecord = await resolveModelRecord(modelName, scope, db);
|
|
50
50
|
if (!modelRecord?.id)
|
|
51
51
|
return new Map();
|
|
52
|
-
const _mod_1 = await import('./tabEvents-
|
|
53
|
-
const _ns_1 = _mod_1.
|
|
52
|
+
const _mod_1 = await import('./tabEvents-DT5ez6io.js');
|
|
53
|
+
const _ns_1 = _mod_1.bi;
|
|
54
54
|
const { getPropertyDefinitions } = _ns_1;
|
|
55
55
|
return getPropertyDefinitions(modelRecord.id, db);
|
|
56
56
|
}
|
|
@@ -84,4 +84,4 @@ scope = {}) => {
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export { getModelPropertyDefinitions, getPropertySchema, resolvePropertyKey };
|
|
87
|
-
//# sourceMappingURL=property-
|
|
87
|
+
//# sourceMappingURL=property-iNW1N3vm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-
|
|
1
|
+
{"version":3,"file":"property-iNW1N3vm.js","sources":["../../src/helpers/property.ts"],"sourcesContent":["import { Static } from '@sinclair/typebox'\nimport { TProperty } from '@/Schema'\nimport pluralize from 'pluralize'\nimport { propertyKeyFromStoredName } from '@/helpers/metadataPropertyNames'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport type { ModelScope } from '@/db/read/resolveModelRecord'\nimport type { PropertyDefinition } from '@/helpers/propertyDefinition'\n\n// Re-export everything from property/index.ts to make it available when importing from helpers/property\nexport * from './property/index'\n\n/**\n * The key in `defs` a property name refers to: the key itself, a stored metadata name\n * (`authorId` → `author`, `authorIdentityIds` → `authors`), or the name minus `Id` / `Ids`\n * (pluralized).\n */\nexport function resolvePropertyKey(defs: Record<string, any>, propertyName: string): string | undefined {\n if (defs[propertyName]) return propertyName\n const storedKey = propertyKeyFromStoredName(defs, propertyName)\n if (storedKey && defs[storedKey]) return storedKey\n const base = propertyName.endsWith('Ids')\n ? pluralize(propertyName.slice(0, -3))\n : propertyName.endsWith('Id')\n ? propertyName.slice(0, -2)\n : undefined\n return base && defs[base] ? base : undefined\n}\n\n/**\n * Every property definition of one model ({@link getPropertyDefinitions}), with the model row\n * resolved from its name and scope. Empty when the model has no row. Throws AmbiguousModelError\n * for a bare name two schemas define.\n */\nexport async function getModelPropertyDefinitions(\n modelName: string | undefined,\n scope: ModelScope = {},\n db = BaseDb.getAppDb(),\n): Promise<Map<string, PropertyDefinition>> {\n if (!db) return new Map()\n const { resolveModelRecord } = await import('../db/read/resolveModelRecord')\n const modelRecord = await resolveModelRecord(modelName, scope, db)\n if (!modelRecord?.id) return new Map()\n const { getPropertyDefinitions } = await import('./propertyDefinition')\n return getPropertyDefinitions(modelRecord.id, db)\n}\n\n/**\n * A property's definition, from its row ({@link getPropertyDefinition}), by model name and\n * property name. The name may be a stored metadata name (`authorId`, `tagIds`); the result's\n * `name` is the property's key. Undefined when the model or the property has no row.\n *\n * @example\n * ```typescript\n * const schema = await getPropertySchema('Article', 'title')\n * // { dataType: 'Text', name: 'title', id: '<schema file id>', validation: ..., ... }\n * const relation = await getPropertySchema('Article', 'authorId')\n * // { dataType: 'Relation', ref: 'Author', name: 'author', ... }\n * ```\n */\nexport const getPropertySchema = async (\n modelName: string,\n propertyName: string,\n /** Which model is meant when several schemas define one named modelName (Model.id and/or schema). */\n scope: { modelFileId?: string | null; schemaName?: string | null } = {},\n): Promise<(Static<typeof TProperty> & PropertyDefinition & { _propertyFileId?: string }) | undefined> => {\n const definitions = await getModelPropertyDefinitions(modelName, scope)\n const defs = Object.fromEntries(definitions)\n const key = resolvePropertyKey(defs, propertyName)\n if (!key) return undefined\n const definition = definitions.get(key)!\n return {\n ...definition,\n modelName,\n _propertyFileId: definition.id,\n } as Static<typeof TProperty> & PropertyDefinition & { _propertyFileId?: string }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,CAAA,CAAA;;;;AAIG,CAAA,CAAA;AACG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAC,CAAA,CAAA,CAAA,CAAyB,CAAA,CAAE,YAAoB,CAAA,CAAA;IAChF,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAC;AAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY;IAC3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,SAAS,CAAA,CAAA,CAAG,CAAA,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,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;IAC1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAU,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAC,CAAA,CAAA,CAAG,CAAC,GAAG,CAAE;IACxC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;AACL,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU;QACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS;QACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAE;KACiD;AACnF,CAAA;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { eq } from 'drizzle-orm';
|
|
2
2
|
import { isValidEasAttestationUid } from '@seedprotocol/eas';
|
|
3
3
|
import { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave';
|
|
4
|
-
import { B as BaseDb, h as htmlEmbeddedImageCoPublish } from './BaseFileManager-
|
|
5
|
-
import { j as findSeedRow, Z as ZERO_BYTES32, n as normalizeDataType, M as ModelPropertyDataTypes, k as getPropertyDefinitions, r as resolveModelRecord, l as resolveModelRecordByNameOrType } from './tabEvents-
|
|
6
|
-
import { M as isVersionRevoked, N as readModelMetadataProperties, P as metadataPropertyNameForms, Q as currentPropertyRow, R as getLatestVersionRow, L as getLatestPublishedVersionRow, S as parseListPropertyValueFromStorage, D as isPublishedSeedRef } from './Item-
|
|
4
|
+
import { B as BaseDb, h as htmlEmbeddedImageCoPublish } from './BaseFileManager-DLou1TZS.js';
|
|
5
|
+
import { j as findSeedRow, Z as ZERO_BYTES32, n as normalizeDataType, M as ModelPropertyDataTypes, k as getPropertyDefinitions, r as resolveModelRecord, l as resolveModelRecordByNameOrType } from './tabEvents-DT5ez6io.js';
|
|
6
|
+
import { M as isVersionRevoked, N as readModelMetadataProperties, P as metadataPropertyNameForms, Q as currentPropertyRow, R as getLatestVersionRow, L as getLatestPublishedVersionRow, S as parseListPropertyValueFromStorage, D as isPublishedSeedRef } from './Item-oPnmIehk.js';
|
|
7
7
|
import 'pluralize';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -147,7 +147,7 @@ function htmlPropertyForHtmlSeed(node, htmlSeedLocalId) {
|
|
|
147
147
|
* only.
|
|
148
148
|
*/
|
|
149
149
|
async function getPublishGraph(root, options = {}) {
|
|
150
|
-
const { waitForPendingOutboxOps } = await import('./index-
|
|
150
|
+
const { waitForPendingOutboxOps } = await import('./index-CZMWKXLM.js');
|
|
151
151
|
await waitForPendingOutboxOps();
|
|
152
152
|
const rootNode = await readNode(root.seedLocalId, 'root', root.modelName);
|
|
153
153
|
if (!rootNode)
|
|
@@ -308,4 +308,4 @@ async function getPublishGraph(root, options = {}) {
|
|
|
308
308
|
const publishGraphItemNodes = (graph) => graph.nodes.filter((n) => n.kind === 'root' || n.kind === 'draft');
|
|
309
309
|
|
|
310
310
|
export { getPublishGraph as g, htmlPropertyForHtmlSeed as h, publishGraphItemNodes as p };
|
|
311
|
-
//# sourceMappingURL=publishGraph-
|
|
311
|
+
//# sourceMappingURL=publishGraph-CRn_N3NT.js.map
|