@xsolla/payment-client-core 0.0.5 → 0.0.7
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/esm2020/lib/core/exceptions-handling/elk/additional-info.interface.mjs +2 -0
- package/esm2020/lib/core/exceptions-handling/elk/elk-logger.service.mjs +120 -0
- package/esm2020/lib/core/exceptions-handling/elk/error-without-meta-fields.interface.mjs +2 -0
- package/esm2020/lib/core/exceptions-handling/elk/log-message.interface.mjs +2 -0
- package/esm2020/lib/core/exceptions-handling/errors/elk-error-types.enum.mjs +13 -0
- package/esm2020/lib/core/exceptions-handling/errors/tagged-error.class.mjs +16 -0
- package/esm2020/lib/core/exceptions-handling/errors/ws-error.class.mjs +10 -0
- package/esm2020/lib/core/payment/actions/action-type-command.map.mjs +2 -1
- package/esm2020/lib/core/payment/actions/check-status/check-status.action.class.mjs +16 -0
- package/esm2020/lib/core/payment/actions/check-status/check-status.action.token.mjs +11 -0
- package/esm2020/lib/core/payment/actions/check-status/check-status.action.type.mjs +1 -1
- package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
- package/esm2020/lib/core/payment/actions/next-action.service.mjs +9 -1
- package/esm2020/lib/core/payment/actions/next-actions.mjs +8 -2
- package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.class.mjs +13 -0
- package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.token.mjs +11 -0
- package/esm2020/lib/core/payment/actions/status-updated/status-updated.action.type.mjs +2 -0
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +13 -7
- package/esm2020/lib/core/payment/status/check-status/check-status.service.mjs +56 -0
- package/esm2020/lib/core/payment/status/check-status/request/check-status-request.class.mjs +16 -0
- package/esm2020/lib/core/payment/status/check-status/request/check-status-request.token.mjs +8 -0
- package/esm2020/lib/core/payment/status/check-status/response/check-status-response.class.mjs +9 -0
- package/esm2020/lib/core/payment/status/check-status/response/check-status-response.token.mjs +8 -0
- package/esm2020/lib/core/payment/status/listen-status/listen-status.service.mjs +112 -0
- package/esm2020/lib/core/payment/status/status-groups.mjs +7 -0
- package/esm2020/lib/core/payment/status/status-params.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/status-request/request/status-request.class.mjs +22 -0
- package/esm2020/lib/core/payment/status/status-request/request/status-request.token.mjs +8 -0
- package/esm2020/lib/core/payment/status/status-request/response/status-response.class.mjs +96 -0
- package/esm2020/lib/core/payment/status/status-request/response/status-response.token.mjs +8 -0
- package/esm2020/lib/core/payment/status/status-request/status-request-params.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/status-request/status-request.service.mjs +68 -0
- package/esm2020/lib/core/payment/status/status-settings.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/status-updated.interface.mjs +2 -0
- package/esm2020/lib/core/payment/status/status.interface.mjs +1 -1
- package/esm2020/lib/core/payment/status/status.service.mjs +38 -0
- package/esm2020/lib/core/payment/status/websocket-status/websocket-status.enum.mjs +6 -0
- package/esm2020/lib/core/payment/status/websocket-status/websocket-status.service.mjs +76 -0
- package/esm2020/lib/core/payment/xps-api-part.abstract.mjs +19 -0
- package/esm2020/lib/core/properties.type.mjs +2 -0
- package/esm2020/lib/core/web-socket/centrifugo-web-socket.service.mjs +200 -0
- package/esm2020/lib/core/web-socket/nchan-web-socket.service.mjs +116 -0
- package/esm2020/lib/core/web-socket/web-socket-client-type.enum.mjs +6 -0
- package/esm2020/lib/core/web-socket/web-socket.factory.mjs +28 -0
- package/esm2020/lib/core/web-socket/web-socket.interface.mjs +2 -0
- package/esm2020/lib/core-library.module.mjs +13 -1
- package/esm2020/lib/core-library.service.mjs +8 -5
- package/fesm2015/xsolla-payment-client-core.mjs +1117 -13
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +1079 -13
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/exceptions-handling/elk/additional-info.interface.d.ts +19 -0
- package/lib/core/exceptions-handling/elk/elk-logger.service.d.ts +27 -0
- package/lib/core/exceptions-handling/elk/error-without-meta-fields.interface.d.ts +8 -0
- package/lib/core/exceptions-handling/elk/log-message.interface.d.ts +8 -0
- package/lib/core/exceptions-handling/errors/elk-error-types.enum.d.ts +11 -0
- package/lib/core/exceptions-handling/errors/tagged-error.class.d.ts +10 -0
- package/lib/core/exceptions-handling/errors/ws-error.class.d.ts +5 -0
- package/lib/core/payment/actions/check-status/check-status.action.class.d.ts +8 -0
- package/lib/core/payment/actions/check-status/check-status.action.token.d.ts +4 -0
- package/lib/core/payment/actions/check-status/check-status.action.type.d.ts +9 -9
- package/lib/core/payment/actions/next-action.interface.d.ts +2 -1
- package/lib/core/payment/actions/next-action.service.d.ts +4 -0
- package/lib/core/payment/actions/status-updated/status-updated.action.class.d.ts +8 -0
- package/lib/core/payment/actions/status-updated/status-updated.action.token.d.ts +4 -0
- package/lib/core/payment/actions/status-updated/status-updated.action.type.d.ts +11 -0
- package/lib/core/payment/payment.interface.d.ts +6 -3
- package/lib/core/payment/payment.service.d.ts +6 -2
- package/lib/core/payment/status/check-status/check-status.service.d.ts +20 -0
- package/lib/core/payment/status/check-status/request/check-status-request.class.d.ts +8 -0
- package/lib/core/payment/status/check-status/request/check-status-request.token.d.ts +6 -0
- package/lib/core/payment/status/check-status/response/check-status-response.class.d.ts +8 -0
- package/lib/core/payment/status/check-status/response/check-status-response.token.d.ts +7 -0
- package/lib/core/payment/status/listen-status/listen-status.service.d.ts +28 -0
- package/lib/core/payment/status/status-groups.d.ts +5 -0
- package/lib/core/payment/status/status-params.interface.d.ts +9 -0
- package/lib/core/payment/status/status-request/request/status-request.class.d.ts +17 -0
- package/lib/core/payment/status/status-request/request/status-request.token.d.ts +6 -0
- package/lib/core/payment/status/status-request/response/status-response.class.d.ts +14 -0
- package/lib/core/payment/status/status-request/response/status-response.token.d.ts +7 -0
- package/lib/core/payment/status/status-request/status-request-params.interface.d.ts +10 -0
- package/lib/core/payment/status/status-request/status-request.service.d.ts +21 -0
- package/lib/core/payment/status/status-settings.interface.d.ts +13 -0
- package/lib/core/payment/status/status-updated.interface.d.ts +6 -0
- package/lib/core/payment/status/status.interface.d.ts +0 -1
- package/lib/core/payment/status/status.service.d.ts +16 -0
- package/lib/core/payment/status/websocket-status/websocket-status.enum.d.ts +4 -0
- package/lib/core/payment/status/websocket-status/websocket-status.service.d.ts +24 -0
- package/lib/core/payment/xps-api-part.abstract.d.ts +8 -0
- package/lib/core/properties.type.d.ts +3 -0
- package/lib/core/web-socket/centrifugo-web-socket.service.d.ts +41 -0
- package/lib/core/web-socket/nchan-web-socket.service.d.ts +30 -0
- package/lib/core/web-socket/web-socket-client-type.enum.d.ts +4 -0
- package/lib/core/web-socket/web-socket.factory.d.ts +13 -0
- package/lib/core/web-socket/web-socket.interface.d.ts +9 -0
- package/lib/core-library.service.d.ts +3 -1
- package/package.json +12 -4
- package/xsolla-payment-client-core-0.0.7.tgz +0 -0
- package/xsolla-payment-client-core-0.0.5.tgz +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AdditionalInfo {
|
|
2
|
+
location: {
|
|
3
|
+
url: string;
|
|
4
|
+
};
|
|
5
|
+
user_agent?: string;
|
|
6
|
+
project: {
|
|
7
|
+
id: number;
|
|
8
|
+
};
|
|
9
|
+
referrer: {
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
viewport: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
cdn_address: string;
|
|
17
|
+
country: string;
|
|
18
|
+
local: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ErrorHandler, NgZone } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { SettingsService } from '../../settings/settings.service';
|
|
4
|
+
import { ExtendedWindow } from '../../extended-window.interface';
|
|
5
|
+
import { ErrorTags } from '../errors/elk-error-types.enum';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ElkLoggerService implements ErrorHandler {
|
|
8
|
+
private readonly window;
|
|
9
|
+
private readonly settingsService;
|
|
10
|
+
private readonly http;
|
|
11
|
+
private readonly ngZone;
|
|
12
|
+
private readonly stackTrace;
|
|
13
|
+
private readonly vendors;
|
|
14
|
+
constructor(window: ExtendedWindow, settingsService: SettingsService, http: HttpClient, ngZone: NgZone);
|
|
15
|
+
handleError(error: Error): void;
|
|
16
|
+
log(message: string, tags: ErrorTags[], extra?: {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}): void;
|
|
19
|
+
private parseError;
|
|
20
|
+
private loadStackTrace;
|
|
21
|
+
private getErrorTrace;
|
|
22
|
+
private getAdditionalInfo;
|
|
23
|
+
private removeErrorMetaFields;
|
|
24
|
+
private sendLog;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElkLoggerService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ElkLoggerService>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdditionalInfo } from './additional-info.interface';
|
|
2
|
+
import { HttpErrorData } from '../http-interceptor/http-error-data.interface';
|
|
3
|
+
export interface ErrorWithoutMetaFields {
|
|
4
|
+
message: string;
|
|
5
|
+
trace: string;
|
|
6
|
+
additionalInfo: AdditionalInfo;
|
|
7
|
+
httpErrorData?: HttpErrorData;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ErrorTags } from './elk-error-types.enum';
|
|
2
|
+
import { AdditionalInfo } from '../elk/additional-info.interface';
|
|
3
|
+
export declare class TaggedError extends Error {
|
|
4
|
+
childTag: ErrorTags;
|
|
5
|
+
trace: string;
|
|
6
|
+
tags: ErrorTags[];
|
|
7
|
+
additionalInfo: AdditionalInfo;
|
|
8
|
+
private readonly parentTag;
|
|
9
|
+
constructor(message: string, tags?: ErrorTags[]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SubmitResponse } from '../../submit/response/submit-response.class';
|
|
2
|
+
import { Action } from '../action.interface';
|
|
3
|
+
import { CheckStatusActionData, CheckStatusActionType } from './check-status.action.type';
|
|
4
|
+
export declare class CheckStatusAction implements Action {
|
|
5
|
+
type: CheckStatusActionType;
|
|
6
|
+
data: CheckStatusActionData;
|
|
7
|
+
constructor(submitResponse: SubmitResponse);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { ActionFactoryValue } from '../action-factory-value.interface';
|
|
3
|
+
export declare const checkStatusActionFactoryToken: InjectionToken<ActionFactoryValue>;
|
|
4
|
+
export declare const checkStatusActionFactoryProvider: ValueProvider;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Action } from '../action.interface';
|
|
2
|
-
type CheckStatusActionType = 'check_status';
|
|
3
|
-
interface CheckStatusActionData {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export type CheckStatusActionType = 'check_status';
|
|
3
|
+
export interface CheckStatusActionData {
|
|
4
|
+
invoice: number;
|
|
5
|
+
signature: string;
|
|
6
|
+
locale: string;
|
|
7
|
+
testProject?: string;
|
|
8
|
+
testPs?: string;
|
|
9
|
+
testXsolla?: string;
|
|
10
|
+
userReturnStatus?: string;
|
|
10
11
|
}
|
|
11
12
|
export type CheckStatusAction = Action<CheckStatusActionType, CheckStatusActionData>;
|
|
12
|
-
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { CheckStatusAction } from './check-status/check-status.action.type';
|
|
2
2
|
import { ShowFieldsAction } from './show-fields/show-fields.action.type';
|
|
3
|
-
|
|
3
|
+
import { StatusUpdatedAction } from './status-updated/status-updated.action.type';
|
|
4
|
+
export type NextAction = CheckStatusAction | ShowFieldsAction | StatusUpdatedAction;
|
|
@@ -2,13 +2,17 @@ import { Injector } from '@angular/core';
|
|
|
2
2
|
import { NextAction } from './next-action.interface';
|
|
3
3
|
import { SubmitResponse } from '../submit/response/submit-response.class';
|
|
4
4
|
import { NextActionTokens } from './next-actions';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class NextActionService {
|
|
7
8
|
private readonly nextActionTokens;
|
|
8
9
|
private readonly injector;
|
|
10
|
+
private readonly flowUpdatesSubject;
|
|
9
11
|
private readonly nextActionsMap;
|
|
12
|
+
get flowUpdates$(): Observable<NextAction>;
|
|
10
13
|
constructor(nextActionTokens: NextActionTokens, injector: Injector);
|
|
11
14
|
getNextAction(submitResponse: SubmitResponse): NextAction | null;
|
|
15
|
+
emitFlowUpdates(action: NextAction): void;
|
|
12
16
|
private fillNextActionsMap;
|
|
13
17
|
private findNextAction;
|
|
14
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<NextActionService, never>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Action } from '../action.interface';
|
|
2
|
+
import { StatusUpdatedActionData, StatusUpdatedActionType } from './status-updated.action.type';
|
|
3
|
+
import { StatusResponse } from '../../status/status-request/response/status-response.class';
|
|
4
|
+
export declare class StatusUpdatedAction implements Action {
|
|
5
|
+
type: StatusUpdatedActionType;
|
|
6
|
+
data: StatusUpdatedActionData;
|
|
7
|
+
constructor(statusResponse: StatusResponse);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { ActionFactoryValue } from '../action-factory-value.interface';
|
|
3
|
+
export declare const statusUpdatedActionFactoryToken: InjectionToken<ActionFactoryValue>;
|
|
4
|
+
export declare const statusUpdatedActionFactoryProvider: ValueProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Action } from '../action.interface';
|
|
2
|
+
import { StatusEnum } from '../../status/status.enum';
|
|
3
|
+
export type StatusUpdatedActionType = 'status_updated';
|
|
4
|
+
export interface StatusUpdatedActionData {
|
|
5
|
+
statusState: StatusEnum;
|
|
6
|
+
group: string;
|
|
7
|
+
isCanceled?: boolean;
|
|
8
|
+
isSuccess?: boolean;
|
|
9
|
+
invoice?: number;
|
|
10
|
+
}
|
|
11
|
+
export type StatusUpdatedAction = Action<StatusUpdatedActionType, StatusUpdatedActionData>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { UntypedFormGroup, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { NextAction } from './actions/next-action.interface';
|
|
3
|
-
import { Field } from './field.interface';
|
|
4
|
-
import { FinanceDetails } from './finance-details.interface';
|
|
5
4
|
import { Status } from './status/status.interface';
|
|
5
|
+
import { StatusParams } from './status/status-params.interface';
|
|
6
|
+
import { FinanceDetails } from './finance-details.interface';
|
|
7
|
+
import { Field } from './field.interface';
|
|
6
8
|
export interface Payment {
|
|
7
9
|
initialize(): Promise<Field[]>;
|
|
8
10
|
submit(fields: Field[], form: UntypedFormGroup): Promise<NextAction | null>;
|
|
@@ -10,6 +12,7 @@ export interface Payment {
|
|
|
10
12
|
validate(field: Field): Promise<ValidationErrors | null>;
|
|
11
13
|
getFinanceDetails(): FinanceDetails;
|
|
12
14
|
runThreeDs(): NextAction;
|
|
13
|
-
getStatus(): Status
|
|
15
|
+
getStatus(params: StatusParams): Promise<Status>;
|
|
14
16
|
changeFieldValue(name: string, value: string): void;
|
|
17
|
+
flowUpdates$: Observable<NextAction>;
|
|
15
18
|
}
|
|
@@ -8,6 +8,8 @@ import { PaymentConfig } from './payment-config.interface';
|
|
|
8
8
|
import { Status } from './status/status.interface';
|
|
9
9
|
import { SubmitService } from './submit/submit.service';
|
|
10
10
|
import { SyncService } from './sync/sync.service';
|
|
11
|
+
import { StatusService } from './status/status.service';
|
|
12
|
+
import { StatusParams } from './status/status-params.interface';
|
|
11
13
|
import { NextActionService } from './actions/next-action.service';
|
|
12
14
|
import * as i0 from "@angular/core";
|
|
13
15
|
export declare class PaymentService {
|
|
@@ -15,18 +17,20 @@ export declare class PaymentService {
|
|
|
15
17
|
private readonly submitService;
|
|
16
18
|
private readonly syncService;
|
|
17
19
|
private readonly formService;
|
|
20
|
+
private readonly statusService;
|
|
18
21
|
private readonly nextActionService;
|
|
19
22
|
form: UntypedFormGroup | null;
|
|
20
23
|
private data;
|
|
21
24
|
private fields;
|
|
22
|
-
|
|
25
|
+
private config;
|
|
26
|
+
constructor(initializeService: InitializeService, submitService: SubmitService, syncService: SyncService, formService: FormService, statusService: StatusService, nextActionService: NextActionService);
|
|
23
27
|
initialize(config: PaymentConfig): Promise<Field[]>;
|
|
24
28
|
submit(fields: Field[], form: UntypedFormGroup): Promise<NextAction | null>;
|
|
25
29
|
getFields(): Field[];
|
|
26
30
|
validate(field: Field): Promise<ValidationErrors | null>;
|
|
27
31
|
runThreeDs(): NextAction;
|
|
28
32
|
getFinanceDetails(): FinanceDetails;
|
|
29
|
-
getStatus(): Status
|
|
33
|
+
getStatus(params: StatusParams): Promise<Status>;
|
|
30
34
|
changeFieldValue(name: string, value: string): void;
|
|
31
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
|
|
32
36
|
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SecureApiClient } from '../../../http/secure-api/secure-api.service';
|
|
2
|
+
import { SettingsService } from '../../../settings/settings.service';
|
|
3
|
+
import { CheckStatusRequestFactory } from './request/check-status-request.token';
|
|
4
|
+
import { CheckStatusResponseFactory } from './response/check-status-response.token';
|
|
5
|
+
import { XpsApiPart } from '../../xps-api-part.abstract';
|
|
6
|
+
import { CheckStatusResponse } from './response/check-status-response.class';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class CheckStatusService extends XpsApiPart<CheckStatusResponse> {
|
|
9
|
+
private readonly secureApiClient;
|
|
10
|
+
private readonly settingsService;
|
|
11
|
+
private readonly requestFactory;
|
|
12
|
+
private readonly responseFactory;
|
|
13
|
+
private readonly apiRoute;
|
|
14
|
+
private invoice;
|
|
15
|
+
constructor(secureApiClient: SecureApiClient, settingsService: SettingsService, requestFactory: CheckStatusRequestFactory, responseFactory: CheckStatusResponseFactory);
|
|
16
|
+
setRequestParams(invoice: number): void;
|
|
17
|
+
request(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckStatusService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckStatusService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XpsApiPartRequest } from '../../../xps-api-part-request.abstract';
|
|
2
|
+
export declare class CheckStatusRequest extends XpsApiPartRequest {
|
|
3
|
+
readonly access_token: string;
|
|
4
|
+
readonly xps_fix_command = "status";
|
|
5
|
+
readonly invoice: number;
|
|
6
|
+
readonly section = "getstatus";
|
|
7
|
+
constructor(token: string | null, invoice: number);
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { CheckStatusRequest } from './check-status-request.class';
|
|
3
|
+
export type CheckStatusRequestParameters = ConstructorParameters<typeof CheckStatusRequest>;
|
|
4
|
+
export type CheckStatusRequestFactory = (...args: CheckStatusRequestParameters) => CheckStatusRequest;
|
|
5
|
+
export declare const checkStatusRequestFactoryToken: InjectionToken<CheckStatusRequestFactory>;
|
|
6
|
+
export declare const checkStatusRequestFactoryProvider: ValueProvider;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Properties } from '../../../../properties.type';
|
|
2
|
+
import { StatusEnum } from '../../status.enum';
|
|
3
|
+
export declare class CheckStatusResponse {
|
|
4
|
+
readonly status?: StatusEnum;
|
|
5
|
+
readonly final?: boolean;
|
|
6
|
+
readonly isPaymentAccountAttached?: boolean;
|
|
7
|
+
constructor(parameters: Properties<CheckStatusResponse>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { CheckStatusResponse } from './check-status-response.class';
|
|
3
|
+
type ResponseParameters = ConstructorParameters<typeof CheckStatusResponse>;
|
|
4
|
+
export type CheckStatusResponseFactory = (...args: ResponseParameters) => CheckStatusResponse;
|
|
5
|
+
export declare const checkStatusResponseFactoryToken: InjectionToken<CheckStatusResponseFactory>;
|
|
6
|
+
export declare const checkStatusResponseFactoryProvider: ValueProvider;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { StatusRequestService } from '../status-request/status-request.service';
|
|
3
|
+
import { CheckStatusService } from '../check-status/check-status.service';
|
|
4
|
+
import { WebsocketStatusService } from '../websocket-status/websocket-status.service';
|
|
5
|
+
import { StatusSettings } from '../status-settings.interface';
|
|
6
|
+
import { StatusUpdated } from '../status-updated.interface';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class ListenStatusService {
|
|
9
|
+
private readonly statusService;
|
|
10
|
+
private readonly checkStatusService;
|
|
11
|
+
private readonly websocketStatusService;
|
|
12
|
+
isListening: boolean;
|
|
13
|
+
private readonly websocketOpenedSubject;
|
|
14
|
+
private readonly statusUpdatedSubject;
|
|
15
|
+
private readonly statusDoneSubject;
|
|
16
|
+
private destroy$;
|
|
17
|
+
get websocketOpened$(): Observable<StatusSettings>;
|
|
18
|
+
get statusUpdated$(): Observable<StatusUpdated>;
|
|
19
|
+
constructor(statusService: StatusRequestService, checkStatusService: CheckStatusService, websocketStatusService: WebsocketStatusService);
|
|
20
|
+
listen(invoice: number): Observable<StatusSettings>;
|
|
21
|
+
stopListening(): void;
|
|
22
|
+
private subscribeStatusUpdate;
|
|
23
|
+
private subscribeCheckStatusUpdate;
|
|
24
|
+
private subscribeWebsocketEvent;
|
|
25
|
+
private openWebsocket;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListenStatusService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ListenStatusService>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { XpsApiPartRequest } from '../../../xps-api-part-request.abstract';
|
|
2
|
+
import { StatusRequestParams } from '../status-request-params.interface';
|
|
3
|
+
export declare class StatusRequest extends XpsApiPartRequest {
|
|
4
|
+
readonly access_token: string;
|
|
5
|
+
readonly xps_fix_command = "status";
|
|
6
|
+
readonly xps_fix_invoice: number;
|
|
7
|
+
readonly xps_fix_pid: number;
|
|
8
|
+
readonly xps_signature: string;
|
|
9
|
+
readonly xps_locale: string;
|
|
10
|
+
readonly xps_fix_testProject: number | undefined;
|
|
11
|
+
readonly xps_fix_testPs: number | undefined;
|
|
12
|
+
readonly xps_fix_testXsolla: number | undefined;
|
|
13
|
+
readonly xps_fix_userReturnStatus: string | undefined;
|
|
14
|
+
constructor(parameters: {
|
|
15
|
+
token: string | null;
|
|
16
|
+
} & StatusRequestParams);
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { StatusRequest } from './status-request.class';
|
|
3
|
+
export type StatusRequestParameters = ConstructorParameters<typeof StatusRequest>;
|
|
4
|
+
export type StatusRequestFactory = (...args: StatusRequestParameters) => StatusRequest;
|
|
5
|
+
export declare const statusRequestFactoryToken: InjectionToken<StatusRequestFactory>;
|
|
6
|
+
export declare const statusRequestFactoryProvider: ValueProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Status } from '../../status.interface';
|
|
2
|
+
import { XpsResponse, XpsStatus } from '../../../xps-response.interface';
|
|
3
|
+
export declare class StatusResponse {
|
|
4
|
+
readonly status: Status;
|
|
5
|
+
private readonly error?;
|
|
6
|
+
constructor(parameters: {
|
|
7
|
+
status: XpsStatus | null;
|
|
8
|
+
errors: XpsResponse['errors'];
|
|
9
|
+
form?: XpsResponse['form'];
|
|
10
|
+
});
|
|
11
|
+
private getUserReturnStatus;
|
|
12
|
+
private getProjectAmount;
|
|
13
|
+
private getAdditionalBackButton;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { StatusResponse } from './status-response.class';
|
|
3
|
+
type ResponseParameters = ConstructorParameters<typeof StatusResponse>;
|
|
4
|
+
export type StatusResponseFactory = (...args: ResponseParameters) => StatusResponse;
|
|
5
|
+
export declare const statusResponseFactoryToken: InjectionToken<StatusResponseFactory>;
|
|
6
|
+
export declare const statusResponseFactoryProvider: ValueProvider;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SettingsService } from '../../../settings/settings.service';
|
|
2
|
+
import { SecureApiClient } from '../../../http/secure-api/secure-api.service';
|
|
3
|
+
import { XpsApiPart } from '../../xps-api-part.abstract';
|
|
4
|
+
import { StatusRequestFactory } from './request/status-request.token';
|
|
5
|
+
import { StatusResponseFactory } from './response/status-response.token';
|
|
6
|
+
import { StatusRequestParams } from './status-request-params.interface';
|
|
7
|
+
import { StatusResponse } from './response/status-response.class';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class StatusRequestService extends XpsApiPart<StatusResponse> {
|
|
10
|
+
private readonly secureApiClient;
|
|
11
|
+
private readonly settingsService;
|
|
12
|
+
private readonly requestFactory;
|
|
13
|
+
private readonly responseFactory;
|
|
14
|
+
private readonly apiRoute;
|
|
15
|
+
private requestParams;
|
|
16
|
+
constructor(secureApiClient: SecureApiClient, settingsService: SettingsService, requestFactory: StatusRequestFactory, responseFactory: StatusResponseFactory);
|
|
17
|
+
setRequestParams(params: StatusRequestParams): void;
|
|
18
|
+
request(): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusRequestService, never>;
|
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StatusRequestService>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WebSocketClientType } from '../../web-socket/web-socket-client-type.enum';
|
|
2
|
+
import { StatusEnum } from './status.enum';
|
|
3
|
+
import { Status } from './status.interface';
|
|
4
|
+
export interface StatusSettings {
|
|
5
|
+
statusState: StatusEnum;
|
|
6
|
+
isCancelUser: boolean;
|
|
7
|
+
needWebSocket: boolean;
|
|
8
|
+
backUrlSettings: Status['backUrlSettings'];
|
|
9
|
+
autoRedirect?: Status['autoRedirect'];
|
|
10
|
+
webSocketUrl: string;
|
|
11
|
+
webSocketChannelName: string;
|
|
12
|
+
webSocketClientType: WebSocketClientType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StatusRequestService } from './status-request/status-request.service';
|
|
2
|
+
import { StatusRequestParams } from './status-request/status-request-params.interface';
|
|
3
|
+
import { ListenStatusService } from './listen-status/listen-status.service';
|
|
4
|
+
import { Status } from './status.interface';
|
|
5
|
+
import { NextActionService } from '../actions/next-action.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class StatusService {
|
|
8
|
+
private readonly statusRequestService;
|
|
9
|
+
private readonly listenStatusService;
|
|
10
|
+
private readonly nextActionService;
|
|
11
|
+
constructor(statusRequestService: StatusRequestService, listenStatusService: ListenStatusService, nextActionService: NextActionService);
|
|
12
|
+
getStatus(params: StatusRequestParams): Promise<Status>;
|
|
13
|
+
private startWaitingStatusUpdates;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StatusService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { WebSocketFactory } from '../../../web-socket/web-socket.factory';
|
|
3
|
+
import { WebSocketClientType } from '../../../web-socket/web-socket-client-type.enum';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class WebsocketStatusService {
|
|
6
|
+
private readonly webSocketFactory;
|
|
7
|
+
private webSocketSubscription;
|
|
8
|
+
private webSocketReconnectionSubscription;
|
|
9
|
+
private readonly reinsuranceCheckStatus;
|
|
10
|
+
private readonly needCheckStatusSubject;
|
|
11
|
+
private readonly statusChangedSubject;
|
|
12
|
+
private webSocketClient;
|
|
13
|
+
get needCheckStatus$(): Observable<void>;
|
|
14
|
+
get statusChanged$(): Observable<void>;
|
|
15
|
+
constructor(webSocketFactory: WebSocketFactory);
|
|
16
|
+
checkStatusWithWebSocket(webSocketUrl: string, webSocketChannelName: string, webSocketClientType: WebSocketClientType): Promise<void>;
|
|
17
|
+
closeWebSocket(): void;
|
|
18
|
+
startReinsuranceCheckTimeout(): void;
|
|
19
|
+
private clearReinsuranceCheckTimeout;
|
|
20
|
+
private statusProcessing;
|
|
21
|
+
private removeSubscription;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WebsocketStatusService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WebsocketStatusService>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare abstract class XpsApiPart<Response> {
|
|
3
|
+
get response$(): Observable<Response>;
|
|
4
|
+
private readonly response;
|
|
5
|
+
emitResponse(response: Response | null): void;
|
|
6
|
+
get currentValue(): Response | null;
|
|
7
|
+
protected abstract request(...args: any[]): void | Promise<Response | void> | Promise<Response> | Observable<Response>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Observable, Subscription } from 'rxjs';
|
|
2
|
+
import { ElkLoggerService } from '../exceptions-handling/elk/elk-logger.service';
|
|
3
|
+
import { WebSocketClient } from './web-socket.interface';
|
|
4
|
+
import { WebSocketClientType } from './web-socket-client-type.enum';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class CentrifugoWebSocketService implements WebSocketClient {
|
|
7
|
+
private readonly elkLoggerService;
|
|
8
|
+
static readonly reconnectionTimeoutIncrementFactor = 2;
|
|
9
|
+
type: WebSocketClientType;
|
|
10
|
+
private static readonly timeoutsMs;
|
|
11
|
+
private reconnectionTimeoutMs;
|
|
12
|
+
private reconnectionTimerId;
|
|
13
|
+
private readonly openConnectionTimerId;
|
|
14
|
+
private connection;
|
|
15
|
+
private subscription;
|
|
16
|
+
private subscriptionPosition?;
|
|
17
|
+
private isConnectionOpen;
|
|
18
|
+
private isConnecting;
|
|
19
|
+
private url;
|
|
20
|
+
private channel;
|
|
21
|
+
private prevSubscribedChannel?;
|
|
22
|
+
private readonly incomingMessages$;
|
|
23
|
+
private readonly successfulReconnectionEventsProxy$;
|
|
24
|
+
constructor(elkLoggerService: ElkLoggerService);
|
|
25
|
+
open(url: string, channel: string): Promise<void>;
|
|
26
|
+
close(): void;
|
|
27
|
+
get messages$(): Observable<string>;
|
|
28
|
+
subscribeOnSuccessfulReconnection(next?: () => void): Subscription;
|
|
29
|
+
private clearReconnectionTimer;
|
|
30
|
+
private setFirstReconnectionTimeout;
|
|
31
|
+
private incrementReconnectionTimeout;
|
|
32
|
+
private getCentrifugoClient;
|
|
33
|
+
private createConnection;
|
|
34
|
+
private onConnect;
|
|
35
|
+
private onDisconnect;
|
|
36
|
+
private reconnect;
|
|
37
|
+
private waitWhileNotReconnect;
|
|
38
|
+
private getSubscriptionOptions;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CentrifugoWebSocketService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CentrifugoWebSocketService>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Observable, Subscription } from 'rxjs';
|
|
2
|
+
import { WebSocketClient } from './web-socket.interface';
|
|
3
|
+
import { WebSocketClientType } from './web-socket-client-type.enum';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class NchanWebSocketService implements WebSocketClient {
|
|
6
|
+
static readonly reconnectionTimeoutIncrementFactor = 2;
|
|
7
|
+
url: string;
|
|
8
|
+
type: WebSocketClientType;
|
|
9
|
+
private static readonly timeoutsMs;
|
|
10
|
+
private openPromise;
|
|
11
|
+
private reconnectionTimeoutMs;
|
|
12
|
+
private reconnectionTimerId;
|
|
13
|
+
private readonly openConnectionTimerId;
|
|
14
|
+
private connection;
|
|
15
|
+
private readonly incomingMessages$;
|
|
16
|
+
private readonly successfulReconnectionEventsProxy$;
|
|
17
|
+
open(): Promise<unknown>;
|
|
18
|
+
close(): void;
|
|
19
|
+
get messages$(): Observable<string>;
|
|
20
|
+
subscribeOnSuccessfulReconnection(next?: () => void): Subscription;
|
|
21
|
+
private isClosed;
|
|
22
|
+
private clearReconnectionTimer;
|
|
23
|
+
private setFirstReconnectionTimeout;
|
|
24
|
+
private incrementReconnectionTimeout;
|
|
25
|
+
private createConnection;
|
|
26
|
+
private reconnect;
|
|
27
|
+
private waitWhileNotReconnect;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NchanWebSocketService, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NchanWebSocketService>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NchanWebSocketService } from './nchan-web-socket.service';
|
|
2
|
+
import { CentrifugoWebSocketService } from './centrifugo-web-socket.service';
|
|
3
|
+
import { WebSocketClient } from './web-socket.interface';
|
|
4
|
+
import { WebSocketClientType } from './web-socket-client-type.enum';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class WebSocketFactory {
|
|
7
|
+
private readonly nchanWebSocket;
|
|
8
|
+
private readonly centrifugoWebSocket;
|
|
9
|
+
constructor(nchanWebSocket: NchanWebSocketService, centrifugoWebSocket: CentrifugoWebSocketService);
|
|
10
|
+
createWebSocketClient(url: string, clientType: WebSocketClientType): WebSocketClient;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketFactory, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketFactory>;
|
|
13
|
+
}
|