@atb-as/config-specs
Advanced tools
Comparing version 3.9.0 to 3.10.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TravelSearchFiltersType = exports.FlexibleTransportOptionType = exports.TransportModeFilterOptionType = exports.TravelSearchTransportModes = exports.TravelSearchTransportModeIcon = void 0; | ||
exports.TravelSearchFiltersType = exports.TravelSearchPreference = exports.TravelSearchPreferenceOption = exports.TravelSearchPreferenceOptionId = exports.TravelSearchPreferenceType = exports.FlexibleTransportOptionType = exports.TransportModeFilterOptionType = exports.TravelSearchTransportModes = exports.TravelSearchTransportModeIcon = void 0; | ||
const zod_1 = require("zod"); | ||
@@ -27,5 +27,24 @@ const common_1 = require("./common"); | ||
}); | ||
exports.TravelSearchPreferenceType = zod_1.z.union([ | ||
zod_1.z.literal('transferPenalty'), | ||
zod_1.z.literal('waitReluctance'), | ||
zod_1.z.literal('walkReluctance'), | ||
zod_1.z.literal('walkSpeed'), | ||
]); | ||
exports.TravelSearchPreferenceOptionId = zod_1.z.string().nonempty(); | ||
exports.TravelSearchPreferenceOption = zod_1.z.object({ | ||
id: exports.TravelSearchPreferenceOptionId, | ||
text: common_1.LanguageAndTextTypeArray.nonempty(), | ||
value: zod_1.z.number().nonnegative(), | ||
}); | ||
exports.TravelSearchPreference = zod_1.z.object({ | ||
type: exports.TravelSearchPreferenceType, | ||
title: common_1.LanguageAndTextTypeArray.nonempty(), | ||
options: exports.TravelSearchPreferenceOption.array().nonempty(), | ||
defaultOption: exports.TravelSearchPreferenceOptionId, | ||
}); | ||
exports.TravelSearchFiltersType = zod_1.z.object({ | ||
transportModes: exports.TransportModeFilterOptionType.array().optional(), | ||
flexibleTransport: exports.FlexibleTransportOptionType.optional(), | ||
travelSearchPreferences: exports.TravelSearchPreference.array().optional(), | ||
}); |
{ | ||
"name": "@atb-as/config-specs", | ||
"version": "3.9.0", | ||
"version": "3.10.0", | ||
"description": "Shared types and validation for fare product type configs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -284,2 +284,66 @@ { | ||
"additionalProperties": false | ||
}, | ||
"travelSearchPreferences": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"transferPenalty", | ||
"waitReluctance", | ||
"walkReluctance", | ||
"walkSpeed" | ||
] | ||
}, | ||
"title": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/LanguageAndTextTypeArray/items" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"options": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"text": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/LanguageAndTextTypeArray/items" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"value": { | ||
"type": "number", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"text", | ||
"value" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"minItems": 1 | ||
}, | ||
"defaultOption": { | ||
"$ref": "#/definitions/TravelSearchFilters/properties/travelSearchPreferences/items/properties/options/items/properties/id" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"title", | ||
"options", | ||
"defaultOption" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
@@ -286,0 +350,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
393821
6134
0