@seedprotocol/sdk 0.1.77 → 0.1.78

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/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-BH0P1ozi.js';
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-_JWt4nA-.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-BH0P1ozi.js';
3
+ import { T as Text, M as Model } from './index-_JWt4nA-.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-CR4yAjam.js.map
79
+ //# sourceMappingURL=seed.schema.config-CD9Ee46X.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.schema.config-CR4yAjam.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;;;;;"}
1
+ {"version":3,"file":"seed.schema.config-CD9Ee46X.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;;;;;"}
@@ -1,10 +1,285 @@
1
1
  import { EventObject, fromCallback } from 'xstate'
2
- import { uploadMachine } from '@/browser/schema/file/upload/index'
2
+ import { fetchAllFilesMachine } from '@/browser/schema/file/fetchAll/index'
3
+ import { ARWEAVE_HOST } from '@/browser/services/internal/constants'
4
+ import { GET_FILES_METADATA } from '@/browser/schema/file/queries'
5
+ import { getArweave } from '../arweave'
6
+ import { fs } from '@zenfs/core'
7
+ import {
8
+ getDataTypeFromString,
9
+ getMimeType,
10
+ identifyString,
11
+ } from '@/shared/helpers'
12
+ import { appState } from 'src/shared/seedSchema'
13
+ import { eq } from 'drizzle-orm'
14
+ import { easClient, queryClient } from '@/browser/helpers'
15
+ import debug from 'debug'
16
+ import { getAppDb } from '@/browser/db/sqlWasmClient'
3
17
 
4
- export const uploadBinaryData = fromCallback<EventObject, typeof uploadMachine>(
5
- ({ sendBack, receive, input }) => {},
6
- )
18
+ import { saveAppState } from '@/browser/db/write/saveAppState'
7
19
 
