btrz-api-client 8.75.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -1
- package/eslint.config.mjs +48 -0
- package/lib/client-standalone-min.js +19 -5
- package/lib/client.js +1363 -473
- package/lib/constants.js +1 -4
- package/lib/endpoints/accounts/accounts.js +36 -33
- package/lib/endpoints/accounts/agencies.js +53 -43
- package/lib/endpoints/accounts/agency-types.js +78 -59
- package/lib/endpoints/accounts/application-settings.js +84 -61
- package/lib/endpoints/accounts/application.js +19 -19
- package/lib/endpoints/accounts/applications.js +35 -30
- package/lib/endpoints/accounts/control-classes-settings.js +30 -27
- package/lib/endpoints/accounts/current-shifts.js +20 -22
- package/lib/endpoints/accounts/customers.js +119 -90
- package/lib/endpoints/accounts/docs.js +4 -8
- package/lib/endpoints/accounts/domains.js +46 -38
- package/lib/endpoints/accounts/dynamic-forms.js +176 -130
- package/lib/endpoints/accounts/email-settings.js +79 -61
- package/lib/endpoints/accounts/email-templates.js +126 -92
- package/lib/endpoints/accounts/exchange-rates.js +36 -32
- package/lib/endpoints/accounts/exchange-receipts.js +33 -28
- package/lib/endpoints/accounts/external-customers.js +61 -47
- package/lib/endpoints/accounts/goal-settings.js +32 -29
- package/lib/endpoints/accounts/images.js +59 -50
- package/lib/endpoints/accounts/interline.js +131 -102
- package/lib/endpoints/accounts/journey-prices-settings.js +30 -27
- package/lib/endpoints/accounts/lexicons.js +160 -124
- package/lib/endpoints/accounts/market-pricing-settings.js +30 -27
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +33 -28
- package/lib/endpoints/accounts/network.js +97 -80
- package/lib/endpoints/accounts/operation-settings.js +32 -29
- package/lib/endpoints/accounts/people-lookups.js +94 -72
- package/lib/endpoints/accounts/point-to-point-settings.js +30 -27
- package/lib/endpoints/accounts/print-settings.js +32 -29
- package/lib/endpoints/accounts/print-templates.js +89 -75
- package/lib/endpoints/accounts/printers.js +20 -20
- package/lib/endpoints/accounts/rms-settings.js +30 -27
- package/lib/endpoints/accounts/s3buckets.js +49 -39
- package/lib/endpoints/accounts/salesforce-settings.js +32 -29
- package/lib/endpoints/accounts/shift-settings.js +32 -29
- package/lib/endpoints/accounts/shifts.js +431 -317
- package/lib/endpoints/accounts/sms-templates.js +126 -92
- package/lib/endpoints/accounts/sub-print-templates.js +19 -20
- package/lib/endpoints/accounts/system-model-settings.js +51 -45
- package/lib/endpoints/accounts/ticket-movement-settings.js +30 -27
- package/lib/endpoints/accounts/tokens.js +34 -29
- package/lib/endpoints/accounts/transport-regulation-settings.js +30 -27
- package/lib/endpoints/accounts/travellers.js +82 -66
- package/lib/endpoints/accounts/trusted-machines.js +48 -39
- package/lib/endpoints/accounts/twilio-settings.js +32 -29
- package/lib/endpoints/accounts/users.js +262 -184
- package/lib/endpoints/accounts/verified-emails.js +64 -50
- package/lib/endpoints/accounts/websales-config.js +35 -31
- package/lib/endpoints/bpes/configuration.js +51 -37
- package/lib/endpoints/btrzpay/adyen.js +34 -31
- package/lib/endpoints/btrzpay/cardpointe.js +84 -62
- package/lib/endpoints/btrzpay/customerCards.js +73 -56
- package/lib/endpoints/btrzpay/customers.js +55 -43
- package/lib/endpoints/btrzpay/cybersource3ds.js +59 -44
- package/lib/endpoints/btrzpay/datalogic.js +84 -69
- package/lib/endpoints/btrzpay/docs.js +4 -8
- package/lib/endpoints/btrzpay/oxxo.js +66 -59
- package/lib/endpoints/btrzpay/payment-methods.js +141 -96
- package/lib/endpoints/btrzpay/payments.js +37 -30
- package/lib/endpoints/btrzpay/prismaTerminals.js +203 -160
- package/lib/endpoints/btrzpay/reference-numbers.js +23 -21
- package/lib/endpoints/btrzpay/referenced-payments.js +41 -36
- package/lib/endpoints/btrzpay/square.js +39 -36
- package/lib/endpoints/btrzpay/stripe-terminals.js +36 -31
- package/lib/endpoints/btrzpay/stripe3ds.js +25 -22
- package/lib/endpoints/btrzpay/terminalPayments.js +58 -52
- package/lib/endpoints/coltrane/docs.js +4 -8
- package/lib/endpoints/coltrane/healthcheck.js +7 -12
- package/lib/endpoints/coltrane/info.js +7 -12
- package/lib/endpoints/coltrane/merged-fare-tables.js +22 -22
- package/lib/endpoints/coltrane/paths.js +18 -20
- package/lib/endpoints/endpoints_helpers.js +14 -30
- package/lib/endpoints/gps/scanner-app-location.js +16 -19
- package/lib/endpoints/inventory/amenities.js +65 -50
- package/lib/endpoints/inventory/amenity-groups.js +65 -50
- package/lib/endpoints/inventory/banks.js +78 -59
- package/lib/endpoints/inventory/bare-routes.js +31 -30
- package/lib/endpoints/inventory/brands.js +68 -50
- package/lib/endpoints/inventory/bundle-fares.js +21 -23
- package/lib/endpoints/inventory/bundles.js +34 -30
- package/lib/endpoints/inventory/change-requests.js +109 -86
- package/lib/endpoints/inventory/companies.js +20 -21
- package/lib/endpoints/inventory/control-classes.js +133 -73
- package/lib/endpoints/inventory/countries.js +35 -32
- package/lib/endpoints/inventory/custom-content.js +76 -58
- package/lib/endpoints/inventory/custom-fields.js +82 -60
- package/lib/endpoints/inventory/docs.js +4 -8
- package/lib/endpoints/inventory/document-types.js +96 -69
- package/lib/endpoints/inventory/external-passes.js +34 -30
- package/lib/endpoints/inventory/external-wallets.js +133 -90
- package/lib/endpoints/inventory/fallback-codes.js +66 -49
- package/lib/endpoints/inventory/fare-classes.js +54 -41
- package/lib/endpoints/inventory/fare-type-modifiers.js +78 -59
- package/lib/endpoints/inventory/fares.js +95 -72
- package/lib/endpoints/inventory/fees.js +68 -50
- package/lib/endpoints/inventory/filtered-trips-v2.js +23 -21
- package/lib/endpoints/inventory/filtered-trips.js +50 -39
- package/lib/endpoints/inventory/financing-costs.js +78 -61
- package/lib/endpoints/inventory/garages.js +72 -59
- package/lib/endpoints/inventory/getnet-terminals.js +78 -60
- package/lib/endpoints/inventory/gift-certificate-definitions.js +84 -66
- package/lib/endpoints/inventory/healthcheck.js +4 -8
- package/lib/endpoints/inventory/holidays.js +83 -61
- package/lib/endpoints/inventory/insurances.js +68 -57
- package/lib/endpoints/inventory/insurancesCost.js +24 -24
- package/lib/endpoints/inventory/items.js +86 -64
- package/lib/endpoints/inventory/journey-prices.js +83 -61
- package/lib/endpoints/inventory/labels.js +83 -61
- package/lib/endpoints/inventory/marital-status.js +82 -67
- package/lib/endpoints/inventory/marketplace-modifiers.js +74 -57
- package/lib/endpoints/inventory/mit-terminal-settings.js +78 -59
- package/lib/endpoints/inventory/mit-terminals.js +74 -57
- package/lib/endpoints/inventory/operating-companies.js +126 -91
- package/lib/endpoints/inventory/operation-messages.js +85 -63
- package/lib/endpoints/inventory/operation-reasons.js +86 -67
- package/lib/endpoints/inventory/parcel-zones.js +52 -40
- package/lib/endpoints/inventory/pay-on-accounts.js +22 -24
- package/lib/endpoints/inventory/payment-terminals.js +74 -57
- package/lib/endpoints/inventory/prisma-terminals.js +78 -59
- package/lib/endpoints/inventory/products.js +90 -70
- package/lib/endpoints/inventory/promos.js +138 -95
- package/lib/endpoints/inventory/regions.js +78 -59
- package/lib/endpoints/inventory/routes.js +323 -262
- package/lib/endpoints/inventory/schedule-groups.js +69 -52
- package/lib/endpoints/inventory/schedules.js +171 -143
- package/lib/endpoints/inventory/seatclasses.js +82 -67
- package/lib/endpoints/inventory/seatfees.js +60 -48
- package/lib/endpoints/inventory/seatmaps.js +108 -84
- package/lib/endpoints/inventory/segments-information-tables.js +22 -23
- package/lib/endpoints/inventory/segments-information.js +78 -59
- package/lib/endpoints/inventory/service-numbers.js +64 -50
- package/lib/endpoints/inventory/service-types.js +74 -57
- package/lib/endpoints/inventory/ssrs.js +18 -20
- package/lib/endpoints/inventory/station-classes.js +79 -61
- package/lib/endpoints/inventory/station-groups.js +18 -20
- package/lib/endpoints/inventory/stations-provinces.js +18 -20
- package/lib/endpoints/inventory/stations-zones.js +18 -20
- package/lib/endpoints/inventory/stations.js +61 -47
- package/lib/endpoints/inventory/taxes.js +137 -98
- package/lib/endpoints/inventory/travel-routes.js +64 -50
- package/lib/endpoints/inventory/traveller-card-providers-types.js +19 -19
- package/lib/endpoints/inventory/traveller-card-providers.js +68 -50
- package/lib/endpoints/inventory/traveller-card-types.js +82 -59
- package/lib/endpoints/inventory/trip-ids.js +21 -21
- package/lib/endpoints/inventory/trips.js +48 -41
- package/lib/endpoints/inventory/vehicle-types.js +19 -19
- package/lib/endpoints/inventory/vehicles.js +111 -83
- package/lib/endpoints/inventory/zone-price-overages.js +74 -57
- package/lib/endpoints/inventory/zone-prices.js +74 -57
- package/lib/endpoints/invoices/dlink.js +37 -34
- package/lib/endpoints/invoices/docs.js +4 -8
- package/lib/endpoints/invoices/emails.js +22 -23
- package/lib/endpoints/invoices/gti.js +37 -34
- package/lib/endpoints/invoices/infile.js +37 -34
- package/lib/endpoints/invoices/infileJson.js +37 -34
- package/lib/endpoints/invoices/invoices.js +78 -63
- package/lib/endpoints/invoices/pdfs.js +22 -24
- package/lib/endpoints/invoices/providers.js +82 -67
- package/lib/endpoints/invoices/providersSequences.js +89 -74
- package/lib/endpoints/invoices/system.js +37 -34
- package/lib/endpoints/invoices/tax-ids.js +20 -21
- package/lib/endpoints/loyalty/movements.js +55 -49
- package/lib/endpoints/loyalty/programs.js +50 -41
- package/lib/endpoints/notifications/customers.js +33 -31
- package/lib/endpoints/notifications/email.js +20 -21
- package/lib/endpoints/notifications/external-customers.js +35 -30
- package/lib/endpoints/notifications/manifest-notifications.js +31 -33
- package/lib/endpoints/notifications/notify.js +112 -81
- package/lib/endpoints/notifications/orders-rules-validations.js +22 -22
- package/lib/endpoints/notifications/pdf-data.js +56 -64
- package/lib/endpoints/notifications/pdfs.js +48 -55
- package/lib/endpoints/notifications/printed-tickets.js +31 -27
- package/lib/endpoints/notifications/salesforce.js +19 -19
- package/lib/endpoints/notifications/short-urls.js +38 -33
- package/lib/endpoints/notifications/twilio.js +57 -46
- package/lib/endpoints/operations/accounting_items.js +30 -36
- package/lib/endpoints/operations/applied_insurance.js +25 -20
- package/lib/endpoints/operations/calendar_entries.js +18 -20
- package/lib/endpoints/operations/cancellation_settings.js +33 -28
- package/lib/endpoints/operations/docs.js +5 -9
- package/lib/endpoints/operations/external-bookings.js +35 -31
- package/lib/endpoints/operations/flexpasses.js +22 -22
- package/lib/endpoints/operations/gift-certificates.js +25 -23
- package/lib/endpoints/operations/loans.js +30 -36
- package/lib/endpoints/operations/manifest.js +469 -372
- package/lib/endpoints/operations/manifest_leg_for_tickets.js +23 -23
- package/lib/endpoints/operations/movements.js +21 -22
- package/lib/endpoints/operations/outlook-trips.js +20 -21
- package/lib/endpoints/operations/pago-express.js +55 -39
- package/lib/endpoints/operations/parcels.js +96 -67
- package/lib/endpoints/operations/parcels_manifests.js +102 -81
- package/lib/endpoints/operations/passenger_check_in_info.js +66 -52
- package/lib/endpoints/operations/redemption.js +52 -40
- package/lib/endpoints/operations/rms.js +35 -33
- package/lib/endpoints/operations/scheduled_notifications.js +80 -61
- package/lib/endpoints/operations/segments.js +24 -24
- package/lib/endpoints/operations/sold-items-fulfillment.js +20 -21
- package/lib/endpoints/operations/sold-items.js +35 -30
- package/lib/endpoints/operations/tickets.js +109 -78
- package/lib/endpoints/operations/transaction.js +22 -22
- package/lib/endpoints/operations/transactions.js +178 -135
- package/lib/endpoints/operations/transport_regulations.js +22 -22
- package/lib/endpoints/operations/trip_change_info.js +23 -23
- package/lib/endpoints/operations/vehicle_assignments.js +60 -48
- package/lib/endpoints/operations/vouchers.js +32 -35
- package/lib/endpoints/operations/waitlists.js +62 -47
- package/lib/endpoints/ratality/auth.js +10 -14
- package/lib/endpoints/ratality/clients.js +30 -28
- package/lib/endpoints/ratality/integrations.js +43 -36
- package/lib/endpoints/reports/custom-reports.js +50 -39
- package/lib/endpoints/reports/email.js +20 -19
- package/lib/endpoints/reports/report-types.js +35 -30
- package/lib/endpoints/reports/trip-manifests.js +20 -21
- package/lib/endpoints/sales/bundles.js +18 -20
- package/lib/endpoints/sales/cancellations.js +48 -34
- package/lib/endpoints/sales/cart-promo.js +37 -34
- package/lib/endpoints/sales/cart.js +218 -166
- package/lib/endpoints/sales/check-in-info.js +22 -23
- package/lib/endpoints/sales/custom-fields.js +18 -20
- package/lib/endpoints/sales/docs.js +4 -8
- package/lib/endpoints/sales/flexpasses.js +21 -21
- package/lib/endpoints/sales/gift-certificates.js +20 -22
- package/lib/endpoints/sales/order.js +66 -53
- package/lib/endpoints/sales/parcel-quotes.js +20 -20
- package/lib/endpoints/sales/payment-providers.js +20 -21
- package/lib/endpoints/sales/redeemable-items.js +32 -31
- package/lib/endpoints/sales/sync-entry.js +21 -21
- package/lib/endpoints/sales/voucher.js +19 -20
- package/lib/endpoints/seatmaps/access-ticket.js +19 -19
- package/lib/endpoints/seatmaps/seat.js +21 -21
- package/lib/endpoints/uploads/files.js +26 -24
- package/lib/endpoints/uploads/images.js +26 -24
- package/lib/endpoints/webhooks/events.js +24 -24
- package/lib/endpoints/webhooks/subscriptions.js +80 -60
- package/lib/endpoints/webhooks/undelivered.js +103 -73
- package/lib/endpoints/webhooks/webhooks.js +20 -20
- package/lib/initializedClient.js +3 -5
- package/lib/productionDefaults.js +6 -8
- package/package.json +18 -18
- package/src/client.js +1 -1
- package/src/endpoints/inventory/control-classes.js +27 -0
- package/src/endpoints/operations/transactions.js +1 -1
- package/test/endpoints/inventory/control-classes.js +14 -0
- package/tools/build-standalone.mjs +15 -0
- package/types/endpoints/inventory/control-classes.d.ts +4 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -3
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
/* eslint-disable max-len */
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const {
|
|
3
|
+
authorizationHeaders
|
|
4
|
+
} = require("./../endpoints_helpers.js");
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Query params for GET /routes (btrz-api-inventory). See get-routes getSpec().
|
|
@@ -32,12 +31,10 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
32
31
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
33
32
|
* @returns {{ get: function, prices: function, all: function, stations: function, create: function, update: function, remove: function, fareTables: object, stops: object, fareRules: object, priceBuckets: object, crossBorderDistances: object, prorationTables: object }}
|
|
34
33
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
40
|
-
|
|
34
|
+
function routesFactory({
|
|
35
|
+
client,
|
|
36
|
+
internalAuthTokenProvider
|
|
37
|
+
}) {
|
|
41
38
|
/**
|
|
42
39
|
* GET /routes/:routeId - get route by id. API does not accept query params.
|
|
43
40
|
* @param {Object} opts
|
|
@@ -47,17 +44,20 @@ function routesFactory(_ref) {
|
|
|
47
44
|
* @param {Object} [opts.headers] - Optional headers
|
|
48
45
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
49
46
|
*/
|
|
50
|
-
function get(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
function get({
|
|
48
|
+
routeId,
|
|
49
|
+
token,
|
|
50
|
+
query = {},
|
|
51
|
+
headers
|
|
52
|
+
}) {
|
|
57
53
|
return client({
|
|
58
|
-
url:
|
|
54
|
+
url: `/routes/${routeId}`,
|
|
59
55
|
params: query,
|
|
60
|
-
headers: authorizationHeaders({
|
|
56
|
+
headers: authorizationHeaders({
|
|
57
|
+
token,
|
|
58
|
+
internalAuthTokenProvider,
|
|
59
|
+
headers
|
|
60
|
+
})
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -74,21 +74,29 @@ function routesFactory(_ref) {
|
|
|
74
74
|
* @param {Object} [opts.headers] - Optional headers
|
|
75
75
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
76
76
|
*/
|
|
77
|
-
function prices(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
function prices({
|
|
78
|
+
token,
|
|
79
|
+
productId,
|
|
80
|
+
originId,
|
|
81
|
+
destinationId,
|
|
82
|
+
channel,
|
|
83
|
+
query,
|
|
84
|
+
headers
|
|
85
|
+
}) {
|
|
86
|
+
const params = Object.assign({}, query, {
|
|
87
|
+
productId,
|
|
88
|
+
originId,
|
|
89
|
+
destinationId,
|
|
90
|
+
channel
|
|
91
|
+
});
|
|
88
92
|
return client({
|
|
89
93
|
url: "/routes/prices",
|
|
90
|
-
params
|
|
91
|
-
headers: authorizationHeaders({
|
|
94
|
+
params,
|
|
95
|
+
headers: authorizationHeaders({
|
|
96
|
+
token,
|
|
97
|
+
internalAuthTokenProvider,
|
|
98
|
+
headers
|
|
99
|
+
})
|
|
92
100
|
});
|
|
93
101
|
}
|
|
94
102
|
|
|
@@ -101,15 +109,18 @@ function routesFactory(_ref) {
|
|
|
101
109
|
* @param {Object} [opts.headers] - Optional headers
|
|
102
110
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
103
111
|
*/
|
|
104
|
-
function all(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
function all({
|
|
113
|
+
token,
|
|
114
|
+
query = {},
|
|
115
|
+
headers
|
|
116
|
+
}) {
|
|
110
117
|
return client.get("/routes", {
|
|
111
118
|
params: query,
|
|
112
|
-
headers: authorizationHeaders({
|
|
119
|
+
headers: authorizationHeaders({
|
|
120
|
+
token,
|
|
121
|
+
internalAuthTokenProvider,
|
|
122
|
+
headers
|
|
123
|
+
})
|
|
113
124
|
});
|
|
114
125
|
}
|
|
115
126
|
|
|
@@ -122,14 +133,18 @@ function routesFactory(_ref) {
|
|
|
122
133
|
* @param {Object} [opts.headers] - Optional headers
|
|
123
134
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
124
135
|
*/
|
|
125
|
-
function stations(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
function stations({
|
|
137
|
+
token,
|
|
138
|
+
routeId,
|
|
139
|
+
headers
|
|
140
|
+
}) {
|
|
130
141
|
return client({
|
|
131
|
-
url:
|
|
132
|
-
headers: authorizationHeaders({
|
|
142
|
+
url: `/routes/${routeId}/stations`,
|
|
143
|
+
headers: authorizationHeaders({
|
|
144
|
+
token,
|
|
145
|
+
internalAuthTokenProvider,
|
|
146
|
+
headers
|
|
147
|
+
})
|
|
133
148
|
});
|
|
134
149
|
}
|
|
135
150
|
|
|
@@ -142,19 +157,22 @@ function routesFactory(_ref) {
|
|
|
142
157
|
* @param {Object} [opts.headers] - Optional headers
|
|
143
158
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
144
159
|
*/
|
|
145
|
-
function create(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
function create({
|
|
161
|
+
token,
|
|
162
|
+
jwtToken,
|
|
163
|
+
data,
|
|
164
|
+
headers
|
|
165
|
+
}) {
|
|
151
166
|
return client({
|
|
152
167
|
url: "/routes",
|
|
153
168
|
method: "post",
|
|
154
169
|
headers: authorizationHeaders({
|
|
155
|
-
token
|
|
170
|
+
token,
|
|
171
|
+
jwtToken,
|
|
172
|
+
internalAuthTokenProvider,
|
|
173
|
+
headers
|
|
156
174
|
}),
|
|
157
|
-
data
|
|
175
|
+
data
|
|
158
176
|
});
|
|
159
177
|
}
|
|
160
178
|
|
|
@@ -168,20 +186,23 @@ function routesFactory(_ref) {
|
|
|
168
186
|
* @param {Object} [opts.headers] - Optional headers
|
|
169
187
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
170
188
|
*/
|
|
171
|
-
function update(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
189
|
+
function update({
|
|
190
|
+
token,
|
|
191
|
+
jwtToken,
|
|
192
|
+
data,
|
|
193
|
+
routeId,
|
|
194
|
+
headers
|
|
195
|
+
}) {
|
|
178
196
|
return client({
|
|
179
|
-
url:
|
|
197
|
+
url: `/routes/${routeId}`,
|
|
180
198
|
method: "put",
|
|
181
199
|
headers: authorizationHeaders({
|
|
182
|
-
token
|
|
200
|
+
token,
|
|
201
|
+
jwtToken,
|
|
202
|
+
internalAuthTokenProvider,
|
|
203
|
+
headers
|
|
183
204
|
}),
|
|
184
|
-
data
|
|
205
|
+
data
|
|
185
206
|
});
|
|
186
207
|
}
|
|
187
208
|
|
|
@@ -194,23 +215,26 @@ function routesFactory(_ref) {
|
|
|
194
215
|
* @param {Object} [opts.headers] - Optional headers
|
|
195
216
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
196
217
|
*/
|
|
197
|
-
function remove(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
218
|
+
function remove({
|
|
219
|
+
token,
|
|
220
|
+
jwtToken,
|
|
221
|
+
routeId,
|
|
222
|
+
headers
|
|
223
|
+
}) {
|
|
203
224
|
return client({
|
|
204
|
-
url:
|
|
225
|
+
url: `/routes/${routeId}`,
|
|
205
226
|
method: "delete",
|
|
206
227
|
headers: authorizationHeaders({
|
|
207
|
-
token
|
|
228
|
+
token,
|
|
229
|
+
jwtToken,
|
|
230
|
+
internalAuthTokenProvider,
|
|
231
|
+
headers
|
|
208
232
|
})
|
|
209
233
|
});
|
|
210
234
|
}
|
|
211
235
|
|
|
212
236
|
/** @type {{ all: function, create: function, update: function }} */
|
|
213
|
-
|
|
237
|
+
const fareTables = {
|
|
214
238
|
/**
|
|
215
239
|
* GET /routes/fare-tables - list fare tables. API does not accept query params.
|
|
216
240
|
* @param {Object} opts
|
|
@@ -219,21 +243,21 @@ function routesFactory(_ref) {
|
|
|
219
243
|
* @param {Object} [opts.headers] - Optional headers
|
|
220
244
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
221
245
|
*/
|
|
222
|
-
all
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
246
|
+
all({
|
|
247
|
+
token,
|
|
248
|
+
query = {},
|
|
249
|
+
headers
|
|
250
|
+
}) {
|
|
228
251
|
return client({
|
|
229
252
|
url: "/routes/fare-tables",
|
|
230
253
|
params: query,
|
|
231
254
|
headers: authorizationHeaders({
|
|
232
|
-
token
|
|
255
|
+
token,
|
|
256
|
+
internalAuthTokenProvider,
|
|
257
|
+
headers
|
|
233
258
|
})
|
|
234
259
|
});
|
|
235
260
|
},
|
|
236
|
-
|
|
237
261
|
/**
|
|
238
262
|
* POST /routes/:routeId/fare-tables - create fare table. API does not accept query params.
|
|
239
263
|
* @param {Object} opts
|
|
@@ -244,25 +268,27 @@ function routesFactory(_ref) {
|
|
|
244
268
|
* @param {Object} [opts.headers] - Optional headers
|
|
245
269
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
246
270
|
*/
|
|
247
|
-
create
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
271
|
+
create({
|
|
272
|
+
token,
|
|
273
|
+
jwtToken,
|
|
274
|
+
routeId,
|
|
275
|
+
fareTable,
|
|
276
|
+
headers
|
|
277
|
+
}) {
|
|
254
278
|
return client({
|
|
255
|
-
url:
|
|
279
|
+
url: `/routes/${routeId}/fare-tables`,
|
|
256
280
|
method: "post",
|
|
257
281
|
headers: authorizationHeaders({
|
|
258
|
-
token
|
|
282
|
+
token,
|
|
283
|
+
jwtToken,
|
|
284
|
+
internalAuthTokenProvider,
|
|
285
|
+
headers
|
|
259
286
|
}),
|
|
260
287
|
data: {
|
|
261
|
-
fareTable
|
|
288
|
+
fareTable
|
|
262
289
|
}
|
|
263
290
|
});
|
|
264
291
|
},
|
|
265
|
-
|
|
266
292
|
/**
|
|
267
293
|
* PUT /routes/:routeId/fare-tables/:fareTableId - update fare table. API does not accept query params.
|
|
268
294
|
* @param {Object} opts
|
|
@@ -274,28 +300,31 @@ function routesFactory(_ref) {
|
|
|
274
300
|
* @param {Object} [opts.headers] - Optional headers
|
|
275
301
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
276
302
|
*/
|
|
277
|
-
update
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
303
|
+
update({
|
|
304
|
+
token,
|
|
305
|
+
jwtToken,
|
|
306
|
+
routeId,
|
|
307
|
+
fareTableId,
|
|
308
|
+
fareTable,
|
|
309
|
+
headers
|
|
310
|
+
}) {
|
|
285
311
|
return client({
|
|
286
|
-
url:
|
|
312
|
+
url: `/routes/${routeId}/fare-tables/${fareTableId}`,
|
|
287
313
|
method: "put",
|
|
288
314
|
headers: authorizationHeaders({
|
|
289
|
-
token
|
|
315
|
+
token,
|
|
316
|
+
jwtToken,
|
|
317
|
+
internalAuthTokenProvider,
|
|
318
|
+
headers
|
|
290
319
|
}),
|
|
291
320
|
data: {
|
|
292
|
-
fareTable
|
|
321
|
+
fareTable
|
|
293
322
|
}
|
|
294
323
|
});
|
|
295
324
|
}
|
|
296
325
|
};
|
|
297
326
|
/** @type {{ create: function }} */
|
|
298
|
-
|
|
327
|
+
const stops = {
|
|
299
328
|
/**
|
|
300
329
|
* POST /routes/:routeId/stops - create stop. API does not accept query params.
|
|
301
330
|
* @param {Object} opts
|
|
@@ -306,18 +335,21 @@ function routesFactory(_ref) {
|
|
|
306
335
|
* @param {Object} [opts.headers] - Optional headers
|
|
307
336
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
308
337
|
*/
|
|
309
|
-
create
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
338
|
+
create({
|
|
339
|
+
token,
|
|
340
|
+
jwtToken,
|
|
341
|
+
routeId,
|
|
342
|
+
stop,
|
|
343
|
+
headers
|
|
344
|
+
}) {
|
|
316
345
|
return client({
|
|
317
|
-
url:
|
|
346
|
+
url: `/routes/${routeId}/stops`,
|
|
318
347
|
method: "post",
|
|
319
348
|
headers: authorizationHeaders({
|
|
320
|
-
token
|
|
349
|
+
token,
|
|
350
|
+
jwtToken,
|
|
351
|
+
internalAuthTokenProvider,
|
|
352
|
+
headers
|
|
321
353
|
}),
|
|
322
354
|
data: stop
|
|
323
355
|
});
|
|
@@ -325,7 +357,7 @@ function routesFactory(_ref) {
|
|
|
325
357
|
};
|
|
326
358
|
|
|
327
359
|
/** @type {{ get: function, create: function, update: function, remove: function }} */
|
|
328
|
-
|
|
360
|
+
const fareRules = {
|
|
329
361
|
/**
|
|
330
362
|
* GET /routes/:routeId/fare-rules - get fare rules. API does not accept query params.
|
|
331
363
|
* @param {Object} opts
|
|
@@ -335,20 +367,22 @@ function routesFactory(_ref) {
|
|
|
335
367
|
* @param {Object} [opts.headers] - Optional headers
|
|
336
368
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
337
369
|
*/
|
|
338
|
-
get
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
370
|
+
get({
|
|
371
|
+
token,
|
|
372
|
+
jwtToken,
|
|
373
|
+
routeId,
|
|
374
|
+
headers
|
|
375
|
+
}) {
|
|
344
376
|
return client({
|
|
345
|
-
url:
|
|
377
|
+
url: `/routes/${routeId}/fare-rules`,
|
|
346
378
|
headers: authorizationHeaders({
|
|
347
|
-
token
|
|
379
|
+
token,
|
|
380
|
+
jwtToken,
|
|
381
|
+
internalAuthTokenProvider,
|
|
382
|
+
headers
|
|
348
383
|
})
|
|
349
384
|
});
|
|
350
385
|
},
|
|
351
|
-
|
|
352
386
|
/**
|
|
353
387
|
* POST /routes/:routeId/fare-rules - create fare rule. API does not accept query params.
|
|
354
388
|
* @param {Object} opts
|
|
@@ -359,25 +393,27 @@ function routesFactory(_ref) {
|
|
|
359
393
|
* @param {Object} [opts.headers] - Optional headers
|
|
360
394
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
361
395
|
*/
|
|
362
|
-
create
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
396
|
+
create({
|
|
397
|
+
token,
|
|
398
|
+
jwtToken,
|
|
399
|
+
routeId,
|
|
400
|
+
fareRule,
|
|
401
|
+
headers
|
|
402
|
+
}) {
|
|
369
403
|
return client({
|
|
370
|
-
url:
|
|
404
|
+
url: `/routes/${routeId}/fare-rules`,
|
|
371
405
|
method: "post",
|
|
372
406
|
headers: authorizationHeaders({
|
|
373
|
-
token
|
|
407
|
+
token,
|
|
408
|
+
jwtToken,
|
|
409
|
+
internalAuthTokenProvider,
|
|
410
|
+
headers
|
|
374
411
|
}),
|
|
375
412
|
data: {
|
|
376
|
-
fareRule
|
|
413
|
+
fareRule
|
|
377
414
|
}
|
|
378
415
|
});
|
|
379
416
|
},
|
|
380
|
-
|
|
381
417
|
/**
|
|
382
418
|
* PUT /routes/:routeId/fare-rules/:fareRuleId - update fare rule. API does not accept query params.
|
|
383
419
|
* @param {Object} opts
|
|
@@ -389,26 +425,28 @@ function routesFactory(_ref) {
|
|
|
389
425
|
* @param {Object} [opts.headers] - Optional headers
|
|
390
426
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
391
427
|
*/
|
|
392
|
-
update
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
428
|
+
update({
|
|
429
|
+
token,
|
|
430
|
+
jwtToken,
|
|
431
|
+
routeId,
|
|
432
|
+
fareRuleId,
|
|
433
|
+
fareRule,
|
|
434
|
+
headers
|
|
435
|
+
}) {
|
|
400
436
|
return client({
|
|
401
|
-
url:
|
|
437
|
+
url: `/routes/${routeId}/fare-rules/${fareRuleId}`,
|
|
402
438
|
method: "put",
|
|
403
439
|
headers: authorizationHeaders({
|
|
404
|
-
token
|
|
440
|
+
token,
|
|
441
|
+
jwtToken,
|
|
442
|
+
internalAuthTokenProvider,
|
|
443
|
+
headers
|
|
405
444
|
}),
|
|
406
445
|
data: {
|
|
407
|
-
fareRule
|
|
446
|
+
fareRule
|
|
408
447
|
}
|
|
409
448
|
});
|
|
410
449
|
},
|
|
411
|
-
|
|
412
450
|
/**
|
|
413
451
|
* DELETE /routes/:routeId/fare-rules/:fareRuleId - remove fare rule. API does not accept query params.
|
|
414
452
|
* @param {Object} opts
|
|
@@ -419,25 +457,28 @@ function routesFactory(_ref) {
|
|
|
419
457
|
* @param {Object} [opts.headers] - Optional headers
|
|
420
458
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
421
459
|
*/
|
|
422
|
-
remove
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
460
|
+
remove({
|
|
461
|
+
token,
|
|
462
|
+
jwtToken,
|
|
463
|
+
routeId,
|
|
464
|
+
fareRuleId,
|
|
465
|
+
headers
|
|
466
|
+
}) {
|
|
429
467
|
return client({
|
|
430
|
-
url:
|
|
468
|
+
url: `/routes/${routeId}/fare-rules/${fareRuleId}`,
|
|
431
469
|
method: "delete",
|
|
432
470
|
headers: authorizationHeaders({
|
|
433
|
-
token
|
|
471
|
+
token,
|
|
472
|
+
jwtToken,
|
|
473
|
+
internalAuthTokenProvider,
|
|
474
|
+
headers
|
|
434
475
|
})
|
|
435
476
|
});
|
|
436
477
|
}
|
|
437
478
|
};
|
|
438
479
|
|
|
439
480
|
/** @type {{ get: function, create: function, update: function, remove: function }} */
|
|
440
|
-
|
|
481
|
+
const priceBuckets = {
|
|
441
482
|
/**
|
|
442
483
|
* GET /routes/:routeId/price-buckets - get price buckets. API does not accept query params.
|
|
443
484
|
* @param {Object} opts
|
|
@@ -447,20 +488,22 @@ function routesFactory(_ref) {
|
|
|
447
488
|
* @param {Object} [opts.headers] - Optional headers
|
|
448
489
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
449
490
|
*/
|
|
450
|
-
get
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
491
|
+
get({
|
|
492
|
+
token,
|
|
493
|
+
jwtToken,
|
|
494
|
+
routeId,
|
|
495
|
+
headers
|
|
496
|
+
}) {
|
|
456
497
|
return client({
|
|
457
|
-
url:
|
|
498
|
+
url: `/routes/${routeId}/price-buckets`,
|
|
458
499
|
headers: authorizationHeaders({
|
|
459
|
-
token
|
|
500
|
+
token,
|
|
501
|
+
jwtToken,
|
|
502
|
+
internalAuthTokenProvider,
|
|
503
|
+
headers
|
|
460
504
|
})
|
|
461
505
|
});
|
|
462
506
|
},
|
|
463
|
-
|
|
464
507
|
/**
|
|
465
508
|
* POST /routes/:routeId/price-buckets - create price bucket. API does not accept query params.
|
|
466
509
|
* @param {Object} opts
|
|
@@ -471,25 +514,27 @@ function routesFactory(_ref) {
|
|
|
471
514
|
* @param {Object} [opts.headers] - Optional headers
|
|
472
515
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
473
516
|
*/
|
|
474
|
-
create
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
517
|
+
create({
|
|
518
|
+
token,
|
|
519
|
+
jwtToken,
|
|
520
|
+
routeId,
|
|
521
|
+
bucket,
|
|
522
|
+
headers
|
|
523
|
+
}) {
|
|
481
524
|
return client({
|
|
482
|
-
url:
|
|
525
|
+
url: `/routes/${routeId}/price-buckets`,
|
|
483
526
|
method: "post",
|
|
484
527
|
headers: authorizationHeaders({
|
|
485
|
-
token
|
|
528
|
+
token,
|
|
529
|
+
jwtToken,
|
|
530
|
+
internalAuthTokenProvider,
|
|
531
|
+
headers
|
|
486
532
|
}),
|
|
487
533
|
data: {
|
|
488
|
-
bucket
|
|
534
|
+
bucket
|
|
489
535
|
}
|
|
490
536
|
});
|
|
491
537
|
},
|
|
492
|
-
|
|
493
538
|
/**
|
|
494
539
|
* PUT /routes/:routeId/price-buckets/:bucketId - update price bucket. API does not accept query params.
|
|
495
540
|
* @param {Object} opts
|
|
@@ -501,26 +546,28 @@ function routesFactory(_ref) {
|
|
|
501
546
|
* @param {Object} [opts.headers] - Optional headers
|
|
502
547
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
503
548
|
*/
|
|
504
|
-
update
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
549
|
+
update({
|
|
550
|
+
token,
|
|
551
|
+
jwtToken,
|
|
552
|
+
routeId,
|
|
553
|
+
bucketId,
|
|
554
|
+
bucket,
|
|
555
|
+
headers
|
|
556
|
+
}) {
|
|
512
557
|
return client({
|
|
513
|
-
url:
|
|
558
|
+
url: `/routes/${routeId}/price-buckets/${bucketId}`,
|
|
514
559
|
method: "put",
|
|
515
560
|
headers: authorizationHeaders({
|
|
516
|
-
token
|
|
561
|
+
token,
|
|
562
|
+
jwtToken,
|
|
563
|
+
internalAuthTokenProvider,
|
|
564
|
+
headers
|
|
517
565
|
}),
|
|
518
566
|
data: {
|
|
519
|
-
bucket
|
|
567
|
+
bucket
|
|
520
568
|
}
|
|
521
569
|
});
|
|
522
570
|
},
|
|
523
|
-
|
|
524
571
|
/**
|
|
525
572
|
* DELETE /routes/:routeId/price-buckets/:bucketId - remove price bucket. API does not accept query params.
|
|
526
573
|
* @param {Object} opts
|
|
@@ -531,25 +578,28 @@ function routesFactory(_ref) {
|
|
|
531
578
|
* @param {Object} [opts.headers] - Optional headers
|
|
532
579
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
533
580
|
*/
|
|
534
|
-
remove
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
581
|
+
remove({
|
|
582
|
+
token,
|
|
583
|
+
jwtToken,
|
|
584
|
+
routeId,
|
|
585
|
+
bucketId,
|
|
586
|
+
headers
|
|
587
|
+
}) {
|
|
541
588
|
return client({
|
|
542
|
-
url:
|
|
589
|
+
url: `/routes/${routeId}/price-buckets/${bucketId}`,
|
|
543
590
|
method: "delete",
|
|
544
591
|
headers: authorizationHeaders({
|
|
545
|
-
token
|
|
592
|
+
token,
|
|
593
|
+
jwtToken,
|
|
594
|
+
internalAuthTokenProvider,
|
|
595
|
+
headers
|
|
546
596
|
})
|
|
547
597
|
});
|
|
548
598
|
}
|
|
549
599
|
};
|
|
550
600
|
|
|
551
601
|
/** @type {{ get: function, update: function }} */
|
|
552
|
-
|
|
602
|
+
const crossBorderDistances = {
|
|
553
603
|
/**
|
|
554
604
|
* GET /routes/:routeId/cross-border-distances - get cross border distances. API does not accept query params.
|
|
555
605
|
* @param {Object} opts
|
|
@@ -559,20 +609,22 @@ function routesFactory(_ref) {
|
|
|
559
609
|
* @param {Object} [opts.headers] - Optional headers
|
|
560
610
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
561
611
|
*/
|
|
562
|
-
get
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
612
|
+
get({
|
|
613
|
+
token,
|
|
614
|
+
jwtToken,
|
|
615
|
+
routeId,
|
|
616
|
+
headers
|
|
617
|
+
}) {
|
|
568
618
|
return client({
|
|
569
|
-
url:
|
|
619
|
+
url: `/routes/${routeId}/cross-border-distances`,
|
|
570
620
|
headers: authorizationHeaders({
|
|
571
|
-
token
|
|
621
|
+
token,
|
|
622
|
+
jwtToken,
|
|
623
|
+
internalAuthTokenProvider,
|
|
624
|
+
headers
|
|
572
625
|
})
|
|
573
626
|
});
|
|
574
627
|
},
|
|
575
|
-
|
|
576
628
|
/**
|
|
577
629
|
* PUT /routes/:routeId/cross-border-distances - update cross border distances. API does not accept query params.
|
|
578
630
|
* @param {Object} opts
|
|
@@ -584,28 +636,31 @@ function routesFactory(_ref) {
|
|
|
584
636
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
585
637
|
*/
|
|
586
638
|
// eslint-disable-next-line no-shadow
|
|
587
|
-
update
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
639
|
+
update({
|
|
640
|
+
token,
|
|
641
|
+
jwtToken,
|
|
642
|
+
routeId,
|
|
643
|
+
crossBorderDistances,
|
|
644
|
+
headers
|
|
645
|
+
}) {
|
|
594
646
|
return client({
|
|
595
|
-
url:
|
|
647
|
+
url: `/routes/${routeId}/cross-border-distances`,
|
|
596
648
|
method: "put",
|
|
597
649
|
headers: authorizationHeaders({
|
|
598
|
-
token
|
|
650
|
+
token,
|
|
651
|
+
jwtToken,
|
|
652
|
+
internalAuthTokenProvider,
|
|
653
|
+
headers
|
|
599
654
|
}),
|
|
600
655
|
data: {
|
|
601
|
-
crossBorderDistances
|
|
656
|
+
crossBorderDistances
|
|
602
657
|
}
|
|
603
658
|
});
|
|
604
659
|
}
|
|
605
660
|
};
|
|
606
661
|
|
|
607
662
|
/** @type {{ all: function, getByRouteId: function, updateByRouteId: function }} */
|
|
608
|
-
|
|
663
|
+
const prorationTables = {
|
|
609
664
|
/**
|
|
610
665
|
* GET /routes/proration-tables - list proration tables.
|
|
611
666
|
* @param {Object} opts
|
|
@@ -615,22 +670,23 @@ function routesFactory(_ref) {
|
|
|
615
670
|
* @param {Object} [opts.headers] - Optional headers
|
|
616
671
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
617
672
|
*/
|
|
618
|
-
all
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
673
|
+
all({
|
|
674
|
+
token,
|
|
675
|
+
jwtToken,
|
|
676
|
+
query = {},
|
|
677
|
+
headers
|
|
678
|
+
}) {
|
|
625
679
|
return client({
|
|
626
680
|
url: "/routes/proration-tables",
|
|
627
681
|
params: query,
|
|
628
682
|
headers: authorizationHeaders({
|
|
629
|
-
token
|
|
683
|
+
token,
|
|
684
|
+
jwtToken,
|
|
685
|
+
internalAuthTokenProvider,
|
|
686
|
+
headers
|
|
630
687
|
})
|
|
631
688
|
});
|
|
632
689
|
},
|
|
633
|
-
|
|
634
690
|
/**
|
|
635
691
|
* GET /routes/:routeId/proration-tables - get proration tables by route id.
|
|
636
692
|
* @param {Object} opts
|
|
@@ -641,23 +697,27 @@ function routesFactory(_ref) {
|
|
|
641
697
|
* @param {Object} [opts.headers] - Optional headers
|
|
642
698
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
643
699
|
*/
|
|
644
|
-
getByRouteId
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
700
|
+
getByRouteId({
|
|
701
|
+
token,
|
|
702
|
+
jwtToken,
|
|
703
|
+
routeId,
|
|
704
|
+
productId,
|
|
705
|
+
headers
|
|
706
|
+
}) {
|
|
707
|
+
const query = productId ? {
|
|
708
|
+
productId
|
|
709
|
+
} : {};
|
|
652
710
|
return client({
|
|
653
|
-
url:
|
|
711
|
+
url: `/routes/${routeId}/proration-tables`,
|
|
654
712
|
params: query,
|
|
655
713
|
headers: authorizationHeaders({
|
|
656
|
-
token
|
|
714
|
+
token,
|
|
715
|
+
jwtToken,
|
|
716
|
+
internalAuthTokenProvider,
|
|
717
|
+
headers
|
|
657
718
|
})
|
|
658
719
|
});
|
|
659
720
|
},
|
|
660
|
-
|
|
661
721
|
/**
|
|
662
722
|
* PUT /routes/:routeId/proration-tables - update proration table by route id. API does not accept query params.
|
|
663
723
|
* @param {Object} opts
|
|
@@ -668,18 +728,21 @@ function routesFactory(_ref) {
|
|
|
668
728
|
* @param {Object} [opts.headers] - Optional headers
|
|
669
729
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
670
730
|
*/
|
|
671
|
-
updateByRouteId
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
731
|
+
updateByRouteId({
|
|
732
|
+
token,
|
|
733
|
+
jwtToken,
|
|
734
|
+
routeId,
|
|
735
|
+
prorationTable: prorationTableData,
|
|
736
|
+
headers
|
|
737
|
+
}) {
|
|
678
738
|
return client({
|
|
679
|
-
url:
|
|
739
|
+
url: `/routes/${routeId}/proration-tables`,
|
|
680
740
|
method: "put",
|
|
681
741
|
headers: authorizationHeaders({
|
|
682
|
-
token
|
|
742
|
+
token,
|
|
743
|
+
jwtToken,
|
|
744
|
+
internalAuthTokenProvider,
|
|
745
|
+
headers
|
|
683
746
|
}),
|
|
684
747
|
data: {
|
|
685
748
|
prorationTable: prorationTableData
|
|
@@ -687,22 +750,20 @@ function routesFactory(_ref) {
|
|
|
687
750
|
});
|
|
688
751
|
}
|
|
689
752
|
};
|
|
690
|
-
|
|
691
753
|
return {
|
|
692
|
-
get
|
|
693
|
-
prices
|
|
694
|
-
all
|
|
695
|
-
stations
|
|
696
|
-
create
|
|
697
|
-
update
|
|
698
|
-
remove
|
|
699
|
-
fareTables
|
|
700
|
-
stops
|
|
701
|
-
fareRules
|
|
702
|
-
priceBuckets
|
|
703
|
-
crossBorderDistances
|
|
704
|
-
prorationTables
|
|
754
|
+
get,
|
|
755
|
+
prices,
|
|
756
|
+
all,
|
|
757
|
+
stations,
|
|
758
|
+
create,
|
|
759
|
+
update,
|
|
760
|
+
remove,
|
|
761
|
+
fareTables,
|
|
762
|
+
stops,
|
|
763
|
+
fareRules,
|
|
764
|
+
priceBuckets,
|
|
765
|
+
crossBorderDistances,
|
|
766
|
+
prorationTables
|
|
705
767
|
};
|
|
706
768
|
}
|
|
707
|
-
|
|
708
769
|
module.exports = routesFactory;
|