@seedprotocol/sdk 0.1.116 → 0.1.117
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-fACn9sTT.js → index-Dd6tPdUt.js} +7 -7
- package/dist/index-Dd6tPdUt.js.map +1 -0
- package/dist/{index-BtxxSQ3G.js → index-Dwb6l5UL.js} +4 -2
- package/dist/index-Dwb6l5UL.js.map +1 -0
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/{seed.schema.config-DLrHziQY.js → seed.schema.config-CPGWVSWI.js} +4 -2
- package/dist/seed.schema.config-CPGWVSWI.js.map +1 -0
- package/dist/src/migrate.ts +2 -5
- package/dist/src/seed.ts +31 -4
- package/dist/types/src/browser/services/db/actors/migrate.d.ts.map +1 -1
- package/dist/types/src/browser/services/db/dbMachine.d.ts +6 -6
- package/package.json +1 -1
- package/dist/index-BtxxSQ3G.js.map +0 -1
- package/dist/index-fACn9sTT.js.map +0 -1
- package/dist/seed.schema.config-DLrHziQY.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-Dd6tPdUt.js';
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'reflect-metadata';
|
|
@@ -25,9 +25,11 @@ import 'pluralize';
|
|
|
25
25
|
import '@statelyai/inspect';
|
|
26
26
|
import 'rxjs';
|
|
27
27
|
import 'drizzle-orm/sqlite-proxy';
|
|
28
|
+
import 'drizzle-orm/sqlite-proxy/migrator';
|
|
29
|
+
import 'drizzle-orm/migrator';
|
|
28
30
|
import '@zenfs/dom';
|
|
29
31
|
import 'arweave';
|
|
30
32
|
import './constants-B6s6tGup.js';
|
|
31
33
|
import '@ethereum-attestation-service/eas-sdk';
|
|
32
34
|
import 'thirdweb';
|
|
33
|
-
//# sourceMappingURL=index-
|
|
35
|
+
//# sourceMappingURL=index-Dwb6l5UL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dwb6l5UL.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-Dd6tPdUt.js';
|
|
2
2
|
import 'immer';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import 'tslib';
|
|
@@ -26,6 +26,8 @@ import 'pluralize';
|
|
|
26
26
|
import '@statelyai/inspect';
|
|
27
27
|
import 'rxjs';
|
|
28
28
|
import 'drizzle-orm/sqlite-proxy';
|
|
29
|
+
import 'drizzle-orm/sqlite-proxy/migrator';
|
|
30
|
+
import 'drizzle-orm/migrator';
|
|
29
31
|
import '@zenfs/dom';
|
|
30
32
|
import './constants-B6s6tGup.js';
|
|
31
33
|
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-
|
|
3
|
+
import { T as Text, M as Model } from './index-Dd6tPdUt.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'reflect-metadata';
|
|
6
6
|
import 'xstate';
|
|
@@ -27,6 +27,8 @@ import 'pluralize';
|
|
|
27
27
|
import '@statelyai/inspect';
|
|
28
28
|
import 'rxjs';
|
|
29
29
|
import 'drizzle-orm/sqlite-proxy';
|
|
30
|
+
import 'drizzle-orm/sqlite-proxy/migrator';
|
|
31
|
+
import 'drizzle-orm/migrator';
|
|
30
32
|
import './constants-B6s6tGup.js';
|
|
31
33
|
import '@ethereum-attestation-service/eas-sdk';
|
|
32
34
|
import 'thirdweb';
|
|
@@ -77,4 +79,4 @@ const models = {
|
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
export { models };
|
|
80
|
-
//# sourceMappingURL=seed.schema.config-
|
|
82
|
+
//# sourceMappingURL=seed.schema.config-CPGWVSWI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.schema.config-CPGWVSWI.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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ACP,QAAQ;;;;;"}
|
package/dist/src/migrate.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { drizzle } from 'drizzle-orm/sqlite-proxy'
|
|
|
9
9
|
import { sql } from 'drizzle-orm'
|
|
10
10
|
import { fs } from '@zenfs/core'
|
|
11
11
|
import debug from 'debug'
|
|
12
|
+
import { migrate as drizzleMigrate } from 'drizzle-orm/sqlite-proxy/migrator'
|
|
13
|
+
import { readMigrationFiles } from 'drizzle-orm/migrator'
|
|
12
14
|
|
|
13
15
|
const logger = debug('app:services:db:actors:migrate')
|
|
14
16
|
|
|
@@ -146,11 +148,6 @@ export const migrate = fromCallback<
|
|
|
146
148
|
},
|
|
147
149
|
)
|
|
148
150
|
|
|
149
|
-
const { migrate: drizzleMigrate } = await import(
|
|
150
|
-
'drizzle-orm/sqlite-proxy/migrator'
|
|
151
|
-
)
|
|
152
|
-
const { readMigrationFiles } = await import('drizzle-orm/migrator')
|
|
153
|
-
|
|
154
151
|
try {
|
|
155
152
|
const migrations = readMigrationFiles({
|
|
156
153
|
migrationsFolder: pathToDbDir,
|
package/dist/src/seed.ts
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isBrowser, isNode, isReactNative } from '@/shared/environment'
|
|
2
|
+
import { Endpoints, SeedConstructorOptions } from '@/types/types'
|
|
3
|
+
import { Subject } from 'rxjs'
|
|
3
4
|
|
|
4
|
-
|
|
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 {
|
|
5
32
|
constructor(props: SeedConstructorOptions) {
|
|
6
33
|
super(props)
|
|
7
34
|
}
|
|
8
35
|
}
|
|
9
36
|
|
|
10
|
-
export {
|
|
37
|
+
export { SeedBase, SeedSync }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/services/db/actors/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/services/db/actors/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAA;AAe/E,eAAO,MAAM,MAAM,kFAkElB,CAAA;AACD,eAAO,MAAM,OAAO,oGAuMlB,CAAA"}
|
|
@@ -2,11 +2,6 @@ import { DbServiceContext } from '@/types';
|
|
|
2
2
|
declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>, import("xstate").AnyEventObject, {
|
|
3
3
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>> | undefined;
|
|
4
4
|
}, import("xstate").Values<{
|
|
5
|
-
migrate: {
|
|
6
|
-
src: "migrate";
|
|
7
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
};
|
|
10
5
|
checkStatus: {
|
|
11
6
|
src: "checkStatus";
|
|
12
7
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
@@ -22,12 +17,12 @@ declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>
|
|
|
22
17
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
23
18
|
id: string | undefined;
|
|
24
19
|
};
|
|
25
|
-
}>, never, never, never, {}, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, import("xstate").MachineConfig<Partial<DbServiceContext>, import("xstate").AnyEventObject, import("xstate").Values<{
|
|
26
20
|
migrate: {
|
|
27
21
|
src: "migrate";
|
|
28
22
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
29
23
|
id: string | undefined;
|
|
30
24
|
};
|
|
25
|
+
}>, never, never, never, {}, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, import("xstate").MachineConfig<Partial<DbServiceContext>, import("xstate").AnyEventObject, import("xstate").Values<{
|
|
31
26
|
checkStatus: {
|
|
32
27
|
src: "checkStatus";
|
|
33
28
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
@@ -43,6 +38,11 @@ declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>
|
|
|
43
38
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
44
39
|
id: string | undefined;
|
|
45
40
|
};
|
|
41
|
+
migrate: {
|
|
42
|
+
src: "migrate";
|
|
43
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
44
|
+
id: string | undefined;
|
|
45
|
+
};
|
|
46
46
|
}>, never, never, never, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject>>;
|
|
47
47
|
export { dbMachine };
|
|
48
48
|
//# sourceMappingURL=dbMachine.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BtxxSQ3G.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|