@mat3ra/ade 2026.5.29-0 → 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.
@@ -2,18 +2,16 @@ import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
2
  import { type Defaultable } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
3
3
  import { HashedEntity } from "@mat3ra/code/dist/js/entity/mixins/HashedEntityMixin";
4
4
  import { type NamedEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
5
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
6
5
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
7
6
  import type { ApplicationSchema } from "@mat3ra/esse/dist/js/types";
8
7
  import { type ApplicationSchemaMixin } from "./generated/ApplicationSchemaMixin";
9
- export type DefaultApplicationConfig = Pick<ApplicationSchema, "name" | "shortName" | "version" | "summary" | "build">;
8
+ type Schema = ApplicationSchema;
9
+ export type DefaultApplicationConfig = Pick<Schema, "name" | "shortName" | "version" | "summary" | "build">;
10
10
  interface Application extends ApplicationSchemaMixin, NamedEntity, Defaultable, HashedEntity {
11
11
  }
12
- declare class Application extends InMemoryEntity implements ApplicationSchema {
13
- constructor(data?: Partial<ApplicationSchema>);
12
+ declare class Application<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
14
13
  static get jsonSchema(): JSONSchema;
15
14
  static createDefault: () => Application;
16
- toJSON: () => ApplicationSchema & AnyObject;
17
15
  getHashObject(): {
18
16
  name: string;
19
17
  version: string;
@@ -10,11 +10,6 @@ const NamedEntityMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/NamedEnti
10
10
  const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
11
11
  const ApplicationSchemaMixin_1 = require("./generated/ApplicationSchemaMixin");
12
12
  class Application extends entity_1.InMemoryEntity {
13
- constructor(data = {}) {
14
- super({
15
- ...data,
16
- });
17
- }
18
13
  static get jsonSchema() {
19
14
  const schema = JSONSchemasInterface_1.default.getSchemaById("software/application");
20
15
  if (schema === undefined) {
@@ -1,20 +1,19 @@
1
1
  import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
2
  import { type Defaultable } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
3
3
  import { type NamedEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
4
- import type { RuntimeItemsInMemoryEntity } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
5
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
+ import type { RuntimeItemsSchemaMixin } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
6
5
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
7
6
  import type { ExecutableSchema } from "@mat3ra/esse/dist/js/types";
8
7
  import { type ExecutableSchemaMixin } from "./generated/ExecutableSchemaMixin";
9
8
  import type { PartialBy } from "./typeUtils";
9
+ type Schema = ExecutableSchema;
10
10
  /** Input for {@link Executable}: runtime item lists default to empty when omitted. */
11
- export type ExecutableConstructorData = PartialBy<ExecutableSchema, "monitors" | "results" | "postProcessors" | "preProcessors">;
12
- interface Executable extends ExecutableSchemaMixin, RuntimeItemsInMemoryEntity, NamedEntity, Defaultable {
11
+ export type ExecutableConstructorData<S extends Schema = Schema> = PartialBy<S, "monitors" | "results" | "postProcessors" | "preProcessors">;
12
+ interface Executable extends ExecutableSchemaMixin, RuntimeItemsSchemaMixin, NamedEntity, Defaultable {
13
13
  }
14
- declare class Executable extends InMemoryEntity implements ExecutableSchema {
15
- constructor(data: ExecutableConstructorData);
14
+ declare class Executable<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
15
+ constructor(data: NoInfer<ExecutableConstructorData<S>>);
16
16
  static get jsonSchema(): JSONSchema;
17
17
  static createDefault: () => Executable;
18
- toJSON: () => ExecutableSchema & AnyObject;
19
18
  }
20
19
  export default Executable;
@@ -10,6 +10,7 @@ const RuntimeItemsMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/RuntimeI
10
10
  const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
11
11
  const ExecutableSchemaMixin_1 = require("./generated/ExecutableSchemaMixin");
12
12
  class Executable extends entity_1.InMemoryEntity {
13
+ // NoInfer: keep default S (or an explicit type arg) instead of inferring S from the data literal.
13
14
  constructor(data) {
14
15
  var _a, _b, _c, _d;
15
16
  super({
@@ -1,17 +1,19 @@
1
1
  import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
2
  import { type Defaultable } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
3
3
  import { type NamedEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
4
- import type { RuntimeItemsInMemoryEntity } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
5
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
+ import type { RuntimeItemsSchemaMixin } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
6
5
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
7
6
  import type { FlavorSchema } from "@mat3ra/esse/dist/js/types";
8
7
  import { type FlavorSchemaMixin } from "./generated/FlavorSchemaMixin";
9
- interface Flavor extends FlavorSchemaMixin, RuntimeItemsInMemoryEntity, NamedEntity, Defaultable {
8
+ import type { PartialBy } from "./typeUtils";
9
+ type Schema = FlavorSchema;
10
+ interface Flavor extends FlavorSchemaMixin, RuntimeItemsSchemaMixin, NamedEntity, Defaultable {
10
11
  }
11
- declare class Flavor extends InMemoryEntity implements FlavorSchema {
12
- constructor(data?: Partial<FlavorSchema>);
12
+ /** Input for {@link Flavor}: runtime item lists default to empty when omitted. */
13
+ export type FlavorConstructorData<S extends Schema = Schema> = PartialBy<S, "monitors" | "results" | "postProcessors" | "preProcessors">;
14
+ declare class Flavor<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
15
+ constructor(data: NoInfer<FlavorConstructorData<S>>);
13
16
  static get jsonSchema(): JSONSchema;
14
17
  static createDefault: () => Flavor;
15
- toJSON: () => FlavorSchema & AnyObject;
16
18
  }
17
19
  export default Flavor;
package/dist/js/Flavor.js CHANGED
@@ -10,17 +10,15 @@ const RuntimeItemsMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/RuntimeI
10
10
  const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
11
11
  const FlavorSchemaMixin_1 = require("./generated/FlavorSchemaMixin");
12
12
  class Flavor extends entity_1.InMemoryEntity {
13
- constructor(data = {}) {
13
+ // NoInfer: keep default S (or an explicit type arg) instead of inferring S from the data literal.
14
+ constructor(data) {
15
+ var _a, _b, _c, _d;
14
16
  super({
15
- monitors: [],
16
- results: [],
17
- postProcessors: [],
18
- preProcessors: [],
19
- input: [],
20
- executableId: "",
21
- executableName: "",
22
- applicationName: "",
23
17
  ...data,
18
+ monitors: (_a = data.monitors) !== null && _a !== void 0 ? _a : [],
19
+ results: (_b = data.results) !== null && _b !== void 0 ? _b : [],
20
+ postProcessors: (_c = data.postProcessors) !== null && _c !== void 0 ? _c : [],
21
+ preProcessors: (_d = data.preProcessors) !== null && _d !== void 0 ? _d : [],
24
22
  });
25
23
  }
26
24
  static get jsonSchema() {
@@ -1,16 +1,14 @@
1
1
  import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
2
  import { type NamedEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
3
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
4
3
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
5
4
  import type { TemplateSchema } from "@mat3ra/esse/dist/js/types";
6
5
  import { type TemplateSchemaMixin } from "./generated/TemplateSchemaMixin";
7
6
  import type { PartialBy } from "./typeUtils";
7
+ type Schema = TemplateSchema;
8
8
  interface Template extends TemplateSchemaMixin, NamedEntity {
9
9
  }
10
- export type DefaultTemplateConfig = PartialBy<TemplateSchema, "content" | "contextProviders">;
11
- declare class Template extends InMemoryEntity implements TemplateSchema {
12
- constructor(data: DefaultTemplateConfig);
10
+ export type DefaultTemplateConfig = PartialBy<Schema, "content" | "contextProviders">;
11
+ declare class Template<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
13
12
  static get jsonSchema(): JSONSchema;
14
- toJSON: () => TemplateSchema & AnyObject;
15
13
  }
16
14
  export default Template;
@@ -8,14 +8,6 @@ const NamedEntityMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/NamedEnti
8
8
  const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
9
9
  const TemplateSchemaMixin_1 = require("./generated/TemplateSchemaMixin");
10
10
  class Template extends entity_1.InMemoryEntity {
11
- constructor(data) {
12
- const templateData = {
13
- content: "",
14
- contextProviders: [],
15
- ...data,
16
- };
17
- super(templateData);
18
- }
19
11
  static get jsonSchema() {
20
12
  const schema = JSONSchemasInterface_1.default.getSchemaById("software/template");
21
13
  if (schema === undefined) {
@@ -1,5 +1,5 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { ApplicationPropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type { ApplicationPropertiesSchema, BaseInMemoryEntitySchema } from "@mat3ra/esse/dist/js/types";
3
3
  export type ApplicationSchemaMixin = ApplicationPropertiesSchema;
4
- export type ApplicationInMemoryEntity = InMemoryEntity & ApplicationSchemaMixin;
4
+ export type ApplicationInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & ApplicationSchemaMixin>;
5
5
  export declare function applicationSchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & ApplicationSchemaMixin;
@@ -53,11 +53,17 @@ function applicationSchemaMixin(item) {
53
53
  this.setProp("isLicensed", value);
54
54
  },
55
55
  get isUsingMaterial() {
56
- return this.prop("isUsingMaterial", false);
56
+ return this.prop("isUsingMaterial");
57
57
  },
58
58
  set isUsingMaterial(value) {
59
59
  this.setProp("isUsingMaterial", value);
60
60
  },
61
+ get runConfig() {
62
+ return this.prop("runConfig");
63
+ },
64
+ set runConfig(value) {
65
+ this.setProp("runConfig", value);
66
+ },
61
67
  };
62
68
  Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
63
69
  }
@@ -1,5 +1,5 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { ExecutablePropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type { BaseInMemoryEntitySchema, ExecutablePropertiesSchema } from "@mat3ra/esse/dist/js/types";
3
3
  export type ExecutableSchemaMixin = ExecutablePropertiesSchema;
4
- export type ExecutableInMemoryEntity = InMemoryEntity & ExecutableSchemaMixin;
4
+ export type ExecutableInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & ExecutableSchemaMixin>;
5
5
  export declare function executableSchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & ExecutableSchemaMixin;
@@ -1,5 +1,5 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { FlavorPropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type { BaseInMemoryEntitySchema, FlavorPropertiesSchema } from "@mat3ra/esse/dist/js/types";
3
3
  export type FlavorSchemaMixin = FlavorPropertiesSchema;
4
- export type FlavorInMemoryEntity = InMemoryEntity & FlavorSchemaMixin;
4
+ export type FlavorInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & FlavorSchemaMixin>;
5
5
  export declare function flavorSchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & FlavorSchemaMixin;
@@ -1,5 +1,5 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { TemplatePropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type { BaseInMemoryEntitySchema, TemplatePropertiesSchema } from "@mat3ra/esse/dist/js/types";
3
3
  export type TemplateSchemaMixin = TemplatePropertiesSchema;
4
- export type TemplateInMemoryEntity = InMemoryEntity & TemplateSchemaMixin;
4
+ export type TemplateInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & TemplateSchemaMixin>;
5
5
  export declare function templateSchemaMixin<T extends InMemoryEntity>(item: InMemoryEntity): asserts item is T & TemplateSchemaMixin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mat3ra/ade",
3
- "version": "2026.5.29-0",
3
+ "version": "2026.8.18-0",
4
4
  "description": "Application DEfinitions",
5
5
  "scripts": {
6
6
  "test": "nyc --reporter=text mocha --recursive --bail tests/js/**/*.ts",
@@ -13,7 +13,8 @@
13
13
  "transpile": "tsc -p tsconfig.json",
14
14
  "prettier": "prettier --check src/js tests/js",
15
15
  "prepare": "husky install",
16
- "generate-mixins": "ts-node scripts/generate-mixins.ts"
16
+ "generate-mixins": "ts-node scripts/generate-mixins.ts",
17
+ "prepublishOnly": "npm run transpile"
17
18
  },
18
19
  "repository": {
19
20
  "type": "git",
@@ -48,10 +49,11 @@
48
49
  "devDependencies": {
49
50
  "@babel/eslint-parser": "^7.28.6",
50
51
  "@exabyte-io/eslint-config": "2025.5.13-0",
51
- "@mat3ra/code": "2026.5.27-0",
52
- "@mat3ra/esse": "2026.5.27-0",
53
- "@mat3ra/standata": "2026.5.28-0",
52
+ "@mat3ra/code": "2026.8.18-0",
53
+ "@mat3ra/esse": "2026.8.18-2",
54
+ "@mat3ra/standata": "https://github.com/mat3ra/standata/releases/download/wip-c5ba9be/standata.tgz",
54
55
  "@mat3ra/tsconfig": "2024.6.3-0",
56
+ "@types/node": "^22.20.1",
55
57
  "@typescript-eslint/eslint-plugin": "^5.62.0",
56
58
  "@typescript-eslint/parser": "^5.62.0",
57
59
  "chai": "^4.5.0",
@@ -12,7 +12,6 @@ import {
12
12
  namedEntityMixin,
13
13
  } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
14
14
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
15
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
16
15
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
17
16
  import type { ApplicationSchema } from "@mat3ra/esse/dist/js/types";
18
17
 
@@ -21,20 +20,16 @@ import {
21
20
  applicationSchemaMixin,
22
21
  } from "./generated/ApplicationSchemaMixin";
23
22
 
23
+ type Schema = ApplicationSchema;
24
+
24
25
  export type DefaultApplicationConfig = Pick<
25
- ApplicationSchema,
26
+ Schema,
26
27
  "name" | "shortName" | "version" | "summary" | "build"
27
28
  >;
28
29
 
29
30
  interface Application extends ApplicationSchemaMixin, NamedEntity, Defaultable, HashedEntity {}
30
31
 
31
- class Application extends InMemoryEntity implements ApplicationSchema {
32
- constructor(data: Partial<ApplicationSchema> = {}) {
33
- super({
34
- ...data,
35
- });
36
- }
37
-
32
+ class Application<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
38
33
  static get jsonSchema(): JSONSchema {
39
34
  const schema = JSONSchemasInterface.getSchemaById("software/application");
40
35
  if (schema === undefined) {
@@ -45,8 +40,6 @@ class Application extends InMemoryEntity implements ApplicationSchema {
45
40
 
46
41
  declare static createDefault: () => Application;
47
42
 
48
- declare toJSON: () => ApplicationSchema & AnyObject;
49
-
50
43
  getHashObject() {
51
44
  return {
52
45
  name: this.name,
@@ -8,9 +8,8 @@ import {
8
8
  namedEntityMixin,
9
9
  } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
10
10
  import { runtimeItemsMixin } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
11
- import type { RuntimeItemsInMemoryEntity } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
11
+ import type { RuntimeItemsSchemaMixin } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
12
12
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
13
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
14
13
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
15
14
  import type { ExecutableSchema } from "@mat3ra/esse/dist/js/types";
16
15
 
@@ -20,27 +19,30 @@ import {
20
19
  } from "./generated/ExecutableSchemaMixin";
21
20
  import type { PartialBy } from "./typeUtils";
22
21
 
22
+ type Schema = ExecutableSchema;
23
+
23
24
  /** Input for {@link Executable}: runtime item lists default to empty when omitted. */
24
- export type ExecutableConstructorData = PartialBy<
25
- ExecutableSchema,
25
+ export type ExecutableConstructorData<S extends Schema = Schema> = PartialBy<
26
+ S,
26
27
  "monitors" | "results" | "postProcessors" | "preProcessors"
27
28
  >;
28
29
 
29
30
  interface Executable
30
31
  extends ExecutableSchemaMixin,
31
- RuntimeItemsInMemoryEntity,
32
+ RuntimeItemsSchemaMixin,
32
33
  NamedEntity,
33
34
  Defaultable {}
34
35
 
35
- class Executable extends InMemoryEntity implements ExecutableSchema {
36
- constructor(data: ExecutableConstructorData) {
36
+ class Executable<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
37
+ // NoInfer: keep default S (or an explicit type arg) instead of inferring S from the data literal.
38
+ constructor(data: NoInfer<ExecutableConstructorData<S>>) {
37
39
  super({
38
40
  ...data,
39
41
  monitors: data.monitors ?? [],
40
42
  results: data.results ?? [],
41
43
  postProcessors: data.postProcessors ?? [],
42
44
  preProcessors: data.preProcessors ?? [],
43
- });
45
+ } as S);
44
46
  }
45
47
 
46
48
  static get jsonSchema(): JSONSchema {
@@ -52,8 +54,6 @@ class Executable extends InMemoryEntity implements ExecutableSchema {
52
54
  }
53
55
 
54
56
  declare static createDefault: () => Executable;
55
-
56
- declare toJSON: () => ExecutableSchema & AnyObject;
57
57
  }
58
58
 
59
59
  namedEntityMixin(Executable.prototype);
package/src/js/Flavor.ts CHANGED
@@ -8,29 +8,34 @@ import {
8
8
  namedEntityMixin,
9
9
  } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
10
10
  import { runtimeItemsMixin } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
11
- import type { RuntimeItemsInMemoryEntity } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
11
+ import type { RuntimeItemsSchemaMixin } from "@mat3ra/code/dist/js/generated/RuntimeItemsSchemaMixin";
12
12
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
13
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
14
13
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
15
14
  import type { FlavorSchema } from "@mat3ra/esse/dist/js/types";
16
15
 
17
16
  import { type FlavorSchemaMixin, flavorSchemaMixin } from "./generated/FlavorSchemaMixin";
17
+ import type { PartialBy } from "./typeUtils";
18
18
 
19
- interface Flavor extends FlavorSchemaMixin, RuntimeItemsInMemoryEntity, NamedEntity, Defaultable {}
19
+ type Schema = FlavorSchema;
20
20
 
21
- class Flavor extends InMemoryEntity implements FlavorSchema {
22
- constructor(data: Partial<FlavorSchema> = {}) {
21
+ interface Flavor extends FlavorSchemaMixin, RuntimeItemsSchemaMixin, NamedEntity, Defaultable {}
22
+
23
+ /** Input for {@link Flavor}: runtime item lists default to empty when omitted. */
24
+ export type FlavorConstructorData<S extends Schema = Schema> = PartialBy<
25
+ S,
26
+ "monitors" | "results" | "postProcessors" | "preProcessors"
27
+ >;
28
+
29
+ class Flavor<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
30
+ // NoInfer: keep default S (or an explicit type arg) instead of inferring S from the data literal.
31
+ constructor(data: NoInfer<FlavorConstructorData<S>>) {
23
32
  super({
24
- monitors: [],
25
- results: [],
26
- postProcessors: [],
27
- preProcessors: [],
28
- input: [],
29
- executableId: "",
30
- executableName: "",
31
- applicationName: "",
32
33
  ...data,
33
- });
34
+ monitors: data.monitors ?? [],
35
+ results: data.results ?? [],
36
+ postProcessors: data.postProcessors ?? [],
37
+ preProcessors: data.preProcessors ?? [],
38
+ } as S);
34
39
  }
35
40
 
36
41
  static get jsonSchema(): JSONSchema {
@@ -42,8 +47,6 @@ class Flavor extends InMemoryEntity implements FlavorSchema {
42
47
  }
43
48
 
44
49
  declare static createDefault: () => Flavor;
45
-
46
- declare toJSON: () => FlavorSchema & AnyObject;
47
50
  }
48
51
 
49
52
  namedEntityMixin(Flavor.prototype);
@@ -4,28 +4,19 @@ import {
4
4
  namedEntityMixin,
5
5
  } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
6
6
  import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
7
- import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
8
7
  import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
9
8
  import type { TemplateSchema } from "@mat3ra/esse/dist/js/types";
10
9
 
11
10
  import { type TemplateSchemaMixin, templateSchemaMixin } from "./generated/TemplateSchemaMixin";
12
11
  import type { PartialBy } from "./typeUtils";
13
12
 
14
- interface Template extends TemplateSchemaMixin, NamedEntity {}
13
+ type Schema = TemplateSchema;
15
14
 
16
- export type DefaultTemplateConfig = PartialBy<TemplateSchema, "content" | "contextProviders">;
15
+ interface Template extends TemplateSchemaMixin, NamedEntity {}
17
16
 
18
- class Template extends InMemoryEntity implements TemplateSchema {
19
- constructor(data: DefaultTemplateConfig) {
20
- const templateData: TemplateSchema = {
21
- content: "",
22
- contextProviders: [],
23
- ...data,
24
- };
25
-
26
- super(templateData);
27
- }
17
+ export type DefaultTemplateConfig = PartialBy<Schema, "content" | "contextProviders">;
28
18
 
19
+ class Template<S extends Schema = Schema> extends InMemoryEntity<S> implements Schema {
29
20
  static get jsonSchema(): JSONSchema {
30
21
  const schema = JSONSchemasInterface.getSchemaById("software/template");
31
22
  if (schema === undefined) {
@@ -33,8 +24,6 @@ class Template extends InMemoryEntity implements TemplateSchema {
33
24
  }
34
25
  return schema;
35
26
  }
36
-
37
- declare toJSON: () => TemplateSchema & AnyObject;
38
27
  }
39
28
 
40
29
  namedEntityMixin(Template.prototype);
@@ -1,55 +1,58 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { ApplicationPropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type {
3
+ ApplicationPropertiesSchema,
4
+ BaseInMemoryEntitySchema,
5
+ } from "@mat3ra/esse/dist/js/types";
3
6
 
4
7
  export type ApplicationSchemaMixin = ApplicationPropertiesSchema;
5
8
 
6
- export type ApplicationInMemoryEntity = InMemoryEntity & ApplicationSchemaMixin;
9
+ export type ApplicationInMemoryEntity = InMemoryEntity<
10
+ BaseInMemoryEntitySchema & ApplicationSchemaMixin
11
+ >;
7
12
 
8
13
  export function applicationSchemaMixin<T extends InMemoryEntity>(
9
14
  item: InMemoryEntity,
10
15
  ): asserts item is T & ApplicationSchemaMixin {
11
16
  // @ts-expect-error
12
- const properties: InMemoryEntity & ApplicationSchemaMixin = {
17
+ const properties: InMemoryEntity<ApplicationSchemaMixin> & ApplicationSchemaMixin = {
13
18
  get shortName() {
14
- return this.requiredProp<ApplicationPropertiesSchema["shortName"]>("shortName");
19
+ return this.requiredProp("shortName");
15
20
  },
16
21
  set shortName(value: ApplicationPropertiesSchema["shortName"]) {
17
22
  this.setProp("shortName", value);
18
23
  },
19
24
  get summary() {
20
- return this.requiredProp<ApplicationPropertiesSchema["summary"]>("summary");
25
+ return this.requiredProp("summary");
21
26
  },
22
27
  set summary(value: ApplicationPropertiesSchema["summary"]) {
23
28
  this.setProp("summary", value);
24
29
  },
25
30
  get version() {
26
- return this.requiredProp<ApplicationPropertiesSchema["version"]>("version");
31
+ return this.requiredProp("version");
27
32
  },
28
33
  set version(value: ApplicationPropertiesSchema["version"]) {
29
34
  this.setProp("version", value);
30
35
  },
31
36
  get build() {
32
- return this.requiredProp<ApplicationPropertiesSchema["build"]>("build");
37
+ return this.requiredProp("build");
33
38
  },
34
39
  set build(value: ApplicationPropertiesSchema["build"]) {
35
40
  this.setProp("build", value);
36
41
  },
37
42
  get isDefault() {
38
- return this.prop<ApplicationPropertiesSchema["isDefault"]>("isDefault");
43
+ return this.prop("isDefault");
39
44
  },
40
45
  set isDefault(value: ApplicationPropertiesSchema["isDefault"]) {
41
46
  this.setProp("isDefault", value);
42
47
  },
43
48
  get isDefaultVersion() {
44
- return this.prop<ApplicationPropertiesSchema["isDefaultVersion"]>("isDefaultVersion");
49
+ return this.prop("isDefaultVersion");
45
50
  },
46
51
  set isDefaultVersion(value: ApplicationPropertiesSchema["isDefaultVersion"]) {
47
52
  this.setProp("isDefaultVersion", value);
48
53
  },
49
54
  get hasAdvancedComputeOptions() {
50
- return this.prop<ApplicationPropertiesSchema["hasAdvancedComputeOptions"]>(
51
- "hasAdvancedComputeOptions",
52
- );
55
+ return this.prop("hasAdvancedComputeOptions");
53
56
  },
54
57
  set hasAdvancedComputeOptions(
55
58
  value: ApplicationPropertiesSchema["hasAdvancedComputeOptions"],
@@ -57,20 +60,23 @@ export function applicationSchemaMixin<T extends InMemoryEntity>(
57
60
  this.setProp("hasAdvancedComputeOptions", value);
58
61
  },
59
62
  get isLicensed() {
60
- return this.prop<ApplicationPropertiesSchema["isLicensed"]>("isLicensed");
63
+ return this.prop("isLicensed");
61
64
  },
62
65
  set isLicensed(value: ApplicationPropertiesSchema["isLicensed"]) {
63
66
  this.setProp("isLicensed", value);
64
67
  },
65
68
  get isUsingMaterial() {
66
- return this.prop<ApplicationPropertiesSchema["isUsingMaterial"]>(
67
- "isUsingMaterial",
68
- false,
69
- );
69
+ return this.prop("isUsingMaterial");
70
70
  },
71
71
  set isUsingMaterial(value: ApplicationPropertiesSchema["isUsingMaterial"]) {
72
72
  this.setProp("isUsingMaterial", value);
73
73
  },
74
+ get runConfig() {
75
+ return this.prop("runConfig");
76
+ },
77
+ set runConfig(value: ApplicationPropertiesSchema["runConfig"]) {
78
+ this.setProp("runConfig", value);
79
+ },
74
80
  };
75
81
 
76
82
  Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
@@ -1,35 +1,34 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { ExecutablePropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type {
3
+ BaseInMemoryEntitySchema,
4
+ ExecutablePropertiesSchema,
5
+ } from "@mat3ra/esse/dist/js/types";
3
6
 
4
7
  export type ExecutableSchemaMixin = ExecutablePropertiesSchema;
5
8
 
6
- export type ExecutableInMemoryEntity = InMemoryEntity & ExecutableSchemaMixin;
9
+ export type ExecutableInMemoryEntity = InMemoryEntity<
10
+ BaseInMemoryEntitySchema & ExecutableSchemaMixin
11
+ >;
7
12
 
8
13
  export function executableSchemaMixin<T extends InMemoryEntity>(
9
14
  item: InMemoryEntity,
10
15
  ): asserts item is T & ExecutableSchemaMixin {
11
16
  // @ts-expect-error
12
- const properties: InMemoryEntity & ExecutableSchemaMixin = {
17
+ const properties: InMemoryEntity<ExecutableSchemaMixin> & ExecutableSchemaMixin = {
13
18
  get applicationName() {
14
- return this.requiredProp<ExecutablePropertiesSchema["applicationName"]>(
15
- "applicationName",
16
- );
19
+ return this.requiredProp("applicationName");
17
20
  },
18
21
  set applicationName(value: ExecutablePropertiesSchema["applicationName"]) {
19
22
  this.setProp("applicationName", value);
20
23
  },
21
24
  get applicationVersion() {
22
- return this.requiredProp<ExecutablePropertiesSchema["applicationVersion"]>(
23
- "applicationVersion",
24
- );
25
+ return this.requiredProp("applicationVersion");
25
26
  },
26
27
  set applicationVersion(value: ExecutablePropertiesSchema["applicationVersion"]) {
27
28
  this.setProp("applicationVersion", value);
28
29
  },
29
30
  get hasAdvancedComputeOptions() {
30
- return this.prop<ExecutablePropertiesSchema["hasAdvancedComputeOptions"]>(
31
- "hasAdvancedComputeOptions",
32
- );
31
+ return this.prop("hasAdvancedComputeOptions");
33
32
  },
34
33
  set hasAdvancedComputeOptions(
35
34
  value: ExecutablePropertiesSchema["hasAdvancedComputeOptions"],
@@ -1,37 +1,35 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { FlavorPropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type { BaseInMemoryEntitySchema, FlavorPropertiesSchema } from "@mat3ra/esse/dist/js/types";
3
3
 
4
4
  export type FlavorSchemaMixin = FlavorPropertiesSchema;
5
5
 
6
- export type FlavorInMemoryEntity = InMemoryEntity & FlavorSchemaMixin;
6
+ export type FlavorInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & FlavorSchemaMixin>;
7
7
 
8
8
  export function flavorSchemaMixin<T extends InMemoryEntity>(
9
9
  item: InMemoryEntity,
10
10
  ): asserts item is T & FlavorSchemaMixin {
11
11
  // @ts-expect-error
12
- const properties: InMemoryEntity & FlavorSchemaMixin = {
12
+ const properties: InMemoryEntity<FlavorSchemaMixin> & FlavorSchemaMixin = {
13
13
  get executableName() {
14
- return this.requiredProp<FlavorPropertiesSchema["executableName"]>("executableName");
14
+ return this.requiredProp("executableName");
15
15
  },
16
16
  set executableName(value: FlavorPropertiesSchema["executableName"]) {
17
17
  this.setProp("executableName", value);
18
18
  },
19
19
  get applicationName() {
20
- return this.requiredProp<FlavorPropertiesSchema["applicationName"]>("applicationName");
20
+ return this.requiredProp("applicationName");
21
21
  },
22
22
  set applicationName(value: FlavorPropertiesSchema["applicationName"]) {
23
23
  this.setProp("applicationName", value);
24
24
  },
25
25
  get applicationVersion() {
26
- return this.requiredProp<FlavorPropertiesSchema["applicationVersion"]>(
27
- "applicationVersion",
28
- );
26
+ return this.requiredProp("applicationVersion");
29
27
  },
30
28
  set applicationVersion(value: FlavorPropertiesSchema["applicationVersion"]) {
31
29
  this.setProp("applicationVersion", value);
32
30
  },
33
31
  get input() {
34
- return this.requiredProp<FlavorPropertiesSchema["input"]>("input");
32
+ return this.requiredProp("input");
35
33
  },
36
34
  set input(value: FlavorPropertiesSchema["input"]) {
37
35
  this.setProp("input", value);
@@ -1,47 +1,44 @@
1
1
  import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import type { TemplatePropertiesSchema } from "@mat3ra/esse/dist/js/types";
2
+ import type {
3
+ BaseInMemoryEntitySchema,
4
+ TemplatePropertiesSchema,
5
+ } from "@mat3ra/esse/dist/js/types";
3
6
 
4
7
  export type TemplateSchemaMixin = TemplatePropertiesSchema;
5
8
 
6
- export type TemplateInMemoryEntity = InMemoryEntity & TemplateSchemaMixin;
9
+ export type TemplateInMemoryEntity = InMemoryEntity<BaseInMemoryEntitySchema & TemplateSchemaMixin>;
7
10
 
8
11
  export function templateSchemaMixin<T extends InMemoryEntity>(
9
12
  item: InMemoryEntity,
10
13
  ): asserts item is T & TemplateSchemaMixin {
11
14
  // @ts-expect-error
12
- const properties: InMemoryEntity & TemplateSchemaMixin = {
15
+ const properties: InMemoryEntity<TemplateSchemaMixin> & TemplateSchemaMixin = {
13
16
  get executableName() {
14
- return this.requiredProp<TemplatePropertiesSchema["executableName"]>("executableName");
17
+ return this.requiredProp("executableName");
15
18
  },
16
19
  set executableName(value: TemplatePropertiesSchema["executableName"]) {
17
20
  this.setProp("executableName", value);
18
21
  },
19
22
  get applicationName() {
20
- return this.requiredProp<TemplatePropertiesSchema["applicationName"]>(
21
- "applicationName",
22
- );
23
+ return this.requiredProp("applicationName");
23
24
  },
24
25
  set applicationName(value: TemplatePropertiesSchema["applicationName"]) {
25
26
  this.setProp("applicationName", value);
26
27
  },
27
28
  get applicationVersion() {
28
- return this.requiredProp<TemplatePropertiesSchema["applicationVersion"]>(
29
- "applicationVersion",
30
- );
29
+ return this.requiredProp("applicationVersion");
31
30
  },
32
31
  set applicationVersion(value: TemplatePropertiesSchema["applicationVersion"]) {
33
32
  this.setProp("applicationVersion", value);
34
33
  },
35
34
  get contextProviders() {
36
- return this.requiredProp<TemplatePropertiesSchema["contextProviders"]>(
37
- "contextProviders",
38
- );
35
+ return this.requiredProp("contextProviders");
39
36
  },
40
37
  set contextProviders(value: TemplatePropertiesSchema["contextProviders"]) {
41
38
  this.setProp("contextProviders", value);
42
39
  },
43
40
  get content() {
44
- return this.requiredProp<TemplatePropertiesSchema["content"]>("content");
41
+ return this.requiredProp("content");
45
42
  },
46
43
  set content(value: TemplatePropertiesSchema["content"]) {
47
44
  this.setProp("content", value);