@seedprotocol/sdk 0.1.57 → 0.1.58

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.
@@ -992,7 +992,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
992
992
  if (propertyRecordSchema &&
993
993
  propertyRecordSchema.storageType &&
994
994
  propertyRecordSchema.storageType === 'ItemStorage') {
995
- const { Item } = yield import('./index-p5KR99fK.js');
995
+ const { Item } = yield import('./index-Ij9VEGXg.js');
996
996
  const item = yield Item.find({
997
997
  seedLocalId,
998
998
  modelName: itemModelName,
@@ -1487,7 +1487,14 @@ const saveImageSrc = fromCallback(({ sendBack, input: { context, event } }) => {
1487
1487
  }
1488
1488
  if (newValueType === 'imageBase64') {
1489
1489
  mimeType = getMimeType(newValue);
1490
- fileData = newValue;
1490
+ const base64Data = newValue.split(',')[1]; // Strip the Base64 prefix
1491
+ const binaryString = atob(base64Data);
1492
+ const binaryLength = binaryString.length;
1493
+ const binaryArray = new Uint8Array(binaryLength);
1494
+ for (let i = 0; i < binaryLength; i++) {
1495
+ binaryArray[i] = binaryString.charCodeAt(i);
1496
+ }
1497
+ fileData = binaryArray.buffer;
1491
1498
  }
1492
1499
  if (newValueType === 'url') {
1493
1500
  fileData = yield fetchImage(newValue);
@@ -2873,7 +2880,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2873
2880
  if (!models$1) {
2874
2881
  return;
2875
2882
  }
2876
- const { models: SeedModels } = yield import('./seed.schema.config-CJEIY4ZZ.js');
2883
+ const { models: SeedModels } = yield import('./seed.schema.config-BzZpzxHI.js');
2877
2884
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2878
2885
  let hasModelsInDb = false;
2879
2886
  const schemaDefsByModelName = new Map();
@@ -6772,7 +6779,7 @@ const client = {
6772
6779
  console.error('fs listeners not ready during init');
6773
6780
  }
6774
6781
  globalService.send({ type: 'init', endpoints, models, addresses });
6775
- import('./seed.schema.config-CJEIY4ZZ.js').then(({ models }) => {
6782
+ import('./seed.schema.config-BzZpzxHI.js').then(({ models }) => {
6776
6783
  for (const [key, value] of Object.entries(models)) {
6777
6784
  setModel(key, value);
6778
6785
  }
@@ -7345,4 +7352,4 @@ if (isNode()) {
7345
7352
  }
7346
7353
 
7347
7354
  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 };
7348
- //# sourceMappingURL=index-COcsVb0S.js.map
7355
+ //# sourceMappingURL=index-CpkFYsgU.js.map