@mat3ra/ade 2026.5.23-0 → 2026.5.29-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.
- package/dist/js/Application.d.ts +23 -0
- package/dist/js/Application.js +37 -0
- package/dist/js/Executable.d.ts +20 -0
- package/dist/js/Executable.js +35 -0
- package/dist/js/Flavor.d.ts +17 -0
- package/dist/js/Flavor.js +38 -0
- package/dist/js/Template.d.ts +16 -0
- package/dist/js/Template.js +29 -0
- package/dist/js/generated/ApplicationSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ApplicationSchemaMixin.js +63 -0
- package/dist/js/generated/ExecutableSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ExecutableSchemaMixin.js +27 -0
- package/dist/js/generated/FlavorSchemaMixin.d.ts +5 -0
- package/dist/js/generated/FlavorSchemaMixin.js +33 -0
- package/dist/js/generated/TemplateSchemaMixin.d.ts +5 -0
- package/dist/js/generated/TemplateSchemaMixin.js +39 -0
- package/dist/js/index.d.ts +1 -14
- package/dist/js/index.js +14 -29
- package/dist/js/typeUtils.d.ts +5 -0
- package/dist/js/typeUtils.js +2 -0
- package/dist/js/types.d.ts +6 -6
- package/dist/js/types.js +12 -0
- package/package.json +8 -14
- package/src/js/Application.ts +64 -0
- package/src/js/Executable.ts +64 -0
- package/src/js/Flavor.ts +54 -0
- package/src/js/Template.ts +43 -0
- package/src/js/generated/ApplicationSchemaMixin.ts +77 -0
- package/src/js/generated/ExecutableSchemaMixin.ts +42 -0
- package/src/js/generated/FlavorSchemaMixin.ts +42 -0
- package/src/js/generated/TemplateSchemaMixin.ts +52 -0
- package/src/js/index.ts +1 -32
- package/src/js/typeUtils.ts +5 -0
- package/src/js/types.ts +6 -14
- package/dist/js/ApplicationRegistry.d.ts +0 -57
- package/dist/js/ApplicationRegistry.js +0 -171
- package/dist/js/application.d.ts +0 -9
- package/dist/js/application.js +0 -13
- package/dist/js/applicationMixin.d.ts +0 -23
- package/dist/js/applicationMixin.js +0 -47
- package/dist/js/context/ContextProvider.d.ts +0 -50
- package/dist/js/context/ContextProvider.js +0 -98
- package/dist/js/context/ContextProviderJinja.d.ts +0 -10
- package/dist/js/context/ContextProviderJinja.js +0 -13
- package/dist/js/context/ContextProviderRegistryContainer.d.ts +0 -24
- package/dist/js/context/ContextProviderRegistryContainer.js +0 -30
- package/dist/js/context/JSONSchemaDataProvider.d.ts +0 -7
- package/dist/js/context/JSONSchemaDataProvider.js +0 -16
- package/dist/js/context/JSONSchemaFormDataProvider.d.ts +0 -18
- package/dist/js/context/JSONSchemaFormDataProvider.js +0 -40
- package/dist/js/context/JinjaContextProvider.d.ts +0 -10
- package/dist/js/context/JinjaContextProvider.js +0 -13
- package/dist/js/executable.d.ts +0 -8
- package/dist/js/executable.js +0 -12
- package/dist/js/executableMixin.d.ts +0 -22
- package/dist/js/executableMixin.js +0 -28
- package/dist/js/flavor.d.ts +0 -9
- package/dist/js/flavor.js +0 -12
- package/dist/js/flavorMixin.d.ts +0 -21
- package/dist/js/flavorMixin.js +0 -51
- package/dist/js/template.d.ts +0 -8
- package/dist/js/template.js +0 -10
- package/dist/js/templateMixin.d.ts +0 -39
- package/dist/js/templateMixin.js +0 -162
- package/src/js/ApplicationRegistry.ts +0 -250
- package/src/js/application.ts +0 -25
- package/src/js/applicationMixin.ts +0 -85
- package/src/js/context/ContextProvider.ts +0 -155
- package/src/js/context/ContextProviderRegistryContainer.ts +0 -41
- package/src/js/context/JSONSchemaDataProvider.ts +0 -11
- package/src/js/context/JSONSchemaFormDataProvider.ts +0 -43
- package/src/js/context/JinjaContextProvider.ts +0 -16
- package/src/js/executable.ts +0 -14
- package/src/js/executableMixin.ts +0 -49
- package/src/js/flavor.ts +0 -19
- package/src/js/flavorMixin.ts +0 -77
- package/src/js/template.ts +0 -17
- package/src/js/templateMixin.ts +0 -243
package/dist/js/application.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
3
|
-
import { type ApplicationMixin, type ApplicationStaticMixin } from "./applicationMixin";
|
|
4
|
-
type Base = typeof NamedDefaultableInMemoryEntity & Constructor<ApplicationMixin> & ApplicationStaticMixin;
|
|
5
|
-
declare const Application_base: Base;
|
|
6
|
-
export default class Application extends Application_base {
|
|
7
|
-
calculateHash(): string;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
package/dist/js/application.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const entity_1 = require("@mat3ra/code/dist/js/entity");
|
|
4
|
-
const utils_1 = require("@mat3ra/utils");
|
|
5
|
-
const applicationMixin_1 = require("./applicationMixin");
|
|
6
|
-
class Application extends entity_1.NamedDefaultableInMemoryEntity {
|
|
7
|
-
calculateHash() {
|
|
8
|
-
return utils_1.Utils.hash.calculateHashFromObject(utils_1.Utils.specific.removeTimestampableKeysFromConfig(this.toJSON()));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.default = Application;
|
|
12
|
-
(0, applicationMixin_1.applicationMixin)(Application.prototype);
|
|
13
|
-
(0, applicationMixin_1.applicationStaticMixin)(Application);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { DefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
|
|
3
|
-
import type { NamedInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
|
|
4
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
5
|
-
import type { ApplicationSchemaBase } from "@mat3ra/esse/dist/js/types";
|
|
6
|
-
import Executable from "./executable";
|
|
7
|
-
type Base = InMemoryEntity & NamedInMemoryEntity & DefaultableInMemoryEntity;
|
|
8
|
-
export type BaseConstructor = Constructor<Base> & {
|
|
9
|
-
constructCustomExecutable?: (config: object) => Executable;
|
|
10
|
-
};
|
|
11
|
-
export type ApplicationConstructor = Constructor<ApplicationMixin> & ApplicationStaticMixin;
|
|
12
|
-
export type ApplicationMixin = Pick<ApplicationSchemaBase, "summary" | "version" | "build" | "shortName" | "hasAdvancedComputeOptions" | "isLicensed"> & {
|
|
13
|
-
name: Required<ApplicationSchemaBase>["name"];
|
|
14
|
-
isUsingMaterial: boolean;
|
|
15
|
-
};
|
|
16
|
-
export type DefaultApplicationConfig = Pick<ApplicationSchemaBase, "name" | "shortName" | "version" | "summary" | "build">;
|
|
17
|
-
export type ApplicationStaticMixin = {
|
|
18
|
-
defaultConfig: DefaultApplicationConfig;
|
|
19
|
-
jsonSchema: ApplicationSchemaBase;
|
|
20
|
-
};
|
|
21
|
-
export declare function applicationMixin(item: Base): void;
|
|
22
|
-
export declare function applicationStaticMixin<T extends BaseConstructor>(Application: T): void;
|
|
23
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.applicationMixin = applicationMixin;
|
|
7
|
-
exports.applicationStaticMixin = applicationStaticMixin;
|
|
8
|
-
const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
|
|
9
|
-
const standata_1 = require("@mat3ra/standata");
|
|
10
|
-
function applicationMixin(item) {
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
const properties = {
|
|
13
|
-
get summary() {
|
|
14
|
-
return this.prop("summary");
|
|
15
|
-
},
|
|
16
|
-
get version() {
|
|
17
|
-
return this.prop("version", "");
|
|
18
|
-
},
|
|
19
|
-
get build() {
|
|
20
|
-
return this.prop("build");
|
|
21
|
-
},
|
|
22
|
-
get shortName() {
|
|
23
|
-
return this.prop("shortName", this.name);
|
|
24
|
-
},
|
|
25
|
-
get hasAdvancedComputeOptions() {
|
|
26
|
-
return this.prop("hasAdvancedComputeOptions", false);
|
|
27
|
-
},
|
|
28
|
-
get isLicensed() {
|
|
29
|
-
return this.prop("isLicensed", false);
|
|
30
|
-
},
|
|
31
|
-
get isUsingMaterial() {
|
|
32
|
-
return this.prop("isUsingMaterial", false);
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
36
|
-
}
|
|
37
|
-
function applicationStaticMixin(Application) {
|
|
38
|
-
const properties = {
|
|
39
|
-
get defaultConfig() {
|
|
40
|
-
return new standata_1.ApplicationStandata().getDefaultConfig();
|
|
41
|
-
},
|
|
42
|
-
get jsonSchema() {
|
|
43
|
-
return JSONSchemasInterface_1.default.getSchemaById("software/application");
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperties(Application, Object.getOwnPropertyDescriptors(properties));
|
|
47
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ContextProviderSchema, Name as ContextProviderNameEnum } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
export interface ContextProviderInstance {
|
|
3
|
-
constructor: typeof ContextProvider;
|
|
4
|
-
config: ContextProviderSchema;
|
|
5
|
-
}
|
|
6
|
-
export interface ContextProviderStatic {
|
|
7
|
-
getConstructorConfig: (config: ContextProviderSchema) => ContextProviderInstance;
|
|
8
|
-
createConfigFromContext: (config: ContextProviderSchema) => ContextProviderSchema;
|
|
9
|
-
getExtraDataKeyByName: (name: string) => string;
|
|
10
|
-
getIsEditedKeyByName: (name: string) => string;
|
|
11
|
-
}
|
|
12
|
-
export default class ContextProvider implements ContextProviderSchema {
|
|
13
|
-
config: ContextProviderSchema;
|
|
14
|
-
name: ContextProviderNameEnum;
|
|
15
|
-
domain?: string;
|
|
16
|
-
entityName?: string;
|
|
17
|
-
data?: object;
|
|
18
|
-
extraData?: object;
|
|
19
|
-
isEdited?: boolean;
|
|
20
|
-
context?: object;
|
|
21
|
-
[k: string]: unknown;
|
|
22
|
-
constructor(config: ContextProviderSchema);
|
|
23
|
-
static getConstructorConfig(config: ContextProviderSchema): ContextProviderInstance;
|
|
24
|
-
static createConfigFromContext(config: ContextProviderSchema): ContextProviderSchema & ({
|
|
25
|
-
data: never;
|
|
26
|
-
extraData: any;
|
|
27
|
-
isEdited: any;
|
|
28
|
-
} | {
|
|
29
|
-
data?: undefined;
|
|
30
|
-
extraData?: undefined;
|
|
31
|
-
isEdited?: undefined;
|
|
32
|
-
});
|
|
33
|
-
setIsEdited(isEdited: boolean): void;
|
|
34
|
-
getData(): object | undefined;
|
|
35
|
-
setData(data: object): void;
|
|
36
|
-
get defaultData(): object;
|
|
37
|
-
transformData(data: object): object;
|
|
38
|
-
yieldData(...transformDataArgs: any): {
|
|
39
|
-
[x: string]: boolean | object | undefined;
|
|
40
|
-
};
|
|
41
|
-
yieldDataForRendering(): {
|
|
42
|
-
[x: string]: boolean | object | undefined;
|
|
43
|
-
};
|
|
44
|
-
get extraDataKey(): string;
|
|
45
|
-
static getExtraDataKeyByName(name: string): string;
|
|
46
|
-
get isEditedKey(): string;
|
|
47
|
-
static getIsEditedKeyByName(name: string): string;
|
|
48
|
-
get isUnitContextProvider(): boolean;
|
|
49
|
-
get isSubworkflowContextProvider(): boolean;
|
|
50
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("@mat3ra/utils");
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
class ContextProvider {
|
|
9
|
-
constructor(config) {
|
|
10
|
-
this.config = config;
|
|
11
|
-
this.name = config.name; // property name, ie. "kpath"
|
|
12
|
-
this.domain = config.domain || "default";
|
|
13
|
-
// if context is passed inside config, treat it as additional config
|
|
14
|
-
// eslint-disable-next-line no-param-reassign
|
|
15
|
-
if (config.context)
|
|
16
|
-
config = ContextProvider.createConfigFromContext(config);
|
|
17
|
-
this.entityName = config.entityName || "unit"; // entity this provider yields data to, eg. "unit", "subworkflow"
|
|
18
|
-
this.data = config.data; // property data container
|
|
19
|
-
this.extraData = config.extraData; // property extraData container, used track changes to data, for example
|
|
20
|
-
this.isEdited = config.isEdited; // whether property was edited by user, available under `isEdited` key
|
|
21
|
-
this.setIsEdited = this.setIsEdited.bind(this);
|
|
22
|
-
this.getData = this.getData.bind(this);
|
|
23
|
-
this.setData = this.setData.bind(this);
|
|
24
|
-
this.transformData = this.transformData.bind(this);
|
|
25
|
-
this.yieldData = this.yieldData.bind(this);
|
|
26
|
-
}
|
|
27
|
-
static getConstructorConfig(config) {
|
|
28
|
-
return {
|
|
29
|
-
constructor: this.prototype.constructor,
|
|
30
|
-
config,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
static createConfigFromContext(config) {
|
|
34
|
-
const data = lodash_1.default.get(config.context, config.name);
|
|
35
|
-
const isEdited = lodash_1.default.get(config.context, this.getIsEditedKeyByName(config.name));
|
|
36
|
-
const extraData = lodash_1.default.get(config.context, this.getExtraDataKeyByName(config.name));
|
|
37
|
-
return Object.assign(config, data
|
|
38
|
-
? {
|
|
39
|
-
data,
|
|
40
|
-
extraData,
|
|
41
|
-
isEdited,
|
|
42
|
-
}
|
|
43
|
-
: {});
|
|
44
|
-
}
|
|
45
|
-
setIsEdited(isEdited) {
|
|
46
|
-
this.isEdited = isEdited;
|
|
47
|
-
}
|
|
48
|
-
getData() {
|
|
49
|
-
return this.isEdited ? this.data : this.defaultData;
|
|
50
|
-
}
|
|
51
|
-
setData(data) {
|
|
52
|
-
this.data = utils_1.Utils.clone.deepClone(data);
|
|
53
|
-
}
|
|
54
|
-
// override in children
|
|
55
|
-
// eslint-disable-next-line class-methods-use-this
|
|
56
|
-
get defaultData() {
|
|
57
|
-
throw new Error("Not implemented.");
|
|
58
|
-
}
|
|
59
|
-
// override in children
|
|
60
|
-
// eslint-disable-next-line class-methods-use-this
|
|
61
|
-
transformData(data) {
|
|
62
|
-
return data;
|
|
63
|
-
}
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
|
-
yieldData(...transformDataArgs) {
|
|
66
|
-
const extraDataObject = this.extraData ? { [this.extraDataKey]: this.extraData } : {};
|
|
67
|
-
return {
|
|
68
|
-
...extraDataObject,
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
[this.name]: this.transformData(this.getData(), ...transformDataArgs),
|
|
71
|
-
[this.isEditedKey]: this.isEdited,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// override when this.data needs additional processing before making it available to rendering context
|
|
75
|
-
// used to calculate explicit points path, for example
|
|
76
|
-
yieldDataForRendering() {
|
|
77
|
-
return this.yieldData();
|
|
78
|
-
}
|
|
79
|
-
get extraDataKey() {
|
|
80
|
-
return `${this.name}ExtraData`;
|
|
81
|
-
}
|
|
82
|
-
static getExtraDataKeyByName(name) {
|
|
83
|
-
return `${name}ExtraData`;
|
|
84
|
-
}
|
|
85
|
-
get isEditedKey() {
|
|
86
|
-
return `is${lodash_1.default.capitalize(this.name)}Edited`;
|
|
87
|
-
}
|
|
88
|
-
static getIsEditedKeyByName(name) {
|
|
89
|
-
return `is${lodash_1.default.capitalize(name)}Edited`;
|
|
90
|
-
}
|
|
91
|
-
get isUnitContextProvider() {
|
|
92
|
-
return this.entityName === "unit";
|
|
93
|
-
}
|
|
94
|
-
get isSubworkflowContextProvider() {
|
|
95
|
-
return this.entityName === "subworkflow";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
exports.default = ContextProvider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ContextProviderSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import ContextProvider from "./ContextProvider";
|
|
3
|
-
interface JSONSchemaDataProviderConfig extends ContextProviderSchema {
|
|
4
|
-
isUsingJinjaVariables?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default class ContextProviderJinja extends ContextProvider {
|
|
7
|
-
isUsingJinjaVariables: boolean;
|
|
8
|
-
constructor(config: JSONSchemaDataProviderConfig);
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ContextProvider_1 = __importDefault(require("./ContextProvider"));
|
|
7
|
-
class ContextProviderJinja extends ContextProvider_1.default {
|
|
8
|
-
constructor(config) {
|
|
9
|
-
super(config);
|
|
10
|
-
this.isUsingJinjaVariables = Boolean(config.isUsingJinjaVariables);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.default = ContextProviderJinja;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ContextProviderInstance } from "./ContextProvider";
|
|
2
|
-
import ContextProvider from "./ContextProvider";
|
|
3
|
-
export default class ContextProviderRegistryContainer {
|
|
4
|
-
_providers: {
|
|
5
|
-
name: string;
|
|
6
|
-
instance: ContextProviderInstance;
|
|
7
|
-
}[];
|
|
8
|
-
constructor();
|
|
9
|
-
get providers(): {
|
|
10
|
-
name: string;
|
|
11
|
-
instance: ContextProviderInstance;
|
|
12
|
-
}[];
|
|
13
|
-
set providers(p: {
|
|
14
|
-
name: string;
|
|
15
|
-
instance: ContextProviderInstance;
|
|
16
|
-
}[]);
|
|
17
|
-
addProvider({ name, instance }: {
|
|
18
|
-
name: string;
|
|
19
|
-
instance: ContextProviderInstance;
|
|
20
|
-
}): void;
|
|
21
|
-
findProviderInstanceByName(name: string): ContextProviderInstance | undefined;
|
|
22
|
-
removeProvider(providerCls: ContextProvider): void;
|
|
23
|
-
removeProviderByName(name: string): void;
|
|
24
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class ContextProviderRegistryContainer {
|
|
4
|
-
constructor() {
|
|
5
|
-
this._providers = [];
|
|
6
|
-
}
|
|
7
|
-
get providers() {
|
|
8
|
-
return this._providers;
|
|
9
|
-
}
|
|
10
|
-
set providers(p) {
|
|
11
|
-
this._providers = p;
|
|
12
|
-
}
|
|
13
|
-
addProvider({ name, instance }) {
|
|
14
|
-
this._providers.push({
|
|
15
|
-
name,
|
|
16
|
-
instance,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
findProviderInstanceByName(name) {
|
|
20
|
-
const provider = this.providers.find((p) => p.name === name);
|
|
21
|
-
return provider && provider.instance;
|
|
22
|
-
}
|
|
23
|
-
removeProvider(providerCls) {
|
|
24
|
-
this.providers = this.providers.filter((p) => p.name !== providerCls.name);
|
|
25
|
-
}
|
|
26
|
-
removeProviderByName(name) {
|
|
27
|
-
this.providers = this.providers.filter((p) => p.name !== name);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.default = ContextProviderRegistryContainer;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint-disable class-methods-use-this */
|
|
7
|
-
const JinjaContextProvider_1 = __importDefault(require("./JinjaContextProvider"));
|
|
8
|
-
/**
|
|
9
|
-
* @summary Provides jsonSchema only.
|
|
10
|
-
*/
|
|
11
|
-
class JSONSchemaDataProvider extends JinjaContextProvider_1.default {
|
|
12
|
-
get jsonSchema() {
|
|
13
|
-
throw new Error("Not implemented.");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = JSONSchemaDataProvider;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { UiSchema } from "react-jsonschema-form";
|
|
2
|
-
import JSONSchemaDataProvider from "./JSONSchemaDataProvider";
|
|
3
|
-
/**
|
|
4
|
-
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
|
|
5
|
-
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
|
|
6
|
-
* Form generation example:
|
|
7
|
-
* ```
|
|
8
|
-
* <Form schema={provider.jsonSchema}
|
|
9
|
-
* uiSchema={provider.uiSchema}
|
|
10
|
-
* formData={provider.getData(unit.important)} />
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export default class JSONSchemaFormDataProvider extends JSONSchemaDataProvider {
|
|
14
|
-
get uiSchema(): UiSchema;
|
|
15
|
-
get fields(): {};
|
|
16
|
-
get defaultFieldStyles(): {};
|
|
17
|
-
get uiSchemaStyled(): UiSchema;
|
|
18
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const JSONSchemaDataProvider_1 = __importDefault(require("./JSONSchemaDataProvider"));
|
|
7
|
-
/**
|
|
8
|
-
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
|
|
9
|
-
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
|
|
10
|
-
* Form generation example:
|
|
11
|
-
* ```
|
|
12
|
-
* <Form schema={provider.jsonSchema}
|
|
13
|
-
* uiSchema={provider.uiSchema}
|
|
14
|
-
* formData={provider.getData(unit.important)} />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
// TODO: MOVE to WebApp/ave or wove
|
|
18
|
-
class JSONSchemaFormDataProvider extends JSONSchemaDataProvider_1.default {
|
|
19
|
-
get uiSchema() {
|
|
20
|
-
throw new Error("Not implemented.");
|
|
21
|
-
}
|
|
22
|
-
get fields() {
|
|
23
|
-
return {};
|
|
24
|
-
}
|
|
25
|
-
get defaultFieldStyles() {
|
|
26
|
-
return {};
|
|
27
|
-
}
|
|
28
|
-
get uiSchemaStyled() {
|
|
29
|
-
const schema = this.uiSchema;
|
|
30
|
-
return Object.fromEntries(Object.entries(schema).map(([key, value]) => [
|
|
31
|
-
key,
|
|
32
|
-
{
|
|
33
|
-
...value,
|
|
34
|
-
...this.defaultFieldStyles,
|
|
35
|
-
classNames: `${value.classNames || ""}`,
|
|
36
|
-
},
|
|
37
|
-
]));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.default = JSONSchemaFormDataProvider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ContextProviderSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import ContextProvider from "./ContextProvider";
|
|
3
|
-
interface JSONSchemaDataProviderConfig extends ContextProviderSchema {
|
|
4
|
-
isUsingJinjaVariables?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default class JinjaContextProvider extends ContextProvider {
|
|
7
|
-
isUsingJinjaVariables: boolean;
|
|
8
|
-
constructor(config: JSONSchemaDataProviderConfig);
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ContextProvider_1 = __importDefault(require("./ContextProvider"));
|
|
7
|
-
class JinjaContextProvider extends ContextProvider_1.default {
|
|
8
|
-
constructor(config) {
|
|
9
|
-
super(config);
|
|
10
|
-
this.isUsingJinjaVariables = Boolean(config.isUsingJinjaVariables);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.default = JinjaContextProvider;
|
package/dist/js/executable.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
3
|
-
import { type ExecutableMixin } from "./executableMixin";
|
|
4
|
-
type Base = Constructor<ExecutableMixin> & typeof NamedDefaultableInMemoryEntity;
|
|
5
|
-
declare const Executable_base: Base;
|
|
6
|
-
export default class Executable extends Executable_base {
|
|
7
|
-
}
|
|
8
|
-
export {};
|
package/dist/js/executable.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const entity_1 = require("@mat3ra/code/dist/js/entity");
|
|
4
|
-
const RuntimeItemsMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin");
|
|
5
|
-
const executableMixin_1 = require("./executableMixin");
|
|
6
|
-
class Executable extends entity_1.NamedDefaultableInMemoryEntity {
|
|
7
|
-
}
|
|
8
|
-
exports.default = Executable;
|
|
9
|
-
// Apply mixins
|
|
10
|
-
(0, RuntimeItemsMixin_1.runtimeItemsMixin)(Executable.prototype);
|
|
11
|
-
(0, executableMixin_1.executableMixin)(Executable.prototype);
|
|
12
|
-
(0, executableMixin_1.executableStaticMixin)(Executable);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { DefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
|
|
3
|
-
import type { NamedInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
|
|
4
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
5
|
-
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
|
|
6
|
-
import type { ExecutableSchema } from "@mat3ra/esse/dist/js/types";
|
|
7
|
-
import type { FlavorMixin } from "./flavorMixin";
|
|
8
|
-
type BaseFlavor = FlavorMixin & NamedInMemoryEntity & InMemoryEntity;
|
|
9
|
-
type Base = InMemoryEntity & NamedInMemoryEntity & DefaultableInMemoryEntity;
|
|
10
|
-
export declare function executableMixin(item: Base): void;
|
|
11
|
-
export declare function executableStaticMixin(Executable: Constructor<Base>): void;
|
|
12
|
-
export type BaseConstructor = Constructor<Base> & {
|
|
13
|
-
constructCustomFlavor?: (config: object) => BaseFlavor;
|
|
14
|
-
};
|
|
15
|
-
export type ExecutableMixin = {
|
|
16
|
-
applicationId: string[];
|
|
17
|
-
toJSON: () => ExecutableSchema & AnyObject;
|
|
18
|
-
};
|
|
19
|
-
export type ExecutableStaticMixin = {
|
|
20
|
-
jsonSchema: ExecutableSchema;
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.executableMixin = executableMixin;
|
|
7
|
-
exports.executableStaticMixin = executableStaticMixin;
|
|
8
|
-
const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
|
|
9
|
-
function executableMixin(item) {
|
|
10
|
-
// @ts-expect-error
|
|
11
|
-
const properties = {
|
|
12
|
-
get applicationId() {
|
|
13
|
-
return this.prop("applicationId", []);
|
|
14
|
-
},
|
|
15
|
-
set applicationId(value) {
|
|
16
|
-
this.setProp("applicationId", value);
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
20
|
-
}
|
|
21
|
-
function executableStaticMixin(Executable) {
|
|
22
|
-
const properties = {
|
|
23
|
-
get jsonSchema() {
|
|
24
|
-
return JSONSchemasInterface_1.default.getSchemaById("software/executable");
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperties(Executable, Object.getOwnPropertyDescriptors(properties));
|
|
28
|
-
}
|
package/dist/js/flavor.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import { type RuntimeItemsInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
|
|
3
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
4
|
-
import { type FlavorMixin } from "./flavorMixin";
|
|
5
|
-
type Base = typeof NamedDefaultableInMemoryEntity & Constructor<FlavorMixin> & Constructor<RuntimeItemsInMemoryEntity>;
|
|
6
|
-
declare const Flavor_base: Base;
|
|
7
|
-
export default class Flavor extends Flavor_base {
|
|
8
|
-
}
|
|
9
|
-
export {};
|
package/dist/js/flavor.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const entity_1 = require("@mat3ra/code/dist/js/entity");
|
|
4
|
-
const RuntimeItemsMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin");
|
|
5
|
-
const flavorMixin_1 = require("./flavorMixin");
|
|
6
|
-
class Flavor extends entity_1.NamedDefaultableInMemoryEntity {
|
|
7
|
-
}
|
|
8
|
-
exports.default = Flavor;
|
|
9
|
-
// Apply mixins
|
|
10
|
-
(0, flavorMixin_1.flavorMixin)(Flavor.prototype);
|
|
11
|
-
(0, RuntimeItemsMixin_1.runtimeItemsMixin)(Flavor.prototype);
|
|
12
|
-
(0, flavorMixin_1.flavorStaticMixin)(Flavor);
|
package/dist/js/flavorMixin.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { NamedInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
|
|
3
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
4
|
-
import type { FlavorSchema } from "@mat3ra/esse/dist/js/types";
|
|
5
|
-
type Base = InMemoryEntity & NamedInMemoryEntity;
|
|
6
|
-
type Input = Required<FlavorSchema>["input"];
|
|
7
|
-
export type FlavorMixin = {
|
|
8
|
-
input: Input;
|
|
9
|
-
disableRenderMaterials: boolean;
|
|
10
|
-
executableId: string;
|
|
11
|
-
executableName: string;
|
|
12
|
-
applicationName: string;
|
|
13
|
-
supportedApplicationVersions?: string[];
|
|
14
|
-
getInputAsRenderedTemplates: (context: Record<string, unknown>) => Record<string, unknown>[];
|
|
15
|
-
};
|
|
16
|
-
export declare function flavorMixin(item: Base): FlavorMixin & InMemoryEntity & NamedInMemoryEntity;
|
|
17
|
-
export declare function flavorStaticMixin(Flavor: Constructor<Base>): void;
|
|
18
|
-
export type FlavorStaticMixin = {
|
|
19
|
-
jsonSchema: FlavorSchema;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
package/dist/js/flavorMixin.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.flavorMixin = flavorMixin;
|
|
7
|
-
exports.flavorStaticMixin = flavorStaticMixin;
|
|
8
|
-
const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
|
|
9
|
-
// TODO: should we add fields from esse schema (executableId, executableName, applicationName)?
|
|
10
|
-
function flavorMixin(item) {
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
const properties = {
|
|
13
|
-
get input() {
|
|
14
|
-
return this.prop("input", []);
|
|
15
|
-
},
|
|
16
|
-
get disableRenderMaterials() {
|
|
17
|
-
return this.prop("isMultiMaterial", false);
|
|
18
|
-
},
|
|
19
|
-
get executableId() {
|
|
20
|
-
return this.prop("executableId", "");
|
|
21
|
-
},
|
|
22
|
-
get executableName() {
|
|
23
|
-
return this.prop("executableName", "");
|
|
24
|
-
},
|
|
25
|
-
get applicationName() {
|
|
26
|
-
return this.prop("applicationName", "");
|
|
27
|
-
},
|
|
28
|
-
get supportedApplicationVersions() {
|
|
29
|
-
return this.prop("supportedApplicationVersions");
|
|
30
|
-
},
|
|
31
|
-
getInputAsRenderedTemplates(context) {
|
|
32
|
-
const input = this.input;
|
|
33
|
-
return input.map((template) => {
|
|
34
|
-
if (template && typeof template === "object" && "getRenderedJSON" in template) {
|
|
35
|
-
return template.getRenderedJSON(context);
|
|
36
|
-
}
|
|
37
|
-
return template;
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
42
|
-
return properties;
|
|
43
|
-
}
|
|
44
|
-
function flavorStaticMixin(Flavor) {
|
|
45
|
-
const properties = {
|
|
46
|
-
get jsonSchema() {
|
|
47
|
-
return JSONSchemasInterface_1.default.getSchemaById("software/flavor");
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperties(Flavor, Object.getOwnPropertyDescriptors(properties));
|
|
51
|
-
}
|
package/dist/js/template.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NamedInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
3
|
-
import { type TemplateMixin, type TemplateStaticMixin } from "./templateMixin";
|
|
4
|
-
type Base = typeof NamedInMemoryEntity & Constructor<TemplateMixin> & TemplateStaticMixin;
|
|
5
|
-
declare const Template_base: Base;
|
|
6
|
-
export default class Template extends Template_base {
|
|
7
|
-
}
|
|
8
|
-
export {};
|
package/dist/js/template.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const entity_1 = require("@mat3ra/code/dist/js/entity");
|
|
4
|
-
const templateMixin_1 = require("./templateMixin");
|
|
5
|
-
class Template extends entity_1.NamedInMemoryEntity {
|
|
6
|
-
}
|
|
7
|
-
exports.default = Template;
|
|
8
|
-
// Apply mixins
|
|
9
|
-
(0, templateMixin_1.templateMixin)(Template.prototype);
|
|
10
|
-
(0, templateMixin_1.templateStaticMixin)(Template);
|