Skip to content

Commit

Permalink
ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhtr committed May 25, 2020
1 parent 99a2466 commit 4f768ff
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
3 changes: 2 additions & 1 deletion maas-schemas-ts/src/core/components/travel-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ export const SuperMode = t.brand(
| 'CAR'
| 'BICYCLE'
| 'BICYCLE_RENT'
| 'UNKNOWN'),
| 'UNKNOWN'
),
SuperModeBrand
> => true,
'SuperMode',
Expand Down
3 changes: 3 additions & 0 deletions maas-schemas-ts/src/core/itinerary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export type Itinerary = t.Branded<
label?: string;
n?: number;
isWhimRide?: boolean;
provider?: string;
} & {
startTime: Defined;
endTime: Defined;
Expand Down Expand Up @@ -125,6 +126,7 @@ export const Itinerary = t.brand(
label: t.string,
n: t.number,
isWhimRide: t.boolean,
provider: t.string,
}),
t.type({
startTime: Defined,
Expand Down Expand Up @@ -158,6 +160,7 @@ export const Itinerary = t.brand(
label?: string;
n?: number;
isWhimRide?: boolean;
provider?: string;
} & {
startTime: Defined;
endTime: Defined;
Expand Down
30 changes: 30 additions & 0 deletions maas-schemas-ts/src/core/leg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,30 @@ export interface RouteLongNameBrand {
export type AgencyId = Common_.AgencyId;
export const AgencyId = Common_.AgencyId;

// AgencyName
// The purpose of this remains a mystery
export type AgencyName = t.Branded<string, AgencyNameBrand>;
export const AgencyName = t.brand(
t.string,
(x): x is t.Branded<string, AgencyNameBrand> => true,
'AgencyName',
);
export interface AgencyNameBrand {
readonly AgencyName: unique symbol;
}

// Co2
// The purpose of this remains a mystery
export type Co2 = t.Branded<number, Co2Brand>;
export const Co2 = t.brand(
t.number,
(x): x is t.Branded<number, Co2Brand> => true,
'Co2',
);
export interface Co2Brand {
readonly Co2: unique symbol;
}

// LegGeometry
// The purpose of this remains a mystery
export type LegGeometry = t.Branded<
Expand Down Expand Up @@ -251,6 +275,8 @@ export type LegCore = t.Branded<
routeShortName?: RouteShortName;
routeLongName?: RouteLongName;
agencyId?: AgencyId;
agencyName?: string;
co2?: number;
legGeometry?: LegGeometry;
tspProduct?: TspProduct;
productOption?: ProductOption;
Expand Down Expand Up @@ -281,6 +307,8 @@ export const LegCore = t.brand(
routeShortName: RouteShortName,
routeLongName: RouteLongName,
agencyId: AgencyId,
agencyName: t.string,
co2: t.number,
legGeometry: LegGeometry,
tspProduct: TspProduct,
productOption: ProductOption,
Expand Down Expand Up @@ -312,6 +340,8 @@ export const LegCore = t.brand(
routeShortName?: RouteShortName;
routeLongName?: RouteLongName;
agencyId?: AgencyId;
agencyName?: string;
co2?: number;
legGeometry?: LegGeometry;
tspProduct?: TspProduct;
productOption?: ProductOption;
Expand Down
14 changes: 12 additions & 2 deletions maas-schemas-ts/translation.log
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ WARNING: minLength field not supported outside top-level definitions
in ./core/components/car-rental.json
WARNING: maxLength field not supported outside top-level definitions
in ./core/components/car-rental.json
INFO: missing description
in ./core/components/car-rental.json
INFO: primitive type "string" used outside top-level definitions
in ./core/components/common.json
INFO: missing description
in ./core/components/common.json
INFO: missing description
in ./core/components/car-rental.json
INFO: missing description
in ./core/components/common.json
INFO: missing description
Expand Down Expand Up @@ -618,6 +618,8 @@ INFO: primitive type "number" used outside top-level definitions
in ./core/itinerary.json
WARNING: minimum field not supported outside top-level definitions
in ./core/itinerary.json
INFO: primitive type "string" used outside top-level definitions
in ./core/itinerary.json
INFO: missing description
in ./core/itinerary.json
INFO: missing description
Expand Down Expand Up @@ -664,6 +666,14 @@ WARNING: skipping examples handling for $ref object
in ./core/leg.json
WARNING: skipping default value handling for $ref object
in ./core/leg.json
INFO: primitive type "string" used outside top-level definitions
in ./core/leg.json
INFO: primitive type "number" used outside top-level definitions
in ./core/leg.json
INFO: missing description
in ./core/leg.json
INFO: missing description
in ./core/leg.json
INFO: missing description
in ./core/leg.json
INFO: missing description
Expand Down

0 comments on commit 4f768ff

Please sign in to comment.