@seedprotocol/sdk 0.2.26 → 0.2.27

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.
@@ -1,4 +1,4 @@
1
- export { I as Item } from './index-8491IPWu.js';
1
+ export { I as Item } from './index-CreT8SAL.js';
2
2
  import 'immer';
3
3
  import 'reflect-metadata';
4
4
  import 'tslib';
@@ -28,4 +28,4 @@ import 'arweave';
28
28
  import 'use-immer';
29
29
  import '@xstate/react';
30
30
  import 'rxjs';
31
- //# sourceMappingURL=index-Bsvr_g6x.js.map
31
+ //# sourceMappingURL=index-hIQeW9Wa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-hIQeW9Wa.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'immer';
2
2
  import 'reflect-metadata';
3
- export { D as Db, d as ImageSrc, e as Item, f as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, x as client, v as eventEmitter, s as getCorrectId, t as getGlobalService, k as useCreateItem, m as useDeleteItem, n as useGlobalServiceStatus, h as useItem, j as useItemProperties, l as useItemProperty, u as useItems, p as usePersistedSnapshots, o as usePublishItem, r as useService, q as useServices, w as withSeed } from './index-8491IPWu.js';
3
+ export { D as Db, d as ImageSrc, e as Item, f as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, x as client, v as eventEmitter, s as getCorrectId, t as getGlobalService, k as useCreateItem, m as useDeleteItem, n as useGlobalServiceStatus, h as useItem, j as useItemProperties, l as useItemProperty, u as useItems, p as usePersistedSnapshots, o as usePublishItem, r as useService, q as useServices, w as withSeed } from './index-CreT8SAL.js';
4
4
  import 'tslib';
5
5
  import 'drizzle-orm';
6
6
  export { c as BaseArweaveClient, B as BaseEasClient, b as BaseFileManager, a as BaseQueryClient } from './constants-CuI_qYXt.js';
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import 'reflect-metadata';
3
- import { T as Text, M as Model } from './index-8491IPWu.js';
3
+ import { T as Text, M as Model } from './index-CreT8SAL.js';
4
4
  import 'immer';
5
5
  import '@sinclair/typebox';
6
6
  import 'drizzle-orm';
@@ -75,4 +75,4 @@ const models = {
75
75
  };
76
76
 
77
77
  export { models };
78
- //# sourceMappingURL=seed.schema.config-CVQ4WO_e.js.map
78
+ //# sourceMappingURL=seed.schema.config-CVCqLN-b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.schema.config-CVQ4WO_e.js","sources":["../../src/db/configs/seed.schema.config.ts"],"sourcesContent":["import { Model, Text } from '@/schema'\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-CVCqLN-b.js","sources":["../../src/db/configs/seed.schema.config.ts"],"sourcesContent":["import { Model, Text } from '@/schema'\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;;;;;"}
@@ -19,9 +19,9 @@ import { getCorrectId } from '@/helpers'
19
19
  import { Item } from '@/browser/Item/Item'
20
20
  import { getSegmentedItemProperties } from '@/helpers/getSegmentedItemProperties'
21
21
  import { IItemProperty } from '@/interfaces'
22
+ import { IItem } from '@/interfaces'
22
23
 
23
-
24
- const getVersionUid = (item: Item<any>) => {
24
+ const getVersionUid = (item: IItem<any>) => {
25
25
  let versionUid
26
26
 
27
27
  if (
@@ -38,7 +38,7 @@ const getPropertyData = async (itemProperty: IItemProperty<any>) => {
38
38
  const easDataType =
39
39
  INTERNAL_DATA_TYPES[itemProperty.propertyDef!.dataType].eas
40
40
 
41
- let schemaUid = itemProperty.schemaUid
41
+ let schemaUid: string | undefined = itemProperty.schemaUid
42
42
 
43
43
  const propertyNameForSchema = toSnakeCase(itemProperty.propertyName)
44
44
 
@@ -112,8 +112,8 @@ export const fetchFilesRecursively = async (
112
112
  localPath: string,
113
113
  fileList: string[],
114
114
  ) => {
115
- try {
116
- for (const file of fileList) {
115
+ for (const file of fileList) {
116
+ try {
117
117
  const fileUrl = `${url}/${file}`
118
118
  const fileLocalPath = path.join(localPath, file)
119
119
 
@@ -121,9 +121,9 @@ export const fetchFilesRecursively = async (
121
121
  // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)
122
122
 
123
123
  await downloadFile(fileUrl, fileLocalPath)
124
+ } catch (error) {
125
+ console.error(`Failed to fetch files from ${url}:`, error)
124
126
  }
125
- } catch (error) {
126
- console.error(`Failed to fetch files from ${url}:`, error)
127
127
  }
128
128
  }
129
129
 
@@ -1,22 +1,23 @@
1
1
  import { EventObject, fromCallback } from 'xstate'
2
- import { itemMachineSingle } from '@/Item/service/itemMachineSingle'
2
+ import { FromCallbackInput, PropertyMachineContext } from '@/types'
3
3
  import { BaseDb } from '@/db/Db/BaseDb'
4
4
 
5
- export const waitForDb = fromCallback<EventObject, typeof itemMachineSingle>(
6
- ({ sendBack }) => {
7
- const _waitForDb = new Promise<void>((resolve) => {
8
- const interval = setInterval(() => {
9
- const appDb = BaseDb.getAppDb()
5
+ export const waitForDb = fromCallback<
6
+ EventObject,
7
+ FromCallbackInput<PropertyMachineContext>
8
+ >(({ sendBack }) => {
9
+ const _waitForDb = new Promise<void>((resolve) => {
10
+ const interval = setInterval(() => {
11
+ const appDb = BaseDb.getAppDb()
10
12
 
11
- if (appDb) {
12
- clearInterval(interval)
13
- resolve()
14
- }
15
- }, 100)
16
- })
13
+ if (appDb) {
14
+ clearInterval(interval)
15
+ resolve()
16
+ }
17
+ }, 100)
18
+ })
17
19
 
18
- _waitForDb.then(() => {
19
- sendBack({ type: 'waitForDbSuccess' })
20
- })
21
- },
22
- )
20
+ _waitForDb.then(() => {
21
+ sendBack({ type: 'waitForDbSuccess' })
22
+ })
23
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/sdk",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "The SDK for Seed Protocol",
5
5
  "type": "module",
6
6
  "engines": {