@seedprotocol/sdk 0.2.4 → 0.2.5
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/{Item-D_fRE67b.js → Item-BnFRrM4P.js} +2 -2
- package/dist/{Item-D_fRE67b.js.map → Item-BnFRrM4P.js.map} +1 -1
- package/dist/{index-DpAde4Hk.js → index-C7j8knrm.js} +2 -2
- package/dist/index-C7j8knrm.js.map +1 -0
- package/dist/{index-CaMCzFrd.js → index-DX0iILNs.js} +59 -55
- package/dist/index-DX0iILNs.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-DrU0-rhL.js → seed.schema.config-CTkdNScQ.js} +2 -2
- package/dist/{seed.schema.config-DrU0-rhL.js.map → seed.schema.config-CTkdNScQ.js.map} +1 -1
- package/dist/src/addModelsToDb.ts +3 -3
- package/dist/src/fetchVersions.ts +3 -3
- package/dist/src/getSchemaForItemProperty.ts +3 -2
- package/dist/src/getSchemaUidForModel.ts +3 -3
- package/dist/src/syncDbWithEas.ts +10 -2
- package/dist/types/src/browser/schema/file/download/actors.d.ts.map +1 -1
- package/dist/types/src/browser/schema/file/fetchAll/actors.d.ts.map +1 -1
- package/dist/types/src/db/read/getSchemaUidForModel.d.ts.map +1 -1
- package/dist/types/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/types/src/helpers/getSchemaForItemProperty.d.ts.map +1 -1
- package/dist/types/src/services/allItems/actors/fetchVersions.d.ts.map +1 -1
- package/dist/types/src/services/global/actors/addModelsToDb.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-CaMCzFrd.js.map +0 -1
- package/dist/index-DpAde4Hk.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'immer';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
export { l as BaseFileManager, a as ImageSrc, I as Item, b as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, n as client, m as eventEmitter, k as getCorrectId, j as getGlobalService, e as useCreateItem, g as useDeleteItem, h as useGlobalServiceStatus, c as useItem, d as useItemProperties, f as useItemProperty, u as useItems, i as useServices, w as withSeed } from './index-
|
|
3
|
+
export { l as BaseFileManager, a as ImageSrc, I as Item, b as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, n as client, m as eventEmitter, k as getCorrectId, j as getGlobalService, e as useCreateItem, g as useDeleteItem, h as useGlobalServiceStatus, c as useItem, d as useItemProperties, f as useItemProperty, u as useItems, i as useServices, w as withSeed } from './index-DX0iILNs.js';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import 'xstate';
|
|
6
6
|
import 'arweave';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
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-DX0iILNs.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'reflect-metadata';
|
|
6
6
|
import 'xstate';
|
|
@@ -75,4 +75,4 @@ const models = {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export { models };
|
|
78
|
-
//# sourceMappingURL=seed.schema.config-
|
|
78
|
+
//# sourceMappingURL=seed.schema.config-CTkdNScQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config-
|
|
1
|
+
{"version":3,"file":"seed.schema.config-CTkdNScQ.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ries'
|
|
11
11
|
|
|
12
|
-
const easClient = BaseEasClient.getEasClient()
|
|
13
|
-
const queryClient = BaseQueryClient.getQueryClient()
|
|
14
|
-
|
|
15
12
|
const logger = debug('app:services:global:actors:addModelsToDb')
|
|
16
13
|
|
|
17
14
|
export const addModelsToDb = fromCallback<
|
|
@@ -101,6 +98,9 @@ export const addModelsToDb = fromCallback<
|
|
|
101
98
|
({ schemaDef }) => schemaDef,
|
|
102
99
|
)
|
|
103
100
|
|
|
101
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
102
|
+
const easClient = BaseEasClient.getEasClient()
|
|
103
|
+
|
|
104
104
|
const { schemas } = await queryClient.fetchQuery({
|
|
105
105
|
queryKey: [`getSchemasVersion`],
|
|
106
106
|
queryFn: async () =>
|
|
@@ -5,9 +5,6 @@ import { Attestation } from '@/graphql/gql/graphql'
|
|
|
5
5
|
import { BaseEasClient } from '@/helpers/BaseEasClient'
|
|
6
6
|
import { BaseQueryClient } from '@/helpers/BaseQueryClient'
|
|
7
7
|
|
|
8
|
-
const easClient = BaseEasClient.getEasClient()
|
|
9
|
-
const queryClient = BaseQueryClient.getQueryClient()
|
|
10
|
-
|
|
11
8
|
|
|
12
9
|
export const fetchVersions = fromCallback<
|
|
13
10
|
EventObject,
|
|
@@ -23,6 +20,9 @@ export const fetchVersions = fromCallback<
|
|
|
23
20
|
let itemVersions: Attestation[] | undefined
|
|
24
21
|
|
|
25
22
|
const _fetchVersions = async () => {
|
|
23
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
24
|
+
const easClient = BaseEasClient.getEasClient()
|
|
25
|
+
|
|
26
26
|
const seedIds = itemSeeds.map((seed) => seed.id)
|
|
27
27
|
|
|
28
28
|
const results = await queryClient.fetchQuery({
|
|
@@ -3,8 +3,6 @@ import { toSnakeCase, BaseEasClient, BaseQueryClient } from '@/helpers'
|
|
|
3
3
|
import { GET_SCHEMAS } from '@/Item/queries'
|
|
4
4
|
import { TypedData } from '@ethereum-attestation-service/eas-sdk/dist/offchain/typed-data-handler'
|
|
5
5
|
|
|
6
|
-
const easClient = BaseEasClient.getEasClient()
|
|
7
|
-
const queryClient = BaseQueryClient.getQueryClient()
|
|
8
6
|
|
|
9
7
|
type GetSchemaForPropertyProps = {
|
|
10
8
|
schemaUid?: string
|
|
@@ -23,6 +21,9 @@ export const getSchemaForItemProperty: GetSchemaForProperty = async ({
|
|
|
23
21
|
const isMissingSchemaUid =
|
|
24
22
|
!schemaUid || schemaUid === 'null' || schemaUid === 'undefined'
|
|
25
23
|
|
|
24
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
25
|
+
const easClient = BaseEasClient.getEasClient()
|
|
26
|
+
|
|
26
27
|
let queryParams: { where: SchemaWhereInput } = {
|
|
27
28
|
where: {
|
|
28
29
|
id: {
|
|
@@ -2,13 +2,13 @@ import { GET_SCHEMAS } from '@/Item/queries'
|
|
|
2
2
|
import { BaseEasClient } from '@/helpers/BaseEasClient'
|
|
3
3
|
import { BaseQueryClient } from '@/helpers/BaseQueryClient'
|
|
4
4
|
|
|
5
|
-
const easClient = BaseEasClient.getEasClient()
|
|
6
|
-
const queryClient = BaseQueryClient.getQueryClient()
|
|
7
|
-
|
|
8
5
|
|
|
9
6
|
export const getSchemaUidForModel = async (
|
|
10
7
|
modelName: string,
|
|
11
8
|
): Promise<string> => {
|
|
9
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
10
|
+
const easClient = BaseEasClient.getEasClient()
|
|
11
|
+
|
|
12
12
|
const modeType = modelName.toLowerCase()
|
|
13
13
|
|
|
14
14
|
const modelSchemaQuery = await queryClient.fetchQuery({
|
|
@@ -35,8 +35,7 @@ import { BaseEasClient } from '@/helpers/BaseEasClient'
|
|
|
35
35
|
import { BaseQueryClient } from '@/helpers/BaseQueryClient'
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
const easClient = BaseEasClient.getEasClient()
|
|
38
|
+
|
|
40
39
|
|
|
41
40
|
const relationValuesToExclude = [
|
|
42
41
|
'0x0000000000000000000000000000000000000000000000000000000000000020',
|
|
@@ -87,6 +86,9 @@ const processPropertiesFoundInDb = async ({ foundModel }) => {
|
|
|
87
86
|
|
|
88
87
|
const modelName = foundModel.name
|
|
89
88
|
|
|
89
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
90
|
+
const easClient = BaseEasClient.getEasClient()
|
|
91
|
+
|
|
90
92
|
const foundPropertySchemas = await queryClient.fetchQuery({
|
|
91
93
|
queryKey: [`getPropertySchemas${modelName}`],
|
|
92
94
|
queryFn: async () => easClient.request(GET_SCHEMAS, queryVariables),
|
|
@@ -141,6 +143,9 @@ const getSeedsFromSchemaUids = async ({ schemaUids, addresses }) => {
|
|
|
141
143
|
})
|
|
142
144
|
}
|
|
143
145
|
|
|
146
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
147
|
+
const easClient = BaseEasClient.getEasClient()
|
|
148
|
+
|
|
144
149
|
const { itemSeeds } = await queryClient.fetchQuery({
|
|
145
150
|
queryKey: [`getSeedsForAllModels`],
|
|
146
151
|
queryFn: async () =>
|
|
@@ -571,6 +576,9 @@ const saveEasPropertiesToDb: SaveEasPropertiesToDb = async ({
|
|
|
571
576
|
}
|
|
572
577
|
|
|
573
578
|
const getRelatedSeedsAndVersions = async () => {
|
|
579
|
+
const queryClient = BaseQueryClient.getQueryClient()
|
|
580
|
+
const easClient = BaseEasClient.getEasClient()
|
|
581
|
+
|
|
574
582
|
const { itemSeeds } = await easClient.request(GET_SEEDS, {
|
|
575
583
|
where: {
|
|
576
584
|
id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/schema/file/download/actors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/schema/file/download/actors.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,KAgCzB,CAAA;AAED,eAAO,MAAM,eAAe,KAe1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/schema/file/fetchAll/actors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/schema/file/fetchAll/actors.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,uBAAuB,KAsClC,CAAA;AAEF,eAAO,MAAM,kBAAkB,KA2N7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaUidForModel.d.ts","sourceRoot":"","sources":["../../../../../src/db/read/getSchemaUidForModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSchemaUidForModel.d.ts","sourceRoot":"","sources":["../../../../../src/db/read/getSchemaUidForModel.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,cACpB,MAAM,KAChB,OAAO,CAAC,MAAM,CAwBhB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncDbWithEas.d.ts","sourceRoot":"","sources":["../../../../../src/events/item/syncDbWithEas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAuB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"syncDbWithEas.d.ts","sourceRoot":"","sources":["../../../../../src/events/item/syncDbWithEas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAuB,MAAM,WAAW,CAAA;AAymBzE,QAAA,MAAM,oBAAoB,EAAE,aAAa,CAAC,GAAG,CA+F5C,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaForItemProperty.d.ts","sourceRoot":"","sources":["../../../../src/helpers/getSchemaForItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,SAAS,EAAE,MAAM,wEAAwE,CAAA;
|
|
1
|
+
{"version":3,"file":"getSchemaForItemProperty.d.ts","sourceRoot":"","sources":["../../../../src/helpers/getSchemaForItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,SAAS,EAAE,MAAM,wEAAwE,CAAA;AAGlG,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,oBAqDtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchVersions.d.ts","sourceRoot":"","sources":["../../../../../../src/services/allItems/actors/fetchVersions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"fetchVersions.d.ts","sourceRoot":"","sources":["../../../../../../src/services/allItems/actors/fetchVersions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAMnE,eAAO,MAAM,aAAa,uHAwCzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addModelsToDb.d.ts","sourceRoot":"","sources":["../../../../../../src/services/global/actors/addModelsToDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAOlD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"addModelsToDb.d.ts","sourceRoot":"","sources":["../../../../../../src/services/global/actors/addModelsToDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAOlD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAMjE,eAAO,MAAM,aAAa,wGA0IxB,CAAA"}
|