@seedprotocol/sdk 0.2.26 → 0.2.28

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 (45) hide show
  1. package/dist/ArweaveClient-C-HZgUWJ.js +13 -0
  2. package/dist/ArweaveClient-C-HZgUWJ.js.map +1 -0
  3. package/dist/ArweaveClient-rTTCUjiu.js +13 -0
  4. package/dist/ArweaveClient-rTTCUjiu.js.map +1 -0
  5. package/dist/{Db-DuHi8kGi.js → Db-BIYweCKe.js} +3 -3
  6. package/dist/{Db-DuHi8kGi.js.map → Db-BIYweCKe.js.map} +1 -1
  7. package/dist/{Db-BB1DgFLW.js → Db-CURz-SUg.js} +3 -3
  8. package/dist/{Db-BB1DgFLW.js.map → Db-CURz-SUg.js.map} +1 -1
  9. package/dist/{EasClient-BGQRv2-M.js → EasClient-CKv5Eyao.js} +2 -2
  10. package/dist/{EasClient-BGQRv2-M.js.map → EasClient-CKv5Eyao.js.map} +1 -1
  11. package/dist/{EasClient-Bbxr5rcF.js → EasClient-nvmz2kCc.js} +2 -2
  12. package/dist/{EasClient-Bbxr5rcF.js.map → EasClient-nvmz2kCc.js.map} +1 -1
  13. package/dist/{FileManager-D-yaDuSt.js → FileManager-Bm_fGCH1.js} +2 -2
  14. package/dist/{FileManager-D-yaDuSt.js.map → FileManager-Bm_fGCH1.js.map} +1 -1
  15. package/dist/{FileManager-CYXquukS.js → FileManager-EGwM_VHY.js} +2 -2
  16. package/dist/{FileManager-CYXquukS.js.map → FileManager-EGwM_VHY.js.map} +1 -1
  17. package/dist/{Item-D1EbCv2s.js → Item-DEoXH_7C.js} +3 -3
  18. package/dist/{Item-D1EbCv2s.js.map → Item-DEoXH_7C.js.map} +1 -1
  19. package/dist/{ItemProperty-C_YuzqFN.js → ItemProperty-B_gQPKDe.js} +3 -3
  20. package/dist/{ItemProperty-C_YuzqFN.js.map → ItemProperty-B_gQPKDe.js.map} +1 -1
  21. package/dist/{QueryClient-Dk66c5aw.js → QueryClient-CkqXe8Nk.js} +2 -2
  22. package/dist/{QueryClient-Dk66c5aw.js.map → QueryClient-CkqXe8Nk.js.map} +1 -1
  23. package/dist/{QueryClient-CY_4gVB3.js → QueryClient-pzZAYWa0.js} +2 -2
  24. package/dist/{QueryClient-CY_4gVB3.js.map → QueryClient-pzZAYWa0.js.map} +1 -1
  25. package/dist/bin.js +6 -12
  26. package/dist/bin.js.map +1 -1
  27. package/dist/{constants-CuI_qYXt.js → constants-BjOTXEgm.js} +2 -2
  28. package/dist/{constants-CuI_qYXt.js.map → constants-BjOTXEgm.js.map} +1 -1
  29. package/dist/{index-Bsvr_g6x.js → index-boyGAsLD.js} +3 -3
  30. package/dist/index-boyGAsLD.js.map +1 -0
  31. package/dist/{index-8491IPWu.js → index-d-n1CVO_.js} +29 -23
  32. package/dist/index-d-n1CVO_.js.map +1 -0
  33. package/dist/main.js +2 -2
  34. package/dist/{seed.schema.config-CVQ4WO_e.js → seed.schema.config-DCQvnp98.js} +3 -3
  35. package/dist/{seed.schema.config-CVQ4WO_e.js.map → seed.schema.config-DCQvnp98.js.map} +1 -1
  36. package/dist/src/client.ts +2 -1
  37. package/dist/src/download.ts +0 -4
  38. package/dist/src/getPublishPayload.ts +3 -3
  39. package/dist/src/helpers.ts +4 -4
  40. package/dist/src/waitForDb.ts +18 -17
  41. package/dist/types/src/client.d.ts.map +1 -1
  42. package/dist/types/src/events/files/download.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/index-8491IPWu.js.map +0 -1
  45. package/dist/index-Bsvr_g6x.js.map +0 -1
@@ -10,7 +10,7 @@ import * as nanoIdDictionary from 'nanoid-dictionary';
10
10
  import fs$1, { fs, configureSingle } from '@zenfs/core';
11
11
  import debug from 'debug';
12
12
  import { sqliteTable, text, int, blob, check, unique } from 'drizzle-orm/sqlite-core';
