@seedprotocol/sdk 0.1.120 → 0.1.122

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,7 +27,6 @@ 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 * as fsNode from 'node:fs';
30
- import retry from 'async-es/retry';
31
30
  import { WebAccess } from '@zenfs/dom';
32
31
  import Arweave from 'arweave';
33
32
  import { i as internalPropertyNames, I as INTERNAL_DATA_TYPES, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, d as defaultAttestationData } from './constants-B6s6tGup.js';
@@ -1816,7 +1815,7 @@ const saveEasPropertiesToDb = (_a) => __awaiter(void 0, [_a], void 0, function*
1816
1815
  isList = true;
1817
1816
  refValueType = 'list';
1818
1817
  const result = parseEasRelationPropertyName(propertyNameSnake);
1819
- if (result) {
1818
+ {
1820
1819
  propertyNameSnake = result.propertyName;
1821
1820
  refSeedType = result.modelName;
1822
1821
  }
@@ -2115,7 +2114,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2115
2114
  if (!models$1) {
2116
2115
  return;
2117
2116
  }
2118
- const { models: SeedModels } = yield import('./seed.schema.config-y0omDTDZ.js');
2117
+ const { models: SeedModels } = yield import('./seed.schema.config-BHoBrAJe.js');
2119
2118
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2120
2119
  let hasModelsInDb = false;
2121
2120
  const schemaDefsByModelName = new Map();
@@ -2325,23 +2324,37 @@ const validate = fromCallback(({ sendBack, input: { context } }) => {
2325
2324
  const waitForFile = (filePath, interval = 500, timeout = 10000) => {
2326
2325
  return new Promise((resolve, reject) => {
2327
2326
  const startTime = Date.now();
2328
- retry({
2329
- times: Math.ceil(timeout / interval),
2330
- interval: interval,
2331
- }, (callback) => {
2327
+ const _interval = setInterval(() => {
2332
2328
  if (fs.existsSync(filePath) && fsNode.existsSync(filePath)) {
2333
- return callback(null, true); // File exists, finish with success
2329
+ clearInterval(_interval);
2330
+ resolve(true);
2334
2331
  }
2335
2332
  if (Date.now() - startTime >= timeout) {
2336
- return callback(new Error('Timeout exceeded while waiting for file'));
2337
- }
2338
- callback(new Error('File does not exist yet')); // Retry with this error
2339
- }, (err, result) => {
2340
- if (err) {
2341
- return resolve(false); // Resolve as false if timeout or error occurs
2333
+ clearInterval(_interval);
2334
+ reject(new Error('Timeout exceeded while waiting for file'));
2342
2335
  }
2343
- resolve(result); // Resolve as true if file exists
2344
- });
2336
+ }, interval);
2337
+ // retry(
2338
+ // {
2339
+ // times: Math.ceil(timeout / interval),
2340
+ // interval: interval,
2341
+ // },
2342
+ // (callback: Function) => {
2343
+ // if (fs.existsSync(filePath) && fsNode.existsSync(filePath)) {
2344
+ // return callback(null, true) // File exists, finish with success
2345
+ // }
2346
+ // if (Date.now() - startTime >= timeout) {
2347
+ // return callback(new Error('Timeout exceeded while waiting for file'))
2348
+ // }
2349
+ // callback(new Error('File does not exist yet')) // Retry with this error
2350
+ // },
2351
+ // (err: Error, result: boolean) => {
2352
+ // if (err) {
2353
+ // return resolve(false) // Resolve as false if timeout or error occurs
2354
+ // }
2355
+ // resolve(result) // Resolve as true if file exists
2356
+ // },
2357
+ // )
2345
2358
  });
2346
2359
  };
2347
2360
 
@@ -3144,7 +3157,7 @@ const setArweaveDomain = (newDomain) => {
3144
3157
  const getMetadata = (props) => __awaiter(void 0, void 0, void 0, function* () {
3145
3158
  const appDb = getAppDb();
3146
3159
  let storageTransactionId;
3147
- if (props) {
3160
+ {
3148
3161
  storageTransactionId = props.storageTransactionId;
3149
3162
  }
3150
3163
  const whereClauses = [];
@@ -6551,7 +6564,7 @@ const client = {
6551
6564
  addresses,
6552
6565
  arweaveDomain,
6553
6566
  });
6554
- import('./seed.schema.config-y0omDTDZ.js').then(({ models }) => {
6567
+ import('./seed.schema.config-BHoBrAJe.js').then(({ models }) => {
6555
6568
  for (const [key, value] of Object.entries(models)) {
6556
6569
  setModel(key, value);
6557
6570
  }
@@ -7226,7 +7239,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
7226
7239
  if (propertyRecordSchema &&
7227
7240
  propertyRecordSchema.storageType &&
7228
7241
  propertyRecordSchema.storageType === 'ItemStorage') {
7229
- const { Item } = yield import('./index-CXivX9-v.js');
7242
+ const { Item } = yield import('./index-IgTStLC1.js');
7230
7243
  const item = yield Item.find({
7231
7244
  seedLocalId,
7232
7245
  modelName,
@@ -8168,4 +8181,4 @@ if (isNode()) {
8168
8181
  }
8169
8182
 
8170
8183
  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 };
8171
- //# sourceMappingURL=index-lYH32Ucm.js.map
8184
+ //# sourceMappingURL=index-D30kap8f.js.map