diff --git a/maas-schemas/package.json b/maas-schemas/package.json index 81eda6d26..1422f957c 100644 --- a/maas-schemas/package.json +++ b/maas-schemas/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas", - "version": "20.6.0", + "version": "20.7.0", "description": "Schemas for MaaS infrastructure", "main": "index.js", "engine": { diff --git a/maas-schemas/schemas/maas-backend/bookings/bookings-options/request.json b/maas-schemas/schemas/maas-backend/bookings/bookings-options/request.json index 4c434eb55..84b75d673 100644 --- a/maas-schemas/schemas/maas-backend/bookings/bookings-options/request.json +++ b/maas-schemas/schemas/maas-backend/bookings/bookings-options/request.json @@ -21,6 +21,15 @@ "type": "object", "additionalProperties": false, "properties": { + "filters": { + "type": "string", + "pattern": "[a-zA-Z_]+==[\\-a-zA-Z0-9]+(?=[;,]|$)", + "description": "Schema for client filters which are passed to TSP-adapter. Based on https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters", + "examples": [ + "ticketZone==ATM-m1,ticketZone==ATM-m2", + "ticketType==daily;ticketZone==ATM-m2" + ] + }, "mode": { "$ref": "https://schemas.maas.global/core/components/travel-mode.json" }, diff --git a/maas-schemas/src/io-ts/_translation.log b/maas-schemas/src/io-ts/_translation.log index 882b9a6ce..b9a3b7a26 100644 --- a/maas-schemas/src/io-ts/_translation.log +++ b/maas-schemas/src/io-ts/_translation.log @@ -1464,6 +1464,12 @@ WARNING: pattern field not supported outside top-level definitions in schemas/maas-backend/bookings/bookings-list/request.json WARNING: minItems field not supported outside top-level definitions in schemas/maas-backend/bookings/bookings-list/response.json +INFO: primitive type "string" used outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json +WARNING: pattern field not supported outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json +WARNING: examples field not supported outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json WARNING: unexpected key in a $ref object in schemas/maas-backend/bookings/bookings-options/request.json INFO: primitive type "string" used outside top-level definitions @@ -1474,6 +1480,12 @@ WARNING: maxLength field not supported outside top-level definitions in schemas/maas-backend/bookings/bookings-options/request.json WARNING: patternProperty support has limitations in schemas/maas-backend/bookings/bookings-options/request.json +INFO: primitive type "string" used outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json +WARNING: pattern field not supported outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json +WARNING: examples field not supported outside top-level definitions + in schemas/maas-backend/bookings/bookings-options/request.json WARNING: unexpected key in a $ref object in schemas/maas-backend/bookings/bookings-options/request.json INFO: primitive type "string" used outside top-level definitions diff --git a/maas-schemas/src/io-ts/_types/maas-backend/bookings/bookings-options/request.ts b/maas-schemas/src/io-ts/_types/maas-backend/bookings/bookings-options/request.ts index 5f5eab11e..9f9ecb563 100644 --- a/maas-schemas/src/io-ts/_types/maas-backend/bookings/bookings-options/request.ts +++ b/maas-schemas/src/io-ts/_types/maas-backend/bookings/bookings-options/request.ts @@ -40,6 +40,7 @@ export const schemaId = // The purpose of this remains a mystery export type Payload = t.Branded< { + filters?: string; mode?: TravelMode_5e34_.TravelMode; startTime?: Units_c404_.Time; endTime?: Units_c404_.Time; @@ -57,6 +58,7 @@ export type Payload = t.Branded< code?: string; } & Record< string, + | string | TravelMode_5e34_.TravelMode | Units_c404_.Time | Units_c404_.Time @@ -80,6 +82,7 @@ export type PayloadC = t.BrandC< t.IntersectionC< [ t.PartialC<{ + filters: t.StringC; mode: typeof TravelMode_5e34_.TravelMode; startTime: typeof Units_c404_.Time; endTime: typeof Units_c404_.Time; @@ -100,6 +103,7 @@ export type PayloadC = t.BrandC< t.StringC, t.UnionC< [ + t.StringC, typeof TravelMode_5e34_.TravelMode, typeof Units_c404_.Time, typeof Units_c404_.Time, @@ -126,6 +130,7 @@ export type PayloadC = t.BrandC< export const Payload: PayloadC = t.brand( t.intersection([ t.partial({ + filters: t.string, mode: TravelMode_5e34_.TravelMode, startTime: Units_c404_.Time, endTime: Units_c404_.Time, @@ -145,6 +150,7 @@ export const Payload: PayloadC = t.brand( t.record( t.string, t.union([ + t.string, TravelMode_5e34_.TravelMode, Units_c404_.Time, Units_c404_.Time, @@ -168,6 +174,7 @@ export const Payload: PayloadC = t.brand( x, ): x is t.Branded< { + filters?: string; mode?: TravelMode_5e34_.TravelMode; startTime?: Units_c404_.Time; endTime?: Units_c404_.Time; @@ -185,6 +192,7 @@ export const Payload: PayloadC = t.brand( code?: string; } & Record< string, + | string | TravelMode_5e34_.TravelMode | Units_c404_.Time | Units_c404_.Time