@seedprotocol/sdk 0.1.101 → 0.1.103

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 { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-BraifCoG.js';
1
+ export { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-Cbpu60mV.js';
2
2
  import './constants-rmQ8zg8_.js';
3
3
  import '@ethereum-attestation-service/eas-sdk';
4
4
  import 'thirdweb';
@@ -29,4 +29,4 @@ import 'rxjs';
29
29
  import 'drizzle-orm/sqlite-proxy';
30
30
  import '@zenfs/dom';
31
31
  import 'arweave';
32
- //# sourceMappingURL=index-CB87k8S8.js.map
32
+ //# sourceMappingURL=index-BB80Wb2a.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CB87k8S8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index-BB80Wb2a.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1068,7 +1068,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
1068
1068
  if (propertyRecordSchema &&
1069
1069
  propertyRecordSchema.storageType &&
1070
1070
  propertyRecordSchema.storageType === 'ItemStorage') {
1071
- const { Item } = yield import('./index-CB87k8S8.js');
1071
+ const { Item } = yield import('./index-BB80Wb2a.js');
1072
1072
  const item = yield Item.find({
1073
1073
  seedLocalId,
1074
1074
  modelName: itemModelName,
@@ -2622,7 +2622,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2622
2622
  if (!models$1) {
2623
2623
  return;
2624
2624
  }
2625
- const { models: SeedModels } = yield import('./seed.schema.config-Bw0_BXD8.js');
2625
+ const { models: SeedModels } = yield import('./seed.schema.config--Nifymhk.js');
2626
2626
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2627
2627
  let hasModelsInDb = false;
2628
2628
  const schemaDefsByModelName = new Map();
@@ -5846,40 +5846,54 @@ const getPublishPayload = (seedLocalId) => __awaiter(void 0, void 0, void 0, fun
5846
5846
  continue;
5847
5847
  }
5848
5848
  const easDataType = INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas;
5849
+ let schemaUid = itemProperty.schemaUid;
5849
5850
  let propertyNameForSchema = propertyName;
5851
+ let propertyValue = itemProperty.getService().getSnapshot()
5852
+ .context.propertyValue;
5850
5853
  if (itemProperty.propertyDef.dataType === 'Relation') {
5851
5854
  propertyNameForSchema = `${propertyName}Id`;
5852
5855
  }
5853
5856
  if (itemProperty.propertyDef.dataType === 'List' &&
5854
5857
  itemProperty.propertyDef.ref) {
5855
5858
  const singularPropertyName = pluralize.singular(propertyName);
5856
- const compositePropertyName = `${singularPropertyName}${itemProperty.propertyDef.ref}Ids`;
5857
- propertyNameForSchema = compositePropertyName;
5859
+ propertyNameForSchema = `${singularPropertyName}${itemProperty.propertyDef.ref}Ids`;
5860
+ if (typeof propertyValue === 'string' && propertyValue.length === 66) {
5861
+ propertyValue = [propertyValue];
5862
+ }
5863
+ if (typeof propertyValue === 'string' && propertyValue.length > 66) {
5864
+ try {
5865
+ propertyValue = JSON.parse(propertyValue);
5866
+ }
5867
+ catch (error) {
5868
+ console.log('No-op due to error: ', error);
5869
+ }
5870
+ }
5858
5871
  }
5859
5872
  if (itemProperty.propertyDef.storageType &&
5860
5873
  itemProperty.propertyDef.storageType === 'ItemStorage') {
5861
5874
  continue;
5862
5875
  }
5863
5876
  const foundPropertySchema = yield getSchemaForItemProperty({
5864
- schemaUid: itemProperty.schemaUid,
5877
+ schemaUid,
5865
5878
  propertyName: propertyNameForSchema,
5866
5879
  easDataType,
5867
5880
  });
5868
5881
  if (!foundPropertySchema) {
5869
5882
  throw new Error(`No schema found for property ${itemProperty.propertyName} ${itemProperty.localId}`);
5870
5883
  }
5884
+ schemaUid = foundPropertySchema.id;
5871
5885
  const data = [
5872
5886
  {
5873
5887
  name: toSnakeCase(propertyNameForSchema),
5874
5888
  type: easDataType,
5875
- value: itemProperty.getService().getSnapshot().context.propertyValue,
5889
+ value: propertyValue,
5876
5890
  },
5877
5891
  ];
5878
5892
  const easSchemaDefinition = foundPropertySchema.schema;
5879
5893
  const dataEncoder = new SchemaEncoder(easSchemaDefinition);
5880
5894
  const encodedData = dataEncoder.encodeData(data);
5881
5895
  listOfAttestations.push({
5882
- schema: itemProperty.schemaUid,
5896
+ schema: schemaUid,
5883
5897
  data: [
5884
5898
  Object.assign(Object.assign({}, defaultAttestationData), { data: encodedData }),
5885
5899
  ],
@@ -6685,7 +6699,7 @@ const client = {
6685
6699
  console.error('fs listeners not ready during init');
6686
6700
  }
6687
6701
  globalService.send({ type: 'init', endpoints, models, addresses });
6688
- import('./seed.schema.config-Bw0_BXD8.js').then(({ models }) => {
6702
+ import('./seed.schema.config--Nifymhk.js').then(({ models }) => {
6689
6703
  for (const [key, value] of Object.entries(models)) {
6690
6704
  setModel(key, value);
6691
6705
  }
@@ -7638,4 +7652,4 @@ if (isNode()) {
7638
7652
  }
7639
7653
 
7640
7654
  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 };
7641
- //# sourceMappingURL=index-BraifCoG.js.map
7655
+ //# sourceMappingURL=index-Cbpu60mV.js.map