-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/production' into 6954-EntityCrea…
…tedEvent
- Loading branch information
Showing
13 changed files
with
648 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { availableLanguagesISO6391 } from 'shared/languagesList'; | ||
|
||
const linkSchema = { | ||
type: 'object', | ||
additionalProperties: false, | ||
required: ['label', 'url'], | ||
properties: { | ||
label: { oneOf: [{ type: 'string' }, { type: 'null' }] }, | ||
url: { oneOf: [{ type: 'string' }, { type: 'null' }] }, | ||
}, | ||
}; | ||
|
||
const dateRangeSchema = { | ||
type: 'object', | ||
additionalProperties: false, | ||
required: ['from', 'to'], | ||
properties: { | ||
from: { oneOf: [{ type: 'number' }, { type: 'null' }] }, | ||
to: { oneOf: [{ type: 'number' }, { type: 'null' }] }, | ||
}, | ||
}; | ||
|
||
const latLonSchema = { | ||
type: 'object', | ||
required: ['lon', 'lat'], | ||
additionalProperties: false, | ||
properties: { | ||
label: { type: 'string' }, | ||
lat: { type: 'number', minimum: -90, maximum: 90 }, | ||
lon: { type: 'number', minimum: -180, maximum: 180 }, | ||
}, | ||
}; | ||
|
||
const geolocationSchema = { | ||
type: 'array', | ||
items: latLonSchema, | ||
}; | ||
|
||
const propertyValueSchema = { | ||
definitions: { linkSchema, dateRangeSchema, latLonSchema }, | ||
oneOf: [ | ||
{ type: 'null' }, | ||
{ type: 'string' }, | ||
{ type: 'number' }, | ||
{ type: 'boolean' }, | ||
linkSchema, | ||
dateRangeSchema, | ||
latLonSchema, | ||
geolocationSchema, | ||
], | ||
}; | ||
|
||
const metadataObjectSchema = { | ||
type: 'object', | ||
definitions: { propertyValueSchema }, | ||
required: ['value'], | ||
properties: { | ||
value: propertyValueSchema, | ||
}, | ||
}; | ||
|
||
const metadataSchema = { | ||
type: 'object', | ||
definitions: { metadataObjectSchema }, | ||
additionalProperties: { | ||
anyOf: [{ type: 'array', items: metadataObjectSchema }], | ||
}, | ||
patternProperties: { | ||
'^.*_nested$': { type: 'array', items: { type: 'object' } }, | ||
}, | ||
}; | ||
|
||
export const entityInputDataSchema = { | ||
title: 'EntityInputData', | ||
$schema: 'http://json-schema.org/schema#', | ||
type: 'object', | ||
required: ['_id', 'sharedId', 'language', 'title', 'template', 'metadata'], | ||
properties: { | ||
_id: { type: 'string' }, | ||
sharedId: { type: 'string', minLength: 1 }, | ||
language: { enum: availableLanguagesISO6391 }, | ||
title: { type: 'string', minLength: 1 }, | ||
template: { type: 'string' }, | ||
metadata: metadataSchema, | ||
}, | ||
}; | ||
|
||
export const emitSchemaTypes = true; |
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,227 @@ | ||
/* eslint-disable */ | ||
/**AUTO-GENERATED. RUN yarn emit-types to update.*/ | ||
|
||
export interface EntityInputData { | ||
_id: string; | ||
sharedId: string; | ||
language: | ||
| 'ab' | ||
| 'aa' | ||
| 'af' | ||
| 'ak' | ||
| 'sq' | ||
| 'am' | ||
| 'ar' | ||
| 'an' | ||
| 'hy' | ||
| 'as' | ||
| 'av' | ||
| 'ae' | ||
| 'ay' | ||
| 'az' | ||
| 'bm' | ||
| 'ba' | ||
| 'eu' | ||
| 'be' | ||
| 'bn' | ||
| 'bh' | ||
| 'bi' | ||
| 'bs' | ||
| 'br' | ||
| 'bg' | ||
| 'my' | ||
| 'ca' | ||
| 'ch' | ||
| 'ce' | ||
| 'ny' | ||
| 'zh' | ||
| 'zh-Hans' | ||
| 'zh-Hant' | ||
| 'cv' | ||
| 'kw' | ||
| 'co' | ||
| 'cr' | ||
| 'hr' | ||
| 'cs' | ||
| 'da' | ||
| 'dv' | ||
| 'nl' | ||
| 'dz' | ||
| 'en' | ||
| 'eo' | ||
| 'et' | ||
| 'ee' | ||
| 'fo' | ||
| 'fj' | ||
| 'fi' | ||
| 'fr' | ||
| 'ff' | ||
| 'gl' | ||
| 'gd' | ||
| 'gv' | ||
| 'ka' | ||
| 'de' | ||
| 'el' | ||
| 'gn' | ||
| 'gu' | ||
| 'ht' | ||
| 'ha' | ||
| 'he' | ||
| 'hz' | ||
| 'hi' | ||
| 'ho' | ||
| 'hu' | ||
| 'is' | ||
| 'io' | ||
| 'ig' | ||
| 'in' | ||
| 'ia' | ||
| 'ie' | ||
| 'iu' | ||
| 'ik' | ||
| 'ga' | ||
| 'it' | ||
| 'ja' | ||
| 'jv' | ||
| 'kl' | ||
| 'kn' | ||
| 'kr' | ||
| 'ks' | ||
| 'kk' | ||
| 'km' | ||
| 'ki' | ||
| 'rw' | ||
| 'rn' | ||
| 'ky' | ||
| 'kv' | ||
| 'kg' | ||
| 'ko' | ||
| 'ku' | ||
| 'kj' | ||
| 'lo' | ||
| 'la' | ||
| 'lv' | ||
| 'li' | ||
| 'ln' | ||
| 'lt' | ||
| 'lu' | ||
| 'lg' | ||
| 'lb' | ||
| 'mk' | ||
| 'mg' | ||
| 'ms' | ||
| 'ml' | ||
| 'mt' | ||
| 'mi' | ||
| 'mr' | ||
| 'mh' | ||
| 'mn' | ||
| 'na' | ||
| 'nv' | ||
| 'ng' | ||
| 'nd' | ||
| 'ne' | ||
| 'no' | ||
| 'nb' | ||
| 'nn' | ||
| 'oc' | ||
| 'oj' | ||
| 'cu' | ||
| 'or' | ||
| 'om' | ||
| 'os' | ||
| 'pi' | ||
| 'ps' | ||
| 'fa' | ||
| 'pl' | ||
| 'pt' | ||
| 'pa' | ||
| 'qu' | ||
| 'rm' | ||
| 'ro' | ||
| 'ru' | ||
| 'se' | ||
| 'sm' | ||
| 'sg' | ||
| 'sa' | ||
| 'sr' | ||
| 'sh' | ||
| 'st' | ||
| 'tn' | ||
| 'sn' | ||
| 'ii' | ||
| 'sd' | ||
| 'si' | ||
| 'ss' | ||
| 'sk' | ||
| 'sl' | ||
| 'so' | ||
| 'nr' | ||
| 'es' | ||
| 'su' | ||
| 'sw' | ||
| 'sv' | ||
| 'tl' | ||
| 'ty' | ||
| 'tg' | ||
| 'ta' | ||
| 'tt' | ||
| 'te' | ||
| 'th' | ||
| 'bo' | ||
| 'ti' | ||
| 'to' | ||
| 'ts' | ||
| 'tr' | ||
| 'tk' | ||
| 'tw' | ||
| 'ug' | ||
| 'uk' | ||
| 'ur' | ||
| 'uz' | ||
| 've' | ||
| 'vi' | ||
| 'vo' | ||
| 'wa' | ||
| 'cy' | ||
| 'wo' | ||
| 'fy' | ||
| 'xh' | ||
| 'yi' | ||
| 'yo' | ||
| 'za' | ||
| 'zu'; | ||
title: string; | ||
template: string; | ||
metadata: { | ||
[k: string]: | ||
| { | ||
value: | ||
| null | ||
| string | ||
| number | ||
| boolean | ||
| { | ||
label: string | null; | ||
url: string | null; | ||
} | ||
| { | ||
from: number | null; | ||
to: number | null; | ||
} | ||
| { | ||
label?: string; | ||
lat: number; | ||
lon: number; | ||
} | ||
| { | ||
label?: string; | ||
lat: number; | ||
lon: number; | ||
}[]; | ||
[k: string]: unknown | undefined; | ||
}[] | ||
| undefined; | ||
}; | ||
[k: string]: unknown | undefined; | ||
} |
Oops, something went wrong.