sm-types 0.2.1 → 1.2.2

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.
@@ -0,0 +1,11 @@
1
+ import * as SharedTypes from './shared';
2
+ export interface ICreditCard {
3
+ holderName: string;
4
+ number: string;
5
+ expirationDate: string;
6
+ cvv: string;
7
+ brand: SharedTypes.ICardBrandsType;
8
+ pgmId?: string;
9
+ creditCardToken?: string;
10
+ cardType?: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ declare const ICardBrands: {
2
+ readonly MasterCard: "mastercard";
3
+ readonly Visa: "visa";
4
+ readonly Amex: "string";
5
+ readonly Diners: "diners";
6
+ readonly Elo: "elo";
7
+ };
8
+ declare type ValueOf<T> = T[keyof T];
9
+ export declare type ICardBrandsType = ValueOf<typeof ICardBrands>;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var ICardBrands = {
4
+ MasterCard: "mastercard",
5
+ Visa: "visa",
6
+ Amex: "string",
7
+ Diners: "diners",
8
+ Elo: "elo"
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sm-types",
3
- "version": "0.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -13,6 +13,8 @@
13
13
  "main": "index.js",
14
14
  "types": "index.d.ts",
15
15
  "files": [
16
+ "/common",
17
+ "/sm-tech",
16
18
  "/sm-wcf",
17
19
  "/sm-azul",
18
20
  "/sm-airlines",
@@ -12,6 +12,7 @@ export interface IAddOfferResDto {
12
12
  export declare type IGetOfferDetailsResDto = ISmAzulOffer | ISmWcfOffer;
13
13
  export interface IRefreshAvailabilityResDto {
14
14
  availability: boolean;
15
+ reservedUntil?: Date;
15
16
  currentPrice: number;
16
17
  selectedPrice: number;
17
18
  isSamePrice: boolean;
@@ -29,11 +30,13 @@ export interface IReserveOfferResDto {
29
30
  priceDetails?: IPriceDetails;
30
31
  reservedUntil: Date | string;
31
32
  extraLocators?: string;
33
+ refreshedOffer: ISmWcfOffer;
32
34
  }
33
35
  export interface ICheckReserveOfferResDto {
34
36
  error?: boolean;
35
37
  message?: string;
36
38
  availability: boolean;
39
+ reservedUntil?: Date;
37
40
  currentPrice: number;
38
41
  selectedPrice: number;
39
42
  priceDetails: IPriceDetails;
@@ -1,3 +1,4 @@
1
+ import { ISmTTravelOffer } from "../sm-tech";
1
2
  export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IListOffersReqDto, IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, } from "./dtos";
2
3
  export { IAddOfferCommandParams, IRefreshAvailabilityCommandParams, IBuyOfferCommandParams, ICancelOfferCommandParams, IReserveOfferCommandParams, IReplaceOfferCommandParams, ICheckReserveQueryParams, } from "./command-params";
3
4
  export interface IWrappedResponse<T> {
@@ -209,6 +210,7 @@ export interface ISmWcfOffer {
209
210
  diffAirports: boolean;
210
211
  familyOffers?: any[];
211
212
  selectedItineraryId?: number;
213
+ supplierSearchId?: string;
212
214
  }
213
215
  export interface ISmWcfBound {
214
216
  segments: ISmWcfSegment[];
@@ -281,7 +283,7 @@ export interface ISmWcfFare {
281
283
  export interface IJourneyIdentificator {
282
284
  journeyKey: string;
283
285
  fareKey: string;
284
- fareInfo: IFareInfo;
286
+ fareInfo: IFareInfo | ISmTechFareInfo;
285
287
  }
286
288
  export interface IFareInfo {
287
289
  classOfService: string;
@@ -292,6 +294,13 @@ export interface IFareInfo {
292
294
  productClass: string;
293
295
  productClassName: ISmAzulProductClassName;
294
296
  }
297
+ export interface ISmTechFareInfo {
298
+ productClass: string;
299
+ productClassName: string;
300
+ fareBasis: string;
301
+ totalPrice: number;
302
+ baggageCount: number;
303
+ }
295
304
  export interface IDateInfo {
296
305
  writtenFormatWithDayOfWeek: string;
297
306
  writtenFormat: string;
@@ -310,11 +319,13 @@ export interface ICarrierInfo {
310
319
  }
311
320
  export interface IPriceDetails {
312
321
  total: number;
322
+ totalPublic: number;
313
323
  totalFare: number;
314
324
  totalTaxes: number;
315
325
  totalAdditional: number;
316
- totalDiscount?: number;
326
+ totalDiscount: number;
317
327
  totalPassengerFees?: number;
328
+ totalDiscountMargin: number;
318
329
  }
319
330
  export interface IReserveDetails {
320
331
  status: string;
@@ -323,6 +334,8 @@ export interface IReserveDetails {
323
334
  priceDetails?: IPriceDetails;
324
335
  reservedUntil: Date | string;
325
336
  extraLocators?: string;
337
+ supplierOrderId?: string;
338
+ refreshedOffer: ISmWcfOffer | ISmAzulOffer | ISmTTravelOffer;
326
339
  }
327
340
  export interface IContactInfo {
328
341
  firstName: string;
@@ -415,7 +428,7 @@ export interface IAvailabilityInfo {
415
428
  selectedPrice: number;
416
429
  isSamePrice: boolean;
417
430
  smWcfOffer: ISmWcfOffer | null;
418
- updatedAirOfferDetails: ISmWcfOffer | ISmAzulOffer;
431
+ updatedAirOfferDetails: ISmWcfOffer | ISmAzulOffer | ISmTTravelOffer;
419
432
  }
420
433
  export interface ISearchData {
421
434
  international: boolean;
@@ -426,6 +439,7 @@ export interface ISearchData {
426
439
  }
427
440
  export interface IReserveCheckInfo {
428
441
  availability: boolean;
442
+ reservedUntil?: Date;
429
443
  currentPrice: number;
430
444
  selectedPrice: number;
431
445
  priceDetails: IPriceDetails;
@@ -448,6 +462,7 @@ declare const RESPONSE_STATUS: {
448
462
  declare const SUPPLIERS: {
449
463
  readonly SKYTEAM: "skyteam";
450
464
  readonly AZUL: "azul";
465
+ readonly TTECH: "tech-travel";
451
466
  };
452
467
  declare const OFFER_STATUS: {
453
468
  readonly ADDED: "added";
@@ -8,6 +8,7 @@ var RESPONSE_STATUS = {
8
8
  var SUPPLIERS = {
9
9
  SKYTEAM: "skyteam",
10
10
  AZUL: "azul",
11
+ TTECH: 'tech-travel'
11
12
  };
12
13
  var OFFER_STATUS = {
13
14
  ADDED: "added",
@@ -757,10 +757,12 @@ export interface IValidationErrorDto {
757
757
  }
758
758
  export interface IPriceDetailsDto {
759
759
  total: number;
760
+ totalPublic: number;
760
761
  totalFare: number;
761
762
  totalTaxes: number;
762
763
  totalAdditional: number;
763
764
  totalDiscount: number;
764
765
  totalPassengerFees?: number;
766
+ totalDiscountMargin: number;
765
767
  }
766
768
  export {};
@@ -0,0 +1,107 @@
1
+ import { ICreditCard } from '../common';
2
+ import { IOfferStatus, IPriceDetails } from '../sm-airlines';
3
+ import * as SharedTypes from './shared';
4
+ export * from './shared';
5
+ export interface ICredentials {
6
+ login: string;
7
+ password: string;
8
+ apiKey: string;
9
+ }
10
+ export interface IRoute {
11
+ date: string;
12
+ departureStation: string;
13
+ arrivalStation: string;
14
+ }
15
+ export interface IPaxInfo {
16
+ adults: number;
17
+ children: number;
18
+ babies: number;
19
+ }
20
+ export interface ISearchConfigurations {
21
+ systems: SharedTypes.ISystemType[];
22
+ onlyTarifsWithLuggage?: boolean;
23
+ onlyDirectFlights?: boolean;
24
+ }
25
+ export interface ISearchData {
26
+ routes: IRoute[];
27
+ paxInfo: IPaxInfo;
28
+ config: ISearchConfigurations;
29
+ }
30
+ export interface IListOffersInfo {
31
+ searchId: string;
32
+ offers: SharedTypes.ISmTTravelOffer[];
33
+ }
34
+ export interface ITarifiedOfferInfo {
35
+ paxType: string;
36
+ priceDetails: IPriceDetails;
37
+ }
38
+ export interface IServiceOrderInfo {
39
+ serviceOrderId: string;
40
+ status: IOfferStatus | string;
41
+ recordLocator: string;
42
+ consultingKey: string;
43
+ createdAt: Date;
44
+ reservedUntil: Date;
45
+ system: SharedTypes.ISystemType;
46
+ }
47
+ export interface ICheckReserveInfo {
48
+ availability: boolean;
49
+ reservedUntil?: Date;
50
+ currentPrice: number;
51
+ selectedPrice: number;
52
+ priceDetails: IPriceDetails | null;
53
+ tariffInfo: SharedTypes.ITariffInfo | null;
54
+ }
55
+ export interface IGetEmissionDataInfo {
56
+ cardBrands: ICardBrandItem[];
57
+ allowCreditCardPayment: boolean;
58
+ total: number;
59
+ }
60
+ export interface ICardBrandItem {
61
+ code: string;
62
+ brandName: string;
63
+ }
64
+ export interface IGetInstallmentsArgs {
65
+ creditCard: ICreditCard;
66
+ creditCardBrandCode: string;
67
+ system: SharedTypes.ISystemType;
68
+ total: number;
69
+ }
70
+ export interface IGetInstallmentsInfo {
71
+ installmentOptions: IInstallmentOption[];
72
+ }
73
+ export interface IInstallmentOption {
74
+ installments: number;
75
+ firstInstallmentValue: number;
76
+ otherInstallmentsValue: number;
77
+ total: number;
78
+ totalInterest: number;
79
+ }
80
+ export interface IEmitOfferArgs {
81
+ serviceOrderInfo: IServiceOrderInfo;
82
+ creditCard: ICreditCard;
83
+ creditCardBrandCode: string;
84
+ installments: number;
85
+ }
86
+ export interface IEmitOfferInfo {
87
+ isEmitted: boolean;
88
+ bookingCode: string;
89
+ recordLocator: string;
90
+ price: number;
91
+ tariffInfo: SharedTypes.ITariffInfo | null;
92
+ authorizationCode: string;
93
+ emittedAt: Date;
94
+ }
95
+ export interface ICancelReserveArgs {
96
+ serviceOrderInfo: IServiceOrderInfo;
97
+ }
98
+ export interface ICancelReserveInfo {
99
+ canceled: boolean;
100
+ }
101
+ export interface ICancelTicketArgs {
102
+ bookingCode: string;
103
+ serviceOrderInfo: IServiceOrderInfo;
104
+ }
105
+ export interface ICancelTicketInfo {
106
+ canceled: boolean;
107
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./shared"), exports);
@@ -0,0 +1,92 @@
1
+ export declare const SystemType: {
2
+ readonly LATAM: "LATAM";
3
+ readonly GOL: "GOL";
4
+ readonly GOLGWS: "GOLGWS";
5
+ readonly AZUL: "AZUL";
6
+ readonly PASSAREDO: "PASSAREDO";
7
+ readonly SABRE: "SABRE";
8
+ };
9
+ export declare const JourneyType: {
10
+ readonly INBOUND: "inbound";
11
+ readonly OUTBOUND: "outbound";
12
+ };
13
+ export declare const PaymentMethodType: {
14
+ readonly InCash: "À Vista";
15
+ readonly CustomerCard: "Cartão Cliente";
16
+ readonly CreditCard: "Cartão de Crédito";
17
+ readonly TravelerCard: "Cartão Viajante";
18
+ };
19
+ declare type ValueOf<T> = T[keyof T];
20
+ export declare type ISystemType = ValueOf<typeof SystemType>;
21
+ export declare type IJourneyType = ValueOf<typeof JourneyType>;
22
+ export declare type IPaymentMethodType = ValueOf<typeof PaymentMethodType>;
23
+ export interface ISmTTravelOffer {
24
+ searchId: string;
25
+ ttravelOfferId: number;
26
+ outboundJourney: IRawJourney;
27
+ inboundJourney?: IRawJourney;
28
+ }
29
+ export interface IRawJourney {
30
+ journeyId: number;
31
+ segments: IRawSegment[];
32
+ journeyType: IJourneyType;
33
+ segmentsCount: number;
34
+ totalDuration: string;
35
+ baseTotal: number;
36
+ baseTarif: number;
37
+ company: string;
38
+ departureHour: string;
39
+ arrivalHour: string;
40
+ departureDate: string;
41
+ arrivalDate: string;
42
+ diffArrivalDate: boolean;
43
+ fare?: IFareFamily;
44
+ filterTotalDuration: string;
45
+ }
46
+ export interface IRawSegment {
47
+ segmentId: number;
48
+ journeyId: number;
49
+ route: string;
50
+ originAirport: string;
51
+ destinationAirport: string;
52
+ stops: string;
53
+ departureHour: string;
54
+ arrivalHour: string;
55
+ departureDate: string;
56
+ arrivalDate: string;
57
+ connection: string;
58
+ system: ISystemType;
59
+ carrier: string;
60
+ company: string;
61
+ flightNumber: string;
62
+ duration: string;
63
+ flightType: string;
64
+ fareFamilies: IFareFamily[];
65
+ }
66
+ export interface IFareFamily {
67
+ fareId: number;
68
+ class: string;
69
+ availableCount: number;
70
+ fareBasis: string;
71
+ farePrice: string;
72
+ boardingFee: string;
73
+ duFee: string;
74
+ totalPrice: string;
75
+ fareClassName: string;
76
+ baggageCount: number;
77
+ discountCode: string;
78
+ netValue: string;
79
+ }
80
+ export interface IBaggageInfo {
81
+ baggagePieces?: number;
82
+ baggageWeight?: number;
83
+ }
84
+ export interface ITariffInfo {
85
+ farePrice: number;
86
+ boardingFee: number;
87
+ serviceFee: number;
88
+ duFee: number;
89
+ totalPrice: number;
90
+ currency: string;
91
+ }
92
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentMethodType = exports.JourneyType = exports.SystemType = void 0;
4
+ exports.SystemType = {
5
+ LATAM: 'LATAM',
6
+ GOL: 'GOL',
7
+ GOLGWS: 'GOLGWS',
8
+ AZUL: 'AZUL',
9
+ PASSAREDO: 'PASSAREDO',
10
+ SABRE: 'SABRE'
11
+ };
12
+ exports.JourneyType = {
13
+ INBOUND: 'inbound',
14
+ OUTBOUND: 'outbound'
15
+ };
16
+ exports.PaymentMethodType = {
17
+ InCash: 'À Vista',
18
+ CustomerCard: 'Cartão Cliente',
19
+ CreditCard: 'Cartão de Crédito',
20
+ TravelerCard: 'Cartão Viajante'
21
+ };
package/sm-wcf/index.d.ts CHANGED
@@ -83,11 +83,13 @@ export interface IWcfFare {
83
83
  }
84
84
  export interface IPriceDetails {
85
85
  total: number;
86
+ totalPublic: number;
86
87
  totalFare: number;
87
88
  totalTaxes: number;
88
89
  totalAdditional: number;
89
- totalDiscount?: number;
90
+ totalDiscount: number;
90
91
  totalPassengerFees?: number;
92
+ totalDiscountMargin: number;
91
93
  }
92
94
  export interface IAirlinesOffer {
93
95
  supplierOfferDetails: IWcfOffer;
@@ -151,6 +153,7 @@ export interface IWcfCheckReserveReqDto {
151
153
  }
152
154
  export interface IWcfCheckReserveResDto {
153
155
  availability: boolean;
156
+ reservedUntil?: Date;
154
157
  currentPrice: number;
155
158
  selectedPrice: number;
156
159
  priceDetails: IPriceDetails;