@seedprotocol/sdk 0.2.25 → 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.
- package/dist/{Db-CKu619ns.js → Db-BXj7xeIK.js} +2 -2
- package/dist/{Db-CKu619ns.js.map → Db-BXj7xeIK.js.map} +1 -1
- package/dist/{Db-ClRDgyEs.js → Db-Dk-X1anD.js} +2 -2
- package/dist/{Db-ClRDgyEs.js.map → Db-Dk-X1anD.js.map} +1 -1
- package/dist/{FileManager-BGej9rn4.js → FileManager-D-yaDuSt.js} +12 -2
- package/dist/FileManager-D-yaDuSt.js.map +1 -0
- package/dist/{Item-C2YmSK8u.js → Item-DXgQOWw4.js} +2 -2
- package/dist/{Item-C2YmSK8u.js.map → Item-DXgQOWw4.js.map} +1 -1
- package/dist/{ItemProperty-paRxkEyi.js → ItemProperty-Dmpm-jKr.js} +2 -2
- package/dist/{ItemProperty-paRxkEyi.js.map → ItemProperty-Dmpm-jKr.js.map} +1 -1
- package/dist/{index-CvbP69-W.js → index-CreT8SAL.js} +16 -16
- package/dist/index-CreT8SAL.js.map +1 -0
- package/dist/{index-nUutMqms.js → index-hIQeW9Wa.js} +2 -2
- package/dist/index-hIQeW9Wa.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-DKZ-EtdB.js → seed.schema.config-CVCqLN-b.js} +2 -2
- package/dist/{seed.schema.config-DKZ-EtdB.js.map → seed.schema.config-CVCqLN-b.js.map} +1 -1
- package/dist/src/configureFs.ts +2 -2
- package/dist/src/getPublishPayload.ts +3 -3
- package/dist/src/helpers.ts +4 -4
- package/dist/src/saveImageSrc.ts +0 -15
- package/dist/types/src/ItemProperty/service/actors/saveValueToDb/saveImageSrc.d.ts.map +1 -1
- package/dist/types/src/browser/helpers/FileManager.d.ts +1 -0
- package/dist/types/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/FileManager-BGej9rn4.js.map +0 -1
- package/dist/index-CvbP69-W.js.map +0 -1
- package/dist/index-nUutMqms.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as Item } from './index-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
78
|
+
//# sourceMappingURL=seed.schema.config-CVCqLN-b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config-
|
|
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;;;;;"}
|
package/dist/src/configureFs.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const configureFs = fromCallback<
|
|
|
16
16
|
EventObject,
|
|
17
17
|
FromCallbackInput<InternalMachineContext>
|
|
18
18
|
>(({ sendBack, input: { context } }) => {
|
|
19
|
-
const { endpoints, appDbService } = context
|
|
19
|
+
const { endpoints, appDbService, filesDir, } = context
|
|
20
20
|
|
|
21
21
|
logger('[internal/actors] [configureFs] Configuring FS')
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ export const configureFs = fromCallback<
|
|
|
42
42
|
},
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
const journalPath = `${BROWSER_FS_TOP_DIR}/db/meta/_journal.json`
|
|
45
|
+
const journalPath = `${filesDir || BROWSER_FS_TOP_DIR}/db/meta/_journal.json`
|
|
46
46
|
|
|
47
47
|
const journalExists = await fs.promises.exists(journalPath)
|
|
48
48
|
|
|
@@ -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
|
|
package/dist/src/helpers.ts
CHANGED
|
@@ -112,8 +112,8 @@ export const fetchFilesRecursively = async (
|
|
|
112
112
|
localPath: string,
|
|
113
113
|
fileList: string[],
|
|
114
114
|
) => {
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
package/dist/src/saveImageSrc.ts
CHANGED
|
@@ -9,27 +9,12 @@ import { createSeed } from '@/db/write/createSeed'
|
|
|
9
9
|
import { getDataTypeFromString, getMimeType } from '@/helpers'
|
|
10
10
|
import { createVersion } from '@/db/write/createVersion'
|
|
11
11
|
import { fs } from '@zenfs/core'
|
|
12
|
-
import { getContentUrlFromPath } from '@/helpers'
|
|
13
12
|
import { createMetadata } from '@/db/write/createMetadata'
|
|
14
13
|
import { updateItemPropertyValue } from '@/db/write/updateItemPropertyValue'
|
|
15
14
|
import { getSchemaUidForSchemaDefinition } from '@/stores/eas'
|
|
16
15
|
import { getSchemaUidForModel } from '@/db/read/getSchemaUidForModel'
|
|
17
16
|
import { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'
|
|
18
17
|
|
|
19
|
-
const readFileAsDataUrl = async (file: File): Promise<string> => {
|
|
20
|
-
return new Promise((resolve) => {
|
|
21
|
-
const reader = new FileReader()
|
|
22
|
-
reader.onload = async (e) => {
|
|
23
|
-
const base64 = e.target.result.split(',')[1] // Extract the base64 string
|
|
24
|
-
const mimeType = file.type // Get the file's MIME type
|
|
25
|
-
const base64WithMimeType = `data:${mimeType};base64,${base64}`
|
|
26
|
-
|
|
27
|
-
resolve(base64WithMimeType)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
reader.readAsDataURL(file)
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
18
|
|
|
34
19
|
const readFileAsArrayBuffer = async (file: File): Promise<ArrayBuffer> => {
|
|
35
20
|
return new Promise((resolve) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveImageSrc.d.ts","sourceRoot":"","sources":["../../../../../../../src/ItemProperty/service/actors/saveValueToDb/saveImageSrc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAGL,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"saveImageSrc.d.ts","sourceRoot":"","sources":["../../../../../../../src/ItemProperty/service/actors/saveValueToDb/saveImageSrc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAGL,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AA+CzB,eAAO,MAAM,YAAY,2GA8KvB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseFileManager } from "@/helpers/FileManager/BaseFileManager";
|
|
2
2
|
declare class FileManager extends BaseFileManager {
|
|
3
3
|
static readFileAsBuffer(filePath: string): Promise<Buffer>;
|
|
4
|
+
static getContentUrlFromPath(path: string): Promise<string | undefined>;
|
|
4
5
|
}
|
|
5
6
|
export { FileManager };
|
|
6
7
|
//# sourceMappingURL=FileManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/FileManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,cAAM,WAAY,SAAQ,eAAe;WAC1B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/FileManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,cAAM,WAAY,SAAQ,eAAe;WAC1B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WAMnD,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAY9E;AAID,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileManager-BGej9rn4.js","sources":["../../src/browser/helpers/FileManager.ts"],"sourcesContent":["import { BaseFileManager } from \"@/helpers/FileManager/BaseFileManager\";\n\nclass FileManager extends BaseFileManager {\n static async readFileAsBuffer(filePath: string): Promise<Buffer> {\n // Implement browser-specific logic\n return new Promise((resolve, reject) => {\n reject(new Error('Not implemented'));\n });\n }\n\n // Implement other methods\n}\n\nBaseFileManager.setPlatformClass(FileManager);\n\nexport { FileManager };\n"],"names":[],"mappings":";;;;AAEA,MAAM,WAAY,SAAQ,eAAe,CAAA;IACvC,OAAa,gBAAgB,CAAC,QAAgB,EAAA;;;YAE5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,gBAAA,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACtC,aAAC,CAAC;SACH,CAAA;AAAA;AAGF;AAED,eAAe,CAAC,gBAAgB,CAAC,WAAW,CAAC;;;;"}
|