@seedprotocol/sdk 0.1.98 → 0.1.99
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-CtPP67gL.js → index-BoPvASL1.js} +27 -8
- package/dist/{index-CtPP67gL.js.map → index-BoPvASL1.js.map} +1 -1
- package/dist/{index-C8w8cEL5.js → index-Mt8WaytK.js} +2 -2
- package/dist/{index-C8w8cEL5.js.map → index-Mt8WaytK.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-DJLubts8.js → seed.schema.config-Dffe0eOd.js} +2 -2
- package/dist/{seed.schema.config-DJLubts8.js.map → seed.schema.config-Dffe0eOd.js.map} +1 -1
- package/dist/src/analyzeInput.ts +13 -1
- package/dist/src/getPublishPayload.ts +4 -3
- package/dist/src/getSchemaForItemProperty.ts +17 -1
- package/dist/types/src/browser/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/types/src/browser/helpers/getSchemaForItemProperty.d.ts +2 -0
- package/dist/types/src/browser/helpers/getSchemaForItemProperty.d.ts.map +1 -1
- package/dist/types/src/browser/property/actors/saveValueToDb/analyzeInput.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-Mt8WaytK.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-Dffe0eOd.js');
|
|
2626
2626
|
const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
|
|
2627
2627
|
let hasModelsInDb = false;
|
|
2628
2628
|
const schemaDefsByModelName = new Map();
|
|
@@ -5787,7 +5787,7 @@ const getItem = (_a) => __awaiter(void 0, [_a], void 0, function* ({ modelName,
|
|
|
5787
5787
|
return Item.create(itemInitObj);
|
|
5788
5788
|
});
|
|
5789
5789
|
|
|
5790
|
-
const getSchemaForItemProperty = (_a) => __awaiter(void 0, [_a], void 0, function* ({ schemaUid, propertyName, }) {
|
|
5790
|
+
const getSchemaForItemProperty = (_a) => __awaiter(void 0, [_a], void 0, function* ({ schemaUid, propertyName, easDataType, }) {
|
|
5791
5791
|
let queryParams = {
|
|
5792
5792
|
where: {
|
|
5793
5793
|
id: {
|
|
@@ -5795,7 +5795,17 @@ const getSchemaForItemProperty = (_a) => __awaiter(void 0, [_a], void 0, functio
|
|
|
5795
5795
|
},
|
|
5796
5796
|
},
|
|
5797
5797
|
};
|
|
5798
|
-
if (!schemaUid
|
|
5798
|
+
if (!schemaUid && easDataType) {
|
|
5799
|
+
queryParams = {
|
|
5800
|
+
where: {
|
|
5801
|
+
schema: {
|
|
5802
|
+
equals: `${easDataType} ${propertyName}`,
|
|
5803
|
+
},
|
|
5804
|
+
},
|
|
5805
|
+
};
|
|
5806
|
+
}
|
|
5807
|
+
if (!easDataType &&
|
|
5808
|
+
(!schemaUid || schemaUid === 'null' || schemaUid === 'undefined')) {
|
|
5799
5809
|
queryParams = {
|
|
5800
5810
|
where: {
|
|
5801
5811
|
schemaNames: {
|
|
@@ -5834,6 +5844,7 @@ const getPublishPayload = (seedLocalId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
5834
5844
|
if (!itemProperty.value || !itemProperty.propertyDef) {
|
|
5835
5845
|
continue;
|
|
5836
5846
|
}
|
|
5847
|
+
const easDataType = INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas;
|
|
5837
5848
|
let propertyNameForSchema = propertyName;
|
|
5838
5849
|
if (itemProperty.propertyDef.dataType === 'Relation') {
|
|
5839
5850
|
propertyNameForSchema = `${propertyName}Id`;
|
|
@@ -5851,11 +5862,11 @@ const getPublishPayload = (seedLocalId) => __awaiter(void 0, void 0, void 0, fun
|
|
|
5851
5862
|
const foundPropertySchema = yield getSchemaForItemProperty({
|
|
5852
5863
|
schemaUid: itemProperty.schemaUid,
|
|
5853
5864
|
propertyName: propertyNameForSchema,
|
|
5865
|
+
easDataType,
|
|
5854
5866
|
});
|
|
5855
5867
|
if (!foundPropertySchema) {
|
|
5856
5868
|
throw new Error(`No schema found for property ${itemProperty.propertyName} ${itemProperty.localId}`);
|
|
5857
5869
|
}
|
|
5858
|
-
const easDataType = INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas;
|
|
5859
5870
|
const data = [
|
|
5860
5871
|
{
|
|
5861
5872
|
name: toSnakeCase(propertyNameForSchema),
|
|
@@ -6673,7 +6684,7 @@ const client = {
|
|
|
6673
6684
|
console.error('fs listeners not ready during init');
|
|
6674
6685
|
}
|
|
6675
6686
|
globalService.send({ type: 'init', endpoints, models, addresses });
|
|
6676
|
-
import('./seed.schema.config-
|
|
6687
|
+
import('./seed.schema.config-Dffe0eOd.js').then(({ models }) => {
|
|
6677
6688
|
for (const [key, value] of Object.entries(models)) {
|
|
6678
6689
|
setModel(key, value);
|
|
6679
6690
|
}
|
|
@@ -6933,7 +6944,15 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
6933
6944
|
return false;
|
|
6934
6945
|
}
|
|
6935
6946
|
if (!schemaUid) {
|
|
6936
|
-
|
|
6947
|
+
let easDataType;
|
|
6948
|
+
if (propertyRecordSchema.dataType) {
|
|
6949
|
+
easDataType = INTERNAL_DATA_TYPES[propertyRecordSchema.dataType]
|
|
6950
|
+
.eas;
|
|
6951
|
+
}
|
|
6952
|
+
const schemaFromEas = yield getSchemaForItemProperty({
|
|
6953
|
+
propertyName,
|
|
6954
|
+
easDataType,
|
|
6955
|
+
});
|
|
6937
6956
|
if (schemaFromEas) {
|
|
6938
6957
|
schemaUid = schemaFromEas.id;
|
|
6939
6958
|
}
|
|
@@ -7618,4 +7637,4 @@ if (isNode()) {
|
|
|
7618
7637
|
}
|
|
7619
7638
|
|
|
7620
7639
|
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 };
|
|
7621
|
-
//# sourceMappingURL=index-
|
|
7640
|
+
//# sourceMappingURL=index-BoPvASL1.js.map
|