@seedprotocol/sdk 0.7.10 → 0.7.11-next.1384.g8b47246

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.
Files changed (132) hide show
  1. package/README.md +1 -1
  2. package/dist/{Item-oPnmIehk.js → Item-Ld1iPicQ.js} +2051 -412
  3. package/dist/Item-Ld1iPicQ.js.map +1 -0
  4. package/dist/{ModelProperty-D2vJozmW.js → ModelProperty-C8gTx4pO.js} +32 -33
  5. package/dist/ModelProperty-C8gTx4pO.js.map +1 -0
  6. package/dist/{Schema-BMXRF4j9.js → Schema-BzeBUZxi.js} +19 -19
  7. package/dist/{Schema-BMXRF4j9.js.map → Schema-BzeBUZxi.js.map} +1 -1
  8. package/dist/{SchemaValidationService-CieGrj5c.js → SchemaValidationService-CW0s7V7R.js} +5 -6
  9. package/dist/{SchemaValidationService-CieGrj5c.js.map → SchemaValidationService-CW0s7V7R.js.map} +1 -1
  10. package/dist/arweaveContentTags-Bh4wCTal.js +51 -0
  11. package/dist/arweaveContentTags-Bh4wCTal.js.map +1 -0
  12. package/dist/dist/{index.node-BfiBriEq.d.ts → index.node-DV1OXCp0.d.ts} +25 -29
  13. package/dist/dist/{index.node-BfiBriEq.d.ts.map → index.node-DV1OXCp0.d.ts.map} +1 -1
  14. package/dist/dist/platform.node.d.ts +1 -1
  15. package/dist/download-Cvac_VGu.js +394 -0
  16. package/dist/download-Cvac_VGu.js.map +1 -0
  17. package/dist/{eas-FZPPqxqe.js → eas-CdhfODXL.js} +10 -11
  18. package/dist/{eas-FZPPqxqe.js.map → eas-CdhfODXL.js.map} +1 -1
  19. package/dist/ensureImageLocal-DNM6c2yD.js +176 -0
  20. package/dist/ensureImageLocal-DNM6c2yD.js.map +1 -0
  21. package/dist/{errors-CnT0fSMK.js → errors-DKxFSvb3.js} +179 -87
  22. package/dist/errors-DKxFSvb3.js.map +1 -0
  23. package/dist/{getPublishPayload-DKuEaq96.js → getPublishPayload-CLrAcZwr.js} +7 -7
  24. package/dist/{getPublishPayload-DKuEaq96.js.map → getPublishPayload-CLrAcZwr.js.map} +1 -1
  25. package/dist/{getPublishPendingDiff-CH5xLMjU.js → getPublishPendingDiff-DiPff8pS.js} +12 -13
  26. package/dist/{getPublishPendingDiff-CH5xLMjU.js.map → getPublishPendingDiff-DiPff8pS.js.map} +1 -1
  27. package/dist/{getPublishUploads-DivYpgNw.js → getPublishUploads-DFcgc27c.js} +6 -5
  28. package/dist/{getPublishUploads-DivYpgNw.js.map → getPublishUploads-DFcgc27c.js.map} +1 -1
  29. package/dist/index-9udoYObJ.js +25 -0
  30. package/dist/index-9udoYObJ.js.map +1 -0
  31. package/dist/{index-Gh42_47r.js → index-Cdm7Q7el.js} +17 -15
  32. package/dist/index-Cdm7Q7el.js.map +1 -0
  33. package/dist/{index-DXRhFg1N.js → index-CghAYA-z.js} +6 -7
  34. package/dist/index-CghAYA-z.js.map +1 -0
  35. package/dist/{index.browser-DQstVvRV.js → index.browser-D9oC-KKx.js} +41 -40
  36. package/dist/index.browser-D9oC-KKx.js.map +1 -0
  37. package/dist/{index.node-BfiBriEq.js → index.node-DV1OXCp0.js} +7 -31
  38. package/dist/index.node-DV1OXCp0.js.map +1 -0
  39. package/dist/main.js +19 -16
  40. package/dist/main.js.map +1 -1
  41. package/dist/{modelPropertyRecordSchemas-DEe-lYhn.js → modelPropertyRecordSchemas-se4QMXSi.js} +9 -12
  42. package/dist/{modelPropertyRecordSchemas-DEe-lYhn.js.map → modelPropertyRecordSchemas-se4QMXSi.js.map} +1 -1
  43. package/dist/node.js +6 -7
  44. package/dist/node.js.map +1 -1
  45. package/dist/platform.browser.js +7 -8
  46. package/dist/platform.browser.js.map +1 -1
  47. package/dist/platform.node.js +1 -1
  48. package/dist/{property-iNW1N3vm.js → property-Broz_CWj.js} +8 -11
  49. package/dist/property-Broz_CWj.js.map +1 -0
  50. package/dist/{publishGraph-CRn_N3NT.js → publishGraph-DnWoWZRP.js} +4 -4
  51. package/dist/{publishGraph-CRn_N3NT.js.map → publishGraph-DnWoWZRP.js.map} +1 -1
  52. package/dist/{readHtmlBodyForStorageSeed-B7HgPmq6.js → readHtmlBodyForStorageSeed-FvwYPn4m.js} +9 -11
  53. package/dist/{readHtmlBodyForStorageSeed-B7HgPmq6.js.map → readHtmlBodyForStorageSeed-FvwYPn4m.js.map} +1 -1
  54. package/dist/src/Item/Item.d.ts.map +1 -1
  55. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  56. package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -1
  57. package/dist/src/Model/index.d.ts +0 -2
  58. package/dist/src/Model/index.d.ts.map +1 -1
  59. package/dist/src/browser/helpers/FileManager.d.ts +1 -3
  60. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  61. package/dist/src/browser/workers/FileDownloader.d.ts +1 -0
  62. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
  63. package/dist/src/browser/workers/ImageResizer.d.ts +1 -0
  64. package/dist/src/browser/workers/ImageResizer.d.ts.map +1 -1
  65. package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
  66. package/dist/src/client/actors/saveAppState.d.ts.map +1 -1
  67. package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
  68. package/dist/src/db/read/metadataProperty.d.ts +1 -1
  69. package/dist/src/db/read/metadataProperty.d.ts.map +1 -1
  70. package/dist/src/db/read/resolveModelRecord.d.ts +0 -20
  71. package/dist/src/db/read/resolveModelRecord.d.ts.map +1 -1
  72. package/dist/src/db/write/createMetadata.d.ts +1 -8
  73. package/dist/src/db/write/createMetadata.d.ts.map +1 -1
  74. package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts +0 -5
  75. package/dist/src/db/write/removeLocalCopiesForAddresses.d.ts.map +1 -1
  76. package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
  77. package/dist/src/events/files/download.d.ts.map +1 -1
  78. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  79. package/dist/src/helpers/easPropertyCanonical.d.ts +1 -1
  80. package/dist/src/helpers/easPropertyCanonical.d.ts.map +1 -1
  81. package/dist/src/helpers/entity/entityLifecycle.d.ts +0 -2
  82. package/dist/src/helpers/entity/entityLifecycle.d.ts.map +1 -1
  83. package/dist/src/helpers/environment.d.ts +0 -13
  84. package/dist/src/helpers/environment.d.ts.map +1 -1
  85. package/dist/src/helpers/index.d.ts +0 -4
  86. package/dist/src/helpers/index.d.ts.map +1 -1
  87. package/dist/src/helpers/itemStorageFile.d.ts +0 -11
  88. package/dist/src/helpers/itemStorageFile.d.ts.map +1 -1
  89. package/dist/src/helpers/propertySchemaUid.d.ts +7 -5
  90. package/dist/src/helpers/propertySchemaUid.d.ts.map +1 -1
  91. package/dist/src/helpers/storageDir.d.ts +0 -2
  92. package/dist/src/helpers/storageDir.d.ts.map +1 -1
  93. package/dist/src/node/db/Db.d.ts +0 -2
  94. package/dist/src/node/db/Db.d.ts.map +1 -1
  95. package/dist/src/node/helpers/FileManager.d.ts +0 -2
  96. package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
  97. package/dist/src/node/index.d.ts +2 -2
  98. package/dist/src/node/index.d.ts.map +1 -1
  99. package/dist/src/outbox/index.d.ts +5 -5
  100. package/dist/src/outbox/index.d.ts.map +1 -1
  101. package/dist/{syncDbWithEas-FuyqoEKk.js → syncDbWithEas-Dj_8VqM7.js} +24 -23
  102. package/dist/syncDbWithEas-Dj_8VqM7.js.map +1 -0
  103. package/dist/tabEvents-BnBzIdEi.js +1408 -0
  104. package/dist/tabEvents-BnBzIdEi.js.map +1 -0
  105. package/dist/{tolerantWebAccess-zEseJ2zT.js → tolerantWebAccess-CNfvmR3m.js} +8 -9
  106. package/dist/{tolerantWebAccess-zEseJ2zT.js.map → tolerantWebAccess-CNfvmR3m.js.map} +1 -1
  107. package/dist/{updateSeedRevokedAt-B9JRwr5T.js → updateSeedRevokedAt-D-3SLW-D.js} +3 -2
  108. package/dist/{updateSeedRevokedAt-B9JRwr5T.js.map → updateSeedRevokedAt-D-3SLW-D.js.map} +1 -1
  109. package/package.json +7 -12
  110. package/dist/Item-oPnmIehk.js.map +0 -1
  111. package/dist/ModelProperty-D2vJozmW.js.map +0 -1
  112. package/dist/errors-CnT0fSMK.js.map +0 -1
  113. package/dist/index-CZMWKXLM.js +0 -27
  114. package/dist/index-CZMWKXLM.js.map +0 -1
  115. package/dist/index-DXRhFg1N.js.map +0 -1
  116. package/dist/index-Gh42_47r.js.map +0 -1
  117. package/dist/index.browser-DQstVvRV.js.map +0 -1
  118. package/dist/index.node-BfiBriEq.js.map +0 -1
  119. package/dist/property-iNW1N3vm.js.map +0 -1
  120. package/dist/src/db/read/getItemProperty.d.ts +0 -6
  121. package/dist/src/db/read/getItemProperty.d.ts.map +0 -1
  122. package/dist/src/db/read/isSeedRevoked.d.ts +0 -7
  123. package/dist/src/db/read/isSeedRevoked.d.ts.map +0 -1
  124. package/dist/src/db/write/saveMetadata.d.ts +0 -3
  125. package/dist/src/db/write/saveMetadata.d.ts.map +0 -1
  126. package/dist/src/db/write/updateMetadata.d.ts +0 -13
  127. package/dist/src/db/write/updateMetadata.d.ts.map +0 -1
  128. package/dist/src/types/fileManager.d.ts +0 -13
  129. package/dist/src/types/fileManager.d.ts.map +0 -1
  130. package/dist/syncDbWithEas-FuyqoEKk.js.map +0 -1
  131. package/dist/tabEvents-DT5ez6io.js +0 -3830
  132. package/dist/tabEvents-DT5ez6io.js.map +0 -1
