@seedprotocol/sdk 0.1.100 → 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-lKduRQ-D.js → index-C63Ut7kK.js} +22 -10
- package/dist/{index-lKduRQ-D.js.map → index-C63Ut7kK.js.map} +1 -1
- package/dist/{index-CxLl6iPh.js → index-D4vrRdvL.js} +2 -2
- package/dist/{index-CxLl6iPh.js.map → index-D4vrRdvL.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-DbK5jPLE.js → seed.schema.config-BCA5sEAY.js} +2 -2
- package/dist/{seed.schema.config-DbK5jPLE.js.map → seed.schema.config-BCA5sEAY.js.map} +1 -1
- package/dist/src/getPublishPayload.ts +14 -3
- package/dist/src/getSchemaForItemProperty.ts +4 -5
- package/dist/types/src/browser/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/types/src/browser/helpers/getSchemaForItemProperty.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-C63Ut7kK.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-
|
|
32
|
+
//# sourceMappingURL=index-D4vrRdvL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-D4vrRdvL.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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-C63Ut7kK.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-C63Ut7kK.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-BCA5sEAY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config-
|
|
1
|
+
{"version":3,"file":"seed.schema.config-BCA5sEAY.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;;;;;"}
|
|
@@ -53,6 +53,8 @@ export const getPublishPayload = async (
|
|
|
53
53
|
INTERNAL_DATA_TYPES[itemProperty.propertyDef.dataType].eas
|
|
54
54
|
|
|
55
55
|
let propertyNameForSchema = propertyName
|
|
56
|
+
let propertyValue = itemProperty.getService().getSnapshot()
|
|
57
|
+
.context.propertyValue
|
|
56
58
|
|
|
57
59
|
if (itemProperty.propertyDef.dataType === 'Relation') {
|
|
58
60
|
propertyNameForSchema = `${propertyName}Id`
|
|
@@ -63,8 +65,17 @@ export const getPublishPayload = async (
|
|
|
63
65
|
itemProperty.propertyDef.ref
|
|
64
66
|
) {
|
|
65
67
|
const singularPropertyName = pluralize.singular(propertyName)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
propertyNameForSchema = `${singularPropertyName}${itemProperty.propertyDef.ref}Ids`
|
|
69
|
+
if (typeof propertyValue === 'string' && propertyValue.length === 66) {
|
|
70
|
+
propertyValue = [propertyValue]
|
|
71
|
+
}
|
|
72
|
+
if (typeof propertyValue === 'string' && propertyValue.length > 66) {
|
|
73
|
+
try {
|
|
74
|
+
propertyValue = JSON.parse(propertyValue)
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.log('No-op due to error: ', error)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
if (
|
|
@@ -90,7 +101,7 @@ export const getPublishPayload = async (
|
|
|
90
101
|
{
|
|
91
102
|
name: toSnakeCase(propertyNameForSchema),
|
|
92
103
|
type: easDataType,
|
|
93
|
-
value:
|
|
104
|
+
value: propertyValue,
|
|
94
105
|
},
|
|
95
106
|
]
|
|
96
107
|
|
|
@@ -18,6 +18,8 @@ export const getSchemaForItemProperty: GetSchemaForProperty = async ({
|
|
|
18
18
|
easDataType,
|
|
19
19
|
}): Promise<Schema | void> => {
|
|
20
20
|
const propertyNameSnakeCase = toSnakeCase(propertyName)
|
|
21
|
+
const isMissingSchemaUid =
|
|
22
|
+
!schemaUid || schemaUid === 'null' || schemaUid === 'undefined'
|
|
21
23
|
|
|
22
24
|
let queryParams: { where: SchemaWhereInput } = {
|
|
23
25
|
where: {
|
|
@@ -27,7 +29,7 @@ export const getSchemaForItemProperty: GetSchemaForProperty = async ({
|
|
|
27
29
|
},
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
if (
|
|
32
|
+
if (easDataType) {
|
|
31
33
|
queryParams = {
|
|
32
34
|
where: {
|
|
33
35
|
schema: {
|
|
@@ -37,10 +39,7 @@ export const getSchemaForItemProperty: GetSchemaForProperty = async ({
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
if (
|
|
41
|
-
!easDataType &&
|
|
42
|
-
(!schemaUid || schemaUid === 'null' || schemaUid === 'undefined')
|
|
43
|
-
) {
|
|
42
|
+
if (!easDataType && isMissingSchemaUid) {
|
|
44
43
|
queryParams = {
|
|
45
44
|
where: {
|
|
46
45
|
schemaNames: {
|
|
@@ -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,CAyG7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaForItemProperty.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/getSchemaForItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,uBAAuB,CAAA;AAIhE,OAAO,EAAE,SAAS,EAAE,MAAM,wEAAwE,CAAA;AAElG,KAAK,yBAAyB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAChC,CAAA;AACD,KAAK,oBAAoB,GAAG,CAC1B,KAAK,EAAE,yBAAyB,KAC7B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;AAC3B,eAAO,MAAM,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"getSchemaForItemProperty.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/getSchemaForItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,uBAAuB,CAAA;AAIhE,OAAO,EAAE,SAAS,EAAE,MAAM,wEAAwE,CAAA;AAElG,KAAK,yBAAyB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAChC,CAAA;AACD,KAAK,oBAAoB,GAAG,CAC1B,KAAK,EAAE,yBAAyB,KAC7B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;AAC3B,eAAO,MAAM,wBAAwB,EAAE,oBAkDtC,CAAA"}
|