btrz-api-client 8.40.0 → 8.42.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 +38 -51
- package/lib/endpoints/btrzpay/adyen.js +14 -1
- package/lib/endpoints/notifications/pdf-data.js +3 -0
- package/package.json +1 -1
- package/src/client.js +1 -1
- package/src/endpoints/btrzpay/adyen.js +9 -1
- package/src/endpoints/notifications/pdf-data.js +3 -0
- package/test/endpoints/btrzpay/adyen.test.js +35 -0
- package/test/endpoints/notifications/pdf-data.test.js +205 -10
package/lib/client.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4
4
|
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
5
7
|
var axios = require("axios");
|
|
6
8
|
var productionOptions = require("./productionDefaults.js");
|
|
7
9
|
|
|
@@ -538,6 +540,8 @@ function createSeatmaps(_ref12) {
|
|
|
538
540
|
* @returns {Object} Object with btrzpay endpoint namespaces and __test.client
|
|
539
541
|
*/
|
|
540
542
|
function createBtrzPay(_ref13) {
|
|
543
|
+
var _ref14;
|
|
544
|
+
|
|
541
545
|
var baseURL = _ref13.baseURL,
|
|
542
546
|
headers = _ref13.headers,
|
|
543
547
|
timeout = _ref13.timeout,
|
|
@@ -546,30 +550,13 @@ function createBtrzPay(_ref13) {
|
|
|
546
550
|
agents = _ref13.agents;
|
|
547
551
|
|
|
548
552
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
549
|
-
|
|
550
|
-
return {
|
|
553
|
+
return _ref14 = {
|
|
551
554
|
adyen: require("./endpoints/btrzpay/adyen.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
552
555
|
cybersource3ds: require("./endpoints/btrzpay/cybersource3ds.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
553
|
-
docs: require("./endpoints/btrzpay/docs.js")({ client: client })
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
payments: require("./endpoints/btrzpay/payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
558
|
-
referencedPayments: require("./endpoints/btrzpay/referenced-payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
559
|
-
customers: require("./endpoints/btrzpay/customers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
560
|
-
customerCards: require("./endpoints/btrzpay/customerCards.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
561
|
-
squareTerminals: require("./endpoints/btrzpay/square.js").squareTerminalsFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
562
|
-
squareWebhooks: require("./endpoints/btrzpay/square.js").squareWebhooksFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
563
|
-
oxxo: require("./endpoints/btrzpay/oxxo.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
564
|
-
datalogic: require("./endpoints/btrzpay/datalogic.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
565
|
-
prismaTerminals: require("./endpoints/btrzpay/prismaTerminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
566
|
-
terminalPayments: require("./endpoints/btrzpay/terminalPayments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
567
|
-
stripeTerminals: require("./endpoints/btrzpay/stripe-terminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
568
|
-
stripe3ds: require("./endpoints/btrzpay/stripe3ds.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
569
|
-
__test: {
|
|
570
|
-
client: client
|
|
571
|
-
}
|
|
572
|
-
};
|
|
556
|
+
docs: require("./endpoints/btrzpay/docs.js")({ client: client })
|
|
557
|
+
}, _defineProperty(_ref14, "adyen", require("./endpoints/btrzpay/adyen.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "cardpointeTerminals", require("./endpoints/btrzpay/cardpointe.js").cardpointeTerminalsFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "paymentMethods", require("./endpoints/btrzpay/payment-methods.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "referenceNumbers", require("./endpoints/btrzpay/reference-numbers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "payments", require("./endpoints/btrzpay/payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "referencedPayments", require("./endpoints/btrzpay/referenced-payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "customers", require("./endpoints/btrzpay/customers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "customerCards", require("./endpoints/btrzpay/customerCards.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "squareTerminals", require("./endpoints/btrzpay/square.js").squareTerminalsFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "squareWebhooks", require("./endpoints/btrzpay/square.js").squareWebhooksFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "oxxo", require("./endpoints/btrzpay/oxxo.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "datalogic", require("./endpoints/btrzpay/datalogic.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "prismaTerminals", require("./endpoints/btrzpay/prismaTerminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "terminalPayments", require("./endpoints/btrzpay/terminalPayments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "stripeTerminals", require("./endpoints/btrzpay/stripe-terminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "stripe3ds", require("./endpoints/btrzpay/stripe3ds.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })), _defineProperty(_ref14, "__test", {
|
|
558
|
+
client: client
|
|
559
|
+
}), _ref14;
|
|
573
560
|
}
|
|
574
561
|
|
|
575
562
|
/**
|
|
@@ -577,13 +564,13 @@ function createBtrzPay(_ref13) {
|
|
|
577
564
|
* @param {CreateModuleOptions} opts - Client options
|
|
578
565
|
* @returns {Object} Object with invoices endpoint namespaces and __test.client
|
|
579
566
|
*/
|
|
580
|
-
function createInvoices(
|
|
581
|
-
var baseURL =
|
|
582
|
-
headers =
|
|
583
|
-
timeout =
|
|
584
|
-
overrideFn =
|
|
585
|
-
internalAuthTokenProvider =
|
|
586
|
-
agents =
|
|
567
|
+
function createInvoices(_ref15) {
|
|
568
|
+
var baseURL = _ref15.baseURL,
|
|
569
|
+
headers = _ref15.headers,
|
|
570
|
+
timeout = _ref15.timeout,
|
|
571
|
+
overrideFn = _ref15.overrideFn,
|
|
572
|
+
internalAuthTokenProvider = _ref15.internalAuthTokenProvider,
|
|
573
|
+
agents = _ref15.agents;
|
|
587
574
|
|
|
588
575
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
589
576
|
|
|
@@ -611,13 +598,13 @@ function createInvoices(_ref14) {
|
|
|
611
598
|
* @param {CreateModuleOptions} opts - Client options
|
|
612
599
|
* @returns {Object} Object with gps endpoint namespaces and __test.client
|
|
613
600
|
*/
|
|
614
|
-
function createGPS(
|
|
615
|
-
var baseURL =
|
|
616
|
-
headers =
|
|
617
|
-
timeout =
|
|
618
|
-
overrideFn =
|
|
619
|
-
internalAuthTokenProvider =
|
|
620
|
-
agents =
|
|
601
|
+
function createGPS(_ref16) {
|
|
602
|
+
var baseURL = _ref16.baseURL,
|
|
603
|
+
headers = _ref16.headers,
|
|
604
|
+
timeout = _ref16.timeout,
|
|
605
|
+
overrideFn = _ref16.overrideFn,
|
|
606
|
+
internalAuthTokenProvider = _ref16.internalAuthTokenProvider,
|
|
607
|
+
agents = _ref16.agents;
|
|
621
608
|
|
|
622
609
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
623
610
|
|
|
@@ -634,12 +621,12 @@ function createGPS(_ref15) {
|
|
|
634
621
|
* @param {Omit<CreateModuleOptions, "internalAuthTokenProvider">} opts - Client options (no internalAuthTokenProvider)
|
|
635
622
|
* @returns {Object} Object with ratality endpoint namespaces and __test.client
|
|
636
623
|
*/
|
|
637
|
-
function createRatality(
|
|
638
|
-
var baseURL =
|
|
639
|
-
headers =
|
|
640
|
-
timeout =
|
|
641
|
-
overrideFn =
|
|
642
|
-
agents =
|
|
624
|
+
function createRatality(_ref17) {
|
|
625
|
+
var baseURL = _ref17.baseURL,
|
|
626
|
+
headers = _ref17.headers,
|
|
627
|
+
timeout = _ref17.timeout,
|
|
628
|
+
overrideFn = _ref17.overrideFn,
|
|
629
|
+
agents = _ref17.agents;
|
|
643
630
|
|
|
644
631
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
645
632
|
var version = "v2";
|
|
@@ -668,15 +655,15 @@ function createRatality(_ref16) {
|
|
|
668
655
|
* @param {{httpAgent: import("http").Agent, httpsAgent: import("https").Agent}} options.agents - An object containg one or both http agents
|
|
669
656
|
*/
|
|
670
657
|
function createApiClient(options) {
|
|
671
|
-
var
|
|
672
|
-
baseURL =
|
|
673
|
-
|
|
674
|
-
baseURLOverride =
|
|
675
|
-
headers =
|
|
676
|
-
|
|
677
|
-
timeout =
|
|
678
|
-
internalAuthTokenProvider =
|
|
679
|
-
agents =
|
|
658
|
+
var _ref18 = options || productionOptions,
|
|
659
|
+
baseURL = _ref18.baseURL,
|
|
660
|
+
_ref18$baseURLOverrid = _ref18.baseURLOverride,
|
|
661
|
+
baseURLOverride = _ref18$baseURLOverrid === undefined ? {} : _ref18$baseURLOverrid,
|
|
662
|
+
headers = _ref18.headers,
|
|
663
|
+
_ref18$timeout = _ref18.timeout,
|
|
664
|
+
timeout = _ref18$timeout === undefined ? 0 : _ref18$timeout,
|
|
665
|
+
internalAuthTokenProvider = _ref18.internalAuthTokenProvider,
|
|
666
|
+
agents = _ref18.agents;
|
|
680
667
|
|
|
681
668
|
return {
|
|
682
669
|
constants: require("./constants.js"),
|
|
@@ -50,8 +50,21 @@ function adyenFactory(_ref) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
function getTerminals(_ref3) {
|
|
54
|
+
var token = _ref3.token,
|
|
55
|
+
jwtToken = _ref3.jwtToken,
|
|
56
|
+
headers = _ref3.headers,
|
|
57
|
+
data = _ref3.data;
|
|
58
|
+
|
|
59
|
+
return client.get("/adyen-terminals", {
|
|
60
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
61
|
+
data: data
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
53
65
|
return {
|
|
54
|
-
getPaymentMethods: getPaymentMethods
|
|
66
|
+
getPaymentMethods: getPaymentMethods,
|
|
67
|
+
getTerminals: getTerminals
|
|
55
68
|
};
|
|
56
69
|
}
|
|
57
70
|
|
|
@@ -72,6 +72,9 @@ function pdfDataFactory(_ref) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
if (query.type === "pre_trip_notification" || query.type === "post_trip_notification") {
|
|
76
|
+
url = "/manifest-notification-data/" + itemId + "?type=" + query.type;
|
|
77
|
+
}
|
|
75
78
|
if (query.type === "parcel_confirmation") {
|
|
76
79
|
url = "/pdf-parcels/" + itemId;
|
|
77
80
|
}
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -449,11 +449,11 @@ function createSeatmaps({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
449
449
|
*/
|
|
450
450
|
function createBtrzPay({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
|
|
451
451
|
const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
|
|
452
|
-
|
|
453
452
|
return {
|
|
454
453
|
adyen: require("./endpoints/btrzpay/adyen.js")({client, internalAuthTokenProvider}),
|
|
455
454
|
cybersource3ds: require("./endpoints/btrzpay/cybersource3ds.js")({client, internalAuthTokenProvider}),
|
|
456
455
|
docs: require("./endpoints/btrzpay/docs.js")({client}),
|
|
456
|
+
adyen: require("./endpoints/btrzpay/adyen.js")({client, internalAuthTokenProvider}),
|
|
457
457
|
cardpointeTerminals: require("./endpoints/btrzpay/cardpointe.js").cardpointeTerminalsFactory({client, internalAuthTokenProvider}),
|
|
458
458
|
paymentMethods: require("./endpoints/btrzpay/payment-methods.js")({client, internalAuthTokenProvider}),
|
|
459
459
|
referenceNumbers: require("./endpoints/btrzpay/reference-numbers.js")({client, internalAuthTokenProvider}),
|
|
@@ -36,8 +36,16 @@ function adyenFactory({client, internalAuthTokenProvider}) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
function getTerminals({token, jwtToken, headers, data}) {
|
|
40
|
+
return client.get("/adyen-terminals", {
|
|
41
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
42
|
+
data
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
return {
|
|
40
|
-
getPaymentMethods
|
|
47
|
+
getPaymentMethods,
|
|
48
|
+
getTerminals
|
|
41
49
|
};
|
|
42
50
|
}
|
|
43
51
|
|
|
@@ -68,6 +68,9 @@ function pdfDataFactory({
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
if (query.type === "pre_trip_notification" || query.type === "post_trip_notification") {
|
|
72
|
+
url = `/manifest-notification-data/${itemId}?type=${query.type}`;
|
|
73
|
+
}
|
|
71
74
|
if (query.type === "parcel_confirmation") {
|
|
72
75
|
url = `/pdf-parcels/${itemId}`;
|
|
73
76
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const {
|
|
2
|
+
axiosMock, expectRequest
|
|
3
|
+
} = require("../../test-helpers.js");
|
|
4
|
+
const api = require("../../../src/client.js").createApiClient({
|
|
5
|
+
baseURL: "http://test.com"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
describe("btrzpay/adyen", () => {
|
|
9
|
+
const token = "token";
|
|
10
|
+
const jwtToken = "I owe you a JWT token";
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
axiosMock.reset();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should get the adyen payment methods", () => {
|
|
17
|
+
axiosMock.onGet("/adyen-payment-methods").reply(expectRequest({
|
|
18
|
+
statusCode: 200, token, jwtToken
|
|
19
|
+
}));
|
|
20
|
+
return api.btrzpay.adyen.getPaymentMethods({
|
|
21
|
+
token,
|
|
22
|
+
jwtToken
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should get the adyen terminals", () => {
|
|
27
|
+
axiosMock.onGet("/adyen-terminals").reply(expectRequest({
|
|
28
|
+
statusCode: 200, token, jwtToken
|
|
29
|
+
}));
|
|
30
|
+
return api.btrzpay.adyen.getTerminals({
|
|
31
|
+
token,
|
|
32
|
+
jwtToken
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -6,6 +6,7 @@ const api = require("./../../../src/client.js").createApiClient({
|
|
|
6
6
|
baseURL: "http://test.com"
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
// eslint-disable-next-line max-statements
|
|
9
10
|
describe("notifications/pdf-data", () => {
|
|
10
11
|
const token = "my-api-key";
|
|
11
12
|
|
|
@@ -301,18 +302,212 @@ describe("notifications/pdf-data", () => {
|
|
|
301
302
|
});
|
|
302
303
|
});
|
|
303
304
|
|
|
304
|
-
it("should return the proper data for
|
|
305
|
+
it("should return the proper data for pre_trip_notification (manifest notification data)", () => {
|
|
305
306
|
const itemId = "12345";
|
|
306
|
-
const query = {
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
const query = {type: "pre_trip_notification"};
|
|
308
|
+
axiosMock.onGet(new RegExp(`^/manifest-notification-data/${itemId}\\?type=pre_trip_notification`))
|
|
309
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
310
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
it("should return the proper data for post_trip_notification (manifest notification data)", () => {
|
|
314
|
+
const itemId = "12345";
|
|
315
|
+
const query = {type: "post_trip_notification"};
|
|
316
|
+
axiosMock.onGet(new RegExp(`^/manifest-notification-data/${itemId}\\?type=post_trip_notification`))
|
|
317
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
318
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it("should return the proper data for parcel_confirmation", () => {
|
|
322
|
+
const itemId = "12345";
|
|
323
|
+
const query = {type: "parcel_confirmation"};
|
|
324
|
+
axiosMock.onGet(`/pdf-parcels/${itemId}`)
|
|
325
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
326
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it("should return the proper data for redeemable_items_confirmation", () => {
|
|
330
|
+
const itemId = "12345";
|
|
331
|
+
const query = {type: "redeemable_items_confirmation"};
|
|
332
|
+
axiosMock.onGet(`/pdf-redeemable-items/${itemId}`)
|
|
333
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
334
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it("should return the proper data for sold_item_confirmation", () => {
|
|
338
|
+
const itemId = "12345";
|
|
339
|
+
const query = {type: "sold_item_confirmation"};
|
|
340
|
+
axiosMock.onGet(`/pdf-sold-items/${itemId}`)
|
|
341
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
342
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it("should return the proper data for customer_card_membership (pdf-customer)", () => {
|
|
346
|
+
const itemId = "12345";
|
|
347
|
+
const query = {type: "customer_card_membership"};
|
|
348
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
349
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
350
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it("should return the proper data for scanning_badge (pdf-customer)", () => {
|
|
354
|
+
const itemId = "12345";
|
|
355
|
+
const query = {type: "scanning_badge"};
|
|
356
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
357
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
358
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it("should return the proper data for customer_activation (pdf-customer)", () => {
|
|
362
|
+
const itemId = "12345";
|
|
363
|
+
const query = {type: "customer_activation"};
|
|
364
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
365
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
366
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it("should return the proper data for customer_activation_mobile (pdf-customer)", () => {
|
|
370
|
+
const itemId = "12345";
|
|
371
|
+
const query = {type: "customer_activation_mobile"};
|
|
372
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
373
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
374
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
it("should return the proper data for customer_password_reset (pdf-customer)", () => {
|
|
378
|
+
const itemId = "12345";
|
|
379
|
+
const query = {type: "customer_password_reset"};
|
|
380
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
381
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
382
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
it("should return the proper data for customer_password_reset_mobile (pdf-customer)", () => {
|
|
386
|
+
const itemId = "12345";
|
|
387
|
+
const query = {type: "customer_password_reset_mobile"};
|
|
388
|
+
axiosMock.onGet(`/pdf-customer/${itemId}`)
|
|
389
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
390
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
it("should return the proper data for gift_certificate_notification", () => {
|
|
394
|
+
const itemId = "12345";
|
|
395
|
+
const query = {type: "gift_certificate_notification"};
|
|
396
|
+
axiosMock.onGet(`/pdf-gift-certificates/${itemId}`)
|
|
397
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
398
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it("should return the proper data for user_password_reset", () => {
|
|
402
|
+
const itemId = "12345";
|
|
403
|
+
const query = {type: "user_password_reset"};
|
|
404
|
+
axiosMock.onGet(`/pdf-users/${itemId}`)
|
|
405
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
406
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it("should return the proper data for voucher_notification", () => {
|
|
410
|
+
const itemId = "12345";
|
|
411
|
+
const query = {type: "voucher_notification"};
|
|
309
412
|
axiosMock.onGet(`/pdf-vouchers/${itemId}`)
|
|
310
|
-
.reply(expectRequest({
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
413
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
414
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
it("should return the proper data for compensation_voucher", () => {
|
|
418
|
+
const itemId = "12345";
|
|
419
|
+
const query = {type: "compensation_voucher"};
|
|
420
|
+
axiosMock.onGet(`/pdf-vouchers/${itemId}`)
|
|
421
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
422
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
it("should return the proper data for new_account (pdf-accounts)", () => {
|
|
426
|
+
const itemId = "12345";
|
|
427
|
+
const query = {type: "new_account"};
|
|
428
|
+
axiosMock.onGet(`/pdf-accounts/${itemId}`)
|
|
429
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
430
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
it("should return the proper data for new_seller_account (pdf-accounts)", () => {
|
|
434
|
+
const itemId = "12345";
|
|
435
|
+
const query = {type: "new_seller_account"};
|
|
436
|
+
axiosMock.onGet(`/pdf-accounts/${itemId}`)
|
|
437
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
438
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it("should return the proper data for interline_provider_invite (pdf-accounts)", () => {
|
|
442
|
+
const itemId = "12345";
|
|
443
|
+
const query = {type: "interline_provider_invite"};
|
|
444
|
+
axiosMock.onGet(`/pdf-accounts/${itemId}`)
|
|
445
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
446
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
it("should return the proper data for operator_purchase (pdf-transactions)", () => {
|
|
450
|
+
const itemId = "12345";
|
|
451
|
+
const query = {type: "operator_purchase"};
|
|
452
|
+
axiosMock.onGet(`/pdf-transactions/${itemId}`)
|
|
453
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
454
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it("should return the proper data for operator_ssr (pdf-transactions)", () => {
|
|
458
|
+
const itemId = "12345";
|
|
459
|
+
const query = {type: "operator_ssr"};
|
|
460
|
+
axiosMock.onGet(`/pdf-transactions/${itemId}`)
|
|
461
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
462
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
it("should return the proper data for operator_manifest_capacity", () => {
|
|
466
|
+
const itemId = "12345";
|
|
467
|
+
const query = {type: "operator_manifest_capacity"};
|
|
468
|
+
axiosMock.onGet(`/pdf-operator-manifest-capacities/${itemId}`)
|
|
469
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
470
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
it("should return the proper data for reaccomodation", () => {
|
|
474
|
+
const itemId = "12345";
|
|
475
|
+
const query = {type: "reaccomodation"};
|
|
476
|
+
axiosMock.onGet(`/pdf-reaccomodation/${itemId}`)
|
|
477
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
478
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
it("should return the proper data for ticket_movement (pdf-reaccomodation)", () => {
|
|
482
|
+
const itemId = "12345";
|
|
483
|
+
const query = {type: "ticket_movement"};
|
|
484
|
+
axiosMock.onGet(`/pdf-reaccomodation/${itemId}`)
|
|
485
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
486
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
it("should return the proper data for manifest_notification", () => {
|
|
490
|
+
const itemId = "12345";
|
|
491
|
+
const query = {type: "manifest_notification"};
|
|
492
|
+
axiosMock.onGet(`/pdf-manifests/${itemId}`)
|
|
493
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
494
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
it("should return the proper data for startingBalance", () => {
|
|
498
|
+
const itemId = "12345";
|
|
499
|
+
const query = {type: "startingBalance"};
|
|
500
|
+
axiosMock.onGet(`/pdf-starting-balance/${itemId}`)
|
|
501
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
502
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("should return the proper data for partialShiftDeposits", () => {
|
|
506
|
+
const itemId = "12345";
|
|
507
|
+
const query = {type: "partialShiftDeposits"};
|
|
508
|
+
axiosMock.onGet(`/pdf-partial-shift-deposits/${itemId}`)
|
|
509
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
510
|
+
return api.notifications.pdfData.get({token, query, itemId});
|
|
316
511
|
});
|
|
317
512
|
|
|
318
513
|
it("should return the proper data for a passengersManifest", () => {
|