sm-types 1.0.1

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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ ## sm-types
2
+
3
+ Package containing useful types for sm
@@ -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 ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "sm-types",
3
+ "version": "1.0.1",
4
+ "description": "",
5
+ "scripts": {
6
+ "build": "tsc",
7
+ "prepare": "npm run build",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [],
11
+ "author": "Caio Poyares",
12
+ "license": "ISC",
13
+ "main": "index.js",
14
+ "types": "index.d.ts",
15
+ "files": [
16
+ "/common",
17
+ "/sm-tech",
18
+ "/sm-wcf",
19
+ "/sm-azul",
20
+ "/sm-airlines",
21
+ "/sm-car-rentals"
22
+ ],
23
+ "dependencies": {
24
+ "typescript": "^4.1.3"
25
+ }
26
+ }
@@ -0,0 +1,21 @@
1
+ import { IAddOfferReqDto, IReserveOfferReqDto, IBuyOfferReqDto } from "../dtos";
2
+ export interface IAddOfferCommandParams extends IAddOfferReqDto {
3
+ }
4
+ export interface IRefreshAvailabilityCommandParams {
5
+ offerId: string;
6
+ }
7
+ export interface IBuyOfferCommandParams extends IBuyOfferReqDto {
8
+ offerId: string;
9
+ }
10
+ export interface ICancelOfferCommandParams {
11
+ offerId: string;
12
+ }
13
+ export interface IReserveOfferCommandParams extends IReserveOfferReqDto {
14
+ offerId: string;
15
+ }
16
+ export interface IReplaceOfferCommandParams {
17
+ offerId: string;
18
+ }
19
+ export interface ICheckReserveQueryParams {
20
+ offerId: string;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IListOffersReqDto, } from "./request";
2
+ export { IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, } from "./response";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,30 @@
1
+ import { IPaxInfo, IPassengerInfo, IContactInfo, IRoute, IOrderOptions, ISmWcfOffer } from "../index";
2
+ export interface IListOffersReqDto {
3
+ international: boolean;
4
+ cabinClass: string;
5
+ promoCode: string;
6
+ paxInfo: IPaxInfo;
7
+ routes: IRoute[];
8
+ config: {
9
+ sortType: IOrderOptions;
10
+ groupByRoute: boolean;
11
+ };
12
+ }
13
+ export interface IAddOfferReqDto {
14
+ international: boolean;
15
+ offerDetails: ISmWcfOffer;
16
+ cabinClass: string;
17
+ promoCode: string;
18
+ paxInfo: IPaxInfo;
19
+ routes: IRoute[];
20
+ recordLocator?: string;
21
+ bookingCode?: string;
22
+ }
23
+ export interface IReserveOfferReqDto {
24
+ contactInfo: IContactInfo;
25
+ passengersInfo: IPassengerInfo[];
26
+ }
27
+ export interface IBuyOfferReqDto {
28
+ paymentDataHash: string;
29
+ passengersInfo: IPassengerInfo[];
30
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,54 @@
1
+ import { IListOffersFiltersInfo, ISmAzulOffer, ISmWcfOffer, IPriceDetails, ISuppliers } from "../index";
2
+ export interface IListOffersResDto {
3
+ generalData: IListOffersFiltersInfo;
4
+ offers: ISmWcfOffer[];
5
+ }
6
+ export interface IAddOfferResDto {
7
+ hasPriceChanged: boolean;
8
+ available: boolean;
9
+ verifiedOffer: ISmWcfOffer;
10
+ airlinesOfferId: number;
11
+ }
12
+ export declare type IGetOfferDetailsResDto = ISmAzulOffer | ISmWcfOffer;
13
+ export interface IRefreshAvailabilityResDto {
14
+ availability: boolean;
15
+ currentPrice: number;
16
+ selectedPrice: number;
17
+ isSamePrice: boolean;
18
+ refreshedOffer: ISmWcfOffer;
19
+ stillReserved: boolean;
20
+ }
21
+ export interface IReplaceOfferResDto {
22
+ replacingOffer: ISmWcfOffer;
23
+ newAirlinesOfferId: any;
24
+ }
25
+ export interface IReserveOfferResDto {
26
+ status: string;
27
+ recordLocator: string;
28
+ price: number;
29
+ priceDetails?: IPriceDetails;
30
+ reservedUntil: Date | string;
31
+ extraLocators?: string;
32
+ refreshedOffer: ISmWcfOffer;
33
+ }
34
+ export interface ICheckReserveOfferResDto {
35
+ error?: boolean;
36
+ message?: string;
37
+ availability: boolean;
38
+ currentPrice: number;
39
+ selectedPrice: number;
40
+ priceDetails: IPriceDetails;
41
+ isSamePrice: boolean;
42
+ }
43
+ export interface IBuyOfferResDto {
44
+ recordLocator: string;
45
+ bookingCode: string;
46
+ price: number;
47
+ emittedAt: Date;
48
+ }
49
+ export interface ICancelOfferResDto {
50
+ supplier: ISuppliers;
51
+ recordLocator: string;
52
+ costToCancel?: number;
53
+ refundedValue?: number;
54
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });