@powerhousedao/vetra 4.1.0-dev.18 → 4.1.0-dev.20
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/document-models/app-module/gen/actions.d.ts +4 -0
- package/dist/document-models/app-module/gen/actions.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/actions.js +2 -0
- package/dist/document-models/app-module/gen/actions.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/actions.d.ts +12 -0
- package/dist/document-models/app-module/gen/base-operations/actions.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/actions.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/actions.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts +5 -0
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/creators.js +5 -0
- package/dist/document-models/app-module/gen/base-operations/creators.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/error.d.ts +2 -0
- package/dist/document-models/app-module/gen/base-operations/error.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/error.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/error.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/object.d.ts +8 -0
- package/dist/document-models/app-module/gen/base-operations/object.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/object.js +11 -0
- package/dist/document-models/app-module/gen/base-operations/object.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/operations.d.ts +8 -0
- package/dist/document-models/app-module/gen/base-operations/operations.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/operations.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/operations.js.map +1 -0
- package/dist/document-models/app-module/gen/creators.d.ts +2 -0
- package/dist/document-models/app-module/gen/creators.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/creators.js +2 -0
- package/dist/document-models/app-module/gen/creators.js.map +1 -0
- package/dist/document-models/app-module/gen/document-model.d.ts +3 -0
- package/dist/document-models/app-module/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/document-model.js +60 -0
- package/dist/document-models/app-module/gen/document-model.js.map +1 -0
- package/dist/document-models/app-module/gen/index.d.ts +6 -0
- package/dist/document-models/app-module/gen/index.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/index.js +6 -0
- package/dist/document-models/app-module/gen/index.js.map +1 -0
- package/dist/document-models/app-module/gen/object.d.ts +16 -0
- package/dist/document-models/app-module/gen/object.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/object.js +26 -0
- package/dist/document-models/app-module/gen/object.js.map +1 -0
- package/dist/document-models/app-module/gen/reducer.d.ts +3 -0
- package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/reducer.js +25 -0
- package/dist/document-models/app-module/gen/reducer.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/index.d.ts +3 -0
- package/dist/document-models/app-module/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/index.js +3 -0
- package/dist/document-models/app-module/gen/schema/index.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/types.d.ts +148 -0
- package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/types.js +2 -0
- package/dist/document-models/app-module/gen/schema/types.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/zod.d.ts +14 -0
- package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/zod.js +24 -0
- package/dist/document-models/app-module/gen/schema/zod.js.map +1 -0
- package/dist/document-models/app-module/gen/types.d.ts +10 -0
- package/dist/document-models/app-module/gen/types.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/types.js +2 -0
- package/dist/document-models/app-module/gen/types.js.map +1 -0
- package/dist/document-models/app-module/gen/utils.d.ts +7 -0
- package/dist/document-models/app-module/gen/utils.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/utils.js +40 -0
- package/dist/document-models/app-module/gen/utils.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +27 -0
- package/dist/document-models/app-module/index.d.ts.map +1 -0
- package/dist/document-models/app-module/index.js +22 -0
- package/dist/document-models/app-module/index.js.map +1 -0
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts +3 -0
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -0
- package/dist/document-models/app-module/src/reducers/base-operations.js +9 -0
- package/dist/document-models/app-module/src/reducers/base-operations.js.map +1 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.d.ts +6 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.d.ts.map +1 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.js +33 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.js.map +1 -0
- package/dist/document-models/app-module/src/tests/document-model.test.d.ts +6 -0
- package/dist/document-models/app-module/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/app-module/src/tests/document-model.test.js +19 -0
- package/dist/document-models/app-module/src/tests/document-model.test.js.map +1 -0
- package/dist/document-models/app-module/src/utils.d.ts +2 -0
- package/dist/document-models/app-module/src/utils.d.ts.map +1 -0
- package/dist/document-models/app-module/src/utils.js +2 -0
- package/dist/document-models/app-module/src/utils.js.map +1 -0
- package/dist/document-models/document-editor/src/tests/base-operations.test.js +8 -8
- package/dist/document-models/document-editor/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/index.d.ts +1 -0
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +1 -0
- package/dist/document-models/index.js.map +1 -1
- package/dist/document-models/processor-module/src/tests/base-operations.test.js +8 -8
- package/dist/document-models/processor-module/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +2 -2
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js +20 -20
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js.map +1 -1
- package/dist/editors/app-editor/components/AppEditorForm.d.ts +8 -0
- package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -0
- package/dist/editors/app-editor/components/AppEditorForm.js +30 -0
- package/dist/editors/app-editor/components/AppEditorForm.js.map +1 -0
- package/dist/editors/app-editor/editor.d.ts +5 -0
- package/dist/editors/app-editor/editor.d.ts.map +1 -0
- package/dist/editors/app-editor/editor.js +17 -0
- package/dist/editors/app-editor/editor.js.map +1 -0
- package/dist/editors/app-editor/index.d.ts +5 -0
- package/dist/editors/app-editor/index.d.ts.map +1 -0
- package/dist/editors/app-editor/index.js +13 -0
- package/dist/editors/app-editor/index.js.map +1 -0
- package/dist/editors/components/StatusPill.d.ts +6 -0
- package/dist/editors/components/StatusPill.d.ts.map +1 -0
- package/dist/editors/components/StatusPill.js +7 -0
- package/dist/editors/components/StatusPill.js.map +1 -0
- package/dist/editors/components/index.d.ts +2 -0
- package/dist/editors/components/index.d.ts.map +1 -0
- package/dist/editors/components/index.js +2 -0
- package/dist/editors/components/index.js.map +1 -0
- package/dist/editors/index.d.ts +1 -0
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.js +3 -0
- package/dist/editors/vetra-drive-app/components/ModuleItem.js.map +1 -1
- package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/editor.js +2 -1
- package/dist/editors/vetra-drive-app/editor.js.map +1 -1
- package/dist/editors/vetra-drive-app/icons/AppIcon.d.ts +9 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.d.ts.map +1 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.js +5 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/dist/powerhouse.manifest.json +9 -0
- package/dist/processors/codegen/document-handlers/app-handler.d.ts +10 -0
- package/dist/processors/codegen/document-handlers/app-handler.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/app-handler.js +36 -0
- package/dist/processors/codegen/document-handlers/app-handler.js.map +1 -0
- package/dist/processors/codegen/document-handlers/index.d.ts +1 -0
- package/dist/processors/codegen/document-handlers/index.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/index.js +1 -0
- package/dist/processors/codegen/document-handlers/index.js.map +1 -1
- package/dist/processors/codegen/factory.d.ts.map +1 -1
- package/dist/processors/codegen/factory.js +1 -0
- package/dist/processors/codegen/factory.js.map +1 -1
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +2 -1
- package/dist/processors/codegen/index.js.map +1 -1
- package/dist/style.css +14 -0
- package/dist/subgraphs/app-module/index.d.ts +10 -0
- package/dist/subgraphs/app-module/index.d.ts.map +1 -0
- package/dist/subgraphs/app-module/index.js +12 -0
- package/dist/subgraphs/app-module/index.js.map +1 -0
- package/dist/subgraphs/app-module/resolvers.d.ts +3 -0
- package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/app-module/resolvers.js +93 -0
- package/dist/subgraphs/app-module/resolvers.js.map +1 -0
- package/dist/subgraphs/app-module/schema.d.ts +3 -0
- package/dist/subgraphs/app-module/schema.d.ts.map +1 -0
- package/dist/subgraphs/app-module/schema.js +56 -0
- package/dist/subgraphs/app-module/schema.js.map +1 -0
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { baseCreateDocument, baseCreateExtendedState, baseSaveToFile, baseSaveToFileHandle, baseLoadFromFile, baseLoadFromInput, generateId, } from "document-model";
|
|
2
|
+
import { reducer } from "./reducer.js";
|
|
3
|
+
export const initialGlobalState = {
|
|
4
|
+
name: "",
|
|
5
|
+
status: "DRAFT",
|
|
6
|
+
};
|
|
7
|
+
export const initialLocalState = {};
|
|
8
|
+
const utils = {
|
|
9
|
+
fileExtension: ".phdm",
|
|
10
|
+
createState(state) {
|
|
11
|
+
return {
|
|
12
|
+
global: { ...initialGlobalState, ...state?.global },
|
|
13
|
+
local: { ...initialLocalState, ...state?.local },
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
createExtendedState(extendedState) {
|
|
17
|
+
return baseCreateExtendedState({ ...extendedState }, utils.createState);
|
|
18
|
+
},
|
|
19
|
+
createDocument(state) {
|
|
20
|
+
const document = baseCreateDocument(utils.createExtendedState(state), utils.createState);
|
|
21
|
+
document.header.documentType = "powerhouse/app";
|
|
22
|
+
// for backwards compatibility, but this is NOT a valid signed document id
|
|
23
|
+
document.header.id = generateId();
|
|
24
|
+
return document;
|
|
25
|
+
},
|
|
26
|
+
saveToFile(document, path, name) {
|
|
27
|
+
return baseSaveToFile(document, path, ".phdm", name);
|
|
28
|
+
},
|
|
29
|
+
saveToFileHandle(document, input) {
|
|
30
|
+
return baseSaveToFileHandle(document, input);
|
|
31
|
+
},
|
|
32
|
+
loadFromFile(path) {
|
|
33
|
+
return baseLoadFromFile(path, reducer);
|
|
34
|
+
},
|
|
35
|
+
loadFromInput(input) {
|
|
36
|
+
return baseLoadFromInput(input, reducer);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export default utils;
|
|
40
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../document-models/app-module/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,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BAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,aAAa,CAAC,KAAK;QACjB,OAAO,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization.
|
|
3
|
+
* Delete the file and run the code generator again to have it reset
|
|
4
|
+
*/
|
|
5
|
+
import { type DocumentModelModule } from "document-model";
|
|
6
|
+
import { reducer } from "./gen/reducer.js";
|
|
7
|
+
import { documentModel } from "./gen/document-model.js";
|
|
8
|
+
import { type AppModuleDocument } from "./gen/types.js";
|
|
9
|
+
declare const utils: {
|
|
10
|
+
fileExtension: string;
|
|
11
|
+
createState: import("document-model").CreateState<AppModuleDocument>;
|
|
12
|
+
createExtendedState: import("document-model").CreateExtendedState<AppModuleDocument>;
|
|
13
|
+
createDocument: import("document-model").CreateDocument<AppModuleDocument>;
|
|
14
|
+
loadFromFile: import("document-model").LoadFromFile<AppModuleDocument>;
|
|
15
|
+
loadFromInput: import("document-model").LoadFromInput<AppModuleDocument>;
|
|
16
|
+
saveToFile: import("document-model").SaveToFile;
|
|
17
|
+
saveToFileHandle: import("document-model").SaveToFileHandle;
|
|
18
|
+
};
|
|
19
|
+
declare const actions: {
|
|
20
|
+
setAppName: (input: import("./gen/index.js").SetAppNameInput) => import("./gen/index.js").SetAppNameAction;
|
|
21
|
+
setAppStatus: (input: import("./gen/index.js").SetAppStatusInput) => import("./gen/index.js").SetAppStatusAction;
|
|
22
|
+
};
|
|
23
|
+
export declare const module: DocumentModelModule<AppModuleDocument>;
|
|
24
|
+
export { reducer, actions, utils, documentModel };
|
|
25
|
+
export * from "./gen/types.js";
|
|
26
|
+
export * from "./src/utils.js";
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,QAAA,MAAM,KAAK;;;;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;iBARE,+CAAsB;mBAIhC,iDAAwB;CAI0B,CAAC;AAExD,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,iBAAiB,CAKzD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization.
|
|
3
|
+
* Delete the file and run the code generator again to have it reset
|
|
4
|
+
*/
|
|
5
|
+
import { actions as BaseActions, } from "document-model";
|
|
6
|
+
import { actions as AppModuleActions } from "./gen/index.js";
|
|
7
|
+
import { reducer } from "./gen/reducer.js";
|
|
8
|
+
import { documentModel } from "./gen/document-model.js";
|
|
9
|
+
import genUtils from "./gen/utils.js";
|
|
10
|
+
import * as customUtils from "./src/utils.js";
|
|
11
|
+
const utils = { ...genUtils, ...customUtils };
|
|
12
|
+
const actions = { ...BaseActions, ...AppModuleActions };
|
|
13
|
+
export const module = {
|
|
14
|
+
reducer,
|
|
15
|
+
actions,
|
|
16
|
+
utils,
|
|
17
|
+
documentModel,
|
|
18
|
+
};
|
|
19
|
+
export { reducer, actions, utils, documentModel };
|
|
20
|
+
export * from "./gen/types.js";
|
|
21
|
+
export * from "./src/utils.js";
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,OAAO,IAAI,WAAW,GAEvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,MAAM,KAAK,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;AAC9C,MAAM,OAAO,GAAG,EAAE,GAAG,WAAW,EAAE,GAAG,gBAAgB,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAA2C;IAC5D,OAAO;IACP,OAAO;IACP,KAAK;IACL,aAAa;CACd,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/base-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAEjG,eAAO,MAAM,OAAO,EAAE,iCAOrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-operations.js","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/base-operations.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAsC;IACtD,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ;QACvC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IACnC,CAAC;IACD,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ;QACzC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;IACvC,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-operations.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import utils from "../../gen/utils.js";
|
|
8
|
+
import { z, } from "../../gen/schema/index.js";
|
|
9
|
+
import { reducer } from "../../gen/reducer.js";
|
|
10
|
+
import * as creators from "../../gen/base-operations/creators.js";
|
|
11
|
+
describe("BaseOperations Operations", () => {
|
|
12
|
+
let document;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
document = utils.createDocument();
|
|
15
|
+
});
|
|
16
|
+
it("should handle setAppName operation", () => {
|
|
17
|
+
const input = generateMock(z.SetAppNameInputSchema());
|
|
18
|
+
const updatedDocument = reducer(document, creators.setAppName(input));
|
|
19
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_APP_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
|
+
});
|
|
24
|
+
it("should handle setAppStatus operation", () => {
|
|
25
|
+
const input = generateMock(z.SetAppStatusInputSchema());
|
|
26
|
+
const updatedDocument = reducer(document, creators.setAppStatus(input));
|
|
27
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
28
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_APP_STATUS");
|
|
29
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
30
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=base-operations.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/app-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAGF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAA2B,CAAC;IAEhC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,KAAK,GAAoB,YAAY,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAEvE,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QAEtE,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CA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{"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import utils, { initialGlobalState, initialLocalState, } from "../../gen/utils.js";
|
|
7
|
+
describe("App Module Document Model", () => {
|
|
8
|
+
it("should create a new App Module document", () => {
|
|
9
|
+
const document = utils.createDocument();
|
|
10
|
+
expect(document).toBeDefined();
|
|
11
|
+
expect(document.header.documentType).toBe("powerhouse/app");
|
|
12
|
+
});
|
|
13
|
+
it("should create a new App Module document with a valid initial state", () => {
|
|
14
|
+
const document = utils.createDocument();
|
|
15
|
+
expect(document.state.global).toStrictEqual(initialGlobalState);
|
|
16
|
+
expect(document.state.local).toStrictEqual(initialLocalState);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=document-model.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-model.test.js","sourceRoot":"","sources":["../../../../../document-models/app-module/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QAExC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QACxC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAChE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../document-models/app-module/src/utils.ts"],"names":[],"mappings":""}
|
|
@@ -17,32 +17,32 @@ describe("BaseOperations Operations", () => {
|
|
|
17
17
|
const input = generateMock(z.SetEditorNameInputSchema());
|
|
18
18
|
const updatedDocument = reducer(document, creators.setEditorName(input));
|
|
19
19
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_EDITOR_NAME");
|
|
21
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_EDITOR_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
22
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
23
|
});
|
|
24
24
|
it("should handle setEditorId operation", () => {
|
|
25
25
|
const input = generateMock(z.SetEditorIdInputSchema());
|
|
26
26
|
const updatedDocument = reducer(document, creators.setEditorId(input));
|
|
27
27
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
28
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_EDITOR_ID");
|
|
29
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
28
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_EDITOR_ID");
|
|
29
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
30
30
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
31
31
|
});
|
|
32
32
|
it("should handle addDocumentType operation", () => {
|
|
33
33
|
const input = generateMock(z.AddDocumentTypeInputSchema());
|
|
34
34
|
const updatedDocument = reducer(document, creators.addDocumentType(input));
|
|
35
35
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
36
|
-
expect(updatedDocument.operations.global[0].type).toBe("ADD_DOCUMENT_TYPE");
|
|
37
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_DOCUMENT_TYPE");
|
|
37
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
38
38
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
39
39
|
});
|
|
40
40
|
it("should handle removeDocumentType operation", () => {
|
|
41
41
|
const input = generateMock(z.RemoveDocumentTypeInputSchema());
|
|
42
42
|
const updatedDocument = reducer(document, creators.removeDocumentType(input));
|
|
43
43
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
44
|
-
expect(updatedDocument.operations.global[0].type).toBe("REMOVE_DOCUMENT_TYPE");
|
|
45
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
44
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_DOCUMENT_TYPE");
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
46
46
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/document-editor/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAKF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAAgC,CAAC;IAErC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,KAAK,GAAuB,YAAY,CAC5C,CAAC,CAAC,wBAAwB,EAAE,CAC7B,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAEzE,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/document-editor/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAA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,KAAK,CAAC,CAAC;QAC/E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,KAAK,GAA4B,YAAY,CACjD,CAAC,CAAC,6BAA6B,EAAE,CAClC,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAC7B,QAAQ,EACR,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CACnC,CAAC;QAEF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAC3D,sBAAsB,CACvB,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { module as DocumentEditor } from "./document-editor/index.js";
|
|
|
2
2
|
export { module as VetraPackage } from "./vetra-package/index.js";
|
|
3
3
|
export { module as SubgraphModule } from "./subgraph-module/index.js";
|
|
4
4
|
export { module as ProcessorModule } from "./processor-module/index.js";
|
|
5
|
+
export { module as AppModule } from "./app-module/index.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { module as DocumentEditor } from "./document-editor/index.js";
|
|
|
2
2
|
export { module as VetraPackage } from "./vetra-package/index.js";
|
|
3
3
|
export { module as SubgraphModule } from "./subgraph-module/index.js";
|
|
4
4
|
export { module as ProcessorModule } from "./processor-module/index.js";
|
|
5
|
+
export { module as AppModule } from "./app-module/index.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -17,32 +17,32 @@ describe("BaseOperations Operations", () => {
|
|
|
17
17
|
const input = generateMock(z.SetProcessorNameInputSchema());
|
|
18
18
|
const updatedDocument = reducer(document, creators.setProcessorName(input));
|
|
19
19
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PROCESSOR_NAME");
|
|
21
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PROCESSOR_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
22
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
23
|
});
|
|
24
24
|
it("should handle setProcessorType operation", () => {
|
|
25
25
|
const input = generateMock(z.SetProcessorTypeInputSchema());
|
|
26
26
|
const updatedDocument = reducer(document, creators.setProcessorType(input));
|
|
27
27
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
28
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PROCESSOR_TYPE");
|
|
29
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
28
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PROCESSOR_TYPE");
|
|
29
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
30
30
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
31
31
|
});
|
|
32
32
|
it("should handle addDocumentType operation", () => {
|
|
33
33
|
const input = generateMock(z.AddDocumentTypeInputSchema());
|
|
34
34
|
const updatedDocument = reducer(document, creators.addDocumentType(input));
|
|
35
35
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
36
|
-
expect(updatedDocument.operations.global[0].type).toBe("ADD_DOCUMENT_TYPE");
|
|
37
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_DOCUMENT_TYPE");
|
|
37
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
38
38
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
39
39
|
});
|
|
40
40
|
it("should handle removeDocumentType operation", () => {
|
|
41
41
|
const input = generateMock(z.RemoveDocumentTypeInputSchema());
|
|
42
42
|
const updatedDocument = reducer(document, creators.removeDocumentType(input));
|
|
43
43
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
44
|
-
expect(updatedDocument.operations.global[0].type).toBe("REMOVE_DOCUMENT_TYPE");
|
|
45
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
44
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_DOCUMENT_TYPE");
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
46
46
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/processor-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAKF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAAiC,CAAC;IAEtC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,KAAK,GAA0B,YAAY,CAC/C,CAAC,CAAC,2BAA2B,EAAE,CAChC,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAE5E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/processor-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAKF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC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4B,YAAY,CACjD,CAAC,CAAC,6BAA6B,EAAE,CAClC,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAC7B,QAAQ,EACR,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CACnC,CAAC;QAEF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAC3D,sBAAsB,CACvB,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -17,8 +17,8 @@ describe("BaseOperations Operations", () => {
|
|
|
17
17
|
const input = generateMock(z.SetSubgraphNameInputSchema());
|
|
18
18
|
const updatedDocument = reducer(document, creators.setSubgraphName(input));
|
|
19
19
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_SUBGRAPH_NAME");
|
|
21
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_SUBGRAPH_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
22
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/subgraph-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,CAAC,EAA6B,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAAgC,CAAC;IAErC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,KAAK,GAAyB,YAAY,CAC9C,CAAC,CAAC,0BAA0B,EAAE,CAC/B,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAE3E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/subgraph-module/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,E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18
18
|
const updatedDocument = reducer(document, creators.setPackageName(input));
|
|
19
19
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_NAME");
|
|
21
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
22
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
23
|
});
|
|
24
24
|
it("should handle setPackageDescription operation", () => {
|
|
25
25
|
const input = generateMock(z.SetPackageDescriptionInputSchema());
|
|
26
26
|
const updatedDocument = reducer(document, creators.setPackageDescription(input));
|
|
27
27
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
28
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_DESCRIPTION");
|
|
29
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
28
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_DESCRIPTION");
|
|
29
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
30
30
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
31
31
|
});
|
|
32
32
|
it("should handle setPackageCategory operation", () => {
|
|
33
33
|
const input = generateMock(z.SetPackageCategoryInputSchema());
|
|
34
34
|
const updatedDocument = reducer(document, creators.setPackageCategory(input));
|
|
35
35
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
36
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_CATEGORY");
|
|
37
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_CATEGORY");
|
|
37
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
38
38
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
39
39
|
});
|
|
40
40
|
it("should handle setPackageAuthor operation", () => {
|
|
41
41
|
const input = generateMock(z.SetPackageAuthorInputSchema());
|
|
42
42
|
const updatedDocument = reducer(document, creators.setPackageAuthor(input));
|
|
43
43
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
44
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_AUTHOR");
|
|
45
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
44
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_AUTHOR");
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
46
46
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
47
47
|
});
|
|
48
48
|
it("should handle setPackageAuthorName operation", () => {
|
|
49
49
|
const input = generateMock(z.SetPackageAuthorNameInputSchema());
|
|
50
50
|
const updatedDocument = reducer(document, creators.setPackageAuthorName(input));
|
|
51
51
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
52
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_AUTHOR_NAME");
|
|
53
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
52
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_AUTHOR_NAME");
|
|
53
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
54
54
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
55
55
|
});
|
|
56
56
|
it("should handle setPackageAuthorWebsite operation", () => {
|
|
57
57
|
const input = generateMock(z.SetPackageAuthorWebsiteInputSchema());
|
|
58
58
|
const updatedDocument = reducer(document, creators.setPackageAuthorWebsite(input));
|
|
59
59
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
60
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_AUTHOR_WEBSITE");
|
|
61
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
60
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_AUTHOR_WEBSITE");
|
|
61
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
62
62
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
63
63
|
});
|
|
64
64
|
it("should handle addPackageKeyword operation", () => {
|
|
65
65
|
const input = generateMock(z.AddPackageKeywordInputSchema());
|
|
66
66
|
const updatedDocument = reducer(document, creators.addPackageKeyword(input));
|
|
67
67
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
68
|
-
expect(updatedDocument.operations.global[0].type).toBe("ADD_PACKAGE_KEYWORD");
|
|
69
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
68
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_PACKAGE_KEYWORD");
|
|
69
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
70
70
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
71
71
|
});
|
|
72
72
|
it("should handle removePackageKeyword operation", () => {
|
|
73
73
|
const input = generateMock(z.RemovePackageKeywordInputSchema());
|
|
74
74
|
const updatedDocument = reducer(document, creators.removePackageKeyword(input));
|
|
75
75
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
76
|
-
expect(updatedDocument.operations.global[0].type).toBe("REMOVE_PACKAGE_KEYWORD");
|
|
77
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
76
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_PACKAGE_KEYWORD");
|
|
77
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
78
78
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
79
79
|
});
|
|
80
80
|
it("should handle setPackageGithubUrl operation", () => {
|
|
81
81
|
const input = generateMock(z.SetPackageGithubUrlInputSchema());
|
|
82
82
|
const updatedDocument = reducer(document, creators.setPackageGithubUrl(input));
|
|
83
83
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
84
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_GITHUB_URL");
|
|
85
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
84
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_GITHUB_URL");
|
|
85
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
86
86
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
87
87
|
});
|
|
88
88
|
it("should handle setPackageNpmUrl operation", () => {
|
|
89
89
|
const input = generateMock(z.SetPackageNpmUrlInputSchema());
|
|
90
90
|
const updatedDocument = reducer(document, creators.setPackageNpmUrl(input));
|
|
91
91
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
92
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_PACKAGE_NPM_URL");
|
|
93
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
92
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_PACKAGE_NPM_URL");
|
|
93
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
94
94
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/vetra-package/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAWF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAA8B,CAAC;IAEnC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,KAAK,GAAwB,YAAY,CAC7C,CAAC,CAAC,yBAAyB,EAAE,CAC9B,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;QAE1E,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"base-operations.test.js","sourceRoot":"","sources":["../../../../../document-models/vetra-package/src/tests/base-operations.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EACL,CAAC,GAWF,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAC;AAGlE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,QAA8B,CAAC;IAEnC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,KAAK,CAAC,cAA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sources":["../../../../editors/app-editor/components/AppEditorForm.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2EtD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useDebounce } from "../../hooks/index.js";
|
|
4
|
+
import { StatusPill } from "../../components/index.js";
|
|
5
|
+
export const AppEditorForm = ({ appName: initialAppName = "", status = "DRAFT", onNameChange, onConfirm }) => {
|
|
6
|
+
const [appName, setAppName] = useState(initialAppName);
|
|
7
|
+
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
8
|
+
// Use the debounce hook for name changes
|
|
9
|
+
useDebounce(appName, onNameChange, 300);
|
|
10
|
+
// Update local state when initialAppName changes
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setAppName(initialAppName);
|
|
13
|
+
}, [initialAppName]);
|
|
14
|
+
// Reset confirmation state if status changes back to DRAFT
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (status === "DRAFT") {
|
|
17
|
+
setIsConfirmed(false);
|
|
18
|
+
}
|
|
19
|
+
}, [status]);
|
|
20
|
+
// Check if form should be read-only
|
|
21
|
+
const isReadOnly = isConfirmed || status === "CONFIRMED";
|
|
22
|
+
const handleConfirm = () => {
|
|
23
|
+
if (appName.trim()) {
|
|
24
|
+
setIsConfirmed(true); // Immediate UI update
|
|
25
|
+
onConfirm?.();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "App Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "App Name" }), _jsx("input", { type: "text", value: appName, onChange: (e) => setAppName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}`, placeholder: "Enter app name" })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !appName.trim(), className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=AppEditorForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppEditorForm.js","sourceRoot":"","sources":["../../../../editors/app-editor/components/AppEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AASvD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,OAAO,EAAE,cAAc,GAAG,EAAE,EAC5B,MAAM,GAAG,OAAO,EAChB,YAAY,EACZ,SAAS,EACV,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvD,MAAM,CAAC,WAAW,E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,EAAE,UAAU,EACpB,SAAS,EAAE,mIACT,UAAU,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,EAClD,EAAE,EACF,WAAW,EAAC,gBAAgB,GAC5B,IACE,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EACzB,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorProps } from "document-model";
|
|
2
|
+
import { type AppModuleDocument } from "../../document-models/app-module/index.js";
|
|
3
|
+
export type IProps = EditorProps<AppModuleDocument>;
|
|
4
|
+
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=editor.d.ts.map
|