btrz-api-client 5.201.0 → 5.202.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 +1 -0
- package/lib/endpoints/accounts/journey-prices-settings.js +43 -0
- package/package.json +1 -1
- package/src/client.js +1 -0
- package/src/endpoints/accounts/journey-prices-settings.js +30 -0
- package/test/endpoints/accounts/journey-prices-settings.test.js +35 -0
- package/types/client.d.ts +13 -0
- package/types/endpoints/accounts/journey-prices-settings.d.ts +17 -0
- package/types/initializedClient.d.ts +13 -0
package/lib/client.js
CHANGED
|
@@ -204,6 +204,7 @@ function createAccounts(_ref4) {
|
|
|
204
204
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
205
205
|
}),
|
|
206
206
|
revenueManagementSettings: require("./endpoints/accounts/rms-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
207
|
+
journeyPricesSettings: require("./endpoints/accounts/journey-prices-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
207
208
|
subPrintTemplates: require("./endpoints/accounts/sub-print-templates.js")({
|
|
208
209
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
209
210
|
}),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function journeyPricesSettingsFactory(_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: "/journey-prices-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
|
+
journeyPricesSettings = _ref3.journeyPricesSettings,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/journey-prices-settings",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({
|
|
31
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
32
|
+
}),
|
|
33
|
+
data: journeyPricesSettings
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
get: get,
|
|
39
|
+
update: update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = journeyPricesSettingsFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -170,6 +170,7 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
170
170
|
client, internalAuthTokenProvider
|
|
171
171
|
}),
|
|
172
172
|
revenueManagementSettings: require("./endpoints/accounts/rms-settings.js")({client, internalAuthTokenProvider}),
|
|
173
|
+
journeyPricesSettings: require("./endpoints/accounts/journey-prices-settings.js")({client, internalAuthTokenProvider}),
|
|
173
174
|
subPrintTemplates: require("./endpoints/accounts/sub-print-templates.js")({
|
|
174
175
|
client, internalAuthTokenProvider
|
|
175
176
|
}),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function journeyPricesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/journey-prices-settings",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, journeyPricesSettings, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/journey-prices-settings",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({
|
|
18
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
19
|
+
}),
|
|
20
|
+
data: journeyPricesSettings
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
get,
|
|
26
|
+
update
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = journeyPricesSettingsFactory;
|
|
@@ -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/journey-prices", () => {
|
|
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 journey prices settings", () => {
|
|
13
|
+
axiosMock.onGet("/journey-prices-settings")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
|
|
16
|
+
return api.accounts.journeyPricesSettings.get({token, jwtToken});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should update journey prices settings", () => {
|
|
20
|
+
const journeyPricesSettings = {
|
|
21
|
+
recordProtectionRules: [{attribute: "isBase", rule: "EQUALS", value: true}]
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
axiosMock.onPut("/journey-prices-settings")
|
|
25
|
+
.reply(expectRequest({
|
|
26
|
+
statusCode: 200,
|
|
27
|
+
token,
|
|
28
|
+
jwtToken
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
return api.accounts.journeyPricesSettings.update({
|
|
32
|
+
token, jwtToken, journeyPricesSettings
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2280,6 +2280,19 @@ export function createApiClient(options: {
|
|
|
2280
2280
|
headers: any;
|
|
2281
2281
|
}) => any;
|
|
2282
2282
|
};
|
|
2283
|
+
journeyPricesSettings: {
|
|
2284
|
+
get: ({ token, jwtToken, headers }: {
|
|
2285
|
+
token: any;
|
|
2286
|
+
jwtToken: any;
|
|
2287
|
+
headers: any;
|
|
2288
|
+
}) => any;
|
|
2289
|
+
update: ({ token, jwtToken, journeyPricesSettings, headers }: {
|
|
2290
|
+
token: any;
|
|
2291
|
+
jwtToken: any;
|
|
2292
|
+
journeyPricesSettings: any;
|
|
2293
|
+
headers: any;
|
|
2294
|
+
}) => any;
|
|
2295
|
+
};
|
|
2283
2296
|
subPrintTemplates: {
|
|
2284
2297
|
create: ({ jwtToken, token, subPrintTemplate, headers }: {
|
|
2285
2298
|
jwtToken: any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = journeyPricesSettingsFactory;
|
|
2
|
+
declare function journeyPricesSettingsFactory({ 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, journeyPricesSettings, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
journeyPricesSettings: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -2234,6 +2234,19 @@ declare const _exports: {
|
|
|
2234
2234
|
headers: any;
|
|
2235
2235
|
}) => any;
|
|
2236
2236
|
};
|
|
2237
|
+
journeyPricesSettings: {
|
|
2238
|
+
get: ({ token, jwtToken, headers }: {
|
|
2239
|
+
token: any;
|
|
2240
|
+
jwtToken: any;
|
|
2241
|
+
headers: any;
|
|
2242
|
+
}) => any;
|
|
2243
|
+
update: ({ token, jwtToken, journeyPricesSettings, headers }: {
|
|
2244
|
+
token: any;
|
|
2245
|
+
jwtToken: any;
|
|
2246
|
+
journeyPricesSettings: any;
|
|
2247
|
+
headers: any;
|
|
2248
|
+
}) => any;
|
|
2249
|
+
};
|
|
2237
2250
|
subPrintTemplates: {
|
|
2238
2251
|
create: ({ jwtToken, token, subPrintTemplate, headers }: {
|
|
2239
2252
|
jwtToken: any;
|