@@ -166,8 +166,6 @@ class NodeFileManager {
166
166
  return path;
167
167
  }
168
168
  }
169
- /** @deprecated Prefer NodeFileManager */
170
- const FileManager = NodeFileManager;
171
169
  BaseFileManager.configure(new NodeFileManager());
172
170
 
173
171
  /**
@@ -446,32 +444,12 @@ class NodeDb {
446
444
  };
447
445
  }
448
446
  async migrate(pathToDbDir, _dbName, _dbId) {
449
- try {
450
- if (!this.db) {
451
- throw new Error('Database not initialized. Call prepareDb first.');
452
- }
453
- await migrate(this.db, { migrationsFolder: pathToDbDir });
454
- const queryResult = await this.db.select().from(appState);
455
- logger('queryResult', queryResult);
456
- }
457
- catch (error) {
458
- const errorMessage = error.message || String(error) || '';
459
- const errorString = String(error);
460
- const isMigrationError = errorMessage.includes("Can't find meta/_journal.json") ||
461
- errorMessage.includes('_journal.json') ||
462
- errorMessage.includes("Cannot read properties of undefined") ||
463
- errorMessage.includes("reading 'dialect'") ||
464
- errorMessage.includes('undefined is not an object') ||
465
- errorString.includes('dialect') ||
466
- errorString.includes('undefined is not an object');
467
- if (isMigrationError) {
468
- if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {
469
- logger('Warning: Migration failed, but continuing in test environment:', errorMessage || errorString);
470
- return this.db;
471
- }
472
- }
473
- throw error;
447
+ if (!this.db) {
448
+ throw new Error('Database not initialized. Call prepareDb first.');
474
449
  }
450
+ await migrate(this.db, { migrationsFolder: pathToDbDir });
451
+ const queryResult = await this.db.select().from(appState);
452
+ logger('queryResult', queryResult);
475
453
  return this.db;
476
454
  }
477
455
  /**
@@ -500,8 +478,6 @@ class NodeDb {
500
478
  }));
501
479
  }
502
480
  }
503
- /** @deprecated Prefer NodeDb */
504
- const Db = NodeDb;
505
481
  BaseDb.configure(new NodeDb());
