@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.
- package/dist/{index-CB87k8S8.js → index-BB80Wb2a.js} +2 -2
- package/dist/{index-CB87k8S8.js.map → index-BB80Wb2a.js.map} +1 -1
- package/dist/{index-BraifCoG.js → index-Cbpu60mV.js} +23 -9
- package/dist/{index-BraifCoG.js.map → index-Cbpu60mV.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-Bw0_BXD8.js → seed.schema.config--Nifymhk.js} +2 -2
- package/dist/{seed.schema.config-Bw0_BXD8.js.map → seed.schema.config--Nifymhk.js.map} +1 -1
- package/dist/src/getPublishPayload.ts +19 -5
- package/dist/types/src/browser/db/read/getPublishPayload.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ImageSrc, I as Item, k as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, t as client, v as getCorrectId, s as getGlobalService, n as useCreateItem, p as useDeleteItem, q as useGlobalServiceStatus, l as useItem, m as useItemProperties, o as useItemProperty, u as useItems, r as useServices, w as withSeed } from './index-
|
|
1
|
+
export { j as ImageSrc, I as Item, k as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, t as client, v as getCorrectId, s as getGlobalService, n as useCreateItem, p as useDeleteItem, q as useGlobalServiceStatus, l as useItem, m as useItemProperties, o as useItemProperty, u as useItems, r as useServices, w as withSeed } from './index-Cbpu60mV.js';
|
|
2
2
|
import 'immer';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import './constants-rmQ8zg8_.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __decorate, a as __metadata } from './constants-rmQ8zg8_.js';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
|
-
import { T as Text, M as Model } from './index-
|
|
3
|
+
import { T as Text, M as Model } from './index-Cbpu60mV.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'reflect-metadata';
|
|
6
6
|
import 'xstate';
|
|
@@ -76,4 +76,4 @@ const models = {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
export { models };
|
|
79
|
-
//# sourceMappingURL=seed.schema.config
|
|
79
|
+
//# sourceMappingURL=seed.schema.config--Nifymhk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config
|
|
1
|
+
{"version":3,"file":"seed.schema.config--Nifymhk.js","sources":["../../src/shared/configs/seed.schema.config.ts"],"sourcesContent":["import { Model, Text } from '@/browser'\n\n@Model\nclass Seed {\n @Text() uid!: string\n @Text() type!: string\n}\n\n@Model\nclass Version {\n @Text() seedUid!: string\n @Text() note!: string\n}\n\n@Model\nclass Metadata {\n @Text() key!: string\n @Text() value!: string\n}\n\nexport const models = {\n Seed,\n Version,\n Metadata,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,IAAI,GAAV,MAAM,IAAI,CAAA;CAGT;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAa,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AACZ,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAc,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAFjB,IAAI,GAAA,UAAA,CAAA;IADT;AACK,CAAA,EAAA,IAAI,CAGT;AAGD,IAAM,OAAO,GAAb,MAAM,OAAO,CAAA;CAGZ;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAiB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AAChB,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAc,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAFjB,OAAO,GAAA,UAAA,CAAA;IADZ;AACK,CAAA,EAAA,OAAO,CAGZ;AAGD,IAAM,QAAQ,GAAd,MAAM,QAAQ,CAAA;CAGb;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAa,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AACZ,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAe,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;AAFlB,QAAQ,GAAA,UAAA,CAAA;IADb;AACK,CAAA,EAAA,QAAQ,CAGb;AAEY,MAAA,MAAM,GAAG;IACpB,IAAI;IACJ,OAAO;IACP,QAAQ;;;;;"}
|
|
@@ -52,7 +52,10 @@ export const getPublishPayload = async (
|
|
|
52
52
|
const easDataType =
|
|
53
53
|
INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas
|
|
54
54
|
|
|
55
|
+
let schemaUid = itemProperty.schemaUid
|
|
55
56
|
let propertyNameForSchema = propertyName
|
|
57
|
+
let propertyValue = itemProperty.getService().getSnapshot()
|
|
58
|
+
.context.propertyValue
|
|
56
59
|
|
|
57
60
|
if (itemProperty.propertyDef.dataType === 'Relation') {
|
|
58
61
|
propertyNameForSchema = `${propertyName}Id`
|
|
@@ -63,8 +66,17 @@ export const getPublishPayload = async (
|
|
|
63
66
|
itemProperty.propertyDef.ref
|
|
64
67
|
) {
|
|
65
68
|
const singularPropertyName = pluralize.singular(propertyName)
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
propertyNameForSchema = `${singularPropertyName}${itemProperty.propertyDef.ref}Ids`
|
|
70
|
+
if (typeof propertyValue === 'string' && propertyValue.length === 66) {
|
|
71
|
+
propertyValue = [propertyValue]
|
|
72
|
+
}
|
|
73
|
+
if (typeof propertyValue === 'string' && propertyValue.length > 66) {
|
|
74
|
+
try {
|
|
75
|
+
propertyValue = JSON.parse(propertyValue)
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.log('No-op due to error: ', error)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
if (
|
|
@@ -75,7 +87,7 @@ export const getPublishPayload = async (
|
|
|
75
87
|
}
|
|
76
88
|
|
|
77
89
|
const foundPropertySchema = await getSchemaForItemProperty({
|
|
78
|
-
schemaUid
|
|
90
|
+
schemaUid,
|
|
79
91
|
propertyName: propertyNameForSchema,
|
|
80
92
|
easDataType,
|
|
81
93
|
})
|
|
@@ -86,11 +98,13 @@ export const getPublishPayload = async (
|
|
|
86
98
|
)
|
|
87
99
|
}
|
|
88
100
|
|
|
101
|
+
schemaUid = foundPropertySchema.id
|
|
102
|
+
|
|
89
103
|
const data = [
|
|
90
104
|
{
|
|
91
105
|
name: toSnakeCase(propertyNameForSchema),
|
|
92
106
|
type: easDataType,
|
|
93
|
-
value:
|
|
107
|
+
value: propertyValue,
|
|
94
108
|
},
|
|
95
109
|
]
|
|
96
110
|
|
|
@@ -101,7 +115,7 @@ export const getPublishPayload = async (
|
|
|
101
115
|
const encodedData = dataEncoder.encodeData(data)
|
|
102
116
|
|
|
103
117
|
listOfAttestations.push({
|
|
104
|
-
schema:
|
|
118
|
+
schema: schemaUid,
|
|
105
119
|
data: [
|
|
106
120
|
{
|
|
107
121
|
...defaultAttestationData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPublishPayload.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/db/read/getPublishPayload.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAEnB,MAAM,uCAAuC,CAAA;AAM9C,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,OAAO,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;IACxC,kBAAkB,EAAE,GAAG,EAAE,CAAA;CAC1B,CAAA;AAED,KAAK,mBAAmB,GAAG,cAAc,EAAE,CAAA;AAE3C,eAAO,MAAM,iBAAiB,gBACf,MAAM,KAClB,OAAO,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"getPublishPayload.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/db/read/getPublishPayload.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAEnB,MAAM,uCAAuC,CAAA;AAM9C,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,OAAO,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;IACxC,kBAAkB,EAAE,GAAG,EAAE,CAAA;CAC1B,CAAA;AAED,KAAK,mBAAmB,GAAG,cAAc,EAAE,CAAA;AAE3C,eAAO,MAAM,iBAAiB,gBACf,MAAM,KAClB,OAAO,CAAC,mBAAmB,CA4G7B,CAAA"}
|