8
- export const uploadMetadata = fromCallback<EventObject, typeof uploadMachine>(
9
- ({ sendBack, receive, input }) => {},
10
- )
20
+ const logger = debug('app:file:actors:fetchAll')
21
+
22
+ type FileType = {
23
+ mimeType: string
24
+ extension: string
25
+ }
26
+
27
+ // Map of common MIME types to file extensions
28
+ const fileTypeMap: Record<string, FileType> = {
29
+ 'image/jpeg': { mimeType: 'image/jpeg', extension: '.jpg' },
30
+ 'image/png': { mimeType: 'image/png', extension: '.png' },
31
+ 'application/json': { mimeType: 'application/json', extension: '.json' },
32
+ 'text/plain': { mimeType: 'text/plain', extension: '.txt' },
33
+ // Add more MIME types and file extensions as needed
34
+ }
35
+
36
+ export const fetchAllMetadataRecords = fromCallback<
37
+ EventObject,
38
+ typeof fetchAllFilesMachine
39
+ >(({ sendBack, receive, input: { context, event } }) => {
40
+ const { addresses } = context
41
+
42
+ const _fetchAllMetadataRecords = async () => {
43
+ const { filesMetadata } = await queryClient.fetchQuery({
44
+ queryKey: ['getFilesMetadata', ...addresses],
45
+ queryFn: async () =>
46
+ easClient.request(GET_FILES_METADATA, {
47
+ where: {
48
+ attester: {
49
+ in: addresses,
50
+ },
51
+ schema: {
52
+ is: {
53
+ id: {
54
+ equals:
55
+ '0x55fdefb36fcbbaebeb7d6b41dc3a1a9666e4e42154267c889de064faa7ede517',
56
+ },
57
+ },
58
+ },
59
+ },
60
+ }),
61
+ })
62
+
63
+ return filesMetadata
64
+ }
65
+
66
+ _fetchAllMetadataRecords().then((filesMetadata) => {
67
+ sendBack({ type: 'fetchingAllMetadataRecordsSuccess', filesMetadata })
68
+ })
69
+
70
+ return () => {}
71
+ })
72
+
73
+ export const fetchAllBinaryData = fromCallback<
74
+ EventObject,
75
+ typeof fetchAllFilesMachine
76
+ >(({ sendBack, input: { context } }) => {
77
+ const { filesMetadata, addresses } = context
78
+
79
+ const _fetchAllBinaryData = async () => {
80
+ if (!(await fs.promises.exists('/files'))) {
81
+ await fs.promises.mkdir('/files', { recursive: true })
82
+ }
83
+
84
+ if (!(await fs.promises.exists('/files/html'))) {
85
+ await fs.promises.mkdir('/files/html', { recursive: true })
86
+ }
87
+
88
+ if (!(await fs.promises.exists('/files/json'))) {
89
+ await fs.promises.mkdir('/files/json', { recursive: true })
90
+ }
91
+
92
+ if (!(await fs.promises.exists('/files/images'))) {
93
+ await fs.promises.mkdir('/files/images', { recursive: true })
94
+ }
95
+
96
+ const appDb = getAppDb()
97
+
98
+ if (!appDb) {
99
+ logger('[fetchAll/actors] [fetchAllBinaryData] seedDb not available')
100
+ return []
101
+ }
102
+
103
+ for (const fileMetadata of filesMetadata) {
104
+ const json = JSON.parse(fileMetadata.decodedDataJson)
105
+ const transactionId = json[0].value.value
106
+
107
+ const excludedTransactionsQuery = await appDb
108
+ .select()
109
+ .from(appState)
110
+ .where(eq(appState.key, 'excludedTransactions'))
111
+
112
+ let excludedTransactions = new Set<string>()
113
+
114
+ if (excludedTransactionsQuery && excludedTransactionsQuery.length === 1) {
115
+ const valueString = excludedTransactionsQuery[0].value
116
+ if (valueString) {
117
+ const excludedTransactionsArray = JSON.parse(valueString)
118
+ excludedTransactions = new Set(excludedTransactionsArray)
119
+ }
120
+ }
121
+
122
+ if (excludedTransactions.has(transactionId)) {
123
+ continue
124
+ }
125
+
126
+ const arweave = getArweave()
127
+
128
+ if (!arweave) {
129
+ logger('[fetchAll/actors] [fetchAllBinaryData] arweave not available')
130
+ return []
131
+ }
132
+
133
+ try {
134
+ const res = await fetch(
135
+ `https://${ARWEAVE_HOST}/tx/${transactionId}/status`,
136
+ )
137
+
138
+ if (res.status !== 200) {
139
+ logger(
140
+ `[fetchAll/actors] [fetchAllBinaryData] error fetching transaction data for ${transactionId}`,
141
+ )
142
+
143
+ excludedTransactions.add(transactionId)
144
+
145
+ await saveAppState(
146
+ 'excludedTransactions',
147
+ JSON.stringify(Array.from(excludedTransactions)),
148
+ )
149
+
150
+ logger(
151
+ '[fetchAll/actors] [fetchAllBinaryData] updated excludedTransactions:',
152
+ excludedTransactions,
153
+ )
154
+
155
+ continue
156
+ }
157
+
158
+ const dataString = await arweave.transactions
159
+ .getData(transactionId, {
160
+ decode: true,
161
+ string: true,
162
+ })
163
+ .catch((error) => {
164
+ logger(
165
+ `[fetchAll/actors] [fetchAllBinaryData] error fetching transaction data for ${transactionId}`,
166
+ error,
167
+ )
168
+ })
169
+
170
+ const dataUint8Array = await arweave.transactions.getData(transactionId)
171
+ // let buffer
172
+ //
173
+ // if (dataUint8Array && dataUint8Array instanceof Uint8Array) {
174
+ // }
175
+
176
+ let contentType = identifyString(dataString)
177
+ if (
178
+ contentType !== 'json' &&
179
+ contentType !== 'base64' &&
180
+ contentType !== 'html'
181
+ ) {
182
+ const possibleImageType = getDataTypeFromString(dataString)
183
+ if (!possibleImageType) {
184
+ logger(
185
+ `[fetchAll/actors] [fetchAllBinaryData] transaction ${transactionId} data not in expected format: ${possibleImageType}`,
186
+ )
187
+ continue
188
+ }
189
+
190
+ contentType = possibleImageType
191
+ }
192
+
193
+ if (contentType === 'url') {
194
+ const url = dataString as string
195
+ const response = await fetch(url)
196
+ if (!response.ok) {
197
+ throw new Error(`Failed to fetch image: ${response.statusText}`)
198
+ }
199
+
200
+ // Get the image as a Blob
201
+ const blob = await response.blob()
202
+ const buffer = await blob.arrayBuffer()
203
+ const bufferUint8Array = new Uint8Array(buffer)
204
+
205
+ // Extract the file extension from the URL
206
+ const extensionMatch = url.match(
207
+ /\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i,
208
+ )
209
+ if (!extensionMatch) {
210
+ throw new Error(
211
+ 'Unable to determine the file extension from the URL.',
212
+ )
213
+ }
214
+ const fileExtension = extensionMatch[0] // e.g., ".jpg"
215
+
216
+ // Set the file name (you can customize this)
217
+ // const fileNameFromUrl = `${transactionId}${fileExtension}`
218
+
219
+ await fs.promises.writeFile(
220
+ `/files/images/${transactionId}`,
221
+ bufferUint8Array,
222
+ {
223
+ encoding: 'binary',
224
+ },
225
+ )
226
+
227
+ continue
228
+ }
229
+
230
+ const mimeType = getMimeType(dataString as string)
231
+
232
+ let fileName = transactionId
233
+
234
+ if (contentType === 'base64') {
235
+ if (mimeType) {
236
+ fileName += `.${mimeType}`
237
+ }
238
+
239
+ // Remove the Base64 header if it exists (e.g., "data:image/png;base64,")
240
+ const base64Data = dataString.split(',').pop() || ''
241
+
242
+ // Decode the Base64 string to binary
243
+ const binaryString = atob(base64Data)
244
+ const length = binaryString.length
245
+ const binaryData = new Uint8Array(length)
246
+
247
+ for (let i = 0; i < length; i++) {
248
+ binaryData[i] = binaryString.charCodeAt(i)
249
+ }
250
+
251
+ await fs.promises.writeFile(`/files/images/${fileName}`, binaryData, {
252
+ encoding: 'binary',
253
+ })
254
+
255
+ // if (dataUint8Array && dataUint8Array instanceof Uint8Array) {
256
+ // await fs.promises.writeFile(
257
+ // `/files/images/${fileName}`,
258
+ // dataUint8Array,
259
+ // )
260
+ // }
261
+ }
262
+
263
+ if (contentType === 'html') {
264
+ fileName += '.html'
265
+ await fs.promises.writeFile(`/files/html/${fileName}`, dataString)
266
+ }
267
+
268
+ if (contentType === 'json') {
269
+ fileName += '.json'
270
+ await fs.promises.writeFile(`/files/json/${fileName}`, dataString)
271
+ }
272
+ } catch (error) {
273
+ logger(error)
274
+ }
275
+ }
276
+
277
+ return []
278
+ }
279
+
280
+ _fetchAllBinaryData().then((binaryData) => {
281
+ sendBack({ type: 'fetchingAllBinaryDataSuccess', binaryData })
282
+ })
283
+
284
+ return () => {}
285
+ })
@@ -186,6 +186,8 @@ export const hydrateFromDb = fromCallback<
186
186
  dir = 'images'