506
482
 
507
483
  /**
@@ -560,5 +536,5 @@ function createPlatformServices() {
560
536
  };
561
537
  }
562
538
 
563
- export { Db as D, FileManager as F, resolveFilesDir as a, createPlatformServices as c, resolveSdkDrizzleMigrationsDir as r };
564
- //# sourceMappingURL=index.node-BfiBriEq.js.map
539
+ export { NodeDb as N, NodeFileManager as a, resolveFilesDir as b, createPlatformServices as c, resolveSdkDrizzleMigrationsDir as r };
540
+ //# sourceMappingURL=index.node-DV1OXCp0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node-DV1OXCp0.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\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/** 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 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 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\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\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;IACR;AAEA,IAAA,MAAM,gBAAgB,GAAA;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC;IACpC;AAEA,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC;IACpC;AAEA,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC;IACpC;IAEA,MAAM,UAAU,CAAC,QAAgB,EAAA;QAC/B,OAAO,MAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;IAC3E;;IAGA,MAAM,qBAAqB,GAAA,EAAmB;IAE9C,MAAM,WAAW,CAAC,QAAgB,EAAA;AAChC,QAAA,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;YACzC,OAAO,IAAI,CAAC,IAAI;QAClB;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,IAAI;QAC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,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,22 @@
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';
1
+ export { C as ConflictError, E as EAS_CHAIN_ID_APP_STATE_KEY, A as INIT_CONFIG_CONFLICT_MESSAGE, B as ItemCreateError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, v as assertLocalDbChain, D as claimUnpublishedDrafts, a as client, F as createLocalQueryDataSource, G as easSyncActor, H as getClient, J as getPublishedSeedRecord, K as getSchemaNameFromId, i as importJsonSchema, L as isSeedQueryLocalSourceRegistered, N as listSchemas, k as loadAllSchemasFromDb, O as mergeEasSyncRequestIntents, r as readJsonImportFile, P as registerSeedQueryLocalSource, Q as requestEasSyncFromAddressChange, R as requestEasSyncFromModelsInit, V as sendEasSyncClientRequest, W as setRetriesWhenOnlineEnabled, X as startEasSyncActor, b as syncSchemaFromSource, c as transformImportToSchemaFile, Y as unregisterSeedQueryLocalSource } from './errors-DKxFSvb3.js';
2
+ export { A as ADDRESSES_PERSISTED_EVENT, E as EAS_SEED_DATA_SYNCED_TO_DB_EVENT, F as FILES_CHANGED_EVENT, m as INTERNAL_DATA_TYPES, I as ImageSize, L as LOCAL_COPIES_REMOVED_EVENT, M as ModelPropertyDataTypes, S as SEED_PROTOCOL_SCHEMA_NAME, y as SeedModels, z as TabLockTimeoutError, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, h as eventEmitter, k as generateId, B as isChangeFeedRunning, i as isDataType, C as isLeaderTab, n as normalizeDataType, G as parseAddressesPersistedPayload, H as watchEntityChanges, J as watchEntityRows, K as whenLeaderTab } from './tabEvents-BnBzIdEi.js';
3
+ export { getPropertySchema } from './property-Broz_CWj.js';
4
+ export { A as AmbiguousModelError, C as ClearNotSupportedError, aU as ClientManagerState, a7 as EntityUnloadedError, I as Item, l as ItemProperty, n as ItemPropertySaveValidationError, aB as METADATA_LATEST_FIRST_ORDER_SQL, aV as MachineIds, q as OwnershipError, aW as PUBLISH_NOT_CONFIGURED_MESSAGE, s as assertItemOwned, D as compareMetadataRowsLatestFirst, aX as createNewItem, ar as easPropertyNameForPublish, aY as getAddressesForItemsFilter, aZ as getArweaveUrlForTransaction, t as getCorrectId, ak as getGetAdditionalSyncAddresses, a_ as getGetPublisherForNewSeeds, a$ as getMetadataLatest, b0 as getPublishExecutor, b1 as getRevokeExecutor, b2 as getUploadExecutor, b3 as getVersionData, ac as isClientReady, b4 as isClientReadySnapshot, u as isItemOwned, b5 as isLocalUnsealedDraft, v as isPublishedSeedRef, b6 as isSeedRowOwned, aq as listRelationEasPropertyName, b7 as localUnsealedDraftSql, b8 as normalizeAddressConfig, b9 as normalizeAddressList, am as normalizeHexAddress, ag as normalizePublisher, ba as ownedPublisherSql, bb as ownedSeedsSql, bc as pickLatestMetadataRowPerProperty, bd as placeholderUidSql, be as propertyMachine, bf as publisherInAddressListSql, bg as publisherIsInOwnedSet, bh as setAdditionalSyncAddresses, bi as setGetPublisherForNewSeeds, bj as setPublishExecutor, bk as setRevokeExecutor, bl as setUploadExecutor, W as whenDbReady } from './Item-Ld1iPicQ.js';
4
5
  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';
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-Cdm7Q7el.js';
7
+ export { S as Schema, s as schemaMachine } from './Schema-BzeBUZxi.js';
8
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';
9
+ export { M as MODEL_AMBIGUOUS_EVENT, u as updateSeedRevokedAt } from './updateSeedRevokedAt-D-3SLW-D.js';
10
+ export { ModelProperty } from './ModelProperty-C8gTx4pO.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-FZPPqxqe.js';
12
+ export { getModelSchemasFromEas } from './eas-CdhfODXL.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-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';
14
+ export { closestImageSize, ensureImageLocal, normalizeArweaveTxIdForEnsure } from './ensureImageLocal-DNM6c2yD.js';
15
+ export { getPublishPendingDiff } from './getPublishPendingDiff-DiPff8pS.js';
16
+ export { P as PublishValidationFailedError, R as RELATED_ITEM_UNPUBLISHED_CODE, a as RelatedItemUnpublishedError, b as getPendingRetractions, r as resolvePublishPayloadValues, v as validateItemForPublish } from './getPublishPayload-CLrAcZwr.js';
17
+ export { g as getPublishGraph } from './publishGraph-DnWoWZRP.js';
18
+ 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-DFcgc27c.js';
19
+ export { C as CONTENT_SHA256_TAG, a as CONTENT_TYPE_TAG, b as buildArweaveContentTags, c as contentSha256TagMatches, g as getContentSha256 } from './arweaveContentTags-Bh4wCTal.js';
18
20
  import 'xstate';
19
21
  import 'debug';
20
22
  import 'pluralize';
@@ -24,13 +26,14 @@ import 'lodash-es';
24
26
  import '@noble/hashes/sha3';
25
27
  import '@noble/hashes/utils';
26
28
  import '@seedprotocol/query';
27
- import 'drizzle-orm/sqlite-core';
28
29
  import 'nanoid';
29
30
  import 'nanoid-dictionary';
30
- import '@noble/hashes/sha256';
31
31
  import 'rxjs';
32
+ import 'drizzle-orm/sqlite-core';
32
33
  import '@seedprotocol/archive';
33
- import './SchemaValidationService-CieGrj5c.js';
34
+ import './SchemaValidationService-CW0s7V7R.js';
34
35
  import '@sinclair/typebox/value';
36
+ import './download-Cvac_VGu.js';
37
+ import '@noble/hashes/sha256';
35
38
  import 'parse5';
36
39
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,22 +1,19 @@
1
- import { getModelPropertyDefinitions } from './property-iNW1N3vm.js';
1
+ import { getModelPropertyDefinitions } from './property-Broz_CWj.js';
2
2
  import 'pluralize';
3
- import './Item-oPnmIehk.js';
4
- import './tabEvents-DT5ez6io.js';
3
+ import './Item-Ld1iPicQ.js';
4
+ import './tabEvents-BnBzIdEi.js';
5
+ import '@sinclair/typebox';
5
6
  import 'debug';
7
+ import 'nanoid';
8
+ import 'nanoid-dictionary';
6
9
  import './BaseFileManager-DLou1TZS.js';
7
10
  import 'drizzle-orm/sqlite-core';
8
11
  import 'drizzle-orm';
9
- import 'xstate';
10
12
  import '@seedprotocol/eas';
11
- import '@sinclair/typebox';
12
13
  import '@seedprotocol/arweave';
13
- import 'nanoid';
14
- import 'nanoid-dictionary';
15
- import '@noble/hashes/sha256';
16
- import '@noble/hashes/sha3';
17
- import '@noble/hashes/utils';
18
- import 'lodash-es';
14
+ import 'xstate';
19
15
  import 'rxjs';
16
+ import 'lodash-es';
20
17
 
21
18
  /**
22
19
  * One read per model while it's in flight: an item's properties load together and would otherwise
@@ -45,4 +42,4 @@ function loadModelPropertyRecordSchemas(modelName, modelFileId, db) {
45
42
  }
46
43
 
47
44
  export { loadModelPropertyRecordSchemas };
48
- //# sourceMappingURL=modelPropertyRecordSchemas-DEe-lYhn.js.map
45
+ //# sourceMappingURL=modelPropertyRecordSchemas-se4QMXSi.js.map
@@ -1 +1 @@
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;;"}
1
+ {"version":3,"file":"modelPropertyRecordSchemas-se4QMXSi.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,12 +1,12 @@
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-CnT0fSMK.js';
3
- export { A as AmbiguousModelError, P as Property, h as eventEmitter } from './tabEvents-DT5ez6io.js';
2
+ export { C as ConflictError, I as ItemCreateValidationError, M as Model, U as UnknownModelError, a as client, i as importJsonSchema, l as loadSchemaFromFile, r as readJsonImportFile, b as syncSchemaFromSource, c as transformImportToSchemaFile } from './errors-DKxFSvb3.js';
3
+ export { P as Property, h as eventEmitter } from './tabEvents-BnBzIdEi.js';
4
4
  import 'pluralize';
5
5
  import '@seedprotocol/eas';
6
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';
7
+ export { A as AmbiguousModelError, C as ClearNotSupportedError, I as Item, l as ItemProperty, n as ItemPropertySaveValidationError, q as OwnershipError, s as assertItemOwned, t as getCorrectId, u as isItemOwned, v as isPublishedSeedRef } from './Item-Ld1iPicQ.js';
8
+ import { c as createPlatformServices } from './index.node-DV1OXCp0.js';
9
+ export { N as NodeDb, a as NodeFileManager, r as resolveSdkDrizzleMigrationsDir } from './index.node-DV1OXCp0.js';
10
10
  export { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave';
11
11
  import { configurePlatform } from './configurePlatform-WkmvqeTO.js';
12
12
  import 'xstate';
@@ -17,10 +17,9 @@ import 'lodash-es';
17
17
  import '@noble/hashes/sha3';
18
18
  import '@noble/hashes/utils';
19
19
  import '@seedprotocol/query';
20
- import 'drizzle-orm/sqlite-core';
21
20
  import 'nanoid';
22
21
  import 'nanoid-dictionary';
23
- import '@noble/hashes/sha256';
22
+ import 'drizzle-orm/sqlite-core';
24
23
  import 'rxjs';
25
24
  import 'fs/promises';
26
25
  import 'fs';
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sources":["../../src/node/index.ts"],"sourcesContent":["import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport { Model, Property } from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError, ClearNotSupportedError } from '../ItemProperty/ItemProperty'\nexport type { IItem, IItemProperty } from '../interfaces'\n\n// Errors\nexport { AmbiguousModelError } from '../Model/errors'\nexport { ItemCreateValidationError, UnknownModelError, type ItemCreateProblem } from '../Item/errors'\nexport { ConflictError, type ConflictResult } from '../Schema/errors'\nexport { OwnershipError, assertItemOwned, isItemOwned } from '../helpers/ownership'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport { isPublishedSeedRef } from '../helpers/relationSeedRef'\nexport { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\nexport type { MultiTabMode } from '../helpers/tabCoordinator'\nexport type { SyncFromEasOptions } from '../events/item/syncDbWithEas'\nexport type { HtmlEmbeddedDataUriPolicy } from '../helpers/property'\n\n// Register the Node platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE"}
1
+ {"version":3,"file":"node.js","sources":["../../src/node/index.ts"],"sourcesContent":["import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport { Model, Property } from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError, ClearNotSupportedError } from '../ItemProperty/ItemProperty'\nexport type { IItem, IItemProperty } from '../interfaces'\n\n// Errors\nexport { AmbiguousModelError } from '../Model/errors'\nexport { ItemCreateValidationError, UnknownModelError, type ItemCreateProblem } from '../Item/errors'\nexport { ConflictError, type ConflictResult } from '../Schema/errors'\nexport { OwnershipError, assertItemOwned, isItemOwned } from '../helpers/ownership'\n\n// Node.js specific exports\nexport { NodeFileManager } from './helpers/FileManager'\nexport { NodeDb, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport { isPublishedSeedRef } from '../helpers/relationSeedRef'\nexport { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\nexport type { MultiTabMode } from '../helpers/tabCoordinator'\nexport type { SyncFromEasOptions } from '../events/item/syncDbWithEas'\nexport type { HtmlEmbeddedDataUriPolicy } from '../helpers/property'\n\n// Register the Node platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE"}
@@ -1,23 +1,22 @@
1
- export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-DQstVvRV.js';
1
+ export { c as createPlatformServices, r as resolveFilesDir } from './index.browser-D9oC-KKx.js';
2
2
  import '@seedprotocol/arweave';
3
3
  import '@seedprotocol/eas';
4
4
  export { configurePlatform } from './configurePlatform-WkmvqeTO.js';
5
- import './tabEvents-DT5ez6io.js';
5
+ import './tabEvents-BnBzIdEi.js';
6
+ import '@sinclair/typebox';
6
7
  import 'debug';
8
+ import 'nanoid';
9
+ import 'nanoid-dictionary';
7
10
  import './BaseFileManager-DLou1TZS.js';
8
11
  import 'drizzle-orm/sqlite-core';
9
12
  import 'drizzle-orm';
10
- import 'xstate';
11
- import 'pluralize';
12
- import '@sinclair/typebox';
13
- import 'nanoid';
14
- import 'nanoid-dictionary';
13
+ import './arweaveContentTags-Bh4wCTal.js';
15
14
  import '@noble/hashes/sha256';
16
15
  import '@noble/hashes/sha3';
17
16
  import '@noble/hashes/utils';
18
- import 'lodash-es';
19
17
  import './browserSupport-C64rX-2I.js';
20
18
  import 'drizzle-orm/sqlite-proxy';
19
+ import 'pluralize';
21
20
  import './index-BjWk0x4-.js';
22
21
  import 'sqlocal/drizzle';
23
22
  import './minimumUpgradeVersion-BDhHvHtr.js';
@@ -1 +1 @@
1
- {"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- export { c as createPlatformServices, a as resolveFilesDir } from './index.node-BfiBriEq.js';
1
+ export { c as createPlatformServices, b as resolveFilesDir } from './index.node-DV1OXCp0.js';
2
2
  import '@seedprotocol/arweave';
3
3
  import '@seedprotocol/eas';
4
4
  import '@seedprotocol/eas/node';
@@ -1,21 +1,18 @@
1
1
  import pluralize from 'pluralize';
2
- import { E as propertyKeyFromStoredName } from './Item-oPnmIehk.js';
2
+ import { x as propertyKeyFromStoredName } from './Item-Ld1iPicQ.js';
3
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';
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-BnBzIdEi.js';
5
5
  import 'xstate';
6
6
  import 'debug';
7
7
  import '@seedprotocol/eas';
8
8
  import 'drizzle-orm';
9
9
  import 'rxjs';
10
10
  import 'lodash-es';
11
- import '@seedprotocol/arweave';
12
11
  import 'drizzle-orm/sqlite-core';
12
+ import '@seedprotocol/arweave';
13
13
  import '@sinclair/typebox';
14
14
  import 'nanoid';
15
15
  import 'nanoid-dictionary';
16
- import '@noble/hashes/sha256';
17
- import '@noble/hashes/sha3';
18
- import '@noble/hashes/utils';
19
16
 
20
17
  /**
21
18
  * The key in `defs` a property name refers to: the key itself, a stored metadata name
@@ -43,14 +40,14 @@ function resolvePropertyKey(defs, propertyName) {
43
40
  async function getModelPropertyDefinitions(modelName, scope = {}, db = BaseDb.getAppDb()) {
44
41
  if (!db)
45
42
  return new Map();
46
- const _mod_0 = await import('./tabEvents-DT5ez6io.js');
47
- const _ns_0 = _mod_0.bh;
43
+ const _mod_0 = await import('./Item-Ld1iPicQ.js');
44
+ const _ns_0 = _mod_0.bO;
48
45
  const { resolveModelRecord } = _ns_0;
49
46
  const modelRecord = await resolveModelRecord(modelName, scope, db);
50
47
  if (!modelRecord?.id)
51
48
  return new Map();
52
- const _mod_1 = await import('./tabEvents-DT5ez6io.js');
53
- const _ns_1 = _mod_1.bi;
49
+ const _mod_1 = await import('./Item-Ld1iPicQ.js');
50
+ const _ns_1 = _mod_1.bP;
54
51
  const { getPropertyDefinitions } = _ns_1;
55
52
  return getPropertyDefinitions(modelRecord.id, db);
56
53
  }
@@ -84,4 +81,4 @@ scope = {}) => {
84
81
  };
85
82
 
86
83
  export { getModelPropertyDefinitions, getPropertySchema, resolvePropertyKey };
87
- //# sourceMappingURL=property-iNW1N3vm.js.map
84
+ //# sourceMappingURL=property-Broz_CWj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-Broz_CWj.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":";;;;;;;;;;;;;;;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A,CAAA,CAAA,CAAU,CAAC,CAAA,CAAE;KACiD;AACnF,CAAA;;"}
@@ -2,8 +2,8 @@ import { eq } from 'drizzle-orm';
2
2
  import { isValidEasAttestationUid } from '@seedprotocol/eas';
3
3
  import { normalizeRelationPropertyValue, resolveSeedIdsFromRefString } from '@seedprotocol/arweave';
4
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';
5
+ import { H as findSeedRow, J as isVersionRevoked, K as getPropertyDefinitions, L as readModelMetadataProperties, M as metadataPropertyNameForms, N as currentPropertyRow, P as getLatestVersionRow, G as getLatestPublishedVersionRow, Q as resolveModelRecord, R as resolveModelRecordByNameOrType, S as parseListPropertyValueFromStorage, v as isPublishedSeedRef } from './Item-Ld1iPicQ.js';
6
+ import { Z as ZERO_BYTES32, n as normalizeDataType, M as ModelPropertyDataTypes } from './tabEvents-BnBzIdEi.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-CZMWKXLM.js');
150
+ const { waitForPendingOutboxOps } = await import('./index-9udoYObJ.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-CRn_N3NT.js.map
311
+ //# sourceMappingURL=publishGraph-DnWoWZRP.js.map