13
- import { a as BaseQueryClient, B as BaseEasClient, I as INTERNAL_DATA_TYPES, G as GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY, e as GLOBAL_INITIALIZING_SEND_CONFIG, f as GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES, g as GLOBAL_ADDING_MODELS_TO_DB_SUCCESS, D as DB_CHECK_STATUS_UPDATE_PATHS, h as DB_CHECK_STATUS_EXISTS, i as BROWSER_FS_TOP_DIR, j as DB_CREATING_SUCCESS, k as DB_VALIDATING_SUCCESS, l as DB_VALIDATING_WAIT, m as DB_MIGRATING_SUCCESS, M as MachineIds, n as DB_WAITING_FOR_FILES_RECEIVED, o as DB_MIGRATING_WAIT, p as DbState, q as INTERNAL_VALIDATING_INPUT_SUCCESS, r as ARWEAVE_HOST, c as BaseArweaveClient, s as INTERNAL_CONFIGURING_FS_SUCCESS, t as INTERNAL_SAVING_CONFIG_SUCCESS, u as INTERNAL_LOADING_APP_DB_SUCCESS, v as DB_ON_SNAPSHOT, w as DB_NAME_APP, x as InternalState, P as PublishMachineStates, y as GlobalState, b as BaseFileManager, z as internalPropertyNames, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, C as defaultAttestationData } from './constants-CuI_qYXt.js';
13
+ import { b as BaseQueryClient, a as BaseEasClient, I as INTERNAL_DATA_TYPES, G as GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY, e as GLOBAL_INITIALIZING_SEND_CONFIG, f as GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES, g as GLOBAL_ADDING_MODELS_TO_DB_SUCCESS, D as DB_CHECK_STATUS_UPDATE_PATHS, h as DB_CHECK_STATUS_EXISTS, i as BROWSER_FS_TOP_DIR, j as DB_CREATING_SUCCESS, k as DB_VALIDATING_SUCCESS, l as DB_VALIDATING_WAIT, m as DB_MIGRATING_SUCCESS, M as MachineIds, n as DB_WAITING_FOR_FILES_RECEIVED, o as DB_MIGRATING_WAIT, p as DbState, q as INTERNAL_VALIDATING_INPUT_SUCCESS, r as ARWEAVE_HOST, B as BaseArweaveClient, s as INTERNAL_CONFIGURING_FS_SUCCESS, t as INTERNAL_SAVING_CONFIG_SUCCESS, u as INTERNAL_LOADING_APP_DB_SUCCESS, v as DB_ON_SNAPSHOT, w as DB_NAME_APP, x as InternalState, P as PublishMachineStates, y as GlobalState, c as BaseFileManager, z as internalPropertyNames, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, C as defaultAttestationData } from './constants-BjOTXEgm.js';
14
14
  import { fromCallback, setup, assign, waitFor, createActor, raise } from 'xstate';
15
15
  import pluralize from 'pluralize';
16
16
  import EventEmitter from 'eventemitter3';
@@ -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-D1EbCv2s.js')).Item;
137
+ Item$2 = (yield import('./Item-DEoXH_7C.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-C_YuzqFN.js')).ItemProperty;
187
+ ItemProperty$2 = (yield import('./ItemProperty-B_gQPKDe.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-DuHi8kGi.js')).Db;
194
+ Db = (yield import('./Db-BIYweCKe.js')).Db;
195
195
  }
