This commit is contained in:
tree 2022-04-12 13:08:19 +02:00
rodič 5349c0b66f
revize 07c0c02e60
6 změnil soubory, kde provedl 109 přidání a 105 odebrání

Zobrazit soubor

@ -197,7 +197,7 @@ export class UTXOEngine {
),
});
}
return arr;
return arr.sort((x, y) => x.name > y.name ? 1 : -1);
}
async _yamlLoad(fn) {

44
utils/schema/1/event.yaml Normal file
Zobrazit soubor

@ -0,0 +1,44 @@
type: object
additionalProperties: false
required:
- id
- type
- name
properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
type:
type: string
enum:
- workshop
- talk
- panel
- lightning
- other
track:
type: string
pattern: "^[a-z0-9-]+$"
name:
type: string
speakers:
type: array
items:
type: string
pattern: "^[a-z0-9-]+$"
duration:
type: number
description:
type: string
after:
type: array
items:
type: string
pattern: "^[a-z0-9-]+$"
rightAfter:
type: string
pattern: "^[a-z0-9-]+$"
properties:
type: object
parent:
pattern: "^[a-z0-9-]+$"

Zobrazit soubor

@ -1,46 +1,3 @@
type: array
items:
type: object
additionalProperties: false
required:
- id
- type
- name
properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
type:
type: string
enum:
- workshop
- talk
- panel
- lightning
- other
track:
type: string
pattern: "^[a-z0-9-]+$"
name:
type: string
speakers:
type: array
items:
type: string
pattern: "^[a-z0-9-]+$"
duration:
type: number
description:
type: string
after:
type: array
items:
type: string
pattern: "^[a-z0-9-]+$"
rightAfter:
type: string
pattern: "^[a-z0-9-]+$"
properties:
type: object
parent:
pattern: "^[a-z0-9-]+$"
$ref: https://spec.utxo.cz/schema/1/events.json

Zobrazit soubor

@ -0,0 +1,60 @@
type: object
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
name:
type: string
nickname:
type: string
twitter:
type: string
pattern: "^[a-zA-Z0-9_]+$"
linkedin:
type: string
pattern: "^[a-zA-Z0-9_]+$"
orgs:
type: string
bio:
type: string
web:
type: object
additionalProperties: false
properties:
url:
type: string
format: uri
name:
type: string
lead:
type: boolean
tracks:
type: array
items:
type: string
photos:
type: array
country:
type: string
pattern: "^[a-z]{2}$"
desc:
type: string
available:
type: array
items:
type: object
additionalProperties: false
required:
- from
- to
properties:
from:
type: string
format: date-time
to:
type: string
format: date-time

Zobrazit soubor

@ -1,62 +1,3 @@
type: array
items:
type: object
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
name:
type: string
nickname:
type: string
twitter:
type: string
pattern: "^[a-zA-Z0-9_]+$"
linkedin:
type: string
pattern: "^[a-zA-Z0-9_]+$"
orgs:
type: string
bio:
type: string
web:
type: object
additionalProperties: false
properties:
url:
type: string
format: uri
name:
type: string
lead:
type: boolean
tracks:
type: array
items:
type: string
photos:
type: array
country:
type: string
pattern: "^[a-z]{2}$"
desc:
type: string
available:
type: array
items:
type: object
additionalProperties: false
required:
- from
- to
properties:
from:
type: string
format: date-time
to:
type: string
format: date-time
$ref: "https://spec.utxo.cz/schema/1/speaker.json"

Zobrazit soubor

@ -13,8 +13,10 @@ await utxo.init();
const schemas = await utxo.schemas();
const validators = {};
console.log(schemas, schemas.map((s) => s.name));
for (const item of schemas) {
validators[item.name] = ajv.compile(item.schema);
//ajv.addSchema(item.schema)
}
// check entries