@seedprotocol/sdk 0.1.46 → 0.1.47

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.
@@ -1,4 +1,4 @@
1
- export { f as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, e as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SEEDS, b as GET_SEED_IDS, c as GET_STORAGE_TRANSACTION_ID, d as GET_VERSIONS, I as Item, g as itemMachineAll, i as itemMachineSingle } from './index-BEzB8REh.js';
1
+ export { f as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, e as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SEEDS, b as GET_SEED_IDS, c as GET_STORAGE_TRANSACTION_ID, d as GET_VERSIONS, I as Item, g as itemMachineAll, i as itemMachineSingle } from './index-DWf9Ls94.js';
2
2
  import './constants-BLctWkrn.js';
3
3
  import 'path';
4
4
  import 'reflect-metadata';
@@ -27,4 +27,4 @@ import '@statelyai/inspect';
27
27
  import 'arweave';
28
28
  import '@zenfs/dom';
29
29
  import 'drizzle-orm/sqlite-proxy';
30
- //# sourceMappingURL=index-ChGsdGPJ.js.map
30
+ //# sourceMappingURL=index-B2WbNudj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B2WbNudj.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -172,6 +172,11 @@ const initialize$3 = fromCallback(({ sendBack, input: { context } }) => {
172
172
  }
173
173
  const _getContentsFromFileSystem = () => __awaiter(void 0, void 0, void 0, function* () {
174
174
  if (propertyName === 'html') {
175
+ const htmlFilePath = `/files/html/${storageTransactionId}.html`;
176
+ const exists = yield fs.promises.exists(htmlFilePath);
177
+ if (!exists) {
178
+ return;
179
+ }
175
180
  const renderValue = yield fs.promises
176
181
  .readFile(`/files/html/${storageTransactionId}.html`, 'utf8')
177
182
  .catch((error) => {
@@ -181,6 +186,11 @@ const initialize$3 = fromCallback(({ sendBack, input: { context } }) => {
181
186
  return;
182
187
  }
183
188
  if (propertyName === 'json') {
189
+ const jsonFilePath = `/files/json/${storageTransactionId}.json`;
190
+ const exists = yield fs.promises.exists(jsonFilePath);
191
+ if (!exists) {
192
+ return;
193
+ }
184
194
  const renderValue = yield fs.promises
185
195
  .readFile(`/files/json/${storageTransactionId}.json`, 'utf8')
186
196
  .catch((error) => {
@@ -983,7 +993,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
983
993
  renderValue: refResolvedDisplayValue,
984
994
  });
985
995
  if (propertyNameFromDb === 'storageTransactionId') {
986
- const { Item } = yield import('./index-ChGsdGPJ.js');
996
+ const { Item } = yield import('./index-B2WbNudj.js');
987
997
  const item = yield Item.find({
988
998
  seedLocalId,
989
999
  modelName: itemModelName,
@@ -1008,6 +1018,24 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
1008
1018
  .send({ type: 'updateRenderValue', renderValue });
1009
1019
  return;
1010
1020
  }
1021
+ if (propertyName === 'json' &&
1022
+ propertyValueFromDb &&
1023
+ propertyValueFromDb.length === 43) {
1024
+ const jsonFilePath = `/files/json/${propertyValueFromDb}.json`;
1025
+ const exists = yield fs.promises.exists(jsonFilePath);
1026
+ if (!exists) {
1027
+ return;
1028
+ }
1029
+ const renderValue = yield fs.promises
1030
+ .readFile(jsonFilePath, 'utf8')
1031
+ .catch((error) => {
1032
+ logger$m('Error reading json file', error);
1033
+ });
1034
+ property
1035
+ .getService()
1036
+ .send({ type: 'updateRenderValue', renderValue });
1037
+ return;
1038
+ }
1011
1039
  }
1012
1040
  }
1013
1041
  }
@@ -1896,7 +1924,6 @@ const processPropertiesFoundInDb = (_a) => __awaiter(void 0, [_a], void 0, funct
1896
1924
  easPropertyName += '_id';
1897
1925
  }
1898
1926
  const regex = new RegExp(`${easDatatype} ${easPropertyName}`);
1899
- console.log(`[allItemsActors] ${foundProperty.name} regex`, `${easDatatype} ${easPropertyName}`);
1900
1927
  const propertySchema = foundPropertySchemas.schemas.find((s) => regex.test(s.schema));
1901
1928
  if (!propertySchema) {
1902
1929
  // TODO: We should create the schema here?
@@ -2206,7 +2233,6 @@ const getRelatedSeedsAndVersions = () => __awaiter(void 0, void 0, void 0, funct
2206
2233
  },
2207
2234
  },
2208
2235
  });
2209
- console.log('[item/events] [syncDbWithEas] getRelatedSeedsAndVersions', itemSeeds);
2210
2236
  yield saveEasSeedsToDb({ itemSeeds });
2211
2237
  const { itemVersions } = yield easClient.request(GET_VERSIONS, {
2212
2238
  where: {
@@ -2312,8 +2338,6 @@ const publishItemRequestHandler = (_a) => __awaiter(void 0, [_a], void 0, functi
2312
2338
  !snapshot.context.publishItemService) {
2313
2339
  return;
2314
2340
  }
2315
- const { publishItemService } = snapshot.context;
2316
- console.log('[sdk] [events/item/publish] publishItemService', publishItemService);
2317
2341
  });
2318
2342
  globalService.send({
2319
2343
  type: 'publishItemRequest',
@@ -3825,7 +3849,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
3825
3849
  if (!models$1) {
3826
3850
  return;
3827
3851
  }
3828
- const { models: SeedModels } = yield import('./seed.schema.config-jKpK-lR6.js');
3852
+ const { models: SeedModels } = yield import('./seed.schema.config-mBqth17w.js');
3829
3853
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
3830
3854
  let hasModelsInDb = false;
3831
3855
  const schemaDefsByModelName = new Map();
@@ -6311,7 +6335,7 @@ const client = {
6311
6335
  console.error('fs listeners not ready during init');
6312
6336
  }
6313
6337
  globalService.send({ type: 'init', endpoints, models, addresses });
6314
- import('./seed.schema.config-jKpK-lR6.js').then(({ models }) => {
6338
+ import('./seed.schema.config-mBqth17w.js').then(({ models }) => {
6315
6339
  for (const [key, value] of Object.entries(models)) {
6316
6340
  setModel(key, value);
6317
6341
  }
@@ -6925,4 +6949,4 @@ if (isNode()) {
6925
6949
  }
6926
6950
 
6927
6951
  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_SEEDS as a, GET_SEED_IDS as b, GET_STORAGE_TRANSACTION_ID as c, GET_VERSIONS as d, GET_PROPERTIES as e, GET_ALL_PROPERTIES_FOR_ALL_VERSIONS as f, itemMachineAll as g, ImageSrc as h, itemMachineSingle as i, ItemProperty as j, useItem as k, useItemProperties as l, useCreateItem as m, useItemProperty as n, useDeleteItem as o, useGlobalServiceStatus as p, useServices as q, getGlobalService as r, client as s, getCorrectId as t, useItems as u, withSeed as w };
6928
- //# sourceMappingURL=index-BEzB8REh.js.map
6952
+ //# sourceMappingURL=index-DWf9Ls94.js.map