Skip to content

Commit

Permalink
Merge pull request #767 from vonpoland/uni-799-agency-options
Browse files Browse the repository at this point in the history
UNI-799: Apply filters to booking-options request schema.
  • Loading branch information
vonpoland authored Nov 16, 2023
2 parents 7c40a89 + 9196b08 commit 00f2f84
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 30 deletions.
2 changes: 1 addition & 1 deletion maas-schemas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maas-schemas",
"version": "20.7.0",
"version": "20.8.0",
"description": "Schemas for MaaS infrastructure",
"main": "index.js",
"engine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"additionalProperties": false,
"required": ["identityId", "payload", "agencyId", "headers"],
"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"
]
},
"identityId": {
"$ref": "https://schemas.maas.global/core/components/units.json#/definitions/identityId"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
"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"
},
Expand Down
18 changes: 6 additions & 12 deletions maas-schemas/src/io-ts/_translation.log
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,12 @@ WARNING: patternProperty support has limitations
in schemas/maas-backend/bookings/bookings-agency-options/request.json
WARNING: unexpected key in a $ref object
in schemas/maas-backend/bookings/bookings-agency-options/request.json
INFO: primitive type "string" used outside top-level definitions
in schemas/maas-backend/bookings/bookings-agency-options/request.json
WARNING: pattern field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-agency-options/request.json
WARNING: examples field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-agency-options/request.json
INFO: missing description
in schemas/maas-backend/bookings/bookings-agency-options/request.json
INFO: primitive type "string" used outside top-level definitions
Expand Down Expand Up @@ -1464,12 +1470,6 @@ 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
Expand All @@ -1480,12 +1480,6 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export type PayloadBrand = {
// The default export. More information at the top.
export type Request = t.Branded<
{
filters?: string;
identityId?: Units_c404_.IdentityId;
agencyId?: Common_ffba_.AgencyId;
payload?: Payload;
Expand All @@ -216,6 +217,7 @@ export type RequestC = t.BrandC<
t.IntersectionC<
[
t.PartialC<{
filters: t.StringC;
identityId: typeof Units_c404_.IdentityId;
agencyId: typeof Common_ffba_.AgencyId;
payload: typeof Payload;
Expand All @@ -234,6 +236,7 @@ export type RequestC = t.BrandC<
export const Request: RequestC = t.brand(
t.intersection([
t.partial({
filters: t.string,
identityId: Units_c404_.IdentityId,
agencyId: Common_ffba_.AgencyId,
payload: Payload,
Expand All @@ -250,6 +253,7 @@ export const Request: RequestC = t.brand(
x,
): x is t.Branded<
{
filters?: string;
identityId?: Units_c404_.IdentityId;
agencyId?: Common_ffba_.AgencyId;
payload?: Payload;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ 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;
Expand All @@ -58,7 +57,6 @@ export type Payload = t.Branded<
code?: string;
} & Record<
string,
| string
| TravelMode_5e34_.TravelMode
| Units_c404_.Time
| Units_c404_.Time
Expand All @@ -82,7 +80,6 @@ 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;
Expand All @@ -103,7 +100,6 @@ export type PayloadC = t.BrandC<
t.StringC,
t.UnionC<
[
t.StringC,
typeof TravelMode_5e34_.TravelMode,
typeof Units_c404_.Time,
typeof Units_c404_.Time,
Expand All @@ -130,7 +126,6 @@ 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,
Expand All @@ -150,7 +145,6 @@ export const Payload: PayloadC = t.brand(
t.record(
t.string,
t.union([
t.string,
TravelMode_5e34_.TravelMode,
Units_c404_.Time,
Units_c404_.Time,
Expand All @@ -174,7 +168,6 @@ 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;
Expand All @@ -192,7 +185,6 @@ export const Payload: PayloadC = t.brand(
code?: string;
} & Record<
string,
| string
| TravelMode_5e34_.TravelMode
| Units_c404_.Time
| Units_c404_.Time
Expand Down

0 comments on commit 00f2f84

Please sign in to comment.