|
| 1 | +import { JSONSchemasInterface } from "../JSONSchemasInterface"; |
| 2 | + |
| 3 | +export const baseSchemas = { |
| 4 | + Material: "material", |
| 5 | + Entity: "system-entity", |
| 6 | + BankMaterial: "material", |
| 7 | + Workflow: "workflow", |
| 8 | + Subworkflow: "workflow-subworkflow", |
| 9 | + BankWorkflow: "workflow", |
| 10 | + Job: "job", |
| 11 | + Application: "software-application", |
| 12 | + Executable: "software-executable", |
| 13 | + Flavor: "software-flavor", |
| 14 | + Template: "software-template", |
| 15 | + AssertionUnit: "workflow-unit-assertion", |
| 16 | + AssignmentUnit: "workflow-unit-assignment", |
| 17 | + ConditionUnit: "workflow-unit-condition", |
| 18 | + ExecutionUnit: "workflow-unit-execution", |
| 19 | + IOUnit: "workflow-unit-io", |
| 20 | + MapUnit: "workflow-unit-map", |
| 21 | + ProcessingUnit: "workflow-unit-processing", |
| 22 | + ReduceUnit: "workflow-unit-reduce", |
| 23 | + SubworkflowUnit: "workflow-unit", |
| 24 | + Unit: "workflow-unit", |
| 25 | +}; |
| 26 | + |
| 27 | +const entityMix = [ |
| 28 | + "system-description-object", |
| 29 | + "system-base-entity-set", |
| 30 | + "system-sharing", |
| 31 | + "system-metadata", |
| 32 | + "system-defaultable", |
| 33 | +]; |
| 34 | + |
| 35 | +const subWorkflowMix = ["system-system-name", "system-is-multi-material"]; |
| 36 | + |
| 37 | +const workflowMix = ["workflow-base-flow", "system-history", "system-is-outdated"]; |
| 38 | + |
| 39 | +const bankMaterialMix = ["material-conventional", "system-creator-account"]; |
| 40 | + |
| 41 | +const bankWorkflowMix = ["system-creator-account"]; |
| 42 | + |
| 43 | +const jobMix = ["system-status", "system-job-extended"]; |
| 44 | + |
| 45 | +const unitMix = ["system-unit-extended", "system-status", "workflow-unit-runtime-runtime-items"]; |
| 46 | + |
| 47 | +const assignmentUnitMix = ["system-scope"]; |
| 48 | + |
| 49 | +const flavorMix = ["system-is-multi-material"]; |
| 50 | + |
| 51 | +const systemEntityMix = ["system-entity"]; |
| 52 | + |
| 53 | +export const mixSchemas = { |
| 54 | + Entity: [...entityMix], |
| 55 | + Material: [...entityMix], |
| 56 | + BankMaterial: [...entityMix, ...bankMaterialMix], |
| 57 | + Workflow: [...entityMix, ...subWorkflowMix, ...workflowMix], |
| 58 | + Subworkflow: [...subWorkflowMix], |
| 59 | + BankWorkflow: [...entityMix, ...subWorkflowMix, ...workflowMix, ...bankWorkflowMix], |
| 60 | + Job: [...entityMix, ...jobMix], |
| 61 | + Application: [...entityMix, ...systemEntityMix], |
| 62 | + Executable: [...entityMix, ...systemEntityMix], |
| 63 | + Flavor: [...entityMix, ...flavorMix, ...systemEntityMix], |
| 64 | + Template: [...entityMix, ...systemEntityMix], |
| 65 | + AssertionUnit: [...unitMix], |
| 66 | + AssignmentUnit: [...unitMix, ...assignmentUnitMix], |
| 67 | + ConditionUnit: [...unitMix], |
| 68 | + ExecutionUnit: [...unitMix], |
| 69 | + IOUnit: [...unitMix], |
| 70 | + MapUnit: [...unitMix], |
| 71 | + ProcessingUnit: [...unitMix], |
| 72 | + ReduceUnit: [...unitMix], |
| 73 | + SubworkflowUnit: [...unitMix], |
| 74 | + Unit: [...unitMix], |
| 75 | +}; |
| 76 | + |
| 77 | +export function getSchemaByClassName(className) { |
| 78 | + return baseSchemas[className] ? JSONSchemasInterface.schemaById(baseSchemas[className]) : null; |
| 79 | +} |
| 80 | + |
| 81 | +export function getMixSchemasByClassName(className) { |
| 82 | + return mixSchemas[className] |
| 83 | + ? mixSchemas[className].map((schemaId) => JSONSchemasInterface.schemaById(schemaId)) |
| 84 | + : []; |
| 85 | +} |
0 commit comments