From 9702d51d634fa26af785d318edc476699abe8006 Mon Sep 17 00:00:00 2001 From: thanhtr Date: Mon, 25 May 2020 09:04:30 +0300 Subject: [PATCH] Rebase develop --- maas-schemas-ts/package.json | 2 +- .../src/core/modes/MODE_SHARED_E_BICYCLE.ts | 76 +++++++++++++++++++ maas-schemas/package.json | 2 +- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 maas-schemas-ts/src/core/modes/MODE_SHARED_E_BICYCLE.ts diff --git a/maas-schemas-ts/package.json b/maas-schemas-ts/package.json index 415e049be..ffc0dc1d8 100644 --- a/maas-schemas-ts/package.json +++ b/maas-schemas-ts/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas-ts", - "version": "13.5.1", + "version": "13.6.0", "description": "TypeScript types and io-ts validators for maas-schemas", "main": "index.js", "files": [ diff --git a/maas-schemas-ts/src/core/modes/MODE_SHARED_E_BICYCLE.ts b/maas-schemas-ts/src/core/modes/MODE_SHARED_E_BICYCLE.ts new file mode 100644 index 000000000..236826f14 --- /dev/null +++ b/maas-schemas-ts/src/core/modes/MODE_SHARED_E_BICYCLE.ts @@ -0,0 +1,76 @@ +/* + +undefined +undefined + +!!! AUTO GENERATED BY CONVERT.TS REFRAIN FROM MANUAL EDITING !!! + +*/ + +import * as t from 'io-ts'; + +type Defined = + | Record + | Array + | string + | boolean + | number + | null; +const Defined = t.union([ + t.UnknownRecord, + t.UnknownArray, + t.string, + t.boolean, + t.number, + t.null, +]); + +export const schemaId = 'http://maasglobal.com/core/modes/MODE_SHARED_E_BICYCLE.json'; + +// MODE_SHARED_E_BICYCLE +// The default export. More information at the top. +export type MODE_SHARED_E_BICYCLE = t.Branded< + { + bike?: { + id?: string; + battery?: number; + } & { + id: Defined; + }; + }, + MODE_SHARED_E_BICYCLEBrand +>; +export const MODE_SHARED_E_BICYCLE = t.brand( + t.partial({ + bike: t.intersection([ + t.partial({ + id: t.string, + battery: t.number, + }), + t.type({ + id: Defined, + }), + ]), + }), + ( + x, + ): x is t.Branded< + { + bike?: { + id?: string; + battery?: number; + } & { + id: Defined; + }; + }, + MODE_SHARED_E_BICYCLEBrand + > => true, + 'MODE_SHARED_E_BICYCLE', +); +export interface MODE_SHARED_E_BICYCLEBrand { + readonly MODE_SHARED_E_BICYCLE: unique symbol; +} + +export default MODE_SHARED_E_BICYCLE; + +// Success diff --git a/maas-schemas/package.json b/maas-schemas/package.json index a39467a6e..f82f31b70 100644 --- a/maas-schemas/package.json +++ b/maas-schemas/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas", - "version": "13.5.1", + "version": "13.6.0", "description": "Schemas for MaaS infrastructure", "main": "index.js", "engine": {