@mat3ra/wode 2026.7.29-1 → 2026.8.18-0

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.
Files changed (101) hide show
  1. package/dist/js/Subworkflow.d.ts +21 -20
  2. package/dist/js/Subworkflow.js +8 -7
  3. package/dist/js/Workflow.d.ts +11 -10
  4. package/dist/js/Workflow.js +7 -3
  5. package/dist/js/context/mixins/MaterialContextMixin.d.ts +1 -4
  6. package/dist/js/context/providers/CollinearMagnetizationDataManager.js +1 -1
  7. package/dist/js/context/providers/Hubbard/HubbardContextProvider.d.ts +6 -4
  8. package/dist/js/context/providers/Hubbard/HubbardContextProvider.js +12 -7
  9. package/dist/js/context/providers/NonCollinearMagnetizationDataManager.js +1 -1
  10. package/dist/js/context/providers/PointsGrid/PointsGridFormDataProvider.d.ts +6 -4
  11. package/dist/js/context/providers/PointsGrid/PointsGridFormDataProvider.js +10 -5
  12. package/dist/js/context/providers/PointsPath/PointsPathFormDataProvider.d.ts +3 -4
  13. package/dist/js/context/providers/PointsPath/PointsPathFormDataProvider.js +3 -2
  14. package/dist/js/context/providers/by_application/espresso/QEPWXInputDataManager.js +2 -1
  15. package/dist/js/context/providers/by_application/nwchem/NWChemInputDataManager.js +1 -1
  16. package/dist/js/generated/AssertionUnitSchemaMixin.d.ts +2 -2
  17. package/dist/js/generated/AssignmentUnitSchemaMixin.d.ts +2 -2
  18. package/dist/js/generated/BaseUnitSchemaMixin.d.ts +2 -2
  19. package/dist/js/generated/BaseUnitSchemaMixin.js +6 -18
  20. package/dist/js/generated/ConditionUnitSchemaMixin.d.ts +2 -2
  21. package/dist/js/generated/ErrorUnitSchemaMixin.d.ts +2 -2
  22. package/dist/js/generated/ExecutionUnitInputSchemaMixin.d.ts +2 -2
  23. package/dist/js/generated/ExecutionUnitSchemaMixin.d.ts +2 -2
  24. package/dist/js/generated/IOUnitSchemaMixin.d.ts +2 -2
  25. package/dist/js/generated/MapUnitSchemaMixin.d.ts +2 -2
  26. package/dist/js/generated/ReduceUnitSchemaMixin.d.ts +2 -2
  27. package/dist/js/generated/StatusTrackSchemaMixin.d.ts +5 -0
  28. package/dist/js/generated/{StatusSchemaMixin.js → StatusTrackSchemaMixin.js} +2 -8
  29. package/dist/js/generated/SubworkflowSchemaMixin.d.ts +2 -2
  30. package/dist/js/generated/SubworkflowUnitSchemaMixin.d.ts +2 -2
  31. package/dist/js/generated/WorkflowSchemaMixin.d.ts +2 -2
  32. package/dist/js/units/AssertionUnit.d.ts +4 -7
  33. package/dist/js/units/AssignmentUnit.d.ts +4 -7
  34. package/dist/js/units/BaseUnit.d.ts +13 -12
  35. package/dist/js/units/BaseUnit.js +14 -11
  36. package/dist/js/units/ConditionUnit.d.ts +4 -7
  37. package/dist/js/units/ErrorUnit.d.ts +4 -7
  38. package/dist/js/units/ExecutionUnit.d.ts +4 -7
  39. package/dist/js/units/ExecutionUnit.js +6 -6
  40. package/dist/js/units/ExecutionUnitInput.d.ts +3 -7
  41. package/dist/js/units/IOUnit.d.ts +4 -7
  42. package/dist/js/units/MapUnit.d.ts +4 -7
  43. package/dist/js/units/MapUnit.js +1 -1
  44. package/dist/js/units/ReduceUnit.d.ts +4 -7
  45. package/dist/js/units/SubworkflowUnit.d.ts +4 -7
  46. package/package.json +12 -12
  47. package/src/js/Subworkflow.ts +42 -32
  48. package/src/js/Workflow.ts +28 -16
  49. package/src/js/context/mixins/MaterialContextMixin.ts +1 -2
  50. package/src/js/context/providers/CollinearMagnetizationDataManager.ts +1 -1
  51. package/src/js/context/providers/Hubbard/HubbardContextProvider.ts +17 -8
  52. package/src/js/context/providers/NonCollinearMagnetizationDataManager.ts +1 -1
  53. package/src/js/context/providers/PointsGrid/PointsGridFormDataProvider.ts +14 -12
  54. package/src/js/context/providers/PointsPath/PointsPathFormDataProvider.ts +9 -6
  55. package/src/js/context/providers/by_application/espresso/QEPWXInputDataManager.ts +4 -3
  56. package/src/js/context/providers/by_application/nwchem/NWChemInputDataManager.ts +1 -1
  57. package/src/js/generated/AssertionUnitSchemaMixin.ts +11 -6
  58. package/src/js/generated/AssignmentUnitSchemaMixin.ts +12 -7
  59. package/src/js/generated/BaseUnitSchemaMixin.ts +17 -26
  60. package/src/js/generated/ConditionUnitSchemaMixin.ts +15 -10
  61. package/src/js/generated/ErrorUnitSchemaMixin.ts +7 -5
  62. package/src/js/generated/ExecutionUnitInputSchemaMixin.ts +12 -8
  63. package/src/js/generated/ExecutionUnitSchemaMixin.ts +14 -9
  64. package/src/js/generated/IOUnitSchemaMixin.ts +7 -7
  65. package/src/js/generated/MapUnitSchemaMixin.ts +6 -6
  66. package/src/js/generated/ReduceUnitSchemaMixin.ts +8 -6
  67. package/src/js/generated/StatusTrackSchemaMixin.ts +24 -0
  68. package/src/js/generated/SubworkflowSchemaMixin.ts +12 -10
  69. package/src/js/generated/SubworkflowUnitSchemaMixin.ts +9 -4
  70. package/src/js/generated/WorkflowSchemaMixin.ts +10 -10
  71. package/src/js/units/AssertionUnit.ts +3 -7
  72. package/src/js/units/AssignmentUnit.ts +4 -7
  73. package/src/js/units/BaseUnit.ts +39 -29
  74. package/src/js/units/ConditionUnit.ts +3 -7
  75. package/src/js/units/ErrorUnit.ts +3 -7
  76. package/src/js/units/ExecutionUnit.ts +10 -15
  77. package/src/js/units/ExecutionUnitInput.ts +3 -10
  78. package/src/js/units/IOUnit.ts +3 -7
  79. package/src/js/units/MapUnit.ts +4 -10
  80. package/src/js/units/ReduceUnit.ts +3 -7
  81. package/src/js/units/SubworkflowUnit.ts +3 -7
  82. package/dist/js/WorkflowDesignerMaterial.d.ts +0 -21
  83. package/dist/js/WorkflowDesignerMaterial.js +0 -26
  84. package/dist/js/generated/StatusSchemaMixin.d.ts +0 -5
  85. package/dist/js/repair/createErrorUnitData.d.ts +0 -3
  86. package/dist/js/repair/createErrorUnitData.js +0 -25
  87. package/dist/js/repair/formatRepairReason.d.ts +0 -1
  88. package/dist/js/repair/formatRepairReason.js +0 -22
  89. package/dist/js/repair/types.d.ts +0 -16
  90. package/dist/js/repair/types.js +0 -2
  91. package/dist/js/subworkflows/convergence/enums.js +0 -15
  92. package/dist/js/subworkflows/convergence/factory.js +0 -36
  93. package/dist/js/subworkflows/subworkflow.js +0 -285
  94. package/dist/js/utils/subworkflow.d.ts +0 -2
  95. package/dist/js/utils/subworkflow.js +0 -29
  96. package/dist/js/utils/underscoreStringSlugify.d.ts +0 -6
  97. package/dist/js/utils/underscoreStringSlugify.js +0 -32
  98. package/dist/js/utils.js +0 -87
  99. package/dist/js/workflows/workflow.d.ts +0 -4404
  100. package/dist/js/workflows/workflow.js +0 -315
  101. package/src/js/generated/StatusSchemaMixin.ts +0 -28
