btrz-api-client 5.211.0 → 5.212.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/lib/client-standalone-min.js +3 -3
- package/lib/client.js +2 -0
- package/lib/endpoints/accounts/market-pricing-settings.js +43 -0
- package/lib/endpoints/accounts/point-to-point-settings.js +43 -0
- package/package.json +1 -1
- package/src/client.js +2 -0
- package/src/endpoints/accounts/market-pricing-settings.js +30 -0
- package/src/endpoints/accounts/point-to-point-settings.js +30 -0
- package/test/endpoints/accounts/msrket-pricing-settings.test.js +35 -0
- package/test/endpoints/accounts/point-to-point-settings.test.js +35 -0
- package/types/client.d.ts +26 -0
- package/types/endpoints/accounts/market-pricing-settings.d.ts +17 -0
- package/types/endpoints/accounts/point-to-point-settings.d.ts +17 -0
- package/types/initializedClient.d.ts +26 -0
package/lib/client.js
CHANGED
|
@@ -195,6 +195,8 @@ function createAccounts(_ref4) {
|
|
|
195
195
|
peopleLookups: require("./endpoints/accounts/people-lookups.js")({
|
|
196
196
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
197
197
|
}),
|
|
198
|
+
pointToPointSettings: require("./endpoints/accounts/point-to-point-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
199
|
+
marketPricingSettings: require("./endpoints/accounts/market-pricing-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
198
200
|
printers: require("./endpoints/accounts/printers.js")({
|
|
199
201
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
200
202
|
}),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function marketPricingSettingsFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function get(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
headers = _ref2.headers;
|
|
14
|
+
|
|
15
|
+
return client({
|
|
16
|
+
url: "/market-pricing-settings",
|
|
17
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function update(_ref3) {
|
|
22
|
+
var token = _ref3.token,
|
|
23
|
+
jwtToken = _ref3.jwtToken,
|
|
24
|
+
marketPricingSettings = _ref3.marketPricingSettings,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/market-pricing-settings",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({
|
|
31
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
32
|
+
}),
|
|
33
|
+
data: marketPricingSettings
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
get: get,
|
|
39
|
+
update: update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = marketPricingSettingsFactory;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function pointToPointSettingsFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function get(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
headers = _ref2.headers;
|
|
14
|
+
|
|
15
|
+
return client({
|
|
16
|
+
url: "/point-to-point-settings",
|
|
17
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function update(_ref3) {
|
|
22
|
+
var token = _ref3.token,
|
|
23
|
+
jwtToken = _ref3.jwtToken,
|
|
24
|
+
pointToPointSettings = _ref3.pointToPointSettings,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/point-to-point-settings",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({
|
|
31
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
32
|
+
}),
|
|
33
|
+
data: pointToPointSettings
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
get: get,
|
|
39
|
+
update: update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = pointToPointSettingsFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -161,6 +161,8 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
161
161
|
peopleLookups: require("./endpoints/accounts/people-lookups.js")({
|
|
162
162
|
client, internalAuthTokenProvider
|
|
163
163
|
}),
|
|
164
|
+
pointToPointSettings: require("./endpoints/accounts/point-to-point-settings.js")({client, internalAuthTokenProvider}),
|
|
165
|
+
marketPricingSettings: require("./endpoints/accounts/market-pricing-settings.js")({client, internalAuthTokenProvider}),
|
|
164
166
|
printers: require("./endpoints/accounts/printers.js")({
|
|
165
167
|
client, internalAuthTokenProvider
|
|
166
168
|
}),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function marketPricingSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/market-pricing-settings",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, marketPricingSettings, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/market-pricing-settings",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({
|
|
18
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
19
|
+
}),
|
|
20
|
+
data: marketPricingSettings
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
get,
|
|
26
|
+
update
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = marketPricingSettingsFactory;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function pointToPointSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/point-to-point-settings",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, pointToPointSettings, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/point-to-point-settings",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({
|
|
18
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
19
|
+
}),
|
|
20
|
+
data: pointToPointSettings
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
get,
|
|
26
|
+
update
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = pointToPointSettingsFactory;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/market-pricing", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "secret";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get the market pricing settings", () => {
|
|
13
|
+
axiosMock.onGet("/market-pricing-settings")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
|
|
16
|
+
return api.accounts.marketPricingSettings.get({token, jwtToken});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should update market pricing settings", () => {
|
|
20
|
+
const marketPricingSettings = {
|
|
21
|
+
useOnlySpecificFareTable: true
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
axiosMock.onPut("/market-pricing-settings")
|
|
25
|
+
.reply(expectRequest({
|
|
26
|
+
statusCode: 200,
|
|
27
|
+
token,
|
|
28
|
+
jwtToken
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
return api.accounts.marketPricingSettings.update({
|
|
32
|
+
token, jwtToken, marketPricingSettings
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/point-to-point", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "secret";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get the point to point settings", () => {
|
|
13
|
+
axiosMock.onGet("/point-to-point-settings")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
|
|
16
|
+
return api.accounts.pointToPointSettings.get({token, jwtToken});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should update point to point settings", () => {
|
|
20
|
+
const pointToPointSettings = {
|
|
21
|
+
useOnlySpecificFareTable: true
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
axiosMock.onPut("/point-to-point-settings")
|
|
25
|
+
.reply(expectRequest({
|
|
26
|
+
statusCode: 200,
|
|
27
|
+
token,
|
|
28
|
+
jwtToken
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
return api.accounts.pointToPointSettings.update({
|
|
32
|
+
token, jwtToken, pointToPointSettings
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2265,6 +2265,32 @@ export function createApiClient(options: {
|
|
|
2265
2265
|
headers: any;
|
|
2266
2266
|
}) => any;
|
|
2267
2267
|
};
|
|
2268
|
+
pointToPointSettings: {
|
|
2269
|
+
get: ({ token, jwtToken, headers }: {
|
|
2270
|
+
token: any;
|
|
2271
|
+
jwtToken: any;
|
|
2272
|
+
headers: any;
|
|
2273
|
+
}) => any;
|
|
2274
|
+
update: ({ token, jwtToken, pointToPointSettings, headers }: {
|
|
2275
|
+
token: any;
|
|
2276
|
+
jwtToken: any;
|
|
2277
|
+
pointToPointSettings: any;
|
|
2278
|
+
headers: any;
|
|
2279
|
+
}) => any;
|
|
2280
|
+
};
|
|
2281
|
+
marketPricingSettings: {
|
|
2282
|
+
get: ({ token, jwtToken, headers }: {
|
|
2283
|
+
token: any;
|
|
2284
|
+
jwtToken: any;
|
|
2285
|
+
headers: any;
|
|
2286
|
+
}) => any;
|
|
2287
|
+
update: ({ token, jwtToken, marketPricingSettings, headers }: {
|
|
2288
|
+
token: any;
|
|
2289
|
+
jwtToken: any;
|
|
2290
|
+
marketPricingSettings: any;
|
|
2291
|
+
headers: any;
|
|
2292
|
+
}) => any;
|
|
2293
|
+
};
|
|
2268
2294
|
printers: {
|
|
2269
2295
|
all: ({ token, query, headers }: {
|
|
2270
2296
|
token: any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = marketPricingSettingsFactory;
|
|
2
|
+
declare function marketPricingSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
get: ({ token, jwtToken, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
headers: any;
|
|
10
|
+
}) => any;
|
|
11
|
+
update: ({ token, jwtToken, marketPricingSettings, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
marketPricingSettings: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = pointToPointSettingsFactory;
|
|
2
|
+
declare function pointToPointSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
get: ({ token, jwtToken, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
headers: any;
|
|
10
|
+
}) => any;
|
|
11
|
+
update: ({ token, jwtToken, pointToPointSettings, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
pointToPointSettings: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -2219,6 +2219,32 @@ declare const _exports: {
|
|
|
2219
2219
|
headers: any;
|
|
2220
2220
|
}) => any;
|
|
2221
2221
|
};
|
|
2222
|
+
pointToPointSettings: {
|
|
2223
|
+
get: ({ token, jwtToken, headers }: {
|
|
2224
|
+
token: any;
|
|
2225
|
+
jwtToken: any;
|
|
2226
|
+
headers: any;
|
|
2227
|
+
}) => any;
|
|
2228
|
+
update: ({ token, jwtToken, pointToPointSettings, headers }: {
|
|
2229
|
+
token: any;
|
|
2230
|
+
jwtToken: any;
|
|
2231
|
+
pointToPointSettings: any;
|
|
2232
|
+
headers: any;
|
|
2233
|
+
}) => any;
|
|
2234
|
+
};
|
|
2235
|
+
marketPricingSettings: {
|
|
2236
|
+
get: ({ token, jwtToken, headers }: {
|
|
2237
|
+
token: any;
|
|
2238
|
+
jwtToken: any;
|
|
2239
|
+
headers: any;
|
|
2240
|
+
}) => any;
|
|
2241
|
+
update: ({ token, jwtToken, marketPricingSettings, headers }: {
|
|
2242
|
+
token: any;
|
|
2243
|
+
jwtToken: any;
|
|
2244
|
+
marketPricingSettings: any;
|
|
2245
|
+
headers: any;
|
|
2246
|
+
}) => any;
|
|
2247
|
+
};
|
|
2222
2248
|
printers: {
|
|
2223
2249
|
all: ({ token, query, headers }: {
|
|
2224
2250
|
token: any;
|