s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
355 lines • 19.6 kB
JavaScript
/**
* # GBFS System Pricing Plans Schema V3.1-RC
* Describes the pricing schemes of the system.
*
* ## Links
* - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#system_pricing_plansjson)
*/
export const gbfsSystemPricingPlansSchemaV31RC = {
$schema: 'http://json-schema.org/draft-07/schema',
$id: 'https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#system_pricing_plansjson',
description: 'Describes the pricing schemes of the system.',
type: 'object',
properties: {
last_updated: {
description: 'Last time the data in the feed was updated in RFC3339 format.',
type: 'string',
format: 'date-time',
},
ttl: {
description: 'Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).',
type: 'integer',
minimum: 0,
},
version: {
description: 'GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).',
type: 'string',
const: '3.1-RC',
},
data: {
description: 'Array that contains one object per plan as defined below.',
type: 'object',
properties: {
plans: {
type: 'array',
items: {
type: 'object',
properties: {
plan_id: {
description: 'Identifier of a pricing plan in the system.',
type: 'string',
},
url: {
description: 'URL where the customer can learn more about this pricing plan.',
type: 'string',
format: 'uri',
},
name: {
description: 'Name of this pricing plan.',
type: 'array',
items: {
type: 'object',
properties: {
text: {
description: 'The translated text.',
type: 'string',
},
language: {
description: 'IETF BCP 47 language code.',
type: 'string',
pattern: '^[a-z]{2,3}(-[A-Z]{2})?$',
},
},
required: ['text', 'language'],
},
},
currency: {
description: 'Currency used to pay the fare in ISO 4217 code.',
type: 'string',
pattern: '^\\w{3}$',
},
price: {
description: 'Fare price.',
type: 'number',
minimum: 0,
},
reservation_price_per_min: {
description: 'The cost, described as per minute rate, to reserve the vehicle prior to beginning a rental.',
type: 'number',
minimum: 0,
},
reservation_price_flat_rate: {
description: 'The cost, described as a flat rate, to reserve the vehicle prior to beginning a rental.',
type: 'number',
minimum: 0,
},
is_taxable: {
description: 'Will additional tax be added to the base price?',
type: 'boolean',
},
description: {
description: 'Customer-readable description of the pricing plan.',
type: 'array',
items: {
type: 'object',
properties: {
text: {
description: 'The translated text.',
type: 'string',
},
language: {
description: 'IETF BCP 47 language code.',
type: 'string',
pattern: '^[a-z]{2,3}(-[A-Z]{2})?$',
},
},
required: ['text', 'language'],
},
},
per_km_pricing: {
description: 'Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).',
type: 'array',
items: {
type: 'object',
properties: {
start: {
description: 'Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
rate: {
description: 'Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).',
type: 'number',
},
interval: {
description: 'Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
end: {
description: 'The kilometer at which the rate will no longer apply (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
},
required: ['start', 'rate', 'interval'],
},
},
per_min_pricing: {
description: 'Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).',
type: 'array',
items: {
type: 'object',
properties: {
start: {
description: 'Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
rate: {
description: 'Rate that is charged for each minute interval after the start (added in v2.1-RC2).',
type: 'number',
},
interval: {
description: 'Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
end: {
description: 'The minute at which the rate will no longer apply (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
},
required: ['start', 'rate', 'interval'],
},
},
surge_pricing: {
description: 'Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)',
type: 'boolean',
},
},
required: ['plan_id', 'name', 'currency', 'price', 'is_taxable', 'description'],
dependencies: {
reservation_price_flat_rate: { not: { required: ['reservation_price_per_min'] } },
reservation_price_per_min: { not: { required: ['reservation_price_flat_rate'] } },
},
},
},
},
required: ['plans'],
},
},
required: ['last_updated', 'ttl', 'version', 'data'],
};
/**
* # GBFS System Pricing Plans Schema V3.0
* Describes the pricing schemes of the system.
*
* ## Links
* - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_pricing_plansjson)
*/
export const gbfsSystemPricingPlansSchemaV30 = {
$schema: 'http://json-schema.org/draft-07/schema',
$id: 'https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_pricing_plansjson',
description: 'Describes the pricing schemes of the system.',
type: 'object',
properties: {
last_updated: {
description: 'Last time the data in the feed was updated in RFC3339 format.',
type: 'string',
format: 'date-time',
},
ttl: {
description: 'Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).',
type: 'integer',
minimum: 0,
},
version: {
description: 'GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).',
type: 'string',
const: '3.0',
},
data: {
description: 'Array that contains one object per plan as defined below.',
type: 'object',
properties: {
plans: {
type: 'array',
items: {
type: 'object',
properties: {
plan_id: {
description: 'Identifier of a pricing plan in the system.',
type: 'string',
},
url: {
description: 'URL where the customer can learn more about this pricing plan.',
type: 'string',
format: 'uri',
},
name: {
description: 'Name of this pricing plan.',
type: 'array',
items: {
type: 'object',
properties: {
text: {
description: 'The translated text.',
type: 'string',
},
language: {
description: 'IETF BCP 47 language code.',
type: 'string',
pattern: '^[a-z]{2,3}(-[A-Z]{2})?$',
},
},
required: ['text', 'language'],
},
},
currency: {
description: 'Currency used to pay the fare in ISO 4217 code.',
type: 'string',
pattern: '^\\w{3}$',
},
price: {
description: 'Fare price.',
type: 'number',
minimum: 0,
},
is_taxable: {
description: 'Will additional tax be added to the base price?',
type: 'boolean',
},
description: {
description: 'Customer-readable description of the pricing plan.',
type: 'array',
items: {
type: 'object',
properties: {
text: {
description: 'The translated text.',
type: 'string',
},
language: {
description: 'IETF BCP 47 language code.',
type: 'string',
pattern: '^[a-z]{2,3}(-[A-Z]{2})?$',
},
},
required: ['text', 'language'],
},
},
per_km_pricing: {
description: 'Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).',
type: 'array',
items: {
type: 'object',
properties: {
start: {
description: 'Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
rate: {
description: 'Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).',
type: 'number',
},
interval: {
description: 'Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
end: {
description: 'The kilometer at which the rate will no longer apply (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
},
required: ['start', 'rate', 'interval'],
},
},
per_min_pricing: {
description: 'Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).',
type: 'array',
items: {
type: 'object',
properties: {
start: {
description: 'Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
rate: {
description: 'Rate that is charged for each minute interval after the start (added in v2.1-RC2).',
type: 'number',
},
interval: {
description: 'Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
end: {
description: 'The minute at which the rate will no longer apply (added in v2.1-RC2).',
type: 'integer',
minimum: 0,
},
},
required: ['start', 'rate', 'interval'],
},
},
surge_pricing: {
description: 'Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)',
type: 'boolean',
},
},
required: ['plan_id', 'name', 'currency', 'price', 'is_taxable', 'description'],
},
},
},
required: ['plans'],
},
},
required: ['last_updated', 'ttl', 'version', 'data'],
};
//# sourceMappingURL=systemPricingPlans.js.map