@seedprotocol/sdk 0.1.88 → 0.1.89
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/{index-CtxwCE0C.js → index-BejZtiZ6.js} +15 -9
- package/dist/index-BejZtiZ6.js.map +1 -0
- package/dist/{index-DtqQJ3vS.js → index-CcE521Ay.js} +2 -2
- package/dist/{index-DtqQJ3vS.js.map → index-CcE521Ay.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-BL0wlKbs.js → seed.schema.config-CnfT1dNe.js} +2 -2
- package/dist/{seed.schema.config-BL0wlKbs.js.map → seed.schema.config-CnfT1dNe.js.map} +1 -1
- package/dist/src/index.ts +21 -4
- package/dist/src/read.ts +17 -17
- package/package.json +1 -1
- package/dist/index-CtxwCE0C.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-
|
|
1
|
+
export { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-BejZtiZ6.js';
|
|
2
2
|
import './constants-rmQ8zg8_.js';
|
|
3
3
|
import '@ethereum-attestation-service/eas-sdk';
|
|
4
4
|
import 'thirdweb';
|
|
@@ -29,4 +29,4 @@ import 'rxjs';
|
|
|
29
29
|
import 'drizzle-orm/sqlite-proxy';
|
|
30
30
|
import '@zenfs/dom';
|
|
31
31
|
import 'arweave';
|
|
32
|
-
//# sourceMappingURL=index-
|
|
32
|
+
//# sourceMappingURL=index-CcE521Ay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CcE521Ay.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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-
|
|
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-BejZtiZ6.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-
|
|
3
|
+
import { T as Text, M as Model } from './index-BejZtiZ6.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-
|
|
79
|
+
//# sourceMappingURL=seed.schema.config-CnfT1dNe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config-
|
|
1
|
+
{"version":3,"file":"seed.schema.config-CnfT1dNe.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/index.ts
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
})
|
package/dist/src/read.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropertyData } from '@/types'
|
|
2
2
|
import { startCase } from 'lodash-es'
|
|
3
3
|
import { metadata, MetadataType } from '@/shared/seedSchema'
|
|
4
|
-
import { and, eq, max, sql } from 'drizzle-orm'
|
|
4
|
+
import { and, eq, max, or, sql } from 'drizzle-orm'
|
|
5
5
|
import { getAppDb, runQueryForStatement } from '@/browser/db/sqlWasmClient'
|
|
6
6
|
|
|
7
7
|
export const getPropertyData = async (
|
|
@@ -11,29 +11,29 @@ export const getPropertyData = async (
|
|
|
11
11
|
): Promise<PropertyData | undefined> => {
|
|
12
12
|
const appDb = getAppDb()
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const whereClauses: any[] = [
|
|
15
|
+
or(
|
|
16
|
+
eq(metadata.propertyName, propertyName),
|
|
17
|
+
eq(metadata.propertyName, propertyName + 'Id'),
|
|
18
|
+
eq(metadata.propertyName, propertyName + 'Ids'),
|
|
19
|
+
),
|
|
20
|
+
]
|
|
15
21
|
|
|
16
22
|
if (seedLocalId) {
|
|
17
|
-
|
|
18
|
-
and(
|
|
19
|
-
eq(metadata.propertyName, propertyName),
|
|
20
|
-
eq(metadata.seedLocalId, seedLocalId),
|
|
21
|
-
),
|
|
22
|
-
)
|
|
23
|
+
whereClauses.push(eq(metadata.seedLocalId, seedLocalId))
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
if (seedUid) {
|
|
26
|
-
|
|
27
|
-
and(
|
|
28
|
-
eq(metadata.propertyName, propertyName),
|
|
29
|
-
eq(metadata.seedUid, seedUid),
|
|
30
|
-
),
|
|
31
|
-
)
|
|
27
|
+
whereClauses.push(eq(metadata.seedUid, seedUid))
|
|
32
28
|
}
|
|
33
29
|
|
|
34
|
-
const rows = (await
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
const rows = (await appDb
|
|
31
|
+
.select()
|
|
32
|
+
.from(metadata)
|
|
33
|
+
.where(and(...whereClauses))
|
|
34
|
+
.orderBy(
|
|
35
|
+
sql.raw(`COALESCE(attestation_created_at, created_at) DESC`),
|
|
36
|
+
)) as MetadataType[]
|
|
37
37
|
|
|
38
38
|
if (!rows || rows.length === 0) {
|
|
39
39
|
return
|