187
187
  }
188
188
 
189
+ dir = dir!.replace(/^\//, '')
190
+
189
191
  if (
190
192
  !refResolvedValue &&
191
193
  propertyValueFromDb &&
package/dist/src/index.ts CHANGED
@@ -1,21 +1,4 @@
1
- import { setup } from 'xstate'
2
- import {
3
- uploadBinaryData,
4
- uploadMetadata,
5
- } from '@/browser/schema/file/upload/actors'
6
-
7
- export const uploadMachine = setup({
8
- actors: {
9
- uploadBinaryData,
10
- uploadMetadata,
11
- },
12
- }).createMachine({
13
- id: 'upload',
14
- initial: 'idle',
15
- context: {
16
- file: '',
17
- },
18
- states: {
19
- idle: {},
20
- },
21
- })
1
+ export * from './analyzeInput'
2
+ export * from './saveImageSrc'
3
+ export * from './saveRelation'
4
+ export * from './saveItemStorage'
@@ -1,41 +1,127 @@
1
- import { EventObject, fromCallback } from 'xstate'
2
- import { itemMachineSingle } from '@/browser/item/single/itemMachineSingle'
3
- import pluralize from 'pluralize'
4
- import { getExistingItem } from '@/browser/db/read'
5
-
6
- export const initialize = fromCallback<EventObject, typeof itemMachineSingle>(
7
- ({ sendBack, input: { context } }) => {
8
- const { seedLocalId, seedUid, ModelClass } = context
9
-
10
- const modelName = ModelClass.originalConstructor.name
11
- const modelNamePlural = pluralize(modelName)
12
- const modelTableName = modelNamePlural.toLowerCase()
13
-
14
- const _intialize = async (): Promise<void> => {
15
- const existingItem = await getExistingItem({ seedUid, seedLocalId })
16
-
17
- if (existingItem) {
18
- sendBack({
19
- type: 'hasExistingItem',
20
- modelName,
21
- modelTableName,
22
- modelNamePlural,
23
- existingItem,
1
+ import { EventObject, fromCallback, Subscription } from 'xstate'
2
+ import { isNode, isReactNative } from '@/shared'
3
+ import {
4
+ GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES,
5
+ GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY,
6
+ GLOBAL_INITIALIZING_SEND_CONFIG,
7
+ } from '@/browser/services/internal/constants'
8
+ import debug from 'debug'
9
+ import { FromCallbackInput, GlobalMachineContext } from '@/types'
10
+ import { getAppDb } from '@/browser/db/sqlWasmClient'
11
+ import { appState } from '@/shared/seedSchema'
12
+ import { like } from 'drizzle-orm'
13
+
14
+ const logger = debug('app:services:global:actors:initialize')
15
+
16
+ export const initialize = fromCallback<
17
+ EventObject,
18
+ FromCallbackInput<GlobalMachineContext>
19
+ >(({ sendBack, input: { event, context } }) => {
20
+ const { internalService, models, endpoints } = context
21
+
22
+ const { addresses } = event
23
+
24
+ let environment = 'browser'
25
+
26
+ if (isNode()) {
27
+ environment = 'node'
28
+ }
29
+
30
+ if (isReactNative()) {
31
+ environment = 'react-native'
32
+ }
33
+
34
+ let internalSubscription: Subscription | undefined
35
+ let easSubscription: Subscription | undefined
36
+
37
+ if (environment === 'browser' && models) {
38
+ const _initFileSystem = async (): Promise<void> => {
39
+ return
40
+ // return new Promise((resolve) => {
41
+ // })
42
+ }
43
+
44
+ const _initInternal = async (): Promise<void> => {
45
+ return new Promise((resolve) => {
46
+ internalSubscription = internalService.subscribe((snapshot) => {
47
+ logger('[sdk] [internal] snapshot', snapshot)
48
+ if (snapshot.value === 'ready') {
49
+ resolve()
50
+ }
24
51
  })
25
- return
52
+ internalService.send({ type: 'init', endpoints, addresses })
53
+ })
54
+ }
55
+
56
+ const _initAllItemsServices = async (): Promise<void> => {
57
+ const appDb = getAppDb()
58
+
59
+ const rows = await appDb
60
+ .select()
61
+ .from(appState)
62
+ .where(like(appState.key, 'snapshot__%'))
63
+
64
+ const payloadObj = {
65
+ create: {},
66
+ restore: {},
26
67
  }
27
68
 
69
+ const modelNamesRestored: string[] = []
70
+
71
+ if (rows && rows.length > 0) {
72
+ for (const row of rows) {
73
+ const modelName = row.key.replace('snapshot__', '')
74
+ payloadObj.restore[modelName] = JSON.parse(row.value)
75
+ modelNamesRestored.push(modelName)
76
+ }
77
+ }
78
+ for (const [modelName, ModelClass] of Object.entries(models)) {
79
+ if (!modelNamesRestored.includes(modelName)) {
80
+ payloadObj.create[modelName] = ModelClass
81
+ }
82
+ }
28
83
  sendBack({
29
- type: 'isNewItem',
30
- modelName,
31
- modelTableName,
32
- modelNamePlural,
84
+ type: GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES,
85
+ ...payloadObj,
33
86
  })
34
87
  }
35
88
 
36
- _intialize().then(() => {
37
- sendBack({ type: 'initializeSuccess' })
38
- return
89
+ const _initEas = async (): Promise<void> => {
90
+ // const { easService } = await import('@/browser/eas')
91
+ // easService.send({ type: 'init', endpoints, models })
92
+ // return new Promise((resolve) => {
93
+ // easSubscription = easService.subscribe((snapshot) => {
94
+ // if (snapshot.value === 'ready') {
95
+ // resolve()
96
+ // }
97
+ // })
98
+ // easService.send({ type: 'init', endpoints, models })
99
+ // })
100
+ }
101
+
102
+ _initFileSystem().then(() => {
103
+ logger('[global/actors] File system initialized')
39
104
  })
40
- },
41
- )
105
+
106
+ _initInternal()
107
+ .then(() => {
108
+ return _initAllItemsServices()
109
+ })
110
+ .then(() => {
111
+ logger('[global/actors] Internal initialized')
112
+ sendBack({ type: GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY })
113
+ internalSubscription?.unsubscribe()
114
+ })
115
+
116
+ // _initEas().then(() => {
117
+ // logger('EAS initialized')
118
+ // })
119
+ }
120
+
121
+ sendBack({ type: GLOBAL_INITIALIZING_SEND_CONFIG, environment })
122
+
123
+ return () => {
124
+ internalSubscription?.unsubscribe()
125
+ easSubscription?.unsubscribe()
126
+ }
127
+ })
@@ -1,34 +1,13 @@
1
1
  import { graphql } from '@/browser/gql'
2
2
 
3
- export const GET_IMAGE_SEEDS = graphql(/* GraphQL */ `
4
- query GetImageSeeds($where: AttestationWhereInput!) {
5
- imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {
3
+ export const GET_SCHEMA_UIDS_FOR_MODELS = graphql(/* GraphQL */ `
4
+ query GetSchemaUids($where: SchemaWhereInput!) {
5
+ schemaUids: schemata(where: $where) {
6
6
  id
7
- decodedDataJson
8
- attester
9
- schema {
10
- schemaNames {
11
- name
12
- }
7
+ schema
8
+ schemaNames {
9
+ name
13
10
  }
14
- refUID
15
- revoked
16
- schemaId
17
- txid
18
- timeCreated
19
- time
20
- isOffchain
21
- }
22
- }
23
- `)
24
-
25
- export const GET_IMAGE_VERSIONS = graphql(/* GraphQL */ `
26
- query GetImageVersions($where: AttestationWhereInput!) {
27
- imageVersions: attestations(
28
- where: $where
29
- orderBy: [{ timeCreated: desc }]
30
- ) {
31
- ...attestationFields
32
11
  }
33
12
  }
34
13
  `)
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateFromDb.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/property/actors/hydrateFromDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAOlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAIzD,eAAO,MAAM,aAAa,uHAkRxB,CAAA"}
1
+ {"version":3,"file":"hydrateFromDb.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/property/actors/hydrateFromDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAOlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAIzD,eAAO,MAAM,aAAa,uHAoRxB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/sdk",
3
- "version": "0.1.77",
3
+ "version": "0.1.78",
4
4
  "description": "The SDK for Seed Protocol",
5
5
  "type": "module",
6
6
  "types": "./dist/types/src/index.d.ts",