@seedprotocol/sdk 0.1.101 → 0.1.102
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.
- package/dist/{index-BraifCoG.js → index-C63Ut7kK.js} +19 -7
- package/dist/{index-BraifCoG.js.map → index-C63Ut7kK.js.map} +1 -1
- package/dist/{index-CB87k8S8.js → index-D4vrRdvL.js} +2 -2
- package/dist/{index-CB87k8S8.js.map → index-D4vrRdvL.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-Bw0_BXD8.js → seed.schema.config-BCA5sEAY.js} +2 -2
- package/dist/{seed.schema.config-Bw0_BXD8.js.map → seed.schema.config-BCA5sEAY.js.map} +1 -1
- package/dist/src/getPublishPayload.ts +14 -3
- package/dist/types/src/browser/db/read/getPublishPayload.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
1071
|
+
const { Item } = yield import('./index-D4vrRdvL.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-
|
|
2625
|
+
const { models: SeedModels } = yield import('./seed.schema.config-BCA5sEAY.js');
|
|
2626
2626
|
const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
|
|
2627
2627
|
let hasModelsInDb = false;
|
|
2628
2628
|
const schemaDefsByModelName = new Map();
|
|
@@ -5847,14 +5847,26 @@ const getPublishPayload = (seedLocalId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
5847
5847
|
}
|
|
5848
5848
|
const easDataType = INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas;
|
|
5849
5849
|
let propertyNameForSchema = propertyName;
|
|
5850
|
+
let propertyValue = itemProperty.getService().getSnapshot()
|
|
5851
|
+
.context.propertyValue;
|
|
5850
5852
|
if (itemProperty.propertyDef.dataType === 'Relation') {
|
|
5851
5853
|
propertyNameForSchema = `${propertyName}Id`;
|
|
5852
5854
|
}
|
|
5853
5855
|
if (itemProperty.propertyDef.dataType === 'List' &&
|
|
5854
5856
|
itemProperty.propertyDef.ref) {
|
|
5855
5857
|
const singularPropertyName = pluralize.singular(propertyName);
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
+
propertyNameForSchema = `${singularPropertyName}${itemProperty.propertyDef.ref}Ids`;
|
|
5859
|
+
if (typeof propertyValue === 'string' && propertyValue.length === 66) {
|
|
5860
|
+
propertyValue = [propertyValue];
|
|
5861
|
+
}
|
|
5862
|
+
if (typeof propertyValue === 'string' && propertyValue.length > 66) {
|
|
5863
|
+
try {
|
|
5864
|
+
propertyValue = JSON.parse(propertyValue);
|
|
5865
|
+
}
|
|
5866
|
+
catch (error) {
|
|
5867
|
+
console.log('No-op due to error: ', error);
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5858
5870
|
}
|
|
5859
5871
|
if (itemProperty.propertyDef.storageType &&
|
|
5860
5872
|
itemProperty.propertyDef.storageType === 'ItemStorage') {
|
|
@@ -5872,7 +5884,7 @@ const getPublishPayload = (seedLocalId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
5872
5884
|
{
|
|
5873
5885
|
name: toSnakeCase(propertyNameForSchema),
|
|
5874
5886
|
type: easDataType,
|
|
5875
|
-
value:
|
|
5887
|
+
value: propertyValue,
|
|
5876
5888
|
},
|
|
5877
5889
|
];
|
|
5878
5890
|
const easSchemaDefinition = foundPropertySchema.schema;
|
|
@@ -6685,7 +6697,7 @@ const client = {
|
|
|
6685
6697
|
console.error('fs listeners not ready during init');
|
|
6686
6698
|
}
|
|
6687
6699
|
globalService.send({ type: 'init', endpoints, models, addresses });
|
|
6688
|
-
import('./seed.schema.config-
|
|
6700
|
+
import('./seed.schema.config-BCA5sEAY.js').then(({ models }) => {
|
|
6689
6701
|
for (const [key, value] of Object.entries(models)) {
|
|
6690
6702
|
setModel(key, value);
|
|
6691
6703
|
}
|
|
@@ -7638,4 +7650,4 @@ if (isNode()) {
|
|
|
7638
7650
|
}
|
|
7639
7651
|
|
|
7640
7652
|
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-
|
|
7653
|
+
//# sourceMappingURL=index-C63Ut7kK.js.map
|