sm-types 1.4.4 → 1.5.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/dist/README.md ADDED
@@ -0,0 +1,3 @@
1
+ ## sm-types
2
+
3
+ Package containing useful types for sm
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "sm-types",
3
+ "author": "Smartrips",
4
+ "license": "ISC",
5
+ "keywords": [],
6
+ "version": "1.5.0",
7
+ "description": "",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git@github.com:smartrips-br/sm-types.git"
11
+ },
12
+ "scripts": {
13
+ "prebuild": "rimraf dist",
14
+ "build": "npm run transpile && npm run copy-files",
15
+ "transpile": "tsc",
16
+ "copy-files": "cp ./package.json ./dist/package.json && cp ./README.md ./dist/README.md",
17
+ "prepublishOnly": "npm run build"
18
+ },
19
+ "engines": {
20
+ "node": ">=12.22.0 <=13.0.0",
21
+ "npm": ">=6.13.4",
22
+ "yarn": ">=0.23.4"
23
+ },
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
26
+ "files": [
27
+ "dist/**"
28
+ ],
29
+ "dependencies": {
30
+ "typescript": "^4.1.3"
31
+ },
32
+ "devDependencies": {
33
+ "rimraf": "3.0.2"
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,26 +1,35 @@
1
1
  {
2
2
  "name": "sm-types",
3
- "version": "1.4.4",
3
+ "author": "Smartrips",
4
+ "license": "ISC",
5
+ "keywords": [],
6
+ "version": "1.5.0",
4
7
  "description": "",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git@github.com:smartrips-br/sm-types.git"
11
+ },
5
12
  "scripts": {
6
- "build": "tsc",
7
- "prepare": "npm run build",
8
- "test": "echo \"Error: no test specified\" && exit 1"
13
+ "prebuild": "rimraf dist",
14
+ "build": "npm run transpile && npm run copy-files",
15
+ "transpile": "tsc",
16
+ "copy-files": "cp ./package.json ./dist/package.json && cp ./README.md ./dist/README.md",
17
+ "prepublishOnly": "npm run build"
9
18
  },
10
- "keywords": [],
11
- "author": "Caio Poyares",
12
- "license": "ISC",
13
- "main": "index.js",
14
- "types": "index.d.ts",
19
+ "engines": {
20
+ "node": ">=12.22.0 <=13.0.0",
21
+ "npm": ">=6.13.4",
22
+ "yarn": ">=0.23.4"
23
+ },
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
15
26
  "files": [
16
- "/common",
17
- "/sm-tech",
18
- "/sm-wcf",
19
- "/sm-azul",
20
- "/sm-airlines",
21
- "/sm-car-rentals"
27
+ "dist/**"
22
28
  ],
23
29
  "dependencies": {
24
30
  "typescript": "^4.1.3"
31
+ },
32
+ "devDependencies": {
33
+ "rimraf": "3.0.2"
25
34
  }
26
35
  }
package/common/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import * as SharedTypes from './shared';
2
- export interface IPaymentMethod {
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
- payment_type: SharedTypes.PaymentMethodType;
12
- }
package/common/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
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 const PaymentMethods: {
9
- readonly CreditCard: "credit_card";
10
- readonly Billed: "billed";
11
- };
12
- declare type ValueOf<T> = T[keyof T];
13
- export declare type ICardBrandsType = ValueOf<typeof ICardBrands>;
14
- export declare type PaymentMethodType = ValueOf<typeof PaymentMethods>;
15
- export {};
@@ -1,13 +0,0 @@
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
- };
10
- var PaymentMethods = {
11
- CreditCard: 'credit_card',
12
- Billed: 'billed'
13
- };
@@ -1,29 +0,0 @@
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 IOrderReserveOfferCommandParams extends IReserveOfferReqDto {
17
- offerId: string;
18
- webhookUrl: string;
19
- }
20
- export interface IProcessReserveCommandParams extends IReserveOfferReqDto {
21
- offerId: string;
22
- webhookPath: string;
23
- }
24
- export interface IReplaceOfferCommandParams {
25
- offerId: string;
26
- }
27
- export interface ICheckReserveQueryParams {
28
- offerId: string;
29
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, } from "./request";
2
- export { IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, IGetChargeDetailsResDto } from "./response";
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,37 +0,0 @@
1
- import { IPaxInfo, IPassengerInfo, IContactInfo, IRoute, IOrderOptions, ISmWcfOffer } from "../index";
2
- export interface IListOffersReqDto {
3
- international: boolean;
4
- cabinClass: string;
5
- promoCode: string;
6
- airlinesCode: string;
7
- paxInfo: IPaxInfo;
8
- routes: IRoute[];
9
- config: {
10
- sortType: IOrderOptions;
11
- groupByRoute: boolean;
12
- };
13
- }
14
- export interface IAddOfferReqDto {
15
- international: boolean;
16
- offerDetails: ISmWcfOffer;
17
- cabinClass: string;
18
- promoCode: string;
19
- airlinesCode: string;
20
- paxInfo: IPaxInfo;
21
- routes: IRoute[];
22
- recordLocator?: string;
23
- bookingCode?: string;
24
- }
25
- export interface IReserveOfferReqDto {
26
- contactInfo: IContactInfo;
27
- passengersInfo: IPassengerInfo[];
28
- }
29
- export interface IOrderReserveOfferReqDto {
30
- contactInfo: IContactInfo;
31
- passengersInfo: IPassengerInfo[];
32
- webhookUrl: string;
33
- }
34
- export interface IBuyOfferReqDto {
35
- paymentDataHash: string;
36
- passengersInfo: IPassengerInfo[];
37
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,66 +0,0 @@
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
- reservedUntil?: Date;
16
- currentPrice: number;
17
- selectedPrice: number;
18
- isSamePrice: boolean;
19
- refreshedOffer: ISmWcfOffer;
20
- stillReserved: boolean;
21
- }
22
- export interface IReplaceOfferResDto {
23
- replacingOffer: ISmWcfOffer;
24
- newAirlinesOfferId: any;
25
- }
26
- export interface IReserveOfferResDto {
27
- status: string;
28
- recordLocator: string;
29
- price: number;
30
- priceDetails?: IPriceDetails;
31
- reservedUntil: Date | string;
32
- extraLocators?: string;
33
- refreshedOffer: ISmWcfOffer;
34
- }
35
- export interface IOrderReserveOfferResDto {
36
- message: string;
37
- messageId: string;
38
- }
39
- export interface ICheckReserveOfferResDto {
40
- error?: boolean;
41
- message?: string;
42
- availability: boolean;
43
- reservedUntil?: Date;
44
- currentPrice: number;
45
- selectedPrice: number;
46
- priceDetails: IPriceDetails;
47
- isSamePrice: boolean;
48
- }
49
- export interface IBuyOfferResDto {
50
- recordLocator: string;
51
- bookingCode: string;
52
- price: number;
53
- emittedAt: Date;
54
- }
55
- export interface ICancelOfferResDto {
56
- supplier: ISuppliers;
57
- recordLocator: string;
58
- costToCancel?: number;
59
- refundedValue?: number;
60
- }
61
- export interface IGetChargeDetailsResDto {
62
- client_discount: number;
63
- cia_charge: number;
64
- smartrips_charge: number;
65
- final_price: number;
66
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });