Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Aurora framework schema #3014

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@
"fileMatch": [".asyncapi-tool"],
"url": "https://raw.githubusercontent.com/asyncapi/website/master/scripts/tools/tools-schema.json"
},
{
"name": "Aurora Agile Meta-Framework",
"description": "Yaml schema for Aurora Agile Meta-Framework",
"fileMatch": ["*.aurora.yaml","*.aurora.yml"],
"url": "https://json.schemastore.org/aurora-1.0.json",
"versions": {
"1.0": "https://json.schemastore.org/aurora-1.0.json"
}
},
{
"name": "Avro Avsc",
"description": "Avro Schema Avsc file",
Expand Down
318 changes: 318 additions & 0 deletions src/schemas/json/aurora-1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Aurora Agile Meta Framework",
"description": "Make agile applications without technical debt",
"type": "object",
"required": [
"boundedContextName",
"moduleName",
"moduleNames",
"aggregateName"
],
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Schema version",
"default": "0.0.1"
},
"boundedContextName": {
"type": "string",
"description": "The name of the bounded context, singular in kebab-case"
},
"moduleName": {
"type": "string",
"description": "The name of the module, singular in kebab-case"
},
"moduleNames": {
"type": "string",
"description": "The name of the module, plural in kebab-case"
},
"aggregateName": {
"type": "string",
"description": "The name of the aggregateName, singular in PascalCase"
},
"hasOAuth": {
"type": "boolean",
"description": "Enabled authentication for this module",
"default": false
},
"hasTenant": {
"type": "boolean",
"description": "Enabled tenant for this module",
"default": false
},
"hasAuditing": {
"type": "boolean",
"description": "Enabled auditing for this module",
"default": false
},
"aggregateProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/property"
}
},
"aggregateI18nProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/property"
}
},
"additionalApis": {
"type": "array",
"items": {
"$ref": "#/definitions/apiDefinition"
}
}
},
"definitions": {
"property": {
"type": "object",
"required": [
"name",
"type"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of property, in camelCase"
},
"type": {
"type": "string",
"description": "The type of property",
"enum": [
"bigint.unsigned",
"bigint",
"blob.long",
"blob.medium",
"blob.tiny",
"blob",
"boolean",
"char",
"date",
"decimal",
"enum",
"float",
"id",
"int.unsigned",
"int",
"json",
"manyToMany",
"password",
"relationship",
"smallint.unsigned",
"smallint",
"text",
"timestamp",
"tinyint.unsigned",
"tinyint",
"varchar"
]
},
"length": {
"type": "number",
"description": "Set max length to property"
},
"maxLength": {
"type": "number",
"description": "Set max length to property"
},
"nullable": {
"type": "boolean",
"description": "Set property to nullable"
},
"primaryKey": {
"type": "boolean",
"description": "Set property to primary key"
},
"index": {
"type": "string",
"description": "To define property like a index",
"enum": [
"index",
"unique"
]
},
"indexName": {
"type": "string",
"description": "The name of index, if there are various indexes with the same name, they will be grouped"
},
"enumOptions": {
"type": "array",
"description": "Values for enum type",
"items": {
"type": "string"
}
},
"defaultValue": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "boolean"
}
],
"description": "Default value for property"
},
"example": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "boolean"
}
],
"description": "Example value for property, this value will be used in swagger documentation"
},
"decimals": {
"type": "array",
"description": "Total digits of the number and length of the decimal places in the back of the number, example: [10, 2].",
"items": {
"type": "number"
}
},
"autoIncrement": {
"type": "boolean",
"description": "Set number property as auto increment"
},
"relationship": {
"$ref": "#/definitions/relationship"
},
"webComponent": {
"$ref": "#/definitions/webComponent"
}
}
},
"apiDefinition": {
"type": "object",
"required": [
"path",
"resolverType",
"httpMethod"
],
"properties": {
"path": {
"type": "string",
"description": "Path to access api"
},
"resolverType": {
"type": "string",
"description": "Type of resolver, query or mutation",
"enum": [
"query",
"mutation"
]
},
"httpMethod": {
"type": "string",
"description": "Verb of api rest",
"enum": [
"get",
"post",
"put",
"delete",
"patch"
]
}
}
},
"relationship": {
"type": "object",
"additionalProperties": false,
"description": "Relationship definition for this property",
"properties": {
"type": {
"type": "string",
"description": "The type of web component",
"enum": [
"many-to-many",
"many-to-one",
"none",
"one-to-many",
"one-to-one"
]
},
"singularName": {
"type": "string",
"description": "Singular name of the property referred to in the relationship, only for one-to-many and many-to-many relationship, example: book"
},
"aggregate": {
"type": "string",
"description": "Aggregate referring to this relationship, example: LibraryAuthor"
},
"modulePath": {
"type": "string",
"description": "Path to the module that refers to this relationship, example: library/author"
},
"key": {
"type": "string",
"description": "Property key that refers to this relationship, only for many-to-one relationship, example: id"
},
"field": {
"type": "string",
"description": "Field to obtain the relationship data, example: author"
},
"avoidConstraint": {
"type": "boolean",
"description": "Avoid constraint rules for this relationship"
},
"packageName": {
"type": "string",
"description": "Path to packageName where is the relationship, example: @aurora-ts/core"
},
"isDenormalized": {
"type": "boolean",
"description": "Set many-to-many relationship as denormalized, creating a field to store the selected ids"
},
"pivot": {
"$ref": "#/definitions/pivotTable"
}
}
},
"webComponent": {
"type": "object",
"additionalProperties": false,
"description": "Web Component that wil be rendered for this property",
"properties": {
"type": {
"type": "string",
"description": "The type of web component",
"enum": [
"grid-select-element",
"grid-elements-manager",
"select"
]
}
}
},
"pivotTable": {
"type": "object",
"additionalProperties": false,
"description": "Relationship pivot table definition for this relationship",
"properties": {
"aggregate": {
"type": "string",
"description": "AggregateName of Pivot table, example: IamRolesAccounts"
},
"modulePath": {
"type": "string",
"description": "Module path where table model file will be saved, example: iam/role"
},
"fileName": {
"type": "string",
"description": "Filename of pivot table model file, example: roles-accounts"
}
}
}
}
}
38 changes: 38 additions & 0 deletions src/test/aurora-1.0/author.aurora.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 0.0.1
boundedContextName: library
moduleName: author
moduleNames: authors
aggregateName: LibraryAuthor
hasOAuth: true
hasTenant: false
hasAuditing: false
aggregateProperties:
- name: id
type: id
primaryKey: true
length: 36
nullable: false
- name: name
type: varchar
maxLength: 50
nullable: false
- name: books
type: relationship
nullable: true
relationship:
type: one-to-many
singularName: book
aggregate: LibraryBook
modulePath: library/book
webComponent:
type: grid-elements-manager
- name: createdAt
type: timestamp
nullable: true
- name: updatedAt
type: timestamp
nullable: true
- name: deletedAt
type: timestamp
nullable: true
additionalApis: []
Loading
Loading