@seedprotocol/sdk 0.3.8 → 0.3.10
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/addModel.js +4 -0
- package/dist/addModel.js.map +1 -1
- package/dist/bin.js +182 -111
- package/dist/bin.js.map +1 -1
- package/dist/main.js +13 -1
- package/dist/main.js.map +1 -1
- package/dist/node/db/node.app.db.config.ts +7 -26
- package/dist/scripts/bin.d.ts +4 -4
- package/dist/scripts/bin.d.ts.map +1 -1
- package/dist/seedData.json +23 -0
- package/dist/src/Item/BaseItem.js +3 -3
- package/dist/src/Item/BaseItem.js.map +1 -1
- package/dist/src/ItemProperty/BaseItemProperty.d.ts +4 -1
- package/dist/src/ItemProperty/BaseItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/BaseItemProperty.js +65 -21
- package/dist/src/ItemProperty/BaseItemProperty.js.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.js +27 -17
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.js.map +1 -1
- package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/initialize.js +25 -20
- package/dist/src/ItemProperty/service/actors/initialize.js.map +1 -1
- package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.js +1 -1
- package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.js.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +11 -11
- package/dist/src/browser/Item/Item.js +0 -1
- package/dist/src/browser/Item/Item.js.map +1 -1
- package/dist/src/browser/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/browser/ItemProperty/ItemProperty.js +0 -1
- package/dist/src/browser/ItemProperty/ItemProperty.js.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/db/Db.js +35 -10
- package/dist/src/browser/db/Db.js.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts +3 -1
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.js +24 -12
- package/dist/src/browser/helpers/FileManager.js.map +1 -1
- package/dist/src/browser/helpers/eas.d.ts +20 -0
- package/dist/src/browser/helpers/eas.d.ts.map +1 -0
- package/dist/src/browser/helpers/eas.js +89 -0
- package/dist/src/browser/helpers/eas.js.map +1 -0
- package/dist/src/browser/index.d.ts +0 -1
- package/dist/src/browser/index.d.ts.map +1 -1
- package/dist/src/browser/react/SeedImage.d.ts +11 -0
- package/dist/src/browser/react/SeedImage.d.ts.map +1 -0
- package/dist/src/browser/react/SeedImage.js +105 -0
- package/dist/src/browser/react/SeedImage.js.map +1 -0
- package/dist/src/browser/react/index.d.ts +2 -1
- package/dist/src/browser/react/index.d.ts.map +1 -1
- package/dist/src/browser/react/item.d.ts +8 -8
- package/dist/src/browser/react/item.d.ts.map +1 -1
- package/dist/src/browser/react/item.js +9 -53
- package/dist/src/browser/react/item.js.map +1 -1
- package/dist/src/browser/react/model.d.ts +7 -0
- package/dist/src/browser/react/model.d.ts.map +1 -0
- package/dist/src/browser/react/model.js +20 -0
- package/dist/src/browser/react/model.js.map +1 -0
- package/dist/src/browser/react/property.d.ts +3 -3
- package/dist/src/browser/react/property.d.ts.map +1 -1
- package/dist/src/browser/react/property.js.map +1 -1
- package/dist/src/browser/react/services.d.ts.map +1 -1
- package/dist/src/browser/react/services.js +6 -1
- package/dist/src/browser/react/services.js.map +1 -1
- package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
- package/dist/src/browser/workers/FileDownloader.js +4 -1
- package/dist/src/browser/workers/FileDownloader.js.map +1 -1
- package/dist/src/browser/workers/ImageResizer.d.ts.map +1 -1
- package/dist/src/browser/workers/ImageResizer.js +1 -0
- package/dist/src/browser/workers/ImageResizer.js.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.js +4 -0
- package/dist/src/browser/workers/filesDownload.js.map +1 -1
- package/dist/src/browser/workers/imageResize.d.ts.map +1 -1
- package/dist/src/browser/workers/imageResize.js +4 -1
- package/dist/src/browser/workers/imageResize.js.map +1 -1
- package/dist/src/client/BaseClientManager.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts +184 -22
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/ClientManager.js +29 -0
- package/dist/src/client/ClientManager.js.map +1 -1
- package/dist/src/client/actors/initialize.d.ts +2 -2
- package/dist/src/client/actors/initialize.d.ts.map +1 -1
- package/dist/src/client/actors/initialize.js +9 -0
- package/dist/src/client/actors/initialize.js.map +1 -1
- package/dist/src/client/actors/saveAppState.js +3 -3
- package/dist/src/client/actors/saveAppState.js.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +86 -10
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.js +3 -1
- package/dist/src/client/clientManagerMachine.js.map +1 -1
- package/dist/src/db/read/getModelSchemas.d.ts +1 -2
- package/dist/src/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/src/db/read/getModelSchemas.js +1 -21
- package/dist/src/db/read/getModelSchemas.js.map +1 -1
- package/dist/src/db/read/getModels.d.ts +5 -0
- package/dist/src/db/read/getModels.d.ts.map +1 -0
- package/dist/src/db/read/getModels.js +16 -0
- package/dist/src/db/read/getModels.js.map +1 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.js +52 -14
- package/dist/src/db/read/getPublishPayload.js.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.js +34 -3
- package/dist/src/db/read/getPublishUploads.js.map +1 -1
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/files/download.js +0 -1
- package/dist/src/events/files/download.js.map +1 -1
- package/dist/src/events/files/index.d.ts.map +1 -1
- package/dist/src/events/files/index.js +0 -1
- package/dist/src/events/files/index.js.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.js +9 -28
- package/dist/src/events/item/syncDbWithEas.js.map +1 -1
- package/dist/src/events/services/allItems.d.ts.map +1 -1
- package/dist/src/events/services/allItems.js +0 -1
- package/dist/src/events/services/allItems.js.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts +2 -0
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.js +6 -0
- package/dist/src/helpers/FileManager/BaseFileManager.js.map +1 -1
- package/dist/src/helpers/constants.d.ts +2 -2
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/constants.js +14 -6
- package/dist/src/helpers/constants.js.map +1 -1
- package/dist/src/helpers/environment.js +1 -1
- package/dist/src/helpers/environment.js.map +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts +1 -0
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.js +6 -2
- package/dist/src/helpers/getSegmentedItemProperties.js.map +1 -1
- package/dist/src/helpers/index.d.ts +2 -1
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +3 -10
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/helpers/scripts.d.ts +2 -0
- package/dist/src/helpers/scripts.d.ts.map +1 -0
- package/dist/src/helpers/scripts.js +14 -0
- package/dist/src/helpers/scripts.js.map +1 -0
- package/dist/src/index.d.ts +11 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IItemProperty.d.ts +7 -0
- package/dist/src/interfaces/IItemProperty.d.ts.map +1 -1
- package/dist/src/node/PathResolver.d.ts +39 -0
- package/dist/src/node/PathResolver.d.ts.map +1 -0
- package/dist/src/node/PathResolver.js +150 -0
- package/dist/src/node/PathResolver.js.map +1 -0
- package/dist/src/node/codegen/drizzle.d.ts.map +1 -1
- package/dist/src/node/codegen/drizzle.js +25 -4
- package/dist/src/node/codegen/drizzle.js.map +1 -1
- package/dist/src/node/constants.d.ts +0 -11
- package/dist/src/node/constants.d.ts.map +1 -1
- package/dist/src/node/constants.js +1 -32
- package/dist/src/node/constants.js.map +1 -1
- package/dist/src/node/db/node.app.db.config.d.ts.map +1 -1
- package/dist/src/node/helpers/FileManager.d.ts +2 -0
- package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/node/helpers/index.d.ts.map +1 -1
- package/dist/src/node/helpers/index.js +0 -1
- package/dist/src/node/helpers/index.js.map +1 -1
- package/dist/src/schema/image/model.d.ts +8 -0
- package/dist/src/schema/image/model.d.ts.map +1 -0
- package/dist/src/schema/image/model.js +29 -0
- package/dist/src/schema/image/model.js.map +1 -0
- package/dist/src/schema/model/index.d.ts +8 -8
- package/dist/src/schema/property/index.d.ts +33 -45
- package/dist/src/schema/property/index.d.ts.map +1 -1
- package/dist/src/schema/property/index.js +0 -1
- package/dist/src/schema/property/index.js.map +1 -1
- package/dist/src/seedSchema/ConfigSchema.js +18 -0
- package/dist/src/seedSchema/ConfigSchema.js.map +1 -0
- package/dist/src/services/db/actors/migrate.js +2 -2
- package/dist/src/services/db/actors/migrate.js.map +1 -1
- package/dist/src/services/global/globalMachine.d.ts +90 -90
- package/dist/src/services/internal/helpers.js +3 -3
- package/dist/src/services/internal/helpers.js.map +1 -1
- package/dist/src/stores/eas.d.ts +12 -5
- package/dist/src/stores/eas.d.ts.map +1 -1
- package/dist/src/stores/eas.js +13 -8
- package/dist/src/stores/eas.js.map +1 -1
- package/dist/src/stores/modelClass.d.ts.map +1 -1
- package/dist/src/stores/modelClass.js.map +1 -1
- package/dist/src/types/model.d.ts +2 -15
- package/dist/src/types/model.d.ts.map +1 -1
- package/package.json +8 -7
- package/dist/src/Item/index.d.ts +0 -5
- package/dist/src/Item/index.d.ts.map +0 -1
- package/dist/src/Item/index.js +0 -4
- package/dist/src/Item/index.js.map +0 -1
- package/dist/src/ItemProperty/index.d.ts +0 -5
- package/dist/src/ItemProperty/index.d.ts.map +0 -1
- package/dist/src/ItemProperty/service/actors/index.d.ts +0 -4
- package/dist/src/ItemProperty/service/actors/index.d.ts.map +0 -1
- package/dist/src/browser/Item/index.d.ts +0 -2
- package/dist/src/browser/Item/index.d.ts.map +0 -1
- package/dist/src/browser/Item/index.js +0 -2
- package/dist/src/browser/Item/index.js.map +0 -1
- package/dist/src/browser/ItemProperty/index.d.ts +0 -2
- package/dist/src/browser/ItemProperty/index.d.ts.map +0 -1
|
@@ -2,18 +2,18 @@ import { ActorRefFrom } from 'xstate';
|
|
|
2
2
|
import { GlobalState, MachineIds } from '@/services/internal/constants';
|
|
3
3
|
import { GlobalMachineContext } from '@/types';
|
|
4
4
|
declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext, import("xstate").AnyEventObject, {
|
|
5
|
-
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
5
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>> | undefined;
|
|
6
6
|
}, import("xstate").Values<{
|
|
7
|
-
initialize: {
|
|
8
|
-
src: "initialize";
|
|
9
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
10
|
-
id: string | undefined;
|
|
11
|
-
};
|
|
12
7
|
getSchemaForModel: {
|
|
13
8
|
src: "getSchemaForModel";
|
|
14
9
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
15
10
|
id: string | undefined;
|
|
16
11
|
};
|
|
12
|
+
initialize: {
|
|
13
|
+
src: "initialize";
|
|
14
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
15
|
+
id: string | undefined;
|
|
16
|
+
};
|
|
17
17
|
addModelsToDb: {
|
|
18
18
|
src: "addModelsToDb";
|
|
19
19
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -29,13 +29,13 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
29
29
|
readonly initial: GlobalState.UNINITIALIZED;
|
|
30
30
|
readonly context: ({ input }: {
|
|
31
31
|
spawn: {
|
|
32
|
-
<TSrc extends "
|
|
33
|
-
src: "
|
|
34
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
32
|
+
<TSrc extends "getSchemaForModel" | "initialize" | "addModelsToDb" | "savePublishService">(logic: TSrc, ...[options]: ({
|
|
33
|
+
src: "getSchemaForModel";
|
|
34
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
35
35
|
id: string | undefined;
|
|
36
36
|
} extends infer T ? T extends {
|
|
37
|
-
src: "
|
|
38
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
37
|
+
src: "getSchemaForModel";
|
|
38
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
39
39
|
id: string | undefined;
|
|
40
40
|
} ? T extends {
|
|
41
41
|
src: TSrc;
|
|
@@ -45,12 +45,12 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
45
45
|
input?: import("xstate").InputFrom<T["logic"]> | undefined;
|
|
46
46
|
syncSnapshot?: boolean;
|
|
47
47
|
} & { [K in import("xstate").RequiredActorOptions<T>]: unknown; }) | undefined], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T>>> : never : never : never) | ({
|
|
48
|
-
src: "
|
|
49
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
48
|
+
src: "initialize";
|
|
49
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
50
50
|
id: string | undefined;
|
|
51
51
|
} extends infer T_1 ? T_1 extends {
|
|
52
|
-
src: "
|
|
53
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
52
|
+
src: "initialize";
|
|
53
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
54
54
|
id: string | undefined;
|
|
55
55
|
} ? T_1 extends {
|
|
56
56
|
src: TSrc;
|
|
@@ -90,16 +90,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
90
90
|
input?: import("xstate").InputFrom<T_3["logic"]> | undefined;
|
|
91
91
|
syncSnapshot?: boolean;
|
|
92
92
|
} & { [K_3 in import("xstate").RequiredActorOptions<T_3>]: unknown; }) | undefined], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T_3>>> : never : never : never)): import("xstate").ActorRefFromLogic<import("xstate").GetConcreteByKey<import("xstate").Values<{
|
|
93
|
-
initialize: {
|
|
94
|
-
src: "initialize";
|
|
95
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
96
|
-
id: string | undefined;
|
|
97
|
-
};
|
|
98
93
|
getSchemaForModel: {
|
|
99
94
|
src: "getSchemaForModel";
|
|
100
95
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
101
96
|
id: string | undefined;
|
|
102
97
|
};
|
|
98
|
+
initialize: {
|
|
99
|
+
src: "initialize";
|
|
100
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
101
|
+
id: string | undefined;
|
|
102
|
+
};
|
|
103
103
|
addModelsToDb: {
|
|
104
104
|
src: "addModelsToDb";
|
|
105
105
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -132,16 +132,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
132
132
|
readonly init: {
|
|
133
133
|
readonly target: GlobalState.INITIALIZING;
|
|
134
134
|
readonly actions: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
135
|
-
initialize: {
|
|
136
|
-
src: "initialize";
|
|
137
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
138
|
-
id: string | undefined;
|
|
139
|
-
};
|
|
140
135
|
getSchemaForModel: {
|
|
141
136
|
src: "getSchemaForModel";
|
|
142
137
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
143
138
|
id: string | undefined;
|
|
144
139
|
};
|
|
140
|
+
initialize: {
|
|
141
|
+
src: "initialize";
|
|
142
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
143
|
+
id: string | undefined;
|
|
144
|
+
};
|
|
145
145
|
addModelsToDb: {
|
|
146
146
|
src: "addModelsToDb";
|
|
147
147
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -165,16 +165,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
165
165
|
readonly on: {
|
|
166
166
|
readonly [x: string]: GlobalState.ADDING_MODELS_TO_DB | {
|
|
167
167
|
readonly actions: import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
168
|
-
initialize: {
|
|
169
|
-
src: "initialize";
|
|
170
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
171
|
-
id: string | undefined;
|
|
172
|
-
};
|
|
173
168
|
getSchemaForModel: {
|
|
174
169
|
src: "getSchemaForModel";
|
|
175
170
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
176
171
|
id: string | undefined;
|
|
177
172
|
};
|
|
173
|
+
initialize: {
|
|
174
|
+
src: "initialize";
|
|
175
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
176
|
+
id: string | undefined;
|
|
177
|
+
};
|
|
178
178
|
addModelsToDb: {
|
|
179
179
|
src: "addModelsToDb";
|
|
180
180
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -188,16 +188,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
188
188
|
}>, never, never, never, never>;
|
|
189
189
|
} | {
|
|
190
190
|
readonly actions: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
191
|
-
initialize: {
|
|
192
|
-
src: "initialize";
|
|
193
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
194
|
-
id: string | undefined;
|
|
195
|
-
};
|
|
196
191
|
getSchemaForModel: {
|
|
197
192
|
src: "getSchemaForModel";
|
|
198
193
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
199
194
|
id: string | undefined;
|
|
200
195
|
};
|
|
196
|
+
initialize: {
|
|
197
|
+
src: "initialize";
|
|
198
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
199
|
+
id: string | undefined;
|
|
200
|
+
};
|
|
201
201
|
addModelsToDb: {
|
|
202
202
|
src: "addModelsToDb";
|
|
203
203
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -233,16 +233,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
233
233
|
readonly [x: string]: {
|
|
234
234
|
readonly target: GlobalState.INITIALIZED;
|
|
235
235
|
readonly actions: import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
236
|
-
initialize: {
|
|
237
|
-
src: "initialize";
|
|
238
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
239
|
-
id: string | undefined;
|
|
240
|
-
};
|
|
241
236
|
getSchemaForModel: {
|
|
242
237
|
src: "getSchemaForModel";
|
|
243
238
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
244
239
|
id: string | undefined;
|
|
245
240
|
};
|
|
241
|
+
initialize: {
|
|
242
|
+
src: "initialize";
|
|
243
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
244
|
+
id: string | undefined;
|
|
245
|
+
};
|
|
246
246
|
addModelsToDb: {
|
|
247
247
|
src: "addModelsToDb";
|
|
248
248
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -281,16 +281,16 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
281
281
|
readonly publishingItem: {
|
|
282
282
|
readonly target: GlobalState.INITIALIZED;
|
|
283
283
|
readonly entry: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
284
|
-
initialize: {
|
|
285
|
-
src: "initialize";
|
|
286
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
287
|
-
id: string | undefined;
|
|
288
|
-
};
|
|
289
284
|
getSchemaForModel: {
|
|
290
285
|
src: "getSchemaForModel";
|
|
291
286
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
292
287
|
id: string | undefined;
|
|
293
288
|
};
|
|
289
|
+
initialize: {
|
|
290
|
+
src: "initialize";
|
|
291
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
292
|
+
id: string | undefined;
|
|
293
|
+
};
|
|
294
294
|
addModelsToDb: {
|
|
295
295
|
src: "addModelsToDb";
|
|
296
296
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -330,18 +330,18 @@ declare const globalMachine: import("xstate").StateMachine<GlobalMachineContext,
|
|
|
330
330
|
};
|
|
331
331
|
}>;
|
|
332
332
|
declare const globalService: import("xstate").Actor<import("xstate").StateMachine<GlobalMachineContext, import("xstate").AnyEventObject, {
|
|
333
|
-
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
333
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>> | undefined;
|
|
334
334
|
}, import("xstate").Values<{
|
|
335
|
-
initialize: {
|
|
336
|
-
src: "initialize";
|
|
337
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
338
|
-
id: string | undefined;
|
|
339
|
-
};
|
|
340
335
|
getSchemaForModel: {
|
|
341
336
|
src: "getSchemaForModel";
|
|
342
337
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
343
338
|
id: string | undefined;
|
|
344
339
|
};
|
|
340
|
+
initialize: {
|
|
341
|
+
src: "initialize";
|
|
342
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
343
|
+
id: string | undefined;
|
|
344
|
+
};
|
|
345
345
|
addModelsToDb: {
|
|
346
346
|
src: "addModelsToDb";
|
|
347
347
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -357,13 +357,13 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
357
357
|
readonly initial: GlobalState.UNINITIALIZED;
|
|
358
358
|
readonly context: ({ input }: {
|
|
359
359
|
spawn: {
|
|
360
|
-
<TSrc extends "
|
|
361
|
-
src: "
|
|
362
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
360
|
+
<TSrc extends "getSchemaForModel" | "initialize" | "addModelsToDb" | "savePublishService">(logic: TSrc, ...[options]: ({
|
|
361
|
+
src: "getSchemaForModel";
|
|
362
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
363
363
|
id: string | undefined;
|
|
364
364
|
} extends infer T ? T extends {
|
|
365
|
-
src: "
|
|
366
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
365
|
+
src: "getSchemaForModel";
|
|
366
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
367
367
|
id: string | undefined;
|
|
368
368
|
} ? T extends {
|
|
369
369
|
src: TSrc;
|
|
@@ -373,12 +373,12 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
373
373
|
input?: import("xstate").InputFrom<T["logic"]> | undefined;
|
|
374
374
|
syncSnapshot?: boolean;
|
|
375
375
|
} & { [K in import("xstate").RequiredActorOptions<T>]: unknown; }) | undefined], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T>>> : never : never : never) | ({
|
|
376
|
-
src: "
|
|
377
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
376
|
+
src: "initialize";
|
|
377
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
378
378
|
id: string | undefined;
|
|
379
379
|
} extends infer T_1 ? T_1 extends {
|
|
380
|
-
src: "
|
|
381
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("
|
|
380
|
+
src: "initialize";
|
|
381
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
382
382
|
id: string | undefined;
|
|
383
383
|
} ? T_1 extends {
|
|
384
384
|
src: TSrc;
|
|
@@ -418,16 +418,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
418
418
|
input?: import("xstate").InputFrom<T_3["logic"]> | undefined;
|
|
419
419
|
syncSnapshot?: boolean;
|
|
420
420
|
} & { [K_3 in import("xstate").RequiredActorOptions<T_3>]: unknown; }) | undefined], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T_3>>> : never : never : never)): import("xstate").ActorRefFromLogic<import("xstate").GetConcreteByKey<import("xstate").Values<{
|
|
421
|
-
initialize: {
|
|
422
|
-
src: "initialize";
|
|
423
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
424
|
-
id: string | undefined;
|
|
425
|
-
};
|
|
426
421
|
getSchemaForModel: {
|
|
427
422
|
src: "getSchemaForModel";
|
|
428
423
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
429
424
|
id: string | undefined;
|
|
430
425
|
};
|
|
426
|
+
initialize: {
|
|
427
|
+
src: "initialize";
|
|
428
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
429
|
+
id: string | undefined;
|
|
430
|
+
};
|
|
431
431
|
addModelsToDb: {
|
|
432
432
|
src: "addModelsToDb";
|
|
433
433
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -460,16 +460,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
460
460
|
readonly init: {
|
|
461
461
|
readonly target: GlobalState.INITIALIZING;
|
|
462
462
|
readonly actions: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
463
|
-
initialize: {
|
|
464
|
-
src: "initialize";
|
|
465
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
466
|
-
id: string | undefined;
|
|
467
|
-
};
|
|
468
463
|
getSchemaForModel: {
|
|
469
464
|
src: "getSchemaForModel";
|
|
470
465
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
471
466
|
id: string | undefined;
|
|
472
467
|
};
|
|
468
|
+
initialize: {
|
|
469
|
+
src: "initialize";
|
|
470
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
471
|
+
id: string | undefined;
|
|
472
|
+
};
|
|
473
473
|
addModelsToDb: {
|
|
474
474
|
src: "addModelsToDb";
|
|
475
475
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -493,16 +493,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
493
493
|
readonly on: {
|
|
494
494
|
readonly [x: string]: GlobalState.ADDING_MODELS_TO_DB | {
|
|
495
495
|
readonly actions: import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
496
|
-
initialize: {
|
|
497
|
-
src: "initialize";
|
|
498
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
499
|
-
id: string | undefined;
|
|
500
|
-
};
|
|
501
496
|
getSchemaForModel: {
|
|
502
497
|
src: "getSchemaForModel";
|
|
503
498
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
504
499
|
id: string | undefined;
|
|
505
500
|
};
|
|
501
|
+
initialize: {
|
|
502
|
+
src: "initialize";
|
|
503
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
504
|
+
id: string | undefined;
|
|
505
|
+
};
|
|
506
506
|
addModelsToDb: {
|
|
507
507
|
src: "addModelsToDb";
|
|
508
508
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -516,16 +516,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
516
516
|
}>, never, never, never, never>;
|
|
517
517
|
} | {
|
|
518
518
|
readonly actions: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
519
|
-
initialize: {
|
|
520
|
-
src: "initialize";
|
|
521
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
522
|
-
id: string | undefined;
|
|
523
|
-
};
|
|
524
519
|
getSchemaForModel: {
|
|
525
520
|
src: "getSchemaForModel";
|
|
526
521
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
527
522
|
id: string | undefined;
|
|
528
523
|
};
|
|
524
|
+
initialize: {
|
|
525
|
+
src: "initialize";
|
|
526
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
527
|
+
id: string | undefined;
|
|
528
|
+
};
|
|
529
529
|
addModelsToDb: {
|
|
530
530
|
src: "addModelsToDb";
|
|
531
531
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -561,16 +561,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
561
561
|
readonly [x: string]: {
|
|
562
562
|
readonly target: GlobalState.INITIALIZED;
|
|
563
563
|
readonly actions: import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
564
|
-
initialize: {
|
|
565
|
-
src: "initialize";
|
|
566
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
567
|
-
id: string | undefined;
|
|
568
|
-
};
|
|
569
564
|
getSchemaForModel: {
|
|
570
565
|
src: "getSchemaForModel";
|
|
571
566
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
572
567
|
id: string | undefined;
|
|
573
568
|
};
|
|
569
|
+
initialize: {
|
|
570
|
+
src: "initialize";
|
|
571
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
572
|
+
id: string | undefined;
|
|
573
|
+
};
|
|
574
574
|
addModelsToDb: {
|
|
575
575
|
src: "addModelsToDb";
|
|
576
576
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -609,16 +609,16 @@ declare const globalService: import("xstate").Actor<import("xstate").StateMachin
|
|
|
609
609
|
readonly publishingItem: {
|
|
610
610
|
readonly target: GlobalState.INITIALIZED;
|
|
611
611
|
readonly entry: readonly [import("xstate").ActionFunction<GlobalMachineContext, import("xstate").AnyEventObject, import("xstate").AnyEventObject, undefined, import("xstate").Values<{
|
|
612
|
-
initialize: {
|
|
613
|
-
src: "initialize";
|
|
614
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
615
|
-
id: string | undefined;
|
|
616
|
-
};
|
|
617
612
|
getSchemaForModel: {
|
|
618
613
|
src: "getSchemaForModel";
|
|
619
614
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("@/types").GetSchemaForModelEvent>, import("xstate").EventObject>;
|
|
620
615
|
id: string | undefined;
|
|
621
616
|
};
|
|
617
|
+
initialize: {
|
|
618
|
+
src: "initialize";
|
|
619
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext, import("xstate").EventObject>, import("xstate").EventObject>;
|
|
620
|
+
id: string | undefined;
|
|
621
|
+
};
|
|
622
622
|
addModelsToDb: {
|
|
623
623
|
src: "addModelsToDb";
|
|
624
624
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<GlobalMachineContext>, import("xstate").EventObject>;
|
|
@@ -12,7 +12,7 @@ const createDirectories = async (dirPath) => {
|
|
|
12
12
|
if (dirPathExists) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
const parentDir =
|
|
15
|
+
const parentDir = BaseFileManager.getParentDirPath(dirPath);
|
|
16
16
|
let parentDirExists = await BaseFileManager.pathExists(parentDir);
|
|
17
17
|
if (!parentDirExists) {
|
|
18
18
|
await createDirectories(parentDir);
|
|
@@ -37,9 +37,9 @@ class FileDownloadManager {
|
|
|
37
37
|
console.error(`No file data from ${url}`);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
const localDirPath =
|
|
40
|
+
const localDirPath = BaseFileManager.getParentDirPath(localFilePath);
|
|
41
41
|
await createDirectories(localDirPath);
|
|
42
|
-
const filename =
|
|
42
|
+
const filename = BaseFileManager.getFilenameFromPath(localFilePath);
|
|
43
43
|
const regex = /(\d+)[\w_]+\.(sql|json)$/;
|
|
44
44
|
const match = filename.match(regex);
|
|
45
45
|
let migrationNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../src/services/internal/helpers.ts"],"sourcesContent":["import path from 'path'\nimport { Endpoints } from '@/types'\nimport debug from 'debug'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\n\nconst logger = debug('seedSdk:services:internal:helpers')\n\n/**\n * Recursively create directories if they don't exist.\n * @param {string} dirPath - The directory path to create.\n */\nexport const createDirectories = async (dirPath: string) => {\n const dirPathExists = await BaseFileManager.pathExists(dirPath)\n if (dirPathExists) {\n return\n }\n\n const parentDir = path.dirname(dirPath)\n let parentDirExists = await BaseFileManager.pathExists(parentDir)\n if (!parentDirExists) {\n await createDirectories(parentDir)\n }\n\n parentDirExists = await BaseFileManager.pathExists(parentDir)\n if (parentDirExists) {\n await BaseFileManager.createDirIfNotExists(dirPath)\n }\n}\n\n// export const downloadFile = async (url: string, localFilePath: string) => {\n// try {\n// const response = await fetch(url)\n// const fileData = await response.text().catch((error) => {\n// console.error(`Failed to parse text from ${url}:`, error)\n// })\n// if (!fileData) {\n// console.error(`No file data from ${url}`)\n// return\n// }\n// const localDirPath = path.dirname(localFilePath)\n\n// if (busy) {\n// return\n// }\n\n// busy = true\n\n// await createDirectories(localDirPath)\n\n// const filename = path.basename(localFilePath)\n\n// const regex = /(\\d+)[\\w_]+\\.(sql|json)$/\n\n// const match = filename.match(regex)\n\n// let migrationNumber\n\n// if (match && match.length > 1) {\n// migrationNumber = match[1]\n// }\n\n// if (migrationNumber) {\n// const filesInDir = await fs.promises.readdir(localDirPath)\n// for (const file of filesInDir) {\n// if (file === filename) {\n// continue\n// }\n// const innerMatch = file.match(regex)\n// let existingFileMigrationNumber\n// if (innerMatch && innerMatch.length > 1) {\n// existingFileMigrationNumber = innerMatch[1]\n// }\n// if (\n// migrationNumber &&\n// existingFileMigrationNumber &&\n// existingFileMigrationNumber === migrationNumber\n// ) {\n// await fs.promises.unlink(path.join(localDirPath, file))\n// }\n// }\n// }\n\n// try {\n\n// await fs.promises.writeFile(localFilePath, fileData)\n// logger(`[downloadFile] Wrote file async to ${localFilePath}`)\n// } catch (error) {\n// fs.writeFileSync(localFilePath, fileData)\n// logger(`[downloadFile] Wrote file sync to ${localFilePath}`)\n// }\n// } catch (error) {\n// logger(`[Error] Failed to download file from ${url}:`, error)\n// }\n\n// busy = false\n// }\n\ntype DownloadFunction = (fileUrl: string) => Promise<void>;\n\nclass FileDownloadManager {\n private filesToDownload: Map<string, number>;\n private maxRetries: number;\n private isDownloading: boolean = false;\n\n constructor(fileUrls: string[], maxRetries: number) {\n this.filesToDownload = new Map(fileUrls.map(url => [url, 0]));\n this.maxRetries = maxRetries;\n }\n\n async downloadFile(url: string, localFilePath: string): Promise<void> {\n const response = await fetch(url)\n const fileData = await response.text().catch((error) => {\n console.error(`Failed to parse text from ${url}:`, error)\n })\n if (!fileData) {\n console.error(`No file data from ${url}`)\n return\n }\n const localDirPath = path.dirname(localFilePath)\n \n await createDirectories(localDirPath)\n \n const filename = path.basename(localFilePath)\n \n const regex = /(\\d+)[\\w_]+\\.(sql|json)$/\n \n const match = filename.match(regex)\n \n let migrationNumber\n \n if (match && match.length > 1) {\n migrationNumber = match[1]\n }\n \n if (migrationNumber) {\n const fs = await BaseFileManager.getFs()\n const filesInDir = await fs.promises.readdir(localDirPath)\n for (const file of filesInDir) {\n if (file === filename) {\n continue\n }\n const innerMatch = file.match(regex)\n let existingFileMigrationNumber\n if (innerMatch && innerMatch.length > 1) {\n existingFileMigrationNumber = innerMatch[1]\n }\n if (\n migrationNumber &&\n existingFileMigrationNumber &&\n existingFileMigrationNumber === migrationNumber\n ) {\n await fs.promises.unlink(path.join(localDirPath, file))\n }\n }\n }\n \n try {\n const fs = await BaseFileManager.getFs()\n await fs.promises.writeFile(localFilePath, fileData)\n logger(`[downloadFile] Wrote file async to ${localFilePath}`)\n } catch (error) {\n const fs = await BaseFileManager.getFs()\n fs.writeFileSync(localFilePath, fileData)\n logger(`[downloadFile] Wrote file sync to ${localFilePath}`)\n }\n \n }\n\n async start(): Promise<void> {\n if (this.isDownloading) {\n console.warn(\"Download process is already running.\");\n return;\n }\n\n this.isDownloading = true;\n\n for (const [fileUrl, attempts] of this.filesToDownload.entries()) {\n let success = false;\n\n while (attempts < this.maxRetries) {\n try {\n console.log(`Starting download: ${fileUrl}`);\n await this.downloadFile(fileUrl, fileUrl);\n console.log(`Download successful: ${fileUrl}`);\n this.filesToDownload.delete(fileUrl);\n success = true;\n break; // Move to next file\n } catch (error) {\n logger(`Error downloading ${fileUrl}:`, error);\n this.filesToDownload.set(fileUrl, attempts + 1);\n }\n }\n\n if (!success) {\n console.error(`Failed to download after ${this.maxRetries} attempts: ${fileUrl}`);\n }\n }\n\n this.isDownloading = false;\n console.log(\"All downloads completed.\");\n }\n\n addFile(fileUrl: string): void {\n if (!this.filesToDownload.has(fileUrl)) {\n this.filesToDownload.set(fileUrl, 0);\n console.log(`Added file to download queue: ${fileUrl}`);\n } else {\n console.warn(`File already in queue: ${fileUrl}`);\n }\n }\n\n getPendingFiles(): string[] {\n return Array.from(this.filesToDownload.keys());\n }\n\n clear(): void {\n this.filesToDownload.clear();\n console.log(\"Cleared all files from the download queue.\");\n }\n}\n\n\nexport const fetchDirectory = async (url: string) => {\n const response = await fetch(url)\n return response.json()\n}\n\n// export const fetchFilesRecursively = async (\n// url: string,\n// localPath: string,\n// fileList: string[],\n// ) => {\n// for (const file of fileList) {\n// try {\n// const fileUrl = `${url}/${file}`\n// const fileLocalPath = path.join(localPath, file)\n\n// // logger(`[fetchFilesRecursively] fileUrl: ${fileUrl}`)\n// // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)\n\n// await downloadFile(fileUrl, fileLocalPath)\n// } catch (error) {\n// console.error(`Failed to fetch files from ${url}:`, error)\n// }\n// }\n// }\n\nexport const confirmFilesExist = async (filePaths: string[]) => {\n let everythingDownloaded = false\n\n for (const filePath of filePaths) {\n const fs = await BaseFileManager.getFs()\n everythingDownloaded = await fs.promises.exists(filePath)\n }\n\n if (!everythingDownloaded) {\n setTimeout(async () => {\n await confirmFilesExist(filePaths)\n }, 500)\n }\n}\n\nconst filesToExclude = ['.DS_Store']\n\nexport const syncDbFiles = async ({ filePaths, files }: Endpoints) => {\n let fileList = await fetchDirectory(filePaths)\n fileList = fileList.filter((file: string) => !filesToExclude.includes(file))\n fileList = fileList.map((file: string) => `${files}/${file}`)\n const downloadManager = new FileDownloadManager(fileList, 5)\n await downloadManager.start()\n // await fetchFilesRecursively(files, BROWSER_FS_TOP_DIR, fileList)\n await confirmFilesExist(fileList)\n logger('[syncDbFiles] Files synced!')\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,MAAM,GAAG,KAAK,CAAC,mCAAmC,CAAC;AAEzD;;;AAGG;MACU,iBAAiB,GAAG,OAAO,OAAe,KAAI;IACzD,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC;IAC/D,IAAI,aAAa,EAAE;QACjB;;IAGF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IACvC,IAAI,eAAe,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;IACjE,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,MAAM,iBAAiB,CAAC,SAAS,CAAC;;IAGpC,eAAe,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;IAC7D,IAAI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C,CAAC,IAAY,KAAK,GAAG,KAAK,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC;IAC7D,MAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC5D,IAAA,MAAM,eAAe,CAAC,KAAK,EAAE;;AAE7B,IAAA,MAAM,iBAAiB,CAAC,QAAQ,CAAC;IACjC,MAAM,CAAC,6BAA6B,CAAC;AACvC;;;;"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../src/services/internal/helpers.ts"],"sourcesContent":["import path from 'path'\nimport { Endpoints } from '@/types'\nimport debug from 'debug'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\n\nconst logger = debug('seedSdk:services:internal:helpers')\n\n/**\n * Recursively create directories if they don't exist.\n * @param {string} dirPath - The directory path to create.\n */\nexport const createDirectories = async (dirPath: string) => {\n const dirPathExists = await BaseFileManager.pathExists(dirPath)\n if (dirPathExists) {\n return\n }\n\n const parentDir = BaseFileManager.getParentDirPath(dirPath)\n let parentDirExists = await BaseFileManager.pathExists(parentDir)\n if (!parentDirExists) {\n await createDirectories(parentDir)\n }\n\n parentDirExists = await BaseFileManager.pathExists(parentDir)\n if (parentDirExists) {\n await BaseFileManager.createDirIfNotExists(dirPath)\n }\n}\n\n// export const downloadFile = async (url: string, localFilePath: string) => {\n// try {\n// const response = await fetch(url)\n// const fileData = await response.text().catch((error) => {\n// console.error(`Failed to parse text from ${url}:`, error)\n// })\n// if (!fileData) {\n// console.error(`No file data from ${url}`)\n// return\n// }\n// const localDirPath = path.dirname(localFilePath)\n\n// if (busy) {\n// return\n// }\n\n// busy = true\n\n// await createDirectories(localDirPath)\n\n// const filename = path.basename(localFilePath)\n\n// const regex = /(\\d+)[\\w_]+\\.(sql|json)$/\n\n// const match = filename.match(regex)\n\n// let migrationNumber\n\n// if (match && match.length > 1) {\n// migrationNumber = match[1]\n// }\n\n// if (migrationNumber) {\n// const filesInDir = await fs.promises.readdir(localDirPath)\n// for (const file of filesInDir) {\n// if (file === filename) {\n// continue\n// }\n// const innerMatch = file.match(regex)\n// let existingFileMigrationNumber\n// if (innerMatch && innerMatch.length > 1) {\n// existingFileMigrationNumber = innerMatch[1]\n// }\n// if (\n// migrationNumber &&\n// existingFileMigrationNumber &&\n// existingFileMigrationNumber === migrationNumber\n// ) {\n// await fs.promises.unlink(path.join(localDirPath, file))\n// }\n// }\n// }\n\n// try {\n\n// await fs.promises.writeFile(localFilePath, fileData)\n// logger(`[downloadFile] Wrote file async to ${localFilePath}`)\n// } catch (error) {\n// fs.writeFileSync(localFilePath, fileData)\n// logger(`[downloadFile] Wrote file sync to ${localFilePath}`)\n// }\n// } catch (error) {\n// logger(`[Error] Failed to download file from ${url}:`, error)\n// }\n\n// busy = false\n// }\n\ntype DownloadFunction = (fileUrl: string) => Promise<void>;\n\nclass FileDownloadManager {\n private filesToDownload: Map<string, number>;\n private maxRetries: number;\n private isDownloading: boolean = false;\n\n constructor(fileUrls: string[], maxRetries: number) {\n this.filesToDownload = new Map(fileUrls.map(url => [url, 0]));\n this.maxRetries = maxRetries;\n }\n\n async downloadFile(url: string, localFilePath: string): Promise<void> {\n const response = await fetch(url)\n const fileData = await response.text().catch((error) => {\n console.error(`Failed to parse text from ${url}:`, error)\n })\n if (!fileData) {\n console.error(`No file data from ${url}`)\n return\n }\n const localDirPath = BaseFileManager.getParentDirPath(localFilePath)\n \n await createDirectories(localDirPath)\n \n const filename = BaseFileManager.getFilenameFromPath(localFilePath)\n \n const regex = /(\\d+)[\\w_]+\\.(sql|json)$/\n \n const match = filename.match(regex)\n \n let migrationNumber\n \n if (match && match.length > 1) {\n migrationNumber = match[1]\n }\n \n if (migrationNumber) {\n const fs = await BaseFileManager.getFs()\n const filesInDir = await fs.promises.readdir(localDirPath)\n for (const file of filesInDir) {\n if (file === filename) {\n continue\n }\n const innerMatch = file.match(regex)\n let existingFileMigrationNumber\n if (innerMatch && innerMatch.length > 1) {\n existingFileMigrationNumber = innerMatch[1]\n }\n if (\n migrationNumber &&\n existingFileMigrationNumber &&\n existingFileMigrationNumber === migrationNumber\n ) {\n await fs.promises.unlink(path.join(localDirPath, file))\n }\n }\n }\n \n try {\n const fs = await BaseFileManager.getFs()\n await fs.promises.writeFile(localFilePath, fileData)\n logger(`[downloadFile] Wrote file async to ${localFilePath}`)\n } catch (error) {\n const fs = await BaseFileManager.getFs()\n fs.writeFileSync(localFilePath, fileData)\n logger(`[downloadFile] Wrote file sync to ${localFilePath}`)\n }\n \n }\n\n async start(): Promise<void> {\n if (this.isDownloading) {\n console.warn(\"Download process is already running.\");\n return;\n }\n\n this.isDownloading = true;\n\n for (const [fileUrl, attempts] of this.filesToDownload.entries()) {\n let success = false;\n\n while (attempts < this.maxRetries) {\n try {\n console.log(`Starting download: ${fileUrl}`);\n await this.downloadFile(fileUrl, fileUrl);\n console.log(`Download successful: ${fileUrl}`);\n this.filesToDownload.delete(fileUrl);\n success = true;\n break; // Move to next file\n } catch (error) {\n logger(`Error downloading ${fileUrl}:`, error);\n this.filesToDownload.set(fileUrl, attempts + 1);\n }\n }\n\n if (!success) {\n console.error(`Failed to download after ${this.maxRetries} attempts: ${fileUrl}`);\n }\n }\n\n this.isDownloading = false;\n console.log(\"All downloads completed.\");\n }\n\n addFile(fileUrl: string): void {\n if (!this.filesToDownload.has(fileUrl)) {\n this.filesToDownload.set(fileUrl, 0);\n console.log(`Added file to download queue: ${fileUrl}`);\n } else {\n console.warn(`File already in queue: ${fileUrl}`);\n }\n }\n\n getPendingFiles(): string[] {\n return Array.from(this.filesToDownload.keys());\n }\n\n clear(): void {\n this.filesToDownload.clear();\n console.log(\"Cleared all files from the download queue.\");\n }\n}\n\n\nexport const fetchDirectory = async (url: string) => {\n const response = await fetch(url)\n return response.json()\n}\n\n// export const fetchFilesRecursively = async (\n// url: string,\n// localPath: string,\n// fileList: string[],\n// ) => {\n// for (const file of fileList) {\n// try {\n// const fileUrl = `${url}/${file}`\n// const fileLocalPath = path.join(localPath, file)\n\n// // logger(`[fetchFilesRecursively] fileUrl: ${fileUrl}`)\n// // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)\n\n// await downloadFile(fileUrl, fileLocalPath)\n// } catch (error) {\n// console.error(`Failed to fetch files from ${url}:`, error)\n// }\n// }\n// }\n\nexport const confirmFilesExist = async (filePaths: string[]) => {\n let everythingDownloaded = false\n\n for (const filePath of filePaths) {\n const fs = await BaseFileManager.getFs()\n everythingDownloaded = await fs.promises.exists(filePath)\n }\n\n if (!everythingDownloaded) {\n setTimeout(async () => {\n await confirmFilesExist(filePaths)\n }, 500)\n }\n}\n\nconst filesToExclude = ['.DS_Store']\n\nexport const syncDbFiles = async ({ filePaths, files }: Endpoints) => {\n let fileList = await fetchDirectory(filePaths)\n fileList = fileList.filter((file: string) => !filesToExclude.includes(file))\n fileList = fileList.map((file: string) => `${files}/${file}`)\n const downloadManager = new FileDownloadManager(fileList, 5)\n await downloadManager.start()\n // await fetchFilesRecursively(files, BROWSER_FS_TOP_DIR, fileList)\n await confirmFilesExist(fileList)\n logger('[syncDbFiles] Files synced!')\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,MAAM,GAAG,KAAK,CAAC,mCAAmC,CAAC;AAEzD;;;AAGG;MACU,iBAAiB,GAAG,OAAO,OAAe,KAAI;IACzD,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC;IAC/D,IAAI,aAAa,EAAE;QACjB;;IAGF,MAAM,SAAS,GAAG,eAAe,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAC3D,IAAI,eAAe,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;IACjE,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,MAAM,iBAAiB,CAAC,SAAS,CAAC;;IAGpC,eAAe,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;IAC7D,IAAI,eAAe,EAAE;AACnB,QAAA,MAAM,eAAe,CAAC,o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AA,EAAI,IAAI,CAAA,CAAE,CAAC;IAC7D,MAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC5D,IAAA,MAAM,eAAe,CAAC,KAAK,EAAE;;AAE7B,IAAA,MAAM,iBAAiB,CAAC,QAAQ,CAAC;IACjC,MAAM,CAAC,6BAA6B,CAAC;AACvC;;;;"}
|
package/dist/src/stores/eas.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
text:
|
|
3
|
-
schemaUid:
|
|
4
|
-
}
|
|
5
|
-
|
|
1
|
+
type SetSchemaUidForSchemaDefinitionProps = {
|
|
2
|
+
text: string;
|
|
3
|
+
schemaUid: string;
|
|
4
|
+
};
|
|
5
|
+
type SetSchemaUidForSchemaDefinition = (props: SetSchemaUidForSchemaDefinitionProps) => void;
|
|
6
|
+
export declare const setSchemaUidForSchemaDefinition: SetSchemaUidForSchemaDefinition;
|
|
7
|
+
type GetSchemaUidForSchemaDefinitionProps = {
|
|
8
|
+
schemaText: string;
|
|
9
|
+
};
|
|
10
|
+
type GetSchemaUidForSchemaDefinition = (props: GetSchemaUidForSchemaDefinitionProps) => Promise<string | undefined>;
|
|
11
|
+
export declare const getSchemaUidForSchemaDefinition: GetSchemaUidForSchemaDefinition;
|
|
6
12
|
export declare const fetchSchemaUids: () => Promise<void>;
|
|
13
|
+
export {};
|
|
7
14
|
//# sourceMappingURL=eas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eas.d.ts","sourceRoot":"","sources":["../../../src/stores/eas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eas.d.ts","sourceRoot":"","sources":["../../../src/stores/eas.ts"],"names":[],"mappings":"AAMA,KAAK,oCAAoC,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,+BAA+B,GAAG,CACrC,KAAK,EAAE,oCAAoC,KACxC,IAAI,CAAA;AAET,eAAO,MAAM,+BAA+B,EAAE,+BAG7C,CAAA;AAED,KAAK,oCAAoC,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,+BAA+B,GAAG,CACrC,KAAK,EAAE,oCAAoC,KACxC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;AAEhC,eAAO,MAAM,+BAA+B,EAAE,+BAU7C,CAAA;AAED,eAAO,MAAM,eAAe,qBAqB3B,CAAA"}
|
package/dist/src/stores/eas.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getSchemaUidBySchemaName } from '../browser/helpers/eas.js';
|
|
1
2
|
import { toSnakeCase } from '../helpers/index.js';
|
|
2
3
|
import { getSchemaForItemProperty } from '../helpers/getSchemaForItemProperty.js';
|
|
3
4
|
|
|
@@ -6,32 +7,36 @@ const setSchemaUidForSchemaDefinition = ({ text, schemaUid }) => {
|
|
|
6
7
|
const propertySnakeCase = toSnakeCase(text);
|
|
7
8
|
schemaUidForSchemaDefinition.set(propertySnakeCase, schemaUid);
|
|
8
9
|
};
|
|
9
|
-
const getSchemaUidForSchemaDefinition = (schemaText) => {
|
|
10
|
+
const getSchemaUidForSchemaDefinition = async ({ schemaText }) => {
|
|
10
11
|
const textSnakeCase = toSnakeCase(schemaText);
|
|
11
12
|
if (!schemaUidForSchemaDefinition.has(textSnakeCase)) {
|
|
12
|
-
|
|
13
|
+
const schemaUid = await getSchemaUidBySchemaName({ schemaName: textSnakeCase });
|
|
14
|
+
if (schemaUid) {
|
|
15
|
+
setSchemaUidForSchemaDefinition({ text: textSnakeCase, schemaUid });
|
|
16
|
+
}
|
|
17
|
+
return schemaUid;
|
|
13
18
|
}
|
|
14
19
|
return schemaUidForSchemaDefinition.get(textSnakeCase);
|
|
15
20
|
};
|
|
16
21
|
const fetchSchemaUids = async () => {
|
|
17
|
-
const
|
|
22
|
+
const versionSchema = await getSchemaForItemProperty({
|
|
18
23
|
propertyName: 'version',
|
|
19
24
|
easDataType: 'bytes32',
|
|
20
25
|
});
|
|
21
|
-
if (
|
|
26
|
+
if (versionSchema) {
|
|
22
27
|
setSchemaUidForSchemaDefinition({
|
|
23
28
|
text: 'version',
|
|
24
|
-
schemaUid:
|
|
29
|
+
schemaUid: versionSchema.id,
|
|
25
30
|
});
|
|
26
31
|
}
|
|
27
|
-
const
|
|
32
|
+
const imageSchema = await getSchemaForItemProperty({
|
|
28
33
|
propertyName: 'image',
|
|
29
34
|
easDataType: 'bytes32',
|
|
30
35
|
});
|
|
31
|
-
if (
|
|
36
|
+
if (imageSchema) {
|
|
32
37
|
setSchemaUidForSchemaDefinition({
|
|
33
38
|
text: 'image',
|
|
34
|
-
schemaUid:
|
|
39
|
+
schemaUid: imageSchema.id,
|
|
35
40
|
});
|
|
36
41
|
}
|
|
37
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eas.js","sources":["../../../../src/stores/eas.ts"],"sourcesContent":["import { toSnakeCase } from '@/helpers'\nimport { getSchemaForItemProperty } from '@/helpers/getSchemaForItemProperty'\n\nconst schemaUidForSchemaDefinition = new Map<string, string>()\n\nexport const setSchemaUidForSchemaDefinition = ({ text, schemaUid }) => {\n const propertySnakeCase = toSnakeCase(text)\n schemaUidForSchemaDefinition.set(propertySnakeCase, schemaUid)\n}\n\nexport const getSchemaUidForSchemaDefinition = (schemaText
|
|
1
|
+
{"version":3,"file":"eas.js","sources":["../../../../src/stores/eas.ts"],"sourcesContent":["import { getSchemaUidBySchemaName } from '@/browser/helpers/eas'\nimport { toSnakeCase } from '@/helpers'\nimport { getSchemaForItemProperty } from '@/helpers/getSchemaForItemProperty'\n\nconst schemaUidForSchemaDefinition = new Map<string, string>()\n\ntype SetSchemaUidForSchemaDefinitionProps = {\n text: string\n schemaUid: string\n}\n\ntype SetSchemaUidForSchemaDefinition = (\n props: SetSchemaUidForSchemaDefinitionProps,\n) => void\n\nexport const setSchemaUidForSchemaDefinition: SetSchemaUidForSchemaDefinition = ({ text, schemaUid }) => {\n const propertySnakeCase = toSnakeCase(text)\n schemaUidForSchemaDefinition.set(propertySnakeCase, schemaUid)\n}\n\ntype GetSchemaUidForSchemaDefinitionProps = {\n schemaText: string\n}\n\ntype GetSchemaUidForSchemaDefinition = (\n props: GetSchemaUidForSchemaDefinitionProps,\n) => Promise<string | undefined>\n\nexport const getSchemaUidForSchemaDefinition: GetSchemaUidForSchemaDefinition = async ({ schemaText }) => {\n const textSnakeCase = toSnakeCase(schemaText)\n if (!schemaUidForSchemaDefinition.has(textSnakeCase)) {\n const schemaUid = await getSchemaUidBySchemaName({ schemaName: textSnakeCase })\n if (schemaUid) {\n setSchemaUidForSchemaDefinition({ text: textSnakeCase, schemaUid })\n }\n return schemaUid\n }\n return schemaUidForSchemaDefinition.get(textSnakeCase)\n}\n\nexport const fetchSchemaUids = async () => {\n const versionSchema = await getSchemaForItemProperty({\n propertyName: 'version',\n easDataType: 'bytes32',\n })\n if (versionSchema) {\n setSchemaUidForSchemaDefinition({\n text: 'version',\n schemaUid: versionSchema.id,\n })\n }\n const imageSchema = await getSchemaForItemProperty({\n propertyName: 'image',\n easDataType: 'bytes32',\n })\n if (imageSchema) {\n setSchemaUidForSchemaDefinition({\n text: 'image',\n schemaUid: imageSchema.id,\n })\n }\n}\n"],"names":[],"mappings":";;;;AAIA,MAAM,4BAA4B,GAAG,IAAI,GAAG,EAAkB;AAWjD,MAAA,+BAA+B,GAAoC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAI;AACtG,IAAA,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC;AAC3C,IAAA,4BAA4B,CAAC,GAAG,CAAC,iBAAiB,EAAE,SAAS,CAAC;AAChE;AAUa,MAAA,+BAA+B,GAAoC,OAAO,EAAE,UAAU,EAAE,KAAI;AACvG,IAAA,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC;IAC7C,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;QACpD,MAAM,SAAS,GAAG,MAAM,wBAAwB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;QAC/E,IAAI,SAAS,EAAE;YACb,+BAA+B,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;;AAErE,QAAA,OAAO,SAAS;;AAElB,IAAA,OAAO,4BAA4B,CAAC,GAAG,CAAC,aAAa,CAAC;AACxD;AAEa,MAAA,eAAe,GAAG,YAAW;AACxC,IAAA,MAAM,aAAa,GAAG,MAAM,wBAAwB,CAAC;AACnD,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,WAAW,EAAE,SAAS;AACvB,KAAA,CAAC;IACF,IAAI,aAAa,EAAE;AACjB,QAAA,+BAA+B,CAAC;AAC9B,YAAA,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,aAAa,CAAC,EAAE;AAC5B,SAAA,CAAC;;AAEJ,IAAA,MAAM,WAAW,GAAG,MAAM,wBAAwB,CAAC;AACjD,QAAA,YAAY,EAAE,OAAO;AACrB,QAAA,WAAW,EAAE,SAAS;AACvB,KAAA,CAAC;IACF,IAAI,WAAW,EAAE;AACf,QAAA,+BAA+B,CAAC;AAC9B,YAAA,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,WAAW,CAAC,EAAE;AAC1B,SAAA,CAAC;;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelClass.d.ts","sourceRoot":"","sources":["../../../src/stores/modelClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"modelClass.d.ts","sourceRoot":"","sources":["../../../src/stores/modelClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAKxC,eAAO,MAAM,SAAS,QAAO,MAAM,CAAC,MAAM,EAAE,cAAc,CAEzD,CAAA;AAED,eAAO,MAAM,QAAQ,cAAe,MAAM,KAAG,cAAc,GAAG,SAE7D,CAAA;AAED,eAAO,MAAM,aAAa,QAAO,MAAM,EAEtC,CAAA;AAED,eAAO,MAAM,QAAQ,cAAe,MAAM,SAAS,cAAc,SAEhE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelClass.js","sources":["../../../../src/stores/modelClass.ts"],"sourcesContent":["import { ModelClassType } from '@/types'\n\nconst modelStore = new Map<string, ModelClassType>()\n\nexport const getModels = (): Record<string, ModelClassType> => {\n return Object.fromEntries(modelStore)\n}\n\nexport const getModel = (modelName: string): ModelClassType | undefined => {\n return modelStore.get(modelName)\n}\n\nexport const getModelNames = (): string[] => {\n return Array.from(modelStore.keys())\n}\n\nexport const setModel = (modelName: string, model: ModelClassType) => {\n modelStore.set(modelName, model)\n}\n"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,IAAI,GAAG,EAA0B;
|
|
1
|
+
{"version":3,"file":"modelClass.js","sources":["../../../../src/stores/modelClass.ts"],"sourcesContent":["import { ModelClassType } from '@/types'\n\nconst modelStore = new Map<string, ModelClassType>()\n\n\nexport const getModels = (): Record<string, ModelClassType> => {\n return Object.fromEntries(modelStore)\n}\n\nexport const getModel = (modelName: string): ModelClassType | undefined => {\n return modelStore.get(modelName)\n}\n\nexport const getModelNames = (): string[] => {\n return Array.from(modelStore.keys())\n}\n\nexport const setModel = (modelName: string, model: ModelClassType) => {\n modelStore.set(modelName, model)\n}\n"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,IAAI,GAAG,EAA0B;AAG7C,MAAM,SAAS,GAAG,MAAqC;AAC5D,IAAA,OAAO,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;AACvC;AAEa,MAAA,QAAQ,GAAG,CAAC,SAAiB,KAAgC;AACxE,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC;AAClC;AAEO,MAAM,aAAa,GAAG,MAAe;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;AACtC;MAEa,QAAQ,GAAG,CAAC,SAAiB,EAAE,KAAqB,KAAI;AACnE,IAAA,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC;AAClC;;;;"}
|