@seedprotocol/sdk 0.1.117 → 0.1.118

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.
@@ -27,6 +27,7 @@ import { drizzle } from 'drizzle-orm/sqlite-proxy';
27
27
  import { migrate as migrate$1 } from 'drizzle-orm/sqlite-proxy/migrator';
28
28
  import { readMigrationFiles } from 'drizzle-orm/migrator';
29
29
  import { WebAccess } from '@zenfs/dom';
30
+ import * as fsNode from 'node:fs';
30
31
  import Arweave from 'arweave';
31
32
  import { i as internalPropertyNames, I as INTERNAL_DATA_TYPES, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, d as defaultAttestationData } from './constants-B6s6tGup.js';
32
33
  import { ZERO_BYTES32, SchemaEncoder } from '@ethereum-attestation-service/eas-sdk';
@@ -2097,7 +2098,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2097
2098
  if (!models$1) {
2098
2099
  return;
2099
2100
  }
2100
- const { models: SeedModels } = yield import('./seed.schema.config-CPGWVSWI.js');
2101
+ const { models: SeedModels } = yield import('./seed.schema.config-BB6-tbUU.js');
2101
2102
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2102
2103
  let hasModelsInDb = false;
2103
2104
  const schemaDefsByModelName = new Map();
@@ -2377,9 +2378,21 @@ const migrate = fromCallback(({ sendBack, input: { context } }) => {
2377
2378
  //
2378
2379
  // _initFs()
2379
2380
  const _checkForFiles = () => __awaiter(void 0, void 0, void 0, function* () {
2380
- journalExists = yield fs.promises.exists(`/${pathToDbDir}/meta/_journal.json`);
2381
+ const journalPath = `/${pathToDbDir}/meta/_journal.json`;
2382
+ journalExists = yield fs.promises.exists(journalPath);
2383
+ const journalExistsAsync = journalExists;
2384
+ const journalExistsSync = fs.existsSync(journalPath);
2385
+ const journalExistsSyncNode = fsNode.existsSync(journalPath);
2386
+ console.log('journalExistsAsync', journalExistsAsync);
2387
+ console.log('journalExistsSync', journalExistsSync);
2388
+ console.log('journalExistsSyncNode', journalExistsSyncNode);
2381
2389
  if (!journalExists) {
2382
- window.location.reload();
2390
+ const handle = yield navigator.storage.getDirectory();
2391
+ yield configureSingle({
2392
+ backend: WebAccess,
2393
+ handle,
2394
+ });
2395
+ // window.location.reload()
2383
2396
  // setTimeout(() => {
2384
2397
  // _checkForFiles().then(() => {
2385
2398
  // return
@@ -2452,8 +2465,14 @@ const migrate = fromCallback(({ sendBack, input: { context } }) => {
2452
2465
  });
2453
2466
  }
2454
2467
  catch (error) {
2455
- console.error('Error migrating database: ', error);
2456
- window.location.reload();
2468
+ // console.error('Error migrating database: ', error)
2469
+ // window.location.reload()
2470
+ const handle = yield navigator.storage.getDirectory();
2471
+ yield configureSingle({
2472
+ backend: WebAccess,
2473
+ handle,
2474
+ });
2475
+ return _migrate();
2457
2476
  }
2458
2477
  setAppDb(drizzleDb);
2459
2478
  // const createTempTableQuery = await appDb.run(
@@ -6481,7 +6500,7 @@ const client = {
6481
6500
  addresses,
6482
6501
  arweaveDomain,
6483
6502
  });
6484
- import('./seed.schema.config-CPGWVSWI.js').then(({ models }) => {
6503
+ import('./seed.schema.config-BB6-tbUU.js').then(({ models }) => {
6485
6504
  for (const [key, value] of Object.entries(models)) {
6486
6505
  setModel(key, value);
6487
6506
  }
@@ -7156,7 +7175,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
7156
7175
  if (propertyRecordSchema &&
7157
7176
  propertyRecordSchema.storageType &&
7158
7177
  propertyRecordSchema.storageType === 'ItemStorage') {
7159
- const { Item } = yield import('./index-Dwb6l5UL.js');
7178
+ const { Item } = yield import('./index-B_TEG7RD.js');
7160
7179
  const item = yield Item.find({
7161
7180
  seedLocalId,
7162
7181
  modelName,
@@ -8098,4 +8117,4 @@ if (isNode()) {
8098
8117
  }
8099
8118
 
8100
8119
  export { GET_SCHEMAS as G, Item as I, Json as J, List as L, Model as M, Property as P, Relation as R, Text as T, GET_SCHEMA_BY_NAME as a, GET_SEEDS as b, GET_SEED_IDS as c, GET_STORAGE_TRANSACTION_ID as d, GET_VERSIONS as e, GET_PROPERTIES as f, GET_ALL_PROPERTIES_FOR_ALL_VERSIONS as g, itemMachineAll as h, itemMachineSingle as i, ImageSrc as j, ItemProperty as k, useItem as l, useItemProperties as m, useCreateItem as n, useItemProperty as o, useDeleteItem as p, useGlobalServiceStatus as q, useServices as r, getGlobalService as s, client as t, useItems as u, getCorrectId as v, withSeed as w };
8101
- //# sourceMappingURL=index-Dd6tPdUt.js.map
8120
+ //# sourceMappingURL=index-BPIesZ_6.js.map