btrz-api-client 9.3.0 → 9.4.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 +1 -1
- package/lib/endpoints/notifications/pdf-data.js +2 -1
- package/lib/endpoints/notifications/pdfs.js +2 -1
- package/package.json +1 -1
- package/src/endpoints/notifications/pdf-data.js +2 -1
- package/src/endpoints/notifications/pdfs.js +2 -1
- package/test/endpoints/notifications/pdf-data.test.js +15 -0
- package/test/endpoints/notifications/pdfs.test.js +15 -0
- package/types/endpoints/notifications/pdf-data.d.ts +1 -1
- package/types/endpoints/notifications/pdfs.d.ts +1 -1
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET pdf-templates-processing routes (btrz-api-notifications). Client uses type/family to resolve path.
|
|
8
8
|
* @typedef {Object} PdfDataGetQuery
|
|
9
9
|
* @property {string} type - Document type; determines path (e.g. product, giftCertificate, voucher, transaction, ssr, manifest, passengersManifest, order, order_confirmation, cancellation, change, shift, invoice, parcelManifest, startingBalance, partialShiftDeposits, bankDepositSlip, terminalVoucher, manualTickets, etc.). For pre_trip_notification and post_trip_notification the request uses GET /queue-notifications/manifest-notification-data/{itemId}.
|
|
10
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
10
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -61,6 +61,7 @@ function pdfDataFactory({
|
|
|
61
61
|
url = `/pdf-flexpasses/${itemId}`;
|
|
62
62
|
break;
|
|
63
63
|
case "bundle":
|
|
64
|
+
case "open-return":
|
|
64
65
|
url = `/pdf-redeemable-items/${itemId}`;
|
|
65
66
|
break;
|
|
66
67
|
default:
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET pdf-templates-processing binary routes (btrz-api-notifications). Client uses type/family to resolve path.
|
|
8
8
|
* @typedef {Object} PdfGetQuery
|
|
9
9
|
* @property {string} type - Document type (e.g. product, giftCertificate, voucher, transaction, ssr, manifest, passengersManifest, order, shift, remainderSlip, exchange, invoice, locationClosure, parcelManifest, startingBalance, partialShiftDeposits, shiftLocationClosure, bankDepositSlip, terminalVoucher, manualTickets, externalWalletVoucher)
|
|
10
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
10
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -63,6 +63,7 @@ function pdfFactory({
|
|
|
63
63
|
url = `/pdf-flexpasses/${itemId}`;
|
|
64
64
|
break;
|
|
65
65
|
case "bundle":
|
|
66
|
+
case "open-return":
|
|
66
67
|
url = `/pdf-redeemable-items/${itemId}`;
|
|
67
68
|
break;
|
|
68
69
|
default:
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET pdf-templates-processing routes (btrz-api-notifications). Client uses type/family to resolve path.
|
|
8
8
|
* @typedef {Object} PdfDataGetQuery
|
|
9
9
|
* @property {string} type - Document type; determines path (e.g. product, giftCertificate, voucher, transaction, ssr, manifest, passengersManifest, order, order_confirmation, cancellation, change, shift, invoice, parcelManifest, startingBalance, partialShiftDeposits, bankDepositSlip, terminalVoucher, manualTickets, etc.). For pre_trip_notification and post_trip_notification the request uses GET /queue-notifications/manifest-notification-data/{itemId}.
|
|
10
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
10
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -61,6 +61,7 @@ function pdfDataFactory({
|
|
|
61
61
|
url = `/pdf-flexpasses/${itemId}`;
|
|
62
62
|
break;
|
|
63
63
|
case "bundle":
|
|
64
|
+
case "open-return":
|
|
64
65
|
url = `/pdf-redeemable-items/${itemId}`;
|
|
65
66
|
break;
|
|
66
67
|
default:
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET pdf-templates-processing binary routes (btrz-api-notifications). Client uses type/family to resolve path.
|
|
8
8
|
* @typedef {Object} PdfGetQuery
|
|
9
9
|
* @property {string} type - Document type (e.g. product, giftCertificate, voucher, transaction, ssr, manifest, passengersManifest, order, shift, remainderSlip, exchange, invoice, locationClosure, parcelManifest, startingBalance, partialShiftDeposits, shiftLocationClosure, bankDepositSlip, terminalVoucher, manualTickets, externalWalletVoucher)
|
|
10
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
10
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -63,6 +63,7 @@ function pdfFactory({
|
|
|
63
63
|
url = `/pdf-flexpasses/${itemId}`;
|
|
64
64
|
break;
|
|
65
65
|
case "bundle":
|
|
66
|
+
case "open-return":
|
|
66
67
|
url = `/pdf-redeemable-items/${itemId}`;
|
|
67
68
|
break;
|
|
68
69
|
default:
|
|
@@ -274,6 +274,21 @@ describe("notifications/pdf-data", () => {
|
|
|
274
274
|
});
|
|
275
275
|
});
|
|
276
276
|
|
|
277
|
+
it("should return the proper data for an open-return redeemableItem", () => {
|
|
278
|
+
const itemId = "12345";
|
|
279
|
+
const query = {
|
|
280
|
+
type: "product",
|
|
281
|
+
family: "open-return"
|
|
282
|
+
};
|
|
283
|
+
axiosMock.onGet(`/pdf-redeemable-items/${itemId}`)
|
|
284
|
+
.reply(expectRequest({
|
|
285
|
+
statusCode: 200, token
|
|
286
|
+
}));
|
|
287
|
+
return api.notifications.pdfData.get({
|
|
288
|
+
token, query, itemId
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
277
292
|
it("should return the proper data for a gift-certificates", () => {
|
|
278
293
|
const itemId = "12345";
|
|
279
294
|
const query = {
|
|
@@ -203,6 +203,21 @@ describe("notifications/pdfs", () => {
|
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
205
|
|
|
206
|
+
it("should return the proper data for an open-return redeemableItem", () => {
|
|
207
|
+
const itemId = "12345";
|
|
208
|
+
const query = {
|
|
209
|
+
type: "product",
|
|
210
|
+
family: "open-return"
|
|
211
|
+
};
|
|
212
|
+
axiosMock.onGet(`/pdf-redeemable-items/${itemId}`)
|
|
213
|
+
.reply(expectRequest({
|
|
214
|
+
statusCode: 200, token
|
|
215
|
+
}));
|
|
216
|
+
return api.notifications.pdfs.get({
|
|
217
|
+
token, query, itemId
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
206
221
|
it("should return the proper data for a gift-certificates", () => {
|
|
207
222
|
const itemId = "12345";
|
|
208
223
|
const query = {
|
|
@@ -2,7 +2,7 @@ export = pdfDataFactory;
|
|
|
2
2
|
/**
|
|
3
3
|
* @typedef {Object} PdfDataGetQuery
|
|
4
4
|
* @property {string} type - Document type; determines path. E.g. "product", "giftCertificate", "voucher", "transaction", "ssr", "manifest", "passengersManifest", "order", "order_confirmation", "cancellation", "change", "shift", "invoice", "parcelManifest", "parcel_confirmation", "redeemable_items_confirmation", "sold_item_confirmation", "customer_card_membership", "user_password_reset", "new_account", "operator_manifest_capacity", "reaccomodation", "ticket_movement", "manifest_notification", "startingBalance", "partialShiftDeposits", "shiftLocationClosure", "bankDepositSlip", "terminalVoucher", "manualTickets", etc.
|
|
5
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
5
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Factory for PDF data (JSON) endpoints (btrz-api-notifications). Resolves URL by query.type (and query.family when type is "product").
|
|
@@ -2,7 +2,7 @@ export = pdfFactory;
|
|
|
2
2
|
/**
|
|
3
3
|
* @typedef {Object} PdfGetQuery
|
|
4
4
|
* @property {string} type - Document type: "product" | "giftCertificate" | "voucher" | "transaction" | "ssr" | "manifest" | "passengersManifest" | "order" | "shift" | "remainderSlip" | "exchange" | "invoice" | "locationClosure" | "parcelManifest" | "startingBalance" | "partialShiftDeposits" | "shiftLocationClosure" | "bankDepositSlip" | "terminalVoucher" | "manualTickets"
|
|
5
|
-
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle"
|
|
5
|
+
* @property {string} [family] - When type is "product": "ticket" | "reservation" | "paid in" | "paid out" | "parcel" | "flexpass" | "bundle" | "open-return"
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Factory for PDF binary endpoints (btrz-api-notifications). Resolves URL by query.type (and query.family when type is "product").
|