@kushki/js 1.23.0 → 1.24.0-alpha.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.
@@ -11,10 +11,10 @@ export interface IAuthService {
11
11
  /**
12
12
  * Get Log in credentials
13
13
  * @param body - required mail from user and name as a optional value
14
- * @param isTestEnvironment
14
+ * @param isTesEnvironment
15
15
  */
16
- requestInitAuth(body: InitAuthRequest, isTestEnvironment: boolean): Observable<InitAuthResponse>;
17
- requestVerifyAuth(code: string, isTestEnvironment: boolean): Observable<VerifyAuthResponse>;
18
- validateSession(isTestEnvironment: boolean): Observable<ValidateSessionResponse>;
16
+ requestInitAuth(body: InitAuthRequest, isTesEnvironment: boolean): Observable<InitAuthResponse>;
17
+ requestVerifyAuth(code: string, isTesEnvironment: boolean): Observable<VerifyAuthResponse>;
18
+ validateSession(isTesEnvironment: boolean): Observable<ValidateSessionResponse>;
19
19
  getAuthorizationToken(): Observable<string>;
20
20
  }
@@ -14,9 +14,9 @@ export declare class AuthService implements IAuthService {
14
14
  private readonly _gateway;
15
15
  private _cognitoUser?;
16
16
  constructor(gateway: IKushkiGateway);
17
- requestInitAuth(body: InitAuthRequest, isTestEnvironment: boolean): Observable<InitAuthResponse>;
18
- requestVerifyAuth(code: string, isTestEnvironment: boolean): Observable<VerifyAuthResponse>;
19
- validateSession(isTestEnvironment: boolean): Observable<ValidateSessionResponse>;
17
+ requestInitAuth(body: InitAuthRequest, isTesEnvironment: boolean): Observable<InitAuthResponse>;
18
+ requestVerifyAuth(code: string, isTesEnvironment: boolean): Observable<VerifyAuthResponse>;
19
+ validateSession(isTesEnvironment: boolean): Observable<ValidateSessionResponse>;
20
20
  getAuthorizationToken(): Observable<string>;
21
21
  private _currentAuthenticatedUser;
22
22
  private _verifyCurrentSession;
@@ -69,28 +69,28 @@ var AuthService = /** @class */ (function () {
69
69
  this._gateway = gateway;
70
70
  }
71
71
  AuthService_1 = AuthService;
72
- AuthService.prototype.requestInitAuth = function (body, isTestEnvironment) {
72
+ AuthService.prototype.requestInitAuth = function (body, isTesEnvironment) {
73
73
  var _this = this;
74
74
  return rxjs_1.of(1).pipe(operators_1.mergeMap(function () {
75
- return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
75
+ return AuthService_1._configureAmplifyCredentials(isTesEnvironment);
76
76
  }), operators_1.mergeMap(function () { return _this._validateCurrentSession(body.email); }), operators_1.mergeMap(function (sessionJwt) {
77
77
  return rxjs_1.iif(function () { return !!sessionJwt; }, rxjs_1.of({ result: true }), _this._handleInitAuth(body.email));
78
78
  }));
79
79
  };
80
- AuthService.prototype.requestVerifyAuth = function (code, isTestEnvironment) {
80
+ AuthService.prototype.requestVerifyAuth = function (code, isTesEnvironment) {
81
81
  var _this = this;
82
82
  return rxjs_1.of(1).pipe(operators_1.concatMap(function () {
83
- return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
83
+ return AuthService_1._configureAmplifyCredentials(isTesEnvironment);
84
84
  }), operators_1.concatMap(function () {
85
85
  return rxjs_1.from(aws_amplify_1.Auth.sendCustomChallengeAnswer(_this._cognitoUser, code));
86
86
  }), operators_1.catchError(function () { return rxjs_1.throwError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E009)); }), operators_1.concatMap(function () { return _this._verifyCurrentSession(); }), operators_1.map(function (session) { return ({
87
87
  authorization: session.getRefreshToken().getToken()
88
88
  }); }));
89
89
  };
90
- AuthService.prototype.validateSession = function (isTestEnvironment) {
90
+ AuthService.prototype.validateSession = function (isTesEnvironment) {
91
91
  var _this = this;
92
92
  return rxjs_1.of(1).pipe(operators_1.concatMap(function () {
93
- return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
93
+ return AuthService_1._configureAmplifyCredentials(isTesEnvironment);
94
94
  }), operators_1.concatMap(function () { return _this._getCurrentUserEmail(); }));
95
95
  };
96
96
  AuthService.prototype.getAuthorizationToken = function () {
@@ -141,7 +141,7 @@ var CardService = /** @class */ (function () {
141
141
  CardService.prototype._getScienceSession = function (request, mid, isTest, merchant) {
142
142
  var _this = this;
143
143
  return rxjs_1.of(1).pipe(operators_1.switchMap(function () {
144
- if (request.card && request.card.number !== undefined)
144
+ if (request.card !== undefined)
145
145
  return _this._antiFraud.createSiftScienceSession(request.card.number.substring(0, 6), request.card.number.slice(-4), mid, isTest, merchant);
146
146
  return rxjs_1.of({
147
147
  sessionId: null,
@@ -32,6 +32,4 @@ export interface CashPaymentDataResponse {
32
32
  email: string;
33
33
  kind: "cash";
34
34
  name: string;
35
- firstName?: string;
36
- lastName?: string;
37
35
  }
@@ -3,11 +3,6 @@
3
3
 
4
4
  export interface SubscriptionTokenKPayRequest {
5
5
  walletId: string;
6
- currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN";
7
- userId?: string;
8
- sessionId?: string;
9
- card?: {
10
- cvc: string;
11
- };
6
+ currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "CRC" | "GTQ" | "HNL" | "NIO";
12
7
  [k: string]: any;
13
8
  }
@@ -10,7 +10,7 @@ export interface SubscriptionTokenRequest {
10
10
  number: string;
11
11
  [k: string]: any;
12
12
  };
13
- currency?: "USD" | "COP" | "PEN" | "CLP" | "UF" | "MXN";
13
+ currency?: "USD" | "COP" | "PEN" | "CLP" | "UF" | "MXN" | "CRC" | "GTQ" | "HNL" | "NIO";
14
14
  savePaymentData?: boolean;
15
15
  [k: string]: any;
16
16
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  export interface TokenKPayRequest {
5
5
  walletId: string;
6
- currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "BRL";
6
+ currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "BRL" | "CRC" | "GTQ" | "HNL" | "NIO";
7
7
  isDeferred?: boolean;
8
8
  amount: number | string;
9
9
  months?: number;
@@ -10,7 +10,7 @@ export interface TokenRequest {
10
10
  number: string;
11
11
  [k: string]: any;
12
12
  };
13
- currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "BRL";
13
+ currency?: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "BRL" | "CRC" | "GTQ" | "HNL" | "NIO";
14
14
  isDeferred?: boolean;
15
15
  amount: number | string;
16
16
  months?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushki/js",
3
- "version": "1.23.0",
3
+ "version": "1.24.0-alpha.1",
4
4
  "description": "kushki-js",
5
5
  "main": "lib/lib.js",
6
6
  "types": "lib/lib.d.ts",
@@ -100,10 +100,16 @@
100
100
  "cardinal-commerce-songbird": "1.0.2",
101
101
  "cardinal-commerce-songbird-staging": "1.0.5",
102
102
  "dot-object": "2.1.4",
103
+ "gulp-typescript": "^5.0.0-alpha.3",
103
104
  "inversify": "5.0.1",
104
105
  "jsonwebtoken": "8.5.1",
106
+ "lodash": "4.17.20",
105
107
  "reflect-metadata": "0.1.13",
106
108
  "rxjs": "6.2.2",
109
+ "snyk": "1.303.1",
110
+ "source-map-support": "0.5.12",
111
+ "ts-mockery": "1.2.0",
112
+ "tsutils": "3.0.0",
107
113
  "uuid": "3.3.2"
108
114
  }
109
115
  }
package/lib/.DS_Store DELETED
Binary file