@@ -4,7 +4,7 @@ import {
4
4
  defaultableEntityMixin,
5
5
  } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
6
6
  import {
7
- HashedEntity,
7
+ type HashedEntity,
8
8
  hashedEntityMixin,
9
9
  } from "@mat3ra/code/dist/js/entity/mixins/HashedEntityMixin";
10
10
  import {
@@ -15,16 +15,21 @@ import {
15
15
  type RuntimeItems,
16
16
  runtimeItemsMixin,
17
17
  } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
18
- import { Taggable, taggableMixin } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
18
+ import { type Taggable, taggableMixin } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
19
19
  import type { NameResultSchema } from "@mat3ra/code/dist/js/utils/object";
20
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
21
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
22
- import type { StatusSchema, WorkflowBaseUnitSchema } from "@mat3ra/esse/dist/js/types";
20
+ import type {
21
+ BaseInMemoryEntitySchema,
22
+ StatusSchema,
23
+ WorkflowBaseUnitSchema,
24
+ } from "@mat3ra/esse/dist/js/types";
23
25
  import { Utils } from "@mat3ra/utils";
24
26
 
25
27
  import { UnitStatus } from "../enums";
26
28
  import { type BaseUnitSchemaMixin, baseUnitSchemaMixin } from "../generated/BaseUnitSchemaMixin";
27
- import { type StatusSchemaMixin, statusSchemaMixin } from "../generated/StatusSchemaMixin";
29
+ import {
30
+ type StatusTrackSchemaMixin,
31
+ statusTrackSchemaMixin,
32
+ } from "../generated/StatusTrackSchemaMixin";
28
33
  import {
29
34
  type RuntimeItemsUILogic,
30
35
  runtimeItemsUILogicMixin,
@@ -32,21 +37,19 @@ import {
32
37
 
33
38
  type Schema = WorkflowBaseUnitSchema;
34
39
 
35
- type Base = typeof InMemoryEntity &
36
- Constructor<NamedEntity> &
37
- Constructor<Defaultable> &
38
- Constructor<Taggable> &
39
- Constructor<HashedEntity> &
40
- Constructor<RuntimeItems> &
41
- Constructor<RuntimeItemsUILogic> &
42
- Constructor<BaseUnitSchemaMixin> &
43
- Constructor<StatusSchemaMixin>;
44
-
45
- class BaseUnit<S extends Schema = Schema> extends (InMemoryEntity as Base) implements Schema {
46
- declare toJSON: () => Schema & AnyObject;
40
+ export type UnitEntity<S extends Schema = Schema> = S & BaseInMemoryEntitySchema;
47
41
 
48
- declare _json: Schema & AnyObject;
42
+ interface BaseUnitCore
43
+ extends BaseUnitSchemaMixin,
44
+ NamedEntity,
45
+ StatusTrackSchemaMixin,
46
+ Defaultable,
47
+ Taggable,
48
+ HashedEntity,
49
+ RuntimeItems,
50
+ RuntimeItemsUILogic {}
49
51
 
52
+ class BaseUnitCore extends InMemoryEntity<UnitEntity<Schema>> {
50
53
  defaultResults: NameResultSchema[] = [];
51
54
 
52
55
  defaultMonitors: NameResultSchema[] = [];
@@ -60,7 +63,7 @@ class BaseUnit<S extends Schema = Schema> extends (InMemoryEntity as Base) imple
60
63
  /**
61
64
  * @param config — `flowchartId` is optional; when absent, a new UUID is generated.
62
65
  */
63
- constructor(config: Partial<S> & Pick<S, "name">) {
66
+ constructor(config: Partial<Schema> & Pick<Schema, "name">) {
64
67
  super({
65
68
  results: [],
66
69
  monitors: [],
@@ -85,7 +88,8 @@ class BaseUnit<S extends Schema = Schema> extends (InMemoryEntity as Base) imple
85
88
  }
86
89
 
87
90
  getHashObject(): object {
88
- return { ...this.hashObjectFromRuntimeItems, type: this.type };
91
+ const { type } = this._json as { type?: string };
92
+ return { ...this.hashObjectFromRuntimeItems, ...(type !== undefined ? { type } : {}) };
89
93
  }
90
94
 
91
95
  isInStatus(status: StatusSchema["status"]) {
@@ -105,13 +109,19 @@ class BaseUnit<S extends Schema = Schema> extends (InMemoryEntity as Base) imple
105
109
  }
106
110
  }
107
111
 
108
- taggableMixin(BaseUnit.prototype);
109
- hashedEntityMixin(BaseUnit.prototype);
110
- runtimeItemsMixin(BaseUnit.prototype);
111
- runtimeItemsUILogicMixin(BaseUnit.prototype);
112
- baseUnitSchemaMixin(BaseUnit.prototype);
113
- statusSchemaMixin(BaseUnit.prototype);
114
- namedEntityMixin(BaseUnit.prototype);
115
- defaultableEntityMixin(BaseUnit);
112
+ taggableMixin(BaseUnitCore.prototype);
113
+ hashedEntityMixin(BaseUnitCore.prototype);
114
+ runtimeItemsMixin(BaseUnitCore.prototype);
115
+ runtimeItemsUILogicMixin(BaseUnitCore.prototype);
116
+ baseUnitSchemaMixin(BaseUnitCore.prototype);
117
+ statusTrackSchemaMixin(BaseUnitCore.prototype);
118
+ namedEntityMixin(BaseUnitCore.prototype);
119
+ defaultableEntityMixin(BaseUnitCore);
120
+
121
+ class BaseUnit<S extends Schema = Schema> extends BaseUnitCore {
122
+ declare _json: UnitEntity<S>;
123
+
124
+ declare toJSON: (exclude?: (keyof UnitEntity<S>)[]) => UnitEntity<S>;
125
+ }
116
126
 
117
127
  export default BaseUnit;
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { ConditionUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitType } from "../enums";
@@ -11,15 +10,12 @@ import {
11
10
  import BaseUnit from "./BaseUnit";
12
11
 
13
12
  type Schema = ConditionUnitSchema;
14
- type Base = typeof BaseUnit<Schema> & Constructor<ConditionUnitSchemaMixin>;
15
13
 
16
14
  export type ConditionUnitConfig = Partial<Schema>;
17
15
 
18
- class ConditionUnit extends (BaseUnit as Base) implements Schema {
19
- declare toJSON: () => Schema & AnyObject;
20
-
21
- declare _json: Schema & AnyObject;
16
+ interface ConditionUnit extends ConditionUnitSchemaMixin, Taggable {}
22
17
 
18
+ class ConditionUnit extends BaseUnit<Schema> implements Schema {
23
19
  static get jsonSchema() {
24
20
  return JSONSchemasInterface.getSchemaById("workflow/unit/condition");
25
21
  }
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { ErrorUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitStatus, UnitType } from "../enums";
@@ -8,15 +7,12 @@ import { type ErrorUnitSchemaMixin, errorUnitSchemaMixin } from "../generated/Er
8
7
  import BaseUnit from "./BaseUnit";
9
8
 
10
9
  type Schema = ErrorUnitSchema;
11
- type Base = typeof BaseUnit<Schema> & Constructor<ErrorUnitSchemaMixin>;
12
10
 
13
11
  export type ErrorUnitConfig = Partial<Schema>;
14
12
 
15
- class ErrorUnit extends (BaseUnit as Base) implements Schema {
16
- declare toJSON: () => Schema & AnyObject;
17
-
18
- declare _json: Schema & AnyObject;
13
+ interface ErrorUnit extends ErrorUnitSchemaMixin, Taggable {}
19
14
 
15
+ class ErrorUnit extends BaseUnit<Schema> implements Schema {
20
16
  static get jsonSchema() {
21
17
  return JSONSchemasInterface.getSchemaById("workflow/unit/error");
22
18
  }
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { ExecutionUnitInputItemSchema, ExecutionUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
  import { ApplicationRegistry, applicationVersionSatisfiesSupportedRange } from "@mat3ra/standata";
6
5
  import { Utils } from "@mat3ra/utils";
@@ -21,8 +20,6 @@ import ExecutionUnitInput from "./ExecutionUnitInput";
21
20
 
22
21
  type Schema = ExecutionUnitSchema;
23
22
 
24
- type Base = typeof BaseUnit & Constructor<ExecutionUnitSchemaMixin>;
25
-
26
23
  export type ExecutionUnitConfig = Omit<Partial<Schema>, "application"> & SetApplicationProps;
27
24
 
28
25
  type SetApplicationProps = Pick<Schema, "application"> &
@@ -34,17 +31,15 @@ type SetExecutableProps = {
34
31
  flavorName?: string;
35
32
  };
36
33
 
37
- class ExecutionUnit extends (BaseUnit as Base) implements Schema {
34
+ interface ExecutionUnit extends ExecutionUnitSchemaMixin, Taggable {}
35
+
36
+ class ExecutionUnit extends BaseUnit<Schema> implements Schema {
38
37
  inputInstances: ExecutionUnitInput[] = [];
39
38
 
40
39
  renderingContext: Partial<ExternalContext> = {};
41
40
 
42
41
  contextProvidersInstances: AnyContextProvider[] = [];
43
42
 
44
- declare toJSON: () => Schema & AnyObject;
45
-
46
- declare _json: Schema & AnyObject;
47
-
48
43
  static get jsonSchema() {
49
44
  return JSONSchemasInterface.getSchemaById("workflow/unit/execution");
50
45
  }
@@ -75,10 +70,10 @@ class ExecutionUnit extends (BaseUnit as Base) implements Schema {
75
70
  executableName,
76
71
  flavorName,
77
72
  }: SetApplicationProps) {
78
- const currentExecutable = this.prop<Schema["executable"]>("executable");
79
- const currentFlavor = this.prop<Schema["flavor"]>("flavor");
73
+ const currentExecutable = this._json.executable;
74
+ const currentFlavor = this._json.flavor;
80
75
 
81
- this.setProp("application", application);
76
+ this.application = application;
82
77
  this.setExecutable({
83
78
  executableName: executableName ?? executable?.name ?? currentExecutable?.name,
84
79
  flavorName: flavorName ?? flavor?.name ?? currentFlavor?.name,
@@ -96,7 +91,7 @@ class ExecutionUnit extends (BaseUnit as Base) implements Schema {
96
91
  throw new Error(`Executable ${executableName} not found`);
97
92
  }
98
93
 
99
- this.setProp("executable", executable);
94
+ this.executable = executable;
100
95
  this.setFlavor(flavorName);
101
96
  }
102
97
 
@@ -115,7 +110,7 @@ class ExecutionUnit extends (BaseUnit as Base) implements Schema {
115
110
  this.defaultPostProcessors = flavor.postProcessors;
116
111
 
117
112
  // flavor is missing on the first run, so do not use getter this.flavor with requiredProperty
118
- const previousFlavor = this.prop<Schema["flavor"]>("flavor");
113
+ const previousFlavor = this._json.flavor;
119
114
 
120
115
  if (previousFlavor?.name !== flavor.name) {
121
116
  this.results = flavor.results;
@@ -124,7 +119,7 @@ class ExecutionUnit extends (BaseUnit as Base) implements Schema {
124
119
  this.postProcessors = flavor.postProcessors;
125
120
  }
126
121
 
127
- this.setProp("flavor", flavor);
122
+ this.flavor = flavor;
128
123
  this.setDefaultInput();
129
124
  }
130
125
 
@@ -1,8 +1,7 @@
1
1
  import { Template } from "@mat3ra/ade";
2
2
  import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
3
3
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
4
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
5
- import type { TemplateSchema } from "@mat3ra/esse/dist/js/types";
4
+ import type { BaseInMemoryEntitySchema, TemplateSchema } from "@mat3ra/esse/dist/js/types";
6
5
  import { setupNunjucksEnvironment } from "@mat3ra/standata";
7
6
  import nunjucks from "nunjucks";
8
7
 
@@ -12,7 +11,7 @@ import {
12
11
  } from "../generated/ExecutionUnitInputSchemaMixin";
13
12
 
14
13
  type Schema = ExecutionUnitInputSchemaMixin;
15
- type JSON = Schema & AnyObject;
14
+ type ExecutionUnitInputEntity = Schema & BaseInMemoryEntitySchema;
16
15
  type ConstructorConfig = Schema | (Omit<Schema, "template"> & { template: Template });
17
16
 
18
17
  const env = setupNunjucksEnvironment(new nunjucks.Environment());
@@ -20,13 +19,7 @@ const env = setupNunjucksEnvironment(new nunjucks.Environment());
20
19
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
21
20
  interface ExecutionUnitInput extends ExecutionUnitInputSchemaMixin {}
22
21
 
23
- class ExecutionUnitInput extends InMemoryEntity implements Schema {
24
- declare _json: JSON;
25
-
26
- declare toJSON: () => JSON;
27
-
28
- declare toJSONQuick: () => JSON;
29
-
22
+ class ExecutionUnitInput extends InMemoryEntity<ExecutionUnitInputEntity> implements Schema {
30
23
  static get jsonSchema() {
31
24
  return JSONSchemasInterface.getSchemaById("workflow/unit/input/-inputItem");
32
25
  }
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { DataIOUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitType } from "../enums";
@@ -8,15 +7,12 @@ import { type IOUnitSchemaMixin, iOUnitSchemaMixin } from "../generated/IOUnitSc
8
7
  import BaseUnit from "./BaseUnit";
9
8
 
10
9
  type Schema = DataIOUnitSchema;
11
- type Base = typeof BaseUnit<Schema> & Constructor<IOUnitSchemaMixin>;
12
10
 
13
11
  export type IOUnitConfig = Partial<Schema>;
14
12
 
15
- class IOUnit extends (BaseUnit as Base) implements Schema {
16
- declare toJSON: () => Schema & AnyObject;
17
-
18
- declare _json: Schema & AnyObject;
13
+ interface IOUnit extends IOUnitSchemaMixin, Taggable {}
19
14
 
15
+ class IOUnit extends BaseUnit<Schema> implements Schema {
20
16
  static get jsonSchema() {
21
17
  return JSONSchemasInterface.getSchemaById("workflow/unit/io");
22
18
  }
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { MapUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitType } from "../enums";
@@ -25,16 +24,11 @@ export const defaultMapConfig = {
25
24
  preProcessors: [],
26
25
  postProcessors: [],
27
26
  };
28
-
29
- type Base = typeof BaseUnit<Schema> & Constructor<MapUnitSchemaMixin>;
30
-
31
27
  export type MapUnitConfig = Partial<Omit<Schema, "type">>;
32
28
 
33
- class MapUnit extends (BaseUnit as Base) implements Schema {
34
- declare toJSON: () => Schema & AnyObject;
35
-
36
- declare _json: Schema & AnyObject;
29
+ interface MapUnit extends MapUnitSchemaMixin, Taggable {}
37
30
 
31
+ class MapUnit extends BaseUnit<Schema> implements Schema {
38
32
  static get jsonSchema() {
39
33
  return JSONSchemasInterface.getSchemaById("workflow/unit/flowchart");
40
34
  }
@@ -50,7 +44,7 @@ class MapUnit extends (BaseUnit as Base) implements Schema {
50
44
  }
51
45
 
52
46
  setWorkflowId(id: string) {
53
- this.setProp("workflowId", id);
47
+ this.workflowId = id;
54
48
  }
55
49
  }
56
50
 
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { ReduceUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitType } from "../enums";
@@ -11,16 +10,13 @@ import {
11
10
  import BaseUnit from "./BaseUnit";
12
11
 
13
12
  type Schema = ReduceUnitSchema;
14
- type Base = typeof BaseUnit<Schema> & Constructor<ReduceUnitSchemaMixin>;
15
13
 
16
14
  export type ReduceUnitConfig = Partial<Omit<Schema, "type" | "flowchartId">> &
17
15
  Pick<Schema, "flowchartId">;
18
16
 
19
- class ReduceUnit extends (BaseUnit as Base) implements Schema {
20
- declare toJSON: () => Schema & AnyObject;
21
-
22
- declare _json: Schema & AnyObject;
17
+ interface ReduceUnit extends ReduceUnitSchemaMixin, Taggable {}
23
18
 
19
+ class ReduceUnit extends BaseUnit<Schema> implements Schema {
24
20
  static get jsonSchema() {
25
21
  return JSONSchemasInterface.getSchemaById("workflow/unit/flowchart");
26
22
  }
@@ -1,6 +1,5 @@
1
- import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
1
+ import { type Taggable } from "@mat3ra/code/dist/js/entity/mixins/TaggableMixin";
2
2
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { SubworkflowUnitSchema } from "@mat3ra/esse/dist/js/types";
5
4
 
6
5
  import { UnitType } from "../enums";
@@ -11,16 +10,13 @@ import {
11
10
  import BaseUnit from "./BaseUnit";
12
11
 
13
12
  type Schema = SubworkflowUnitSchema;
14
- type Base = typeof BaseUnit<Schema> & Constructor<SubworkflowUnitSchemaMixin>;
15
13
 
16
14
  export type SubworkflowUnitConfig = Partial<Omit<Schema, "flowchartId">> &
17
15
  Pick<Schema, "flowchartId">;
18
16
 
19
- class SubworkflowUnit extends (BaseUnit as Base) implements Schema {
20
- declare toJSON: () => Schema & AnyObject;
21
-
22
- declare _json: Schema & AnyObject;
17
+ interface SubworkflowUnit extends SubworkflowUnitSchemaMixin, Taggable {}
23
18
 
19
+ class SubworkflowUnit extends BaseUnit<Schema> implements Schema {
24
20
  static get jsonSchema() {
25
21
  return JSONSchemasInterface.getSchemaById("workflow/unit/subworkflow");
26
22
  }
@@ -1,21 +0,0 @@
1
- import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import { type InMemoryEntityInSet } from "@mat3ra/code/dist/js/entity/set/InMemoryEntityInSetMixin";
3
- import type { OrderedInMemoryEntityInSet } from "@mat3ra/code/dist/js/entity/set/ordered/OrderedInMemoryEntityInSetMixin";
4
- import type { ConsistencyCheck, MaterialSchema } from "@mat3ra/esse/dist/js/types";
5
- import { Material } from "@mat3ra/made";
6
- type Schema = Omit<MaterialSchema, "consistencyChecks"> & {
7
- consistencyChecks?: ConsistencyCheck[];
8
- };
9
- interface WorkflowDesignerMaterial extends InMemoryEntityInSet, OrderedInMemoryEntityInSet {
10
- }
11
- /**
12
- * `Material` with `OrderedInMemoryEntityInSet` for workflow designer / map nested `Workflow.render`
13
- * (expects `OrderedMaterial` in render context), mirroring app materials that use ordered-set mixins.
14
- */
15
- declare class WorkflowDesignerMaterial extends Material implements Schema {
16
- constructor(config?: object | InMemoryEntity);
17
- static createDefault(): WorkflowDesignerMaterial;
18
- /** Wrap any `Material` as `OrderedMaterial` for `Workflow.render`. */
19
- static fromMaterial(material: Material): WorkflowDesignerMaterial;
20
- }
21
- export default WorkflowDesignerMaterial;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const entity_1 = require("@mat3ra/code/dist/js/entity");
4
- const InMemoryEntityInSetMixin_1 = require("@mat3ra/code/dist/js/entity/set/InMemoryEntityInSetMixin");
5
- const OrderedInMemoryEntityInSetMixin_1 = require("@mat3ra/code/dist/js/entity/set/ordered/OrderedInMemoryEntityInSetMixin");
6
- const made_1 = require("@mat3ra/made");
7
- /**
8
- * `Material` with `OrderedInMemoryEntityInSet` for workflow designer / map nested `Workflow.render`
9
- * (expects `OrderedMaterial` in render context), mirroring app materials that use ordered-set mixins.
10
- */
11
- class WorkflowDesignerMaterial extends made_1.Material {
12
- constructor(config = {}) {
13
- super(config instanceof entity_1.InMemoryEntity ? config.toJSON() : config);
14
- this.setProp("inSet", this.prop("inSet", []));
15
- }
16
- static createDefault() {
17
- return new WorkflowDesignerMaterial(made_1.defaultMaterialConfig);
18
- }
19
- /** Wrap any `Material` as `OrderedMaterial` for `Workflow.render`. */
20
- static fromMaterial(material) {
21
- return new WorkflowDesignerMaterial(material.toJSON());
22
- }
23
- }
24
- (0, InMemoryEntityInSetMixin_1.inMemoryEntityInSetMixin)(WorkflowDesignerMaterial.prototype);
25
- (0, OrderedInMemoryEntityInSetMixin_1.orderedEntityInSetMixin)(WorkflowDesignerMaterial.prototype);
26
- exports.default = WorkflowDesignerMaterial;
@@ -1,5 +0,0 @@
1
- import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { StatusSchema } from "@mat3ra/esse/dist/js/types";
3
- export type StatusSchemaMixin = StatusSchema;
4
- export type StatusInMemoryEntity = InMemoryEntity & StatusSchemaMixin;
5
- export declare function statusSchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & StatusSchemaMixin;
@@ -1,3 +0,0 @@
1
- import type { ErrorUnitSchema } from "@mat3ra/esse/dist/js/types";
2
- import type { AnySubworkflowUnitSchema } from "../units/factory";
3
- export declare function createErrorUnitData(unitData: AnySubworkflowUnitSchema | Record<string, unknown>, reason: string): ErrorUnitSchema;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createErrorUnitData = createErrorUnitData;
4
- const utils_1 = require("@mat3ra/utils");
5
- const enums_1 = require("../enums");
6
- function createErrorUnitData(unitData, reason) {
7
- const original = structuredClone(unitData);
8
- return {
9
- results: [],
10
- preProcessors: [],
11
- postProcessors: [],
12
- monitors: [],
13
- name: typeof original.name === "string" ? original.name : enums_1.UnitType.error,
14
- type: enums_1.UnitType.error,
15
- status: enums_1.UnitStatus.error,
16
- flowchartId: typeof original.flowchartId === "string" ? original.flowchartId : utils_1.Utils.uuid.getUUID(),
17
- originalUnit: original,
18
- reason,
19
- ...(typeof original._id === "string" ? { _id: original._id } : {}),
20
- ...(typeof original.next === "string" ? { next: original.next } : {}),
21
- ...(original.head === true ? { head: true } : {}),
22
- ...(Array.isArray(original.statusTrack) ? { statusTrack: original.statusTrack } : {}),
23
- ...(Array.isArray(original.tags) ? { tags: original.tags } : {}),
24
- };
25
- }
@@ -1 +0,0 @@
1
- export declare function formatRepairReason(error: unknown): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatRepairReason = formatRepairReason;
4
- function formatRepairReason(error) {
5
- var _a;
6
- if (error && typeof error === "object") {
7
- const entityError = error;
8
- if (((_a = entityError.details) === null || _a === void 0 ? void 0 : _a.error) !== undefined) {
9
- return JSON.stringify(entityError.details.error);
10
- }
11
- if (typeof entityError.message === "string" && entityError.message.length > 0) {
12
- return entityError.message;
13
- }
14
- if (typeof entityError.code === "string" && entityError.code.length > 0) {
15
- return entityError.code;
16
- }
17
- }
18
- if (error instanceof Error) {
19
- return error.message;
20
- }
21
- return String(error);
22
- }
@@ -1,16 +0,0 @@
1
- import type { SubworkflowSchema, WorkflowSchema } from "@mat3ra/esse/dist/js/types";
2
- export type SubworkflowUnitRepairRecord = {
3
- subworkflowId: string;
4
- flowchartId: string;
5
- reason: string;
6
- };
7
- export type SubworkflowRepairResult = {
8
- document: SubworkflowSchema;
9
- changed: boolean;
10
- repairs: SubworkflowUnitRepairRecord[];
11
- };
12
- export type WorkflowRepairResult = {
13
- document: WorkflowSchema;
14
- changed: boolean;
15
- repairs: SubworkflowUnitRepairRecord[];
16
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ConvergenceParameterName = void 0;
7
- var _schemas = _interopRequireDefault(require("@mat3ra/esse/dist/js/schemas.json"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const convergenceEnumOptionsSchema = _schemas.default.find(schema => schema.$id === "workflow/subworkflow/convergence/enum-options");
10
- const values = convergenceEnumOptionsSchema?.definitions?.ConvergenceParameterNameEnum?.enum || [];
11
- const ConvergenceParameterName = exports.ConvergenceParameterName = Object.freeze({
12
- N_k: values[0] || "N_k",
13
- N_k_nonuniform: values[1] || "N_k_nonuniform",
14
- N_k_nonuniform_2D: values[2] || "N_k_nonuniform_2D"
15
- });
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createConvergenceParameter = createConvergenceParameter;
7
- var _enums = require("./enums");
8
- var _non_uniform_kgrid = require("./non_uniform_kgrid");
9
- var _parameter = require("./parameter");
10
- var _uniform_kgrid = require("./uniform_kgrid");
11
- function createConvergenceParameter({
12
- name,
13
- initialValue,
14
- increment
15
- }) {
16
- switch (name) {
17
- case _enums.ConvergenceParameterName.N_k:
18
- return new _uniform_kgrid.UniformKGridConvergence({
19
- name,
20
- initialValue,
21
- increment
22
- });
23
- case _enums.ConvergenceParameterName.N_k_nonuniform:
24
- return new _non_uniform_kgrid.NonUniformKGridConvergence({
25
- name,
26
- initialValue,
27
- increment
28
- });
29
- default:
30
- return new _parameter.ConvergenceParameter({
31
- name,
32
- initialValue,
33
- increment
34
- });
35
- }
36
- }