sm-types 1.5.0 → 1.5.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.
- package/common/index.d.ts +12 -0
- package/common/index.js +2 -0
- package/common/shared/index.d.ts +15 -0
- package/common/shared/index.js +13 -0
- package/errors/index.d.ts +1 -0
- package/errors/index.js +23 -0
- package/errors/user/create-user.d.ts +4 -0
- package/errors/user/create-user.js +7 -0
- package/errors/user/index.d.ts +1 -0
- package/errors/user/index.js +13 -0
- package/package.json +6 -6
- package/sm-airlines/command-params/index.d.ts +29 -0
- package/sm-airlines/command-params/index.js +2 -0
- package/sm-airlines/dtos/index.d.ts +2 -0
- package/sm-airlines/dtos/index.js +2 -0
- package/sm-airlines/dtos/request.d.ts +37 -0
- package/sm-airlines/dtos/request.js +2 -0
- package/sm-airlines/dtos/response.d.ts +66 -0
- package/sm-airlines/dtos/response.js +2 -0
- package/sm-airlines/index.d.ts +580 -0
- package/sm-airlines/index.js +110 -0
- package/sm-azul/index.d.ts +203 -0
- package/sm-azul/index.js +13 -0
- package/sm-azul/shared/index.d.ts +768 -0
- package/sm-azul/shared/index.js +210 -0
- package/sm-car-rentals/index.d.ts +146 -0
- package/sm-car-rentals/index.js +16 -0
- package/sm-car-rentals/localiza/index.d.ts +12 -0
- package/sm-car-rentals/localiza/index.js +2 -0
- package/sm-car-rentals/movida/index.d.ts +11 -0
- package/sm-car-rentals/movida/index.js +2 -0
- package/sm-tech/index.d.ts +116 -0
- package/sm-tech/index.js +13 -0
- package/sm-tech/shared/index.d.ts +105 -0
- package/sm-tech/shared/index.js +30 -0
- package/sm-wcf/index.d.ts +185 -0
- package/sm-wcf/index.js +2 -0
- package/dist/README.md +0 -3
- package/dist/package.json +0 -35
|
@@ -0,0 +1,12 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as UserErrors from './user';
|
package/errors/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.UserErrors = void 0;
|
|
23
|
+
exports.UserErrors = __importStar(require("./user"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateUser = void 0;
|
|
4
|
+
exports.CreateUser = {
|
|
5
|
+
EMAIL_TAKEN_BY_ACTIVE_USER: 'user:create:email_taken_by_active_user',
|
|
6
|
+
EMAIL_TAKEN_BY_INACTIVE_USER: 'user:create:email_taken_by_inactive_user'
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create-user';
|
|
@@ -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("./create-user"), exports);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Smartrips",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"keywords": [],
|
|
6
|
-
"version": "1.5.
|
|
6
|
+
"version": "1.5.2",
|
|
7
7
|
"description": "",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
"prebuild": "rimraf dist",
|
|
14
14
|
"build": "npm run transpile && npm run copy-files",
|
|
15
15
|
"transpile": "tsc",
|
|
16
|
-
"copy-files": "cp ./package.json ./dist
|
|
17
|
-
"
|
|
16
|
+
"copy-files": "cp ./package.json ./dist && cp ./README.md ./dist",
|
|
17
|
+
"publish-package": "npm run build && cd ./dist && npm publish"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=12.22.0 <=13.0.0",
|
|
21
21
|
"npm": ">=6.13.4",
|
|
22
22
|
"yarn": ">=0.23.4"
|
|
23
23
|
},
|
|
24
|
-
"main": "
|
|
25
|
-
"types": "
|
|
24
|
+
"main": "index.js",
|
|
25
|
+
"types": "index.d.ts",
|
|
26
26
|
"files": [
|
|
27
|
-
"
|
|
27
|
+
"*/**"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"typescript": "^4.1.3"
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, } from "./request";
|
|
2
|
+
export { IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, IGetChargeDetailsResDto } from "./response";
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|