@seedprotocol/sdk 0.1.120 → 0.1.121

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-lYH32Ucm.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-CQVtBXqn.js';
2
2
  import 'immer';
3
3
  import 'reflect-metadata';
4
4
  import 'tslib';
@@ -29,7 +29,6 @@ import 'drizzle-orm/sqlite-proxy';
29
29
  import 'drizzle-orm/sqlite-proxy/migrator';
30
30
  import 'drizzle-orm/migrator';
31
31
  import 'node:fs';
32
- import 'async-es/retry';
33
32
  import '@zenfs/dom';
34
33
  import './constants-B6s6tGup.js';
35
34
  import '@ethereum-attestation-service/eas-sdk';
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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-lYH32Ucm.js';
3
+ import { T as Text, M as Model } from './index-CQVtBXqn.js';
4
4
  import 'react';
5
5
  import 'reflect-metadata';
6
6
  import 'xstate';
@@ -30,7 +30,6 @@ import 'drizzle-orm/sqlite-proxy';
30
30
  import 'drizzle-orm/sqlite-proxy/migrator';
31
31
  import 'drizzle-orm/migrator';
32
32
  import 'node:fs';
33
- import 'async-es/retry';
34
33
  import './constants-B6s6tGup.js';
35
34
  import '@ethereum-attestation-service/eas-sdk';
36
35
  import 'thirdweb';
@@ -81,4 +80,4 @@ const models = {
81
80
  };
82
81
 
83
82
  export { models };
84
- //# sourceMappingURL=seed.schema.config-y0omDTDZ.js.map
83
+ //# sourceMappingURL=seed.schema.config-CEyCY7bh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seed.schema.config-CEyCY7bh.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;;;;;"}
package/dist/src/files.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { fs } from '@zenfs/core'
2
2
  import * as fsNode from 'node:fs'
3
- import retry from 'async-es/retry'
3
+ // import * as retry from 'async-es/retry'
4
4
 
5
5
  export const listFilesInOPFSRoot = async () => {
6
6
  // Get the root directory handle
@@ -34,26 +34,37 @@ export const waitForFile = (
34
34
  return new Promise((resolve, reject) => {
35
35
  const startTime = Date.now()
36
36
 
37
- retry(
38
- {
39
- times: Math.ceil(timeout / interval),
40
- interval: interval,
41
- },
42
- (callback: Function) => {
43
- if (fs.existsSync(filePath) && fsNode.existsSync(filePath)) {
44
- return callback(null, true) // File exists, finish with success
45
- }
46
- if (Date.now() - startTime >= timeout) {
47
- return callback(new Error('Timeout exceeded while waiting for file'))
48
- }
49
- callback(new Error('File does not exist yet')) // Retry with this error
50
- },
51
- (err: Error, result: boolean) => {
52
- if (err) {
53
- return resolve(false) // Resolve as false if timeout or error occurs
54
- }
55
- resolve(result) // Resolve as true if file exists
56
- },
57
- )
37
+ const _interval = setInterval(() => {
38
+ if (fs.existsSync(filePath) && fsNode.existsSync(filePath)) {
39
+ clearInterval(_interval)
40
+ resolve(true)
41
+ }
42
+ if (Date.now() - startTime >= timeout) {
43
+ clearInterval(_interval)
44
+ reject(new Error('Timeout exceeded while waiting for file'))
45
+ }
46
+ }, interval)
47
+
48
+ // retry(
49
+ // {
50
+ // times: Math.ceil(timeout / interval),
51
+ // interval: interval,
52
+ // },
53
+ // (callback: Function) => {
54
+ // if (fs.existsSync(filePath) && fsNode.existsSync(filePath)) {
55
+ // return callback(null, true) // File exists, finish with success
56
+ // }
57
+ // if (Date.now() - startTime >= timeout) {
58
+ // return callback(new Error('Timeout exceeded while waiting for file'))
59
+ // }
60
+ // callback(new Error('File does not exist yet')) // Retry with this error
61
+ // },
62
+ // (err: Error, result: boolean) => {
63
+ // if (err) {
64
+ // return resolve(false) // Resolve as false if timeout or error occurs
65
+ // }
66
+ // resolve(result) // Resolve as true if file exists
67
+ // },
68
+ // )
58
69
  })
59
70
  }
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'
package/dist/src/seed.ts CHANGED
@@ -1,37 +1,10 @@
1
- import { isBrowser, isNode, isReactNative } from '@/shared/environment'
2
- import { Endpoints, SeedConstructorOptions } from '@/types/types'
3
- import { Subject } from 'rxjs'
1
+ import { SeedConstructorOptions } from '@/types/types'
2
+ import { SeedBase } from '@/shared/seed'
4
3
 
5
- type Environment = 'node' | 'browser' | 'react-native'
6
-
7
- abstract class SeedBase {
8
- private readonly _env: Environment = 'browser'
9
- protected _subject: Subject<void> = new Subject<void>()
10
-
11
- constructor(props: { endpoints: Endpoints }) {
12
- console.log('Seed constructor called')
13
- if (isNode()) {
14
- this._env = 'node'
15
- }
16
- if (isBrowser()) {
17
- this._env = 'browser'
18
- }
19
- if (isReactNative()) {
20
- this._env = 'react-native'
21
- }
22
- }
23
-
24
- async initialize() {}
25
-
26
- subscribe(callback: (event: any) => void) {
27
- return this._subject.subscribe(callback)
28
- }
29
- }
30
-
31
- class SeedSync extends SeedBase {
4
+ class SeedNode extends SeedBase {
32
5
  constructor(props: SeedConstructorOptions) {
33
6
  super(props)
34
7
  }
35
8
  }
36
9
 
37
- export { SeedBase, SeedSync }
10
+ export { SeedNode }
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/shared/helpers/files.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,sBAe/B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aACZ,MAAM,aACN,MAAM,YACP,MAAM,KACd,OAAO,CAAC,OAAO,CA0BjB,CAAA"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/shared/helpers/files.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,sBAe/B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aACZ,MAAM,aACN,MAAM,YACP,MAAM,KACd,OAAO,CAAC,OAAO,CAqCjB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/sdk",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "description": "The SDK for Seed Protocol",
5
5
  "type": "module",
6
6
  "types": "./dist/types/src/index.d.ts",
@@ -51,8 +51,6 @@
51
51
  "@zenfs/core": "^1.6.8",
52
52
  "@zenfs/dom": "1.1.0",
53
53
  "arweave": "^1.15.5",
54
- "async": "^3.2.6",
55
- "async-es": "^3.2.6",
56
54
  "better-sqlite3": "^11.7.0",
57
55
  "crypto-browserify": "^3.12.1",
58
56
  "dayjs": "^1.11.13",
@@ -111,7 +109,6 @@
111
109
  "@testing-library/dom": "^10.4.0",
112
110
  "@testing-library/react": "^16.1.0",
113
111
  "@testing-library/react-hooks": "^8.0.1",
114
- "@types/async": "^3.2.24",
115
112
  "@types/better-sqlite3": "^7.6.12",
116
113
  "@types/debug": "^4.1.12",
117
114
  "@types/express": "^5.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CXivX9-v.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}