@seedprotocol/sdk 0.1.51 → 0.1.53

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-DMIKRod-.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-DcXK4ERW.js';
2
2
  import './constants-BLctWkrn.js';
3
3
  import 'path';
4
4
  import 'reflect-metadata';
@@ -27,4 +27,4 @@ import 'arweave';
27
27
  import 'react';
28
28
  import 'use-immer';
29
29
  import '@xstate/react';
30
- //# sourceMappingURL=index-wKss7188.js.map
30
+ //# sourceMappingURL=index-5a9z-kqT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-5a9z-kqT.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -993,7 +993,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
993
993
  renderValue: refResolvedDisplayValue,
994
994
  });
995
995
  if (propertyNameFromDb === 'storageTransactionId') {
996
- const { Item } = yield import('./index-wKss7188.js');
996
+ const { Item } = yield import('./index-5a9z-kqT.js');
997
997
  const item = yield Item.find({
998
998
  seedLocalId,
999
999
  modelName: itemModelName,
@@ -2894,7 +2894,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2894
2894
  if (!models$1) {
2895
2895
  return;
2896
2896
  }
2897
- const { models: SeedModels } = yield import('./seed.schema.config-C0M8Rcti.js');
2897
+ const { models: SeedModels } = yield import('./seed.schema.config-BtfzZOfM.js');
2898
2898
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2899
2899
  let hasModelsInDb = false;
2900
2900
  const schemaDefsByModelName = new Map();
@@ -5559,11 +5559,12 @@ const setupServicesEventHandlers = () => {
5559
5559
 
5560
5560
  const saveServiceHandler = (event) => __awaiter(void 0, void 0, void 0, function* () {
5561
5561
  const globalService = getGlobalService();
5562
- if (!globalService) {
5562
+ if (!globalService || !globalService.getSnapshot().context) {
5563
5563
  return;
5564
5564
  }
5565
5565
  const { modelName } = event;
5566
- const service = globalService.getSnapshot().context[`${modelName}Service`];
5566
+ const nameOfService = `${modelName}Service`;
5567
+ const service = globalService.getSnapshot().context[nameOfService];
5567
5568
  yield writeAppState(`snapshot__${modelName}`, JSON.stringify(service.getPersistedSnapshot()));
5568
5569
  });
5569
5570
 
@@ -5588,7 +5589,7 @@ const client = {
5588
5589
  console.error('fs listeners not ready during init');
5589
5590
  }
5590
5591
  globalService.send({ type: 'init', endpoints, models, addresses });
5591
- import('./seed.schema.config-C0M8Rcti.js').then(({ models }) => {
5592
+ import('./seed.schema.config-BtfzZOfM.js').then(({ models }) => {
5592
5593
  for (const [key, value] of Object.entries(models)) {
5593
5594
  setModel(key, value);
5594
5595
  }
@@ -6580,13 +6581,19 @@ const getItemDataFromDb = (_a) => __awaiter(void 0, [_a], void 0, function* ({ m
6580
6581
  if (modelName) {
6581
6582
  whereClauses.push(eq(seeds.type, modelName.toLowerCase()));
6582
6583
  }
6583
- const uidWhereClause = seedUid
6584
- ? eq(seeds.uid, seedUid)
6585
- : isNull(seeds.uid);
6586
- const localWhereClause = seedLocalId
6587
- ? eq(seeds.localId, seedLocalId)
6588
- : isNull(seeds.localId);
6589
- whereClauses.push(or(localWhereClause, uidWhereClause));
6584
+ if (seedUid) {
6585
+ whereClauses.push(eq(seeds.uid, seedUid));
6586
+ }
6587
+ if (seedLocalId && !seedUid) {
6588
+ whereClauses.push(eq(seeds.localId, seedLocalId));
6589
+ }
6590
+ // const uidWhereClause: SQL = seedUid
6591
+ // ? eq(seeds.uid, seedUid)
6592
+ // : isNull(seeds.uid)
6593
+ // const localWhereClause: SQL = seedLocalId
6594
+ // ? eq(seeds.localId, seedLocalId)
6595
+ // : isNull(seeds.localId)
6596
+ // whereClauses.push(or(localWhereClause, uidWhereClause) as SQL)
6590
6597
  const latestVersions = appDb.$with('latestVersions').as(appDb
6591
6598
  .select({
6592
6599
  localId: versions.localId,
@@ -6949,4 +6956,4 @@ if (isNode()) {
6949
6956
  }
6950
6957
 
6951
6958
  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 };
6952
- //# sourceMappingURL=index-DMIKRod-.js.map
6959
+ //# sourceMappingURL=index-DcXK4ERW.js.map