sm-types 1.9.2 → 1.9.4

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/enums.d.ts CHANGED
@@ -85,6 +85,28 @@ export declare enum OfferStatus {
85
85
  EMITTED = "EMITTED",
86
86
  CANCELED = "CANCELED"
87
87
  }
88
+ export declare enum CredentialTypeEnum {
89
+ AGENCY = "AGENCY",
90
+ GENERAL = "GENERAL",
91
+ CUSTOMER = "CUSTOMER"
92
+ }
93
+ export interface IWcfCredentials {
94
+ login: string;
95
+ password: string;
96
+ securityKey: string;
97
+ developerCredentials?: IWcfDeveloperCredentials;
98
+ url: string;
99
+ }
100
+ export interface ITTravelCredentialItem {
101
+ login: string;
102
+ password: string;
103
+ apiKey: string;
104
+ }
105
+ export interface IWcfDeveloperCredentials {
106
+ token: string;
107
+ binaryData: string;
108
+ encryptionKey: string;
109
+ }
88
110
  export interface ITagStatus {
89
111
  pendingApproval: boolean;
90
112
  negotiated: boolean;
package/common/enums.js CHANGED
@@ -1,107 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BookingConfirmationStatus = exports.OfferStatus = exports.ServiceType = exports.BookingStatus = exports.NavanStatus = exports.BookingFeeStatus = exports.EmailType = exports.IndicationStatus = exports.IndicationRewardStatus = exports.JustificationPolicy = exports.CabinClass = exports.DealOwnerEnum = exports.SuppliersEnum = exports.RentabilityTypeEnum = exports.TravelCustomFieldEnum = void 0;
4
- var TravelCustomFieldEnum;
5
- (function (TravelCustomFieldEnum) {
6
- TravelCustomFieldEnum["TRIP_PURPOSE"] = "TRIP_PURPOSE";
7
- TravelCustomFieldEnum["HOTEL_PURPOSE"] = "HOTEL_PURPOSE";
8
- TravelCustomFieldEnum["FLIGHT_PURPOSE"] = "FLIGHT_PURPOSE";
9
- })(TravelCustomFieldEnum = exports.TravelCustomFieldEnum || (exports.TravelCustomFieldEnum = {}));
10
- var RentabilityTypeEnum;
11
- (function (RentabilityTypeEnum) {
12
- RentabilityTypeEnum["MARK_UP"] = "MARK_UP";
13
- RentabilityTypeEnum["MARGIN"] = "MARGIN";
14
- })(RentabilityTypeEnum = exports.RentabilityTypeEnum || (exports.RentabilityTypeEnum = {}));
15
- var SuppliersEnum;
16
- (function (SuppliersEnum) {
17
- SuppliersEnum["SKYTEAM"] = "skyteam";
18
- SuppliersEnum["AZUL"] = "azul";
19
- SuppliersEnum["TTECH"] = "tech-travel";
20
- })(SuppliersEnum = exports.SuppliersEnum || (exports.SuppliersEnum = {}));
21
- var DealOwnerEnum;
22
- (function (DealOwnerEnum) {
23
- DealOwnerEnum["AGENCY"] = "AGENCY";
24
- DealOwnerEnum["CUSTOMER"] = "CUSTOMER";
25
- DealOwnerEnum["PUBLIC"] = "PUBLIC";
26
- })(DealOwnerEnum = exports.DealOwnerEnum || (exports.DealOwnerEnum = {}));
27
- var CabinClass;
28
- (function (CabinClass) {
29
- CabinClass["ECONOMY"] = "economy";
30
- CabinClass["PREMIUM_ECONOMY"] = "premium_economy";
31
- CabinClass["BUSINESS"] = "business";
32
- CabinClass["FIRST"] = "first";
33
- })(CabinClass = exports.CabinClass || (exports.CabinClass = {}));
34
- var JustificationPolicy;
35
- (function (JustificationPolicy) {
36
- JustificationPolicy["ALWAYS"] = "ALWAYS";
37
- JustificationPolicy["OUTSIDE_POLICY"] = "OUTSIDE_POLICY";
38
- JustificationPolicy["ALWAYS_ON_APPROVAL"] = "ALWAYS_ON_APPROVAL";
39
- JustificationPolicy["OUTSIDE_POLICY_ON_APPROVAL"] = "OUTSIDE_POLICY_ON_APPROVAL";
40
- JustificationPolicy["NEVER"] = "NEVER";
41
- })(JustificationPolicy = exports.JustificationPolicy || (exports.JustificationPolicy = {}));
42
- var IndicationRewardStatus;
43
- (function (IndicationRewardStatus) {
44
- IndicationRewardStatus["UNAVAILABLE"] = "UNAVAILABLE";
45
- IndicationRewardStatus["ALMOST_READY"] = "ALMOST_READY";
46
- IndicationRewardStatus["READY"] = "READY";
47
- IndicationRewardStatus["RESERVED"] = "RESERVED";
48
- IndicationRewardStatus["USED"] = "USED";
49
- IndicationRewardStatus["DROPPED"] = "DROPPED";
50
- })(IndicationRewardStatus = exports.IndicationRewardStatus || (exports.IndicationRewardStatus = {}));
51
- var IndicationStatus;
52
- (function (IndicationStatus) {
53
- IndicationStatus["IN_NEGOTIATION"] = "IN_NEGOTIATION";
54
- IndicationStatus["CONVERTED"] = "CONVERTED";
55
- IndicationStatus["REWARD_REACHED"] = "REWARD_REACHED";
56
- IndicationStatus["NOT_REACHED"] = "NOT_REACHED";
57
- })(IndicationStatus = exports.IndicationStatus || (exports.IndicationStatus = {}));
58
- var EmailType;
59
- (function (EmailType) {
60
- EmailType["INVITE_EVENT"] = "INVITE_EVENT";
61
- EmailType["UPDATE_EVENT"] = "UPDATE_EVENT";
62
- })(EmailType = exports.EmailType || (exports.EmailType = {}));
63
- var BookingFeeStatus;
64
- (function (BookingFeeStatus) {
65
- BookingFeeStatus["NONE"] = "NONE";
66
- BookingFeeStatus["UNITIATED"] = "UNITIATED";
67
- BookingFeeStatus["PENDING"] = "PENDING";
68
- BookingFeeStatus["PAID"] = "PAID";
69
- BookingFeeStatus["FAILED"] = "FAILED";
70
- })(BookingFeeStatus = exports.BookingFeeStatus || (exports.BookingFeeStatus = {}));
71
- var NavanStatus;
72
- (function (NavanStatus) {
73
- NavanStatus["UNITIATED"] = "UNITIATED";
74
- NavanStatus["EXPORTED"] = "EXPORTED";
75
- NavanStatus["FAILED"] = "FAILED";
76
- })(NavanStatus = exports.NavanStatus || (exports.NavanStatus = {}));
77
- var BookingStatus;
78
- (function (BookingStatus) {
79
- BookingStatus["UNITIATED"] = "UNITIATED";
80
- BookingStatus["PENDING"] = "PENDING";
81
- BookingStatus["FAILED"] = "FAILED";
82
- BookingStatus["DROPPED"] = "DROPPED";
83
- BookingStatus["EMITTED"] = "EMITTED";
84
- })(BookingStatus = exports.BookingStatus || (exports.BookingStatus = {}));
85
- var ServiceType;
86
- (function (ServiceType) {
87
- ServiceType["FLIGHT"] = "flight";
88
- ServiceType["HOTEL"] = "hotel";
89
- ServiceType["CAR"] = "car";
90
- ServiceType["BUS"] = "bus";
91
- ServiceType["RIDE"] = "ride";
92
- ServiceType["SMARTRIPS"] = "smartrips";
93
- ServiceType["INSURANCE"] = "insurance";
94
- })(ServiceType = exports.ServiceType || (exports.ServiceType = {}));
95
- var OfferStatus;
96
- (function (OfferStatus) {
97
- OfferStatus["APPROVAL_DECLINED"] = "APPROVAL_DECLINED";
98
- OfferStatus["BOOKING_FAILED"] = "BOOKING_FAILED";
99
- OfferStatus["DRAFT"] = "DRAFT";
100
- OfferStatus["BOOKING_PROCESSING"] = "BOOKING_PROCESSING";
101
- OfferStatus["CANCELING"] = "CANCELING";
102
- OfferStatus["EMITTED"] = "EMITTED";
103
- OfferStatus["CANCELED"] = "CANCELED";
104
- })(OfferStatus = exports.OfferStatus || (exports.OfferStatus = {}));
3
+ exports.BookingConfirmationStatus = exports.CredentialTypeEnum = void 0;
4
+ var CredentialTypeEnum;
5
+ (function (CredentialTypeEnum) {
6
+ CredentialTypeEnum["AGENCY"] = "AGENCY";
7
+ CredentialTypeEnum["GENERAL"] = "GENERAL";
8
+ CredentialTypeEnum["CUSTOMER"] = "CUSTOMER";
9
+ })(CredentialTypeEnum = exports.CredentialTypeEnum || (exports.CredentialTypeEnum = {}));
105
10
  var BookingConfirmationStatus;
106
11
  (function (BookingConfirmationStatus) {
107
12
  BookingConfirmationStatus["CONFIRMED"] = "CONFIRMED";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Smartrips",
4
4
  "license": "ISC",
5
5
  "keywords": [],
6
- "version": "1.9.2",
6
+ "version": "1.9.4",
7
7
  "description": "",
8
8
  "repository": {
9
9
  "type": "git",
@@ -1,2 +1,2 @@
1
- export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, IUpdateOfferDetailsReqDto } from "./request";
2
- export { IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, ICancelPreReserveResDto, IGetChargeDetailsResDto, IUpdateOfferDetialsResDto } from "./response";
1
+ export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, IUpdateOfferDetailsReqDto, ICreateSupplierCredentialReqDto, ICreateCustomerReqDto, IUpdateCustomerReqDto, IGetSupplierCredentialByAgencyReqDto, IGetCustomerCredentialReqDto, IAssocitateCustomerCredentialReqDto } from "./request";
2
+ export { ICreateSupplierCredentialResDto, ICreateCustomerResDto, IUpdateCustomerResDto, IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, ICancelPreReserveResDto, IGetChargeDetailsResDto, IUpdateOfferDetialsResDto, IGetSupplierCredentialResDto, IGetCustomerCredentialResDto, IAssocitateCustomerCredentialResDto } from "./response";
@@ -1,5 +1,6 @@
1
- import { RentabilityTypeEnum, SuppliersEnum } from "../../common";
2
- import { IPaxInfo, IPassengerInfo, IContactInfo, IRoute, IOrderOptions } from "../index";
1
+ import { RentabilityTypeEnum, SuppliersEnum, CredentialTypeEnum } from "../../common";
2
+ import { IAzulCredentials } from "../../sm-azul";
3
+ import { IPaxInfo, IPassengerInfo, IContactInfo, IRoute, IOrderOptions, IWcfCredentials, ITTravelCredentialItem } from "../index";
3
4
  export interface IRentabilityOptions {
4
5
  type: RentabilityTypeEnum;
5
6
  value: number;
@@ -46,3 +47,33 @@ export interface IBuyOfferReqDto {
46
47
  export interface IUpdateOfferDetailsReqDto {
47
48
  supplierOrderId: string;
48
49
  }
50
+ export interface ICreateSupplierCredentialReqDto {
51
+ type: CredentialTypeEnum;
52
+ agencyCode: string;
53
+ supplierCode: string;
54
+ customerCode?: string;
55
+ authData: IWcfCredentials | ITTravelCredentialItem | IAzulCredentials;
56
+ description: string;
57
+ }
58
+ export interface ICreateCustomerReqDto {
59
+ code: string;
60
+ agencyCode: string;
61
+ description: string;
62
+ }
63
+ export interface IUpdateCustomerReqDto {
64
+ code: string;
65
+ agencyCode: string;
66
+ description: string;
67
+ }
68
+ export interface IGetSupplierCredentialByAgencyReqDto {
69
+ agencyCode: string;
70
+ supplierCode?: string;
71
+ }
72
+ export interface IGetCustomerCredentialReqDto {
73
+ customerCode: string;
74
+ supplierCode?: string;
75
+ }
76
+ export interface IAssocitateCustomerCredentialReqDto {
77
+ customerCode: string;
78
+ supplierCredentialId: number;
79
+ }
@@ -1,4 +1,6 @@
1
- import { IListOffersFiltersInfo, ISmAzulOffer, ISmWcfOffer, IPriceDetails, ISuppliers } from "../index";
1
+ import { IListOffersFiltersInfo, ISmAzulOffer, ISmWcfOffer, IPriceDetails, ISuppliers, IWcfCredentials, ITTravelCredentialItem } from "../index";
2
+ import { CredentialTypeEnum } from "../../common";
3
+ import { IAzulCredentials } from "../../sm-azul";
2
4
  export interface IListOffersResDto {
3
5
  generalData: IListOffersFiltersInfo;
4
6
  offers: ISmWcfOffer[];
@@ -80,3 +82,45 @@ export interface IUpdateOfferDetialsResDto {
80
82
  export interface IEquivalentOfferDto {
81
83
  equivalentOffer: ISmWcfOffer;
82
84
  }
85
+ export interface ICreateSupplierCredentialResDto {
86
+ type: CredentialTypeEnum;
87
+ agencyCode: string;
88
+ supplierCode: string;
89
+ customerCode?: string;
90
+ authData: IWcfCredentials | ITTravelCredentialItem | IAzulCredentials;
91
+ description: string;
92
+ }
93
+ export interface ICreateCustomerResDto {
94
+ code: string;
95
+ agencyCode: string;
96
+ description: string;
97
+ }
98
+ export interface IUpdateCustomerResDto {
99
+ code: string;
100
+ agencyCode: string;
101
+ description: string;
102
+ }
103
+ export interface IGetSupplierCredentialResDto {
104
+ id: number;
105
+ type: CredentialTypeEnum;
106
+ agencyCode: string;
107
+ supplierCode: string;
108
+ customerCode?: string;
109
+ authData: IWcfCredentials | ITTravelCredentialItem | IAzulCredentials;
110
+ description: string;
111
+ }
112
+ export interface IGetCustomerCredentialResDto {
113
+ supplierCode?: string;
114
+ credential?: ICredentialRes;
115
+ isConfigured: boolean;
116
+ }
117
+ export interface ICredentialRes {
118
+ id: number;
119
+ authData: IWcfCredentials | ITTravelCredentialItem | IAzulCredentials;
120
+ type: CredentialTypeEnum;
121
+ }
122
+ export interface IAssocitateCustomerCredentialResDto {
123
+ id: number;
124
+ customerCode: string;
125
+ supplierCredentialId: string;
126
+ }
@@ -2,7 +2,7 @@ import { DealOwnerEnum } from "../common";
2
2
  import { IAzulFareDetails, IAzulFareInfo, IAzulOfferJourney } from "../sm-azul";
3
3
  import { ISmTTravelOffer } from "../sm-tech";
4
4
  import { IRentabilityOptions } from "./dtos/request";
5
- export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, ICancelPreReserveResDto, IGetChargeDetailsResDto, IUpdateOfferDetialsResDto, IUpdateOfferDetailsReqDto } from "./dtos";
5
+ export { IAddOfferReqDto, IBuyOfferReqDto, IReserveOfferReqDto, IOrderReserveOfferReqDto, IListOffersReqDto, IListOffersResDto, IAddOfferResDto, IGetOfferDetailsResDto, IRefreshAvailabilityResDto, IReplaceOfferResDto, IReserveOfferResDto, IOrderReserveOfferResDto, ICheckReserveOfferResDto, IBuyOfferResDto, ICancelOfferResDto, ICancelPreReserveResDto, IGetChargeDetailsResDto, IUpdateOfferDetialsResDto, IUpdateOfferDetailsReqDto, ICreateSupplierCredentialReqDto, ICreateCustomerReqDto, IUpdateCustomerReqDto, IGetSupplierCredentialByAgencyReqDto, IGetCustomerCredentialReqDto, IAssocitateCustomerCredentialReqDto, ICreateSupplierCredentialResDto, ICreateCustomerResDto, IUpdateCustomerResDto, IGetSupplierCredentialResDto, IGetCustomerCredentialResDto, IAssocitateCustomerCredentialResDto } from "./dtos";
6
6
  export { IAddOfferCommandParams, IRefreshAvailabilityCommandParams, IBuyOfferCommandParams, ICancelOfferCommandParams, IReserveOfferCommandParams, IOrderReserveOfferCommandParams, IProcessReserveCommandParams, IReplaceOfferCommandParams, ICheckReserveQueryParams, ICancelPreReserveCommandParams } from "./command-params";
7
7
  export interface IWrappedResponse<T> {
8
8
  status: IResponseStatus;
@@ -367,6 +367,23 @@ declare const SEX: {
367
367
  readonly MALE: "M";
368
368
  readonly FEMALE: "F";
369
369
  };
370
+ export interface IWcfDeveloperCredentials {
371
+ token: string;
372
+ binaryData: string;
373
+ encryptionKey: string;
374
+ }
375
+ export interface ITTravelCredentialItem {
376
+ login: string;
377
+ password: string;
378
+ apiKey: string;
379
+ }
380
+ export interface IWcfCredentials {
381
+ login: string;
382
+ password: string;
383
+ securityKey: string;
384
+ developerCredentials?: IWcfDeveloperCredentials;
385
+ url: string;
386
+ }
370
387
  export type IResponseStatus = ValueOf<typeof RESPONSE_STATUS>;
371
388
  export type ISuppliers = ValueOf<typeof SUPPLIERS>;
372
389
  export type IOfferStatus = ValueOf<typeof OFFER_STATUS>;
@@ -30,22 +30,9 @@ export type OfferInfo = {
30
30
  booking_status: BookingStatus;
31
31
  offer_status: OfferStatus;
32
32
  tag_status: ITagStatus;
33
- } & ({
34
- offer: IBusJSON;
35
- type: ServiceType.BUS;
36
- } | {
37
- offer: ICarJSON;
38
- type: ServiceType.CAR;
39
- } | {
40
- offer: IFlightJSON;
41
- type: ServiceType.FLIGHT;
42
- } | {
43
- offer: IHotelJSON;
44
- type: ServiceType.HOTEL;
45
- } | {
46
- offer: IRideJSON;
47
- type: ServiceType.RIDE;
48
- });
33
+ offer: IBusJSON | ICarJSON | IFlightJSON | IHotelJSON | IRideJSON;
34
+ type: ServiceType;
35
+ };
49
36
  export type BasicEventParticipant = {
50
37
  token: string;
51
38
  event_token: string;