@starfish-codes/hellgate 3.4.0 → 3.5.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.
- package/README.md +1 -1
- package/dist/card/card-handler.d.ts +10 -9
- package/dist/card/typings.d.ts +22 -3
- package/dist/card/ui/iframe/elements/card-number.d.ts +1 -0
- package/dist/card/ui/typings.d.ts +1 -0
- package/dist/card/ui/utils.d.ts +2 -0
- package/dist/hellgate-sdk.mjs +1979 -1619
- package/dist/hellgate-sdk.umd.js +6 -5
- package/dist/hellgate.d.ts +3 -3
- package/dist/session/session.d.ts +7 -2
- package/dist/session/typings.d.ts +3 -3
- package/package.json +3 -3
package/dist/hellgate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hellgate3DSHandler } from './3ds';
|
|
2
|
-
import {
|
|
2
|
+
import { CardHandlerSessionInitState, HellgateCardHandler } from './card';
|
|
3
3
|
import { HellgateSession } from './session';
|
|
4
4
|
interface IDisposable {
|
|
5
5
|
dispose: () => void;
|
|
@@ -22,11 +22,11 @@ export declare class Hellgate<TCardHandler extends IDisposable = HellgateCardHan
|
|
|
22
22
|
dispose: () => void;
|
|
23
23
|
static init(sessionId: string, options?: Partial<HellgateOptions>): Promise<Hellgate<HellgateCardHandler, Hellgate3DSHandler>>;
|
|
24
24
|
protected static initHandlers(sessionId: string, options: Partial<HellgateOptions>): Promise<{
|
|
25
|
-
session: HellgateSession
|
|
25
|
+
session: HellgateSession<import("./session").SessionStateDTO>;
|
|
26
26
|
cardHandler: HellgateCardHandler | undefined;
|
|
27
27
|
handler3DS: Hellgate3DSHandler;
|
|
28
28
|
}>;
|
|
29
|
-
protected static createCardHandler(session: HellgateSession
|
|
29
|
+
protected static createCardHandler(session: HellgateSession<CardHandlerSessionInitState>): Promise<HellgateCardHandler>;
|
|
30
30
|
protected static create3DSHandler(session: HellgateSession, options: Pick<HellgateOptions, 'challenge_3ds_container' | 'challenge_3ds_label_text'>): Hellgate3DSHandler;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { HellgateAPIClient } from './api';
|
|
2
2
|
import { CompleteActionDTO, CompleteActionResult, SessionStateDTO } from './typings';
|
|
3
3
|
export type SessionOnCloseHandler = (result: CompleteActionResult) => void;
|
|
4
|
-
|
|
4
|
+
type SessionStateMap = {
|
|
5
|
+
[K in SessionStateDTO as K['next_action'] extends string ? K['next_action'] : '']: K;
|
|
6
|
+
};
|
|
7
|
+
export declare class HellgateSession<State extends SessionStateDTO = SessionStateDTO> {
|
|
5
8
|
id: string;
|
|
6
9
|
private api;
|
|
7
|
-
state:
|
|
10
|
+
state: State | null;
|
|
8
11
|
private stateChangeHandlers;
|
|
9
12
|
private onCloseHandlers;
|
|
10
13
|
private pollingTimer?;
|
|
@@ -13,9 +16,11 @@ export declare class HellgateSession {
|
|
|
13
16
|
onStateChange: (fn: (state: SessionStateDTO) => void) => () => ((state: SessionStateDTO) => void)[];
|
|
14
17
|
onClose: (fn: SessionOnCloseHandler) => () => void;
|
|
15
18
|
completeAction: (action: CompleteActionDTO) => Promise<CompleteActionResult>;
|
|
19
|
+
isNextAction<T extends State['next_action']>(nextAction: T): this is HellgateSession<SessionStateMap[T extends string ? T : '']>;
|
|
16
20
|
completeSession: (result: CompleteActionResult) => void;
|
|
17
21
|
dispose: () => void;
|
|
18
22
|
private stop;
|
|
19
23
|
private updateSessionState;
|
|
20
24
|
private newStateHandle;
|
|
21
25
|
}
|
|
26
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TokenizeCardActionDTO, TokenizeCardSessionStateDTO } from '../card/typings';
|
|
1
|
+
import { RefreshSecurityCodeActionDTO, RefreshSecurityCodeSessionStateDTO, TokenizeCardActionDTO, TokenizeCardSessionStateDTO } from '../card/typings';
|
|
2
2
|
import { Check3DSActionDTO, Check3DSSessionStateDTO, Do3DSChallengeActionDTO, Do3DSChallengeDecoupledActionDTO, Do3DSChallengeDecoupledSessionStateDTO, Do3DSChallengeSessionStateDTO } from '../3ds/typings';
|
|
3
|
-
export type SessionStateDTO = TokenizeCardSessionStateDTO | Check3DSSessionStateDTO | Do3DSChallengeSessionStateDTO | Do3DSChallengeDecoupledSessionStateDTO | {
|
|
3
|
+
export type SessionStateDTO = TokenizeCardSessionStateDTO | RefreshSecurityCodeSessionStateDTO | Check3DSSessionStateDTO | Do3DSChallengeSessionStateDTO | Do3DSChallengeDecoupledSessionStateDTO | {
|
|
4
4
|
next_action: 'wait';
|
|
5
5
|
data: Record<string, never>;
|
|
6
6
|
} | (CompleteActionResult & {
|
|
7
7
|
next_action: null;
|
|
8
8
|
});
|
|
9
|
-
export type CompleteActionDTO = TokenizeCardActionDTO | Check3DSActionDTO | Do3DSChallengeActionDTO | Do3DSChallengeDecoupledActionDTO;
|
|
9
|
+
export type CompleteActionDTO = TokenizeCardActionDTO | RefreshSecurityCodeActionDTO | Check3DSActionDTO | Do3DSChallengeActionDTO | Do3DSChallengeDecoupledActionDTO;
|
|
10
10
|
export type CompleteActionResult = {
|
|
11
11
|
status: 'success' | 'failure' | 'pending';
|
|
12
12
|
data: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starfish-codes/hellgate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Starfish GmbH & Co. KG",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"mobx": "^6.12.0",
|
|
60
60
|
"mobx-react": "^9.1.0",
|
|
61
61
|
"mobx-react-viewmodel": "^0.2.0",
|
|
62
|
-
"playwright": "^1.
|
|
62
|
+
"playwright": "^1.49.1",
|
|
63
63
|
"postcss": "^8.4.36",
|
|
64
64
|
"postcss-nesting": "^12.1.0",
|
|
65
65
|
"prettier": "^3.2.5",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"tailwindcss": "^3.4.1",
|
|
73
73
|
"tailwindcss-animate": "^1.0.7",
|
|
74
74
|
"typescript": "^5.4.2",
|
|
75
|
-
"vite": "^5.1.
|
|
75
|
+
"vite": "^5.1.8",
|
|
76
76
|
"vite-plugin-checker": "^0.6.4",
|
|
77
77
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
78
78
|
"vite-plugin-top-level-await": "^1.4.1",
|