@seedprotocol/sdk 0.2.28 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Db-BIYweCKe.js → Db-Bu5Y7_fn.js} +2 -2
- package/dist/{Db-BIYweCKe.js.map → Db-Bu5Y7_fn.js.map} +1 -1
- package/dist/{Db-CURz-SUg.js → Db-lX4nNJTb.js} +2 -2
- package/dist/{Db-CURz-SUg.js.map → Db-lX4nNJTb.js.map} +1 -1
- package/dist/{Item-DEoXH_7C.js → Item-BRHX17yq.js} +2 -2
- package/dist/{Item-DEoXH_7C.js.map → Item-BRHX17yq.js.map} +1 -1
- package/dist/{ItemProperty-B_gQPKDe.js → ItemProperty-CZzIP1b8.js} +2 -2
- package/dist/{ItemProperty-B_gQPKDe.js.map → ItemProperty-CZzIP1b8.js.map} +1 -1
- package/dist/{index-d-n1CVO_.js → index-BCmsQoYg.js} +10 -9
- package/dist/{index-d-n1CVO_.js.map → index-BCmsQoYg.js.map} +1 -1
- package/dist/{index-boyGAsLD.js → index-DzDVTUae.js} +2 -2
- package/dist/index-DzDVTUae.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-DCQvnp98.js → seed.schema.config-BswsDyRe.js} +2 -2
- package/dist/{seed.schema.config-DCQvnp98.js.map → seed.schema.config-BswsDyRe.js.map} +1 -1
- package/dist/src/getPublishPayload.ts +2 -1
- package/dist/src/waitForDb.ts +17 -18
- package/dist/types/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/index-boyGAsLD.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as BaseDb, g as getAppDb, i as isAppDbReady, c as getSqliteWasmClient } from './index-
|
|
1
|
+
import { b as BaseDb, g as getAppDb, i as isAppDbReady, c as getSqliteWasmClient } from './index-BCmsQoYg.js';
|
|
2
2
|
import { __awaiter } from 'tslib';
|
|
3
3
|
import debug from 'debug';
|
|
4
4
|
import 'immer';
|
|
@@ -135,4 +135,4 @@ class Db extends BaseDb {
|
|
|
135
135
|
BaseDb.setPlatformClass(Db);
|
|
136
136
|
|
|
137
137
|
export { Db };
|
|
138
|
-
//# sourceMappingURL=Db-
|
|
138
|
+
//# sourceMappingURL=Db-Bu5Y7_fn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Db-
|
|
1
|
+
{"version":3,"file":"Db-Bu5Y7_fn.js","sources":["../../src/services/db/connectionManager.ts","../../src/browser/db/Db.ts"],"sourcesContent":["type SqliteDatabase = {\n open: (filename: string) => Promise<void>\n exec: (sql: string, params?: any[]) => any\n close: () => void\n}\n\nclass SqliteConnectionManager {\n private sqliteModule: SqliteDatabase\n private idleTimeout: number\n private databases: { [key: string]: SqliteDatabase }\n private idleTimers: { [key: string]: NodeJS.Timeout }\n\n constructor(sqliteModule: SqliteDatabase, idleTimeout: number = 300000) {\n // Default idle timeout: 5 minutes\n this.sqliteModule = sqliteModule\n this.idleTimeout = idleTimeout\n this.databases = {}\n this.idleTimers = {}\n }\n\n private resetIdleTimer(dbName: string): void {\n if (this.idleTimers[dbName]) {\n clearTimeout(this.idleTimers[dbName])\n }\n\n this.idleTimers[dbName] = setTimeout(() => {\n this.closeConnection(dbName)\n }, this.idleTimeout)\n }\n\n private async getConnection(dbName: string): Promise<SqliteDatabase> {\n if (this.databases[dbName]) {\n this.resetIdleTimer(dbName)\n return this.databases[dbName]\n }\n\n const db = new this.sqliteModule()\n await db.open(dbName)\n this.databases[dbName] = db\n this.resetIdleTimer(dbName)\n return db\n }\n\n public async execute(\n dbName: string,\n sql: string,\n params: any[] = [],\n ): Promise<any> {\n const db = await this.getConnection(dbName)\n const result = db.exec(sql, params)\n this.resetIdleTimer(dbName)\n return result\n }\n\n public closeConnection(dbName: string): void {\n if (this.databases[dbName]) {\n this.databases[dbName].close()\n delete this.databases[dbName]\n if (this.idleTimers[dbName]) {\n clearTimeout(this.idleTimers[dbName])\n delete this.idleTimers[dbName]\n }\n }\n }\n}\n\nexport { SqliteConnectionManager }\n","import { BaseDb } from \"@/db/Db/BaseDb\";\nimport { IDb } from \"@/interfaces/IDb\";\nimport { getAppDb, getSqliteWasmClient, isAppDbReady } from \"./sqlWasmClient\";\nimport { SqliteConnectionManager } from \"@/services/db\";\nimport debug from \"debug\";\n\nconst logger = debug('app:browser:db:Db')\n\nclass Db extends BaseDb implements IDb {\n constructor() {\n super()\n }\n\n static getAppDb() {\n return getAppDb()\n }\n\n static isAppDbReady() {\n return isAppDbReady()\n }\n\n static prepareDb(filesDir: string) {\n\n return new Promise((resolve, reject) => {\n let sqliteWasmClient\n const interval = setInterval(() => {\n // TODO: Add a timeout\n // TODO: Add a cancel token to the promise so we can prevent more loops starting while we're checking the successful outcome\n getSqliteWasmClient().then((sqliteWasmClient) => {\n\n if (sqliteWasmClient) {\n clearInterval(interval)\n const manager = new SqliteConnectionManager(sqliteWasmClient)\n resolve(manager)\n }\n })\n\n }, 200)\n })\n }\n\n static connectToDb(pathToDir: string, dbName: string) {\n\n return new Promise((resolve, reject) => {\n const interval = setInterval(() => {\n\n // TODO: Add a timeout\n // TODO: Add a cancel token to the promise so we can prevent more loops starting while we're checking the successful outcome\n getSqliteWasmClient().then((sqliteWasmClient) => {\n\n //@ts-ignore\n sqliteWasmClient('config-get', {}).then((response) => {\n logger(response)\n logger('Running SQLite3 version', response.result.version.libVersion)\n\n //@ts-ignore\n sqliteWasmClient('open', {\n filename: `file:${pathToDir}/db/${dbName}.sqlite3?vfs=opfs`,\n }).then((response: { dbId: string, result: { filename: string } }) => {\n\n logger(response)\n const dbId = response.dbId\n logger(\n 'OPFS is available, created persisted database at',\n response.result.filename.replace(/^file:(.*?)\\?vfs=opfs$/, '$1'),\n )\n\n if (dbId) {\n clearInterval(interval)\n resolve(dbId)\n }\n })\n })\n })\n }, 500)\n })\n }\n}\n\nBaseDb.setPlatformClass(Db)\n\nexport { Db }"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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';
|
|
2
|
-
import { b as BaseDb } from './index-
|
|
2
|
+
import { b as BaseDb } from './index-BCmsQoYg.js';
|
|
3
3
|
import { defineConfig } from 'drizzle-kit';
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
5
|
import process from 'node:process';
|
|
@@ -111,4 +111,4 @@ class Db extends BaseDb {
|
|
|
111
111
|
BaseDb.setPlatformClass(Db);
|
|
112
112
|
|
|
113
113
|
export { Db };
|
|
114
|
-
//# sourceMappingURL=Db-
|
|
114
|
+
//# sourceMappingURL=Db-lX4nNJTb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Db-
|
|
1
|
+
{"version":3,"file":"Db-lX4nNJTb.js","sources":["../../src/node/db/node.app.db.config.ts","../../src/node/db/Db.ts"],"sourcesContent":["import { defineConfig } from 'drizzle-kit'\nimport dotenv from 'dotenv'\nimport process from 'node:process'\nimport path from 'path'\nimport { DrizzleConfig } from 'drizzle-orm'\n\ndotenv.config()\n\nlet sdkRoot = './node_modules/@seedprotocol/sdk'\n\nif (process.env.IS_SEED_DEV) {\n sdkRoot = './src'\n}\n\nlet dotSeedDir = path.join(process.cwd(), '.seed')\n\nif (process.env.IS_SEED_DEV) {\n dotSeedDir = path.join(\n process.cwd(),\n '__tests__',\n '__mocks__',\n 'browser',\n 'project',\n '.seed',\n )\n}\n\nlet schemaDir = `${sdkRoot}/dist/seedSchema/*.ts`\n\nif (process.env.IS_SEED_DEV) {\n schemaDir = `${sdkRoot}/seedSchema/*.ts`\n}\n\nexport default defineConfig({\n schema: schemaDir,\n dialect: 'sqlite',\n out: `${dotSeedDir}/db`,\n dbCredentials: {\n url: `${dotSeedDir}/db/app_db.sqlite3`,\n },\n}) as DrizzleConfig\n","import { BaseDb } from \"@/db/Db/BaseDb\";\nimport { IDb } from \"@/interfaces\";\nimport nodeAppDbConfig from \"./node.app.db.config\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport { defineConfig, } from \"drizzle-kit\";\nimport path from \"path\";\nimport { DrizzleConfig, } from \"drizzle-orm\";\nimport Database from \"better-sqlite3\";\n\nconst getConfig = (filesDir: string) => {\n\n const dotSeedDir = path.join(filesDir, '.seed')\n let schemaDir = `${dotSeedDir}/schema/*Schema.ts`\n\n const nodeDbConfig = defineConfig({\n schema: schemaDir,\n dialect: 'sqlite',\n out: `${dotSeedDir}/db`,\n dbCredentials: {\n url: `${dotSeedDir}/db/app_db.sqlite3`,\n }\n }) as DrizzleConfig & { dbCredentials: { url: string } }\n\n return nodeDbConfig\n}\n\nclass Db extends BaseDb implements IDb {\n constructor() {\n super()\n }\n\n static getAppDb() {\n return drizzle(nodeAppDbConfig)\n }\n\n static isAppDbReady() {\n return true\n }\n\n static async prepareDb(filesDir: string) {\n const nodeDbConfig = getConfig(filesDir)\n\n let db\n\n try {\n db = drizzle(nodeDbConfig)\n } catch (error) {\n console.error(error)\n }\n\n try {\n const client = new Database(nodeDbConfig.dbCredentials.url)\n db = drizzle({ client })\n } catch (error) {\n console.error(error)\n }\n\n return db\n }\n\n static async connectToDb(pathToDir: string, dbName: string) {\n\n const nodeDbConfig = getConfig(pathToDir)\n\n return {\n id: drizzle(nodeDbConfig).$client.name\n }\n }\n}\n\nBaseDb.setPlatformClass(Db)\n\nexport { Db }"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,CAAC,MAAM,EAAE;AAEf,IAAI,OAAO,GAAG,kCAAkC;AAEhD,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;IAC3B,OAAO,GAAG,OAAO;AACnB;AAEA,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC;AAElD,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;IAC3B,UAAU,GAAG,IAAI,CAAC,IAAI,CACpB,OAAO,CAAC,GAAG,EAAE,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS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A,IAAI,EAAE;AAEN,YAAA,IAAI;AACF,gBAAA,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;;YAC1B,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;;AAGtB,YAAA,IAAI;gBACF,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC;AAC3D,gBAAA,EAAE,GAAG,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;;YACxB,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;;AAGtB,YAAA,OAAO,EAAE;SACV,CAAA;AAAA;AAED,IAAA,OAAa,WAAW,CAAC,SAAiB,EAAE,MAAc,EAAA;;AAExD,YAAA,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC;YAEzC,OAAO;gBACL,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC;aACnC;SACF,CAAA;AAAA;AACF;AAED,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseItem } from './index-
|
|
1
|
+
import { B as BaseItem } from './index-BCmsQoYg.js';
|
|
2
2
|
import 'immer';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import 'tslib';
|
|
@@ -37,4 +37,4 @@ class Item extends BaseItem {
|
|
|
37
37
|
BaseItem.setPlatformClass(Item);
|
|
38
38
|
|
|
39
39
|
export { Item };
|
|
40
|
-
//# sourceMappingURL=Item-
|
|
40
|
+
//# sourceMappingURL=Item-BRHX17yq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item-
|
|
1
|
+
{"version":3,"file":"Item-BRHX17yq.js","sources":["../../src/node/Item/Item.ts"],"sourcesContent":["import { IItem } from '@/interfaces';\nimport { BaseItem } from '@/Item/BaseItem';\nimport { ModelSchema, ModelValues, NewItemProps } from '@/types';\n\nexport class Item<T extends ModelValues<ModelSchema>> extends BaseItem<T> implements IItem<T> {\n constructor(initialValues: NewItemProps<T>) {\n super(initialValues);\n }\n\n}\n\nBaseItem.setPlatformClass(Item)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIM,MAAO,IAAyC,SAAQ,QAAW,CAAA;AACvE,IAAA,WAAA,CAAY,aAA8B,EAAA;QACxC,KAAK,CAAC,aAAa,CAAC;;AAGvB;AAED,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BaseItemProperty } from './index-
|
|
1
|
+
import { a as BaseItemProperty } from './index-BCmsQoYg.js';
|
|
2
2
|
import 'immer';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import 'tslib';
|
|
@@ -36,4 +36,4 @@ class ItemProperty extends BaseItemProperty {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export { ItemProperty };
|
|
39
|
-
//# sourceMappingURL=ItemProperty-
|
|
39
|
+
//# sourceMappingURL=ItemProperty-CZzIP1b8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemProperty-
|
|
1
|
+
{"version":3,"file":"ItemProperty-CZzIP1b8.js","sources":["../../src/node/ItemProperty/ItemProperty.ts"],"sourcesContent":["import { IItemProperty } from '@/interfaces'\nimport { BaseItemProperty } from '@/ItemProperty/BaseItemProperty'\nimport { CreatePropertyInstanceProps, ModelSchema, ModelValues, } from '@/types'\n\nexport class ItemProperty<PropertyType> extends BaseItemProperty<PropertyType> implements IItemProperty<PropertyType> {\n constructor(initialValues: Partial<CreatePropertyInstanceProps>) {\n super(initialValues)\n }\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIM,MAAO,YAA2B,SAAQ,gBAA8B,CAAA;AAC5E,IAAA,WAAA,CAAY,aAAmD,EAAA;QAC7D,KAAK,CAAC,aAAa,CAAC;;AAEvB;;;;"}
|
|
@@ -134,7 +134,7 @@ const initItem = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
134
134
|
Item$2 = (yield Promise.resolve().then(function () { return Item$1; })).Item;
|
|
135
135
|
}
|
|
136
136
|
if (!isBrowser()) {
|
|
137
|
-
Item$2 = (yield import('./Item-
|
|
137
|
+
Item$2 = (yield import('./Item-BRHX17yq.js')).Item;
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
|
|
@@ -184,17 +184,17 @@ const initItemProperty = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
184
184
|
ItemProperty$2 = (yield Promise.resolve().then(function () { return ItemProperty$1; })).ItemProperty;
|
|
185
185
|
}
|
|
186
186
|
if (!isBrowser()) {
|
|
187
|
-
ItemProperty$2 = (yield import('./ItemProperty-
|
|
187
|
+
ItemProperty$2 = (yield import('./ItemProperty-CZzIP1b8.js')).ItemProperty;
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
let Db;
|
|
192
192
|
const initDb = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
193
193
|
if (isBrowser()) {
|
|
194
|
-
Db = (yield import('./Db-
|
|
194
|
+
Db = (yield import('./Db-Bu5Y7_fn.js')).Db;
|
|
195
195
|
}
|
|
196
196
|
if (!isBrowser()) {
|
|
197
|
-
Db = (yield import('./Db-
|
|
197
|
+
Db = (yield import('./Db-lX4nNJTb.js')).Db;
|
|
198
198
|
}
|
|
199
199
|
// TODO: Add config for React Native
|
|
200
200
|
});
|
|
@@ -1696,7 +1696,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1696
1696
|
if (!models$1) {
|
|
1697
1697
|
return;
|
|
1698
1698
|
}
|
|
1699
|
-
const { models: SeedModels } = yield import('./seed.schema.config-
|
|
1699
|
+
const { models: SeedModels } = yield import('./seed.schema.config-BswsDyRe.js');
|
|
1700
1700
|
const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
|
|
1701
1701
|
let hasModelsInDb = false;
|
|
1702
1702
|
const schemaDefsByModelName = new Map();
|
|
@@ -5522,7 +5522,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5522
5522
|
if (propertyRecordSchema &&
|
|
5523
5523
|
propertyRecordSchema.storageType &&
|
|
5524
5524
|
propertyRecordSchema.storageType === 'ItemStorage') {
|
|
5525
|
-
const { Item } = yield import('./index-
|
|
5525
|
+
const { Item } = yield import('./index-DzDVTUae.js');
|
|
5526
5526
|
const item = yield Item.find({
|
|
5527
5527
|
seedLocalId,
|
|
5528
5528
|
modelName,
|
|
@@ -6985,7 +6985,8 @@ const processListProperty = (listProperty, multiPublishPayload) => __awaiter(voi
|
|
|
6985
6985
|
seedUid,
|
|
6986
6986
|
});
|
|
6987
6987
|
if (!relatedItem) {
|
|
6988
|
-
|
|
6988
|
+
console.error(`No related item found for list property: ${listProperty.propertyName}`);
|
|
6989
|
+
continue;
|
|
6989
6990
|
}
|
|
6990
6991
|
if (relatedItem.seedUid) {
|
|
6991
6992
|
return multiPublishPayload;
|
|
@@ -8152,7 +8153,7 @@ const client = {
|
|
|
8152
8153
|
arweaveDomain,
|
|
8153
8154
|
filesDir,
|
|
8154
8155
|
});
|
|
8155
|
-
const { models: internalModels } = yield import('./seed.schema.config-
|
|
8156
|
+
const { models: internalModels } = yield import('./seed.schema.config-BswsDyRe.js');
|
|
8156
8157
|
for (const [key, value] of Object.entries(internalModels)) {
|
|
8157
8158
|
setModel(key, value);
|
|
8158
8159
|
}
|
|
@@ -8200,4 +8201,4 @@ const client = {
|
|
|
8200
8201
|
enableMapSet();
|
|
8201
8202
|
|
|
8202
8203
|
export { BaseItem as B, Db as D, Item as I, Json as J, List as L, Model as M, Property as P, Relation as R, Text as T, BaseItemProperty as a, BaseDb as b, getSqliteWasmClient as c, ImageSrc as d, Item$2 as e, ItemProperty$2 as f, getAppDb as g, useItem as h, isAppDbReady as i, useItemProperties as j, useCreateItem as k, useItemProperty as l, useDeleteItem as m, useGlobalServiceStatus as n, usePublishItem as o, usePersistedSnapshots as p, useServices as q, useService as r, getCorrectId as s, getGlobalService as t, useItems as u, eventEmitter as v, withSeed as w, client as x };
|
|
8203
|
-
//# sourceMappingURL=index-
|
|
8204
|
+
//# sourceMappingURL=index-BCmsQoYg.js.map
|