196
196
  if (!isBrowser()) {
197
- Db = (yield import('./Db-BB1DgFLW.js')).Db;
197
+ Db = (yield import('./Db-CURz-SUg.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-CVQ4WO_e.js');
1699
+ const { models: SeedModels } = yield import('./seed.schema.config-DCQvnp98.js');
1700
1700
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
1701
1701
  let hasModelsInDb = false;
1702
1702
  const schemaDefsByModelName = new Map();
@@ -2441,17 +2441,17 @@ const fetchDirectory = (url) => __awaiter(void 0, void 0, void 0, function* () {
2441
2441
  return response.json();
2442
2442
  });
2443
2443
  const fetchFilesRecursively = (url, localPath, fileList) => __awaiter(void 0, void 0, void 0, function* () {
2444
- try {
2445
- for (const file of fileList) {
2444
+ for (const file of fileList) {
2445
+ try {
2446
2446
  const fileUrl = `${url}/${file}`;
2447
2447
  const fileLocalPath = path.join(localPath, file);
2448
2448
  // logger(`[fetchFilesRecursively] fileUrl: ${fileUrl}`)
2449
2449
  // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)
2450
2450
  yield downloadFile(fileUrl, fileLocalPath);
2451
2451
  }
2452
- }
2453
- catch (error) {
2454
- console.error(`Failed to fetch files from ${url}:`, error);
2452
+ catch (error) {
2453
+ console.error(`Failed to fetch files from ${url}:`, error);
2454
+ }
2455
2455
  }
2456
2456
  });
2457
2457
  const confirmFilesExist = (filePaths) => __awaiter(void 0, void 0, void 0, function* () {
@@ -2576,6 +2576,14 @@ const saveAppState = (key, value) => __awaiter(void 0, void 0, void 0, function*
2576
2576
  });
2577
2577
  });
2578
2578
 
2579
+ const initArweaveClient = () => __awaiter(void 0, void 0, void 0, function* () {
2580
+ if (isBrowser()) {
2581
+ (yield import('./ArweaveClient-rTTCUjiu.js')).ArweaveClient;
2582
+ }
2583
+ if (!isBrowser()) {
2584
+ (yield import('./ArweaveClient-C-HZgUWJ.js')).ArweaveClient;
2585
+ }
2586
+ });
2579
2587
  let domain = 'arweave.net';
2580
2588
  const getArweave = () => {
2581
2589
  if (typeof window === 'undefined' ||
@@ -2707,9 +2715,6 @@ const downloadAllFilesBinaryRequestHandler = () => __awaiter(void 0, void 0, voi
2707
2715
  yield saveAppState('excludedTransactions', JSON.stringify(Array.from(excludedTransactions)));
2708
2716
  continue;
2709
2717
  }
2710
- if (transactionId === 'ZXnDkNk_PHRl5Yqu90kEJn_R3LS3Tl9P8eLtlJTqB-M') {
2711
- console.log('transactionId', transactionId);
2712
- }
2713
2718
  const arweaveClient = BaseArweaveClient.getArweaveClient();
2714
2719
  const { tags: tagsResult } = yield queryClient.fetchQuery({
2715
2720
  queryKey: ['getTransactionTags', transactionId],
@@ -5517,7 +5522,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
5517
5522
  if (propertyRecordSchema &&
5518
5523
  propertyRecordSchema.storageType &&
5519
5524
  propertyRecordSchema.storageType === 'ItemStorage') {
5520
- const { Item } = yield import('./index-Bsvr_g6x.js');
5525
+ const { Item } = yield import('./index-boyGAsLD.js');
5521
5526
  const item = yield Item.find({
5522
5527
  seedLocalId,
5523
5528
  modelName,
@@ -8087,28 +8092,28 @@ const setupServiceHandlers = () => {
8087
8092
 
8088
8093
  const initEasClient = () => __awaiter(void 0, void 0, void 0, function* () {
8089
8094
  if (isBrowser()) {
8090
- (yield import('./EasClient-Bbxr5rcF.js')).EasClient;
8095
+ (yield import('./EasClient-nvmz2kCc.js')).EasClient;
8091
8096
  }
8092
8097
  if (!isBrowser()) {
8093
- (yield import('./EasClient-BGQRv2-M.js')).EasClient;
8098
+ (yield import('./EasClient-CKv5Eyao.js')).EasClient;
8094
8099
  }
8095
8100
  });
8096
8101
 
8097
8102
  const initQueryClient = () => __awaiter(void 0, void 0, void 0, function* () {
8098
8103
  if (isBrowser()) {
8099
- (yield import('./QueryClient-Dk66c5aw.js')).QueryClient;
8104
+ (yield import('./QueryClient-CkqXe8Nk.js')).QueryClient;
8100
8105
  }
8101
8106
  if (!isBrowser()) {
8102
- (yield import('./QueryClient-CY_4gVB3.js')).QueryClient;
8107
+ (yield import('./QueryClient-pzZAYWa0.js')).QueryClient;
8103
8108
  }
8104
8109
  });
8105
8110
 
8106
8111
  const initFileManager = () => __awaiter(void 0, void 0, void 0, function* () {
8107
8112
  if (isBrowser()) {
8108
- (yield import('./FileManager-D-yaDuSt.js')).FileManager;
8113
+ (yield import('./FileManager-Bm_fGCH1.js')).FileManager;
8109
8114
  }
8110
8115
  if (!isBrowser()) {
8111
- (yield import('./FileManager-CYXquukS.js')).FileManager;
8116
+ (yield import('./FileManager-EGwM_VHY.js')).FileManager;
8112
8117
  }
8113
8118
  });
8114
8119
 
@@ -8118,6 +8123,7 @@ const client = {
8118
8123
  yield initItem();
8119
8124
  yield initItemProperty();
8120
8125
  yield initEasClient();
8126
+ yield initArweaveClient();
8121
8127
  yield initQueryClient();
8122
8128
  yield initFileManager();
8123
8129
  yield initDb();
@@ -8146,7 +8152,7 @@ const client = {
8146
8152
  arweaveDomain,
8147
8153
  filesDir,
8148
8154
  });
8149
- const { models: internalModels } = yield import('./seed.schema.config-CVQ4WO_e.js');
8155
+ const { models: internalModels } = yield import('./seed.schema.config-DCQvnp98.js');
8150
8156
  for (const [key, value] of Object.entries(internalModels)) {
8151
8157
  setModel(key, value);
8152
8158
  }
@@ -8194,4 +8200,4 @@ const client = {
8194
8200
  enableMapSet();
8195
8201
 
8196
8202
  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 };
8197
- //# sourceMappingURL=index-8491IPWu.js.map
8203
+ //# sourceMappingURL=index-d-n1CVO_.js.map