-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: pogi7 <[email protected]>
- Loading branch information
Showing
10 changed files
with
184 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Defines the structure of the JSON object that is received from the pages.json file. | ||
* | ||
* @field title - The title of the page item | ||
* @field type - The type of the page item. Home = Home Page (there can only be one home page), Group = collection of pages, Diagram = Diagram Page, Tree = Tree Page, and Table = Table Page | ||
* @field path - The path to the configuration of the page item | ||
* @field iconUrl - The url to the icon that gets displayed in the home page. This is typically the url to a SVG published to the web | ||
* @field children - The children of the group items | ||
* | ||
*/ | ||
export default interface IPagesSchema { | ||
title: string; | ||
type: string; | ||
path?: string; | ||
iconUrl?: string; | ||
children?: Children[]; | ||
} | ||
|
||
/** | ||
* Defines the structure of the child pages | ||
* | ||
* @field title - The title of the child page item | ||
* @field type - The type of the child page item. Home = Home Page (there can only be one home page), Group = collection of pages, Diagram = Diagram Page, Tree = Tree Page, and Table = Table Page | ||
* @field path - The path to the configuration of the child page item | ||
* | ||
*/ | ||
interface Children { | ||
title: string; | ||
type: string; | ||
path: string; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ICommandSchema from "../../interfaces/ICommandSchema"; | ||
import { JSONSchemaType } from "ajv"; | ||
|
||
/** | ||
* This JSON schema is used with AJV to validate JSON files stored in the commands directory that is stored within OML models. | ||
* | ||
* @remarks | ||
* This constant will help validate JSON data using {@link https://ajv.js.org | AJV}. | ||
* | ||
* The data within the constant was generated with {@link https://www.jsonschema.net | JSON Schema}. | ||
* | ||
*/ | ||
|
||
export const commandSchema: JSONSchemaType<ICommandSchema[]> = { | ||
$schema: "http://json-schema.org/draft-07/schema#", | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
name: { | ||
type: "string", | ||
}, | ||
id: { | ||
type: "string", | ||
}, | ||
command: { | ||
type: "object", | ||
properties: { | ||
type: { | ||
type: "string", | ||
}, | ||
}, | ||
required: ["type"], | ||
}, | ||
}, | ||
required: ["name", "id", "command"], | ||
}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
controller/src/schemas/sparqlConfigSchema.ts → .../src/schemas/config/sparqlConfigSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import IPagesSchema from "../../interfaces/IPagesSchema"; | ||
import { JSONSchemaType } from "ajv"; | ||
|
||
/** | ||
* This JSON schema is used with AJV to validate pages.json data that is stored within OML models. | ||
* | ||
* @remarks | ||
* This constant will help validate JSON data using {@link https://ajv.js.org | AJV}. | ||
* | ||
* This schema has a recursive schema which you can read more {@link https://ajv.js.org/guide/combining-schemas.html | here}. | ||
* | ||
* This schema has nullable properties which you can read more {@link https://ajv.js.org/guide/typescript.html#utility-types-for-schemas | here}. | ||
* | ||
* The data within the constant was generated with {@link https://www.jsonschema.net | JSON Schema}. | ||
* | ||
*/ | ||
|
||
export const pagesSchema: JSONSchemaType<IPagesSchema[]> = { | ||
$schema: "http://json-schema.org/draft-07/schema#", | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
title: { | ||
type: "string", | ||
}, | ||
type: { | ||
type: "string", | ||
}, | ||
path: { | ||
type: "string", | ||
nullable: true, | ||
}, | ||
iconUrl: { | ||
type: "string", | ||
nullable: true, | ||
}, | ||
children: { | ||
type: "array", | ||
nullable: true, | ||
items: { | ||
type: "object", | ||
properties: { | ||
title: { | ||
type: "string", | ||
}, | ||
type: { | ||
type: "string", | ||
}, | ||
path: { | ||
type: "string", | ||
}, | ||
}, | ||
required: ["title", "type", "path"], | ||
}, | ||
}, | ||
}, | ||
required: ["title", "type"], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.