@seedprotocol/sdk 0.1.115 → 0.1.117

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.
@@ -3,8 +3,8 @@ import path, { basename } from 'path';
3
3
  import 'reflect-metadata';
4
4
  import { Type } from '@sinclair/typebox';
5
5
  import { fromCallback, createActor, waitFor, setup, assign, raise } from 'xstate';
6
- import { sql, relations, count, max, eq, or, isNotNull, isNull, and, gt, inArray, like, getTableColumns } from 'drizzle-orm';
7
6
  import { fs, configureSingle } from '@zenfs/core';
7
+ import { sql, relations, count, max, eq, or, isNotNull, isNull, and, gt, inArray, like, getTableColumns } from 'drizzle-orm';
8
8
  import 'dayjs';
9
9
  import { customAlphabet } from 'nanoid';
10
10
  import * as nanoIdDictionary from 'nanoid-dictionary';
@@ -24,6 +24,8 @@ import pluralize from 'pluralize';
24
24
  import { createBrowserInspector } from '@statelyai/inspect';
25
25
  import { BehaviorSubject } from 'rxjs';
26
26
  import { drizzle } from 'drizzle-orm/sqlite-proxy';
27
+ import { migrate as migrate$1 } from 'drizzle-orm/sqlite-proxy/migrator';
28
+ import { readMigrationFiles } from 'drizzle-orm/migrator';
27
29
  import { WebAccess } from '@zenfs/dom';
28
30
  import Arweave from 'arweave';
29
31
  import { i as internalPropertyNames, I as INTERNAL_DATA_TYPES, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, d as defaultAttestationData } from './constants-B6s6tGup.js';
@@ -99,7 +101,6 @@ const resolveRemoteStorage = fromCallback(({ sendBack, input: { context } }) =>
99
101
  const storageTransactionId = propertyInstances.get('storageTransactionId');
100
102
  const _resolveRemoteStorage = () => __awaiter(void 0, void 0, void 0, function* () {
101
103
  const path = yield import('path-browserify');
102
- const { fs } = yield import('@zenfs/core');
103
104
  const filesDirExists = yield fs.promises.exists('/files');
104
105
  if (!filesDirExists) {
105
106
  yield fs.promises.mkdir('/files');
@@ -2096,7 +2097,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2096
2097
  if (!models$1) {
2097
2098
  return;
2098
2099
  }
2099
- const { models: SeedModels } = yield import('./seed.schema.config-BwklbHGI.js');
2100
+ const { models: SeedModels } = yield import('./seed.schema.config-CPGWVSWI.js');
2100
2101
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2101
2102
  let hasModelsInDb = false;
2102
2103
  const schemaDefsByModelName = new Map();
@@ -2376,7 +2377,6 @@ const migrate = fromCallback(({ sendBack, input: { context } }) => {
2376
2377
  //
2377
2378
  // _initFs()
2378
2379
  const _checkForFiles = () => __awaiter(void 0, void 0, void 0, function* () {
2379
- const { fs } = yield import('@zenfs/core');
2380
2380
  journalExists = yield fs.promises.exists(`/${pathToDbDir}/meta/_journal.json`);
2381
2381
  if (!journalExists) {
2382
2382
  window.location.reload();
@@ -2409,8 +2409,6 @@ const migrate = fromCallback(({ sendBack, input: { context } }) => {
2409
2409
  schema: schemaGlobString,
2410
2410
  // logger: true,
2411
2411
  });
2412
- const { migrate: drizzleMigrate } = yield import('drizzle-orm/sqlite-proxy/migrator');
2413
- const { readMigrationFiles } = yield import('drizzle-orm/migrator');
2414
2412
  try {
2415
2413
  const migrations = readMigrationFiles({
2416
2414
  migrationsFolder: pathToDbDir,
@@ -2443,7 +2441,7 @@ const migrate = fromCallback(({ sendBack, input: { context } }) => {
2443
2441
  }
2444
2442
  }
2445
2443
  }
2446
- yield drizzleMigrate(drizzleDb, (queriesToRun) => __awaiter(void 0, void 0, void 0, function* () {
2444
+ yield migrate$1(drizzleDb, (queriesToRun) => __awaiter(void 0, void 0, void 0, function* () {
2447
2445
  // logger('queriesToRun', queriesToRun)
2448
2446
  for (const query of queriesToRun) {
2449
2447
  // logger('query', query)
@@ -6483,7 +6481,7 @@ const client = {
6483
6481
  addresses,
6484
6482
  arweaveDomain,
6485
6483
  });
6486
- import('./seed.schema.config-BwklbHGI.js').then(({ models }) => {
6484
+ import('./seed.schema.config-CPGWVSWI.js').then(({ models }) => {
6487
6485
  for (const [key, value] of Object.entries(models)) {
6488
6486
  setModel(key, value);
6489
6487
  }
@@ -7158,7 +7156,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
7158
7156
  if (propertyRecordSchema &&
7159
7157
  propertyRecordSchema.storageType &&
7160
7158
  propertyRecordSchema.storageType === 'ItemStorage') {
7161
- const { Item } = yield import('./index-CUOeIj1a.js');
7159
+ const { Item } = yield import('./index-Dwb6l5UL.js');
7162
7160
  const item = yield Item.find({
7163
7161
  seedLocalId,
7164
7162
  modelName,
@@ -8100,4 +8098,4 @@ if (isNode()) {
8100
8098
  }
8101
8099
 
8102
8100
  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 };
8103
- //# sourceMappingURL=index-DKyw5ggt.js.map
8101
+ //# sourceMappingURL=index-Dd6tPdUt.js.map