@kushki/js 1.24.0-alpha.1 → 1.24.0-alpha.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/lib/repository/IAuthService.d.ts +4 -4
- package/lib/service/AuthService.d.ts +3 -3
- package/lib/service/AuthService.js +6 -6
- package/lib/service/CardService.js +1 -1
- package/lib/types/payment_data_response.d.ts +2 -0
- package/lib/types/subscription_token_kpay_request.d.ts +5 -0
- package/package.json +1 -7
|
@@ -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
|
|
14
|
+
* @param isTestEnvironment
|
|
15
15
|
*/
|
|
16
|
-
requestInitAuth(body: InitAuthRequest,
|
|
17
|
-
requestVerifyAuth(code: string,
|
|
18
|
-
validateSession(
|
|
16
|
+
requestInitAuth(body: InitAuthRequest, isTestEnvironment: boolean): Observable<InitAuthResponse>;
|
|
17
|
+
requestVerifyAuth(code: string, isTestEnvironment: boolean): Observable<VerifyAuthResponse>;
|
|
18
|
+
validateSession(isTestEnvironment: 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,
|
|
18
|
-
requestVerifyAuth(code: string,
|
|
19
|
-
validateSession(
|
|
17
|
+
requestInitAuth(body: InitAuthRequest, isTestEnvironment: boolean): Observable<InitAuthResponse>;
|
|
18
|
+
requestVerifyAuth(code: string, isTestEnvironment: boolean): Observable<VerifyAuthResponse>;
|
|
19
|
+
validateSession(isTestEnvironment: 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,
|
|
72
|
+
AuthService.prototype.requestInitAuth = function (body, isTestEnvironment) {
|
|
73
73
|
var _this = this;
|
|
74
74
|
return rxjs_1.of(1).pipe(operators_1.mergeMap(function () {
|
|
75
|
-
return AuthService_1._configureAmplifyCredentials(
|
|
75
|
+
return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
|
|
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,
|
|
80
|
+
AuthService.prototype.requestVerifyAuth = function (code, isTestEnvironment) {
|
|
81
81
|
var _this = this;
|
|
82
82
|
return rxjs_1.of(1).pipe(operators_1.concatMap(function () {
|
|
83
|
-
return AuthService_1._configureAmplifyCredentials(
|
|
83
|
+
return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
|
|
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 (
|
|
90
|
+
AuthService.prototype.validateSession = function (isTestEnvironment) {
|
|
91
91
|
var _this = this;
|
|
92
92
|
return rxjs_1.of(1).pipe(operators_1.concatMap(function () {
|
|
93
|
-
return AuthService_1._configureAmplifyCredentials(
|
|
93
|
+
return AuthService_1._configureAmplifyCredentials(isTestEnvironment);
|
|
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 !== undefined)
|
|
144
|
+
if (request.card && request.card.number !== 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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kushki/js",
|
|
3
|
-
"version": "1.24.0-alpha.
|
|
3
|
+
"version": "1.24.0-alpha.2",
|
|
4
4
|
"description": "kushki-js",
|
|
5
5
|
"main": "lib/lib.js",
|
|
6
6
|
"types": "lib/lib.d.ts",
|
|
@@ -100,16 +100,10 @@
|
|
|
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",
|
|
104
103
|
"inversify": "5.0.1",
|
|
105
104
|
"jsonwebtoken": "8.5.1",
|
|
106
|
-
"lodash": "4.17.20",
|
|
107
105
|
"reflect-metadata": "0.1.13",
|
|
108
106
|
"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",
|
|
113
107
|
"uuid": "3.3.2"
|
|
114
108
|
}
|
|
115
109
|
}
|